r145: *** empty log message ***
[ctsim.git] / libctgraphics / ezset.cpp
index 09e85e1a70a0492baff7a7d4319c7d3e9ec12847..7b95e30dcddb2f32e23a551696dbb067e0c59a9f 100644 (file)
@@ -6,7 +6,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ezset.cpp,v 1.3 2000/06/20 17:54:51 kevin Exp $
+**  $Id: ezset.cpp,v 1.4 2000/07/13 07:03:21 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -39,7 +39,6 @@ static void initkw(void);
 static int modeinteract = FALSE;
 static int curveinteract = -1;
 static int ezset_firstcall = TRUE;
-static int eztrace = TRUE;
 
 int 
 ezset (char *command)
@@ -565,105 +564,103 @@ static struct key {
        char *keyword;
        int code;
 } keytab[] = {
-       "solid",        S_SOLID,
-       "dash",         S_DASH,
-       "noline",       S_NOLINE,
-       "black",        S_BLACK,
-       "red",          S_RED,
-       "blue",         S_BLUE,
-       "green",        S_GREEN,
-       "pen",          S_PEN,
-       "symbol",       S_SYMBOL,
+       {"solid",       S_SOLID},
+       {"dash",                S_DASH},
+       {"noline",      S_NOLINE},
+       {"black",       S_BLACK},
+       {"red",         S_RED},
+       {"blue",                S_BLUE},
+       {"green",       S_GREEN},
+       {"pen",         S_PEN},
+       {"symbol",      S_SYMBOL},
 /*     "every",        S_EVERY,        */
 /*     "none",         S_NONE,         */
 
-       "curves",       S_CURVES,
-       "curve",        S_CURVES,
+       {"curves",      S_CURVES},
+       {"curve",       S_CURVES},
 /*     "unknown",      S_UNKNOWN,      */
 /*     "end",          S_END,          */
 
-       "legend",       S_LEGEND,
-       "xlegend",      S_XLEGEND,
-       "ylegend",      S_YLEGEND,
-
-       "xlin",         S_XLIN,
-       "ylin",         S_YLIN,
-       "xlog",         S_XLOG,
-       "ylog",         S_YLOG,
-       "xlabel",       S_XLABEL,
-       "ylabel",       S_YLABEL,
-       "xlength",      S_XLENGTH,
-       "ylength",      S_YLENGTH,
-
-       "xticks",       S_XTICKS,
-       "yticks",       S_YTICKS,
-       "above",        S_ABOVE,
-       "label",        S_LABEL,
-       "below",        S_BELOW,
-       "nolabel",      S_NOLABEL,
-       "right",        S_RIGHT,
-       "left",         S_LEFT,
-
-       "xautoscale",   S_XAUTOSCALE,
-       "yautoscale",   S_YAUTOSCALE,
-       "xmin",         S_XMIN,
-       "ymin",         S_YMIN,
-       "xmax",         S_XMAX,
-       "ymax",         S_YMAX,
-       "lxfrac",       S_LXFRAC,
-       "lyfrac",       S_LYFRAC,
-       "xcross",       S_XCROSS,
-       "ycross",       S_YCROSS,
-       "noxaxis",      S_NOXAXIS,
-       "noyaxis",      S_NOYAXIS,
-       "xporigin",     S_XPORIGIN,
-       "yporigin",     S_YPORIGIN,
-       "title",        S_TITLE,
-       "xtitle",       S_XTITLE,
-       "ytitle",       S_YTITLE,
-
-       "replot",       S_REPLOT,
-       "clear",        S_CLEAR,
-       "store",        S_STORE,
-       "restore",      S_RESTORE,
-       "ustart",       S_USTART,
-       "ufinish",      S_UFINISH,
-       "amark",        S_AMARK,
-       "interactive",  S_INTERACTIVE,
-       "units",        S_UNITS,
-       "inches",       S_INCHES,
-       "user",         S_USER,
-
-       "data",         S_DATA,
-       "help",         S_HELP,
-       "exit",         S_EXIT,
-
-       "box",          S_BOX,
-       "nobox",        S_NOBOX,
-       "grid",         S_GRID,
-       "nogrid",       S_NOGRID,
-       "major",        S_MAJOR,
-       "minor",        S_MINOR,
-       "color",        S_COLOR,
-       "legendbox",    S_LEGENDBOX,
-
-       "epson",        S_EPSON,
-       "crt",          S_CRT,
-       "no",           S_NO,
-
-       "textsize",     S_TEXTSIZE,
-       "xbuf",         S_XBUF,
-       "ybuf",         S_YBUF,
-       "prtmode",      S_PRTMODE,
+       {"legend",      S_LEGEND},
+       {"xlegend",     S_XLEGEND},
+       {"ylegend",     S_YLEGEND},
+
+       {"xlin",                S_XLIN},
+       {"ylin",                S_YLIN},
+       {"xlog",                S_XLOG},
+       {"ylog",                S_YLOG},
+       {"xlabel",      S_XLABEL},
+       {"ylabel",      S_YLABEL},
+       {"xlength",     S_XLENGTH},
+       {"ylength",     S_YLENGTH},
+
+       {"xticks",      S_XTICKS},
+       {"yticks",      S_YTICKS},
+       {"above",       S_ABOVE},
+       {"label",       S_LABEL},
+       {"below",       S_BELOW},
+       {"nolabel",     S_NOLABEL},
+       {"right",       S_RIGHT},
+       {"left",                S_LEFT},
+
+       {"xautoscale",  S_XAUTOSCALE},
+       {"yautoscale",  S_YAUTOSCALE},
+       {"xmin",                S_XMIN},
+       {"ymin",                S_YMIN},
+       {"xmax",                S_XMAX},
+       {"ymax",                S_YMAX},
+       {"lxfrac",      S_LXFRAC},
+       {"lyfrac",      S_LYFRAC},
+       {"xcross",      S_XCROSS},
+       {"ycross",      S_YCROSS},
+       {"noxaxis",     S_NOXAXIS},
+       {"noyaxis",     S_NOYAXIS},
+       {"xporigin",    S_XPORIGIN},
+       {"yporigin",    S_YPORIGIN},
+       {"title",       S_TITLE},
+       {"xtitle",      S_XTITLE},
+       {"ytitle",      S_YTITLE},
+
+       {"replot",      S_REPLOT},
+       {"clear",       S_CLEAR},
+       {"store",       S_STORE},
+       {"restore",     S_RESTORE},
+       {"ustart",      S_USTART},
+       {"ufinish",     S_UFINISH},
+       {"amark",       S_AMARK},
+       {"interactive", S_INTERACTIVE},
+       {"units",       S_UNITS},
+       {"inches",      S_INCHES},
+       {"user",                S_USER},
+
+       {"data",                S_DATA},
+       {"help",                S_HELP},
+       {"exit",                S_EXIT},
+
+       {"box",         S_BOX},
+       {"nobox",       S_NOBOX},
+       {"grid",                S_GRID},
+       {"nogrid",      S_NOGRID},
+       {"major",       S_MAJOR},
+       {"minor",       S_MINOR},
+       {"color",       S_COLOR},
+       {"legendbox",   S_LEGENDBOX},
+
+       {"epson",       S_EPSON},
+       {"crt",         S_CRT},
+       {"no",          S_NO},
+
+       {"textsize",    S_TEXTSIZE},
+       {"xbuf",                S_XBUF},
+       {"ybuf",                S_YBUF},
+         //        {"prtmode", S_PRTMOD},
 };
 
-#define NKEYS  (sizeof(keytab) / sizeof(struct key))
+static const unsigned int NKEYS=(sizeof(keytab) / sizeof(struct key));
 
 static void initkw(void)
 {
-       int i;
-
-       for (i = 0; i < NKEYS; i++)
-           if (pol_install(keytab[i].keyword, keytab[i].code) == FALSE)
-               sys_error(ERR_SEVERE, "error installing ezset keywords [initkw]");
+  for (unsigned int i = 0; i < NKEYS; i++)
+    if (pol_install(keytab[i].keyword, keytab[i].code) == FALSE)
+      sys_error(ERR_SEVERE, "error installing ezset keywords [initkw]");
 }