diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/hw/dmx/config/dmxprint.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2 vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-mmx.c
xorg-server/Xext/shm.c
xorg-server/Xext/syncsrv.h
xorg-server/Xext/xvmain.c
xorg-server/Xi/exevents.c
xorg-server/Xi/opendev.c
xorg-server/composite/compalloc.c
xorg-server/composite/compoverlay.c
xorg-server/dix/colormap.c
xorg-server/dix/devices.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/dix/eventconvert.c
xorg-server/dix/events.c
xorg-server/dix/gc.c
xorg-server/dix/getevents.c
xorg-server/dix/main.c
xorg-server/dix/privates.c
xorg-server/dix/registry.c
xorg-server/dix/resource.c
xorg-server/exa/exa_accel.c
xorg-server/exa/exa_migration_classic.c
xorg-server/exa/exa_unaccel.c
xorg-server/fb/fb.h
xorg-server/fb/fbcopy.c
xorg-server/fb/fbpixmap.c
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmds.c
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdricommon.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/glxext.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_util.c
xorg-server/glx/rensize.c
xorg-server/glx/single2swap.c
xorg-server/glx/singlepix.c
xorg-server/glx/singlepixswap.c
xorg-server/glx/singlesize.c
xorg-server/hw/dmx/dmxinit.c
xorg-server/hw/kdrive/ephyr/ephyr.c
xorg-server/hw/kdrive/ephyr/hostx.c
xorg-server/hw/kdrive/ephyr/hostx.h
xorg-server/hw/kdrive/src/kinput.c
xorg-server/hw/xfree86/common/compiler.h
xorg-server/hw/xwin/InitInput.c
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glwrap.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/wgl_ext_api.h
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winallpriv.c
xorg-server/hw/xwin/winauth.c
xorg-server/hw/xwin/winclipboard.h
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/winclipboardunicode.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winclipboardxevents.c
xorg-server/hw/xwin/wincmap.c
xorg-server/hw/xwin/winconfig.c
xorg-server/hw/xwin/wincreatewnd.c
xorg-server/hw/xwin/wincursor.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winerror.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winkeybd.c
xorg-server/hw/xwin/winkeybd.h
xorg-server/hw/xwin/winlayouts.h
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winmonitors.c
xorg-server/hw/xwin/winmouse.c
xorg-server/hw/xwin/winmsg.c
xorg-server/hw/xwin/winmsg.h
xorg-server/hw/xwin/winmultiwindowclass.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winmultiwindowwndproc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winprefs.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/hw/xwin/winregistry.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winshaddd.c
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/wintrayicon.c
xorg-server/hw/xwin/winwin32rootless.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwin32rootlesswndproc.c
xorg-server/hw/xwin/winwindow.c
xorg-server/hw/xwin/winwindow.h
xorg-server/hw/xwin/winwindowswm.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/include/callback.h
xorg-server/include/dixstruct.h
xorg-server/include/misc.h
xorg-server/include/os.h
xorg-server/include/scrnintstr.h
xorg-server/mi/micmap.c
xorg-server/mi/miinitext.c
xorg-server/mi/mioverlay.c
xorg-server/mi/misprite.c
xorg-server/mi/mivaltree.c
xorg-server/mi/miwindow.c
xorg-server/miext/damage/damage.c
xorg-server/miext/rootless/rootlessGC.c
xorg-server/miext/rootless/rootlessWindow.c
xorg-server/os/WaitFor.c
xorg-server/os/access.c
xorg-server/os/connection.c
xorg-server/os/io.c
xorg-server/os/log.c
xorg-server/os/osinit.c
xorg-server/os/utils.c
xorg-server/os/xdmcp.c
xorg-server/os/xprintf.c
xorg-server/os/xstrans.c
xorg-server/render/mipict.c
xorg-server/xkb/xkbActions.c
xorg-server/xkb/xkbInit.c
xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/hw/dmx/config/dmxprint.c')
-rw-r--r-- | xorg-server/hw/dmx/config/dmxprint.c | 373 |
1 files changed, 231 insertions, 142 deletions
diff --git a/xorg-server/hw/dmx/config/dmxprint.c b/xorg-server/hw/dmx/config/dmxprint.c index 599ebf5df..3145fb56a 100644 --- a/xorg-server/hw/dmx/config/dmxprint.c +++ b/xorg-server/hw/dmx/config/dmxprint.c @@ -52,100 +52,126 @@ #include <stdarg.h> #include <ctype.h> -static FILE *str = NULL; -static int indent = 0; -static int pos = 0; +static FILE *str = NULL; +static int indent = 0; +static int pos = 0; /** Stack of indentation information used for pretty-printing * configuration information. */ static struct stack { - int base; - int comment; - int step; + int base; + int comment; + int step; struct stack *next; -} *stack, initialStack = { 0, 0, 4, NULL }; +} *stack, initialStack = { +0, 0, 4, NULL}; -static void dmxConfigIndent(void) +static void +dmxConfigIndent(void) { int i; - if (indent < 0) indent = 0; - if (indent > 40) indent = 40; - for (i = 0; i < indent; i++) fprintf(str, " "); + + if (indent < 0) + indent = 0; + if (indent > 40) + indent = 40; + for (i = 0; i < indent; i++) + fprintf(str, " "); } -static void dmxConfigNewline(void) +static void +dmxConfigNewline(void) { - if (pos) fprintf(str, "\n"); + if (pos) + fprintf(str, "\n"); pos = 0; } -static void dmxConfigPushState(int base, int comment, int step) +static void +dmxConfigPushState(int base, int comment, int step) { struct stack *new = dmxConfigAlloc(sizeof(*new)); - new->base = base; + + new->base = base; new->comment = comment; - new->step = step; - new->next = stack; - stack = new; - indent = base; + new->step = step; + new->next = stack; + stack = new; + indent = base; dmxConfigNewline(); } -static void dmxConfigPushComment(void) +static void +dmxConfigPushComment(void) { - if (stack) indent = stack->comment; + if (stack) + indent = stack->comment; } -static void dmxConfigPushStep(void) +static void +dmxConfigPushStep(void) { - if (stack) indent = stack->step; + if (stack) + indent = stack->step; } -static void dmxConfigPopState(void) +static void +dmxConfigPopState(void) { struct stack *old = stack; - if (!stack) return; + if (!stack) + return; indent = old->base; - stack = old->next; - if (!stack) dmxConfigLog("Stack underflow\n"); + stack = old->next; + if (!stack) + dmxConfigLog("Stack underflow\n"); dmxConfigFree(old); dmxConfigNewline(); } -static void dmxConfigOutput(int addSpace, int doNewline, const char *comment, - const char *format, ...) +static void +dmxConfigOutput(int addSpace, int doNewline, const char *comment, + const char *format, ...) { va_list args; - if (!pos) dmxConfigIndent(); - else if (addSpace) fprintf(str, " "); + if (!pos) + dmxConfigIndent(); + else if (addSpace) + fprintf(str, " "); if (format) { va_start(args, format); - /* RATS: This hasn't been audited -- it - * could probably result in a buffer - * overflow. */ - pos += vfprintf(str, format, args); /* assumes no newlines! */ + /* RATS: This hasn't been audited -- it + * could probably result in a buffer + * overflow. */ + pos += vfprintf(str, format, args); /* assumes no newlines! */ va_end(args); } if (comment) { - if (pos) fprintf(str, " "); + if (pos) + fprintf(str, " "); pos += fprintf(str, "#%s", comment); dmxConfigNewline(); dmxConfigPushComment(); - } else if (doNewline) dmxConfigNewline(); + } + else if (doNewline) + dmxConfigNewline(); } -static void dmxConfigPrintComment(DMXConfigCommentPtr p) +static void +dmxConfigPrintComment(DMXConfigCommentPtr p) { dmxConfigOutput(1, 1, p->comment, NULL); } -static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag) +static void +dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag) { - if (!p) return; + if (!p) + return; switch (p->token) { case T_VIRTUAL: dmxConfigPushState(0, 4, 4); @@ -169,14 +195,16 @@ static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag) break; case ';': dmxConfigOutput(0, 1, p->comment, ";"); - if (flag) dmxConfigPopState(); + if (flag) + dmxConfigPopState(); break; case '{': dmxConfigOutput(1, 1, p->comment, "{"); dmxConfigPushStep(); break; case '}': - if (flag) dmxConfigPopState(); + if (flag) + dmxConfigPopState(); dmxConfigOutput(0, 1, p->comment, "}"); break; case '/': @@ -187,49 +215,66 @@ static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag) } } -static void dmxConfigPrintToken(DMXConfigTokenPtr p) +static void +dmxConfigPrintToken(DMXConfigTokenPtr p) { dmxConfigPrintTokenFlag(p, 1); } -static void dmxConfigPrintTokenNopop(DMXConfigTokenPtr p) +static void +dmxConfigPrintTokenNopop(DMXConfigTokenPtr p) { dmxConfigPrintTokenFlag(p, 0); } -static int dmxConfigPrintQuotedString(const char *s) +static int +dmxConfigPrintQuotedString(const char *s) { const char *pt; - if (!s || !s[0]) return 1; /* Quote empty string */ - for (pt = s; *pt; ++pt) if (isspace(*pt)) return 1; + if (!s || !s[0]) + return 1; /* Quote empty string */ + for (pt = s; *pt; ++pt) + if (isspace(*pt)) + return 1; return 0; } -static void dmxConfigPrintString(DMXConfigStringPtr p, int quote) +static void +dmxConfigPrintString(DMXConfigStringPtr p, int quote) { DMXConfigStringPtr pt; - - if (!p) return; + + if (!p) + return; for (pt = p; pt; pt = pt->next) { if (quote && dmxConfigPrintQuotedString(pt->string)) { dmxConfigOutput(1, 0, pt->comment, "\"%s\"", pt->string ? pt->string : ""); - } else + } + else dmxConfigOutput(1, 0, pt->comment, "%s", pt->string ? pt->string : ""); } } -static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace) +static int +dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace) { const char *format = NULL; - - if (!p) return 0; + + if (!p) + return 0; switch (p->token) { - case T_ORIGIN: format = "@%dx%d"; break; - case T_DIMENSION: format = "%dx%d"; break; - case T_OFFSET: format = "%c%d%c%d"; break; + case T_ORIGIN: + format = "@%dx%d"; + break; + case T_DIMENSION: + format = "%dx%d"; + break; + case T_OFFSET: + format = "%c%d%c%d"; + break; } if (p->token == T_OFFSET) { if (!p->comment && !p->x && !p->y && p->xsign >= 0 && p->ysign >= 0) @@ -237,69 +282,79 @@ static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace) dmxConfigOutput(addSpace, 0, p->comment, format, p->xsign < 0 ? '-' : '+', p->x, p->ysign < 0 ? '-' : '+', p->y); - } else { - if (!p->comment && !p->x && !p->y) return 0; + } + else { + if (!p->comment && !p->x && !p->y) + return 0; dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y); } return 1; } -static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p) +static void +dmxConfigPrintDisplay(DMXConfigDisplayPtr p) { - DMXConfigToken dummyStart = { T_DISPLAY, 0, NULL }; - DMXConfigToken dummyEnd = { ';', 0, NULL }; - DMXConfigToken dummySep = { '/', 0, NULL }; - DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL }; - DMXConfigPair dummySDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummySOffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummyRDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummyROffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 }; - DMXConfigPair dummyOrigin = { T_ORIGIN, 0, NULL, 0, 0, 0, 0 }; - int output; - - if (p->dname) p->dname->string = p->name; - else dummyName.string = p->name; - + DMXConfigToken dummyStart = { T_DISPLAY, 0, NULL }; + DMXConfigToken dummyEnd = { ';', 0, NULL }; + DMXConfigToken dummySep = { '/', 0, NULL }; + DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL }; + DMXConfigPair dummySDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 }; + DMXConfigPair dummySOffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 }; + DMXConfigPair dummyRDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 }; + DMXConfigPair dummyROffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 }; + DMXConfigPair dummyOrigin = { T_ORIGIN, 0, NULL, 0, 0, 0, 0 }; + int output; + + if (p->dname) + p->dname->string = p->name; + else + dummyName.string = p->name; + if (p->dim && p->dim->scrn && p->dim->scrn->dim) { - p->dim->scrn->dim->x = p->scrnWidth; - p->dim->scrn->dim->y = p->scrnHeight; - } else { - dummySDim.x = p->scrnWidth; - dummySDim.y = p->scrnHeight; + p->dim->scrn->dim->x = p->scrnWidth; + p->dim->scrn->dim->y = p->scrnHeight; + } + else { + dummySDim.x = p->scrnWidth; + dummySDim.y = p->scrnHeight; } if (p->dim && p->dim->scrn && p->dim->scrn->offset) { p->dim->scrn->offset->x = p->scrnX; p->dim->scrn->offset->y = p->scrnY; - } else { - dummySOffset.x = p->scrnX; - dummySOffset.y = p->scrnY; } - + else { + dummySOffset.x = p->scrnX; + dummySOffset.y = p->scrnY; + } + if (p->dim && p->dim->root && p->dim->root->dim) { - p->dim->root->dim->x = p->rootWidth; - p->dim->root->dim->y = p->rootHeight; - } else { - dummyRDim.x = p->rootWidth; - dummyRDim.y = p->rootHeight; + p->dim->root->dim->x = p->rootWidth; + p->dim->root->dim->y = p->rootHeight; + } + else { + dummyRDim.x = p->rootWidth; + dummyRDim.y = p->rootHeight; } if (p->dim && p->dim->root && p->dim->root->offset) { p->dim->root->offset->x = p->rootX; p->dim->root->offset->y = p->rootY; - } else { - dummyROffset.x = p->rootX; - dummyROffset.y = p->rootY; + } + else { + dummyROffset.x = p->rootX; + dummyROffset.y = p->rootY; } if (p->origin) { - p->origin->x = p->rootXOrigin, p->origin->y = p->rootYOrigin; - p->origin->xsign = p->rootXSign, p->origin->ysign = p->rootYSign; - } else { - dummyOrigin.x = p->rootXOrigin, dummyOrigin.y = p->rootYOrigin; - dummyOrigin.xsign = p->rootXSign, dummyOrigin.ysign = p->rootYSign; + p->origin->x = p->rootXOrigin, p->origin->y = p->rootYOrigin; + p->origin->xsign = p->rootXSign, p->origin->ysign = p->rootYSign; + } + else { + dummyOrigin.x = p->rootXOrigin, dummyOrigin.y = p->rootYOrigin; + dummyOrigin.xsign = p->rootXSign, dummyOrigin.ysign = p->rootYSign; } - + dmxConfigPrintToken(p->start ? p->start : &dummyStart); dmxConfigPrintString(p->dname ? p->dname : &dummyName, 1); @@ -313,9 +368,7 @@ static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p) dmxConfigPrintPair(&dummySOffset, !output); if (p->scrnWidth != p->rootWidth - || p->scrnHeight != p->rootHeight - || p->rootX - || p->rootY) { + || p->scrnHeight != p->rootHeight || p->rootX || p->rootY) { dmxConfigPrintToken(&dummySep); if (p->dim && p->dim->root && p->dim->root->dim) output = dmxConfigPrintPair(p->dim->root->dim, 1); @@ -331,7 +384,8 @@ static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p) dmxConfigPrintToken(p->end ? p->end : &dummyEnd); } -static void dmxConfigPrintWall(DMXConfigWallPtr p) +static void +dmxConfigPrintWall(DMXConfigWallPtr p) { dmxConfigPrintToken(p->start); dmxConfigPrintPair(p->wallDim, 1); @@ -340,11 +394,12 @@ static void dmxConfigPrintWall(DMXConfigWallPtr p) dmxConfigPrintToken(p->end); } -static void dmxConfigPrintOption(DMXConfigOptionPtr p) +static void +dmxConfigPrintOption(DMXConfigOptionPtr p) { - DMXConfigToken dummyStart = { T_OPTION, 0, NULL }; + DMXConfigToken dummyStart = { T_OPTION, 0, NULL }; DMXConfigString dummyOption = { T_STRING, 0, NULL, NULL, NULL }; - DMXConfigToken dummyEnd = { ';', 0, NULL }; + DMXConfigToken dummyEnd = { ';', 0, NULL }; dummyOption.string = p->string; @@ -353,41 +408,59 @@ static void dmxConfigPrintOption(DMXConfigOptionPtr p) dmxConfigPrintToken(p->end ? p->end : &dummyEnd); } -static void dmxConfigPrintParam(DMXConfigParamPtr p) +static void +dmxConfigPrintParam(DMXConfigParamPtr p) { - if (!p) return; + if (!p) + return; if (p->start) { if (p->open && p->close) { dmxConfigPrintToken(p->start); dmxConfigPrintToken(p->open); dmxConfigPrintParam(p->next); dmxConfigPrintToken(p->close); - } else if (p->end && p->param) { + } + else if (p->end && p->param) { dmxConfigPrintToken(p->start); dmxConfigPrintString(p->param, 1); dmxConfigPrintToken(p->end); - } else + } + else dmxConfigLog("dmxConfigPrintParam: cannot handle format (a)\n"); - } else if (p->end && p->param) { + } + else if (p->end && p->param) { dmxConfigPrintString(p->param, 1); dmxConfigPrintTokenNopop(p->end); dmxConfigPrintParam(p->next); - } else + } + else dmxConfigLog("dmxConfigPrintParam: cannot handle format (b)\n"); } -static void dmxConfigPrintSub(DMXConfigSubPtr p) +static void +dmxConfigPrintSub(DMXConfigSubPtr p) { DMXConfigSubPtr pt; - if (!p) return; + if (!p) + return; for (pt = p; pt; pt = pt->next) { switch (pt->type) { - case dmxConfigComment: dmxConfigPrintComment(pt->comment); break; - case dmxConfigDisplay: dmxConfigPrintDisplay(pt->display); break; - case dmxConfigWall: dmxConfigPrintWall(pt->wall); break; - case dmxConfigOption: dmxConfigPrintOption(pt->option); break; - case dmxConfigParam: dmxConfigPrintParam(pt->param); break; + case dmxConfigComment: + dmxConfigPrintComment(pt->comment); + break; + case dmxConfigDisplay: + dmxConfigPrintDisplay(pt->display); + break; + case dmxConfigWall: + dmxConfigPrintWall(pt->wall); + break; + case dmxConfigOption: + dmxConfigPrintOption(pt->option); + break; + case dmxConfigParam: + dmxConfigPrintParam(pt->param); + break; default: dmxConfigLog("dmxConfigPrintSub:" " cannot handle type %d in subentry\n", pt->type); @@ -395,20 +468,24 @@ static void dmxConfigPrintSub(DMXConfigSubPtr p) } } -static void dmxConfigPrintVirtual(DMXConfigVirtualPtr p) +static void +dmxConfigPrintVirtual(DMXConfigVirtualPtr p) { - DMXConfigToken dummyStart = { T_VIRTUAL, 0, NULL }; - DMXConfigToken dummyOpen = { '{', 0, NULL }; - DMXConfigToken dummyClose = { '}', 0, NULL }; - DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL }; - DMXConfigPair dummyDim = { T_DIMENSION, 0, NULL, 0, 0 }; - - if (p->vname) p->vname->string = p->name; - else dummyName.string = p->name; + DMXConfigToken dummyStart = { T_VIRTUAL, 0, NULL }; + DMXConfigToken dummyOpen = { '{', 0, NULL }; + DMXConfigToken dummyClose = { '}', 0, NULL }; + DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL }; + DMXConfigPair dummyDim = { T_DIMENSION, 0, NULL, 0, 0 }; + + if (p->vname) + p->vname->string = p->name; + else + dummyName.string = p->name; - if (p->dim) p->dim->x = p->width, p->dim->y = p->height; - else dummyDim.x = p->width, dummyDim.y = p->height; - + if (p->dim) + p->dim->x = p->width, p->dim->y = p->height; + else + dummyDim.x = p->width, dummyDim.y = p->height; dmxConfigPrintToken(p->start ? p->start : &dummyStart); dmxConfigPrintString(p->vname ? p->vname : &dummyName, 1); @@ -420,36 +497,48 @@ static void dmxConfigPrintVirtual(DMXConfigVirtualPtr p) /** The configuration information in \a entry will be pretty-printed to * the \a stream. If \a stream is NULL, then stdout will be used. */ -void dmxConfigPrint(FILE *stream, DMXConfigEntryPtr entry) +void +dmxConfigPrint(FILE * stream, DMXConfigEntryPtr entry) { DMXConfigEntryPtr pt; - if (!stream) str = stdout; - else str = stream; - + if (!stream) + str = stdout; + else + str = stream; + stack = &initialStack; - + for (pt = entry; pt; pt = pt->next) { switch (pt->type) { - case dmxConfigComment: dmxConfigPrintComment(pt->comment); break; - case dmxConfigVirtual: dmxConfigPrintVirtual(pt->virtual); break; + case dmxConfigComment: + dmxConfigPrintComment(pt->comment); + break; + case dmxConfigVirtual: + dmxConfigPrintVirtual(pt->virtual); + break; default: dmxConfigLog("dmxConfigPrint: cannot handle type %d in entry\n", pt->type); } } - if (pos) dmxConfigNewline(); + if (pos) + dmxConfigNewline(); } /** The configuration information in \a p will be pretty-printed to the * \a stream. If \a stream is NULL, then stdout will be used. */ -void dmxConfigVirtualPrint(FILE *stream, DMXConfigVirtualPtr p) +void +dmxConfigVirtualPrint(FILE * stream, DMXConfigVirtualPtr p) { - if (!stream) str = stdout; - else str = stream; + if (!stream) + str = stdout; + else + str = stream; stack = &initialStack; - + dmxConfigPrintVirtual(p); - if (pos) dmxConfigNewline(); + if (pos) + dmxConfigNewline(); } |