Re: Multipurpose binaries with different names

2009-07-29 Thread Tor Lillqvist
#ifdef _WIN32  executable_name = strrchr (argv[0], '\\'); Bzzt. You have to use the multi-byte character set aware _mbschr() and _mbsrchr() functions from mbchar.h to search for backlashes (or slashes) in narrow (char *) system code page strings (for instance, file names) on Windows. The East

Re: Multipurpose binaries with different names

2009-07-28 Thread Paolo Bonzini
On 07/24/2009 11:25 AM, Jan Engelhardt wrote: Hi, when one has a program that does something like if(strcmp(argv[0], gunzip) == 0) uncompress(); else compress(); and this program also uses a libtool library, then the - lets use this example - just-built gzip file will be

Multipurpose binaries with different names

2009-07-24 Thread Jan Engelhardt
Hi, when one has a program that does something like if(strcmp(argv[0], gunzip) == 0) uncompress(); else compress(); and this program also uses a libtool library, then the - lets use this example - just-built gzip file will be around 4 kilobytes only, it is a libtool wrapper

Re: Multipurpose binaries with different names

2009-07-24 Thread Roumen Petrov
Eric Blake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jan Engelhardt on 7/24/2009 3:25 AM: Hi, when one has a program that does something like if(strcmp(argv[0], gunzip) == 0) uncompress(); else compress(); GNU Coding Standards frown on this practice:

Re: Multipurpose binaries with different names

2009-07-24 Thread Jan Engelhardt
On Friday 2009-07-24 13:56, Eric Blake wrote: when one has a program that does something like if(strcmp(argv[0], gunzip) == 0) uncompress(); else compress(); GNU Coding Standards frown on this practice: http://www.gnu.org/software/automake/manual/standards.html#User-Interfaces

Re: Multipurpose binaries with different names

2009-07-24 Thread Bob Friesenhahn
On Fri, 24 Jul 2009, Jan Engelhardt wrote: The reason to do symlinking is that some programs are large enough to warrant not compiling them again or have a double copy of it on the filesystem. The presence of /usr/bin/dir in system I would consider a waste of space, even if it's just 100K. Do