Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

htcfg.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      htcfg.h
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef __HTCFG_H__
00022 #define __HTCFG_H__
00023 
00024 #include "common.h"
00025 #include "stream.h"
00026 
00027 #if defined(WIN32) || defined(__WIN32__) || defined(MSDOS) || defined(DJGPP)
00028 #define SYSTEM_CONFIG_FILE_NAME "ht.cfg"
00029 #else
00030 #define SYSTEM_CONFIG_FILE_NAME ".htcfg"
00031 #endif
00032 
00033 enum loadstore_result {
00034         LS_OK,
00035         LS_ERROR_NOT_FOUND,
00036         LS_ERROR_READ,
00037         LS_ERROR_WRITE,
00038         LS_ERROR_MAGIC,
00039         LS_ERROR_VERSION,             // sets error_info to version
00040         LS_ERROR_FORMAT,
00041         LS_ERROR_CORRUPTED
00042 };
00043 
00044 /*      SYSTEM CONFIG FILE VERSION HISTORY
00045  *      Version 2: HT 0.4.4
00046  *      Version 3: HT 0.4.5
00047  *      Version 4: HT 0.5.0
00048  *      Version 5: HT 0.6.0
00049  */
00050 
00051 #define ht_systemconfig_magic                           "HTCP"
00052 #define ht_systemconfig_fileversion             5
00053 
00054 
00055 
00056 /*      FILE CONFIG FILE VERSION HISTORY
00057  *      Version 1: HT 0.5.0
00058  *      Version 2: HT 0.6.0
00059  *      Version 3: HT 0.7.0
00060  */
00061 
00062 #define ht_fileconfig_magic                             "HTCF"
00063 #define ht_fileconfig_fileversion                       3
00064 
00065 
00066 
00067 /*      PROJECT CONFIG FILE VERSION HISTORY
00068  *      Version 1: HT 0.7.0
00069  */
00070 
00071 #define ht_projectconfig_magic                  "HTPR"
00072 #define ht_projectconfig_fileversion            1
00073 
00074 
00075 
00076 
00077 
00078 extern char *systemconfig_file;
00079 loadstore_result save_systemconfig();
00080 bool load_systemconfig(loadstore_result *result, int *error_info);
00081 
00082 typedef int (*load_fcfg_func)(ht_object_stream *f, void *context);
00083 typedef void (*store_fcfg_func)(ht_object_stream *f, void *context);
00084 
00085 loadstore_result save_fileconfig(char *fileconfig_file, const char *magic, UINT version, store_fcfg_func store_func, void *context);
00086 loadstore_result load_fileconfig(char *fileconfig_file, const char *magic, UINT version, load_fcfg_func load_func, void *context, int *error_info);
00087 
00088 /*
00089  *      INIT
00090  */
00091 
00092 bool init_cfg();
00093 
00094 /*
00095  *      DONE
00096  */
00097 
00098 void done_cfg();
00099 
00100 #endif /* !__HTCFG_H__ */
00101 

Generated on Fri May 7 21:15:31 2004 by doxygen 1.3.5