ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/error.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/error.c (file contents):
Revision 1.7 by tdb, Wed Apr 7 21:08:40 2004 UTC vs.
Revision 1.8 by ats, Wed Apr 7 21:19:26 2004 UTC

# Line 30 | Line 30
30   #include "statgrab.h"
31  
32   static sg_error error = SG_ERROR_NONE;
33 + #define ERROR_ARG_MAX 256
34 + static char error_arg[ERROR_ARG_MAX];
35  
36   void sg_set_error(sg_error code, const char *arg) {
37          error = code;
38 <        /* FIXME do something with arg */
38 >        strlcpy(error_arg, arg, sizeof error_arg);
39   }
40  
41   sg_error sg_get_error() {
42          return error;
43   }
44  
45 + const char *sg_get_error_arg() {
46 +        return error_arg;
47 + }
48 +
49   const char *sg_str_error(sg_error code) {
50          switch (code) {
51          case SG_ERROR_NONE:
# Line 102 | Line 108 | const char *sg_str_error(sg_error code) {
108                  return "unsupported function";
109          case SG_ERROR_XSW_VER_MISMATCH:
110                  return "XSW version mismatch";
105        default:
106                return "unknown error";
111          }
112 +        return "unknown error";
113   }
114  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines