Menu

Initializing

Brad Lanam

Wiki Home

Initializing


di_initialize

Create the di_data structure and returns it. The di_data structure is required for all subsequent calls to the di library.

#include <di.h>

void * di_data;

di_data = di_initialize (void);

Returns: A pointer to an allocated di_data structure. This structure must be freed in a call to di_cleanup.


di_process_options

Processes the arguments to di. These are passed as strings via an
argv structure as if on the command line. If no call to
di_process_options is made, di will use the defaults, and the DI_ARGS environment variable will not be processed.

#include <di.h>

int   exitflag;

exitflag = di_process_options (void *di_data, int targc, const char *targv [], int offset)

di_data : The di_data structure returned from di_initialize.

targc : The number of items in the targv array.

targv : An array of character strings.

offset : The starting offset in the argv array. This will be 0
for most cases, 1, if the argv array is from the command line.

Returns: A return value indicating the status of processing the options.

DI_EXIT_NORM  // normal exit
DI_EXIT_HELP  // --help was specified as an argument
DI_EXIT_VERS  // --version was specified as an argument
DI_EXIT_WARN  // invalid data was found in the arguments
DI_EXIT_FAIL  // a very serious error occurred.

di_cleanup

Frees all allocated data.

#include <di.h>

void di_cleanup (void *di_data);

di_data : The di_data structure returned from di_initialize.


di_version

Returns the di version string.

#include <di.h>

const char *str;

str = di_version (void)

Wiki Home


Related

Wiki: Home