/********************************************************************** * * char * * G_program_name() * * returns the current program name * ********************************************************************** * * G_set_program_name(name) * char *name * * program name set to name (name will be returned by G_program_name * **********************************************************************/ #include #include static const char *name = "?" ; /*! * \brief return module name * * Routine returns the name * of the module as set by the call to G_gisinit. * * \param ~ * \return char * */ const char *G_program_name(void) { return name; } int G_set_program_name(const char *s) { int i; i = strlen (s); while (--i >= 0) { if (s[i] == '/') { s += i+1; break; } } name = G_store (s); return 0; }