# dmxparse.c File Reference

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <stdarg.h>`
`#include "dmxparse.h"`

## Functions

void | dmxConfigLog (const char *format,...)
void * | dmxConfigAlloc (unsigned long bytes)
void * | dmxConfigRealloc (void *orig, unsigned long orig_bytes, unsigned long bytes)
const char * | dmxConfigCopyString (const char *string, int length)
void | dmxConfigFree (void *area)
DMXConfigTokenPtr | dmxConfigCreateToken (int token, int line, const char *comment)
void | dmxConfigFreeToken (DMXConfigTokenPtr p)
DMXConfigStringPtr | dmxConfigCreateString (int token, int line, const char *comment, const char *string)
void | dmxConfigFreeString (DMXConfigStringPtr p)
DMXConfigNumberPtr | dmxConfigCreateNumber (int token, int line, const char *comment, int number)
void | dmxConfigFreeNumber (DMXConfigNumberPtr p)
DMXConfigPairPtr | dmxConfigCreatePair (int token, int line, const char *comment, int x, int y, int xsign, int ysign)
void | dmxConfigFreePair (DMXConfigPairPtr p)
DMXConfigCommentPtr | dmxConfigCreateComment (int token, int line, const char *comment)
void | dmxConfigFreeComment (DMXConfigCommentPtr p)
DMXConfigPartDimPtr | dmxConfigCreatePartDim (DMXConfigPairPtr pDim, DMXConfigPairPtr pOffset)
void | dmxConfigFreePartDim (DMXConfigPartDimPtr p)
DMXConfigFullDimPtr | dmxConfigCreateFullDim (DMXConfigPartDimPtr pScrn, DMXConfigPartDimPtr pRoot)
void | dmxConfigFreeFullDim (DMXConfigFullDimPtr p)
DMXConfigDisplayPtr | dmxConfigCreateDisplay (DMXConfigTokenPtr pStart, DMXConfigStringPtr pName, DMXConfigFullDimPtr pDim, DMXConfigPairPtr pOrigin, DMXConfigTokenPtr pEnd)
void | dmxConfigFreeDisplay (DMXConfigDisplayPtr p)
DMXConfigWallPtr | dmxConfigCreateWall (DMXConfigTokenPtr pStart, DMXConfigPairPtr pWallDim, DMXConfigPairPtr pDisplayDim, DMXConfigStringPtr pNameList, DMXConfigTokenPtr pEnd)
void | dmxConfigFreeWall (DMXConfigWallPtr p)
DMXConfigOptionPtr | dmxConfigCreateOption (DMXConfigTokenPtr pStart, DMXConfigStringPtr pOption, DMXConfigTokenPtr pEnd)
void | dmxConfigFreeOption (DMXConfigOptionPtr p)
const char ** | dmxConfigLookupParam (DMXConfigParamPtr p, const char *key, int *argc)
DMXConfigParamPtr | dmxConfigCreateParam (DMXConfigTokenPtr pStart, DMXConfigTokenPtr pOpen, DMXConfigStringPtr pParam, DMXConfigTokenPtr pClose, DMXConfigTokenPtr pEnd)
void | dmxConfigFreeParam (DMXConfigParamPtr p)
DMXConfigSubPtr | dmxConfigCreateSub (DMXConfigType type, DMXConfigCommentPtr comment, DMXConfigDisplayPtr display, DMXConfigWallPtr wall, DMXConfigOptionPtr option, DMXConfigParamPtr param)
void | dmxConfigFreeSub (DMXConfigSubPtr sub)
DMXConfigSubPtr | dmxConfigSubComment (DMXConfigCommentPtr comment)
DMXConfigSubPtr | dmxConfigSubDisplay (DMXConfigDisplayPtr display)
DMXConfigSubPtr | dmxConfigSubWall (DMXConfigWallPtr wall)
DMXConfigSubPtr | dmxConfigSubOption (DMXConfigOptionPtr option)
DMXConfigSubPtr | dmxConfigSubParam (DMXConfigParamPtr param)
DMXConfigSubPtr | dmxConfigAddSub (DMXConfigSubPtr head, DMXConfigSubPtr sub)
DMXConfigVirtualPtr | dmxConfigCreateVirtual (DMXConfigTokenPtr pStart, DMXConfigStringPtr pName, DMXConfigPairPtr pDim, DMXConfigTokenPtr pOpen, DMXConfigSubPtr pSubentry, DMXConfigTokenPtr pClose)
void | dmxConfigFreeVirtual (DMXConfigVirtualPtr virtual)
DMXConfigEntryPtr | dmxConfigCreateEntry (DMXConfigType type, DMXConfigCommentPtr comment, DMXConfigVirtualPtr virtual)
void | dmxConfigFreeEntry (DMXConfigEntryPtr entry)
DMXConfigEntryPtr | dmxConfigAddEntry (DMXConfigEntryPtr head, DMXConfigType type, DMXConfigCommentPtr comment, DMXConfigVirtualPtr virtual)
DMXConfigEntryPtr | dmxConfigEntryComment (DMXConfigCommentPtr comment)
DMXConfigEntryPtr | dmxConfigEntryVirtual (DMXConfigVirtualPtr virtual)

## Detailed Description

This file provides support routines and helper functions to be used by the DMX configuration file parser.

Because the DMX configuration file parsing should be capable of being used in a stand-alone fashion (i.e., independent from the DMX server source tree), no dependencies on other DMX routines are made.

## Function Documentation

DMXConfigEntryPtr dmxConfigAddEntry | ( | DMXConfigEntryPtr | head,
|  | DMXConfigType | type,
|  | DMXConfigCommentPtr | comment,
|  | DMXConfigVirtualPtr | virtual |
| ) |  |  |

References dmxConfigCreateEntry(), and _DMXConfigEntry::next.

Referenced by dmxConfigNCCallback(), and dmxVDLRead().

DMXConfigSubPtr dmxConfigAddSub | ( | DMXConfigSubPtr | head,
|  | DMXConfigSubPtr | sub |
| ) |  |  |

References _DMXConfigSub::next.

Referenced by dmxConfigNDCallback(), and dmxVDLRead().

void* dmxConfigAlloc | ( | unsigned long | bytes | ) |

References dmxConfigLog().

Referenced by dmxConfigCopyString(), dmxConfigCreateComment(), dmxConfigCreateDisplay(), dmxConfigCreateEntry(), dmxConfigCreateFullDim(), dmxConfigCreateNumber(), dmxConfigCreateOption(), dmxConfigCreatePair(), dmxConfigCreateParam(), dmxConfigCreatePartDim(), dmxConfigCreateString(), dmxConfigCreateSub(), dmxConfigCreateToken(), dmxConfigCreateVirtual(), dmxConfigCreateWall(), and dmxConfigPushState().

const char* dmxConfigCopyString | ( | const char * | string,
|  | int | length |
| ) |  |  |

References dmxConfigAlloc().

Referenced by dmxVDLRead().

DMXConfigCommentPtr dmxConfigCreateComment | ( | int | token,
|  | int | line,
|  | const char * | comment |
| ) |  |  |

References _DMXConfigComment::comment, dmxConfigAlloc(), _DMXConfigComment::line, and _DMXConfigComment::token.

Referenced by dmxVDLRead().

DMXConfigDisplayPtr dmxConfigCreateDisplay | ( | DMXConfigTokenPtr | pStart,
|  | DMXConfigStringPtr | pName,
|  | DMXConfigFullDimPtr | pDim,
|  | DMXConfigPairPtr | pOrigin,
|  | DMXConfigTokenPtr | pEnd |
| ) |  |  |

References _DMXConfigPartDim::dim, _DMXConfigDisplay::dim, dmxConfigAlloc(), _DMXConfigDisplay::dname, _DMXConfigDisplay::end, _DMXConfigDisplay::name, _DMXConfigPartDim::offset, _DMXConfigDisplay::origin, _DMXConfigFullDim::root, _DMXConfigDisplay::rootHeight, _DMXConfigDisplay::rootWidth, _DMXConfigDisplay::rootX, _DMXConfigDisplay::rootXOrigin, _DMXConfigDisplay::rootXSign, _DMXConfigDisplay::rootY, _DMXConfigDisplay::rootYOrigin, _DMXConfigDisplay::rootYSign, _DMXConfigFullDim::scrn, _DMXConfigDisplay::scrnHeight, _DMXConfigDisplay::scrnWidth, _DMXConfigDisplay::scrnX, _DMXConfigDisplay::scrnXSign, _DMXConfigDisplay::scrnY, _DMXConfigDisplay::scrnYSign, _DMXConfigDisplay::start, _DMXConfigString::string, _DMXConfigPair::x, _DMXConfigPair::xsign, _DMXConfigPair::y, and _DMXConfigPair::ysign.

Referenced by dmxConfigNDCallback(), and dmxVDLRead().

DMXConfigEntryPtr dmxConfigCreateEntry | ( | DMXConfigType | type,
|  | DMXConfigCommentPtr | comment,
|  | DMXConfigVirtualPtr | virtual |
| ) |  |  |

References _DMXConfigEntry::comment, dmxConfigAlloc(), dmxConfigComment, dmxConfigLog(), dmxConfigVirtual, _DMXConfigEntry::type, and _DMXConfigEntry::virtual.

Referenced by dmxConfigAddEntry(), dmxConfigEntryComment(), and dmxConfigEntryVirtual().

DMXConfigFullDimPtr dmxConfigCreateFullDim | ( | DMXConfigPartDimPtr | pScrn,
|  | DMXConfigPartDimPtr | pRoot |
| ) |  |  |

References dmxConfigAlloc(), _DMXConfigFullDim::root, and _DMXConfigFullDim::scrn.

Referenced by dmxVDLRead().

DMXConfigNumberPtr dmxConfigCreateNumber | ( | int | token,
|  | int | line,
|  | const char * | comment,
|  | int | number |
| ) |  |  |

References _DMXConfigNumber::comment, dmxConfigAlloc(), _DMXConfigNumber::line, _DMXConfigNumber::number, and _DMXConfigNumber::token.

DMXConfigOptionPtr dmxConfigCreateOption | ( | DMXConfigTokenPtr | pStart,
|  | DMXConfigStringPtr | pOption,
|  | DMXConfigTokenPtr | pEnd |
| ) |  |  |

References dmxConfigAlloc(), _DMXConfigOption::end, _DMXConfigString::next, _DMXConfigOption::option, _DMXConfigOption::start, _DMXConfigOption::string, and _DMXConfigString::string.

DMXConfigPairPtr dmxConfigCreatePair | ( | int | token,
|  | int | line,
|  | const char * | comment,
|  | int | x,
|  | int | y,
|  | int | xsign,
|  | int | ysign |
| ) |  |  |

References _DMXConfigPair::comment, dmxConfigAlloc(), _DMXConfigPair::line, _DMXConfigPair::token, _DMXConfigPair::x, _DMXConfigPair::xsign, _DMXConfigPair::y, and _DMXConfigPair::ysign.

Referenced by dmxVDLRead().

DMXConfigParamPtr dmxConfigCreateParam | ( | DMXConfigTokenPtr | pStart,
|  | DMXConfigTokenPtr | pOpen,
|  | DMXConfigStringPtr | pParam,
|  | DMXConfigTokenPtr | pClose,
|  | DMXConfigTokenPtr | pEnd |
| ) |  |  |

References _DMXConfigParam::argc, _DMXConfigParam::argv, _DMXConfigParam::close, dmxConfigAlloc(), _DMXConfigParam::end, _DMXConfigString::next, _DMXConfigParam::open, _DMXConfigParam::param, _DMXConfigParam::start, and _DMXConfigString::string.

DMXConfigPartDimPtr dmxConfigCreatePartDim | ( | DMXConfigPairPtr | pDim,
|  | DMXConfigPairPtr | pOffset |
| ) |  |  |

References _DMXConfigPartDim::dim, dmxConfigAlloc(), and _DMXConfigPartDim::offset.

Referenced by dmxVDLRead().

DMXConfigStringPtr dmxConfigCreateString | ( | int | token,
|  | int | line,
|  | const char * | comment,
|  | const char * | string |
| ) |  |  |

References _DMXConfigString::comment, dmxConfigAlloc(), _DMXConfigString::line, _DMXConfigString::string, and _DMXConfigString::token.

Referenced by dmxVDLRead().

DMXConfigSubPtr dmxConfigCreateSub | ( | DMXConfigType | type,
|  | DMXConfigCommentPtr | comment,
|  | DMXConfigDisplayPtr | display,
|  | DMXConfigWallPtr | wall,
|  | DMXConfigOptionPtr | option,
|  | DMXConfigParamPtr | param |
| ) |  |  |

References _DMXConfigSub::comment, _DMXConfigSub::display, dmxConfigAlloc(), dmxConfigComment, dmxConfigDisplay, dmxConfigLog(), dmxConfigOption, dmxConfigParam, dmxConfigWall, _DMXConfigSub::option, _DMXConfigSub::param, _DMXConfigSub::type, and _DMXConfigSub::wall.

Referenced by dmxConfigSubComment(), dmxConfigSubDisplay(), dmxConfigSubOption(), dmxConfigSubParam(), and dmxConfigSubWall().

DMXConfigTokenPtr dmxConfigCreateToken | ( | int | token,
|  | int | line,
|  | const char * | comment |
| ) |  |  |

References _DMXConfigToken::comment, dmxConfigAlloc(), _DMXConfigToken::line, and _DMXConfigToken::token.

DMXConfigVirtualPtr dmxConfigCreateVirtual | ( | DMXConfigTokenPtr | pStart,
|  | DMXConfigStringPtr | pName,
|  | DMXConfigPairPtr | pDim,
|  | DMXConfigTokenPtr | pOpen,
|  | DMXConfigSubPtr | pSubentry,
|  | DMXConfigTokenPtr | pClose |
| ) |  |  |

References _DMXConfigVirtual::close, _DMXConfigVirtual::dim, dmxConfigAlloc(), _DMXConfigVirtual::height, _DMXConfigVirtual::name, _DMXConfigVirtual::open, _DMXConfigVirtual::start, _DMXConfigString::string, _DMXConfigVirtual::subentry, _DMXConfigVirtual::vname, _DMXConfigVirtual::width, _DMXConfigPair::x, and _DMXConfigPair::y.

Referenced by dmxConfigNCCallback(), and dmxVDLRead().

DMXConfigWallPtr dmxConfigCreateWall | ( | DMXConfigTokenPtr | pStart,
|  | DMXConfigPairPtr | pWallDim,
|  | DMXConfigPairPtr | pDisplayDim,
|  | DMXConfigStringPtr | pNameList,
|  | DMXConfigTokenPtr | pEnd |
| ) |  |  |

References _DMXConfigWall::displayDim, dmxConfigAlloc(), _DMXConfigWall::end, _DMXConfigWall::height, _DMXConfigWall::nameList, _DMXConfigWall::start, _DMXConfigWall::wallDim, _DMXConfigWall::width, _DMXConfigPair::x, _DMXConfigWall::xwall, _DMXConfigPair::y, and _DMXConfigWall::ywall.

DMXConfigEntryPtr dmxConfigEntryComment | ( | DMXConfigCommentPtr | comment | ) |

References dmxConfigComment, and dmxConfigCreateEntry().

DMXConfigEntryPtr dmxConfigEntryVirtual | ( | DMXConfigVirtualPtr | virtual | ) |

References dmxConfigCreateEntry(), and dmxConfigVirtual.

void dmxConfigFree | ( | void * | area | ) |

Referenced by dmxConfigFreeComment(), dmxConfigFreeDisplay(), dmxConfigFreeEntry(), dmxConfigFreeFullDim(), dmxConfigFreeNumber(), dmxConfigFreeOption(), dmxConfigFreePair(), dmxConfigFreeParam(), dmxConfigFreePartDim(), dmxConfigFreeString(), dmxConfigFreeSub(), dmxConfigFreeToken(), dmxConfigFreeVirtual(), dmxConfigFreeWall(), and dmxConfigPopState().

void dmxConfigFreeComment | ( | DMXConfigCommentPtr | p | ) |

References _DMXConfigComment::comment, and dmxConfigFree().

Referenced by dmxConfigFreeEntry(), and dmxConfigFreeSub().

void dmxConfigFreeDisplay | ( | DMXConfigDisplayPtr | p | ) |

References _DMXConfigDisplay::dim, dmxConfigFree(), dmxConfigFreeFullDim(), dmxConfigFreeString(), dmxConfigFreeToken(), _DMXConfigDisplay::dname, _DMXConfigDisplay::end, and _DMXConfigDisplay::start.

Referenced by dmxConfigDDCallback(), and dmxConfigFreeSub().

void dmxConfigFreeEntry | ( | DMXConfigEntryPtr | entry | ) |

References _DMXConfigEntry::comment, dmxConfigComment, dmxConfigFree(), dmxConfigFreeComment(), dmxConfigFreeVirtual(), dmxConfigLog(), dmxConfigVirtual, _DMXConfigEntry::next, _DMXConfigEntry::type, and _DMXConfigEntry::virtual.

Referenced by dmxConfigConfigure().

void dmxConfigFreeFullDim | ( | DMXConfigFullDimPtr | p | ) |

References dmxConfigFree(), dmxConfigFreePartDim(), _DMXConfigFullDim::root, and _DMXConfigFullDim::scrn.

Referenced by dmxConfigFreeDisplay().

void dmxConfigFreeNumber | ( | DMXConfigNumberPtr | p | ) |

References _DMXConfigNumber::comment, and dmxConfigFree().

void dmxConfigFreeOption | ( | DMXConfigOptionPtr | p | ) |

References dmxConfigFree(), dmxConfigFreeString(), dmxConfigFreeToken(), _DMXConfigOption::end, _DMXConfigOption::option, _DMXConfigOption::start, and _DMXConfigOption::string.

Referenced by dmxConfigFreeSub().

void dmxConfigFreePair | ( | DMXConfigPairPtr | p | ) |

References _DMXConfigPair::comment, and dmxConfigFree().

Referenced by dmxConfigFreePartDim(), dmxConfigFreeVirtual(), and dmxConfigFreeWall().

void dmxConfigFreeParam | ( | DMXConfigParamPtr | p | ) |

References _DMXConfigParam::argv, _DMXConfigParam::close, dmxConfigFree(), dmxConfigFreeString(), dmxConfigFreeToken(), _DMXConfigParam::end, _DMXConfigParam::next, _DMXConfigParam::open, _DMXConfigParam::param, and _DMXConfigParam::start.

Referenced by dmxConfigFreeSub().

void dmxConfigFreePartDim | ( | DMXConfigPartDimPtr | p | ) |

References _DMXConfigPartDim::dim, dmxConfigFree(), dmxConfigFreePair(), and _DMXConfigPartDim::offset.

Referenced by dmxConfigFreeFullDim().

void dmxConfigFreeString | ( | DMXConfigStringPtr | p | ) |

References _DMXConfigString::comment, dmxConfigFree(), _DMXConfigString::next, and _DMXConfigString::string.

Referenced by dmxConfigFreeDisplay(), dmxConfigFreeOption(), dmxConfigFreeParam(), dmxConfigFreeVirtual(), and dmxConfigFreeWall().

void dmxConfigFreeSub | ( | DMXConfigSubPtr | sub | ) |

References _DMXConfigSub::comment, _DMXConfigSub::display, dmxConfigComment, dmxConfigDisplay, dmxConfigFree(), dmxConfigFreeComment(), dmxConfigFreeDisplay(), dmxConfigFreeOption(), dmxConfigFreeParam(), dmxConfigFreeWall(), dmxConfigLog(), dmxConfigOption, dmxConfigParam, dmxConfigWall, _DMXConfigSub::next, _DMXConfigSub::option, _DMXConfigSub::param, _DMXConfigSub::type, and _DMXConfigSub::wall.

Referenced by dmxConfigFreeVirtual().

void dmxConfigFreeToken | ( | DMXConfigTokenPtr | p | ) |

References _DMXConfigToken::comment, and dmxConfigFree().

Referenced by dmxConfigFreeDisplay(), dmxConfigFreeOption(), dmxConfigFreeParam(), dmxConfigFreeVirtual(), and dmxConfigFreeWall().

void dmxConfigFreeVirtual | ( | DMXConfigVirtualPtr | virtual | ) |

References dmxConfigFree(), dmxConfigFreePair(), dmxConfigFreeString(), dmxConfigFreeSub(), and dmxConfigFreeToken().

Referenced by dmxConfigDCCallback(), and dmxConfigFreeEntry().

void dmxConfigFreeWall | ( | DMXConfigWallPtr | p | ) |

References _DMXConfigWall::displayDim, dmxConfigFree(), dmxConfigFreePair(), dmxConfigFreeString(), dmxConfigFreeToken(), _DMXConfigWall::end, _DMXConfigWall::nameList, _DMXConfigWall::start, and _DMXConfigWall::wallDim.

Referenced by dmxConfigFreeSub().

void dmxConfigLog | ( | const char * | format,
|  |  | ... |
| ) |  |  |

A general error logging routine that does not depend on the dmxLog functions.

Referenced by dmxConfigAlloc(), dmxConfigCreateEntry(), dmxConfigCreateSub(), dmxConfigFreeEntry(), dmxConfigFreeSub(), dmxConfigPopState(), dmxConfigPrint(), dmxConfigPrintParam(), dmxConfigPrintSub(), dmxConfigPrintTokenFlag(), and dmxConfigRealloc().

const char** dmxConfigLookupParam | ( | DMXConfigParamPtr | p,
|  | const char * | key,
|  | int * | argc |
| ) |  |  |

References _DMXConfigParam::argc, _DMXConfigParam::argv, and _DMXConfigParam::next.

Referenced by dmxConfigCopyFromParam().

void* dmxConfigRealloc | ( | void * | orig,
|  | unsigned long | orig_bytes,
|  | unsigned long | bytes |
| ) |  |  |

References dmxConfigLog().

DMXConfigSubPtr dmxConfigSubComment | ( | DMXConfigCommentPtr | comment | ) |

References dmxConfigComment, and dmxConfigCreateSub().

DMXConfigSubPtr dmxConfigSubDisplay | ( | DMXConfigDisplayPtr | display | ) |

References dmxConfigCreateSub(), and dmxConfigDisplay.

Referenced by dmxConfigNDCallback(), and dmxVDLRead().

DMXConfigSubPtr dmxConfigSubOption | ( | DMXConfigOptionPtr | option | ) |

References dmxConfigCreateSub(), and dmxConfigOption.

DMXConfigSubPtr dmxConfigSubParam | ( | DMXConfigParamPtr | param | ) |

References dmxConfigCreateSub(), and dmxConfigParam.

DMXConfigSubPtr dmxConfigSubWall | ( | DMXConfigWallPtr | wall | ) |

References dmxConfigCreateSub(), and dmxConfigWall.

Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4. </addres>