git-svn-id: svn://svn.cc65.org/cc65/trunk@2098 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-04-28 20:23:45 +00:00
parent e4a6273056
commit 459cfb06c1
10 changed files with 321 additions and 52 deletions

View File

@@ -38,6 +38,11 @@
/* common */
#include "coll.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
@@ -50,7 +55,7 @@ struct CfgData {
CfgDataInvalid,
CfgDataId,
CfgDataNumber,
CfgDataString
CfgDataString
} Type; /* Type of the value */
union {
char* SVal; /* String or id value */
@@ -63,6 +68,45 @@ struct CfgData {
/*****************************************************************************/
/* Code */
/*****************************************************************************/
CfgData* NewCfgData (void);
/* Create and intialize a new CfgData struct, then return it. The function
* uses the current output of the config scanner.
*/
void FreeCfgData (CfgData* D);
/* Free a config data structure */
int CfgDataFind (Collection* Attributes, const char* AttrName);
/* Find the attribute with the given name and return its index. Return -1 if
* the attribute was not found.
*/
int CfgDataGetId (Collection* Attributes, const char* Name, char** Id);
/* Search CfgInfo for an attribute with the given name and type "id". If
* found, remove it from the configuration, copy it into Buf and return
* true. If not found, return false.
*/
int CfgDataGetStr (Collection* Attributes, const char* Name, char** S);
/* Search CfgInfo for an attribute with the given name and type "string".
* If found, remove it from the configuration, copy it into Buf and return
* true. If not found, return false.
*/
int CfgDataGetNum (Collection* Attributes, const char* Name, long* Val);
/* Search CfgInfo for an attribute with the given name and type "number".
* If found, remove it from the configuration, copy it into Val and return
* true. If not found, return false.
*/
/* End of cfgdata.h */
#endif