Browse Source

dtksh: Use ksh93 translate over augmented version

We can reduce our differences from upstream ksh by simply using their
ERROR_translate() function instead of our janky and obsolete msg_translate,
we also move DtGetMessage() to msgs.c and lockedfiledescriptors and,
unlockfiledescriptors to extra.c to lessen modifications to init.c, which
all changes will hopefully be moved elsewhere in the future
Chase 3 years ago
parent
commit
461d326bbe

+ 1 - 1
cde/programs/dtksh/XtCvtrs.c

@@ -149,7 +149,7 @@ DtkshCvtStringToPixel(
             {
                char * errbuf;
 
-	       errmsg = GETMESSAGE(1, 1, 
+	       errmsg = GETMESSAGE(
                         "DtkshCvtStringToPixel: The color '%s' is not defined");
                errbuf = XtMalloc(strlen(errmsg) + strlen(str) + 10);
                sprintf(errbuf, errmsg, str);

File diff suppressed because it is too large
+ 112 - 112
cde/programs/dtksh/dtkcmds.c


+ 14 - 14
cde/programs/dtksh/dtkcvt.c

@@ -105,7 +105,7 @@ DtkshCvtWindowToString(
 
    if (fval->size != sizeof(Window))
    {
-      errmsg = strdup(GETMESSAGE(6,1, 
+      errmsg = strdup(GETMESSAGE(
             "DtkshCvtWindowToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -135,7 +135,7 @@ DtkshCvtScreenToString(
 
    if (fval->size != sizeof(Screen *))
    {
-      errmsg = strdup(GETMESSAGE(6,14, 
+      errmsg = strdup(GETMESSAGE(
             "DtkshCvtScreenToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -225,7 +225,7 @@ DtkshCvtHexIntToString(
    if (fval->size != sizeof(long) && fval->size != sizeof(int) && 
        fval->size != sizeof(short) && fval->size != sizeof(char)) 
    {
-      errmsg = strdup(GETMESSAGE(6,2, 
+      errmsg = strdup(GETMESSAGE(
            "DtkshCvtHexIntToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -257,7 +257,7 @@ DtkshCvtIntToString(
 
    if (fval->size != sizeof(int) && fval->size != sizeof(short)) 
    {
-      errmsg = strdup(GETMESSAGE(6,3, 
+      errmsg = strdup(GETMESSAGE(
              "DtkshCvtIntToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -286,7 +286,7 @@ DtkshCvtBooleanToString(
    if (fval->size != sizeof(int) && fval->size != sizeof(short) &&
        fval->size != sizeof(char)) 
    {
-      errmsg = strdup(GETMESSAGE(6,4, 
+      errmsg = strdup(GETMESSAGE(
              "DtkshCvtBooleanToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -347,7 +347,7 @@ DtkshCvtStringToWidget(
 
    if (fval->size <= 0) 
    {
-      errmsg = strdup(GETMESSAGE(6,5, 
+      errmsg = strdup(GETMESSAGE(
              "DtkshCvtStringToWidget: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -387,7 +387,7 @@ DtkshCvtStringToWidget(
    {
       char errbuf[1024];
 
-      errmsg = strdup(GETMESSAGE(6,6, 
+      errmsg = strdup(GETMESSAGE(
                "DtkshCvtStringToWidget: Unable to find a widget named '%s'"));
       sprintf(errbuf, errmsg, wname);
       XtWarning(errbuf);
@@ -414,7 +414,7 @@ DtkshCvtStringToCallback(
 
    if (fval->size <= 0) 
    {
-      errmsg = strdup(GETMESSAGE(6,7, 
+      errmsg = strdup(GETMESSAGE(
              "DtkshCvtStringToCallback: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -451,7 +451,7 @@ DtkshCvtCallbackToString(
 
    if (fval->size != sizeof(XtCallbackList)) 
    {
-      errmsg = strdup(GETMESSAGE(6,8, 
+      errmsg = strdup(GETMESSAGE(
           "DtkshCvtCallbackToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -508,7 +508,7 @@ DtkshCvtWidgetToString(
 
    if (fval->size != sizeof(Widget) || fval->addr == NULL) 
    {
-      errmsg = strdup(GETMESSAGE(6,9, 
+      errmsg = strdup(GETMESSAGE(
            "DtkshCvtWidgetToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -525,7 +525,7 @@ DtkshCvtWidgetToString(
    }
    if ((w = widget_to_wtab(widget)) == NULL) 
    {
-      errmsg = strdup(GETMESSAGE(6,10, 
+      errmsg = strdup(GETMESSAGE(
           "DtkshCvtWidgetToString: Unable to find a name for the widget"));
       XtWarning(errmsg);
       free(errmsg);
@@ -646,7 +646,7 @@ DtkshCvtWidgetClassToString(
 
    if (fval->size != sizeof(WidgetClass))
    {
-      errmsg = strdup(GETMESSAGE(6,11, 
+      errmsg = strdup(GETMESSAGE(
            "DtkshCvtWidgetClassToString: The 'from' value is an invalid size"));
       XtWarning(errmsg);
       free(errmsg);
@@ -673,7 +673,7 @@ DtkshCvtWidgetClassToString(
    }
 
    /* No match found */
-   errmsg = strdup(GETMESSAGE(6,12,
+   errmsg = strdup(GETMESSAGE(
           "DtkshCvtWidgetClassToString: Unknown widget class"));
    XtWarning(errmsg);
    free(errmsg);
@@ -717,7 +717,7 @@ DtkshCvtStringToWidgetClass(
    }
 
    /* No match found */
-   errmsg = strdup(GETMESSAGE(6,13,
+   errmsg = strdup(GETMESSAGE(
           "DtkshCvtStringToWidgetClass: Unknown widget class name"));
    XtWarning(errmsg);
    free(errmsg);

+ 70 - 0
cde/programs/dtksh/extra.c

@@ -154,3 +154,73 @@ printerrf(
         else
 	   printf("%s\n", buf);
 }
+
+/****************************************************************************
+ *
+ * The following two functions are ugly, but necessary.  Ksh reserves file
+ * descriptors 0 - 9 for use by shell scripts, and has intimate knowledge
+ * of how and when they were opened.  Unfortunately, certain dtksh functions
+ * (XtInitialize, catopen, ttdt_open, _DtActionInvoke, others) open file
+ * descriptors which are not known to ksh.  We can't let these file
+ * descriptors fall in the 0 - 9 range, because we can't afford to have
+ * the shell script overriding our file descriptors.  Therefore, any of
+ * our commands which open files must first lock our file descriptors 0 - 9,
+ * thus forcing the command to get a file descriptor out of the shell's
+ * range.  After the command has opened its file descriptor, it then needs
+ * to unlock file descriptors 0 - 9, so that the shell script will have
+ * access to them again.
+ *
+ **************************************************************************/
+
+
+/*
+ * Return a list of the file descriptors we had to open, to lock out file
+ * descriptors 0 - 9; this list should be freed (and the file descriptors
+ * closed) by calling UnlockkshFileDescriptors().
+ */
+
+int *LockKshFileDescriptors(void)
+{
+   int * fdList;
+   int i;
+   int fd, newfd;
+
+   fdList = (int *)malloc(sizeof(int) * 10);
+   for (i = 0; i < 10; i++)
+      fdList[i] = -1;
+
+   if ((fd = open("/dev/null", O_RDONLY)) >= 0)
+   {
+      if (fd < 10)
+      {
+         fdList[0] = fd;
+         for (i = 1; i < 10; i++)
+         {
+            if ((newfd = dup(fd)) < 10)
+               fdList[i] = newfd;
+            else
+            {
+	       close(newfd);
+               break;
+            }
+         }
+      }
+      else
+         close(fd);
+   }
+
+   return(fdList);
+}
+
+void UnlockKshFileDescriptors(int *fdList)
+{
+   int i;
+
+   for (i = 0; i < 10; i++)
+   {
+      if (fdList[i] != (-1))
+         close(fdList[i]);
+   }
+
+   free((char *)fdList);
+}

+ 2 - 538
cde/programs/dtksh/init.c

@@ -389,520 +389,11 @@ static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t
 }
 
 #ifdef _hdr_locale
-#ifdef BUILD_DTKSH
-/*
- * This version of putenv uses the hash storage to assign environment values
- *
- * The original ksh93 code had this routine called "putenv".  This hid
- * the libc version of putenv, which caused problems for dtksh on systems
- * with shared libraries, as it caused the existence of two separate and
- * non-overlapping environments.  To the best of my knowledge there are
- * no calls to this routine. - harry phinney  8/15/1994.
- */
-int ksh_putenv(const char *name)
-{
-        Namval_t *np;
-        if(name)
-        {
-                np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN);
-                if(!strchr(name,'='))
-                        nv_unset(np);
-        }
-        return(0);
-}
-
-void
-SyncEnv(
-    char *name)
-{
-  char *value, *buf;
-
-  value = getenv(name);
-  if(value != (char *)NULL)
-  {
-    buf = malloc(strlen(name) + strlen(value) + 2);
-    strcpy(buf, name);
-    strcat(buf, "=");
-    strcat(buf, value);
-    ksh_putenv(buf);
-    free(buf);  /* I hope it's legal to free this! */
-  }
-}
-
-/*
- * The following struct is based on an alphanumerically sorted list of
- * all ksh-generated messages which might be displayed, and
- * must be looked up in a message catalog.  The point of this is to
- * translate from the AT&T/UI style of string-based message indexing
- * to the X/OPEN style of message number lookup.  The following struct
- * allows us to do a binary search on the strings to find the associated
- * set number and message ID.  While we could have used the string index
- * as the message number, that would cause headaches if/when we
- * need to add more messages, as all following messages would have to
- * be renumbered.
- */
-typedef struct {
-        char *string;
-        int setNum;
-        int msgNum;
-} MsgStr, *MsgPtr;
-
-static MsgStr allmsgs[] = {
-	{" Done", 25, 1},
-        {" Running", 25, 3},
-        {" [-n] [arg...]", 25, 4},
-        {" [arg...]", 25, 5},
-        {" [dir] [list]", 25, 6},
-        {" [job...]", 25, 7},
-        {" [n]", 25, 8},
-        {" [name [pathname] ]", 25, 9},
-        {" [name]", 25, 10},
-        {" [top] [base]", 25, 11},
-        {" expr...", 25, 12},
-        {" format [arg...]", 25, 13},
-        {" is a function", 25, 14},
-        {" is a keyword", 25, 15},
-        {" is a shell builtin", 25, 16},
-        {" is an exported function", 25, 17},
-        {" is an undefined function", 25, 18},
-        {" name [arg...]", 25, 19},
-        {":a:[name] optstring name [args...]", 25, 20},
-        {" seconds", 25, 21},
-        {"${HOME:-.}/.profile", 25, 23},
-        {"%c: invalid character in expression - %s", 25, 24},
-	{"%c: unknown format specifier", 25, 25},
-        {"%d-%d: invalid range", 25, 26},
-        {"%d: invalid binary script version", 25, 27},
-        {"%s is an alias for ", 25, 28},
-        {"%s is an exported alias for ", 25, 29},
-        {"%s missing", 25, 30},
-        {"%s unknown base", 25, 31},
-        {"%s: ':' expected for '?' operator", 25, 32},
-        {"%s: Ambiguous", 25, 33},
-        {"%s: Arguments must be %job or process ids", 25, 34},
-        {"%s: alias not found\n", 25, 35},
-        {"%s: arithmetic syntax error", 25, 36},
-        {"%s: assignment requires lvalue", 25, 37},
-        {"%s: bad file unit number", 25, 38},
-        {"%s: bad format", 25, 39},
-        {"%s: bad number", 25, 40},
-        {"%s: bad option(s)", 25, 41},
-        {"%s: bad substitution", 25, 42},
-        {"%s: bad trap", 25, 43},
-        {"%s: cannot create", 25, 44},
-        {"%s: cannot execute", 25, 45},
-	{"%s: cannot open", 25, 46},
-        {"%s: divide by zero", 25, 47},
-        {"%s: domain exception", 25, 48},
-        {"%s: fails %s", 25, 49},
-        {"%s: file already exists", 25, 50},
-        {"%s: illegal function name", 25, 51},
-        {"%s: invalid alias name", 25, 52},
-        {"%s: invalid discipline function", 25, 53},
-        {"%s: invalid export name", 25, 54},
-        {"%s: invalid function name", 25, 55},
-        {"%s: invalid name", 25, 56},
-        {"%s: invalid regular expression", 25, 57},
-        {"%s: invalid self reference", 25, 58},
-        {"%s: invalid use of :", 25, 59},
-        {"%s: invalid variable name", 25, 60},
-        {"%s: is not an identifier", 25, 61},
-        {"%s: is read only", 25, 62},
-        {"%s: label not implemented", 25, 63},
-        {"%s: limit exceeded", 25, 64},
-        {"%s: more tokens expected", 25, 65},
-        {"%s: no parent", 25, 66},
-	{"%s: no reference name", 25, 67},
-        {"%s: not found", 25, 68},
-        {"%s: not implemented", 25, 69},
-        {"%s: operands have incompatible types", 25, 70},
-        {"%s: overflow exception", 25, 71},
-        {"%s: parameter not set", 25, 72},
-        {"%s: parameter null or not set", 25, 73},
-        {"%s: recursion too deep", 25, 74},
-        {"%s: reference variable cannot be an array", 25, 75},
-        {"%s: requires pathname argument", 25, 76},
-        {"%s: restricted", 25, 77},
-        {"%s: singularity exception", 25, 78},
-        {"%s: subscript out of range", 25, 79},
-        {"%s: unbalanced parenthesis", 25, 80},
-        {"%s: unknown function", 25, 81},
-        {"%s: unknown locale", 25, 82},
-        {"%s: unknown operator", 25, 83},
-        {"%s: unknown signal name", 25, 84},
-        {"%s: would cause loop", 25, 85},
-        {"(coredump)", 25, 86},
-        {"-c requires argument", 25, 87},
-	{"-e - requires single argument", 25, 88},
-        {"/vpix", 25, 89},
-        {"<command unknown>", 25, 90},
-        {"AC:E#?F#?H:[name]L#?R#?Z#?fi#?[base]lnprtux [name=[value]...]", 25, 91},
-        {"AE#?F#?HL#?R#?Z#?fi#?[base]lnprtux [name=[value]...]", 25, 92},
-        {"Abort", 25, 93},
-        {"Ad:[delim]prst#[timeout]u#[filenum] [name...]", 25, 94},
-        {"Alarm call", 25, 95},
-        {"Bad root node specification", 25, 96},
-        {"Bad system call", 25, 97},
-        {"Broken Pipe", 25, 98},
-        {"Bus error", 25, 99},
-        {"Cannot start job control", 25, 100},
-        {"Current option settings", 25, 101},
-        {"DIL signal", 25, 102},
-        {"Death of Child", 25, 103},
-        {"DircabefhkmnpstuvxCR:[file]o:?[option] [arg...]", 25, 104},
-	{"DircabefhkmnpstuvxCo:?[option] [arg...]", 25, 105},
-        {"EMT trap", 25, 106},
-        {"Exceeded CPU time limit", 25, 107},
-        {"Exceeded file size limit", 25, 108},
-        {"Floating exception", 25, 109},
-        {"HSacdfmnstv [limit]", 25, 110},
-        {"Hangup", 25, 111},
-        {"IO signal", 25, 112},
-        {"Illegal instruction", 25, 113},
-        {"Interrupt", 25, 114},
-        {"Killed", 25, 115},
-        {"LP [dir] [change]", 25, 116},
-        {"Memory fault", 25, 117},
-        {"Migrate process", 25, 118},
-        {"No job control", 25, 119},
-        {"Phone interrupt", 25, 120},
-        {"Polling alarm", 25, 121},
-        {"Power fail", 25, 122},
-        {"Profiling time alarm", 25, 123},
-	{"Quit", 25, 124},
-        {"Resources lost", 25, 125},
-        {"Reverting to old tty driver...", 25, 126},
-        {"S [mask]", 25, 127},
-        {"Security label changed", 25, 129},
-        {"Socket interrupt", 25, 130},
-        {"Sound completed", 25, 131},
-        {"Stopped (signal)", 25, 132},
-        {"Stopped (tty input)", 25, 133},
-        {"Stopped process continued", 25, 134},
-        {"Stopped", 25, 135},
-        {"Stopped(tty output)", 25, 136},
-        {"Switching to new tty driver...", 25, 137},
-        {"System crash soon", 25, 138},
-        {"Terminated", 25, 139},
-        {"Trace/BPT trap", 25, 140},
-        {"Unrecognized version", 25, 141},
-        {"Use 'exit' to terminate this shell", 25, 142},
-        {"User signal 1", 25, 143},
-        {"User signal 2", 25, 144},
-        {"Version not defined", 25, 145},
-	{"Virtual time alarm", 25, 146},
-        {"Window size change", 25, 147},
-        {"You have running jobs", 25, 148},
-        {"You have stopped jobs", 25, 149},
-        {"[_[:alpha:]]*([_[:alnum:]])", 25, 150},
-        {"\n@(#)Version 12/28/93\0\n", 25, 151},
-        {"\n@(#)Version M-12/28/93\0\n", 25, 152},
-        {"\nreal", 25, 153},
-        {"\r\n\007shell will timeout in 60 seconds due to inactivity", 25, 154},
-        {"a name...", 25, 155},
-        {"a:c [command [args...] ]", 25, 156},
-        {"afpv name...", 25, 157},
-        {"alarm %s %.3f\n", 25, 158},
-        {"alarm -r %s +%.3g\n", 25, 159},
-        {"argument expected", 25, 160},
-        {"bad directory", 25, 161},
-        {"bad file unit number", 25, 162},
-        {"bad substitution", 25, 163},
-        {"cannot access parent directories", 25, 164},
-        {"cannot create pipe", 25, 165},
-        {"cannot create tempory file", 25, 166},
-	{"cannot fork", 25, 167},
-        {"cannot get %s", 25, 168},
-        {"cannot set %s", 25, 169},
-        {"cannot set alarm", 25, 170},
-        {"condition(s) required", 25, 171},
-        {"dsf:[library] [name...]", 25, 172},
-        {"e:[editor]lnrsN# [first] [last]", 25, 173},
-        {"end of file", 25, 174},
-        {"f:[format]enprsu:[filenum] [arg...]", 25, 175},
-        {"fnv name...", 25, 176},
-        {"hist -e \"${VISUAL:-${EDITOR:-vi}}\" ", 25, 177},
-        {"history file cannot open", 25, 178},
-        {"incorrect syntax", 25, 179},
-        {"invalid argument of type %c", 25, 180},
-        {"is a shell builtin version of", 25, 181},
-        {"is a tracked alias for", 25, 182},
-        {"kill", 25, 183},
-        {"line %d: $ not preceded by \\", 25, 184},
-        {"line %d: %c within ${} should be quoted", 25, 185},
-        {"line %d: %s unknown label", 25, 186},
-        {"line %d: %s within [[...]] obsolete, use ((...))", 25, 187},
-	{"line %d: '=' obsolete, use '=='", 25, 188},
-        {"line %d: -a obsolete, use -e", 25, 189},
-        {"line %d: \\ in front of %c reserved for future use", 25, 190},
-        {"line %d: `...` obsolete, use $(...)", 25, 191},
-        {"line %d: escape %c to avoid ambiguities", 25, 192},
-        {"line %d: label %s ignored", 25, 193},
-        {"line %d: quote %c to avoid ambiguities", 25, 194},
-        {"line %d: set %s obsolete", 25, 195},
-        {"line %d: spaces required for nested subshell", 25, 196},
-        {"line %d: use braces to avoid ambiguities with $id[...]", 25, 197},
-        {"line %d: use space or tab to separate operators %c and %c", 25, 198},
-        {"ln#[signum]s:[signame] sig...", 25, 199},
-        {"login setuid/setgid shells prohibited", 25, 200},
-        {"mapping", 25, 201},
-        {"newline", 25, 202},
-        {"nlp [job...]", 25, 203},
-        {"no history file", 25, 204},
-        {"no query process", 25, 205},
-        {"no such job", 25, 206},
-        {"no such process", 25, 207},
-        {"not supported", 25, 208},
-	{"off", 25, 209},
-        {"on", 25, 210},
-        {"open file limit exceeded", 25, 211},
-        {"out of memory", 25, 212},
-        {"p [action condition...]", 25, 213},
-        {"p [name[=value]...]", 25, 214},
-        {"parameter not set", 25, 215},
-        {"permission denied", 25, 216},
-        {"process already exists", 25, 217},
-        {"ptx [name=[value]...]", 25, 218},
-        {"pvV name [arg]...", 25, 219},
-        {"r [varname seconds]", 25, 220},
-        {"syntax error at line %d: `%s' %s", 25, 221},
-        {"syntax error at line %d: duplicate label %s", 25, 222},
-        {"syntax error: `%s' %s", 25, 223},
-        {"sys", 25, 224},
-        {"timed out waiting for input", 25, 225},
-        {"unexpected", 25, 226},
-	{"universe not accessible", 25, 227},
-        {"unlimited", 25, 228},
-        {"unmatched", 25, 229},
-        {"user", 25, 230},
-        {"versions", 25, 231},
-        {"write to %d failed", 25, 232},
-        {"you have mail in $_", 25, 233},
-        {"zero byte", 25, 234},
-};
-#define _CLIENT_CAT_NAME "dtksh"
-
-/*
- * Without this proto, standard C says that _DtGetMessage() returns
- * an int, even though it really returns a pointer.  The compiler is
- * then free to use the high 32-bits of the return for
- * something else (like scratch), and that can garble the pointer.
- */
-char *_DtGetMessage(char *filename, int set, int n, char *s);
-#define GETMESSAGE(set, number, string)\
-        (_DtGetMessage(_CLIENT_CAT_NAME, set, number, string))
-
-static int localeChanged = 1;
-
-void LocaleChanged(Namval_t *np, const char *val, int flags, Namfun_t *fp)
-{
-   localeChanged = 1;
-   nv_putv(np, val, flags, fp);
-   setlocale(LC_ALL, "");
-}
-
-static Namdisc_t localeDisc = { 0, LocaleChanged, NULL, NULL, NULL, NULL, NULL, NULL };
-static Namfun_t localeFun = {NULL, NULL };
-
-/****************************************************************************
- *
- * The following two functions are ugly, but necessary.  Ksh reserves file
- * descriptors 0 - 9 for use by shell scripts, and has intimate knowledge
- * of how and when they were opened.  Unfortunately, certain dtksh functions
- * (XtInitialize, catopen, ttdt_open, _DtActionInvoke, others) open file
- * descriptors which are not known to ksh.  We can't let these file
- * descriptors fall in the 0 - 9 range, because we can't afford to have
- * the shell script overriding our file descriptors.  Therefore, any of
- * our commands which open files must first lock our file descriptors 0 - 9,
- * thus forcing the command to get a file descriptor out of the shell's
- * range.  After the command has opened its file descriptor, it then needs
- * to unlock file descriptors 0 - 9, so that the shell script will have
- * access to them again.
- *
- **************************************************************************/
-
-
-/*
- * Return a list of the file descriptors we had to open, to lock out file
- * descriptors 0 - 9; this list should be freed (and the file descriptors
- * closed) by calling UnlockkshFileDescriptors().
- */
-
-int *LockKshFileDescriptors(void)
-{
-   int * fdList;
-   int i;
-   int fd, newfd;
-
-   fdList = (int *)malloc(sizeof(int) * 10);
-   for (i = 0; i < 10; i++)
-      fdList[i] = -1;
-
-   if ((fd = open("/dev/null", O_RDONLY)) >= 0)
-   {
-      if (fd < 10)
-      {
-         fdList[0] = fd;
-         for (i = 1; i < 10; i++)
-         {
-            if ((newfd = dup(fd)) < 10)
-               fdList[i] = newfd;
-            else
-            {
-	       close(newfd);
-               break;
-            }
-         }
-      }
-      else
-         close(fd);
-   }
-
-   return(fdList);
-}
-
-void UnlockKshFileDescriptors(int *fdList)
-{
-   int i;
-
-   for (i = 0; i < 10; i++)
-   {
-      if (fdList[i] != (-1))
-         close(fdList[i]);
-   }
-
-   free((char *)fdList);
-}
-
-/*
- * This function overrides the traditional libDtSvc version of this function.
- * Since ksh dynamically changes to match the user's locale, we potentially
- * need to change our message catalog in the middle of running.
- */
-char *savedNlsPath;
-
-char *_DtGetMessage(char *filename, int set, int n, char *s)
-{
-        nl_catd catopen();
-        char *catgets();
-        int catclose();
-
-        static nl_catd nlmsg_fd = (nl_catd)-1;
-        static char *lang = NULL;
-        char *msg;
-        char * newLang;
-        int * lockedFds;
-        int swappedNlsPath = 0;
-        char *pEqual;
-	static char pathBuf[1024] = {(char)'N', (char)'L', (char)'S', (char)'P',
-                                                                (char)'A', (char)'T', (char)'H', (char)'='};
-
-        if ( localeChanged )
-        {
-                char *oldPath;
-                localeChanged = 0;
-
-                newLang = (char *) getenv ("LANG");
-                if (lang)
-                   free(lang);
-                if (newLang)
-                   lang = strdup(newLang);
-                else
-                   lang = NULL;
-
-                if (nlmsg_fd != (nl_catd)-1)
-                   catclose(nlmsg_fd);
-		if(strcmp((oldPath = getenv("NLSPATH")), savedNlsPath) != 0)
-                {
-                        swappedNlsPath = 1;
-                        pEqual = strchr(pathBuf, '=');
-                        strcpy(pEqual + 1, savedNlsPath);
-                        /*
-                         * Only call putenv if pathBuf isn't already holding NLSPATH
-                         * in the environment.
-                         */
-                        if(oldPath != (pEqual + 1))
-                            putenv(pathBuf);
-                }
-                lockedFds = LockKshFileDescriptors();
-                nlmsg_fd = catopen(filename, 0);
-                UnlockKshFileDescriptors(lockedFds);
-                if(swappedNlsPath != 0)
-                {
-                        swappedNlsPath = 0;
-                        pEqual = strchr(pathBuf, '=');
-                        strcpy(pEqual + 1, oldPath);
-                        if(oldPath != (pEqual + 1))
-			    putenv(pathBuf);
-                }
-        }
-        msg=catgets(nlmsg_fd,set,n,s);
-        return (msg);
-}
-
-    /*
-     * This function needs to be modified to handle international
-     * error message translations
-     */
-static char *msg_translate(const char *message,int type)
-{
-        int startIndex = 0, endIndex = sizeof(allmsgs)/sizeof(MsgStr) - 1,
-            midIndex, res, weFoundIt = 0;
-
-        if(type != 1) /* if it's not a shell message, don't translate */
-            return((char*)message);
-
-        while(startIndex != endIndex)
-        {
-                midIndex = (startIndex + endIndex) / 2;
-                if(midIndex == startIndex)
-                {
-                        if((res = strcmp(allmsgs[startIndex].string, message)) == 0)
-                        {
-                                weFoundIt = 1;
-                                midIndex = startIndex;
-                                break;
-                        }
-                        else if(res < 0)
-			{
-                                if((res = strcmp(allmsgs[endIndex].string, message)) == 0)
-                                {
-                                        weFoundIt = 1;
-                                        midIndex = endIndex;
-                                        break;
-                                }
-                        }
-                        /* we didn't find a match in the table */
-                        weFoundIt = 0;
-                        break;
-                }
-                else
-                {
-                        if((res = strcmp(allmsgs[midIndex].string, message)) == 0)
-                        {
-                                weFoundIt = 1;
-                                break; /* we found it */
-                        }
-                        else if(res < 0)
-                                startIndex = midIndex;
-			else
-                                endIndex = midIndex;
-                }
-        }
-        if(weFoundIt)
-                return GETMESSAGE(allmsgs[midIndex].setNum, allmsgs[midIndex].msgNum, (char *)message);
-
-        return((char*)message);
-
-}
-
-#else
     static char* msg_translate(const char* catalog, const char* message)
     {
 	NOT_USED(catalog);
 	return((char*)message);
     }
-#endif
 
     /* Trap for LC_ALL, LC_CTYPE, LC_MESSAGES, LC_COLLATE and LANG */
     static void put_lang(Namval_t* np,const char *val,int flags,Namfun_t *fp)
@@ -996,11 +487,6 @@ static char *msg_translate(const char *message,int type)
 			sh_lexstates[ST_BRACE]=(char*)sh_lexrstates[ST_BRACE];
 		}
 	}
-#ifdef BUILD_DTKSH
-	if(type==LC_ALL || type==LC_MESSAGES)
-		error_info.translate = msg_translate;
-#endif
-
     }
 #endif /* _hdr_locale */
 
@@ -2017,34 +1503,12 @@ Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit)
 	if(shp->userinit=userinit)
 		(*userinit)(shp, 0);
 #ifdef BUILD_DTKSH
-	int * lockedFds;
-
-        lockedFds = LockKshFileDescriptors();
+	int * lockedFds = LockKshFileDescriptors();
         (void) XtSetLanguageProc((XtAppContext)NULL, (XtLanguageProc)NULL,
                                 (XtPointer)NULL);
-        setlocale(LC_ALL, "");
-        DtNlInitialize();
+	DtNlInitialize();
         _DtEnvControl(DT_ENV_SET);
-        localeFun.disc = &localeDisc;
-        nv_stack(LANGNOD, &localeFun);
         UnlockKshFileDescriptors(lockedFds);
-
-        /*
-        * Save the current setting of NLSPATH.  The user/script may want to
-        * set its own NLSPATH to access its message catalog, so we need to
-        * remember where to find our own catalog(s).  This saved path is used
-        * in ksh93/src/cmd/ksh93/sh/init.c: _DtGetMessage().  We don't mess
-        * with the user/script's setting of LANG as we want to track changes
-        * in LANG.
-        */
-	savedNlsPath = strdup(getenv("NLSPATH"));
-
-        /*
-        * Sync the libc environment (set up by DtEnvControl) with our internal
-        * hash table environment.
-        */
-        SyncEnv("NLSPATH");
-        SyncEnv("LANG");
 #endif
 	return(shp);
 }

+ 42 - 36
cde/programs/dtksh/msgs.c

@@ -28,7 +28,13 @@
 #include <nl_types.h>
 #endif
 #include "msgs.h"
+#include "error.h"
 
+char *_DtGetMessage(char *filename, char *s)
+{
+    char * loc = getenv("LANG");
+    return(ERROR_translate(loc, 0, _CLIENT_CAT_NAME, s));
+}
 
 char *
 GetSharedMsg(
@@ -39,147 +45,147 @@ GetSharedMsg(
    switch (msgId)
    {
       case DT_BAD_FIELD_NAME:
-         msg = GETMESSAGE(11,1, "Cannot find a field named '%s' in the structure '%s'");
+         msg = GETMESSAGE("Cannot find a field named '%s' in the structure '%s'");
          break;
 
       case DT_CONV_BUF_OVFL:
-         msg = GETMESSAGE(11,2, "DtkshCvtCallbackToString: An internal conversion buffer overflowed");
+         msg = GETMESSAGE("DtkshCvtCallbackToString: An internal conversion buffer overflowed");
          break;
 
       case DT_HASHING_FAILURE:
-         msg = GETMESSAGE(11,3, "Hashing failure for resource '%s' in widget class '%s'");
+         msg = GETMESSAGE("Hashing failure for resource '%s' in widget class '%s'");
          break;
 
       case DT_NO_FUNC_NAME:
-         msg = GETMESSAGE(11,4, "No function name was supplied");
+         msg = GETMESSAGE("No function name was supplied");
          break;
 
       case DT_TK_NOT_INIT:
-         msg = GETMESSAGE(11,5, "The command cannot be executed; the toolkit has not been initialized");
+         msg = GETMESSAGE("The command cannot be executed; the toolkit has not been initialized");
          break;
 
       case DT_WIDGET_CREATE_FAILED:
-         msg = GETMESSAGE(11,6, "The creation of widget '%s' failed");
+         msg = GETMESSAGE("The creation of widget '%s' failed");
          break;
 
       case DT_BAD_DISPLAY:
-         msg = GETMESSAGE(11,7, "The display parameter is invalid: %s");
+         msg = GETMESSAGE("The display parameter is invalid: %s");
          break;
 
       case DT_BAD_ATOM:
-         msg = GETMESSAGE(11,8, "The following property atom is invalid: %s");
+         msg = GETMESSAGE("The following property atom is invalid: %s");
          break;
 
       case DT_UNDEF_RESOURCE:
-         msg = GETMESSAGE(11,9, "The following resource is not defined for widget '%s': %s");
+         msg = GETMESSAGE("The following resource is not defined for widget '%s': %s");
          break;
 
       case DT_BAD_POSITION:
-         msg = GETMESSAGE(11,10, "The position specified is invalid: %s");
+         msg = GETMESSAGE("The position specified is invalid: %s");
          break;
 
       case DT_BAD_FONT:
-         msg = GETMESSAGE(11,11, "The specified font is invalid: %s");
+         msg = GETMESSAGE("The specified font is invalid: %s");
          break;
 
       case DT_BAD_WIDGET_HANDLE:
-         msg = GETMESSAGE(11,12, "The widget handle '%s' does not refer to an existing widget");
+         msg = GETMESSAGE("The widget handle '%s' does not refer to an existing widget");
          break;
 
       case DT_CMD_WIDGET:
-         msg = GETMESSAGE(11,13, "The widget must be a 'command' widget");
+         msg = GETMESSAGE("The widget must be a 'command' widget");
          break;
 
       case DT_MAIN_WIN_WIDGET:
-         msg = GETMESSAGE(11,14, "The widget must be a 'mainWindow' widget");
+         msg = GETMESSAGE("The widget must be a 'mainWindow' widget");
          break;
 
       case DT_SCALE_WIDGET:
-         msg = GETMESSAGE(11,15, "The widget must be a 'scale' widget");
+         msg = GETMESSAGE("The widget must be a 'scale' widget");
          break;
 
       case DT_SCROLLBAR_WIDGET:
-         msg = GETMESSAGE(11,16, "The widget must be a 'scrollBar' widget");
+         msg = GETMESSAGE("The widget must be a 'scrollBar' widget");
          break;
 
       case DT_TOGGLE_WIDGET:
-         msg = GETMESSAGE(11,17, "The widget must be a 'toggleButton' widget or gadget");
+         msg = GETMESSAGE("The widget must be a 'toggleButton' widget or gadget");
          break;
 
       case DT_BAD_WINDOW:
-         msg = GETMESSAGE(11,18, "The window parameter is invalid: %s");
+         msg = GETMESSAGE("The window parameter is invalid: %s");
          break;
 
       case DT_ALLOC_FAILURE:
-         msg = GETMESSAGE(11,19, "Unable to allocate required memory; exiting");
+         msg = GETMESSAGE("Unable to allocate required memory; exiting");
          break;
 
       case DT_NO_PARENT:
-         msg = GETMESSAGE(11,20, "Unable to find the parent widget");
+         msg = GETMESSAGE("Unable to find the parent widget");
          break;
 
       case DT_UNDEF_SYMBOL:
-         msg = GETMESSAGE(11,21, "Unable to locate the symbol '%s'");
+         msg = GETMESSAGE("Unable to locate the symbol '%s'");
          break;
 
       case DT_UNDEF_TYPE:
-         msg = GETMESSAGE(11,22, "Unable to locate the type '%s'");
+         msg = GETMESSAGE("Unable to locate the type '%s'");
          break;
 
       case DT_BAD_DECL:
-         msg = GETMESSAGE(11,23, "Unable to parse the declaration '%s'; using 'unsigned long'");
+         msg = GETMESSAGE("Unable to parse the declaration '%s'; using 'unsigned long'");
          break;
 
       case DT_UNKNOWN_CHILD_TYPE:
-         msg = GETMESSAGE(11,24, "Unknown child type: %s");
+         msg = GETMESSAGE("Unknown child type: %s");
          break;
 
       case DT_UNKNOWN_OPTION:
-         msg = GETMESSAGE(11,25, "Unrecognized option flag: %s");
+         msg = GETMESSAGE("Unrecognized option flag: %s");
          break;
 
       case DT_USAGE_WIDGET_POS:
-         msg = GETMESSAGE(11,26, "Usage: %s widget position");
+         msg = GETMESSAGE("Usage: %s widget position");
          break;
 
       case DT_USAGE_WIDGET_TIME:
-         msg = GETMESSAGE(11,27, "Usage: %s widget time");
+         msg = GETMESSAGE("Usage: %s widget time");
          break;
 
       case DT_USAGE_WIDGET:
-         msg = GETMESSAGE(11,28, "Usage: %s widget");
+         msg = GETMESSAGE("Usage: %s widget");
          break;
 
       case DTKSH_ERROR:
-         msg = GETMESSAGE(11,29, "dtksh error");
+         msg = GETMESSAGE("dtksh error");
          break;
 
       case DT_WARNING:
-         msg = GETMESSAGE(11,30, "dtksh warning");
+         msg = GETMESSAGE("dtksh warning");
          break;
 
       case DT_USAGE_DISPLAY_WINDOW:
-         msg = GETMESSAGE(11,31, "Usage: %s display window");
+         msg = GETMESSAGE("Usage: %s display window");
          break;
 
       case DT_USAGE_DISPLAY_WINDOW_VAR:
-         msg = GETMESSAGE(11,32, "Usage: %s display window variable");
+         msg = GETMESSAGE("Usage: %s display window variable");
          break;
 
       case DT_USAGE_DISPLAY_ROOT_VAR:
-         msg = GETMESSAGE(11,33, "Usage: %s display rootWindow variable");
+         msg = GETMESSAGE("Usage: %s display rootWindow variable");
          break;
 
       case DT_BAD_TIMEOUT:
-         msg = GETMESSAGE(11,34, "The timeout parameter is invalid: %s");
+         msg = GETMESSAGE("The timeout parameter is invalid: %s");
          break;
 
       case DT_BAD_MESSAGE:
-         msg = GETMESSAGE(11,35, "The msg parameter is invalid: %s");
+         msg = GETMESSAGE("The msg parameter is invalid: %s");
          break;
 
       case DT_BAD_PATTERN:
-         msg = GETMESSAGE(11,36, "The patterns parameter is invalid: %s");
+         msg = GETMESSAGE("The patterns parameter is invalid: %s");
          break;
    }
    return(msg);

+ 4 - 4
cde/programs/dtksh/msgs.h

@@ -65,13 +65,13 @@ char * GetSharedMsg(
 # ifdef _NO_PROTO
 extern char *_DtGetMessage();
 # else  /* _NO_PROTO */
-extern char *_DtGetMessage(char *filename, int set, int n, char *s );
+extern char *_DtGetMessage(char *filename, char *s );
 # endif /* _NO_PROTO */
 
-# define GETMESSAGE(set, number, string)\
-    (_DtGetMessage(_CLIENT_CAT_NAME, set, number, string))
+# define GETMESSAGE(string)\
+    (_DtGetMessage(_CLIENT_CAT_NAME, string))
 #else
-# define GETMESSAGE(set, number, string)\
+# define GETMESSAGE(string)\
     string
 #endif
 

+ 15 - 16
cde/programs/dtksh/widget.c

@@ -130,7 +130,7 @@ init_widgets( void )
                 if ((nam = hashput(Wclasses, C[i].cname, (char *)(&C[i]))) == NULL) 
                 {
                          errhdr = strdup(GetSharedMsg(DTKSH_ERROR));
-                         errmsg = strdup(GETMESSAGE(14,1, 
+                         errmsg = strdup(GETMESSAGE(
                                  "Internal hash table failure during widget class initialization; exiting"));
                          printerr(errhdr, errmsg, NULL);
                          free(errhdr);
@@ -303,7 +303,7 @@ str_to_class(
       return(ret);
    }
 
-   errmsg = strdup(GETMESSAGE(14,2, 
+   errmsg = strdup(GETMESSAGE(
                    "Could not find a widget class named '%s'"));
    printerrf(arg0, errmsg, s, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
    free(errmsg);
@@ -368,7 +368,7 @@ str_to_wtab(
 		if ((wid = DtkshNameToWidget(v)) == NULL) {
 			if (arg0)
                         {
-                                errmsg = strdup(GETMESSAGE(14,3, 
+                                errmsg = strdup(GETMESSAGE(
                                   "The identifier '%s' is not a valid widget handle"));
 				printerrf(arg0, errmsg, v,
                                           NULL, NULL, NULL, NULL, NULL,
@@ -472,7 +472,7 @@ widget_to_wtab(
 			}
 		}
 		if (class == NULL) {
-                        errmsg = strdup(GETMESSAGE(14,4, 
+                        errmsg = strdup(GETMESSAGE(
                               "Unable to find the widget class"));
 			printerr("widget_to_wtab", errmsg, NULL);
                         free(errmsg);
@@ -593,7 +593,7 @@ do_DtLoadWidget(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(14,5, 
+      errmsg = strdup(GETMESSAGE(
                "Usage: DtLoadWidget widgetClassName widgetClassRecordName"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -602,7 +602,7 @@ do_DtLoadWidget(
 
    if ((address = (void *)fsym(argv[2], -1)) == NULL) 
    {
-      errmsg = strdup(GETMESSAGE(14,6, 
+      errmsg = strdup(GETMESSAGE(
                     "Unable to locate a widget class record named '%s'"));
       printerrf(argv[0], errmsg,
                 argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -618,7 +618,7 @@ do_DtLoadWidget(
       if ((nam = hashput(Wclasses, classtab->cname, (char *)classtab)) == NULL)
       {
          errhdr = strdup(GetSharedMsg(DTKSH_ERROR));
-         errmsg= strdup(GETMESSAGE(14,7, 
+         errmsg= strdup(GETMESSAGE(
             "Internal hash table failure during initialization of widget class '%s'"));
          printerrf(errhdr, errmsg, classtab->cname,
                    NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -692,8 +692,8 @@ _pr_resource(
 	if (Show_constraint && c->con == NULL)	/* No constraint resources */
 		return;
 
-	errmsg = strdup(GETMESSAGE(14,8, "\n%sRESOURCES FOR %s%s%s:\n"));
-	errmsg2 = strdup(Show_constraint ? GETMESSAGE(14,9, "CONSTRAINT ") : 
+	errmsg = strdup(GETMESSAGE("\n%sRESOURCES FOR %s%s%s:\n"));
+	errmsg2 = strdup(Show_constraint ? GETMESSAGE("CONSTRAINT ") :
                          str_nill);
 	printf(errmsg, errmsg2,
                 c->cname,
@@ -779,11 +779,10 @@ pr_widinfo(
 
         if (errmsg == NULL)
         {
-	   errmsg = strdup(GETMESSAGE(14,13, 
-                           "%-15s %-6s %-6s %-18s %-6s %s\n"));
-	   realizedStr = strdup(GETMESSAGE(14,10, "R"));
-	   managedStr = strdup(GETMESSAGE(14,11, "M"));
-	   sensitiveStr = strdup(GETMESSAGE(14,12, "S"));
+	   errmsg = strdup(GETMESSAGE("%-15s %-6s %-6s %-18s %-6s %s\n"));
+	   realizedStr = strdup(GETMESSAGE("R"));
+	   managedStr = strdup(GETMESSAGE("M"));
+	   sensitiveStr = strdup(GETMESSAGE("S"));
         }
 
 	name = getname(w, namebuf, sizeof(namebuf));
@@ -806,7 +805,7 @@ pr_widheader( void )
 {
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(14,14, 
+   errmsg = strdup(GETMESSAGE(
             "ENV VARIABLE    HANDLE PARENT CLASS              STATUS NAME\n"));
    printf(errmsg);
    free(errmsg);
@@ -914,7 +913,7 @@ do_DtWidgetInfo(
                                   NULL, NULL, NULL, NULL, NULL, NULL);
                         free(errmsg);
 
-                        errmsg = strdup(GETMESSAGE(14,15, "\nUsage:\tDtWidgetInfo [widgetHandle]\n\tDtWidgetInfo -r <widgetHandle|className>\n\tDtWidgetInfo -R <widgetHandle|className>\n\tDtWidgetInfo -c [className]\n\tDtWidgetInfo -h [widgetHandle]"));
+                        errmsg = strdup(GETMESSAGE("\nUsage:\tDtWidgetInfo [widgetHandle]\n\tDtWidgetInfo -r <widgetHandle|className>\n\tDtWidgetInfo -R <widgetHandle|className>\n\tDtWidgetInfo -c [className]\n\tDtWidgetInfo -h [widgetHandle]"));
 		        printerr(str_nill, errmsg, NULL);
                         free(errmsg);
 			return(255);

+ 103 - 110
cde/programs/dtksh/xmcmds.c

@@ -386,7 +386,7 @@ toolkit_initialize(
 							0, &newargc, newargv);
 
 	if (Toplevel == NULL) {
-		errmsg = strdup(GETMESSAGE(15,1, 
+		errmsg = strdup(GETMESSAGE(
                                 "Unable to initialize the Toolkit"));
 		printerr(argv[0], errmsg, NULL);
                 free(errmsg);
@@ -659,7 +659,7 @@ _xmcreatefunc(
 	char ** pargv;
 
 	if (argc < 4) {
-                errmsg = strdup(GETMESSAGE(15,3, 
+                errmsg = strdup(GETMESSAGE(
                      "Usage: %s variable parent name [argument:value ...]"));
 		printerrf(str_nill, errmsg, argv[0], NULL,
                     NULL, NULL, NULL, NULL, NULL, NULL);
@@ -1287,7 +1287,7 @@ do_DtHelpReturnSelectedWidgetId(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,4, 
+      errmsg = strdup(GETMESSAGE(
          "Usage: DtHelpReturnSelectedWidgetId variable widget variable"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -1334,7 +1334,7 @@ do_DtHelpSetCatalogName(
 
    if (argc != 2) 
    {
-      errmsg = strdup(GETMESSAGE(15,5, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: DtHelpSetCatalogName catalogName"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -1364,7 +1364,7 @@ do_DtHelpQuickDialogGetChild(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,6, 
+      errmsg = strdup(GETMESSAGE(
             "Usage: DtHelpQuickDialogGetChild variable quickHelpWidget child"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -1378,7 +1378,7 @@ do_DtHelpQuickDialogGetChild(
    }
 
    if (w->wclass->class != dtHelpQuickDialogWidgetClass) {
-      errmsg = strdup(GETMESSAGE(15,7, 
+      errmsg = strdup(GETMESSAGE(
                       "The widget must be a 'quickHelp' widget"));
       printerr(arg0, errmsg, NULL);
       free(errmsg);
@@ -1432,7 +1432,7 @@ verifyListWidget(
 
    if (w->wclass->class != xmListWidgetClass) 
    {
-      errmsg = strdup(GETMESSAGE(15,8, "The widget must be a 'list' widget"));
+      errmsg = strdup(GETMESSAGE("The widget must be a 'list' widget"));
       printerr(cmd, errmsg, NULL);
       free(errmsg);
       return(NULL);
@@ -1456,7 +1456,7 @@ List_ItemAndPos(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,9, "Usage: %s widget position item"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget position item"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL, NULL, NULL, NULL, 
                 NULL);
       free(errmsg);
@@ -1510,7 +1510,7 @@ List_ItemListAndPos(
 
    if (argc < 4)
    {
-      errmsg = strdup(GETMESSAGE(15,10, "Usage: %s widget position itemList"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget position itemList"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL,
                 NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -1647,7 +1647,7 @@ List_ItemOnly(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,11, "Usage: %s widget item"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget item"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL, NULL,
                 NULL, NULL, NULL);
       free(errmsg);
@@ -1788,7 +1788,7 @@ do_XmListDeleteItemsPos(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,12, 
+      errmsg = strdup(GETMESSAGE(
                "Usage: XmListDeleteItemsPos widget count position"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -1820,7 +1820,7 @@ do_XmListDeleteItems(
 
    if (argc < 3)
    {
-      errmsg = strdup(GETMESSAGE(15,13, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: XmListDeleteItems widget itemList"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -1866,7 +1866,7 @@ do_XmListDeletePositions(
 
    if (argc < 3)
    {
-      errmsg = strdup(GETMESSAGE(15,14, 
+      errmsg = strdup(GETMESSAGE(
            "Usage: XmListDeletePositions widget positionList"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -1967,7 +1967,7 @@ do_XmListGetSelectedPos(
    Boolean result;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,94, 
+   errmsg = strdup(GETMESSAGE(
                    "Usage: XmListGetSelectedPos variable widget"));
    result = GetSelectedPosList(XmListGetSelectedPos, 3, errmsg, argc, argv);
    free(errmsg);
@@ -1983,7 +1983,7 @@ do_XmListGetMatchPos(
    Boolean result;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,95, 
+   errmsg = strdup(GETMESSAGE(
                    "Usage: XmListGetMatchPos variable widget item"));
    result = GetSelectedPosList(XmListGetMatchPos, 4, errmsg, argc, argv);
    free(errmsg);
@@ -2005,7 +2005,7 @@ do_XmListGetKbdItemPos(
 
    if (argc != 3)
    {
-      errmsg = strdup(GETMESSAGE(15,15, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: XmListGetKbdItemPos variable widget"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2039,7 +2039,7 @@ do_XmListItemExists(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,16, "Usage: XmListItemExists widget item"));
+      errmsg = strdup(GETMESSAGE("Usage: XmListItemExists widget item"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2071,8 +2071,7 @@ do_XmListItemPos(
 
    if (argc != 4)
    {
-      errmsg = strdup(GETMESSAGE(15,17, 
-                      "Usage: XmListItemPos variable widget item"));
+      errmsg = strdup(GETMESSAGE("Usage: XmListItemPos variable widget item"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2107,8 +2106,7 @@ do_XmListPosSelected(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,18, 
-                      "Usage: XmListPosSelected widget position"));
+      errmsg = strdup(GETMESSAGE("Usage: XmListPosSelected widget position"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2142,7 +2140,7 @@ do_XmListPosToBounds(
 
    if (argc != 7) 
    {
-      errmsg=strdup(GETMESSAGE(15,19, 
+      errmsg=strdup(GETMESSAGE(
             "Usage: XmListPosToBounds widget position variable variable variable variable"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2203,12 +2201,11 @@ ListSelectItem(
    {
       if (usePosition)
       {
-         errmsg = strdup(GETMESSAGE(15,20, 
-                         "Usage: %s widget position notifyFlag"));
+         errmsg = strdup(GETMESSAGE("Usage: %s widget position notifyFlag"));
       }
       else
       {
-         errmsg = strdup(GETMESSAGE(15,21, "Usage: %s widget item notifyFlag"));
+         errmsg = strdup(GETMESSAGE("Usage: %s widget item notifyFlag"));
       }
 
       printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL, NULL, NULL, NULL, 
@@ -2276,8 +2273,7 @@ do_XmListSetAddMode(
 
    if (argc != 3)
    {
-      errmsg = strdup(GETMESSAGE(15,22, 
-                      "Usage: XmListSetAddMode widget boolean"));
+      errmsg = strdup(GETMESSAGE("Usage: XmListSetAddMode widget boolean"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2312,7 +2308,7 @@ do_XmListSetKbdItemPos(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,23, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: XmListSetKbdItemPos widget position"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2341,7 +2337,7 @@ do_XmMainWindowSetAreas(
 
    if (argc != 7) 
    {
-      errmsg=strdup(GETMESSAGE(15,24, 
+      errmsg=strdup(GETMESSAGE(
            "Usage: XmMainWindowSetAreas mainwindow menu command hscroll vscroll work"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2363,7 +2359,7 @@ do_XmMainWindowSetAreas(
    }
 
    if (w[0] == NULL) {
-      errmsg = strdup(GETMESSAGE(15,25, "The 'mainWindow' handle is NULL"));
+      errmsg = strdup(GETMESSAGE("The 'mainWindow' handle is NULL"));
       printerr(argv[0], errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2402,7 +2398,7 @@ GetMainWindowSeparator(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,26, "Usage: %s variable mainwindow"));
+      errmsg = strdup(GETMESSAGE("Usage: %s variable mainwindow"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL,
                 NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -2480,8 +2476,7 @@ do_XmProcessTraversal(
    char * errmsg;
 
    if (argc != 3) {
-      errmsg = strdup(GETMESSAGE(15,27, 
-                      "Usage: XmProcessTraversal widget direction"));
+      errmsg = strdup(GETMESSAGE("Usage: XmProcessTraversal widget direction"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2504,7 +2499,7 @@ do_XmProcessTraversal(
    } 
    else 
    {
-      errmsg = strdup(GETMESSAGE(15,28, "Unknown traversal direction: %s"));
+      errmsg = strdup(GETMESSAGE("Unknown traversal direction: %s"));
       printerrf(argv[0], errmsg, argv[2], NULL,
                 NULL, NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -2528,7 +2523,7 @@ do_XmInternAtom(
 
    if (argc != 5)
    {
-      errmsg = strdup(GETMESSAGE(15,29, 
+      errmsg = strdup(GETMESSAGE(
              "Usage: XmInternAtom variable display name onlyIfExists"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2591,8 +2586,7 @@ do_XmGetAtomName(
 
    if (argc != 4)
    {
-      errmsg = strdup(GETMESSAGE(15,30, 
-                      "Usage: XmGetAtomName variable display atom"));
+      errmsg = strdup(GETMESSAGE("Usage: XmGetAtomName variable display atom"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2612,7 +2606,7 @@ do_XmGetAtomName(
    atom = (Atom)strtoul(argv[3], &p, 0);
    if (p == argv[3]) 
    {
-      errmsg = strdup(GETMESSAGE(15,31, "The specified atom is invalid: %s"));
+      errmsg = strdup(GETMESSAGE("The specified atom is invalid: %s"));
       printerrf(argv[0], errmsg, argv[3],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -2654,7 +2648,7 @@ do_XmGetColors(
 
    if (argc != 7)
    {
-      errmsg=strdup(GETMESSAGE(15,32, 
+      errmsg=strdup(GETMESSAGE(
           "Usage: XmGetColors widget background foreground topshadow bottomshadow select"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2674,7 +2668,7 @@ do_XmGetColors(
    background = strtoul(argv[2], &p, 0);
    if (p == argv[2]) 
    {
-      errmsg = strdup(GETMESSAGE(15,33, "The background pixel is invalid: %s"));
+      errmsg = strdup(GETMESSAGE("The background pixel is invalid: %s"));
       printerrf(argv[0], errmsg, argv[2],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -2714,7 +2708,7 @@ do_XmUpdateDisplay(
 
    if (argc != 2)
    {
-      errmsg = strdup(GETMESSAGE(15,34, "Usage: XmUpdateDisplay widget"));
+      errmsg = strdup(GETMESSAGE("Usage: XmUpdateDisplay widget"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2742,7 +2736,7 @@ AddOrDeleteWMProtocols(
 
    if (argc < 3)
    {
-      errmsg = strdup(GETMESSAGE(15,35, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: %s widget protocol [protocol ...]"));
       printerrf(argv[0], errmsg, argv[0],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -2760,8 +2754,7 @@ AddOrDeleteWMProtocols(
       protocolList[i - 2] = (Atom)strtoul(argv[i], &p, 0);
       if (p == argv[i])
       {
-         errmsg = strdup(GETMESSAGE(15,36, 
-                         "The atom specified is invalid: %s"));
+         errmsg = strdup(GETMESSAGE("The atom specified is invalid: %s"));
          printerrf(argv[0], errmsg, argv[i],
                    NULL, NULL, NULL, NULL, NULL, NULL, NULL);
          free(errmsg);
@@ -2806,7 +2799,7 @@ do_XmAddWMProtocolCallback(
 
    if (argc != 4)
    {
-      errmsg = strdup(GETMESSAGE(15,37, 
+      errmsg = strdup(GETMESSAGE(
             "Usage: XmAddWMProtocolCallback widget protocol ksh-command"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2825,7 +2818,7 @@ do_XmRemoveWMProtocolCallback(
 
    if (argc != 4)
    {
-      errmsg = strdup(GETMESSAGE(15,38, 
+      errmsg = strdup(GETMESSAGE(
           "Usage: XmRemoveWMProtocolCallback widget protocol ksh-command"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2848,7 +2841,7 @@ do_XmMenuPosition(
 
    if (argc != 3)
    {
-      errmsg = strdup(GETMESSAGE(15,39, "Usage: XmMenuPosition menu event"));
+      errmsg = strdup(GETMESSAGE("Usage: XmMenuPosition menu event"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -2861,7 +2854,7 @@ do_XmMenuPosition(
    event = (XEvent *)strtoul(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,40, "The specified event is invalid: %s"));
+      errmsg = strdup(GETMESSAGE("The specified event is invalid: %s"));
       printerrf(argv[0], errmsg, argv[2], NULL,
                 NULL, NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -2885,7 +2878,7 @@ do_XmCommandAppendValue(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,41, 
+      errmsg = strdup(GETMESSAGE(
              "Usage: XmCommandAppendValue commandWidget string"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2923,7 +2916,7 @@ do_XmCommandError(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,42, 
+      errmsg = strdup(GETMESSAGE(
           "Usage: XmCommandError commandWidget errorMessage"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -2961,7 +2954,7 @@ do_XmCommandSetValue(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,43, 
+      errmsg = strdup(GETMESSAGE(
               "Usage: XmCommandSetValue commandWidget command"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3004,7 +2997,7 @@ do_XmCommandGetChild(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,44, 
+      errmsg = strdup(GETMESSAGE(
              "Usage: XmCommandGetChild variable commandWidget child"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3075,7 +3068,7 @@ do_XmMessageBoxGetChild(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,45, 
+      errmsg = strdup(GETMESSAGE(
             "Usage: XmMessageBoxGetChild variable commandWidget child"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3089,7 +3082,7 @@ do_XmMessageBoxGetChild(
    }
 
    if (w->wclass->class != xmMessageBoxWidgetClass) {
-      errmsg = strdup(GETMESSAGE(15,46, 
+      errmsg = strdup(GETMESSAGE(
                       "The widget must be a 'messageBox' widget"));
       printerr(arg0, errmsg, NULL);
       free(errmsg);
@@ -3147,7 +3140,7 @@ do_XmFileSelectionBoxGetChild(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,47, 
+      errmsg = strdup(GETMESSAGE(
              "Usage: XmFileSelectionBoxGetChild variable widget child"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3161,7 +3154,7 @@ do_XmFileSelectionBoxGetChild(
    }
 
    if (w->wclass->class != xmFileSelectionBoxWidgetClass) {
-      errmsg = strdup(GETMESSAGE(15,48, 
+      errmsg = strdup(GETMESSAGE(
             "The widget must be a 'file selection box' widget"));
       printerr(arg0, errmsg, NULL);
       free(errmsg);
@@ -3219,7 +3212,7 @@ do_XmSelectionBoxGetChild(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,49, 
+      errmsg = strdup(GETMESSAGE(
               "Usage: XmSelectionBoxGetChild variable widget child"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3233,7 +3226,7 @@ do_XmSelectionBoxGetChild(
    }
 
    if (w->wclass->class != xmSelectionBoxWidgetClass) {
-      errmsg = strdup(GETMESSAGE(15,50, 
+      errmsg = strdup(GETMESSAGE(
              "The widget must be a 'selection box' widget"));
       printerr(arg0, errmsg, NULL);
       free(errmsg);
@@ -3297,7 +3290,7 @@ do_XmScaleGetValue(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,51, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: XmScaleGetValue scaleWidget variable"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3340,7 +3333,7 @@ do_XmScaleSetValue(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,52, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: XmScaleSetValue scaleWidget value"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3361,7 +3354,7 @@ do_XmScaleSetValue(
    scaleValue = strtol(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,53, 
+      errmsg = strdup(GETMESSAGE(
                       "The scale value specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[2],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -3390,7 +3383,7 @@ do_XmScrollBarGetValues(
 
    if (argc != 6) 
    {
-      errmsg=strdup(GETMESSAGE(15,54, 
+      errmsg=strdup(GETMESSAGE(
            "Usage: XmScrollBarGetValues scrollbar variable variable variable variable"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3450,7 +3443,7 @@ do_XmScrollBarSetValues(
 
    if (argc != 7) 
    {
-      errmsg=strdup(GETMESSAGE(15,55, 
+      errmsg=strdup(GETMESSAGE(
            "Usage: XmScrollBarSetValues scrollbar value sliderSize increment pageIncrement notify"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3471,7 +3464,7 @@ do_XmScrollBarSetValues(
    value = strtol(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,56, "The value specified is invalid: %s"));
+      errmsg = strdup(GETMESSAGE("The value specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[2], NULL,
                 NULL, NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -3481,7 +3474,7 @@ do_XmScrollBarSetValues(
    sliderSize = strtoul(argv[3], &p, 0);
    if (p == argv[3])
    {
-      errmsg = strdup(GETMESSAGE(15,57, 
+      errmsg = strdup(GETMESSAGE(
                       "The slider size specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[3],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -3492,7 +3485,7 @@ do_XmScrollBarSetValues(
    increment = strtoul(argv[4], &p, 0);
    if (p == argv[4])
    {
-      errmsg = strdup(GETMESSAGE(15,58, 
+      errmsg = strdup(GETMESSAGE(
                       "The increment specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[4],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -3503,7 +3496,7 @@ do_XmScrollBarSetValues(
    pageIncrement = strtoul(argv[5], &p, 0);
    if (p == argv[5])
    {
-      errmsg = strdup(GETMESSAGE(15,59, 
+      errmsg = strdup(GETMESSAGE(
                       "The page increment specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[5],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -3541,7 +3534,7 @@ do_XmScrollVisible(
 
    if (argc != 5) 
    {
-      errmsg=strdup(GETMESSAGE(15,60, 
+      errmsg=strdup(GETMESSAGE(
         "Usage: XmScrollVisible scrolledWin widget leftRightMargin topBottomMargin"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3553,7 +3546,7 @@ do_XmScrollVisible(
 	return(1);
 
    if (w->wclass->class != xmScrolledWindowWidgetClass) {
-      errmsg = strdup(GETMESSAGE(15,61, 
+      errmsg = strdup(GETMESSAGE(
              "The widget must be a 'scrolledWindow' widget"));
       printerr(arg0, errmsg, NULL);
       free(errmsg);
@@ -3563,7 +3556,7 @@ do_XmScrollVisible(
    w2 = str_to_wtab(arg0, argv[2]);
    if (w2 == NULL) 
    {
-      errmsg = strdup(GETMESSAGE(15,62, 
+      errmsg = strdup(GETMESSAGE(
               "The widget to be made visible does not exist."));
       printerr(arg0, errmsg, NULL);
       free(errmsg);
@@ -3573,7 +3566,7 @@ do_XmScrollVisible(
    lrMargin = strtol(argv[3], &p, 0);
    if (p == argv[3])
    {
-      errmsg = strdup(GETMESSAGE(15,63, 
+      errmsg = strdup(GETMESSAGE(
             "The left/right margin specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, 
                 NULL);
@@ -3584,7 +3577,7 @@ do_XmScrollVisible(
    tbMargin = strtoul(argv[4], &p, 0);
    if (p == argv[4])
    {
-      errmsg = strdup(GETMESSAGE(15,64, 
+      errmsg = strdup(GETMESSAGE(
              "The top/bottom margin specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[4], NULL, NULL, NULL, NULL, NULL, NULL, 
                 NULL);
@@ -3665,7 +3658,7 @@ SetToggleState(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,65, "Usage: %s widget state notify"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget state notify"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL,
                 NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -3741,7 +3734,7 @@ do_catopen(
 
    if (argc != 3)
    {
-      errmsg = strdup(GETMESSAGE(15,66, "Usage: catopen variable catName"));
+      errmsg = strdup(GETMESSAGE("Usage: catopen variable catName"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -3803,7 +3796,7 @@ do_catclose(
 
    if (argc != 2)
    {
-      errmsg = strdup(GETMESSAGE(15,67, "Usage: catclose catId"));
+      errmsg = strdup(GETMESSAGE("Usage: catclose catId"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
       return(1);
@@ -3835,7 +3828,7 @@ do_catgets(
 
    if (argc != 6)
    {
-      errmsg = strdup(GETMESSAGE(15,68, 
+      errmsg = strdup(GETMESSAGE(
              "Usage: catgets variable catId setNum msgNum dftMsg"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -3866,7 +3859,7 @@ verifyTextWidget(
    if ((w->wclass->class != xmTextWidgetClass) &&
        (w->wclass->class != xmTextFieldWidgetClass))
    {
-      errmsg = strdup(GETMESSAGE(15,69, 
+      errmsg = strdup(GETMESSAGE(
              "The widget must be a 'text' or 'textField' widget"));
       printerr(cmd, errmsg, NULL);
       free(errmsg);
@@ -3973,7 +3966,7 @@ Text_VarAndWidget(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,70, "Usage: %s variable widget"));
+      errmsg = strdup(GETMESSAGE("Usage: %s variable widget"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL,
                 NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4084,7 +4077,7 @@ Text_WidgetAndBoolean(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,71, "Usage: %s widget boolean"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget boolean"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL,
                 NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4159,7 +4152,7 @@ Text_WidgetAndOneParam(
       param = strtoul(argv[2], &p, 0);
       if (p == argv[2])
       {
-         errmsg = strdup(GETMESSAGE(15,72, 
+         errmsg = strdup(GETMESSAGE(
                          "The parameter specified is invalid: %s"));
          printerrf(arg0, errmsg, argv[2],
                    NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4184,7 +4177,7 @@ do_XmTextScroll(
    char * errmsg;
    int retVal;
    
-   errmsg = strdup(GETMESSAGE(15,73, "Usage: %s widget lines"));
+   errmsg = strdup(GETMESSAGE("Usage: %s widget lines"));
    retVal = Text_WidgetAndOneParam((Boolean (*)())XmTextScroll, False, False, 
                                     errmsg, argc, argv);
    free(errmsg);
@@ -4233,7 +4226,7 @@ do_XmTextSetMaxLength(
    char * errmsg;
    int retVal;
    
-   errmsg = strdup(GETMESSAGE(15,74, "Usage: %s widget maxLength"));
+   errmsg = strdup(GETMESSAGE("Usage: %s widget maxLength"));
    retVal = Text_WidgetAndOneParam((Boolean (*)())XmTextSetMaxLength, False, 
                                    False, errmsg, argc, argv);
    free(errmsg);
@@ -4249,7 +4242,7 @@ do_XmTextSetString(
    char * errmsg;
    int retVal;
    
-   errmsg = strdup(GETMESSAGE(15,75, "Usage: %s widget string"));
+   errmsg = strdup(GETMESSAGE("Usage: %s widget string"));
    retVal = Text_WidgetAndOneParam((Boolean (*)())XmTextSetString, False, True, 
                                    errmsg, argc, argv);
    free(errmsg);
@@ -4334,7 +4327,7 @@ do_XmTextGetSelectionPosition(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,76, "Usage: %s widget variable variable"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget variable variable"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL,
                 NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4379,7 +4372,7 @@ do_XmTextInsert(
 
    if (argc != 4) 
    {
-      errmsg = strdup(GETMESSAGE(15,77, "Usage: %s widget position string"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget position string"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL,
                 NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4421,7 +4414,7 @@ do_XmTextPosToXY(
 
    if (argc != 5) 
    {
-      errmsg = strdup(GETMESSAGE(15,78, 
+      errmsg = strdup(GETMESSAGE(
                       "Usage: %s widget position variable variable"));
       printerrf(str_nill, errmsg, arg0, NULL,
                 NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4479,7 +4472,7 @@ do_XmTextReplace(
 
    if (argc != 5) 
    {
-      errmsg = strdup(GETMESSAGE(15,79, 
+      errmsg = strdup(GETMESSAGE(
               "Usage: %s widget fromPosition toPosition string"));
       printerrf(str_nill, errmsg, arg0, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4493,7 +4486,7 @@ do_XmTextReplace(
    from = strtoul(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,80, 
+      errmsg = strdup(GETMESSAGE(
                "The 'from' position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[2],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4504,7 +4497,7 @@ do_XmTextReplace(
    to = strtoul(argv[3], &p, 0);
    if (p == argv[3])
    {
-      errmsg = strdup(GETMESSAGE(15,81, 
+      errmsg = strdup(GETMESSAGE(
                       "The 'to' position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[3],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4532,7 +4525,7 @@ do_XmTextSetSelection(
 
    if (argc != 5) 
    {
-      errmsg = strdup(GETMESSAGE(15,82, 
+      errmsg = strdup(GETMESSAGE(
               "Usage: %s widget firstPosition lastPosition time"));
       printerrf(str_nill, errmsg, arg0, NULL,
                 NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4546,7 +4539,7 @@ do_XmTextSetSelection(
    first = strtoul(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,83, 
+      errmsg = strdup(GETMESSAGE(
                       "The first position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[2],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4557,7 +4550,7 @@ do_XmTextSetSelection(
    last = strtoul(argv[3], &p, 0);
    if (p == argv[3])
    {
-      errmsg = strdup(GETMESSAGE(15,84, 
+      errmsg = strdup(GETMESSAGE(
                       "The last position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[3],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4568,7 +4561,7 @@ do_XmTextSetSelection(
    time = strtoul(argv[4], &p, 0);
    if (p == argv[4])
    {
-      errmsg = strdup(GETMESSAGE(15,85, "The time specified is invalid: %s"));
+      errmsg = strdup(GETMESSAGE("The time specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[4],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4596,7 +4589,7 @@ do_XmTextXYToPos(
 
    if (argc != 5) 
    {
-      errmsg = strdup(GETMESSAGE(15,86, "Usage: %s variable widget x y"));
+      errmsg = strdup(GETMESSAGE("Usage: %s variable widget x y"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL,
                 NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4612,7 +4605,7 @@ do_XmTextXYToPos(
    x = strtoul(argv[3], &p, 0);
    if (p == argv[3])
    {
-      errmsg = strdup(GETMESSAGE(15,87, 
+      errmsg = strdup(GETMESSAGE(
                       "The x position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[3],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4624,7 +4617,7 @@ do_XmTextXYToPos(
    y = strtoul(argv[4], &p, 0);
    if (p == argv[4])
    {
-      errmsg = strdup(GETMESSAGE(15,88, 
+      errmsg = strdup(GETMESSAGE(
                       "The y position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[4],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4656,7 +4649,7 @@ do_XmTextSetHighlight(
 
    if (argc != 5) 
    {
-      errmsg = strdup(GETMESSAGE(15,89, "Usage: %s widget left right mode"));
+      errmsg = strdup(GETMESSAGE("Usage: %s widget left right mode"));
       printerrf(str_nill, errmsg, arg0, NULL, NULL,
                 NULL, NULL, NULL, NULL, NULL);
       free(errmsg);
@@ -4669,7 +4662,7 @@ do_XmTextSetHighlight(
    left = strtoul(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,90, 
+      errmsg = strdup(GETMESSAGE(
                       "The left position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[2],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4680,7 +4673,7 @@ do_XmTextSetHighlight(
    right = strtoul(argv[3], &p, 0);
    if (p == argv[3])
    {
-      errmsg = strdup(GETMESSAGE(15,91, 
+      errmsg = strdup(GETMESSAGE(
                       "The right position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[3],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4719,7 +4712,7 @@ do_XmTextFindString(
 
    if (argc != 6) 
    {
-      errmsg = strdup(GETMESSAGE(15,92, 
+      errmsg = strdup(GETMESSAGE(
               "Usage: %s widget start string direction variable"));
       printerrf(str_nill, errmsg, arg0, NULL,
                 NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4736,7 +4729,7 @@ do_XmTextFindString(
    start = strtoul(argv[2], &p, 0);
    if (p == argv[2])
    {
-      errmsg = strdup(GETMESSAGE(15,93, 
+      errmsg = strdup(GETMESSAGE(
                       "The start position specified is invalid: %s"));
       printerrf(arg0, errmsg, argv[2],
                 NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4816,7 +4809,7 @@ do_XmOptionLabelGadget(
    int retVal;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,96, 
+   errmsg = strdup(GETMESSAGE(
               "Usage: XmOptionLabelGadget variable widget"));
    retVal = GetSubWidget(errmsg, XmOptionLabelGadget, argc, argv);
    XtFree(errmsg);
@@ -4832,7 +4825,7 @@ do_XmOptionButtonGadget(
    int retVal;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,97, 
+   errmsg = strdup(GETMESSAGE(
               "Usage: XmOptionButtonGadget variable widget"));
    retVal = GetSubWidget(errmsg, XmOptionButtonGadget, argc, argv);
    XtFree(errmsg);
@@ -4854,7 +4847,7 @@ do_XmGetVisibility(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,98, 
+      errmsg = strdup(GETMESSAGE(
          "Usage: XmGetVisibility variable widget"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -4887,7 +4880,7 @@ do_XmGetTearOffControl(
    int retVal;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,99, 
+   errmsg = strdup(GETMESSAGE(
               "Usage: XmGetTearOffControl variable widget"));
    retVal = GetSubWidget(errmsg, XmGetTearOffControl, argc, argv);
    XtFree(errmsg);
@@ -4903,7 +4896,7 @@ do_XmGetTabGroup(
    int retVal;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,100, 
+   errmsg = strdup(GETMESSAGE(
               "Usage: XmGetTabGroup variable widget"));
    retVal = GetSubWidget(errmsg, XmGetTabGroup, argc, argv);
    XtFree(errmsg);
@@ -4919,7 +4912,7 @@ do_XmGetPostedFromWidget(
    int retVal;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,101, 
+   errmsg = strdup(GETMESSAGE(
               "Usage: XmGetPostedFromWidget variable widget"));
    retVal = GetSubWidget(errmsg, XmGetPostedFromWidget, argc, argv);
    XtFree(errmsg);
@@ -4935,7 +4928,7 @@ do_XmGetFocusWidget(
    int retVal;
    char * errmsg;
 
-   errmsg = strdup(GETMESSAGE(15,102, 
+   errmsg = strdup(GETMESSAGE(
               "Usage: XmGetFocusWidget variable widget"));
    retVal = GetSubWidget(errmsg, XmGetFocusWidget, argc, argv);
    XtFree(errmsg);
@@ -4955,7 +4948,7 @@ do_XmFileSelectionDoSearch(
 
    if (argc != 3) 
    {
-      errmsg = strdup(GETMESSAGE(15,103,
+      errmsg = strdup(GETMESSAGE(
               "Usage: XmFileSelectionDoSearch widget directoryMask"));
       printerr(str_nill, errmsg, NULL);
       free(errmsg);
@@ -4990,7 +4983,7 @@ _CreatePDMJobSetup(
 	WidgetClass wclass;
 
 	if (argc < 2) {
-                errmsg = strdup(GETMESSAGE(15,3, 
+                errmsg = strdup(GETMESSAGE(
                      "Usage: %s variable parent"));
 		printerrf(str_nill, errmsg, argv[0], NULL,
                     NULL, NULL, NULL, NULL, NULL, NULL);

+ 1 - 1
cde/programs/dtksh/xmcvt.c

@@ -356,7 +356,7 @@ DtkshCvtStringToNamedValue(
 			return;
 		}
 	}
-	errmsg =strdup(GETMESSAGE(16,2, 
+	errmsg =strdup(GETMESSAGE(
              "DtkshCvtStringToNamedValue: Unable to convert the string '%s'"));
         errbuf = XtMalloc(strlen(errmsg) + strlen(value) + 10);
         sprintf(errbuf, errmsg, value);

Some files were not shown because too many files changed in this diff