Back to index

im-sdk  12.3.91
Defines | Enumerations | Functions
config-reader.h File Reference

Go to the source code of this file.

Defines

#define Bool   Boolean

Enumerations

enum  Boolean {
  True = 1, False = 0, True = 1, False = 0,
  True = 1, False = 0, True = 1, False = 0,
  True = 1, False = 0
}

Functions

Bool get_configuration (const char *fname, int *ret_noptions, KOLE_config ***options)

Define Documentation

#define Bool   Boolean

Definition at line 29 of file config-reader.h.


Enumeration Type Documentation

enum Boolean
Enumerator:
True 
False 
True 
False 
True 
False 
True 
False 
True 
False 

Definition at line 26 of file config-reader.h.

             {
  True=1, False=0
} Boolean;

Function Documentation

Bool get_configuration ( const char *  fname,
int *  ret_noptions,
KOLE_config ***  options 
)

Definition at line 35 of file config-reader.c.

{
  FILE *fp;
  char *line;
  KOLE_config *pconf;
  
  /* read file */
  assert (fname != NULL);
  if (!fname){
    /* TO DO: log error */
    return False;
  }

  assert (ret_noptions != NULL);
  if (!ret_noptions){
    /* TO DO: log error */
    return False;
  }
  
  fp = fopen (fname, "r");

  if (!fp)
    return False;
  *ret_noptions = 0;
  *options = NULL;
  while ((line = (char *)safe_getline (fp))){
    if (parse_line (line, &pconf)){
      *options =
       (KOLE_config **) realloc (*options, sizeof (KOLE_config *) * *ret_noptions);
      (*options)[*ret_noptions] = pconf;
      (*ret_noptions)++;
    } else
      continue;
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function: