00001 /********************************************************************** 00002 * 00003 * Verball Model Storage Library, Common Information Model Library 00004 * for integration of Intelligent Services. 00005 * Copyright (C) 2005 Nikita Vinokurov, Orgway LLC. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; 00010 * version 2.1 of the License. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301 USA 00021 * 00022 * $Id: dump.h,v 1.5 2006/09/18 21:38:29 sbreg Exp $ 00023 **********************************************************************/ 00024 00030 #ifndef _DUMP_H_ 00031 #define _DUMP_H_ 00032 00033 #include <stdio.h> 00034 00042 #define DUMP_MAGIC "Verball dump v." 00043 00044 #define DUMP_MAGIC_LEN 16 00045 00046 #define DUMP_VERSION 0x42302e31 00047 00049 #define DUMP_SECTIONS 20 00050 00051 #define DUMP_COMMENT_LEN 80 00052 00054 #define DUMP_NODE_PREV -4 00055 00057 typedef struct _dump_header DumpHeader; 00058 00060 typedef struct _dump_desc DumpDesc; 00061 00063 typedef enum { 00064 DUMP_STMTS = 48, 00065 DUMP_NHVS = 49, 00066 DUMP_INDEX = 50, 00067 DUMP_LOG = 57 00068 } DumpSection; 00069 00071 typedef enum { 00072 DUMP_WRITE, /* ready for write */ 00073 DUMP_READ, /* reading dump */ 00074 DUMP_SECTION, /* writing of section in progress */ 00075 DUMP_ERROR /* reading was stopped on error */ 00076 } DumpStatus; 00077 00082 DumpDesc *dump_write(char *path); 00083 00090 DumpDesc *dump_read(char *path); 00091 00095 int dump_begin_section(DumpDesc *d, DumpSection type); 00096 00098 FILE *dump_stream(DumpDesc *d); 00099 00103 int dump_end_section(DumpDesc *d); 00104 00108 FILE *dump_goto(DumpDesc *d, DumpSection sec); 00109 00113 FILE *dump_log_end(DumpDesc *d); 00114 00116 int dump_close(DumpDesc *d); 00117 00118 #endif /* _DUMP_H_ */ 00119