1 #ifdef HAVE_CONFIG_H 2 #include "config.h" 3 #endif 4 #include <string.h> 5 6 extern char *__progname; 7 8 const char * 9 getprogname(void) 10 { 11 return __progname; 12 } 13 14 void 15 setprogname(char *p) 16 { 17 char *q; 18 if (p == NULL) 19 return; 20 if ((q = strrchr(p, '/')) != NULL) 21 __progname = ++q; 22 else 23 __progname = p; 24 } 25