mdcore  0.1.5
Functions | Variables
/home/pedro/work/mdcore/src/errs.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "errs.h"

Functions

void errs_clear ()
 Re-set the error stack.
int errs_dump (FILE *out)
 Print the error stack out to the given FILE pointer.
int errs_register (int id, const char *msg, int line, const char *func, char *file)
 Dump an error onto the stack.

Variables

int errs_err = errs_err_ok
const char * errs_err_msg []
struct {
   int   id
   int   line
   const char *   msg
   const char *   func
   const char *   file
errs_stack [errs_maxstack]
int errs_count = 0

Function Documentation

void errs_clear ( )

Re-set the error stack.

int errs_dump ( FILE *  out)

Print the error stack out to the given FILE pointer.

Parameters:
outA pointer to a FILE structure.
Returns:
errs_err_ok or < 0 on failure.
int errs_register ( int  id,
const char *  msg,
int  line,
const char *  func,
char *  file 
)

Dump an error onto the stack.

Parameters:
idAn error identifier that will be returned.
msgA pointer to a string containing a descriptive error message.
lineThe line on which the error occured.
funcThe name of the function in which the error occured.
fileThe name of the file in which the error occured.
Returns:
The value of id.

Variable Documentation

int errs_count = 0
const char* errs_err_msg[]
Initial value:
 {
    "All is well.",
    "An IO-error has occurred." }
struct { ... } errs_stack[ errs_maxstack ]
const char * file
const char * func
int id
int line
const char* msg
 All Data Structures Files Functions Variables Typedefs Enumerator Defines