progrm_nme.c

Go to the documentation of this file.
00001 /**********************************************************************
00002  *
00003  *   char *
00004  *   G_program_name()
00005  *
00006  *   returns the current program name
00007  *
00008  **********************************************************************
00009  *
00010  *   G_set_program_name(name)
00011  *        char *name 
00012  *
00013  *   program name set to name (name will be returned by G_program_name
00014  *
00015  **********************************************************************/
00016 #include <string.h>
00017 #include <grass/gis.h>
00018 
00019 static const char *name = "?" ;
00020 
00021 
00032 const char *G_program_name(void)
00033 {
00034     return name;
00035 }
00036 
00037 int G_set_program_name(const char *s)
00038 {
00039     int i;
00040 
00041     i = strlen (s);
00042     while (--i >= 0)
00043     {
00044         if (s[i] == '/')
00045         {
00046             s += i+1;
00047             break;
00048         }
00049     }
00050     name = G_store (s);
00051 
00052     return 0;
00053 }

Generated on Wed Dec 19 14:59:06 2007 for GRASS by  doxygen 1.5.4