diff --git a/cde/programs/dtksh/XtCvtrs.c b/cde/programs/dtksh/XtCvtrs.c index 3807d1abf..7b4292fca 100644 --- a/cde/programs/dtksh/XtCvtrs.c +++ b/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); diff --git a/cde/programs/dtksh/dtkcmds.c b/cde/programs/dtksh/dtkcmds.c index fb90a91d3..89482ab21 100644 --- a/cde/programs/dtksh/dtkcmds.c +++ b/cde/programs/dtksh/dtkcmds.c @@ -554,7 +554,7 @@ parse_args( *n = 0; for (i = 0; i < argc; i++) { if (i >= MAXARGS) { - errmsg = strdup(GETMESSAGE(5,1, + errmsg = strdup(GETMESSAGE( "Too many resource parameters have been specified; skipping '%s'")); printerrf(arg0, errmsg, argv[*n], NULL, NULL, NULL, NULL, NULL, @@ -564,7 +564,7 @@ parse_args( } if ((colon = strchr(argv[i], ':')) == NULL) { - errmsg = strdup(GETMESSAGE(5,2, + errmsg = strdup(GETMESSAGE( "Bad resource specification; should be of the form 'name:value' : %s")); printerrf(arg0, errmsg, argv[i], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -664,7 +664,7 @@ do_XtInitialize( if (Toplevel != NULL) { - errmsg = strdup(GETMESSAGE(5,4, + errmsg = strdup(GETMESSAGE( "The toolkit has already been initialized")); printerr(argv[0], errmsg, NULL); free(errmsg); @@ -672,7 +672,7 @@ do_XtInitialize( } if (argc < 4) { - errmsg =strdup(GETMESSAGE(5,5, + errmsg =strdup(GETMESSAGE( "Usage: XtInitialize variable applicationName applicationClass [args ...]")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -707,7 +707,7 @@ _CreateWidget( char ** pargv; if (argc < 5) { - errmsg = strdup(GETMESSAGE(5,6, + errmsg = strdup(GETMESSAGE( "Usage: %s variable name class parent [arg:val ...]")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -784,7 +784,7 @@ do_XtCreateApplicationShell( char ** pargv; if (argc < 4) { - errmsg=strdup(GETMESSAGE(5,7, + errmsg=strdup(GETMESSAGE( "Usage: XtCreateApplicationShell variable name class [arg:val ...]")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -869,8 +869,8 @@ do_XtPopup( if (argc != 3) { - errmsg=strdup(GETMESSAGE(5,8, - "Usage: XtPopup widget GrabNone|GrabNonexclusive|GrabExclusive")); + errmsg=strdup(GETMESSAGE( + "Usage: XtPopup widget GrabNone|GrabNonexclusive|GrabExclusive")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -889,7 +889,7 @@ do_XtPopup( grab = XtGrabExclusive; else { - errmsg=strdup(GETMESSAGE(5,9, + errmsg=strdup(GETMESSAGE( "The grab type '%s' is not recognized; using 'GrabNone'")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -990,7 +990,7 @@ do_XtIsShell( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,10, "Usage: XtIsShell widget")); + errmsg = strdup(GETMESSAGE("Usage: XtIsShell widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1048,7 +1048,7 @@ do_XtMapWidget( char * errmsg; if (argc < 2) { - errmsg = strdup(GETMESSAGE(5,11, "Usage: XtMapWidget widget")); + errmsg = strdup(GETMESSAGE("Usage: XtMapWidget widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1072,7 +1072,7 @@ do_XtUnmapWidget( char * errmsg; if (argc < 2) { - errmsg = strdup(GETMESSAGE(5,12, "Usage: XtUnmapWidget widget")); + errmsg = strdup(GETMESSAGE("Usage: XtUnmapWidget widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1143,7 +1143,7 @@ GetDisplayHandle( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,13, "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); @@ -1174,7 +1174,7 @@ do_XtNameToWidget( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,82, + errmsg = strdup(GETMESSAGE( "Usage: XtNameToWidget variable referenceWidget names")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1229,7 +1229,7 @@ do_XtScreen( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,14, "Usage: XtScreen variable widget")); + errmsg = strdup(GETMESSAGE("Usage: XtScreen variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1258,7 +1258,7 @@ do_XtWindow( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,15, "Usage: XtWindow variable widget")); + errmsg = strdup(GETMESSAGE("Usage: XtWindow variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1280,7 +1280,7 @@ XtCallCallbacks_usage( { char * errmsg; - errmsg = strdup(GETMESSAGE(5,16, + errmsg = strdup(GETMESSAGE( "Usage: XtCallCallbacks widget callbackName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1323,7 +1323,7 @@ do_XtHasCallbacks( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,17, + errmsg = strdup(GETMESSAGE( "Usage: XtHasCallbacks variable widget callbackName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1367,7 +1367,7 @@ do_XtAddCallback( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,18, + errmsg = strdup(GETMESSAGE( "Usage: XtAddCallback widget callbackName ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1437,7 +1437,7 @@ do_XtRemoveCallback( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,19, + errmsg = strdup(GETMESSAGE( "Usage: XtRemoveCallback widget callbackName ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1492,7 +1492,7 @@ RemoveOneCallback( handle = (DtWsmCBContext)strtoul(handleStr, &p, 0); if (p == handleStr) { - errmsg = strdup(GETMESSAGE(5,20, + errmsg = strdup(GETMESSAGE( "The following is an invalid callback handle: %s")); printerrf(cmd, errmsg, handleStr, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1531,7 +1531,7 @@ RemoveOneCallback( return(0); } - errmsg = strdup(GETMESSAGE(5,21, + errmsg = strdup(GETMESSAGE( "The specified callback is not registered")); printerr(cmd, errmsg, NULL); free(errmsg); @@ -1553,7 +1553,7 @@ do_XtAddEventHandler( if (argc != 5) { - errmsg=strdup(GETMESSAGE(5,22, + errmsg=strdup(GETMESSAGE( "Usage: XtAddEventHandler widget mask nonMaskable ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1609,7 +1609,7 @@ do_XtRemoveEventHandler( if (argc != 5) { - errmsg =strdup(GETMESSAGE(5,23, + errmsg =strdup(GETMESSAGE( "Usage: XtRemoveEventHandler widget mask nonMaskable ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1669,7 +1669,7 @@ do_XtRemoveEventHandler( return(0); } - errmsg = strdup(GETMESSAGE(5,24, + errmsg = strdup(GETMESSAGE( "The specified event handler is not registered")); printerr(arg0, errmsg, NULL); free(errmsg); @@ -1691,7 +1691,7 @@ do_XtGetValues( char * errmsg; if (argc < 3) { - errmsg = strdup(GETMESSAGE(5,25, + errmsg = strdup(GETMESSAGE( "Usage: XtGetValues widget resource:variable ...")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1711,7 +1711,7 @@ do_XtGetValues( for (i = 0, n = 0; i < argc; i++) { if ((p = strchr(argv[i], ':')) == NULL) { - errmsg=strdup(GETMESSAGE(5,26, + errmsg=strdup(GETMESSAGE( "The following resource parameter is incorrectly formed: %s")); printerrf(arg0, errmsg, argv[i], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1763,7 +1763,7 @@ do_XtSetValues( char ** pargv; if (argc < 3) { - errmsg = strdup(GETMESSAGE(5,27, + errmsg = strdup(GETMESSAGE( "Usage: XtSetValues widget arg:val ...")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1886,7 +1886,7 @@ do_XtAddWorkProc( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,28, + errmsg = strdup(GETMESSAGE( "Usage: XtAddWorkProc variable command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1913,7 +1913,7 @@ do_XtRemoveWorkProc( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,29, "Usage: XtRemoveWorkProc workProcId")); + errmsg = strdup(GETMESSAGE("Usage: XtRemoveWorkProc workProcId")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1922,7 +1922,7 @@ do_XtRemoveWorkProc( id = strtoul(argv[1], &p, 16); if (p == argv[1]) { - errmsg=strdup(GETMESSAGE(5,30, + errmsg=strdup(GETMESSAGE( "The workProcId parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1949,7 +1949,7 @@ do_XtAddTimeOut( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,31, + errmsg = strdup(GETMESSAGE( "Usage: XtAddTimeOut variable milliseconds command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1959,7 +1959,7 @@ do_XtAddTimeOut( variable = argv[1]; if ((milliseconds = atol(argv[2])) <= 0) { - errmsg = strdup(GETMESSAGE(5,32, + errmsg = strdup(GETMESSAGE( "The milliseconds parameter must be greater than zero")); printerr(argv[0], errmsg, NULL); free(errmsg); @@ -1987,7 +1987,7 @@ do_XtRemoveTimeOut( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,33, "Usage: XtRemoveTimeOut intervalId")); + errmsg = strdup(GETMESSAGE("Usage: XtRemoveTimeOut intervalId")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1995,7 +1995,7 @@ do_XtRemoveTimeOut( id = strtoul(argv[1], &p, 16); if (p == argv[1]) { - errmsg = strdup(GETMESSAGE(5,34, + errmsg = strdup(GETMESSAGE( "The intervalId parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2036,7 +2036,7 @@ do_managelist_func( char * errmsg; if (argc < 2) { - errmsg = strdup(GETMESSAGE(5,35, "Usage: %s widget ...")); + errmsg = strdup(GETMESSAGE("Usage: %s widget ...")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2064,7 +2064,7 @@ do_XtIsSubclass( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,120, + errmsg = strdup(GETMESSAGE( "Usage: XtIsSubclass widget class")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2080,7 +2080,7 @@ do_XtIsSubclass( return(!XtIsSubclass(w->w, C[i].class)); } } - errmsg = strdup(GETMESSAGE(5,121, + errmsg = strdup(GETMESSAGE( "%s is not a valid widget class name")); printerrf(str_nill, errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2101,7 +2101,7 @@ do_XtClass( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,122, + errmsg = strdup(GETMESSAGE( "Usage: XtClass variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2156,7 +2156,7 @@ do_XBell( if (argc != 3) { - errmsg=strdup(GETMESSAGE(5,36, "Usage: XBell display volume")); + errmsg=strdup(GETMESSAGE("Usage: XBell display volume")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -2196,7 +2196,7 @@ do_RootWindowCmd( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,37, "Usage: %s variable screen")); + errmsg = strdup(GETMESSAGE("Usage: %s variable screen")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2206,7 +2206,7 @@ do_RootWindowCmd( screen = (Screen *)strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg = strdup(GETMESSAGE(5,38, "The screen parameter is invalid: %s")); + errmsg = strdup(GETMESSAGE("The screen parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2255,7 +2255,7 @@ do_XDefineCursor( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,39, + errmsg = strdup(GETMESSAGE( "Usage: XDefineCursor display window cursorId")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2285,7 +2285,7 @@ do_XDefineCursor( cursor = (Cursor)strtoul(argv[3], &p, 0); if (p == argv[3]) { - errmsg = strdup(GETMESSAGE(5,40, + errmsg = strdup(GETMESSAGE( "The cursorId parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2309,7 +2309,7 @@ do_XUndefineCursor( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,41, + errmsg = strdup(GETMESSAGE( "Usage: XUndefineCursor display window")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2350,7 +2350,7 @@ do_XtRemoveAllCallbacks( char * errmsg; if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,42, + errmsg = strdup(GETMESSAGE( "Usage: XtRemoveAllCallbacks widget callbackName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2441,7 +2441,7 @@ do_XTextWidth( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,43, + errmsg = strdup(GETMESSAGE( "Usage: XTextWidth variable fontName string")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2496,7 +2496,7 @@ invokeXDrawFunction( if (argc < 3) { - errmsg = strdup(GETMESSAGE(5,44, + errmsg = strdup(GETMESSAGE( "Usage: %s display drawable [args ...]")); printerrf(str_nill, errmsg, functionName, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2516,7 +2516,7 @@ invokeXDrawFunction( drawable = (Window)strtoul(argv[2], &sp, 0); if (sp == argv[2]) { - errmsg = strdup(GETMESSAGE(5,45, + errmsg = strdup(GETMESSAGE( "The drawable parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2532,7 +2532,7 @@ invokeXDrawFunction( destination = (Window)strtoul(argv[3], &sp, 0); if (sp == argv[3]) { - errmsg = strdup(GETMESSAGE(5,46, + errmsg = strdup(GETMESSAGE( "The destination parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2766,7 +2766,7 @@ invokeXDrawFunction( f = GXcopyInverted; else { - errmsg = strdup(GETMESSAGE(5,47, + errmsg = strdup(GETMESSAGE( "Unrecognized graphics function name: %s")); printerrf(functionName, errmsg, argv[4], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2795,7 +2795,7 @@ invokeXDrawFunction( else if (strcmp(argv[4], "LineOnOffDash") == 0) f = LineOnOffDash; else { - errmsg = strdup(GETMESSAGE(5,48, "Unrecognized line style: %s")); + errmsg = strdup(GETMESSAGE("Unrecognized line style: %s")); printerrf(functionName, errmsg, argv[4], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2811,7 +2811,7 @@ invokeXDrawFunction( } else { - errmsg = strdup(GETMESSAGE(5,49, "Unrecognized drawing option: %s")); + errmsg = strdup(GETMESSAGE("Unrecognized drawing option: %s")); printerrf(functionName, errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2943,7 +2943,7 @@ invokeXDrawFunction( if (argc != 0) { - errmsg = strdup(GETMESSAGE(5,50, + errmsg = strdup(GETMESSAGE( "There were left over points which were ignored")); printerr(functionName, errmsg, NULL); free(errmsg); @@ -3021,7 +3021,7 @@ do_XCopyArea( if (argc < 10) { - errmsg = strdup(GETMESSAGE(5,51, + errmsg = strdup(GETMESSAGE( "Usage: XCopyArea display source dest sourceX sourceY width height destX destY [args ...]")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -3146,7 +3146,7 @@ ConvertTypeToString( if ((to_val.addr) || (strcmp(res->resource_type, XmRXmString) == 0)) { *ret = to_val.addr; } else { - errmsg=strdup(GETMESSAGE(5,52, + errmsg=strdup(GETMESSAGE( "Unable to convert resource type '%s' to 'String'")); printerrf(arg0, errmsg, res->resource_type, NULL, NULL, NULL, NULL, NULL, @@ -3278,7 +3278,7 @@ ConvertStringToType( *freeit = TRUE; } } else { - errmsg=strdup(GETMESSAGE(5,53, + errmsg=strdup(GETMESSAGE( "Unable to convert resource type 'String' to type '%s'")); printerrf(arg0, errmsg, res->resource_type, NULL, NULL, NULL, NULL, NULL, @@ -3295,7 +3295,7 @@ XtAddInputUsage( { char * errmsg; - errmsg=strdup(GETMESSAGE(5,54, + errmsg=strdup(GETMESSAGE( "Usage: XtAddInput variable [-r] fileDescriptor kshCommand")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -3406,7 +3406,7 @@ do_XtRemoveInput( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,56, "Usage: XtRemoveInput inputId")); + errmsg = strdup(GETMESSAGE("Usage: XtRemoveInput inputId")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -3415,7 +3415,7 @@ do_XtRemoveInput( id = strtoul(argv[1], &p, 16); if (p == argv[1]) { - errmsg = strdup(GETMESSAGE(5,57, + errmsg = strdup(GETMESSAGE( "The inputId parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -3954,7 +3954,7 @@ do_XFlush( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,59, "Usage: XFlush display")); + errmsg = strdup(GETMESSAGE("Usage: XFlush display")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -3987,7 +3987,7 @@ do_XSync( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,60, "Usage: XSync display discard")); + errmsg = strdup(GETMESSAGE("Usage: XSync display discard")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4031,7 +4031,7 @@ do_XRaiseWindow( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,61, "Usage: XRaiseWindow display window")); + errmsg = strdup(GETMESSAGE("Usage: XRaiseWindow display window")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4066,7 +4066,7 @@ XtSetSensitive_usage( { char * errmsg; - errmsg = strdup(GETMESSAGE(5,62, "Usage: %s widget [True|False]")); + errmsg = strdup(GETMESSAGE("Usage: %s widget [True|False]")); printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); return(1); @@ -4114,7 +4114,7 @@ RegisterTranslations( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,63, "Usage: %s widget translations")); + errmsg = strdup(GETMESSAGE("Usage: %s widget translations")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -4166,7 +4166,7 @@ do_XtUninstallTranslations( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,64, + errmsg = strdup(GETMESSAGE( "Usage: XtUninstallTranslations widget")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4194,7 +4194,7 @@ do_XtParent( char * errmsg; if (argc != 3 ) { - errmsg = strdup(GETMESSAGE(5,65, "Usage: XtParent variable widget")); + errmsg = strdup(GETMESSAGE("Usage: XtParent variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4239,7 +4239,7 @@ do_XtLastTimestampProcessed( char * errmsg; if (argc != 3 ) { - errmsg = strdup(GETMESSAGE(5,66, + errmsg = strdup(GETMESSAGE( "Usage: XtLastTimestampProcessed variable display")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4496,7 +4496,7 @@ do_DtSessionRestorePath( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,67, + errmsg = strdup(GETMESSAGE( "Usage: DtSessionRestorePath widget pathVariable saveFile")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4529,7 +4529,7 @@ do_DtSessionSavePath( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,68, + errmsg = strdup(GETMESSAGE( "Usage: DtSessionSavePath widget pathVariable fileVariable")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4572,7 +4572,7 @@ do_DtShellIsIconified( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,69, "Usage: DtShellIsIconified widget")); + errmsg = strdup(GETMESSAGE("Usage: DtShellIsIconified widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4604,7 +4604,7 @@ do_DtSetStartupCommand( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,70, + errmsg = strdup(GETMESSAGE( "Usage: DtSetStartupCommand widget command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4640,7 +4640,7 @@ do_DtSetIconifyHint( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,71, + errmsg = strdup(GETMESSAGE( "Usage: DtSetIconifyHint widget boolean")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4778,7 +4778,7 @@ do_DtWsmGetCurrentWorkspace( rootWindow = (Window)strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg = strdup(GETMESSAGE(5,73, + errmsg = strdup(GETMESSAGE( "The rootWindow parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -4807,7 +4807,7 @@ do_DtWsmSetCurrentWorkspace( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,74, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmSetCurrentWorkspace widget atom")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4821,7 +4821,7 @@ do_DtWsmSetCurrentWorkspace( atom = (Atom)strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg = strdup(GETMESSAGE(5,75, "The workspace atom is invalid: %s")); + errmsg = strdup(GETMESSAGE("The workspace atom is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -4962,7 +4962,7 @@ do_DtWsmSetWorkspacesOccupied( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,78, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmSetWorkspacesOccupied display window workspaceList")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5098,7 +5098,7 @@ do__DtGetHourGlassCursor( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,79, + errmsg = strdup(GETMESSAGE( "Usage: _DtGetHourGlassCursor variable display")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5186,7 +5186,7 @@ do_DtWsmAddCurrentWorkspaceCallback( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,80, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmAddCurrentWorkspaceCallback variable widget ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5227,7 +5227,7 @@ do_DtWsmRemoveWorkspaceCallback( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,81, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmRemoveWorkspaceCallback handle")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5252,7 +5252,7 @@ do_DtWsmRemoveWorkspaceCallback( if(cdata == (dtksh_client_data_t *)NULL) { - errmsg = strdup(GETMESSAGE(5,20, + errmsg = strdup(GETMESSAGE( "The following is an invalid callback handle: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -5278,7 +5278,7 @@ do_DtDbLoad( if (argc != 1) { - errmsg = strdup(GETMESSAGE(5,83, "Usage: DtDbLoad")); + errmsg = strdup(GETMESSAGE("Usage: DtDbLoad")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5321,7 +5321,7 @@ do_DtDbReloadNotify( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,84, "Usage: DtDbReloadNotify ksh-command")); + errmsg = strdup(GETMESSAGE("Usage: DtDbReloadNotify ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5352,7 +5352,7 @@ do_DtActionExists( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,85, "Usage: DtActionExists actionName")); + errmsg = strdup(GETMESSAGE("Usage: DtActionExists actionName")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5379,7 +5379,7 @@ do_DtActionLabel( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,86, + errmsg = strdup(GETMESSAGE( "Usage: DtActionLabel variable actionName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5412,7 +5412,7 @@ do_DtActionDescription( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,87, + errmsg = strdup(GETMESSAGE( "Usage: DtActionDescription variable actionName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5435,7 +5435,7 @@ _DtActionInvokeUsage( void ) { char * errmsg; - errmsg = strdup(GETMESSAGE(5,88, + errmsg = strdup(GETMESSAGE( "Usage: DtActionInvoke widget actionName termParms execHost contextDir useIndicator ksh-command [\"FILE\" fileName] ...")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5548,7 +5548,7 @@ do_DtDtsLoadDataTypes( if (argc != 1) { - errmsg = strdup(GETMESSAGE(5,89, "Usage: DtDtsLoadDataTypes")); + errmsg = strdup(GETMESSAGE("Usage: DtDtsLoadDataTypes")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5569,7 +5569,7 @@ do_DtDtsFileToDataType( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,90, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFileToDataType variable fileName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5597,7 +5597,7 @@ do_DtDtsFileToAttributeValue( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,91, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFileToAttributeValue variable fileName attrName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5627,7 +5627,7 @@ do_DtDtsFileToAttributeList( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,92, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFileToAttributeList variable fileName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5669,7 +5669,7 @@ do_DtDtsDataTypeToAttributeValue( if ((argc != 4) && (argc != 5)) { - errmsg = strdup(GETMESSAGE(5,93, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsDataTypeToAttributeValue variable dataType attrName optName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5705,7 +5705,7 @@ do_DtDtsDataTypeToAttributeList( if ((argc != 3) && (argc != 4)) { - errmsg = strdup(GETMESSAGE(5,94, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsDataTypeToAttributeList variable dataType optName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5753,7 +5753,7 @@ do_DtDtsFindAttribute( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,95, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFindAttribute variable name value")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5796,7 +5796,7 @@ do_DtDtsDataTypeNames( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,96, "Usage: DtDtsDataTypeNames variable")); + errmsg = strdup(GETMESSAGE("Usage: DtDtsDataTypeNames variable")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5837,7 +5837,7 @@ do_DtDtsSetDataType( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,97, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsSetDataType variable fileName dataType override")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5872,7 +5872,7 @@ do_DtDtsDataTypeIsAction( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,98, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsDataTypeIsAction dataType")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5909,7 +5909,7 @@ do_ttdt_open( if (argc != 8) { - errmsg = strdup(GETMESSAGE(5,99, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_open variable status variable2 toolname vendor version sendStarted")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5973,7 +5973,7 @@ do_ttdt_close( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,103, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_close status procId newProcId sendStopped")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6032,7 +6032,7 @@ do_tttk_Xt_input_handler( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,100, + errmsg = strdup(GETMESSAGE( "Usage: tttk_Xt_input_handler procId source id")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6042,7 +6042,7 @@ do_tttk_Xt_input_handler( source = strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg=strdup(GETMESSAGE(5,101, + errmsg=strdup(GETMESSAGE( "The source parameter must be an integer: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6053,7 +6053,7 @@ do_tttk_Xt_input_handler( fid = strtoul(argv[3], &p, 0); if (p == argv[3]) { - errmsg = strdup(GETMESSAGE(5,102, + errmsg = strdup(GETMESSAGE( "The id parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6084,7 +6084,7 @@ do_ttdt_session_join( if (argc != 6) { - errmsg = strdup(GETMESSAGE(5,104, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_session_join variable status sessId shellWidgetHandle join" )); printerr(str_nill, errmsg, NULL); @@ -6157,7 +6157,7 @@ do_ttdt_session_quit( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,105, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_session_quit status sessId sessPatterns quit")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6185,7 +6185,7 @@ do_ttdt_session_quit( patterns = (Tt_pattern *)strtoul(argv[3], &p, 0); if (p == argv[3]) { - errmsg=strdup(GETMESSAGE(5,106, + errmsg=strdup(GETMESSAGE( "The sessPatterns parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6225,7 +6225,7 @@ do_ttdt_file_event( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,107, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_file_event status op patterns send")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6373,7 +6373,7 @@ do_ttdt_file_join( if (argc != 7) { - errmsg = strdup(GETMESSAGE(5,115, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_file_join variable status pathName scope join ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6466,7 +6466,7 @@ do_ttdt_file_quit( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,108, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_file_quit status patterns quit")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6536,7 +6536,7 @@ do_ttdt_Get_Modified( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,109, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_Get_Modified pathName scope timeout")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6590,7 +6590,7 @@ ttdt_SaveOrRevert( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,110, + errmsg = strdup(GETMESSAGE( "Usage: %s status pathName scope timeout")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6664,7 +6664,7 @@ do_tt_error_pointer( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,112, + errmsg = strdup(GETMESSAGE( "Usage: tt_error_pointer variable ttStatus")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6702,7 +6702,7 @@ message_DestroyOrReply( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,113, "Usage: %s status msg")); + errmsg = strdup(GETMESSAGE("Usage: %s status msg")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -6769,7 +6769,7 @@ message_FailOrReject( if (argc != 6) { - errmsg = strdup(GETMESSAGE(5,114, + errmsg = strdup(GETMESSAGE( "Usage: %s status msg msgStatus msgStatusString destroy")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6899,7 +6899,7 @@ do_tt_file_netfile( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,116, + usageMsg = strdup(GETMESSAGE( "Usage: tt_file_netfile variable status filename")); results = tt_netfile_handler(4, tt_file_netfile, usageMsg, argc, argv); XtFree(usageMsg); @@ -6915,7 +6915,7 @@ do_tt_netfile_file( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,117, + usageMsg = strdup(GETMESSAGE( "Usage: tt_netfile_file variable status netfilename")); results = tt_netfile_handler(4, tt_netfile_file, usageMsg, argc, argv); XtFree(usageMsg); @@ -6931,7 +6931,7 @@ do_tt_host_file_netfile( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,118, + usageMsg = strdup(GETMESSAGE( "Usage: tt_host_file_netfile variable status host filename")); results = tt_netfile_handler(5, tt_host_file_netfile, usageMsg, argc, argv); XtFree(usageMsg); @@ -6947,7 +6947,7 @@ do_tt_host_netfile_file( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,119, + usageMsg = strdup(GETMESSAGE( "Usage: tt_host_netfile_file variable status host netfilename")); results = tt_netfile_handler(5, tt_host_netfile_file, usageMsg, argc, argv); XtFree(usageMsg); diff --git a/cde/programs/dtksh/dtkcvt.c b/cde/programs/dtksh/dtkcvt.c index 299e84788..f2414376c 100644 --- a/cde/programs/dtksh/dtkcvt.c +++ b/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); diff --git a/cde/programs/dtksh/extra.c b/cde/programs/dtksh/extra.c index 3a0594bcf..a69ac0a61 100644 --- a/cde/programs/dtksh/extra.c +++ b/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); +} diff --git a/cde/programs/dtksh/init.c b/cde/programs/dtksh/init.c index ecab24e9c..2a0bfe352 100644 --- a/cde/programs/dtksh/init.c +++ b/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}, - {"", 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); } diff --git a/cde/programs/dtksh/msgs.c b/cde/programs/dtksh/msgs.c index 7e4a400dd..987157ff9 100644 --- a/cde/programs/dtksh/msgs.c +++ b/cde/programs/dtksh/msgs.c @@ -28,7 +28,13 @@ #include #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); diff --git a/cde/programs/dtksh/msgs.h b/cde/programs/dtksh/msgs.h index 7171e341b..e30f434d5 100644 --- a/cde/programs/dtksh/msgs.h +++ b/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 diff --git a/cde/programs/dtksh/widget.c b/cde/programs/dtksh/widget.c index 11f49502c..924caed68 100644 --- a/cde/programs/dtksh/widget.c +++ b/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 \n\tDtWidgetInfo -R \n\tDtWidgetInfo -c [className]\n\tDtWidgetInfo -h [widgetHandle]")); + errmsg = strdup(GETMESSAGE("\nUsage:\tDtWidgetInfo [widgetHandle]\n\tDtWidgetInfo -r \n\tDtWidgetInfo -R \n\tDtWidgetInfo -c [className]\n\tDtWidgetInfo -h [widgetHandle]")); printerr(str_nill, errmsg, NULL); free(errmsg); return(255); diff --git a/cde/programs/dtksh/xmcmds.c b/cde/programs/dtksh/xmcmds.c index 58f020960..547905990 100644 --- a/cde/programs/dtksh/xmcmds.c +++ b/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); diff --git a/cde/programs/dtksh/xmcvt.c b/cde/programs/dtksh/xmcvt.c index 8c381397f..21320bcf4 100644 --- a/cde/programs/dtksh/xmcvt.c +++ b/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);