src/error/error.c File Reference

#include "util.h"
#include "error.h"
Include dependency graph for error.c:

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

Function Documentation

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   ) 

Definition at line 41 of file error.c.

00042 {
00043     return error_str;
00044 }


Variable Documentation

char* error_str = 0 [static]

Definition at line 8 of file error.c.

int error_str_len [static]

Definition at line 9 of file error.c.

int error_str_maxlen [static]

Definition at line 9 of file error.c.


Generated on Tue Jan 12 13:57:24 2010 for glu-2.2 by  doxygen 1.6.1