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