Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

pdl.h File Reference

General include file. More...

#include <stdio.h>

Include dependency graph for pdl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  plugin_s
 Structure holds a plugin name and its arguments, as well as the line number the plugin is first mentioned. More...

struct  record_s
 Structure is used to keep track of strings and the line they appear on. More...


Defines

#define TRUE   1

Typedefs

typedef struct record_s  record_t
 Structure is used to keep track of strings and the line they appear on. More...

typedef struct plugin_s  plugin_t
 Structure holds a plugin name and its arguments, as well as the line number the plugin is first mentioned. More...


Enumerations

enum  pdl_error_t {
  PDL_UNKNOWN, PDL_INFO, PDL_WARNING, PDL_ERROR,
  PDL_SAME
}
enum  plugin_status_t { EVALUATION_START, EVALUATION_SUCCESS, EVALUATION_FAILURE }

Functions

int pdl_init (const char *name)
const char* pdl_path (void)
int yyparse_errors (void)
int yyerror (const char *)
const char* pdl_next_plugin (plugin_status_t status)
void set_path (record_t *_path)
record_tconcat_strings (record_t *s1, record_t *s2)
const plugin_tget_plugins (void)
void warning (pdl_error_t error, const char *s,...)

Variables

unsigned int lineno = 1
 The first line of a configuration sctipt is labeled 1.


Detailed Description

General include file.

In this include file all general "things" can be found.

Author:
G.M. Venekamp (venekamp@nikhef.nl)
Version:
Revision:
1.10
Date:
Date:
2003/07/15 11:38:06

Definition in file pdl.h.


Define Documentation

#define TRUE   1
 

The evaluation manager defines its own boolean type. It first undefines any existing type defenitions before it defines it itself.

Definition at line 44 of file pdl.h.


Typedef Documentation

typedef struct plugin_s plugin_t
 

Structure holds a plugin name and its arguments, as well as the line number the plugin is first mentioned.

typedef struct record_s record_t
 

Structure is used to keep track of strings and the line they appear on.

When lex finds a match, this structure is used to keep track of the relevant information. The matchig string as well as the line number are saved. The line number can be used for later references when an error related to the symbol has occured. This allows for easier debugging of the configuration file.


Enumeration Type Documentation

enum pdl_error_t
 

Different levels of error logging.

Enumeration values:
PDL_UNKNOWN   Unknown error level.
PDL_INFO   Informational level.
PDL_WARNING   Warning level.
PDL_ERROR   Error level.
PDL_SAME   Repeat the previous level.

Definition at line 52 of file pdl.h.

enum plugin_status_t
 

Guide the selection of the next plugin.

Enumeration values:
EVALUATION_START   The evaluation process has just started.
EVALUATION_SUCCESS   The evaluation of the plugin was successful.
EVALUATION_FAILURE   The evaluation of the plugin was unsuccessfyl.

Definition at line 65 of file pdl.h.


Function Documentation

record_t * concat_strings ( record_t * s1,
record_t * s2 )
 

Concatenate two strings. The orginal two strings are freed. When the concatenation fails, the origial strings are still freed. The actual concatenation is done by _concat_strings().

Parameters:
s1   First string.
s2   Second string
Returns:
Concatenated strings of s1 + s2.

Definition at line 481 of file pdl_main.c.

const plugin_t * get_plugins ( void )
 

Get a list of plugins as known by the configuration file.

Returns:
Plugin list (linked list).

Definition at line 130 of file pdl_main.c.

Referenced by getPluginNameAndArgs().

int pdl_init ( const char * name )
 

Init the pdl engine. The function takes one arguments, the name of a configuration file to use.

Parameters:
name   Name of the configuration file to use.
Returns:
0 in case the initialization is successful; -1 in case of not being successful.

Definition at line 72 of file pdl_main.c.

const char * pdl_next_plugin ( plugin_status_t status )
 

Find the next plugin to evaluate based on the return status of the previous plugin evaluation. There are three statuses, two of which are rather obvious: either the previous evaluation has succeeded (EVALUATION_SUCCESS), or it has failed (EVALUATION_FAILURE). Based on these results, the next plugin should be the true_branch or false_branch respectively. There is one situation where there is no previous evaluation and that is at the very beginning. The very first call to this function should have (EVALUATION_START) as arguments. In this case the current state of the rule is returned as the next plugin to evaluate.

Parameters:
status   Status of previous evaluation.
Returns:
plugin name to be evaluation according to the configuration file.

Definition at line 316 of file pdl_main.c.

const char * pdl_path ( void )
 

Get the path.

Returns:
Path.

Definition at line 394 of file pdl_main.c.

Referenced by getPluginNameAndArgs(), and pdl_next_plugin().

void set_path ( record_t * path )
 

Function is called when the parser has found the value of the reserved path word. This function acts as a wrapper for the _set_path() function.

Parameters:
path  

Definition at line 424 of file pdl_main.c.

void warning ( pdl_error_t error,
const char * s,
... )
 

Display a warning message.

Parameters:
error   Severity of the error.
s   The text string.
...   Additional values; much like printf(char *, ...);

Definition at line 562 of file pdl_main.c.

int yyerror ( const char * s )
 

When yacc encounters an error during the parsing process of the configuration file, it calls yyerror(). The actual message formatting is done in waring();

Parameters:
s   error string.

Definition at line 407 of file pdl_main.c.

int yyparse_errors ( void )
 

Tell if there were errors/warning during parsing.

Returns:
0, if the are no errors/warnings, -1 otherwise.

Definition at line 118 of file pdl_main.c.

Referenced by startEvaluationManager().


Generated at Wed Jul 16 16:34:08 2003 for edg-lcmaps by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001