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

htcfg.h File Reference

#include "common.h"
#include "stream.h"

Go to the source code of this file.

Defines

#define SYSTEM_CONFIG_FILE_NAME   ".htcfg"
#define ht_systemconfig_magic   "HTCP"
#define ht_systemconfig_fileversion   5
#define ht_fileconfig_magic   "HTCF"
#define ht_fileconfig_fileversion   3
#define ht_projectconfig_magic   "HTPR"
#define ht_projectconfig_fileversion   1

Typedefs

typedef int(* load_fcfg_func )(ht_object_stream *f, void *context)
typedef void(* store_fcfg_func )(ht_object_stream *f, void *context)

Enumerations

enum  loadstore_result {
  LS_OK, LS_ERROR_NOT_FOUND, LS_ERROR_READ, LS_ERROR_WRITE,
  LS_ERROR_MAGIC, LS_ERROR_VERSION, LS_ERROR_FORMAT, LS_ERROR_CORRUPTED
}

Functions

loadstore_result save_systemconfig ()
bool load_systemconfig (loadstore_result *result, int *error_info)
loadstore_result save_fileconfig (char *fileconfig_file, const char *magic, UINT version, store_fcfg_func store_func, void *context)
loadstore_result load_fileconfig (char *fileconfig_file, const char *magic, UINT version, load_fcfg_func load_func, void *context, int *error_info)
bool init_cfg ()
void done_cfg ()

Variables

char * systemconfig_file


Define Documentation

#define ht_fileconfig_fileversion   3
 

Definition at line 63 of file htcfg.h.

Referenced by ht_app::create_window_file_bin(), and ht_file_window::handlemsg().

#define ht_fileconfig_magic   "HTCF"
 

Definition at line 62 of file htcfg.h.

Referenced by ht_app::create_window_file_bin(), and ht_file_window::handlemsg().

#define ht_projectconfig_fileversion   1
 

Definition at line 72 of file htcfg.h.

Referenced by ht_app::handlemsg(), and ht_app::project_opencreate().

#define ht_projectconfig_magic   "HTPR"
 

Definition at line 71 of file htcfg.h.

Referenced by ht_app::handlemsg(), and ht_app::project_opencreate().

#define ht_systemconfig_fileversion   5
 

Definition at line 52 of file htcfg.h.

Referenced by load_systemconfig(), main(), and save_systemconfig().

#define ht_systemconfig_magic   "HTCP"
 

Definition at line 51 of file htcfg.h.

Referenced by load_systemconfig(), and save_systemconfig().

#define SYSTEM_CONFIG_FILE_NAME   ".htcfg"
 

Definition at line 30 of file htcfg.h.

Referenced by init_cfg(), and main().


Typedef Documentation

typedef int(* load_fcfg_func)(ht_object_stream *f, void *context)
 

Definition at line 82 of file htcfg.h.

Referenced by load_fileconfig().

typedef void(* store_fcfg_func)(ht_object_stream *f, void *context)
 

Definition at line 83 of file htcfg.h.

Referenced by save_fileconfig().


Enumeration Type Documentation

enum loadstore_result
 

Enumeration values:
LS_OK 
LS_ERROR_NOT_FOUND 
LS_ERROR_READ 
LS_ERROR_WRITE 
LS_ERROR_MAGIC 
LS_ERROR_VERSION 
LS_ERROR_FORMAT 
LS_ERROR_CORRUPTED 

Definition at line 33 of file htcfg.h.

Referenced by ht_app::create_window_file_bin(), load_fileconfig(), main(), ht_app::project_opencreate(), save_fileconfig(), and save_systemconfig().


Function Documentation

void done_cfg  ) 
 

Definition at line 371 of file htcfg.cc.

References systemconfig_file.

bool init_cfg  ) 
 

Definition at line 347 of file htcfg.cc.

References appname, malloc(), sys_dirname(), SYSTEM_CONFIG_FILE_NAME, and systemconfig_file.

loadstore_result load_fileconfig char *  fileconfig_file,
const char *  magic,
UINT  version,
load_fcfg_func  load_func,
void *  context,
int *  error_info
 

Definition at line 273 of file htcfg.cc.

References create_object_stream(), ht_object_stream::done(), ht_file::done(), FAM_READ, FOM_EXISTS, ht_layer_stream::get_error(), ht_stream::get_error(), hexb_ex(), hexw_ex(), ht_file::init(), load_fcfg_func, loadstore_result, LS_ERROR_CORRUPTED, LS_ERROR_FORMAT, LS_ERROR_MAGIC, LS_ERROR_NOT_FOUND, LS_ERROR_READ, LS_ERROR_VERSION, LS_OK, object_stream_txt, ht_stdio_file::read(), STERR_SYSTEM, UINT, uint16, and uint8.

Referenced by ht_app::create_window_file_bin(), and ht_app::project_opencreate().

bool load_systemconfig loadstore_result result,
int *  error_info
 

Definition at line 139 of file htcfg.cc.

References app, create_object_stream(), ht_object_stream::done(), ht_file::done(), FAM_READ, FOM_EXISTS, ht_layer_stream::get_error(), ht_stream::get_error(), hexb_ex(), hexw_ex(), ht_systemconfig_fileversion, ht_systemconfig_magic, ht_file::init(), ht_view::load(), LS_ERROR_CORRUPTED, LS_ERROR_FORMAT, LS_ERROR_MAGIC, LS_ERROR_NOT_FOUND, LS_ERROR_READ, LS_ERROR_VERSION, LS_OK, object_stream_txt, ht_stdio_file::read(), STERR_SYSTEM, systemconfig_file, uint16, and uint8.

Referenced by main().

loadstore_result save_fileconfig char *  fileconfig_file,
const char *  magic,
UINT  version,
store_fcfg_func  store_func,
void *  context
 

Definition at line 224 of file htcfg.cc.

References create_object_stream(), ht_object_stream::done(), ht_file::done(), FAM_WRITE, FOM_CREATE, get_config_dword(), ht_stream::get_error(), ht_file::init(), loadstore_result, LS_ERROR_WRITE, LS_OK, object_stream_bin, object_stream_txt, store_fcfg_func, UINT, and ht_stdio_file::write().

Referenced by ht_file_window::handlemsg(), and ht_app::handlemsg().

loadstore_result save_systemconfig  ) 
 

Definition at line 89 of file htcfg.cc.

References app, create_object_stream(), ht_object_stream::done(), ht_file::done(), FAM_WRITE, FOM_CREATE, get_config_dword(), ht_layer_stream::get_error(), ht_stream::get_error(), ht_systemconfig_fileversion, ht_systemconfig_magic, ht_file::init(), loadstore_result, LS_ERROR_WRITE, LS_OK, object_stream_bin, object_stream_txt, ht_view::store(), systemconfig_file, and ht_stdio_file::write().

Referenced by main().


Variable Documentation

char* systemconfig_file
 

Definition at line 78 of file htcfg.h.

Referenced by done_cfg(), init_cfg(), load_systemconfig(), main(), and save_systemconfig().


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