done_msg.c

Go to the documentation of this file.
00001 #include <unistd.h>
00002 #include "gis.h"
00003 #include "glocale.h"
00004 #include <string.h>
00005 
00006 int G_done_msg(char *msg)
00007 {
00008         char *me;
00009         FILE *out;
00010 
00011 #ifdef __MINGW32__
00012         static char *user = "mingw_user_name";
00013 #else
00014         char *user = getlogin();
00015 #endif
00016         if (user == NULL)
00017                 return 1;
00018         me = G_whoami();
00019         if (me == NULL)
00020                 return 1;
00021         if (strcmp(me,user) != 0)
00022                 return 1;
00023         if (isatty(1))
00024                 out = stdout;
00025         else if (isatty(2))
00026                 out = stderr;
00027         else
00028                 return 1;
00029         fprintf (out, _("%s complete. %s\n"), G_program_name(), msg);
00030 
00031         return 0;
00032 }

Generated on Mon Jan 1 19:49:25 2007 for GRASS by  doxygen 1.5.1