Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dump.h File Reference

Dump interface. More...

#include <stdio.h>

Include dependency graph for dump.h:

Go to the source code of this file.

Defines

#define DUMP_COMMENT_LEN   80
 Maximum lenght of comments in section header.
#define DUMP_MAGIC   "Verball dump v."
 Magic of section.
#define DUMP_MAGIC_LEN   16
 Lenght of magic.
#define DUMP_NODE_PREV   -4
 Flag for nodes not changed from previous dumped statement.
#define DUMP_SECTIONS   20
 Maximum number of sections in dump.
#define DUMP_VERSION   0x42302e31
 Version of dump.

Typedefs

typedef _dump_desc DumpDesc
 Descriptor of dump file.
typedef _dump_header DumpHeader
 Header of section.

Enumerations

enum  DumpSection { DUMP_STMTS = 48, DUMP_NHVS = 49, DUMP_INDEX = 50, DUMP_LOG = 57 }
 Type of section. More...
enum  DumpStatus { DUMP_WRITE, DUMP_READ, DUMP_SECTION, DUMP_ERROR }
 Status of descriptor. More...

Functions

int dump_begin_section (DumpDesc *d, DumpSection type)
 Writes to dump section header.
int dump_close (DumpDesc *d)
 Close and free Descriptor.
int dump_end_section (DumpDesc *d)
 Fills section header.
FILE * dump_goto (DumpDesc *d, DumpSection sec)
 Seek to some section.
FILE * dump_log_end (DumpDesc *d)
 Seek to the end of dump file.
DumpDescdump_read (char *path)
 Reads dump file and inits Descriptor.
FILE * dump_stream (DumpDesc *d)
 Get FILE* pointer from Descriptor.
DumpDescdump_write (char *path)
 Creates dump file and inits Descriptor.


Detailed Description

Dump interface.

This file define interface to read and write dump file, and its sections. Sections headers are human-readable for now (Ver. 'A').


Define Documentation

#define DUMP_COMMENT_LEN   80
 

Maximum lenght of comments in section header.

#define DUMP_MAGIC   "Verball dump v."
 

Magic of section.

#define DUMP_MAGIC_LEN   16
 

Lenght of magic.

#define DUMP_NODE_PREV   -4
 

Flag for nodes not changed from previous dumped statement.

#define DUMP_SECTIONS   20
 

Maximum number of sections in dump.

#define DUMP_VERSION   0x42302e31
 

Version of dump.


Typedef Documentation

typedef struct _dump_desc DumpDesc
 

Descriptor of dump file.

typedef struct _dump_header DumpHeader
 

Header of section.


Enumeration Type Documentation

enum DumpSection
 

Type of section.

Enumerator:
DUMP_STMTS 
DUMP_NHVS 
DUMP_INDEX 
DUMP_LOG 

enum DumpStatus
 

Status of descriptor.

Enumerator:
DUMP_WRITE 
DUMP_READ 
DUMP_SECTION 
DUMP_ERROR 


Function Documentation

int dump_begin_section DumpDesc d,
DumpSection  type
 

Writes to dump section header.

Returns:
zero if no error.

int dump_close DumpDesc d  ) 
 

Close and free Descriptor.

int dump_end_section DumpDesc d  ) 
 

Fills section header.

Fills len field of section header.

FILE* dump_goto DumpDesc d,
DumpSection  sec
 

Seek to some section.

Returns:
FILE* pointer from Descriptor, or NULL when no such section

FILE* dump_log_end DumpDesc d  ) 
 

Seek to the end of dump file.

Returns:
FILE* pointer, ready for appending log.

DumpDesc* dump_read char *  path  ) 
 

Reads dump file and inits Descriptor.

This function checks file headers.

Returns:
a pointer to allocated Dump Descriptor. It has to be deleted with dump_close() function.

NULL, if no one section was read.

FILE* dump_stream DumpDesc d  ) 
 

Get FILE* pointer from Descriptor.

DumpDesc* dump_write char *  path  ) 
 

Creates dump file and inits Descriptor.

Returns:
a pointer to allocated Dump Descriptor. It has to be deleted with dump_close() function.


Generated on Wed Dec 27 16:52:18 2006 for VRB Online Server by  doxygen 1.4.4