Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

debug.c File Reference

#include "define.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <inttypes.h>

Include dependency graph for debug.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  pst_debug_item
struct  pst_debug_func

Defines

#define MAX_MESSAGE_SIZE   4096
#define NUM_COL   30

Functions

void pst_debug_write_msg (struct pst_debug_item *item, const char *fmt, va_list *ap, int size)
void pst_debug_write_hex (struct pst_debug_item *item, char *buf, size_t size, int col)
void * xmalloc (size_t size)
size_t pst_debug_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream)
void pst_debug (const char *fmt,...)
void pst_debug_hexdumper (FILE *out, char *buf, size_t size, int col, int delta)
void pst_debug_init (const char *fname)
void pst_debug_msg_info (int line, const char *file, int type)
void pst_debug_msg_text (const char *fmt,...)
void pst_debug_hexdump (char *x, size_t y, int cols, int delta)
void pst_debug_func (const char *function)
void pst_debug_func_ret ()
void pst_debug_close (void)
void pst_debug_write ()

Variables

pst_debug_itemitem_head
pst_debug_funcfunc_head
FILE * debug_fp = NULL
unsigned int max_items = 0 curr_items=0


Define Documentation

#define MAX_MESSAGE_SIZE   4096
 

Definition at line 41 of file debug.c.

#define NUM_COL   30
 

Definition at line 51 of file debug.c.


Function Documentation

void pst_debug const char *  fmt,
  ...
 

Definition at line 43 of file debug.c.

void pst_debug_close void   ) 
 

Definition at line 246 of file debug.c.

References debug_fp, func_head, pst_debug_func::next, and pst_debug_write().

Referenced by pst_debug_init().

Here is the call graph for this function:

void pst_debug_func const char *  function  ) 
 

Definition at line 224 of file debug.c.

References func_head, pst_debug_item::next, and xmalloc().

Here is the call graph for this function:

void pst_debug_func_ret  ) 
 

Definition at line 233 of file debug.c.

References DIE, func_head, and pst_debug_func::next.

size_t pst_debug_fwrite const void *  ptr,
size_t  size,
size_t  nitems,
FILE *  stream
 

Definition at line 33 of file debug.c.

Referenced by pst_debug_init(), pst_debug_write(), pst_debug_write_hex(), and pst_debug_write_msg().

void pst_debug_hexdump char *  x,
size_t  y,
int  cols,
int  delta
 

Definition at line 208 of file debug.c.

References pst_debug_item::next, pst_debug_write(), and pst_debug_write_hex().

Here is the call graph for this function:

void pst_debug_hexdumper FILE *  out,
char *  buf,
size_t  size,
int  col,
int  delta
 

Definition at line 52 of file debug.c.

Referenced by main(), and pst_debug_write_hex().

void pst_debug_init const char *  fname  ) 
 

Definition at line 91 of file debug.c.

References debug_fp, item_head, pst_debug_close(), pst_debug_fwrite(), and version().

Here is the call graph for this function:

void pst_debug_msg_info int  line,
const char *  file,
int  type
 

Definition at line 107 of file debug.c.

References pst_debug_item::file, func_head, pst_debug_item::function, pst_debug_item::line, pst_debug_func::name, pst_debug_item::next, pst_debug_item::type, and xmalloc().

Here is the call graph for this function:

void pst_debug_msg_text const char *  fmt,
  ...
 

Definition at line 126 of file debug.c.

References item_head, pst_debug_item::next, pst_debug_write(), pst_debug_write_msg(), pst_debug_item::text, and xmalloc().

Here is the call graph for this function:

void pst_debug_write  ) 
 

Definition at line 259 of file debug.c.

References debug_fp, pst_debug_file_rec_l::end, pst_debug_file_rec_m::end, pst_debug_file_rec_l::filename, pst_debug_file_rec_m::filename, pst_debug_file_rec_l::funcname, pst_debug_file_rec_m::funcname, item_head, pst_debug_file_rec_l::line, pst_debug_file_rec_m::line, pst_debug_item::next, pst_debug_fwrite(), pst_debug_file_rec_l::text, pst_debug_file_rec_m::text, pst_debug_file_rec_l::type, pst_debug_file_rec_m::type, and xmalloc().

Referenced by pst_debug_close(), pst_debug_hexdump(), and pst_debug_msg_text().

Here is the call graph for this function:

void pst_debug_write_hex struct pst_debug_item item,
char *  buf,
size_t  size,
int  col
 

Definition at line 406 of file debug.c.

References debug_fp, pst_debug_file_rec_l::end, pst_debug_item::file, pst_debug_file_rec_l::filename, pst_debug_file_rec_l::funcname, pst_debug_item::function, pst_debug_item::line, pst_debug_file_rec_l::line, pst_debug_fwrite(), pst_debug_hexdumper(), pst_debug_file_rec_l::text, pst_debug_item::type, and pst_debug_file_rec_l::type.

Referenced by pst_debug_hexdump().

Here is the call graph for this function:

void pst_debug_write_msg struct pst_debug_item item,
const char *  fmt,
va_list *  ap,
int  size
 

Definition at line 343 of file debug.c.

References debug_fp, pst_debug_file_rec_m::end, pst_debug_file_rec_l::end, pst_debug_item::file, pst_debug_file_rec_m::filename, pst_debug_file_rec_l::filename, pst_debug_file_rec_m::funcname, pst_debug_file_rec_l::funcname, pst_debug_item::function, pst_debug_file_rec_m::line, pst_debug_item::line, pst_debug_file_rec_l::line, pst_debug_fwrite(), pst_debug_file_rec_m::text, pst_debug_file_rec_l::text, pst_debug_file_rec_m::type, pst_debug_item::type, and pst_debug_file_rec_l::type.

Referenced by pst_debug_msg_text().

Here is the call graph for this function:

void * xmalloc size_t  size  ) 
 

Definition at line 448 of file debug.c.


Variable Documentation

FILE* debug_fp = NULL
 

Definition at line 87 of file debug.c.

Referenced by pst_debug_close(), pst_debug_init(), pst_debug_write(), pst_debug_write_hex(), and pst_debug_write_msg().

struct pst_debug_func * func_head
 

Referenced by pst_debug_close(), pst_debug_func(), pst_debug_func_ret(), and pst_debug_msg_info().

struct pst_debug_item * item_head
 

Referenced by pst_debug_init(), pst_debug_msg_text(), and pst_debug_write().

unsigned int max_items = 0 curr_items=0
 

Definition at line 88 of file debug.c.


Generated on Thu Dec 11 11:58:51 2008 for 'LibPst' by  doxygen 1.3.9.1