home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / kpathsea / progname.c < prev    next >
C/C++ Source or Header  |  1996-09-28  |  1KB  |  44 lines

  1. /* progname.c: the executable name we were invoked as; general initialization.
  2.  
  3. Copyright (C) 1994 Karl Berry.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #include <kpathsea/config.h>
  20.  
  21. #include <kpathsea/progname.h>
  22.  
  23.  
  24. #ifndef HAVE_PROGRAM_INVOCATION_NAME
  25. /* Don't redefine the variables if glibc already has.  */
  26. string program_invocation_name;
  27. string program_invocation_short_name;
  28. #endif
  29.  
  30.  
  31. void
  32. kpse_set_progname P1C(const_string, progname)
  33. {
  34. #ifndef HAVE_PROGRAM_INVOCATION_NAME
  35.   program_invocation_name = xstrdup (progname);
  36.   program_invocation_short_name = (string) basename (program_invocation_name);
  37. #endif
  38.   {
  39.     string s = getenv ("KPATHSEA_DEBUG");
  40.     if (s) 
  41.      kpathsea_debug |= atoi (s);
  42.   }
  43. }
  44.