Skyld AV  0.6
On access virus scanning for Linux
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
conf.c File Reference

Analyze configuration file. More...

#include <stdio.h>
#include <string.h>
#include "conf.h"
Include dependency graph for conf.c:

Go to the source code of this file.

Functions

static void skipComment (FILE *file)
 Skips comment. More...
 
static void getToken (FILE *file, char *token, int *newline)
 Gets token. More...
 
int parseConfigurationFile (char *filename, conf_cb cb, void *info)
 Parses configuration file. If cb is NULL the key value pairs are output to the console. Returns 0 if successful. More...
 

Detailed Description

Analyze configuration file.

Each assignement line must have a key and a value separated by an equal sign.

key = value

Comments start with a number sign.

This is a comment.

Multiple values on a line must be separated by comma.

key = value1, value2

Alternatively multiple lines may be used.

key = value1
key = value2

Use backslashs to escape ' ', ',', '#' and '\'.

key = value\ with\ spaces

Lines may be empty.

Definition in file conf.c.

Function Documentation

static void getToken ( FILE *  file,
char *  token,
int *  newline 
)
static

Gets token.

Parameters
filefile
tokentoken

Definition at line 62 of file conf.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int parseConfigurationFile ( char *  filename,
conf_cb  cb,
void *  info 
)

Parses configuration file. If cb is NULL the key value pairs are output to the console. Returns 0 if successful.

Parameters
filenamefile name
cbcallback function
infoparameter passed to callback function
Returns
success

Definition at line 123 of file conf.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void skipComment ( FILE *  file)
static

Skips comment.

Parameters
filefile

Definition at line 47 of file conf.c.

Here is the caller graph for this function: