Main Page | Data Structures | File List | Data Fields | Globals

iparser.h File Reference

#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "cuf-global.h"
#include "llist.h"
#include "mimeproc.h"
#include "strings.h"
#include "win32lacks.h"

Go to the source code of this file.

Data Structures

struct  _IOption
struct  _IOpts

Typedefs

typedef enum _IOptType IOptType
typedef _IOption IOption
typedef _IOpts IOpts

Enumerations

enum  _IOptType {
  IBool,
  IChar,
  IInt,
  ILong,
  IFloat,
  IDouble,
  IString,
  IDString,
  IFuncVoid,
  IFuncBool,
  IFuncChar,
  IFuncInt,
  IFuncLong,
  IFuncFloat,
  IFuncDouble,
  IFuncString,
  IFuncDString,
  IFuncWVoid,
  IFuncWBool,
  IFuncWChar,
  IFuncWInt,
  IFuncWLong,
  IFuncWFloat,
  IFuncWDouble,
  IFuncWString,
  IFuncWDString
}

Functions

IOptsioption_init (void)
void ioption_add (IOpts *opts, char *sw, IOptType iot, void *var)
void ioption_allowfrees_set (IOpts *opts, int allowfrees)
int ioption_parse (IOpts *opts, char *filename)
int ioption_write (IOpts *opts, char *filename)
void ioption_done (IOpts *opts)


Detailed Description

INI file type parser v0.2

Typedef Documentation

typedef struct _IOption IOption
 

Description:
Option member, only to be modifyed internaly.

typedef struct _IOpts IOpts
 

Description:
Options list, only to be modifyed internaly.

typedef enum _IOptType IOptType
 

Description:
An Option Type.


Enumeration Type Documentation

enum _IOptType
 

Description:
An Option Type.
Enumeration values:
IBool  Variable is of type int.
IChar  Variable is of type char.
IInt  Variable is of type int.
ILong  Variable is of type long.
IFloat  Variable is of type float.
IDouble  Variable is of type double.
IString  Variable is of type char *.
IDString  Variable is of type DString.
IFuncVoid  Variable is of type FuncVoid.
IFuncBool  Variable is of type FuncBool.
IFuncChar  Variable is of type FuncChar.
IFuncInt  Variable is of type FuncInt.
IFuncLong  Variable is of type FuncLong.
IFuncFloat  Variable is of type FuncFloat.
IFuncDouble  Variable is of type FuncDouble.
IFuncString  Variable is of type FuncString.
IFuncDString  Variable is of type FuncDString.
IFuncWVoid  Variable is of type FuncWVoid.
IFuncWBool  Variable is of type FuncWBool.
IFuncWChar  Variable is of type FuncWChar.
IFuncWInt  Variable is of type FuncWInt.
IFuncWLong  Variable is of type FuncWLong.
IFuncWFloat  Variable is of type FuncWFloat.
IFuncWDouble  Variable is of type FuncWDouble.
IFuncWString  Variable is of type FuncWString.
IFuncWDString  Variable is of type FuncWDString.


Function Documentation

void ioption_add IOpts opts,
char *  sw,
IOptType  iot,
void *  var
 

Parameters:
opts The options list to append to.
sw The word to search for.
iot The data type.
var The variable to be modified.
Description:
Adds a new search word to a list of options to search for.

void ioption_allowfrees_set IOpts opts,
int  allowfrees
 

Parameters:
opts The options list to modify.
allowfrees To allow frees internally or not.
Description:
Allows internal freeing of strings and DStrings. Could cause problems if parent program is using memory wrapping code.

void ioption_done IOpts opts  ) 
 

Parameters:
opts The options list to free.
Description:
Frees a list of options (an IOpts struct).

IOpts* ioption_init void   ) 
 

Return values:
#IOpts * The newly allocated IOpts.
NULL when out of memory.
Description:
Allocates a new link list for options to be added to.

int ioption_parse IOpts opts,
char *  filename
 

Parameters:
opts The options list to use during parsing.
filename The name of the file to parse.
Return values:
#TRUE on success.
#FALSE if file not found or a required argument is missing.
Description:
Parses a file searching for the options in the supplied list.

int ioption_write IOpts opts,
char *  filename
 

Parameters:
opts The options list to be used for writing.
filename The name of the file to write to.
Return values:
#TRUE on success.
#FALSE if file could not be opened or a required argument is missing. Saves the data present in a list of options to a specific file.
Note:
Currently the file specified will be overwritten.


Generated on Fri Jun 4 18:35:19 2004 for cuf by doxygen 1.3.6