#include "util.h"
#include "error.h"
Go to the source code of this file.
Functions | |
void | error_init (void) |
void | error_append (char *s) |
char * | error_string (void) |
void | error_cleanup (void) |
Variables | |
static char * | error_str = 0 |
static int | error_str_len |
static int | error_str_maxlen |
void error_append | ( | char * | s | ) |
Definition at line 26 of file error.c.
00027 { 00028 int slen; 00029 00030 slen = strlen(s); 00031 if (error_str_len + slen + 1 > error_str_maxlen) { 00032 error_str_maxlen = (error_str_len + slen) * 2; /* cstevens@ic */ 00033 error_str = REALLOC(char, error_str, error_str_maxlen); 00034 } 00035 (void) strcpy(error_str + error_str_len, s); 00036 error_str_len += slen; 00037 }
void error_cleanup | ( | void | ) |
Definition at line 48 of file error.c.
00049 { 00050 FREE(error_str); 00051 error_str_len = 0; 00052 error_str_maxlen = 0; 00053 error_str = 0; 00054 }
void error_init | ( | void | ) |
Definition at line 13 of file error.c.
00014 { 00015 if (error_str != 0) { 00016 FREE(error_str); 00017 } 00018 error_str_len = 0; 00019 error_str_maxlen = 100; 00020 error_str = ALLOC(char, error_str_maxlen); 00021 *error_str = '\0'; 00022 }
char* error_string | ( | void | ) |
int error_str_len [static] |
int error_str_maxlen [static] |