00001 /* 00002 * Copyright (C) 2004-2005 by David J. Hardy. All rights reserved. 00003 */ 00004 00030 #ifndef MDIO_CONFIG_H 00031 #define MDIO_CONFIG_H 00032 00033 #include "adt/list.h" 00034 #include "mdio/file.h" 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00047 typedef struct mdio_ConfigData_t { 00048 const char *keyword; 00049 const char *value; 00050 const char *filename; 00051 int linenum; 00052 } mdio_ConfigData; 00053 00054 00059 typedef struct mdio_Config_t { 00060 mdio_File file; 00061 adt_List configdata; 00062 } mdio_Config; 00063 00064 00065 /* constructor and destructor */ 00066 00073 mdio_Config *mdio_createConfig(void); 00074 00075 00084 void mdio_destroyConfig(mdio_Config *); 00085 00086 00087 /* reading file and obtaining parsed data */ 00088 00102 int mdio_readConfig(mdio_Config *, const char *name); 00103 00104 00112 mdio_ConfigData *mdio_getDataConfig(mdio_Config *, int *len); 00113 00114 00115 /* constructor and destructor for preallocated mdio_Config object */ 00116 00122 int mdio_initializeConfig(mdio_Config *); 00123 00124 00130 void mdio_cleanupConfig(mdio_Config *); 00131 00132 #ifdef __cplusplus 00133 } 00134 #endif 00135 00136 #endif /* MDIO_CONFIG_H */