dmxconfig.c File Reference

#include "dmx.h"
#include "dmxinput.h"
#include "dmxconfig.h"
#include "dmxparse.h"
#include "dmxlog.h"
#include "dmxcb.h"
#include "dmxstat.h"
#include "parser.h"

Data Structures

struct  DMXConfigListStruct
struct  DMXConfigCmdStruct

Defines

#define GEN(param, glob, def)

Typedefs

typedef struct DMXConfigListStruct DMXConfigList
typedef struct
DMXConfigListStruct
DMXConfigListPtr
typedef struct DMXConfigCmdStruct DMXConfigCmd
typedef struct DMXConfigCmdStructDMXConfigCmdPtr

Functions

int yyparse (void)
void dmxConfigStoreDisplay (const char *display)
void dmxConfigStoreInput (const char *input)
void dmxConfigStoreXInput (const char *input)
void dmxConfigStoreFile (const char *file)
void dmxConfigStoreConfig (const char *config)
static int dmxConfigReadFile (const char *filename, int debug)
static const char * dmxConfigMatch (const char *target, DMXConfigEntryPtr entry)
static DMXScreenInfodmxConfigAddDisplay (const char *name, int scrnWidth, int scrnHeight, int scrnX, int scrnY, int scrnXSign, int scrnYSign, int rootWidth, int rootHeight, int rootX, int rootY, int rootXSign, int rootYSign)
DMXInputInfodmxConfigAddInput (const char *name, int core)
static void dmxConfigCopyFromDisplay (DMXConfigDisplayPtr d)
static void dmxConfigCopyFromWall (DMXConfigWallPtr w)
static void dmxConfigCopyFromOption (DMXConfigOptionPtr o)
static void dmxConfigCopyFromParam (DMXConfigParamPtr p)
static void dmxConfigCopyData (DMXConfigVirtualPtr v)
static void dmxConfigFromCommandLine (void)
static void dmxConfigFromConfigFile (void)
static void dmxConfigConfigInputs (void)
void dmxConfigConfigure (void)
void dmxConfigSetMaxScreens (void)

Variables

FILE * yyin
static char * dmxXkbRules
static char * dmxXkbModel
static char * dmxXkbLayout
static char * dmxXkbVariant
static char * dmxXkbOptions
DMXConfigEntryPtr dmxConfigEntry
static DMXConfigCmd dmxConfigCmd
static int dmxDisplaysFromCommandLine

Detailed Description

Provides interface for reading DMX configuration files and for combining that information with command-line configuration parameters.


Define Documentation

#define GEN ( param,
glob,
def   ) 
Value:
void dmxConfigSet##glob(const char *param) {                                 \
     if (dmx##glob) free((void *)dmx##glob);                                  \
     dmx##glob = strdup(param);                                               \
 }                                                                            \
 char *dmxConfigGet##glob(void) {                                             \
     return (char *)(dmx##glob ? dmx##glob : def);                            \
 }

This macro is used to generate the following access methods:

  • dmxConfig{Set,Get}rules
  • dmxConfig{Set,Get}model
  • dmxConfig{Set,Get}layout
  • dmxConfig{Set,Get}variant
  • dmxConfig{Set,Get}options These methods are used to read and write information about the keyboard.

Typedef Documentation

This stucture stores the parsed configuration information.

Stores lists of configuration information.


Function Documentation

static DMXScreenInfo* dmxConfigAddDisplay ( const char *  name,
int  scrnWidth,
int  scrnHeight,
int  scrnX,
int  scrnY,
int  scrnXSign,
int  scrnYSign,
int  rootWidth,
int  rootHeight,
int  rootX,
int  rootY,
int  rootXSign,
int  rootYSign 
) [static]
DMXInputInfo* dmxConfigAddInput ( const char *  name,
int  core 
)
static void dmxConfigConfigInputs ( void   )  [static]
void dmxConfigConfigure ( void   ) 

Set up the appropriate global variables so that the DMX server will be initialized using the configuration specified in the config file and on the command line.

References DMXConfigCmdStruct::config, DMXConfigCmdStruct::displays, dmxConfigConfigInputs(), dmxConfigFreeEntry(), dmxConfigFromCommandLine(), dmxConfigFromConfigFile(), dmxConfigReadFile(), dmxLog(), dmxWarning, and DMXConfigCmdStruct::filename.

Referenced by dmxConfigSetMaxScreens(), and InitOutput().

static void dmxConfigCopyData ( DMXConfigVirtualPtr  v  )  [static]
static void dmxConfigCopyFromDisplay ( DMXConfigDisplayPtr  d  )  [static]
static void dmxConfigCopyFromOption ( DMXConfigOptionPtr  o  )  [static]
static void dmxConfigCopyFromParam ( DMXConfigParamPtr  p  )  [static]
static void dmxConfigCopyFromWall ( DMXConfigWallPtr  w  )  [static]
static void dmxConfigFromCommandLine ( void   )  [static]
static void dmxConfigFromConfigFile ( void   )  [static]
static const char* dmxConfigMatch ( const char *  target,
DMXConfigEntryPtr  entry 
) [static]
static int dmxConfigReadFile ( const char *  filename,
int  debug 
) [static]

References dmxInfo, dmxLog(), str, yydebug, yyin, and yyparse().

Referenced by dmxConfigConfigure().

void dmxConfigSetMaxScreens ( void   ) 

This function determines the number of displays we WILL have and sets MAXSCREENS to that value. This is difficult since the number depends on the command line (which is easy to count) or on the config file, which has to be parsed.

References dmxConfigConfigure(), dmxDisplaysFromCommandLine, dmxNumScreens, and DMXConfigCmdStruct::filename.

Referenced by ddxProcessArgument().

void dmxConfigStoreConfig ( const char *  config  ) 

Make a note that config should be used as the configuration for current instantiation of the DMX server.

References DMXConfigCmdStruct::config, dmxFatal, and dmxLog().

Referenced by ddxProcessArgument().

void dmxConfigStoreDisplay ( const char *  display  ) 

Make a note that display is the name of an X11 display that should be initialized as a backend (output) display. Called from ddxProcessArgument.

References DMXConfigCmdStruct::displays, dmxDisplaysFromCommandLine, dmxFatal, dmxLog(), DMXConfigListStruct::name, and DMXConfigListStruct::next.

Referenced by ddxProcessArgument().

void dmxConfigStoreFile ( const char *  file  ) 

Make a note that file is the configuration file.

References dmxFatal, dmxLog(), and DMXConfigCmdStruct::filename.

Referenced by ddxProcessArgument().

void dmxConfigStoreInput ( const char *  input  ) 

Make a note that input is the name of an X11 display that should be used for input (either a backend or a console input device).

References dmxFatal, dmxLog(), DMXConfigCmdStruct::inputs, DMXConfigListStruct::name, and DMXConfigListStruct::next.

Referenced by ddxProcessArgument().

void dmxConfigStoreXInput ( const char *  input  ) 

Make a note that input is the name of an X11 display that should be used for input from XInput extension devices.

References dmxFatal, dmxLog(), DMXConfigListStruct::name, DMXConfigListStruct::next, and DMXConfigCmdStruct::xinputs.

Referenced by ddxProcessArgument().

int yyparse ( void   ) 

Referenced by dmxConfigReadFile(), and main().


Variable Documentation

Referenced by main().

char* dmxXkbLayout [static]
char* dmxXkbModel [static]
char* dmxXkbOptions [static]
char* dmxXkbRules [static]
char* dmxXkbVariant [static]
FILE* yyin

Referenced by dmxConfigReadFile().


Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4.