GRASS Programmer's Manual  6.4.2(2012)
lib/datetime/error.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1995.  Bill Brown <brown@gis.uiuc.edu> & Michael Shapiro
00003  *
00004  * This program is free software under the GPL (>=v2)
00005  * Read the file GPL.TXT coming with GRASS for details.
00006  */
00007 #include <string.h>
00008 
00009 
00010 static int err_code = 0;
00011 static char err_msg[1024];
00012 
00013 
00030 int datetime_error(int code, char *msg)
00031 {
00032     err_code = code;
00033     *err_msg = 0;
00034     if (code != 0 && msg)
00035         strcpy(err_msg, msg);   /* hope err_msg is big enough */
00036 
00037     return code;
00038 }
00039 
00048 int datetime_error_code(void)
00049 {
00050     return err_code;
00051 }
00052 
00061 char *datetime_error_msg(void)
00062 {
00063     return err_msg;
00064 }
00065 
00066 
00075 void datetime_clear_error(void)
00076 {
00077     err_code = 0;
00078     *err_msg = 0;
00079 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines