2. Top-level files

Worgle is amalgamated into one C files and two header files: public and private.

2.1. Top Level C File

<<worgle-top>>=
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef WORGLITE
#include <sqlite3.h>
#endif
#include "parg.h"
#include "worgle.h"
#include "worgle_private.h"
#ifndef WORGLITE
#include "db.h"
#endif

<<global_variables>>
<<enums>>
<<static_function_declarations>>
<<functions>>

int main(int argc, char *argv[])
{
<<local_variables>>
<<initialization>>
<<loading>>
<<parsing>>
<<generation>>
<<mapping>>
<<database>>
<<cleanup>>
}

2.2. Header File

In more recent developments of Worgle, a corresponding header file will be generated with the C file. This is needed so that other C files can be generated.

<<worgle-header>>=
#ifndef WORGLE_H
#define WORGLE_H
<<typedefs>>
<<function_declarations>>
#endif

2.3. Header File (private)

Private data (for things like structs), is stored in a header file called worgle_private.h.

<<worgle-private-header>>=
#ifndef WORGLE_PRIVATE_H
<<structs>>
#define WORGLE_PRIVATE_H
#endif



prev | home | next