From d2945db4cc64b2a3317030590ff6446b780d644f Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 31 Jan 2021 16:15:25 -0700 Subject: [PATCH 01/90] ksh93: update to 66e1d446 from autotools branch --- cde/programs/dtksh/ksh93 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/dtksh/ksh93 b/cde/programs/dtksh/ksh93 index 47468f56c..66e1d4464 160000 --- a/cde/programs/dtksh/ksh93 +++ b/cde/programs/dtksh/ksh93 @@ -1 +1 @@ -Subproject commit 47468f56c2d0506045120fb4d0709f3a734693f5 +Subproject commit 66e1d446429543be0f9d47d9364e472932dc53f1 From c56f6320aeec4918b3d5c4b449a99ff220d885b4 Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Sat, 30 Jan 2021 19:56:47 -0700 Subject: [PATCH 02/90] config/cf/Imake.cf: Define AArch64Architecture on the BSDs. --- cde/config/cf/Imake.cf | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cde/config/cf/Imake.cf b/cde/config/cf/Imake.cf index b9587ddc7..b28af3ce9 100644 --- a/cde/config/cf/Imake.cf +++ b/cde/config/cf/Imake.cf @@ -86,6 +86,10 @@ XCOMM $TOG: Imake.cf /main/30 1998/04/28 13:55:25 barstow $ # define ZaurusArchitecture # endif # endif +# if defined(__aarch64__) +# define AArch64Architecture +# undef __aarch64__ +# endif # if defined(__mc68020__) || defined(mc68020) # define Mc68020Architecture # if defined(amiga) @@ -180,6 +184,10 @@ XCOMM $TOG: Imake.cf /main/30 1998/04/28 13:55:25 barstow $ # define AMD64Architecture # undef amd64 # endif +# ifdef __aarch64__ +# define AArch64Architecture +# undef __aarch64__ +# endif #endif /* __FreeBSD__ */ #ifdef sun @@ -479,14 +487,14 @@ XCOMM $TOG: Imake.cf /main/30 1998/04/28 13:55:25 barstow $ # undef __arm__ # undef __arm32__ # endif -# if defined(__sparc__) || defined(sparc) -# define SparcArchitecture -# undef sparc -# endif # if defined(__aarch64__) # define AArch64Architecture # undef __aarch64__ # endif +# if defined(__sparc__) || defined(sparc) +# define SparcArchitecture +# undef sparc +# endif #endif /* linux */ #if defined(sequent) || defined(_SEQUENT_) From 8278e0eae3d94a1b3828b28f4e0500cf0d012dab Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Sat, 30 Jan 2021 20:00:02 -0700 Subject: [PATCH 03/90] dtinfo: rename the CATGETS macro to MCATGETS --- .../dtinfo/src/Agents/AddLibraryAgentMotif.C | 10 +- .../dtinfo/src/Agents/BookmarkEditMotif.C | 18 +- .../dtinfo/src/Agents/GraphicAgentMotif.C | 110 +++---- .../dtinfo/dtinfo/src/Agents/HelpAgent.C | 4 +- .../dtinfo/dtinfo/src/Agents/IcccmAgent.C | 4 +- .../dtinfo/src/Agents/LibraryAgentMotif.C | 160 +++++----- .../dtinfo/dtinfo/src/Agents/ListViewMotif.C | 6 +- .../dtinfo/dtinfo/src/Agents/MapAgentMotif.C | 12 +- .../dtinfo/dtinfo/src/Agents/MarkChooser.C | 2 +- .../dtinfo/dtinfo/src/Agents/MarkIconMotif.C | 12 +- .../dtinfo/dtinfo/src/Agents/MarkListView.C | 12 +- .../dtinfo/src/Agents/MessageAgentMotif.C | 36 +-- .../dtinfo/src/Agents/NodeHistoryAgentMotif.C | 12 +- .../dtinfo/src/Agents/NodeListAgentMotif.C | 6 +- .../dtinfo/src/Agents/NodeWindowAgentMotif.C | 294 +++++++++--------- .../dtinfo/src/Agents/OutlineListViewMotif.C | 2 +- .../dtinfo/dtinfo/src/Agents/PrefAgentMotif.C | 58 ++-- .../dtinfo/src/Agents/PrintPanelAgentMotif.C | 24 +- .../src/Agents/SearchHistoryListViewMotif.C | 8 +- .../src/Agents/SearchResultsAgentMotif.C | 22 +- .../dtinfo/src/Agents/SearchScopeAgentMotif.C | 64 ++-- .../dtinfo/src/Agents/SearchScopeList.C | 6 +- .../dtinfo/dtinfo/src/Agents/UrlAgentMotif.C | 30 +- .../dtinfo/dtinfo/src/Managers/CatMgr.hh | 2 +- .../dtinfo/dtinfo/src/Managers/EnvMgr.C | 12 +- .../dtinfo/dtinfo/src/Managers/MarkMgr.C | 12 +- .../dtinfo/dtinfo/src/Managers/MessageMgr.C | 24 +- .../dtinfo/dtinfo/src/Managers/NodeMgr.C | 2 +- .../dtinfo/dtinfo/src/Managers/PrintMgr.C | 2 +- .../dtinfo/dtinfo/src/Managers/SearchMgr.C | 4 +- .../dtinfo/dtinfo/src/Managers/ServiceMgrX.C | 2 +- .../dtinfo/dtinfo/src/Managers/TtIpcMgr.C | 6 +- .../dtinfo/src/Other/WindowSystemMotif.C | 8 +- .../dtinfo/dtinfo/src/Query/QueryEditor.C | 38 +-- .../dtinfo/dtinfo/src/Query/QueryTermView.C | 24 +- .../dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C | 4 +- .../dtinfo/src/UAS/Base/UAS_OQLParser.C | 2 +- .../dtinfo/dtinfo/src/UAS/Base/UAS_ObjList.C | 2 +- .../dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C | 2 +- .../dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C | 16 +- .../dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C | 2 +- .../src/UAS/DtSR/DtSR_SearchResultsEntry.C | 2 +- .../dtinfo/dtinfo/src/UAS/MMDB/MMDB.C | 2 +- .../dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C | 6 +- .../dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C | 4 +- 45 files changed, 545 insertions(+), 545 deletions(-) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C index 30b1f0f62..55ef14579 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C @@ -104,11 +104,11 @@ AddLibraryAgent::create_ui (Widget parent) { mtfstring = msg_catalog_mgr().catgets(Set_AgentLabel, 162); XtVaSetValues(canc, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 223, "Clear"); + mtfstring = MCATGETS(Set_AgentLabel, 223, "Clear"); XtVaSetValues(f_clr, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 270, "..."); + mtfstring = MCATGETS(Set_AgentLabel, 270, "..."); XtVaSetValues(pick, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); @@ -211,9 +211,9 @@ AddLibraryAgent::pick_dir () { int n; XmString title_str = XmStringCreateLocalized( - CATGETS(Set_AddLibraryAgent, 10, "Dtinfo: Infolib Selection")); + MCATGETS(Set_AddLibraryAgent, 10, "Dtinfo: Infolib Selection")); XmString no_libs_str = XmStringCreateLocalized( - CATGETS(Set_AddLibraryAgent, 11, "No Infolibs Present")); + MCATGETS(Set_AddLibraryAgent, 11, "No Infolibs Present")); XmString patt_str = XmStringCreateLocalized( (char*)"*.dti" ); XmString infolibs_str = XmStringCreateLocalized( (char*)"Infolibs" ); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C index 3528a4c28..e2928cf57 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C @@ -218,7 +218,7 @@ BookmarkEdit::create_ui() new WTopLevelShell (window_system().toplevel(), WPopup, "bookmark_edit"); window_system().register_shell (f_shell); - string = CATGETS(Set_BookmarkEdit, 1, "Dtinfo: Bookmark Editor"); + string = MCATGETS(Set_BookmarkEdit, 1, "Dtinfo: Bookmark Editor"); XtVaSetValues(*f_shell, XmNtitle, string, NULL); WXmForm form (*f_shell, "form"); @@ -226,28 +226,28 @@ BookmarkEdit::create_ui() f_name_text = new WXmTextField (form, "name_text", WAutoManage); WXmLabelGadget notes (form, "notes", WAutoManage); - mtfstring = CATGETS(Set_AgentLabel, 163, "Name"); + mtfstring = MCATGETS(Set_AgentLabel, 163, "Name"); XtVaSetValues(name, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 164, "Notes"); + mtfstring = MCATGETS(Set_AgentLabel, 164, "Notes"); XtVaSetValues(notes, XmNlabelString, (XmString)mtfstring, NULL); // NOTE: Don't add spaces after "," because of stupid CPP. f_ok = WXmPushButtonGadget (form, "ok", WAutoManage); ON_ACTIVATE (f_ok, ok); - mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); + mtfstring = MCATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues(f_ok, XmNlabelString, (XmString)mtfstring, NULL); BUTTON (form,view); BUTTON (form,cancel); - mtfstring = CATGETS(Set_AgentLabel, 165, "Display"); + mtfstring = MCATGETS(Set_AgentLabel, 165, "Display"); XtVaSetValues(view, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); + mtfstring = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues(cancel, XmNlabelString, (XmString)mtfstring, NULL); WXmPushButtonGadget help (form, "help", WAutoManage); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); help_agent().add_activate_help (help, (char*)"bookmark_edit_help"); f_wm_delete_callback = @@ -301,7 +301,7 @@ BookmarkEdit::ok() mcatch_any() { message_mgr().error_dialog( - CATGETS(Set_BookmarkEdit, 1, "Dtinfo: Bookmark Editor")); + MCATGETS(Set_BookmarkEdit, 1, "Dtinfo: Bookmark Editor")); } end_try; } @@ -334,7 +334,7 @@ BookmarkEdit::cancel() if (f_modified) confirmed = message_mgr().question_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 2, + (char*)UAS_String(MCATGETS(Set_Messages, 2, "Abandon changes?"))); if (confirmed) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C index ae539baea..acc46e11e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C @@ -238,7 +238,7 @@ GraphicAgent::create_ui() f_shell = WTopLevelShell (window_system().toplevel(), WPopup, "graphic"); window_system().register_shell (&f_shell); - string = CATGETS(Set_GraphicAgent, 1, "Dtinfo: Detached Graphic"); + string = MCATGETS(Set_GraphicAgent, 1, "Dtinfo: Detached Graphic"); XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); // just use "delete_response" instead @@ -264,27 +264,27 @@ GraphicAgent::create_ui() DECLM (WXmPushButton, close, file_menu, "close" ); XtVaSetValues(file, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 1, "File")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 1, "File")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 2, ""), + *MCATGETS(Set_AgentLabel, 2, ""), NULL); XtVaSetValues(attach, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 167, "Attach")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 167, "Attach")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 21, ""), + *MCATGETS(Set_AgentLabel, 21, ""), NULL); XtVaSetValues(visit, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel,168,"Display Section")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel,168,"Display Section")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 119, ""), + *MCATGETS(Set_AgentLabel, 119, ""), NULL); XtVaSetValues(close, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 12, "Close")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 12, "Close")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 13, ""), + *MCATGETS(Set_AgentLabel, 13, ""), NULL); DECLM (WXmCascadeButton, pan, menu_bar, "panner" ); @@ -296,39 +296,39 @@ GraphicAgent::create_ui() DECLM (WXmToggleButton, low_right, panner_menu, "low_right" ); XtVaSetValues(pan, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 166, "Panner")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 166, "Panner")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 9, ""), + *MCATGETS(Set_AgentLabel, 9, ""), NULL); XtVaSetValues(none, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 178, "None")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 178, "None")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 7, ""), + *MCATGETS(Set_AgentLabel, 7, ""), NULL); XtVaSetValues(up_left, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 179, "Upper Left")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 179, "Upper Left")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 254, ""), + *MCATGETS(Set_AgentLabel, 254, ""), NULL); XtVaSetValues(up_right, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 180, "Upper Right")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 180, "Upper Right")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 252, ""), + *MCATGETS(Set_AgentLabel, 252, ""), NULL); XtVaSetValues(low_left, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 181, "Lower Left")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 181, "Lower Left")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 113, ""), + *MCATGETS(Set_AgentLabel, 113, ""), NULL); XtVaSetValues(low_right, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 182, "Lower Right")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 182, "Lower Right")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 259, ""), + *MCATGETS(Set_AgentLabel, 259, ""), NULL); // NOTE: some code in this module depends upon the exact ordering of items @@ -339,22 +339,22 @@ GraphicAgent::create_ui() DECLM (WXmPushButton, fit_win_to_gr, view_menu, "fit_graphic" ); XtVaSetValues(view, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 4, "View")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 4, "View")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 5, ""), + *MCATGETS(Set_AgentLabel, 5, ""), NULL); XtVaSetValues(fit_gr_to_win, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 169, "Fit to Window")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 169, "Fit to Window")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 35, ""), + *MCATGETS(Set_AgentLabel, 35, ""), NULL); XtVaSetValues(fit_win_to_gr, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 170, "Fit to Graphic")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 170, "Fit to Graphic")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 37, ""), + *MCATGETS(Set_AgentLabel, 37, ""), NULL); DECLM (WXmSeparator, separator, view_menu, "separator" ); @@ -366,23 +366,23 @@ GraphicAgent::create_ui() DECLM (WXmToggleButton, z_200, view_menu, "z_200" ); DECLM (WXmToggleButton, z_custom, view_menu, "z_custom" ); - mtfstring = CATGETS(Set_AgentLabel, 171, "25 %"); + mtfstring = MCATGETS(Set_AgentLabel, 171, "25 %"); XtVaSetValues(z_25, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 172, "50 %"); + mtfstring = MCATGETS(Set_AgentLabel, 172, "50 %"); XtVaSetValues(z_50, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 173, "100 %"); + mtfstring = MCATGETS(Set_AgentLabel, 173, "100 %"); XtVaSetValues(z_100, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 174, "125 %"); + mtfstring = MCATGETS(Set_AgentLabel, 174, "125 %"); XtVaSetValues(z_125, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 175, "150 %"); + mtfstring = MCATGETS(Set_AgentLabel, 175, "150 %"); XtVaSetValues(z_150, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 176, "200 %"); + mtfstring = MCATGETS(Set_AgentLabel, 176, "200 %"); XtVaSetValues(z_200, XmNlabelString, (XmString)mtfstring, NULL); XtVaSetValues(z_custom, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 177, "Custom...")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 177, "Custom...")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 13, ""), + *MCATGETS(Set_AgentLabel, 13, ""), NULL); z_100.Set(1); @@ -397,21 +397,21 @@ GraphicAgent::create_ui() DECLM (WXmPushButton, on_help, help_menu, "on_help" ); XtVaSetValues(help, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 48, "Help")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 48, "Help")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 39, ""), + *MCATGETS(Set_AgentLabel, 39, ""), NULL); XtVaSetValues(on_window, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 147, "On Window")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 147, "On Window")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 35, ""), + *MCATGETS(Set_AgentLabel, 35, ""), NULL); XtVaSetValues(on_help, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 153, "On Help")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 153, "On Help")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 39, ""), + *MCATGETS(Set_AgentLabel, 39, ""), NULL); DECLM (WXmLabel, message_area, form, "message"); @@ -440,12 +440,12 @@ GraphicAgent::create_ui() PixmapGraphic &pgraphic = *(f_graphic->pixmap_graphic()); Graphic *graphic = f_graphic ; - UAS_String buffer = CATGETS(Set_GraphicAgent, 8, "Dtinfo: "); + UAS_String buffer = MCATGETS(Set_GraphicAgent, 8, "Dtinfo: "); UAS_String titleStr(graphic->title()); const char *title = titleStr ; if (title == NULL || *title == '\0') // empty string - title = (char *)CATGETS(Set_GraphicAgent, 2, "Detached Graphic"); + title = (char *)MCATGETS(Set_GraphicAgent, 2, "Detached Graphic"); buffer = buffer + title; f_shell.Title((char*)buffer); @@ -493,9 +493,9 @@ GraphicAgent::create_ui() if(scalable) { if (f_graphic->content_type() == "application/CGM") - mtfstring = CATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); + mtfstring = MCATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); else - mtfstring = CATGETS(Set_GraphicAgent, 9, "Raster illustration (scalable)"); + mtfstring = MCATGETS(Set_GraphicAgent, 9, "Raster illustration (scalable)"); } else { @@ -503,7 +503,7 @@ GraphicAgent::create_ui() for (unsigned int i = 0 ; i < view_menu.NumChildren(); i++) WRect(view_menu.Children()[i]).SetSensitive(False); #endif - mtfstring = CATGETS(Set_GraphicAgent, 3, + mtfstring = MCATGETS(Set_GraphicAgent, 3, "Raster illustration (non-scalable)"); } @@ -514,11 +514,11 @@ GraphicAgent::create_ui() for (int i = 0 ; i < view_menu.NumChildren(); i++) WRect(view_menu.Children()[i]).SetSensitive(False); #endif - mtfstring = CATGETS(Set_GraphicAgent, 3, + mtfstring = MCATGETS(Set_GraphicAgent, 3, "Raster illustration (non-scalable)"); } else { - mtfstring = CATGETS(Set_GraphicAgent, 4, + mtfstring = MCATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); } #endif @@ -859,9 +859,9 @@ GraphicAgent::zoom_callback(WCallback *wcb) } f_setcustom = 1 ; - UAS_String msg = CATGETS(Set_GraphicAgent, 6, + UAS_String msg = MCATGETS(Set_GraphicAgent, 6, "Enter the new scaling percentage:"); - UAS_String title = CATGETS(Set_GraphicAgent, 7, "Dtinfo: Set Scale"); + UAS_String title = MCATGETS(Set_GraphicAgent, 7, "Dtinfo: Set Scale"); scale = message_mgr(). get_integer((char*)msg, (char*)title, f_current_scale, (Widget)f_shell); @@ -901,7 +901,7 @@ GraphicAgent::set_zoom(unsigned int scale) Wait_Cursor bob; - XmStringLocalized mtfstring = CATGETS(Set_GraphicAgent, 5, + XmStringLocalized mtfstring = MCATGETS(Set_GraphicAgent, 5, "Scaling illustration, please wait..."); XtVaSetValues((Widget)f_message_area, XmNlabelString, (XmString)mtfstring, NULL); @@ -920,9 +920,9 @@ GraphicAgent::set_zoom(unsigned int scale) refresh(graphic()); if (f_graphic->content_type() == "application/CGM") - mtfstring = CATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); + mtfstring = MCATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); else - mtfstring = CATGETS(Set_GraphicAgent, 9, "Raster illustration (scalable)"); + mtfstring = MCATGETS(Set_GraphicAgent, 9, "Raster illustration (scalable)"); XtVaSetValues((Widget)f_message_area, XmNlabelString, (XmString)mtfstring, NULL); @@ -940,9 +940,9 @@ GraphicAgent::refresh(const UAS_Pointer &) // update message area XmStringLocalized mtfstring; if (f_graphic->content_type() == "application/CGM") - mtfstring = CATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); + mtfstring = MCATGETS(Set_GraphicAgent, 4, "Vector illustration (scalable)"); else - mtfstring = CATGETS(Set_GraphicAgent, 9, "Raster illustration (scalable)"); + mtfstring = MCATGETS(Set_GraphicAgent, 9, "Raster illustration (scalable)"); XtVaSetValues((Widget)f_message_area, XmNlabelString, (XmString)mtfstring, NULL); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C b/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C index 2e6c1d21a..fcd757018 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C @@ -181,7 +181,7 @@ HelpAgent::display_help (Widget w) if(locator_id == NULL) { message_mgr().error_dialog ((char*)UAS_String( - CATGETS(Set_Messages, 3, "No help available"))); + MCATGETS(Set_Messages, 3, "No help available"))); return; } @@ -232,7 +232,7 @@ HelpAgent::display_help (const String locatoridResourceString) else { message_mgr().error_dialog (UAS_String( - CATGETS(Set_Messages, 3, "No help available"))); + MCATGETS(Set_Messages, 3, "No help available"))); } } } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C index 4b7f66211..09e752e9c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/IcccmAgent.C @@ -240,7 +240,7 @@ IcccmAgent::targetCB(Widget w, XtPointer ia, Atom *selection, length, format); if (atom == None) // failed to resolve the best atom message_mgr().info_dialog ((char*) - UAS_String(CATGETS(Set_Messages, 4, + UAS_String(MCATGETS(Set_Messages, 4, "There is no text selected.\n" "Select some text, then try again."))); } @@ -255,7 +255,7 @@ IcccmAgent::valueCB(Widget w, XtPointer ia, Atom *selection, if (atom == None) // failed to resolve the best atom message_mgr().info_dialog ((char*) - UAS_String(CATGETS(Set_Messages, 4, + UAS_String(MCATGETS(Set_Messages, 4, "There is no text selected.\n" "Select some text, then try again."))); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C index ff805329a..86c4890b5 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C @@ -226,7 +226,7 @@ exitCB(Widget, XtPointer client_data, XtPointer) if (BookmarkEdit::modified_count() > 0) { if (! message_mgr().question_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 5, + (char*)UAS_String(MCATGETS(Set_Messages, 5, "There are unsaved bookmarks open.\n" "Quit without saving them?")), f_shell)) @@ -237,7 +237,7 @@ exitCB(Widget, XtPointer client_data, XtPointer) //if (XtIsRealized(f_shell)) XMapRaised(XtDisplay(f_shell), XtWindow(f_shell)); message_mgr().quit_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 6, "Quit Dtinfo?")), f_shell); + (char*)UAS_String(MCATGETS(Set_Messages, 6, "Quit Dtinfo?")), f_shell); } // ///////////////////////////////////////////////////////////////// @@ -348,7 +348,7 @@ LibraryAgent::create_ui() window_system().register_shell ((WTopLevelShell*)f_shell); // set title of doc_tree - string = CATGETS(Set_LibraryAgent, 3, "Dtinfo: Book List"); + string = MCATGETS(Set_LibraryAgent, 3, "Dtinfo: Book List"); XtVaSetValues(f_shell, XmNtitle, string, NULL); // just use "delete_response" instead @@ -384,9 +384,9 @@ LibraryAgent::create_ui() widget = XtCreateManagedWidget("file", xmCascadeButtonGadgetClass, menu_bar, args, n); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 1, "File")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 1, "File")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 2, ""), + *MCATGETS(Set_AgentLabel, 2, ""), NULL); help_agent().add_help_cb(widget); @@ -398,9 +398,9 @@ LibraryAgent::create_ui() XtVaSetValues(f_view, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 4, "View")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 4, "View")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 5, ""), + *MCATGETS(Set_AgentLabel, 5, ""), NULL); #ifdef AllowDetach @@ -411,9 +411,9 @@ LibraryAgent::create_ui() // add labelString to f_detach XtVaSetValues(f_detach, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 6, "Detach")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 6, "Detach")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 7, ""), + *MCATGETS(Set_AgentLabel, 7, ""), NULL); #endif @@ -427,9 +427,9 @@ LibraryAgent::create_ui() // add labelString to f_print_as XtVaSetValues(f_print_as, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 10, "Print...")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 10, "Print...")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 9, "P"), + *MCATGETS(Set_AgentLabel, 9, "P"), NULL); XtCreateManagedWidget("sep2", xmSeparatorGadgetClass, fileM, 0, 0); @@ -442,9 +442,9 @@ LibraryAgent::create_ui() // add labelString to f_close XtVaSetValues(f_close, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 12, "Close")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 12, "Close")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 13, ""), + *MCATGETS(Set_AgentLabel, 13, ""), NULL); widget = XtCreateManagedWidget("exit", xmPushButtonGadgetClass, fileM, 0, 0); @@ -452,9 +452,9 @@ LibraryAgent::create_ui() // add labelString to "exit" XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 14, "Exit")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 14, "Exit")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 15, ""), + *MCATGETS(Set_AgentLabel, 15, ""), NULL); // edit menu @@ -467,9 +467,9 @@ LibraryAgent::create_ui() // add labelString to "edit" XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 16, "Edit")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 16, "Edit")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 17, ""), + *MCATGETS(Set_AgentLabel, 17, ""), NULL); help_agent().add_help_cb(widget); @@ -479,9 +479,9 @@ LibraryAgent::create_ui() // add labelString to "copy" XtVaSetValues(f_copy, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 18, "Copy")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 18, "Copy")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 19, ""), + *MCATGETS(Set_AgentLabel, 19, ""), NULL); widget = XtCreateManagedWidget("add", xmPushButtonWidgetClass, editM, 0, 0); @@ -489,9 +489,9 @@ LibraryAgent::create_ui() // add labelString to "add" XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 20, "Add...")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 20, "Add...")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 21, ""), + *MCATGETS(Set_AgentLabel, 21, ""), NULL); f_remove = XtCreateManagedWidget("remove", @@ -500,9 +500,9 @@ LibraryAgent::create_ui() // add labelString to "remove" XtVaSetValues(f_remove, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 22, "Remove")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 22, "Remove")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 23, ""), + *MCATGETS(Set_AgentLabel, 23, ""), NULL); // options menu @@ -515,9 +515,9 @@ LibraryAgent::create_ui() // add labelString to "options" XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 24, "Options")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 24, "Options")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 25, ""), + *MCATGETS(Set_AgentLabel, 25, ""), NULL); help_agent().add_help_cb(widget); @@ -527,9 +527,9 @@ LibraryAgent::create_ui() // add labelString to "preferences" XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 26, "Preferences...")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 26, "Preferences...")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 27, ""), + *MCATGETS(Set_AgentLabel, 27, ""), NULL); XtCreateManagedWidget("sep1", xmSeparatorGadgetClass, optionsM, 0, 0); @@ -542,9 +542,9 @@ LibraryAgent::create_ui() // add labelString to "auto_track" XtVaSetValues(f_auto_track, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 28, "Auto Track")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 28, "Auto Track")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 29, ""), + *MCATGETS(Set_AgentLabel, 29, ""), NULL); Widget tool_barT = XtCreateManagedWidget("show_tool_bar", @@ -555,9 +555,9 @@ LibraryAgent::create_ui() // add labelString to "show_tool_bar" XtVaSetValues(tool_barT, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 30, "Show ToolBar")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 30, "Show ToolBar")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 31, ""), + *MCATGETS(Set_AgentLabel, 31, ""), NULL); Widget search_areaT = XtCreateManagedWidget("show_search_area", @@ -568,9 +568,9 @@ LibraryAgent::create_ui() // add labelString to "show_search_area" XtVaSetValues(search_areaT, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 32, "Show Search Area")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 32, "Show Search Area")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 33, ""), + *MCATGETS(Set_AgentLabel, 33, ""), NULL); // windows menu @@ -583,9 +583,9 @@ LibraryAgent::create_ui() // add labelString to "windows" XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 34, "Windows")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 34, "Windows")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 35, ""), + *MCATGETS(Set_AgentLabel, 35, ""), NULL); help_agent().add_help_cb(widget); @@ -594,9 +594,9 @@ LibraryAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, mark_listCB, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 40, "Marks List")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 40, "Marks List")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 41, ""), + *MCATGETS(Set_AgentLabel, 41, ""), NULL); widget = XtCreateManagedWidget("section_history", xmPushButtonGadgetClass, @@ -604,9 +604,9 @@ LibraryAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, section_historyCB, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 38, "Section History")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 38, "Section History")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 39, ""), + *MCATGETS(Set_AgentLabel, 39, ""), NULL); widget = XtCreateManagedWidget("search_history", xmPushButtonGadgetClass, @@ -614,9 +614,9 @@ LibraryAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, search_historyCB, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 42, "Search History")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 42, "Search History")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 43, ""), + *MCATGETS(Set_AgentLabel, 43, ""), NULL); widget = XtCreateManagedWidget("query", xmPushButtonGadgetClass, @@ -624,9 +624,9 @@ LibraryAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, query_editorCB, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 44, "Query Editor")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 44, "Query Editor")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 45, ""), + *MCATGETS(Set_AgentLabel, 45, ""), NULL); widget = XtCreateManagedWidget("scope", xmPushButtonGadgetClass, @@ -634,9 +634,9 @@ LibraryAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, scope_editorCB, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 46, "Scope Editor")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 46, "Scope Editor")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 47, ""), + *MCATGETS(Set_AgentLabel, 47, ""), NULL); Widget helpM = XmCreatePulldownMenu(menu_bar, (char*)"help_menu", 0, 0); @@ -648,9 +648,9 @@ LibraryAgent::create_ui() menu_bar, args, n); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 48, "Help")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 48, "Help")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 49, ""), + *MCATGETS(Set_AgentLabel, 49, ""), NULL); help_agent().add_help_cb(widget); n = 0; @@ -663,9 +663,9 @@ LibraryAgent::create_ui() helpM, 0, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 50, "On Item...")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 50, "On Item...")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 51, ""), + *MCATGETS(Set_AgentLabel, 51, ""), NULL); #endif @@ -677,9 +677,9 @@ LibraryAgent::create_ui() helpM, 0, 0); XtVaSetValues(on_overview, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 257, "Overview")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 257, "Overview")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 258, ""), + *MCATGETS(Set_AgentLabel, 258, ""), NULL); XtCreateManagedWidget("sep", xmSeparatorGadgetClass, @@ -688,26 +688,26 @@ LibraryAgent::create_ui() helpM, 0, 0); XtVaSetValues(on_tasks, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 249, "Tasks")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 249, "Tasks")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 250, ""), + *MCATGETS(Set_AgentLabel, 250, ""), NULL); on_reference = XtCreateManagedWidget("on_reference", xmPushButtonGadgetClass, helpM, 0, 0); XtVaSetValues(on_reference, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 251, "Reference")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 251, "Reference")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 252, ""), + *MCATGETS(Set_AgentLabel, 252, ""), NULL); on_item = XtCreateManagedWidget("on_item", xmPushButtonGadgetClass, helpM, 0, 0); XtVaSetValues(on_item, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 50, "On Item...")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 50, "On Item...")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 51, ""), + *MCATGETS(Set_AgentLabel, 51, ""), NULL); XtCreateManagedWidget("sep", xmSeparatorGadgetClass, helpM, 0, 0); @@ -715,9 +715,9 @@ LibraryAgent::create_ui() helpM, 0, 0); XtVaSetValues(on_help, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 253, "Using Help")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 253, "Using Help")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 254, ""), + *MCATGETS(Set_AgentLabel, 254, ""), NULL); XtCreateManagedWidget("sep", xmSeparatorGadgetClass, helpM, 0, 0); @@ -725,9 +725,9 @@ LibraryAgent::create_ui() helpM, 0, 0); XtVaSetValues(on_about, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 255, "About Information Manager")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 255, "About Information Manager")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 256, ""), + *MCATGETS(Set_AgentLabel, 256, ""), NULL); // WXmPushButtonGadget tmp_pbg(tmp); @@ -750,7 +750,7 @@ LibraryAgent::create_ui() tool_bar, 0, 0); XtAddCallback(f_view2, XmNactivateCallback, display_nodeCB, this); help_text = new UAS_String( - CATGETS(Set_AgentQHelp, 52, "Display selected section")); + MCATGETS(Set_AgentQHelp, 52, "Display selected section")); add_quick_help(f_view2, (char*)*help_text); f_help_text.insert_item(help_text); help_agent().add_help_cb(f_view2); @@ -762,7 +762,7 @@ LibraryAgent::create_ui() f_detach2 = XtCreateManagedWidget("detach", xmPushButtonWidgetClass, tool_bar, 0, 0); XtAddCallback(f_detach2, XmNactivateCallback, detach_subtreeCB, this); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 53, "Display selected section in a separate Book List")); + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 53, "Display selected section in a separate Book List")); add_quick_help(f_detach2, (char*)*help_text); f_help_text.insert_item(help_text); #endif @@ -770,7 +770,7 @@ LibraryAgent::create_ui() f_print2 = XtCreateManagedWidget("print", xmPushButtonWidgetClass, tool_bar, 0, 0); XtAddCallback(f_print2, XmNactivateCallback, printCB, this); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 54, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 54, "Print selected section")); add_quick_help(f_print2, (char*)*help_text); f_help_text.insert_item(help_text); @@ -778,7 +778,7 @@ LibraryAgent::create_ui() widget = XtCreateManagedWidget("add", xmPushButtonWidgetClass, tool_bar, 0, 0); XtAddCallback(widget, XmNactivateCallback, add_libraryCB, this); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 55, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 55, "Open an additional information library")); add_quick_help(widget, (char*)*help_text); f_help_text.insert_item(help_text); @@ -787,7 +787,7 @@ LibraryAgent::create_ui() f_remove2 = XtCreateManagedWidget("remove", xmPushButtonWidgetClass, tool_bar, 0, 0); XtAddCallback(f_remove2, XmNactivateCallback, remove_libraryCB, this); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 56, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 56, "Close selected information library")); add_quick_help(f_remove2, (char*)*help_text); f_help_text.insert_item(help_text); @@ -796,7 +796,7 @@ LibraryAgent::create_ui() widget = XtCreateManagedWidget("query", xmPushButtonWidgetClass, tool_bar, 0, 0); XtAddCallback(widget, XmNactivateCallback, query_editorCB, 0); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 57, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 57, "Perform a search using the Query Editor")); add_quick_help(widget, (char*)*help_text); f_help_text.insert_item(help_text); @@ -806,7 +806,7 @@ LibraryAgent::create_ui() widget = XtCreateManagedWidget("marks_list", xmPushButtonWidgetClass, tool_bar, 0, 0); XtAddCallback(widget, XmNactivateCallback, mark_listCB, 0); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 58, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 58, "Display the bookmarks and notes list")); add_quick_help(widget, (char*)*help_text); f_help_text.insert_item(help_text); @@ -862,7 +862,7 @@ LibraryAgent::create_ui() XtSetArg(args[n], XmNbackground, bg); n++; f_status_text = XtCreateManagedWidget("text", xmTextFieldWidgetClass, message, args, n); - string = CATGETS(Set_LibraryAgent, 63, "Welcome to Dtinfo!"); + string = MCATGETS(Set_LibraryAgent, 63, "Welcome to Dtinfo!"); XtVaSetValues(f_status_text, XmNvalue, string, NULL); // Search area @@ -873,9 +873,9 @@ LibraryAgent::create_ui() XtManageChild(widget = XmCreateOptionMenu(search_area, (char*)"scope", args, n)); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 59, "Search:")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 59, "Search:")), NULL); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 60, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 60, "Specify search scope")); add_quick_help(widget, (char*)*help_text); f_help_text.insert_item(help_text); @@ -911,9 +911,9 @@ LibraryAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, scope_editorCB, 0); XtVaSetValues(widget, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 61, "Scope Editor")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 61, "Scope Editor")), NULL); - help_text = new UAS_String(CATGETS(Set_AgentQHelp, 62, + help_text = new UAS_String(MCATGETS(Set_AgentQHelp, 62, "Specify search scope using the Scope Editor")); add_quick_help(widget, (char*)*help_text); f_help_text.insert_item(help_text); @@ -1066,11 +1066,11 @@ LibraryAgent::search_help (Widget, XtPointer client_data, if (help_text == NULL) { UAS_Pointer str; - str = new UAS_String(CATGETS(Set_AgentQHelp, 64, "Search %s")); + str = new UAS_String(MCATGETS(Set_AgentQHelp, 64, "Search %s")); help_text = (char*)*str; agent->f_help_text.insert_item(str); - str = new UAS_String(CATGETS(Set_LibraryAgent, 65, "Current Section")); + str = new UAS_String(MCATGETS(Set_LibraryAgent, 65, "Current Section")); default_scope = (char*)*str; agent->f_help_text.insert_item(str); } @@ -1169,7 +1169,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) ((newLib != NULL) && ( *newLib == '\0' )) ) { message_mgr().error_dialog( - (char*)UAS_String(CATGETS( Set_AddLibraryAgent, 6, + (char*)UAS_String(MCATGETS( Set_AddLibraryAgent, 6, "No Infolib specified." )), parent); return (sts = BAD_ARG_FORMAT); } @@ -1210,7 +1210,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) else { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_AddLibraryAgent, 5, + (char*)UAS_String(MCATGETS(Set_AddLibraryAgent, 5, "Infolib specification format error.")), parent); sts = BAD_ARG_FORMAT ; @@ -1219,7 +1219,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) } else { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_AddLibraryAgent, 2, + (char*)UAS_String(MCATGETS(Set_AddLibraryAgent, 2, "Please enter an absolute path to the infolib.")), parent); } @@ -1231,7 +1231,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) // if returned to reach here, error msg probably given by // MMDB interface: "Invalid MMDB infolib path: <>" message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_AddLibraryAgent, 3, + (char*)UAS_String(MCATGETS(Set_AddLibraryAgent, 3, "Infolib open failed. Check the path specified.")), parent); #endif @@ -1246,7 +1246,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) if( d != (const int)0 ) { message_mgr().error_dialog( - (char*)UAS_String(CATGETS(Set_AddLibraryAgent, 4, + (char*)UAS_String(MCATGETS(Set_AddLibraryAgent, 4, "Infolib creation failed.")), parent) ; } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C index b15f62806..02b12396a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C @@ -149,9 +149,9 @@ ListView::create_ui_objects() WXmPushButton help (form, "help", WAutoManage); XtVaSetValues(close, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 12, "Close")), NULL); + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 12, "Close")), NULL); XtVaSetValues(help, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 48, "Help")), NULL); + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 48, "Help")), NULL); // 7/30/93 rtp - bear with this hack, it's a little bogus int help_namelen = strlen(f_name) + strlen("_help") + 1; @@ -163,7 +163,7 @@ ListView::create_ui_objects() f_activate = WXmPushButton (form, "activate", WAutoManage); XtVaSetValues(f_activate, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 165, "Display")), NULL); + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 165, "Display")), NULL); // WXmLabelGadget label (form, "label", WAutoManage); WXmSeparator separator (form, "separator", WAutoManage); // NOTE: Fix WWL to have a scrolled list object! diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C index ba6287136..223765788 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C @@ -346,7 +346,7 @@ MapAgent::display (UAS_Pointer &doc_ptr, bool popup) if (this_button == NULL) { message_mgr(). - error_dialog (CATGETS(Set_Messages, 7, "File a Bug")); + error_dialog (MCATGETS(Set_Messages, 7, "File a Bug")); return; } else @@ -432,7 +432,7 @@ MapAgent::display (UAS_Pointer &doc_ptr, bool popup) // Manage all the children. MapButton::ManageKids(); - UAS_String buffer = CATGETS(Set_MapAgent, 2, "Dtinfo: "); + UAS_String buffer = MCATGETS(Set_MapAgent, 2, "Dtinfo: "); buffer = buffer + doc_ptr->title(); f_shell->Title ((char*)buffer); @@ -481,7 +481,7 @@ MapAgent::create_ui() window_system().register_shell (f_shell); XtVaSetValues(*f_shell, XmNtitle, - CATGETS(Set_MapAgent, 1, "Dtinfo: Local Map"), NULL); + MCATGETS(Set_MapAgent, 1, "Dtinfo: Local Map"), NULL); WindowGeometry wg = pref_mgr().get_geometry (PrefMgr::MapGeometry); f_shell->Set(WArgList(XmNwidth, wg.width, XmNheight, wg.height, @@ -496,9 +496,9 @@ MapAgent::create_ui() help_agent().add_activate_help (help, (char*)"map_help"); XtVaSetValues(close, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 12, "Close")), NULL); + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 12, "Close")), NULL); XtVaSetValues(help, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 48, "Help")), NULL); + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 48, "Help")), NULL); WXmPanedWindow pane (rootform, "pane"); WXmForm topform (pane, "topform"); @@ -512,7 +512,7 @@ MapAgent::create_ui() f_lock = new WXmToggleButton (topform, "lock", WAutoManage); XtVaSetValues(*f_lock, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 196, "Auto Update")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 196, "Auto Update")), XmNindicatorSize, 15, NULL); bool lock_status = pref_mgr().get_boolean (PrefMgr::MapAutoUpdate); f_lock->Set(lock_status); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C index 53262b83e..104125a5e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C @@ -135,7 +135,7 @@ MarkChooser::create_ui (Widget parent, XtVaSetValues(f_form, XmNdialogTitle, (XmString)XmStringLocalized((char*)title_key), NULL); XtVaSetValues(f_ok, XmNlabelString, (XmString)XmStringLocalized((char*)ok_key), NULL); - mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); + mtfstring = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues(cancel, XmNlabelString, (XmString)mtfstring, NULL); SET_CALLBACK (f_list,SingleSelection,select); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C index 04acfb2cf..3d786c7e4 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C @@ -203,8 +203,8 @@ MarkIcon::double_click(XEvent *event) g_timeout = NULL; } - UAS_String title = CATGETS(Set_MarkChooser, 2, "Dtinfo: Edit Mark"); - UAS_String btitle = CATGETS(Set_AgentLabel, 16, "Edit"); + UAS_String title = MCATGETS(Set_MarkChooser, 2, "Dtinfo: Edit Mark"); + UAS_String btitle = MCATGETS(Set_AgentLabel, 16, "Edit"); MarkChooser chooser (f_chooser_parent, f_mark_list, (char*)title, (char*)btitle); @@ -511,8 +511,8 @@ MarkIcon::activate (WCallback *wcb) delete g_timeout; g_timeout = NULL; - UAS_String title = CATGETS(Set_MarkChooser, 2, "Dtinfo: Edit Mark"); - UAS_String btitle = CATGETS(Set_AgentLabel, 16, "Edit"); + UAS_String title = MCATGETS(Set_MarkChooser, 2, "Dtinfo: Edit Mark"); + UAS_String btitle = MCATGETS(Set_AgentLabel, 16, "Edit"); MarkChooser chooser (f_chooser_parent, f_mark_list, (char*)title, (char*)btitle); @@ -537,8 +537,8 @@ MarkIcon::select_mark_timeout() // WTimeOut will destruct itself, do not delete g_timeout here g_timeout = NULL; - UAS_String title = CATGETS(Set_MarkChooser, 1, "Dtinfo: Select Mark"); - UAS_String btitle = CATGETS(Set_AgentLabel, 161, "Ok"); + UAS_String title = MCATGETS(Set_MarkChooser, 1, "Dtinfo: Select Mark"); + UAS_String btitle = MCATGETS(Set_AgentLabel, 161, "Ok"); MarkChooser chooser (f_chooser_parent, f_mark_list, (char*)title, (char*)btitle); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C index acd2a75a6..9b9fc0979 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C @@ -134,7 +134,7 @@ MarkListView::create_ui() f_shell = WTopLevelShell (window_system().toplevel(), WPopup, "mark_list"); window_system().register_shell(&f_shell); - string = CATGETS(Set_MarkList, 1, "Dtinfo: User Marks List"); + string = MCATGETS(Set_MarkList, 1, "Dtinfo: User Marks List"); XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); DECL (WXmForm, form, f_shell, "form"); @@ -148,15 +148,15 @@ MarkListView::create_ui() f_list = WXmList (list); f_list.Manage(); - mtfstring = CATGETS(Set_AgentLabel, 165, "Display"); + mtfstring = MCATGETS(Set_AgentLabel, 165, "Display"); XtVaSetValues(f_view, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 16, "Edit"); + mtfstring = MCATGETS(Set_AgentLabel, 16, "Edit"); XtVaSetValues(f_edit, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 183, "Delete"); + mtfstring = MCATGETS(Set_AgentLabel, 183, "Delete"); XtVaSetValues(f_delete, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 12, "Close"); + mtfstring = MCATGETS(Set_AgentLabel, 12, "Close"); XtVaSetValues(close, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); SET_CALLBACK (f_list,SingleSelection,select); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C index 58f7b15f0..220ee873e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C @@ -210,9 +210,9 @@ MessageAgent::displayMessage (char *message_text) XmStringLocalized mtfstring; // Set labels on buttons - mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); + mtfstring = MCATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues((Widget)f_dialog->OkPB(), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); + mtfstring = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues((Widget)f_dialog->CancelPB(), XmNlabelString, (XmString)mtfstring, NULL); // Unmanage the cancel and help buttons @@ -256,7 +256,7 @@ MessageAgent::displayError (char *message_text, Widget parent) // Set the window title WXmDialogShell *shell = (WXmDialogShell *)XtParent(*f_dialog); - String string = CATGETS(Set_MessageAgent, 1, "Dtinfo: Error"); + String string = MCATGETS(Set_MessageAgent, 1, "Dtinfo: Error"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); // Set the dialog type @@ -295,7 +295,7 @@ MessageAgent::displayWarning (char *message_text, Widget parent) // Set the window title WXmDialogShell *shell = (WXmDialogShell *)XtParent(*f_dialog); - String string = CATGETS(Set_MessageAgent, 2, "Dtinfo: Warning"); + String string = MCATGETS(Set_MessageAgent, 2, "Dtinfo: Warning"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); // Set the dialog type @@ -334,7 +334,7 @@ MessageAgent::displayInformation (char *message_text, Widget parent) // Set the window title WXmDialogShell *shell = (WXmDialogShell *)XtParent(*f_dialog); - String string = CATGETS(Set_MessageAgent, 3, "Dtinfo: Information"); + String string = MCATGETS(Set_MessageAgent, 3, "Dtinfo: Information"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); // Set the dialog type @@ -378,14 +378,14 @@ MessageAgent::displayProgress (char *message_text, Widget parent) { #if 0 f_dialog->ResizePolicy(XmRESIZE_NONE); #endif - String string = CATGETS(Set_MessageAgent, 4, "Dtinfo: Progress"); + String string = MCATGETS(Set_MessageAgent, 4, "Dtinfo: Progress"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); f_dialog->DialogType (XmDIALOG_INFORMATION); f_dialog->MessageAlignment (XmALIGNMENT_BEGINNING); // Set labels on buttons - XmStringLocalized label_str = CATGETS(Set_AgentLabel, 162, "Cancel"); + XmStringLocalized label_str = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues((Widget)f_dialog->CancelPB(), XmNlabelString, (XmString)label_str, NULL); @@ -450,7 +450,7 @@ MessageAgent::displayQuestion (char *message_text, Widget parent) // Set the window title WXmDialogShell *shell = (WXmDialogShell *)XtParent(*f_dialog); - String string = CATGETS(Set_MessageAgent, 6, "Dtinfo: Question"); + String string = MCATGETS(Set_MessageAgent, 6, "Dtinfo: Question"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); // Set the dialog type @@ -460,9 +460,9 @@ MessageAgent::displayQuestion (char *message_text, Widget parent) f_dialog->MessageAlignment (XmALIGNMENT_CENTER); // Set labels on buttons - mtfstring = CATGETS(Set_AgentLabel, 244, "Yes"); + mtfstring = MCATGETS(Set_AgentLabel, 244, "Yes"); XtVaSetValues((Widget)f_dialog->OkPB(), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 245, "No"); + mtfstring = MCATGETS(Set_AgentLabel, 245, "No"); XtVaSetValues((Widget)f_dialog->CancelPB(), XmNlabelString, (XmString)mtfstring, NULL); // Manage the cancel and help buttons @@ -504,7 +504,7 @@ MessageAgent::displayQuit (char *message_text, Widget parent) // Set the window title WXmDialogShell *shell = (WXmDialogShell *)XtParent(*f_dialog); - String string = CATGETS(Set_MessageAgent, 5, "Dtinfo: Confirm Quit"); + String string = MCATGETS(Set_MessageAgent, 5, "Dtinfo: Confirm Quit"); XtVaSetValues((Widget)shell, XmNtitle, string, XmNminWidth, 200, NULL); @@ -518,9 +518,9 @@ MessageAgent::displayQuit (char *message_text, Widget parent) f_exit_flag = True; // Set labels on buttons - mtfstring = CATGETS(Set_AgentLabel, 244, "Yes"); + mtfstring = MCATGETS(Set_AgentLabel, 244, "Yes"); XtVaSetValues((Widget)f_dialog->OkPB(), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 245, "No"); + mtfstring = MCATGETS(Set_AgentLabel, 245, "No"); XtVaSetValues((Widget)f_dialog->CancelPB(), XmNlabelString, (XmString)mtfstring, NULL); // Manage the cancel and help buttons @@ -607,9 +607,9 @@ MessageAgent::get_integer (const char *message, const char* title, XmStringLocalized mtfstring; - mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); + mtfstring = MCATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues((Widget)f_dialog->OkPB(), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); + mtfstring = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues((Widget)f_dialog->CancelPB(), XmNlabelString, (XmString)mtfstring, NULL); snprintf (buffer, sizeof(buffer), "%d", default_value); @@ -712,7 +712,7 @@ MessageAgent::get_string (const char *msg, const char* title, if (title == NULL) title = (char*)UAS_String( - CATGETS(Set_MessageAgent, 7, "Dtinfo: File a Bug")); + MCATGETS(Set_MessageAgent, 7, "Dtinfo: File a Bug")); static char buffer[256]; @@ -729,9 +729,9 @@ MessageAgent::get_string (const char *msg, const char* title, XmStringLocalized mtfstring; - mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); + mtfstring = MCATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues((Widget)f_dialog->OkPB(), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); + mtfstring = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues((Widget)f_dialog->CancelPB(), XmNlabelString, (XmString)mtfstring, NULL); if (default_value) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C index 1fb8785e5..b3194260e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C @@ -128,7 +128,7 @@ NodeHistoryAgent::create_ui() f_shell = WTopLevelShell (window_system().toplevel(), WPopup, "node_hist"); window_system().register_shell (&f_shell); - string = CATGETS(Set_NodeHistoryAgent, 1, "Dtinfo: Section History"); + string = MCATGETS(Set_NodeHistoryAgent, 1, "Dtinfo: Section History"); XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); DECL (WXmForm, form, f_shell, "form"); @@ -137,20 +137,20 @@ NodeHistoryAgent::create_ui() DECLM (WXmPushButton, help, form, "help"); DECLM (WXmSeparator, sep, form, "separator"); - mtfstring = CATGETS(Set_AgentLabel, 165, "Display"); + mtfstring = MCATGETS(Set_AgentLabel, 165, "Display"); XtVaSetValues(f_display, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 12, "Close"); + mtfstring = MCATGETS(Set_AgentLabel, 12, "Close"); XtVaSetValues(close, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); // set up column labels (Book, Section) WXmLabel booklabel (form, "book", WAutoManage); WXmLabel sectionlabel (form, "section", WAutoManage); - mtfstring = CATGETS(Set_AgentLabel, 184, "Book"); + mtfstring = MCATGETS(Set_AgentLabel, 184, "Book"); XtVaSetValues(booklabel, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 185, "Section"); + mtfstring = MCATGETS(Set_AgentLabel, 185, "Section"); XtVaSetValues(sectionlabel, XmNlabelString, (XmString)mtfstring, NULL); Widget scrolled_list = XmCreateScrolledList (form, (char*)"list", NULL, 0); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C index a7c909569..5d5eb5bc3 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C @@ -159,11 +159,11 @@ NodeListAgent::create_base_window (char *name) f_help = WXmPushButton (*f_form, "help", AM); WXmPushButton closeb (*f_form, "close", AM); - mtfstring = CATGETS(Set_AgentLabel, 165, "Display"); + mtfstring = MCATGETS(Set_AgentLabel, 165, "Display"); XtVaSetValues((Widget)f_display, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 12, "Close"); + mtfstring = MCATGETS(Set_AgentLabel, 12, "Close"); XtVaSetValues((Widget)closeb, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues((Widget)f_help, XmNlabelString, (XmString)mtfstring, NULL); WXmSeparator separator (*f_form, "separator", AM); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C index 311c21f15..ef277c756 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C @@ -410,14 +410,14 @@ NodeWindowAgent::exit_cb() { bool resp; resp = message_mgr().question_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 2, + (char*)UAS_String(MCATGETS(Set_Messages, 2, "Do you want to abandon your changes?")), (Widget)f_shell); if (! resp) return; } message_mgr().quit_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 6, + (char*)UAS_String(MCATGETS(Set_Messages, 6, "Do you really want to quit Dtinfo?")), (Widget)f_shell); } @@ -511,10 +511,10 @@ NodeWindowAgent::popup_menu(XButtonPressedEvent* event) const char *book_name = (char *) bn; if (book_name != NULL && *book_name != '\0') snprintf (preview_buffer, sizeof(preview_buffer), - CATGETS(Set_Messages, 8, "Link to %s: %s"), book_name, title); + MCATGETS(Set_Messages, 8, "Link to %s: %s"), book_name, title); else snprintf (preview_buffer, sizeof(preview_buffer), - CATGETS(Set_Messages, 9, "Link to %s"), title); + MCATGETS(Set_Messages, 9, "Link to %s"), title); WXmLabel lb = WXmLabel(f_preview_label); lb.LabelString(WXmString(title)); @@ -885,14 +885,14 @@ exitCB(Widget, XtPointer client_data, XtPointer) { bool resp; resp = message_mgr().question_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 2, + (char*)UAS_String(MCATGETS(Set_Messages, 2, "Do you want to abandon your changes?"))); if (! resp) return; } message_mgr().quit_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 6, + (char*)UAS_String(MCATGETS(Set_Messages, 6, "Do you really want to quit Dtinfo?"))); #endif } @@ -981,7 +981,7 @@ NodeWindowAgent::create_ui() window_system().register_shell (f_shell); - string = CATGETS(Set_NodeWindowAgent, 1, "Dtinfo: Browser"); + string = MCATGETS(Set_NodeWindowAgent, 1, "Dtinfo: Browser"); XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); f_wm_delete_callback = @@ -1019,15 +1019,15 @@ NodeWindowAgent::create_ui() help_agent().add_help_cb(widget); - mtfstring = CATGETS(Set_AgentLabel, 62, "Browser"); - mnemonic = *CATGETS(Set_AgentLabel, 63, ""); + mtfstring = MCATGETS(Set_AgentLabel, 62, "Browser"); + mnemonic = *MCATGETS(Set_AgentLabel, 63, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("new", xmPushButtonGadgetClass, fileM, 0, 0); XtAddCallback(widget, XmNactivateCallback, cloneCB, this); - mtfstring = CATGETS(Set_AgentLabel, 64, "New Window"); - mnemonic = *CATGETS(Set_AgentLabel, 65, ""); + mtfstring = MCATGETS(Set_AgentLabel, 64, "New Window"); + mnemonic = *MCATGETS(Set_AgentLabel, 65, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep1", xmSeparatorGadgetClass, fileM, 0, 0); @@ -1036,8 +1036,8 @@ NodeWindowAgent::create_ui() fileM, 0, 0); XtAddCallback(f_print_as, XmNactivateCallback, print_asCB, this); - mtfstring = CATGETS(Set_AgentLabel, 72, "Print..."); - mnemonic = *CATGETS(Set_AgentLabel, 71, "P"); + mtfstring = MCATGETS(Set_AgentLabel, 72, "Print..."); + mnemonic = *MCATGETS(Set_AgentLabel, 71, "P"); XtVaSetValues(f_print_as, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep2", xmSeparatorGadgetClass, fileM, 0, 0); @@ -1045,8 +1045,8 @@ NodeWindowAgent::create_ui() widget = XtCreateManagedWidget("show", xmPushButtonGadgetClass, fileM, 0, 0); XtAddCallback(widget, XmNactivateCallback, show_locatorCB, this); - mtfstring = CATGETS(Set_AgentLabel, 68, "Show Locator"); - mnemonic = *CATGETS(Set_AgentLabel, 69, ""); + mtfstring = MCATGETS(Set_AgentLabel, 68, "Show Locator"); + mnemonic = *MCATGETS(Set_AgentLabel, 69, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep3", xmSeparatorGadgetClass, fileM, 0, 0); @@ -1057,15 +1057,15 @@ NodeWindowAgent::create_ui() fileM, args, n); XtAddCallback(f_close, XmNactivateCallback, dismissCB, this); - mtfstring = CATGETS(Set_AgentLabel, 74, "Close"); - mnemonic = *CATGETS(Set_AgentLabel, 75, ""); + mtfstring = MCATGETS(Set_AgentLabel, 74, "Close"); + mnemonic = *MCATGETS(Set_AgentLabel, 75, ""); XtVaSetValues(f_close, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("exit", xmPushButtonGadgetClass, fileM, 0, 0); XtAddCallback(widget, XmNactivateCallback, exitCB, this); - mtfstring = CATGETS(Set_AgentLabel, 76, "Exit"); - mnemonic = *CATGETS(Set_AgentLabel, 77, ""); + mtfstring = MCATGETS(Set_AgentLabel, 76, "Exit"); + mnemonic = *MCATGETS(Set_AgentLabel, 77, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // search menu @@ -1078,32 +1078,32 @@ NodeWindowAgent::create_ui() menu_bar, args, n); help_agent().add_help_cb(f_search_menu_button); - mtfstring = CATGETS(Set_AgentLabel, 102, "Search"); - mnemonic = *CATGETS(Set_AgentLabel, 103, ""); + mtfstring = MCATGETS(Set_AgentLabel, 102, "Search"); + mnemonic = *MCATGETS(Set_AgentLabel, 103, ""); XtVaSetValues(f_search_menu_button, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("on_selection", xmPushButtonGadgetClass, searchM, 0, 0); XtAddCallback(widget, XmNactivateCallback, search_on_selectionCB, this); - mtfstring = CATGETS(Set_AgentLabel, 78, "On Selection"); - mnemonic = *CATGETS(Set_AgentLabel, 79, ""); + mtfstring = MCATGETS(Set_AgentLabel, 78, "On Selection"); + mnemonic = *MCATGETS(Set_AgentLabel, 79, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("query_editor", xmPushButtonGadgetClass, searchM, 0, 0); XtAddCallback(widget, XmNactivateCallback, query_editorCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 80, "Query Editor"); - mnemonic = *CATGETS(Set_AgentLabel, 81, ""); + mtfstring = MCATGETS(Set_AgentLabel, 80, "Query Editor"); + mnemonic = *MCATGETS(Set_AgentLabel, 81, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("scope_editor", xmPushButtonGadgetClass, searchM, 0, 0); XtAddCallback(widget, XmNactivateCallback, scope_editorCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 82, "Scope Editor"); - mnemonic = *CATGETS(Set_AgentLabel, 83, ""); + mtfstring = MCATGETS(Set_AgentLabel, 82, "Scope Editor"); + mnemonic = *MCATGETS(Set_AgentLabel, 83, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep1", xmSeparatorGadgetClass, searchM, 0, 0); @@ -1112,8 +1112,8 @@ NodeWindowAgent::create_ui() searchM, 0, 0); XtAddCallback(widget, XmNactivateCallback, search_historyCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 84, "Search History"); - mnemonic = *CATGETS(Set_AgentLabel, 85, ""); + mtfstring = MCATGETS(Set_AgentLabel, 84, "Search History"); + mnemonic = *MCATGETS(Set_AgentLabel, 85, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep2", xmSeparatorGadgetClass, searchM, 0, 0); @@ -1125,9 +1125,9 @@ NodeWindowAgent::create_ui() XtVaSetValues(f_clear_search_hits, XmNlabelString, - (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 86, "Clear Search Hits")), + (XmString)XmStringLocalized(MCATGETS(Set_AgentLabel, 86, "Clear Search Hits")), XmNmnemonic, - *CATGETS(Set_AgentLabel, 87, ""), + *MCATGETS(Set_AgentLabel, 87, ""), NULL); XtCreateManagedWidget("sep3", xmSeparatorGadgetClass, searchM, 0, 0); @@ -1136,16 +1136,16 @@ NodeWindowAgent::create_ui() xmPushButtonGadgetClass, searchM, 0, 0); XtAddCallback(f_search_prev, XmNactivateCallback, search_previousCB, this); - mtfstring = CATGETS(Set_AgentLabel, 98, "Previous Search"); - mnemonic = *CATGETS(Set_AgentLabel, 99, ""); + mtfstring = MCATGETS(Set_AgentLabel, 98, "Previous Search"); + mnemonic = *MCATGETS(Set_AgentLabel, 99, ""); XtVaSetValues(f_search_prev, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); f_search_next = XtCreateManagedWidget("search_next", xmPushButtonGadgetClass, searchM, 0, 0); XtAddCallback(f_search_next, XmNactivateCallback, search_nextCB, this); - mtfstring = CATGETS(Set_AgentLabel, 100, "Next Search"); - mnemonic = *CATGETS(Set_AgentLabel, 101, ""); + mtfstring = MCATGETS(Set_AgentLabel, 100, "Next Search"); + mnemonic = *MCATGETS(Set_AgentLabel, 101, ""); XtVaSetValues(f_search_next, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // go menu @@ -1156,8 +1156,8 @@ NodeWindowAgent::create_ui() menu_bar, args, n); help_agent().add_help_cb(widget); - mtfstring = CATGETS(Set_AgentLabel, 104, "Go"); - mnemonic = *CATGETS(Set_AgentLabel, 105, ""); + mtfstring = MCATGETS(Set_AgentLabel, 104, "Go"); + mnemonic = *MCATGETS(Set_AgentLabel, 105, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); f_history_prev = XtCreateManagedWidget("history_prev", @@ -1166,8 +1166,8 @@ NodeWindowAgent::create_ui() XtAddCallback(f_history_prev, XmNarmCallback, preview_history_prevCB, this); XtAddCallback(f_history_prev, XmNdisarmCallback, unpreviewCB, this); - mtfstring = CATGETS(Set_AgentLabel, 88, "Back (History)"); - mnemonic = *CATGETS(Set_AgentLabel, 89, ""); + mtfstring = MCATGETS(Set_AgentLabel, 88, "Back (History)"); + mnemonic = *MCATGETS(Set_AgentLabel, 89, ""); XtVaSetValues(f_history_prev, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); f_history_next = XtCreateManagedWidget("history_next", @@ -1176,16 +1176,16 @@ NodeWindowAgent::create_ui() XtAddCallback(f_history_next, XmNarmCallback, preview_history_nextCB, this); XtAddCallback(f_history_next, XmNdisarmCallback, unpreviewCB, this); - mtfstring = CATGETS(Set_AgentLabel, 90, "Forward (History)"); - mnemonic = *CATGETS(Set_AgentLabel, 91, ""); + mtfstring = MCATGETS(Set_AgentLabel, 90, "Forward (History)"); + mnemonic = *MCATGETS(Set_AgentLabel, 91, ""); XtVaSetValues(f_history_next, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("section_history", xmPushButtonGadgetClass, goM, 0, 0); XtAddCallback(widget, XmNactivateCallback, section_historyCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 92, "History..."); - mnemonic = *CATGETS(Set_AgentLabel, 93, ""); + mtfstring = MCATGETS(Set_AgentLabel, 92, "History..."); + mnemonic = *MCATGETS(Set_AgentLabel, 93, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep1", xmSeparatorGadgetClass, goM, 0, 0); @@ -1196,8 +1196,8 @@ NodeWindowAgent::create_ui() XtAddCallback(f_node_next, XmNarmCallback, preview_nextCB, this); XtAddCallback(f_node_next, XmNdisarmCallback, unpreviewCB, this); - mtfstring = CATGETS(Set_AgentLabel, 96, "Next Section"); - mnemonic = *CATGETS(Set_AgentLabel, 97, ""); + mtfstring = MCATGETS(Set_AgentLabel, 96, "Next Section"); + mnemonic = *MCATGETS(Set_AgentLabel, 97, ""); XtVaSetValues(f_node_next, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); f_node_prev = XtCreateManagedWidget("section_prev", @@ -1206,8 +1206,8 @@ NodeWindowAgent::create_ui() XtAddCallback(f_node_prev, XmNarmCallback, preview_previousCB, this); XtAddCallback(f_node_prev, XmNdisarmCallback, unpreviewCB, this); - mtfstring = CATGETS(Set_AgentLabel, 94, "Previous Section"); - mnemonic = *CATGETS(Set_AgentLabel, 95, ""); + mtfstring = MCATGETS(Set_AgentLabel, 94, "Previous Section"); + mnemonic = *MCATGETS(Set_AgentLabel, 95, ""); XtVaSetValues(f_node_prev, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep2", xmSeparatorGadgetClass, goM, 0, 0); @@ -1215,8 +1215,8 @@ NodeWindowAgent::create_ui() widget = XtCreateManagedWidget("open", xmPushButtonGadgetClass, goM, 0, 0); XtAddCallback(widget, XmNactivateCallback, open_urlCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 66, "Open Locator..."); - mnemonic = *CATGETS(Set_AgentLabel, 67, ""); + mtfstring = MCATGETS(Set_AgentLabel, 66, "Open Locator..."); + mnemonic = *MCATGETS(Set_AgentLabel, 67, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // marks menu @@ -1228,8 +1228,8 @@ NodeWindowAgent::create_ui() menu_bar, args, n); help_agent().add_help_cb(widget); - mtfstring = CATGETS(Set_AgentLabel, 106, "Marks"); - mnemonic = *CATGETS(Set_AgentLabel, 107, ""); + mtfstring = MCATGETS(Set_AgentLabel, 106, "Marks"); + mnemonic = *MCATGETS(Set_AgentLabel, 107, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); f_create_bmrk = XtCreateManagedWidget("create_bmrk", @@ -1247,8 +1247,8 @@ NodeWindowAgent::create_ui() if (window_system().dtinfo_font()) bmfont = XmFontListAppendEntry(bmfont, window_system().dtinfo_font()); - mtfstring = CATGETS(Set_AgentLabel, 108, "Create Bookmark"); - mnemonic = *CATGETS(Set_AgentLabel, 109, ""); + mtfstring = MCATGETS(Set_AgentLabel, 108, "Create Bookmark"); + mnemonic = *MCATGETS(Set_AgentLabel, 109, ""); XtVaSetValues(f_create_bmrk, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, XmNfontList, bmfont, NULL); @@ -1258,8 +1258,8 @@ NodeWindowAgent::create_ui() markM, 0, 0); XtAddCallback(f_create_anno, XmNactivateCallback, create_annotationCB, this); - mtfstring = CATGETS(Set_AgentLabel, 110, "Create Note..."); - mnemonic = *CATGETS(Set_AgentLabel, 111, ""); + mtfstring = MCATGETS(Set_AgentLabel, 110, "Create Note..."); + mnemonic = *MCATGETS(Set_AgentLabel, 111, ""); XtVaSetValues(f_create_anno, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, XmNfontList, bmfont, NULL); @@ -1271,8 +1271,8 @@ NodeWindowAgent::create_ui() markM, 0, 0); XtAddCallback(list_marks, XmNactivateCallback, mark_listCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 112, "List Marks"); - mnemonic = *CATGETS(Set_AgentLabel, 113, ""); + mtfstring = MCATGETS(Set_AgentLabel, 112, "List Marks"); + mnemonic = *MCATGETS(Set_AgentLabel, 113, ""); XtVaSetValues(list_marks, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, XmNfontList, bmfont, NULL); @@ -1283,8 +1283,8 @@ NodeWindowAgent::create_ui() xmPushButtonGadgetClass, markM, 0, 0); XtAddCallback(f_edit_mark, XmNactivateCallback, edit_markCB, this); - mtfstring = CATGETS(Set_AgentLabel, 114, "Edit Selection..."); - mnemonic = *CATGETS(Set_AgentLabel, 115, ""); + mtfstring = MCATGETS(Set_AgentLabel, 114, "Edit Selection..."); + mnemonic = *MCATGETS(Set_AgentLabel, 115, ""); XtVaSetValues(f_edit_mark, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, XmNfontList, bmfont, NULL); @@ -1293,8 +1293,8 @@ NodeWindowAgent::create_ui() xmPushButtonGadgetClass, markM, 0, 0); XtAddCallback(f_move_mark, XmNactivateCallback, move_markCB, this); - mtfstring = CATGETS(Set_AgentLabel, 116, "Move Selection"); - mnemonic = *CATGETS(Set_AgentLabel, 117, ""); + mtfstring = MCATGETS(Set_AgentLabel, 116, "Move Selection"); + mnemonic = *MCATGETS(Set_AgentLabel, 117, ""); XtVaSetValues(f_move_mark, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, XmNfontList, bmfont, NULL); @@ -1304,8 +1304,8 @@ NodeWindowAgent::create_ui() markM, 0, 0); XtAddCallback(f_delete_mark, XmNactivateCallback, delete_markCB, this); - mtfstring = CATGETS(Set_AgentLabel, 118, "Delete Selection"); - mnemonic = *CATGETS(Set_AgentLabel, 119, ""); + mtfstring = MCATGETS(Set_AgentLabel, 118, "Delete Selection"); + mnemonic = *MCATGETS(Set_AgentLabel, 119, ""); XtVaSetValues(f_delete_mark, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, XmNfontList, bmfont, NULL); @@ -1385,16 +1385,16 @@ NodeWindowAgent::create_ui() menu_bar, args, n); help_agent().add_help_cb(widget); - mtfstring = CATGETS(Set_AgentLabel, 120, "Options"); - mnemonic = *CATGETS(Set_AgentLabel, 121, ""); + mtfstring = MCATGETS(Set_AgentLabel, 120, "Options"); + mnemonic = *MCATGETS(Set_AgentLabel, 121, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("preferences", xmPushButtonGadgetClass, optionsM, 0, 0); XtAddCallback(widget, XmNactivateCallback, prefsCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 122, "Preferences..."); - mnemonic = *CATGETS(Set_AgentLabel, 123, ""); + mtfstring = MCATGETS(Set_AgentLabel, 122, "Preferences..."); + mnemonic = *MCATGETS(Set_AgentLabel, 123, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep1", xmSeparatorGadgetClass, optionsM, 0, 0); @@ -1404,8 +1404,8 @@ NodeWindowAgent::create_ui() optionsM, 0, 0); XtAddCallback(f_detach_graphic, XmNactivateCallback, detach_graphicCB, this); - mtfstring = CATGETS(Set_AgentLabel, 124, "Detach Graphic"); - mnemonic = *CATGETS(Set_AgentLabel, 125, ""); + mtfstring = MCATGETS(Set_AgentLabel, 124, "Detach Graphic"); + mnemonic = *MCATGETS(Set_AgentLabel, 125, ""); XtVaSetValues(f_detach_graphic, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); XtCreateManagedWidget("sep2", xmSeparatorGadgetClass, optionsM, 0, 0); @@ -1416,8 +1416,8 @@ NodeWindowAgent::create_ui() XtAddCallback(tool_barT, XmNvalueChangedCallback, tool_bar_toggleCB, tool_bar); - mtfstring = CATGETS(Set_AgentLabel, 126, "Show Tool Bar"); - mnemonic = *CATGETS(Set_AgentLabel, 127, ""); + mtfstring = MCATGETS(Set_AgentLabel, 126, "Show Tool Bar"); + mnemonic = *MCATGETS(Set_AgentLabel, 127, ""); XtVaSetValues(tool_barT, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); Widget search_areaT = XtCreateManagedWidget("show_search_area", @@ -1426,8 +1426,8 @@ NodeWindowAgent::create_ui() XtAddCallback(search_areaT, XmNvalueChangedCallback, search_area_toggleCB, search_area); - mtfstring = CATGETS(Set_AgentLabel, 128, "Show Search Area"); - mnemonic = *CATGETS(Set_AgentLabel, 129, ""); + mtfstring = MCATGETS(Set_AgentLabel, 128, "Show Search Area"); + mnemonic = *MCATGETS(Set_AgentLabel, 129, ""); XtVaSetValues(search_areaT, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // windows menu @@ -1439,24 +1439,24 @@ NodeWindowAgent::create_ui() menu_bar, args, n); help_agent().add_help_cb(widget); - mtfstring = CATGETS(Set_AgentLabel, 130, "Windows"); - mnemonic = *CATGETS(Set_AgentLabel, 131, ""); + mtfstring = MCATGETS(Set_AgentLabel, 130, "Windows"); + mnemonic = *MCATGETS(Set_AgentLabel, 131, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("booklist", xmPushButtonGadgetClass, windowsM, 0, 0); XtAddCallback(widget, XmNactivateCallback, show_booklistCB, 0); - mtfstring = CATGETS(Set_AgentLabel, 132, "Book List"); - mnemonic = *CATGETS(Set_AgentLabel, 133, ""); + mtfstring = MCATGETS(Set_AgentLabel, 132, "Book List"); + mnemonic = *MCATGETS(Set_AgentLabel, 133, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); widget = XtCreateManagedWidget("graphical_map", xmPushButtonGadgetClass, windowsM, 0, 0); XtAddCallback(widget, XmNactivateCallback, show_mapCB, this); - mtfstring = CATGETS(Set_AgentLabel, 134, "Graphical Map"); - mnemonic = *CATGETS(Set_AgentLabel, 135, ""); + mtfstring = MCATGETS(Set_AgentLabel, 134, "Graphical Map"); + mnemonic = *MCATGETS(Set_AgentLabel, 135, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); @@ -1472,8 +1472,8 @@ NodeWindowAgent::create_ui() XtSetArg(args[n], XmNmenuHelpWidget, widget); n++; XtSetValues(menu_bar, args, n); - mtfstring = CATGETS(Set_AgentLabel, 143, "Help"); - mnemonic = *CATGETS(Set_AgentLabel, 144, ""); + mtfstring = MCATGETS(Set_AgentLabel, 143, "Help"); + mnemonic = *MCATGETS(Set_AgentLabel, 144, ""); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); #define AM WAutoManage @@ -1496,56 +1496,56 @@ NodeWindowAgent::create_ui() //WXmPushButton on_version (helpM, "on_version" , AM); //ON_ACTIVATE (on_version, display_version); - mtfstring = CATGETS(Set_AgentLabel, 257, "Overview"); - mnemonic = *CATGETS(Set_AgentLabel, 258, ""); + mtfstring = MCATGETS(Set_AgentLabel, 257, "Overview"); + mnemonic = *MCATGETS(Set_AgentLabel, 258, ""); XtVaSetValues((Widget)on_overview, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 249, "Tasks"); - mnemonic = *CATGETS(Set_AgentLabel, 250, ""); + mtfstring = MCATGETS(Set_AgentLabel, 249, "Tasks"); + mnemonic = *MCATGETS(Set_AgentLabel, 250, ""); XtVaSetValues((Widget)on_tasks, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 251, "Reference"); - mnemonic = *CATGETS(Set_AgentLabel, 252, ""); + mtfstring = MCATGETS(Set_AgentLabel, 251, "Reference"); + mnemonic = *MCATGETS(Set_AgentLabel, 252, ""); XtVaSetValues((Widget)on_reference, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 50, "On Item..."); - mnemonic = *CATGETS(Set_AgentLabel, 51, ""); + mtfstring = MCATGETS(Set_AgentLabel, 50, "On Item..."); + mnemonic = *MCATGETS(Set_AgentLabel, 51, ""); XtVaSetValues((Widget)on_item, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 253, "Using Help"); - mnemonic = *CATGETS(Set_AgentLabel, 254, ""); + mtfstring = MCATGETS(Set_AgentLabel, 253, "Using Help"); + mnemonic = *MCATGETS(Set_AgentLabel, 254, ""); XtVaSetValues((Widget)on_help, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 255, "About Information Manager"); - mnemonic = *CATGETS(Set_AgentLabel, 256, ""); + mtfstring = MCATGETS(Set_AgentLabel, 255, "About Information Manager"); + mnemonic = *MCATGETS(Set_AgentLabel, 256, ""); XtVaSetValues((Widget)on_about, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); #ifdef EAM - mtfstring = CATGETS(Set_AgentLabel, 147, "On Window"); - mnemonic = *CATGETS(Set_AgentLabel, 148, ""); + mtfstring = MCATGETS(Set_AgentLabel, 147, "On Window"); + mnemonic = *MCATGETS(Set_AgentLabel, 148, ""); XtVaSetValues((Widget)on_window, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); -// mtfstring = CATGETS(Set_AgentLabel, 149, "On Application"); -// mnemonic = *CATGETS(Set_AgentLabel, 150, ""); +// mtfstring = MCATGETS(Set_AgentLabel, 149, "On Application"); +// mnemonic = *MCATGETS(Set_AgentLabel, 150, ""); // XtVaSetValues((Widget)on_application, XmNlabelString, (XmString)mtfstring, // XmNmnemonic, mnemonic, NULL); -// mtfstring = CATGETS(Set_AgentLabel, 151, "Index"); -// mnemonic = *CATGETS(Set_AgentLabel, 152, ""); +// mtfstring = MCATGETS(Set_AgentLabel, 151, "Index"); +// mnemonic = *MCATGETS(Set_AgentLabel, 152, ""); // XtVaSetValues((Widget)index, XmNlabelString, (XmString)mtfstring, // XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 155, "On Keys"); - mnemonic = *CATGETS(Set_AgentLabel, 156, ""); + mtfstring = MCATGETS(Set_AgentLabel, 155, "On Keys"); + mnemonic = *MCATGETS(Set_AgentLabel, 156, ""); XtVaSetValues((Widget)on_keys, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 157, "On Version"); - mnemonic = *CATGETS(Set_AgentLabel, 158. ""); + mtfstring = MCATGETS(Set_AgentLabel, 157, "On Version"); + mnemonic = *MCATGETS(Set_AgentLabel, 158. ""); XtVaSetValues((Widget)on_version, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); @@ -1569,7 +1569,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_history_prev2, XmNdisarmCallback, unpreviewCB, this); help_agent().add_help_cb (f_history_prev2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 1, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 1, "Go to the previous section in history")); add_quick_help(f_history_prev2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1582,7 +1582,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_history_next2, XmNdisarmCallback, unpreviewCB, this); help_agent().add_help_cb (f_history_next2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 2, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 2, "Go to the next section in history")); add_quick_help(f_history_next2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1599,7 +1599,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_node_prev2, XmNdisarmCallback, unpreviewCB, this); help_agent().add_help_cb (f_node_prev2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 3, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 3, "Go to the previous section in document")); add_quick_help(f_node_prev2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1612,7 +1612,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_node_next2, XmNdisarmCallback, unpreviewCB, this); help_agent().add_help_cb (f_node_next2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 4, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 4, "Go to the next section in document")); add_quick_help(f_node_next2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1627,7 +1627,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_search_prev2, XmNactivateCallback, search_previousCB, this); help_agent().add_help_cb (f_search_prev2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 5, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 5, "Go to the previous search match")); add_quick_help(f_search_prev2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1638,7 +1638,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_search_next2, XmNactivateCallback, search_nextCB, this); help_agent().add_help_cb (f_search_next2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 6, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 6, "Go to the next search match")); add_quick_help(f_search_next2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1654,7 +1654,7 @@ NodeWindowAgent::create_ui() XtAddCallback(f_print2, XmNactivateCallback, printCB, this); help_agent().add_help_cb (f_print2); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 7, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 7, "Print current section")); add_quick_help(f_print2, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1664,7 +1664,7 @@ NodeWindowAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, show_booklistCB, 0); help_agent().add_help_cb (widget); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 8, "Display Book List")); + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 8, "Display Book List")); add_quick_help(widget, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1673,7 +1673,7 @@ NodeWindowAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, show_mapCB, this); help_agent().add_help_cb (widget); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 9, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 9, "Display Graphical Map")); add_quick_help(widget, (char*)*textstore); f_textstore.insert_item(textstore); @@ -1705,13 +1705,13 @@ NodeWindowAgent::create_ui() XtAddCallback(widget, XmNvalueChangedCallback, lock_toggleCB, this); help_agent().add_help_cb (widget); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 10, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 10, "Pin (unpin) this window, " "to prevent (allow) use for new documents.")); add_quick_help(widget, (char*)*textstore); f_textstore.insert_item(textstore); - mtfstring = CATGETS(Set_AgentLabel, 159, "Retain"); + mtfstring = MCATGETS(Set_AgentLabel, 159, "Retain"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); // Work Window @@ -1745,7 +1745,7 @@ NodeWindowAgent::create_ui() XtSetArg(args[n], XmNbackground, bg); n++; f_status_text = XtCreateManagedWidget("text", xmTextFieldWidgetClass, message, args, n); - string = CATGETS(Set_NodeWindowAgent, 2, "To preview a link destination, " + string = MCATGETS(Set_NodeWindowAgent, 2, "To preview a link destination, " "click and hold on the link."); XtVaSetValues(f_status_text, XmNvalue, string, NULL); @@ -1805,19 +1805,19 @@ NodeWindowAgent::create_ui() f_detach_button = XmCreatePushButton(f_detach_menu, (char*)"Detach Graphic", NULL, 0); XtAddCallback(f_detach_button, XmNactivateCallback, detach_grCB, this); XtManageChild(f_detach_button); - mtfstring = CATGETS(Set_AgentLabel, 124, "Detach Graphic"); + mtfstring = MCATGETS(Set_AgentLabel, 124, "Detach Graphic"); XtVaSetValues(f_detach_button, XmNlabelString, (XmString)mtfstring, NULL); f_attach_button = XmCreatePushButton(f_detach_menu, (char*)"Attach Graphic", NULL, 0); XtAddCallback(f_attach_button, XmNactivateCallback, attach_grCB, this); XtManageChild(f_attach_button); - mtfstring = CATGETS(Set_AgentLabel, 265, "Attach Graphic"); + mtfstring = MCATGETS(Set_AgentLabel, 265, "Attach Graphic"); XtVaSetValues(f_attach_button, XmNlabelString, (XmString)mtfstring, NULL); f_raise_button = XmCreatePushButton(f_detach_menu, (char*)"Raise Graphic", NULL, 0); XtAddCallback(f_raise_button, XmNactivateCallback, raise_grCB, this); XtManageChild(f_raise_button); - mtfstring = CATGETS(Set_AgentLabel, 264, "Raise Graphic"); + mtfstring = MCATGETS(Set_AgentLabel, 264, "Raise Graphic"); XtVaSetValues(f_raise_button, XmNlabelString, (XmString)mtfstring, NULL); XtAddEventHandler (f_help_dsp_area->dispWid, ButtonPressMask, False, popup_menuCB, (XtPointer)this); @@ -1837,13 +1837,13 @@ NodeWindowAgent::create_ui() widget = XmCreatePushButton(f_preview_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, go_to_linkCB, this); XtManageChild(widget); - mtfstring = CATGETS(Set_AgentLabel, 168, "Display Link"); + mtfstring = MCATGETS(Set_AgentLabel, 168, "Display Link"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); widget = XmCreatePushButton(f_preview_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, open_new_nodeCB, this); XtManageChild(widget); - mtfstring = CATGETS(Set_AgentLabel, 64, "New Window"); + mtfstring = MCATGETS(Set_AgentLabel, 64, "New Window"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); // create default popup menu @@ -1853,13 +1853,13 @@ NodeWindowAgent::create_ui() f_node_next3 = XmCreatePushButton(f_default_menu, (char*)"f_node_next3", NULL, 0); XtAddCallback(f_node_next3, XmNactivateCallback, node_nextCB, this); XtManageChild(f_node_next3); - mtfstring = CATGETS(Set_AgentLabel, 96, "Next Section"); + mtfstring = MCATGETS(Set_AgentLabel, 96, "Next Section"); XtVaSetValues(f_node_next3, XmNlabelString, (XmString)mtfstring, NULL); f_node_prev3 = XmCreatePushButton(f_default_menu, (char*)"f_node_prev3", NULL, 0); XtAddCallback(f_node_prev3, XmNactivateCallback, node_previousCB, this); XtManageChild(f_node_prev3); - mtfstring = CATGETS(Set_AgentLabel, 94, "Previous Section"); + mtfstring = MCATGETS(Set_AgentLabel, 94, "Previous Section"); XtVaSetValues(f_node_prev3, XmNlabelString, (XmString)mtfstring, NULL); widget = XmCreateSeparator(f_default_menu, (char*)"sep", NULL, 0); @@ -1868,7 +1868,7 @@ NodeWindowAgent::create_ui() widget = XmCreatePushButton(f_default_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, show_locatorCB, this); XtManageChild(widget); - mtfstring = CATGETS(Set_AgentLabel, 68, "Show Locator"); + mtfstring = MCATGETS(Set_AgentLabel, 68, "Show Locator"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); widget = XmCreateSeparator(f_default_menu, (char*)"sep", NULL, 0); @@ -1877,7 +1877,7 @@ NodeWindowAgent::create_ui() widget = XmCreatePushButton(f_default_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, printCB, this); XtManageChild(widget); - mtfstring = CATGETS(Set_AgentLabel, 70, "Print"); + mtfstring = MCATGETS(Set_AgentLabel, 70, "Print"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); @@ -1890,11 +1890,11 @@ NodeWindowAgent::create_ui() if (MB_CUR_MAX > 1) { // DtHelpDispAreaStruct cant_begin_chars - WString cant_begin_chars = CATGETS(Set_NodeWindowAgent, 5, ""); + WString cant_begin_chars = MCATGETS(Set_NodeWindowAgent, 5, ""); f_help_dsp_area->cant_begin_chars = cant_begin_chars.get_wstr(); // DtHelpDispAreaStruct cant_end_chars - WString cant_end_chars = CATGETS(Set_NodeWindowAgent, 6, ""); + WString cant_end_chars = MCATGETS(Set_NodeWindowAgent, 6, ""); f_help_dsp_area->cant_end_chars = cant_end_chars.get_wstr(); #ifdef LB_DEBUG @@ -1998,12 +1998,12 @@ NodeWindowAgent::create_ui() XtManageChild(widget = XmCreateOptionMenu(search_area, (char*)"scope", args, n)); help_agent().add_help_cb (widget); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 60, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 60, "Specify search scope")); add_quick_help(widget, (char*)*textstore); f_textstore.insert_item(textstore); - mtfstring = CATGETS(Set_AgentLabel, 59, "Search:"); + mtfstring = MCATGETS(Set_AgentLabel, 59, "Search:"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); // hookup the ScopeMenu object here @@ -2029,10 +2029,10 @@ NodeWindowAgent::create_ui() XtAddCallback(widget, XmNactivateCallback, scope_editorCB, 0); help_agent().add_help_cb (widget); - mtfstring = CATGETS(Set_AgentLabel, 46, "Scope Editor"); + mtfstring = MCATGETS(Set_AgentLabel, 46, "Scope Editor"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); - textstore = new UAS_String(CATGETS(Set_AgentQHelp, 11, + textstore = new UAS_String(MCATGETS(Set_AgentQHelp, 11, "Specify search scope using the Scope Editor")); add_quick_help(widget, (char*)*textstore); f_textstore.insert_item(textstore); @@ -2321,11 +2321,11 @@ NodeWindowAgent::search_help (Widget, XtPointer client_data, if (help_text == NULL) { UAS_Pointer str; - str = new UAS_String(CATGETS(Set_AgentQHelp, 64, "Search %s")); + str = new UAS_String(MCATGETS(Set_AgentQHelp, 64, "Search %s")); help_text = (char*)*str; agent->f_textstore.insert_item(str); - str = new UAS_String(CATGETS(Set_NodeWindowAgent, 3, "Information Library")); + str = new UAS_String(MCATGETS(Set_NodeWindowAgent, 3, "Information Library")); default_scope = (char*)*str; agent->f_textstore.insert_item(str); } @@ -2478,7 +2478,7 @@ NodeWindowAgent::initialize_history() void NodeWindowAgent::display_version() { - UAS_String version = CATGETS(Set_Version, 1, ""); + UAS_String version = MCATGETS(Set_Version, 1, ""); if (*(char*)version) { message_mgr().info_dialog ((char*)version); } @@ -3000,10 +3000,10 @@ NodeWindowAgent::preview (WTimeOut *) const char *book_name = (char *) bn; if (book_name != NULL && *book_name != '\0') snprintf (preview_buffer, sizeof(preview_buffer), - CATGETS(Set_Messages, 8, "Link to %s: %s"), book_name, title); + MCATGETS(Set_Messages, 8, "Link to %s: %s"), book_name, title); else snprintf (preview_buffer, sizeof(preview_buffer), - CATGETS(Set_Messages, 9, "Link to %s"), title); + MCATGETS(Set_Messages, 9, "Link to %s"), title); XmTextFieldSetString(f_status_text, preview_buffer); f_preview_timeout = NULL; f_preview_document = NULL; @@ -3083,7 +3083,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) //Xassert (name != NULL); if (name == NULL) { - message_mgr().error_dialog ((char*)UAS_String(CATGETS(Set_Messages, 10, + message_mgr().error_dialog ((char*)UAS_String(MCATGETS(Set_Messages, 10, "Dtinfo is unable to create this bookmark.")), (Widget)f_shell); return status; @@ -3257,7 +3257,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) } else if (bad_markinfo.length() > 0) message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_NodeWindowAgent, 7, + (char*)UAS_String(MCATGETS(Set_NodeWindowAgent, 7, "The selected text is dynamically inserted and cannot\n" "be used alone to create a bookmark reference. Either\n" "select other text near the point, or include more of\n" @@ -3269,7 +3269,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) mcatch_any() { if (! refmark) - message_mgr().error_dialog ((char*)UAS_String(CATGETS(Set_Messages, 10, + message_mgr().error_dialog ((char*)UAS_String(MCATGETS(Set_Messages, 10, "Dtinfo is unable to create this bookmark.")), (Widget)f_shell); } @@ -3555,7 +3555,7 @@ NodeWindowAgent::delete_mark() mcatch_any() { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 11, + (char*)UAS_String(MCATGETS(Set_Messages, 11, "Dtinfo is unable to delete this bookmark.")), (Widget)f_shell); } @@ -3606,7 +3606,7 @@ NodeWindowAgent::move_markCB(Widget, XtPointer client_data, XtPointer) mcatch_any() { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 12, + (char*)UAS_String(MCATGETS(Set_Messages, 12, "Dtinfo is unable to remove this bookmark.")), (Widget)f_shell); } @@ -3667,10 +3667,10 @@ NodeWindowAgent::detach_graphic() WArgList (XmNdialogType, XmDIALOG_INFORMATION, NULL)); WXmDialogShell shell (info_dialog.Parent()); // set window title - String string = CATGETS(Set_Messages, 72, "Dtinfo: Detach Graphic"); + String string = MCATGETS(Set_Messages, 72, "Dtinfo: Detach Graphic"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); info_dialog.MessageString ( - (char*)UAS_String(CATGETS(Set_Messages, 73, "Click on graphic"))); + (char*)UAS_String(MCATGETS(Set_Messages, 73, "Click on graphic"))); XtUnmanageChild (info_dialog.OkPB()); XtUnmanageChild (info_dialog.HelpPB()); @@ -3732,7 +3732,7 @@ NodeWindowAgent::show_locator() UAS_String locator_str = f_node_ptr->id(); const char *locator = (const char *)locator_str; snprintf (buffer, sizeof(buffer), - CATGETS(Set_NodeWindowAgent, 4, + MCATGETS(Set_NodeWindowAgent, 4, "The locator for this section is %s"), locator); XmTextFieldSetString(f_status_text, buffer); XmTextFieldSetSelection(f_status_text, @@ -4048,7 +4048,7 @@ NodeWindowAgent::do_bookmarks(bool move_to_mark) if (bookmark_errors > 0) { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 10, + (char*)UAS_String(MCATGETS(Set_Messages, 10, "Dtinfo is unable to create this bookmark.")), (Widget)f_shell); } @@ -4162,7 +4162,7 @@ NodeWindowAgent::initialize_hierarchy() if (++depth > 15) { message_mgr().error_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 13, "File a Bug")), + (char*)UAS_String(MCATGETS(Set_Messages, 13, "File a Bug")), (Widget)f_shell); break; } @@ -4886,7 +4886,7 @@ NodeWindowAgent::show_mark(MarkCanvas *jump_to, bool move_to) else { message_mgr().warning_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 14, + (char*)UAS_String(MCATGETS(Set_Messages, 14, "The bookmark cannot be displayed.")), (Widget)f_shell); } @@ -5139,7 +5139,7 @@ MarkViewer::receive (ViewMark &message, void* /*client_data*/) mcatch_any() { message_mgr().info_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 15, + (char*)UAS_String(MCATGETS(Set_Messages, 15, "The bookcase is not accessible."))); } end_try; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C index 38ab18941..9737bcf2d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C @@ -1235,7 +1235,7 @@ OutlineListView::activate (WCallback *wcb) } mcatch_any() { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, 5, "Document not found." )) ) ; } end_try; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C index 067aa5826..ef75f934e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C @@ -312,7 +312,7 @@ PrefAgent::create_ui() f_shell = WTopLevelShell (window_system().toplevel(), WPopup, "preferences"); window_system().register_shell(&f_shell); - string = CATGETS(Set_PrefAgent, 1, "Dtinfo: Preferences"); + string = MCATGETS(Set_PrefAgent, 1, "Dtinfo: Preferences"); XtVaSetValues((Widget)f_shell, XmNtitle, string, XmNmwmDecorations, decorations, @@ -322,7 +322,7 @@ PrefAgent::create_ui() DECLMC(WXmOptionMenu, options, form, "options"); DECLC (WXmPulldownMenu, options_menu, form, "options_menu"); - mtfstring = CATGETS(Set_AgentLabel, 186, "Preferences for"); + mtfstring = MCATGETS(Set_AgentLabel, 186, "Preferences for"); XtVaSetValues(options, XmNlabelString, (XmString)mtfstring, NULL); ASSNM (WXmPushButton, f_ok, form, "ok"); @@ -331,15 +331,15 @@ PrefAgent::create_ui() DECLM (WXmPushButton, cancel, form, "cancel"); DECLM (WXmPushButton, help, form, "help"); - mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); + mtfstring = MCATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues(f_ok, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 201, "Apply"); + mtfstring = MCATGETS(Set_AgentLabel, 201, "Apply"); XtVaSetValues(f_apply, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 202, "Reset"); + mtfstring = MCATGETS(Set_AgentLabel, 202, "Reset"); XtVaSetValues(f_reset, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 162, "Cancel"); + mtfstring = MCATGETS(Set_AgentLabel, 162, "Cancel"); XtVaSetValues(cancel, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); SET_CALLBACK (f_ok,Activate,ok); @@ -366,17 +366,17 @@ PrefAgent::create_ui() DECLM (WXmLabel, lock_label, browse_form, "lock_label"); ASSNM (WXmToggleButton, f_lock_toggle, browse_form, "lock_toggle"); - mtfstring = CATGETS(Set_AgentLabel, 187, "Browsing"); + mtfstring = MCATGETS(Set_AgentLabel, 187, "Browsing"); XtVaSetValues(browse, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 190, "Browser Geometry"); + mtfstring = MCATGETS(Set_AgentLabel, 190, "Browser Geometry"); XtVaSetValues(browse_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 270, "..."); + mtfstring = MCATGETS(Set_AgentLabel, 270, "..."); XtVaSetValues(get_browse_geo, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 192, "Font Scale"); + mtfstring = MCATGETS(Set_AgentLabel, 192, "Font Scale"); XtVaSetValues(fs_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 193, "Pin Window"); + mtfstring = MCATGETS(Set_AgentLabel, 193, "Pin Window"); XtVaSetValues(lock_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); + mtfstring = MCATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues(f_lock_toggle, XmNlabelString, (XmString)mtfstring, NULL); Dimension height; @@ -425,15 +425,15 @@ PrefAgent::create_ui() DECLM (WXmLabel, update_label, map_form, "update_label"); ASSNM (WXmToggleButton, f_update_toggle, map_form, "update_toggle"); - mtfstring = CATGETS(Set_AgentLabel, 188, "Map"); + mtfstring = MCATGETS(Set_AgentLabel, 188, "Map"); XtVaSetValues(map, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 195, "Map Geometry"); + mtfstring = MCATGETS(Set_AgentLabel, 195, "Map Geometry"); XtVaSetValues(map_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 270, "..."); + mtfstring = MCATGETS(Set_AgentLabel, 270, "..."); XtVaSetValues(get_map_geo, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 196, "Auto Update"); + mtfstring = MCATGETS(Set_AgentLabel, 196, "Auto Update"); XtVaSetValues(update_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); + mtfstring = MCATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues(f_update_toggle, XmNlabelString, (XmString)mtfstring, NULL); height = f_map_geo.Height(); @@ -451,7 +451,7 @@ PrefAgent::create_ui() // Create history preferences DECLM (WXmPushButton, history, options_menu, "history"); - mtfstring = CATGETS(Set_AgentLabel, 260, "History"); + mtfstring = MCATGETS(Set_AgentLabel, 260, "History"); XtVaSetValues(history, XmNlabelString, (XmString)mtfstring, NULL); DECL (WXmForm, hist_form, container, "history_prefs"); @@ -466,9 +466,9 @@ PrefAgent::create_ui() DECLM (WXmArrowButton, sh_up, sh_form, "sh_up"); DECLM (WXmArrowButton, sh_down, sh_form, "sh_down"); - mtfstring = CATGETS(Set_AgentLabel, 197, "Section History Size"); + mtfstring = MCATGETS(Set_AgentLabel, 197, "Section History Size"); XtVaSetValues(nh_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 198, "Search History Size"); + mtfstring = MCATGETS(Set_AgentLabel, 198, "Search History Size"); XtVaSetValues(sh_label, XmNlabelString, (XmString)mtfstring, NULL); height = f_nh_field.Height(); @@ -511,7 +511,7 @@ PrefAgent::create_ui() DECLM (WXmPushButton, search, options_menu, "search"); - mtfstring = CATGETS(Set_AgentLabel, 189, "Searching"); + mtfstring = MCATGETS(Set_AgentLabel, 189, "Searching"); XtVaSetValues(search, XmNlabelString, (XmString)mtfstring, NULL); DECL (WXmForm, search_form, container, "search_prefs"); @@ -523,11 +523,11 @@ PrefAgent::create_ui() DECLM (WXmLabel, adisplay_label, search_form, "adisplay_label"); ASSNM (WXmToggleButton, f_adisplay_toggle, search_form, "adisplay_toggle"); - mtfstring = CATGETS(Set_AgentLabel, 199, "Maximum Search Hits"); + mtfstring = MCATGETS(Set_AgentLabel, 199, "Maximum Search Hits"); XtVaSetValues(max_hits_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 200, "Auto Display First Hit"); + mtfstring = MCATGETS(Set_AgentLabel, 200, "Auto Display First Hit"); XtVaSetValues(adisplay_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); + mtfstring = MCATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues(f_adisplay_toggle, XmNlabelString, (XmString)mtfstring, NULL); height = f_max_hits_field.Height(); @@ -963,7 +963,7 @@ void PrefAgent::set_update (bool set) { XmStringLocalized mtfstring = - CATGETS(Set_AgentLabel, set? 203 : 204, set ? "On" : "Off"); + MCATGETS(Set_AgentLabel, set? 203 : 204, set ? "On" : "Off"); XtVaSetValues(f_update_toggle, XmNlabelString, (XmString)mtfstring, NULL); @@ -1022,7 +1022,7 @@ void PrefAgent::set_auto_display (bool set) { XmStringLocalized mtfstring = - CATGETS(Set_AgentLabel, set? 203 : 204, set ? "On" : "Off"); + MCATGETS(Set_AgentLabel, set? 203 : 204, set ? "On" : "Off"); XtVaSetValues(f_adisplay_toggle, XmNlabelString, (XmString)mtfstring, NULL); @@ -1072,11 +1072,11 @@ PrefAgent::get_geometry (WCallback *wcb) WArgList (XmNdialogType, XmDIALOG_INFORMATION, NULL)); WXmDialogShell shell (info_dialog.Parent()); // set window title - String string = CATGETS(Set_PrefAgent, 2, "Dtinfo: Get Geometry"); + String string = MCATGETS(Set_PrefAgent, 2, "Dtinfo: Get Geometry"); XtVaSetValues((Widget)shell, XmNtitle, string, NULL); // window_system().register_full_modal_shell (&shell); info_dialog.MessageString ( - (char*)UAS_String(CATGETS(Set_Messages, 16, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 16, "File a Bug"))); XtUnmanageChild (info_dialog.OkPB()); XtUnmanageChild (info_dialog.HelpPB()); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C index 84282d483..a9c8ddfef 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C @@ -272,7 +272,7 @@ customizePrintSetupBox(AppPrintData *p) XmNmarginHeight, 2, NULL); - label = XmStringGenerate(CATGETS(Set_AgentLabel, 205, "Number of Sections"), + label = XmStringGenerate(MCATGETS(Set_AgentLabel, 205, "Number of Sections"), NULL, XmCHARSET_TEXT, NULL); XtVaCreateManagedWidget("how_many_title", @@ -289,7 +289,7 @@ customizePrintSetupBox(AppPrintData *p) how_many_frame, NULL); - label = XmStringGenerate(CATGETS(Set_AgentLabel, 206, "Selected:"), + label = XmStringGenerate(MCATGETS(Set_AgentLabel, 206, "Selected:"), NULL, XmCHARSET_TEXT, NULL); selected_label = XtVaCreateManagedWidget("selected_label", @@ -314,7 +314,7 @@ customizePrintSetupBox(AppPrintData *p) XmNtopOffset, 2, NULL); - label = XmStringGenerate(CATGETS(Set_AgentLabel, 207, "To Be Printed:"), + label = XmStringGenerate(MCATGETS(Set_AgentLabel, 207, "To Be Printed:"), NULL, XmCHARSET_TEXT, NULL); XtVaCreateManagedWidget("to_print_label", @@ -357,7 +357,7 @@ customizePrintSetupBox(AppPrintData *p) XmNrightOffset, 5, NULL); - label = XmStringGenerate(CATGETS(Set_AgentLabel, 209, "What to Print"), + label = XmStringGenerate(MCATGETS(Set_AgentLabel, 209, "What to Print"), NULL, XmCHARSET_TEXT, NULL); XtVaCreateManagedWidget("what_title", @@ -373,7 +373,7 @@ customizePrintSetupBox(AppPrintData *p) what_frame, NULL); - label = XmStringGenerate(CATGETS(Set_AgentLabel, 210, "Sections"), + label = XmStringGenerate(MCATGETS(Set_AgentLabel, 210, "Sections"), NULL, XmCHARSET_TEXT, NULL); f_print_nodes = print_nodes = XtVaCreateManagedWidget("print_nodes", @@ -393,7 +393,7 @@ customizePrintSetupBox(AppPrintData *p) XmStringFree(label); XtAddCallback(print_nodes, XmNvalueChangedCallback, ToggleWhatCB, p); - label = XmStringGenerate(CATGETS(Set_AgentLabel, 211, "Hierarchy"), + label = XmStringGenerate(MCATGETS(Set_AgentLabel, 211, "Hierarchy"), NULL, XmCHARSET_TEXT, NULL); f_print_hierarchy = XtVaCreateManagedWidget("print_hierarchy", @@ -445,7 +445,7 @@ PdmNotifyCB(Widget pr_shell, XtPointer client_data, XtPointer call_data) (pr_cbs->reason == XmCR_PDM_START_VXAUTH) || (pr_cbs->reason == XmCR_PDM_START_PXAUTH)) { - msg = CATGETS(Set_PrintPanelAgent, 12, "Print Dialog Manager error - setup failed."); + msg = MCATGETS(Set_PrintPanelAgent, 12, "Print Dialog Manager error - setup failed."); message_mgr().error_dialog(msg); } @@ -548,7 +548,7 @@ PrintSetupCB(Widget print_dialog, XtPointer client_data, XtPointer call_data) if (XmPrintPopupPDM(p->f_print_shell, print_dialog) != XmPDM_NOTIFY_SUCCESS) { /* post a message error dialog */ - msg = CATGETS(Set_PrintPanelAgent, 6, "Unable to display the Print Dialog Manager"); + msg = MCATGETS(Set_PrintPanelAgent, 6, "Unable to display the Print Dialog Manager"); message_mgr().error_dialog(msg); RCS_DEBUG("XmPrintPopupPDM failed\n"); } @@ -642,7 +642,7 @@ CreatePrintSetup(Widget parent, AppPrintData* p) // additional dialog resources XmString title = XmStringCreateLocalized( - CATGETS(Set_PrintPanelAgent, 1, "Dtinfo: Print")); + MCATGETS(Set_PrintPanelAgent, 1, "Dtinfo: Print")); XtSetArg(args[n], XmNdialogTitle, title); n++; XtSetArg(args[n], (char*)DtNworkAreaLocation, DtWORK_AREA_BOTTOM); n++; @@ -782,14 +782,14 @@ FinishPrintToFile(Display *display, if (status != XPGetDocFinished) { - msg = CATGETS(Set_PrintPanelAgent, 8, "Error printing to file"); + msg = MCATGETS(Set_PrintPanelAgent, 8, "Error printing to file"); message_mgr().error_dialog(msg); RCS_DEBUG("Something went wrong with XmPrintToFile...\n"); } else { - msg = CATGETS(Set_PrintPanelAgent, 9, "Print to file completed."); + msg = MCATGETS(Set_PrintPanelAgent, 9, "Print to file completed."); message_mgr().info_dialog(msg); RCS_DEBUG("XmPrintToFile completed OK\n"); @@ -886,7 +886,7 @@ DoPrint(Widget widget, AppPrintData * p) // Post an error dialog - msg = CATGETS(Set_PrintPanelAgent, + msg = MCATGETS(Set_PrintPanelAgent, 11, "Print Job Failed.\n\nThe X Print Server is Temporarily Out of Resources."); message_mgr().error_dialog(msg); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C index 82656aa05..bb05f5d47 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C @@ -203,9 +203,9 @@ SearchHistoryListView::child_create_ui_pre(WXmForm &form) int number_width = WXmString("0").Width(header_font); - WXmString matchString = CATGETS(Set_AgentLabel, 246, "Matches"); - WXmString scopeString = CATGETS(Set_AgentLabel, 243, "Scope"); - WXmString queryString = CATGETS(Set_AgentLabel, 230, "Query"); + WXmString matchString = MCATGETS(Set_AgentLabel, 246, "Matches"); + WXmString scopeString = MCATGETS(Set_AgentLabel, 243, "Scope"); + WXmString queryString = MCATGETS(Set_AgentLabel, 230, "Query"); int scope_offset = 8 * number_width; @@ -284,5 +284,5 @@ SearchHistoryListView::display() cerr << "done." << endl; #endif XtVaSetValues(*f_shell, XmNtitle, - CATGETS(Set_SearchHistoryList, 1, "Dtinfo: Search History"), NULL); + MCATGETS(Set_SearchHistoryList, 1, "Dtinfo: Search History"), NULL); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C index e3cf9ac4f..d7d9ae0d3 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C @@ -247,8 +247,8 @@ SearchResultsAgent::compose_header() WXmLabel* header = (WXmLabel*)XtNameToWidget((Widget)*f_list_form, "header"); - WXmString bookString = CATGETS(Set_AgentLabel, 184, "Book"); - WXmString sectString = CATGETS(Set_AgentLabel, 185, "Section"); + WXmString bookString = MCATGETS(Set_AgentLabel, 184, "Book"); + WXmString sectString = MCATGETS(Set_AgentLabel, 185, "Section"); WXmString bookPostfix( window_system().make_space( @@ -313,7 +313,7 @@ SearchResultsAgent::display (ResultID *results) // NOTE: Using bogus internal string below: if (f_scale == 0) message_mgr().warning_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 69, + (char*)UAS_String(MCATGETS(Set_Messages, 69, "Search results weighting are not available."))); /* -------- Display the number of hits. -------- */ @@ -452,7 +452,7 @@ SearchResultsAgent::create_window() XmStringLocalized mtfstring; String string; - string = CATGETS(Set_SearchResultsAgent, 1, "Dtinfo: Search Results"); + string = MCATGETS(Set_SearchResultsAgent, 1, "Dtinfo: Search Results"); XtVaSetValues((Widget)*f_shell, XmNtitle, string, NULL); help_agent().add_activate_help(f_help, (char*)"results_help"); @@ -477,15 +477,15 @@ SearchResultsAgent::create_window() f_scope_label = (WXmLabel*)(Widget) WXmLabel (*f_form, "scope_name", AM); WXmLabel query_label (*f_form, "query_label", AM); - mtfstring = CATGETS(Set_AgentLabel, 219, "Retrieved:"); + mtfstring = MCATGETS(Set_AgentLabel, 219, "Retrieved:"); XtVaSetValues(retrieved, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); + mtfstring = MCATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues((Widget)f_hits_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 220, "Scope:"); + mtfstring = MCATGETS(Set_AgentLabel, 220, "Scope:"); XtVaSetValues(scope, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 194, "File a Bug"); + mtfstring = MCATGETS(Set_AgentLabel, 194, "File a Bug"); XtVaSetValues((Widget)f_scope_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 221, "Query:"); + mtfstring = MCATGETS(Set_AgentLabel, 221, "Query:"); XtVaSetValues(query_label, XmNlabelString, (XmString)mtfstring, NULL); Widget textw = XmCreateScrolledText (*f_pane, (char*)"query_text", NULL, 0); @@ -600,7 +600,7 @@ SearchResultsAgent::view_activate (WCallback *) } else { message_mgr().warning_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 51, + (char*)UAS_String(MCATGETS(Set_Messages, 51, "The document or section requested is not available."))); } } @@ -683,6 +683,6 @@ SearchResultsAgent::modify_verify (WCallback *wcb) tvp->doit = False; message_mgr().warning_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 47, + (char*)UAS_String(MCATGETS(Set_Messages, 47, "This is a display-only field."))); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C index 2ebeaf5b0..56152ef47 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C @@ -421,7 +421,7 @@ SearchScopeAgent::display() if (env().debug()) { message_mgr().warning_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 31, + (char*)UAS_String(MCATGETS(Set_Messages, 31, "Ignoring invalid scopes in your profile."))); } search_scope_mgr().show_warning(False); @@ -467,7 +467,7 @@ SearchScopeAgent::create_ui() f_shell = WTopLevelShell (window_system().toplevel(),WPopup,"scope_editor"); window_system().register_shell(&f_shell); - string = CATGETS(Set_SearchScopeAgent, 1, "Dtinfo: Search Scope Editor"); + string = MCATGETS(Set_SearchScopeAgent, 1, "Dtinfo: Search Scope Editor"); XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); DECL (WXmForm, form, f_shell, "form"); @@ -478,9 +478,9 @@ SearchScopeAgent::create_ui() f_scope_option = WXmOptionMenu (form, (char*)"scope_option", WAutoManage, args, n); ASSN (WXmPushButton, f_unnamed, scope_menu, "unnamed"); - mtfstring = CATGETS(Set_AgentLabel, 212, "Scope Name"); + mtfstring = MCATGETS(Set_AgentLabel, 212, "Scope Name"); XtVaSetValues(f_scope_option, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 213, "Unnamed"); + mtfstring = MCATGETS(Set_AgentLabel, 213, "Unnamed"); XtVaSetValues(f_unnamed, XmNlabelString, (XmString)mtfstring, NULL); ASSNM (WXmPushButton, f_new, form, "new"); @@ -496,23 +496,23 @@ SearchScopeAgent::create_ui() DECLM (WXmLabel, bookshelf, form, "books"); DECLM (WXmLabel, components, form, "components"); - mtfstring = CATGETS(Set_AgentLabel, 214, "Books"); + mtfstring = MCATGETS(Set_AgentLabel, 214, "Books"); XtVaSetValues(bookshelf, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 215, "Components"); + mtfstring = MCATGETS(Set_AgentLabel, 215, "Components"); XtVaSetValues(components, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 216, "New"); + mtfstring = MCATGETS(Set_AgentLabel, 216, "New"); XtVaSetValues(f_new, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 217, "Save"); + mtfstring = MCATGETS(Set_AgentLabel, 217, "Save"); XtVaSetValues(f_save, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 218, "Rename"); + mtfstring = MCATGETS(Set_AgentLabel, 218, "Rename"); XtVaSetValues(f_rename, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 183, "Delete"); + mtfstring = MCATGETS(Set_AgentLabel, 183, "Delete"); XtVaSetValues(f_delete, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 202, "Reset"); + mtfstring = MCATGETS(Set_AgentLabel, 202, "Reset"); XtVaSetValues(f_reset, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 12, "Close"); + mtfstring = MCATGETS(Set_AgentLabel, 12, "Close"); XtVaSetValues(close, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); // WARNING: the widget name, infobases, is used else where--do not alter. @@ -592,7 +592,7 @@ SearchScopeAgent::new_scope() if (f_reset.Sensitive()) { bool dosave = message_mgr().question_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 17, + (char*)UAS_String(MCATGETS(Set_Messages, 17, "Do you want to save changes to the current scope?"))); if (dosave) save_scope(); @@ -646,9 +646,9 @@ SearchScopeAgent::scope_name_prompt() *((char *) memcpy(default_name, scope_name, len) + len) = '\0'; message_mgr().set_max_length(default_name_len); scope_name = message_mgr().get_string( - (char*)UAS_String(CATGETS(Set_SearchScopeAgent, 2, + (char*)UAS_String(MCATGETS(Set_SearchScopeAgent, 2, "Enter the scope name to save as:")), - (char*)UAS_String(CATGETS(Set_SearchScopeAgent, 3, + (char*)UAS_String(MCATGETS(Set_SearchScopeAgent, 3, "Dtinfo: Save Scope")), default_name); @@ -665,14 +665,14 @@ SearchScopeAgent::scope_name_prompt() if (strpbrk (scope_name, ":,;") != NULL) { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 18, + (char*)UAS_String(MCATGETS(Set_Messages, 18, "You cannot use a colon, comma or semicolon in a search scope name."))); } // look for empty scope name else if (*scope_name == '\0') { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 19, + (char*)UAS_String(MCATGETS(Set_Messages, 19, "Please choose a non-empty scope name."))); } // look for name too long @@ -683,7 +683,7 @@ SearchScopeAgent::scope_name_prompt() // max char length has changed to 20, the message should // be changed to reflect that--or just removed. message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 20, + (char*)UAS_String(MCATGETS(Set_Messages, 20, "A search scope name may not exceed 30 characters."))); } // look for duplicate scope name @@ -698,7 +698,7 @@ SearchScopeAgent::scope_name_prompt() if (s != 0) { message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 21, + (char*)UAS_String(MCATGETS(Set_Messages, 21, "The name you entered is already in use."))); } else @@ -1044,7 +1044,7 @@ SearchScopeAgent::close() if (f_reset.Sensitive()) { bool dosave = message_mgr().question_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 17, + (char*)UAS_String(MCATGETS(Set_Messages, 17, "Do you want to save changes to the current scope?"))); if (dosave) save_scope(); @@ -1241,14 +1241,14 @@ SearchScopeAgent::generate_component_list() OutlineList *parts = new OutlineList (10); OutlineElement *oe; - ADD (components, CATGETS(Set_Messages, 22, "Everything"), parts, True); - ADD (parts, CATGETS(Set_Messages, 23, "Titles"), 0, False); - ADD (parts, CATGETS(Set_Messages, 24, "Body"), 0, False); - ADD (parts, CATGETS(Set_Messages, 25, "Examples"), 0, False); - ADD (parts, CATGETS(Set_Messages, 26, "Index"), 0, False); - ADD (parts, CATGETS(Set_Messages, 27, "Tables"), 0, False); + ADD (components, MCATGETS(Set_Messages, 22, "Everything"), parts, True); + ADD (parts, MCATGETS(Set_Messages, 23, "Titles"), 0, False); + ADD (parts, MCATGETS(Set_Messages, 24, "Body"), 0, False); + ADD (parts, MCATGETS(Set_Messages, 25, "Examples"), 0, False); + ADD (parts, MCATGETS(Set_Messages, 26, "Index"), 0, False); + ADD (parts, MCATGETS(Set_Messages, 27, "Tables"), 0, False); #ifndef DtinfoClient - ADD (parts, CATGETS(Set_Messages, 28, "Graphics"), 0, False); + ADD (parts, MCATGETS(Set_Messages, 28, "Graphics"), 0, False); #endif return (components); @@ -1493,7 +1493,7 @@ SearchScopeAgent::select_scope (WCallback *wcb) if (f_reset.Sensitive()) { bool dosave = message_mgr().question_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 17, + (char*)UAS_String(MCATGETS(Set_Messages, 17, "Do you want to save changes to the current scope?"))); if (dosave) save_scope(); @@ -1545,7 +1545,7 @@ SearchScopeAgent::delete_scope() Xassert (f_current_scope != NULL); bool doit = message_mgr().question_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 29, + (char*)UAS_String(MCATGETS(Set_Messages, 29, "Are you sure you want to delete the scope?"))); if (!doit) return; @@ -1623,7 +1623,7 @@ SearchScopeAgent::add_infolib(UAS_Pointer &lib) // find the scope scope = get_search_scope((char*)UAS_String( - CATGETS(Set_SearchScopeAgent, 4, "All Libraries"))); + MCATGETS(Set_SearchScopeAgent, 4, "All Libraries"))); // get a list of all bookcases UAS_PtrListbcases = bookcase_list(); @@ -1712,7 +1712,7 @@ SearchScopeAgent::remove_infolib(UAS_Pointer &lib) // find the scope scope = get_search_scope((char*)UAS_String( - CATGETS(Set_SearchScopeAgent, 4, "All Libraries"))); + MCATGETS(Set_SearchScopeAgent, 4, "All Libraries"))); // get a list of all bookcases UAS_PtrListbcases = bookcase_list(); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C index bf9f0d53f..80feda77f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C @@ -293,7 +293,7 @@ SearchScopeList::restore() // Create the scope for the Current Section // s = f_search_scope_agent->create_scope( - (char*)UAS_String(CATGETS(Set_Messages, 30, "Current Section")), + (char*)UAS_String(MCATGETS(Set_Messages, 30, "Current Section")), bcases, f_section, FALSE); s->set_read_only(); @@ -302,7 +302,7 @@ SearchScopeList::restore() // bcases = f_search_scope_agent->bookcase_list(); s = f_search_scope_agent->create_scope( - (char*)UAS_String(CATGETS(Set_SearchScopeAgent, 4, "All Libraries")), + (char*)UAS_String(MCATGETS(Set_SearchScopeAgent, 4, "All Libraries")), bcases, f_all, FALSE); s->set_read_only(); bcases.clear(); @@ -325,7 +325,7 @@ SearchScopeList::restore() // yet been realized. Just set the flag so dialog can be // shown later. // message_mgr().warning_dialog ( - // (char*)UAS_String(CATGETS(Set_Messages, 31, + // (char*)UAS_String(MCATGETS(Set_Messages, 31, // "Ignoring invalid scopes in your profile."))); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C index dcfb27fea..95d89c116 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C @@ -121,7 +121,7 @@ UrlAgent::document( char *locator, ((locator != NULL) && ( *locator == '\0' )) ) { // checked here to avoid less specific error return, later - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, ERR_NO_LOCATOR, "No locator value provided." )) ) ; return (sts = BAD_ARG_FORMAT); @@ -155,7 +155,7 @@ UrlAgent::document( char *locator, } else { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, ERR_LOCATOR_FORMAT, "Locator specification format error." )) ) ; sts = BAD_ARG_FORMAT ; @@ -176,7 +176,7 @@ UrlAgent::document( char *locator, } mcatch_any() { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, ERR_LOCATOR_RESOLUTION, "Locator resolution failed." )) ) ; @@ -251,7 +251,7 @@ UrlAgent::print_document(char *locator) // checked here to avoid less specific error return, later if (!(window_system().videoShell()->silent)) { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, ERR_NO_LOCATOR, "No locator value provided." )) ) ; } @@ -287,7 +287,7 @@ UrlAgent::print_document(char *locator) else { if ((!window_system().videoShell()->silent)) { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, ERR_LOCATOR_FORMAT, "Locator specification format error." )) ) ; } @@ -342,7 +342,7 @@ UrlAgent::print_document(char *locator) { if ((!window_system().videoShell()->silent)) { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_UrlAgent, ERR_LOCATOR_RESOLUTION, "Locator resolution failed." )) ) ; } @@ -374,7 +374,7 @@ UrlAgent::create_ui () { XmStringLocalized mtfstring; String string; - string = CATGETS(Set_UrlAgent, 1, "Dtinfo: Open Locator"); + string = MCATGETS(Set_UrlAgent, 1, "Dtinfo: Open Locator"); XtVaSetValues((Widget)fShell, XmNtitle, string, XmNmwmDecorations, decorations, @@ -390,17 +390,17 @@ UrlAgent::create_ui () { ASSNM (WXmTextField, fTextField, f_form, "text_field"); DECLM (WXmLabel, label, f_form, "the_label"); - mtfstring = CATGETS(Set_AgentLabel, 222, "Enter a Unique Locator:"); + mtfstring = MCATGETS(Set_AgentLabel, 222, "Enter a Unique Locator:"); XtVaSetValues(label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 161, "OK"); + mtfstring = MCATGETS(Set_AgentLabel, 161, "OK"); XtVaSetValues(fOk, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 201, "Apply"); + mtfstring = MCATGETS(Set_AgentLabel, 201, "Apply"); XtVaSetValues(fApply, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 223, "Clear"); + mtfstring = MCATGETS(Set_AgentLabel, 223, "Clear"); XtVaSetValues(fClear, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 12, "Close"); + mtfstring = MCATGETS(Set_AgentLabel, 12, "Close"); XtVaSetValues(close, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); // @@ -477,13 +477,13 @@ UrlAgent::displayDocument () { // d->retrieve (); // } else { // message_mgr().error_dialog ((char*) -// UAS_String(CATGETS(Set_Messages, 70, +// UAS_String(MCATGETS(Set_Messages, 70, // "Invalid access method in url."))); // } // } // mcatch_any() { // message_mgr().error_dialog ((char*) -// UAS_String(CATGETS(Set_Messages, 71, +// UAS_String(MCATGETS(Set_Messages, 71, // "Document creation failed."))); // } // end_try; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh index b506fd921..908d27ef7 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh @@ -63,6 +63,6 @@ inline CatMgr& msg_catalog_mgr() return CatMgr::msg_catalog_mgr(); }; -#define CATGETS msg_catalog_mgr().catgets +#define MCATGETS msg_catalog_mgr().catgets #endif diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C index d25d4116a..e2f9e9aac 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C @@ -204,7 +204,7 @@ EnvMgr::init(int argc_i, char** argv_i) { // invalid infolib--display error message message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_AddLibraryAgent, 7, + (char*)UAS_String(MCATGETS(Set_AddLibraryAgent, 7, "No infolibs found or specified."))); return -1; } @@ -349,7 +349,7 @@ EnvMgr::parse_cmdline( int argc_i, { // invalid infolib--display error message, but not fatal message_mgr().error_dialog ( - (char*)UAS_String(CATGETS(Set_AddLibraryAgent, 5, + (char*)UAS_String(MCATGETS(Set_AddLibraryAgent, 5, "Infolib specification format error."))); } } @@ -418,7 +418,7 @@ EnvMgr::parse_cmdline( int argc_i, } else { - cerr << CATGETS(Set_EnvMgr, 2, "Invalid argument") << endl; + cerr << MCATGETS(Set_EnvMgr, 2, "Invalid argument") << endl; return -1; } } @@ -428,7 +428,7 @@ EnvMgr::parse_cmdline( int argc_i, // make sure that if print option was specified that some sections // to print were also specified. if ( (window_system().videoShell()->print_only) && (f_sectionsArg == (UAS_String)NULL)) { - cerr << CATGETS(Set_EnvMgr, 3, "ERROR: The -sect option must be specified with the -print option.") << endl; + cerr << MCATGETS(Set_EnvMgr, 3, "ERROR: The -sect option must be specified with the -print option.") << endl; cerr << endl; usage(); exit(1); @@ -440,7 +440,7 @@ EnvMgr::parse_cmdline( int argc_i, void EnvMgr::usage() { - cerr << CATGETS(Set_EnvMgr, 4, "Usage: dtinfo") << endl; + cerr << MCATGETS(Set_EnvMgr, 4, "Usage: dtinfo") << endl; cerr << " [-help]" << endl; cerr << " [-l infolib1] [-l infolib2] [...]" << endl; cerr << " [-sect section[-section][,section[-section]]]" << endl; @@ -452,7 +452,7 @@ EnvMgr::usage() cerr << " [-paperSize]" << endl; cerr << " [-printer x_print_server]]]" << endl; cerr << endl; - cerr << CATGETS(Set_EnvMgr, 5, + cerr << MCATGETS(Set_EnvMgr, 5, "This application understands all standard X Toolkit command-line options.") << endl; } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C index fd5cc77ff..6d4040ebd 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C @@ -194,7 +194,7 @@ MarkMgr::open_base (const char *filename) if (base == NULL) { message_mgr().error_dialog ((char*)UAS_String( - CATGETS(Set_Messages, 32, "Your mark base cannot be opened."))); + MCATGETS(Set_Messages, 32, "Your mark base cannot be opened."))); return; } @@ -219,14 +219,14 @@ MarkMgr::create_mark (UAS_Pointer &doc_ptr, const Anchor &anchor, if (f_num_bases == 0) { message_mgr().error_dialog ((char*)UAS_String( - CATGETS(Set_Messages, 33, "Dtinfo mark base was not found.\n" + MCATGETS(Set_Messages, 33, "Dtinfo mark base was not found.\n" "Dtinfo cannot create a bookmark."))); return (NULL); } if (!f_can_create) { message_mgr().error_dialog ((char*)UAS_String( - CATGETS(Set_Messages, 34, "This mark base provides read-only permissions."))); + MCATGETS(Set_Messages, 34, "This mark base provides read-only permissions."))); return (NULL); } @@ -264,7 +264,7 @@ MarkMgr::create_mark (UAS_Pointer &doc_ptr, const Anchor &anchor, assert( n >= 0 ); } else { - trimmed_name = strdup(CATGETS(Set_AgentLabel, 213, "Unnamed")); + trimmed_name = strdup(MCATGETS(Set_AgentLabel, 213, "Unnamed")); } #else char *new_name = strdup (name); @@ -310,14 +310,14 @@ MarkMgr::move_mark (UAS_Pointer &doc_ptr, const Anchor &anchor, if (f_num_bases == 0) { message_mgr().error_dialog ((char*)UAS_String( - CATGETS(Set_Messages, 33, "Dtinfo mark base was not found.\n" + MCATGETS(Set_Messages, 33, "Dtinfo mark base was not found.\n" "Dtinfo cannot create a bookmark."))); return (NULL); } if (!f_can_create) { message_mgr().error_dialog ((char*)UAS_String( - CATGETS(Set_Messages, 34, "This mark base provides read-only permissions."))); + MCATGETS(Set_Messages, 34, "This mark base provides read-only permissions."))); return (NULL); } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C index 140bb1bdd..6c754357d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C @@ -86,7 +86,7 @@ DisplayDocumentError::receive (UAS_ErrorMsg &message, void *client_data) const char *text = message.fErrorMsg; if (text == NULL) - text = (char*)UAS_String(CATGETS(Set_Messages, 35, "File a Bug")); + text = (char*)UAS_String(MCATGETS(Set_Messages, 35, "File a Bug")); message_mgr().error_dialog ((char *) text); } @@ -111,7 +111,7 @@ ReportSearchMsg::receive (UAS_SearchMsg &message, void *client_data) } else { message_mgr().error_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 36, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 36, "File a Bug"))); } } @@ -294,18 +294,18 @@ MessageMgr::quit_dialog (char *message_text, Widget parent) // Set labels on buttons XmStringLocalized mtfstring; - mtfstring = CATGETS(Set_AgentLabel, 244, "Yes"); + mtfstring = MCATGETS(Set_AgentLabel, 244, "Yes"); XtVaSetValues(XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 245, "No"); + mtfstring = MCATGETS(Set_AgentLabel, 245, "No"); XtVaSetValues(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON), XmNlabelString, (XmString)mtfstring, NULL); // Set the window title Widget shell = XtParent(dialog); - String string = CATGETS(Set_MessageAgent, 5, "Dtinfo: Confirm Quit"); + String string = MCATGETS(Set_MessageAgent, 5, "Dtinfo: Confirm Quit"); XtVaSetValues(shell, XmNminWidth, 200, XmNtitle, (XmString)string, @@ -347,7 +347,7 @@ MessageMgr::error_dialog (char *message_text, Widget parent) // Set the window title Widget shell = XtParent(dialog); - String string = CATGETS(Set_MessageAgent, 1, "Dtinfo: Error"); + String string = MCATGETS(Set_MessageAgent, 1, "Dtinfo: Error"); XtVaSetValues(shell, XmNtitle, string, NULL); show_it(dialog); @@ -382,7 +382,7 @@ MessageMgr::warning_dialog (char *message_text, Widget parent) // Set the window title Widget shell = XtParent(dialog); - String string = CATGETS(Set_MessageAgent, 2, "Dtinfo: Warning"); + String string = MCATGETS(Set_MessageAgent, 2, "Dtinfo: Warning"); XtVaSetValues(shell, XmNtitle, string, NULL); show_it(dialog); @@ -413,7 +413,7 @@ MessageMgr::info_dialog (char *message_text, Widget parent) // Set the window title Widget shell = XtParent(dialog); - String string = CATGETS(Set_MessageAgent, 3, "Dtinfo: Information"); + String string = MCATGETS(Set_MessageAgent, 3, "Dtinfo: Information"); XtVaSetValues(shell, XmNtitle, string, NULL); show_it(dialog); @@ -482,11 +482,11 @@ MessageMgr::question_dialog (char *message_text, Widget parent) // Set labels on buttons XmStringLocalized mtfstring; - mtfstring = CATGETS(Set_AgentLabel, 244, "Yes"); + mtfstring = MCATGETS(Set_AgentLabel, 244, "Yes"); XtVaSetValues(XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON), XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 245, "No"); + mtfstring = MCATGETS(Set_AgentLabel, 245, "No"); XtVaSetValues(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON), XmNlabelString, (XmString)mtfstring, NULL); @@ -496,7 +496,7 @@ MessageMgr::question_dialog (char *message_text, Widget parent) // Set the window title Widget shell = XtParent(dialog); - String string = CATGETS(Set_MessageAgent, 3, "Dtinfo: Information"); + String string = MCATGETS(Set_MessageAgent, 3, "Dtinfo: Information"); XtVaSetValues(shell, XmNtitle, string, NULL); show_it(dialog); @@ -574,7 +574,7 @@ void MessageMgr::demo_failure(demoException &, Widget parent) { error_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 38, "File a Bug")), + (char*)UAS_String(MCATGETS(Set_Messages, 38, "File a Bug")), parent); ::exit(0); } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C index 03bd8526e..857fb743b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C @@ -348,7 +348,7 @@ NodeMgr::load(UAS_Pointer &node_ptr) mcatch_noarg (StyleSheetSyntaxError&) { message_mgr().error_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 39, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 39, "File a Bug"))); } end_try ; #endif diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C index 4bc633e17..7c774363a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C @@ -212,7 +212,7 @@ PrintMgr::load(UAS_Pointer &node_ptr) mcatch_noarg (StyleSheetSyntaxError&) { message_mgr().error_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 39, + (char*)UAS_String(MCATGETS(Set_Messages, 39, "There is an error in the Style Sheet for this Section.\nDefault features have been applied.") )); } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C index 45cc1888b..0df2c782c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C @@ -311,11 +311,11 @@ SearchMgr::display_message (SearchMessageType msg, int) switch( msg ){ case NO_HITS: message_mgr().info_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 40, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 40, "File a Bug"))); break; case BAD_QUERY: message_mgr().warning_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 41, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 41, "File a Bug"))); break; } } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C b/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C index c183673c1..f0b6507f5 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C @@ -454,7 +454,7 @@ olias_send_event (Widget, OliasEvent *event) else { message_mgr().info_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 46, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 46, "File a Bug"))); return (OLIAS_SUCCESS); // return (OLIAS_LOCATOR_NOT_FOUND); until help lib fixed } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C index 3ce3ea1a5..54a1bfbf9 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C @@ -140,7 +140,7 @@ LogToolTalkMessage ( if (! tt_is_err(status)) return XtsNewString("");; - errfmt = CATGETS(Set_TtIpcMgr, msg_num, dflt_txt); + errfmt = MCATGETS(Set_TtIpcMgr, msg_num, dflt_txt); statmsg = tt_status_message(status); errmsglen = strlen(errfmt) + strlen(statmsg) + 2; errmsg = XtMalloc(errmsglen); @@ -280,7 +280,7 @@ TtIpcMgr::ipc_init_wp0( XtPointer /* theIpcObj */ ) { DtMsgLogMessage("dtinfo", DtMsgLogError, "%s: %s", "tt_ptype_declare", - (char *) CATGETS( + (char *) MCATGETS( Set_TtIpcMgr, 9, "The process type 'DtInfoPrint' is not the\nname of an installed process type.")); } @@ -364,7 +364,7 @@ TtIpcMgr::do_infolib( char *lib_path ) // if no file argument specified, get the default if( !(lib_path = env().infolibDefault()) ) { - message_mgr().error_dialog( (char*)UAS_String(CATGETS( + message_mgr().error_dialog( (char*)UAS_String(MCATGETS( Set_AddLibraryAgent, ERR_INFOLIB_SPEC_FORMAT, "Infolib specification format error." )) ) ; return (sts = BAD_ARG_FORMAT); diff --git a/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C b/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C index 92fc8cff4..a1b7715a4 100644 --- a/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C @@ -576,7 +576,7 @@ WindowSystem::init() if (f_display == (Display*)NULL) { fprintf(stderr, "%s", - CATGETS(Set_WindowSystem, 3, "Unable to open display.\n")); + MCATGETS(Set_WindowSystem, 3, "Unable to open display.\n")); exit(1); } @@ -1028,14 +1028,14 @@ WindowSystem::core_dump_handler (int signal_number) { WXmMessageDialog byebye (window_system().toplevel(), (char*)"core_dump"); XtVaSetValues((Widget)byebye, XmNmessageString, - (XmString)XmStringLocalized(CATGETS(Set_WindowSystem, 2, + (XmString)XmStringLocalized(MCATGETS(Set_WindowSystem, 2, "Bombing...")), NULL); WShell shell (XtParent ((Widget) byebye)); window_system().register_shell (&shell); window_system().set_cursor (window_system().f_bomb_cursor); XtVaSetValues((Widget)shell, XmNtitle, - CATGETS(Set_WindowSystem, 1, "Dtinfo: Fatal Error"), NULL); + MCATGETS(Set_WindowSystem, 1, "Dtinfo: Fatal Error"), NULL); byebye.OkPB().Unmanage(); byebye.CancelPB().Unmanage(); @@ -1597,7 +1597,7 @@ WindowSystem::interrupt_handler (int /* signal_number */) if (!(window_system().videoShell()->silent)) { message_mgr().quit_dialog ( - (char*)UAS_String(CATGETS(Set_Messages, 6, "Quit Dtinfo?"))); + (char*)UAS_String(MCATGETS(Set_Messages, 6, "Quit Dtinfo?"))); } else { exit(1); diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C index c19f9d5f5..1686f6825 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C @@ -278,7 +278,7 @@ QueryEditor::create_ui() f_shell = WTopLevelShell(window_system().toplevel(), WPopup, "query_editor"); window_system().register_shell (&f_shell); - string = CATGETS(Set_QueryEditor, 1, "Dtinfo: Query Editor"); + string = MCATGETS(Set_QueryEditor, 1, "Dtinfo: Query Editor"); XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); // Main form and menu bar. @@ -291,7 +291,7 @@ QueryEditor::create_ui() XtSetArg(args[n], XmNsubMenuId, (Widget) scope_menu); n++; f_scope_option = WXmOptionMenu (form, (char*)"scope_option", AM, args, n); - mtfstring = CATGETS(Set_AgentLabel, 212, "Scope Name"); + mtfstring = MCATGETS(Set_AgentLabel, 212, "Scope Name"); XtVaSetValues(f_scope_option, XmNlabelString, (XmString)mtfstring, NULL); // Menu definitions. how about using AddPushButton (name, obj, fun)?? @@ -308,23 +308,23 @@ QueryEditor::create_ui() f_undo_btn = WXmPushButton (edit_menu, "undo", AM); f_redo_btn = WXmPushButton (edit_menu, "redo", AM); - mtfstring = CATGETS(Set_AgentLabel, 16, "Edit"); - mnemonic = *CATGETS(Set_AgentLabel, 17, "E"); + mtfstring = MCATGETS(Set_AgentLabel, 16, "Edit"); + mnemonic = *MCATGETS(Set_AgentLabel, 17, "E"); XtVaSetValues(edit_cascade, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); - mtfstring = CATGETS(Set_AgentLabel, 224, "Cut"); + mtfstring = MCATGETS(Set_AgentLabel, 224, "Cut"); XtVaSetValues(f_cut_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 18, "Copy"); + mtfstring = MCATGETS(Set_AgentLabel, 18, "Copy"); XtVaSetValues(f_copy_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 225, "Paste"); + mtfstring = MCATGETS(Set_AgentLabel, 225, "Paste"); XtVaSetValues(f_paste_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 226, "Group"); + mtfstring = MCATGETS(Set_AgentLabel, 226, "Group"); XtVaSetValues(f_group_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 227, "Ungroup"); + mtfstring = MCATGETS(Set_AgentLabel, 227, "Ungroup"); XtVaSetValues(f_ungroup_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 228, "Undo"); + mtfstring = MCATGETS(Set_AgentLabel, 228, "Undo"); XtVaSetValues(f_undo_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 229, "Redo"); + mtfstring = MCATGETS(Set_AgentLabel, 229, "Redo"); XtVaSetValues(f_redo_btn, XmNlabelString, (XmString)mtfstring, NULL); // Button area at the bottom @@ -339,17 +339,17 @@ QueryEditor::create_ui() WXmPushButton help (form, "help", AM); WXmSeparator separator (form, "separator", AM); - mtfstring = CATGETS(Set_AgentLabel, 92, "History"); + mtfstring = MCATGETS(Set_AgentLabel, 92, "History"); XtVaSetValues(history, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 102, "Search"); + mtfstring = MCATGETS(Set_AgentLabel, 102, "Search"); XtVaSetValues(f_search_btn, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 231, "Clear All"); + mtfstring = MCATGETS(Set_AgentLabel, 231, "Clear All"); XtVaSetValues(clear, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 46, "Scope Editor"); + mtfstring = MCATGETS(Set_AgentLabel, 46, "Scope Editor"); XtVaSetValues(scope, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 12, "Close"); + mtfstring = MCATGETS(Set_AgentLabel, 12, "Close"); XtVaSetValues(cancel, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); + mtfstring = MCATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); help_agent().add_activate_help (help, (char*)"query_editor_help"); @@ -359,7 +359,7 @@ QueryEditor::create_ui() WXmForm qform (pane, "qform" ); WXmLabel qlabel (qform, "qlabel", AM); - mtfstring = CATGETS(Set_AgentLabel, 230, "Query"); + mtfstring = MCATGETS(Set_AgentLabel, 230, "Query"); XtVaSetValues(qlabel, XmNlabelString, (XmString)mtfstring, NULL); f_query_text = WXmScrolledText (qform, (char*)"qtext", AM); @@ -545,7 +545,7 @@ QueryEditor::modify_verify (WCallback *wcb) // tvp->doit = False; // message_mgr().warning_dialog ( -// (char*)UAS_String(CATGETS(Set_Messages, 47, +// (char*)UAS_String(MCATGETS(Set_Messages, 47, // "This is a display-only field."))); } diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C index 97d6aa8ab..d8b8652b6 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C @@ -179,9 +179,9 @@ QueryTermView::create_ui() DECLM (WXmPushButtonGadget, contains, prefix_menu, "contains" ); DECLM (WXmPushButtonGadget, not_contains, prefix_menu, "not_contains" ); - mtfstring = CATGETS(Set_AgentLabel, 232, "Contains"); + mtfstring = MCATGETS(Set_AgentLabel, 232, "Contains"); XtVaSetValues(contains, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 233, "Doesn\'t Contain"); + mtfstring = MCATGETS(Set_AgentLabel, 233, "Doesn\'t Contain"); XtVaSetValues(not_contains, XmNlabelString, (XmString)mtfstring, NULL); unsigned int caps = f_query_term->avail_caps(); @@ -191,9 +191,9 @@ QueryTermView::create_ui() ASSNM (WXmPushButtonGadget, starts, prefix_menu, "starts_with" ); ASSNM (WXmPushButtonGadget, not_starts, prefix_menu, "not_starts_with" ); - mtfstring = CATGETS(Set_AgentLabel, 234, "Starts With"); + mtfstring = MCATGETS(Set_AgentLabel, 234, "Starts With"); XtVaSetValues(starts, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 235, "Doesn\'t Start With"); + mtfstring = MCATGETS(Set_AgentLabel, 235, "Doesn\'t Start With"); XtVaSetValues(not_starts, XmNlabelString, (XmString)mtfstring, NULL); } DECLC (WXmPulldownMenu, connect_menu, f_form, "connect_menu" ); @@ -208,7 +208,7 @@ QueryTermView::create_ui() if (caps & (0x01 << UAS_OQLParser::OQL_XOR)) { ASSNM (WXmPushButtonGadget, xorgad, connect_menu, "xor" ); - mtfstring = CATGETS(Set_AgentLabel, 237, "Xor"); + mtfstring = MCATGETS(Set_AgentLabel, 237, "Xor"); XtVaSetValues(xorgad, XmNlabelString, (XmString)mtfstring, NULL); } DECLM (WXmPushButtonGadget, andgad, connect_menu, "and" ); @@ -217,13 +217,13 @@ QueryTermView::create_ui() if (caps & (0x01 << UAS_OQLParser::OQL_NEAR)) { ASSNM (WXmPushButtonGadget, near, connect_menu, "near" ); - mtfstring = CATGETS(Set_AgentLabel, 239, "Near"); + mtfstring = MCATGETS(Set_AgentLabel, 239, "Near"); XtVaSetValues(near, XmNlabelString, (XmString)mtfstring, NULL); } if (caps & (0x01 << UAS_OQLParser::OQL_BEFORE)) { ASSNM (WXmPushButtonGadget, before, connect_menu, "before" ); - mtfstring = CATGETS(Set_AgentLabel, 240, "Before"); + mtfstring = MCATGETS(Set_AgentLabel, 240, "Before"); XtVaSetValues(before, XmNlabelString, (XmString)mtfstring, NULL); } ASSNM (WXmArrowButton, f_pw_button,f_form, "pw_button" ); @@ -231,9 +231,9 @@ QueryTermView::create_ui() WXmTextField (f_form, "term_text", WAutoManage); // ASSNM (WXmTextField, f_term_field, f_form, "term_text"); - mtfstring = CATGETS(Set_AgentLabel, 236, "Or"); + mtfstring = MCATGETS(Set_AgentLabel, 236, "Or"); XtVaSetValues(orgad, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 238, "And"); + mtfstring = MCATGETS(Set_AgentLabel, 238, "And"); XtVaSetValues(andgad, XmNlabelString, (XmString)mtfstring, NULL); // Callbacks! @@ -597,11 +597,11 @@ QueryTermView::create_fields() ASSNM (WXmTextField, f_weight_field, f_pws_form, "weight_field" ); ASSN (WXmTextField, f_scope_field, f_pws_form, "scope_field" ); - mtfstring = CATGETS(Set_AgentLabel, 241, "Weight"); + mtfstring = MCATGETS(Set_AgentLabel, 241, "Weight"); XtVaSetValues(weight_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 242, "Proximity"); + mtfstring = MCATGETS(Set_AgentLabel, 242, "Proximity"); XtVaSetValues(f_proximity_label, XmNlabelString, (XmString)mtfstring, NULL); - mtfstring = CATGETS(Set_AgentLabel, 243, "Scope"); + mtfstring = MCATGETS(Set_AgentLabel, 243, "Scope"); XtVaSetValues(scope_label, XmNlabelString, (XmString)mtfstring, NULL); SET_CALLBACK (f_proximity_field,ValueChanged,proximity_changed); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C index a13716bbe..40d8a7b93 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C @@ -111,13 +111,13 @@ UAS_Factory::create (const UAS_String &locator) { locator.split (':', access, rest); if (access == "") { throw (UAS_Exception((char*)UAS_String( - CATGETS(Set_UAS_Base, 1, + MCATGETS(Set_UAS_Base, 1, "No access part provided in locator (URL).")))); } UAS_Factory *theFactory = UAS_Factory::lookup(access); if (theFactory == 0) { char buf[BUFSIZ]; - (void) snprintf (buf, sizeof(buf), CATGETS(Set_UAS_Base, 2, + (void) snprintf (buf, sizeof(buf), MCATGETS(Set_UAS_Base, 2, "Don't know how to create %s: objects"), (char*)access); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C index 505a8d471..1317f751a 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C @@ -145,7 +145,7 @@ UAS_OQLParser::parse(const char *oql) // clean up the stack seql = f_stack.pop(); throw(CASTUASEXCEPT UAS_Exception( - (char*)UAS_String(CATGETS(Set_Messages, 41, + (char*)UAS_String(MCATGETS(Set_Messages, 41, "Invalid characters in search string.")))); } else if (f_stack.entries() != 1){ // NOTE: bad query - error message to user required diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_ObjList.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_ObjList.C index 3de279cac..3912f923f 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_ObjList.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_ObjList.C @@ -77,7 +77,7 @@ T & UAS_ObjList::item (int i) const { if (i < 0 || i >= fNumItems) throw (UAS_Exception ( - (char*)UAS_String(CATGETS(Set_UAS_Base, 3, "File a Bug")))); + (char*)UAS_String(MCATGETS(Set_UAS_Base, 3, "File a Bug")))); return fItems[i]; } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C index 3b2a67534..e77ff34fc 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C @@ -78,7 +78,7 @@ T * UAS_PtrList::item (int i) const { if (i < 0 || i >= fNumItems) throw (UAS_Exception ( - (char*)UAS_String(CATGETS(Set_UAS_Base, 4, "File a Bug")))); + (char*)UAS_String(MCATGETS(Set_UAS_Base, 4, "File a Bug")))); return fItems[i]; } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C index 37ffa0e24..264460d84 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C @@ -125,9 +125,9 @@ DtSR_Parser::se_construct(OQL_Token token, #ifdef IGNORE_UNSUPPORTED return arg1; #else - UAS_String str = CATGETS(Set_DtSR_Parser, 1, + UAS_String str = MCATGETS(Set_DtSR_Parser, 1, "The ``%s'' Search feature is not supported."); - UAS_String opstr = CATGETS(Set_DtSR_Parser, 3, "weight"); + UAS_String opstr = MCATGETS(Set_DtSR_Parser, 3, "weight"); snprintf(msg, sizeof(msg), (char*)str, (char*)opstr); UAS_String uas_msg = msg; throw(UAS_Search_Feature_Unavailable(uas_msg)); @@ -166,9 +166,9 @@ DtSR_Parser::se_construct(OQL_Token token, } return newstr; #else - UAS_String str = CATGETS(Set_DtSR_Parser, 1, + UAS_String str = MCATGETS(Set_DtSR_Parser, 1, "The ``%s'' Search feature is not supported."); - UAS_String opstr = CATGETS(Set_DtSR_Parser, 2, "quoted phrase"); + UAS_String opstr = MCATGETS(Set_DtSR_Parser, 2, "quoted phrase"); snprintf(msg, sizeof(msg), (char*)str, (char*)opstr); UAS_String uas_msg = msg; @@ -187,9 +187,9 @@ DtSR_Parser::se_construct(OQL_Token token, newstr = newstr + arg1 + " & " + arg2 + " )"; return newstr; #else - UAS_String str = CATGETS(Set_DtSR_Parser, 1, + UAS_String str = MCATGETS(Set_DtSR_Parser, 1, "The ``%s'' Search feature is not supported."); - UAS_String opstr = CATGETS(Set_DtSR_Parser, 4, "proximity"); + UAS_String opstr = MCATGETS(Set_DtSR_Parser, 4, "proximity"); snprintf(msg, sizeof(msg), (char*)str, (char*)opstr); UAS_String uas_msg = msg; throw(UAS_Search_Feature_Unavailable(uas_msg)); @@ -228,9 +228,9 @@ DtSR_Parser::se_construct(OQL_Token token, newstr = newstr + arg1 + " & " + arg2 + " )"; return newstr; #else - UAS_String str = CATGETS(Set_DtSR_Parser, 1, + UAS_String str = MCATGETS(Set_DtSR_Parser, 1, "The ``%s'' Search feature is not supported."); - UAS_String opstr = CATGETS(Set_DtSR_Parser, 5, "xor"); + UAS_String opstr = MCATGETS(Set_DtSR_Parser, 5, "xor"); snprintf(msg, sizeof(msg), (char*)str, (char*)opstr); UAS_String uas_msg = msg; throw(UAS_Search_Feature_Unavailable(uas_msg)); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C index d911e8001..77d065e3a 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C @@ -616,7 +616,7 @@ DtSR_SearchEngine::search(UAS_String oql, UAS_SearchScope& scope, if (DtSr_res) DtSearchFreeResults(&DtSr_res); - UAS_String msg(CATGETS(Set_DtSR_SearchEngine, 1, + UAS_String msg(MCATGETS(Set_DtSR_SearchEngine, 1, "DtSearch does not support the query.")); DtSearchFreeMessages(); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C index 2ea6fbf41..92e83a2ea 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C @@ -281,7 +281,7 @@ DtSR_SearchResultsEntry::create_matches() { #ifdef JOE_HATES_THIS message_mgr().error_dialog( - (char*)UAS_String(CATGETS(Set_Messages, 39, "File a Bug"))); + (char*)UAS_String(MCATGETS(Set_Messages, 39, "File a Bug"))); #else throw(CASTEXCEPT Exception()); #endif diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C index 5f471f340..ed1ac4d96 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C @@ -75,7 +75,7 @@ MMDB::database() UAS_ErrorMsg msg; UAS_Buffer buf(256); const char *x = - (char*)UAS_String(CATGETS(Set_UAS_MMDB, 1, "The following bookcases are not valid:")); + (char*)UAS_String(MCATGETS(Set_UAS_MMDB, 1, "The following bookcases are not valid:")); buf.write (x, sizeof(char), strlen(x)); for (int i = 1; i <= bad_count; i++) { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C index cac20e111..6f6743304 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C @@ -70,7 +70,7 @@ MMDB_Factory::createMMDB (const UAS_String &infoLibPath) { if (!olias_db().validInfoLibPath(infoLibPath)) { UAS_ErrorMsg badPath; char buf[BUFSIZ]; - (void) snprintf (buf, sizeof(buf), CATGETS(Set_UAS_MMDB, 2, + (void) snprintf (buf, sizeof(buf), MCATGETS(Set_UAS_MMDB, 2, "Invalid Infolib path: %s"), (char *) infoLibPath); badPath.fErrorMsg = buf; @@ -83,7 +83,7 @@ MMDB_Factory::createMMDB (const UAS_String &infoLibPath) { } mcatch_any() { #if 0 char buf[BUFSIZ]; - (void) snprintf (buf, sizeof(buf), CATGETS(Set_UAS_MMDB, 3, + (void) snprintf (buf, sizeof(buf), MCATGETS(Set_UAS_MMDB, 3, "Ignoring invalid Infolib path: %s"), (char *) infoLibPath); UAS_ErrorMsg theError; @@ -351,7 +351,7 @@ MMDB_Factory::genInfolibName () { static int counter = 0; char buf[BUFSIZ]; (void) snprintf (buf, sizeof(buf), - CATGETS(Set_UAS_MMDB, 4, "DtMmdb Library %d"), ++counter); + MCATGETS(Set_UAS_MMDB, 4, "DtMmdb Library %d"), ++counter); return UAS_String (buf); } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C index b39ce147f..9ac7edbd2 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C @@ -62,7 +62,7 @@ MMDB_Library::title (UAS_TitleType) { UAS_String rval = il->get_info_lib_name(); if (rval == "") { - rval = CATGETS(Set_UAS_MMDB, 5, "File a Bug"); + rval = MCATGETS(Set_UAS_MMDB, 5, "File a Bug"); rval = rval + mmdb().infoLibPath(); } return rval; @@ -128,7 +128,7 @@ MMDB_Library::name () { { char scratch[128]; snprintf(scratch, sizeof(scratch), - CATGETS(Set_UAS_MMDB, 6, "File a Bug"), (char *)kids[i]->id()); + MCATGETS(Set_UAS_MMDB, 6, "File a Bug"), (char *)kids[i]->id()); f_name = UAS_String(scratch); } } From 7010b2c11b4d6faffbec4f0ec6e21b723af4079b Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Sat, 30 Jan 2021 20:05:13 -0700 Subject: [PATCH 04/90] Centralize catgets() calls through MsgCat CDE has relied upon catgets() implementations following a relaxed interpretation of the XPG internationalization standard that ignored -1, the standard error value returned by catopen, as the catalog argument. However, this same behavior causes segmentation faults with the musl C library. This patch: - Centralizes (with the exception of ToolTalk) all calls to catopen(), catgets(), and catclose() through MsgCat within the DtSvc library. - Prevents calls to catgets() and catclose() that rely upon undefined behavior. - Eliminates a number of bespoke catgets() wrappers, including multiple redundant caching implementations designed to work around a design peculiarity in HP/UX. - Eases building CDE without XPG internationalization support by providing the appropriate macros. --- cde/examples/template/template.c | 42 +- cde/lib/DtHelp/FormatMan.c | 1 - cde/lib/DtHelp/FormatUtil.c | 12 +- cde/lib/DtHelp/Helpos.c | 10 +- cde/lib/DtHelp/Layout.c | 4 - cde/lib/DtHelp/LayoutUtil.c | 8 - cde/lib/DtHelp/SetList.c | 4 - cde/lib/DtPrint/PrintMsgs.c | 95 +---- cde/lib/DtPrint/PrintMsgsP.h | 2 +- cde/lib/DtSearch/SearchP.h | 4 +- cde/lib/DtSearch/ausdopen.c | 4 +- cde/lib/DtSearch/boolpars.c | 36 +- cde/lib/DtSearch/boolsrch.c | 16 +- cde/lib/DtSearch/dbchange.c | 4 +- cde/lib/DtSearch/dberr.c | 20 +- cde/lib/DtSearch/dtoe.c | 18 +- cde/lib/DtSearch/dtoeinit.c | 10 +- cde/lib/DtSearch/dtsrapi.c | 26 +- cde/lib/DtSearch/dtsrdbrec.c | 114 +++--- cde/lib/DtSearch/dtsrjoint.c | 4 +- cde/lib/DtSearch/dtsrutil.c | 2 +- cde/lib/DtSearch/dtsrve.c | 44 +- cde/lib/DtSearch/globals.c | 2 +- cde/lib/DtSearch/hdecode.c | 8 +- cde/lib/DtSearch/hencode.c | 2 +- cde/lib/DtSearch/jpn.c | 14 +- cde/lib/DtSearch/lang.c | 30 +- cde/lib/DtSearch/mrclean.c | 4 +- cde/lib/DtSearch/msgutil.c | 6 +- cde/lib/DtSearch/ocf.c | 68 ++-- cde/lib/DtSearch/opendblk.c | 12 +- cde/lib/DtSearch/vestatis.c | 30 +- cde/lib/DtSvc/DtUtil2/DtGetMessage.c | 6 +- cde/lib/DtSvc/DtUtil2/DtNlUtils.h | 3 +- cde/lib/DtSvc/DtUtil2/GetMessage.c | 8 +- cde/lib/DtSvc/DtUtil2/MsgCat.c | 66 ++- cde/lib/DtSvc/DtUtil2/MsgCatP.h | 13 +- cde/lib/DtSvc/DtUtil2/Setlocale.h | 2 +- cde/lib/DtSvc/include/bms/sbstdinc.h | 2 +- cde/lib/DtTerm/Term/Term.c | 1 - cde/lib/DtTerm/TermPrim/TermPrim.c | 6 +- cde/lib/DtWidget/DtMsgs.c | 8 +- cde/lib/DtWidget/DtMsgsP.h | 2 +- cde/lib/pam/libpam/pam_framework_utils.c | 18 +- .../tt/bin/ttdbserverd/db_server_functions.C | 1 - cde/lib/tt/lib/util/tt_gettext.C | 9 +- cde/lib/tt/slib/mp_s_mp.C | 1 - cde/programs/dtaction/Main.c | 2 +- cde/programs/dtaction/demo/dtactiondemo.c | 2 +- cde/programs/dtappbuilder/src/ab/ab.h | 4 +- cde/programs/dtappbuilder/src/ab/ab_bil.c | 18 +- cde/programs/dtappbuilder/src/ab/ab_dnd.c | 6 +- cde/programs/dtappbuilder/src/ab/abobj_edit.c | 14 +- cde/programs/dtappbuilder/src/ab/abobj_menu.c | 42 +- cde/programs/dtappbuilder/src/ab/abobj_util.c | 20 +- .../dtappbuilder/src/ab/appfw_stubs.c | 4 +- .../dtappbuilder/src/ab/attch_ed_stubs.c | 16 +- cde/programs/dtappbuilder/src/ab/brws.c | 2 +- cde/programs/dtappbuilder/src/ab/brws_find.c | 6 +- cde/programs/dtappbuilder/src/ab/brws_stubs.c | 16 +- .../dtappbuilder/src/ab/cgen_env_stubs.c | 4 +- cde/programs/dtappbuilder/src/ab/cgen_utils.c | 2 +- cde/programs/dtappbuilder/src/ab/conn_obj.c | 90 ++--- cde/programs/dtappbuilder/src/ab/conn_stubs.c | 6 +- .../dtappbuilder/src/ab/dnd_ed_stubs.c | 6 +- .../dtappbuilder/src/ab/dtbuilder.c.src | 36 +- cde/programs/dtappbuilder/src/ab/dtbuilder.h | 2 +- .../dtappbuilder/src/ab/help_ed_stubs.c | 12 +- .../dtappbuilder/src/ab/message_ed_stubs.c | 38 +- cde/programs/dtappbuilder/src/ab/pal_button.c | 4 +- cde/programs/dtappbuilder/src/ab/pal_choice.c | 10 +- .../dtappbuilder/src/ab/pal_combobox.c | 6 +- cde/programs/dtappbuilder/src/ab/pal_create.c | 14 +- .../dtappbuilder/src/ab/pal_custdlg.c | 10 +- .../dtappbuilder/src/ab/pal_fchooser.c | 4 +- cde/programs/dtappbuilder/src/ab/pal_label.c | 2 +- cde/programs/dtappbuilder/src/ab/pal_list.c | 4 +- .../dtappbuilder/src/ab/pal_mainwin.c | 4 +- cde/programs/dtappbuilder/src/ab/pal_menu.c | 4 +- .../dtappbuilder/src/ab/pal_menubar.c | 6 +- cde/programs/dtappbuilder/src/ab/pal_scale.c | 4 +- cde/programs/dtappbuilder/src/ab/pal_sep.c | 2 +- .../dtappbuilder/src/ab/pal_spinbox.c | 2 +- cde/programs/dtappbuilder/src/ab/pal_textf.c | 2 +- cde/programs/dtappbuilder/src/ab/proj.c | 14 +- .../dtappbuilder/src/ab/projP_utils.c | 16 +- cde/programs/dtappbuilder/src/ab/proj_stubs.c | 10 +- cde/programs/dtappbuilder/src/ab/proj_utils.c | 82 ++-- cde/programs/dtappbuilder/src/ab/prop.c | 96 ++--- cde/programs/dtappbuilder/src/ab/prop_items.c | 2 +- .../dtappbuilder/src/abmf/ab_func_strings.c | 2 +- cde/programs/dtappbuilder/src/abmf/abmf.c | 76 ++-- cde/programs/dtappbuilder/src/abmf/abmfP.h | 2 +- .../dtappbuilder/src/abmf/generate_code.c | 42 +- .../dtappbuilder/src/abmf/instances.c | 4 +- cde/programs/dtappbuilder/src/abmf/msg_cvt.c | 2 +- .../dtappbuilder/src/abmf/proj_c_file.c | 4 +- .../dtappbuilder/src/abmf/proj_header_file.c | 2 +- .../dtappbuilder/src/abmf/stubs_c_file.c | 6 +- cde/programs/dtappbuilder/src/abmf/utils.c | 6 +- cde/programs/dtappbuilder/src/libABil/bilP.h | 2 +- .../dtappbuilder/src/libABil/bil_lexer.c | 4 +- .../dtappbuilder/src/libABil/bil_loadatt.c | 6 +- .../dtappbuilder/src/libABil/bil_loadfile.c | 2 +- .../dtappbuilder/src/libABil/bil_store.c | 8 +- .../dtappbuilder/src/libABil/bil_test.c | 2 +- cde/programs/dtappbuilder/src/libABil/load.c | 20 +- .../dtappbuilder/src/libABobjXm/objxmP.h | 2 +- .../dtappbuilder/src/libABobjXm/objxm_args.c | 6 +- .../src/libABobjXm/objxm_config.c | 4 +- .../dtappbuilder/src/libABobjXm/objxm_util.c | 12 +- .../dtappbuilder/src/libAButil/abio.c | 10 +- .../dtappbuilder/src/libAButil/istr.c | 68 ++-- .../dtappbuilder/src/libAButil/utilP.h | 2 +- .../dtappbuilder/src/libAButil/util_err.c | 50 +-- cde/programs/dtcm/dtcm/about.c | 38 +- cde/programs/dtcm/dtcm/alarm.c | 32 +- cde/programs/dtcm/dtcm/blist.c | 32 +- cde/programs/dtcm/dtcm/browser.c | 42 +- cde/programs/dtcm/dtcm/calendar.h | 2 +- cde/programs/dtcm/dtcm/calendarA.c | 234 +++++------ cde/programs/dtcm/dtcm/cm_admin.c | 16 +- cde/programs/dtcm/dtcm/cm_delete.c | 12 +- cde/programs/dtcm/dtcm/cm_insert.c | 42 +- cde/programs/dtcm/dtcm/cm_lookup.c | 10 +- cde/programs/dtcm/dtcm/cmtt.c | 4 +- cde/programs/dtcm/dtcm/dayglance.c | 6 +- cde/programs/dtcm/dtcm/dnd.c | 64 +-- cde/programs/dtcm/dtcm/dssw.c | 24 +- cde/programs/dtcm/dtcm/dtcm_editor.c | 38 +- cde/programs/dtcm/dtcm/editor.c | 144 +++---- cde/programs/dtcm/dtcm/find.c | 50 +-- cde/programs/dtcm/dtcm/goto.c | 20 +- cde/programs/dtcm/dtcm/group_editor.c | 122 +++--- cde/programs/dtcm/dtcm/help.c | 10 +- cde/programs/dtcm/dtcm/misc.c | 166 ++++---- cde/programs/dtcm/dtcm/print.c | 42 +- cde/programs/dtcm/dtcm/props.c | 50 +-- cde/programs/dtcm/dtcm/props_pu.c | 190 ++++----- cde/programs/dtcm/dtcm/reminders.c | 34 +- cde/programs/dtcm/dtcm/rfp.c | 60 +-- cde/programs/dtcm/dtcm/tempbr.c | 16 +- cde/programs/dtcm/dtcm/timezone.c | 24 +- cde/programs/dtcm/dtcm/todo.c | 158 ++++---- cde/programs/dtcm/dtcm/weekglance.c | 20 +- cde/programs/dtcm/dtcm/x_graphics.c | 44 +- cde/programs/dtcm/dtcm/yearglance.c | 2 +- cde/programs/dtcm/libDtCmP/cm_tty.c | 104 ++--- cde/programs/dtcm/libDtCmP/cm_tty.h | 2 +- cde/programs/dtcm/libDtCmP/props.c | 8 +- cde/programs/dtcreate/dtcreate.h | 4 +- cde/programs/dtcreate/main.c | 4 +- cde/programs/dtdspmsg/Imakefile | 4 +- cde/programs/dtdspmsg/dtdspmsg.c | 23 +- cde/programs/dtdspmsg/msgfac_msg.h | 2 - cde/programs/dtexec/Imakefile | 5 +- cde/programs/dtfile/HelpCB.c | 2 +- cde/programs/dtfile/Main.c | 5 +- cde/programs/dtfile/SharedMsgs.c | 4 +- cde/programs/dthello/Imakefile | 5 +- cde/programs/dthello/dthello.c | 27 +- cde/programs/dthelp/dthelpgen/helpgen.c | 6 +- cde/programs/dthelp/dthelpprint/HelpPrintI.h | 2 +- cde/programs/dthelp/dthelpprint/PrintUtil.c | 28 +- cde/programs/dtimsstart/main.c | 108 +++-- .../dtinfo/dtinfo/src/Managers/CatMgr.C | 10 +- .../dtinfo/dtinfo/src/Managers/CatMgr.hh | 2 +- cde/programs/dtlogin/Imakefile | 3 +- cde/programs/dtlogin/chooser.c | 4 - cde/programs/dtlogin/util.c | 9 +- cde/programs/dtlogin/vgutil.c | 53 +-- cde/programs/dtlogin/xdm_msg.h | 1 - cde/programs/dtmail/MotifApp/Application.C | 34 +- cde/programs/dtmail/MotifApp/AskFirstCmd.C | 6 +- cde/programs/dtmail/MotifApp/DialogManager.C | 8 +- cde/programs/dtmail/MotifApp/Help.C | 28 +- cde/programs/dtmail/MotifApp/QuitCmd.C | 6 +- cde/programs/dtmail/MotifApp/SelectFileCmd.C | 6 +- cde/programs/dtmail/MotifApp/WarnNoUndoCmd.C | 6 +- cde/programs/dtmail/dtmail/AttachArea.C | 40 +- cde/programs/dtmail/dtmail/AttachCmds.C | 42 +- cde/programs/dtmail/dtmail/Attachment.C | 28 +- cde/programs/dtmail/dtmail/ComposeCmds.C | 34 +- cde/programs/dtmail/dtmail/DmxPrintJob.C | 52 +-- cde/programs/dtmail/dtmail/DmxPrintOptions.C | 18 +- cde/programs/dtmail/dtmail/DmxPrintSetup.C | 8 +- cde/programs/dtmail/dtmail/DtEditor.C | 4 +- cde/programs/dtmail/dtmail/DtMailGenDialog.C | 10 +- cde/programs/dtmail/dtmail/Editor.C | 22 +- cde/programs/dtmail/dtmail/FindDialog.C | 34 +- cde/programs/dtmail/dtmail/MailMsg.h | 11 +- .../dtmail/dtmail/MailRetrievalOptions.C | 32 +- cde/programs/dtmail/dtmail/MsgScrollingList.C | 44 +- cde/programs/dtmail/dtmail/OptCmd.C | 44 +- cde/programs/dtmail/dtmail/RoamApp.C | 42 +- cde/programs/dtmail/dtmail/RoamCmds.C | 90 ++--- cde/programs/dtmail/dtmail/RoamMenuWindow.C | 376 +++++++++--------- cde/programs/dtmail/dtmail/SendMsgDialog.C | 184 ++++----- cde/programs/dtmail/dtmail/SortCmd.C | 2 +- cde/programs/dtmail/dtmail/Undelete.C | 12 +- cde/programs/dtmail/dtmail/ViewMsgDialog.C | 38 +- cde/programs/dtmail/dtmail/XmTextEditor.C | 4 +- cde/programs/dtmail/dtmail/options_ui.C | 204 +++++----- cde/programs/dtmail/include/DtMail/Common.h | 2 +- cde/programs/dtmail/include/DtMail/DtMail.hh | 2 +- .../dtmail/include/DtMail/DtMailError.hh | 2 +- .../dtmail/include/MotifApp/dtmailopts.h | 2 +- cde/programs/dtmail/include/utils/NLS.hh | 53 --- .../dtmail/libDtMail/Common/DtMailError.C | 10 +- cde/programs/dtpad/dtpad.c | 2 +- cde/programs/dtpad/dtpad.h | 2 +- cde/programs/dtpad/main.c | 20 +- cde/programs/dtpdm/PdmMsgs.c | 15 +- cde/programs/dtpdm/PdmMsgs.h | 2 +- cde/programs/dtpdmd/Imakefile | 5 +- cde/programs/dtpdmd/nlmsg.c | 35 +- cde/programs/dtpdmd/nlmsg.h | 91 ++--- cde/programs/dtprintinfo/DtPrintinfo.C | 8 +- cde/programs/dtprintinfo/dtprintinfomsg.h | 10 +- cde/programs/dtscreen/dtscreen.c | 10 +- cde/programs/dtscreen/resource.c | 18 +- cde/programs/dtsr/Imakefile | 24 +- cde/programs/dtsr/dtsrclean.c | 94 ++--- cde/programs/dtsr/dtsrcreate.c | 56 +-- cde/programs/dtsr/dtsrdbrec.c | 114 +++--- cde/programs/dtsr/dtsrhan.c | 172 ++++---- cde/programs/dtsr/dtsrindex.c | 106 ++--- cde/programs/dtsr/dtsrkdump.c | 48 +-- cde/programs/dtsr/dtsrload.c | 74 ++-- cde/programs/dtsr/huffcode.c | 42 +- cde/programs/dtsr/tomita.c | 66 +-- cde/programs/dtstyle/Main.c | 2 +- cde/programs/dtudcexch/selectx.c | 2 +- cde/programs/dtudcexch/selectxlfd.c | 2 +- cde/programs/dtudcexch/xlfdutil.c | 2 +- cde/programs/dtudcfonted/cpyx.c | 2 +- cde/programs/dtudcfonted/selectx.c | 2 +- cde/programs/dtudcfonted/xutil.c | 2 +- cde/programs/localized/util/Imakefile | 7 +- cde/programs/localized/util/merge.c | 24 +- cde/programs/util/dttypes/dttypes.c | 82 ++-- 241 files changed, 3153 insertions(+), 3493 deletions(-) delete mode 100644 cde/programs/dtmail/include/utils/NLS.hh diff --git a/cde/examples/template/template.c b/cde/examples/template/template.c index 5932bbc51..961f0b577 100644 --- a/cde/examples/template/template.c +++ b/cde/examples/template/template.c @@ -39,7 +39,7 @@ #include #include -#include +#include
#include #include
#include
@@ -182,7 +182,7 @@ main(int argc, char **argv) optionTable, XtNumber(optionTable), &argc, argv, NULL, NULL, 0); - msgCatalog = catopen(MessageCatalog, NL_CAT_LOCALE); + msgCatalog = CATOPEN(MessageCatalog, NL_CAT_LOCALE); XtGetApplicationResources(appShell, &argvals, appResources, XtNumber(appResources), @@ -195,9 +195,9 @@ main(int argc, char **argv) WM_SAVE_YOURSELF = XmInternAtom(XtDisplay(appShell), "WM_SAVE_YOURSELF", False); - appnameString = catgets(msgCatalog, 1, 1, "Template"); - separatorString = catgets(msgCatalog, 1, 5, " - "); - untitledString = catgets(msgCatalog, 1, 6, "(untitled)"); + appnameString = CATGETS(msgCatalog, 1, 1, "Template"); + separatorString = CATGETS(msgCatalog, 1, 5, " - "); + untitledString = CATGETS(msgCatalog, 1, 6, "(untitled)"); if (argvals.printMode != NULL) { /* Load up each file and print it, then exit */ @@ -207,7 +207,7 @@ main(int argc, char **argv) PrintData(wd); else fprintf(stderr, - catgets(msgCatalog, 1, 10, "template: can't open %s\n"), + CATGETS(msgCatalog, 1, 10, "template: can't open %s\n"), argv[i]); } DestroyData(wd); @@ -220,7 +220,7 @@ main(int argc, char **argv) procid = ttdt_open(&ttfd, appnameString, "CDE", "1.0", True); if ((ttrc = tt_ptr_error(procid)) != TT_OK) { - errfmt = catgets(msgCatalog, 1, 7, "ttdt_open failed:\n%s"); + errfmt = CATGETS(msgCatalog, 1, 7, "ttdt_open failed:\n%s"); statmsg = tt_status_message(ttrc); errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); sprintf(errmsg, errfmt, statmsg); @@ -232,7 +232,7 @@ main(int argc, char **argv) ttrc = ttmedia_ptype_declare(ToolTalkPType, 0, HandleTtMedia, NULL, True); if (tt_is_err(ttrc)) { - errfmt = catgets(msgCatalog, 1, 8, "ttmedia_ptype_declare failed:\n%s"); + errfmt = CATGETS(msgCatalog, 1, 8, "ttmedia_ptype_declare failed:\n%s"); statmsg = tt_status_message(status); errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); sprintf(errmsg, errfmt, statmsg); @@ -243,7 +243,7 @@ main(int argc, char **argv) ttpat = ttdt_session_join(NULL, NULL, NULL, NULL, True); if ((ttrc = tt_ptr_error(ttpat)) != TT_OK) { - errfmt = catgets(msgCatalog, 1, 9, "ttdt_session_join failed:\n%s"); + errfmt = CATGETS(msgCatalog, 1, 9, "ttdt_session_join failed:\n%s"); statmsg = tt_status_message(status); errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); sprintf(errmsg, errfmt, statmsg); @@ -353,7 +353,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) pd = XmCreatePulldownMenu(menuBar, "fileMenu", NULL, 0); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 1, "File")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 1, "File")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'F'); n++; @@ -362,7 +362,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtManageChild(cb); XmStringFree(labelString); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 9, "New...")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 9, "New...")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'N'); n++; @@ -371,7 +371,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtAddCallback(pb, XmNactivateCallback, NewCb, NULL); XmStringFree(labelString); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 2, "Open...")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 2, "Open...")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'O'); n++; @@ -380,7 +380,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtAddCallback(pb, XmNactivateCallback, OpenCb, (XtPointer)wd); XmStringFree(labelString); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 3, + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 3, "Save As...")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; @@ -390,7 +390,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtAddCallback(pb, XmNactivateCallback, SaveCb, (XtPointer)wd); XmStringFree(labelString); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 4, "Print")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 4, "Print")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'P'); n++; @@ -399,7 +399,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtAddCallback(pb, XmNactivateCallback, PrintCb, (XtPointer)wd); XmStringFree(labelString); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 5, "Clear")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 5, "Clear")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'C'); n++; @@ -408,7 +408,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtAddCallback(pb, XmNactivateCallback, ClearCb, (XtPointer)wd); XmStringFree(labelString); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 6, "Exit")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 6, "Exit")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'E'); n++; @@ -421,7 +421,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) pd = XmCreatePulldownMenu(menuBar, "helpMenu", NULL, 0); - labelString = XmStringCreateLocalized(catgets(msgCatalog, 2, 7, "Help")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog, 2, 7, "Help")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'H'); n++; @@ -432,7 +432,7 @@ NewWindow(LoadType loadtype, char *name_or_buf, int len) XtVaSetValues(menuBar, XmNmenuHelpWidget, cb, NULL); - labelString = XmStringCreateLocalized(catgets(msgCatalog,2,8, "Overview...")); + labelString = XmStringCreateLocalized(CATGETS(msgCatalog,2,8, "Overview...")); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; XtSetArg(args[n], XmNmnemonic, 'O'); n++; @@ -512,7 +512,7 @@ static void HelpCb(Widget w, XtPointer cd, XtPointer cb) XtSetArg(args[n], DtNlocationId, HelpTopic); n++; helpDialog = DtCreateHelpDialog(appShell, "helpDialog", args, n); - title = catgets(msgCatalog, 1, 4, "Template Help"); + title = CATGETS(msgCatalog, 1, 4, "Template Help"); XtVaSetValues(XtParent(helpDialog), XmNtitle, title, NULL); } else { XtVaSetValues(helpDialog, @@ -561,7 +561,7 @@ static void OpenCb(Widget w, XtPointer cd, XtPointer cb) Arg args[20]; int n; - dialogTitle = XmStringCreateLocalized(catgets(msgCatalog, 1, 2, + dialogTitle = XmStringCreateLocalized(CATGETS(msgCatalog, 1, 2, "Template Open")); pattern = XmStringCreateLocalized(SearchPattern); n = 0; @@ -610,7 +610,7 @@ static void SaveCb(Widget w, XtPointer cd, XtPointer cb) Arg args[20]; int n; - dialogTitle = XmStringCreateLocalized(catgets(msgCatalog, 1, 3, + dialogTitle = XmStringCreateLocalized(CATGETS(msgCatalog, 1, 3, "Template Save As")); pattern = XmStringCreateLocalized(SearchPattern); n = 0; diff --git a/cde/lib/DtHelp/FormatMan.c b/cde/lib/DtHelp/FormatMan.c index 5b54fedb3..87762d78c 100644 --- a/cde/lib/DtHelp/FormatMan.c +++ b/cde/lib/DtHelp/FormatMan.c @@ -53,7 +53,6 @@ #endif #include #include -#include #include #include #include diff --git a/cde/lib/DtHelp/FormatUtil.c b/cde/lib/DtHelp/FormatUtil.c index 65f8d63f9..d741cc004 100644 --- a/cde/lib/DtHelp/FormatUtil.c +++ b/cde/lib/DtHelp/FormatUtil.c @@ -75,7 +75,7 @@ extern int errno; #include "FormatUtilI.h" #if defined(NLS16) || !defined(NO_MESSAGE_CATALOG) -#include +#include
#endif #ifndef NL_CAT_LOCALE @@ -789,13 +789,13 @@ _DtHelpLoadMultiInfo ( char *ptr; nl_catd cat_fd; - cat_fd = catopen ("fmt_tbl", NL_CAT_LOCALE); + cat_fd = CATOPEN("fmt_tbl", NL_CAT_LOCALE); if (cat_fd != ((nl_catd) -1)) { /* * Get the list of characters that can't begin a line. */ - ptr = catgets (cat_fd, 1, 1, ""); + ptr = CATGETS(cat_fd, 1, 1, ""); len = strlen (ptr) + 1; *cant_begin_chars = (wchar_t *) malloc (len * sizeof (wchar_t)); if (NULL != *cant_begin_chars && @@ -808,7 +808,7 @@ _DtHelpLoadMultiInfo ( /* * Get the list of characters that can't end a line. */ - ptr = catgets (cat_fd, 1, 2, ""); + ptr = CATGETS(cat_fd, 1, 2, ""); len = strlen (ptr) + 1; *cant_end_chars = (wchar_t *) malloc (len * sizeof (wchar_t)); if (*cant_end_chars != NULL && @@ -825,10 +825,10 @@ _DtHelpLoadMultiInfo ( * 0 means only between a multibyte string and * a singlebyte string. */ - ptr = catgets (cat_fd, 1, 3, "1"); + ptr = CATGETS(cat_fd, 1, 3, "1"); *nl_to_space = atoi(ptr); - catclose (cat_fd); + CATCLOSE(cat_fd); } else #endif diff --git a/cde/lib/DtHelp/Helpos.c b/cde/lib/DtHelp/Helpos.c index fd4285a24..f67703ebd 100644 --- a/cde/lib/DtHelp/Helpos.c +++ b/cde/lib/DtHelp/Helpos.c @@ -51,9 +51,6 @@ #define XOS_USE_XT_LOCKING #include #include -#ifndef _SUN_OS /* don't need the nl_types.h file */ -# include -#endif /* ! _SUN_OS */ #include #include @@ -62,6 +59,7 @@ /* Dt Includes */ #include
#include
+#include
#include "HelpP.h" #include "HelpI.h" @@ -305,8 +303,6 @@ char *_DtHelpGetMessage( { char *msg; char *loc; - nl_catd catopen(); - char *catgets(); static int first = 1; static nl_catd nlmsg_fd; @@ -330,12 +326,12 @@ char *_DtHelpGetMessage( */ nlmsg_fd = (nl_catd) -1; else - nlmsg_fd = catopen(CatFileName, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(CatFileName, NL_CAT_LOCALE); first = 0; } - msg=catgets(nlmsg_fd,set,n,s); + msg=CATGETS(nlmsg_fd,set,n,s); _DtHelpProcessUnlock(); return (msg); } diff --git a/cde/lib/DtHelp/Layout.c b/cde/lib/DtHelp/Layout.c index 6090c5886..8f81f8271 100644 --- a/cde/lib/DtHelp/Layout.c +++ b/cde/lib/DtHelp/Layout.c @@ -65,10 +65,6 @@ #include "SelectionI.h" #include "VirtFuncsI.h" -#ifdef NLS16 -#include -#endif - /****************************************************************************** * * Private Macros diff --git a/cde/lib/DtHelp/LayoutUtil.c b/cde/lib/DtHelp/LayoutUtil.c index a3f75e796..cf3c32ddd 100644 --- a/cde/lib/DtHelp/LayoutUtil.c +++ b/cde/lib/DtHelp/LayoutUtil.c @@ -64,14 +64,6 @@ #include "StringFuncsI.h" #include "VirtFuncsI.h" -#if defined(NLS16) || !defined(NO_MESSAGE_CATALOG) -#include -#endif - -#ifndef NL_CAT_LOCALE -static const int NL_CAT_LOCALE = 0; -#endif - /****************************************************************************** * * Private Defines diff --git a/cde/lib/DtHelp/SetList.c b/cde/lib/DtHelp/SetList.c index 6b70c58d9..3245fef18 100644 --- a/cde/lib/DtHelp/SetList.c +++ b/cde/lib/DtHelp/SetList.c @@ -72,10 +72,6 @@ #include "XInterfaceI.h" #include "XUICreateI.h" -#ifdef NLS16 -#include -#endif - /******** Private Function Declarations ********/ /******** End Public Function Declarations ********/ diff --git a/cde/lib/DtPrint/PrintMsgs.c b/cde/lib/DtPrint/PrintMsgs.c index 1ca6e8819..94eabbb18 100644 --- a/cde/lib/DtPrint/PrintMsgs.c +++ b/cde/lib/DtPrint/PrintMsgs.c @@ -37,8 +37,8 @@ #ifdef I18N_MSG #include -#include #include +#include
#include
#if !defined(NL_CAT_LOCALE) @@ -155,86 +155,6 @@ const char _DtPrMsgPrintDlgMgr_0001[] = "Banner Page Title:"; const char _DtPrMsgPrintDlgMgr_0002[] = "Print Command Options:"; #if defined(I18N_MSG) - -#if defined(hpV4) -/* - * Wrapper around catgets -- this makes sure the message string is saved - * in a safe location; so repeated calls to catgets() do not overwrite - * the catgets() internal buffer. This has been a problem on HP systems. - */ -static char *catgets_cached(nl_catd catd, int set, int num, char *dflt) -{ -#define INITIAL_NMSGS_PER_SET 300 -#define INITIAL_NSETS 50 - - /* array to hold messages from catalog */ - static char ***cached_msgs = NULL; - static int nmsgs_per_set = INITIAL_NMSGS_PER_SET; - static int nsets = INITIAL_NSETS; - - char **setptr; - int i, multiplier; - Cardinal size; - - char* message; - - /* convert to a zero based index */ - int setIdx = set - 1; - int numIdx = num - 1; - - _DtPrintProcessLock(); - - if (NULL == cached_msgs) - { - size = sizeof(char**) * nsets; - cached_msgs = (char***) XtMalloc(size); - memset((char*) cached_msgs, 0, size); - } - else if (setIdx >= nsets) - { - for (multiplier=2; setIdx > multiplier*nsets; multiplier++) {} - size = sizeof(char**) * nsets; - cached_msgs = (char***) XtRealloc((char*) cached_msgs, multiplier * size); - memset((char*) (cached_msgs + size), 0, multiplier * size); - nsets *= multiplier; - } - - if (NULL == cached_msgs[setIdx]) - { - size = sizeof(char*) * nmsgs_per_set; - cached_msgs[setIdx] = (char**) XtMalloc(size); - memset((char*) cached_msgs[setIdx], 0, size); - } - else if (numIdx >= nmsgs_per_set) - { - for (multiplier=2; numIdx > multiplier*nsets; multiplier++) {} - size = sizeof(char*) * nmsgs_per_set; - - for (i=0; i +#include
#define DTPRINT_GETMESSAGE(set, number, string) \ _DtPrintGetMessage(set, number, string) diff --git a/cde/lib/DtSearch/SearchP.h b/cde/lib/DtSearch/SearchP.h index f6f7cea71..749c1c710 100644 --- a/cde/lib/DtSearch/SearchP.h +++ b/cde/lib/DtSearch/SearchP.h @@ -95,7 +95,7 @@ * Removed debugging #defines. */ #include "Search.h" /* the "public" header file */ -#include /* for nl_catd below and all cat...() funcs */ +#include
/* for nl_catd below and all cat...() funcs */ #include #include @@ -600,7 +600,7 @@ extern void swab_objrec (struct or_objrec *rec, SWABDIR direction); /*------------------------- MACROS ---------------------------*/ /* (Use offsetof() in stddef.h to replace my old OFFSET macro) */ -#define NULLORSTR(str) ((str)?str:catgets(dtsearch_catd,1,1,"")) +#define NULLORSTR(str) ((str)?str:CATGETS(dtsearch_catd,1,1,"")) #define NUMARRAY(arr) ((sizeof(arr) / sizeof(arr[0]))) /****************************************/ diff --git a/cde/lib/DtSearch/ausdopen.c b/cde/lib/DtSearch/ausdopen.c index ef3544ebc..9b99239a4 100644 --- a/cde/lib/DtSearch/ausdopen.c +++ b/cde/lib/DtSearch/ausdopen.c @@ -104,7 +104,7 @@ int austext_dopen ( /* Test dbname */ if (dbname == NULL) { INVALID_DBNAME: - sprintf (sprintbuf, catgets (dtsearch_catd, 13, 348, + sprintf (sprintbuf, CATGETS(dtsearch_catd, 13, 348, "%s Invalid database name '%s'."), PROGNAME"348", NULLORSTR(dbname)); DtSearchAddMessage (sprintbuf); @@ -175,7 +175,7 @@ INVALID_DBNAME: SETPAGES (PROGNAME "283", cache, 4); d_open (dbdbuf, "o"); if (db_status != S_OKAY) { - sprintf (sprintbuf, catgets (dtsearch_catd, 13, 379, + sprintf (sprintbuf, CATGETS(dtsearch_catd, 13, 379, "%s Could not open database '%s':\n %s."), PROGNAME"379", dbdbuf, vista_msg (PROGNAME"379")); DtSearchAddMessage (sprintbuf); diff --git a/cde/lib/DtSearch/boolpars.c b/cde/lib/DtSearch/boolpars.c index 8e2dafae6..199876e71 100644 --- a/cde/lib/DtSearch/boolpars.c +++ b/cde/lib/DtSearch/boolpars.c @@ -134,14 +134,14 @@ void add_syntax_errmsg (int msgno) switch (msgno) { case 1: /* Message #2 is called in two places */ - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 2, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 2, "%s Query field is empty."), PROGNAME"086"); DtSearchAddMessage (msgbuf); break; case 2: - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 5, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 5, "%s Boolean operators must be positioned\n" "between words or expressions. Two sequential words\n" "without an operator are interpreted as being separated\n" @@ -151,14 +151,14 @@ void add_syntax_errmsg (int msgno) break; case 3: - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 6, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 6, "%s Expression in parentheses is missing."), PROGNAME"093"); DtSearchAddMessage (msgbuf); break; case 4: - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 7, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 7, "%s NOT operator (~) must be positioned to\n" "the left of the word or expression it qualifies."), PROGNAME"098"); @@ -167,7 +167,7 @@ void add_syntax_errmsg (int msgno) case 5: /* Message #3 is called in two places */ - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 3, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 3, "%s COLLOCATION operator (@) may\n" "only be positioned between two words."), PROGNAME"111"); @@ -175,7 +175,7 @@ void add_syntax_errmsg (int msgno) break; case 6: - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 4, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 4, "%s One or more words in your\n" "query are not stored in database '%s'.") , PROGNAME"089", usrblk.dblk->label); @@ -183,7 +183,7 @@ void add_syntax_errmsg (int msgno) break; default: - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 8, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 8, "%s Invalid boolean query. Syntax Error #%d.") , PROGNAME"100", msgno); DtSearchAddMessage (msgbuf); @@ -288,7 +288,7 @@ static TRUTHTAB *get_stem_truthtab (char *newstem, char *origword) /* Add new stem to array */ if (stemno == saveusr.stemcount) { if (++saveusr.stemcount > DtSrMAX_STEMCOUNT) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_boolpars, 9, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 9, "%s Too many terms in boolean query."), PROGNAME"1513"); DtSearchAddMessage (msgbuf); @@ -490,7 +490,7 @@ TRUTHTAB *boolyac_COLLOC ( if (word1tt->stemno < 0 || word2tt->stemno < 0) { /* Message #3 is called in two places */ - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 3, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 3, "%s COLLOCATION operator (@) may\n" "only be positioned between two words."), PROGNAME"371"); @@ -498,7 +498,7 @@ TRUTHTAB *boolyac_COLLOC ( return NULL; } if (word1tt->stemno == word2tt->stemno) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 12, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 12, "%s Collocation operator is not\n" "permitted between identical words."), PROGNAME"377"); @@ -533,7 +533,7 @@ void yyerror (char *msg) { else if (parser_invalid_wordcount > 0) add_syntax_errmsg(6); else { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 1, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 1, "%s Your search string is an invalid\n" "boolean query. Please reformulate and try again."), PROGNAME"001"); @@ -700,7 +700,7 @@ GET_ANOTHER_TOKEN: if ((usrblk.dblk->dbrec.or_dbaccess & ORA_BLOB) == 0) { retn_token = ERROR_TOKEN; - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 10, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 10, "%s Collocation searches not available for database '%s'."), PROGNAME"2567", usrblk.dblk->label); DtSearchAddMessage (msgbuf); @@ -709,7 +709,7 @@ GET_ANOTHER_TOKEN: yylval.int_val = atoi (yytext + 1); if (yylval.int_val <= 0) { retn_token = ERROR_TOKEN; - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 11, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 11, "%s Collocation operator '%.*s' is invalid.\n" "Correct format is '@n' where n is greater than zero.") , PROGNAME"294", DtSrMAXWIDTH_HWORD, yytext); @@ -778,7 +778,7 @@ GET_ANOTHER_TOKEN: goto GET_ANOTHER_TOKEN; retn_token = ERROR_TOKEN; if (!DtSearchHasMessages()) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 13, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 13, "%s Word '%.*s' is invalid.") , PROGNAME"315", DtSrMAXWIDTH_HWORD, yytext); DtSearchAddMessage (msgbuf); @@ -787,7 +787,7 @@ GET_ANOTHER_TOKEN: } if (strlen(stembufp) != strlen(yytext)) { retn_token = ERROR_TOKEN; - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 14, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 14, "%s String '%.*s' is not a single word.") , PROGNAME"634", DtSrMAXWIDTH_HWORD, yytext); DtSearchAddMessage (msgbuf); @@ -869,7 +869,7 @@ int boolean_parse (void) if (usrblk.query == NULL) { EMPTY_QUERY: /* Message #2 is called in two places */ - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 2, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 2, "%s Query is empty."), PROGNAME"289"); DtSearchAddMessage (msgbuf); return FALSE; @@ -935,7 +935,7 @@ EMPTY_QUERY: } if (final_truthtab.pmsz <= 0) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 15, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 15, "%s Your query cannot logically return\n" "any records. Please reformulate and try again."), PROGNAME"334"); @@ -943,7 +943,7 @@ EMPTY_QUERY: return FALSE; } if (final_truthtab.pmsz >= 256) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolpars, 16, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolpars, 16, "%s Your query will return entire database\n" "'%s'. Please reformulate and try again.") , PROGNAME"341", usrblk.dblk->label); diff --git a/cde/lib/DtSearch/boolsrch.c b/cde/lib/DtSearch/boolsrch.c index 445e16efe..e4febaf1c 100644 --- a/cde/lib/DtSearch/boolsrch.c +++ b/cde/lib/DtSearch/boolsrch.c @@ -342,7 +342,7 @@ static int load_or_wordrecs (void) /* Probable corrupted database. The btree * read succeeded but the record read failed. */ - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolsrch, 6, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolsrch, 6, "%s Database Error. Word '%s' is\n" "listed in database '%s' but has no index record.") , PROGNAME"295", usrblk.stems[stemno], usrblk.dblk->label); @@ -359,7 +359,7 @@ static int load_or_wordrecs (void) (long) wordrec->or_hwaddrs, (long) wordrec->or_hwfree); if (wordrec->or_hwaddrs > OE_words_hitlimit) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_boolsrch, 14, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolsrch, 14, "%s '%s' has more than %ld hits.\n" "Please remove it from the query or raise the WHITLIM\n" "value in the search engine configuration file."), @@ -1110,7 +1110,7 @@ static DB_ADDR read_d99 (struct or_hwordrec *wordrec) } if (fread (readbuf, sizeof(DB_ADDR), request_read, fptr) != request_read) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolsrch, 28, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolsrch, 28, "%s Database Read Error in %s.d99.") , PROGNAME"428", usrblk.dblk->name); DtSearchAddMessage (msgbuf); @@ -1342,13 +1342,13 @@ static void read_stem_bitvec_WK (void) * The bit number is the remainder after division by 8. */ if ((byteno = d99recno >> 3) >= bitveclen) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_boolsrch, 32, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolsrch, 32, "%s Database Error: %s '%s'\n" "in database '%s' has invalid d99 record number %ld.") , PROGNAME"394", (usrblk.search_type == 'W') ? - catgets(dtsearch_catd, MS_boolsrch, 33, "Word") : - catgets(dtsearch_catd, MS_boolsrch, 34, "Stem of"), + CATGETS(dtsearch_catd, MS_boolsrch, 33, "Word") : + CATGETS(dtsearch_catd, MS_boolsrch, 34, "Stem of"), usrblk.stems [save_stemno], usrblk.dblk->label, d99recno); @@ -1427,7 +1427,7 @@ void boolean_search (void) if ( saveusr.stemcount <= 0 || final_truthtab.pmsz <= 0 || final_truthtab.pmsz >= 256 ) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_boolsrch, 35, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_boolsrch, 35, "%s Program Error: stemct=%d pmsz=%d\n") , PROGNAME"1404", saveusr.stemcount, final_truthtab.pmsz); DtSearchExit (14); @@ -1556,7 +1556,7 @@ void boolean_search (void) * generated if a NOT operator was included in the query. */ if (need_zero_permute) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_boolsrch, 15, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_boolsrch, 15, "%s Your query requires retrieving every\n" "document in the database that does not have any of\n" "your query words. This type of search may take an\n" diff --git a/cde/lib/DtSearch/dbchange.c b/cde/lib/DtSearch/dbchange.c index 1d8b3bf9b..e2f975d4a 100644 --- a/cde/lib/DtSearch/dbchange.c +++ b/cde/lib/DtSearch/dbchange.c @@ -89,7 +89,7 @@ static int file_has_changed (char *fname, time_t origtime) char sprintbuf[1024]; if (stat (fname, &statbuf) == -1) { - sprintf (sprintbuf, catgets (dtsearch_catd, 10, 1300, + sprintf (sprintbuf, CATGETS(dtsearch_catd, 10, 1300, "%s Unable to comply with request; cannot access status\n" " of database file '%s': %s"), PROGNAME "1300", fname, strerror (errno)); @@ -107,7 +107,7 @@ static int file_has_changed (char *fname, time_t origtime) PROGNAME "1312", aa_argv0, fname, sprintbuf, nowstring (&statbuf.st_mtime)); if (!(usrblk.flags & USR_NO_INFOMSGS)) { - sprintf (sprintbuf, catgets (dtsearch_catd, 10, 1313, + sprintf (sprintbuf, CATGETS(dtsearch_catd, 10, 1313, "%s *** REQUEST CANCELED *** %s Engine reinitialized\n" " due to modification of file %s, probably caused by\n" " update to one or more databases."), diff --git a/cde/lib/DtSearch/dberr.c b/cde/lib/DtSearch/dberr.c index a54bcafa1..c485a6f4f 100644 --- a/cde/lib/DtSearch/dberr.c +++ b/cde/lib/DtSearch/dberr.c @@ -68,7 +68,7 @@ #include #include #include -#include /* for nl_catd */ +#include
/* for nl_catd */ #include "vista.h" #include "dberr.h" /* retained for default vista msgs */ @@ -121,7 +121,7 @@ int dberr (int verrno) */ void dbautorec (void) { - fputs (catgets (dtsearch_catd, MS_vista, 304, + fputs (CATGETS(dtsearch_catd, MS_vista, 304, "\n*** db_VISTA auto recovery in process...\n"), aa_stderr); db_status = S_RECOVERY; @@ -151,19 +151,19 @@ char *vista_msg (char *location) /* Assemble standard Raima err msg */ if (location == NULL) - location = catgets (dtsearch_catd, MS_vista, 303, + location = CATGETS(dtsearch_catd, MS_vista, 303, "(unspecified location)"); - sprintf (vista_errmsg, catgets (dtsearch_catd, MS_vista, 311, + sprintf (vista_errmsg, CATGETS(dtsearch_catd, MS_vista, 311, "*** DB Error at %s, db_status = %d: %n"), location, db_status, &i); msgtarg = vista_errmsg + i; if (db_status == S_UNAVAIL) { /* +5, usually at d_open() time */ - strcpy (msgtarg, catgets (dtsearch_catd, MS_vista, 315, + strcpy (msgtarg, CATGETS(dtsearch_catd, MS_vista, 315, "Database in use by other users.")); } else if (db_status >= 0) - strcpy (msgtarg, catgets (dtsearch_catd, MS_vista, 312, + strcpy (msgtarg, CATGETS(dtsearch_catd, MS_vista, 312, "Programming Error.")); else { if (db_status < 0 && db_status > -100) @@ -171,22 +171,22 @@ char *vista_msg (char *location) else if (db_status <= -900) defaultmsg = system_error[-(db_status + 900)]; else - defaultmsg = catgets (dtsearch_catd, MS_vista, 313, + defaultmsg = CATGETS(dtsearch_catd, MS_vista, 313, "Unknown Error."); - strcpy (msgtarg, catgets (dtsearch_catd, MS_vista, -db_status, + strcpy (msgtarg, CATGETS(dtsearch_catd, MS_vista, -db_status, defaultmsg)); } msgtarg += strlen (msgtarg); /* Append system errno msg */ - sprintf (msgtarg, catgets (dtsearch_catd, MS_vista, 301, + sprintf (msgtarg, CATGETS(dtsearch_catd, MS_vista, 301, "\n*** System I/O errno %d = %s"), vista_syserrno, strerror (vista_syserrno)); msgtarg += strlen (msgtarg); /* Append additional information for common user error msgs */ if (db_status == S_NOFILE) { - strcpy (msgtarg, catgets (dtsearch_catd, MS_vista, 302, + strcpy (msgtarg, CATGETS(dtsearch_catd, MS_vista, 302, "\n" "*** The usual cause for this kind of error is a missing\n" "*** or read-only database file, or some system limit\n" diff --git a/cde/lib/DtSearch/dtoe.c b/cde/lib/DtSearch/dtoe.c index d97fa12d0..388633a60 100644 --- a/cde/lib/DtSearch/dtoe.c +++ b/cde/lib/DtSearch/dtoe.c @@ -165,7 +165,7 @@ SAVEUSR saveusr = { 0 }; */ static void expired (char *sprintbuf) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oe, 71, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oe, 71, PROGNAME "71 %s has expired."), OE_prodname); DtSearchAddMessage (sprintbuf); @@ -288,7 +288,7 @@ static void save_query (char *prefix, time_t start_time) * with a displayable funny character (tilde ~). */ if (usrblk.query == NULL) - strcpy (targ, catgets (dtsearch_catd, MS_misc, 1, "")); + strcpy (targ, CATGETS(dtsearch_catd, MS_misc, 1, "")); else { end = saveusr.lastqry + MAX_LASTQRY - 2; src = usrblk.query; @@ -326,7 +326,7 @@ void oe_write_audit_rec (long numhits) if ((stream = fopen (OEF_audit, "a ")) == NULL) /* the blank in "a " works around old aix bug */ { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_misc, 1596, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_misc, 1596, PROGNAME "1596 Cannot open audit file %s: %s"), OEF_audit, strerror (errno)); DtSearchAddMessage (sprintbuf); @@ -341,7 +341,7 @@ void oe_write_audit_rec (long numhits) usrblk.dblk->name, numhits, (saveusr.lastqry == NULL) ? \ - catgets (dtsearch_catd, MS_misc, 1, "") : saveusr.lastqry); + CATGETS(dtsearch_catd, MS_misc, 1, "") : saveusr.lastqry); if (saveusr.lastqry != NULL) { free (saveusr.lastqry); saveusr.lastqry = NULL; @@ -370,7 +370,7 @@ static int no_keytypes (void) while (--i >= 0) if (keytypes[i].is_selected) return FALSE; - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oe, 440, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oe, 440, PROGNAME "440 No record keytypes were selected in database '%s'."), usrblk.dblk->label); DtSearchAddMessage (sprintbuf); @@ -539,7 +539,7 @@ void Opera_Engine (void) expired (sprintbuf); if (OE_flags & OE_PERMERR) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oe, 490, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oe, 490, PROGNAME "490 %s Engine permanently disabled."), OE_prodname); DtSearchAddMessage (sprintbuf); usrblk.retncode = OE_ABORT; @@ -548,7 +548,7 @@ void Opera_Engine (void) /* Ensure that the first call is always an OE_INITIALIZE call */ if ((usrblk.request != OE_INITIALIZE) && !(OE_flags & OE_INITOK)) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_oe, 523, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_oe, 523, PROGNAME "523 Request Denied: First request must " "be Engine Initialization.")); usrblk.retncode = OE_NOOP; @@ -573,7 +573,7 @@ void Opera_Engine (void) if (strcmp (usrblk.dblk->name, db->name) == 0) break; if (db == NULL) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oe, 48, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oe, 48, PROGNAME "48 Request Aborted: " "'%s' database not available at this site."), usrblk.dblk->name); @@ -874,7 +874,7 @@ NO_TEXT: break; default: - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oe, 367, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oe, 367, PROGNAME "367: User Interface Error. " "%d is invalid request code.\n"), usrblk.request); diff --git a/cde/lib/DtSearch/dtoeinit.c b/cde/lib/DtSearch/dtoeinit.c index 9796ad942..69710fcb6 100644 --- a/cde/lib/DtSearch/dtoeinit.c +++ b/cde/lib/DtSearch/dtoeinit.c @@ -179,8 +179,8 @@ void oe_initialize (void) if (usrblk.query != NULL) ptr = usrblk.query; else - ptr = catgets (dtsearch_catd, MS_misc, 6, ""); - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 137, + ptr = CATGETS(dtsearch_catd, MS_misc, 6, ""); + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 137, "%s User Interface version %s and Engine " "version %s are incompatible."), PROGNAME"137", ptr, AUSAPI_VERSION); @@ -192,7 +192,7 @@ void oe_initialize (void) /* Load site configuration (ocf) file and create dblks list */ if (!load_ocf()) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 202, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 202, "%s Initialization failed due to errors in configuration file."), PROGNAME"202"); DtSearchAddMessage (sprintbuf); @@ -227,7 +227,7 @@ void oe_initialize (void) */ if (!ve_initialize()) { INIT_FAILED: - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 266, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 266, "%s Initialization failed due to errors in database,\n" " language, or related files."), PROGNAME "266"); @@ -276,7 +276,7 @@ DELETE_DB: /* Abort if fatal dictionary load errors */ if (good_dblk_count <= 0) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_misc, 8, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_misc, 8, "%s No valid databases remain."), PROGNAME"265"); DtSearchAddMessage (sprintbuf); diff --git a/cde/lib/DtSearch/dtsrapi.c b/cde/lib/DtSearch/dtsrapi.c index e9be4604b..f6554434e 100644 --- a/cde/lib/DtSearch/dtsrapi.c +++ b/cde/lib/DtSearch/dtsrapi.c @@ -147,7 +147,7 @@ extern int db_oflag; static void signal_abort (int sig) { fputs (DtSearchGetMessages (), aa_stderr); - fprintf (aa_stderr, catgets (dtsearch_catd, MS_ausapi, 216, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_ausapi, 216, "\n%s %s Caught signal %d.\n"), PROGNAME"216", (aa_argv0) ? aa_argv0 : OE_prodname, @@ -191,7 +191,7 @@ static int valid_dbname (char *dbname) break; } if (db == NULL) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 1, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 1, "%1$sInvalid or unavailable database '%2$s'."), PROGNAME "48 ", dbname); DtSearchAddMessage (sprintbuf); @@ -301,7 +301,7 @@ int DtSearchInit ( int *dbcount) { if (aa_is_initialized) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 621, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 621, "%1$s %2%s has already been initialized."), PROGNAME"621", PRODNAME); DtSearchAddMessage (sprintbuf); @@ -322,7 +322,7 @@ int DtSearchInit ( /* Open msgs and help text catalogs. */ if (switches & (DtSrInNOLOCALE == 0)) { setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); } /* Register AusText abort signal handlers. @@ -348,7 +348,7 @@ int DtSearchInit ( /* If user name was not passed, get it from LOGNAME environment var */ if (userid == NULL || *userid == 0) if ((userid = (char *) getenv ("LOGNAME")) == NULL) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 187, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 187, "%1$s Missing both userid and LOGNAME environment variable."), PROGNAME "187 "); DtSearchAddMessage (sprintbuf); @@ -398,7 +398,7 @@ int DtSearchInit ( if (dbnames) { *dbnames = ausapi_dbnamesv; if (!dbcount) { - sprintf (sprintbuf, catgets(dtsearch_catd, MS_ausapi, 7, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 7, "%s dbnames specified but not dbcount."), PROGNAME"304"); DtSearchAddMessage (sprintbuf); @@ -494,7 +494,7 @@ static int both_valid_dates (char *date1, char *date2) usrblk.objdate1 != 0L && usrblk.objdate2 != 0L && usrblk.objdate1 >= usrblk.objdate2) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 198, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 198, "%s 'Before' date is equal to or after 'After' date.\n" " No records would be returned."), PROGNAME "198"); @@ -569,7 +569,7 @@ int DtSearchQuery ( break; default: - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 20, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 20, "%1$s Invalid search_type '%2$c'."), PROGNAME "172 ", search_type); DtSearchAddMessage (sprintbuf); @@ -580,7 +580,7 @@ int DtSearchQuery ( /* Validate the 'qry' argument */ if (qry == NULL) { QUERY_ERROR: - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 30, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 30, "%s Null query. No search performed."), PROGNAME"81"); DtSearchAddMessage (sprintbuf); @@ -686,7 +686,7 @@ END_OF_SEARCH: /* Query was invalid. Tell the user why. */ if (ausapi_msglist == NULL) { sprintf (sprintbuf, - catgets (dtsearch_catd, MS_ausapi, 806, + CATGETS(dtsearch_catd, MS_ausapi, 806, "%s Query insufficient or search options " "incompatible with database '%s' to commence search."), PROGNAME "806", usrblk.dblk->name); @@ -795,7 +795,7 @@ int DtSearchHighlight ( /* copy cleartext to usrblk if necessary */ if (cleartext == NULL || cleartext[0] == 0) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 40, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 40, "%1$s Null cleartext. No highlighting performed."), PROGNAME "349 ", dbname); DtSearchAddMessage (sprintbuf); @@ -817,7 +817,7 @@ int DtSearchHighlight ( if (stems) { if (stemcount > DtSrMAX_STEMCOUNT) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 1072, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 1072, "%s Program Error: Stem count (%d) greater than maximum (%d)."), PROGNAME"1072", stemcount, DtSrMAX_STEMCOUNT); DtSearchAddMessage (sprintbuf); @@ -864,7 +864,7 @@ int DtSearchHighlight ( * msglist. */ if (!ausapi_msglist) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_ausapi, 1342, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_ausapi, 1342, "%s Search Engine Error %d for highlight request for " "database '%s', hit word count=%ld, search type='%c', text='%.30s'"), PROGNAME "1342", diff --git a/cde/lib/DtSearch/dtsrdbrec.c b/cde/lib/DtSearch/dtsrdbrec.c index 21f6ee460..8e397385f 100644 --- a/cde/lib/DtSearch/dtsrdbrec.c +++ b/cde/lib/DtSearch/dtsrdbrec.c @@ -104,25 +104,25 @@ void print_dbrec (char *dbname, struct or_dbrec * dbrec) int i; int blobs_are_possible = FALSE; - printf (catgets (dtsearch_catd, MS_dbrec, 1, + printf (CATGETS(dtsearch_catd, MS_dbrec, 1, "---------- System Values for Database '%s' ----------\n"), dbname); - printf (catgets (dtsearch_catd, MS_dbrec, 2, + printf (CATGETS(dtsearch_catd, MS_dbrec, 2, "Schema version number (version) is '%s'.\n"), dbrec->or_version); - printf (catgets (dtsearch_catd, MS_dbrec, 3, + printf (CATGETS(dtsearch_catd, MS_dbrec, 3, "Maximum object key size (sizeof(objkey)) is %ld bytes.\n"), DtSrMAX_DB_KEYSIZE); if (ORD_USEHUGEKEYS & dbrec->or_dbflags) - printf ("%s", catgets (dtsearch_catd, MS_dbrec, 4, + printf ("%s", CATGETS(dtsearch_catd, MS_dbrec, 4, "Optional 'Huge' keys enabled.\n")); - printf (catgets (dtsearch_catd, MS_dbrec, 12, + printf (CATGETS(dtsearch_catd, MS_dbrec, 12, "Maximum length of an abstract string (abstrsz) is %d.\n"), dbrec->or_abstrsz); if (dbrec->or_abstrsz == 0) - puts (catgets (dtsearch_catd, MS_dbrec, 14, + puts (CATGETS(dtsearch_catd, MS_dbrec, 14, " (Abstracts are not used in this database).")); else { /* @@ -130,88 +130,88 @@ void print_dbrec (char *dbname, struct or_dbrec * dbrec) * actually are */ if (dbrec->or_hufid != 0L) - printf (catgets (dtsearch_catd, MS_dbrec, 20, + printf (CATGETS(dtsearch_catd, MS_dbrec, 20, "Abstracts are %scompressed.\n"), (ORC_COMPABSTR & dbrec->or_compflags) ? "" : "not "); } - printf (catgets (dtsearch_catd, MS_dbrec, 22, + printf (CATGETS(dtsearch_catd, MS_dbrec, 22, "Parsing language is number %d, %s.\n"), dbrec->or_language, language_name(dbrec->or_language)); - printf (catgets (dtsearch_catd, MS_dbrec, 24, + printf (CATGETS(dtsearch_catd, MS_dbrec, 24, "Minimum word length (minwordsz) is %d.\n"), dbrec->or_minwordsz); - printf (catgets (dtsearch_catd, MS_dbrec, 26, + printf (CATGETS(dtsearch_catd, MS_dbrec, 26, "Maximum word length (maxwordsz) is %d.\n"), dbrec->or_maxwordsz); - printf (catgets (dtsearch_catd, MS_dbrec, 30, + printf (CATGETS(dtsearch_catd, MS_dbrec, 30, "Number of .d00 slots per object (recslots) is %d.\n"), dbrec->or_recslots); - printf (catgets (dtsearch_catd, MS_dbrec, 36, + printf (CATGETS(dtsearch_catd, MS_dbrec, 36, " (Maximum number of database objects is %ld).\n"), 0xffffffL / (long) dbrec->or_recslots); - printf (catgets (dtsearch_catd, MS_dbrec, 40, + printf (CATGETS(dtsearch_catd, MS_dbrec, 40, "Huffman compression table id (hufid) is %ld.\n"), dbrec->or_hufid); if (dbrec->or_hufid == 0L) - puts (catgets (dtsearch_catd, MS_dbrec, 42, + puts (CATGETS(dtsearch_catd, MS_dbrec, 42, " (Compression is disabled in this database).")); if (dbrec->or_hufid == -1L) - puts (catgets (dtsearch_catd, MS_dbrec, 44, + puts (CATGETS(dtsearch_catd, MS_dbrec, 44, " (Specific compression table is not yet determined).")); blobs_are_possible = FALSE; switch (dbrec->or_dbaccess) { case ORA_VARIES: - puts (catgets (dtsearch_catd, MS_dbrec, 50, + puts (CATGETS(dtsearch_catd, MS_dbrec, 50, "Engine accessibility to data may vary from object to object.")); blobs_are_possible = TRUE; break; case ORA_NOTAVAIL: - puts (catgets (dtsearch_catd, MS_dbrec, 54, + puts (CATGETS(dtsearch_catd, MS_dbrec, 54, "Data objects are not directly accessible from the engine.")); break; case ORA_BLOB: - puts (catgets (dtsearch_catd, MS_dbrec, 56, + puts (CATGETS(dtsearch_catd, MS_dbrec, 56, "Data objects are stored internally as blobs.")); blobs_are_possible = TRUE; break; case ORA_REFBLOB: - puts (catgets (dtsearch_catd, MS_dbrec, 60, + puts (CATGETS(dtsearch_catd, MS_dbrec, 60, "Only server file references to objects are stored in the blobs.")); break; case ORA_CREFBLOB: - puts (catgets (dtsearch_catd, MS_dbrec, 64, + puts (CATGETS(dtsearch_catd, MS_dbrec, 64, "Only client file references to objects are stored in the blobs.")); break; case ORA_REFKEY: - puts (catgets (dtsearch_catd, MS_dbrec, 68, + puts (CATGETS(dtsearch_catd, MS_dbrec, 68, "Object keys are server file references to the objects.")); break; case ORA_CREFKEY: - puts (catgets (dtsearch_catd, MS_dbrec, 72, + puts (CATGETS(dtsearch_catd, MS_dbrec, 72, "Object keys are client file references to the objects.")); break; case ORA_REFHUGEKEY: - puts (catgets (dtsearch_catd, MS_dbrec, 74, + puts (CATGETS(dtsearch_catd, MS_dbrec, 74, "Server file references to objects are " "stored in the 'huge' keys.")); break; case ORA_REFABSTR: - puts (catgets (dtsearch_catd, MS_dbrec, 80, + puts (CATGETS(dtsearch_catd, MS_dbrec, 80, "Server file references to objects are stored in the abstracts.")); break; case ORA_CREFABSTR: - puts (catgets (dtsearch_catd, MS_dbrec, 86, + puts (CATGETS(dtsearch_catd, MS_dbrec, 86, "Client file references to objects are stored in the abstracts.")); break; default: - printf (catgets (dtsearch_catd, MS_dbrec, 90, + printf (CATGETS(dtsearch_catd, MS_dbrec, 90, "Error: meaning of or_dbaccess value (%hd) is unknown.\n"), dbrec->or_dbaccess); blobs_are_possible = TRUE; @@ -224,59 +224,59 @@ void print_dbrec (char *dbname, struct or_dbrec * dbrec) * actually are */ if (dbrec->or_hufid != 0L) - printf (catgets (dtsearch_catd, MS_dbrec, 100, + printf (CATGETS(dtsearch_catd, MS_dbrec, 100, "Repository blobs are %scompressed.\n"), (ORC_COMPBLOB & dbrec->or_compflags) ? "" : "not "); } else - puts (catgets (dtsearch_catd, MS_dbrec, 110, + puts (CATGETS(dtsearch_catd, MS_dbrec, 110, "Repository blobs are not used in this database.")); - printf (catgets (dtsearch_catd, MS_dbrec, 120, + printf (CATGETS(dtsearch_catd, MS_dbrec, 120, "Database switches (dbflags) are 0x%lx:\n"), dbrec->or_dbflags); - printf (catgets (dtsearch_catd, MS_dbrec, 130, + printf (CATGETS(dtsearch_catd, MS_dbrec, 130, " Inverted index %s words exactly as parsed.\n"), (ORD_XWORDS & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 124, "INCLUDES") : - catgets (dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); + CATGETS(dtsearch_catd, MS_dbrec, 124, "INCLUDES") : + CATGETS(dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); - printf (catgets (dtsearch_catd, MS_dbrec, 140, + printf (CATGETS(dtsearch_catd, MS_dbrec, 140, " Inverted index %s word stems.\n"), (ORD_XSTEMS & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 124, "INCLUDES") : - catgets (dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); + CATGETS(dtsearch_catd, MS_dbrec, 124, "INCLUDES") : + CATGETS(dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); - printf (catgets (dtsearch_catd, MS_dbrec, 160, + printf (CATGETS(dtsearch_catd, MS_dbrec, 160, " Use of optional 'huge' keys is %s.\n"), (ORD_USEHUGEKEYS & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 126, "ENABLED") : - catgets (dtsearch_catd, MS_dbrec, 127, "DISABLED")); + CATGETS(dtsearch_catd, MS_dbrec, 126, "ENABLED") : + CATGETS(dtsearch_catd, MS_dbrec, 127, "DISABLED")); - printf (catgets (dtsearch_catd, MS_dbrec, 162, + printf (CATGETS(dtsearch_catd, MS_dbrec, 162, " Mark-for-deletion is %s.\n"), (ORD_NOMARKDEL & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 127, "DISABLED") : - catgets (dtsearch_catd, MS_dbrec, 126, "ENABLED")); + CATGETS(dtsearch_catd, MS_dbrec, 127, "DISABLED") : + CATGETS(dtsearch_catd, MS_dbrec, 126, "ENABLED")); - printf (catgets (dtsearch_catd, MS_dbrec, 164, + printf (CATGETS(dtsearch_catd, MS_dbrec, 164, " Appendable user notes are %s.\n"), (ORD_NONOTES & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 127, "DISABLED") : - catgets (dtsearch_catd, MS_dbrec, 126, "ENABLED")); + CATGETS(dtsearch_catd, MS_dbrec, 127, "DISABLED") : + CATGETS(dtsearch_catd, MS_dbrec, 126, "ENABLED")); - printf (catgets (dtsearch_catd, MS_dbrec, 170, + printf (CATGETS(dtsearch_catd, MS_dbrec, 170, " Text characters are %s wide.\n"), (ORD_WIDECHAR & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 172, "MULTIPLE bytes") : - catgets (dtsearch_catd, MS_dbrec, 174, "a SINGLE byte")); + CATGETS(dtsearch_catd, MS_dbrec, 172, "MULTIPLE bytes") : + CATGETS(dtsearch_catd, MS_dbrec, 174, "a SINGLE byte")); - printf (catgets (dtsearch_catd, MS_dbrec, 200, + printf (CATGETS(dtsearch_catd, MS_dbrec, 200, "Current number of database objects (reccount) is %ld.\n"), dbrec->or_reccount); - printf (catgets (dtsearch_catd, MS_dbrec, 210, + printf (CATGETS(dtsearch_catd, MS_dbrec, 210, "Last currently used slot number (maxdba) is %ld.\n"), dbrec->or_maxdba); @@ -306,22 +306,22 @@ int main (int argc, char *argv[]) aa_argv0 = argv[0]; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); - austools_catd = catopen (FNAME_AUSCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); + austools_catd = CATOPEN(FNAME_AUSCAT, 0); time (&now); time_ptr = _XLocaltime(&now, localtime_buf); strftime (renamebuf, sizeof (renamebuf), - catgets (dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), time_ptr); - printf (catgets (dtsearch_catd, MS_misc, 23, + printf (CATGETS(dtsearch_catd, MS_misc, 23, "%s: Version %s. Run %s.\n"), aa_argv0, DtSrVERSION, renamebuf); if (argc < 2) { - printf (catgets (dtsearch_catd, MS_dbrec, 310, + printf (CATGETS(dtsearch_catd, MS_dbrec, 310, "USAGE: %s \n"), aa_argv0); return 2; } @@ -329,21 +329,21 @@ int main (int argc, char *argv[]) db_oflag = O_RDONLY; /* db files may be read-only */ d_open (argv[1], "o"); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_dbrec, 330, + printf (CATGETS(dtsearch_catd, MS_dbrec, 330, "Could not open '%s' database.\n%s\n"), argv[1], vista_msg(PROGNAME"293")); return 3; } d_recfrst (OR_DBREC, 0); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_dbrec, 340, + printf (CATGETS(dtsearch_catd, MS_dbrec, 340, "No dbrec record in database '%s'.\n"), argv[1]); return 4; } d_recread (&dbrec, 0); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_dbrec, 350, + printf (CATGETS(dtsearch_catd, MS_dbrec, 350, "Can't read dbrec record in database '%s'.\n%s\n"), argv[1], vista_msg(PROGNAME"306")); return 5; diff --git a/cde/lib/DtSearch/dtsrjoint.c b/cde/lib/DtSearch/dtsrjoint.c index 1448b75a4..cc6ab1d87 100644 --- a/cde/lib/DtSearch/dtsrjoint.c +++ b/cde/lib/DtSearch/dtsrjoint.c @@ -124,7 +124,7 @@ void aa_check_initialization (void) if (aa_is_initialized) return; fprintf (aa_stderr, - catgets (dtsearch_catd, 2, 37, + CATGETS(dtsearch_catd, 2, 37, "%s First API function call must be DtSearchInit().\n"), PROGNAME"37"); DtSearchExit (37); @@ -183,7 +183,7 @@ DtSrObjdate DtSearchValidDateString (char *datestr) #endif INVALID_DATESTR: sprintf (msgbuf, - catgets (dtsearch_catd, 2, 115, + CATGETS(dtsearch_catd, 2, 115, "%s '%s' is invalid or incomplete date string.\n" "The correct format is '[yy]yy [mm [dd]]'."), PROGNAME"115", datestr); diff --git a/cde/lib/DtSearch/dtsrutil.c b/cde/lib/DtSearch/dtsrutil.c index 2bfd5793f..f03fddeb9 100644 --- a/cde/lib/DtSearch/dtsrutil.c +++ b/cde/lib/DtSearch/dtsrutil.c @@ -166,7 +166,7 @@ char *get_hitlist_text (int maxlen) size_t mallocsz; if (usrblk.dittocount <= 0L) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_misc, 96, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_misc, 96, "%s Hitlist is empty."), PROGNAME"96"); DtSearchAddMessage (sprintbuf); return NULL; diff --git a/cde/lib/DtSearch/dtsrve.c b/cde/lib/DtSearch/dtsrve.c index e67119728..14ea2806c 100644 --- a/cde/lib/DtSearch/dtsrve.c +++ b/cde/lib/DtSearch/dtsrve.c @@ -107,7 +107,7 @@ char *strupr(char *); */ void dummy_workproc (void) { - fputs (catgets (dtsearch_catd, MS_ve, 26, + fputs (CATGETS(dtsearch_catd, MS_ve, 26, PROGNAME "26 Called dummy_workproc().\n"), aa_stderr); return; @@ -201,7 +201,7 @@ int ve_initialize (void) RECFRST (PROGNAME "285", OR_DBREC, db->vistano); /* seqtl retrieval */ if (db_status != S_OKAY) { NO_DBREC: - sprintf (msgbuf, catgets (dtsearch_catd, MS_misc, 13, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_misc, 13, "%s No DB record in database '%s'."), PROGNAME "853 ", db->name); DtSearchAddMessage (msgbuf); @@ -222,14 +222,14 @@ int ve_initialize (void) /*-------------- DBREC SANITY CHECKS ----------------*/ if (db->dbrec.or_reccount <= 0) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_ve, 167, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_ve, 167, "%s No data in database '%s'."), PROGNAME"167 ", db->name); DtSearchAddMessage (msgbuf); goto DELETE_DB; } if (!is_compatible_version (db->dbrec.or_version, SCHEMA_VERSION)) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_ve, 178, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_ve, 178, "%s Database '%s' version '%s' incompatible" " with Engine version '%s'."), PROGNAME"178 ", @@ -238,7 +238,7 @@ int ve_initialize (void) goto DELETE_DB; } if (db->dbrec.or_reccount > db->dbrec.or_maxdba) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_ve, 251, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_ve, 251, "%s Database '%s' corrupted: " "Incompatible record counts and database addresses.\n"), PROGNAME" 251", db->name); @@ -246,7 +246,7 @@ int ve_initialize (void) goto DELETE_DB; } if (db->dbrec.or_maxwordsz < MAXWIDTH_SWORD - 1) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_ve, 185, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_ve, 185, "%s Database '%s' maximum word size %d is too short."), PROGNAME" 185", db->name, db->dbrec.or_maxwordsz); DtSearchAddMessage (msgbuf); @@ -257,7 +257,7 @@ int ve_initialize (void) * for now, huffman decompress table hardcoded and * linked in */ - sprintf (msgbuf, catgets (dtsearch_catd, MS_ve, 156, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_ve, 156, "%s Incompatible data compression table used for database '%s'.\n" " Database compressed with %ld, " "engine decompressor is %ld.\n"), @@ -289,7 +289,7 @@ int ve_initialize (void) fprintf (aa_stderr, "--> opening '%s'\n", d9x_fname); if ((db->syofile = fopen (d9x_fname, open_mode)) == NULL) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_oeinit, 317, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_oeinit, 317, default_cant_open_msg), PROGNAME "286", d9x_fname, errno, strerror (errno), OE_prodname, db->name); DtSearchAddMessage (msgbuf); @@ -301,7 +301,7 @@ int ve_initialize (void) fprintf (aa_stderr, "--> opening '%s'\n", d9x_fname); if ((db->syifile = fopen (d9x_fname, open_mode)) == NULL) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_oeinit, 317, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_oeinit, 317, default_cant_open_msg), PROGNAME "298", d9x_fname, errno, strerror (errno), OE_prodname, db->name); DtSearchAddMessage (msgbuf); @@ -337,7 +337,7 @@ DELETE_DB: /* Quit if no dblks remain */ if (good_dblk_count <= 0) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_misc, 8, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_misc, 8, "%s No valid databases remain."), PROGNAME "246"); DtSearchAddMessage (msgbuf); return FALSE; @@ -419,14 +419,14 @@ int ve_append_notes (void) /* Test if function is disabled */ if (!OE_enable_usernotes || usrblk.dblk->dbrec.or_dbflags & ORD_NONOTES) { - sprintf (mybuf, catgets (dtsearch_catd, MS_ve, 309, + sprintf (mybuf, CATGETS(dtsearch_catd, MS_ve, 309, "%s User notes disabled "), PROGNAME" 309"); ptr = mybuf + strlen (mybuf); if (!OE_enable_usernotes) - strcpy (ptr, catgets (dtsearch_catd, MS_ve, 310, + strcpy (ptr, CATGETS(dtsearch_catd, MS_ve, 310, "for entire Engine.")); else - sprintf (ptr, catgets (dtsearch_catd, MS_ve, 311, + sprintf (ptr, CATGETS(dtsearch_catd, MS_ve, 311, "for database '%s'."), usrblk.dblk->name); DtSearchAddMessage (mybuf); @@ -435,7 +435,7 @@ int ve_append_notes (void) /* Test for invalid dba */ if (usrblk.dba == NULL_DBA) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_ve, 157, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_ve, 157, PROGNAME "157 Client Program Error: " "Null database address in usrblk.dba.")); OE_flags |= OE_PERMERR; @@ -452,7 +452,7 @@ int ve_append_notes (void) for (;;) { if ((semaphore_file = fopen (OEF_notessem, "r+")) == NULL) { sprintf (mybuf, - catgets (dtsearch_catd, MS_ve, 183, + CATGETS(dtsearch_catd, MS_ve, 183, "%s Could not open user notes semaphore file '%s': %s.\n"), PROGNAME "183 ", OEF_notessem, strerror (errno)); DtSearchAddMessage (mybuf); @@ -478,7 +478,7 @@ int ve_append_notes (void) fclose (semaphore_file); if (++i > NOTES_SEM_DELAY) { sprintf (mybuf, - catgets (dtsearch_catd, MS_ve, 199, + CATGETS(dtsearch_catd, MS_ve, 199, "%s Could not acquire user notes semaphore '%s' " "within %d tries.\n"), PROGNAME " 199", OEF_notessem, NOTES_SEM_DELAY); @@ -503,9 +503,9 @@ int ve_append_notes (void) appendbufptr = entirebufptr + strlen (entirebufptr); time (&mystamp); time_ptr = _XLocaltime(&mystamp, localtime_buf); - strftime (mybuf, sizeof (mybuf), catgets (dtsearch_catd, MS_ve, 332, + strftime (mybuf, sizeof (mybuf), CATGETS(dtsearch_catd, MS_ve, 332, "%Y/%m/%d at %H:%M %Z"), time_ptr); - sprintf (appendbufptr, catgets (dtsearch_catd, MS_ve, 333, + sprintf (appendbufptr, CATGETS(dtsearch_catd, MS_ve, 333, "\n \n"), usrblk.userid, mybuf); strcat (appendbufptr, usrblk.query); /* now add user's text */ @@ -544,7 +544,7 @@ int ve_append_notes (void) /* Also append the note to the backup flat file */ if ((backup_file = fopen (OEF_notesnot, "at ")) == NULL) { sprintf (mybuf, - catgets (dtsearch_catd, MS_ve, 230, + CATGETS(dtsearch_catd, MS_ve, 230, "%s Could not open user notes backup file '%s': %s."), PROGNAME " 230", OEF_notesnot, strerror (errno)); DtSearchAddMessage (mybuf); @@ -713,7 +713,7 @@ int ve_getrec_dba (LLIST ** bloblist) /* Test for invalid dba */ if (dba == NULL_DBA) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_ve, 157, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_ve, 157, PROGNAME "245 Client Program Error: " "Null database address in usrblk.dba.")); OE_flags |= OE_PERMERR; @@ -727,7 +727,7 @@ int ve_getrec_dba (LLIST ** bloblist) */ d_crset (&dba, vistano); if (db_status == S_INVADDR) { - sprintf (msgbuf, catgets (dtsearch_catd, MS_ve, 142, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_ve, 142, "%s Client Error: Requested record with invalid\n" " database addr %ld (%d:%ld, x'%08.8lx') for database '%s'."), PROGNAME "142 ", dba, dba >> 24, dba & 0xffffff, dba, usrblk.dblk->label); @@ -951,7 +951,7 @@ DtSrINT32 ve_reckey2dba (void) if (usrblk.query == NULL) { null_query = TRUE; usrblk.query = ""; - DtSearchAddMessage (catgets (dtsearch_catd, MS_ve, 398, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_ve, 398, PROGNAME "398 NULL query string.")); } if (strncmp (usrblk.query, debugkey, strlen (debugkey)) == 0) { diff --git a/cde/lib/DtSearch/globals.c b/cde/lib/DtSearch/globals.c index c0bf71a9f..f3baf4008 100644 --- a/cde/lib/DtSearch/globals.c +++ b/cde/lib/DtSearch/globals.c @@ -58,7 +58,7 @@ #define _XOPEN_SOURCE #endif #include -#include +#include
FILE *aa_stderr = NULL; char *aa_argv0 = ""; diff --git a/cde/lib/DtSearch/hdecode.c b/cde/lib/DtSearch/hdecode.c index d843617e0..54252029e 100644 --- a/cde/lib/DtSearch/hdecode.c +++ b/cde/lib/DtSearch/hdecode.c @@ -139,13 +139,13 @@ void hc_decode ( /* Create hctree from external file? */ if (hctree == NULL) { if ((hdecode_filebuf = malloc (HDEC_FBUFSZ)) == NULL) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_huff, 10, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_huff, 10, "%s Out of Memory.\n"), PROGNAME"076"); DtSearchExit (2); } if ((hdecode_file = fopen (hctree_name, "r")) == NULL) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_huff, 11, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_huff, 11, "%s Cannot open tree file '%s': %s\n"), PROGNAME"082", hctree_name, strerror (errno)); DtSearchExit (2); @@ -171,7 +171,7 @@ void hc_decode ( } for (i = 0; i <= hctree_root; i++) { if ((fgets (hdecode_filebuf, HDEC_FBUFSZ, hdecode_file)) == NULL) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_huff, 12, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_huff, 12, "%s Invalid format hctree '%s'.\n"), PROGNAME"106", hctree_name); DtSearchExit (2); @@ -195,7 +195,7 @@ void hc_decode ( if (encode_id != hctree_id) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_huff, 13, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_huff, 13, "%s Incompatible hctree_ids.\n"), PROGNAME"118"); DtSearchExit (2); diff --git a/cde/lib/DtSearch/hencode.c b/cde/lib/DtSearch/hencode.c index 5b42a318b..43318ad28 100644 --- a/cde/lib/DtSearch/hencode.c +++ b/cde/lib/DtSearch/hencode.c @@ -102,7 +102,7 @@ void gen_vec (char *fname_huffcode_tab) _Xstrtokparams strtok_buf; if ((tab_stream = fopen (fname_huffcode_tab, "r")) == NULL) { - printf (catgets(dtsearch_catd, MS_huff, 1, + printf (CATGETS(dtsearch_catd, MS_huff, 1, "%s: Cannot open huffman encode file '%s':\n" " %s\n Exit Code = 2\n"), PROGNAME"222", fname_huffcode_tab, strerror (errno)); diff --git a/cde/lib/DtSearch/jpn.c b/cde/lib/DtSearch/jpn.c index 286c0ef11..08629f723 100644 --- a/cde/lib/DtSearch/jpn.c +++ b/cde/lib/DtSearch/jpn.c @@ -731,7 +731,7 @@ ENTIRE_SUBSTR_IS_WORD: } /* end state switch */ /* Should never get here... */ - fprintf (aa_stderr, catgets(dtsearch_catd, MS_lang, 20, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_lang, 20, "%s Program Error: Unknown jstate %d.\n") , PROGNAME"246", last_jstate); DtSearchExit (46); @@ -865,7 +865,7 @@ FILL_ANOTHER_SUBSTRING: fputs ("jpnparser: js=ETX\n", aa_stderr); if (add_msgs) { char msgbuf [DtSrMAXWIDTH_HWORD + 100]; - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 21, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 21, "%s '%.*s' is not a valid Japanese word.") , PROGNAME"812", DtSrMAXWIDTH_HWORD, save_parg_string); DtSearchAddMessage (msgbuf); @@ -980,7 +980,7 @@ static int load_jpntree ( } else { sprintf (sprintbuf, - catgets (dtsearch_catd, MS_misc, 362, "%s: %s: %s."), + CATGETS(dtsearch_catd, MS_misc, 362, "%s: %s: %s."), PROGNAME"362", fname, strerror(errno)); DtSearchAddMessage (sprintbuf); return 2; @@ -1010,7 +1010,7 @@ static int load_jpntree ( /* Test for word too short */ if (strlen((char*)readbuf) < 4) { - sprintf (sprintbuf, catgets(dtsearch_catd, MS_lang, 23, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_lang, 23, "%s Word '%s' on line %ld is too short.") , PROGNAME"1074", readbuf, linecount); DtSearchAddMessage (sprintbuf); @@ -1043,7 +1043,7 @@ static int load_jpntree ( /* Test for duplicate word */ if (i == 0) { sprintf (sprintbuf, - catgets (dtsearch_catd, MS_misc, 423, + CATGETS(dtsearch_catd, MS_misc, 423, "%s Word '%s' in '%s' is a duplicate."), PROGNAME"423", readbuf, fname); DtSearchAddMessage (sprintbuf); @@ -1090,7 +1090,7 @@ static int load_jpntree ( fprintf (aa_stderr, PROGNAME"1185 load '%s' unsuccessful, %d comments discarded.\n", fname, comment_count); - sprintf (sprintbuf, catgets(dtsearch_catd, MS_lang, 24, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_lang, 24, "%s No Japanese words in word file '%s'.") , PROGNAME"1186", fname); DtSearchAddMessage (sprintbuf); @@ -1154,7 +1154,7 @@ int load_jpn_language (DBLK *dblk, DBLK *dblist) path[0] = 0; else { if (strlen (dblk->path) > _POSIX_PATH_MAX - 14) { - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 25, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 25, "%s Database '%s' path too long: '%s'.") , PROGNAME"759", dblk->name, dblk->path); DtSearchAddMessage (msgbuf); diff --git a/cde/lib/DtSearch/lang.c b/cde/lib/DtSearch/lang.c index 006726978..5b2ff3f5c 100644 --- a/cde/lib/DtSearch/lang.c +++ b/cde/lib/DtSearch/lang.c @@ -335,7 +335,7 @@ char *teskey_parser (PARG *parg) is_hiliting = (parg->flags & PA_HILITING); add_msgs = (parg->flags & PA_MSGS); if (charmap == NULL) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_lang, 4, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_lang, 4, "%s dblk not initialized.\n"), PROGNAME"801"); DtSearchExit (55); @@ -350,7 +350,7 @@ char *teskey_parser (PARG *parg) cofunction = (READCFP) readchar_ftext; } else { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_lang, 5, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_lang, 5, "%s Program Error: parg contains neither file nor string.\n"), PROGNAME"327"); DtSearchExit (27); @@ -444,7 +444,7 @@ READ_ANOTHER_WORD: candidate_offset-1, outbuf); if (add_msgs) { char msgbuf [DtSrMAXWIDTH_HWORD + 100]; - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 8, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 8, "%s '%.*s...' is larger\n" "than the maximum word size of database '%s'.") , PROGNAME"449", maxwordsz, @@ -503,7 +503,7 @@ READ_ANOTHER_WORD: /*------------- UNKNOWN State ------------*/ else { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_lang, 10, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_lang, 10, "%s Program Error: Unknown parser state.\n"), PROGNAME"306"); DtSearchExit (26); @@ -516,7 +516,7 @@ READ_ANOTHER_WORD: fprintf (aa_stderr, "teskey: etx\n"); if (add_msgs) { char msgbuf [200]; - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 12, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 12, "%s '%.120s' is not a valid word in database '%s'.") , PROGNAME"506", parg->string, dblk->label); DtSearchAddMessage (msgbuf); @@ -553,7 +553,7 @@ READ_ANOTHER_WORD: fprintf (aa_stderr, ", (TOO SHORT, min %d)\n", minwordsz); if (add_msgs) { char msgbuf [200]; - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 17, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 17, "%s '%s' is less than the\n" "minimum word size of database '%s'.") , PROGNAME"543", parg->string, dblk->label); @@ -570,7 +570,7 @@ READ_ANOTHER_WORD: fprintf (aa_stderr, ", (STOP LIST)\n"); if (add_msgs) { char msgbuf [200]; - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 19, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 19, "%s The word '%s' is not indexed in database '%s'.") , PROGNAME"558", parg->string, dblk->label); DtSearchAddMessage (msgbuf); @@ -666,7 +666,7 @@ int load_wordtree ( } else { sprintf (sprintbuf, - catgets (dtsearch_catd, MS_misc, 362, "%s: %s: %s."), + CATGETS(dtsearch_catd, MS_misc, 362, "%s: %s: %s."), PROGNAME"362", fname, strerror(errno)); DtSearchAddMessage (sprintbuf); return 2; @@ -694,7 +694,7 @@ int load_wordtree ( /* If requested confirm all chars are teskey-concordable. */ if (do_teskey_test) if (!is_concordable (token, dblk->charmap)) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_misc, 400, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_misc, 400, "%s: %s, line %ld: Invalid chars in word '%s'."), PROGNAME"400", fname, linecount, token); DtSearchAddMessage (sprintbuf); @@ -723,7 +723,7 @@ int load_wordtree ( /* test for duplicate word */ if (i == 0) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_misc, 423, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_misc, 423, "%s Word '%s' in '%s' is a duplicate."), PROGNAME"423", token, fname); DtSearchAddMessage (sprintbuf); @@ -920,7 +920,7 @@ static int load_include_list (DBLK *dblk, DBLK *dblist) } else { sprintf (sprintbuf, - catgets (dtsearch_catd, MS_misc, 362, "%s: %s: %s."), + CATGETS(dtsearch_catd, MS_misc, 362, "%s: %s: %s."), PROGNAME"1218", dblk->fname_inc, strerror(ENOENT)); DtSearchAddMessage (sprintbuf); return FALSE; @@ -1011,7 +1011,7 @@ static int load_stop_list (DBLK *dblk, DBLK *dblist) i = load_wordtree (&dblk->stoplist, dblk, dblk->fname_stp, TRUE); if (i == 1) { sprintf (sprintbuf, - catgets (dtsearch_catd, MS_misc, 362, "%s: %s: %s"), + CATGETS(dtsearch_catd, MS_misc, 362, "%s: %s: %s"), PROGNAME"1270", dblk->fname_stp, strerror(ENOENT)); DtSearchAddMessage (sprintbuf); } @@ -1149,7 +1149,7 @@ static int load_paice_suffixes (DBLK *dblk, DBLK *dblist) fp = fopen (dblk->fname_sfx, "rt"); if (fp == NULL) { sprintf (msgbuf, - catgets (dtsearch_catd, MS_misc, 362, "%s: %s: %s."), + CATGETS(dtsearch_catd, MS_misc, 362, "%s: %s: %s."), PROGNAME"181", dblk->fname_sfx, strerror(errno)); DtSearchAddMessage (msgbuf); dblk->fname_sfx = NULL; @@ -1192,7 +1192,7 @@ static int load_paice_suffixes (DBLK *dblk, DBLK *dblist) /* OPTIONAL TOKEN #2: if next token '*', set 'intact' flag */ if ((token = (UCHAR *)_XStrtok(NULL, SFX_DELIMS, strtok_buf)) == NULL) { BAD_RULE: - sprintf (msgbuf, catgets(dtsearch_catd, MS_lang, 51, + sprintf (msgbuf, CATGETS(dtsearch_catd, MS_lang, 51, "%s %s, Line %d: Invalid Paice Rule for suffix '%s'.") , PROGNAME"898", dblk->fname_sfx, lineno, suffix); DtSearchAddMessage (msgbuf); @@ -1398,7 +1398,7 @@ static char *paice_stemmer (char *wordin, DBLK *dblk) return ""; if ((rules_table = (PRULE **)dblk->stem_extra) == NULL) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_lang, 31, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_lang, 31, "%s Stemmer suffixes file never loaded.\n"), PROGNAME"310"); DtSearchExit (2); diff --git a/cde/lib/DtSearch/mrclean.c b/cde/lib/DtSearch/mrclean.c index 05855a68e..384979680 100644 --- a/cde/lib/DtSearch/mrclean.c +++ b/cde/lib/DtSearch/mrclean.c @@ -963,9 +963,9 @@ aa_argv0 = argv[0]; time (&starttime); time_ptr = _XLocaltime(&starttime, localtime_buf); strftime (dbfpath, sizeof (dbfpath), /* just use any ol' buffer */ - catgets (dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), time_ptr); - printf (catgets (dtsearch_catd, MS_misc, 23, + printf (CATGETS(dtsearch_catd, MS_misc, 23, "%s: Version %s%s. Run %s.\n"), aa_argv0, AUSAPI_VERSION, betabuf, dbfpath); diff --git a/cde/lib/DtSearch/msgutil.c b/cde/lib/DtSearch/msgutil.c index 48d27fe9e..f7da85ced 100644 --- a/cde/lib/DtSearch/msgutil.c +++ b/cde/lib/DtSearch/msgutil.c @@ -122,7 +122,7 @@ char *nowstring (time_t * now) } time_ptr = _XLocaltime(now, localtime_buf); strftime (buf, sizeof (buf), - catgets (dtsearch_catd, MS_misc, 2, "%Y/%m/%d,%H:%M:%S"), + CATGETS(dtsearch_catd, MS_misc, 2, "%Y/%m/%d,%H:%M:%S"), time_ptr); return buf; } /* nowstring() */ @@ -342,8 +342,8 @@ void *austext_malloc (size_t size, char *location, void *ignore) ptr = ((aa_argv0) ? aa_argv0 : ""); if (location == NULL) - location = catgets (dtsearch_catd, MS_misc, 1, ""); - outofmem_msg = catgets (dtsearch_catd, MS_misc, 3, + location = CATGETS(dtsearch_catd, MS_misc, 1, ""); + outofmem_msg = CATGETS(dtsearch_catd, MS_misc, 3, "*** %sOut of Memory at %s asking for %lu bytes! ***\n"); fprintf (aa_stderr, outofmem_msg, ptr, location, size); fflush (aa_stderr); diff --git a/cde/lib/DtSearch/ocf.c b/cde/lib/DtSearch/ocf.c index 56ce7ae65..a56b84689 100644 --- a/cde/lib/DtSearch/ocf.c +++ b/cde/lib/DtSearch/ocf.c @@ -287,7 +287,7 @@ static int read_database (char *keyword, _Xstrtokparams *strtok_buf) if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 477, + CATGETS(dtsearch_catd, MS_loadocf, 477, "%s %s: Missing database name after '%s' keyword.\n"), PROGNAME"477", cfgfname, keyword); DtSearchAddMessage (sprintbufp); @@ -297,7 +297,7 @@ static int read_database (char *keyword, _Xstrtokparams *strtok_buf) if (strlen (token) > 8) { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 184, + CATGETS(dtsearch_catd, MS_loadocf, 184, "%s %s: More than 8 characters in Database name '%.16s'.\n"), PROGNAME"184", cfgfname, token); DtSearchAddMessage (sprintbufp); @@ -346,7 +346,7 @@ static void set_boolbit (long *flagvar, long mask, char *flagname, *flagvar &= ~mask; /* switch OFF */ else { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 352, + CATGETS(dtsearch_catd, MS_loadocf, 352, "%s %s: Invalid %s value, line ignored.\n"), PROGNAME"352", cfgfname, flagname); DtSearchAddMessage (sprintbufp); @@ -366,9 +366,9 @@ static void set_int (int *intvar, char *keyword, _Xstrtokparams *strtok_buf) int myint; if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { - token = catgets (dtsearch_catd, MS_loadocf, 140, "(missing)"); + token = CATGETS(dtsearch_catd, MS_loadocf, 140, "(missing)"); ERR_MSG: - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 610, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 610, "%s %s: %s value is '%s'. " "Should be positive integer. Line ignored."), PROGNAME"844", cfgfname, keyword, token); @@ -393,9 +393,9 @@ static void set_long (long *longvar, char *keyword, long longi; if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { - token = catgets (dtsearch_catd, MS_loadocf, 140, "(missing)"); + token = CATGETS(dtsearch_catd, MS_loadocf, 140, "(missing)"); ERR_MSG: - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 610, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 610, "%s %s: %s value is '%s'. " "Should be positive integer. Line ignored."), PROGNAME"610", cfgfname, keyword, token); @@ -427,7 +427,7 @@ static void set_boolint (int *boolint, char *keyword, *boolint = FALSE; /* switch OFF */ else { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 352, + CATGETS(dtsearch_catd, MS_loadocf, 352, "%s %s: Invalid %s value, line ignored.\n"), PROGNAME"352", cfgfname, keyword); DtSearchAddMessage (sprintbufp); @@ -464,7 +464,7 @@ static void set_fileio (_Xstrtokparams *strtok_buf) else if (strcmp (token, "-HOME") == 0) OE_fileio = "-HOME"; else { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 607, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 607, "%s %s: Invalid FILEIO value. " "User file reads and writes prohibited."), PROGNAME"607", cfgfname); @@ -487,7 +487,7 @@ static void read_rest_of_line (char *keyword, char **passed_ptr, _Xstrtokparams *strtok_buf) { if ((token = _XStrtok(NULL, "\n", *strtok_buf)) == NULL) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 1007, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 1007, "%s%s: Empty %s string ignored."), PROGNAME"1007 ", cfgfname, keyword); DtSearchAddMessage (sprintbufp); @@ -515,12 +515,12 @@ static void read_filepath (_Xstrtokparams *strtok_buf) * Set tabx to matching oef table entry. */ if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { - token = catgets (dtsearch_catd, MS_loadocf, 142, "rest of line"); - errp = catgets (dtsearch_catd, MS_loadocf, 143, "is empty"); + token = CATGETS(dtsearch_catd, MS_loadocf, 142, "rest of line"); + errp = CATGETS(dtsearch_catd, MS_loadocf, 143, "is empty"); IGNORE_FILEPATH: sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 903, + CATGETS(dtsearch_catd, MS_loadocf, 903, "%s %s: FILEPATH '%s' %s. Line ignored."), PROGNAME"903", cfgfname, token, errp); DtSearchAddMessage (sprintbufp); @@ -532,11 +532,11 @@ IGNORE_FILEPATH: break; } if (oef_table[tabx].id == NULL) { - errp = catgets (dtsearch_catd, MS_loadocf, 165, "unknown id"); + errp = CATGETS(dtsearch_catd, MS_loadocf, 165, "unknown id"); goto IGNORE_FILEPATH; } if (oef_table[tabx].previously_specified) { - errp = catgets (dtsearch_catd, MS_loadocf, 166, "previously specified"); + errp = CATGETS(dtsearch_catd, MS_loadocf, 166, "previously specified"); goto IGNORE_FILEPATH; } @@ -545,7 +545,7 @@ IGNORE_FILEPATH: */ if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { token = oef_table[tabx].id; - errp = catgets (dtsearch_catd, MS_loadocf, 168, + errp = CATGETS(dtsearch_catd, MS_loadocf, 168, "missing path specification"); goto IGNORE_FILEPATH; } @@ -586,7 +586,7 @@ static void read_path (_Xstrtokparams *strtok_buf) /* parse the path for this dictionary/database */ if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 221, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 221, "%s %s: Database '%s', No PATH specified, statement ignored.\n"), PROGNAME"221", cfgfname, db->name); DtSearchAddMessage (sprintbufp); @@ -607,7 +607,7 @@ static void read_path (_Xstrtokparams *strtok_buf) /* append warning msg: passed keyword no longer used */ static void obsolete_keyword (char *keyword) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 1, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 1, "%1$s%2$s: %3$s keyword is obsolete."), PROGNAME "001 ", cfgfname, keyword); DtSearchAddMessage (sprintbufp); @@ -632,7 +632,7 @@ static void read_maxhits (_Xstrtokparams *strtok_buf) if ((token = _XStrtok(NULL, DELIMITERS, *strtok_buf)) == NULL) { INVALID_MAXHITS: sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 304, + CATGETS(dtsearch_catd, MS_loadocf, 304, "%s %s: Database '%s', invalid MAXHITS value.\n"), PROGNAME"304", cfgfname, db->name); DtSearchAddMessage (sprintbufp); @@ -672,7 +672,7 @@ static int add_a_keytype (char ktchar) /* Make sure we have not exceeded max number of keytypes */ if (db->ktcount >= MAX_KTCOUNT) { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 732, + CATGETS(dtsearch_catd, MS_loadocf, 732, "%s %s: Database '%s', No more than %d keytypes allowed.\n"), PROGNAME"732", cfgfname, db->name, MAX_KTCOUNT); DtSearchAddMessage (sprintbufp); @@ -685,7 +685,7 @@ static int add_a_keytype (char ktchar) if (!isprint (ktchar)) ktchar = '?'; sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 684, + CATGETS(dtsearch_catd, MS_loadocf, 684, "%s %s: Database '%s',\n Invalid KEYTYPE character '%c'."), PROGNAME"684", cfgfname, db->name, ktchar); DtSearchAddMessage (sprintbufp); @@ -698,7 +698,7 @@ static int add_a_keytype (char ktchar) for (i = 0; i < db->ktcount; i++) if (ktchar == kt[i].ktchar) { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 1002, + CATGETS(dtsearch_catd, MS_loadocf, 1002, "%s %s: Database '%s', Duplicate KEYTYPE character '%c'.\n"), PROGNAME"1002", cfgfname, db->name, ktchar); DtSearchAddMessage (sprintbufp); @@ -716,12 +716,12 @@ static int add_a_keytype (char ktchar) kt[newindex].is_selected = TRUE; kt[newindex].ktchar = ktchar; sprintf (kt[newindex].name, - catgets (dtsearch_catd, MS_loadocf, 457, "'%c' Records"), ktchar); + CATGETS(dtsearch_catd, MS_loadocf, 457, "'%c' Records"), ktchar); /* Warn about inaccessible lowercase ktchars */ if ( ((ascii_charmap[ktchar] & 0xff) != ktchar) && OE_uppercase_keys ) { sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 1011, + CATGETS(dtsearch_catd, MS_loadocf, 1011, "%s %s: Database '%s': Records with lowercase\n" " KEYTYPE character '%c' will be inaccessible.\n" " Set UPPERKEYS = FALSE if lowercase keys are intended."), @@ -870,7 +870,7 @@ GOT_FULLNAME: */ if (fptr == NULL) { if (errno != ENOENT || is_prespecified_fname) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 414, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 414, "%s Unable to open configuration file '%s':\n %s."), PROGNAME"414", fullname, strerror(errno)); DtSearchAddMessage (sprintbufp); @@ -885,7 +885,7 @@ GOT_FULLNAME: strcpy (OE_sitecnfg_fname, fullname); } if (fstat (fileno (fptr), &statbuf) == -1) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 1404, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 1404, "%s Status unavailable for configuration file '%s': %s"), PROGNAME"1404", fullname, strerror(errno)); DtSearchAddMessage (sprintbufp); @@ -1014,7 +1014,7 @@ int load_ocf (void) goto OCFOPEN_OK; /* If we can't find site config on OE side we must quit. */ - sprintf (sprintbuf, catgets (dtsearch_catd, MS_loadocf, 1643, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_loadocf, 1643, "%1$sCannot find or open '%2$s'\n" " configuration file in any of the following locations:\n" " DTSROCFPATH directory = %3$s,\n" @@ -1025,16 +1025,16 @@ int load_ocf (void) ) ,PROGNAME "1643 " ,FNAME_SITECONFIG - ,(p) ? p : catgets (dtsearch_catd, MS_misc, 16, + ,(p) ? p : CATGETS(dtsearch_catd, MS_misc, 16, "") ,inbuf - ,(q) ? q : catgets (dtsearch_catd, MS_misc, 16, + ,(q) ? q : CATGETS(dtsearch_catd, MS_misc, 16, "") ,(OE_inittab_dir) ? OE_inittab_dir : - catgets (dtsearch_catd, MS_misc, 17, + CATGETS(dtsearch_catd, MS_misc, 17, "") ,(OE_server_dir) ? OE_server_dir : - catgets (dtsearch_catd, MS_misc, 17, + CATGETS(dtsearch_catd, MS_misc, 17, "") ); DtSearchAddMessage (sprintbuf); @@ -1130,7 +1130,7 @@ OCFOPEN_OK: /* if we made it this far, the first token is unknown */ sprintf (sprintbufp, - catgets (dtsearch_catd, MS_loadocf, 495, + CATGETS(dtsearch_catd, MS_loadocf, 495, "%s %s: '%.16s' is invalid keyword.\n"), PROGNAME"495", cfgfname, token); DtSearchAddMessage (sprintbufp); @@ -1149,7 +1149,7 @@ OCFOPEN_OK: * in site config file, remove the dblk and mark fatal error. */ if (usrblk.dblist == NULL) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 1869, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 1869, "%s %s: Configuration file must specify at least one database."), PROGNAME"1869", cfgfname); DtSearchAddMessage (sprintbufp); @@ -1158,7 +1158,7 @@ OCFOPEN_OK: else for (db = usrblk.dblist; db != NULL; db = db->link) { if (db->ktcount <= 0) { - sprintf (sprintbufp, catgets (dtsearch_catd, MS_loadocf, 986, + sprintf (sprintbufp, CATGETS(dtsearch_catd, MS_loadocf, 986, "%s %s: KEYTYPES missing for database '%s'."), PROGNAME"986", cfgfname, db->name); DtSearchAddMessage (sprintbufp); diff --git a/cde/lib/DtSearch/opendblk.c b/cde/lib/DtSearch/opendblk.c index 4e41903c3..b4db2be61 100644 --- a/cde/lib/DtSearch/opendblk.c +++ b/cde/lib/DtSearch/opendblk.c @@ -135,7 +135,7 @@ int open_dblk (DBLK ** dblist, int numpages, int debugging) db_oflag); if (dblist == NULL || numpages < 8) { BAD_INPUT: - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 99, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 99, "%s Programming Error: Invalid input to open_dblk()."), PROGNAME "99"); DtSearchAddMessage (sprintbuf); @@ -192,14 +192,14 @@ BAD_INPUT: if (debugging) fprintf (aa_stderr, PROGNAME "129 UNLINK: cant open '%s'.\n", temp_file_name); - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 317, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 317, "%s Cannot open database file '%s'.\n" " Errno %d = %s\n" " %s is removing '%s' from list of available databases."), PROGNAME "317", temp_file_name, errno, strerror (errno), OE_prodname, db->name); if (errno == ENOENT) - strcat (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 318, + strcat (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 318, "\n This can usually be corrected by specifying a valid\n" " database PATH in the site configuration file.")); DtSearchAddMessage (sprintbuf); @@ -216,7 +216,7 @@ BAD_INPUT: fprintf (aa_stderr, PROGNAME "149 UNLINK: cant get status '%s'.\n", temp_file_name); - sprintf (sprintbuf, catgets (dtsearch_catd, MS_oeinit, 1404, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_oeinit, 1404, "%s Removing database '%s' from list of " "available databases because status is " "unavailable for file %s: %s"), @@ -252,7 +252,7 @@ DELETE_DB: /* quit if no dblks remain */ if (vistano <= 0) { - sprintf (sprintbuf, catgets (dtsearch_catd, MS_misc, 8, + sprintf (sprintbuf, CATGETS(dtsearch_catd, MS_misc, 8, "%s No valid databases remain."), PROGNAME "265"); DtSearchAddMessage (sprintbuf); return FALSE; @@ -283,7 +283,7 @@ DELETE_DB: if (db_status != S_OKAY) { targptr = austext_malloc (totlen + 128, PROGNAME"239", NULL); - sprintf (targptr, catgets (dtsearch_catd, MS_vista, 378, + sprintf (targptr, CATGETS(dtsearch_catd, MS_vista, 378, "%s Could not open following database name string:\n '%s'"), PROGNAME"378", allnames); DtSearchAddMessage (targptr); diff --git a/cde/lib/DtSearch/vestatis.c b/cde/lib/DtSearch/vestatis.c index 82c73cdbf..038bf7f39 100644 --- a/cde/lib/DtSearch/vestatis.c +++ b/cde/lib/DtSearch/vestatis.c @@ -184,14 +184,14 @@ void release_shm_mem (void) { if (global_memory_ptr != NULL) { if (shmdt (global_memory_ptr) == -1) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_vestatis, 104, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_vestatis, 104, PROGNAME "104 Cannot detach shared memory ")); OE_flags |= OE_PERMERR; usrblk.retncode = OE_ABORT; return; } if (shmctl (shm_id, IPC_RMID, NULL) == -1) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_vestatis, 110, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_vestatis, 110, PROGNAME "110 Cannot remove shared memory ")); OE_flags |= OE_PERMERR; usrblk.retncode = OE_ABORT; @@ -224,7 +224,7 @@ static int init_global_memory (DtSrINT32 addrs, DtSrINT32 r_addrs) shm_id = shmget (IPC_PRIVATE, k, SHM_FLAG); if ((global_memory_ptr = (char *) shmat (shm_id, (char *) 0, 0)) == ((char *) -1)) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_vestatis, 115, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_vestatis, 115, PROGNAME "115 No shared memory available")); OE_flags |= OE_PERMERR; usrblk.retncode = OE_ABORT; @@ -404,7 +404,7 @@ int efim_qsort (void) sptr++; if (sptr == STACKSZ) { - fputs (catgets (dtsearch_catd, MS_vestatis, 107, + fputs (CATGETS(dtsearch_catd, MS_vestatis, 107, PROGNAME "107 Qsort stack overflow.\n"), aa_stderr); OE_flags |= OE_PERMERR; @@ -433,7 +433,7 @@ int efim_qsort (void) sptr++; if (sptr == STACKSZ) { - fputs (catgets (dtsearch_catd, MS_vestatis, 107, + fputs (CATGETS(dtsearch_catd, MS_vestatis, 107, PROGNAME "107 Qsort stack overflow.\n"), aa_stderr); OE_flags |= OE_PERMERR; @@ -630,7 +630,7 @@ void get_next_memory_block (size_t node_size) mem_offset += node_size; cur_pos = mem_start; if (mem_start == NULL) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_vestatis, 310, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_vestatis, 310, "%s Out of Memory. Need %ld bytes.\n"), PROGNAME "310", total_memory_size); OE_flags |= OE_PERMERR; @@ -645,7 +645,7 @@ void get_next_memory_block (size_t node_size) memory_blocks = (CNCRD_MEMORY_AREA_LIST *) malloc (sizeof (CNCRD_MEMORY_AREA_LIST) + 2); if (memory_blocks == NULL) { - fputs (catgets (dtsearch_catd, MS_vestatis, 314, + fputs (CATGETS(dtsearch_catd, MS_vestatis, 314, PROGNAME"314 Out of Memory.\n"), aa_stderr); OE_flags |= OE_PERMERR; usrblk.retncode = OE_ABORT; @@ -761,7 +761,7 @@ void init_memory (void) { mem_start = (char *) malloc (MEMORY_SIZE); if (mem_start == NULL) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_vestatis, 310, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_vestatis, 310, "%s Out of Memory. Need %ld bytes.\n"), PROGNAME "310", MEMORY_SIZE); OE_flags |= OE_PERMERR; usrblk.retncode = OE_ABORT; @@ -778,7 +778,7 @@ void init_memory (void) memory_blocks = (CNCRD_MEMORY_AREA_LIST *) malloc (sizeof (CNCRD_MEMORY_AREA_LIST) + 2); if (memory_blocks == NULL) { - fputs (catgets (dtsearch_catd, MS_vestatis, 314, + fputs (CATGETS(dtsearch_catd, MS_vestatis, 314, PROGNAME "314 Out of Memory.\n"), aa_stderr); OE_flags |= OE_PERMERR; usrblk.retncode = OE_ABORT; @@ -1008,7 +1008,7 @@ void load_ditto_str (void) */ d_crset (&dba1, saveusr.vistano); if (db_status < 0) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_vestatis, 437, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_vestatis, 437, "%s: db_status = %d, dba = %d:%ld (x'%08.8lx'), vistano = %d\n"), PROGNAME "437", db_status, (dba1 & 0xff000000) >> 24, dba1 & 0xffffff, dba1, saveusr.vistano); @@ -1019,7 +1019,7 @@ void load_ditto_str (void) } d_recread (&cur_rec, saveusr.vistano); if (db_status < 0) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_vestatis, 437, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_vestatis, 437, "%s: db_status = %d, dba = %d:%ld (x'%08.8lx'), vistano = %d\n"), PROGNAME "437", db_status, (dba1 & 0xff000000) >> 24, dba1 & 0xffffff, dba1, saveusr.vistano); @@ -1047,7 +1047,7 @@ void load_ditto_str (void) else { cur_ditto_mem = malloc (dittosz); if (cur_ditto_mem == NULL) { - fputs ( catgets (dtsearch_catd, MS_vestatis, 504, + fputs ( CATGETS(dtsearch_catd, MS_vestatis, 504, PROGNAME "504 Cannot allocate cur_ditto\n"), aa_stderr); OE_flags |= OE_PERMERR; @@ -1150,7 +1150,7 @@ void load_ditto_str (void) if (num_hits >= maxhits) { if (!(usrblk.flags & USR_NO_INFOMSGS)) { - sprintf (vestat_msgbuf, catgets (dtsearch_catd, MS_vestatis, 421, + sprintf (vestat_msgbuf, CATGETS(dtsearch_catd, MS_vestatis, 421, "$s Total Number Hits = %ld. Discarded hits beyond maximum number specified."), PROGNAME "421", (long)num_hits); DtSearchAddMessage (vestat_msgbuf); @@ -1342,7 +1342,7 @@ static void stat_search (void) */ if (num_hits > SORT_MESG && !(usrblk.flags & USR_NO_ITERATE)) { if (!mes_search_box) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_vestatis, 990, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_vestatis, 990, PROGNAME"990 The system is now sorting. Please wait.")); } usrblk.retncode = OE_SEARCHING; @@ -1406,7 +1406,7 @@ void ve_statistical (void) /* stat_array size = 1 node for every possible object */ if (usrblk.query[0] == 0) { - DtSearchAddMessage (catgets (dtsearch_catd, MS_vestatis, + DtSearchAddMessage (CATGETS(dtsearch_catd, MS_vestatis, 677, PROGNAME "677 Query field is empty.")); usrblk.retncode = OE_BAD_QUERY; return; diff --git a/cde/lib/DtSvc/DtUtil2/DtGetMessage.c b/cde/lib/DtSvc/DtUtil2/DtGetMessage.c index ea67903ce..869dee448 100644 --- a/cde/lib/DtSvc/DtUtil2/DtGetMessage.c +++ b/cde/lib/DtSvc/DtUtil2/DtGetMessage.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include
#include "DtSvcLock.h" /***************************************************************************** @@ -79,7 +79,7 @@ Dt11GetMessage( _DtSvcProcessLock(); if ( NULL == nlmsg_filename || 0 != strcmp(nlmsg_filename, filename) ) { - nlmsg_fd = catopen(filename, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(filename, NL_CAT_LOCALE); if (nlmsg_filename) { free(nlmsg_filename); @@ -87,7 +87,7 @@ Dt11GetMessage( } nlmsg_filename = strdup(filename); } - msg=catgets(nlmsg_fd,set,n,s); + msg=CATGETS(nlmsg_fd,set,n,s); _DtSvcProcessUnlock(); return (msg); } diff --git a/cde/lib/DtSvc/DtUtil2/DtNlUtils.h b/cde/lib/DtSvc/DtUtil2/DtNlUtils.h index 6a20789c0..e57b8d698 100644 --- a/cde/lib/DtSvc/DtUtil2/DtNlUtils.h +++ b/cde/lib/DtSvc/DtUtil2/DtNlUtils.h @@ -34,13 +34,12 @@ /**************************************************************************/ #ifdef NLS16 - #include #include #include #include -#include #include +#include
#endif #include diff --git a/cde/lib/DtSvc/DtUtil2/GetMessage.c b/cde/lib/DtSvc/DtUtil2/GetMessage.c index b2804f120..10b2da479 100644 --- a/cde/lib/DtSvc/DtUtil2/GetMessage.c +++ b/cde/lib/DtSvc/DtUtil2/GetMessage.c @@ -45,7 +45,7 @@ ************************************<+>*************************************/ #include -#include +#include
#include "DtSvcLock.h" #if !defined(NL_CAT_LOCALE) @@ -80,8 +80,6 @@ _DtGetMessage( { char *msg; char *lang; - nl_catd catopen(); - char *catgets(); static int first = 1; static nl_catd nlmsg_fd; @@ -89,9 +87,9 @@ _DtGetMessage( if ( first ) { first = 0; - nlmsg_fd = catopen(filename, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(filename, NL_CAT_LOCALE); } - msg=catgets(nlmsg_fd,set,n,s); + msg=CATGETS(nlmsg_fd,set,n,s); _DtSvcProcessUnlock(); return (msg); } diff --git a/cde/lib/DtSvc/DtUtil2/MsgCat.c b/cde/lib/DtSvc/DtUtil2/MsgCat.c index dcd291d41..f34b8020b 100644 --- a/cde/lib/DtSvc/DtUtil2/MsgCat.c +++ b/cde/lib/DtSvc/DtUtil2/MsgCat.c @@ -37,11 +37,18 @@ #include #include -#include -#include -#include
-#include +#if defined(NO_XLIB) +#define _DtSvcProcessLock() +#define _DtSvcProcessUnlock() +#else +#include +#include +#endif /* NO_XLIB */ + +#include
+ +#if defined(hpV4) && !defined(NO_XLIB) typedef struct _dt_msg_cache { char ***cached_msgs; @@ -56,8 +63,8 @@ static _DtMsgCache *catalog_message_caches = NULL; static _DtMsgCache *get_msg_cache(nl_catd catd) { - #define INITIAL_NMSGS_PER_SET 300 - #define INITIAL_NSETS 50 + const int initial_nmsgs_per_set = 300; + const int initial_nsets = 50; _DtMsgCache *c; @@ -66,28 +73,23 @@ static _DtMsgCache *get_msg_cache(nl_catd catd) c = (_DtMsgCache*) XtMalloc(sizeof(_DtMsgCache)); c->cached_msgs = NULL; - c->nmsgs_per_set = INITIAL_NMSGS_PER_SET; - c->nsets = INITIAL_NSETS; + c->nmsgs_per_set = initial_nmsgs_per_set; + c->nsets = initial_nsets; c->catd = catd; c->next = catalog_message_caches; catalog_message_caches = c; return c; } - /* * Wrapper around catgets -- this makes sure the message string is saved * in a safe location; so repeated calls to catgets() do not overwrite * the catgets() internal buffer. This has been a problem on HP systems. */ -char *_DtCatgetsCached(nl_catd catd, int set, int num, char *dflt) +char *_DtCatgetsCached(nl_catd catd, int set, int num, const char *dflt) { - char *message; - -#if !defined(hpV4) - message = catgets(catd, set, num, dflt); -#else - _DtMsgCache *c; + char *message = NULL; + _DtMsgCache *c; char **setptr; int i, multiplier; int size; @@ -96,8 +98,6 @@ char *_DtCatgetsCached(nl_catd catd, int set, int num, char *dflt) int setIdx = set - 1; int numIdx = num - 1; - _DtSvcProcessLock(); - c = get_msg_cache(catd); if (NULL == c) { @@ -150,8 +150,32 @@ char *_DtCatgetsCached(nl_catd catd, int set, int num, char *dflt) message = setptr[numIdx]; - _DtSvcProcessUnlock(); -#endif /* hpV4 */ - return message; } +#endif /* hpV4 */ + +int _DtCatclose(nl_catd catd) +{ + return (catd == (nl_catd) -1) ? 0 : catclose(catd); +} + +char *_DtCatgets(nl_catd catd, int set, int num, const char *dflt) +{ + char *msg = NULL; + + if (catd == (nl_catd) -1 || set < 0 || num < 0) { + /* Some catgets() implementations will fault if catd is invalid. */ + msg = (char *) dflt; + } else { + /* Per POSIX, we cannot assume catgets() is thread-safe. */ + _DtSvcProcessLock(); +#if defined(hpV4) && !defined(NO_XLIB) + msg = _DtCatgetsCached(catd, set, num, dflt); +#else + msg = catgets(catd, set, num, dflt); +#endif /* hpV4 */ + _DtSvcProcessUnlock(); + } + + return msg; +} diff --git a/cde/lib/DtSvc/DtUtil2/MsgCatP.h b/cde/lib/DtSvc/DtUtil2/MsgCatP.h index bfbb9e609..60809a28f 100644 --- a/cde/lib/DtSvc/DtUtil2/MsgCatP.h +++ b/cde/lib/DtSvc/DtUtil2/MsgCatP.h @@ -44,7 +44,18 @@ extern "C" { #endif -extern char *_DtCatgetsCached(nl_catd catd, int set, int num, char *dflt); +#define CATOPEN(name,oflag) catopen(name,oflag) +#define CATCLOSE(catd) _DtCatclose(catd) +#define CATGETS(catd,set,num,dflt) _DtCatgets(catd,set,num,dflt) +extern char *_DtCatgets(nl_catd catd, int set, int num, const char *dflt); +extern int _DtCatclose(nl_catd catd); + +#if 0 /* TODO: Decide between !I18N_MSG and NO_MESSAGE_CATALOG */ +typedef int nl_catd; +#define CATOPEN(name,oflag) 0 +#define CATCLOSE(catd) 0 +#define CATGETS(catd,set,num,dflt) dflt +#endif #ifdef __cplusplus } diff --git a/cde/lib/DtSvc/DtUtil2/Setlocale.h b/cde/lib/DtSvc/DtUtil2/Setlocale.h index fd9358883..b45b096b7 100644 --- a/cde/lib/DtSvc/DtUtil2/Setlocale.h +++ b/cde/lib/DtSvc/DtUtil2/Setlocale.h @@ -41,7 +41,7 @@ #include #include -#include +#include
#include #include
diff --git a/cde/lib/DtSvc/include/bms/sbstdinc.h b/cde/lib/DtSvc/include/bms/sbstdinc.h index 17dc52093..6a5619176 100644 --- a/cde/lib/DtSvc/include/bms/sbstdinc.h +++ b/cde/lib/DtSvc/include/bms/sbstdinc.h @@ -52,7 +52,7 @@ #include #include #include -#include +#include
/************************************************************************/ /* Routines not defined in include files (yet). */ diff --git a/cde/lib/DtTerm/Term/Term.c b/cde/lib/DtTerm/Term/Term.c index f61097120..82fdedd82 100644 --- a/cde/lib/DtTerm/Term/Term.c +++ b/cde/lib/DtTerm/Term/Term.c @@ -48,7 +48,6 @@ static char *termWhatString = _DtTermPullInTermWhatString; #include "TermPrimRenderLineDraw.h" #include "TermPrimMessageCatI.h" #include "TermPrimSelectP.h" -#include static int TextInsertProc(Widget w, unsigned char *buffer, int length); diff --git a/cde/lib/DtTerm/TermPrim/TermPrim.c b/cde/lib/DtTerm/TermPrim/TermPrim.c index 9e064a76b..16053c2c3 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrim.c +++ b/cde/lib/DtTerm/TermPrim/TermPrim.c @@ -73,7 +73,7 @@ extern char * _DtTermPrimGetMessage( char *filename, int set, int n, char *s ); #include #include #include -#include +#include
#include #if defined(__linux__) || defined(hpV4) # include /* For FD_* macros. */ @@ -3776,10 +3776,10 @@ _DtTermPrimGetMessage( */ nlmsg_fd = (nl_catd) -1; else - nlmsg_fd = catopen(filename, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(filename, NL_CAT_LOCALE); } _DtTermProcessUnlock(); - msg=catgets(nlmsg_fd,set,n,s); + msg=CATGETS(nlmsg_fd,set,n,s); return (msg); } diff --git a/cde/lib/DtWidget/DtMsgs.c b/cde/lib/DtWidget/DtMsgs.c index 6d48c7573..0384fed4e 100644 --- a/cde/lib/DtWidget/DtMsgs.c +++ b/cde/lib/DtWidget/DtMsgs.c @@ -32,7 +32,7 @@ #ifdef I18N_MSG -#include +#include
#if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 @@ -329,8 +329,6 @@ _DtWidgetGetMessage(int set, char *s) { char *msg; - nl_catd catopen(); - char *catgets(); static int first = 1; static nl_catd nlmsg_fd; @@ -339,13 +337,13 @@ _DtWidgetGetMessage(int set, _DtProcessLock(); if ( first) { - nlmsg_fd = catopen(_DTWIDGET_CAT_NAME, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(_DTWIDGET_CAT_NAME, NL_CAT_LOCALE); first = 0; } _DtProcessUnlock(); } - msg=catgets(nlmsg_fd,set,n,s); + msg=CATGETS(nlmsg_fd,set,n,s); return (msg); } #endif /* I18N_MSG */ diff --git a/cde/lib/DtWidget/DtMsgsP.h b/cde/lib/DtWidget/DtMsgsP.h index 3f1397542..6933c7d57 100644 --- a/cde/lib/DtWidget/DtMsgsP.h +++ b/cde/lib/DtWidget/DtMsgsP.h @@ -40,7 +40,7 @@ #define CONST #ifdef I18N_MSG -#include +#include
#define DTWIDGET_GETMESSAGE(set, number, string)\ (char *) _DtWidgetGetMessage(set, number, string) diff --git a/cde/lib/pam/libpam/pam_framework_utils.c b/cde/lib/pam/libpam/pam_framework_utils.c index 5000e2b1a..b1e7bb06a 100644 --- a/cde/lib/pam/libpam/pam_framework_utils.c +++ b/cde/lib/pam/libpam/pam_framework_utils.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include
#include #include @@ -304,7 +304,7 @@ __pam_msg_cleanup( { _pam_msg_data *msg_data = (_pam_msg_data *) data; - catclose(msg_data->fd); + CATCLOSE(msg_data->fd); free(msg_data); } @@ -395,20 +395,20 @@ __pam_get_i18n_msg( int status = pam_get_data(pamh, filename, (void**) &msg_data); if (status == PAM_SUCCESS) { - return (catgets(msg_data->fd, set, n, s)); + return (CATGETS(msg_data->fd, set, n, s)); } if (status == PAM_NO_MODULE_DATA) { /* * No message file descriptor found, make and store one. */ - nlmsg_fd = catopen(filename, NL_CAT_LOCALE); - msg = catgets(nlmsg_fd, set, n, s); + nlmsg_fd = CATOPEN(filename, NL_CAT_LOCALE); + msg = CATGETS(nlmsg_fd, set, n, s); if ((msg_data = (_pam_msg_data *) calloc(1, sizeof (_pam_msg_data))) == NULL) { output_msg = __pam_thread_backup(msg); - catclose(nlmsg_fd); + CATCLOSE(nlmsg_fd); return (output_msg); } @@ -421,10 +421,10 @@ __pam_get_i18n_msg( /* NULL pamh */ - nlmsg_fd = catopen(filename, NL_CAT_LOCALE); - msg = catgets(nlmsg_fd, set, n, s); + nlmsg_fd = CATOPEN(filename, NL_CAT_LOCALE); + msg = CATGETS(nlmsg_fd, set, n, s); output_msg = __pam_thread_backup(msg); - catclose(nlmsg_fd); + CATCLOSE(nlmsg_fd); return (output_msg); } diff --git a/cde/lib/tt/bin/ttdbserverd/db_server_functions.C b/cde/lib/tt/bin/ttdbserverd/db_server_functions.C index d71b4f55f..9017abbd9 100644 --- a/cde/lib/tt/bin/ttdbserverd/db_server_functions.C +++ b/cde/lib/tt/bin/ttdbserverd/db_server_functions.C @@ -43,7 +43,6 @@ #include #include #include -#include #include "api/c/tt_c.h" #include "util/tt_file_system.h" diff --git a/cde/lib/tt/lib/util/tt_gettext.C b/cde/lib/tt/lib/util/tt_gettext.C index bce28adb4..17119d55c 100644 --- a/cde/lib/tt/lib/util/tt_gettext.C +++ b/cde/lib/tt/lib/util/tt_gettext.C @@ -103,7 +103,7 @@ _tt_gettext( #endif // OPT_DGETTEXT #if defined(OPT_CATGETS) -static char * +static const char * _tt__catgets( int set_num, int msg_num, @@ -111,13 +111,16 @@ _tt__catgets( ) { static nl_catd catalog = 0; - if (catalog == 0) { + if (catalog == (nl_catd) 0) { catalog = catopen( #if defined(OPT_BUG_AIX) (char *) #endif tt_err_domain, NL_CAT_LOCALE ); } + if (catalog == (nl_catd) -1) { + return default_string; + } return catgets( catalog, set_num, msg_num, #if defined(OPT_BUG_SUNOS_5) || defined(OPT_BUG_AIX) (char *) @@ -126,7 +129,7 @@ _tt__catgets( } #endif // OPT_CATGETS -char * +const char * _tt_catgets( int set_num, int msg_num, diff --git a/cde/lib/tt/slib/mp_s_mp.C b/cde/lib/tt/slib/mp_s_mp.C index 0a32e7f66..e60f0eff2 100644 --- a/cde/lib/tt/slib/mp_s_mp.C +++ b/cde/lib/tt/slib/mp_s_mp.C @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/cde/programs/dtaction/Main.c b/cde/programs/dtaction/Main.c index 72d977a09..222735725 100644 --- a/cde/programs/dtaction/Main.c +++ b/cde/programs/dtaction/Main.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include
#include #include #include /* for MAXPATHLEN and MAXHOSTNAMELEN */ diff --git a/cde/programs/dtaction/demo/dtactiondemo.c b/cde/programs/dtaction/demo/dtactiondemo.c index d1c71308d..f9e31468e 100644 --- a/cde/programs/dtaction/demo/dtactiondemo.c +++ b/cde/programs/dtaction/demo/dtactiondemo.c @@ -54,7 +54,7 @@ #include #include -#include +#include
#include #include diff --git a/cde/programs/dtappbuilder/src/ab/ab.h b/cde/programs/dtappbuilder/src/ab/ab.h index f1456a8d2..f2ee4d167 100644 --- a/cde/programs/dtappbuilder/src/ab/ab.h +++ b/cde/programs/dtappbuilder/src/ab/ab.h @@ -47,11 +47,11 @@ #define _AB_H_ #include -#include /* Necessary for message I18N */ #include #include #include -#include
/* for version information */ +#include
/* for version information */ +#include
/* for message I18N */ #define MODE_BUILD 1 diff --git a/cde/programs/dtappbuilder/src/ab/ab_bil.c b/cde/programs/dtappbuilder/src/ab/ab_bil.c index cc76f20b1..097b9a07c 100644 --- a/cde/programs/dtappbuilder/src/ab/ab_bil.c +++ b/cde/programs/dtappbuilder/src/ab/ab_bil.c @@ -164,7 +164,7 @@ ab_load_bil_file( /* The first thing in the message is * some general text. */ - init_msg = catgets(Dtb_project_catd, 100, 38, "The following modules are read-only.\nIf you edit these modules, you\nwill not be able to save your edits."); + init_msg = CATGETS(Dtb_project_catd, 100, 38, "The following modules are read-only.\nIf you edit these modules, you\nwill not be able to save your edits."); /* If we have an old buffer lying around, free it */ if (errmsg != (STRING) NULL) @@ -193,7 +193,7 @@ ab_load_bil_file( if (!util_strempty(errmsg)) { - util_set_help_data(catgets(Dtb_project_catd, 100, 92, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 92, "Any changes made to a read-only module cannot be saved,\nunless you save the module to a different file name."), NULL, NULL); util_puts(errmsg); @@ -203,7 +203,7 @@ ab_load_bil_file( if( obj_get_num_children(newProject) == 0 ) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 23, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 23, "%s: Empty project file loaded."), fileName); xm_buf = XmStringCreateLocalized(Buf); dtb_palette_empty_proj_msg_initialize(&dtb_palette_empty_proj_msg); @@ -443,14 +443,14 @@ ab_check_and_open_bip( else /* Read-only file */ { /* You can read it but you can't write to it. */ - sprintf(Buf, catgets(Dtb_project_catd, 100, 17, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 17, "The file %s is a read-only file.\nYou may open the project\nor cancel the operation."), fileName); xm_buf = XmStringCreateLocalized(Buf); dtb_palette_open_ro_proj_msg_initialize( &dtb_palette_open_ro_proj_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 90, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 90, "Opening a read-only project means that any changes that\naffect the project (.bip) file, such as creation of a\nnew module or creation of a cross-module connection,\ncannot be saved, unless you save the project to a\ndifferent file name. You have the option of continuing\nwith the open operation or cancelling it."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -476,7 +476,7 @@ ab_check_and_open_bip( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 20, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 20, "%s does not have read permission."), fileName); xm_buf = XmStringCreateLocalized(Buf); dtb_palette_error_msg_initialize(&dtb_palette_error_msg); @@ -550,7 +550,7 @@ ab_check_and_import_bil( else { /* You can read it but you can't write to it. */ - sprintf(Buf, catgets(Dtb_project_catd, 100, 21, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 21, "The file %s is a read-only file.\n\ You may import the module or cancel\n\ the operation."), fileName); @@ -559,7 +559,7 @@ ab_check_and_import_bil( &dtb_palette_import_ro_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 91, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 91, "Importing a read-only module means that any changes\nthat affect the module cannot be saved, unless you\nsave the module to a different file name. You have\nthe option of continuing with the import operation\nor cancelling it."); help_data->help_volume = ""; @@ -585,7 +585,7 @@ ab_check_and_import_bil( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 9, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 9, "%s does not have read permission."), fileName); xm_buf = XmStringCreateLocalized(Buf); dtb_palette_error_msg_initialize(&dtb_palette_error_msg); diff --git a/cde/programs/dtappbuilder/src/ab/ab_dnd.c b/cde/programs/dtappbuilder/src/ab/ab_dnd.c index 4bf3f58c2..fa3ad160b 100644 --- a/cde/programs/dtappbuilder/src/ab/ab_dnd.c +++ b/cde/programs/dtappbuilder/src/ab/ab_dnd.c @@ -177,7 +177,7 @@ dnd_load_buffer( goto epilogue; } - fileName = dropBuf.name? dropBuf.name : catgets(Dtb_project_catd, 100, 104, "NoName"); + fileName = dropBuf.name? dropBuf.name : CATGETS(Dtb_project_catd, 100, 104, "NoName"); fileName = XtNewString(fileName); if ( (strcmp(dataType, BIX) == 0) || @@ -218,7 +218,7 @@ dnd_load_buffer( } else { - fmtStr = XtNewString(catgets(Dtb_project_catd, 100, 103, + fmtStr = XtNewString(CATGETS(Dtb_project_catd, 100, 103, "Cannot determine file type for %s.\nDo you want to load the file as a project or a module?")); msg = (STRING) util_malloc(strlen(fmtStr) + strlen(fileName) + 1); @@ -348,7 +348,7 @@ dnd_load_file( } else { - fmtStr = XtNewString(catgets(Dtb_project_catd, 100, 103, + fmtStr = XtNewString(CATGETS(Dtb_project_catd, 100, 103, "Cannot determine file type for %s.\nDo you want to load the file as a project or a module?")); msg = (STRING) util_malloc(strlen(fmtStr) + strlen(fileName) + 1); sprintf(msg, fmtStr, fileName); diff --git a/cde/programs/dtappbuilder/src/ab/abobj_edit.c b/cde/programs/dtappbuilder/src/ab/abobj_edit.c index bd9c4c54d..7046b07ce 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_edit.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_edit.c @@ -2269,7 +2269,7 @@ abobj_paste( if (!obj_is_base_win(winobj)) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 37, + i18n_msg = CATGETS(Dtb_project_catd, 100, 37, "Menubar can be pasted to a Main Window only."); if (errmsg != (STRING) NULL) @@ -2289,7 +2289,7 @@ abobj_paste( if (obj_is_menubar(nobj)) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 27, + i18n_msg = CATGETS(Dtb_project_catd, 100, 27, "There is already a Menubar for the selected window."); if (errmsg != (STRING) NULL) util_free(errmsg); @@ -2308,7 +2308,7 @@ abobj_paste( && !obj_is_file_chooser(obj_get_root(root))))) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 28, + i18n_msg = CATGETS(Dtb_project_catd, 100, 28, "Containers must be pasted to\na Main Window or Custom Dialog."); if (errmsg != (STRING) NULL) @@ -2324,7 +2324,7 @@ abobj_paste( || obj_is_group(obj_get_root(root))))) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 57, + i18n_msg = CATGETS(Dtb_project_catd, 100, 57, "Groups must be pasted to\na group or control panel."); if (errmsg != (STRING) NULL) @@ -2406,7 +2406,7 @@ abobj_paste( if (obj_is_control_panel(obj)) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 59, + i18n_msg = CATGETS(Dtb_project_catd, 100, 59, "Control Panes must be pasted to a Main Window,\nCustom Dialog, or another pane."); /* If we have an old buffer lying around, free it */ @@ -2440,7 +2440,7 @@ abobj_paste( !(obj_is_container(root) && !obj_is_menubar(root)))) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 29, + i18n_msg = CATGETS(Dtb_project_catd, 100, 29, "Panes must be pasted to\na Main Window, Custom Dialog or Container."); if (errmsg != (STRING) NULL) @@ -2459,7 +2459,7 @@ abobj_paste( !obj_is_group(obj_get_root(newroot)))) { Err = True; - i18n_msg = catgets(Dtb_project_catd, 100, 30, + i18n_msg = CATGETS(Dtb_project_catd, 100, 30, "Controls must be pasted to\na Control Panel or Group."); if (errmsg != (STRING) NULL) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_menu.c b/cde/programs/dtappbuilder/src/ab/abobj_menu.c index e34ad8f1d..84fd273c2 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_menu.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_menu.c @@ -1217,40 +1217,40 @@ abobj_strings_init(void) char *attach_str; props_str = - XtNewString(catgets(Dtb_project_catd, 100, 137, "Props")); + XtNewString(CATGETS(Dtb_project_catd, 100, 137, "Props")); undo_str = - XtNewString(catgets(Dtb_project_catd, 100, 138, "Undo")); + XtNewString(CATGETS(Dtb_project_catd, 100, 138, "Undo")); cut_str = - XtNewString(catgets(Dtb_project_catd, 100, 139, "Cut")); + XtNewString(CATGETS(Dtb_project_catd, 100, 139, "Cut")); copy_str = - XtNewString(catgets(Dtb_project_catd, 100, 140, "Copy")); + XtNewString(CATGETS(Dtb_project_catd, 100, 140, "Copy")); paste_str = - XtNewString(catgets(Dtb_project_catd, 100, 141, "Paste")); + XtNewString(CATGETS(Dtb_project_catd, 100, 141, "Paste")); delete_str = - XtNewString(catgets(Dtb_project_catd, 100, 142, "Delete")); + XtNewString(CATGETS(Dtb_project_catd, 100, 142, "Delete")); align_str = - XtNewString(catgets(Dtb_project_catd, 100, 143, "Align")); + XtNewString(CATGETS(Dtb_project_catd, 100, 143, "Align")); distr_str = - XtNewString(catgets(Dtb_project_catd, 100, 144, "Distribute")); + XtNewString(CATGETS(Dtb_project_catd, 100, 144, "Distribute")); group_str = - XtNewString(catgets(Dtb_project_catd, 100, 145, "Group")); + XtNewString(CATGETS(Dtb_project_catd, 100, 145, "Group")); ungroup_str = - XtNewString(catgets(Dtb_project_catd, 100, 146, "Ungroup")); + XtNewString(CATGETS(Dtb_project_catd, 100, 146, "Ungroup")); mk_paned_win_str = - XtNewString(catgets(Dtb_project_catd, 100, 147, "Make Paned Window")); + XtNewString(CATGETS(Dtb_project_catd, 100, 147, "Make Paned Window")); unmk_paned_win_str = - XtNewString(catgets(Dtb_project_catd, 100, 148, "Unmake Paned Window")); + XtNewString(CATGETS(Dtb_project_catd, 100, 148, "Unmake Paned Window")); attach_str = - XtNewString(catgets(Dtb_project_catd, 100, 149, "Attachments...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 149, "Attachments...")); prop_menu[0].label = - XtNewString(catgets(Dtb_project_catd, 100, 150, "Revolving...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 150, "Revolving...")); prop_menu[1].label = - XtNewString(catgets(Dtb_project_catd, 100, 151, "Fixed...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 151, "Fixed...")); obj_menu_items[0].label = props_str; obj_menu_items[1].label = - XtNewString(catgets(Dtb_project_catd, 100, 152, "Browse...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 152, "Browse...")); obj_menu_items[3].label = undo_str; obj_menu_items[4].label = cut_str; obj_menu_items[5].label = copy_str; @@ -1264,11 +1264,11 @@ abobj_strings_init(void) obj_menu_items[14].label = unmk_paned_win_str; obj_menu_items[15].label = attach_str; obj_menu_items[17].label = - XtNewString(catgets(Dtb_project_catd, 100, 153, "NextLayer")); + XtNewString(CATGETS(Dtb_project_catd, 100, 153, "NextLayer")); browser_menu_items[0].label = props_str; browser_menu_items[1].label = - XtNewString(catgets(Dtb_project_catd, 100, 154, "Tearoff Browser...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 154, "Tearoff Browser...")); browser_menu_items[3].label = undo_str; browser_menu_items[4].label = cut_str; browser_menu_items[5].label = copy_str; @@ -1280,11 +1280,11 @@ abobj_strings_init(void) browser_menu_items[12].label = unmk_paned_win_str; browser_menu_items[13].label = attach_str; browser_menu_items[15].label = - XtNewString(catgets(Dtb_project_catd, 100, 155, "Expand")); + XtNewString(CATGETS(Dtb_project_catd, 100, 155, "Expand")); browser_menu_items[16].label = - XtNewString(catgets(Dtb_project_catd, 100, 156, "Expand All")); + XtNewString(CATGETS(Dtb_project_catd, 100, 156, "Expand All")); browser_menu_items[17].label = - XtNewString(catgets(Dtb_project_catd, 100, 157, "Collapse")); + XtNewString(CATGETS(Dtb_project_catd, 100, 157, "Collapse")); layout_menu_items[0].label = align_str; layout_menu_items[1].label = distr_str; diff --git a/cde/programs/dtappbuilder/src/ab/abobj_util.c b/cde/programs/dtappbuilder/src/ab/abobj_util.c index 865852b32..e7bcd8a8c 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_util.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_util.c @@ -796,19 +796,19 @@ abobj_update_proj_name( else { proj_win_title = (STRING) util_malloc( - strlen(catgets(Dtb_project_catd, 100, 104, "NoName")) + strlen(CATGETS(Dtb_project_catd, 100, 104, "NoName")) + strlen(".bip") +1); strcpy(proj_win_title, - catgets(Dtb_project_catd, 100, 104, "NoName")); + CATGETS(Dtb_project_catd, 100, 104, "NoName")); } strcat(proj_win_title, ".bip"); new_title = (STRING) util_malloc( - strlen(catgets(Dtb_project_catd, 10, 1, "Project Organizer")) + strlen(CATGETS(Dtb_project_catd, 10, 1, "Project Organizer")) + strlen(" - ") + strlen(proj_win_title) +1); strcpy(new_title, - catgets(Dtb_project_catd, 10, 1, "Project Organizer")); + CATGETS(Dtb_project_catd, 10, 1, "Project Organizer")); strcat(new_title, " - "); strcat(new_title, proj_win_title); util_free(proj_win_title); @@ -848,10 +848,10 @@ abobj_update_palette_title( else { proj_win_title = (STRING) util_malloc( - strlen(catgets(Dtb_project_catd, 100, 104, "NoName")) + strlen(CATGETS(Dtb_project_catd, 100, 104, "NoName")) + strlen(".bip") +1); strcpy(proj_win_title, - catgets(Dtb_project_catd, 100, 104, "NoName")); + CATGETS(Dtb_project_catd, 100, 104, "NoName")); } strcat(proj_win_title, ".bip"); @@ -865,13 +865,13 @@ abobj_update_palette_title( SaveNeeded = TRUE; new_title = (STRING) util_malloc( - strlen(catgets(Dtb_project_catd, 10, 5, "Application Builder")) + strlen(CATGETS(Dtb_project_catd, 10, 5, "Application Builder")) + strlen(" - ") + strlen(proj_win_title) + - + strlen(catgets(Dtb_project_catd, 100, 244, " (Save Needed)")) + + strlen(CATGETS(Dtb_project_catd, 100, 244, " (Save Needed)")) +1); strcpy(new_title, - catgets(Dtb_project_catd, 10, 5, "Application Builder")); + CATGETS(Dtb_project_catd, 10, 5, "Application Builder")); strcat(new_title, " - "); strcat(new_title, proj_win_title); util_free(proj_win_title); @@ -879,7 +879,7 @@ abobj_update_palette_title( if (SaveNeeded) { strcat(new_title, - catgets(Dtb_project_catd, 100, 244, " (Save Needed)")); + CATGETS(Dtb_project_catd, 100, 244, " (Save Needed)")); } XtVaSetValues(AB_toplevel, XmNtitle, new_title, NULL); diff --git a/cde/programs/dtappbuilder/src/ab/appfw_stubs.c b/cde/programs/dtappbuilder/src/ab/appfw_stubs.c index 81287465c..15dfbc737 100644 --- a/cde/programs/dtappbuilder/src/ab/appfw_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/appfw_stubs.c @@ -663,10 +663,10 @@ appfw_editor_prevent_closeCB( */ help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - xm_buf = XmStringCreateLocalized(catgets(Dtb_project_catd, 100, 248, "Properties for your project have been modified on the\nApplication Framework Editor but not Applied.\nApply Changes or Cancel Close operation.")); + xm_buf = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 248, "Properties for your project have been modified on the\nApplication Framework Editor but not Applied.\nApply Changes or Cancel Close operation.")); help_data->help_volume = help_data->help_locationID = NULL; - help_data->help_text = XtNewString(catgets(Dtb_project_catd, 100, 249, "Click Apply Changes to apply the changes \nand close the Application Framework Editor.\n\nClick Cancel if you don't want to apply the\nchanges and want the Application Framework\nEditor to remain displayed. You can then click\nReset to undo the changes before closing\nthe Application Framework Editor.")); + help_data->help_text = XtNewString(CATGETS(Dtb_project_catd, 100, 249, "Click Apply Changes to apply the changes \nand close the Application Framework Editor.\n\nClick Cancel if you don't want to apply the\nchanges and want the Application Framework\nEditor to remain displayed. You can then click\nReset to undo the changes before closing\nthe Application Framework Editor.")); /* * Pop up warning message dialog diff --git a/cde/programs/dtappbuilder/src/ab/attch_ed_stubs.c b/cde/programs/dtappbuilder/src/ab/attch_ed_stubs.c index c31445b82..5377bc44d 100644 --- a/cde/programs/dtappbuilder/src/ab/attch_ed_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/attch_ed_stubs.c @@ -3517,9 +3517,9 @@ get_wrn_response( switch(wrn_type) { case ATTCH_ED_WRN_LOAD: - help_data->help_text = XtNewString(catgets(Dtb_project_catd, 100, 93, "Click Apply Changes to apply the changes to the\ncurrent object and load the selected object.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before loading\nthe selected object.")); + help_data->help_text = XtNewString(CATGETS(Dtb_project_catd, 100, 93, "Click Apply Changes to apply the changes to the\ncurrent object and load the selected object.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before loading\nthe selected object.")); sprintf(wrn_string, - catgets(Dtb_project_catd, 100, 43, + CATGETS(Dtb_project_catd, 100, 43, "Attachments for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ @@ -3528,9 +3528,9 @@ get_wrn_response( break; case ATTCH_ED_WRN_CHANGE_OBJTYPE: - help_data->help_text = XtNewString(catgets(Dtb_project_catd, 100, 95, "Click Apply Changes to apply the changes to the\ncurrent object and display the new object type.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before changing\nto a different object type.")); + help_data->help_text = XtNewString(CATGETS(Dtb_project_catd, 100, 95, "Click Apply Changes to apply the changes to the\ncurrent object and display the new object type.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before changing\nto a different object type.")); sprintf(wrn_string, - catgets(Dtb_project_catd, 100, 44, + CATGETS(Dtb_project_catd, 100, 44, "Attachments for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ @@ -3539,9 +3539,9 @@ get_wrn_response( break; case ATTCH_ED_WRN_CLOSE: - help_data->help_text = XtNewString(catgets(Dtb_project_catd, 100, 247, "Click Apply Changes to apply the changes to the\ncurrent object and close the Attachments Editor.\n\nClick Cancel if you don't want to apply the\nchanges to the current object and want the\nAttachments Editor to remain displayed. You can\nthen click Reset to undo the changes before\nclosing the Attachments Editor.")); + help_data->help_text = XtNewString(CATGETS(Dtb_project_catd, 100, 247, "Click Apply Changes to apply the changes to the\ncurrent object and close the Attachments Editor.\n\nClick Cancel if you don't want to apply the\nchanges to the current object and want the\nAttachments Editor to remain displayed. You can\nthen click Reset to undo the changes before\nclosing the Attachments Editor.")); sprintf(wrn_string, - catgets(Dtb_project_catd, 100, 45, + CATGETS(Dtb_project_catd, 100, 45, "Attachments for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ @@ -3704,7 +3704,7 @@ attch_ed_verify_props(void) /* * Fetch format string */ - format_str = XtNewString(catgets(Dtb_project_catd, 100, 245, + format_str = XtNewString(CATGETS(Dtb_project_catd, 100, 245, "Attachments for \"%s\"\ncannot be modified because it is\na member of the group \"%s\".")); /* @@ -3733,7 +3733,7 @@ attch_ed_verify_props(void) * Malloc/setup struct for help text */ help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 246, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 246, "Group objects have attributes that determine what\nattachments their members will have, therefore setting\nattachments for group members is not allowed. This only\napplies to group objects that have layout type Vertical,\nHorizontal, or Row-column. Click Cancel or Reset to\nundo your changes on the Attachments Editor."); help_data->help_volume = NULL; help_data->help_locationID = NULL; diff --git a/cde/programs/dtappbuilder/src/ab/brws.c b/cde/programs/dtappbuilder/src/ab/brws.c index 85a5ee89e..267d477cf 100644 --- a/cde/programs/dtappbuilder/src/ab/brws.c +++ b/cde/programs/dtappbuilder/src/ab/brws.c @@ -2881,7 +2881,7 @@ brws_build_module_menu( if (!shown_modules_exist) { label = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 229, "No modules to browse")); + CATGETS(Dtb_project_catd, 100, 229, "No modules to browse")); mpb = XtVaCreateManagedWidget(name, xmPushButtonWidgetClass, pulldown, diff --git a/cde/programs/dtappbuilder/src/ab/brws_find.c b/cde/programs/dtappbuilder/src/ab/brws_find.c index 18043c66d..4169aa883 100644 --- a/cde/programs/dtappbuilder/src/ab/brws_find.c +++ b/cde/programs/dtappbuilder/src/ab/brws_find.c @@ -122,7 +122,7 @@ brwsP_create_find_box( args, num_args); - title = XtNewString(catgets(Dtb_project_catd, 100, 230, + title = XtNewString(CATGETS(Dtb_project_catd, 100, 230, "Module Browser: Find Object")); XtVaSetValues(XtParent(ui->find_box), XmNtitle, title, @@ -130,9 +130,9 @@ brwsP_create_find_box( XtFree(title); sel_label = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 231, "Object Name")); + CATGETS(Dtb_project_catd, 100, 231, "Object Name")); ok_label = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 232, "Find")); + CATGETS(Dtb_project_catd, 100, 232, "Find")); XtVaSetValues(ui->find_box, XmNselectionLabelString, sel_label, XmNokLabelString, ok_label, diff --git a/cde/programs/dtappbuilder/src/ab/brws_stubs.c b/cde/programs/dtappbuilder/src/ab/brws_stubs.c index 27e9aa4d5..2230fb102 100644 --- a/cde/programs/dtappbuilder/src/ab/brws_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/brws_stubs.c @@ -179,12 +179,12 @@ brwsP_orientation( if (props->orientation == BRWS_VERTICAL) { props->orientation = BRWS_HORIZONTAL; - str = catgets(Dtb_project_catd, 100, 66, "Vertical"); + str = CATGETS(Dtb_project_catd, 100, 66, "Vertical"); xmlabel = XmStringCreateLocalized(str); } else { props->orientation = BRWS_VERTICAL; - str = catgets(Dtb_project_catd, 100, 67, "Horizontal"); + str = CATGETS(Dtb_project_catd, 100, 67, "Horizontal"); xmlabel = XmStringCreateLocalized(str); } @@ -220,9 +220,9 @@ brwsP_obj_glyph( if (!ab || !ab->module) return; - hide_str = XtNewString(catgets(Dtb_project_catd, 100, 60, + hide_str = XtNewString(CATGETS(Dtb_project_catd, 100, 60, "Hide Object Glyph")); - show_str = XtNewString(catgets(Dtb_project_catd, 100, 61, + show_str = XtNewString(CATGETS(Dtb_project_catd, 100, 61, "Show Object Glyph")); browser_show_view_elements(ab->module, @@ -255,9 +255,9 @@ brwsP_obj_class( if (!b || !b->module) return; - hide_str = XtNewString(catgets(Dtb_project_catd, 100, 62, + hide_str = XtNewString(CATGETS(Dtb_project_catd, 100, 62, "Hide Object Type")); - show_str = XtNewString(catgets(Dtb_project_catd, 100, 63, + show_str = XtNewString(CATGETS(Dtb_project_catd, 100, 63, "Show Object Type")); browser_show_view_elements(b->module, @@ -290,9 +290,9 @@ brwsP_obj_name( if (!ab || !ab->module) return; - hide_str = XtNewString(catgets(Dtb_project_catd, 100, 64, + hide_str = XtNewString(CATGETS(Dtb_project_catd, 100, 64, "Hide Object Name")); - show_str = XtNewString(catgets(Dtb_project_catd, 100, 65, + show_str = XtNewString(CATGETS(Dtb_project_catd, 100, 65, "Show Object Name")); browser_show_view_elements(ab->module, diff --git a/cde/programs/dtappbuilder/src/ab/cgen_env_stubs.c b/cde/programs/dtappbuilder/src/ab/cgen_env_stubs.c index 22b73de1c..64189ab24 100644 --- a/cde/programs/dtappbuilder/src/ab/cgen_env_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/cgen_env_stubs.c @@ -105,7 +105,7 @@ cgenP_get_envCB( } if (var_value == NULL) { - XmTextSetString(env_dlg->textpane, catgets(Dtb_project_catd, 100, 58, "*** Not Set ***")); + XmTextSetString(env_dlg->textpane, CATGETS(Dtb_project_catd, 100, 58, "*** Not Set ***")); } else { @@ -193,7 +193,7 @@ cgenP_reset_envCB( if (var_value == NULL) { - XmTextSetString(env_dlg->textpane, catgets(Dtb_project_catd, 100, 58, "*** Not Set ***")); + XmTextSetString(env_dlg->textpane, CATGETS(Dtb_project_catd, 100, 58, "*** Not Set ***")); } else { diff --git a/cde/programs/dtappbuilder/src/ab/cgen_utils.c b/cde/programs/dtappbuilder/src/ab/cgen_utils.c index 7c77cbe65..ed1d780fa 100644 --- a/cde/programs/dtappbuilder/src/ab/cgen_utils.c +++ b/cde/programs/dtappbuilder/src/ab/cgen_utils.c @@ -2406,7 +2406,7 @@ check_path_to_cmd(STRING *cmdList, BOOL *allowWarnUserInOut) util_strncpy(dirName, foundCmd, dirNameLen+1); /*util_dprintf(2, "directory: '%s'\n", dirName);*/ - sprintf(buffer, catgets(Dtb_project_catd, 100, 52, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 52, "Your PATH does not contain the command %s.\n" "In order to access this command, may I append this\n" "directory to your path?:\n" diff --git a/cde/programs/dtappbuilder/src/ab/conn_obj.c b/cde/programs/dtappbuilder/src/ab/conn_obj.c index 1d267ecd3..d90ffed18 100644 --- a/cde/programs/dtappbuilder/src/ab/conn_obj.c +++ b/cde/programs/dtappbuilder/src/ab/conn_obj.c @@ -960,7 +960,7 @@ connP_make_conn_string( strcat(conn_string, unknown_str); } - strcat(conn_string, catgets(Dtb_project_catd, 100, 196, " on ")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 196, " on ")); modname = abobj_get_moduled_name(src_obj); strcat(conn_string, (char*)modname); XtFree(modname); @@ -995,7 +995,7 @@ connP_make_conn_string( strcat(conn_string, unknown_str); } - strcat(conn_string, catgets(Dtb_project_catd, 100, 196, " on ")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 196, " on ")); modname = abobj_get_moduled_name(target_obj); strcat(conn_string, (char*)modname); XtFree(modname); @@ -1003,7 +1003,7 @@ connP_make_conn_string( break; case AB_FUNC_USER_DEF: - strcat(conn_string, catgets(Dtb_project_catd, 100, 197, "Call function")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 197, "Call function")); strcat(conn_string, " \""); { ISTRING istr_val = action_info->func_value.func_name; @@ -1015,20 +1015,20 @@ connP_make_conn_string( break; case AB_FUNC_CODE_FRAG: - strcat(conn_string, catgets(Dtb_project_catd, 100, 198, "Execute Code")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 198, "Execute Code")); break; case AB_FUNC_ON_ITEM_HELP: - strcat(conn_string, catgets(Dtb_project_catd, 100, 199, "Activate On-Item Help")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 199, "Activate On-Item Help")); break; case AB_FUNC_HELP_VOLUME: - strcat(conn_string, catgets(Dtb_project_catd, 100, 200, "Access Help Volume")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 200, "Access Help Volume")); strcat(conn_string, " \""); strcat(conn_string, obj_get_func_help_volume(action_obj)? obj_get_func_help_volume(action_obj):""); strcat(conn_string, "\" "); - strcat(conn_string, catgets(Dtb_project_catd, 100, 201, "at location")); + strcat(conn_string, CATGETS(Dtb_project_catd, 100, 201, "at location")); strcat(conn_string, " \""); strcat(conn_string, obj_get_func_help_location(action_obj)? obj_get_func_help_location(action_obj):""); @@ -1522,85 +1522,85 @@ extern void conn_strings_init(void) { unknown_str = - XtNewString(catgets(Dtb_project_catd, 100, 158, "??unknown??")); + XtNewString(CATGETS(Dtb_project_catd, 100, 158, "??unknown??")); invalid_str = - XtNewString(catgets(Dtb_project_catd, 100, 159, "??invalid??")); + XtNewString(CATGETS(Dtb_project_catd, 100, 159, "??invalid??")); when_labels[AB_WHEN_UNDEF] = unknown_str; when_labels[AB_WHEN_ACTION1] = - XtNewString(catgets(Dtb_project_catd, 100, 160, "Action1 Activated")); + XtNewString(CATGETS(Dtb_project_catd, 100, 160, "Action1 Activated")); when_labels[AB_WHEN_ACTION2] = - XtNewString(catgets(Dtb_project_catd, 100, 161, "Action2 Activated")); + XtNewString(CATGETS(Dtb_project_catd, 100, 161, "Action2 Activated")); when_labels[AB_WHEN_ACTION3] = - XtNewString(catgets(Dtb_project_catd, 100, 162, "Action3 Activated")); + XtNewString(CATGETS(Dtb_project_catd, 100, 162, "Action3 Activated")); when_labels[AB_WHEN_ACTIVATED] = - XtNewString(catgets(Dtb_project_catd, 100, 163, "Activated")); + XtNewString(CATGETS(Dtb_project_catd, 100, 163, "Activated")); when_labels[AB_WHEN_AFTER_CREATED] = - XtNewString(catgets(Dtb_project_catd, 100, 164, "Created")); + XtNewString(CATGETS(Dtb_project_catd, 100, 164, "Created")); when_labels[AB_WHEN_AFTER_RESIZED] = - XtNewString(catgets(Dtb_project_catd, 100, 165, "Resized")); + XtNewString(CATGETS(Dtb_project_catd, 100, 165, "Resized")); when_labels[AB_WHEN_BEFORE_TEXT_CHANGED] = - XtNewString(catgets(Dtb_project_catd, 100, 166, "Before Text Changed")); + XtNewString(CATGETS(Dtb_project_catd, 100, 166, "Before Text Changed")); when_labels[AB_WHEN_CANCEL] = - XtNewString(catgets(Dtb_project_catd, 100, 167, "Cancel Activated")); + XtNewString(CATGETS(Dtb_project_catd, 100, 167, "Cancel Activated")); when_labels[AB_WHEN_DESTROYED] = - XtNewString(catgets(Dtb_project_catd, 100, 168, "Destroyed")); + XtNewString(CATGETS(Dtb_project_catd, 100, 168, "Destroyed")); when_labels[AB_WHEN_DOUBLE_CLICKED_ON] = - XtNewString(catgets(Dtb_project_catd, 100, 169, "Double Clicked On")); + XtNewString(CATGETS(Dtb_project_catd, 100, 169, "Double Clicked On")); when_labels[AB_WHEN_DRAGGED] = - XtNewString(catgets(Dtb_project_catd, 100, 170, "Dragged")); + XtNewString(CATGETS(Dtb_project_catd, 100, 170, "Dragged")); when_labels[AB_WHEN_DRAGGED_FROM] = - XtNewString(catgets(Dtb_project_catd, 100, 171, "Dragged From")); + XtNewString(CATGETS(Dtb_project_catd, 100, 171, "Dragged From")); when_labels[AB_WHEN_DROPPED_ON] = - XtNewString(catgets(Dtb_project_catd, 100, 172, "Dropped On")); + XtNewString(CATGETS(Dtb_project_catd, 100, 172, "Dropped On")); when_labels[AB_WHEN_HIDDEN] = - XtNewString(catgets(Dtb_project_catd, 100, 173, "Hidden")); + XtNewString(CATGETS(Dtb_project_catd, 100, 173, "Hidden")); when_labels[AB_WHEN_ITEM_SELECTED] = - XtNewString(catgets(Dtb_project_catd, 100, 174, "Item Selected")); + XtNewString(CATGETS(Dtb_project_catd, 100, 174, "Item Selected")); when_labels[AB_WHEN_OK] = - XtNewString(catgets(Dtb_project_catd, 100, 175, "Ok Activated")); + XtNewString(CATGETS(Dtb_project_catd, 100, 175, "Ok Activated")); when_labels[AB_WHEN_POPPED_DOWN] = - XtNewString(catgets(Dtb_project_catd, 100, 176, "Popped Down")); + XtNewString(CATGETS(Dtb_project_catd, 100, 176, "Popped Down")); when_labels[AB_WHEN_POPPED_UP] = - XtNewString(catgets(Dtb_project_catd, 100, 177, "Popped Up")); + XtNewString(CATGETS(Dtb_project_catd, 100, 177, "Popped Up")); when_labels[AB_WHEN_REPAINT_NEEDED] = - XtNewString(catgets(Dtb_project_catd, 100, 178, "Repaint Needed")); + XtNewString(CATGETS(Dtb_project_catd, 100, 178, "Repaint Needed")); when_labels[AB_WHEN_SESSION_SAVE] = - XtNewString(catgets(Dtb_project_catd, 100, 179, "Session Save")); + XtNewString(CATGETS(Dtb_project_catd, 100, 179, "Session Save")); when_labels[AB_WHEN_SESSION_RESTORE] = - XtNewString(catgets(Dtb_project_catd, 100, 180, "Session Restore")); + XtNewString(CATGETS(Dtb_project_catd, 100, 180, "Session Restore")); when_labels[AB_WHEN_SHOWN] = - XtNewString(catgets(Dtb_project_catd, 100, 181, "Shown")); + XtNewString(CATGETS(Dtb_project_catd, 100, 181, "Shown")); when_labels[AB_WHEN_TEXT_CHANGED] = - XtNewString(catgets(Dtb_project_catd, 100, 182, "Text Changed")); + XtNewString(CATGETS(Dtb_project_catd, 100, 182, "Text Changed")); when_labels[AB_WHEN_TOGGLED] = - XtNewString(catgets(Dtb_project_catd, 100, 183, "Toggled")); + XtNewString(CATGETS(Dtb_project_catd, 100, 183, "Toggled")); when_labels[AB_WHEN_TOOLTALK_DO_COMMAND] = - XtNewString(catgets(Dtb_project_catd, 100, 184, "ToolTalk Do Command")); + XtNewString(CATGETS(Dtb_project_catd, 100, 184, "ToolTalk Do Command")); when_labels[AB_WHEN_TOOLTALK_GET_STATUS] = - XtNewString(catgets(Dtb_project_catd, 100, 185, "ToolTalk Get Status")); + XtNewString(CATGETS(Dtb_project_catd, 100, 185, "ToolTalk Get Status")); when_labels[AB_WHEN_TOOLTALK_PAUSE_RESUME] = - XtNewString(catgets(Dtb_project_catd, 100, 186, "ToolTalk Pause/Resume")); + XtNewString(CATGETS(Dtb_project_catd, 100, 186, "ToolTalk Pause/Resume")); when_labels[AB_WHEN_TOOLTALK_QUIT] = - XtNewString(catgets(Dtb_project_catd, 100, 187, "ToolTalk Quit")); + XtNewString(CATGETS(Dtb_project_catd, 100, 187, "ToolTalk Quit")); when_labels[AB_WHEN_VALUE_CHANGED] = - XtNewString(catgets(Dtb_project_catd, 100, 188, "Value Changed")); + XtNewString(CATGETS(Dtb_project_catd, 100, 188, "Value Changed")); when_labels[AB_WHEN_NUM_VALUES] = invalid_str; stdact_labels[AB_STDACT_UNDEF] = unknown_str; stdact_labels[AB_STDACT_DISABLE] = - XtNewString(catgets(Dtb_project_catd, 100, 189, "Disable")); + XtNewString(CATGETS(Dtb_project_catd, 100, 189, "Disable")); stdact_labels[AB_STDACT_ENABLE] = - XtNewString(catgets(Dtb_project_catd, 100, 190, "Enable")); + XtNewString(CATGETS(Dtb_project_catd, 100, 190, "Enable")); stdact_labels[AB_STDACT_HIDE] = - XtNewString(catgets(Dtb_project_catd, 100, 191, "Hide")); + XtNewString(CATGETS(Dtb_project_catd, 100, 191, "Hide")); stdact_labels[AB_STDACT_SET_LABEL] = - XtNewString(catgets(Dtb_project_catd, 100, 192, "Set Label")); + XtNewString(CATGETS(Dtb_project_catd, 100, 192, "Set Label")); stdact_labels[AB_STDACT_SET_TEXT] = - XtNewString(catgets(Dtb_project_catd, 100, 193, "Set Text")); + XtNewString(CATGETS(Dtb_project_catd, 100, 193, "Set Text")); stdact_labels[AB_STDACT_SET_VALUE] = - XtNewString(catgets(Dtb_project_catd, 100, 194, "Set Value")); + XtNewString(CATGETS(Dtb_project_catd, 100, 194, "Set Value")); stdact_labels[AB_STDACT_SHOW] = - XtNewString(catgets(Dtb_project_catd, 100, 195, "Show")); + XtNewString(CATGETS(Dtb_project_catd, 100, 195, "Show")); stdact_labels[AB_BUILTIN_ACTION_NUM_VALUES] = invalid_str; } diff --git a/cde/programs/dtappbuilder/src/ab/conn_stubs.c b/cde/programs/dtappbuilder/src/ab/conn_stubs.c index 5b2370c00..f398fabdc 100644 --- a/cde/programs/dtappbuilder/src/ab/conn_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/conn_stubs.c @@ -1601,7 +1601,7 @@ set_standard_action_type( XtUnmanageChild(volume_rowcol); hide_execute_code_win(); - xm_label_str = XmStringCreateLocalized(catgets(Dtb_project_catd, + xm_label_str = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 54, ARGUMENT_LABEL)); XtVaSetValues(arg_label, XmNlabelString, xm_label_str, NULL); XmStringFree(xm_label_str); @@ -1631,7 +1631,7 @@ set_call_function_action_type( XtUnmanageChild(location_rowcol); hide_execute_code_win(); - xm_label_str = XmStringCreateLocalized(catgets(Dtb_project_catd, + xm_label_str = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 55, FUNCTION_LABEL)); XtVaSetValues(arg_label, XmNlabelString, xm_label_str, NULL); XmStringFree(xm_label_str); @@ -1664,7 +1664,7 @@ set_execute_code_action_type( XtUnmanageChild(volume_rowcol); XtUnmanageChild(location_rowcol); - xm_label_str = XmStringCreateLocalized(catgets(Dtb_project_catd, + xm_label_str = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 56, CODE_LABEL)); XtVaSetValues(arg_label, XmNlabelString, xm_label_str, NULL); XmStringFree(xm_label_str); diff --git a/cde/programs/dtappbuilder/src/ab/dnd_ed_stubs.c b/cde/programs/dtappbuilder/src/ab/dnd_ed_stubs.c index 2c19af762..e5c52fba3 100644 --- a/cde/programs/dtappbuilder/src/ab/dnd_ed_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/dnd_ed_stubs.c @@ -656,7 +656,7 @@ do_auto_apply( { if (changing_objects) { - sprintf(buffer, catgets(Dtb_project_catd, 100, 31, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 31, "Drag and drop properties for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ @@ -666,7 +666,7 @@ do_auto_apply( { if(new_obj != (ABObj) NULL) { - sprintf(buffer, catgets(Dtb_project_catd, 100, 32, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 32, "Drag and drop properties for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ @@ -674,7 +674,7 @@ do_auto_apply( } else { - sprintf(buffer,catgets(Dtb_project_catd, 100, 33, + sprintf(buffer,CATGETS(Dtb_project_catd, 100, 33, "Drag and drop properties for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ diff --git a/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src b/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src index de2669756..8777fb25f 100644 --- a/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src +++ b/cde/programs/dtappbuilder/src/ab/dtbuilder.c.src @@ -53,7 +53,7 @@ #include
#include
#include
-#include +#include
#include "palette_ui.h" #include "about_box_ui.h" #include "brws_ui.h" @@ -345,7 +345,7 @@ init_ab(ABInitProcInfo init_info) if ((*file_name) == 0) { - sprintf(errmsg_buf, catgets(Dtb_project_catd, 100, 2, "File not found: %s"), user_file_name); + sprintf(errmsg_buf, CATGETS(Dtb_project_catd, 100, 2, "File not found: %s"), user_file_name); errmsg = errmsg_buf; } else @@ -379,7 +379,7 @@ init_ab(ABInitProcInfo init_info) } if ((ret < 0) && (answer != DTB_ANSWER_CANCEL)) { - sprintf(errmsg_buf, catgets(Dtb_project_catd, 100, 1, "Could not import module %s"), file_name); + sprintf(errmsg_buf, CATGETS(Dtb_project_catd, 100, 1, "Could not import module %s"), file_name); errmsg = errmsg_buf; } } @@ -388,7 +388,7 @@ init_ab(ABInitProcInfo init_info) STRING fmtStr = NULL, msg = NULL; XmString xm_str = NULL; - fmtStr = XtNewString(catgets(Dtb_project_catd, 100, 103, + fmtStr = XtNewString(CATGETS(Dtb_project_catd, 100, 103, "Cannot determine file type for %s.\nDo you want to load the file as a project or a module?")); msg = (STRING) util_malloc(strlen(fmtStr) + strlen(file_name) + 1); sprintf(msg, fmtStr, file_name); @@ -933,7 +933,7 @@ create_import_rbox( NULL); label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 46,"Import Format:")); + CATGETS(Dtb_project_catd, 100, 46,"Import Format:")); rbox_label = XtVaCreateManagedWidget("rbox_label", xmLabelWidgetClass, format_rbox, @@ -956,7 +956,7 @@ create_import_rbox( XtManageChild(rbox); label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 47,"BIL")); + CATGETS(Dtb_project_catd, 100, 47,"BIL")); BIL_item = XtVaCreateManagedWidget("bil_item", xmToggleButtonWidgetClass, rbox, @@ -970,7 +970,7 @@ create_import_rbox( label_xmstring = NULL; label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 48,"UIL")); + CATGETS(Dtb_project_catd, 100, 48,"UIL")); UIL_item = XtVaCreateManagedWidget("uil_item", xmToggleButtonWidgetClass, rbox, @@ -1010,7 +1010,7 @@ create_import_rbox( NULL); label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 49,"Import By:")); + CATGETS(Dtb_project_catd, 100, 49,"Import By:")); rbox_label = XtVaCreateManagedWidget("rbox_label", xmLabelWidgetClass, method_rbox, @@ -1029,7 +1029,7 @@ create_import_rbox( XtManageChild(rbox); label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 50,"Copy")); + CATGETS(Dtb_project_catd, 100, 50,"Copy")); Copy_item = XtVaCreateManagedWidget("Copy_item", xmToggleButtonWidgetClass, rbox, @@ -1043,7 +1043,7 @@ create_import_rbox( label_xmstring = NULL; label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 51,"Reference")); + CATGETS(Dtb_project_catd, 100, 51,"Reference")); Ref_item = XtVaCreateManagedWidget("Ref_item", xmToggleButtonWidgetClass, rbox, @@ -1293,7 +1293,7 @@ main(int argc, char **argv) /* * Open the standard message catalog for the project. */ - Dtb_project_catd = catopen(DTB_PROJECT_CATALOG, NL_CAT_LOCALE); + Dtb_project_catd = CATOPEN(DTB_PROJECT_CATALOG, NL_CAT_LOCALE); if (Dtb_project_catd == (nl_catd)-1) { fprintf(stderr, "WARNING: Could not open message catalog: %s. Messages will be defaults.\n", @@ -1501,8 +1501,8 @@ main(int argc, char **argv) XtVaSetValues(dtb_palette_ab_palette_main.ab_palette_main, XmNallowShellResize, True, - XmNtitle, XtNewString(catgets(Dtb_project_catd, 6, 1, "Application Builder")), - XmNiconName, XtNewString(catgets(Dtb_project_catd, 6, 135, "dtbuilder")), + XmNtitle, XtNewString(CATGETS(Dtb_project_catd, 6, 1, "Application Builder")), + XmNiconName, XtNewString(CATGETS(Dtb_project_catd, 6, 135, "dtbuilder")), XmNinitialState, NormalState, XmNmwmDecorations, MWM_DECOR_ALL | MWM_DECOR_RESIZEH, XmNmwmFunctions, MWM_FUNC_ALL | MWM_FUNC_RESIZE, @@ -2018,7 +2018,7 @@ proj_show_open_chooserCB( NULL); /* Set up help info for shared chooser */ - tmp_txt = catgets(Dtb_project_catd,110,1,"Use the File Selection Dialog to specify which file should be used for saving and loading modules or projects"); + tmp_txt = CATGETS(Dtb_project_catd,110,1,"Use the File Selection Dialog to specify which file should be used for saving and loading modules or projects"); chooser_help_data.help_text = XtMalloc(strlen(tmp_txt)+1); strcpy(chooser_help_data.help_text,tmp_txt); } @@ -2034,7 +2034,7 @@ proj_show_open_chooserCB( info->child = (Widget) NULL; info->chooser_type = AB_OPEN_PROJ_CHOOSER; - ok_label = XmStringCreateLocalized(catgets(Dtb_project_catd, 100, 233, "Open")); + ok_label = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 233, "Open")); XtVaSetValues(AB_generic_chooser, XmNautoUnmanage, FALSE, XtVaTypedArg, XmNpattern, @@ -2047,7 +2047,7 @@ proj_show_open_chooserCB( NULL); XmStringFree(ok_label); - title = XtNewString(catgets(Dtb_project_catd, 100, 234, "Open Project")); + title = XtNewString(CATGETS(Dtb_project_catd, 100, 234, "Open Project")); XtVaSetValues(XtParent(AB_generic_chooser), XmNtitle, title, XmNpopdownCallback, &popdown_callback, @@ -2240,7 +2240,7 @@ proj_show_import_chooserCB( info->ImportAsBil = TRUE; info->ImportByCopy = TRUE; - ok_label = XmStringCreateLocalized(catgets(Dtb_project_catd, 100, 235, "Import")); + ok_label = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 235, "Import")); XtVaSetValues(AB_generic_chooser, XmNautoUnmanage, FALSE, XtVaTypedArg, XmNpattern, @@ -2252,7 +2252,7 @@ proj_show_import_chooserCB( NULL); XmStringFree(ok_label); - title = XtNewString(catgets(Dtb_project_catd, 100, 236, "Import File")); + title = XtNewString(CATGETS(Dtb_project_catd, 100, 236, "Import File")); XtVaSetValues(XtParent(AB_generic_chooser), XmNtitle, title, XmNpopdownCallback, &popdown_callback, diff --git a/cde/programs/dtappbuilder/src/ab/dtbuilder.h b/cde/programs/dtappbuilder/src/ab/dtbuilder.h index 08bd5c328..0b341b791 100644 --- a/cde/programs/dtappbuilder/src/ab/dtbuilder.h +++ b/cde/programs/dtappbuilder/src/ab/dtbuilder.h @@ -42,7 +42,7 @@ #include #include -#include +#include
#define DTB_PROJECT_CATALOG "dtbuilder" /* Handle for standard message catalog for the project */ extern nl_catd Dtb_project_catd; diff --git a/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c b/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c index 224cafc0c..658aaafb3 100644 --- a/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/help_ed_stubs.c @@ -524,37 +524,37 @@ do_auto_apply( if (changing_objects) { - sprintf(buffer, catgets(Dtb_project_catd, 100, 31, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 31, "Help properties for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ Load operation for \"%s\"."),old_name, new_name); - help_data->help_text = catgets(Dtb_project_catd, 100, 93, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 93, "Click Apply Changes to apply the changes to the\ncurrent object and load the selected object.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before loading\nthe selected object."); } else { if(new_obj != (ABObj) NULL) { - sprintf(buffer, catgets(Dtb_project_catd, 100, 32, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 32, "Help properties for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ Close operation."), old_name); - help_data->help_text = catgets(Dtb_project_catd, 100, 94, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 94, "Click Apply Changes to apply the changes to the\ncurrent object and close the Help Editor.\n\nClick Cancel if you don't want to apply the\nchanges to the current object and want the Help\nEditor to remain displayed. You can then click\nReset to undo the changes before closing the\nHelp Editor."); } else { - sprintf(buffer,catgets(Dtb_project_catd, 100, 33, + sprintf(buffer,CATGETS(Dtb_project_catd, 100, 33, "Help properties for \"%s\"\n\ have been modified but not Applied.\n\n\ You can Apply the Changes or Cancel the\n\ 'Change Object-Type' operation."), old_name); - help_data->help_text = catgets(Dtb_project_catd, 100, 95, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 95, "Click Apply Changes to apply the changes to the\ncurrent object and display the new object type.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before changing\nto a different object type."); } } diff --git a/cde/programs/dtappbuilder/src/ab/message_ed_stubs.c b/cde/programs/dtappbuilder/src/ab/message_ed_stubs.c index b002c8a6a..7840fa960 100644 --- a/cde/programs/dtappbuilder/src/ab/message_ed_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/message_ed_stubs.c @@ -1164,23 +1164,23 @@ set_msg_textp_label( { case AB_MSG_QUESTION: ui_set_label_string(mes->msg_textp_label, - catgets(Dtb_project_catd, 100, 210, "Question Message")); + CATGETS(Dtb_project_catd, 100, 210, "Question Message")); break; case AB_MSG_ERROR: ui_set_label_string(mes->msg_textp_label, - catgets(Dtb_project_catd, 100, 211, "Error Message")); + CATGETS(Dtb_project_catd, 100, 211, "Error Message")); break; case AB_MSG_WARNING: ui_set_label_string(mes->msg_textp_label, - catgets(Dtb_project_catd, 100, 212, "Warning Message")); + CATGETS(Dtb_project_catd, 100, 212, "Warning Message")); break; case AB_MSG_WORKING: ui_set_label_string(mes->msg_textp_label, - catgets(Dtb_project_catd, 100, 213, "Working Message")); + CATGETS(Dtb_project_catd, 100, 213, "Working Message")); break; case AB_MSG_INFORMATION: ui_set_label_string(mes->msg_textp_label, - catgets(Dtb_project_catd, 100, 214, "Information Message")); + CATGETS(Dtb_project_catd, 100, 214, "Information Message")); break; default: break; @@ -2361,31 +2361,31 @@ msgEdP_do_auto_apply( if (ChangingObjects) { - sprintf(buffer, catgets(Dtb_project_catd, 100, 36, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 36, "Properties for \"%s\" have been modified but not\ Applied.\nApply Changes or Cancel Load operation\ for \"%s\"."), old_name, new_name); - help_data->help_text = catgets(Dtb_project_catd, 100, 98, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 98, "Click Apply Changes to apply the changes to the\ncurrent message and load the selected message.\n\nClick Cancel if you don't want to apply the\nchanges to the current message. You can then\nclick Reset to undo the changes before loading\nthe selected message."); } else { if (new_obj != (ABObj) NULL) { - sprintf(buffer, catgets(Dtb_project_catd, 100, 35, + sprintf(buffer, CATGETS(Dtb_project_catd, 100, 35, "Properties for \"%s\" have been modified but not\ Applied.\nApply Changes or Cancel Close operation."), old_name); - help_data->help_text = catgets(Dtb_project_catd, 100, 99, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 99, "Click Apply Changes to apply the changes to the\ncurrent message and close the Message Editor.\n\nClick Cancel if you don't want to apply the\nchanges to the current message and want the\nMessage Editor to remain displayed. You can\nthen click Reset to undo the changes before\nclosing the Message Editor."); } else { - sprintf(buffer,catgets(Dtb_project_catd, 100, 39, + sprintf(buffer,CATGETS(Dtb_project_catd, 100, 39, "Properties for \"%s\" have been modified but not\ Applied.\nApply Changes or Cancel Add-Message\ operation."), old_name); - help_data->help_text = catgets(Dtb_project_catd, 100, 100, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 100, "Click Apply Changes to apply the changes to the\ncurrent message and add a new message to the\nmodule.\n\nClick Cancel if you don't want to apply the\nchanges to the current message. You can then\nclick Reset to undo the changes before adding\na new message."); } } @@ -2553,21 +2553,21 @@ static void msgEdP_strings_init(void) { msgEd_strings[MSG_ED_RETRY_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 202, "Retry")); + XtNewString(CATGETS(Dtb_project_catd, 100, 202, "Retry")); msgEd_strings[MSG_ED_OK_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 203, "OK")); + XtNewString(CATGETS(Dtb_project_catd, 100, 203, "OK")); msgEd_strings[MSG_ED_CLOSE_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 204, "Close")); + XtNewString(CATGETS(Dtb_project_catd, 100, 204, "Close")); msgEd_strings[MSG_ED_STOP_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 205, "Stop")); + XtNewString(CATGETS(Dtb_project_catd, 100, 205, "Stop")); msgEd_strings[MSG_ED_YES_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 206, "Yes")); + XtNewString(CATGETS(Dtb_project_catd, 100, 206, "Yes")); msgEd_strings[MSG_ED_NO_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 207, "No")); + XtNewString(CATGETS(Dtb_project_catd, 100, 207, "No")); msgEd_strings[MSG_ED_CONT_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 208, "Continue")); + XtNewString(CATGETS(Dtb_project_catd, 100, 208, "Continue")); msgEd_strings[MSG_ED_NO_MODULES_STR] = - XtNewString(catgets(Dtb_project_catd, 100, 209, "No Modules")); + XtNewString(CATGETS(Dtb_project_catd, 100, 209, "No Modules")); } /*** DTB_USER_CODE_END diff --git a/cde/programs/dtappbuilder/src/ab/pal_button.c b/cde/programs/dtappbuilder/src/ab/pal_button.c index c34104b5c..369b4965a 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_button.c +++ b/cde/programs/dtappbuilder/src/ab/pal_button.c @@ -190,12 +190,12 @@ button_initialize( if (obj_get_subtype(obj) == AB_BUT_MENU) { obj_set_unique_name(obj, "menubutton"); - obj_set_label(obj, catgets(Dtb_project_catd, 6, 66, "Menu Button")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 6, 66, "Menu Button")); } else /* Push or Drawn */ { obj_set_unique_name(obj, "button"); - obj_set_label(obj, catgets(Dtb_project_catd, 6, 65, "Button")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 6, 65, "Button")); } obj_set_is_initially_visible(obj, True); obj_set_is_initially_active(obj, True); diff --git a/cde/programs/dtappbuilder/src/ab/pal_choice.c b/cde/programs/dtappbuilder/src/ab/pal_choice.c index bd5af6dd0..6bb6dd69d 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_choice.c +++ b/cde/programs/dtappbuilder/src/ab/pal_choice.c @@ -203,16 +203,16 @@ choice_initialize( { case AB_CHOICE_NONEXCLUSIVE: obj_set_unique_name(obj, "checkbox"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 253, "Choice:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 253, "Choice:")); break; case AB_CHOICE_OPTION_MENU: obj_set_unique_name(obj, "optionmenu"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 254, "Options:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 254, "Options:")); break; case AB_CHOICE_EXCLUSIVE: default: obj_set_unique_name(obj, "radiobox"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 253, "Choice:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 253, "Choice:")); break; } @@ -227,8 +227,8 @@ choice_initialize( obj_set_num_columns(obj, 1); /* Add initial items to Choice */ - items[0] = catgets(Dtb_project_catd, 6, 70, "itemA"); - items[1] = catgets(Dtb_project_catd, 6, 71, "itemB"); + items[0] = CATGETS(Dtb_project_catd, 6, 70, "itemA"); + items[1] = CATGETS(Dtb_project_catd, 6, 71, "itemB"); for (i=0; i < XtNumber(items); i++) { iobj = obj_create(AB_TYPE_ITEM, NULL); diff --git a/cde/programs/dtappbuilder/src/ab/pal_combobox.c b/cde/programs/dtappbuilder/src/ab/pal_combobox.c index f637de9aa..8900ce812 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_combobox.c +++ b/cde/programs/dtappbuilder/src/ab/pal_combobox.c @@ -183,13 +183,13 @@ combo_box_initialize( obj_set_unique_name(obj, "combobox"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 255, "ComboBox:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 255, "ComboBox:")); obj_set_label_position(obj, AB_CP_WEST); obj_set_height(obj, -1); /* Add initial items to list */ - items[0] = catgets(Dtb_project_catd, 6, 70, "itemA"); - items[1] = catgets(Dtb_project_catd, 6, 71, "itemB"); + items[0] = CATGETS(Dtb_project_catd, 6, 70, "itemA"); + items[1] = CATGETS(Dtb_project_catd, 6, 71, "itemB"); for (i=0; i < XtNumber(items); i++) { iobj = obj_create(AB_TYPE_ITEM, NULL); diff --git a/cde/programs/dtappbuilder/src/ab/pal_create.c b/cde/programs/dtappbuilder/src/ab/pal_create.c index 68c00d3b3..370c9a2f3 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_create.c +++ b/cde/programs/dtappbuilder/src/ab/pal_create.c @@ -906,7 +906,7 @@ locate_obj_parent( (nobj = trav_next(&trav)) != NULL; ) if (obj_is_menubar(nobj)) { - i18n_msg = catgets(Dtb_project_catd, 100, 11, + i18n_msg = CATGETS(Dtb_project_catd, 100, 11, "There is already a Menubar for this window."); /* If we have an old buffer lying around, free it */ @@ -923,7 +923,7 @@ locate_obj_parent( } if (obj_parent == NULL) { - i18n_msg = catgets(Dtb_project_catd, 100, 15, + i18n_msg = CATGETS(Dtb_project_catd, 100, 15, "Menubars must be dropped on a Main Window."); /* If we have an old buffer lying around, free it */ @@ -944,7 +944,7 @@ locate_obj_parent( obj_is_window(obj_get_root(obj_parent)) && !obj_is_file_chooser(obj_parent)))) { - i18n_msg = catgets(Dtb_project_catd, 100, 12, + i18n_msg = CATGETS(Dtb_project_catd, 100, 12, "Containers must be dropped on\na Main Window or Custom Dialog."); /* If we have an old buffer lying around, free it */ if (errmsg != (STRING) NULL) @@ -1176,7 +1176,7 @@ locate_obj_parent( { if (obj_is_control_panel(obj)) { - i18n_msg = catgets(Dtb_project_catd, 100, 59, + i18n_msg = CATGETS(Dtb_project_catd, 100, 59, "Control Panes must be dropped on a Main Window,\nCustom Dialog, or another pane."); /* If we have an old buffer lying around, free it */ @@ -1211,7 +1211,7 @@ locate_obj_parent( (!(obj_is_container(obj_parent) && !obj_is_menubar(obj_parent)))) { - i18n_msg = catgets(Dtb_project_catd, 100, 13, + i18n_msg = CATGETS(Dtb_project_catd, 100, 13, "Panes must be dropped on a Main Window,\nCustom Dialog, or another pane."); /* If we have an old buffer lying around, free it */ @@ -1231,7 +1231,7 @@ locate_obj_parent( (!obj_is_control_panel(obj_get_root(obj_parent)) && !obj_is_group(obj_get_root(obj_parent)))) { - i18n_msg = catgets(Dtb_project_catd, 100, 14, + i18n_msg = CATGETS(Dtb_project_catd, 100, 14, "Controls must be dropped on\na Control Pane or Group."); /* If we have an old buffer lying around, free it */ if (errmsg != (STRING) NULL) @@ -1245,7 +1245,7 @@ locate_obj_parent( } else { - i18n_msg = catgets(Dtb_project_catd, 100, 16, + i18n_msg = CATGETS(Dtb_project_catd, 100, 16, "Unknown object type."); /* If we have an old buffer lying around, free it */ diff --git a/cde/programs/dtappbuilder/src/ab/pal_custdlg.c b/cde/programs/dtappbuilder/src/ab/pal_custdlg.c index 4293fee35..70c34cd8c 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_custdlg.c +++ b/cde/programs/dtappbuilder/src/ab/pal_custdlg.c @@ -201,7 +201,7 @@ custdlg_initialize( } obj_set_unique_name(obj, "dialog"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 256, "Custom Dialog")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 256, "Custom Dialog")); obj_set_bg_color(obj, "white"); obj_set_is_initially_visible(obj, False); obj_set_is_initially_active(obj, True); @@ -813,7 +813,7 @@ custdlg_create_area( obj_set_x(label, 1); obj_set_y(label, 1); pal_initialize_obj(label); - obj_set_label(label, catgets(Dtb_project_catd, 100, 264, "footer message")); + obj_set_label(label, CATGETS(Dtb_project_catd, 100, 264, "footer message")); obj_set_label_alignment(label, AB_ALIGN_LEFT); obj_set_unique_name(label, ab_ident_from_name_and_label(obj_get_name(obj), "label")); @@ -853,9 +853,9 @@ custdlg_create_buttons( int startpos, endpos; int i; - button_labels[0] = catgets(Dtb_project_catd, 100, 265, "Button1"); - button_labels[1] = catgets(Dtb_project_catd, 100, 266, "Button2"); - button_labels[2] = catgets(Dtb_project_catd, 100, 267, "Button3"); + button_labels[0] = CATGETS(Dtb_project_catd, 100, 265, "Button1"); + button_labels[1] = CATGETS(Dtb_project_catd, 100, 266, "Button2"); + button_labels[2] = CATGETS(Dtb_project_catd, 100, 267, "Button3"); endpos = 0; for(i=0; i < XtNumber(button_names); i++) diff --git a/cde/programs/dtappbuilder/src/ab/pal_fchooser.c b/cde/programs/dtappbuilder/src/ab/pal_fchooser.c index 7aa8b5197..a71a52bd6 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_fchooser.c +++ b/cde/programs/dtappbuilder/src/ab/pal_fchooser.c @@ -179,8 +179,8 @@ fchooser_initialize( name = obj_get_unique_name(obj, "file_seln", 5000, nameBuf); obj_set_name(obj, name); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 257, "File Selection Dialog")); - obj_set_ok_label(obj, catgets(Dtb_project_catd, 100, 228, "Ok")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 257, "File Selection Dialog")); + obj_set_ok_label(obj, CATGETS(Dtb_project_catd, 100, 228, "Ok")); obj_set_is_initially_visible(obj, False); obj_set_is_initially_active(obj, True); diff --git a/cde/programs/dtappbuilder/src/ab/pal_label.c b/cde/programs/dtappbuilder/src/ab/pal_label.c index 0ba76436f..d9064b5ef 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_label.c +++ b/cde/programs/dtappbuilder/src/ab/pal_label.c @@ -161,7 +161,7 @@ label_initialize( { obj_set_unique_name(obj, "label"); - obj_set_label(obj, catgets(Dtb_project_catd, 6, 69, "Label")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 6, 69, "Label")); obj_set_is_initially_visible(obj, True); obj_set_is_initially_active(obj, True); diff --git a/cde/programs/dtappbuilder/src/ab/pal_list.c b/cde/programs/dtappbuilder/src/ab/pal_list.c index 7e993ab14..ba31ef723 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_list.c +++ b/cde/programs/dtappbuilder/src/ab/pal_list.c @@ -197,8 +197,8 @@ list_initialize( obj_set_is_initially_active(obj, True); /* Add initial items to list */ - items[0] = catgets(Dtb_project_catd, 6, 70, "itemA"); - items[1] = catgets(Dtb_project_catd, 6, 71, "itemB"); + items[0] = CATGETS(Dtb_project_catd, 6, 70, "itemA"); + items[1] = CATGETS(Dtb_project_catd, 6, 71, "itemB"); for (i=0; i < XtNumber(items); i++) { iobj = obj_create(AB_TYPE_ITEM, NULL); diff --git a/cde/programs/dtappbuilder/src/ab/pal_mainwin.c b/cde/programs/dtappbuilder/src/ab/pal_mainwin.c index 2a4d1df6d..d8a21056e 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_mainwin.c +++ b/cde/programs/dtappbuilder/src/ab/pal_mainwin.c @@ -170,7 +170,7 @@ mainwin_initialize( obj_set_unique_name(obj, "mainwindow"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 258, "Main Window")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 258, "Main Window")); obj_set_bg_color(obj, "white"); obj_set_is_initially_visible(obj, True); obj_set_is_initially_iconic(obj, False); @@ -797,7 +797,7 @@ mainwin_create_area( obj_set_x(label, 1); obj_set_y(label, 1); pal_initialize_obj(label); - obj_set_label(label, catgets(Dtb_project_catd, 100, 264, "footer message")); + obj_set_label(label, CATGETS(Dtb_project_catd, 100, 264, "footer message")); obj_set_label_alignment(label, AB_ALIGN_LEFT); obj_set_unique_name(label, ab_ident_from_name_and_label(obj_get_name(obj), "label")); diff --git a/cde/programs/dtappbuilder/src/ab/pal_menu.c b/cde/programs/dtappbuilder/src/ab/pal_menu.c index 2c62da00d..079fec43c 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_menu.c +++ b/cde/programs/dtappbuilder/src/ab/pal_menu.c @@ -216,8 +216,8 @@ menu_initialize( obj_set_is_initially_active(obj, True); /* Add initial items to Choice */ - items[0] = catgets(Dtb_project_catd, 6, 136, "Item1"); - items[1] = catgets(Dtb_project_catd, 100, 259, "Item2"); + items[0] = CATGETS(Dtb_project_catd, 6, 136, "Item1"); + items[1] = CATGETS(Dtb_project_catd, 100, 259, "Item2"); for (i=0; i < XtNumber(items); i++) { iobj = obj_create(AB_TYPE_ITEM, NULL); diff --git a/cde/programs/dtappbuilder/src/ab/pal_menubar.c b/cde/programs/dtappbuilder/src/ab/pal_menubar.c index 5049a29e3..e205dd139 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_menubar.c +++ b/cde/programs/dtappbuilder/src/ab/pal_menubar.c @@ -179,9 +179,9 @@ menubar_initialize( obj_set_is_initially_active(obj, True); /* Add initial cascades to Choice */ - cascades[0] = catgets(Dtb_project_catd, 6, 20, "File"); - cascades[1] = catgets(Dtb_project_catd, 6, 21, "Edit"); - cascades[2] = catgets(Dtb_project_catd, 6, 25, "Help"); + cascades[0] = CATGETS(Dtb_project_catd, 6, 20, "File"); + cascades[1] = CATGETS(Dtb_project_catd, 6, 21, "Edit"); + cascades[2] = CATGETS(Dtb_project_catd, 6, 25, "Help"); for (i=0; i < XtNumber(cascades); i++) { iobj = obj_create(AB_TYPE_ITEM, NULL); diff --git a/cde/programs/dtappbuilder/src/ab/pal_scale.c b/cde/programs/dtappbuilder/src/ab/pal_scale.c index a6fd51282..c415d67e3 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_scale.c +++ b/cde/programs/dtappbuilder/src/ab/pal_scale.c @@ -177,12 +177,12 @@ scale_initialize( if (obj_get_read_only(obj) == False) { obj_set_unique_name(obj, "scale"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 260, "Scale:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 260, "Scale:")); } else /* Gauge */ { obj_set_unique_name(obj, "gauge"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 261, "Gauge:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 261, "Gauge:")); } obj_set_label_position(obj, AB_CP_NORTH); diff --git a/cde/programs/dtappbuilder/src/ab/pal_sep.c b/cde/programs/dtappbuilder/src/ab/pal_sep.c index 92eb2f2f5..7f56dc4e6 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_sep.c +++ b/cde/programs/dtappbuilder/src/ab/pal_sep.c @@ -157,7 +157,7 @@ separator_initialize( { obj_set_unique_name(obj, "separator"); - obj_set_label(obj, catgets(Dtb_project_catd, 22, 46, "Separator")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 22, 46, "Separator")); obj_set_line_style(obj, AB_LINE_ETCHED_IN); obj_set_is_initially_visible(obj, True); obj_set_is_initially_active(obj, True); diff --git a/cde/programs/dtappbuilder/src/ab/pal_spinbox.c b/cde/programs/dtappbuilder/src/ab/pal_spinbox.c index 4c2ad8a64..d670f47ac 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_spinbox.c +++ b/cde/programs/dtappbuilder/src/ab/pal_spinbox.c @@ -186,7 +186,7 @@ spinbox_initialize( { obj_set_unique_name(obj, "spinbox"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 262, "SpinBox:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 262, "SpinBox:")); obj_set_label_position(obj, AB_CP_NORTH); obj_set_width(obj, spinbox_init_width); obj_set_text_type(obj, AB_TEXT_NUMERIC); diff --git a/cde/programs/dtappbuilder/src/ab/pal_textf.c b/cde/programs/dtappbuilder/src/ab/pal_textf.c index e8229b443..5f3e0e001 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_textf.c +++ b/cde/programs/dtappbuilder/src/ab/pal_textf.c @@ -163,7 +163,7 @@ textf_initialize( obj_set_unique_name(obj, "textfield"); - obj_set_label(obj, catgets(Dtb_project_catd, 100, 263, "TextField:")); + obj_set_label(obj, CATGETS(Dtb_project_catd, 100, 263, "TextField:")); obj_set_is_initially_visible(obj, True); obj_set_is_initially_active(obj, True); obj_set_num_columns(obj, 8); diff --git a/cde/programs/dtappbuilder/src/ab/proj.c b/cde/programs/dtappbuilder/src/ab/proj.c index 4bf6679f5..3d92df4b8 100644 --- a/cde/programs/dtappbuilder/src/ab/proj.c +++ b/cde/programs/dtappbuilder/src/ab/proj.c @@ -1118,20 +1118,20 @@ proj_open_proj_okCB( } else if (!util_file_exists(proj_filename)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 8, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 8, "The file %s does not exist."), proj_filename); util_printf_err(Buf); } else if (!util_file_is_regular_file(proj_filename)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 69, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 69, "Cannot open %s.\n%s is not a regular file."), proj_filename, proj_filename); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 89, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 89, "The file you specified is a directory or\nanother special file."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -1198,20 +1198,20 @@ proj_import_okCB( /* If the file specified does not exist, keep up the file * chooser so that the user can specify another file. */ - sprintf(Buf, catgets(Dtb_project_catd, 100, 8, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 8, "The file %s does not exist."), file_name); util_printf_err(Buf); } else if (!util_file_is_regular_file(file_name)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 70, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 70, "Cannot import %s.\n%s is not a regular file."), file_name, file_name); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 89, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 89, "The file you specified is a directory or\nanother special file."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -1247,7 +1247,7 @@ proj_import_okCB( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 9, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 9, "%s does not have read permission."), file_name); util_printf_err(Buf); diff --git a/cde/programs/dtappbuilder/src/ab/projP_utils.c b/cde/programs/dtappbuilder/src/ab/projP_utils.c index 30a9c868e..2bcb050cc 100644 --- a/cde/programs/dtappbuilder/src/ab/projP_utils.c +++ b/cde/programs/dtappbuilder/src/ab/projP_utils.c @@ -164,7 +164,7 @@ projP_show_save_as_bil_chooser( /* Pass along the client_data to the okCallback */ ok_callback[0].closure = (XtPointer) obj; - ok_label = XmStringCreateLocalized(catgets(Dtb_project_catd, 100, 237, "Save")); + ok_label = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 237, "Save")); XtVaSetValues(AB_generic_chooser, XmNautoUnmanage, FALSE, XtVaTypedArg, XmNpattern, @@ -176,7 +176,7 @@ projP_show_save_as_bil_chooser( NULL); XmStringFree(ok_label); - title = XtNewString(catgets(Dtb_project_catd, 100, 242, "Save BIL File")); + title = XtNewString(CATGETS(Dtb_project_catd, 100, 242, "Save BIL File")); XtVaSetValues(XtParent(AB_generic_chooser), XmNtitle, title, XmNpopdownCallback, &popdown_callback, @@ -235,13 +235,13 @@ save_as_bil_okCB( } if (util_file_is_directory(fullpath)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 73, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 73, "Cannot save the module to %s.\n%s is a directory not a file."), fullpath, fullpath); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 87, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 87, "The file name you specified for saving the\nmodule is a directory. Type another file name\nfor the module."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -273,13 +273,13 @@ save_as_bil_okCB( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 76, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 76, "Cannot save module to \"%s\".\n\"%s\" does not have write permission."), mod_dir, mod_dir); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 88, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 88, "The directory you specified for saving is not\nwritable by you. Therefore, the module cannot\nbe saved. Try saving the module to another\ndirectory."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -341,10 +341,10 @@ projP_save_export_bil( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 7, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 7, "%s is a read-only file."), old_filename); - util_set_help_data(catgets(Dtb_project_catd, 100, 81, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 81, "The changes that were made cannot be saved\nbecause you do not have permission to write\nto the file."), NULL, NULL); util_printf_err(Buf); } diff --git a/cde/programs/dtappbuilder/src/ab/proj_stubs.c b/cde/programs/dtappbuilder/src/ab/proj_stubs.c index d38f2531b..dffb0a2d0 100644 --- a/cde/programs/dtappbuilder/src/ab/proj_stubs.c +++ b/cde/programs/dtappbuilder/src/ab/proj_stubs.c @@ -266,9 +266,9 @@ projP_save_mod_proc( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 10, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 10, "The file %s is a read-only file.\nCannot save edits."), file); - util_set_help_data(catgets(Dtb_project_catd, 100, 81, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 81, "The changes that were made cannot be saved\nbecause you do not have permission to write\nto the file."), NULL, NULL); util_printf_err(Buf); @@ -276,9 +276,9 @@ projP_save_mod_proc( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 76, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 76, "Cannot save module to \"%s\".\n\"%s\" does not have write permission."), mod_dir, mod_dir); - sprintf(help_buf, catgets(Dtb_project_catd, 100, 82, + sprintf(help_buf, CATGETS(Dtb_project_catd, 100, 82, "You do not have permission to write to the\ndirectory \"%s\"."), mod_dir); util_set_help_data(help_buf, NULL, NULL); util_printf_err(Buf); @@ -634,7 +634,7 @@ projP_remove_proc( /* The first thing in the message is * some general text. */ - init_msg = catgets(Dtb_project_catd, 100, 68, + init_msg = CATGETS(Dtb_project_catd, 100, 68, "The following module(s) have unsaved edits. Removing the\nmodule(s) from the project will discard your changes.\nPlease confirm."); /* If we have an old buffer lying around, free it */ diff --git a/cde/programs/dtappbuilder/src/ab/proj_utils.c b/cde/programs/dtappbuilder/src/ab/proj_utils.c index d649f98ca..2798bc8a5 100644 --- a/cde/programs/dtappbuilder/src/ab/proj_utils.c +++ b/cde/programs/dtappbuilder/src/ab/proj_utils.c @@ -438,7 +438,7 @@ proj_show_save_proj_as_chooser( info->child = (Widget) encap_cbox; info->chooser_type = AB_SAVE_PROJ_AS_CHOOSER; - ok_label = XmStringCreateLocalized(catgets(Dtb_project_catd, 100, 237, "Save")); + ok_label = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 237, "Save")); XtVaSetValues(AB_generic_chooser, XmNautoUnmanage, FALSE, XtVaTypedArg, XmNpattern, @@ -450,7 +450,7 @@ proj_show_save_proj_as_chooser( NULL); XmStringFree(ok_label); - title = XtNewString(catgets(Dtb_project_catd, 100, 238, "Save Project")); + title = XtNewString(CATGETS(Dtb_project_catd, 100, 238, "Save Project")); XtVaSetValues(XtParent(AB_generic_chooser), XmNtitle, title, XmNpopdownCallback, &popdown_callback, @@ -536,14 +536,14 @@ save_proj_as_okCB( } if (util_file_is_directory(proj_filename)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 71, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 71, "Cannot save the project to %s.\n%s is a directory not a file."), proj_filename, proj_filename); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 85, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 85, "The file name you specified for saving the project\nis a directory. Type another file name for the project."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -590,16 +590,16 @@ save_proj_as_okCB( XtVaGetValues(widget, XmNuserData, &chooserInfo, NULL); if (chooserInfo->writeEncapsulated) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 77, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 77, "Cannot save encapsulated project to \"%s\".\n\"%s\" does not have write permission."), proj_dir, proj_dir); } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 74, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 74, "Cannot save project to \"%s\".\n\"%s\" does not have write permission."), proj_dir, proj_dir); } - util_set_help_data(catgets(Dtb_project_catd, 100, 83, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 83, "The directory you specified for saving is not\nwritable by you. Therefore, the project cannot\nbe saved. Try saving the project to another directory."), NULL, NULL); util_printf_err(Buf); @@ -694,15 +694,15 @@ save_proj_as_bip( new_file, MAXPATHLEN); new_name_len = strlen(new_file); old_name_len = strlen(old_file); - msg_len = strlen(catgets(Dtb_project_catd, 100, 101, MSG)); + msg_len = strlen(CATGETS(Dtb_project_catd, 100, 101, MSG)); msg = (STRING)util_malloc((2*old_name_len)+new_name_len+msg_len +1); - help_data.help_text = catgets(Dtb_project_catd, 100, 102, HLP_MSG); + help_data.help_text = CATGETS(Dtb_project_catd, 100, 102, HLP_MSG); help_data.help_volume = NULL; help_data.help_locationID = NULL; if (msg) { - sprintf(msg, catgets(Dtb_project_catd, 100, 101, MSG), + sprintf(msg, CATGETS(Dtb_project_catd, 100, 101, MSG), new_file, old_file, old_file); xm_msg = XmStringCreateLocalized(msg); answer = dtb_show_modal_message(AB_generic_chooser, @@ -838,17 +838,17 @@ proj_show_name_dlg( help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = XtNewString(catgets(Dtb_project_catd, 100, 41, + help_data->help_text = XtNewString(CATGETS(Dtb_project_catd, 100, 41, "Type in a name for the new module. A valid name\ncan consist of letters, underscore (_), and digits,\nhowever the name must begin with either a letter or\nan underscore.")); help_data->help_volume = ""; help_data->help_locationID = ""; - dialog_title = XtNewString(catgets(Dtb_project_catd, 100, 40, + dialog_title = XtNewString(CATGETS(Dtb_project_catd, 100, 40, "Application Builder")); - textf_lbl = XtNewString(catgets(Dtb_project_catd, 100, 111, "Module Name:")); - btn1_lbl = XtNewString(catgets(Dtb_project_catd, 100, 108, "Apply")); - btn2_lbl = XtNewString(catgets(Dtb_project_catd, 100, 109, "Cancel")); - btn3_lbl = XtNewString(catgets(Dtb_project_catd, 100, 110, "Help")); + textf_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 111, "Module Name:")); + btn1_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 108, "Apply")); + btn2_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 109, "Cancel")); + btn3_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 110, "Help")); answer = ui_popup_modal_prompt( parent, dialog_title, textf_lbl, init_name, btn1_lbl, btn2_lbl, @@ -948,7 +948,7 @@ proj_show_export_bil_chooser( /* Pass along the client_data to the okCallback */ ok_callback[0].closure = (XtPointer) obj; - ok_label = XmStringCreateLocalized(catgets(Dtb_project_catd, 100, 243, "Export")); + ok_label = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 100, 243, "Export")); XtVaSetValues(AB_generic_chooser, XmNautoUnmanage, FALSE, XtVaTypedArg, XmNpattern, @@ -960,7 +960,7 @@ proj_show_export_bil_chooser( NULL); XmStringFree(ok_label); - title = XtNewString(catgets(Dtb_project_catd, 100, 239, "Export Module")); + title = XtNewString(CATGETS(Dtb_project_catd, 100, 239, "Export Module")); XtVaSetValues(XtParent(AB_generic_chooser), XmNtitle, title, XmNpopdownCallback, &popdown_callback, @@ -1012,13 +1012,13 @@ export_bil_okCB( } if (util_file_is_directory(fullpath)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 72, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 72, "Cannot export the module to %s.\n%s is a directory not a file."), fullpath, fullpath); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 84, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 84, "The file name you specified for exporting the\nmodule is a directory. Type another file name\nfor the module."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -1074,13 +1074,13 @@ export_bil_okCB( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 78, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 78, "Cannot export module to \"%s\".\n\"%s\" does not have write permission."), mod_dir, mod_dir); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_error_msg_initialize(&dtb_proj_error_msg); help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = catgets(Dtb_project_catd, 100, 86, + help_data->help_text = CATGETS(Dtb_project_catd, 100, 86, "The directory you specified for exporting is not\nwritable by you. Therefore, the module cannot be\nexported. Try exporting the module to another\ndirectory."); help_data->help_volume = ""; help_data->help_locationID = ""; @@ -1122,22 +1122,22 @@ proj_overwrite_existing_file( { if (!encapsulating) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 3, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 3, "File \"%s\" exists and\nis a read-only file. You can save your\nwork by saving to a different filename."), file); } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 53, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 53, "File \"%s\" exists and\nis a read-only file. To save the encapsulated file,\nyou must save it to a different file name."), file); } - util_set_help_data(catgets(Dtb_project_catd, 100, 79, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 79, "The file name you specified for saving already exists\nand cannot be overwritten, since it is not writable by\nyou. Your edits can be saved if you type a different\nfile name."), NULL, NULL); util_error(Buf); return (-1); } - sprintf(Buf, catgets(Dtb_project_catd, 100, 4, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 4, "File \"%s\" exists. You can:"), file); xm_buf = XmStringCreateLocalized(Buf); @@ -1197,7 +1197,7 @@ proj_save_needed( *proj_dir = 0; if (!proj_is_exploded(project)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 5, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 5, "Project %s was loaded from an encapsulated file (%s).\n\ It will be saved as a normal project, with one file per module."), projName, @@ -1245,10 +1245,10 @@ proj_save_needed( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 74, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 74, "Cannot save project to \"%s\".\n\"%s\" does not have write permission."), proj_dir, proj_dir); - util_set_help_data(catgets(Dtb_project_catd, 100, 83, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 83, "The directory you specified for saving is not\nwritable by you. Therefore, the project cannot\nbe saved. Try saving the project to another directory."), NULL, NULL); util_printf_err(Buf); @@ -1375,10 +1375,10 @@ proj_save_encapsulated( } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 77, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 77, "Cannot save encapsulated project to \"%s\".\n\"%s\" does not have write permission."), proj_dir, proj_dir); - util_set_help_data(catgets(Dtb_project_catd, 100, 83, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 83, "The directory you specified for saving is not\nwritable by you. Therefore, the project cannot\nbe saved. Try saving the project to another directory."), NULL, NULL); util_printf_err(Buf); @@ -1850,18 +1850,18 @@ proj_name_proj(void) STRING btn3_lbl = NULL; help_data = (DtbObjectHelpData) util_malloc(sizeof(DtbObjectHelpDataRec)); - help_data->help_text = XtNewString(catgets(Dtb_project_catd, 100, 42, + help_data->help_text = XtNewString(CATGETS(Dtb_project_catd, 100, 42, "Type in a name for the new project. A valid\nname can consist of letters, underscore (_),\nand digits, however the name must begin with\neither a letter or an underscore.")); help_data->help_volume = ""; help_data->help_locationID = ""; - dialog_title = XtNewString(catgets(Dtb_project_catd, 100, 40, + dialog_title = XtNewString(CATGETS(Dtb_project_catd, 100, 40, "Application Builder")); - textf_lbl = XtNewString(catgets(Dtb_project_catd, 100, 107, "Project Name:")); + textf_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 107, "Project Name:")); def_name = XtNewString("project"); - btn1_lbl = XtNewString(catgets(Dtb_project_catd, 100, 108, "Apply")); - btn2_lbl = XtNewString(catgets(Dtb_project_catd, 100, 109, "Cancel")); - btn3_lbl = XtNewString(catgets(Dtb_project_catd, 100, 110, "Help")); + btn1_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 108, "Apply")); + btn2_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 109, "Cancel")); + btn3_lbl = XtNewString(CATGETS(Dtb_project_catd, 100, 110, "Help")); /* Popup the name dialog for the project */ answer = ui_popup_modal_prompt( dtb_get_toplevel_widget(), @@ -1977,7 +1977,7 @@ create_save_encap_cbox( XmString label_xmstring = NULL; label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 240, "Save As Encapsulated Project")); + CATGETS(Dtb_project_catd, 100, 240, "Save As Encapsulated Project")); encap_toggle = XtVaCreateManagedWidget("encap_toggle", xmToggleButtonWidgetClass, parent, @@ -2004,7 +2004,7 @@ create_export_format_cbox( XmString label_xmstring = NULL; label_xmstring = XmStringCreateLocalized( - catgets(Dtb_project_catd, 100, 241, "Save As UIL")); + CATGETS(Dtb_project_catd, 100, 241, "Save As UIL")); format_toggle = XtVaCreateManagedWidget("format_toggle", xmToggleButtonWidgetClass, parent, @@ -2238,7 +2238,7 @@ export_uil_file( ** The file already exists, so post an overwrite dialog and ** see what the user wants to do. */ - sprintf(Buf, catgets(Dtb_project_catd, 100, 4, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 4, "File \"%s\" exists. You can:"), fullpath); xm_buf = XmStringCreateLocalized(Buf); dtb_proj_overwrite_msg_initialize(&dtb_proj_overwrite_msg); @@ -2554,7 +2554,7 @@ proj_verify_name( */ if ((obj != NULL) && (obj != newObj)) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 6, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 6, "%s is not a unique name for the module."), new_name ); xm_buf = XmStringCreateLocalized(Buf); diff --git a/cde/programs/dtappbuilder/src/ab/prop.c b/cde/programs/dtappbuilder/src/ab/prop.c index b44752c17..86ec99555 100644 --- a/cde/programs/dtappbuilder/src/ab/prop.c +++ b/cde/programs/dtappbuilder/src/ab/prop.c @@ -1940,9 +1940,9 @@ prop_color_ok( if (!objxm_color_exists(colorname)) { sprintf(Buf, - catgets(Dtb_project_catd, 100, 112, "%s is not a valid color."), + CATGETS(Dtb_project_catd, 100, 112, "%s is not a valid color."), colorname); - util_set_help_data(catgets(Dtb_project_catd, 100, 113, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 113, "The color that was specified is not recognized\nas a valid color name."), NULL, NULL); valid = FALSE; @@ -1977,11 +1977,11 @@ prop_graphic_filename_ok( valid = True; /* No Filename is valid */ else { - util_set_help_data(catgets(Dtb_project_catd, 100, 115, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 115, "If Graphic is specified as the Label Type for\nthe object whose properties are being modified,\nthen a pixmap (.pm, .xpm) or bitmap (.bm, .xbm)\nfile name must be specified in the Graphic Filename\nfield."), NULL, NULL); propP_popup_message(field, - catgets(Dtb_project_catd, 100, 114, + CATGETS(Dtb_project_catd, 100, 114, "The \"Graphic Filename\" field cannot be empty."), False); } } @@ -1999,11 +1999,11 @@ prop_graphic_filename_ok( ext = strrchr(filebase, '.'); ext[0] = '\0'; /* strip off extension */ - util_set_help_data(catgets(Dtb_project_catd, 100, 117, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 117, "The graphic file name extension should not be included\nwhen it is specified in the Graphic Filename field."), NULL, NULL); propP_popup_message(field, - catgets(Dtb_project_catd, 100, 116, + CATGETS(Dtb_project_catd, 100, 116, "\"Graphic Filename\" field expects the filename\nbase only (no extensions: .pm .xpm .bm .xbm).\nStripping off the extension."), True); ui_field_set_string(field, filebase); } @@ -2055,10 +2055,10 @@ prop_help_item_ok( } if (exists) { - util_set_help_data(catgets(Dtb_project_catd, 100, 119, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 119, "Two Menubar items cannot both be specified as the\nHelp cascade. To specify a different Menubar item,\nyou must first clear the item that is currently set\nto be the Help cascade, then select the new Menubar\nitem to be the Help cascade."), NULL, NULL); - sprintf(Buf, catgets(Dtb_project_catd, 100, 118, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 118, "There can only be one Help cascade per Menubar.Item\n\"%s\" is already configured to be the Help cascade,\ntherefore Item \"%s\" cannot also be the Help cascade."), obj_get_label(iobj_list[i]), obj_get_label(item_obj)); @@ -2104,10 +2104,10 @@ prop_name_ok( if (!newname || !*newname) { - util_set_help_data(catgets(Dtb_project_catd, 100, 121, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 121, "A string must be entered in the Object Name field."), NULL, NULL); - propP_popup_message( field, catgets(Dtb_project_catd, 100, 120, + propP_popup_message( field, CATGETS(Dtb_project_catd, 100, 120, "A name is required."), False); valid = FALSE; } @@ -2121,11 +2121,11 @@ prop_name_ok( { if (other != obj) { - util_set_help_data(catgets(Dtb_project_catd, 100, 123, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 123, "The name specified in the Object Name field is not\na unique name in the module. You must specify a unique\nname for the object."), NULL, NULL); - sprintf(Buf, catgets(Dtb_project_catd, 100, 122, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 122, "Another object in Module \"%s\"\nhas the name \"%s\".\nPlease enter a unique name."), util_strsafe(obj_get_name(module)),newname); propP_popup_message(field, Buf, False); valid = FALSE; @@ -2160,9 +2160,9 @@ prop_number_ok( if((s == p) || ((s + strlen(s)) != p)) { - util_set_help_data(catgets(Dtb_project_catd, 100, 125, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 125, "The field only accepts integers. You must enter\nan integer value."), NULL, NULL); - sprintf(Buf, catgets(Dtb_project_catd, 100, 124, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 124, "\"%s\" must contain an integer."), field_name); propP_popup_message(field, Buf, False); @@ -2174,9 +2174,9 @@ prop_number_ok( value = prop_str_to_int(string); if (value < min_val || value > max_val) { - util_set_help_data(catgets(Dtb_project_catd, 100, 127, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 127, "The numerical value entered into the field is not valid. Specify a value in the given range."), NULL, NULL); - sprintf(Buf, catgets(Dtb_project_catd, 100, 126, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 126, "\"%s\" value (%d) out of\nvalid range [%d - %d]."), field_name, value, min_val, max_val); propP_popup_message(field, Buf, False); @@ -2217,20 +2217,20 @@ prop_obj_name_ok( valid = TRUE; else { - util_set_help_data(catgets(Dtb_project_catd, 100, 129, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 129, "The object specified is not of the correct type.\nFor example, it is an error to specify a button\nas the Popup Menu for a Control Pane."), NULL, NULL); - sprintf(msgbuf, catgets(Dtb_project_catd, 100, 128, + sprintf(msgbuf, CATGETS(Dtb_project_catd, 100, 128, "\"%s\" is not an object of type %s."), objname, objtype_name); } } else { - util_set_help_data(catgets(Dtb_project_catd, 100, 136, + util_set_help_data(CATGETS(Dtb_project_catd, 100, 136, "The specified object does not exist or it is\nnot of the correct type."), NULL, NULL); - sprintf(msgbuf, catgets(Dtb_project_catd, 100, 130, + sprintf(msgbuf, CATGETS(Dtb_project_catd, 100, 130, "\"%s\" is not the name of an existing %s."), objname, objtype_name); } @@ -2289,7 +2289,7 @@ prop_submenu_name_ok( valid = False; - fmtStr = XtNewString(catgets(Dtb_project_catd, + fmtStr = XtNewString(CATGETS(Dtb_project_catd, 100, 132, "Menu \"%s\" is attached as a sub-menu\nto \"%s\". You cannot create a circular\nreference within menus.")); help_buf = (STRING) util_malloc(strlen(fmtStr) + @@ -2297,7 +2297,7 @@ prop_submenu_name_ok( sprintf(help_buf, fmtStr, obj_get_name(owner), menu_name); util_set_help_data(help_buf, NULL, NULL); - sprintf(msgbuf, catgets(Dtb_project_catd, 100, 131, + sprintf(msgbuf, CATGETS(Dtb_project_catd, 100, 131, "Menu \"%s\" is an ancestor of \"%s\"\ntherefore it cannot be attached as a Sub-menu."), menu_name, obj_get_name(owner)); propP_popup_message(field, msgbuf, False); @@ -2357,10 +2357,10 @@ prop_string_ok( { if (display_notice) { - util_set_help_data(catgets(Dtb_project_catd, 10, 69, + util_set_help_data(CATGETS(Dtb_project_catd, 10, 69, "Object names are used by the code generator to\ncreate C identifier names. C identifiers must\nbe composed of letters, digits, or underscores.\nTherefore, object names in App Builder must also\nfollow that rule."), NULL, NULL); - sprintf(Buf, catgets(Dtb_project_catd, 100, 133, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 133, "Only letters, digits, and [%s] allowed."), chars); propP_popup_message(field, Buf, False); } @@ -3133,22 +3133,22 @@ handle_auto_apply( { if (changing_types) { - sprintf(Buf, catgets(Dtb_project_catd, 100, 34, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 34, "Properties for \"%s\" have been modified but not Applied.\ \nApply Changes or Cancel Change-ObjectType operation."), loadedObjName); - help_data->help_text = catgets(Dtb_project_catd, 100,95, + help_data->help_text = CATGETS(Dtb_project_catd, 100,95, "Click Apply Changes to apply the changes to the\ncurrent object and display the new object type.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before changing\nto a different object type."); } else { - sprintf(Buf, catgets(Dtb_project_catd, 100, 35, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 35, "Properties for \"%s\" have been modified but not Applied.\ \nApply Changes or Cancel Close operation."), loadedObjName); - help_data->help_text = catgets(Dtb_project_catd, 100,96, + help_data->help_text = CATGETS(Dtb_project_catd, 100,96, "Click Apply Changes to apply the changes to the\ncurrent object and close the Property Editor.\n\nClick Cancel if you don't want to apply the\nchanges to the current object and want the\nProperty Editor to remain displayed. You can\nthen click Reset to undo the changes before\nclosing the Property Editor."); } } @@ -3156,12 +3156,12 @@ handle_auto_apply( { STRING newObjName = obj_get_name(new_obj); - sprintf(Buf, catgets(Dtb_project_catd, 100, 36, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 36, "Properties for \"%s\" have been modified but not Applied.\ \nApply Changes or Cancel Load operation for \"%s\"."), loadedObjName, newObjName); - help_data->help_text = catgets(Dtb_project_catd, 100,93, + help_data->help_text = CATGETS(Dtb_project_catd, 100,93, "Click Apply Changes to apply the changes to the\ncurrent object and load the selected object.\n\nClick Cancel if you don't want to apply the\nchanges to the current object. You can then\nclick Reset to undo the changes before loading\nthe selected object."); } @@ -4378,7 +4378,7 @@ menu_editCB( STRING help_buf = NULL; char Buf[256]; - fmtStr = XtNewString(catgets(Dtb_project_catd, 100, 135, + fmtStr = XtNewString(CATGETS(Dtb_project_catd, 100, 135, "The menu with the name \"%s\" does not exist in\nthe module \"%s\". Specify a valid menu name.")); help_buf = (STRING) util_malloc(strlen(fmtStr) + @@ -4386,7 +4386,7 @@ menu_editCB( sprintf(help_buf, fmtStr, current_menuname, obj_get_name(module)); util_set_help_data(help_buf, NULL, NULL); - sprintf(Buf, catgets(Dtb_project_catd, 100, 134, + sprintf(Buf, CATGETS(Dtb_project_catd, 100, 134, "Could not find menu \"%s\" in module \"%s\"."), current_menuname, obj_get_name(module)); propP_popup_message(pms->field, Buf, False); @@ -4478,35 +4478,35 @@ void strings_init(void) { LabelForString = - XtNewString(catgets(Dtb_project_catd, 100, 215, "Label:")); + XtNewString(CATGETS(Dtb_project_catd, 100, 215, "Label:")); LabelForGraphic = - XtNewString(catgets(Dtb_project_catd, 100, 216, "Graphic Filename:")); + XtNewString(CATGETS(Dtb_project_catd, 100, 216, "Graphic Filename:")); NoneItem = - XtNewString(catgets(Dtb_project_catd, 100, 217, "None")); + XtNewString(CATGETS(Dtb_project_catd, 100, 217, "None")); XFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 218, "X Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 218, "X Field")); YFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 219, "Y Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 219, "Y Field")); WFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 220, "Width Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 220, "Width Field")); HFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 221, "Height Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 221, "Height Field")); OffsetFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 222, "Offset Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 222, "Offset Field")); PercentageFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 223, "Percentage Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 223, "Percentage Field")); menu_strs[0] = - XtNewString(catgets(Dtb_project_catd, 100, 224, "None")); + XtNewString(CATGETS(Dtb_project_catd, 100, 224, "None")); menu_strs[1] = - XtNewString(catgets(Dtb_project_catd, 100, 225, "Create New Menu...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 225, "Create New Menu...")); menu_strs[2] = - XtNewString(catgets(Dtb_project_catd, 100, 226, "Menus")); + XtNewString(CATGETS(Dtb_project_catd, 100, 226, "Menus")); menu_strs[3] = - XtNewString(catgets(Dtb_project_catd, 100, 227, "Edit Current...")); + XtNewString(CATGETS(Dtb_project_catd, 100, 227, "Edit Current...")); RowColFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 250, "Rows/Columns Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 250, "Rows/Columns Field")); VertSpacingFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 251, "Vertical Spacing Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 251, "Vertical Spacing Field")); HorizSpacingFieldStr = - XtNewString(catgets(Dtb_project_catd, 100, 252, "Horizontal Spacing Field")); + XtNewString(CATGETS(Dtb_project_catd, 100, 252, "Horizontal Spacing Field")); } diff --git a/cde/programs/dtappbuilder/src/ab/prop_items.c b/cde/programs/dtappbuilder/src/ab/prop_items.c index aef076a0a..0767ecdf4 100644 --- a/cde/programs/dtappbuilder/src/ab/prop_items.c +++ b/cde/programs/dtappbuilder/src/ab/prop_items.c @@ -1195,7 +1195,7 @@ init_new_item( new_iobj->label_type = AB_LABEL_STRING; newlabel = get_unique_default_label(pis->item_list, - catgets(Dtb_project_catd, 100, 268, "Item")); + CATGETS(Dtb_project_catd, 100, 268, "Item")); obj_set_label(new_iobj, newlabel); abobj_set_item_name(new_iobj, obj_get_module(current_obj), diff --git a/cde/programs/dtappbuilder/src/abmf/ab_func_strings.c b/cde/programs/dtappbuilder/src/abmf/ab_func_strings.c index a86a87cf4..554c9332f 100644 --- a/cde/programs/dtappbuilder/src/abmf/ab_func_strings.c +++ b/cde/programs/dtappbuilder/src/abmf/ab_func_strings.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include
#include #include #include diff --git a/cde/programs/dtappbuilder/src/abmf/abmf.c b/cde/programs/dtappbuilder/src/abmf/abmf.c index 011548f97..b4251d1e0 100644 --- a/cde/programs/dtappbuilder/src/abmf/abmf.c +++ b/cde/programs/dtappbuilder/src/abmf/abmf.c @@ -48,7 +48,7 @@ #include #include #include -#include +#include
#include #include #include @@ -226,7 +226,7 @@ main(int argc, STRING *argv) /* * Open the standard message catalog for the project. */ - Dtb_project_catd = catopen("dtcodegen", NL_CAT_LOCALE); + Dtb_project_catd = CATOPEN("dtcodegen", NL_CAT_LOCALE); if (Dtb_project_catd == (nl_catd)-1) { fprintf(stderr, @@ -268,14 +268,14 @@ main(int argc, STRING *argv) if (!util_be_silent()) { util_printf( - catgets(Dtb_project_catd, 1, 1, + CATGETS(Dtb_project_catd, 1, 1, "No project file that references module(s) - using defaults\n")); } } else if (numProjFiles == 0) { util_printf( - catgets(Dtb_project_catd, 1, 2, + CATGETS(Dtb_project_catd, 1, 2, "No files specified, and no project file found\n")); abmf_usage(); } @@ -344,7 +344,7 @@ main(int argc, STRING *argv) { char *proj_file_name = istr_string_safe(cmdline->proj_file); util_printf( - catgets(Dtb_project_catd, 1, 3, "Reading project %s.\n"), + CATGETS(Dtb_project_catd, 1, 3, "Reading project %s.\n"), proj_file_name); } @@ -443,7 +443,7 @@ main(int argc, STRING *argv) char *prog_name_string = util_get_program_name(); fprintf(stderr, - catgets(Dtb_project_catd, 1, 4, + CATGETS(Dtb_project_catd, 1, 4, "%s: exiting due to error loading project.\n"), prog_name_string); exit(1); @@ -461,7 +461,7 @@ main(int argc, STRING *argv) char *prog_name_string = util_get_program_name(); fprintf(stderr, - catgets(Dtb_project_catd, 1, 5, + CATGETS(Dtb_project_catd, 1, 5, "%s: Nothing to do!\n"), prog_name_string); exit(1); } @@ -667,7 +667,7 @@ parse_args(int argc, char *argv[], CmdlineArgs cmdline) { if ((argCount + 1) >= argc) { - util_error( catgets(Dtb_project_catd, 1, 6, + util_error( CATGETS(Dtb_project_catd, 1, 6, "Missing project name for -p option")); abmf_usage(); } @@ -762,7 +762,7 @@ parse_args(int argc, char *argv[], CmdlineArgs cmdline) { char *prog_name_string = util_get_program_name(); - fprintf(stderr, catgets(Dtb_project_catd, 1, 7, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 7, "%s: Illegal option \"%s\"\n\n"), prog_name_string, arg); abmf_usage(); } @@ -780,7 +780,7 @@ parse_args(int argc, char *argv[], CmdlineArgs cmdline) if (cmdline->proj_file != NULL) { util_error( - catgets(Dtb_project_catd, 1, 8, + CATGETS(Dtb_project_catd, 1, 8, "Only one project file may be specified.")); abmf_usage(); } @@ -818,7 +818,7 @@ parse_args(int argc, char *argv[], CmdlineArgs cmdline) char *proj_file_name = istr_string_safe(cmdline->proj_file); util_printf_err( - catgets(Dtb_project_catd, 1, 9, + CATGETS(Dtb_project_catd, 1, 9, "ignoring -noproject (-np) because project file was specified: %s\n"), proj_file_name); cmdline->use_default_project = FALSE; @@ -1107,7 +1107,7 @@ load_module(ABObj module) else if (newProject != project) { util_printf_err( - catgets(Dtb_project_catd, 1, 10, + CATGETS(Dtb_project_catd, 1, 10, "Unexpected project in file %s. Aborting\n"), fileName); exit(1); } @@ -1116,7 +1116,7 @@ load_module(ABObj module) char *module_name_string = obj_get_name(module); util_printf_err( - catgets(Dtb_project_catd, 1, 11, + CATGETS(Dtb_project_catd, 1, 11, "Module %s not found in file %s. Aborting\n"), module_name_string, fileName); exit(1); @@ -1136,49 +1136,49 @@ abmf_usage(void) fprintf(stderr,"\n"); fprintf(stderr, - catgets(Dtb_project_catd, 1, 12, + CATGETS(Dtb_project_catd, 1, 12, "Usage: %s [options] [project-file] [module-file [module-file] ...]\n\n"), program_name_string); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 13, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 13, "Code is generated for each module specified on the command line, or for\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 14, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 14, "all modules in the project, if no modules are specified. If no project\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 15, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 15, "file is specified, a project file containing the specified module(s) is\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 16, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 16, "searched for in the current directory.\n\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 17, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 17, "Files with extension .bip are assumend to be BIL project files, files with\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 18, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 18, ".bix extension are assumed to be encapsulated BIL files, and files\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 19, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 19, "With a .bil extension are assumed to be BIL module files.\n\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 20, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 20, "Options (* = default, + = default with no project file):\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 21, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 21, " -help (-h) Print out this help message\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 22, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 22, " -main Write file containing main()\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 23, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 23, " -changed Only generate files that have changed\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 24, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 24, "* -merge Merge generated _stubs.c files with previous version\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 25, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 25, " -nomerge Don't merge existing and new stubs file\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 26, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 26, "* -project (-p) Specify a project to generate code for\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 27, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 27, " -noproject (-np) Use default project settings, ignore project file\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 28, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 28, "+ -showall Application shows (maps) all windows at startup\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 29, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 29, "* -noshowall Application shows (maps) only initially-visible windows\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 30, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 30, " -silent (-s) Silent mode, no messages written\n")); - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 31, + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 31, " -verbose (-v) Verbose mode, detailed progress messages\n\n")); @@ -1211,7 +1211,7 @@ find_proj_file(CmdlineArgs cmdline) dir= opendir("."); if (dir == NULL) { - perror(catgets(Dtb_project_catd,1,32,"Couldn't open '.'")); + perror(CATGETS(Dtb_project_catd,1,32,"Couldn't open '.'")); return -1; } @@ -1251,17 +1251,17 @@ find_proj_file(CmdlineArgs cmdline) int i = 0; char *prog_name_string = util_get_program_name(); - fprintf(stderr, catgets(Dtb_project_catd, 1, 33, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 33, "%s: Please specify project file (e.g."), prog_name_string); for (i = 0; i < strlist_get_num_strs(&projFiles); ++i) { fprintf(stderr, ", %s", strlist_get_str(&projFiles, i, NULL)); } - fprintf(stderr, "%s", catgets(Dtb_project_catd, 1, 34, ")\n")); + fprintf(stderr, "%s", CATGETS(Dtb_project_catd, 1, 34, ")\n")); if (!strlist_is_empty(cmdline->files)) { fprintf(stderr, - catgets(Dtb_project_catd, 1, 35, + CATGETS(Dtb_project_catd, 1, 35, "%s: More than one project contains specified module(s)\n"), prog_name_string); } @@ -2088,7 +2088,7 @@ abmfP_create_obj_data_for_module(ABObj objInModule) memset(objData, 0, objDataBytes); if (objData == NULL) { - util_printf_err(catgets(Dtb_project_catd, 1, 36, + util_printf_err(CATGETS(Dtb_project_catd, 1, 36, "Could not allocate cgen data\n")); return -1; } diff --git a/cde/programs/dtappbuilder/src/abmf/abmfP.h b/cde/programs/dtappbuilder/src/abmf/abmfP.h index a19496c3a..423984fce 100644 --- a/cde/programs/dtappbuilder/src/abmf/abmfP.h +++ b/cde/programs/dtappbuilder/src/abmf/abmfP.h @@ -51,7 +51,7 @@ #include /* FILE*, BUFSIZ */ #include #include /* MAXPATHLEN, ... */ -#include +#include
#include #include #include diff --git a/cde/programs/dtappbuilder/src/abmf/generate_code.c b/cde/programs/dtappbuilder/src/abmf/generate_code.c index 0d44d35ea..a59df6962 100644 --- a/cde/programs/dtappbuilder/src/abmf/generate_code.c +++ b/cde/programs/dtappbuilder/src/abmf/generate_code.c @@ -252,7 +252,7 @@ static int update_msg_set(MsgFile msgFile, ABObj obj); #define print_writing_message(_fname) \ {STRING progress_msg; \ - progress_msg=XtNewString(catgets(Dtb_project_catd, 1, 52, "writing"));\ + progress_msg=XtNewString(CATGETS(Dtb_project_catd, 1, 52, "writing"));\ print_progress_message(1,progress_msg,_fname);\ XtFree(progress_msg);} @@ -486,7 +486,7 @@ epilogue: if (return_value < 0) { util_puts_err("\n"); - util_puts_err(catgets(Dtb_project_catd, 1, 53, + util_puts_err(CATGETS(Dtb_project_catd, 1, 53, "** Aborting due to errors **\n")); } abmfP_res_file_close(genCodeInfo->resource_file); /* NULL OK */ @@ -544,13 +544,13 @@ write_module_files( char *prog_name_string = util_get_program_name(); char *module_name_string = obj_get_name(module); - fprintf(stderr, catgets(Dtb_project_catd, 1, 54, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 54, "%s: module filename must contain only letters\n"), prog_name_string); - fprintf(stderr, catgets(Dtb_project_catd, 1, 55, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 55, "and digits. %s will generate C variables based\n"), prog_name_string); - fprintf(stderr, catgets(Dtb_project_catd, 1, 56, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 56, "on the module filename. Please rename %s\n"), module_name_string); exit(1); } @@ -628,7 +628,7 @@ write_module_files( if ((genCodeInfo->resource_file != NULL) && (resFileName != NULL)) { char *prog_name_string = util_get_program_name(); - fprintf(stderr, catgets(Dtb_project_catd, 1, 57, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 57, "%s: writing resources for %s into %s\n"), prog_name_string, uiCFileName, @@ -888,7 +888,7 @@ write_project_files( { if (check_dates && force_write_c_file) { - util_printf(catgets(Dtb_project_catd, 1, 58, + util_printf(CATGETS(Dtb_project_catd, 1, 58, "generating %s because of changes in modules\n"), stubsFileName); } @@ -1014,7 +1014,7 @@ write_make_file( if (util_be_verbose()) { char *prog_name_string = util_get_program_name(); - fprintf(stderr, catgets(Dtb_project_catd, 1, 59, + fprintf(stderr, CATGETS(Dtb_project_catd, 1, 59, "%s: Skipping user-defined %s\n"), prog_name_string, curMakeFileName); } @@ -1037,7 +1037,7 @@ write_make_file( if (actualOSType == AB_OS_UNDEF) { - util_printf_err(catgets(Dtb_project_catd, 1, 60, + util_printf_err(CATGETS(Dtb_project_catd, 1, 60, "Could not determine OS type of this machine\n")); goto epilogue; } @@ -1049,7 +1049,7 @@ write_make_file( /* The user has modified this file since we wrote it last */ if (util_be_verbose()) { - util_printf(catgets(Dtb_project_catd, 1, 61, + util_printf(CATGETS(Dtb_project_catd, 1, 61, "Skipping user-defined %s\n"), actualMakeFileName); } } @@ -1057,20 +1057,20 @@ write_make_file( { if (!util_be_silent()) { - util_printf(catgets(Dtb_project_catd, 1, 62, + util_printf(CATGETS(Dtb_project_catd, 1, 62, "linking %s => %s\n"), curMakeFileName, actualMakeFileName); } rc = unlink(actualMakeFileName); if (util_file_exists(actualMakeFileName)) { - util_printf_err(catgets(Dtb_project_catd, 1, 63, + util_printf_err(CATGETS(Dtb_project_catd, 1, 63, "Could not remove %s\n"), actualMakeFileName); return_code(-1); } rc = link(curMakeFileName, actualMakeFileName); if (rc != 0) { - util_printf_err(catgets(Dtb_project_catd, 1, 64, + util_printf_err(CATGETS(Dtb_project_catd, 1, 64, "Could not create link to %s\n"), curMakeFileName); return_code(-1); } @@ -1647,7 +1647,7 @@ check_and_replace_file( if (orgFile == NULL) { fileSkippedReasonOut = ABMF_SKIP_ERR_OCCURRED; - util_printf_err(catgets(Dtb_project_catd, 1, 65, "%s: %s\n"), + util_printf_err(CATGETS(Dtb_project_catd, 1, 65, "%s: %s\n"), fileName, strerror(errno)); return_code(-1); } @@ -1673,7 +1673,7 @@ check_and_replace_file( if (file == NULL) { fileSkippedReasonOut = ABMF_SKIP_ERR_OCCURRED; - util_printf_err(catgets(Dtb_project_catd, 1, 65, "%s: %s\n"), + util_printf_err(CATGETS(Dtb_project_catd, 1, 65, "%s: %s\n"), fileName, strerror(errno)); return_code(ERR_OPEN); } @@ -1767,7 +1767,7 @@ replace_file(STRING fileName, File fromFile, BOOL rewindFiles) toFile = util_fopen_locked(fileName, "w"); if (toFile == NULL) { - util_printf_err(catgets(Dtb_project_catd, 1, 65, "%s: %s\n"), + util_printf_err(CATGETS(Dtb_project_catd, 1, 65, "%s: %s\n"), fileName, strerror(errno)); return ERR_OPEN; } @@ -1787,7 +1787,7 @@ print_progress_message(int verbosity, STRING message, STRING fileName) { if (util_get_verbosity() >= verbosity) { - util_printf_err(catgets(Dtb_project_catd, 1, 67, "%s %s\n"), + util_printf_err(CATGETS(Dtb_project_catd, 1, 67, "%s %s\n"), message, fileName); } return 0; @@ -1802,15 +1802,15 @@ print_skipping_message(STRING fileName, ABMF_SKIP_WHY why) switch (why) { case ABMF_SKIP_NO_CHANGES: - util_printf(catgets(Dtb_project_catd, 1, 68, + util_printf(CATGETS(Dtb_project_catd, 1, 68, "skipping (no changes) %s\n"), fileName); break; case ABMF_SKIP_UP_TO_DATE: - util_printf(catgets(Dtb_project_catd, 1, 69, + util_printf(CATGETS(Dtb_project_catd, 1, 69, "skipping (up-to-date) %s\n"), fileName); break; case ABMF_SKIP_ERR_OCCURRED: - util_printf(catgets(Dtb_project_catd, 1, 70, + util_printf(CATGETS(Dtb_project_catd, 1, 70, "skipping due to errors %s\n"), fileName); break; } @@ -1824,7 +1824,7 @@ print_backing_up_message(STRING fileFromName, STRING fileToName) { if (util_be_verbose()) { - util_printf(catgets(Dtb_project_catd, 1, 71, + util_printf(CATGETS(Dtb_project_catd, 1, 71, "saving previous %s to %s\n"), fileFromName, fileToName); } return 0; diff --git a/cde/programs/dtappbuilder/src/abmf/instances.c b/cde/programs/dtappbuilder/src/abmf/instances.c index f878dbe47..a1cc09f15 100644 --- a/cde/programs/dtappbuilder/src/abmf/instances.c +++ b/cde/programs/dtappbuilder/src/abmf/instances.c @@ -931,12 +931,12 @@ abmfP_write_add_callbacks_and_actions( util_strsafe(util_when_to_string(when)); if(src_obj_name == NULL) { - util_printf_err(catgets(Dtb_project_catd, 1, 74, + util_printf_err(CATGETS(Dtb_project_catd, 1, 74, "Ignoring unsupported WHEN - obj: when:%s\n"), when_string); } else { - util_printf_err(catgets(Dtb_project_catd, 1, 75, + util_printf_err(CATGETS(Dtb_project_catd, 1, 75, "Ignoring unsupported WHEN - obj:%s when:%s\n"), src_obj_name, when_string); } diff --git a/cde/programs/dtappbuilder/src/abmf/msg_cvt.c b/cde/programs/dtappbuilder/src/abmf/msg_cvt.c index 25c969742..b16e818fd 100644 --- a/cde/programs/dtappbuilder/src/abmf/msg_cvt.c +++ b/cde/programs/dtappbuilder/src/abmf/msg_cvt.c @@ -116,7 +116,7 @@ abmfP_catgets_prefix_str( goto cret; MsgSet_set_msg_is_referenced(msg_set, msg_num, TRUE); - sprintf(str_catg, "catgets(Dtb_project_catd, %d, %d, ", + sprintf(str_catg, "CATGETS(Dtb_project_catd, %d, %d, ", MsgSet_get_number(msg_set), msg_num); diff --git a/cde/programs/dtappbuilder/src/abmf/proj_c_file.c b/cde/programs/dtappbuilder/src/abmf/proj_c_file.c index 86b6ecc00..47a2bd934 100644 --- a/cde/programs/dtappbuilder/src/abmf/proj_c_file.c +++ b/cde/programs/dtappbuilder/src/abmf/proj_c_file.c @@ -136,7 +136,7 @@ static char *Session_Includes[] = */ static char *I18n_Includes[] = { - "", + "
", NULL, }; @@ -997,7 +997,7 @@ write_main_msg_i18n( abio_puts(codeFile, abmfP_comment_end); abio_puts(codeFile, - "Dtb_project_catd = catopen(DTB_PROJECT_CATALOG, NL_CAT_LOCALE);\n"); + "Dtb_project_catd = CATOPEN(DTB_PROJECT_CATALOG, NL_CAT_LOCALE);\n"); abio_puts(codeFile, "if (Dtb_project_catd == (nl_catd)-1)\n"); abmfP_write_c_block_begin(genCodeInfo); abio_puts(codeFile, diff --git a/cde/programs/dtappbuilder/src/abmf/proj_header_file.c b/cde/programs/dtappbuilder/src/abmf/proj_header_file.c index 8489ab2e0..f20774535 100644 --- a/cde/programs/dtappbuilder/src/abmf/proj_header_file.c +++ b/cde/programs/dtappbuilder/src/abmf/proj_header_file.c @@ -81,7 +81,7 @@ static int write_i18n_declarations(GenCodeInfo genCodeInfo, ABObj project); */ static char *I18n_Includes[] = { - "", + "
", NULL, }; diff --git a/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c b/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c index c8816297c..768f6a5ce 100644 --- a/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c +++ b/cde/programs/dtappbuilder/src/abmf/stubs_c_file.c @@ -1192,7 +1192,7 @@ abmfP_write_action_function( default: { char *obj_name_string = obj_get_name(fromObj); - util_printf_err(catgets(Dtb_project_catd, 1, 78, + util_printf_err(CATGETS(Dtb_project_catd, 1, 78, "unknown function type for action from object, %s"), obj_name_string); return_code(ERR); @@ -1469,13 +1469,13 @@ write_builtin_action( if (obj_get_name(action) != NULL) { char *action_name = obj_get_name(action); - sprintf(msg, catgets(Dtb_project_catd, 1, 76, + sprintf(msg, CATGETS(Dtb_project_catd, 1, 76, "Unknown action name, %s"), action_name); } else { int action_type = obj_get_func_builtin(action); - sprintf(msg, catgets(Dtb_project_catd, 1, 77, + sprintf(msg, CATGETS(Dtb_project_catd, 1, 77, "Unknown action type, %d"), action_type); } util_error(msg); diff --git a/cde/programs/dtappbuilder/src/abmf/utils.c b/cde/programs/dtappbuilder/src/abmf/utils.c index 6de3f0d1c..6cfd7f2f0 100644 --- a/cde/programs/dtappbuilder/src/abmf/utils.c +++ b/cde/programs/dtappbuilder/src/abmf/utils.c @@ -380,7 +380,7 @@ abmfP_calloc(size_t n, size_t size) if (p = (STRING) calloc(n, size)) return p; - util_error(catgets(Dtb_project_catd, 1, 83, "calloc: out of memory")); + util_error(CATGETS(Dtb_project_catd, 1, 83, "calloc: out of memory")); return NULL; } @@ -394,7 +394,7 @@ abmfP_malloc(size_t size) if (p = malloc(size)) return p; - util_error(catgets(Dtb_project_catd, 1, 84, "malloc: out of memory")); + util_error(CATGETS(Dtb_project_catd, 1, 84, "malloc: out of memory")); return NULL; } @@ -408,7 +408,7 @@ abmfP_realloc(void *buf, unsigned int size) if (p = realloc(buf, size)) return p; - util_error(catgets(Dtb_project_catd, 1, 85, "realloc: out of memory")); + util_error(CATGETS(Dtb_project_catd, 1, 85, "realloc: out of memory")); return NULL; } diff --git a/cde/programs/dtappbuilder/src/libABil/bilP.h b/cde/programs/dtappbuilder/src/libABil/bilP.h index fc09555e0..01f41b8bb 100644 --- a/cde/programs/dtappbuilder/src/libABil/bilP.h +++ b/cde/programs/dtappbuilder/src/libABil/bilP.h @@ -46,7 +46,7 @@ #define _ABIL_BIL_P_H_ #include -#include +#include
#include #include #include diff --git a/cde/programs/dtappbuilder/src/libABil/bil_lexer.c b/cde/programs/dtappbuilder/src/libABil/bil_lexer.c index 95eb04eec..f9f50e912 100644 --- a/cde/programs/dtappbuilder/src/libABil/bil_lexer.c +++ b/cde/programs/dtappbuilder/src/libABil/bil_lexer.c @@ -260,7 +260,7 @@ get_keyword(FILE *file, int lastChar) */ char msg[256]; sprintf(msg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 35, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 35, "unknown keyword - %s"), tokenText); abil_print_custom_load_err(msg); @@ -378,7 +378,7 @@ AByyerror(const char *message) if (strlen(tokenText) > 0) { sprintf(tokenMsg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 37, ", near '%s'"), + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 37, ", near '%s'"), tokenText); } sprintf(errMsg, "%s%s\n", message, tokenMsg); diff --git a/cde/programs/dtappbuilder/src/libABil/bil_loadatt.c b/cde/programs/dtappbuilder/src/libABil/bil_loadatt.c index bea8c284f..106bcb76e 100644 --- a/cde/programs/dtappbuilder/src/libABil/bil_loadatt.c +++ b/cde/programs/dtappbuilder/src/libABil/bil_loadatt.c @@ -1352,7 +1352,7 @@ bilP_load_att_name(BIL_TOKEN valueToken) obj_name = obj_get_name(load_obj); sprintf(msg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 36, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 36, "Duplicate name. Changed to %s.\n\t(This may be a conflict with the interface or project name)\n"), obj_name); abil_print_custom_load_err(msg); } @@ -1986,7 +1986,7 @@ bilP_load_att_type(BIL_TOKEN valueToken) /* REMIND: make cat entry! sprintf(msg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 36, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 36, "Duplicate name. Changed to %s.\n\t(This may be a conflict with the interface or project name)\n"), obj_name); */ @@ -2139,7 +2139,7 @@ bilP_load_list_value(BIL_TOKEN token) obj_set_drag_types(loadObj, dndTypeFlag); else util_dprintf(1, "%s", - abil_loadmsg(catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 48, + abil_loadmsg(CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 48, "only 1 drag-type allowed - discarding additional drag-type"))); break; diff --git a/cde/programs/dtappbuilder/src/libABil/bil_loadfile.c b/cde/programs/dtappbuilder/src/libABil/bil_loadfile.c index b8575db94..0ccad8b44 100644 --- a/cde/programs/dtappbuilder/src/libABil/bil_loadfile.c +++ b/cde/programs/dtappbuilder/src/libABil/bil_loadfile.c @@ -209,7 +209,7 @@ bil_load_file( if (bilP_load.project == NULL) { LoadErr = TRUE; - sprintf(Buf, "%s", catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 39, + sprintf(Buf, "%s", CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 39, "Unable to load project.")); errmsg = Buf; goto epilogue; diff --git a/cde/programs/dtappbuilder/src/libABil/bil_store.c b/cde/programs/dtappbuilder/src/libABil/bil_store.c index ab45f2495..47b6c0eb5 100644 --- a/cde/programs/dtappbuilder/src/libABil/bil_store.c +++ b/cde/programs/dtappbuilder/src/libABil/bil_store.c @@ -265,7 +265,7 @@ attr_is_undef( if ( obj_get_packing(obj) == AB_PACK_UNDEF ) { util_error( - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 41, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 41, "packing is undefined\n")); return (True); } @@ -285,7 +285,7 @@ attr_is_undef( if ( obj_get_menu_type(obj) == AB_MENU_UNDEF ) { util_error( - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 42, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 42, "menu type is undefined\n")); return (True); } @@ -299,7 +299,7 @@ attr_is_undef( if (obj_get_ref_point(obj) == AB_CP_UNDEF) { util_error( - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 42, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 42, "reference point is undefined\n")); return (True); } @@ -3195,7 +3195,7 @@ store_project_tree( else { util_printf_err( - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 45, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 45, "Cannot save project; Either nothing to store or NULL filename.")); } diff --git a/cde/programs/dtappbuilder/src/libABil/bil_test.c b/cde/programs/dtappbuilder/src/libABil/bil_test.c index 5a9a0c695..834270292 100644 --- a/cde/programs/dtappbuilder/src/libABil/bil_test.c +++ b/cde/programs/dtappbuilder/src/libABil/bil_test.c @@ -49,7 +49,7 @@ #include #include -#include +#include
#include #include #include diff --git a/cde/programs/dtappbuilder/src/libABil/load.c b/cde/programs/dtappbuilder/src/libABil/load.c index 3b75ff4d2..177db61f7 100644 --- a/cde/programs/dtappbuilder/src/libABil/load.c +++ b/cde/programs/dtappbuilder/src/libABil/load.c @@ -82,28 +82,28 @@ abil_loadmsg(STRING userMessage) if (*File != 0) { sprintf(tmpMsg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 27, "file: %s"), + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 27, "file: %s"), File); strcat(msg, tmpMsg); } if (lineNumber > 0) { sprintf(tmpMsg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 28, ", line: %d"), + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 28, ", line: %d"), lineNumber); strcat(msg, tmpMsg); } if (*Current_Object != 0) { sprintf(tmpMsg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET,29, ", object: %s"), + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET,29, ", object: %s"), Current_Object); strcat(msg, tmpMsg); } if (*Attribute != 0) { sprintf(tmpMsg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 30, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 30, ", attribute: %s"), Attribute); strcat(msg, tmpMsg); @@ -111,23 +111,23 @@ abil_loadmsg(STRING userMessage) if (*Action_Attr != 0) { sprintf(tmpMsg, - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 31, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 31, ", action-attribute: %s"), Action_Attr); strcat(msg, tmpMsg); } - strcat(msg, catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 32, ", ")); + strcat(msg, CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 32, ", ")); if ( (userMessage == 0) || (*userMessage == 0) ) { - strcat(msg, catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 33, + strcat(msg, CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 33, "syntax error")); } else { strcat(msg, userMessage); } - strcat(msg, catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 34, "\n")); + strcat(msg, CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 34, "\n")); return msg; } @@ -238,12 +238,12 @@ abil_print_load_err(int errmsg) if (!abil_loadmsg_err_printed()) { if(Errormsg[errmsg].msg_id < 0) { - snprintf(msg, sizeof(msg), "%s", catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 33, + snprintf(msg, sizeof(msg), "%s", CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, 33, "syntax error")); } else { snprintf(msg, sizeof(msg), "%s", - catgets(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, + CATGETS(ABIL_MESSAGE_CATD, ABIL_MESSAGE_SET, Errormsg[errmsg].msg_id, Errormsg[errmsg].def_str)); } diff --git a/cde/programs/dtappbuilder/src/libABobjXm/objxmP.h b/cde/programs/dtappbuilder/src/libABobjXm/objxmP.h index 5ab650ae7..3a8d9fddc 100644 --- a/cde/programs/dtappbuilder/src/libABobjXm/objxmP.h +++ b/cde/programs/dtappbuilder/src/libABobjXm/objxmP.h @@ -47,7 +47,7 @@ #define _OBJXM_P_H_ #include -#include +#include
#include #include diff --git a/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c b/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c index 0f79fd0e7..7598c9659 100644 --- a/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c +++ b/cde/programs/dtappbuilder/src/libABobjXm/objxm_args.c @@ -546,7 +546,7 @@ objxm_comp_set_color_args( if (status == ERR) /* Color couldn't be allocated! */ { obj_get_safe_name(rootObj, name, 256); - util_printf_err(catgets(OBJXM_MESSAGE_CATD, + util_printf_err(CATGETS(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 21, "WARNING: Object '%s'\nCould not allocate Background color \"%s\".\n\ Object's Background will default to white."), @@ -572,7 +572,7 @@ Object's Background will default to white."), if (status == ERR) /* Color couldn't be allocated! */ { obj_get_safe_name(rootObj, name, 256); - util_printf_err(catgets(OBJXM_MESSAGE_CATD, + util_printf_err(CATGETS(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 22, "WARNING: Object '%s'\nCould not allocate Foreground color \"%s\".\n\ Object's Foreground will default to black."), @@ -1667,7 +1667,7 @@ objxmP_set_attachment_arg( { char name[256]; obj_get_safe_name(obj, name, 256); - util_printf_err(catgets(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 3, + util_printf_err(CATGETS(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 3, "ERROR: %s: NULL Object attachment\n"), name); } break; diff --git a/cde/programs/dtappbuilder/src/libABobjXm/objxm_config.c b/cde/programs/dtappbuilder/src/libABobjXm/objxm_config.c index 4dce682f5..7c67138ac 100644 --- a/cde/programs/dtappbuilder/src/libABobjXm/objxm_config.c +++ b/cde/programs/dtappbuilder/src/libABobjXm/objxm_config.c @@ -309,7 +309,7 @@ xm_configure_tree( if (configCount!= numSalientObjs) { fprintf(stderr, "%s", - catgets(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 8, + CATGETS(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 8, "INTERNAL ERROR: salient counts don't match.\n") ); iRetVal= -1; goto epilogue; @@ -471,7 +471,7 @@ objxm_comp_get_subobj( char name[256]; obj_get_safe_name(obj, name, 256); fprintf(stderr, - catgets(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 9, + CATGETS(OBJXM_MESSAGE_CATD, OBJXM_MESSAGE_SET, 9, "ERROR: objxm_comp_get_subobj - object not xmconfigured: %s\n"), name); diff --git a/cde/programs/dtappbuilder/src/libABobjXm/objxm_util.c b/cde/programs/dtappbuilder/src/libABobjXm/objxm_util.c index 50e8345e8..894922396 100644 --- a/cde/programs/dtappbuilder/src/libABobjXm/objxm_util.c +++ b/cde/programs/dtappbuilder/src/libABobjXm/objxm_util.c @@ -219,25 +219,25 @@ objxm_pixmap_conversion_error_msg( char file_buf[BUF_SIZE]; if (obj != NULL) - sprintf(buf, catgets(OBJXM_MESSAGE_CATD, 203, 14, + sprintf(buf, CATGETS(OBJXM_MESSAGE_CATD, 203, 14, "Warning: %s :\n"), util_strsafe(obj_get_name(obj))); else strcpy(buf, ""); - sprintf(buf2, catgets(OBJXM_MESSAGE_CATD, 203, 15, + sprintf(buf2, CATGETS(OBJXM_MESSAGE_CATD, 203, 15, "Graphic File base '%s'\ncould not be converted to a Pixmap because\n"), filebase); strcat(buf, buf2); if (status == ERR_BAD_PARAM2) - strcat(buf, catgets(OBJXM_MESSAGE_CATD, 203, 16, + strcat(buf, CATGETS(OBJXM_MESSAGE_CATD, 203, 16, "File base is an empty string.")); else { - strcat(buf, catgets(OBJXM_MESSAGE_CATD, 203, 17, + strcat(buf, CATGETS(OBJXM_MESSAGE_CATD, 203, 17, "None of the following files could be converted to a Pixmap:\n")); if ((int)(strlen(buf) + (4 * (strlen(filebase) + 4))) > LG_BUF_SIZE) - strcat(buf, catgets(OBJXM_MESSAGE_CATD, 203, 18, + strcat(buf, CATGETS(OBJXM_MESSAGE_CATD, 203, 18, "filenames too long to display\n")); else { @@ -248,7 +248,7 @@ objxm_pixmap_conversion_error_msg( } } - util_set_help_data(catgets(OBJXM_MESSAGE_CATD, 203, 20, + util_set_help_data(CATGETS(OBJXM_MESSAGE_CATD, 203, 20, "The graphic file name specified could not be converted\ninto a pixmap. App Builder searches for a file of the\nform Filename.pm, Filename.xpm, Filename.bm, and\nFilename.xbm.\n\nEither none of those files exists in the directory specified\n(via the Graphic Filename field or if no path was specified,\nthen the current working directory), or a file exists but may\nbe corrupt."), NULL, NULL); return(buf); diff --git a/cde/programs/dtappbuilder/src/libAButil/abio.c b/cde/programs/dtappbuilder/src/libAButil/abio.c index 31f64e9a3..96a54d70f 100644 --- a/cde/programs/dtappbuilder/src/libAButil/abio.c +++ b/cde/programs/dtappbuilder/src/libAButil/abio.c @@ -1098,15 +1098,15 @@ abio_check_bil_version( STRING help_buf = NULL; STRING fileName = NULL; - fileName = name? name : catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 35, "NoName"); + fileName = name? name : CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 35, "NoName"); fileName = strdup(fileName); if (ver > Util_major_version) { - errmsg = strdup(catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 32, + errmsg = strdup(CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 32, "Incompatible BIL version")); - help_msg = catgets(UTIL_MESSAGE_CATD, + help_msg = CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 33, "The version of the BIL file %s (%3.2f)\nis not supported in this version of App Builder."); @@ -1116,10 +1116,10 @@ abio_check_bil_version( } else if (ver == 0.0) { - errmsg = strdup(catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 30, + errmsg = strdup(CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 30, "Unrecognized file format")); - help_msg = catgets(UTIL_MESSAGE_CATD, + help_msg = CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 31, "The file %s does not appear to be in BIL\nformat. Either a BIL header (:bil-version) was\nnot found or the header is corrupt."); diff --git a/cde/programs/dtappbuilder/src/libAButil/istr.c b/cde/programs/dtappbuilder/src/libAButil/istr.c index 4148c2aca..52a986519 100644 --- a/cde/programs/dtappbuilder/src/libAButil/istr.c +++ b/cde/programs/dtappbuilder/src/libAButil/istr.c @@ -167,7 +167,7 @@ istr_create ( if (insert_array(1,num_count, string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -180,7 +180,7 @@ istr_create ( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -188,7 +188,7 @@ istr_create ( if (insert_array(1,freelist[freecount-1], string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -210,7 +210,7 @@ istr_create ( if (insert_array(1, num_count, string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -223,7 +223,7 @@ istr_create ( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -232,7 +232,7 @@ istr_create ( freelist[freecount-1], string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -248,7 +248,7 @@ istr_create ( if (new_bucket == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return NULL ; } @@ -262,7 +262,7 @@ istr_create ( if (insert_array(1, num_count, string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -275,7 +275,7 @@ istr_create ( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -284,7 +284,7 @@ istr_create ( if (insert_array(1, freelist[freecount-1], string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -336,7 +336,7 @@ istrP_create_alloced_impl( if (insert_array(3,num_count, *string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -349,7 +349,7 @@ istrP_create_alloced_impl( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -357,7 +357,7 @@ istrP_create_alloced_impl( if (insert_array(3,freelist[freecount-1], *string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -379,7 +379,7 @@ istrP_create_alloced_impl( if (insert_array(3, num_count, *string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -392,7 +392,7 @@ istrP_create_alloced_impl( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -401,7 +401,7 @@ istrP_create_alloced_impl( freelist[freecount-1], *string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -417,7 +417,7 @@ istrP_create_alloced_impl( if (new_bucket == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return NULL ; } @@ -431,7 +431,7 @@ istrP_create_alloced_impl( if (insert_array(3, num_count, *string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -444,7 +444,7 @@ istrP_create_alloced_impl( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); free(new_bucket); return NULL; @@ -454,7 +454,7 @@ istrP_create_alloced_impl( if (insert_array(3, freelist[freecount-1], *string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -514,7 +514,7 @@ istr_create_const( if (insert_array(2, num_count, string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -527,7 +527,7 @@ istr_create_const( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -535,7 +535,7 @@ istr_create_const( if (insert_array(2, freelist[freecount-1], string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -557,7 +557,7 @@ istr_create_const( if (insert_array(2, num_count, string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -570,7 +570,7 @@ istr_create_const( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); return NULL; } @@ -579,7 +579,7 @@ istr_create_const( freelist[freecount-1], string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -595,7 +595,7 @@ istr_create_const( if (new_bucket == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return NULL ; } @@ -611,7 +611,7 @@ istr_create_const( if (insert_array(2, num_count, string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -624,7 +624,7 @@ istr_create_const( if(int_array[freelist[freecount-1]].refcount != 0) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 2, "ISTR: error in allocating space for string\n") ); free(new_bucket); return NULL; @@ -634,7 +634,7 @@ istr_create_const( if (insert_array(2, freelist[freecount-1], string) == -1) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 1, "ISTR: error in allocating to int array\n") ); return NULL; } @@ -758,7 +758,7 @@ istrP_destroy_impl( if (freelist == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return 0 ; } @@ -779,7 +779,7 @@ istrP_destroy_impl( if (freelist == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return 0 ; } @@ -938,7 +938,7 @@ insert_array( if (int_array == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return 0 ; } @@ -973,7 +973,7 @@ insert_array( if (int_array == NULL) { fprintf(stderr, "%s", - catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, + CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 3, "ISTR: error in allocating memory\n") ); return 0 ; } diff --git a/cde/programs/dtappbuilder/src/libAButil/utilP.h b/cde/programs/dtappbuilder/src/libAButil/utilP.h index 18a6904a2..ff9afce32 100644 --- a/cde/programs/dtappbuilder/src/libAButil/utilP.h +++ b/cde/programs/dtappbuilder/src/libAButil/utilP.h @@ -50,7 +50,7 @@ #endif #include -#include +#include
#include /* diff --git a/cde/programs/dtappbuilder/src/libAButil/util_err.c b/cde/programs/dtappbuilder/src/libAButil/util_err.c index 2bf8b1e03..699df981b 100644 --- a/cde/programs/dtappbuilder/src/libAButil/util_err.c +++ b/cde/programs/dtappbuilder/src/libAButil/util_err.c @@ -75,79 +75,79 @@ util_err_string(int errCode) switch (errCode) { case ERR_INTERNAL: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 4, "Internal error"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 4, "Internal error"); break; case ERR_RECURSION: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 5, "Recursive function calls"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 5, "Recursive function calls"); break; case ERR_NOT_ALLOWED: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 6, "Permission denied"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 6, "Permission denied"); break; case ERR_DATA_SPACE_FULL: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 8, "Data space is full"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 8, "Data space is full"); break; case ERR_BUFFER_TOO_SMALL: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 9, "Buffer is too small"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 9, "Buffer is too small"); break; case ERR_NOT_IMPLEMENTED: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 10, "Functionality is not implemented"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 10, "Functionality is not implemented"); break; case ERR_NOT_INITIALIZED: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 11, "Not initialized"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 11, "Not initialized"); break; case ERR_CLIENT: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 12, "Client error"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 12, "Client error"); break; case ERR_NOT_FOUND: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 13, "Not found"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 13, "Not found"); break; case ERR_DUPLICATE_KEY: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 14, "Duplicate key"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 14, "Duplicate key"); break; case ERR_BAD_PARAM: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 15, "Bad parameter"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 15, "Bad parameter"); break; case ERR_IO: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 16, "I/O error"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 16, "I/O error"); break; case ERR_FILE_NOT_FOUND: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 17, "File not found"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 17, "File not found"); break; case ERR_OPEN: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 18, "Could not open file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 18, "Could not open file"); break; case ERR_WRITE: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 19, "Could not write to file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 19, "Could not write to file"); break; case ERR_READ: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 20, "Could not read file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 20, "Could not read file"); break; case ERR_EOF: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 21, "End of file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 21, "End of file"); break; case ERR_BAD_FILE_FORMAT: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 22, "Bad file format"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 22, "Bad file format"); break; case ERR_RENAME: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 23, "Could not rename file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 23, "Could not rename file"); break; case ERR_MEMORY: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 24, "Memory error"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 24, "Memory error"); break; case ERR_NO_MEMORY: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 25, "No memory"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 25, "No memory"); break; case ERR_MEMORY_CORRUPT: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 26, "Memory is corrupt"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 26, "Memory is corrupt"); break; case ERR_MULTIPLE_FREE: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 27, "Multiple free of memory"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 27, "Multiple free of memory"); break; case ERR_READ_ONLY: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 28, "Read-only file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 28, "Read-only file"); break; case ERR_BACKUP: - err= catgets(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 29, "Could not backup file"); + err= CATGETS(UTIL_MESSAGE_CATD, UTIL_MESSAGE_SET, 29, "Could not backup file"); break; } diff --git a/cde/programs/dtcm/dtcm/about.c b/cde/programs/dtcm/dtcm/about.c index 45a5ea97d..5d2a3674b 100644 --- a/cde/programs/dtcm/dtcm/about.c +++ b/cde/programs/dtcm/dtcm/about.c @@ -124,7 +124,7 @@ show_about( return; } - title = XtNewString(catgets(c->DT_catd, 1, 922, "About Calendar")); + title = XtNewString(CATGETS(c->DT_catd, 1, 922, "About Calendar")); dialog = XtVaCreatePopupShell("about_dialog", xmDialogShellWidgetClass, c->frame, @@ -173,7 +173,7 @@ show_about( if (!image || image == XmUNSPECIFIED_PIXMAP) { xstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 917, "Missing\nGraphics")); + CATGETS(c->DT_catd, 1, 917, "Missing\nGraphics")); XtVaSetValues(icon_label, XmNlabelType, XmSTRING, XmNlabelString, xstr, @@ -200,7 +200,7 @@ show_about( XmNshadowType, XmSHADOW_IN, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 340, "Calendar")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 340, "Calendar")); name_label = XtVaCreateWidget("about_name_label", xmLabelWidgetClass, @@ -219,13 +219,13 @@ show_about( XmStringFree(xstr); sprintf(buf, "%s %d.%d.%d", - catgets(c->DT_catd, 1, 671, "Version"), + CATGETS(c->DT_catd, 1, 671, "Version"), DtVERSION, DtREVISION, DtUPDATE_LEVEL); #if DTCM_INTERNAL_REV > 0 strcpy(buf2, buf); sprintf(buf, "%s (%s %d)", buf2, - catgets(c->DT_catd, 1, 672, "Revision"), + CATGETS(c->DT_catd, 1, 672, "Revision"), DTCM_INTERNAL_REV); #endif @@ -248,7 +248,7 @@ show_about( XmStringFree(xstr); - sprintf(buf, "%s %d", catgets(c->DT_catd, 1, 967, + sprintf(buf, "%s %d", CATGETS(c->DT_catd, 1, 967, "Calendar Server Version"), get_server_version(c->my_cal_handle)); @@ -271,7 +271,7 @@ show_about( XmStringFree(xstr); - sprintf(buf, "%s %d", catgets(c->DT_catd, 1, 968, + sprintf(buf, "%s %d", CATGETS(c->DT_catd, 1, 968, "Calendar Data Version"), c->my_cal_version); @@ -328,7 +328,7 @@ show_about( NULL); XmStringFree(xstr); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 674, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 674, "Copyright (c) 1993, 1994, 1995:")); copyright_label = XtVaCreateWidget("copyright_label", @@ -347,7 +347,7 @@ show_about( NULL); XmStringFree(xstr); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 675, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 675, "Hewlett-Packard Company")); hp_label = XtVaCreateWidget("hp_label", @@ -366,7 +366,7 @@ show_about( NULL); XmStringFree(xstr); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 676, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 676, "International Business Machines Corp.")); ibm_label = XtVaCreateWidget("ibm_label", @@ -385,7 +385,7 @@ show_about( NULL); XmStringFree(xstr); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 677, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 677, "Novell, Inc.")); novell_label = XtVaCreateWidget("novell_label", @@ -404,7 +404,7 @@ show_about( NULL); XmStringFree(xstr); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 678, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 678, "Sun Microsystems, Inc.")); sun_label = XtVaCreateWidget("sun_label", @@ -426,7 +426,7 @@ show_about( #endif #ifdef CREDITS - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 679, "More...")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 679, "More...")); more_button = XtVaCreateWidget("more_button", xmPushButtonGadgetClass, main_form, @@ -457,7 +457,7 @@ show_about( XmNrightOffset, 0, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); close_button = XtVaCreateWidget("close_button", xmPushButtonGadgetClass, main_form, XmNlabelString, xstr, @@ -577,7 +577,7 @@ do_credits( return; } - title = XtNewString(catgets(c->DT_catd, 1, 681, "Calendar Contributors")); + title = XtNewString(CATGETS(c->DT_catd, 1, 681, "Calendar Contributors")); dialog = XtVaCreatePopupShell("contrib_dialog", xmDialogShellWidgetClass, c->frame, @@ -611,7 +611,7 @@ do_credits( if (!image || image == XmUNSPECIFIED_PIXMAP) { xstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 918, "Missing\nGraphics")); + CATGETS(c->DT_catd, 1, 918, "Missing\nGraphics")); XtVaSetValues(icon_label, XmNlabelType, XmSTRING, XmNlabelString, xstr, @@ -636,7 +636,7 @@ do_credits( XmNrightAttachment, XmATTACH_FORM, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 682, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 682, "This application was brought to you by:")); title_label = XtVaCreateWidget("title_label", @@ -679,7 +679,7 @@ do_credits( XmStringFree(xstr); } - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 1002, + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 1002, "Also contributing:")); title_label = XtVaCreateWidget("title_label", @@ -735,7 +735,7 @@ do_credits( XmNrightOffset, 0, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); close_button = XtVaCreateWidget("close_button", xmPushButtonGadgetClass, main_form, XmNlabelString, xstr, diff --git a/cde/programs/dtcm/dtcm/alarm.c b/cde/programs/dtcm/dtcm/alarm.c index 545630dce..f7631d066 100644 --- a/cde/programs/dtcm/dtcm/alarm.c +++ b/cde/programs/dtcm/dtcm/alarm.c @@ -218,7 +218,7 @@ mail_it(XtPointer client_data, XtIntervalId *interval_id, CSA_reminder_reference (appt->mail->value->item.reminder_value->reminder_data.size == 0)) { /* empty recipient */ if (debug) - fprintf(stderr, "%s", catgets(c->DT_catd, 1, 1, + fprintf(stderr, "%s", CATGETS(c->DT_catd, 1, 1, "dtcm: empty recipient in mail reminder\n")); to = appt->author->value->item.calendar_user_value->user_name; } else { @@ -229,7 +229,7 @@ mail_it(XtPointer client_data, XtIntervalId *interval_id, CSA_reminder_reference /* compose subject field */ lines = text_to_lines(appt->what->value->item.string_value, 5); - sprintf(subbuf, catgets(c->DT_catd, 1, 2, "Reminder- %s"), + sprintf(subbuf, CATGETS(c->DT_catd, 1, 2, "Reminder- %s"), (lines) ? lines->s : "\0"); /* compose message body */ @@ -256,8 +256,8 @@ mail_it(XtPointer client_data, XtIntervalId *interval_id, CSA_reminder_reference pm = (dt == HOUR12 && !adjust_hour(&hr)) ? True : False; if (dt == HOUR12) { sprintf(stopbuf, "%2d:%02d %s", hr, minute(stop), - pm ? catgets(c->DT_catd, 1, 3, "pm") : - catgets(c->DT_catd, 1, 4, "am")); + pm ? CATGETS(c->DT_catd, 1, 3, "pm") : + CATGETS(c->DT_catd, 1, 4, "am")); } else { sprintf(stopbuf, "%02d%02d", hr, minute(stop)); } @@ -280,10 +280,10 @@ mail_it(XtPointer client_data, XtIntervalId *interval_id, CSA_reminder_reference destroy_lines(lines); if (stopbuf[0] != '\0') { - sprintf(bodybuf, catgets(c->DT_catd, 1, 7, "\n\n\t** Calendar Appointment **\n\n\tDate:\t%s\n\tStart:\t%s\n\tEnd:\t%s\n\tWhat:\t%s"), + sprintf(bodybuf, CATGETS(c->DT_catd, 1, 7, "\n\n\t** Calendar Appointment **\n\n\tDate:\t%s\n\tStart:\t%s\n\tEnd:\t%s\n\tWhat:\t%s"), datebuf, startbuf, stopbuf, whatbuf); } else { - sprintf(bodybuf, catgets(c->DT_catd, 1, 1100, "\n\n\t** Calendar To Do Item **\n\n\tDue Date:\t%s\n\tTime Due:\t%s\n\tWhat:\t\t%s"), + sprintf(bodybuf, CATGETS(c->DT_catd, 1, 1100, "\n\n\t** Calendar To Do Item **\n\n\tDue Date:\t%s\n\tTime Due:\t%s\n\tWhat:\t\t%s"), datebuf, startbuf, whatbuf); } @@ -413,7 +413,7 @@ postup_show_proc(Calendar *c, CSA_reminder_reference *r) { /* ** Create the Motif objects */ - title = XtNewString(catgets(c->DT_catd, 1, 839, "Calendar : Reminder")); + title = XtNewString(CATGETS(c->DT_catd, 1, 839, "Calendar : Reminder")); pu_frame = XtVaCreatePopupShell("pu_frame", topLevelShellWidgetClass, c->postup, XmNtitle, title, @@ -456,7 +456,7 @@ postup_show_proc(Calendar *c, CSA_reminder_reference *r) { XmNfractionBase, 3, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); pu_close = XtVaCreateManagedWidget("close", xmPushButtonWidgetClass, button_form, XmNtopAttachment, XmATTACH_FORM, @@ -590,12 +590,12 @@ postup_show_proc(Calendar *c, CSA_reminder_reference *r) { $6 -> am or pm */ - char *am = XtNewString(catgets(c->DT_catd, + char *am = XtNewString(CATGETS(c->DT_catd, 1, 4, "am")); - char *pm = XtNewString(catgets(c->DT_catd, + char *pm = XtNewString(CATGETS(c->DT_catd, 1, 3, "pm")); stop_am = adjust_hour(&stop_hr); - sprintf(text, catgets(c->DT_catd, 1, 1087, + sprintf(text, CATGETS(c->DT_catd, 1, 1087, "From %1$2d:%2$02d%3$s to %4$2d:%5$02d%6$s"), start_hr, minute(st), (start_am) ? am : pm, @@ -624,10 +624,10 @@ postup_show_proc(Calendar *c, CSA_reminder_reference *r) { */ char *meridian = XtNewString ((start_am) ? - catgets(c->DT_catd, 1, 4, "am"): - catgets(c->DT_catd, 1, 3, "pm")); + CATGETS(c->DT_catd, 1, 4, "am"): + CATGETS(c->DT_catd, 1, 3, "pm")); - sprintf(text, catgets(c->DT_catd, 1, 1088, + sprintf(text, CATGETS(c->DT_catd, 1, 1088, "%1$2d:%2$02d%3$s"), start_hr, minute(st), meridian ); @@ -654,7 +654,7 @@ postup_show_proc(Calendar *c, CSA_reminder_reference *r) { $4 -> stop minute */ - sprintf(text, catgets(c->DT_catd, 1, 1089, + sprintf(text, CATGETS(c->DT_catd, 1, 1089, "From %1$02d%2$02d to %3$02d%4$02d"), start_hr, minute(st), stop_hr, minute(sp)); @@ -677,7 +677,7 @@ postup_show_proc(Calendar *c, CSA_reminder_reference *r) { $2 -> start minute */ - sprintf(text, catgets(c->DT_catd, 1, 1090, + sprintf(text, CATGETS(c->DT_catd, 1, 1090, "%1$02d%2$02d"), start_hr, minute(st)); } diff --git a/cde/programs/dtcm/dtcm/blist.c b/cde/programs/dtcm/dtcm/blist.c index 98139a739..dd33a40fe 100644 --- a/cde/programs/dtcm/dtcm/blist.c +++ b/cde/programs/dtcm/dtcm/blist.c @@ -96,7 +96,7 @@ bl_pending_change(Widget w, XtPointer data, XtPointer cbs) { of the string so the footer will use two lines and the editor will grow vertically. */ - set_message(bl->message, catgets(c->DT_catd, 1, 841, "Click on \"Add Name\" to add a name, \"Apply\" to commit changes.")); + set_message(bl->message, CATGETS(c->DT_catd, 1, 841, "Click on \"Add Name\" to add a name, \"Apply\" to commit changes.")); bl->bl_pending_message_up = True; XtSetSensitive(bl->add_button, True); } @@ -163,14 +163,14 @@ blist_removenames(Widget widget, XtPointer client_data, XtPointer call_data) { set_message(bl->message, " "); XmListGetSelectedPos(bl->browse_list, &pos_list, &pos_cnt); if (pos_cnt <= 0) { - set_message(bl->message, catgets(calendar->DT_catd, 1, 17, + set_message(bl->message, CATGETS(calendar->DT_catd, 1, 17, "Select a name to remove")); return; } for (i = 0; i < pos_cnt; i++) { if (pos_list[i] == 1) { - set_message(bl->message, catgets(calendar->DT_catd, 1, + set_message(bl->message, CATGETS(calendar->DT_catd, 1, 16, "You may not remove the default calendar")); rejected_name++; continue; @@ -294,13 +294,13 @@ blist_addname(Widget widget, XtPointer client_data, XtPointer cbs) { if (blank_buf(new_name)) { - set_message(bl->message, catgets(c->DT_catd, 1, 603, + set_message(bl->message, CATGETS(c->DT_catd, 1, 603, "Type a name to add in the User Name field")); return; } if (embedded_blank(new_name)) { - set_message(bl->message, catgets(c->DT_catd, 1, 684, + set_message(bl->message, CATGETS(c->DT_catd, 1, 684, "User Names may not have embedded blanks or tabs")); return; } @@ -313,7 +313,7 @@ blist_addname(Widget widget, XtPointer client_data, XtPointer cbs) { cm_select_text(bl->username, e->xbutton.time); } else { sprintf(buf, "%s %s", new_name, - catgets(c->DT_catd, 1, 604, "is already in the list")); + CATGETS(c->DT_catd, 1, 604, "is already in the list")); set_message(bl->message, buf); } XtVaSetValues(bl->form, XmNresizePolicy, XmRESIZE_ANY, NULL); @@ -546,7 +546,7 @@ make_browselist(Calendar *c) if (!bl) return; - title = XtNewString(catgets(c->DT_catd, 1, 963, + title = XtNewString(CATGETS(c->DT_catd, 1, 963, "Calendar : Menu Editor")); bl->frame = XtVaCreatePopupShell("menu_editor_frame", xmDialogShellWidgetClass, c->frame, @@ -565,7 +565,7 @@ make_browselist(Calendar *c) NULL); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 410, "User Name:")); + CATGETS(c->DT_catd, 1, 410, "User Name:")); bl->username_label = XtVaCreateWidget("name_label", xmLabelGadgetClass, bl->form, XmNlabelString, label_str, @@ -582,7 +582,7 @@ make_browselist(Calendar *c) bl->edit_rc_mgr = XmCreateRowColumn(bl->form, "edit_rc_mgr", args, ac); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 686, "Add Name")); + CATGETS(c->DT_catd, 1, 686, "Add Name")); bl->add_button = XtVaCreateWidget("add_button", xmPushButtonWidgetClass, bl->edit_rc_mgr, XmNlabelString, label_str, @@ -593,7 +593,7 @@ make_browselist(Calendar *c) blist_addname, (XtPointer)c); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 687, "Remove Name")); + CATGETS(c->DT_catd, 1, 687, "Remove Name")); bl->remove_button = XtVaCreateWidget("remove_button", xmPushButtonWidgetClass, bl->edit_rc_mgr, XmNlabelString, label_str, @@ -632,7 +632,7 @@ make_browselist(Calendar *c) NULL); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 688, "Browse Menu Items")); + CATGETS(c->DT_catd, 1, 688, "Browse Menu Items")); bl->list_label = XtVaCreateWidget("list_label", xmLabelWidgetClass, bl->form, XmNlabelString, label_str, @@ -671,7 +671,7 @@ make_browselist(Calendar *c) XmNbottomOffset, 5, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 655, "OK")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 655, "OK")); bl->ok_button = XtVaCreateWidget("ok_button", xmPushButtonWidgetClass, button_form, @@ -689,7 +689,7 @@ make_browselist(Calendar *c) (XtPointer)c); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 460, "Apply")); + CATGETS(c->DT_catd, 1, 460, "Apply")); bl->apply_button = XtVaCreateWidget("apply_button", xmPushButtonWidgetClass, button_form, @@ -707,7 +707,7 @@ make_browselist(Calendar *c) (XtPointer)c); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 691, "Reset")); + CATGETS(c->DT_catd, 1, 691, "Reset")); bl->reset_button = XtVaCreateWidget("reset_button", xmPushButtonWidgetClass, button_form, @@ -725,7 +725,7 @@ make_browselist(Calendar *c) blist_reset_cb, (XtPointer)c); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 923, "Cancel")); + CATGETS(c->DT_catd, 1, 923, "Cancel")); bl->cancel_button = XtVaCreateWidget("cancel_button", xmPushButtonWidgetClass, button_form, @@ -742,7 +742,7 @@ make_browselist(Calendar *c) XtAddCallback(bl->cancel_button, XmNactivateCallback, blist_cancel_cb, (XtPointer)c); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); bl->help_button = XtVaCreateWidget("help_button", xmPushButtonWidgetClass, button_form, diff --git a/cde/programs/dtcm/dtcm/browser.c b/cde/programs/dtcm/dtcm/browser.c index 736038694..8ab86f1b8 100644 --- a/cde/programs/dtcm/dtcm/browser.c +++ b/cde/programs/dtcm/dtcm/browser.c @@ -163,11 +163,11 @@ static void invalid_date_msg(Calendar *c, Widget widget) { Browser *b = (Browser*)c->browser; - char *title = XtNewString(catgets(c->DT_catd, 1, 1070, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1070, "Calendar : Error - Compare Calendars")); - char *text = XtNewString(catgets(c->DT_catd, 1, 20, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 20, "Invalid Date In Go To Field.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(b->frame, DIALOG_TITLE, title, @@ -271,7 +271,7 @@ make_browser(Calendar *c) upform_min = 200; } - title = XtNewString(catgets(c->DT_catd, 1, 1010, + title = XtNewString(CATGETS(c->DT_catd, 1, 1010, "Calendar : Compare Calendars")); b->frame = XtVaCreatePopupShell("frame", xmDialogShellWidgetClass, c->frame, @@ -308,7 +308,7 @@ make_browser(Calendar *c) XmNpaneMinimum, upform_min, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 22, "Browse Menu Items")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 22, "Browse Menu Items")); b->list_label = XtVaCreateWidget("browseMenuLabel", xmLabelGadgetClass, b->upper_form, XmNlabelString, xmstr, @@ -318,7 +318,7 @@ make_browser(Calendar *c) NULL); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 21, "Edit List...")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 21, "Edit List...")); b->edit_list = XtVaCreateWidget("editList", xmPushButtonGadgetClass, b->upper_form, XmNlabelString, xmstr, @@ -361,17 +361,17 @@ make_browser(Calendar *c) * Create the "go to" option menu for time navigation */ prev_week = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 23, "Prev Week")); + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 23, "Prev Week")); this_week = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 24, "This Week")); + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 24, "This Week")); next_week = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 25, "Next Week")); + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 25, "Next Week")); prev_month = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 26, "Prev Month")); + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 26, "Prev Month")); next_month = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 27, "Next Month")); + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 27, "Next Month")); goto_label = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 28, "Go To:")); + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 28, "Go To:")); /* * remember - this returns a RowColumn widget! @@ -452,7 +452,7 @@ make_browser(Calendar *c) xmFormWidgetClass, b->outer_pane, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 29, "Schedule...")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 29, "Schedule...")); b->schedule = XtVaCreateWidget("schedule", xmPushButtonGadgetClass, b->action, XmNlabelString, xmstr, @@ -462,7 +462,7 @@ make_browser(Calendar *c) XmStringFree(xmstr); XtAddCallback(b->schedule, XmNactivateCallback, schedule_cb, (XtPointer)c); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 30, "Mail...")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 30, "Mail...")); b->mail = XtVaCreateWidget("mail", xmPushButtonGadgetClass, b->action, XmNlabelString, xmstr, @@ -475,7 +475,7 @@ make_browser(Calendar *c) XtSetSensitive(b->mail, c->tt_procid == NULL ? False : True); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); b->cancel = XtVaCreateWidget("cancel", xmPushButtonGadgetClass, b->action, XmNlabelString, xmstr, @@ -486,7 +486,7 @@ make_browser(Calendar *c) XmStringFree(xmstr); XtAddCallback(b->cancel, XmNactivateCallback, cancel_cb, (XtPointer)c); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); b->helpbutton = XtVaCreateWidget("help", xmPushButtonGadgetClass, b->action, XmNlabelString, xmstr, @@ -693,10 +693,10 @@ mb_display_footermess(Browser *b, Calendar *c) XtVaGetValues(b->browse_list, XmNselectedItemCount, &num_cals, NULL); if (num_cals == 1) sprintf(buf, "%d %s", num_cals, - catgets(c->DT_catd, 1, 31, "Calendar Displayed")); + CATGETS(c->DT_catd, 1, 31, "Calendar Displayed")); else sprintf(buf, "%d %s", num_cals, - catgets(c->DT_catd, 1, 32, "Calendars Displayed")); + CATGETS(c->DT_catd, 1, 32, "Calendars Displayed")); set_message(b->message_text, buf); } @@ -1117,11 +1117,11 @@ register_names(char *name, Calendar *c) while ((bd = (BlistData *)CmDataListGetData(bl->blist_data, i++)) && strcmp(bd->name, name) != 0); if (!bd) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1070, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1070, "Calendar : Error - Compare Calendars")); - char *text = XtNewString(catgets(c->DT_catd, 1, 607, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 607, "Internal error registering calendar name.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(b->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, diff --git a/cde/programs/dtcm/dtcm/calendar.h b/cde/programs/dtcm/dtcm/calendar.h index 046c03731..096a3a4c9 100644 --- a/cde/programs/dtcm/dtcm/calendar.h +++ b/cde/programs/dtcm/dtcm/calendar.h @@ -54,7 +54,7 @@ #include #include -#include +#include
#include #include "util.h" #include "timeops.h" diff --git a/cde/programs/dtcm/dtcm/calendarA.c b/cde/programs/dtcm/dtcm/calendarA.c index 6f079daee..a99c21b7d 100644 --- a/cde/programs/dtcm/dtcm/calendarA.c +++ b/cde/programs/dtcm/dtcm/calendarA.c @@ -61,7 +61,7 @@ static char sccsid[] = "@(#)calendarA.c 1.196 95/04/12 Copyr 1991 Sun Microsyst #include /* SYS_NMLN */ #endif /* SVR4 specific includes */ #include -#include +#include
#include #include #include @@ -995,22 +995,22 @@ make_view_menu(Calendar *c) Arg al[10]; int ac; - day_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 33, "Day")); - week_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 34, "Week")); + day_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 33, "Day")); + week_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 34, "Week")); month_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 35, "Month")); - year_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 36, "Year")); + CATGETS(c->DT_catd, 1, 35, "Month")); + year_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 36, "Year")); tz_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 37, "Time Zone...")); + CATGETS(c->DT_catd, 1, 37, "Time Zone...")); apptlist_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 38, "Appointment List...")); + CATGETS(c->DT_catd, 1, 38, "Appointment List...")); todo_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 965, "To Do List...")); - view_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 40, "View")); + CATGETS(c->DT_catd, 1, 965, "To Do List...")); + view_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 40, "View")); findappts = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 41, "Find...")); + CATGETS(c->DT_catd, 1, 41, "Find...")); gotodate = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 42, "Go to Date...")); + CATGETS(c->DT_catd, 1, 42, "Go to Date...")); view_menu = XmCreatePulldownMenu(c->menu_bar, "viewMenu", NULL, 0); @@ -1229,11 +1229,11 @@ browse_cb(Widget w, XtPointer client_data, XtPointer cbs) { Browselist *bl = (Browselist *)c->browselist; if (!(bd = (BlistData *)CmDataListGetData(bl->blist_data, idx))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1072, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1072, "Calendar : Error - Browse")); - char *text = XtNewString(catgets(c->DT_catd, 1, 610, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 610, "Internal error retrieving calendar name.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1274,7 +1274,7 @@ make_file_menu(Calendar *c) ac = 0; xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 68, "Print Current View")); + CATGETS(c->DT_catd, 1, 68, "Print Current View")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; pr_current = XmCreatePushButtonGadget(file_menu, "printCurrent", al, ac); @@ -1282,7 +1282,7 @@ make_file_menu(Calendar *c) XmStringFree(xmstr); ac = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 69, "Print...")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 69, "Print...")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; print = XmCreatePushButtonGadget(file_menu, "print", al, ac); XtAddCallback(print, XmNactivateCallback, print_cb, NULL); @@ -1293,7 +1293,7 @@ make_file_menu(Calendar *c) ac = 0; xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 72, "Options...")); + CATGETS(c->DT_catd, 1, 72, "Options...")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; opts = XmCreatePushButtonGadget(file_menu, "options", al, ac); XtAddCallback(opts, XmNactivateCallback, edit_cb, (XtPointer) 1); @@ -1303,7 +1303,7 @@ make_file_menu(Calendar *c) sep = XmCreateSeparatorGadget(file_menu, "separator2", al, ac); ac = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 73, "Exit")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 73, "Exit")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; exit = XmCreatePushButtonGadget(file_menu, "exit", al, ac); XtAddCallback(exit, XmNactivateCallback, quit_handler, (XtPointer) c); @@ -1313,7 +1313,7 @@ make_file_menu(Calendar *c) ac = 0; XtSetArg(al[ac], XmNsubMenuId, file_menu); ac++; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 65, "File")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 65, "File")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; file_btn = (Widget) XmCreateCascadeButton(c->menu_bar, "file", al, ac); XtAddCallback(file_btn, XmNhelpCallback, (XtCallbackProc)help_cb, @@ -1331,11 +1331,11 @@ make_edit_menu(Calendar *c) int ac; appt_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 74, "Appointment...")); + CATGETS(c->DT_catd, 1, 74, "Appointment...")); todo_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 966, "To Do...")); + CATGETS(c->DT_catd, 1, 966, "To Do...")); edit_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 76, "Edit")); + CATGETS(c->DT_catd, 1, 76, "Edit")); edit_menu = XmCreatePulldownMenu(c->menu_bar, "editMenu", NULL, 0); @@ -1373,18 +1373,18 @@ make_help_menu(Calendar *c) Widget cascade, help_menu, w_overview, w_tasks, w_ref, w_onitem, w_using, w_about, w_sep; - help = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + help = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); overview = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 612, "Overview...")); - tasks = XmStringCreateLocalized(catgets(c->DT_catd, 1, 79, "Tasks...")); + CATGETS(c->DT_catd, 1, 612, "Overview...")); + tasks = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 79, "Tasks...")); ref = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 80, "Reference...")); + CATGETS(c->DT_catd, 1, 80, "Reference...")); onitem = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 964, "On Item")); + CATGETS(c->DT_catd, 1, 964, "On Item")); using = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 82, "Using Help...")); + CATGETS(c->DT_catd, 1, 82, "Using Help...")); about = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 613, "About Calendar...")); + CATGETS(c->DT_catd, 1, 613, "About Calendar...")); help_menu = XmCreatePulldownMenu(c->menu_bar, "helpMenu", NULL, 0); @@ -1515,7 +1515,7 @@ update_browse_menu_names(Calendar *c) { NULL); ac = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 84, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 84, "Show Other Calendar...")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; item = XmCreatePushButtonGadget(c->browse_menu, "showOther", al, ac); @@ -1523,7 +1523,7 @@ update_browse_menu_names(Calendar *c) { XmStringFree(xmstr); ac = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 85, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 85, "Compare Calendars...")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; item = XmCreatePushButtonGadget(c->browse_menu, "compare", al, ac); @@ -1531,7 +1531,7 @@ update_browse_menu_names(Calendar *c) { XmStringFree(xmstr); ac = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 86, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 86, "Menu Editor...")); XtSetArg(al[ac], XmNlabelString, xmstr); ac++; item = XmCreatePushButtonGadget(c->browse_menu, "editMenu", al, ac); @@ -1575,7 +1575,7 @@ make_browse_menu(Calendar *c) { */ update_browse_menu_names(c); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 87, "Browse")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 87, "Browse")); XtSetArg(al[ac], XmNsubMenuId, c->browse_menu); ac++; XtSetArg(al[ac], XmNlabelString, xmstr); ac++; c->browse_button = XmCreateCascadeButton(c->menu_bar, "browse", al, ac); @@ -1624,7 +1624,7 @@ make_buttons(Calendar *c) Screen *s; today_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 88, "Today")); + CATGETS(c->DT_catd, 1, 88, "Today")); ac=0; XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; @@ -1946,7 +1946,7 @@ quit_handler(Widget w, XtPointer cdata, XtPointer cbs) { Calendar *c = (Calendar *)cdata; if (debug) - fprintf(stderr, "%s", catgets(c->DT_catd, 1, 89, "in quit_handler\n")); + fprintf(stderr, "%s", CATGETS(c->DT_catd, 1, 89, "in quit_handler\n")); if (editor_showing((Editor*) c->editor) || todo_showing((ToDo*) c->todo)) @@ -2033,20 +2033,20 @@ error_open(Calendar *c) { char *name, *host; Props_pu *p = (Props_pu *)c->properties_pu; - char *nl_user = XtNewString(catgets(c->DT_catd, 1, 92, "User name")); - char *nl_host = XtNewString(catgets(c->DT_catd, 1, 93, "Host")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *nl_user = XtNewString(CATGETS(c->DT_catd, 1, 92, "User name")); + char *nl_host = XtNewString(CATGETS(c->DT_catd, 1, 93, "Host")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); char *title = - XtNewString(catgets(c->DT_catd, 1, 94, "Calendar : Error")); + XtNewString(CATGETS(c->DT_catd, 1, 94, "Calendar : Error")); name = cm_target2name(c->calname); host = cm_target2host(c->calname); - sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 90, + sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 90, "Error opening Calendar file"), c->calname); set_message(c->message_text, buf); - sprintf(buf, "%s\n%s: %s, %s: %s", catgets(c->DT_catd, 1, 91, + sprintf(buf, "%s\n%s: %s, %s: %s", CATGETS(c->DT_catd, 1, 91, "rpc.cmsd is not responding for your user name.\nMake sure the inetd process is running and the entry\nin inetd.conf for rpc.cmsd is correct for your host."), nl_user, name, nl_host, host); @@ -2074,16 +2074,16 @@ error_noloc(Calendar *c, char *name) char buf[BUFSIZ]; Props_pu *p = (Props_pu *)c->properties_pu; - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); char *title = - XtNewString(catgets(c->DT_catd, 1, 94, "Calendar : Error")); + XtNewString(CATGETS(c->DT_catd, 1, 94, "Calendar : Error")); sprintf(buf, "%s %s", - catgets(c->DT_catd, 1, 108, "No Calendar Location specified for"), + CATGETS(c->DT_catd, 1, 108, "No Calendar Location specified for"), name); set_message(c->message_text, buf); - sprintf(buf, "%s", catgets(c->DT_catd, 1, 109, "No location specified; add a hostname to the\nInitial Calendar View in Properties/Display Settings. If\nyou ran Calendar (dtcm) with the -c option, verify you specified a hostname.")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 109, "No location specified; add a hostname to the\nInitial Calendar View in Properties/Display Settings. If\nyou ran Calendar (dtcm) with the -c option, verify you specified a hostname.")); dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, buf, @@ -2200,7 +2200,7 @@ open_user_calendar(Calendar *c, Boolean retry) NULL, &cb_ext); if (c->my_cal_version < DTCM_DATA_VER) - set_message(c->message_text, catgets(c->DT_catd, 1, 186, + set_message(c->message_text, CATGETS(c->DT_catd, 1, 186, "Calendar (dtcm) and rpc.cmsd versions are different.")); if (!viewother) { @@ -2209,7 +2209,7 @@ open_user_calendar(Calendar *c, Boolean retry) Message 113 : ``Calendar'' is used in the main titlebar of the tool: Calendar : user@host. */ - sprintf(buf, "%s : %s", catgets(c->DT_catd, 1, 113, "Calendar"), + sprintf(buf, "%s : %s", CATGETS(c->DT_catd, 1, 113, "Calendar"), c->calname); XtVaSetValues(c->frame, XmNtitle, buf, NULL); } @@ -2265,7 +2265,7 @@ open_initial_calendar( c->general->version = get_data_version(c->cal_handle); if (c->general->version < DTCM_DATA_VER) - set_message(c->message_text, catgets(c->DT_catd, 1, 186, + set_message(c->message_text, CATGETS(c->DT_catd, 1, 186, "Calendar (dtcm) and rpc.cmsd versions are different.")); @@ -2277,7 +2277,7 @@ open_initial_calendar( csa_register_callback(c->cal_handle, flags, update_handler, NULL, &cb_ext); - sprintf(buf, "%s : %s", catgets(c->DT_catd, 1, 113, "Calendar"), + sprintf(buf, "%s : %s", CATGETS(c->DT_catd, 1, 113, "Calendar"), c->view->current_calendar); XtVaSetValues(c->frame, XmNtitle, buf, NULL); @@ -2648,7 +2648,7 @@ init_calendar(int argc, char **argv) cm_strdup(calendar->app_data->default_calendar); /* Open the message catalog for internationalization */ - calendar->DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + calendar->DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); ac=0; XtSetArg(al[ac], XmNfractionBase, 100); ac++; @@ -2735,7 +2735,7 @@ init_calendar(int argc, char **argv) status = cmtt_init("Calendar", calendar, app, calendar->frame); if (TT_OK != status) { char *errfmt; - errfmt = catgets(calendar->DT_catd, 2, 2, + errfmt = CATGETS(calendar->DT_catd, 2, 2, "Could not connect to ToolTalk:\n%s\n"); DieFromToolTalkError( calendar, errfmt, status ); } @@ -2783,7 +2783,7 @@ init_calendar(int argc, char **argv) calendar->general->version = calendar->my_cal_version; sprintf(buf, "%s : %s", - catgets(calendar->DT_catd, 1, 113, + CATGETS(calendar->DT_catd, 1, 113, "Calendar"), calendar->calname); XtVaSetValues(calendar->frame, XmNtitle, buf, @@ -2938,31 +2938,31 @@ init_strings(void) { char *display_lang="C"; - months[1] = strdup(catgets(calendar->DT_catd, 1, 114, "January")); - months[2] = strdup(catgets(calendar->DT_catd, 1, 115, "February")); - months[3] = strdup(catgets(calendar->DT_catd, 1, 116, "March")); - months[4] = strdup(catgets(calendar->DT_catd, 1, 117, "April")); - months[5] = strdup(catgets(calendar->DT_catd, 1, 118, "May")); - months[6] = strdup(catgets(calendar->DT_catd, 1, 119, "June")); - months[7] = strdup(catgets(calendar->DT_catd, 1, 120, "July")); - months[8] = strdup(catgets(calendar->DT_catd, 1, 121, "August")); - months[9] = strdup(catgets(calendar->DT_catd, 1, 122, "September")); - months[10] = strdup(catgets(calendar->DT_catd, 1, 123, "October")); - months[11] = strdup(catgets(calendar->DT_catd, 1, 124, "November")); - months[12] = strdup(catgets(calendar->DT_catd, 1, 125, "December")); + months[1] = strdup(CATGETS(calendar->DT_catd, 1, 114, "January")); + months[2] = strdup(CATGETS(calendar->DT_catd, 1, 115, "February")); + months[3] = strdup(CATGETS(calendar->DT_catd, 1, 116, "March")); + months[4] = strdup(CATGETS(calendar->DT_catd, 1, 117, "April")); + months[5] = strdup(CATGETS(calendar->DT_catd, 1, 118, "May")); + months[6] = strdup(CATGETS(calendar->DT_catd, 1, 119, "June")); + months[7] = strdup(CATGETS(calendar->DT_catd, 1, 120, "July")); + months[8] = strdup(CATGETS(calendar->DT_catd, 1, 121, "August")); + months[9] = strdup(CATGETS(calendar->DT_catd, 1, 122, "September")); + months[10] = strdup(CATGETS(calendar->DT_catd, 1, 123, "October")); + months[11] = strdup(CATGETS(calendar->DT_catd, 1, 124, "November")); + months[12] = strdup(CATGETS(calendar->DT_catd, 1, 125, "December")); - months2[1] = strdup(catgets(calendar->DT_catd, 1, 126, "Jan")); - months2[2] = strdup(catgets(calendar->DT_catd, 1, 127, "Feb")); - months2[3] = strdup(catgets(calendar->DT_catd, 1, 128, "Mar")); - months2[4] = strdup(catgets(calendar->DT_catd, 1, 129, "Apr")); - months2[5] = strdup(catgets(calendar->DT_catd, 1, 130, "May")); - months2[6] = strdup(catgets(calendar->DT_catd, 1, 131, "Jun")); - months2[7] = strdup(catgets(calendar->DT_catd, 1, 132, "Jul")); - months2[8] = strdup(catgets(calendar->DT_catd, 1, 133, "Aug")); - months2[9] = strdup(catgets(calendar->DT_catd, 1, 134, "Sep")); - months2[10] = strdup(catgets(calendar->DT_catd, 1, 135, "Oct")); - months2[11] = strdup(catgets(calendar->DT_catd, 1, 136, "Nov")); - months2[12] = strdup(catgets(calendar->DT_catd, 1, 137, "Dec")); + months2[1] = strdup(CATGETS(calendar->DT_catd, 1, 126, "Jan")); + months2[2] = strdup(CATGETS(calendar->DT_catd, 1, 127, "Feb")); + months2[3] = strdup(CATGETS(calendar->DT_catd, 1, 128, "Mar")); + months2[4] = strdup(CATGETS(calendar->DT_catd, 1, 129, "Apr")); + months2[5] = strdup(CATGETS(calendar->DT_catd, 1, 130, "May")); + months2[6] = strdup(CATGETS(calendar->DT_catd, 1, 131, "Jun")); + months2[7] = strdup(CATGETS(calendar->DT_catd, 1, 132, "Jul")); + months2[8] = strdup(CATGETS(calendar->DT_catd, 1, 133, "Aug")); + months2[9] = strdup(CATGETS(calendar->DT_catd, 1, 134, "Sep")); + months2[10] = strdup(CATGETS(calendar->DT_catd, 1, 135, "Oct")); + months2[11] = strdup(CATGETS(calendar->DT_catd, 1, 136, "Nov")); + months2[12] = strdup(CATGETS(calendar->DT_catd, 1, 137, "Dec")); /* NL_COMMENT Attention Translator: @@ -2980,23 +2980,23 @@ init_strings(void) Sun --> Sunday */ - days[0] = strdup(catgets(calendar->DT_catd, 1, 138, "Sun")); - days[1] = strdup(catgets(calendar->DT_catd, 1, 139, "Mon")); - days[2] = strdup(catgets(calendar->DT_catd, 1, 140, "Tue")); - days[3] = strdup(catgets(calendar->DT_catd, 1, 141, "Wed")); - days[4] = strdup(catgets(calendar->DT_catd, 1, 142, "Thu")); - days[5] = strdup(catgets(calendar->DT_catd, 1, 143, "Fri")); - days[6] = strdup(catgets(calendar->DT_catd, 1, 144, "Sat")); - days[7] = strdup(catgets(calendar->DT_catd, 1, 138, "Sun")); + days[0] = strdup(CATGETS(calendar->DT_catd, 1, 138, "Sun")); + days[1] = strdup(CATGETS(calendar->DT_catd, 1, 139, "Mon")); + days[2] = strdup(CATGETS(calendar->DT_catd, 1, 140, "Tue")); + days[3] = strdup(CATGETS(calendar->DT_catd, 1, 141, "Wed")); + days[4] = strdup(CATGETS(calendar->DT_catd, 1, 142, "Thu")); + days[5] = strdup(CATGETS(calendar->DT_catd, 1, 143, "Fri")); + days[6] = strdup(CATGETS(calendar->DT_catd, 1, 144, "Sat")); + days[7] = strdup(CATGETS(calendar->DT_catd, 1, 138, "Sun")); - days2[0] = strdup(catgets(calendar->DT_catd, 1, 146, "Sunday")); - days2[1] = strdup(catgets(calendar->DT_catd, 1, 147, "Monday")); - days2[2] = strdup(catgets(calendar->DT_catd, 1, 148, "Tuesday")); - days2[3] = strdup(catgets(calendar->DT_catd, 1, 149, "Wednesday")); - days2[4] = strdup(catgets(calendar->DT_catd, 1, 150, "Thursday")); - days2[5] = strdup(catgets(calendar->DT_catd, 1, 151, "Friday")); - days2[6] = strdup(catgets(calendar->DT_catd, 1, 152, "Saturday")); - days2[7] = strdup(catgets(calendar->DT_catd, 1, 146, "Sunday")); + days2[0] = strdup(CATGETS(calendar->DT_catd, 1, 146, "Sunday")); + days2[1] = strdup(CATGETS(calendar->DT_catd, 1, 147, "Monday")); + days2[2] = strdup(CATGETS(calendar->DT_catd, 1, 148, "Tuesday")); + days2[3] = strdup(CATGETS(calendar->DT_catd, 1, 149, "Wednesday")); + days2[4] = strdup(CATGETS(calendar->DT_catd, 1, 150, "Thursday")); + days2[5] = strdup(CATGETS(calendar->DT_catd, 1, 151, "Friday")); + days2[6] = strdup(CATGETS(calendar->DT_catd, 1, 152, "Saturday")); + days2[7] = strdup(CATGETS(calendar->DT_catd, 1, 146, "Sunday")); /* NL_COMMENT Attention Translator: @@ -3013,14 +3013,14 @@ init_strings(void) S --> Saturday (message 160) */ - days3[0] = strdup(catgets(calendar->DT_catd, 1, 154, "S")); - days3[1] = strdup(catgets(calendar->DT_catd, 1, 155, "M")); - days3[2] = strdup(catgets(calendar->DT_catd, 1, 156, "T")); - days3[3] = strdup(catgets(calendar->DT_catd, 1, 157, "W")); - days3[4] = strdup(catgets(calendar->DT_catd, 1, 158, "T")); - days3[5] = strdup(catgets(calendar->DT_catd, 1, 159, "F")); - days3[6] = strdup(catgets(calendar->DT_catd, 1, 160, "S")); - days3[7] = strdup(catgets(calendar->DT_catd, 1, 154, "S")); + days3[0] = strdup(CATGETS(calendar->DT_catd, 1, 154, "S")); + days3[1] = strdup(CATGETS(calendar->DT_catd, 1, 155, "M")); + days3[2] = strdup(CATGETS(calendar->DT_catd, 1, 156, "T")); + days3[3] = strdup(CATGETS(calendar->DT_catd, 1, 157, "W")); + days3[4] = strdup(CATGETS(calendar->DT_catd, 1, 158, "T")); + days3[5] = strdup(CATGETS(calendar->DT_catd, 1, 159, "F")); + days3[6] = strdup(CATGETS(calendar->DT_catd, 1, 160, "S")); + days3[7] = strdup(CATGETS(calendar->DT_catd, 1, 154, "S")); /* NL_COMMENT Attention Translator: @@ -3037,14 +3037,14 @@ init_strings(void) SAT --> Saturday */ - days4[0] = strdup(catgets(calendar->DT_catd, 1, 170, "SUN")); - days4[1] = strdup(catgets(calendar->DT_catd, 1, 171, "MON")); - days4[2] = strdup(catgets(calendar->DT_catd, 1, 172, "TUE")); - days4[3] = strdup(catgets(calendar->DT_catd, 1, 173, "WED")); - days4[4] = strdup(catgets(calendar->DT_catd, 1, 174, "THU")); - days4[5] = strdup(catgets(calendar->DT_catd, 1, 175, "FRI")); - days4[6] = strdup(catgets(calendar->DT_catd, 1, 176, "SAT")); - days4[7] = strdup(catgets(calendar->DT_catd, 1, 170, "SUN")); + days4[0] = strdup(CATGETS(calendar->DT_catd, 1, 170, "SUN")); + days4[1] = strdup(CATGETS(calendar->DT_catd, 1, 171, "MON")); + days4[2] = strdup(CATGETS(calendar->DT_catd, 1, 172, "TUE")); + days4[3] = strdup(CATGETS(calendar->DT_catd, 1, 173, "WED")); + days4[4] = strdup(CATGETS(calendar->DT_catd, 1, 174, "THU")); + days4[5] = strdup(CATGETS(calendar->DT_catd, 1, 175, "FRI")); + days4[6] = strdup(CATGETS(calendar->DT_catd, 1, 176, "SAT")); + days4[7] = strdup(CATGETS(calendar->DT_catd, 1, 170, "SUN")); } @@ -3069,7 +3069,7 @@ switch_it(Calendar *c, char *new_calendar, WindowType win) */ if (strcmp(new_calendar, c->view->current_calendar) == 0 && c->cal_handle) { - sprintf(buf, catgets(c->DT_catd, 1, 178, + sprintf(buf, CATGETS(c->DT_catd, 1, 178, "You Are Already Browsing %s"), new_calendar); set_message(c->message_text, buf); if (tb && tb->show_message) @@ -3095,9 +3095,9 @@ switch_it(Calendar *c, char *new_calendar, WindowType win) } else { if ((user = cm_target2name(new_calendar)) == NULL) { if (!strcmp(new_calendar, "")) - sprintf(buf, "%s", catgets(c->DT_catd, 1, 619, "Please enter a calendar name in the format: @")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 619, "Please enter a calendar name in the format: @")); else - sprintf(buf, catgets(c->DT_catd, 1, 620, + sprintf(buf, CATGETS(c->DT_catd, 1, 620, "Unknown calendar. Calendar name needed: %s"), new_calendar); set_message(c->message_text, buf); @@ -3108,9 +3108,9 @@ switch_it(Calendar *c, char *new_calendar, WindowType win) if ((loc = cm_target2location(new_calendar)) == NULL) { if (!strcmp(new_calendar, "")) - sprintf(buf, "%s", catgets(c->DT_catd, 1, 619, "Please enter a calendar name in the format: @")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 619, "Please enter a calendar name in the format: @")); else - sprintf(buf, catgets(c->DT_catd, 1, 622, + sprintf(buf, CATGETS(c->DT_catd, 1, 622, "Unknown calendar. Hostname needed: %s@"), user); set_message(c->message_text, buf); @@ -3161,7 +3161,7 @@ switch_it(Calendar *c, char *new_calendar, WindowType win) new_version = get_data_version(new_cal_handle); if (new_version < DTCM_DATA_VER) - set_message(c->message_text, catgets(c->DT_catd, 1, 186, + set_message(c->message_text, CATGETS(c->DT_catd, 1, 186, "Calendar (dtcm) and rpc.cmsd versions are different.")); /* @@ -3201,7 +3201,7 @@ switch_it(Calendar *c, char *new_calendar, WindowType win) /* * Set the title bars on all the windows! */ - sprintf(buf, "%s : %s", catgets(c->DT_catd, 1, 113, "Calendar"), + sprintf(buf, "%s : %s", CATGETS(c->DT_catd, 1, 113, "Calendar"), new_calendar); XtVaSetValues(c->frame, XmNtitle, buf, NULL); @@ -3239,12 +3239,12 @@ switch_it(Calendar *c, char *new_calendar, WindowType win) if (tb && tb->show_message) { char buf[128]; char *calendar = - XtNewString(catgets(c->DT_catd, 1, 919, "Calendar")); + XtNewString(CATGETS(c->DT_catd, 1, 919, "Calendar")); sprintf (buf, "%s %s %s", calendar, new_calendar, - catgets(c->DT_catd, 1, 920, "displayed.")); + CATGETS(c->DT_catd, 1, 920, "displayed.")); XtFree(calendar); set_message(tb->show_message, buf); } diff --git a/cde/programs/dtcm/dtcm/cm_admin.c b/cde/programs/dtcm/dtcm/cm_admin.c index bbf9b05c7..317427c15 100644 --- a/cde/programs/dtcm/dtcm/cm_admin.c +++ b/cde/programs/dtcm/dtcm/cm_admin.c @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)cm_lookup.c 1.21 94/08/05 Copyr 1993 Sun Microsyste #include #include #include -#include +#include
#include #include "cm_tty.h" #include "util.h" @@ -106,7 +106,7 @@ grab(char**argv, /* command line arguments */ static void usage_msg() { - fprintf(stderr,catgets(DT_catd, 1, 696, "Usage:\n\tdtcm_admin [ -d ] [ -a action ] [ -c calendar ][ -s ] [ -e ] [-f filename]\n")); + fprintf(stderr,CATGETS(DT_catd, 1, 696, "Usage:\n\tdtcm_admin [ -d ] [ -a action ] [ -c calendar ][ -s ] [ -e ] [-f filename]\n")); } static void @@ -122,7 +122,7 @@ cm_args(int argc, char **argv) else if (strcmp(*argv, "restore") == 0) Mode = restore; else { - fprintf(stderr,catgets(DT_catd, 1, 697, "You have specified an unsupported administration operation \"%s\".\n"), *argv); + fprintf(stderr,CATGETS(DT_catd, 1, 697, "You have specified an unsupported administration operation \"%s\".\n"), *argv); usage_msg(); exit(1); } @@ -167,7 +167,7 @@ int main(int argc, char **argv) init_time(); setlocale(LC_ALL, ""); - DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); cm_tty_load_props(&p); cm_args(argc,argv); /* parse command line */ @@ -187,7 +187,7 @@ int main(int argc, char **argv) if (cm_file[0]) { if (Mode == archive) { if ((output_stream = fopen(cm_file, "w")) == NULL) { - fprintf(stderr, catgets(DT_catd, 1, 698, "\nCould not open output file \"%s\"\n"), cm_file); + fprintf(stderr, CATGETS(DT_catd, 1, 698, "\nCould not open output file \"%s\"\n"), cm_file); exit(1); } @@ -195,7 +195,7 @@ int main(int argc, char **argv) if (Mode == restore) { if ((input_stream = fopen(cm_file, "r")) == NULL) { - fprintf(stderr, catgets(DT_catd, 1, 699, "\nCould not open input file \"%s\"\n"), cm_file); + fprintf(stderr, CATGETS(DT_catd, 1, 699, "\nCould not open input file \"%s\"\n"), cm_file); exit(1); } } @@ -207,10 +207,10 @@ int main(int argc, char **argv) stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL); if (stat != CSA_SUCCESS) { - char *format = XtNewString(catgets(DT_catd, 1, 208, + char *format = XtNewString(CATGETS(DT_catd, 1, 208, "\nCould not open calendar \"%s\"\n")); fprintf(stderr, format, - target ? target : catgets(DT_catd, 1, 209, "UNKNOWN")); + target ? target : CATGETS(DT_catd, 1, 209, "UNKNOWN")); XtFree(format); free(uname); free(loc); diff --git a/cde/programs/dtcm/dtcm/cm_delete.c b/cde/programs/dtcm/dtcm/cm_delete.c index 44d010030..cbebf4944 100644 --- a/cde/programs/dtcm/dtcm/cm_delete.c +++ b/cde/programs/dtcm/dtcm/cm_delete.c @@ -61,7 +61,7 @@ static char sccsid[] = "@(#)cm_delete.c 1.29 95/03/17 Copyr 1993 Sun Microsyste #include #include #include -#include +#include
#include #include
#include
@@ -118,7 +118,7 @@ cm_args(int argc, char **argv) argv = grab(++argv,cm_view,'-'); break; default: - fprintf(stderr, "%s", catgets(DT_catd, 1, 187, "Usage:\n\tdtcm_delete [-c calendar] [-d ] [-v view]\n")); + fprintf(stderr, "%s", CATGETS(DT_catd, 1, 187, "Usage:\n\tdtcm_delete [-c calendar] [-d ] [-v view]\n")); exit(1); } } @@ -142,7 +142,7 @@ int main(int argc, char **argv) init_time(); setlocale(LC_ALL, ""); _DtEnvControl(DT_ENV_SET); /* set up environment variables */ - DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); cm_tty_load_props(&p); cm_args(argc,argv); /* parse command line */ target = (cm_strlen(cm_target)) ? cm_target : cm_get_credentials(); @@ -167,10 +167,10 @@ int main(int argc, char **argv) stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL); if (stat != CSA_SUCCESS) { - char *format = strdup(catgets(DT_catd, 1, 188, + char *format = strdup(CATGETS(DT_catd, 1, 188, "\nCould not open calendar %s\n")); fprintf(stderr, format, - target ? target : catgets(DT_catd, 1, 189, "UNKNOWN")); + target ? target : CATGETS(DT_catd, 1, 189, "UNKNOWN")); free(format); free(uname); free(loc); @@ -186,7 +186,7 @@ int main(int argc, char **argv) free(loc); exit(0); } - fprintf(stdout, "%s", catgets(DT_catd, 1, 190, + fprintf(stdout, "%s", CATGETS(DT_catd, 1, 190, "Item to delete (number)? ")); fgets(index, 9, stdin); fprintf(stdout,"\n\n"); diff --git a/cde/programs/dtcm/dtcm/cm_insert.c b/cde/programs/dtcm/dtcm/cm_insert.c index 404417268..95063c083 100644 --- a/cde/programs/dtcm/dtcm/cm_insert.c +++ b/cde/programs/dtcm/dtcm/cm_insert.c @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)cm_insert.c 1.31 95/05/19 Copyr 1993 Sun Microsyste #include #include #include -#include +#include
#include #include "util.h" #include "getdate.h" @@ -145,8 +145,8 @@ cm_args(int argc, char **argv) argv = grab(++argv,cm_appt_file,'-'); break; default: - fprintf(stderr, "%s", catgets(DT_catd, 1, 191, "Usage:\n\tdtcm_insert [ -c calendar ] [-d ] [ -v view ]\n")); - fprintf(stderr, "%s", catgets(DT_catd, 1, 192, " [-w what string] [-s ] [-e ]\n")); + fprintf(stderr, "%s", CATGETS(DT_catd, 1, 191, "Usage:\n\tdtcm_insert [ -c calendar ] [-d ] [ -v view ]\n")); + fprintf(stderr, "%s", CATGETS(DT_catd, 1, 192, " [-w what string] [-s ] [-e ]\n")); exit(1); } } @@ -179,15 +179,15 @@ prompt_for_insert(Props *p) { format_tick(now(), get_int_prop(p, CP_DATEORDERING), get_int_prop(p, CP_DATESEPARATOR), date_str); - printf("%s", catgets(DT_catd, 1, 193, "Please enter the information for the appointment you wish to add.\nDefaults will be shown in parentheses.\n")); - prompt_for_line(catgets(DT_catd, 1, 194, + printf("%s", CATGETS(DT_catd, 1, 193, "Please enter the information for the appointment you wish to add.\nDefaults will be shown in parentheses.\n")); + prompt_for_line(CATGETS(DT_catd, 1, 194, "Calendar (%s): "), cm_get_credentials(), cm_target); - prompt_for_line(catgets(DT_catd, 1, 195, + prompt_for_line(CATGETS(DT_catd, 1, 195, "Date (%s): "), date_str, cm_date); while (valid != TRUE) { format_time(now(), dt, cm_start); - prompt_for_line(catgets(DT_catd, 1, 196, + prompt_for_line(CATGETS(DT_catd, 1, 196, "Start (%s): "), cm_start, cm_start); if (cm_start[0]) { @@ -195,7 +195,7 @@ prompt_for_insert(Props *p) { if (valid_time(p, timecopy)) valid = TRUE; else - printf("%s", catgets(DT_catd, 1, 197, "You have entered an invalid time. Please try again:\n")); + printf("%s", CATGETS(DT_catd, 1, 197, "You have entered an invalid time. Please try again:\n")); free(timecopy); } } @@ -207,23 +207,23 @@ prompt_for_insert(Props *p) { format_time(next, dt, cm_end); if (cm_start[0]) prompt_for_line( - catgets(DT_catd, 1, 198, "End (%s): "), cm_end, cm_end); + CATGETS(DT_catd, 1, 198, "End (%s): "), cm_end, cm_end); else prompt_for_line( - catgets(DT_catd, 1, 199, "End (%s): "), "None", cm_end); + CATGETS(DT_catd, 1, 199, "End (%s): "), "None", cm_end); - snprintf(cm_repeatstr, sizeof(cm_repeatstr), "%s", catgets(DT_catd, 1, 200, "One Time")); + snprintf(cm_repeatstr, sizeof(cm_repeatstr), "%s", CATGETS(DT_catd, 1, 200, "One Time")); - prompt_for_line(catgets(DT_catd, 1, 201, + prompt_for_line(CATGETS(DT_catd, 1, 201, "Repeat (%s): "), cm_repeatstr, cm_repeatstr); - if (strcmp(cm_repeatstr, catgets(DT_catd, 1, 200, "One Time"))) { - sprintf(buf, "%s", catgets(DT_catd, 1, 203, "no default")); + if (strcmp(cm_repeatstr, CATGETS(DT_catd, 1, 200, "One Time"))) { + sprintf(buf, "%s", CATGETS(DT_catd, 1, 203, "no default")); prompt_for_line( - catgets(DT_catd, 1, 204, "For (%s): "), buf, cm_for); + CATGETS(DT_catd, 1, 204, "For (%s): "), buf, cm_for); } - printf("%s", catgets(DT_catd, 1, 205, + printf("%s", CATGETS(DT_catd, 1, 205, "What (you may enter up to 5 lines, use ^D to finish):\n")); cm_what[0] = '\0'; for (index = 0; index < 5; index++) @@ -268,7 +268,7 @@ main(int argc, char **argv) init_time(); _DtEnvControl(DT_ENV_SET); /* set up environment variables */ setlocale(LC_ALL, ""); - DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); cm_tty_load_props(&p); dt = get_int_prop(p, CP_DEFAULTDISP); #ifdef FNS @@ -297,11 +297,11 @@ main(int argc, char **argv) csa_user.calendar_address = target; stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL); if (stat != CSA_SUCCESS) { - char *format = cm_strdup(catgets(DT_catd, 1, 206, + char *format = cm_strdup(CATGETS(DT_catd, 1, 206, "\nCould not open calendar %s\n")); fprintf(stderr, format, target ? target : - catgets(DT_catd, 1, 209, "UNKNOWN")); + CATGETS(DT_catd, 1, 209, "UNKNOWN")); free(format); free(uname); free(loc); @@ -344,11 +344,11 @@ main(int argc, char **argv) csa_user.calendar_address = target; stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL); if (stat !=CSA_SUCCESS) { - char *format = cm_strdup(catgets(DT_catd, 1, 206, + char *format = cm_strdup(CATGETS(DT_catd, 1, 206, "\nCould not open calendar %s\n")); fprintf(stderr, format, target ? target : - catgets(DT_catd, 1, 209, "UNKNOWN")); + CATGETS(DT_catd, 1, 209, "UNKNOWN")); free(format); free(uname); free(loc); diff --git a/cde/programs/dtcm/dtcm/cm_lookup.c b/cde/programs/dtcm/dtcm/cm_lookup.c index a34b4d3bb..80376fb1a 100644 --- a/cde/programs/dtcm/dtcm/cm_lookup.c +++ b/cde/programs/dtcm/dtcm/cm_lookup.c @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)cm_lookup.c 1.30 95/03/08 Copyr 1993 Sun Microsyste #include #include #include -#include +#include
#include #include "cm_tty.h" #include "util.h" @@ -115,7 +115,7 @@ cm_args(int argc, char **argv) argv = grab(++argv,cm_view,'-'); break; default: - fprintf(stderr, "%s", catgets(DT_catd, 1, 207, "Usage:\n\tdtcm_lookup [ -c calendar ][ -d ] [ -v view ]\n")); + fprintf(stderr, "%s", CATGETS(DT_catd, 1, 207, "Usage:\n\tdtcm_lookup [ -c calendar ][ -d ] [ -v view ]\n")); exit(1); } } @@ -139,7 +139,7 @@ int main(int argc, char **argv) init_time(); _DtEnvControl(DT_ENV_SET); /* set up environment variables */ setlocale(LC_ALL, ""); - DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); cm_tty_load_props(&p); cm_args(argc,argv); /* parse command line */ @@ -161,10 +161,10 @@ int main(int argc, char **argv) stat = csa_logon(NULL, &csa_user, NULL, NULL, NULL, &c_handle, NULL); if (stat != CSA_SUCCESS) { - char *format = cm_strdup(catgets(DT_catd, 1, 208, + char *format = cm_strdup(CATGETS(DT_catd, 1, 208, "\nCould not open calendar \"%s\"\n")); fprintf(stderr, format, - target ? target : catgets(DT_catd, 1, 209, "UNKNOWN")); + target ? target : CATGETS(DT_catd, 1, 209, "UNKNOWN")); free(format); free(uname); free(loc); diff --git a/cde/programs/dtcm/dtcm/cmtt.c b/cde/programs/dtcm/dtcm/cmtt.c index 87833e5d8..50f5c7a50 100644 --- a/cde/programs/dtcm/dtcm/cmtt.c +++ b/cde/programs/dtcm/dtcm/cmtt.c @@ -111,9 +111,9 @@ DieFromToolTalkError(Calendar *c, char *errfmt, Tt_status status) errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); sprintf(errmsg, errfmt, statmsg); - xms_ok = XmStringCreateLocalized(catgets(c->DT_catd, 2, 3, "OK")); + xms_ok = XmStringCreateLocalized(CATGETS(c->DT_catd, 2, 3, "OK")); xms_errmsg = XmStringCreateLocalized(errmsg); - xms_title = XmStringCreateLocalized(catgets(c->DT_catd, 2, 1, + xms_title = XmStringCreateLocalized(CATGETS(c->DT_catd, 2, 1, "Calendar - Warning")); n = 0; diff --git a/cde/programs/dtcm/dtcm/dayglance.c b/cde/programs/dtcm/dtcm/dayglance.c index 1e5cf9520..20f4dbef2 100644 --- a/cde/programs/dtcm/dtcm/dayglance.c +++ b/cde/programs/dtcm/dtcm/dayglance.c @@ -133,7 +133,7 @@ paint_day_header(Calendar *c, Tick date, void *rect) Use the appropriate strftime conversion for your locale. */ - strftime(buf, 100, catgets(c->DT_catd, 1, 992, "%A, %B %e, %Y"), tm); + strftime(buf, 100, CATGETS(c->DT_catd, 1, 992, "%A, %B %e, %Y"), tm); inrange = today_inrange(c, date); x = gr_center(c->view->winw-(int)MOBOX_AREA_WIDTH, buf, c->fonts->labelfont) + (int)MOBOX_AREA_WIDTH; @@ -1088,13 +1088,13 @@ display_monthpanels(Calendar *c) if ((panel_year == firstyear) && (panel_month == 1)) { XtUnmapWidget(d->month_panels[0]); XtMapWidget(d->month_panels[2]); - sprintf(buf, "%s", catgets(c->DT_catd, 1, 623, "Calendar does not display dates prior to January 1, 1970")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 623, "Calendar does not display dates prior to January 1, 1970")); set_message(c->message_text, buf); } else if ((panel_year == lastyear) && (panel_month == 12)) { XtMapWidget(d->month_panels[0]); XtUnmapWidget(d->month_panels[2]); - sprintf(buf, "%s", catgets(c->DT_catd, 1, 624, "Calendar does not display dates after December 31, 2037")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 624, "Calendar does not display dates after December 31, 2037")); set_message(c->message_text, buf); } else { diff --git a/cde/programs/dtcm/dtcm/dnd.c b/cde/programs/dtcm/dtcm/dnd.c index f37f19a67..67fa3922a 100644 --- a/cde/programs/dtcm/dtcm/dnd.c +++ b/cde/programs/dtcm/dtcm/dnd.c @@ -327,11 +327,11 @@ schedule_appt(Calendar *c, Dtcm_appointment *a) { * Make sure user really meant to insert appointment * into somebody elses calendar. */ - char *ident = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *title = XtNewString(catgets(c->DT_catd, 1, 212, + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 212, "Calendar : Schedule Appointment")); - sprintf(buf, "%s", catgets(c->DT_catd, 1, 210, "The appointment will be scheduled in the calendar\nyou are currently browsing. Do you still want to schedule it?")); - sprintf(buf2, "%s %s", catgets(c->DT_catd, 1, 211, "Schedule in"), + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 210, "The appointment will be scheduled in the calendar\nyou are currently browsing. Do you still want to schedule it?")); + sprintf(buf2, "%s %s", CATGETS(c->DT_catd, 1, 211, "Schedule in"), c->view->current_calendar); answer = dialog_popup(c->frame, DIALOG_TITLE, title, @@ -356,7 +356,7 @@ schedule_appt(Calendar *c, Dtcm_appointment *a) { _csa_iso8601_to_tick(a->time->value->item.string_value, &tick); format_tick(tick, ot, st, date_buf); - sprintf(buf, catgets(c->DT_catd, 1, 214, + sprintf(buf, CATGETS(c->DT_catd, 1, 214, "Appointment scheduled: %s"), date_buf); set_message(c->message_text, buf); return 1; @@ -410,57 +410,57 @@ drag_load_proc(char *filename, Calendar *c) { (void *)c, c->general->version); if (list->count <= 0) { op = CANCEL_APPT; - sprintf(buf, "%s", catgets(c->DT_catd, 1, 842, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 842, "The information transferred did not\ncontain any appointments.")); } switch(op) { case COULD_NOT_OPEN_FILE: - msg = XtNewString(catgets(c->DT_catd, 1, 843, + msg = XtNewString(CATGETS(c->DT_catd, 1, 843, "Drag and Drop operation failed.")); sprintf(buf, "%s\n%s", msg, - catgets(c->DT_catd, 1, 844, + CATGETS(c->DT_catd, 1, 844, "Unable to locate the transferred information.")); XtFree(msg); break; case INVALID_DATE: sprintf(buf, "%s", - catgets(c->DT_catd, 1, 218, "Invalid DATE specified")); + CATGETS(c->DT_catd, 1, 218, "Invalid DATE specified")); break; case INVALID_START: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 219, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 219, "Invalid START time specified")); break; case INVALID_STOP: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 220, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 220, "Invalid END time specified")); break; case MISSING_DATE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 221, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 221, "Empty or missing DATE field")); break; case MISSING_START: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 222, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 222, "Empty or missing START field")); break; case MISSING_WHAT: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 223, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 223, "Empty or missing WHAT field")); break; case REPEAT_FOR_MISMATCH: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 224, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 224, "REPEAT and FOR field mismatch")); break; case VALID_APPT: break; case CANCEL_APPT: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 225, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 225, "Schedule appointment was cancelled.")); break; default: op = CANCEL_APPT; - sprintf(buf, "%s", catgets(c->DT_catd, 1, 225, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 225, "Schedule appointment was cancelled.")); break; } @@ -475,11 +475,11 @@ drag_load_proc(char *filename, Calendar *c) { ret_val = schedule_appt(c, a); if (ret_val < 0) { op = CANCEL_APPT; - sprintf(buf, "%s", catgets(c->DT_catd, 1, 226, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 226, "Internal error scheduling appointment.")); } else if (ret_val == 0) { op = CANCEL_APPT; - sprintf(buf, "%s", catgets(c->DT_catd, 1, 225, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 225, "Schedule appointment was cancelled.")); } ++i; @@ -491,9 +491,9 @@ drag_load_proc(char *filename, Calendar *c) { CmDataListDestroy(list, B_FALSE); if (op != VALID_APPT) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1073, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1073, "Calendar : Error - Drag and Drop")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, buf, @@ -533,10 +533,10 @@ get_appt_struct(DragContext *context) { list = ((ToDo *) context->editor)->todo_list; if (list && !XmListGetSelectedPos(list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 230, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 230, "Calendar : Error - Drag Appointment")); - char *text = XtNewString(catgets(c->DT_catd, 1, 231, "Select an appointment and DRAG again.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 231, "Select an appointment and DRAG again.")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -563,10 +563,10 @@ get_appt_struct(DragContext *context) { if (!entry) { - char *title = XtNewString(catgets(c->DT_catd, 1, 230, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 230, "Calendar : Error - Drag Appointment")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); - sprintf(buf, "%s", catgets(c->DT_catd, 1, 845, + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 845, "Drag and Drop operation Failed\nInternal consistency error.")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, @@ -611,7 +611,7 @@ ApptConvertCB( data->bp = XtNewString(context->data); data->size = strlen(data->bp); - data->name = XtNewString(catgets(c->DT_catd, 1, 236, "CalendarAppointment")); + data->name = XtNewString(CATGETS(c->DT_catd, 1, 236, "CalendarAppointment")); } /* @@ -636,7 +636,7 @@ GetIcon(Calendar *calendar) drag_xbm_width, drag_xbm_height); if (e->drag_bitmap == 0) { - printf("%s", catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n")); + printf("%s", CATGETS(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n")); return; } else @@ -647,7 +647,7 @@ GetIcon(Calendar *calendar) window, (char *) drag_mask_xbm_bits, drag_mask_xbm_width, drag_mask_xbm_height); if (e->drag_mask == 0) { - printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n")); + printf("%s", CATGETS(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n")); return; } else @@ -798,7 +798,7 @@ TranslationDragStart( DtNsourceIcon, e->drag_icon, NULL) == NULL) { - printf("%s", catgets(calendar->DT_catd, 1, 239, + printf("%s", CATGETS(calendar->DT_catd, 1, 239, "DragStart returned NULL.\n")); } } @@ -953,7 +953,7 @@ ApptDragStart( NULL) == NULL) { - printf("%s", catgets(calendar->DT_catd, 1, 239, + printf("%s", CATGETS(calendar->DT_catd, 1, 239, "DragStart returned NULL.\n")); } } diff --git a/cde/programs/dtcm/dtcm/dssw.c b/cde/programs/dtcm/dtcm/dssw.c index f2ce5e641..99151c743 100644 --- a/cde/programs/dtcm/dtcm/dssw.c +++ b/cde/programs/dtcm/dtcm/dssw.c @@ -250,28 +250,28 @@ build_dssw( XmNautoUnmanage, False, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 828, "Date:")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 828, "Date:")); dssw->date_label = XtVaCreateWidget("date_label", xmLabelGadgetClass, dssw->dssw_form_mgr, XmNlabelString, label_str, NULL); XmStringFree(label_str); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 829, "Start:")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 829, "Start:")); dssw->start_label = XtVaCreateWidget("start_label", xmLabelGadgetClass, dssw->dssw_form_mgr, XmNlabelString, label_str, NULL); XmStringFree(label_str); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 832, "End:")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 832, "End:")); dssw->stop_label = XtVaCreateWidget("stop_label", xmLabelGadgetClass, dssw->dssw_form_mgr, XmNlabelString, label_str, NULL); XmStringFree(label_str); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 835, "What:")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 835, "What:")); dssw->what_label = XtVaCreateWidget("what_label", xmLabelGadgetClass, dssw->dssw_form_mgr, XmNlabelString, label_str, @@ -311,7 +311,7 @@ build_dssw( XmNentryClass, xmToggleButtonGadgetClass, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 830, "AM")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 830, "AM")); child[0] = dssw->start_am = XtVaCreateWidget("start_am", xmToggleButtonGadgetClass, dssw->start_ampm_rc_mgr, XmNlabelString, label_str, @@ -319,7 +319,7 @@ build_dssw( NULL); XmStringFree(label_str); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 831, "PM")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 831, "PM")); child[1] = dssw->start_pm = XtVaCreateWidget("start_pm", xmToggleButtonGadgetClass, dssw->start_ampm_rc_mgr, XmNlabelString, label_str, @@ -357,7 +357,7 @@ build_dssw( XmNentryClass, xmToggleButtonGadgetClass, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 833, "AM")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 833, "AM")); child[0] = dssw->stop_am = XtVaCreateWidget("stop_am", xmToggleButtonGadgetClass, dssw->stop_ampm_rc_mgr, XmNlabelString, label_str, @@ -365,7 +365,7 @@ build_dssw( NULL); XmStringFree(label_str); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 834, "PM")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 834, "PM")); child[1] = dssw->stop_pm = XtVaCreateWidget("stop_pm", xmToggleButtonGadgetClass, dssw->stop_ampm_rc_mgr, XmNlabelString, label_str, @@ -633,13 +633,13 @@ dssw_form_flags_to_appt(DSSW *dssw, Dtcm_appointment *a, char *name, Tick t, int if (stop_tick < start_tick) { if (*flagsP == 0) { - char *title = XtNewString(catgets(calendar->DT_catd, 1, 248, + char *title = XtNewString(CATGETS(calendar->DT_catd, 1, 248, "Calendar : Schedule Appointment")); - char *ident1 = XtNewString(catgets(calendar->DT_catd, 1, + char *ident1 = XtNewString(CATGETS(calendar->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(calendar->DT_catd, 1, + char *ident2 = XtNewString(CATGETS(calendar->DT_catd, 1, 250, "Next Day")); - sprintf(buf, "%s", catgets(calendar->DT_catd, 1, 247, + sprintf(buf, "%s", CATGETS(calendar->DT_catd, 1, 247, "This appointment has an end time earlier than\nits begin time. Do you want to\nschedule it into the next day?")); *flagsP = dialog_popup(dssw->parent, DIALOG_TITLE, title, diff --git a/cde/programs/dtcm/dtcm/dtcm_editor.c b/cde/programs/dtcm/dtcm/dtcm_editor.c index 8a6b3e081..a7415c15a 100644 --- a/cde/programs/dtcm/dtcm/dtcm_editor.c +++ b/cde/programs/dtcm/dtcm/dtcm_editor.c @@ -47,7 +47,7 @@ #include "dnd.h" #include "util.h" #include "cm_tty.h" -#include +#include
#include #if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 @@ -250,7 +250,7 @@ GetIcon(DTCM_editor *de) drag_xbm_width, drag_xbm_height); if (de->drag_bitmap == 0) { - printf("%s", catgets(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n")); + printf("%s", CATGETS(calendar->DT_catd, 1, 237, "XCreateBitmapFromData() failed for bitmap.\n")); return; } } @@ -259,7 +259,7 @@ GetIcon(DTCM_editor *de) window, (char *) drag_mask_xbm_bits, drag_mask_xbm_width, drag_mask_xbm_height); if (de->drag_mask == 0) { - printf("%s", catgets(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n")); + printf("%s", CATGETS(calendar->DT_catd, 1, 238, "XCreateBitmapFromData() failed for mask.\n")); return; } } @@ -320,7 +320,7 @@ ApptConvertCB( data->bp = XtNewString(context->data); data->size = strlen(data->bp); - data->name = XtNewString(catgets(c->DT_catd, 1, 236, "CalendarAppointment")); + data->name = XtNewString(CATGETS(c->DT_catd, 1, 236, "CalendarAppointment")); } void @@ -396,7 +396,7 @@ StandaloneApptDragStart( NULL) == NULL) { - printf("%s", catgets(c->DT_catd, 1, 239, "DragStart returned NULL.\n")); + printf("%s", CATGETS(c->DT_catd, 1, 239, "DragStart returned NULL.\n")); } } @@ -469,11 +469,11 @@ de_quit_handler(Widget w, XtPointer cdata, XtPointer data) { int answer; if (de->modified == True) { - char *title = XtNewString(catgets(de->c->DT_catd, 1, 1008, "Calendar Appointment : Help")); - char *text = XtNewString(catgets(de->c->DT_catd, 1, 451, "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog.")); - char *ident1 = XtNewString(catgets(de->c->DT_catd, 1, 452, "Save")); - char *ident2 = XtNewString(catgets(de->c->DT_catd, 1, 700, "Discard")); - char *ident3 = XtNewString(catgets(de->c->DT_catd, 1, 923, "Cancel")); + char *title = XtNewString(CATGETS(de->c->DT_catd, 1, 1008, "Calendar Appointment : Help")); + char *text = XtNewString(CATGETS(de->c->DT_catd, 1, 451, "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog.")); + char *ident1 = XtNewString(CATGETS(de->c->DT_catd, 1, 452, "Save")); + char *ident2 = XtNewString(CATGETS(de->c->DT_catd, 1, 700, "Discard")); + char *ident3 = XtNewString(CATGETS(de->c->DT_catd, 1, 923, "Cancel")); answer = dialog_popup(de->top_level, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -718,9 +718,9 @@ DieFromToolTalkError(DTCM_editor *de, char *errfmt, Tt_status status) errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); sprintf(errmsg, errfmt, statmsg); - xms_ok = XmStringCreateLocalized(catgets(de->c->DT_catd, 2, 3, "OK")); + xms_ok = XmStringCreateLocalized(CATGETS(de->c->DT_catd, 2, 3, "OK")); xms_errmsg = XmStringCreateLocalized(errmsg); - xms_title = XmStringCreateLocalized(catgets(de->c->DT_catd, 2, 4, + xms_title = XmStringCreateLocalized(CATGETS(de->c->DT_catd, 2, 4, "Calendar : Appointment Editor - Warning")); n = 0; @@ -1145,12 +1145,12 @@ main(int argc, char **argv) { set_int_prop(de->p, CP_DAYBEGIN, start); set_int_prop(de->p, CP_DAYEND, stop); de->c->calname = cm_strdup(get_char_prop(de->p, CP_DEFAULTCAL)); - de->c->DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + de->c->DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); /* Open the message catalog for internationalization */ - calendar->DT_catd = catopen(DTCM_CAT, NL_CAT_LOCALE); + calendar->DT_catd = CATOPEN(DTCM_CAT, NL_CAT_LOCALE); - title = XtNewString(catgets(calendar->DT_catd, 1, 1074, + title = XtNewString(CATGETS(calendar->DT_catd, 1, 1074, "Calendar Appointment")); XtVaSetValues(de->top_level, XmNtitle, title, @@ -1166,7 +1166,7 @@ main(int argc, char **argv) { XmNfractionBase, 5, NULL); - label_str = XmStringCreateLocalized(catgets(de->c->DT_catd, 1, 846, "Save")); + label_str = XmStringCreateLocalized(CATGETS(de->c->DT_catd, 1, 846, "Save")); de->attach_button = XtVaCreateWidget("attach_button", xmPushButtonGadgetClass, de->form, XmNlabelString, label_str, @@ -1182,7 +1182,7 @@ main(int argc, char **argv) { if (!de->file) XtSetSensitive(de->attach_button, False); - label_str = XmStringCreateLocalized(catgets(de->c->DT_catd, 1, 691, "Reset")); + label_str = XmStringCreateLocalized(CATGETS(de->c->DT_catd, 1, 691, "Reset")); de->reset_button = XtVaCreateWidget("reset_button", xmPushButtonGadgetClass, de->form, XmNlabelString, label_str, @@ -1225,7 +1225,7 @@ main(int argc, char **argv) { * Add a drag source icon inside the dssw, lower right */ xmstr = XmStringCreateLocalized( - catgets(de->c->DT_catd, 1, 627, "Drag Appt")); + CATGETS(de->c->DT_catd, 1, 627, "Drag Appt")); de->drag_source = XtVaCreateWidget("drag_source", dtIconGadgetClass, de->form, XmNpixmapPosition, XmPIXMAP_TOP, @@ -1350,7 +1350,7 @@ main(int argc, char **argv) { status = cmtt_init("AppointmentEditor", de, app, calendar->frame); if (TT_OK != status) { char *errfmt; - errfmt = catgets(calendar->DT_catd, 2, 2, + errfmt = CATGETS(calendar->DT_catd, 2, 2, "Could not connect to ToolTalk:\n%s\n"); DieFromToolTalkError( de, errfmt, status ); } diff --git a/cde/programs/dtcm/dtcm/editor.c b/cde/programs/dtcm/dtcm/editor.c index 1f05cfe71..0a9d7e624 100644 --- a/cde/programs/dtcm/dtcm/editor.c +++ b/cde/programs/dtcm/dtcm/editor.c @@ -128,7 +128,7 @@ appt_to_form(Editor *e, CSA_entry_handle a) { free_appt_struct(&appt); return; } - sprintf(buf, "%s: %s", catgets(e->cal->DT_catd, 1, 251, "Author"), + sprintf(buf, "%s: %s", CATGETS(e->cal->DT_catd, 1, 251, "Author"), appt->author->value->item.calendar_user_value->user_name); set_message(e->message_text, buf); free_appt_struct(&appt); @@ -200,7 +200,7 @@ e_build_view_popup(Editor *e) { /* ** Dialog shell and stuff */ - title = XtNewString(catgets(c->DT_catd, 1, 1086, + title = XtNewString(CATGETS(c->DT_catd, 1, 1086, "Calendar : Appointment List")); e->view_frame = XtVaCreatePopupShell("appt_list", xmDialogShellWidgetClass, e->cal->frame, @@ -219,7 +219,7 @@ e_build_view_popup(Editor *e) { XmNautoUnmanage, False, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); e->view_cancel_button = XtVaCreateWidget("cancel", xmPushButtonWidgetClass, e->view_form, XmNlabelString, xmstr, @@ -234,7 +234,7 @@ e_build_view_popup(Editor *e) { XtAddCallback(e->view_cancel_button, XmNactivateCallback, (XtCallbackProc) e_view_cancel_cb, e); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); e->view_help_button = XtVaCreateWidget("help", xmPushButtonWidgetClass, e->view_form, XmNlabelString, xmstr, @@ -257,7 +257,7 @@ e_build_view_popup(Editor *e) { XmNbottomOffset, 5, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 703, "context")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 703, "context")); e->view_list_label= XtVaCreateWidget("type_label", xmLabelGadgetClass, e->view_form, XmNtopAttachment, XmATTACH_FORM, @@ -367,7 +367,7 @@ e_expand_ui_proc(Widget w, XtPointer client_data, XtPointer data) { XtRealizeWidget(e->rfp.rfp_form_mgr); XtRealizeWidget(e->reminders.bfpm_form_mgr); - xmstr = XmStringCreateLocalized(catgets(e->cal->DT_catd, 1, 625, + xmstr = XmStringCreateLocalized(CATGETS(e->cal->DT_catd, 1, 625, "Less")); XtVaSetValues(e->expand_ui_button, XmNlabelString, xmstr, NULL); @@ -383,7 +383,7 @@ e_expand_ui_proc(Widget w, XtPointer client_data, XtPointer data) { expand_state_closed = False; } else { - xmstr = XmStringCreateLocalized(catgets(e->cal->DT_catd, 1, 626, + xmstr = XmStringCreateLocalized(CATGETS(e->cal->DT_catd, 1, 626, "More")); XtVaSetValues(e->expand_ui_button, XmNlabelString, xmstr, NULL); @@ -454,12 +454,12 @@ e_insert_proc(Widget w, XtPointer client_data, XtPointer data) { * Make sure user really meant to insert appointment * into somebody elses calendar. */ - sprintf(buf, "%s", catgets(c->DT_catd, 1, 210, "The appointment will be scheduled in the calendar\nyou are currently browsing. Do you still want to schedule it?")); - sprintf(buf2, "%s %s", catgets(c->DT_catd, 1, 211, "Schedule in"), + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 210, "The appointment will be scheduled in the calendar\nyou are currently browsing. Do you still want to schedule it?")); + sprintf(buf2, "%s %s", CATGETS(c->DT_catd, 1, 211, "Schedule in"), c->view->current_calendar); - title = XtNewString(catgets(c->DT_catd, 1, 212, + title = XtNewString(CATGETS(c->DT_catd, 1, 212, "Calendar : Schedule Appointment")); - ident = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); + ident = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, buf, @@ -498,12 +498,12 @@ e_delete_proc(Widget w, XtPointer client_data, XtPointer data) { * Make sure user really meant to delete appointment * from somebody elses calendar. */ - sprintf(buf, "%s", catgets(c->DT_catd, 1, 1004, "This appointment is in a calendar owned by someone else.\nDo you want to delete it anyway ?")); - sprintf(buf2, "%s %s", catgets(c->DT_catd, 1, 1005, "Delete from"), + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 1004, "This appointment is in a calendar owned by someone else.\nDo you want to delete it anyway ?")); + sprintf(buf2, "%s %s", CATGETS(c->DT_catd, 1, 1005, "Delete from"), c->view->current_calendar); - title = XtNewString(catgets(c->DT_catd, 1, 252, + title = XtNewString(CATGETS(c->DT_catd, 1, 252, "Calendar : Appointment Editor - Delete")); - ident = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); + ident = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, buf, @@ -518,11 +518,11 @@ e_delete_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(e->frame); if (!XmListGetSelectedPos(e->appt_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 252, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 252, "Calendar : Appointment Editor - Delete")); - char *text = XtNewString(catgets(c->DT_catd, 1, 253, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 253, "Select an appointment and DELETE again.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -537,11 +537,11 @@ e_delete_proc(Widget w, XtPointer client_data, XtPointer data) { } if (!(a = editor_nth_appt(e, item_list[0] - 1))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 252, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 252, "Calendar : Appointment Editor - Delete")); - char *text = XtNewString(catgets(c->DT_catd, 1, 256, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 256, "Internal error selecting appointment.\nAppointment was not deleted.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -574,15 +574,15 @@ e_change_proc(Widget w, XtPointer client_data, XtPointer data) { if (strcmp(c->calname, c->view->current_calendar) != 0) { char buf[BUFSIZ], buf2[BUFSIZ]; - char *title = XtNewString(catgets(c->DT_catd, 1, 258, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 258, "Calendar : Appointment Editor - Change")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); /* * Make sure user really meant to insert appointment * into somebody elses calendar. */ - sprintf(buf, "%s", catgets(c->DT_catd, 1, 1003, "This appointment is in a calendar owned by someone else.\nDo you want to change it anyway ?")); - sprintf(buf2, "%s %s", catgets(c->DT_catd, 1, 1006, "Change in"), + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 1003, "This appointment is in a calendar owned by someone else.\nDo you want to change it anyway ?")); + sprintf(buf2, "%s %s", CATGETS(c->DT_catd, 1, 1006, "Change in"), c->view->current_calendar); answer = dialog_popup(e->frame, DIALOG_TITLE, title, @@ -598,11 +598,11 @@ e_change_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(e->frame); if (!XmListGetSelectedPos(e->appt_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 258, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 258, "Calendar : Appointment Editor - Change")); - char *text = XtNewString(catgets(c->DT_catd, 1, 259, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 259, "Select an appointment and CHANGE again.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -617,11 +617,11 @@ e_change_proc(Widget w, XtPointer client_data, XtPointer data) { } if (!(old_a = editor_nth_appt(e, item_list[0] - 1))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1075, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1075, "Calendar : Error - Change Appointment")); - char *text = XtNewString(catgets(c->DT_catd, 1, 1007, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 1007, "Internal error selecting appointment.\nAppointment was not changed.")); - char *ident = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -777,7 +777,7 @@ e_make_editor(Calendar *c) ** first separator. */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 628, "Time What")); + CATGETS(c->DT_catd, 1, 628, "Time What")); e->list_label = XtVaCreateWidget("label", xmLabelGadgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -802,7 +802,7 @@ e_make_editor(Calendar *c) /* ** Create insert, delete, change, and clear buttons */ - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 342, "Insert")); e->insert_button = XtVaCreateWidget("Insert", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -816,7 +816,7 @@ e_make_editor(Calendar *c) XtAddCallback(e->insert_button, XmNactivateCallback, e_insert_proc, e); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 343, "Change")); e->change_button = XtVaCreateWidget("Change", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -831,7 +831,7 @@ e_make_editor(Calendar *c) XtAddCallback(e->change_button, XmNactivateCallback, e_change_proc, e); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 419, "Delete")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 419, "Delete")); e->delete_button = XtVaCreateWidget("Delete", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -846,7 +846,7 @@ e_make_editor(Calendar *c) XtAddCallback(e->delete_button, XmNactivateCallback, e_delete_proc, e); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 803, "Clear")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 803, "Clear")); e->clear_button = XtVaCreateWidget("Clear", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -860,7 +860,7 @@ e_make_editor(Calendar *c) XtAddCallback(e->clear_button, XmNactivateCallback, e_clear_proc, e); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); e->close_button = XtVaCreateWidget("Cancel", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -874,7 +874,7 @@ e_make_editor(Calendar *c) XtAddCallback(e->close_button, XmNactivateCallback, e_close_proc, e); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); e->help_button = XtVaCreateWidget("Help", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -908,7 +908,7 @@ e_make_editor(Calendar *c) XmNbottomWidget, e->separator2, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 626, "More")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 626, "More")); e->expand_ui_button = XtVaCreateWidget("expand_ui_button", xmPushButtonWidgetClass, e->base_form_mgr, XmNlabelString, xmstr, @@ -952,7 +952,7 @@ e_make_editor(Calendar *c) * Add a drag source icon inside the dssw, lower right */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 627, "Drag Appt")); + CATGETS(c->DT_catd, 1, 627, "Drag Appt")); e->drag_source = XtVaCreateWidget("drag_source", dtIconGadgetClass, e->dssw.dssw_form_mgr, XmNpixmapPosition, XmPIXMAP_TOP, @@ -1156,21 +1156,21 @@ set_list_title(Editor *e) { switch (e->view_list_glance) { case yearGlance: - header = catgets(c->DT_catd, 1, 704, "Year of %d"); + header = CATGETS(c->DT_catd, 1, 704, "Year of %d"); sprintf(buffer, header, year(e->view_list_date)); break; case monthGlance: - header = catgets(c->DT_catd, 1, 705, "%s"); + header = CATGETS(c->DT_catd, 1, 705, "%s"); format_date(e->view_list_date+1, get_int_prop(p, CP_DATEORDERING), buffer2, 0, 0, 0); sprintf(buffer, header, buffer2); break; case weekGlance: - header = catgets(c->DT_catd, 1, 706, "Week of %s"); + header = CATGETS(c->DT_catd, 1, 706, "Week of %s"); format_date(e->view_list_date+1, get_int_prop(p, CP_DATEORDERING), buffer2, 1, 0, 0); sprintf(buffer, header, buffer2); break; case dayGlance: - header = catgets(c->DT_catd, 1, 707, "%s"); + header = CATGETS(c->DT_catd, 1, 707, "%s"); format_date(e->view_list_date+1, get_int_prop(p, CP_DATEORDERING), buffer2, 1, 0, 0); sprintf(buffer, header, buffer2); break; @@ -1492,12 +1492,12 @@ editor_change(Dtcm_appointment *new_a, CSA_entry_handle old_a, CSA_entry_handle (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_WEEKLY) || (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_MONTHLY) || (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_YEARLY)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 258, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 258, "Calendar : Appointment Editor - Change")); - char *text = XtNewString(catgets(c->DT_catd, 1, 708, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 708, "This appointment repeats in an unknown fashion. All occurrences will be changed\nDo you still wish to change it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1512,15 +1512,15 @@ editor_change(Dtcm_appointment *new_a, CSA_entry_handle old_a, CSA_entry_handle } else if (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 258, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 258, "Calendar : Appointment Editor - Change")); - char *text = XtNewString(catgets(c->DT_catd, 1, 268, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 268, "This appointment is part of a repeating series.\nDo you want to change ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 270, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 270, "This One Only")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 271, "Forward")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 271, "Forward")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1654,15 +1654,15 @@ editor_delete(CSA_entry_handle entry, Calendar *c) { if (appt->repeat_type->value) { if (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 252, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 252, "Calendar : Appointment Editor - Delete")); - char *text = XtNewString(catgets(c->DT_catd, 1, 274, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 274, "This appointment is part of a repeating series.\nDo you want to delete ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 270, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 270, "This One Only")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 271, "Forward")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 271, "Forward")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1681,12 +1681,12 @@ editor_delete(CSA_entry_handle entry, Calendar *c) { } } else if (appt->recurrence_rule->value) { - char *title = XtNewString(catgets(c->DT_catd, 1, 252, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 252, "Calendar : Appointment Editor - Delete")); - char *text = XtNewString(catgets(c->DT_catd, 1, 711, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 711, "This appointment repeats in an unknown fashion. All occurrences will be deleted\nDo you still wish to delete it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1753,12 +1753,12 @@ editor_insert(Dtcm_appointment *appt, CSA_entry_handle *new_a, Calendar *c) { if ((appt->repeat_type) && (appt->repeat_type->value) && (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1101, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1101, "Insert Appointment")); - char *text = XtNewString(catgets(c->DT_catd, 1, 984, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 984, "This appointment is part of a repeating series.\nDo you want to insert appointment ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(e->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1872,7 +1872,7 @@ set_editor_title(Editor *e, char *name) { Calendar *c = e->cal; if (e->frame) { - sprintf(buf, "%s - %s", catgets(c->DT_catd, 1, 279, + sprintf(buf, "%s - %s", CATGETS(c->DT_catd, 1, 279, "Calendar : Appointment Editor"), name); XtVaSetValues(e->frame, XmNtitle, buf, NULL); @@ -1932,11 +1932,11 @@ show_editor_view(Calendar *c, Glance glance) { if (build_editor_view(e, glance, False) <= 0) { - char *title = XtNewString(catgets(c->DT_catd, 1, 280, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 280, "Calendar : Error - Appointment List")); - char *text = XtNewString(catgets(c->DT_catd, 1, 281, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 281, "Sorry, no appointments to list. ")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(e->cal->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, diff --git a/cde/programs/dtcm/dtcm/find.c b/cde/programs/dtcm/dtcm/find.c index 10742709a..a0c17b626 100644 --- a/cde/programs/dtcm/dtcm/find.c +++ b/cde/programs/dtcm/dtcm/find.c @@ -94,7 +94,7 @@ make_find(Calendar *c) else f = (Find*)c->find; - title = XtNewString(catgets(c->DT_catd, 1, 283, "Calendar : Find")); + title = XtNewString(CATGETS(c->DT_catd, 1, 283, "Calendar : Find")); f->frame = XtVaCreatePopupShell("frame", xmDialogShellWidgetClass, c->frame, @@ -113,7 +113,7 @@ make_find(Calendar *c) XmNmarginHeight, 0, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 284, "Find:")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 284, "Find:")); f->apptstr_label = XtVaCreateWidget("label", xmLabelWidgetClass, f->form, @@ -153,7 +153,7 @@ make_find(Calendar *c) NULL); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 973, "Search all")); + CATGETS(c->DT_catd, 1, 973, "Search all")); f->search_all = XtVaCreateWidget("searchAll", xmToggleButtonGadgetClass, f->search_rc_mgr, @@ -165,7 +165,7 @@ make_find(Calendar *c) NULL); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 974, "Search from")); + CATGETS(c->DT_catd, 1, 974, "Search from")); f->search_range = XtVaCreateWidget("searchrange", xmToggleButtonGadgetClass, f->search_rc_mgr, @@ -209,7 +209,7 @@ make_find(Calendar *c) format_tick(cursor, ot, sep, buffer); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 975, "to")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 975, "to")); f->search_tolabel = XtVaCreateWidget("tolabel", xmLabelWidgetClass, f->form, @@ -247,7 +247,7 @@ make_find(Calendar *c) NULL); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 848, "Date")); + CATGETS(c->DT_catd, 1, 848, "Date")); f->date_label = XtVaCreateWidget("finddatelabel", xmLabelWidgetClass, f->form, @@ -260,7 +260,7 @@ make_find(Calendar *c) NULL); XmStringFree(xmstr); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 849, "Time")); + CATGETS(c->DT_catd, 1, 849, "Time")); f->time_label = XtVaCreateWidget("findtimelabel", xmLabelWidgetClass, f->form, @@ -273,7 +273,7 @@ make_find(Calendar *c) NULL); XmStringFree(xmstr); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 850, "What")); + CATGETS(c->DT_catd, 1, 850, "What")); f->what_label = XtVaCreateWidget("findwhatlabel", xmLabelWidgetClass, f->form, @@ -320,7 +320,7 @@ make_find(Calendar *c) XmNbottomOffset, 5, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 285, "Find")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 285, "Find")); f->find_button = XtVaCreateWidget("findbutton", xmPushButtonGadgetClass, button_form, @@ -338,7 +338,7 @@ make_find(Calendar *c) XmStringFree(xmstr); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 851, "Show Appointment")); + CATGETS(c->DT_catd, 1, 851, "Show Appointment")); f->show_button = XtVaCreateWidget("show", xmPushButtonGadgetClass, button_form, @@ -355,7 +355,7 @@ make_find(Calendar *c) XtAddCallback(f->show_button, XmNactivateCallback, show_appt, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); f->cancel_button = XtVaCreateWidget("cancel", xmPushButtonGadgetClass, button_form, @@ -372,7 +372,7 @@ make_find(Calendar *c) XtAddCallback(f->cancel_button, XmNactivateCallback, f_cancel_cb, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); f->help_button = XtVaCreateWidget("help", xmPushButtonGadgetClass, button_form, @@ -587,7 +587,7 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs astr = XmTextGetString(f->apptstr); if (astr == NULL || *astr == '\0') { - sprintf(message, "%s", catgets(c->DT_catd, 1, 290, "Specify Appt String to Match.")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 290, "Specify Appt String to Match.")); set_message(f->find_message, message); return; } @@ -612,12 +612,12 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs if (start == DATE_BBOT) start = get_bot(); else if (start == DATE_AEOT) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 810, "Please enter a start date after 1/1/1970")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 810, "Please enter a start date after 1/1/1970")); set_message(f->find_message, message); return; } else if (start <= 0) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 811, "Malformed start date")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 811, "Malformed start date")); set_message(f->find_message, message); return; } @@ -628,18 +628,18 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs if (end_of_time == DATE_AEOT) end_of_time = real_eot; else if (end_of_time == DATE_BBOT) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 812, "Please enter an end date before 1/1/2038")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 812, "Please enter an end date before 1/1/2038")); set_message(f->find_message, message); return; } else if (end_of_time <= 0) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 813, "Malformed end date")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 813, "Malformed end date")); set_message(f->find_message, message); return; } if (start >= end_of_time) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 713, "You must choose a begin date before the end date.")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 713, "You must choose a begin date before the end date.")); set_message(f->find_message, message); return; } @@ -722,9 +722,9 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs if (match_total != last_match_total) { if (match_total == 1) - sprintf(message, catgets(c->DT_catd, 1, 631, "%d match found"), match_total); + sprintf(message, CATGETS(c->DT_catd, 1, 631, "%d match found"), match_total); else if (match_total > 1) - sprintf(message, catgets(c->DT_catd, 1, 292, "%d matches found"), match_total); + sprintf(message, CATGETS(c->DT_catd, 1, 292, "%d matches found"), match_total); set_message(f->find_message, message); } @@ -751,11 +751,11 @@ find_appts(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs } /* end for range.end loop */ if (match_total == 0) - sprintf(message, "%s", catgets(c->DT_catd, 1, 291, "Appointment Not Found.")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 291, "Appointment Not Found.")); else if (match_total == 1) - sprintf(message, catgets(c->DT_catd, 1, 631, "%d match found"), match_total); + sprintf(message, CATGETS(c->DT_catd, 1, 631, "%d match found"), match_total); else - sprintf(message, catgets(c->DT_catd, 1, 292, "%d matches found"), match_total); + sprintf(message, CATGETS(c->DT_catd, 1, 292, "%d matches found"), match_total); set_message(f->find_message, message); free_appt_struct(&appt); _DtTurnOffHourGlass(f->frame); @@ -781,12 +781,12 @@ show_appt(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs) XtVaGetValues(f->find_list, XmNitemCount, &list_cnt, NULL); if (list_cnt == 0) { - sprintf(buf, "%s", catgets(c->DT_catd, 1, 714, "There are no appointments in the list. You must find one before showing an appointment.")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 714, "There are no appointments in the list. You must find one before showing an appointment.")); set_message(f->find_message, buf); return; } if (!XmListGetSelectedPos(f->find_list, &pos_list, &pos_cnt)) { - sprintf(buf, "%s", catgets(c->DT_catd, 1, 632, "Please select an appointment from the list to show")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 632, "Please select an appointment from the list to show")); set_message(f->find_message, buf); return; } diff --git a/cde/programs/dtcm/dtcm/goto.c b/cde/programs/dtcm/dtcm/goto.c index f457efd65..924833cb9 100644 --- a/cde/programs/dtcm/dtcm/goto.c +++ b/cde/programs/dtcm/dtcm/goto.c @@ -95,7 +95,7 @@ make_goto(Calendar *c) else g = (Goto*)c->goTo; - title = XtNewString(catgets(c->DT_catd, 1, 715, "Calendar : Go to Date")); + title = XtNewString(CATGETS(c->DT_catd, 1, 715, "Calendar : Go to Date")); g->frame = XtVaCreatePopupShell("frame", xmDialogShellWidgetClass, c->frame, XmNtitle, title, @@ -114,7 +114,7 @@ make_goto(Calendar *c) XmNmarginHeight, 0, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 293, "Date:")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 293, "Date:")); g->datelabel = XtVaCreateWidget("Date:", xmLabelWidgetClass, g->form, XmNleftAttachment, XmATTACH_FORM, @@ -163,7 +163,7 @@ make_goto(Calendar *c) XmNfractionBase, 3, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 294, "Go To")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 294, "Go To")); g->datebutton = XtVaCreateWidget("goTo", xmPushButtonWidgetClass, button_form, XmNtopAttachment, XmATTACH_WIDGET, @@ -178,7 +178,7 @@ make_goto(Calendar *c) XtAddCallback(g->datebutton, XmNactivateCallback, goto_date, NULL); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); g->cancelbutton = XtVaCreateWidget("cancel", xmPushButtonWidgetClass, button_form, XmNtopAttachment, XmATTACH_WIDGET, @@ -193,7 +193,7 @@ make_goto(Calendar *c) XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); g->helpbutton = XtVaCreateWidget("help", xmPushButtonWidgetClass, button_form, XmNtopAttachment, XmATTACH_WIDGET, @@ -259,7 +259,7 @@ goto_date(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs) date = XmTextGetString(g->datetext); if ((date == NULL) || (*date == '\0')) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 297, "Please type in a date")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 297, "Please type in a date")); set_message(g->goto_message, message); return; } @@ -272,24 +272,24 @@ goto_date(Widget widget, XtPointer client_data, XmPushButtonCallbackStruct *cbs) gotodate = cm_getdate(date, NULL); } if (!strcmp(today, date)) { - sprintf(message, catgets(c->DT_catd, 1, 298, "You are already viewing %s"), date); + sprintf(message, CATGETS(c->DT_catd, 1, 298, "You are already viewing %s"), date); set_message(g->goto_message, message); return; } if (gotodate == DATE_BBOT) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 814, "You must enter a date after 1969 and before 2038")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 814, "You must enter a date after 1969 and before 2038")); set_message(g->goto_message, message); return; } else if (gotodate == DATE_AEOT) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 814, "You must enter a date after 1969 and before 2038")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 814, "You must enter a date after 1969 and before 2038")); set_message(g->goto_message, message); return; } else if (gotodate <= 0) { - sprintf(message, "%s", catgets(c->DT_catd, 1, 299, "Invalid Date")); + sprintf(message, "%s", CATGETS(c->DT_catd, 1, 299, "Invalid Date")); set_message(g->goto_message, message); return; } diff --git a/cde/programs/dtcm/dtcm/group_editor.c b/cde/programs/dtcm/dtcm/group_editor.c index 9c528e360..75bb93638 100644 --- a/cde/programs/dtcm/dtcm/group_editor.c +++ b/cde/programs/dtcm/dtcm/group_editor.c @@ -219,7 +219,7 @@ appt_to_form(GEditor *ge, CSA_entry_handle a, char *name, int version) { backend_err_msg(ge->frame, name, stat, pu->xm_error_pixmap); if (stat == CSA_SUCCESS) { sprintf(buf, "%s: %s", - catgets(ge->cal->DT_catd, 1, 300, "Author"), + CATGETS(ge->cal->DT_catd, 1, 300, "Author"), appt->author->value->item.calendar_user_value->user_name); set_message(ge->message_text, buf); } else @@ -266,10 +266,10 @@ ge_set_modify_buttons(GEditor *ge, int cnt) { if (cnt == 1) sprintf(buf, "%d %s.", cnt, - catgets(ge->cal->DT_catd, 1, 633, "Calendar Selected")); + CATGETS(ge->cal->DT_catd, 1, 633, "Calendar Selected")); else sprintf(buf, "%d %s.", cnt, - catgets(ge->cal->DT_catd, 1, 634, "Calendars Selected")); + CATGETS(ge->cal->DT_catd, 1, 634, "Calendars Selected")); set_message(ge->message_text, buf); } @@ -420,7 +420,7 @@ ge_build_expand(GEditor *ge) { } XtManageChildren(widgets, n - 2); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 304, "Mail...")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 304, "Mail...")); ge->mail_button = XtVaCreateWidget("mail", xmPushButtonWidgetClass, ge->base_form_mgr, XmNlabelString, xmstr, @@ -472,7 +472,7 @@ ge_expand_ui_proc(Widget w, XtPointer client_data, XtPointer data) { XtRealizeWidget(ge->rfp.rfp_form_mgr); xmstr = XmStringCreateLocalized( - catgets(ge->cal->DT_catd, 1, 625, "Less")); + CATGETS(ge->cal->DT_catd, 1, 625, "Less")); XtVaSetValues(ge->expand_ui_button, XmNlabelString, xmstr, NULL); @@ -489,7 +489,7 @@ ge_expand_ui_proc(Widget w, XtPointer client_data, XtPointer data) { expand_state_closed = False; } else { XtSetSensitive(ge->rfp.rfp_form_mgr, False); - xmstr = XmStringCreateLocalized(catgets(ge->cal->DT_catd, 1, 626, + xmstr = XmStringCreateLocalized(CATGETS(ge->cal->DT_catd, 1, 626, "More")); XtVaSetValues(ge->expand_ui_button, XmNlabelString, xmstr, NULL); @@ -707,11 +707,11 @@ ge_insert_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(ge->frame); XmListGetSelectedPos(ge->access_list, &c_list, &c_cnt); if (c_cnt <= 0) { - char *title = XtNewString(catgets(c->DT_catd, 1, 305, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 305, "Calendar : Error - Group Appointment Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 306, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 306, "Select a calendar and INSERT again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -813,11 +813,11 @@ ge_delete_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(ge->frame); if (!XmListGetSelectedPos(ge->appt_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 305, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 305, "Calendar : Error - Group Appointment Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 253, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 253, "Select an appointment and DELETE again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -832,11 +832,11 @@ ge_delete_proc(Widget w, XtPointer client_data, XtPointer data) { } if (!(entry = geditor_nth_appt(ge, item_list[0], &ad))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 305, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 305, "Calendar : Error - Group Appointment Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 256, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 256, "Internal error selecting appointment.\nAppointment was not deleted.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, @@ -857,11 +857,11 @@ ge_delete_proc(Widget w, XtPointer client_data, XtPointer data) { XtVaGetValues(ge->access_list, XmNselectedItemCount, &c_cnt, NULL); if (c_cnt <= 0) { - char *title = XtNewString(catgets(c->DT_catd, 1, 305, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 305, "Calendar : Error - Group Appointment Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 315, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 315, "Select a calendar and DELETE again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -892,15 +892,15 @@ ge_delete_proc(Widget w, XtPointer client_data, XtPointer data) { if (appt->repeat_type->value) { if (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 314, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 314, "Calendar : Group Appointment Editor - Delete")); - char *text = XtNewString(catgets(c->DT_catd, 1, 274, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 274, "This appointment is part of a repeating series.\nDo you want to delete ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 270, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 270, "This One Only")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 271, "Forward")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 271, "Forward")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -919,12 +919,12 @@ ge_delete_proc(Widget w, XtPointer client_data, XtPointer data) { } } else if (appt->recurrence_rule->value) { - char *title = XtNewString(catgets(c->DT_catd, 1, 314, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 314, "Calendar : Group Appointment Editor - Delete")); - char *text = XtNewString(catgets(c->DT_catd, 1, 711, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 711, "This appointment repeats in an unknown fashion. All occurrences will be deleted\nDo you still wish to delete it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -982,11 +982,11 @@ ge_change_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(ge->frame); if (!XmListGetSelectedPos(ge->appt_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 305, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 305, "Calendar : Error - Group Appointment Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 259, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 259, "Select an appointment and CHANGE again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1001,11 +1001,11 @@ ge_change_proc(Widget w, XtPointer client_data, XtPointer data) { } if (!(old_a = geditor_nth_appt(ge, item_list[0], &ad))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 305, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 305, "Calendar : Error - Group Appointment Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 1007, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 1007, "Internal error selecting appointment.\nAppointment was not changed.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1024,11 +1024,11 @@ ge_change_proc(Widget w, XtPointer client_data, XtPointer data) { XtVaGetValues(ge->access_list, XmNselectedItemCount, &c_cnt, NULL); if (c_cnt <= 0) { - char *title = XtNewString(catgets(c->DT_catd, 1, 329, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 329, "Calendar : Group Appointment Editor - Change")); - char *text = XtNewString(catgets(c->DT_catd, 1, 330, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 330, "Select a calendar and CHANGE again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1071,12 +1071,12 @@ ge_change_proc(Widget w, XtPointer client_data, XtPointer data) { (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_WEEKLY) || (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_MONTHLY) || (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_YEARLY)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 329, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 329, "Calendar : Group Appointment Editor - Change")); - char *text = XtNewString(catgets(c->DT_catd, 1, 708, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 708, "This appointment repeats in an unknown fashion. All occurrences will be changed\nDo you still wish to change it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1092,15 +1092,15 @@ ge_change_proc(Widget w, XtPointer client_data, XtPointer data) { else if (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 329, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 329, "Calendar : Group Appointment Editor - Change")); - char *text = XtNewString(catgets(c->DT_catd, 1, 268, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 268, "This appointment is part of a repeating series.\nDo you want to change ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 270, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 270, "This One Only")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 271, "Forward")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 271, "Forward")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(ge->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1337,7 +1337,7 @@ ge_make_editor(Calendar *c) { cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 342, "Insert")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNleftAttachment, XmATTACH_POSITION); ++cnt; XtSetArg(args[cnt], XmNleftPosition, 1); ++cnt; @@ -1350,7 +1350,7 @@ ge_make_editor(Calendar *c) { ge); cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 343, "Change")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNleftAttachment, XmATTACH_POSITION); ++cnt; XtSetArg(args[cnt], XmNleftPosition, 2); ++cnt; @@ -1363,7 +1363,7 @@ ge_make_editor(Calendar *c) { ge); cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 419, "Delete")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 419, "Delete")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNleftAttachment, XmATTACH_POSITION); ++cnt; XtSetArg(args[cnt], XmNleftPosition, 3); ++cnt; @@ -1376,7 +1376,7 @@ ge_make_editor(Calendar *c) { ge); cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 803, "Clear")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 803, "Clear")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNleftAttachment, XmATTACH_POSITION); ++cnt; XtSetArg(args[cnt], XmNleftPosition, 4); ++cnt; @@ -1389,7 +1389,7 @@ ge_make_editor(Calendar *c) { ge); cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNleftAttachment, XmATTACH_POSITION); ++cnt; XtSetArg(args[cnt], XmNleftPosition, 5); ++cnt; @@ -1402,7 +1402,7 @@ ge_make_editor(Calendar *c) { ge); cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNleftAttachment, XmATTACH_POSITION); ++cnt; XtSetArg(args[cnt], XmNleftPosition, 6); ++cnt; @@ -1445,7 +1445,7 @@ ge_make_editor(Calendar *c) { ** The more button */ cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 626, "More")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 626, "More")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNbottomAttachment, XmATTACH_WIDGET); ++cnt; XtSetArg(args[cnt], XmNbottomWidget, ge->separator1); ++cnt; @@ -1462,7 +1462,7 @@ ge_make_editor(Calendar *c) { ** The appt list label */ cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 971, "Time Calendar")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 971, "Time Calendar")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNtopAttachment, XmATTACH_FORM); ++cnt; XtSetArg(args[cnt], XmNtopOffset, 5); ++cnt; @@ -1474,7 +1474,7 @@ ge_make_editor(Calendar *c) { ** The appt list label */ cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 972, "What")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 972, "What")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNtopAttachment, XmATTACH_FORM); ++cnt; XtSetArg(args[cnt], XmNtopOffset, 5); ++cnt; @@ -1501,7 +1501,7 @@ ge_make_editor(Calendar *c) { /* * Add a drag source icon inside the dssw, lower right */ - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 627, "Drag Appt")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 627, "Drag Appt")); ge->drag_source = XtVaCreateWidget("drag_source", dtIconGadgetClass, ge->dssw.dssw_form_mgr, XmNpixmapPosition, XmPIXMAP_TOP, @@ -1571,7 +1571,7 @@ ge_make_editor(Calendar *c) { ** The access list label */ cnt = 0; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 340, "Calendar")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 340, "Calendar")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNbottomAttachment, XmATTACH_WIDGET); ++cnt; XtSetArg(args[cnt], XmNbottomWidget, ge->access_list_sw); ++cnt; @@ -1582,7 +1582,7 @@ ge_make_editor(Calendar *c) { "access_list_label", args, cnt); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 341, "Access")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 341, "Access")); XtSetArg(args[cnt], XmNlabelString, xmstr); ++cnt; XtSetArg(args[cnt], XmNbottomAttachment, XmATTACH_WIDGET); ++cnt; XtSetArg(args[cnt], XmNbottomWidget, ge->access_list_sw); ++cnt; @@ -1731,7 +1731,7 @@ add_to_gaccess_list( new_data->entry_access = user_access; CmDataListAdd(ge->access_data, (void *)new_data, 0); - buf = (char *)ckalloc(ACCESS_NAME_LEN + cm_strlen(catgets(c->DT_catd, + buf = (char *)ckalloc(ACCESS_NAME_LEN + cm_strlen(CATGETS(c->DT_catd, 1, 348, "Insert Permission")) + 5); sprintf(buf, "%-*s %c", ACCESS_NAME_LEN, name, access); xmstr = XmStringCreateLocalized(buf); @@ -1978,7 +1978,7 @@ set_geditor_title(GEditor *ge, char *name) { Calendar *c = ge->cal; if (ge->frame) { - sprintf(buf, "%s - %s", catgets(c->DT_catd, 1, 349, + sprintf(buf, "%s - %s", CATGETS(c->DT_catd, 1, 349, "Calendar : Group Appointment Editor"), name); XtVaSetValues(ge->frame, XmNtitle, buf, NULL); diff --git a/cde/programs/dtcm/dtcm/help.c b/cde/programs/dtcm/dtcm/help.c index 96f4fc0c7..e350f6249 100644 --- a/cde/programs/dtcm/dtcm/help.c +++ b/cde/programs/dtcm/dtcm/help.c @@ -98,7 +98,7 @@ display_help(Calendar *c, ArgList args, int nargs) if (!c->mainhelpdialog) { Arg oneArg; - char *title = XtNewString(catgets(c->DT_catd, 1, 1076, "Calendar : Help")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1076, "Calendar : Help")); XtSetArg(oneArg, XmNtitle, title); c->mainhelpdialog = @@ -154,7 +154,7 @@ void show_main_help(Widget w, XtPointer clientData, XtPointer cbs) switch ((int)status) { case DtHELP_SELECT_ERROR: - printf("%s", catgets(c->DT_catd, 1, 350, "Selection Error, cannot continue\n")); + printf("%s", CATGETS(c->DT_catd, 1, 350, "Selection Error, cannot continue\n")); break; case DtHELP_SELECT_VALID: while (selWidget != NULL) @@ -174,9 +174,9 @@ void show_main_help(Widget w, XtPointer clientData, XtPointer cbs) case DtHELP_SELECT_INVALID: { - char *title = XtNewString(catgets(c->DT_catd, 1, 110, "Calendar : Error - Help")); - char *text = XtNewString(catgets(c->DT_catd, 1, 352, "You must select a component within your application.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 110, "Calendar : Error - Help")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 352, "You must select a component within your application.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, diff --git a/cde/programs/dtcm/dtcm/misc.c b/cde/programs/dtcm/dtcm/misc.c index f598633bb..051547cba 100644 --- a/cde/programs/dtcm/dtcm/misc.c +++ b/cde/programs/dtcm/dtcm/misc.c @@ -89,47 +89,47 @@ create_repeat_menu(Widget parent, XtCallbackProc cb_func, XtPointer data) { XtSetArg(args[ac], XmNpositionMode, XmONE_BASED); ++ac; cb = XmCreateComboBox(parent, "repeat_cb", args, ac); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 200, "One Time")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 200, "One Time")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 853, "Daily")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 853, "Daily")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 854, "Weekly")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 854, "Weekly")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 855, "Every Two Weeks")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 855, "Every Two Weeks")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 856, "Monthly By Date")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 856, "Monthly By Date")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 857, "Monthly By Weekday")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 857, "Monthly By Weekday")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 858, "Yearly")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 858, "Yearly")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 859, "Monday Thru Friday")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 859, "Monday Thru Friday")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 860, "Mon, Wed, Fri")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 860, "Mon, Wed, Fri")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 861, "Tuesday, Thursday")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 861, "Tuesday, Thursday")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 862, "Repeat Every...")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 862, "Repeat Every...")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); @@ -160,59 +160,59 @@ create_for_menu(Widget parent) { */ XtVaSetValues(cb, XmNwidth, 80, NULL); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 863, "2")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 863, "2")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 864, "3")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 864, "3")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 865, "4")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 865, "4")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 866, "5")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 866, "5")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 867, "6")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 867, "6")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 868, "7")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 868, "7")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 869, "8")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 869, "8")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 870, "9")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 870, "9")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 871, "10")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 871, "10")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 872, "11")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 872, "11")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 873, "12")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 873, "12")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 874, "13")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 874, "13")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 875, "14")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 875, "14")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 876, "forever")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 876, "forever")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); @@ -237,15 +237,15 @@ create_privacy_menu(Widget parent) { XtSetArg(args[ac], XmNpositionMode, XmONE_BASED); ++ac; cb = XmCreateComboBox(parent, "privacy_cb", args, ac); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 721, "Others See Time And Text")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 721, "Others See Time And Text")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 722, "Others See Time Only")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 722, "Others See Time Only")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 723, "Others See Nothing")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 723, "Others See Nothing")); XmComboBoxAddItem((Widget)cb, xmstr, 0, False); XmStringFree(xmstr); @@ -323,7 +323,7 @@ set_time_submenu(Widget parent, } if (nt) { - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 353, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 353, "No Time")); (*widget_list)[allocation_counter++] = menuitem = XtVaCreateWidget("noTime", @@ -338,7 +338,7 @@ set_time_submenu(Widget parent, } if (ad) { - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 354, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 354, "All Day")); (*widget_list)[allocation_counter++] = menuitem = XtVaCreateWidget("allDay", @@ -413,7 +413,7 @@ create_time_scope_menu(Widget parent, option_m = XmCreateOptionMenu(parent, "option_m", args, ac); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 877, "Mins")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 877, "Mins")); menuitems[0] = XtVaCreateWidget("timescope0", xmPushButtonGadgetClass, menu, XmNlabelString, xmstr, @@ -424,7 +424,7 @@ create_time_scope_menu(Widget parent, callback, client_data); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 878, "Hrs")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 878, "Hrs")); menuitems[1] = XtVaCreateWidget("timescope1", xmPushButtonGadgetClass, menu, XmNlabelString, xmstr, @@ -435,7 +435,7 @@ create_time_scope_menu(Widget parent, callback, client_data); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 879, "Days")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 879, "Days")); menuitems[2] = XtVaCreateWidget("timescope2", xmPushButtonGadgetClass, menu, XmNlabelString, xmstr, @@ -479,7 +479,7 @@ create_repeat_scope_menu(Widget parent, XmString label, sprintf(buf, "repeatscope%d", REPEAT_DAYS); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 816, "Days"));; + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 816, "Days"));; menuitems[0] = XtVaCreateWidget(buf, xmPushButtonGadgetClass, menu, XmNlabelString, xmstr, @@ -491,7 +491,7 @@ create_repeat_scope_menu(Widget parent, XmString label, XmStringFree(xmstr); sprintf(buf, "repeatscope%d", REPEAT_WEEKS); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 817, "Weeks"));; + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 817, "Weeks"));; menuitems[1] = XtVaCreateWidget(buf, xmPushButtonGadgetClass, menu, XmNlabelString, xmstr, @@ -503,7 +503,7 @@ create_repeat_scope_menu(Widget parent, XmString label, XmStringFree(xmstr); sprintf(buf, "repeatscope%d", REPEAT_MONTHS); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 818, "Months"));; + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 818, "Months"));; menuitems[2] = XtVaCreateWidget(buf, xmPushButtonGadgetClass, menu, XmNlabelString, xmstr, @@ -768,7 +768,7 @@ dialog_popup(Widget parent, ...) { case BUTTON_HELP: help_str = cm_strdup(va_arg(pvar, char *)); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 77, "Help")); + CATGETS(c->DT_catd, 1, 77, "Help")); button = XtVaCreateWidget("help_button", xmPushButtonGadgetClass, form, XmNlabelString, xmstr, @@ -891,55 +891,55 @@ editor_err_msg(Widget frame, char *name, Validate_op op, Pixmap p) { switch(op) { case COULD_NOT_OPEN_FILE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 355, "Unable to open callog file.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 355, "Unable to open callog file.\nOperation was cancelled. Calendar")); sprintf(error_buf, CMSD_ERROR_HELP); break; case CANCEL_APPT: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 356, "Per user request, Operation was cancelled.\nCalendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 356, "Per user request, Operation was cancelled.\nCalendar")); help_button = False; break; case INVALID_DATE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 357, "Invalid value in DATE field.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 357, "Invalid value in DATE field.\nOperation was cancelled. Calendar")); sprintf(error_buf, DATE_ERROR_HELP); break; case INVALID_START: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 358, "Invalid value in START field.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 358, "Invalid value in START field.\nOperation was cancelled. Calendar")); sprintf(error_buf, START_ERROR_HELP); break; case INVALID_TIME_DUE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 1011, "Invalid value in the \"Time Due\" field.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 1011, "Invalid value in the \"Time Due\" field.\nOperation was cancelled. Calendar")); sprintf(error_buf, START_ERROR_HELP); break; case INVALID_STOP: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 359, "Invalid value in END field.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 359, "Invalid value in END field.\nOperation was cancelled. Calendar")); sprintf(error_buf, STOP_ERROR_HELP); break; case MISSING_DATE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 360, "You must provide a DATE value.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 360, "You must provide a DATE value.\nOperation was cancelled. Calendar")); sprintf(error_buf, MISSING_FIELD_ERROR_HELP); break; case MISSING_START: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 361, "You must provide a START value.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 361, "You must provide a START value.\nOperation was cancelled. Calendar")); sprintf(error_buf, MISSING_FIELD_ERROR_HELP); break; case MISSING_WHAT: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 362, "You must provide a WHAT value.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 362, "You must provide a WHAT value.\nOperation was cancelled. Calendar")); sprintf(error_buf, MISSING_FIELD_ERROR_HELP); break; case REPEAT_FOR_MISMATCH: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 363, "Invalid or mismatched REPEAT and FOR values.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 363, "Invalid or mismatched REPEAT and FOR values.\nOperation was cancelled. Calendar")); sprintf(error_buf, REPEAT_FOR_ERROR_HELP); break; case INVALID_NOTIME_APPT: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 724, "No Time appointments must have a WHAT value specified.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 724, "No Time appointments must have a WHAT value specified.\nOperation was cancelled. Calendar")); sprintf(error_buf, NO_TIME_ERROR_HELP); break; case INVALID_TIME: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 1104, "Invalid value in TIME DUE field.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 1104, "Invalid value in TIME DUE field.\nOperation was cancelled. Calendar")); sprintf(error_buf, START_ERROR_HELP); break; case MISSING_TIME: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 1105, "You must provide a TIME DUE value.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 1105, "You must provide a TIME DUE value.\nOperation was cancelled. Calendar")); sprintf(error_buf, MISSING_FIELD_ERROR_HELP); break; case VALID_APPT: @@ -949,9 +949,9 @@ editor_err_msg(Widget frame, char *name, Validate_op op, Pixmap p) { sprintf(buf2, "%s %s", buf, name); if (help_button) { - char *title = XtNewString(catgets(c->DT_catd, 1, 914, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 914, "Calendar : Error - Editor")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(frame, DIALOG_TITLE, title, DIALOG_TEXT, buf2, @@ -963,9 +963,9 @@ editor_err_msg(Widget frame, char *name, Validate_op op, Pixmap p) { XtFree(title); } else { - char *title = XtNewString(catgets(c->DT_catd, 1, 914, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 914, "Calendar : Error - Editor")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(frame, DIALOG_TITLE, title, DIALOG_TEXT, buf2, @@ -994,83 +994,83 @@ backend_err_msg( switch(stat) { case CSA_E_CALENDAR_EXISTS: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 367, "Calendar already exists.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 367, "Calendar already exists.\nOperation was cancelled. Calendar")); help_button = False; break; case CSA_E_CALENDAR_NOT_EXIST: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 368, "Calendar does not exist.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 368, "Calendar does not exist.\nOperation was cancelled. Calendar")); help_button = False; break; case CSA_X_DT_E_ENTRY_NOT_FOUND: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 725, "Calendar Entry does not exist.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 725, "Calendar Entry does not exist.\nOperation was cancelled. Calendar")); break; case CSA_E_INVALID_ENTRY_HANDLE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 881, "Internal Error #1: Invalid calendar/entry handle.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 881, "Internal Error #1: Invalid calendar/entry handle.\nOperation was cancelled. Calendar")); break; case CSA_E_INVALID_SESSION_HANDLE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 882, "Internal Error #2: Invalid session handle.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 882, "Internal Error #2: Invalid session handle.\nOperation was cancelled. Calendar")); break; case CSA_E_NO_AUTHORITY: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 370, "Authorization error. Permission denied.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 370, "Authorization error. Permission denied.\nOperation was cancelled. Calendar")); help_button = False; break; case CSA_E_INVALID_PARAMETER: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 883, "Internal Error #3: Invalid data value.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 883, "Internal Error #3: Invalid data value.\nOperation was cancelled. Calendar")); break; case CSA_E_READONLY: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 884, "Internal Error #4: Value specified for a read-only attribute.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 884, "Internal Error #4: Value specified for a read-only attribute.\nOperation was cancelled. Calendar")); break; case CSA_E_INVALID_ATTRIBUTE_VALUE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 885, "Internal Error #5: Incorrect data type specified for an attribute value.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 885, "Internal Error #5: Incorrect data type specified for an attribute value.\nOperation was cancelled. Calendar")); break; case CSA_E_UNSUPPORTED_ATTRIBUTE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 886, "Internal Error #6: Specified attribute is not supported on this calendar version.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 886, "Internal Error #6: Specified attribute is not supported on this calendar version.\nOperation was cancelled. Calendar")); break; case CSA_E_NOT_SUPPORTED: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 887, "Internal Error #7: Specified function is not supported on this calendar version.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 887, "Internal Error #7: Specified function is not supported on this calendar version.\nOperation was cancelled. Calendar")); break; case CSA_E_INVALID_ENUM: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 888, "Internal Error #8: Invalid operator specified.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 888, "Internal Error #8: Invalid operator specified.\nOperation was cancelled. Calendar")); break; case CSA_E_INSUFFICIENT_MEMORY: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 378, "Memory allocation error - not enough memory.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 378, "Memory allocation error - not enough memory.\nOperation was cancelled. Calendar")); sprintf(error_buf, MEMORY_ALLOC_ERROR_HELP); break; case CSA_E_DISK_FULL: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 907, "No space left for calendar file.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 907, "No space left for calendar file.\nOperation was cancelled. Calendar")); break; case CSA_E_SERVICE_UNAVAILABLE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 921, "Couldn't access calendar: ")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 921, "Couldn't access calendar: ")); break; case CSA_X_DT_E_INVALID_SERVER_LOCATION: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 641, "Server failed to get network address\nfor the specified location: invalid hostname.")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 641, "Server failed to get network address\nfor the specified location: invalid hostname.")); break; case CSA_X_DT_E_SERVICE_NOT_REGISTERED: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 642, "rpc.cmsd daemon is not registered.\nPlease verify rpc.cmsd is installed correctly on your system.")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 642, "rpc.cmsd daemon is not registered.\nPlease verify rpc.cmsd is installed correctly on your system.")); sprintf(error_buf, CMSD_ERROR_HELP); break; case CSA_X_DT_E_SERVER_TIMEOUT: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 727, "Your request timed out\nPlease verify rpc.cmsd is installed correctly on your system.")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 727, "Your request timed out\nPlease verify rpc.cmsd is installed correctly on your system.")); sprintf(error_buf, CMSD_ERROR_HELP); break; case CSA_E_FAILURE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 643, "Couldn't access calendar. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 643, "Couldn't access calendar. Calendar")); break; case CSA_E_INVALID_RULE: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 1120, "The event cannot be scheduled in the given time frame.\nThe operation was cancelled.")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 1120, "The event cannot be scheduled in the given time frame.\nThe operation was cancelled.")); break; case CSA_SUCCESS: return; default: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 383, "Unknown error.\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 383, "Unknown error.\nOperation was cancelled. Calendar")); break; } sprintf(buf2, "%s %s", buf, name); if (help_button) { - char *title = XtNewString(catgets(c->DT_catd, 1, 890, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 890, "Calendar : Error - Services")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(frame, DIALOG_TITLE, title, DIALOG_TEXT, buf2, @@ -1082,9 +1082,9 @@ backend_err_msg( XtFree(title); } else { - char *title = XtNewString(catgets(c->DT_catd, 1, 890, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 890, "Calendar : Error - Services")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(frame, DIALOG_TITLE, title, DIALOG_TEXT, buf2, @@ -1112,11 +1112,11 @@ query_user(void *user_data) { char *ident2; static int answer; - sprintf(buf, "%s", catgets(c->DT_catd, 1, 386, + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 386, "That appointment has an end time earlier than its begin time.\nDo you want to schedule it into the next day?")); - title = XtNewString(catgets(c->DT_catd, 1, 248, "Calendar : Schedule Appointment")); - ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - ident2 = XtNewString(catgets(c->DT_catd, 1, 389, "Next Day")); + title = XtNewString(CATGETS(c->DT_catd, 1, 248, "Calendar : Schedule Appointment")); + ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + ident2 = XtNewString(CATGETS(c->DT_catd, 1, 389, "Next Day")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, buf, diff --git a/cde/programs/dtcm/dtcm/print.c b/cde/programs/dtcm/dtcm/print.c index fba8c2a67..15a92fc68 100644 --- a/cde/programs/dtcm/dtcm/print.c +++ b/cde/programs/dtcm/dtcm/print.c @@ -934,7 +934,7 @@ create_print_dialog(Calendar *c) print_dir = ""; sprintf(fnamebuf, "%s/%s", print_dir, print_file); - title = XtNewString(catgets(c->DT_catd, 1, 728, "Calendar : Print")); + title = XtNewString(CATGETS(c->DT_catd, 1, 728, "Calendar : Print")); nargs = 0; XtSetArg(args[nargs], XmNtitle, title); nargs++; XtSetArg(args[nargs], XmNdeleteResponse, XmUNMAP); nargs++; @@ -968,19 +968,19 @@ create_print_dialog(Calendar *c) pd->form = XmCreateForm(pd->pdb, "RangeForm", args, nargs); view = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 976, "Report Type:")); + CATGETS(c->DT_catd, 1, 976, "Report Type:")); day_view = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 977, "Day View")); + CATGETS(c->DT_catd, 1, 977, "Day View")); week_view = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 978, "Week View")); + CATGETS(c->DT_catd, 1, 978, "Week View")); month_view = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 979, "Month View")); + CATGETS(c->DT_catd, 1, 979, "Month View")); year_view = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 980, "Year View")); + CATGETS(c->DT_catd, 1, 980, "Year View")); appt_list = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 981, "Appointment List")); + CATGETS(c->DT_catd, 1, 981, "Appointment List")); todo_list = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 982, "To Do List")); + CATGETS(c->DT_catd, 1, 982, "To Do List")); /* * remember - this returns a RowColumn widget! @@ -1014,7 +1014,7 @@ create_print_dialog(Calendar *c) XmStringFree(todo_list); XmStringFree(view); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 731, "From:")); pd->from_label = XtVaCreateWidget("FromLabel", xmLabelGadgetClass, @@ -1095,7 +1095,7 @@ create_print_dialog(Calendar *c) XtManageChild(pd->from_year); XtManageChild(pd->from_spin); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 732, "To:")); pd->to_label = XtVaCreateWidget("ToLabel", xmLabelGadgetClass, @@ -1171,7 +1171,7 @@ create_print_dialog(Calendar *c) XtManageChild(pd->to_year); XtManageChild(pd->to_spin); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 679, "More...")); nargs = 0; XtSetArg(args[nargs], XmNlabelString, xmstr); nargs++; @@ -1241,7 +1241,7 @@ report_error(Calendar *c, char *title, char *errText) Props_pu *pu = (Props_pu *)c->properties_pu; char *label; - label = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + label = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(c->frame, DIALOG_TITLE, title, @@ -1268,7 +1268,7 @@ pdm_notify_cb(Widget w, XtPointer uData, XtPointer cbData) case XmCR_PDM_NONE: case XmCR_PDM_START_ERROR: case XmCR_PDM_EXIT_ERROR: - errText = XtNewString(catgets(c->DT_catd, 1, 1112, pdmErrorText)); + errText = XtNewString(CATGETS(c->DT_catd, 1, 1112, pdmErrorText)); break; default: @@ -1277,7 +1277,7 @@ pdm_notify_cb(Widget w, XtPointer uData, XtPointer cbData) if (errText) { - title = XtNewString(catgets(c->DT_catd, 1, 1111, setupErrorTitle)); + title = XtNewString(CATGETS(c->DT_catd, 1, 1111, setupErrorTitle)); report_error(c, title, errText); @@ -1354,9 +1354,9 @@ print_setup_cb(Widget w, XtPointer uData, XtPointer cbData) if (XmPrintPopupPDM(pd->printShell, w) != XmPDM_NOTIFY_SUCCESS) { - char *errText = XtNewString(catgets(c->DT_catd, 1, 1112, + char *errText = XtNewString(CATGETS(c->DT_catd, 1, 1112, pdmErrorText)); - char *title = XtNewString(catgets(c->DT_catd, 1, 1111, setupErrorTitle)); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1111, setupErrorTitle)); report_error(c, title, errText); @@ -1387,28 +1387,28 @@ print_report(Calendar *c) if ((start_date == DATE_BBOT) || (end_date == DATE_BBOT) || (start_date == DATE_AEOT) || (end_date == DATE_BBOT)) { - text = XtNewString(catgets(c->DT_catd, 1, 892, + text = XtNewString(CATGETS(c->DT_catd, 1, 892, "The dates for printing must be between 1969 and 2038.")); } else if (start_date <= 0) { - text = XtNewString(catgets(c->DT_catd, 1, 894, + text = XtNewString(CATGETS(c->DT_catd, 1, 894, "Malformed \"From\" date")); } else if (end_date <= 0) { - text = XtNewString(catgets(c->DT_catd, 1, 896, + text = XtNewString(CATGETS(c->DT_catd, 1, 896, "Malformed \"To\" date")); } else if (start_date > end_date) { - text = XtNewString(catgets(c->DT_catd, 1, 898, + text = XtNewString(CATGETS(c->DT_catd, 1, 898, "The \"To\" date for printing must be after the \"From\" date for printing")); } if (text) { - char *title = XtNewString(catgets(c->DT_catd, 1, 736, printErrorTitle)); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 736, printErrorTitle)); report_error(c, title, text); diff --git a/cde/programs/dtcm/dtcm/props.c b/cde/programs/dtcm/dtcm/props.c index c4ca59134..30370cdad 100644 --- a/cde/programs/dtcm/dtcm/props.c +++ b/cde/programs/dtcm/dtcm/props.c @@ -117,7 +117,7 @@ p_create_v5_group_access_pane( * side. */ xstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 410, "User Name:")); + CATGETS(c->DT_catd, 1, 410, "User Name:")); p->gap2_user_label = XtVaCreateWidget("gap2_label_user_name", xmLabelGadgetClass, @@ -129,7 +129,7 @@ p_create_v5_group_access_pane( XmStringFree(xstr); xstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 738, "Access List:")); + CATGETS(c->DT_catd, 1, 738, "Access List:")); p->gap2_access_label = XtVaCreateWidget("gap2_label_access", xmLabelGadgetClass, @@ -141,7 +141,7 @@ p_create_v5_group_access_pane( XmStringFree(xstr); xstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 739, "Access Rights:")); + CATGETS(c->DT_catd, 1, 739, "Access Rights:")); p->gap2_permissions_label = XtVaCreateWidget("gap2_label_permissions", xmLabelGadgetClass, @@ -189,7 +189,7 @@ p_create_v5_group_access_pane( XmNrightOffset, GAP, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 740, "Add")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 740, "Add")); p->gap2_add_button = XtVaCreateWidget("gap2_button_add", xmPushButtonWidgetClass, @@ -206,7 +206,7 @@ p_create_v5_group_access_pane( XmStringFree(xstr); XtAddCallback(p->gap2_add_button, XmNactivateCallback, GAPAddProc, p); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 419, "Delete")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 419, "Delete")); p->gap2_delete_button = XtVaCreateWidget("gap2_button_delete", xmPushButtonWidgetClass, @@ -226,7 +226,7 @@ p_create_v5_group_access_pane( XtAddCallback(p->gap2_delete_button, XmNactivateCallback, p_gap_remove_proc, p); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 343, "Change")); p->gap2_change_button = XtVaCreateWidget("gap2_button_change", xmPushButtonWidgetClass, @@ -368,7 +368,7 @@ CreatePermissions( XmNshadowType, XmSHADOW_IN, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 743, "Public:")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 743, "Public:")); p->gap2_public_label = XtVaCreateWidget("gap2_public_label", xmLabelGadgetClass, @@ -379,7 +379,7 @@ CreatePermissions( XmStringFree (xstr); xstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 744, "Semiprivate:")); + CATGETS(c->DT_catd, 1, 744, "Semiprivate:")); p->gap2_semi_label = XtVaCreateWidget("gap2_semi_label", xmLabelGadgetClass, @@ -391,7 +391,7 @@ CreatePermissions( XmStringFree (xstr); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 745, "Private:")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 745, "Private:")); p->gap2_private_label = XtVaCreateWidget("gap2_private_label", xmLabelGadgetClass, @@ -409,7 +409,7 @@ CreatePermissions( /* Create the labels and toggles for the permissions */ - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 40, "View")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 40, "View")); p->gap2_view_label = XtVaCreateWidget("gap2_view_label", xmLabelGadgetClass, @@ -439,7 +439,7 @@ CreatePermissions( #endif /* __ppc */ if (label_offset < 0) label_offset = 0; - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 342, "Insert")); p->gap2_insert_label = XtVaCreateWidget("gap2_insert_label", @@ -459,7 +459,7 @@ CreatePermissions( XmNwidth, &insert_label_width, NULL); - xstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change")); + xstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 343, "Change")); /* * If label is greater than the allocated space for the @@ -685,11 +685,11 @@ GAPAddProc( /* Get the user's name and host */ if (!(user_name = (char *)XmTextGetString(p->gap2_user_text)) || !*user_name) { - char *title = XtNewString(catgets(c->DT_catd, 1, 750, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 750, "Calendar : Error - Access List and Permissions")); - char *text = XtNewString(catgets(c->DT_catd, 1, 749, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 749, "Name and Access Rights must be set to add an item to the Access List.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); XtFree(user_name); @@ -774,13 +774,13 @@ ChangeExistingGAPEntry( Calendar *c = calendar; int answer; - char *title = XtNewString(catgets(c->DT_catd, 1, 1078, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1078, "Calendar : Access List and Permissions - Add")); - char *text = XtNewString(catgets(c->DT_catd, 1, 751, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 751, "This entry already exists in the Access List. Do you wish to change it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 343, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 343, "Change")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 923, + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); answer = dialog_popup(p->frame, @@ -819,11 +819,11 @@ GAPChangeProc( /* An item to change must be selected in the access list */ if (!XmListGetSelectedPos(p->gap2_access_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 750, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 750, "Calendar : Error - Access List and Permissions")); - char *text = XtNewString(catgets(c->DT_catd, 1, 408, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 408, "Please select a name first. ")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(p->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -845,11 +845,11 @@ GAPChangeProc( /* Get the user's name and host */ if (!(user_name = (char *)XmTextGetString(p->gap2_user_text)) || !*user_name) { - char *title = XtNewString(catgets(c->DT_catd, 1, 750, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 750, "Calendar : Error - Access List and Permissions")); - char *text = XtNewString(catgets(c->DT_catd, 1, 756, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 756, "Name and Access rights must be set to change an item in the Access List")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); XtFree(user_name); dialog_popup(p->frame, diff --git a/cde/programs/dtcm/dtcm/props_pu.c b/cde/programs/dtcm/dtcm/props_pu.c index 6315fb23d..99da5130f 100644 --- a/cde/programs/dtcm/dtcm/props_pu.c +++ b/cde/programs/dtcm/dtcm/props_pu.c @@ -227,7 +227,7 @@ p_create_editor_pane( ** Default start time and duration for appointments - use DSSW widget ** for start time stuff. */ - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 644, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 644, "Appointment Times:")); pu->ep_appt_label = XtVaCreateWidget("apptTimes", xmLabelGadgetClass, ep_form_mgr, @@ -250,7 +250,7 @@ p_create_editor_pane( widgets[2] = pu->ep_dssw.start_menu; widgets[3] = pu->ep_dssw.start_ampm_rc_mgr; - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 645, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 645, "Duration:")); pu->ep_dur_label = widgets[4] = XtVaCreateWidget("duration", xmLabelGadgetClass, pu->ep_dssw.dssw_form_mgr, @@ -281,7 +281,7 @@ p_create_editor_pane( XtAddCallback(text_field, XmNvalueChangedCallback, p_mark_change, pu); XtAddCallback(pu->ep_dur_cb, XmNselectionCallback, p_mark_change, pu); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 646, "Minutes")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 646, "Minutes")); pu->ep_dur_message = widgets[6] = XtVaCreateWidget("message", xmLabelGadgetClass, pu->ep_dssw.dssw_form_mgr, XmNlabelString, xmstr, @@ -386,7 +386,7 @@ p_create_editor_pane( ** Build the stuff for privacy ... */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 390, "Privacy:")); + CATGETS(c->DT_catd, 1, 390, "Privacy:")); pu->privacy_label = XtVaCreateWidget("privacy", xmLabelGadgetClass, pu->ep_reminders.bfpm_form_mgr, XmNlabelString, xmstr, @@ -459,13 +459,13 @@ format_hour(char buffer[], int hour, DisplayType dt, Calendar *c) { if (dt == HOUR12) { if ((hour == 24) || (hour == 0)) - cm_strcpy(buffer, catgets(c->DT_catd, 1, 758,"midnight")); + cm_strcpy(buffer, CATGETS(c->DT_catd, 1, 758,"midnight")); else if (hour > 12) sprintf(buffer, "%2d:00 %s", hour-12, - catgets(c->DT_catd, 1, 3, "pm")); + CATGETS(c->DT_catd, 1, 3, "pm")); else sprintf(buffer, "%2d:00 %s", hour, - catgets(c->DT_catd, 1, 4, "am")); + CATGETS(c->DT_catd, 1, 4, "am")); } else sprintf(buffer, " %02d00", hour); @@ -565,7 +565,7 @@ p_create_display_pane(Props_pu *p) { ** User Calendar Location label and text field */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 391, "User Calendar Location:")); + CATGETS(c->DT_catd, 1, 391, "User Calendar Location:")); p->dp_loc_label = XtVaCreateWidget("location", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -595,14 +595,14 @@ p_create_display_pane(Props_pu *p) { items is mapped. Pretty stupid. Thus the positioning happens just after the panel is mapped. */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 392, "Day Boundaries:")); + CATGETS(c->DT_catd, 1, 392, "Day Boundaries:")); p->dp_day_label = XtVaCreateWidget("dayBoundaries", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, NULL); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 393, "Begin:")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 393, "Begin:")); p->dp_beg_label = XtVaCreateWidget("begin", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -622,14 +622,14 @@ p_create_display_pane(Props_pu *p) { XtAddCallback(p->dp_beg_scale, XmNdragCallback, p_dp_scale_mod_proc, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 759, "value")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 759, "value")); p->dp_beg_value = XtVaCreateWidget("begin", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, NULL); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 394, "End:")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 394, "End:")); p->dp_end_label = XtVaCreateWidget("end", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -649,7 +649,7 @@ p_create_display_pane(Props_pu *p) { XtAddCallback(p->dp_end_scale, XmNdragCallback, p_dp_scale_mod_proc, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 760, "value")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 760, "value")); p->dp_end_value = XtVaCreateWidget("begin", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -660,7 +660,7 @@ p_create_display_pane(Props_pu *p) { ** 12/24 Hour Display label and toggle buttons */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 395, "Hour Display:")); + CATGETS(c->DT_catd, 1, 395, "Hour Display:")); p->dp_hour_label = XtVaCreateWidget("hourDisplay", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -676,7 +676,7 @@ p_create_display_pane(Props_pu *p) { XmNentryClass, xmToggleButtonGadgetClass, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 396, "12 Hour")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 396, "12 Hour")); p->dp_hour12_toggle = widgets[0] = XtVaCreateWidget("twelveHour", xmToggleButtonGadgetClass, p->dp_hour_rc_mgr, XmNlabelString, xmstr, @@ -686,7 +686,7 @@ p_create_display_pane(Props_pu *p) { XtAddCallback(p->dp_hour12_toggle, XmNvalueChangedCallback, p_mark_change, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 397, "24 Hour")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 397, "24 Hour")); p->dp_hour24_toggle = widgets[1] = XtVaCreateWidget("twentyFourHour", xmToggleButtonGadgetClass, p->dp_hour_rc_mgr, XmNlabelString, xmstr, @@ -702,7 +702,7 @@ p_create_display_pane(Props_pu *p) { ** Default view label and toggle buttons */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 398, "Default View:")); + CATGETS(c->DT_catd, 1, 398, "Default View:")); p->dp_view_label = XtVaCreateWidget("defaultView:", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -719,7 +719,7 @@ p_create_display_pane(Props_pu *p) { NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 402, "Day")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 402, "Day")); p->dp_view_day_toggle = XtVaCreateWidget("day", xmToggleButtonGadgetClass, p->dp_view_rc_mgr, XmNlabelString, xmstr, @@ -729,7 +729,7 @@ p_create_display_pane(Props_pu *p) { XtAddCallback(p->dp_view_day_toggle, XmNvalueChangedCallback, p_mark_change, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 401, "Week")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 401, "Week")); p->dp_view_week_toggle = XtVaCreateWidget("week", xmToggleButtonGadgetClass, p->dp_view_rc_mgr, XmNlabelString, xmstr, @@ -739,7 +739,7 @@ p_create_display_pane(Props_pu *p) { XtAddCallback(p->dp_view_week_toggle, XmNvalueChangedCallback, p_mark_change, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 400, "Month")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 400, "Month")); p->dp_view_month_toggle = XtVaCreateWidget("month", xmToggleButtonGadgetClass, p->dp_view_rc_mgr, XmNlabelString, xmstr, @@ -749,7 +749,7 @@ p_create_display_pane(Props_pu *p) { XtAddCallback(p->dp_view_month_toggle, XmNvalueChangedCallback, p_mark_change, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 399, "Year")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 399, "Year")); p->dp_view_year_toggle = XtVaCreateWidget("year", xmToggleButtonGadgetClass, p->dp_view_rc_mgr, XmNlabelString, xmstr, @@ -765,7 +765,7 @@ p_create_display_pane(Props_pu *p) { ** Initial Calendar View label and text field */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 403, "Initial Calendar View:")); + CATGETS(c->DT_catd, 1, 403, "Initial Calendar View:")); p->dp_init_view_label = XtVaCreateWidget("initialView", xmLabelGadgetClass, dp_form_mgr, XmNlabelString, xmstr, @@ -1001,11 +1001,11 @@ p_gap_convert_permissions( } if (perm_val == 0) { - char *title = XtNewString(catgets(c->DT_catd, 1, 750, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 750, "Calendar : Error - Access List and Permissions")); - char *text = XtNewString(catgets(c->DT_catd, 1, 405, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 405, "Please select at least one permission. ")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(p->frame, DIALOG_TITLE, title, @@ -1159,9 +1159,9 @@ p_gap_remove_proc(Widget w, XtPointer client_data, XtPointer callback_struct) { XtFree((XtPointer)item_list); } else { - char *title = XtNewString(catgets(c->DT_catd, 1, 750, "Calendar : Error - Access List and Permissions")); - char *text = XtNewString(catgets(c->DT_catd, 1, 408, "Please select a name first. ")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 750, "Calendar : Error - Access List and Permissions")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 408, "Please select a name first. ")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(p->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1279,7 +1279,7 @@ p_create_v4_group_access_pane(Props_pu *p) { ** User Name label, text field, and add button */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 410, "User Name:")); + CATGETS(c->DT_catd, 1, 410, "User Name:")); p->gap_user_label = XtVaCreateWidget("userName", xmLabelGadgetClass, gap_form_mgr, XmNlabelString, xmstr, @@ -1295,7 +1295,7 @@ p_create_v4_group_access_pane(Props_pu *p) { (XtPointer)p); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 411, "Add Name")); + CATGETS(c->DT_catd, 1, 411, "Add Name")); p->gap_add_button = XtVaCreateWidget("addName", xmPushButtonGadgetClass, gap_form_mgr, XmNlabelString, xmstr, @@ -1310,8 +1310,8 @@ p_create_v4_group_access_pane(Props_pu *p) { ** Access list stuff and remove button */ { - char *user = XtNewString(catgets(c->DT_catd, 1, 983, "User Name")); - char *perm = XtNewString(catgets(c->DT_catd, 1, 413, "Permissions")); + char *user = XtNewString(CATGETS(c->DT_catd, 1, 983, "User Name")); + char *perm = XtNewString(CATGETS(c->DT_catd, 1, 413, "Permissions")); buf = (char *)ckalloc(cm_strlen(user) + cm_strlen(perm) + 10); sprintf(buf, "%-*s%s", NAME_LEN, user, perm); xmstr = XmStringCreateLocalized(buf); @@ -1341,7 +1341,7 @@ p_create_v4_group_access_pane(Props_pu *p) { XtManageChild(p->gap_access_list); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 414, "Remove Name")); + CATGETS(c->DT_catd, 1, 414, "Remove Name")); p->gap_remove_button = XtVaCreateWidget("removeName", xmPushButtonGadgetClass, gap_form_mgr, XmNlabelString, xmstr, @@ -1353,7 +1353,7 @@ p_create_v4_group_access_pane(Props_pu *p) { XmNactivateCallback, p_gap_remove_proc, p); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 415, "B = Browse I = Insert D = Delete")); + CATGETS(c->DT_catd, 1, 415, "B = Browse I = Insert D = Delete")); p->gap_access_msg = XtVaCreateWidget("browseInsertDelete", xmLabelGadgetClass, gap_form_mgr, XmNlabelString, xmstr, @@ -1364,7 +1364,7 @@ p_create_v4_group_access_pane(Props_pu *p) { ** Finally, permissions label and choice toggle list */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 416, "Permissions:")); + CATGETS(c->DT_catd, 1, 416, "Permissions:")); p->gap_perm_label = XtVaCreateWidget("permissions", xmLabelGadgetClass, gap_form_mgr, XmNlabelString, xmstr, @@ -1381,21 +1381,21 @@ p_create_v4_group_access_pane(Props_pu *p) { XmNentryClass, xmToggleButtonGadgetClass, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 417, "Browse")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 417, "Browse")); p->gap_browse_toggle = XtVaCreateWidget("browse", xmToggleButtonGadgetClass, p->gap_perm_rc_mgr, XmNlabelString, xmstr, NULL); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 342, "Insert")); p->gap_insert_toggle = XtVaCreateWidget("insert", xmToggleButtonGadgetClass, p->gap_perm_rc_mgr, XmNlabelString, xmstr, NULL); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 419, "Delete")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 419, "Delete")); p->gap_delete_toggle = XtVaCreateWidget("delete", xmToggleButtonGadgetClass, p->gap_perm_rc_mgr, XmNlabelString, xmstr, @@ -1578,7 +1578,7 @@ p_create_printer_ops_pane( p_mark_change, (XtPointer)p); for (i = 0; i < POP_HDR_NUM_CHOICES; i++) - hdrStrings[i] = XtNewString(catgets(c->DT_catd, 1, 1106 + i, + hdrStrings[i] = XtNewString(CATGETS(c->DT_catd, 1, 1106 + i, hdrDefaults[i])); p->pop_header_frame = @@ -1617,7 +1617,7 @@ p_create_printer_ops_pane( DTPRINT_OPTION_FOOTER_RIGHT); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 434, "Include:")); + CATGETS(c->DT_catd, 1, 434, "Include:")); p->pop_privacy_label = XtVaCreateWidget("include", xmLabelGadgetClass, pop_form_mgr, XmNlabelString, xmstr, @@ -1651,7 +1651,7 @@ p_create_printer_ops_pane( XmNleftWidget, p->pop_privacy_label, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 435, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 435, "Show Time and Text Appts")); p->pop_privacy_public_toggle = XtVaCreateWidget( "showTimeText", @@ -1663,7 +1663,7 @@ p_create_printer_ops_pane( XtAddCallback(p->pop_privacy_public_toggle, XmNvalueChangedCallback, p_mark_change, p); - xmstr = XmStringCreateLocalized( catgets(c->DT_catd, 1, 436, + xmstr = XmStringCreateLocalized( CATGETS(c->DT_catd, 1, 436, "Show Time Only Appts")); p->pop_privacy_semi_toggle = XtVaCreateWidget( "showTimeOnly", @@ -1675,7 +1675,7 @@ p_create_printer_ops_pane( XtAddCallback(p->pop_privacy_semi_toggle, XmNvalueChangedCallback, p_mark_change, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 437, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 437, "Show Nothing Appts")); p->pop_privacy_private_toggle = XtVaCreateWidget( "showNothing", @@ -1723,7 +1723,7 @@ p_create_date_format_pane( ** Date ordering label and choice toggle widget */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 438, "Date Ordering:")); + CATGETS(c->DT_catd, 1, 438, "Date Ordering:")); p->dfp_order_label = XtVaCreateWidget("dateOrdering", xmLabelGadgetClass, dfp_form_mgr, XmNlabelString, xmstr, @@ -1731,7 +1731,7 @@ p_create_date_format_pane( XmStringFree(xmstr); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 442, "Date Separator:")); + CATGETS(c->DT_catd, 1, 442, "Date Separator:")); p->dfp_sep_label = XtVaCreateWidget("dateSeparator", xmLabelGadgetClass, dfp_form_mgr, XmNlabelString, xmstr, @@ -1756,7 +1756,7 @@ p_create_date_format_pane( NULL); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 439, "MM | DD | YY")); + CATGETS(c->DT_catd, 1, 439, "MM | DD | YY")); p->dfp_order_mmddyy_toggle = XtVaCreateWidget("mmddyy", xmToggleButtonGadgetClass, p->dfp_order_rc_mgr, XmNlabelString, xmstr, @@ -1767,7 +1767,7 @@ p_create_date_format_pane( XmNvalueChangedCallback, p_mark_change, p); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 440, "DD | MM | YY")); + CATGETS(c->DT_catd, 1, 440, "DD | MM | YY")); p->dfp_order_ddmmyy_toggle = XtVaCreateWidget("ddmmyy", xmToggleButtonGadgetClass, p->dfp_order_rc_mgr, XmNlabelString, xmstr, @@ -1778,7 +1778,7 @@ p_create_date_format_pane( XmNvalueChangedCallback, p_mark_change, p); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 441, "YY | MM | DD")); + CATGETS(c->DT_catd, 1, 441, "YY | MM | DD")); p->dfp_order_yymmdd_toggle = XtVaCreateWidget("yymmdd", xmToggleButtonGadgetClass, p->dfp_order_rc_mgr, XmNlabelString, xmstr, @@ -1807,7 +1807,7 @@ p_create_date_format_pane( XmNtopOffset, GAP, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 443, "Blank")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 443, "Blank")); p->dfp_sep_blank_toggle = XtVaCreateWidget("blank", xmToggleButtonGadgetClass, p->dfp_sep_rc_mgr, XmNlabelString, xmstr, @@ -2067,9 +2067,9 @@ p_save_changes(Calendar *c) { } if (!save_props(p)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 454, "Calendar : Error - Options")); - char *text = XtNewString(catgets(c->DT_catd, 1, 445, "An error occurred writing to ~/.desksetdefaults.\nMake sure you have permission to write to this file.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 454, "Calendar : Error - Options")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 445, "An error occurred writing to ~/.desksetdefaults.\nMake sure you have permission to write to this file.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(pu->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -2238,9 +2238,9 @@ extern void p_defaults_proc_helper(XtPointer client_data){ Props_pu *pu = (Props_pu *)c->properties_pu; if (!read_props(p)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 454, "Calendar : Error - Options")); - char *text = XtNewString(catgets(c->DT_catd, 1, 448, "An error occurred reading from ~/.desksetdefaults.\nMake sure you have permission to read this file.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 454, "Calendar : Error - Options")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 448, "An error occurred reading from ~/.desksetdefaults.\nMake sure you have permission to read this file.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(pu->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -2283,11 +2283,11 @@ p_flush_changes(Calendar *c) { int val; if (pu->changed_flag == True) { - char *title = XtNewString(catgets(c->DT_catd, 1, 450, "Calendar : Options - Help")); - char *text = XtNewString(catgets(c->DT_catd, 1, 451, "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 452, "Save")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 700, "Discard")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 450, "Calendar : Options - Help")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 451, "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 452, "Save")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 700, "Discard")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); answer = dialog_popup(pu->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -2331,7 +2331,7 @@ static void p_make_props_pu(Calendar *c) { char *buf; char *popuplabel = - catgets(c->DT_catd, 1, 458, "Calendar : Options"); + CATGETS(c->DT_catd, 1, 458, "Calendar : Options"); PaneType pt; Props_pu *p = (Props_pu *)c->properties_pu; XmString label; @@ -2385,23 +2385,23 @@ p_make_props_pu(Calendar *c) { */ Pane_XmStrs[EDITOR_PANE] = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 762, + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 762, "Editor Defaults")); Pane_XmStrs[DISPLAY_PANE] = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 763, + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 763, "Display Settings")); Pane_XmStrs[GROUP_ACCESS_PANE] = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 764, + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 764, "Access List and Permissions")); Pane_XmStrs[PRINTER_OPS_PANE] = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 765, + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 765, "Printer Settings")); Pane_XmStrs[DATE_FORMAT_PANE] = - XmStringCreateLocalized(catgets(c->DT_catd, 1, 766, + XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 766, "Date Format")); label = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 459, "Category:")); + CATGETS(c->DT_catd, 1, 459, "Category:")); p->category_menu = widgets[0] = XmVaCreateSimpleOptionMenu(p->base_form_mgr, @@ -2448,7 +2448,7 @@ p_make_props_pu(Calendar *c) { XmNbottomWidget, p->separator2, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 655, "OK")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 655, "OK")); p->ok_button = widgets[3] = XtVaCreateWidget("ok", xmPushButtonGadgetClass, p->base_form_mgr, XmNlabelString, xmstr, @@ -2470,7 +2470,7 @@ p_make_props_pu(Calendar *c) { XmNbottomWidget, p->ok_button, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 460, "Apply")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 460, "Apply")); p->apply_button = widgets[4] = XtVaCreateWidget("apply", xmPushButtonGadgetClass, p->base_form_mgr, XmNlabelString, xmstr, @@ -2487,7 +2487,7 @@ p_make_props_pu(Calendar *c) { XmStringFree(xmstr); XtAddCallback(p->apply_button, XmNactivateCallback, p_apply_proc, c); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 691, "Reset")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 691, "Reset")); p->defaults_button = widgets[5] = XtVaCreateWidget("reset", xmPushButtonGadgetClass, p->base_form_mgr, XmNlabelString, xmstr, @@ -2504,7 +2504,7 @@ p_make_props_pu(Calendar *c) { XtAddCallback(p->defaults_button, XmNactivateCallback, p_defaults_proc, c); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); p->close_button = widgets[6] = XtVaCreateWidget("close", xmPushButtonGadgetClass, p->base_form_mgr, XmNlabelString, xmstr, @@ -2520,7 +2520,7 @@ p_make_props_pu(Calendar *c) { XmStringFree(xmstr); XtAddCallback(p->close_button, XmNactivateCallback, p_close_proc, p); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); p->help_button = widgets[7] = XtVaCreateWidget("help", xmPushButtonGadgetClass, p->base_form_mgr, XmNlabelString, xmstr, @@ -2649,9 +2649,9 @@ get_editor_vals_from_ui(Props_pu *pu, Props *p) { dur_txt = XmTextGetString(text); if (string_is_number(dur_txt) == False) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); - char *text = XtNewString(catgets(c->DT_catd, 1, 819, "The Duration value must be an integer with no sign.\nYour properties settings have not been saved.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 819, "The Duration value must be an integer with no sign.\nYour properties settings have not been saved.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); XtFree(dur_txt); dialog_popup(pu->frame, @@ -2668,9 +2668,9 @@ get_editor_vals_from_ui(Props_pu *pu, Props *p) { } if (atoi(dur_txt) >= (60 *24)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); - char *text = XtNewString(catgets(c->DT_catd, 1, 916, "The Duration value must be less than 24 hours.\nYour properties settings have not been saved.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 916, "The Duration value must be less than 24 hours.\nYour properties settings have not been saved.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); XtFree(dur_txt); dialog_popup(pu->frame, @@ -2689,9 +2689,9 @@ get_editor_vals_from_ui(Props_pu *pu, Props *p) { get_dssw_times(&pu->ep_dssw); if (string_is_time(pu->ep_dssw.start_val.val) == False) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); - char *text = XtNewString(catgets(c->DT_catd, 1, 820, "The start value must be a valid time.\nYour properties settings have not been saved.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 820, "The start value must be a valid time.\nYour properties settings have not been saved.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(pu->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -2732,18 +2732,18 @@ get_editor_vals_from_ui(Props_pu *pu, Props *p) { } if ((status = get_reminders_vals(&pu->ep_reminders, False)) != REMINDERS_OK) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1079, "Calendar : Error - Editor Settings")); char *text; - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); switch (status) { - case ADVANCE_BLANK : text = XtNewString(catgets(c->DT_catd, 1, 908, "You may not set a blank reminder value.\nYour properties settings have not been saved.")); + case ADVANCE_BLANK : text = XtNewString(CATGETS(c->DT_catd, 1, 908, "You may not set a blank reminder value.\nYour properties settings have not been saved.")); break; - case ADVANCE_CONTAINS_BLANK : text = XtNewString(catgets(c->DT_catd, 1, 909, "You may not set a reminder value with an embedded blank.\nYour properties settings have not been saved.")); + case ADVANCE_CONTAINS_BLANK : text = XtNewString(CATGETS(c->DT_catd, 1, 909, "You may not set a reminder value with an embedded blank.\nYour properties settings have not been saved.")); break; - case ADVANCE_NONNUMERIC : text = XtNewString(catgets(c->DT_catd, 1, 910, "Reminder values must be a number with an optional sign.\nYour properties settings have not been saved.")); + case ADVANCE_NONNUMERIC : text = XtNewString(CATGETS(c->DT_catd, 1, 910, "Reminder values must be a number with an optional sign.\nYour properties settings have not been saved.")); break; } @@ -2796,9 +2796,9 @@ get_display_vals_from_ui(Props_pu *pu, Props *p) { set_char_prop(p, CP_CALLOC, str = XmTextGetString(pu->dp_loc_text)); if (blank_buf(str) || embedded_blank(str)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1083, "Calendar : Error - Display Settings")); - char *text = XtNewString(catgets(c->DT_catd, 1, 772, "You may not save a blank User Calendar Location\nor one that contains blanks.\nYour properties settings have not been saved.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1083, "Calendar : Error - Display Settings")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 772, "You may not save a blank User Calendar Location\nor one that contains blanks.\nYour properties settings have not been saved.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(pu->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -2839,9 +2839,9 @@ get_display_vals_from_ui(Props_pu *pu, Props *p) { str = XmTextGetString(pu->dp_init_view_text)); if (blank_buf(str) || embedded_blank(str)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1083, "Calendar : Error - Display Settings")); - char *text = XtNewString(catgets(c->DT_catd, 1, 773, "You may not save a blank Initial Calendar View\nor one that contains blanks.\nYour properties settings have not been saved.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1083, "Calendar : Error - Display Settings")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 773, "You may not save a blank Initial Calendar View\nor one that contains blanks.\nYour properties settings have not been saved.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(pu->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -2883,15 +2883,15 @@ static void print_option_error(Props_pu *pu, int setNum, int msgNum, char *str) { Calendar *c = pu->cal; - char *text = XtNewString(catgets(c->DT_catd, setNum, msgNum, str)); + char *text = XtNewString(CATGETS(c->DT_catd, setNum, msgNum, str)); static char *title = (char *)NULL; static char *ident1 = (char *)NULL; if (title == (char *)NULL) - title = XtNewString(catgets(c->DT_catd, 1, 1085, + title = XtNewString(CATGETS(c->DT_catd, 1, 1085, "Calendar : Error - Printer Settings")); if (ident1 == (char *)NULL) - ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(pu->frame, DIALOG_TITLE, title, diff --git a/cde/programs/dtcm/dtcm/reminders.c b/cde/programs/dtcm/dtcm/reminders.c index 6735c2b45..ae99eb849 100644 --- a/cde/programs/dtcm/dtcm/reminders.c +++ b/cde/programs/dtcm/dtcm/reminders.c @@ -212,15 +212,15 @@ r_set_bfpm_vals( switch ( scope ) { case TIME_MINS : xmstr = XmStringCreateLocalized( - catgets( calendar->DT_catd, 1, 877, time_scope_str(scope) ) ); + CATGETS( calendar->DT_catd, 1, 877, time_scope_str(scope) ) ); break; case TIME_HRS : xmstr = XmStringCreateLocalized( - catgets( calendar->DT_catd, 1, 878, time_scope_str(scope) ) ); + CATGETS( calendar->DT_catd, 1, 878, time_scope_str(scope) ) ); break; case TIME_DAYS : xmstr = XmStringCreateLocalized( - catgets( calendar->DT_catd, 1, 879, time_scope_str(scope) ) ); + CATGETS( calendar->DT_catd, 1, 879, time_scope_str(scope) ) ); break; default : xmstr = XmStringCreateLocalized(time_scope_str(scope)); @@ -249,15 +249,15 @@ r_set_bfpm_vals( switch ( scope ) { case TIME_MINS : xmstr = XmStringCreateLocalized( - catgets( calendar->DT_catd, 1, 877, time_scope_str(scope) ) ); + CATGETS( calendar->DT_catd, 1, 877, time_scope_str(scope) ) ); break; case TIME_HRS : xmstr = XmStringCreateLocalized( - catgets( calendar->DT_catd, 1, 878, time_scope_str(scope) ) ); + CATGETS( calendar->DT_catd, 1, 878, time_scope_str(scope) ) ); break; case TIME_DAYS : xmstr = XmStringCreateLocalized( - catgets( calendar->DT_catd, 1, 879, time_scope_str(scope) ) ); + CATGETS( calendar->DT_catd, 1, 879, time_scope_str(scope) ) ); break; default : xmstr = XmStringCreateLocalized(time_scope_str(scope)); @@ -362,7 +362,7 @@ build_reminders(Reminders *r, Calendar *c, Widget parent) { NULL); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 985, "Reminders")); + CATGETS(c->DT_catd, 1, 985, "Reminders")); r->alarm_label = XtVaCreateWidget("Reminders", xmLabelGadgetClass, r->bfpm_form_mgr, XmNlabelString, xmstr, @@ -376,7 +376,7 @@ build_reminders(Reminders *r, Calendar *c, Widget parent) { /* Create the 4 toggle items to see which one is the longest */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 986, "Beep")); + CATGETS(c->DT_catd, 1, 986, "Beep")); r->beep_toggle = XtVaCreateWidget("Beep", xmToggleButtonGadgetClass, r->bfpm_form_mgr, XmNlabelString, xmstr, @@ -386,7 +386,7 @@ build_reminders(Reminders *r, Calendar *c, Widget parent) { xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 987, "Flash")); + CATGETS(c->DT_catd, 1, 987, "Flash")); r->flash_toggle = XtVaCreateWidget("Flash", xmToggleButtonGadgetClass, r->bfpm_form_mgr, XmNlabelString, xmstr, @@ -396,7 +396,7 @@ build_reminders(Reminders *r, Calendar *c, Widget parent) { xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 988, "Popup")); + CATGETS(c->DT_catd, 1, 988, "Popup")); r->popup_toggle = XtVaCreateWidget("Popup", xmToggleButtonGadgetClass, r->bfpm_form_mgr, XmNlabelString, xmstr, @@ -406,7 +406,7 @@ build_reminders(Reminders *r, Calendar *c, Widget parent) { xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 989, "Mail")); + CATGETS(c->DT_catd, 1, 989, "Mail")); r->mail_toggle = XtVaCreateWidget("Mail", xmToggleButtonGadgetClass, r->bfpm_form_mgr, XmNlabelString, xmstr, @@ -416,7 +416,7 @@ build_reminders(Reminders *r, Calendar *c, Widget parent) { xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 990, "Mail To:" ) ); + CATGETS(c->DT_catd, 1, 990, "Mail To:" ) ); r->mailto_label = XtVaCreateManagedWidget("MailTo", xmLabelGadgetClass, r->bfpm_form_mgr, XmNlabelString, xmstr, @@ -675,13 +675,13 @@ reminder_err_msg(Widget frame, char *name, Reminder_val_op op, Pixmap p) switch(op) { case ADVANCE_BLANK: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 775, "You must specify a reminder advance\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 775, "You must specify a reminder advance\nOperation was cancelled. Calendar")); break; case ADVANCE_CONTAINS_BLANK: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 776, "A reminder advance may not contain an embedded blank\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 776, "A reminder advance may not contain an embedded blank\nOperation was cancelled. Calendar")); break; case ADVANCE_NONNUMERIC: - sprintf(buf, "%s", catgets(c->DT_catd, 1, 777, "Advance values must be a number with an optional sign\nOperation was cancelled. Calendar")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 777, "Advance values must be a number with an optional sign\nOperation was cancelled. Calendar")); break; case REMINDERS_OK: default: @@ -690,9 +690,9 @@ reminder_err_msg(Widget frame, char *name, Reminder_val_op op, Pixmap p) sprintf(buf2, "%s %s", buf, name); - title = XtNewString(catgets(c->DT_catd, 1, 364, + title = XtNewString(CATGETS(c->DT_catd, 1, 364, "Calendar : Error - Editor")); - ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(frame, DIALOG_TITLE, title, DIALOG_TEXT, buf2, BUTTON_IDENT, 1, ident1, diff --git a/cde/programs/dtcm/dtcm/rfp.c b/cde/programs/dtcm/dtcm/rfp.c index 0615b38fc..04c6406df 100644 --- a/cde/programs/dtcm/dtcm/rfp.c +++ b/cde/programs/dtcm/dtcm/rfp.c @@ -127,25 +127,25 @@ rfp_set_repeat_values(RFP *rfp) return; } else if (limit == 10) { - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 901, "Repeat Every ...")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 901, "Repeat Every ...")); XmComboBoxAddItem(rfp->repeat_menu, xmstr, 0, False); XmStringFree(xmstr); } else if (limit == 7) { - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 902, "Monday Thru Friday")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 902, "Monday Thru Friday")); XmComboBoxAddItem(rfp->repeat_menu, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 903, "Mon, Wed, Fri")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 903, "Mon, Wed, Fri")); XmComboBoxAddItem(rfp->repeat_menu, xmstr, 0, False); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 861, "Tuesday, Thursday")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 861, "Tuesday, Thursday")); XmComboBoxAddItem(rfp->repeat_menu, xmstr, 0, False); XmStringFree(xmstr); if (rfp->cal->general->version == DATAVER3) { - xmstr = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 862, "Repeat Every...")); + xmstr = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 862, "Repeat Every...")); XmComboBoxAddItem(rfp->repeat_menu, xmstr, 0, False); XmStringFree(xmstr); } @@ -227,9 +227,9 @@ rfp_apply_proc(Widget w, XtPointer client_data, XtPointer cbs) { str = XmTextGetString(rfp->repeat_popup_text); if (!string_is_number(str)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 969, "Calendar : Error - Repeat Every")); - char *text = XtNewString(catgets(c->DT_catd, 1, 970, "The Repeat Every value must be an integer with no sign.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 969, "Calendar : Error - Repeat Every")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 970, "The Repeat Every value must be an integer with no sign.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); XtFree(str); dialog_popup(c->frame, @@ -258,13 +258,13 @@ rfp_apply_proc(Widget w, XtPointer client_data, XtPointer cbs) { switch (op) { - case REPEAT_DAYS: repeat_str = catgets(c->DT_catd, 1, 825, "Days"); + case REPEAT_DAYS: repeat_str = CATGETS(c->DT_catd, 1, 825, "Days"); break; - case REPEAT_WEEKS: repeat_str = catgets(c->DT_catd, 1, 826, "Weeks"); + case REPEAT_WEEKS: repeat_str = CATGETS(c->DT_catd, 1, 826, "Weeks"); break; - case REPEAT_MONTHS: repeat_str = catgets(c->DT_catd, 1, 827, "Months"); + case REPEAT_MONTHS: repeat_str = CATGETS(c->DT_catd, 1, 827, "Months"); break; } @@ -273,7 +273,7 @@ rfp_apply_proc(Widget w, XtPointer client_data, XtPointer cbs) { */ { char *nl_repeat = XtNewString(repeat_str); - sprintf(buf, catgets(c->DT_catd, 1, 531, "Every %d %s"), + sprintf(buf, CATGETS(c->DT_catd, 1, 531, "Every %d %s"), rfp->repeat_nth, nl_repeat); XtFree(nl_repeat); } @@ -329,7 +329,7 @@ rfp_repeat_every_popup(RFP *rfp) { char *title; XmString label_str; - title = XtNewString(catgets(c->DT_catd, 1, 532, + title = XtNewString(CATGETS(c->DT_catd, 1, 532, "Calendar : Repeat Every")); rfp->repeat_popup_frame = XtVaCreatePopupShell("repeat_popup_frame", xmDialogShellWidgetClass, rfp->parent, @@ -351,7 +351,7 @@ rfp_repeat_every_popup(RFP *rfp) { XmNfractionBase, 2, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 460, "Apply")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 460, "Apply")); rfp->repeat_apply_button = XtVaCreateWidget("repeat_apply_button", xmPushButtonWidgetClass, rfp->repeat_form_mgr, XmNlabelString, label_str, @@ -366,7 +366,7 @@ rfp_repeat_every_popup(RFP *rfp) { XtAddCallback(rfp->repeat_apply_button, XmNactivateCallback, rfp_apply_proc, rfp); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 680, "Close")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 680, "Close")); rfp->repeat_cancel_button = XtVaCreateWidget("repeat_cancel_button", xmPushButtonWidgetClass, rfp->repeat_form_mgr, XmNlabelString, label_str, @@ -391,7 +391,7 @@ rfp_repeat_every_popup(RFP *rfp) { XmNbottomOffset, 5, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 533, + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 533, "Repeat Every:")); label = XtVaCreateWidget("every", xmLabelGadgetClass, rfp->repeat_form_mgr, @@ -525,7 +525,7 @@ build_rfp( XmNuserData, rfp, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 836, "Frequency")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 836, "Frequency")); rfp->frequency_label = XtVaCreateWidget("frequency_label", xmLabelGadgetClass, rfp->rfp_form_mgr, XmNlabelString, label_str, @@ -534,7 +534,7 @@ build_rfp( NULL); XmStringFree(label_str); - tmp = XmStringCreateLocalized(catgets(c->DT_catd, 1, 534, "Occurs:")); + tmp = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 534, "Occurs:")); rfp->repeat_label = XtVaCreateWidget("repeat", xmLabelGadgetClass, rfp->rfp_form_mgr, XmNlabelString, label_str, @@ -542,7 +542,7 @@ build_rfp( NULL); XmStringFree(tmp); - tmp = XmStringCreateLocalized(catgets(c->DT_catd, 1, 535, "For:")); + tmp = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 535, "For:")); rfp->for_label = XtVaCreateWidget("for", xmLabelGadgetClass, rfp->rfp_form_mgr, XmNlabelString, tmp, @@ -550,7 +550,7 @@ build_rfp( NULL); XmStringFree(tmp); - tmp = XmStringCreateLocalized( catgets(c->DT_catd, 1, 536, "Privacy:")); + tmp = XmStringCreateLocalized( CATGETS(c->DT_catd, 1, 536, "Privacy:")); rfp->privacy_label = XtVaCreateWidget("privacy", xmLabelGadgetClass, rfp->rfp_form_mgr, XmNlabelString, tmp, @@ -759,7 +759,7 @@ get_rfp_repeat_val( NULL); if (sensitive) { - char *forever_str = catgets(calendar->DT_catd, 1, 876, + char *forever_str = CATGETS(calendar->DT_catd, 1, 876, "forever"); str = XmTextGetString(tf); if (strcmp(str, forever_str) == 0) { @@ -885,15 +885,15 @@ rfp_form_flags_to_appt(RFP *rfp, Dtcm_appointment *a, char *name, int *flagsP) { if (*flagsP == 0) { - char *title = XtNewString(catgets(c->DT_catd, 1, 537, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 537, "Calendar : Editor - Schedule Appointment")); - char *text = XtNewString(catgets(c->DT_catd, 1, 538, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 538, "Would you like to schedule this appointment as the last\nweek of the month or the 4th week of the month?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 540, "Last Week")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 541, "4th Week")); *flagsP = dialog_popup(rfp->parent, DIALOG_TITLE, title, @@ -1136,17 +1136,17 @@ set_rfp_repeat_val(RFP *rfp) { } else if (rfp->repeat_type == CSA_X_DT_REPEAT_EVERY_NDAY) { op = REPEAT_EVERY; repeat_scope = repeat_scope_str(c->DT_catd, REPEAT_DAYS); - sprintf(buf, catgets(c->DT_catd, 1, 542, "Every %d %s"), + sprintf(buf, CATGETS(c->DT_catd, 1, 542, "Every %d %s"), rfp->repeat_nth, repeat_scope); } else if (rfp->repeat_type == CSA_X_DT_REPEAT_EVERY_NWEEK) { op = REPEAT_EVERY; repeat_scope = repeat_scope_str(c->DT_catd, REPEAT_WEEKS); - sprintf(buf, catgets(c->DT_catd, 1, 543, "Every %d %s"), + sprintf(buf, CATGETS(c->DT_catd, 1, 543, "Every %d %s"), rfp->repeat_nth, repeat_scope); } else if (rfp->repeat_type == CSA_X_DT_REPEAT_EVERY_NMONTH) { op = REPEAT_EVERY; repeat_scope = repeat_scope_str(c->DT_catd, REPEAT_MONTHS); - sprintf(buf, catgets(c->DT_catd, 1, 544, "Every %d %s"), + sprintf(buf, CATGETS(c->DT_catd, 1, 544, "Every %d %s"), rfp->repeat_nth, repeat_scope); } else return; @@ -1165,7 +1165,7 @@ set_rfp_repeat_val(RFP *rfp) { if (rfp->for_val == CSA_X_DT_DT_REPEAT_FOREVER) { if(rfp->repeat_type != CSA_X_DT_REPEAT_ONETIME) { - sprintf(buf, "%s", catgets(c->DT_catd, 1, 876, "forever")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 876, "forever")); xmstr = XmStringCreateLocalized(buf); XmComboBoxSetItem(rfp->for_menu, xmstr); XmStringFree(xmstr); diff --git a/cde/programs/dtcm/dtcm/tempbr.c b/cde/programs/dtcm/dtcm/tempbr.c index ac46eb0c9..4467f0eda 100644 --- a/cde/programs/dtcm/dtcm/tempbr.c +++ b/cde/programs/dtcm/dtcm/tempbr.c @@ -171,7 +171,7 @@ tempbr_show_cb(Widget w, XtPointer data, XtPointer cbs) #ifdef FNS if (cmfns_use_fns((Props *)c->properties)) { - sprintf(msg_buf, catgets(c->DT_catd, 1, 647, + sprintf(msg_buf, CATGETS(c->DT_catd, 1, 647, "Looking up %s..."), name); set_message(tb->show_message, msg_buf); XmUpdateDisplay(tb->show_message); @@ -182,7 +182,7 @@ tempbr_show_cb(Widget w, XtPointer data, XtPointer cbs) } #endif - sprintf(msg_buf, catgets(c->DT_catd, 1, 559, "Browsing %s..."), + sprintf(msg_buf, CATGETS(c->DT_catd, 1, 559, "Browsing %s..."), name); set_message(tb->show_message, msg_buf); XFlush(XtDisplay(w)); @@ -206,7 +206,7 @@ make_std_tempbr(Calendar *c) else tb = (Tempbr*)c->tempbr; - title = XtNewString(catgets(c->DT_catd, 1, 560, "Calendar : Show Other Calendar")); + title = XtNewString(CATGETS(c->DT_catd, 1, 560, "Calendar : Show Other Calendar")); tb->frame = XtVaCreatePopupShell("frame", xmDialogShellWidgetClass, c->frame, XmNtitle, title, @@ -227,7 +227,7 @@ make_std_tempbr(Calendar *c) NULL); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 410, "User Name:")); + CATGETS(c->DT_catd, 1, 410, "User Name:")); tb->name_label = XtVaCreateWidget("name_label", xmLabelWidgetClass, tb->form, @@ -278,7 +278,7 @@ make_std_tempbr(Calendar *c) NULL); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 562, "Show")); + CATGETS(c->DT_catd, 1, 562, "Show")); tb->show_button = XtVaCreateWidget("show_button", xmPushButtonWidgetClass, button_form, @@ -294,7 +294,7 @@ make_std_tempbr(Calendar *c) XmStringFree(label_str); label_str = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 680, "Close")); + CATGETS(c->DT_catd, 1, 680, "Close")); tb->cancel_button = XtVaCreateWidget("cancelButton", xmPushButtonWidgetClass, button_form, @@ -311,7 +311,7 @@ make_std_tempbr(Calendar *c) XtAddCallback(tb->cancel_button, XmNactivateCallback, tb_cancel_cb, NULL); - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); tb->help_button = XtVaCreateWidget("helpButton", xmPushButtonWidgetClass, button_form, XmNlabelString, label_str, @@ -329,7 +329,7 @@ make_std_tempbr(Calendar *c) (XtCallbackProc)help_cb, (XtPointer) SHOW_OTHER_CAL_HELP_BUTTON); #ifdef FNS_SUNDEX_DEMO - label_str = XmStringCreateLocalized(catgets(c->DT_catd, 1, 648, + label_str = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 648, "SunDex")); tb->show_button = XtVaCreateWidget("sundex_button", xmPushButtonWidgetClass, tb->form, diff --git a/cde/programs/dtcm/dtcm/timezone.c b/cde/programs/dtcm/dtcm/timezone.c index 097990846..a57d70572 100644 --- a/cde/programs/dtcm/dtcm/timezone.c +++ b/cde/programs/dtcm/dtcm/timezone.c @@ -80,7 +80,7 @@ make_timezone(Calendar *c) else t = (Timezone*)c->timezone; - title = XtNewString(catgets(c->DT_catd, 1, 649, "Calendar : Time Zone")); + title = XtNewString(CATGETS(c->DT_catd, 1, 649, "Calendar : Time Zone")); t->frame = XtVaCreatePopupShell("frame", xmDialogShellWidgetClass, c->frame, XmNtitle, title, @@ -113,7 +113,7 @@ make_timezone(Calendar *c) XmNtopOffset, 5, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 650, "My Time")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 650, "My Time")); t->mytime = XtVaCreateWidget("myTime", xmToggleButtonGadgetClass, t->timezone_rc_mgr, XmNlabelString, xmstr, @@ -123,7 +123,7 @@ make_timezone(Calendar *c) XmStringFree(xmstr); XtAddCallback(t->mytime, XmNvalueChangedCallback, tz_mytime_cb, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 652, "Custom Time")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 652, "Custom Time")); t->customtime = XtVaCreateWidget("customTime", xmToggleButtonGadgetClass, t->timezone_rc_mgr, XmNlabelString, xmstr, @@ -132,7 +132,7 @@ make_timezone(Calendar *c) XmStringFree(xmstr); XtAddCallback(t->customtime, XmNvalueChangedCallback, tz_customtime_cb, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 653, "GMT")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 653, "GMT")); t->gmtlabel = XtVaCreateWidget("gmtLabel", xmLabelWidgetClass, t->form, XmNlabelString, xmstr, XmNleftAttachment, XmATTACH_WIDGET, @@ -174,7 +174,7 @@ make_timezone(Calendar *c) XmTextSetString(text, "-6"); */ - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 654, "Hours")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 654, "Hours")); t->hourlabel = XtVaCreateWidget("gmtHours", xmLabelWidgetClass, t->form, XmNlabelString, xmstr, XmNleftAttachment, XmATTACH_WIDGET, @@ -211,7 +211,7 @@ make_timezone(Calendar *c) XmNfractionBase, 4, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 655, "OK")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 655, "OK")); t->okbutton = XtVaCreateWidget("OK", xmPushButtonWidgetClass, button_form, XmNlabelString, xmstr, @@ -228,7 +228,7 @@ make_timezone(Calendar *c) XmStringFree(xmstr); XtAddCallback(t->okbutton, XmNactivateCallback, tz_ok_cb, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 460, "Apply")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 460, "Apply")); t->applybutton = XtVaCreateWidget("Apply", xmPushButtonWidgetClass, button_form, XmNlabelString, xmstr, @@ -245,7 +245,7 @@ make_timezone(Calendar *c) XmStringFree(xmstr); XtAddCallback(t->applybutton, XmNactivateCallback, tz_apply_cb, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); t->cancelbutton = XtVaCreateWidget("Cancel", xmPushButtonWidgetClass, button_form, XmNlabelString, xmstr, @@ -262,7 +262,7 @@ make_timezone(Calendar *c) XmStringFree(xmstr); XtAddCallback(t->cancelbutton, XmNactivateCallback, tz_cancel_cb, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); t->helpbutton = XtVaCreateWidget("Help", xmPushButtonWidgetClass, button_form, XmNlabelString, xmstr, @@ -298,7 +298,7 @@ make_timezone(Calendar *c) cm_strcpy(tmp_buf, (char*)getenv("TZ")); cm_strcpy(t->mytimezone, tmp_buf); - sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"), + sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), t->mytimezone); set_message(t->timezone_message, buf); set_message(c->message_text, buf); @@ -384,7 +384,7 @@ tz_set_timezone(Calendar *c, Timezone *t) if (t->timezone_type == mytime) { set_timezone(t->mytimezone); - sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"), + sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), t->mytimezone); /* get utc time */ @@ -412,7 +412,7 @@ tz_set_timezone(Calendar *c, Timezone *t) cm_strcpy(t->gmttimezone, tmp_buf); sprintf(gmt, "GMT%s", tmp_buf); set_timezone(gmt); - sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"), gmt); + sprintf(buf, "%s %s", CATGETS(c->DT_catd, 1, 659, "Time Zone:"), gmt); } set_message(t->timezone_message, buf); paint_canvas(c, NULL, RENDER_CLEAR_FIRST); diff --git a/cde/programs/dtcm/dtcm/todo.c b/cde/programs/dtcm/dtcm/todo.c index ffda2397f..248862753 100644 --- a/cde/programs/dtcm/dtcm/todo.c +++ b/cde/programs/dtcm/dtcm/todo.c @@ -145,7 +145,7 @@ appt_to_form(ToDo *t, CSA_entry_handle a) { t->completed_val = False; XmToggleButtonGadgetSetState(t->completed_toggle, t->completed_val, True); - sprintf(buf, "%s: %s", catgets(t->cal->DT_catd, 1, 565, "Author"), + sprintf(buf, "%s: %s", CATGETS(t->cal->DT_catd, 1, 565, "Author"), appt->author->value->item.calendar_user_value->user_name); set_message(t->message_text, buf); free_appt_struct(&appt); @@ -354,11 +354,11 @@ flush_view_changes(ToDo *t){ int answer; if (t->view_list_modified) { - char *title = XtNewString(catgets(c->DT_catd, 1, 778, "Calendar : To Do List - Help")); - char *text = XtNewString(catgets(c->DT_catd, 1, 451, "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 452, "Save")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 700, "Discard")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); + char *title = XtNewString(CATGETS(c->DT_catd, 1, 778, "Calendar : To Do List - Help")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 451, "You have made unsaved changes.\nYou may save your changes, discard your changes, \nor return to your previous place in the dialog.")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 452, "Save")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 700, "Discard")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); answer = dialog_popup(t->view_frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -476,10 +476,10 @@ create_filter_menu(Widget parent, XtCallbackProc cb_func, XtPointer data) { int ac = 0; Arg args[5]; - label = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 40, "View")); - option1 = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 272, "All")); - option2 = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 783, "Pending")); - option3 = XmStringCreateLocalized(catgets(calendar->DT_catd, 1, 784, "Completed")); + label = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 40, "View")); + option1 = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 272, "All")); + option2 = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 783, "Pending")); + option3 = XmStringCreateLocalized(CATGETS(calendar->DT_catd, 1, 784, "Completed")); menu = XmCreatePulldownMenu(parent, "_pulldown", NULL, 0); @@ -536,7 +536,7 @@ t_build_view_popup(ToDo *t) { /* ** Dialog shell and form */ - title = XtNewString(catgets(c->DT_catd, 1, 1012, "Calendar : To Do List")); + title = XtNewString(CATGETS(c->DT_catd, 1, 1012, "Calendar : To Do List")); t->view_frame = XtVaCreatePopupShell("todo_list", xmDialogShellWidgetClass, c->frame, XmNtitle, title, @@ -554,7 +554,7 @@ t_build_view_popup(ToDo *t) { XmNautoUnmanage, False, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 655, "OK")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 655, "OK")); t->view_ok_button = XtVaCreateWidget("ok", @@ -575,7 +575,7 @@ t_build_view_popup(ToDo *t) { XtAddCallback(t->view_ok_button, XmNactivateCallback, (XtCallbackProc) t_view_ok_cb, t); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 460, "Apply")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 460, "Apply")); t->view_apply_button = XtVaCreateWidget("apply", xmPushButtonWidgetClass, t->view_form, @@ -591,7 +591,7 @@ t_build_view_popup(ToDo *t) { XtAddCallback(t->view_apply_button, XmNactivateCallback, (XtCallbackProc) t_view_apply_cb, t); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); t->view_cancel_button = XtVaCreateWidget("cancel", xmPushButtonWidgetClass, t->view_form, @@ -608,7 +608,7 @@ t_build_view_popup(ToDo *t) { XtAddCallback(t->view_cancel_button, XmNactivateCallback, (XtCallbackProc) t_view_cancel_cb, t); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); t->view_help_button = XtVaCreateWidget("help", xmPushButtonWidgetClass, t->view_form, @@ -634,7 +634,7 @@ t_build_view_popup(ToDo *t) { XmNbottomOffset, 5, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 789, "To Do Type:")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 789, "To Do Type:")); label= XtVaCreateWidget("type_label", xmLabelGadgetClass, t->view_form, XmNtopAttachment, XmATTACH_FORM, @@ -657,7 +657,7 @@ t_build_view_popup(ToDo *t) { XmNleftOffset, 5, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 790, "context")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 790, "context")); t->view_list_label= XtVaCreateWidget("type_label", xmLabelGadgetClass, t->view_form, XmNtopAttachment, XmATTACH_WIDGET, @@ -743,7 +743,7 @@ t_expand_ui_proc(Widget w, XtPointer client_data, XtPointer data) { XtSetSensitive(t->rfp.rfp_form_mgr, False); - xmstr = XmStringCreateLocalized(catgets(t->cal->DT_catd, 1, 625, + xmstr = XmStringCreateLocalized(CATGETS(t->cal->DT_catd, 1, 625, "Less")); XtVaSetValues(t->expand_ui_button, XmNlabelString, xmstr, NULL); @@ -766,7 +766,7 @@ t_expand_ui_proc(Widget w, XtPointer client_data, XtPointer data) { expand_state_closed = False; } else { XtSetSensitive(t->rfp.rfp_form_mgr, False); - xmstr = XmStringCreateLocalized(catgets(t->cal->DT_catd, 1, 626, + xmstr = XmStringCreateLocalized(CATGETS(t->cal->DT_catd, 1, 626, "More")); XtVaSetValues(t->expand_ui_button, XmNlabelString, xmstr, NULL); @@ -873,10 +873,10 @@ t_form_to_appt(ToDo *t) { str = XmTextGetString(t->dssw.what_text); if (!first_line_contains_text(str)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 837, "Calendar : Error - To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 913, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 837, "Calendar : Error - To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 913, "A To Do item must have text in the first line of the What item.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); dialog_popup(t->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -979,12 +979,12 @@ t_insert_proc(Widget w, XtPointer client_data, XtPointer data) { op = ONE_TIME; if (op != ONE_TIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1102, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1102, "Insert To Do")); - char *text = XtNewString(catgets(c->DT_catd, 1, 1103, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 1103, "This To Do is part of a repeating series.\nDo you want to insert the item ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1051,10 +1051,10 @@ t_delete_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(t->frame); if (!XmListGetSelectedPos(t->todo_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 567, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 567, "Select a To Do and DELETE again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(t->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1069,10 +1069,10 @@ t_delete_proc(Widget w, XtPointer client_data, XtPointer data) { } if (!(entry = t_nth_appt(t, item_list[0] - 1))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 570, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 570, "Internal error selecting To Do.\nTo Do was not deleted.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(t->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1105,14 +1105,14 @@ t_delete_proc(Widget w, XtPointer client_data, XtPointer data) { if (appt->repeat_type->value) { if (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 591, "Calendar : To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 573, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 591, "Calendar : To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 573, "This To Do is part of a repeating series.\nDo you want to delete ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 270, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 270, "This One Only")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 271, "Forward")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 271, "Forward")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(t->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1131,12 +1131,12 @@ t_delete_proc(Widget w, XtPointer client_data, XtPointer data) { } } else if (appt->recurrence_rule->value) { - char *title = XtNewString(catgets(c->DT_catd, 1, 591, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 591, "Calendar : To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 791, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 791, "This To Do repeats in an unknown fashion. All occurrences will be changed\nDo you still wish to delete it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1218,12 +1218,12 @@ t_execute_change(ToDo *t, CSA_entry_handle old_a, Dtcm_appointment *new_a, (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_WEEKLY) || (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_MONTHLY) || (appt->repeat_type->value->item.sint32_value == CSA_X_DT_REPEAT_OTHER_YEARLY)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 591, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 591, "Calendar : To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 708, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 708, "This appointment repeats in an unknown fashion. All occurrences will be changed\nDo you still wish to change it?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1238,14 +1238,14 @@ t_execute_change(ToDo *t, CSA_entry_handle old_a, Dtcm_appointment *new_a, } else if (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME) { - char *title = XtNewString(catgets(c->DT_catd, 1, 591, "Calendar : To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 579, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 591, "Calendar : To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 579, "This To Do is part of a repeating series.\nDo you want to change ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident2 = XtNewString(catgets(c->DT_catd, 1, 270, + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident2 = XtNewString(CATGETS(c->DT_catd, 1, 270, "This One Only")); - char *ident3 = XtNewString(catgets(c->DT_catd, 1, 271, "Forward")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident3 = XtNewString(CATGETS(c->DT_catd, 1, 271, "Forward")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1366,10 +1366,10 @@ t_change_proc(Widget w, XtPointer client_data, XtPointer data) { _DtTurnOnHourGlass(t->frame); if (!XmListGetSelectedPos(t->todo_list, &item_list, &item_cnt)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 585, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 585, "Select a To Do and CHANGE again.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(t->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1384,10 +1384,10 @@ t_change_proc(Widget w, XtPointer client_data, XtPointer data) { } if (!(old_a = t_nth_appt(t, item_list[0] - 1))) { - char *title = XtNewString(catgets(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); - char *text = XtNewString(catgets(c->DT_catd, 1, 1009, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 566, "Calendar : Error - To Do Editor")); + char *text = XtNewString(CATGETS(c->DT_catd, 1, 1009, "Internal error selecting To Do.\nTo Do was not changed.")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); answer = dialog_popup(t->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, @@ -1558,7 +1558,7 @@ t_make_todo(Calendar *c) ** Build the stuff in the upper portion of the form */ - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 797, "To Do")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 797, "To Do")); t->list_label = XtVaCreateWidget("todo_label", xmLabelGadgetClass, t->base_form_mgr, XmNtopAttachment, XmATTACH_FORM, @@ -1586,7 +1586,7 @@ t_make_todo(Calendar *c) /* ** Create insert, delete, change, and clear buttons */ - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 342, "Insert")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 342, "Insert")); t->insert_button = XtVaCreateWidget("insert", xmPushButtonWidgetClass, t->base_form_mgr, XmNbottomAttachment, XmATTACH_WIDGET, @@ -1600,7 +1600,7 @@ t_make_todo(Calendar *c) XtAddCallback(t->insert_button, XmNactivateCallback, t_insert_proc, t); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 343, "Change")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 343, "Change")); t->change_button = XtVaCreateWidget("change", xmPushButtonWidgetClass, t->base_form_mgr, XmNbottomAttachment, XmATTACH_WIDGET, @@ -1615,7 +1615,7 @@ t_make_todo(Calendar *c) XtAddCallback(t->change_button, XmNactivateCallback, t_change_proc, t); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 802, "Delete")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 802, "Delete")); t->delete_button = XtVaCreateWidget("delete", xmPushButtonWidgetClass, t->base_form_mgr, XmNbottomAttachment, XmATTACH_WIDGET, @@ -1630,7 +1630,7 @@ t_make_todo(Calendar *c) XtAddCallback(t->delete_button, XmNactivateCallback, t_delete_proc, t); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 803, "Clear")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 803, "Clear")); t->clear_button = XtVaCreateWidget("clear", xmPushButtonWidgetClass, t->base_form_mgr, XmNbottomAttachment, XmATTACH_WIDGET, @@ -1644,7 +1644,7 @@ t_make_todo(Calendar *c) XtAddCallback(t->clear_button, XmNactivateCallback, t_clear_proc, t); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 923, "Cancel")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 923, "Cancel")); t->close_button = XtVaCreateWidget("close", xmPushButtonWidgetClass, t->base_form_mgr, XmNbottomAttachment, XmATTACH_WIDGET, @@ -1658,7 +1658,7 @@ t_make_todo(Calendar *c) XtAddCallback(t->close_button, XmNactivateCallback, t_close_proc, t); XmStringFree(xmstr); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 77, "Help")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 77, "Help")); t->help_button = XtVaCreateWidget("help", xmPushButtonWidgetClass, t->base_form_mgr, XmNbottomAttachment, XmATTACH_WIDGET, @@ -1697,7 +1697,7 @@ t_make_todo(Calendar *c) XmNbottomWidget, t->separator2, NULL); - xmstr = XmStringCreateLocalized(catgets(c->DT_catd, 1, 626, "More")); + xmstr = XmStringCreateLocalized(CATGETS(c->DT_catd, 1, 626, "More")); t->expand_ui_button = XtVaCreateWidget("expando", xmPushButtonWidgetClass, t->base_form_mgr, XmNlabelString, xmstr, @@ -1723,14 +1723,14 @@ t_make_todo(Calendar *c) build_dssw(&t->dssw, c, t->base_form_mgr, True, False); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 590, "Due Date:")); + CATGETS(c->DT_catd, 1, 590, "Due Date:")); XtVaSetValues(t->dssw.date_label, XmNlabelString, xmstr, NULL); XmStringFree(xmstr); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 798, "Time Due:")); + CATGETS(c->DT_catd, 1, 798, "Time Due:")); XtVaSetValues(t->dssw.start_label, XmNlabelString, xmstr, NULL); @@ -1790,7 +1790,7 @@ t_make_todo(Calendar *c) * Add a drag source icon inside the dssw, lower right */ xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 906, "Drag To Do")); + CATGETS(c->DT_catd, 1, 906, "Drag To Do")); t->drag_source = XtVaCreateWidget("drag_source", dtIconGadgetClass, t->dssw.dssw_form_mgr, XmNpixmapPosition, XmPIXMAP_TOP, @@ -1830,7 +1830,7 @@ t_make_todo(Calendar *c) XtVaSetValues(t->drag_source, XmNpixmap, p->drag_icon_xbm, NULL); xmstr = XmStringCreateLocalized( - catgets(c->DT_catd, 1, 784, "Completed")); + CATGETS(c->DT_catd, 1, 784, "Completed")); t->completed_toggle = XtVaCreateManagedWidget("completed", xmToggleButtonGadgetClass, t->dssw.dssw_form_mgr, @@ -2056,22 +2056,22 @@ set_list_title(ToDo *t) { switch (t->view_list_glance) { case yearGlance: - header = catgets(c->DT_catd, 1, 806, "Year of %d"); + header = CATGETS(c->DT_catd, 1, 806, "Year of %d"); sprintf(buffer, header, year(t->view_list_date)); break; case monthGlance: format_date(t->view_list_date+1, get_int_prop(p, CP_DATEORDERING), buffer2, 0, 0, 0); - header = catgets(c->DT_catd, 1, 807, "%s"); + header = CATGETS(c->DT_catd, 1, 807, "%s"); sprintf(buffer, header, buffer2); break; case weekGlance: format_date(t->view_list_date+1, get_int_prop(p, CP_DATEORDERING), buffer2, 1, 0, 0); - header = catgets(c->DT_catd, 1, 808, "Week of %s"); + header = CATGETS(c->DT_catd, 1, 808, "Week of %s"); sprintf(buffer, header, buffer2); break; case dayGlance: format_date(t->view_list_date+1, get_int_prop(p, CP_DATEORDERING), buffer2, 1, 0, 0); - header = catgets(c->DT_catd, 1, 809, "%s"); + header = CATGETS(c->DT_catd, 1, 809, "%s"); sprintf(buffer, header, buffer2); break; } @@ -2361,7 +2361,7 @@ set_todo_title(ToDo *t, char *name) { char buf[MAXNAMELEN]; if (t->frame) { - sprintf(buf, "%s - %s", catgets(c->DT_catd, 1, 591, "Calendar : To Do Editor"), name); + sprintf(buf, "%s - %s", CATGETS(c->DT_catd, 1, 591, "Calendar : To Do Editor"), name); XtVaSetValues(t->frame, XmNtitle, buf, NULL); } @@ -2459,12 +2459,12 @@ todo_insert(Dtcm_appointment *appt, CSA_entry_handle *new_a, Calendar *c) { if ((appt->repeat_type->value) && (appt->repeat_type->value->item.sint32_value != CSA_X_DT_REPEAT_ONETIME)) { - char *title = XtNewString(catgets(c->DT_catd, 1, 1102, + char *title = XtNewString(CATGETS(c->DT_catd, 1, 1102, "Insert To Do")); - char *text = XtNewString(catgets(c->DT_catd, 1, 1103, + char *text = XtNewString(CATGETS(c->DT_catd, 1, 1103, "This To Do is part of a repeating series.\nDo you want to insert the item ...?")); - char *ident1 = XtNewString(catgets(c->DT_catd, 1, 923, "Cancel")); - char *ident4 = XtNewString(catgets(c->DT_catd, 1, 272, "All")); + char *ident1 = XtNewString(CATGETS(c->DT_catd, 1, 923, "Cancel")); + char *ident4 = XtNewString(CATGETS(c->DT_catd, 1, 272, "All")); answer = dialog_popup(c->frame, DIALOG_TITLE, title, DIALOG_TEXT, text, diff --git a/cde/programs/dtcm/dtcm/weekglance.c b/cde/programs/dtcm/dtcm/weekglance.c index e68e22e2a..6c8d55f31 100644 --- a/cde/programs/dtcm/dtcm/weekglance.c +++ b/cde/programs/dtcm/dtcm/weekglance.c @@ -137,7 +137,7 @@ format_week_header(Tick date, OrderingType order, char *buf) Use the appropriate strftime conversion for your locale. */ strftime(buf, 80, - catgets(c->DT_catd, 1, 993, "Week Starting %A, %B %e, %Y"), tm); + CATGETS(c->DT_catd, 1, 993, "Week Starting %A, %B %e, %Y"), tm); } static int @@ -207,13 +207,13 @@ print_week (Calendar *c, if (days[0] == (char *)NULL) { - days[0] = XtNewString(catgets(c->DT_catd, 1, 596, "Monday %d")); - days[1] = XtNewString(catgets(c->DT_catd, 1, 597, "Tuesday %d")); - days[2] = XtNewString(catgets(c->DT_catd, 1, 598, "Wednesday %d")); - days[3] = XtNewString(catgets(c->DT_catd, 1, 599, "Thursday %d")); - days[4] = XtNewString(catgets(c->DT_catd, 1, 600, "Friday %d")); - days[5] = XtNewString(catgets(c->DT_catd, 1, 601, "Saturday %d")); - days[6] = XtNewString(catgets(c->DT_catd, 1, 602, "Sunday %d")); + days[0] = XtNewString(CATGETS(c->DT_catd, 1, 596, "Monday %d")); + days[1] = XtNewString(CATGETS(c->DT_catd, 1, 597, "Tuesday %d")); + days[2] = XtNewString(CATGETS(c->DT_catd, 1, 598, "Wednesday %d")); + days[3] = XtNewString(CATGETS(c->DT_catd, 1, 599, "Thursday %d")); + days[4] = XtNewString(CATGETS(c->DT_catd, 1, 600, "Friday %d")); + days[5] = XtNewString(CATGETS(c->DT_catd, 1, 601, "Saturday %d")); + days[6] = XtNewString(CATGETS(c->DT_catd, 1, 602, "Sunday %d")); } x_init_printer(xp, LANDSCAPE); @@ -956,7 +956,7 @@ draw_week(Calendar *c, XRectangle *rect, Boundary boundary) c->paint_cache, c->paint_cache_size, rect); current_day += daysec; if (lower_bound > 0) { - sprintf(buf, "%s", catgets(c->DT_catd, 1, 623, "Calendar does not display dates prior to January 1, 1970")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 623, "Calendar does not display dates prior to January 1, 1970")); footer_message = buf; } else @@ -975,7 +975,7 @@ draw_week(Calendar *c, XRectangle *rect, Boundary boundary) fill_day(c, w, x, y, current_day, c->paint_cache, c->paint_cache_size, rect); current_day += daysec; - sprintf(buf, "%s", catgets(c->DT_catd, 1, 624, "Calendar does not display dates after December 31, 2037")); + sprintf(buf, "%s", CATGETS(c->DT_catd, 1, 624, "Calendar does not display dates after December 31, 2037")); footer_message = buf; if (upper_bound > 4) clear_hot_btn(c, n); diff --git a/cde/programs/dtcm/dtcm/x_graphics.c b/cde/programs/dtcm/dtcm/x_graphics.c index 08e99a7fb..19bfc1dbf 100644 --- a/cde/programs/dtcm/dtcm/x_graphics.c +++ b/cde/programs/dtcm/dtcm/x_graphics.c @@ -1010,13 +1010,13 @@ cm_load_font_error(CMGraphicsInfo *gInfo, char *fontPattern) char *title; char *label; - errFmt = catgets(c->DT_catd, 1, 1119, + errFmt = CATGETS(c->DT_catd, 1, 1119, "Warning - Unable to load font %s."); errText = (char *)XtMalloc((strlen(errFmt) + strlen(fontPattern) + 1) * sizeof(char)); sprintf(errText, errFmt, fontPattern); - label = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); - title = XtNewString(catgets(c->DT_catd, 1, 1118, + label = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); + title = XtNewString(CATGETS(c->DT_catd, 1, 1118, "Calendar : Warning - Print")); dialog_popup(c->frame, @@ -1999,7 +1999,7 @@ local_dayname(Calendar *c, char **array_place, int dayNum) 497, 491, 492, 493, 494, 495, 496 }; - source = catgets(c->DT_catd, 1, + source = CATGETS(c->DT_catd, 1, dayCatIndex[dayNum], defaultDays[dayNum]); _len = strlen( source ); @@ -2031,7 +2031,7 @@ local_dayname3(Calendar *c, char **array_place, int dayNum) 480, 481, 482, 483, 484, 485, 486 }; - source = catgets(c->DT_catd, 1, + source = CATGETS(c->DT_catd, 1, dayCatIndex[dayNum], defaultDays[dayNum]); _len = strlen( source ); @@ -2079,7 +2079,7 @@ get_report_type_string(CMGraphicsInfo *gInfo) unsigned long to_len = 0; unsigned long _len; - str = catgets(c->DT_catd, 1, catIndex[reportType], + str = CATGETS(c->DT_catd, 1, catIndex[reportType], defaultStrs[reportType]); _len = strlen( str ); @@ -2121,20 +2121,20 @@ filePrintReportStatus(Calendar *c, Boolean ok) char *label; Pixmap pixmap; - label = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); + label = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); if (!ok) { - errText = XtNewString(catgets(c->DT_catd, 1, 1115, + errText = XtNewString(CATGETS(c->DT_catd, 1, 1115, "Error - unable to print to file.")); - title = XtNewString(catgets(c->DT_catd, 1, 1114, + title = XtNewString(CATGETS(c->DT_catd, 1, 1114, "Calendar : Error - Print To File")); pixmap = pu->xm_error_pixmap; } else { - errText = XtNewString(catgets(c->DT_catd, 1, 1117, + errText = XtNewString(CATGETS(c->DT_catd, 1, 1117, "Print to file has completed.")); - title = XtNewString(catgets(c->DT_catd, 1, 1116, + title = XtNewString(CATGETS(c->DT_catd, 1, 1116, "Calendar : Print To File")); pixmap = pu->xm_info_pixmap; } @@ -2160,11 +2160,11 @@ showBadAllocError(Calendar *c) char *label; Pixmap pixmap; - label = XtNewString(catgets(c->DT_catd, 1, 95, "Continue")); - errText = XtNewString(catgets(c->DT_catd, 1, 1122, + label = XtNewString(CATGETS(c->DT_catd, 1, 95, "Continue")); + errText = XtNewString(CATGETS(c->DT_catd, 1, 1122, "Print job failed.\n\n\ The X Print Server is temporarily out of resources.")); - title = XtNewString(catgets(c->DT_catd, 1, 1121, + title = XtNewString(CATGETS(c->DT_catd, 1, 1121, "Calendar : Print Server Error")); pixmap = pu->xm_error_pixmap; @@ -2626,7 +2626,7 @@ x_print_header(void *gInfoP, char *buf, int pageNum, int numPages) numPages++; /* print creation notice at bottom */ - cm_strcpy(str2, catgets(c->DT_catd, 1, 468, "Page")); + cm_strcpy(str2, CATGETS(c->DT_catd, 1, 468, "Page")); { char *to = NULL; unsigned long to_len = 0; @@ -2641,7 +2641,7 @@ x_print_header(void *gInfoP, char *buf, int pageNum, int numPages) } cm_strcpy(str2, euc_to_octal(str2)); - str = catgets(c->DT_catd, 1, 476, "of"); + str = CATGETS(c->DT_catd, 1, 476, "of"); { char *to = NULL; unsigned long to_len = 0; @@ -2703,7 +2703,7 @@ x_day_header (void *gInfoP) gInfo->topMarginY + dayBoxVOffset + gInfo->u.dayInfo.tab1, gInfo->normalWd); - str = catgets(c->DT_catd, 1, 470, "Morning"); + str = CATGETS(c->DT_catd, 1, 470, "Morning"); { char *to = NULL; @@ -2723,7 +2723,7 @@ x_day_header (void *gInfoP) (gInfo->u.dayInfo.tab1 / 2), CENTER_AT_X | CENTER_AT_Y); - str = catgets(c->DT_catd, 1, 471, "Afternoon"); + str = CATGETS(c->DT_catd, 1, 471, "Afternoon"); { char *to = NULL; @@ -2756,8 +2756,8 @@ x_day_timeslots(void *gInfoP, int i, Boolean more) Calendar *c = gInfo->c; sprintf (hourbuf, "%d", (morning(i) || (i == 12)) ? i : (i - 12) ); - sprintf (modbuf, "%s", morning(i) ? catgets(c->DT_catd, 1, 4, "am") : - catgets(c->DT_catd, 1, 3, "pm")); + sprintf (modbuf, "%s", morning(i) ? CATGETS(c->DT_catd, 1, 4, "am") : + CATGETS(c->DT_catd, 1, 3, "pm")); /* --- print hourly boxes for appt entries --- */ if (i == 12) @@ -3005,10 +3005,10 @@ x_print_list_range(Calendar *c, CSA_sint32 appt_type, int item_data, format_date(start + 1, ot, buf2, 1, 0, 0); if (appt_type == CSA_TYPE_TODO) - sprintf(buf, catgets(c->DT_catd, 1, 899, + sprintf(buf, CATGETS(c->DT_catd, 1, 899, "To Do List Beginning: %s"), buf2); else - sprintf(buf, catgets(c->DT_catd, 1, 900, + sprintf(buf, CATGETS(c->DT_catd, 1, 900, "Appt List Beginning: %s"), buf2); setup_range(&range_attrs, &ops, &i, start, end, appt_type, diff --git a/cde/programs/dtcm/dtcm/yearglance.c b/cde/programs/dtcm/dtcm/yearglance.c index fc5107d10..a319f3c92 100644 --- a/cde/programs/dtcm/dtcm/yearglance.c +++ b/cde/programs/dtcm/dtcm/yearglance.c @@ -307,7 +307,7 @@ update_year(Calendar *c) Use the appropriate strftime conversion for your locale. */ - strftime(buf, 100, catgets(c->DT_catd, 1, 1092, "%Y"), + strftime(buf, 100, CATGETS(c->DT_catd, 1, 1092, "%Y"), _XLocaltime(&c->view->date, localtime_buf)); XtVaGetValues(y->year_label, XmNlabelString, &str, NULL); XmStringFree(str); diff --git a/cde/programs/dtcm/libDtCmP/cm_tty.c b/cde/programs/dtcm/libDtCmP/cm_tty.c index 7be6d4761..4e20b938e 100644 --- a/cde/programs/dtcm/libDtCmP/cm_tty.c +++ b/cde/programs/dtcm/libDtCmP/cm_tty.c @@ -57,7 +57,7 @@ static char sccsid[] = "@(#)cm_tty.c 1.91 95/07/27 Copyr 1993 Sun Microsystems, #include #include #include -#include +#include
#include #include #include "cm_tty.h" @@ -197,25 +197,25 @@ mini_err_msg( if (type == TTY_Insert) fprintf(stderr, "%s", - catgets(catd, 1, 1042, "Insert Access Denied: ")); + CATGETS(catd, 1, 1042, "Insert Access Denied: ")); else if (type == TTY_Delete) fprintf(stderr, "%s", - catgets(catd, 1, 1043, "Delete Access Denied: ")); + CATGETS(catd, 1, 1043, "Delete Access Denied: ")); else fprintf(stderr, "%s", - catgets(catd, 1, 1044, "Lookup Access Denied: ")); + CATGETS(catd, 1, 1044, "Lookup Access Denied: ")); if (appt_what && appt_what[0] != '\0') { buf = cm_strdup(appt_what); if (ptr = strrchr(buf, '\n')) *ptr = '\0'; fprintf(stderr, "%s '%s'\n", - catgets(catd, 1, 1045, "Cancelled for"), + CATGETS(catd, 1, 1045, "Cancelled for"), buf); free(buf); } else fprintf(stderr, "%s\n", - catgets(catd, 1, 1046, + CATGETS(catd, 1, 1046, "Appointment Cancelled\n")); } @@ -243,14 +243,14 @@ query_user(void *client_data) { */ if (what_str && what_str[0] != '\0') - fprintf(stdout, catgets(catd_global, 1, 1047, + fprintf(stdout, CATGETS(catd_global, 1, 1047, "This appointment: '%s' has an end\n"), what_str); else - fprintf(stdout, "%s", catgets(catd_global, 1, 1048, + fprintf(stdout, "%s", CATGETS(catd_global, 1, 1048, "This appointment has an end\n")); - fprintf(stdout, "%s", catgets(catd_global, 1, 1049, + fprintf(stdout, "%s", CATGETS(catd_global, 1, 1049, "time earlier than its begin time. Do you\n")); - fprintf(stdout, "%s", catgets(catd_global, 1, 1050, + fprintf(stdout, "%s", CATGETS(catd_global, 1, 1050, "want to schedule it into the next day? [Y/N] ")); fgets(ans, sizeof(ans)-1, stdin); fprintf(stdout, "\n"); @@ -314,17 +314,17 @@ cm_tty_delete( Option [1-4]: " */ - fprintf(stdout, catgets(catd, 1, 1051, + fprintf(stdout, CATGETS(catd, 1, 1051, "The appointment '%s' is part of a repeating series. "), appt->what->value->item.string_value); - fprintf(stdout, "%s", catgets(catd, 1, 1052, "Do you want to:")); - fprintf(stdout, "%s", catgets(catd, 1, 1053, + fprintf(stdout, "%s", CATGETS(catd, 1, 1052, "Do you want to:")); + fprintf(stdout, "%s", CATGETS(catd, 1, 1053, "\n\t1. Delete all of them")); - fprintf(stdout, "%s", catgets(catd, 1, 1054, + fprintf(stdout, "%s", CATGETS(catd, 1, 1054, "\n\t2. Delete this one only")); - fprintf(stdout, "%s", catgets(catd, 1, 1055, "\n\t3. Delete forward")); - fprintf(stdout, "%s", catgets(catd, 1, 1056, "\n\t4. Cancel")); - fprintf(stdout, "%s", catgets(catd, 1, 1057, "\n\tOption [1-4]: ")); + fprintf(stdout, "%s", CATGETS(catd, 1, 1055, "\n\t3. Delete forward")); + fprintf(stdout, "%s", CATGETS(catd, 1, 1056, "\n\t4. Cancel")); + fprintf(stdout, "%s", CATGETS(catd, 1, 1057, "\n\tOption [1-4]: ")); fgets(ans, sizeof(ans)-1, stdin); fprintf(stdout, "\n"); } @@ -459,36 +459,36 @@ cm_tty_insert(nl_catd catd, CSA_session_handle target, int version, switch(op) { case INVALID_DATE: - t1 = catgets(catd, 1, 1058, "Invalid Date specified.\n"); + t1 = CATGETS(catd, 1, 1058, "Invalid Date specified.\n"); break; case INVALID_START: - t1 = catgets(catd, 1, 1059, + t1 = CATGETS(catd, 1, 1059, "Invalid Start time specified.\n"); break; case INVALID_TIME: t1 = "Invalid Due time specified.\n"; break; case INVALID_STOP: - t1 = catgets(catd, 1, 1060, + t1 = CATGETS(catd, 1, 1060, "Invalid Stop time specified.\n"); break; case MISSING_DATE: - t1 = catgets(catd, 1, 1061, + t1 = CATGETS(catd, 1, 1061, "Empty or missing Date field.\n"); break; case MISSING_START: - t1 = catgets(catd, 1, 1062, + t1 = CATGETS(catd, 1, 1062, "Empty or missing Start field.\n"); break; case MISSING_TIME: t1 = "Empty or missing Due time field.\n"; break; case MISSING_WHAT: - t1 = catgets(catd, 1, 1063, + t1 = CATGETS(catd, 1, 1063, "Empty or missing What field.\n"); break; case REPEAT_FOR_MISMATCH: - t1 = catgets(catd, 1, 1064, + t1 = CATGETS(catd, 1, 1064, "Repeat and For field mismatch.\n"); break; case VALID_APPT: @@ -497,7 +497,7 @@ cm_tty_insert(nl_catd catd, CSA_session_handle target, int version, break; default: op = CANCEL_APPT; - t1 = catgets(catd, 1, 1065, + t1 = CATGETS(catd, 1, 1065, "Insert appointment was cancelled\n"); break; } @@ -514,7 +514,7 @@ cm_tty_insert(nl_catd catd, CSA_session_handle target, int version, csa_free((CSA_buffer)new_entry); } else { char *msg = strdup(t1); - fprintf(stderr, "%s%s\n", msg, catgets(catd, 1, 1066, + fprintf(stderr, "%s%s\n", msg, CATGETS(catd, 1, 1066, "Appointment was not inserted.")); free(msg); ret_stat = -1; @@ -591,7 +591,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date, tick = now(); else if ((tick = cm_getdate(date, NULL)) < 0) { fprintf(stdout, "\n%s %s\n\n", - catgets(catd, 1, 1067, "Invalid date specified:"), + CATGETS(catd, 1, 1067, "Invalid date specified:"), date); return(0); } @@ -640,7 +640,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date, if (day != last_day) { cm_tty_format_header(p, start_tick, date_str); fprintf(stdout, "\n%s %s:\n", - catgets(catd, 1, 1068, "Appointments for"), + CATGETS(catd, 1, 1068, "Appointments for"), date_str); } last_day = day; @@ -679,7 +679,7 @@ cm_tty_lookup(nl_catd catd, CSA_session_handle target, int version, char *date, if (*list == NULL) { cm_tty_format_header(p, start + 1, date_str); fprintf(stdout, "\n%s %s\n\n", - catgets(catd, 1, 1069, "No Appointments for"), + CATGETS(catd, 1, 1069, "No Appointments for"), date_str); } return a_total; @@ -779,17 +779,17 @@ default_repeat_scope_str( if (!default_repeat_scope_strs[DAILY]) { default_repeat_scope_strs[ONE_TIME] = strdup("\0"); default_repeat_scope_strs[DAILY] = - strdup(catgets(catd, 1, 994, "days")); + strdup(CATGETS(catd, 1, 994, "days")); default_repeat_scope_strs[WEEKLY] = - strdup(catgets(catd, 1, 995, "weeks")); + strdup(CATGETS(catd, 1, 995, "weeks")); default_repeat_scope_strs[EVERY_TWO_WEEKS] = - strdup(catgets(catd, 1, 996, "biweeks")); + strdup(CATGETS(catd, 1, 996, "biweeks")); default_repeat_scope_strs[MONTHLY_BY_DATE] = - strdup(catgets(catd, 1, 997, "months")); + strdup(CATGETS(catd, 1, 997, "months")); default_repeat_scope_strs[MONTHLY_BY_WEEKDAY] = default_repeat_scope_strs[MONTHLY_BY_DATE]; default_repeat_scope_strs[YEARLY] = - strdup(catgets(catd, 1, 998, "years")); + strdup(CATGETS(catd, 1, 998, "years")); default_repeat_scope_strs[MONDAY_THRU_FRIDAY] = default_repeat_scope_strs[WEEKLY]; default_repeat_scope_strs[MON_WED_FRI] = @@ -2316,25 +2316,25 @@ init_repeat_strs( nl_catd catd, char **repeat_strs) { - repeat_strs[ONE_TIME] = strdup(catgets(catd, 1, 852, "One Time")); - repeat_strs[DAILY] = strdup(catgets(catd, 1, 853, "Daily")); - repeat_strs[WEEKLY] = strdup(catgets(catd, 1, 854, "Weekly")); + repeat_strs[ONE_TIME] = strdup(CATGETS(catd, 1, 852, "One Time")); + repeat_strs[DAILY] = strdup(CATGETS(catd, 1, 853, "Daily")); + repeat_strs[WEEKLY] = strdup(CATGETS(catd, 1, 854, "Weekly")); repeat_strs[EVERY_TWO_WEEKS] = - strdup(catgets(catd, 1, 855, "Every Two Weeks")); + strdup(CATGETS(catd, 1, 855, "Every Two Weeks")); repeat_strs[MONTHLY_BY_DATE] = - strdup(catgets(catd, 1, 856, "Monthly By Date")); + strdup(CATGETS(catd, 1, 856, "Monthly By Date")); repeat_strs[MONTHLY_BY_WEEKDAY] = - strdup(catgets(catd, 1, 857, "Monthly By Weekday")); + strdup(CATGETS(catd, 1, 857, "Monthly By Weekday")); repeat_strs[YEARLY] = - strdup(catgets(catd, 1, 858, "Yearly")); + strdup(CATGETS(catd, 1, 858, "Yearly")); repeat_strs[MONDAY_THRU_FRIDAY] = - strdup(catgets(catd, 1, 859, "Monday Thru Friday")); + strdup(CATGETS(catd, 1, 859, "Monday Thru Friday")); repeat_strs[MON_WED_FRI] = - strdup(catgets(catd, 1, 860, "Mon, Wed, Fri")); + strdup(CATGETS(catd, 1, 860, "Mon, Wed, Fri")); repeat_strs[TUESDAY_THURSDAY] = - strdup(catgets(catd, 1, 861, "Tuesday, Thursday")); + strdup(CATGETS(catd, 1, 861, "Tuesday, Thursday")); repeat_strs[REPEAT_EVERY] = - strdup(catgets(catd, 1, 862, "Repeat Every...")); + strdup(CATGETS(catd, 1, 862, "Repeat Every...")); } extern char* @@ -2364,11 +2364,11 @@ repeat_scope_str( { if (!repeat_scope_strs[0]) { repeat_scope_strs[REPEAT_DAYS] = - strdup(catgets(catd, 1, 994, "days")); + strdup(CATGETS(catd, 1, 994, "days")); repeat_scope_strs[REPEAT_WEEKS] = - strdup(catgets(catd, 1, 995, "weeks")); + strdup(CATGETS(catd, 1, 995, "weeks")); repeat_scope_strs[REPEAT_MONTHS] = - strdup(catgets(catd, 1, 997, "months")); + strdup(CATGETS(catd, 1, 997, "months")); } if (op >= REPEAT_DAYS && op <= REPEAT_MONTHS) @@ -2406,11 +2406,11 @@ time_scope_str_i18n( { if (!time_scope_strs_i18n[0]) { time_scope_strs_i18n[TIME_MINS] = - strdup(catgets(catd, 1, 877, "Mins")); + strdup(CATGETS(catd, 1, 877, "Mins")); time_scope_strs_i18n[TIME_HRS] = - strdup(catgets(catd, 1, 878, "Hrs")); + strdup(CATGETS(catd, 1, 878, "Hrs")); time_scope_strs_i18n[TIME_DAYS] = - strdup(catgets(catd, 1, 879, "Days")); + strdup(CATGETS(catd, 1, 879, "Days")); } if (op >= TIME_MINS && op <= TIME_DAYS) @@ -2655,7 +2655,7 @@ validate_rfp( If it is a CSA_X_DT_REPEAT_ONETIME then f_buf == ``0''. */ - if (strcasecmp(f_buf, catgets(catd, 1, 876, "forever")) == 0) { + if (strcasecmp(f_buf, CATGETS(catd, 1, 876, "forever")) == 0) { repeat_times = CSA_X_DT_DT_REPEAT_FOREVER; repeat_forever = True; } else { diff --git a/cde/programs/dtcm/libDtCmP/cm_tty.h b/cde/programs/dtcm/libDtCmP/cm_tty.h index 7b9f20059..449e7d565 100644 --- a/cde/programs/dtcm/libDtCmP/cm_tty.h +++ b/cde/programs/dtcm/libDtCmP/cm_tty.h @@ -53,7 +53,7 @@ #define CM_TTY_H #include -#include +#include
#include "timeops.h" #include "util.h" #include "props.h" diff --git a/cde/programs/dtcm/libDtCmP/props.c b/cde/programs/dtcm/libDtCmP/props.c index 18ddbe940..a976a6a98 100644 --- a/cde/programs/dtcm/libDtCmP/props.c +++ b/cde/programs/dtcm/libDtCmP/props.c @@ -53,7 +53,7 @@ static char sccsid[] = "@(#)props.c 1.13 94/11/07 Copyr 1991 Sun Microsystems, I #include #include -#include +#include
#include #include #include @@ -339,15 +339,15 @@ init_props(void) is_inited = 1; - libdtcm_catd = catopen(LIBDTCM_CAT, NL_CAT_LOCALE); + libdtcm_catd = CATOPEN(LIBDTCM_CAT, NL_CAT_LOCALE); if ((nl_catd) -1 == libdtcm_catd) return; dflt = def_props[CP_DATEORDERING]; - str = catgets(libdtcm_catd, 1, 1, dflt); + str = CATGETS(libdtcm_catd, 1, 1, dflt); def_props[CP_DATEORDERING] = strdup(str); dflt = def_props[CP_DEFAULTDISP]; - str = catgets(libdtcm_catd, 1, 2, dflt); + str = CATGETS(libdtcm_catd, 1, 2, dflt); def_props[CP_DEFAULTDISP] = strdup(str); } diff --git a/cde/programs/dtcreate/dtcreate.h b/cde/programs/dtcreate/dtcreate.h index f4f65f0d3..b36732f2d 100644 --- a/cde/programs/dtcreate/dtcreate.h +++ b/cde/programs/dtcreate/dtcreate.h @@ -33,7 +33,7 @@ #define __TOOLTALK #include -#include +#include
#include /***************************************************************************/ @@ -190,7 +190,7 @@ typedef struct { /* Macro Declarations */ /* */ /***************************************************************************/ -#define GETMESSAGE(set, number, defstr) catgets(nlmsg_fd, set, number, defstr) +#define GETMESSAGE(set, number, defstr) CATGETS(nlmsg_fd, set, number, defstr) /***************************************************************************/ /* */ diff --git a/cde/programs/dtcreate/main.c b/cde/programs/dtcreate/main.c index 0b223cf62..5dd83254b 100644 --- a/cde/programs/dtcreate/main.c +++ b/cde/programs/dtcreate/main.c @@ -1386,7 +1386,7 @@ main(int argc, char *argv[]) for (i=1; i] [-?]")); exit(0); @@ -1412,7 +1412,7 @@ main(int argc, char *argv[]) UxTopLevel = XtAppInitialize(&UxAppContext, CLASS_NAME, NULL, 0, &argc, argv, NULL, NULL, 0); - nlmsg_fd = catopen("dtcreate", NL_CAT_LOCALE); + nlmsg_fd = CATOPEN("dtcreate", NL_CAT_LOCALE); UxDisplay = XtDisplay(UxTopLevel); UxScreen = XDefaultScreen(UxDisplay); diff --git a/cde/programs/dtdspmsg/Imakefile b/cde/programs/dtdspmsg/Imakefile index d44266410..4aab31fd7 100644 --- a/cde/programs/dtdspmsg/Imakefile +++ b/cde/programs/dtdspmsg/Imakefile @@ -1,5 +1,6 @@ XCOMM $XConsortium: Imakefile /main/8 1996/10/09 14:04:16 drk $ +DEFINES = -DNO_XLIB SYS_LIBRARIES = -lm $(DYNLIBSYSLIB) $(REGEXSYSLIB) #ifdef HPArchitecture @@ -9,6 +10,7 @@ EXTRA_DEFINES = +e PROGRAMS=dtdspmsg SRCS = dtdspmsg.c -OBJS = dtdspmsg.o +OBJS = dtdspmsg.o MsgCat.o ComplexProgramTarget($(PROGRAMS)) +LinkSourceFile(MsgCat.c,$(DTSVCSRC)/DtUtil2) diff --git a/cde/programs/dtdspmsg/dtdspmsg.c b/cde/programs/dtdspmsg/dtdspmsg.c index 757602a30..00750525f 100644 --- a/cde/programs/dtdspmsg/dtdspmsg.c +++ b/cde/programs/dtdspmsg/dtdspmsg.c @@ -58,6 +58,7 @@ #include #include #include +#include
#include "msgfac_msg.h" #define die(s) puts(s), exit(1) @@ -82,8 +83,6 @@ void parse_args(int argc, char *argv[], struct arguments *args); nl_catd catderr; /* error message catalog descriptor */ - - /* * NAME: main * @@ -112,9 +111,9 @@ int main(int argc,char *argv[]) int n; /* # bytes in a character */ setlocale (LC_ALL,""); - catderr = catopen(MF_MSGFAC, 0); + catderr = CATOPEN(MF_MSGFAC, 0); if (argc < 3) { - die(catgets(catderr,MS_DSPMSG,M_DSPMSG, "Usage: dtdspmsg [-s setno] ['default' arg ... ]")); + die(CATGETS(catderr,MS_DSPMSG,M_DSPMSG, "Usage: dtdspmsg [-s setno] ['default' arg ... ]")); } /*______________________________________________________________________ @@ -127,8 +126,8 @@ int main(int argc,char *argv[]) get the message out of the catalog. ______________________________________________________________________*/ - catdmsg = catopen(args.catname, 0); - message = catgets(catdmsg,args.set,args.msg,args.def); + catdmsg = CATOPEN(args.catname, 0); + message = CATGETS(catdmsg,args.set,args.msg,args.def); /*______________________________________________________________________ @@ -230,26 +229,26 @@ int main(int argc,char *argv[]) /* do not allow mixing of reorder types */ if (reorder == FALSE) { - die(catgets(catderr,MS_DSPMSG,M_REORDER,"\nNone or all arguments must use %n$ format")); + die(CATGETS(catderr,MS_DSPMSG,M_REORDER,"\nNone or all arguments must use %n$ format")); } for (idx = 0 ; isanumber(*p) ; p++) idx += idx * 10 + toanumber(*p); idx--; if (*p++ != '$') { - die(catgets(catderr,MS_DSPMSG,M_INVRE,"\n% missing from %n$ format")); + die(CATGETS(catderr,MS_DSPMSG,M_INVRE,"\n% missing from %n$ format")); } reorder = TRUE; } else { /* do not allow mixing of reorder types */ if (reorder == TRUE) { - die(catgets(catderr,MS_DSPMSG,M_REORDER,"\nNone or all arguments must use %n$ format")); + die(CATGETS(catderr,MS_DSPMSG,M_REORDER,"\nNone or all arguments must use %n$ format")); } reorder = FALSE; } /* report invalid printf argument number */ if (idx < 0 || idx >= args.argmax) { - die(catgets(catderr,MS_DSPMSG,M_REINDEX,"\nInvalid argument index")); + die(CATGETS(catderr,MS_DSPMSG,M_REINDEX,"\nInvalid argument index")); } /* report unsupported % type */ if (*p == 's') @@ -306,7 +305,7 @@ void parse_args(int argc, char *argv[], struct arguments *args) argc--; /* Skip the program name */ if (!strcmp(*argv,"-s")) { /* check for a set number */ if (argc < 4) /* check for sufficient arguments */ - die(catgets(catderr,MS_DSPMSG,M_DSPMSG, "Usage: dtdspmsg [-s setno] ['default' arg ... ]")); + die(CATGETS(catderr,MS_DSPMSG,M_DSPMSG, "Usage: dtdspmsg [-s setno] ['default' arg ... ]")); argv++; argc--; /* skip past the '-s' */ sscanf(*argv,"%d",&args->set); /* get the real set number */ @@ -317,7 +316,7 @@ void parse_args(int argc, char *argv[], struct arguments *args) argc--; if (!strcmp(*argv,"-s")) { /* check for a set number */ if (argc < 3) /* check for sufficient arguments */ - die(catgets(catderr,MS_DSPMSG,M_DSPMSG, "Usage: dtdspmsg [-s setno] ['default' arg ... ]")); + die(CATGETS(catderr,MS_DSPMSG,M_DSPMSG, "Usage: dtdspmsg [-s setno] ['default' arg ... ]")); argv++; argc--; /* skip past the '-s' */ diff --git a/cde/programs/dtdspmsg/msgfac_msg.h b/cde/programs/dtdspmsg/msgfac_msg.h index 5434b76b1..e0001f056 100644 --- a/cde/programs/dtdspmsg/msgfac_msg.h +++ b/cde/programs/dtdspmsg/msgfac_msg.h @@ -30,8 +30,6 @@ #ifndef _H_MSGFAC_MSG #define _H_MSGFAC_MSG -#include -#include #define MF_MSGFAC "msgfac.cat" diff --git a/cde/programs/dtexec/Imakefile b/cde/programs/dtexec/Imakefile index a5528a59d..50bf2306c 100644 --- a/cde/programs/dtexec/Imakefile +++ b/cde/programs/dtexec/Imakefile @@ -6,11 +6,12 @@ DEPEND_DEFINES = $(DEPENDDEFINES) DEFINES = -DMSGLOG_CLIENT_ONLY INCLUDES = -I. $(TIRPCINC) -SRCS = DtGetMessage.c Main.c MsgLog.c -OBJS = DtGetMessage.o Main.o MsgLog.o +SRCS = DtGetMessage.c Main.c MsgCat.c MsgLog.c +OBJS = DtGetMessage.o Main.o MsgCat.o MsgLog.o ComplexProgramTarget(dtexec) LinkSourceFile(DtSvcLock.h,$(DTSVCSRC)/include) +LinkSourceFile(MsgCat.c,$(DTSVCSRC)/DtUtil2) LinkSourceFile(MsgLog.c,$(DTSVCSRC)/DtUtil2) LinkSourceFile(DtGetMessage.c,$(DTSVCSRC)/DtUtil2) diff --git a/cde/programs/dtfile/HelpCB.c b/cde/programs/dtfile/HelpCB.c index 1e3965197..047f709a3 100644 --- a/cde/programs/dtfile/HelpCB.c +++ b/cde/programs/dtfile/HelpCB.c @@ -58,7 +58,7 @@ #include #include #include -#include +#include
#include #include diff --git a/cde/programs/dtfile/Main.c b/cde/programs/dtfile/Main.c index 4943a5f65..cbfa4a413 100644 --- a/cde/programs/dtfile/Main.c +++ b/cde/programs/dtfile/Main.c @@ -125,10 +125,6 @@ #include #include -#ifndef sun /* don't need the nl_types.h file */ -#include -#endif /* !sun */ - #include #include @@ -165,6 +161,7 @@ #include
#include
#include
+#include
#include
#include
#include
diff --git a/cde/programs/dtfile/SharedMsgs.c b/cde/programs/dtfile/SharedMsgs.c index 888b8ded3..5b9ff071b 100644 --- a/cde/programs/dtfile/SharedMsgs.c +++ b/cde/programs/dtfile/SharedMsgs.c @@ -52,9 +52,7 @@ #include #include #include -#ifndef sun /* don't need the nl_types.h file */ -#include -#endif /* ! sun */ +#include
#include diff --git a/cde/programs/dthello/Imakefile b/cde/programs/dthello/Imakefile index 868d3209a..03ae89ce7 100644 --- a/cde/programs/dthello/Imakefile +++ b/cde/programs/dthello/Imakefile @@ -17,9 +17,10 @@ SYS_LIBRARIES = -lm -ldl -lgen SRCS1 = dthello.c SRCS = $(SRCS1) OBJS = dthello.o \ - $(CDELIBSRC)/DtSvc/DtUtil2/EnvControl.o \ $(CDELIBSRC)/DtSvc/DtUtil2/DtNlUtils.o \ - $(CDELIBSRC)/DtSvc/DtUtil2/GetDispRes.o + $(CDELIBSRC)/DtSvc/DtUtil2/EnvControl.o \ + $(CDELIBSRC)/DtSvc/DtUtil2/GetDispRes.o \ + $(CDELIBSRC)/DtSvc/DtUtil2/MsgCat.o ComplexProgramTarget(dthello) diff --git a/cde/programs/dthello/dthello.c b/cde/programs/dthello/dthello.c index 7789e7219..41fe82d97 100644 --- a/cde/programs/dthello/dthello.c +++ b/cde/programs/dthello/dthello.c @@ -76,7 +76,7 @@ #include #include #ifndef NO_MESSAGE_CATALOG -# include +# include
#endif #include
@@ -1147,30 +1147,15 @@ GetMessage( int n, char *s ) { - char *msg; - char *lang; - nl_catd catopen(); - char *catgets(); static int first = 1; - static nl_catd nlmsg_fd; - if ( first ) + static nl_catd nlmsg_fd = (nl_catd) -1; + + if ( first ) { first = 0; - - lang = (char *) getenv ("LANG"); - - if (!lang || !(strcmp (lang, "C"))) - /* - * If LANG is not set or if LANG=C, then there - * is no need to open the message catalog - just - * return the built-in string "s". - */ - nlmsg_fd = (nl_catd)-1; - else - nlmsg_fd = catopen("dthello", NL_CAT_LOCALE); + nlmsg_fd = CATOPEN("dthello", NL_CAT_LOCALE); } - msg=catgets(nlmsg_fd,set,n,s); - return (msg); + return CATGETS(nlmsg_fd, set, n, s); } #endif diff --git a/cde/programs/dthelp/dthelpgen/helpgen.c b/cde/programs/dthelp/dthelpgen/helpgen.c index 882369abb..50ae1de20 100644 --- a/cde/programs/dthelp/dthelpgen/helpgen.c +++ b/cde/programs/dthelp/dthelpgen/helpgen.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include
#include #include #include @@ -226,9 +226,9 @@ GetMessage ( */ nlmsg_fd = (nl_catd) -1; else - nlmsg_fd = catopen(catFileName, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(catFileName, NL_CAT_LOCALE); } - msg=catgets(nlmsg_fd,set,n,s); + msg=CATGETS(nlmsg_fd,set,n,s); return (msg); } diff --git a/cde/programs/dthelp/dthelpprint/HelpPrintI.h b/cde/programs/dthelp/dthelpprint/HelpPrintI.h index 86a8c9b9b..2e3c5fa22 100644 --- a/cde/programs/dthelp/dthelpprint/HelpPrintI.h +++ b/cde/programs/dthelp/dthelpprint/HelpPrintI.h @@ -423,7 +423,7 @@ void _DtHPrGetPrOffsetArg( char * _DtHPrGetMessage( int set, int n, - char *s); + const char *s); #endif /* DTHELPRPINTP_H */ diff --git a/cde/programs/dthelp/dthelpprint/PrintUtil.c b/cde/programs/dthelp/dthelpprint/PrintUtil.c index cc9ea1511..28deb8efb 100644 --- a/cde/programs/dthelp/dthelpprint/PrintUtil.c +++ b/cde/programs/dthelp/dthelpprint/PrintUtil.c @@ -40,7 +40,7 @@ $COPYRIGHT$: #include #include #include -#include /* for message cat processing */ +#include
/* for message cat processing */ #if defined(sun) #include #else @@ -245,14 +245,10 @@ $ARGS$: char * _DtHPrGetMessage( int set, int n, - char *s) + const char *s) { /*$CODE$*/ - char *msg; - char *lang; - nl_catd catopen(); - char *catgets(); static int s_First = 1; - static nl_catd s_Nlmsg_fd; + static nl_catd s_Nlmsg_fd = (nl_catd) -1; static char * s_CatFileName = NULL; if ( s_First ) @@ -264,23 +260,9 @@ char * _DtHPrGetMessage( s_CatFileName = strdup(HELPPRINT_CAT); } s_First = 0; - - lang = (char *) getenv ("LANG"); - - /* If LANG is not set or if LANG=C, then there - * is no need to open the message catalog - just - * return the built-in string "s". */ - if (!lang || !(strcmp (lang, "C"))) - s_Nlmsg_fd = (nl_catd) -1; - else - s_Nlmsg_fd = catopen(s_CatFileName, 0); + s_Nlmsg_fd = CATOPEN(s_CatFileName, 0); } /* end of first-time processing */ - msg = catgets(s_Nlmsg_fd,set,n,s); - return (msg); - + return CATGETS(s_Nlmsg_fd, set, n, s); } #endif /* NO_MESSAGE_CATALOG */ - - - diff --git a/cde/programs/dtimsstart/main.c b/cde/programs/dtimsstart/main.c index 12bb4d2c6..834a5c076 100644 --- a/cde/programs/dtimsstart/main.c +++ b/cde/programs/dtimsstart/main.c @@ -32,26 +32,18 @@ * (c) Copyright 1996 Hitachi. */ -#ifndef lint -static char *RCS_ID = "@(#)dtimsstart $Revision: /main/10 $ $Date: 1996/10/28 12:41:03 $"; -#endif - char *ProgramRevision = "dtimsstart $Revision: /main/10 $"; #define _EXTERN_DEFINE_ #include "xims.h" #undef _EXTERN_DEFINE_ -#include -#include +#include +#include +#include
-#ifndef NLS -#define catgets(i, sn,mn,s) (s) -#else #define NL_SETN 1 /* set number */ -#include static nl_catd catd = (nl_catd) -1; -#endif /* NLS */ extern char *find_system_locale_name(char *); @@ -616,7 +608,7 @@ static void show_select_mode(int mode) { char *valp; - printf("%s: \t", (catgets(catd,NL_SETN,20, "SelectMode"))); + printf("%s: \t", (CATGETS(catd,NL_SETN,20, "SelectMode"))); switch (mode) { default: @@ -624,10 +616,10 @@ static void show_select_mode(int mode) case SEL_MODE_NONE: valp = ""; /* break; */ #endif case SEL_MODE_NOAUTO: - valp = (catgets(catd,NL_SETN,21, "ask_at_login")); + valp = (CATGETS(catd,NL_SETN,21, "ask_at_login")); break; case SEL_MODE_AUTO: - valp = (catgets(catd,NL_SETN,22, "resume_current_input_method")); + valp = (CATGETS(catd,NL_SETN,22, "resume_current_input_method")); break; #ifdef SelectMode_ONCE case SEL_MODE_ONCE: @@ -705,14 +697,10 @@ static int set_locale_env(char *locale) putenv(XtNewString(buf)); } -#ifdef NLS - if (catd != (nl_catd) -1) (void) catclose(catd); - catd = (nl_catd) -1; (void) catclose(catd); - + (void)CATCLOSE(catd); if (Verbose > 0) { - catd = catopen(DTIMS_PROGNAME, 0); + catd = CATOPEN(DTIMS_PROGNAME, 0); } -#endif /* NLS */ return NoError; } @@ -1107,32 +1095,32 @@ static void usage(int force) if (!force && Verbose <= 0) return; - fprintf(LogFp, (catgets(catd,NL_SETN,1, "usage: %s [options ..]")), + fprintf(LogFp, (CATGETS(catd,NL_SETN,1, "usage: %s [options ..]")), ProgramName); putc('\n', LogFp); if (OpMode != MODE_MODE) { fprintf(LogFp, fmt, - "-env", (catgets(catd,NL_SETN,2, "print modified environment variables"))); + "-env", (CATGETS(catd,NL_SETN,2, "print modified environment variables"))); fprintf(LogFp, fmt, - "-shell ", (catgets(catd,NL_SETN,3, "override $SHELL"))); + "-shell ", (CATGETS(catd,NL_SETN,3, "override $SHELL"))); fprintf(LogFp, fmt, - "-ims ", (catgets(catd,NL_SETN,4, "specifies input method name"))); + "-ims ", (CATGETS(catd,NL_SETN,4, "specifies input method name"))); fprintf(LogFp, fmt, - "-imsopt ", (catgets(catd,NL_SETN,5, "specifies command options for input method server"))); + "-imsopt ", (CATGETS(catd,NL_SETN,5, "specifies command options for input method server"))); fprintf(LogFp, fmt, - "-host ", (catgets(catd,NL_SETN,6, "specifies host where input method server should be run"))); + "-host ", (CATGETS(catd,NL_SETN,6, "specifies host where input method server should be run"))); fprintf(LogFp, fmt, - "-mode", (catgets(catd,NL_SETN,7, "change input method selection mode"))); + "-mode", (CATGETS(catd,NL_SETN,7, "change input method selection mode"))); fprintf(LogFp, fmt, - "-list", (catgets(catd,NL_SETN,8, "print registered input method"))); + "-list", (CATGETS(catd,NL_SETN,8, "print registered input method"))); fprintf(LogFp, fmt, - "-help", (catgets(catd,NL_SETN,9, "show this message"))); + "-help", (CATGETS(catd,NL_SETN,9, "show this message"))); } else { fprintf(LogFp, fmt, - "-auto", (catgets(catd,NL_SETN,23, "force 'resume_current_input_method' mode"))); + "-auto", (CATGETS(catd,NL_SETN,23, "force 'resume_current_input_method' mode"))); fprintf(LogFp, fmt, - "-noauto", (catgets(catd,NL_SETN,24, "force 'ask_at_login' mode"))); + "-noauto", (CATGETS(catd,NL_SETN,24, "force 'ask_at_login' mode"))); } #ifdef DEBUG @@ -1159,86 +1147,86 @@ char *xims_errmsg(int err_num, void *arg1, void *arg2, void *arg3) case NoError: break; case ErrSyntax: /* arg1: option string */ - fmt = (catgets(catd,NL_SETN,31, "invalid option '%s'")); + fmt = (CATGETS(catd,NL_SETN,31, "invalid option '%s'")); break; case ErrNoHome: - fmt = (catgets(catd,NL_SETN,32, "environment variable 'HOME' not defined")); + fmt = (CATGETS(catd,NL_SETN,32, "environment variable 'HOME' not defined")); break; case ErrNoLocale: - fmt = (catgets(catd,NL_SETN,33, "environment variable 'LANG' not defined")); + fmt = (CATGETS(catd,NL_SETN,33, "environment variable 'LANG' not defined")); break; case ErrNoCDELocale: - fmt = (catgets(catd,NL_SETN,34, "this locale is not supported by the desktop.")); + fmt = (CATGETS(catd,NL_SETN,34, "this locale is not supported by the desktop.")); break; case ErrNoDisplay: - fmt = (catgets(catd,NL_SETN,35, "environment variable 'DISPLAY' not defined")); + fmt = (CATGETS(catd,NL_SETN,35, "environment variable 'DISPLAY' not defined")); break; case ErrFileOpen: /* arg1: file name */ - fmt = (catgets(catd,NL_SETN,36, "cannot open file\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,36, "cannot open file\n [%s]")); setErrArg1(errFilePath); break; case ErrFileCreate: /* arg1: file name */ - fmt = (catgets(catd,NL_SETN,37, "cannot create file\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,37, "cannot create file\n [%s]")); setErrArg1(errFilePath); break; case ErrDirCreate: /* arg1: dir name */ - fmt = (catgets(catd,NL_SETN,38, "cannot create directory\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,38, "cannot create directory\n [%s]")); setErrArg1(errFilePath); break; case ErrMissEntry: /* arg1: entry name, arg2: file name */ - fmt = (catgets(catd,NL_SETN,39, "missing '%s' entry in configuration file\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,39, "missing '%s' entry in configuration file\n [%s]")); setErrArg2(errFilePath); break; case ErrAnotherProg: - fmt = (catgets(catd,NL_SETN,40, "another '%s' is already running")); + fmt = (CATGETS(catd,NL_SETN,40, "another '%s' is already running")); setErrArg1(ProgramName); break; case ErrNoSelectionFile: /* arg1: locale name */ - fmt = (catgets(catd,NL_SETN,41, "no selection file for '%s'")); + fmt = (CATGETS(catd,NL_SETN,41, "no selection file for '%s'")); setErrArg1(userEnv.locale); break; case ErrSaveSelection: /* arg1: file name */ - fmt = (catgets(catd,NL_SETN,42, "cannot create selection file\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,42, "cannot create selection file\n [%s]")); setErrArg1(errFilePath); break; case ErrNoSelection: /* arg1: locale name */ - fmt = (catgets(catd,NL_SETN,43, "no ims selected for '%s'")); + fmt = (CATGETS(catd,NL_SETN,43, "no ims selected for '%s'")); setErrArg1(userEnv.locale); break; case ErrNoLocaleConf: /* arg1: file name */ - fmt = (catgets(catd,NL_SETN,44, "no locale configuration file for '%s'")); + fmt = (CATGETS(catd,NL_SETN,44, "no locale configuration file for '%s'")); setErrArg1(userEnv.locale); break; case ErrNoImsEntry: /* arg1: locale name */ - fmt = (catgets(catd,NL_SETN,45, "no ims configured for '%s'")); + fmt = (CATGETS(catd,NL_SETN,45, "no ims configured for '%s'")); setErrArg1(userEnv.locale); break; case ErrNoImsConf: /* arg1: ims name */ - fmt = (catgets(catd,NL_SETN,46, "no ims configuration file for '%s'")); + fmt = (CATGETS(catd,NL_SETN,46, "no ims configuration file for '%s'")); setErrArg1(userSel.name); break; case ErrNotRegistered: /* arg1: ims name */ - fmt = (catgets(catd,NL_SETN,47, "ims '%s' not registered")); + fmt = (CATGETS(catd,NL_SETN,47, "ims '%s' not registered")); setErrArg1(userSel.name); break; case ErrNoExecutable: /* arg1: ims name, arg2: file name */ - fmt = (catgets(catd,NL_SETN,48, "no executable file for '%s'\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,48, "no executable file for '%s'\n [%s]")); setErrArg1(userSel.name); setErrArg2(userSel.ent->ims->cmd_path); break; case ErrImsRunning: /* arg1: ims name */ - fmt = (catgets(catd,NL_SETN,49, "ims '%s' is already running")); + fmt = (CATGETS(catd,NL_SETN,49, "ims '%s' is already running")); setErrArg1(userSel.name); break; case ErrImsExecution: /* arg1: ims name */ - fmt = (catgets(catd,NL_SETN,50, "cannot execute ims '%s'")); + fmt = (CATGETS(catd,NL_SETN,50, "cannot execute ims '%s'")); setErrArg1(userSel.name); break; case ErrImsAborted: /* arg1: ims name, arg2: log file */ - fmt = (catgets(catd,NL_SETN,51, "ims '%s' aborted. See log file.\n [%s]")); + fmt = (CATGETS(catd,NL_SETN,51, "ims '%s' aborted. See log file.\n [%s]")); setErrArg1(userSel.name); if (userSel.host_type == HOST_REMOTE) setErrArg2(errFilePath); @@ -1246,38 +1234,38 @@ char *xims_errmsg(int err_num, void *arg1, void *arg2, void *arg3) setErrArg2(Opt.LogPath); break; case ErrImsTimeout: /* arg1: file name */ - fmt = (catgets(catd,NL_SETN,52, "ims '%s' is not available yet")); + fmt = (CATGETS(catd,NL_SETN,52, "ims '%s' is not available yet")); setErrArg1(userSel.name); break; case ErrUnknownHost: /* arg1: host name */ - fmt = (catgets(catd,NL_SETN,53, "unknown host '%s'")); + fmt = (CATGETS(catd,NL_SETN,53, "unknown host '%s'")); setErrArg1(userSel.hostname); break; case ErrRemoteAction: /* arg1: action name */ - fmt = (catgets(catd,NL_SETN,54, "action '%s' failed")); + fmt = (CATGETS(catd,NL_SETN,54, "action '%s' failed")); setErrArg1(errFuncName); break; case ErrRemoteData: /* arg1: host name */ - fmt = (catgets(catd,NL_SETN,55, "remote execution failed on '%s'")); + fmt = (CATGETS(catd,NL_SETN,55, "remote execution failed on '%s'")); setErrArg1(userSel.hostname); break; case ErrNoImsstart: /* arg1: host name */ - fmt = (catgets(catd,NL_SETN,56, "remote functionality is not available on '%s'")); + fmt = (CATGETS(catd,NL_SETN,56, "remote functionality is not available on '%s'")); setErrArg1(userSel.hostname); break; case ErrRemoteNoIms: /* arg1: host name */ - fmt = (catgets(catd,NL_SETN,57, "no ims registered on '%s'")); + fmt = (CATGETS(catd,NL_SETN,57, "no ims registered on '%s'")); setErrArg1(userSel.hostname); break; case ErrRemoteMissIms: /* arg1: ims name, arg2: host name */ - fmt = (catgets(catd,NL_SETN,58, "ims '%1$s' not registered on '%2$s'")); + fmt = (CATGETS(catd,NL_SETN,58, "ims '%1$s' not registered on '%2$s'")); setErrArg1(userSel.name); setErrArg2(userSel.hostname); break; case ErrOpenDpy: /* arg1: display name */ - fmt = (catgets(catd,NL_SETN,59, "cannot open display '%s'")); + fmt = (CATGETS(catd,NL_SETN,59, "cannot open display '%s'")); setErrArg1(userEnv.displayname); break; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C index f3ae52a1a..60ad2291a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C @@ -54,14 +54,14 @@ CatMgr::CatMgr() : f_msg(NULL), f_default(NULL) cerr << "(WARNING) NLSPATH not specified" << '\n' << flush; #endif - f_catd = catopen(CATALOG_PREFIX, NL_CAT_LOCALE); + f_catd = CATOPEN(CATALOG_PREFIX, NL_CAT_LOCALE); // setup default message if (is_open(f_catd)) { #ifdef DEBUG cerr << "(DEBUG) catopen succeeded." << '\n' << flush; #endif - char* msg = ::catgets(f_catd, Set_CatMgr, DEFAULT_MSG, + char* msg = ::CATGETS(f_catd, Set_CatMgr, DEFAULT_MSG, "default message not found."); len = strlen(msg); f_default = new char[len + 1]; @@ -94,7 +94,7 @@ CatMgr::~CatMgr() delete[] f_default; if (is_open(f_catd)) { - int status = catclose(f_catd); + int status = CATCLOSE(f_catd); if (status < 0) { #ifdef DEBUG cerr << "(ERROR) catclose failed." << '\n' << flush; @@ -127,9 +127,9 @@ CatMgr::catgets(int set_num, int msg_num, const char* def) if (is_open(f_catd)) { char* msg; if (def) - msg = ::catgets(f_catd, set_num, msg_num, def); + msg = ::CATGETS(f_catd, set_num, msg_num, def); else - msg = ::catgets(f_catd, set_num, msg_num, f_default); + msg = ::CATGETS(f_catd, set_num, msg_num, f_default); int msglen = strlen(msg); len = msglen; f_msg = new char[msglen + 1]; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh index 908d27ef7..f3b98a866 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh @@ -27,7 +27,7 @@ #ifndef __CATMGR_HH__ #define __CATMGR_HH__ -#include +#include
#include "Registration.hh" diff --git a/cde/programs/dtlogin/Imakefile b/cde/programs/dtlogin/Imakefile index 120add7e0..6725b7286 100644 --- a/cde/programs/dtlogin/Imakefile +++ b/cde/programs/dtlogin/Imakefile @@ -166,7 +166,8 @@ INCLUDES = -I$(XPROJECTROOT)/include/freetype2 dpylist.o error.o file.o mitauth.o protodpy.o policy.o \ reset.o resource.o server.o session.o socket.o util.o \ verify.o sysauth.o fontpath.o $(DESOBJS) qualify.o choose.o \ - netaddr.o xdmcp.o $(PAM_OBJS) $(SOLARIS_OBJS) + netaddr.o xdmcp.o $(PAM_OBJS) $(SOLARIS_OBJS) \ + $(CDELIBSRC)/DtSvc/DtUtil2/MsgCat.o PROG2 = dtgreet #ifdef AlphaArchitecture diff --git a/cde/programs/dtlogin/chooser.c b/cde/programs/dtlogin/chooser.c index dd034dc15..6401bc76a 100644 --- a/cde/programs/dtlogin/chooser.c +++ b/cde/programs/dtlogin/chooser.c @@ -100,10 +100,6 @@ in this Software without prior written authorization from the X Consortium. #include #include #include -#include -#ifndef NL_CAT_LOCALE -#define NL_CAT_LOCALE 0 -#endif #ifdef SVR4 #include diff --git a/cde/programs/dtlogin/util.c b/cde/programs/dtlogin/util.c index 60a54e983..c5d6b30d3 100644 --- a/cde/programs/dtlogin/util.c +++ b/cde/programs/dtlogin/util.c @@ -58,7 +58,7 @@ #include #include #include -#include +#include
# include @@ -112,7 +112,6 @@ unsigned char * ReadCatalog( int set_num, int msg_num, char *def_str ) { static Bool alreadyopen = False; - char *s; if (alreadyopen == False) { @@ -174,12 +173,10 @@ ReadCatalog( int set_num, int msg_num, char *def_str ) * msg catalog could not be opened), subsequent call to catgets() using * that descriptor will return 'def_str'. */ - nl_fd = catopen("dtlogin", NL_CAT_LOCALE); + nl_fd = CATOPEN("dtlogin", NL_CAT_LOCALE); } - s = catgets(nl_fd,set_num,msg_num,def_str); - - return((unsigned char *)s); + return ((unsigned char *) CATGETS(nl_fd, set_num, msg_num, def_str)); } void diff --git a/cde/programs/dtlogin/vgutil.c b/cde/programs/dtlogin/vgutil.c index d7f23da69..c158c4f3e 100644 --- a/cde/programs/dtlogin/vgutil.c +++ b/cde/programs/dtlogin/vgutil.c @@ -54,7 +54,6 @@ * ***************************************************************************/ -#include #include #include #include @@ -64,6 +63,7 @@ #include #include +#include
#include "vg.h" #include "vgmsg.h" @@ -734,7 +734,7 @@ LogError( unsigned char *fmt, ...) void CloseCatalog(void) { - catclose(nl_fd); + CATCLOSE(nl_fd); } /*************************************************************************** @@ -773,7 +773,7 @@ OpenCatalog(void) */ if (NULL != langenv) { - nl_fd = catopen(NLS_CATALOG, NL_CAT_LOCALE); + nl_fd = CATOPEN(NLS_CATALOG, NL_CAT_LOCALE); if (0 > (long) nl_fd) LogError((unsigned char*) MC_DEF_LOG_NO_MSGCAT, langenv); } @@ -794,7 +794,7 @@ ReadCatalog(int setn, int msgn, char *dflt) if ((0 > (long) nl_fd) || (NULL == langenv)) return (unsigned char*) dflt; else - return (unsigned char*) catgets(nl_fd, setn, msgn, dflt); + return (unsigned char*) CATGETS(nl_fd, setn, msgn, dflt); } /*************************************************************************** @@ -1127,48 +1127,3 @@ ToPixel( Widget w, int orientation, int pixel ) XmPIXELS)); } } - - - -#if 0 -/*************************************************************************** - * - * _DtMessage Catalog Stubs - * - * These stub routines can be used for porting to systems that do not yet - * support message catalogs. Replace the above "0" with an appropriate - * define for your target system. Do the same for the external defines - * in "vg.h". - ***************************************************************************/ - -nl_catd -catopen(name, oflag) - char *name; - int oflag; - -{ - return (555); -} - - -int -catclose(catd) - nl_catd catd; - -{ - return; -} - - -char * -catgets(catd, set_num, msg_num, def_str) - nl_catd catd; - int set_num; - int msg_num; - char *def_str; - -{ - return (def_str); -} - -#endif diff --git a/cde/programs/dtlogin/xdm_msg.h b/cde/programs/dtlogin/xdm_msg.h index e417768d6..93d26714c 100644 --- a/cde/programs/dtlogin/xdm_msg.h +++ b/cde/programs/dtlogin/xdm_msg.h @@ -30,7 +30,6 @@ #ifndef _H_XDM_MSG #define _H_XDM_MSG #include -#include #define MF_XDM "xdm.cat" diff --git a/cde/programs/dtmail/MotifApp/Application.C b/cde/programs/dtmail/MotifApp/Application.C index 604a77962..b1bc02814 100644 --- a/cde/programs/dtmail/MotifApp/Application.C +++ b/cde/programs/dtmail/MotifApp/Application.C @@ -70,7 +70,7 @@ #include #include #include -#include +#include
#include #include "EUSDebug.hh" @@ -98,34 +98,6 @@ Application::_appResources[] = { #define NL_CAT_LOCALE 0 #endif -#ifdef hpV4 -/* - * Wrapper around catgets -- this makes sure the message string is saved - * in a safe location; so repeated calls to catgets() do not overwrite - * the catgets() internal buffer. This has been a problem on HP systems. - */ -char *catgets_cache2(nl_catd catd, int set, int num, char *dflt) -{ - -#define MSGS_PER_SET_MAX 12 -#define NUM_SETS_MAX 2 - - /* array to hold messages from catalog */ - static char *MsgCat[NUM_SETS_MAX][MSGS_PER_SET_MAX]; - - /* convert to a zero based index */ - int setIdx = set - 1; - int numIdx = num - 1; - - if ( ! MsgCat[setIdx][numIdx] ) { - MsgCat[setIdx][numIdx] = strdup( catgets(catd, set, num, dflt)); - } - - return MsgCat[setIdx][numIdx]; -} - -#endif - Application *theApplication = NULL; nl_catd catd = (nl_catd) -1; // catgets file descriptor @@ -261,7 +233,7 @@ Application::~Application() #endif #endif - catclose(catd); + CATCLOSE(catd); // In an MT environment, calling exit() causes threads to // hang and a deadlock results. @@ -387,7 +359,7 @@ void Application::open_catalog() { // open message catalog file - catd = catopen("MotifApp", NL_CAT_LOCALE); + catd = CATOPEN("MotifApp", NL_CAT_LOCALE); } void diff --git a/cde/programs/dtmail/MotifApp/AskFirstCmd.C b/cde/programs/dtmail/MotifApp/AskFirstCmd.C index f1d8d59ff..4b63fa7ab 100644 --- a/cde/programs/dtmail/MotifApp/AskFirstCmd.C +++ b/cde/programs/dtmail/MotifApp/AskFirstCmd.C @@ -65,11 +65,9 @@ #include "QuestionDialogManager.h" #include -#include +#include
extern nl_catd catd; -#include "NLS.hh" - AskFirstCmd::AskFirstCmd ( char *name, char *label, int active ) : Cmd ( name, label, active ) @@ -77,7 +75,7 @@ AskFirstCmd::AskFirstCmd ( char *name, _dialog = NULL; _question = NULL; _dialogParentWidget = NULL; - setQuestion ( GETMSG(catd, 1, 1, + setQuestion ( CATGETS(catd, 1, 1, "Do you really want to execute this command?")); } diff --git a/cde/programs/dtmail/MotifApp/DialogManager.C b/cde/programs/dtmail/MotifApp/DialogManager.C index 670961310..8051a7a44 100644 --- a/cde/programs/dtmail/MotifApp/DialogManager.C +++ b/cde/programs/dtmail/MotifApp/DialogManager.C @@ -69,11 +69,9 @@ #include #include -#include +#include
extern nl_catd catd; -#include "NLS.hh" - DialogManager::DialogManager ( char *name ): UIComponent ( name ) { // Empty @@ -468,8 +466,8 @@ DialogManager::post_and_return( // They may have been set via the overloaded post_and_return() // method before. Reset them to their default values... - okLabel = XmStringCreateLocalized(GETMSG(catd, 1, 2, "OK")); - cancelLabel = XmStringCreateLocalized(GETMSG(catd, 1, 3, "Cancel")); + okLabel = XmStringCreateLocalized(CATGETS(catd, 1, 2, "OK")); + cancelLabel = XmStringCreateLocalized(CATGETS(catd, 1, 3, "Cancel")); Widget dlg = this->getDialog(wid); diff --git a/cde/programs/dtmail/MotifApp/Help.C b/cde/programs/dtmail/MotifApp/Help.C index c263e8c3a..bcf273770 100644 --- a/cde/programs/dtmail/MotifApp/Help.C +++ b/cde/programs/dtmail/MotifApp/Help.C @@ -50,11 +50,9 @@ #include
#include "Help.hh" -#include +#include
extern nl_catd catd; -#include "NLS.hh" - void DisplayMain( Widget, char *, char *); static Widget helpMain = NULL; static Widget helpError = NULL; @@ -126,7 +124,7 @@ DisplayVersion ( if (versionMain != NULL) { n = 0; - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 4, + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 4, "DtMail Version Dialog")); n++; if (helpVolume != NULL) { XtSetArg (args[n], DtNhelpVolume, helpVolume); n++; @@ -141,7 +139,7 @@ DisplayVersion ( // Build a new one in our cached list n = 0; - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 5, + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 5, "DtMail Version Dialog")); n++; if (helpVolume != NULL) { XtSetArg (args[n], DtNhelpVolume, helpVolume); n++; @@ -190,7 +188,7 @@ HelpMenuCB ( switch ((int) status) { case DtHELP_SELECT_ERROR: - printf(GETMSG(catd, 2, 1, "Selection Error, cannot continue\n")); + printf(CATGETS(catd, 2, 1, "Selection Error, cannot continue\n")); break; case DtHELP_SELECT_VALID: while (selWidget != NULL) { @@ -205,10 +203,10 @@ HelpMenuCB ( } break; case DtHELP_SELECT_ABORT: - printf(GETMSG(catd, 2, 2, "Selection aborted by user.\n")); + printf(CATGETS(catd, 2, 2, "Selection aborted by user.\n")); break; case DtHELP_SELECT_INVALID: - printf(GETMSG(catd, 1, 6, + printf(CATGETS(catd, 1, 6, "You must select a component withing your app.\n")); break; } @@ -260,9 +258,9 @@ DisplayMain( if (helpMain != NULL) { n = 0; #ifdef undef - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 7, "DtMail Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 7, "DtMail Help")); n++; #endif - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 12, "Mailer : Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 12, "Mailer : Help")); n++; if (helpVolume != NULL) { XtSetArg (args[n], DtNhelpVolume, helpVolume); n++; } @@ -277,7 +275,7 @@ DisplayMain( // Build a new one in our cached list n = 0; - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 12, "Mailer : Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 12, "Mailer : Help")); n++; if (helpVolume != NULL) { XtSetArg (args[n], DtNhelpVolume, helpVolume); n++; } @@ -306,9 +304,9 @@ DisplayErrorHelp( if (helpError) { n = 0; #ifdef undef - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 7, "DtMail Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 7, "DtMail Help")); n++; #endif - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 12, "Mailer : Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 12, "Mailer : Help")); n++; if (helpVolume != NULL) { XtSetArg (args[n], DtNhelpVolume, helpVolume); n++; } @@ -323,9 +321,9 @@ DisplayErrorHelp( // when done. n = 0; #ifdef undef - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 8, "DtMail Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 8, "DtMail Help")); n++; #endif - XtSetArg (args[n], XmNtitle, GETMSG(catd, 1, 12, "Mailer : Help")); n++; + XtSetArg (args[n], XmNtitle, CATGETS(catd, 1, 12, "Mailer : Help")); n++; if (helpVolume != NULL) { XtSetArg (args[n], DtNhelpVolume, helpVolume); n++; } diff --git a/cde/programs/dtmail/MotifApp/QuitCmd.C b/cde/programs/dtmail/MotifApp/QuitCmd.C index 5cce76f0d..a96ce7c20 100644 --- a/cde/programs/dtmail/MotifApp/QuitCmd.C +++ b/cde/programs/dtmail/MotifApp/QuitCmd.C @@ -66,17 +66,15 @@ #include "MainWindow.h" #include "Application.h" -#include +#include
extern nl_catd catd; -#include "NLS.hh" - QuitCmd::QuitCmd ( char *name, char *label, int active, MainWindow *mywindow) : WarnNoUndoCmd ( name, label, active ) { _mywindow = mywindow; _dialogParentWidget = _mywindow->baseWidget(); - setQuestion ( GETMSG(catd, 1, 9, "Close this folder?") ); + setQuestion ( CATGETS(catd, 1, 9, "Close this folder?") ); } void QuitCmd::doit() diff --git a/cde/programs/dtmail/MotifApp/SelectFileCmd.C b/cde/programs/dtmail/MotifApp/SelectFileCmd.C index 4e0df1bdb..5830e32bb 100644 --- a/cde/programs/dtmail/MotifApp/SelectFileCmd.C +++ b/cde/programs/dtmail/MotifApp/SelectFileCmd.C @@ -70,11 +70,9 @@ #include #include "Help.hh" -#include +#include
extern nl_catd catd; -#include "NLS.hh" - extern "C" { #include
} @@ -184,7 +182,7 @@ void SelectFileCmd::doit() XmStringFree(title); XmStringFree(ok_str); XmString hidden_str = XmStringCreateLocalized( - GETMSG(catd, 1, 11, "Show hidden folders and files")); + CATGETS(catd, 1, 11, "Show hidden folders and files")); _hidden_button = XtVaCreateManagedWidget( "hidden", xmToggleButtonWidgetClass, _fileBrowser, diff --git a/cde/programs/dtmail/MotifApp/WarnNoUndoCmd.C b/cde/programs/dtmail/MotifApp/WarnNoUndoCmd.C index 9d4db2f6e..95e131771 100644 --- a/cde/programs/dtmail/MotifApp/WarnNoUndoCmd.C +++ b/cde/programs/dtmail/MotifApp/WarnNoUndoCmd.C @@ -63,17 +63,15 @@ ////////////////////////////////////////////////////////// #include "WarnNoUndoCmd.h" -#include +#include
extern nl_catd catd; -#include "NLS.hh" - WarnNoUndoCmd::WarnNoUndoCmd ( char *name, char *label, int active) : AskFirstCmd ( name, label, active ) { _hasUndo = 0; // Specify that there is no undo - setQuestion ( GETMSG(catd, 1, 10, + setQuestion ( CATGETS(catd, 1, 10, "This command cannot be undone. Proceed anyway?") ); } diff --git a/cde/programs/dtmail/dtmail/AttachArea.C b/cde/programs/dtmail/dtmail/AttachArea.C index c22e4011f..65e6099da 100644 --- a/cde/programs/dtmail/dtmail/AttachArea.C +++ b/cde/programs/dtmail/dtmail/AttachArea.C @@ -385,18 +385,18 @@ void AttachArea::setAttachmentsLabel( ) if((last_displayCount == 0 && displayCount == 1) || (last_displayCount == 2 && displayCount == 1)) { - sprintf(c, GETMSG(DT_catd, 12, 1, "Attachment")); + sprintf(c, CATGETS(DT_catd, 12, 1, "Attachment")); XtVaSetValues(_attachments_label, XtVaTypedArg, XmNlabelString, XtRString, c, strlen(c)+1, NULL); } else if(last_displayCount == 1 && displayCount == 2) { - sprintf(c, GETMSG(DT_catd, 12, 2, "Attachments")); + sprintf(c, CATGETS(DT_catd, 12, 2, "Attachments")); XtVaSetValues(_attachments_label, XtVaTypedArg, XmNlabelString, XtRString, c, strlen(c)+1, NULL); } if(last_displayCount != displayCount) { - sprintf(c, GETMSG(DT_catd, 12, 3, "displayCount")); + sprintf(c, CATGETS(DT_catd, 12, 3, "displayCount")); XtVaSetValues(_no_attachments_label, XtVaTypedArg, XmNlabelString, XtRString, c, strlen(c)+1, NULL); @@ -610,9 +610,9 @@ AttachArea::addAttachment( bp = msg->newBodyPart(mail_error, lastAttBP); if (SafeAccess(filename, F_OK) != 0) { - sprintf(buf, GETMSG(DT_catd, 3, 34, "%s does not exist."), + sprintf(buf, CATGETS(DT_catd, 3, 34, "%s does not exist."), filename); - answer = this->handleErrorDialog(GETMSG(DT_catd, 1, 81, "Mailer"), + answer = this->handleErrorDialog(CATGETS(DT_catd, 1, 81, "Mailer"), buf); delete [] buf; delete [] errormsg; @@ -623,33 +623,33 @@ AttachArea::addAttachment( if(S_ISFIFO(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 12, 4, "Cannot attach FIFO files: %s"), filename); + CATGETS(DT_catd, 12, 4, "Cannot attach FIFO files: %s"), filename); validtype = FALSE; } else if(S_ISCHR(s.st_mode)) { sprintf( errormsg, - GETMSG(DT_catd, 12, 5, "Cannot attach character special files: %s"), filename + CATGETS(DT_catd, 12, 5, "Cannot attach character special files: %s"), filename ); validtype = FALSE; } else if(S_ISDIR(s.st_mode)) { sprintf( errormsg, - GETMSG(DT_catd, 12, 6, "Cannot attach directories: %s"), filename + CATGETS(DT_catd, 12, 6, "Cannot attach directories: %s"), filename ); validtype = FALSE; } else if(S_ISBLK(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 12, 7, "Cannot attach block special files: %s"), filename + CATGETS(DT_catd, 12, 7, "Cannot attach block special files: %s"), filename ); validtype = FALSE; } else if(S_ISSOCK(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 12, 8, "Cannot attach socket files: %s"), filename + CATGETS(DT_catd, 12, 8, "Cannot attach socket files: %s"), filename ); validtype = FALSE; } if(validtype == FALSE) { - answer = this->handleErrorDialog(GETMSG(DT_catd, 1, 81, "Mailer"), + answer = this->handleErrorDialog(CATGETS(DT_catd, 1, 81, "Mailer"), errormsg, NULL); delete [] buf; @@ -660,9 +660,9 @@ AttachArea::addAttachment( fd = SafeOpen(filename, O_RDONLY); if (fd < 0) { - sprintf(buf, GETMSG(DT_catd, 3, 35, "Unable to open %s."), filename); + sprintf(buf, CATGETS(DT_catd, 3, 35, "Unable to open %s."), filename); helpId = DTMAILHELPNOOPEN; - answer = this->handleErrorDialog(GETMSG(DT_catd, 1, 82, "Mailer"), + answer = this->handleErrorDialog(CATGETS(DT_catd, 1, 82, "Mailer"), buf, helpId); delete [] buf; @@ -686,9 +686,9 @@ AttachArea::addAttachment( if (!buffer) { sprintf(buf, "%s", - GETMSG(DT_catd, 3, 36, "Unable to allocate memory.")); + CATGETS(DT_catd, 3, 36, "Unable to allocate memory.")); helpId = DTMAILHELPNOALLOCMEM; - answer = this->handleErrorDialog(GETMSG(DT_catd, 1, 83, "Mailer"), + answer = this->handleErrorDialog(CATGETS(DT_catd, 1, 83, "Mailer"), buf, helpId); return(NULL); @@ -1170,7 +1170,7 @@ AttachArea::addToRowOfAttachmentsStatus() // Size of first label labelStr2 = XmStringCreateLocalized( - GETMSG(DT_catd, 3, 37, "Summary of attachments")); + CATGETS(DT_catd, 3, 37, "Summary of attachments")); _attachments_summary = XtCreateManagedWidget("Attachments_Summary", @@ -1276,7 +1276,7 @@ AttachArea::attachment_summary( char * tmp2; if ((live == 1) && (dead == 0)) { - tmp1 = GETMSG(DT_catd, 3, 38, "attachment"); + tmp1 = CATGETS(DT_catd, 3, 38, "attachment"); buf = new char[strlen(tmp1) + 64]; sprintf(buf, "%d %s", live, tmp1); } @@ -1284,13 +1284,13 @@ AttachArea::attachment_summary( /* NL_COMMENT * "attachments" is the plural form of "attachment". */ - tmp1 = GETMSG(DT_catd, 3, 39, "attachments"); + tmp1 = CATGETS(DT_catd, 3, 39, "attachments"); buf = new char[strlen(tmp1) + 64]; sprintf(buf, "%d %s", live, tmp1); } else if ((live >= 0) && (dead > 0)) { - tmp1 = GETMSG(DT_catd, 3, 40, "attachments"); - tmp2 = GETMSG(DT_catd, 3, 41, "deleted"); + tmp1 = CATGETS(DT_catd, 3, 40, "attachments"); + tmp2 = CATGETS(DT_catd, 3, 41, "deleted"); buf = new char[strlen(tmp1) + strlen(tmp2) + 64]; sprintf(buf, "%d %s, %d %s", live, tmp1, dead, tmp2); } diff --git a/cde/programs/dtmail/dtmail/AttachCmds.C b/cde/programs/dtmail/dtmail/AttachCmds.C index 34ff2ec12..04ee2c997 100644 --- a/cde/programs/dtmail/dtmail/AttachCmds.C +++ b/cde/programs/dtmail/dtmail/AttachCmds.C @@ -138,7 +138,7 @@ void AttachAddCmd::doit() break; } XtVaSetValues(XtParent(fsdialog), - XmNtitle, GETMSG(DT_catd, 14, 1, "Add Attachment"), + XmNtitle, CATGETS(DT_catd, 14, 1, "Add Attachment"), NULL); XtManageChild(fsdialog); } @@ -208,7 +208,7 @@ void AttachAddCmd::add_file( char *filename ) if(stat(filename, &s) == -1) { sprintf(errormsg, - GETMSG(DT_catd, 14, 2, "Unable to open %s"), + CATGETS(DT_catd, 14, 2, "Unable to open %s"), filename ); @@ -222,31 +222,31 @@ void AttachAddCmd::add_file( char *filename ) if(S_ISFIFO(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 14, 3, + CATGETS(DT_catd, 14, 3, "Cannot attach FIFO files: %s"), filename ); validtype = FALSE; } else if(S_ISCHR(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 14, 4, + CATGETS(DT_catd, 14, 4, "Cannot attach character special files: %s"), filename ); validtype = FALSE; } else if(S_ISDIR(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 14, 5, + CATGETS(DT_catd, 14, 5, "Cannot attach directories: %s"), filename ); validtype = FALSE; } else if(S_ISBLK(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 14, 6, + CATGETS(DT_catd, 14, 6, "Cannot attach block special files: %s"), filename ); validtype = FALSE; } else if(S_ISSOCK(s.st_mode)) { sprintf(errormsg, - GETMSG(DT_catd, 14, 7, + CATGETS(DT_catd, 14, 7, "Cannot attach socket files: %s"), filename ); validtype = FALSE; @@ -263,7 +263,7 @@ void AttachAddCmd::add_file( char *filename ) fd = open(filename, O_RDONLY); if(fd == -1) { sprintf(errormsg, - GETMSG(DT_catd, 14, 8, + CATGETS(DT_catd, 14, 8, "Unable to open %s"),filename ); @@ -352,7 +352,7 @@ void AttachFetchCmd::doit() // // If contents is NULL then we were unable to get the contents // if(contents == NULL) { // sprintf(error, -// GETMSG(DT_catd, 14, 9, +// CATGETS(DT_catd, 14, 9, // "File contents unavailable: %s"), // list[i]->getLabel() // ); @@ -460,7 +460,7 @@ AttachRenameCmd::AttachRenameCmd ( AttachArea *attachArea, XtVaSetValues(renameDialog, XmNselectionLabelString, message, NULL); XmStringFree(message); XtVaSetValues(XtParent(renameDialog), - XmNtitle, GETMSG(DT_catd, 14, 9, "Mailer - Rename Attachment"), + XmNtitle, CATGETS(DT_catd, 14, 9, "Mailer - Rename Attachment"), NULL); XtUnmanageChild( XmSelectionBoxGetChild(renameDialog, XmDIALOG_HELP_BUTTON) @@ -518,7 +518,7 @@ void AttachRenameCmd::ok( XtPointer callData ) if(_attachArea->getIconSelectedCount() != 1) { // theInfoDialogManager->post( -// GETMSG(DT_catd, 14, 12, +// CATGETS(DT_catd, 14, 12, // "Please select only one attachment to rename"), // (void *)NULL, // okcb); @@ -552,7 +552,7 @@ AttachDescriptionCmd::AttachDescriptionCmd ( AttachArea *attachArea, XtVaSetValues(descriptionDialog, XmNselectionLabelString, message, NULL); XmStringFree(message); XtVaSetValues(XtParent(descriptionDialog), - XmNtitle, GETMSG(DT_catd, 14, 10, "Description"), + XmNtitle, CATGETS(DT_catd, 14, 10, "Description"), NULL); XtUnmanageChild(XmSelectionBoxGetChild(descriptionDialog, XmDIALOG_HELP_BUTTON)); _attachArea->setDescriptionDialog(descriptionDialog); @@ -620,7 +620,7 @@ void AttachDescriptionCmd::ok( XtPointer callData ) if(_attachArea->getIconSelectedCount() != 1) { // theInfoDialogManager->post( -// GETMSG(DT_catd, 14, 12, +// CATGETS(DT_catd, 14, 12, // "Please select only one attachment to describe"), // (void *)NULL, // okcb); @@ -694,7 +694,7 @@ void AttachSaveAsCmd::doit() break; } XtVaSetValues(XtParent(fsdialog), - XmNtitle, GETMSG(DT_catd, 14, 11, "Save Attachment As"), + XmNtitle, CATGETS(DT_catd, 14, 11, "Save Attachment As"), NULL); XtManageChild(fsdialog); } @@ -754,7 +754,7 @@ void ConfirmCallback( XtPointer) // break; // case ROAM_UNAVAILABLE: // // theInfoDialogManager->post( -// // GETMSG(DT_catd, 14, 15, "File Contents Unavailable"), +// // CATGETS(DT_catd, 14, 15, "File Contents Unavailable"), // // (void *)NULL, // // (DialogCallback)okcb); // return; @@ -813,13 +813,13 @@ void AttachSaveAsCmd::ok( XtPointer callData ) // // to a single existing file then we barf! // if(_attachArea->getIconSelectedCount() != 1) { // sprintf(error, -// GETMSG(DT_catd, 14, 16, "Cannot create")); +// CATGETS(DT_catd, 14, 16, "Cannot create")); // sfs = CONFIRM; // } else { // // The file already exists // completefilename = dirname; // sprintf(error, -// GETMSG(DT_catd, 14, 17, +// CATGETS(DT_catd, 14, 17, // "File %s exists. Overwrite?"), // completefilename); // sfs = CONFIRM; @@ -831,7 +831,7 @@ void AttachSaveAsCmd::ok( XtPointer callData ) // if(stat(buf, &s) != -1) { // The file exists // if(S_ISREG(s.st_mode)) { // sprintf(error, -// GETMSG(DT_catd, 14, 18, +// CATGETS(DT_catd, 14, 18, // "File %s exists. Overwrite?"), // completefilename); // sfs = CONFIRM; @@ -839,7 +839,7 @@ void AttachSaveAsCmd::ok( XtPointer callData ) // // We're trying to overwrite something other // // than a regular file. FAIL! // sprintf(error, -// GETMSG(14, 19, "Cannot create")); +// CATGETS(14, 19, "Cannot create")); // sfs = CONFIRM; // } // } @@ -847,7 +847,7 @@ void AttachSaveAsCmd::ok( XtPointer callData ) // // The file already exists but is not a regular file // completefilename = dirname; // sprintf(error, -// GETMSG( +// CATGETS( // DT_catd, 14, 20, "Cannot create %s"), completefilename); // sfs = ERR; // } @@ -894,7 +894,7 @@ void AttachSaveAsCmd::ok( XtPointer callData ) // break; // case ROAM_UNAVAILABLE: // // theInfoDialogManager->post( -// // GETMSG(DT_catd, 14. 21, "File Contents Unavailable"), +// // CATGETS(DT_catd, 14. 21, "File Contents Unavailable"), // // (void *)NULL, (DialogCallback)okcb); // return; // } diff --git a/cde/programs/dtmail/dtmail/Attachment.C b/cde/programs/dtmail/dtmail/Attachment.C index 905bf43e0..b899bcf97 100644 --- a/cde/programs/dtmail/dtmail/Attachment.C +++ b/cde/programs/dtmail/dtmail/Attachment.C @@ -458,10 +458,10 @@ Attachment::invokeAction(int index) char *buf = new char[2048]; sprintf(buf, "%s", - GETMSG(DT_catd, 3, 81, "This attachment may contain commands that can cause serious\ndamage. It is recommended that you only execute it after you\nare certain it is safe to do so.\n\nPress OK if you are certain it is safe,\nCancel to cancel execution.")); + CATGETS(DT_catd, 3, 81, "This attachment may contain commands that can cause serious\ndamage. It is recommended that you only execute it after you\nare certain it is safe to do so.\n\nPress OK if you are certain it is safe,\nCancel to cancel execution.")); answer = parent()->handleQuestionDialog( - GETMSG(DT_catd, 1, 86, "Mailer"), + CATGETS(DT_catd, 1, 86, "Mailer"), buf, DTMAILHELPEXECUTEOK); delete [] buf; @@ -600,11 +600,11 @@ Attachment::saveToFile(DtMailEnv &, char *filename) if (SafeAccess(filename, F_OK) == 0) { - sprintf(buf, GETMSG(DT_catd, 3, 42, "%s already exists. Replace?"), + sprintf(buf, CATGETS(DT_catd, 3, 42, "%s already exists. Replace?"), filename); helpId = DTMAILHELPALREADYEXISTS; - answer = parent()->handleQuestionDialog(GETMSG(DT_catd, + answer = parent()->handleQuestionDialog(CATGETS(DT_catd, 1, 85, "Mailer"), buf, @@ -616,9 +616,9 @@ Attachment::saveToFile(DtMailEnv &, char *filename) } if (unlink(filename) < 0) { - sprintf(buf, GETMSG(DT_catd, 3, 43, "Unable to replace %s."), filename); + sprintf(buf, CATGETS(DT_catd, 3, 43, "Unable to replace %s."), filename); helpId = DTMAILHELPNOREPLACE; - answer = parent()->handleErrorDialog(GETMSG(DT_catd, + answer = parent()->handleErrorDialog(CATGETS(DT_catd, 1, 86, "Mailer"), buf, @@ -642,9 +642,9 @@ Attachment::saveToFile(DtMailEnv &, char *filename) // int fd = SafeOpen(filename, O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd < 0) { - sprintf(buf, GETMSG(DT_catd, 3, 44, "Unable to create %s."), filename); + sprintf(buf, CATGETS(DT_catd, 3, 44, "Unable to create %s."), filename); helpId = DTMAILHELPNOCREATE; - answer = parent()->handleErrorDialog(GETMSG(DT_catd, 1, 87, "Mailer"), + answer = parent()->handleErrorDialog(CATGETS(DT_catd, 1, 87, "Mailer"), buf, helpId); delete [] buf; @@ -652,10 +652,10 @@ Attachment::saveToFile(DtMailEnv &, char *filename) } if (SafeWrite(fd, _myContents, (unsigned int)_myContentsSize) < _myContentsSize) { - sprintf(buf, GETMSG(DT_catd, 3, 45, "Unable to create %s."), + sprintf(buf, CATGETS(DT_catd, 3, 45, "Unable to create %s."), filename); helpId = DTMAILHELPNOCREATE; - answer = parent()->handleErrorDialog(GETMSG(DT_catd, 1, 88, "Mailer"), + answer = parent()->handleErrorDialog(CATGETS(DT_catd, 1, 88, "Mailer"), buf, helpId); SafeClose(fd); @@ -887,10 +887,10 @@ Attachment::action( * Post a dialog explaining that the action was invalid */ sprintf(buf, "%s", - GETMSG( + CATGETS( DT_catd, 3, 91, "Cannot execute invalid action.")); - answer = parent()->handleErrorDialog(GETMSG(DT_catd, 1, 86, "Mailer"), + answer = parent()->handleErrorDialog(CATGETS(DT_catd, 1, 86, "Mailer"), buf); unregisterAction(id); @@ -902,9 +902,9 @@ Attachment::action( * Post a dialog explaining that the action failed. */ sprintf(buf, "%s", - GETMSG(DT_catd, 3, 92, "Executing action failed!")); + CATGETS(DT_catd, 3, 92, "Executing action failed!")); - answer = parent()->handleErrorDialog(GETMSG(DT_catd, 1, 86, "Mailer"), + answer = parent()->handleErrorDialog(CATGETS(DT_catd, 1, 86, "Mailer"), buf); unregisterAction(id); diff --git a/cde/programs/dtmail/dtmail/ComposeCmds.C b/cde/programs/dtmail/dtmail/ComposeCmds.C index df95f378c..1105f055a 100644 --- a/cde/programs/dtmail/dtmail/ComposeCmds.C +++ b/cde/programs/dtmail/dtmail/ComposeCmds.C @@ -238,7 +238,7 @@ ComposeFamily::Display_entire_msg(DtMailMessageHandle msgno, char *att; Editor *editor = compose->get_editor()->textEditor(); - att = GETMSG( + att = CATGETS( DT_catd, 1, 255, "------------------ Attachments ------------------\n"); @@ -348,8 +348,8 @@ ComposeCmd::doit() if (newsend == NULL) { DtMailGenDialog * dialog = _parent->genDialog(); - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 203, "Mailer"), - GETMSG(DT_catd, 1, 204, "Unable to create a compose window.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 203, "Mailer"), + CATGETS(DT_catd, 1, 204, "Unable to create a compose window.")); char * helpId = DTMAILHELPNOCOMPOSE; int answer = dialog->post_and_return(helpId); } @@ -387,8 +387,8 @@ ForwardCmd::doit() if ( newsend == NULL ) { DtMailGenDialog * dialog = _parent->genDialog(); - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 205, "Mailer"), - GETMSG(DT_catd, 1, 206, "Unable to create a compose window.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 205, "Mailer"), + CATGETS(DT_catd, 1, 206, "Unable to create a compose window.")); char * helpId = DTMAILHELPNOCOMPOSE; int answer = dialog->post_and_return(helpId); } @@ -469,8 +469,8 @@ ReplyCmd::doit() if ( newsend == NULL ) { DtMailGenDialog * dialog = _parent->genDialog(); - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 207, "Mailer"), - GETMSG(DT_catd, 1, 208, "Unable to create a compose window.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 207, "Mailer"), + CATGETS(DT_catd, 1, 208, "Unable to create a compose window.")); char * helpId = DTMAILHELPNOCOMPOSE; int answer = dialog->post_and_return(helpId); } @@ -613,8 +613,8 @@ ReplyAllCmd::doit() if ( newsend == NULL ) { dialog = _parent->genDialog(); - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 209, "Mailer"), - GETMSG(DT_catd, 1, 210, "Unable to create a compose window.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 209, "Mailer"), + CATGETS(DT_catd, 1, 210, "Unable to create a compose window.")); char * helpId = DTMAILHELPNOCOMPOSE; int answer = dialog->post_and_return(helpId); } @@ -768,8 +768,8 @@ TemplateCmd::doit() // int fd = SafeOpen(fullpath, O_RDONLY); if (fd < 0) { - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 211, "Mailer"), - GETMSG(DT_catd, 1, 212, "The template does not exist.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 211, "Mailer"), + CATGETS(DT_catd, 1, 212, "The template does not exist.")); char * helpId = DTMAILHELPNOTEMPLATE; int answer = dialog->post_and_return(helpId); free(fullpath); @@ -778,8 +778,8 @@ TemplateCmd::doit() struct stat buf; if (SafeFStat(fd, &buf) < 0) { - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 213, "Mailer"), - GETMSG(DT_catd, 1, 214, "The template appears to be corrupt.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 213, "Mailer"), + CATGETS(DT_catd, 1, 214, "The template appears to be corrupt.")); char * helpId = DTMAILHELPCORRUPTTEMPLATE; int answer = dialog->post_and_return(helpId); SafeClose(fd); @@ -798,8 +798,8 @@ TemplateCmd::doit() free_buf = 1; mbuf.buffer = new char[mbuf.size]; if (mbuf.buffer == NULL) { - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 215, "Mailer"), - GETMSG(DT_catd, 1, 216, "There is not enough memory to load the template.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 215, "Mailer"), + CATGETS(DT_catd, 1, 216, "There is not enough memory to load the template.")); char * helpId = DTMAILHELPNOMEMTEMPLATE; int answer = dialog->post_and_return(helpId); SafeClose(fd); @@ -808,8 +808,8 @@ TemplateCmd::doit() } if (SafeRead(fd, mbuf.buffer, (unsigned int)mbuf.size) < mbuf.size) { - dialog->setToErrorDialog(GETMSG(DT_catd, 1, 217, "Mailer"), - GETMSG(DT_catd, 1, 218, "The template appears to be corrupt.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 1, 217, "Mailer"), + CATGETS(DT_catd, 1, 218, "The template appears to be corrupt.")); char * helpId = DTMAILHELPERROR; int answer = dialog->post_and_return(helpId); SafeClose(fd); diff --git a/cde/programs/dtmail/dtmail/DmxPrintJob.C b/cde/programs/dtmail/dtmail/DmxPrintJob.C index 14ae8ec0f..ce251b7e6 100644 --- a/cde/programs/dtmail/dtmail/DmxPrintJob.C +++ b/cde/programs/dtmail/dtmail/DmxPrintJob.C @@ -214,13 +214,13 @@ DmxPrintJob::cancel(void) "Dialog", _parent->baseWidget()); char *errMsg = - GETMSG( + CATGETS( DT_catd, 21, 23, "The X Print Server is temporarily out of resources."); - genDialog->setToErrorDialog(GETMSG(DT_catd, 1, 6, "Mailer"), + genDialog->setToErrorDialog(CATGETS(DT_catd, 1, 6, "Mailer"), errMsg); - genDialog->post_and_return(GETMSG(DT_catd, 3, 9, "OK"), NULL); + genDialog->post_and_return(CATGETS(DT_catd, 3, 9, "OK"), NULL); delete genDialog; theRoamApp.setErrorPrintDisplay(NULL); @@ -416,19 +416,19 @@ DmxPrintJob::createOutputWidgets (void) char *errMsg = (char *) XtMalloc(1024); char *i18nMsg; - i18nMsg = GETMSG( + i18nMsg = CATGETS( DT_catd, 21, 2, "One of the following margin specifiers \n has incorrect syntax: \n %s \n %s \n %s \n %s \nContinue using default margins?" ); sprintf(errMsg, i18nMsg, top, right, bottom, left); genDialog->setToErrorDialog( - GETMSG(DT_catd, 21, 3, "Mailer"), + CATGETS(DT_catd, 21, 3, "Mailer"), errMsg); XtFree(errMsg); genDialog->post_and_return( - GETMSG(DT_catd, 21, 4, "OK"), + CATGETS(DT_catd, 21, 4, "OK"), NULL); delete genDialog; } @@ -471,7 +471,7 @@ DmxPrintJob::doPrint (void) // if (_parent != NULL) { char *buf = new char[1024]; - char *msg = GETMSG(DT_catd, 21, 1, "Printing %s ..."); + char *msg = CATGETS(DT_catd, 21, 1, "Printing %s ..."); sprintf(buf, msg, _filename); _parent->setStatus(buf); @@ -526,7 +526,7 @@ DmxPrintJob::doPrint (void) XFlush(XtDisplay(_pshell)); genDialog = new DtMailGenDialog("Dialog", w); - appmessage = (char *) GETMSG( + appmessage = (char *) CATGETS( DT_catd, 21, 14, "'Print to File' was unsuccessful."); @@ -548,11 +548,11 @@ DmxPrintJob::doPrint (void) } genDialog->setToErrorDialog( - GETMSG(DT_catd, 21, 3, "Mailer"), + CATGETS(DT_catd, 21, 3, "Mailer"), message); #if 0 genDialog->post_and_return( - GETMSG(DT_catd, 21, 4, "OK"), + CATGETS(DT_catd, 21, 4, "OK"), NULL); delete genDialog; #else @@ -887,7 +887,7 @@ DmxPrintJob::getPageHeaderString( { char *hdrstr = msg->getMessageHeader(DMXCC); - format = GETMSG(DT_catd, 21, 5, "Cc: %s"); + format = CATGETS(DT_catd, 21, 5, "Cc: %s"); buf = (char *) malloc(strlen(format) + strlen(hdrstr) + 1); if (buf != (char *) NULL) sprintf(buf, format, hdrstr); @@ -899,7 +899,7 @@ DmxPrintJob::getPageHeaderString( { char *hdrstr = msg->getMessageHeader(DMXDATE); - format = GETMSG(DT_catd, 21, 6, "Date: %s"); + format = CATGETS(DT_catd, 21, 6, "Date: %s"); buf = (char *) malloc(strlen(format) + strlen(hdrstr) + 1); if (buf != (char *) NULL) sprintf(buf, format, hdrstr); @@ -911,7 +911,7 @@ DmxPrintJob::getPageHeaderString( { char *hdrstr = msg->getMessageHeader(DMXFROM); - format = GETMSG(DT_catd, 21, 7, "From: %s"); + format = CATGETS(DT_catd, 21, 7, "From: %s"); buf = (char *) malloc(strlen(format) + strlen(hdrstr) + 1); if (buf != (char *) NULL) sprintf(buf, format, hdrstr); @@ -923,7 +923,7 @@ DmxPrintJob::getPageHeaderString( { char *hdrstr = msg->getMessageHeader(DMXSUBJ); - format = GETMSG(DT_catd, 21, 8, "Subject: %s"); + format = CATGETS(DT_catd, 21, 8, "Subject: %s"); buf = (char *) malloc(strlen(format) + strlen(hdrstr) + 1); if (buf != (char *) NULL) sprintf(buf, format, hdrstr); @@ -935,7 +935,7 @@ DmxPrintJob::getPageHeaderString( { char *hdrstr = msg->getMessageHeader(DMXTO); - format = GETMSG(DT_catd, 21, 9, "To: %s"); + format = CATGETS(DT_catd, 21, 9, "To: %s"); buf = (char *) malloc(strlen(format) + strlen(hdrstr) + 1); if (buf != (char *) NULL) sprintf(buf, format, hdrstr); @@ -948,7 +948,7 @@ DmxPrintJob::getPageHeaderString( // Allocate space for the format and the translated page number. // { - format = GETMSG(DT_catd, 21, 10, "Page %d of %d"); + format = CATGETS(DT_catd, 21, 10, "Page %d of %d"); buf = (char *) malloc(strlen(format) + 16); if (buf != (char *) NULL) sprintf(buf, format, _spool_npages_done, _spool_npages_total); @@ -961,7 +961,7 @@ DmxPrintJob::getPageHeaderString( { struct passwd *pw; - format = GETMSG(DT_catd, 21, 11, "Mail For: %s"); + format = CATGETS(DT_catd, 21, 11, "Mail For: %s"); pw = getpwuid(getuid()); buf = (char *) malloc(strlen(format) + strlen(pw->pw_name) + 1); if (buf != (char *) NULL) @@ -996,14 +996,14 @@ DmxPrintJob::finishedPrintToFile( { DtMailGenDialog *genDialog = new DtMailGenDialog("Dialog", w); - message = (char *) GETMSG( + message = (char *) CATGETS( DT_catd, 21, 14, "'Print to File' was unsuccessful."); genDialog->setToErrorDialog( - GETMSG(DT_catd, 21, 3, "Mailer"), + CATGETS(DT_catd, 21, 3, "Mailer"), message); genDialog->post_and_return( - GETMSG(DT_catd, 21, 4, "OK"), + CATGETS(DT_catd, 21, 4, "OK"), NULL); delete genDialog; } @@ -1011,15 +1011,15 @@ DmxPrintJob::finishedPrintToFile( { DtMailGenDialog *genDialog = new DtMailGenDialog("Dialog", w); - message = (char *) GETMSG( + message = (char *) CATGETS( DT_catd, 21, 15, "'Print to File' completed successfully"); genDialog->setToWarningDialog( - GETMSG(DT_catd, 21, 3, "Mailer"), + CATGETS(DT_catd, 21, 3, "Mailer"), message); genDialog->post_and_return( - GETMSG(DT_catd, 21, 4, "OK"), + CATGETS(DT_catd, 21, 4, "OK"), NULL); delete genDialog; } @@ -1084,7 +1084,7 @@ DmxPrintJob::pdmNotificationCB( case XmCR_PDM_START_ERROR: case XmCR_PDM_START_VXAUTH: case XmCR_PDM_START_PXAUTH: - message = (char *) GETMSG( + message = (char *) CATGETS( DT_catd, 21, 24, "Print Dialog Manager error - setup failed."); break; @@ -1099,10 +1099,10 @@ DmxPrintJob::pdmNotificationCB( "Dialog", thisJob->_parent->baseWidget()); genDialog->setToErrorDialog( - GETMSG(DT_catd, 21, 3, "Mailer"), + CATGETS(DT_catd, 21, 3, "Mailer"), message); genDialog->post_and_return( - GETMSG(DT_catd, 21, 25, "Continue"), + CATGETS(DT_catd, 21, 25, "Continue"), NULL); delete genDialog; } diff --git a/cde/programs/dtmail/dtmail/DmxPrintOptions.C b/cde/programs/dtmail/dtmail/DmxPrintOptions.C index f7a28e5f9..00aeaa964 100644 --- a/cde/programs/dtmail/dtmail/DmxPrintOptions.C +++ b/cde/programs/dtmail/dtmail/DmxPrintOptions.C @@ -251,7 +251,7 @@ DmxPrintOptions::DmxPrintOptions ( for (i=0; ibaseWidget(), @@ -387,7 +387,7 @@ DmxPrintOptions::DmxPrintOptions ( for (i=0; ibaseWidget(), @@ -703,19 +703,19 @@ DmxPrintOptions::isValidMarginSpec(PropUiItem* pui, void* data) { case DTPRINT_OPTION_MARGIN_TOP: i18nMsg = - GETMSG(DT_catd, 26, 1, "Top Margin specifier is invalid: "); + CATGETS(DT_catd, 26, 1, "Top Margin specifier is invalid: "); break; case DTPRINT_OPTION_MARGIN_RIGHT: i18nMsg = - GETMSG(DT_catd, 26, 2, "Right Margin specifier is invalid: "); + CATGETS(DT_catd, 26, 2, "Right Margin specifier is invalid: "); break; case DTPRINT_OPTION_MARGIN_BOTTOM: i18nMsg = - GETMSG(DT_catd, 26, 3, "Bottom Margin specifier is invalid: "); + CATGETS(DT_catd, 26, 3, "Bottom Margin specifier is invalid: "); break; case DTPRINT_OPTION_MARGIN_LEFT: i18nMsg = - GETMSG(DT_catd, 26, 4, "Left Margin specifier is invalid: "); + CATGETS(DT_catd, 26, 4, "Left Margin specifier is invalid: "); break; } errMsg = (char*) XtMalloc(strlen(i18nMsg) + strlen(marginSpec) + 1); diff --git a/cde/programs/dtmail/dtmail/DmxPrintSetup.C b/cde/programs/dtmail/dtmail/DmxPrintSetup.C index 9c9f74884..d41250ae0 100644 --- a/cde/programs/dtmail/dtmail/DmxPrintSetup.C +++ b/cde/programs/dtmail/dtmail/DmxPrintSetup.C @@ -286,7 +286,7 @@ DmxPrintSetup::attachPrintSetupDialog (void) dialog = XtParent(_dtprint_setup); if (NULL != dialog && XtIsShell(dialog)) { - char *title = (char*) GETMSG(DT_catd, 21, 21, "Mailer - Print Setup"); + char *title = (char*) CATGETS(DT_catd, 21, 21, "Mailer - Print Setup"); XtVaSetValues(dialog, XmNtitle, title, NULL); } else @@ -339,7 +339,7 @@ DmxPrintSetup::createPrintSetupDialog (Widget parent) widgets->dtprint_setup, NULL); - xms = XmStringCreateLocalized(GETMSG(DT_catd, 21, 12, "Print Separately")); + xms = XmStringCreateLocalized(CATGETS(DT_catd, 21, 12, "Print Separately")); widgets->print_separately_tb = XtVaCreateManagedWidget( "PrintSeparatelyTB", xmToggleButtonWidgetClass, @@ -351,7 +351,7 @@ DmxPrintSetup::createPrintSetupDialog (Widget parent) NULL); XmStringFree(xms); - xms = XmStringCreateLocalized(GETMSG(DT_catd, 21, 13, "Use Word Wrap")); + xms = XmStringCreateLocalized(CATGETS(DT_catd, 21, 13, "Use Word Wrap")); widgets->use_word_wrap_tb = XtVaCreateManagedWidget( "UseWordWrapTB", xmToggleButtonWidgetClass, @@ -365,7 +365,7 @@ DmxPrintSetup::createPrintSetupDialog (Widget parent) NULL); XmStringFree(xms); - xms = XmStringCreateLocalized(GETMSG(DT_catd, 21, 20, "More ...")); + xms = XmStringCreateLocalized(CATGETS(DT_catd, 21, 20, "More ...")); widgets->more_options_pb = XtVaCreateManagedWidget( "PrintOptionsPB", xmPushButtonWidgetClass, diff --git a/cde/programs/dtmail/dtmail/DtEditor.C b/cde/programs/dtmail/dtmail/DtEditor.C index d7a29016a..66d635d84 100644 --- a/cde/programs/dtmail/dtmail/DtEditor.C +++ b/cde/programs/dtmail/dtmail/DtEditor.C @@ -786,10 +786,10 @@ CDEM_DtWidgetEditor::modifyData( { if( !begin_ins_bracket) - begin_ins_bracket = GETMSG(DT_catd, 1, 201, + begin_ins_bracket = CATGETS(DT_catd, 1, 201, "\n------------- Begin Included Message -------------\n"); if(!end_ins_bracket) - end_ins_bracket = GETMSG(DT_catd, 1, 202, + end_ins_bracket = CATGETS(DT_catd, 1, 202, "\n------------- End Included Message -------------\n"); size_t begin_len = strlen(begin_ins_bracket); diff --git a/cde/programs/dtmail/dtmail/DtMailGenDialog.C b/cde/programs/dtmail/dtmail/DtMailGenDialog.C index cf46343e5..72527d3ac 100644 --- a/cde/programs/dtmail/dtmail/DtMailGenDialog.C +++ b/cde/programs/dtmail/dtmail/DtMailGenDialog.C @@ -236,7 +236,7 @@ DtMailGenDialog::okCallback(Widget w, XtPointer clientData, XtPointer cbs) obj->setToAboutDialog(); // char * helpId = "About"; char * helpId = NULL; - int answer = obj->post_and_return(GETMSG(DT_catd, 1, 180, "OK"), + int answer = obj->post_and_return(CATGETS(DT_catd, 1, 180, "OK"), helpId); } } @@ -441,8 +441,8 @@ DtMailGenDialog::post_and_return(char *helpId) // They may have been set via the overloaded post_and_return() // method before. Reset them to their default values... - okLabel = XmStringCreateLocalized(GETMSG(DT_catd, 1, 181, "OK")); - cancelLabel = XmStringCreateLocalized(GETMSG(DT_catd, 1, 182, "Cancel")); + okLabel = XmStringCreateLocalized(CATGETS(DT_catd, 1, 181, "OK")); + cancelLabel = XmStringCreateLocalized(CATGETS(DT_catd, 1, 182, "Cancel")); // Make sure the dialog exists, and that it is an XmMessageBox // or subclass, since the callbacks assume this widget type @@ -807,8 +807,8 @@ DtMailGenDialog::setToAboutDialog(void) if (NULL == ABOUT_TITLE) { char *version; - ABOUT_TITLE = GETMSG(DT_catd, 1, 235, "Mailer - About Mailer"); - version = GETMSG(DT_catd, 1, 236, "Mailer Version %d.%d.%d"); + ABOUT_TITLE = CATGETS(DT_catd, 1, 235, "Mailer - About Mailer"); + version = CATGETS(DT_catd, 1, 236, "Mailer Version %d.%d.%d"); DTMAIL_VERSION = new char [strlen(version) + 16]; sprintf( diff --git a/cde/programs/dtmail/dtmail/Editor.C b/cde/programs/dtmail/dtmail/Editor.C index 16e8e4be8..fcf6fb97c 100644 --- a/cde/programs/dtmail/dtmail/Editor.C +++ b/cde/programs/dtmail/dtmail/Editor.C @@ -109,12 +109,12 @@ Editor::set_message(DtMail::Message * msg, char * ins_bracket; switch (brackets) { case BF_FORWARD: - ins_bracket = GETMSG(DT_catd, 1, 195, "------------- Begin Forwarded Message -------------\n\n"); + ins_bracket = CATGETS(DT_catd, 1, 195, "------------- Begin Forwarded Message -------------\n\n"); break; case BF_INCLUDE: default: - ins_bracket = GETMSG(DT_catd, 1, 196, "------------- Begin Included Message -------------\n\n"); + ins_bracket = CATGETS(DT_catd, 1, 196, "------------- Begin Included Message -------------\n\n"); break; } @@ -265,7 +265,7 @@ Editor::set_message(DtMail::Message * msg, // of text checksums more. // //if (bp->checksum(error) == DtMailCheckBad) { - // *status_string = GETMSG(DT_catd, 1, -1, "Digital signature did not match."); + // *status_string = CATGETS(DT_catd, 1, -1, "Digital signature did not match."); //} } delete [] line; @@ -274,12 +274,12 @@ Editor::set_message(DtMail::Message * msg, char * ins_bracket; switch (brackets) { case BF_FORWARD: - ins_bracket = GETMSG(DT_catd, 1, 197, "------------- End Forwarded Message -------------\n\n"); + ins_bracket = CATGETS(DT_catd, 1, 197, "------------- End Forwarded Message -------------\n\n"); break; case BF_INCLUDE: default: - ins_bracket = GETMSG(DT_catd, 1, 198, "------------- End Included Message -------------\n\n"); + ins_bracket = CATGETS(DT_catd, 1, 198, "------------- End Included Message -------------\n\n"); break; } @@ -327,7 +327,7 @@ Editor::set_attachment( if ((format == IF_BRACKETED) && (brackets == BF_INCLUDE)) { char * ins_bracket = - GETMSG( + CATGETS( DT_catd, 1, 249, "------------- Begin Included Attachment -------------\n\n"); @@ -345,7 +345,7 @@ Editor::set_attachment( { if (NULL != indent_str) append_to_contents(indent_str, strlen(indent_str)); - input = GETMSG(DT_catd, 1, 251, " Attachment Name: "); + input = CATGETS(DT_catd, 1, 251, " Attachment Name: "); append_to_contents(input, strlen(input)); append_to_contents(name, strlen(name)); append_newline_to_contents(); @@ -355,7 +355,7 @@ Editor::set_attachment( { if (NULL != indent_str) append_to_contents(indent_str, strlen(indent_str)); - input = GETMSG(DT_catd, 1, 252, " Attachment DtType: "); + input = CATGETS(DT_catd, 1, 252, " Attachment DtType: "); append_to_contents(input, strlen(input)); append_to_contents(dttype, strlen(dttype)); append_newline_to_contents(); @@ -366,7 +366,7 @@ Editor::set_attachment( { if (NULL != indent_str) append_to_contents(indent_str, strlen(indent_str)); - input = GETMSG(DT_catd, 1, 253, "Attachment ContentType: "); + input = CATGETS(DT_catd, 1, 253, "Attachment ContentType: "); append_to_contents(input, strlen(input)); append_to_contents(mimetype, strlen(mimetype)); append_newline_to_contents(); @@ -376,7 +376,7 @@ Editor::set_attachment( { if (NULL != indent_str) append_to_contents(indent_str, strlen(indent_str)); - input = GETMSG(DT_catd, 1, 254, "Attachment Description: "); + input = CATGETS(DT_catd, 1, 254, "Attachment Description: "); append_to_contents(input, strlen(input)); append_to_contents(description, strlen(description)); append_newline_to_contents(); @@ -385,7 +385,7 @@ Editor::set_attachment( if ((format == IF_BRACKETED) && (brackets == BF_INCLUDE)) { char * ins_bracket = - GETMSG( + CATGETS( DT_catd, 1, 250, "------------- End Included Attachment -------------\n\n"); diff --git a/cde/programs/dtmail/dtmail/FindDialog.C b/cde/programs/dtmail/dtmail/FindDialog.C index 1275d82e3..02be08dba 100644 --- a/cde/programs/dtmail/dtmail/FindDialog.C +++ b/cde/programs/dtmail/dtmail/FindDialog.C @@ -149,7 +149,7 @@ FindDialog::FindDialog(RoamMenuWindow *parent) : Dialog("find", parent) // // Initialize the buttons. // - _buttonData[0].label = strdup(GETMSG(DT_catd, 1, 183, "Find")); + _buttonData[0].label = strdup(CATGETS(DT_catd, 1, 183, "Find")); _buttonData[0].callback = findCallback; _buttonData[0].data = (caddr_t) this; @@ -158,32 +158,32 @@ FindDialog::FindDialog(RoamMenuWindow *parent) : Dialog("find", parent) * NL_COMMENT * This is an obsolete message. Replaced by message 220 in set 1 */ - _buttonData[1].label = strdup(GETMSG(DT_catd, 1, 184, "Find & Select All")); + _buttonData[1].label = strdup(CATGETS(DT_catd, 1, 184, "Find & Select All")); #endif /* * NL_COMMENT * This message replaces message 184 in set 1 */ - _buttonData[1].label = strdup(GETMSG(DT_catd, 1, 220, "Select All")); + _buttonData[1].label = strdup(CATGETS(DT_catd, 1, 220, "Select All")); _buttonData[1].callback = findSelectAllCallback; _buttonData[1].data = (caddr_t) this; - _buttonData[2].label = strdup(GETMSG(DT_catd, 1, 185, "Clear")); + _buttonData[2].label = strdup(CATGETS(DT_catd, 1, 185, "Clear")); _buttonData[2].callback = clearCallback; _buttonData[2].data = (caddr_t) this; - _buttonData[3].label = strdup(GETMSG(DT_catd, 1, 186, "Close")); + _buttonData[3].label = strdup(CATGETS(DT_catd, 1, 186, "Close")); _buttonData[3].callback = closeCallback; _buttonData[3].data = (caddr_t) this; - _buttonData[4].label = strdup(GETMSG(DT_catd, 1, 187, "Help")); + _buttonData[4].label = strdup(CATGETS(DT_catd, 1, 187, "Help")); _buttonData[4].callback = HelpCB; _buttonData[4].data = (caddr_t) DTMAILFINDDIALOG; - _text_labels[0] = strdup(GETMSG(DT_catd, 1, 188, "To:")); - _text_labels[1] = strdup(GETMSG(DT_catd, 1, 189, "From:")); - _text_labels[2] = strdup(GETMSG(DT_catd, 1, 190, "Subject:")); - _text_labels[3] = strdup(GETMSG(DT_catd, 1, 191, "Cc:")); + _text_labels[0] = strdup(CATGETS(DT_catd, 1, 188, "To:")); + _text_labels[1] = strdup(CATGETS(DT_catd, 1, 189, "From:")); + _text_labels[2] = strdup(CATGETS(DT_catd, 1, 190, "Subject:")); + _text_labels[3] = strdup(CATGETS(DT_catd, 1, 191, "Cc:")); // These strings should not be translated. They are // the Motif names for the widgets that will be created (they are @@ -241,7 +241,7 @@ FindDialog::createWorkArea(Widget dialog) unsigned int offset; - _name = GETMSG(DT_catd, 1, 192, "Mailer - Find"); + _name = CATGETS(DT_catd, 1, 192, "Mailer - Find"); title(_name); @@ -333,8 +333,8 @@ FindDialog::createWorkArea(Widget dialog) } - XmString strForward = XmStringCreateLocalized(GETMSG(DT_catd, 1, 193, "Forward")); - XmString strBackward = XmStringCreateLocalized(GETMSG(DT_catd, 1, 194, "Backward")); + XmString strForward = XmStringCreateLocalized(CATGETS(DT_catd, 1, 193, "Forward")); + XmString strBackward = XmStringCreateLocalized(CATGETS(DT_catd, 1, 194, "Backward")); Widget fd_direction = XmVaCreateSimpleRadioBox(fd_form, @@ -478,7 +478,7 @@ FindDialog::findMatching(Boolean findAll) * when searching for a matching message. */ - setStatus(GETMSG(DT_catd, 1, 231, "Searching...")); + setStatus(CATGETS(DT_catd, 1, 231, "Searching...")); busyCursor(); theRoamApp.busyAllWindows(NULL); @@ -620,9 +620,9 @@ FindDialog::findMatching(Boolean findAll) * one. The %d is the number of messages that matched. */ if (matchCount == 1) { - strcpy(line, GETMSG(DT_catd, 1, 232, "1 message selected")); + strcpy(line, CATGETS(DT_catd, 1, 232, "1 message selected")); } else { - sprintf(line, GETMSG(DT_catd, 1, 233, "%d messages selected"), + sprintf(line, CATGETS(DT_catd, 1, 233, "%d messages selected"), matchCount); } setStatus(line); @@ -649,7 +649,7 @@ FindDialog::findMatching(Boolean findAll) * This string is displayed on the find dialog status line when * no matching messages were found. */ - setStatus(GETMSG(DT_catd, 1, 234, "No matches were found")); + setStatus(CATGETS(DT_catd, 1, 234, "No matches were found")); return(False); } diff --git a/cde/programs/dtmail/dtmail/MailMsg.h b/cde/programs/dtmail/dtmail/MailMsg.h index d4cb11699..ce4e1d3d9 100644 --- a/cde/programs/dtmail/dtmail/MailMsg.h +++ b/cde/programs/dtmail/dtmail/MailMsg.h @@ -43,7 +43,7 @@ #ifndef MAILMSG_H #define MAILMSG_H -#include +#include
#include
/* @@ -65,16 +65,9 @@ extern nl_catd DT_catd; /* Catgets file descriptor */ #ifdef XGETTEXT #define MAILMSG(msgid, str) dgettext(NL_SET, msgid, str) #else -#define MAILMSG(msgid, str) catgets(DT_catd, NL_SET, msgid, str) +#define MAILMSG(msgid, str) CATGETS(DT_catd, NL_SET, msgid, str) #endif -#ifdef hpV4 -#define GETMSG(DT_catd, NL_SET, msgid, str) _DtCatgetsCached(DT_catd, NL_SET, msgid, str) -#else -#define GETMSG(DT_catd, NL_SET, msgid, str) catgets(DT_catd, NL_SET, msgid, str) -#endif - - /* MailBox.C msgid 100 - 199 * MBOX_* */ diff --git a/cde/programs/dtmail/dtmail/MailRetrievalOptions.C b/cde/programs/dtmail/dtmail/MailRetrievalOptions.C index 06f9d21fb..75875808e 100644 --- a/cde/programs/dtmail/dtmail/MailRetrievalOptions.C +++ b/cde/programs/dtmail/dtmail/MailRetrievalOptions.C @@ -205,7 +205,7 @@ MailRetrievalOptions::MailRetrievalOptions ( XmNcolumns, 30, XmNvalue, "", NULL); - xms = XmStringCreateLocalized(GETMSG(DT_catd, 27, 18,"INBOX folder path:")); + xms = XmStringCreateLocalized(CATGETS(DT_catd, 27, 18,"INBOX folder path:")); _inboxpath_label = XtVaCreateManagedWidget( "InboxNameLabel", xmLabelWidgetClass, _form, @@ -266,7 +266,7 @@ MailRetrievalOptions::MailRetrievalOptions ( NULL); xms = XmStringCreateLocalized( - GETMSG(Dtb_project_catd, 2, 13, "Check for new mail every:")); + CATGETS(Dtb_project_catd, 2, 13, "Check for new mail every:")); _checkfornewmail_label = XtVaCreateManagedWidget( "CheckForNewMailLabel", xmLabelWidgetClass, _form, @@ -307,7 +307,7 @@ MailRetrievalOptions::MailRetrievalOptions ( NULL); xms = XmStringCreateLocalized( - GETMSG(DT_catd, 27, 6, "Automatic (system) delivery")); + CATGETS(DT_catd, 27, 6, "Automatic (system) delivery")); _system_tb = XtVaCreateManagedWidget( "SystemTB", xmToggleButtonGadgetClass, _form, @@ -355,7 +355,7 @@ MailRetrievalOptions::MailRetrievalOptions ( NULL); xms = XmStringCreateLocalized( - GETMSG(DT_catd, 27, 7, "Mail server retrieval")); + CATGETS(DT_catd, 27, 7, "Mail server retrieval")); _server_tb = XtVaCreateManagedWidget( "UseServerTB", xmToggleButtonGadgetClass, _server_frame, @@ -400,7 +400,7 @@ MailRetrievalOptions::MailRetrievalOptions ( for (int i=0; igetWidget(); if (text) inbox_path = XmTextFieldGetString(text); if (NULL == inbox_path || 0 == strlen(inbox_path)) - return GETMSG(DT_catd, 27, 17, "Null INBOX path."); + return CATGETS(DT_catd, 27, 17, "Null INBOX path."); tmp = (char*) malloc(strlen(inbox_path)+1); for (s=inbox_path, t=tmp; *s; s++) @@ -826,7 +826,7 @@ MailRetrievalOptions::isValidInboxPath(PropUiItem* pui, void* data) inbox_path = tmp; if (NULL == inbox_path || 0 == strlen(inbox_path)) - return GETMSG(DT_catd, 27, 17, "Null INBOX path."); + return CATGETS(DT_catd, 27, 17, "Null INBOX path."); if (isalpha(inbox_path[0])) { diff --git a/cde/programs/dtmail/dtmail/MsgScrollingList.C b/cde/programs/dtmail/dtmail/MsgScrollingList.C index a90a7d7bb..a5dbc0447 100644 --- a/cde/programs/dtmail/dtmail/MsgScrollingList.C +++ b/cde/programs/dtmail/dtmail/MsgScrollingList.C @@ -442,7 +442,7 @@ MsgScrollingList::load_headers( * There is only space to display 1 character. If "N" needs to be translated, * please make sure the translation is only 1 character. */ - new_status = XmStringCreateLocalized(GETMSG(DT_catd, 1, 110, "N")); + new_status = XmStringCreateLocalized(CATGETS(DT_catd, 1, 110, "N")); read_status = XmStringCreateLocalized(" "); #endif @@ -579,7 +579,7 @@ MsgScrollingList::load_headers( * There is only space to display 1 character. If "N" needs to be translated, * please make sure the translation is only 1 character. */ - new_status = XmStringCreateLocalized(GETMSG(DT_catd, 1, 111, "N")); + new_status = XmStringCreateLocalized(CATGETS(DT_catd, 1, 111, "N")); read_status = XmStringCreateLocalized(" "); #endif @@ -873,7 +873,7 @@ MsgScrollingList::deleteSelected(Boolean silent) * of the message that gets printed if more than one message * is moved. */ - str = GETMSG(DT_catd, 3, 84, "%d messages deleted"); + str = CATGETS(DT_catd, 3, 84, "%d messages deleted"); } else { @@ -883,7 +883,7 @@ MsgScrollingList::deleteSelected(Boolean silent) * form of the message that gets printed if only one message * is moved. */ - str = GETMSG(DT_catd, 3, 85, "%d message deleted"); + str = CATGETS(DT_catd, 3, 85, "%d message deleted"); } status_message = new char[strlen(str) + 10]; sprintf(status_message, str, position_count); @@ -954,8 +954,8 @@ MsgScrollingList::copySelected( DtMailGenDialog *dialog = _parent->genDialog(); dialog->setToErrorDialog( - GETMSG(DT_catd, 3, 50, "Mailer"), - GETMSG(DT_catd, 2, 16, "No message selected.")); + CATGETS(DT_catd, 3, 50, "Mailer"), + CATGETS(DT_catd, 2, 16, "No message selected.")); dialog->post_and_return(helpId); } return(1); @@ -968,7 +968,7 @@ MsgScrollingList::copySelected( // The following is an error message. "mailrc" is the name of the // mail resource file. Translate as appropriate. // - parent()->message(GETMSG(DT_catd, 2, 15,"Error - Unable to get mailrc.")); + parent()->message(CATGETS(DT_catd, 2, 15,"Error - Unable to get mailrc.")); return(1); } @@ -1060,7 +1060,7 @@ MsgScrollingList::copySelected( // mail folder. This is the plural form of the message that gets // printed if more than one message is moved. // - str = GETMSG(DT_catd, 3, 65, "%d messages moved to %s"); + str = CATGETS(DT_catd, 3, 65, "%d messages moved to %s"); } else { // NL_COMMENT // The following sentence means %d number of mail messages have @@ -1068,7 +1068,7 @@ MsgScrollingList::copySelected( // mail folder. This is the singular form of the message that // gets printed if only one message is moved. // - str = GETMSG(DT_catd, 3, 66, "%d message moved to %s"); + str = CATGETS(DT_catd, 3, 66, "%d message moved to %s"); } } else { @@ -1078,14 +1078,14 @@ MsgScrollingList::copySelected( // copied to the %s mail folder. This is the plural form of the // message that gets printed if more than one message is copied. // - str = GETMSG(DT_catd, 3, 67, "%d messages copied to %s"); + str = CATGETS(DT_catd, 3, 67, "%d messages copied to %s"); } else { // NL_COMMENT // The following sentence means %d number of mail messages have been // copied to the %s mail folder. This is the singular form of the // message that gets printed if only one message is copied. // - str = GETMSG(DT_catd, 3, 68, "%d message copied to %s"); + str = CATGETS(DT_catd, 3, 68, "%d message copied to %s"); } } @@ -1584,7 +1584,7 @@ MsgScrollingList::display_no_message() * No mail message has been selected by the user. */ - parent()->message(GETMSG(DT_catd, 2, 16, "No message selected.")); + parent()->message(CATGETS(DT_catd, 2, 16, "No message selected.")); _displayed_item_position = 0; _selected_item_position = 0; @@ -1642,7 +1642,7 @@ MsgScrollingList::viewInSeparateWindow(DtMailEnv &mail_error) * raised in front of existing windows so the user can see it. */ parent()->message( - GETMSG( + CATGETS( DT_catd, 3, 69, "View already exists. Raising it.")); newview->displayInCurrentWorkspace(); @@ -2056,7 +2056,7 @@ MsgScrollingList::undelete_messages(MsgHndArray *tmpMHlist) // gregl - new_status and read_status are not used in this function. // either comment them out (like I'm doing) or free them. // - new_status = XmStringCreateLocalized(GETMSG(DT_catd, 1, 112, "N")); + new_status = XmStringCreateLocalized(CATGETS(DT_catd, 1, 112, "N")); read_status = XmStringCreateLocalized(" "); #endif @@ -2174,7 +2174,7 @@ MsgScrollingList::undelete_last_deleted() * There is only space to display 1 character. If "N" needs to be translated, * please make sure the translation is only 1 character. */ - new_status = XmStringCreateLocalized(GETMSG(DT_catd, 1, 113, "N")); + new_status = XmStringCreateLocalized(CATGETS(DT_catd, 1, 113, "N")); read_status = XmStringCreateLocalized(" "); #endif @@ -2515,7 +2515,7 @@ MsgScrollingList::formatHeader(DtMailHeaderLine & info, attach_symbol[1] = 0; attachment_glyph = XmStringCreate((char *)attach_symbol, "attach"); no_attachment_glyph = XmStringCreateLocalized(" "); - new_status = XmStringCreateLocalized(GETMSG(DT_catd, 1, 114, "N")); + new_status = XmStringCreateLocalized(CATGETS(DT_catd, 1, 114, "N")); read_status = XmStringCreateLocalized(" "); } @@ -2621,14 +2621,14 @@ MsgScrollingList::formatHeader(DtMailHeaderLine & info, // Refer to strftime man page for explanation of the date format. now = time(NULL); if (USE_YEAR_FORMAT_SECONDS < now - ds.dtm_date) - dateformat = GETMSG(DT_catd, 1, 259, "%a %b %d %Y"); + dateformat = CATGETS(DT_catd, 1, 259, "%a %b %d %Y"); else { #ifdef sun - dateformat = GETMSG(DT_catd, 1, 260, "%a %b %d %k:%M"); + dateformat = CATGETS(DT_catd, 1, 260, "%a %b %d %k:%M"); #else - dateformat = GETMSG(DT_catd, 1, 261, "%a %b %d %H:%M"); + dateformat = CATGETS(DT_catd, 1, 261, "%a %b %d %H:%M"); #endif } @@ -2644,7 +2644,7 @@ MsgScrollingList::formatHeader(DtMailHeaderLine & info, memset(&epoch, 0, sizeof(tm)); /* Refer to strftime man page for explanation of the date format. */ - dateformat = GETMSG(DT_catd, 1, 259, "%a %b %d %Y"); + dateformat = CATGETS(DT_catd, 1, 259, "%a %b %d %Y"); SafeStrftime(date, BUFSIZ, dateformat, &epoch); } @@ -3000,12 +3000,12 @@ MsgScrollingList::layoutLabels() #ifdef sun SafeStrftime(buf, sizeof(buf), - GETMSG(DT_catd, 1, 222, "%a %b %d %k:%M"), + CATGETS(DT_catd, 1, 222, "%a %b %d %k:%M"), tm); #else SafeStrftime(buf, sizeof(buf), - GETMSG(DT_catd, 1, 223, "%a %b %d %H:%M"), + CATGETS(DT_catd, 1, 223, "%a %b %d %H:%M"), tm); #endif diff --git a/cde/programs/dtmail/dtmail/OptCmd.C b/cde/programs/dtmail/dtmail/OptCmd.C index 5ddf70905..0dc2e5235 100644 --- a/cde/programs/dtmail/dtmail/OptCmd.C +++ b/cde/programs/dtmail/dtmail/OptCmd.C @@ -89,7 +89,7 @@ ////////////////////////////////////////////////////////// #include #include -#include +#include
#include #include @@ -204,7 +204,7 @@ opt_help_button_CB(Widget wid, XtPointer clientData, XtPointer calldata) void OptCmd::create_dlog() { theRoamApp.busyAllWindows( - GETMSG(DT_catd, 3, 78, "Initializing Mail Options...")); + CATGETS(DT_catd, 3, 78, "Initializing Mail Options...")); // make a new widget structure _opt_dlog = (DtbOptionsDialogInfo)malloc(sizeof( @@ -216,7 +216,7 @@ void OptCmd::create_dlog() /* * Open the standard message catalog for the project. */ - Dtb_project_catd = catopen(DTB_PROJECT_CATALOG, NL_CAT_LOCALE); + Dtb_project_catd = CATOPEN(DTB_PROJECT_CATALOG, NL_CAT_LOCALE); #ifdef NEVER // Not a fatal error @@ -347,16 +347,16 @@ options_set_category_pane( return; if (current_pane != NULL && props_changed) { - sprintf(buf, "%s", GETMSG(DT_catd, 15, 1, "You have made unsaved changes.\nYou may save your changes, discard your changes,\nor return to your previous place in the dialog.")); + sprintf(buf, "%s", CATGETS(DT_catd, 15, 1, "You have made unsaved changes.\nYou may save your changes, discard your changes,\nor return to your previous place in the dialog.")); cmd_ptr->genDialog()->setToQuestionDialog( - GETMSG(DT_catd, 5, 2, "Mailer"), + CATGETS(DT_catd, 5, 2, "Mailer"), buf); answer = cmd_ptr->genDialog()->post_and_return( - GETMSG(DT_catd, 15, 2, "Save"), - GETMSG(DT_catd, 1, 182, "Cancel"), - GETMSG(DT_catd, 15, 3, "Discard"), + CATGETS(DT_catd, 15, 2, "Save"), + CATGETS(DT_catd, 1, 182, "Cancel"), + CATGETS(DT_catd, 15, 3, "Discard"), DTMAILHELPERROR); if (answer == 1) { //Save @@ -451,7 +451,7 @@ void OptCmd::update_panes() // would like to reset. We need reset the subject back to the message // "Dtb_project_catd, 2, 68," - XtSetArg(args[0], XmNvalue, GETMSG(Dtb_project_catd, 2, 68, "Out of the office")); + XtSetArg(args[0], XmNvalue, CATGETS(Dtb_project_catd, 2, 68, "Out of the office")); if(tmp_ptr != NULL) XtVaSetValues(_opt_dlog->subject_tf, @@ -507,10 +507,10 @@ void OptCmd::update_source() char* helpId; int answer = 0; - genDialog()->setToErrorDialog(GETMSG(DT_catd, 2, 1, "Mailer"), - GETMSG(DT_catd, 2, 25, "There were unrecoverable syntax errors found in the ~/.mailrc file.\nMail options settings can be applied in the current session but can\nnot be saved to file.")); + genDialog()->setToErrorDialog(CATGETS(DT_catd, 2, 1, "Mailer"), + CATGETS(DT_catd, 2, 25, "There were unrecoverable syntax errors found in the ~/.mailrc file.\nMail options settings can be applied in the current session but can\nnot be saved to file.")); helpId = DTMAILHELPERROR; - genDialog()->post_and_return(GETMSG(DT_catd, 3, 5, "OK"), helpId); + genDialog()->post_and_return(CATGETS(DT_catd, 3, 5, "OK"), helpId); return; } else mail_rc->update(error); @@ -550,16 +550,16 @@ int OptCmd::doFileLockingCheck() if (is_set != use_file_locking) { - char *message = GETMSG(DT_catd, 2, 26, + char *message = CATGETS(DT_catd, 2, 26, "The value of the file locking option has changed.\nTo take immediate effect, folders need to be closed and reopened.\n o Click on 'Reopen' to reopen folders,\n making the new option take effect immediately.\n o Click on 'Continue' to avoid reopening folders.\n The new option will take effect the next time you open a folder.\n o Click on 'Cancel' to cancel the Apply and return to editing options."); genDialog()->setToQuestionDialog( - GETMSG(DT_catd, 2, 1, "Mailer"), + CATGETS(DT_catd, 2, 1, "Mailer"), message); answer = genDialog()->post_and_return( - GETMSG(DT_catd, 2, 27, "Reopen"), - GETMSG(DT_catd, 2, 29, "Cancel"), - GETMSG(DT_catd, 2, 28, "Continue"), + CATGETS(DT_catd, 2, 27, "Reopen"), + CATGETS(DT_catd, 2, 29, "Cancel"), + CATGETS(DT_catd, 2, 28, "Continue"), "AdvancedMailOptions"); // @@ -672,11 +672,11 @@ Boolean OptCmd::optionsAreValid() if (errMsg != NULL) { this->genDialog()->setToQuestionDialog( - GETMSG(DT_catd, 5, 2, "Mailer"), + CATGETS(DT_catd, 5, 2, "Mailer"), errMsg); answer = this->genDialog()->post_and_return( - GETMSG(DT_catd, 26, 5, "Continue"), + CATGETS(DT_catd, 26, 5, "Continue"), DTMAILHELPERROR); XtFree(errMsg); @@ -692,11 +692,11 @@ Boolean OptCmd::optionsAreValid() if (errMsg != NULL) { this->genDialog()->setToQuestionDialog( - GETMSG(DT_catd, 5, 2, "Mailer"), + CATGETS(DT_catd, 5, 2, "Mailer"), errMsg); answer = this->genDialog()->post_and_return( - GETMSG(DT_catd, 26, 5, "Continue"), + CATGETS(DT_catd, 26, 5, "Continue"), DTMAILHELPERROR); XtFree(errMsg); @@ -1128,7 +1128,7 @@ void OptCmd::init_advanced_pane() user_passwd = getpwuid(euid); // get passwd entry for user sprintf(label_str, "%s \"%s\" =", - GETMSG( DT_catd, 20, 2, "Use local name: "), user_passwd->pw_name); + CATGETS( DT_catd, 20, 2, "Use local name: "), user_passwd->pw_name); label_xm_str = XmStringCreateLocalized(label_str); diff --git a/cde/programs/dtmail/dtmail/RoamApp.C b/cde/programs/dtmail/dtmail/RoamApp.C index 45d1acab2..049742f31 100644 --- a/cde/programs/dtmail/dtmail/RoamApp.C +++ b/cde/programs/dtmail/dtmail/RoamApp.C @@ -380,7 +380,7 @@ int dieFromTtError(Tt_status errid, char *procname, char *errmsg, char *helpid) /* Do not die on warnings or TT_OK */ if ( tt_is_err(errid) ) { - char *title = GETMSG(DT_catd, 2, 1, "Mailer"); + char *title = CATGETS(DT_catd, 2, 1, "Mailer"); char *errmsg = tt_status_message(errid); DtMailEnv error; @@ -388,7 +388,7 @@ int dieFromTtError(Tt_status errid, char *procname, char *errmsg, char *helpid) error.logError( DTM_TRUE, - GETMSG(DT_catd, 2, 30, "%s returned ToolTalk error: %s\n"), + CATGETS(DT_catd, 2, 30, "%s returned ToolTalk error: %s\n"), procname, tt_status_message(errid)); DtMailGenDialog *exit_dialog = new DtMailGenDialog( @@ -396,7 +396,7 @@ int dieFromTtError(Tt_status errid, char *procname, char *errmsg, char *helpid) theApplication->baseWidget()); exit_dialog->setToErrorDialog(title, errmsg); if (NULL == helpid) helpid = DTMAILHELPERROR; - exit_dialog->post_and_return(GETMSG(DT_catd, 1, 1, "OK"), helpid); + exit_dialog->post_and_return(CATGETS(DT_catd, 1, 1, "OK"), helpid); XtRemoveAllCallbacks(theApplication->baseWidget(), XmNdestroyCallback); exit(1); @@ -925,12 +925,12 @@ void pspace_signal( int ) // Serious error here -- No Space on Filesystem -- sprintf(errMsg,"Insufficient paging space, \n Mailer cannot perform any operations.\n Please contact the System Administrator to \n correct the paging space problem "); genDialog->setToErrorDialog( - GETMSG(DT_catd, 1, 6, "Mailer"), + CATGETS(DT_catd, 1, 6, "Mailer"), errMsg); XtFree(errMsg); genDialog->post_and_return( - GETMSG(DT_catd, 3, 9, "OK"), + CATGETS(DT_catd, 3, 9, "OK"), NULL); delete genDialog; } @@ -1230,7 +1230,7 @@ void RoamApp::initialize(int *argcp, char **argv) roam_tt_procid = ttdt_open( &roam_tt_fd, "DTMAIL", "SunSoft", "%I", 1 ); dieFromTtError(tt_ptr_error(roam_tt_procid), "initialize.ttdt_open", - GETMSG(DT_catd, 2, 2, "ToolTalk is not initialized. Mailer cannot run without ToolTalk.\nTry starting /usr/dt/bin/dtsession, or contact your System Administrator."), + CATGETS(DT_catd, 2, 2, "ToolTalk is not initialized. Mailer cannot run without ToolTalk.\nTry starting /usr/dt/bin/dtsession, or contact your System Administrator."), DTMAILHELPCANTINITTOOLTALK); // This is for supporting old ptype where RFC_822_Message is @@ -1288,13 +1288,13 @@ void RoamApp::initialize(int *argcp, char **argv) "MailRcDialog", theApplication->baseWidget()); mailrc_dialog->setToQuestionDialog( - GETMSG(DT_catd, 2, 1, "Mailer"), - GETMSG(DT_catd, 2, 22, + CATGETS(DT_catd, 2, 1, "Mailer"), + CATGETS(DT_catd, 2, 22, "There were unrecoverable syntax errors found in the ~/.mailrc file.\nCheck for more messages on terminal. Fix the errors and restart dtmail.\nIf you choose to continue you will not be able to save any changes made\nin the options dialog to file.") ); helpId = DTMAILHELPERROR; answer = mailrc_dialog->post_and_return( - GETMSG(DT_catd, 2, 23, "Continue"), - GETMSG(DT_catd, 2, 24, "Exit"), + CATGETS(DT_catd, 2, 23, "Continue"), + CATGETS(DT_catd, 2, 24, "Exit"), helpId); if (answer == 2) { XtRemoveAllCallbacks( @@ -1330,19 +1330,19 @@ void RoamApp::initialize(int *argcp, char **argv) DtMailGenDialog *install_errDialog = new DtMailGenDialog("Dialog", theApplication->baseWidget()); - sprintf(buf, "%s", GETMSG(DT_catd, 2, 4, + sprintf(buf, "%s", CATGETS(DT_catd, 2, 4, "Mailer has not been properly installed,\n\ and cannot run because the execution group\n\ is incorrectly set.")); install_errDialog->setToErrorDialog( - GETMSG(DT_catd, 1, 6, "Mailer"), + CATGETS(DT_catd, 1, 6, "Mailer"), buf); // No choice at this state other than to OK. helpId = DTMAILHELPBADGROUPID; answer = install_errDialog->post_and_return( - GETMSG(DT_catd, 3, 9, "OK"), + CATGETS(DT_catd, 3, 9, "OK"), helpId); XtRemoveAllCallbacks( theApplication->baseWidget(), @@ -1355,7 +1355,7 @@ is incorrectly set.")); free((void*) value); _options = new OptCmd("Mail Options...", - GETMSG(DT_catd, 1, 2,"Mail Options..."), + CATGETS(DT_catd, 1, 2,"Mail Options..."), TRUE, _w); @@ -1364,7 +1364,7 @@ is incorrectly set.")); SendMsgDialog *compose = theCompose.getWin(); if (dead_letter) { - char *ttl = GETMSG(DT_catd, 1, 262, "Dead Letter Message"); + char *ttl = CATGETS(DT_catd, 1, 262, "Dead Letter Message"); compose->loadDeadLetter(dead_letter); compose->setTitle(ttl); compose->setIconTitle(ttl); @@ -1479,7 +1479,7 @@ is incorrectly set.")); // Get the vacation handle before the new RoamMenuWindow // This is for setting the Vacation title stripe on the window - _vacation = new VacationCmd("Vacation", GETMSG(DT_catd, 1, 3, "Vacation")); + _vacation = new VacationCmd("Vacation", CATGETS(DT_catd, 1, 3, "Vacation")); // DtMail only supports the "Mail" message. // If DtMail is started by ToolTalk, then we assume that the @@ -1559,7 +1559,7 @@ RoamApp::~RoamApp() } #endif - catclose(DT_catd); + CATCLOSE(DT_catd); if (_appTimeoutId) XtRemoveTimeOut(_appTimeoutId); } @@ -1724,11 +1724,11 @@ RoamApp::showBusyState( switch (busy_state) { case DtMailBusyState_AutoSave: - self->busyAllWindows(GETMSG(DT_catd, 3, 1, "Auto-saving...")); + self->busyAllWindows(CATGETS(DT_catd, 3, 1, "Auto-saving...")); break; case DtMailBusyState_NewMail: - self->busyAllWindows(GETMSG(DT_catd, 3, 86, "Checking for new mail...")); + self->busyAllWindows(CATGETS(DT_catd, 3, 86, "Checking for new mail...")); break; case DtMailBusyState_NotBusy: @@ -1782,7 +1782,7 @@ RoamApp::globalAddToCachedContainerList(char *destname) void RoamApp::globalPropChange(void) { - busyAllWindows(GETMSG(DT_catd, 1, 4, "Updating properties...")); + busyAllWindows(CATGETS(DT_catd, 1, 4, "Updating properties...")); for (int win = 0; win < _numWindows; win++) { _windows[win]->propsChanged(); @@ -2191,5 +2191,5 @@ void RoamApp::open_catalog() { Application::open_catalog(); // Open Motif Application message catalog file - DT_catd = catopen(DTMAIL_CAT, NL_CAT_LOCALE); // Open DtMail message catalog file + DT_catd = CATOPEN(DTMAIL_CAT, NL_CAT_LOCALE); // Open DtMail message catalog file } diff --git a/cde/programs/dtmail/dtmail/RoamCmds.C b/cde/programs/dtmail/dtmail/RoamCmds.C index 9a2719719..aae58f946 100644 --- a/cde/programs/dtmail/dtmail/RoamCmds.C +++ b/cde/programs/dtmail/dtmail/RoamCmds.C @@ -209,7 +209,7 @@ SearchCmd::doit() _menuwindow->normalCursor(); if (count == 0) { - _menuwindow->message(GETMSG(DT_catd, 3, 46, "Empty container")); + _menuwindow->message(CATGETS(DT_catd, 3, 46, "Empty container")); _done = TRUE; return; } @@ -833,7 +833,7 @@ UnifiedSelectFileCmd::unifiedFileSelected(char *selection) errmsg = (const char*) error; err = strdup(errmsg); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 48, "Mailer"), err); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 48, "Mailer"), err); answer = _genDialog->post_and_return(DTMAILHELPERROR); if (1 == answer) doit(); if (err) free(err); @@ -1154,7 +1154,7 @@ UnifiedSelectMailboxCmd::unifiedMailboxSelected( errmsg = (const char*) error; err = strdup(errmsg); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 48, "Mailer"), err); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 48, "Mailer"), err); answer = _genDialog->post_and_return(DTMAILHELPERROR); if (1 == answer) doit(); if (err) free(err); @@ -1213,7 +1213,7 @@ ContainerMenuCmd::doit() // Initialize mail_error. mail_error.clear(); - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 15, "Saving...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 15, "Saving...")); _menuwindow->mailbox()->save(); theRoamApp.unbusyAllWindows(); @@ -1432,7 +1432,7 @@ UndeleteCmd::doit() } // if (!_undelFromList) { _undelFromList = new UndelFromListDialog( - GETMSG(DT_catd, 1, 227, "Mailer - Deleted Messages"), + CATGETS(DT_catd, 1, 227, "Mailer - Deleted Messages"), _menuwindow); _undelFromList->initialize(); @@ -1496,7 +1496,7 @@ MoveCopyCmd::MoveCopyCmd( char *name, DtMailBoolean only_show_mailboxes) : UnifiedSelectMailboxCmd(name, label, - GETMSG(DT_catd, 1, 89, "Mailer - Other Mailboxes"), + CATGETS(DT_catd, 1, 89, "Mailer - Other Mailboxes"), "Move", active, move_callback, @@ -1539,7 +1539,7 @@ MoveCopyCmd::doit() if (!_fileBrowser) { UnifiedSelectMailboxCmd::doit(); // Customize buttons for MoveCopy dialog - move = XmStringCreateLocalized(GETMSG(DT_catd, 1, 90, "Move")); + move = XmStringCreateLocalized(CATGETS(DT_catd, 1, 90, "Move")); filter_button = XtNameToWidget(_fileBrowser, "*Apply"); _move_button = XtNameToWidget(_fileBrowser, "*OK"); @@ -1549,11 +1549,11 @@ MoveCopyCmd::doit() xmPushButtonWidgetClass, _fileBrowser, NULL); _copy_button = XtVaCreateManagedWidget( - GETMSG(DT_catd, 1, 237, "Copy"), + CATGETS(DT_catd, 1, 237, "Copy"), /*xmPushButtonWidgetClass, _fileBrowser,*/ xmPushButtonGadgetClass, _fileBrowser, XmNlabelString, - XmStringCreateLocalized(GETMSG(DT_catd, 1, 43, "Copy")), + XmStringCreateLocalized(CATGETS(DT_catd, 1, 43, "Copy")), NULL); printHelpId("Copy", _copy_button); // @@ -2084,7 +2084,7 @@ RelNoteCmd::doit() // _genDialog = new DtMailGenDialog("AboutBox", _parent->baseWidget()); // _genDialog->setToAboutDialog(); - // answer = _genDialog->post_and_return(GETMSG(DT_catd, 1, 92, "OK"), NULL); + // answer = _genDialog->post_and_return(CATGETS(DT_catd, 1, 92, "OK"), NULL); DisplayMain(_parent->baseWidget(), "Mailer", "_copyright"); } @@ -2248,7 +2248,7 @@ SaveAttachCmd::SaveAttachCmd ( char *name, :UnifiedSelectFileCmd (name, label, title, - GETMSG(DT_catd, 1, 93, "Save"), + CATGETS(DT_catd, 1, 93, "Save"), active, save_callback, clientData, @@ -2270,7 +2270,7 @@ SaveAttachCmd::SaveAttachCmd ( :UnifiedSelectFileCmd (name, label, title, - GETMSG(DT_catd, 1, 93, "Save"), + CATGETS(DT_catd, 1, 93, "Save"), active, save_callback, clientData, @@ -2292,7 +2292,7 @@ SaveAttachCmd::SaveAttachCmd ( :UnifiedSelectFileCmd (name, label, title, - GETMSG(DT_catd, 1, 93, "Save"), + CATGETS(DT_catd, 1, 93, "Save"), active, save_callback, clientData, @@ -2341,7 +2341,7 @@ SaveAsTextCmd::SaveAsTextCmd ( :UnifiedSelectFileCmd (name, label, title, - GETMSG(DT_catd, 1, 95, "Save"), + CATGETS(DT_catd, 1, 95, "Save"), active, fileCB, this, @@ -2363,7 +2363,7 @@ SaveAsTextCmd::SaveAsTextCmd ( :UnifiedSelectFileCmd (name, label, title, - GETMSG(DT_catd, 1, 95, "Save"), + CATGETS(DT_catd, 1, 95, "Save"), active, fileCB, this, @@ -2392,10 +2392,10 @@ SaveAsTextCmd::saveText(const char * filename) if (0 == status) { sprintf(buf, - GETMSG(DT_catd, 3, 47, "%s already exists.\nOverwrite?"), + CATGETS(DT_catd, 3, 47, "%s already exists.\nOverwrite?"), filename); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 3, 48, "Mailer"), buf); + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 48, "Mailer"), buf); helpId = DTMAILHELPERROR; answer = _genDialog->post_and_return(helpId); if (answer==2) { @@ -2406,10 +2406,10 @@ SaveAsTextCmd::saveText(const char * filename) if (unlink(filename) < 0) { sprintf(buf, - GETMSG(DT_catd, 3, 49, "Unable to overwrite %s.\n\ + CATGETS(DT_catd, 3, 49, "Unable to overwrite %s.\n\ Check file permissions and retry."), filename); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 50, "Mailer"), buf); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 50, "Mailer"), buf); helpId = DTMAILHELPNOOVERWRITE; _genDialog->post_and_return(helpId); delete [] buf; @@ -2421,8 +2421,8 @@ Check file permissions and retry."), int fd = SafeOpen(filename, O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd < 0) { - sprintf(buf, GETMSG(DT_catd, 3, 51, "Unable to create %s."), filename); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 52, "Mailer"), buf); + sprintf(buf, CATGETS(DT_catd, 3, 51, "Unable to create %s."), filename); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 52, "Mailer"), buf); helpId = DTMAILHELPNOCREATE; _genDialog->post_and_return(helpId); delete [] buf; @@ -2432,9 +2432,9 @@ Check file permissions and retry."), if (SafeWrite(fd, "\n", 1) < 1) { sprintf(buf, - GETMSG(DT_catd, 3, 53, "Unable to write to %s."), + CATGETS(DT_catd, 3, 53, "Unable to write to %s."), filename); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 54, "Mailer"), buf); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 54, "Mailer"), buf); helpId = DTMAILHELPNOWRITE; _genDialog->post_and_return(helpId); SafeClose(fd); @@ -2473,8 +2473,8 @@ SaveAsTextCmd::writeTextFromScrolledList(int fd) char *tmpdir = new char[MAXPATHLEN+1]; snprintf(tmpdir, MAXPATHLEN+1, "%s/%s", getenv("HOME"), DtPERSONAL_TMP_DIRECTORY); if ((tmppath = tempnam(tmpdir, "dtmail")) == NULL) { - snprintf(buf, sizeof(buf), GETMSG(DT_catd, 3, 51, "Unable to create %s."), tmpdir); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 52, "Mailer"), buf); + snprintf(buf, sizeof(buf), CATGETS(DT_catd, 3, 51, "Unable to create %s."), tmpdir); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 52, "Mailer"), buf); helpId = DTMAILHELPNOCREATE; _genDialog->post_and_return(helpId); delete [] tmpdir; @@ -2537,10 +2537,10 @@ SaveAsTextCmd::writeText(XtPointer filedes, char *text_buf) sprintf( buf, - GETMSG(DT_catd, 3, 53, "Unable to write to %s."), + CATGETS(DT_catd, 3, 53, "Unable to write to %s."), filename); helpId = DTMAILHELPNOWRITE; - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 56, "Mailer"), buf); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 56, "Mailer"), buf); _genDialog->post_and_return(helpId); #endif } @@ -2566,8 +2566,8 @@ SaveAsTextCmd::doit() DtMailGenDialog *dialog = _roam_menu_window->genDialog(); dialog->setToErrorDialog( - GETMSG(DT_catd, 3, 50, "Mailer"), - GETMSG(DT_catd, 2, 16, "No message selected.")); + CATGETS(DT_catd, 3, 50, "Mailer"), + CATGETS(DT_catd, 2, 16, "No message selected.")); dialog->post_and_return(NULL); return; @@ -2701,12 +2701,12 @@ RenameAttachCmd::RenameAttachCmd ( 0 ); - message = XmStringCreateLocalized(GETMSG(DT_catd, 1, 96, "Empty")); + message = XmStringCreateLocalized(CATGETS(DT_catd, 1, 96, "Empty")); XtVaSetValues(renameDialog, XmNselectionLabelString, message, NULL); XmStringFree(message); - XmString ok_str = XmStringCreateLocalized(GETMSG(DT_catd, 1, 97, "Rename")); + XmString ok_str = XmStringCreateLocalized(CATGETS(DT_catd, 1, 97, "Rename")); XtVaSetValues(XtParent(renameDialog), - XmNtitle, GETMSG(DT_catd, 1, 98, "Mailer - Rename"), + XmNtitle, CATGETS(DT_catd, 1, 98, "Mailer - Rename"), NULL); XtVaSetValues(renameDialog, XmNokLabelString, ok_str, @@ -2744,7 +2744,7 @@ void RenameAttachCmd::doit() renameDialog = aa->getRenameDialog(); - sprintf(buf, "%s", GETMSG(DT_catd, 3, 57, "Rename attachment as")); + sprintf(buf, "%s", CATGETS(DT_catd, 3, 57, "Rename attachment as")); message = XmStringCreateLocalized(buf); @@ -3493,9 +3493,9 @@ VacationCmd::handleForwardFile() else dialog = theRoamApp.genDialog(); - sprintf(error_buf, "%s", GETMSG(DT_catd, 1, 102, "You are already using the forwarding facility for\nsomething other than Vacation. While Vacation is\nrunning, Vacation will be appended to this other\nforwarding activity. Is it still OK to start Vacation?\0")); + sprintf(error_buf, "%s", CATGETS(DT_catd, 1, 102, "You are already using the forwarding facility for\nsomething other than Vacation. While Vacation is\nrunning, Vacation will be appended to this other\nforwarding activity. Is it still OK to start Vacation?\0")); - dialog->setToQuestionDialog(GETMSG(DT_catd, 1, 103, "Mailer"), + dialog->setToQuestionDialog(CATGETS(DT_catd, 1, 103, "Mailer"), error_buf); helpId = DTMAILHELPOKSTARTVACATION; @@ -3541,7 +3541,7 @@ VacationCmd::handleForwardFile() else dialog = theRoamApp.genDialog(); - sprintf(error_buf, "%s", GETMSG(DT_catd, 1, 104, "You are already running the vacation program in your .forward file.\nConsult documentation on how to stop it and remove it from your .forward file.\nTry this command after fixing that problem.\0")); + sprintf(error_buf, "%s", CATGETS(DT_catd, 1, 104, "You are already running the vacation program in your .forward file.\nConsult documentation on how to stop it and remove it from your .forward file.\nTry this command after fixing that problem.\0")); dialog->setToErrorDialog("Error", error_buf); helpId = DTMAILHELPREMOVEVACATION; @@ -3921,7 +3921,7 @@ VacationCmd::parseVacationMessage() if (SafeFStat(fd, &buf) < 0) { sprintf(dialog_text, "%s", - GETMSG(DT_catd, 1, 105, "Cannot open .vacation.msg file -- No write permission.")); + CATGETS(DT_catd, 1, 105, "Cannot open .vacation.msg file -- No write permission.")); dialog->setToQuestionDialog("Mailer", dialog_text); helpId = DTMAILHELPNOWRITEVACATION; answer = dialog->post_and_return(helpId); @@ -3949,8 +3949,8 @@ VacationCmd::parseVacationMessage() free_buf = 1; mbuf.buffer = new char[mbuf.size]; if (mbuf.buffer == NULL) { - dialog->setToErrorDialog(GETMSG(DT_catd, 3, 59, "No Memory"), - GETMSG(DT_catd, 3, 60, "There is not enough memory to load the existing .vacation.msg file.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 3, 59, "No Memory"), + CATGETS(DT_catd, 3, 60, "There is not enough memory to load the existing .vacation.msg file.")); helpId = DTMAILHELPNOLOADVACATION; answer = dialog->post_and_return(helpId); SafeClose(fd); @@ -3962,8 +3962,8 @@ VacationCmd::parseVacationMessage() } if (SafeRead(fd, mbuf.buffer, (unsigned int)mbuf.size) < mbuf.size) { - dialog->setToErrorDialog(GETMSG(DT_catd, 3, 61, "Mailer"), - GETMSG(DT_catd, 3, 62, "The existing .vacation.msg file appears to be corrupt.")); + dialog->setToErrorDialog(CATGETS(DT_catd, 3, 61, "Mailer"), + CATGETS(DT_catd, 3, 62, "The existing .vacation.msg file appears to be corrupt.")); helpId = DTMAILHELPCORRUPTVACATION; answer = dialog->post_and_return(helpId); SafeClose(fd); @@ -4107,7 +4107,7 @@ VacationCmd::handleMessageFile( if (msg_file_exists >= 0 && text_changed) { sprintf(dialog_text, "%s", - GETMSG(DT_catd, 1, 106, ".vacation.msg file exists. Replace with new text?")); + CATGETS(DT_catd, 1, 106, ".vacation.msg file exists. Replace with new text?")); dialog->setToQuestionDialog("Mailer", dialog_text); helpId = DTMAILHELPEXISTSVACATION; answer = dialog->post_and_return(helpId); @@ -4125,7 +4125,7 @@ VacationCmd::handleMessageFile( fd = SafeOpen(messagefile, O_WRONLY | O_CREAT); if (fd < 0) { sprintf(dialog_text, "%s", - GETMSG(DT_catd, 1, 107, "Cannot open .vacation.msg file -- No write permission.")); + CATGETS(DT_catd, 1, 107, "Cannot open .vacation.msg file -- No write permission.")); dialog->setToQuestionDialog("Mailer", dialog_text); helpId = DTMAILHELPERROR; answer = dialog->post_and_return(helpId); @@ -4142,7 +4142,7 @@ VacationCmd::handleMessageFile( * message that gets returned to the sender when vacation * is turned on. */ - subj = GETMSG(DT_catd, 1, 108, "I am on vacation"); + subj = CATGETS(DT_catd, 1, 108, "I am on vacation"); } else { buf.appendData("Subject: ", 9); buf.appendData(subj, strlen(subj)); @@ -4153,7 +4153,7 @@ VacationCmd::handleMessageFile( _subject = strdup(subj); if (!text) { - text = GETMSG(DT_catd, 1, 109, + text = CATGETS(DT_catd, 1, 109, "I'm on vacation.\nYour mail regarding \"$SUBJECT\" will be read when I return.\n"); } buf.appendData(text, strlen(text)); diff --git a/cde/programs/dtmail/dtmail/RoamMenuWindow.C b/cde/programs/dtmail/dtmail/RoamMenuWindow.C index 1c05b336c..bf6ed53b1 100644 --- a/cde/programs/dtmail/dtmail/RoamMenuWindow.C +++ b/cde/programs/dtmail/dtmail/RoamMenuWindow.C @@ -649,13 +649,13 @@ RoamMenuWindow::initialize() { fprintf( stderr, "%s", - GETMSG(DT_catd, 2, 3, + CATGETS(DT_catd, 2, 3, "Unable to initialize windows. Exiting.\n")); exit(1); } busyCursor(); - setStatus(GETMSG(DT_catd, 3, 2, "Initializing...")); + setStatus(CATGETS(DT_catd, 3, 2, "Initializing...")); // XInternAtom(XtDisplay(this->baseWidget()) ,"STRING", False); // XInternAtom(XtDisplay(this->baseWidget()) ,"MESSAGES", False); @@ -1530,18 +1530,18 @@ RoamMenuWindow::open( if (create_flag == DTM_FALSE) { sprintf(buf, - GETMSG(DT_catd, + CATGETS(DT_catd, 3, 3, "The mailbox %s does not exist.\nCreate a mailbox with this name?"), _mailbox_fullpath); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 4, "Mailer"), buf); helpId = DTMAILHELPERROR; - answer = _genDialog->post_and_return(GETMSG(DT_catd, + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 5, "OK"), - GETMSG(DT_catd, + CATGETS(DT_catd, 1, 5, "Cancel"), helpId); @@ -1560,15 +1560,15 @@ RoamMenuWindow::open( // The full file path is not valid so that we need flag // an error sprintf(buf, - GETMSG(DT_catd, + CATGETS(DT_catd, 3, 44, "Unable to create %s."), _mailbox_fullpath); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 4, "Mailer"), buf); helpId = DTMAILHELPNOCREATE; - answer = _genDialog->post_and_return(GETMSG(DT_catd, + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 5, "OK"), helpId); @@ -1581,17 +1581,17 @@ RoamMenuWindow::open( { // See if they want to take the lock. // sprintf(buf, -// GETMSG(DT_catd, 3, 6, "The mailbox %s is locked.\n\ +// CATGETS(DT_catd, 3, 6, "The mailbox %s is locked.\n\ // You can manually unlock the mailbox and try again\n\ // or contact your System Administrator."), // _mailbox_fullpath); // _genDialog->setToErrorDialog( -// GETMSG(DT_catd, 3, 7, "Mailer"), +// CATGETS(DT_catd, 3, 7, "Mailer"), // buf); // helpId = DTMAILHELPTAKELOCK; // _genDialog->post_and_return( -// GETMSG(DT_catd, 3, 8, "OK"), +// CATGETS(DT_catd, 3, 8, "OK"), // helpId); // error.setError(DTME_GetLockRefused); @@ -1608,20 +1608,20 @@ RoamMenuWindow::open( else if ((DTMailError_t)error == DTME_BadRunGroup) { - sprintf(buf, "%s", GETMSG(DT_catd, 2, 4, + sprintf(buf, "%s", CATGETS(DT_catd, 2, 4, "Mailer has not been properly installed,\n\ and cannot run because the execution group\n\ is incorrectly set.")); _genDialog->setToQuestionDialog( - GETMSG(DT_catd, 1, 6, "Mailer"), + CATGETS(DT_catd, 1, 6, "Mailer"), buf); // No choice at this state other than to OK. helpId = DTMAILHELPBADGROUPID; answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 9, "OK"), + CATGETS(DT_catd, 3, 9, "OK"), helpId); delete [] buf; return; @@ -1633,49 +1633,49 @@ is incorrectly set.")); * The %s is the name of the mailbox the user doesn't have * permission to view. */ - sprintf(buf, GETMSG(DT_catd, 2, 5, + sprintf(buf, CATGETS(DT_catd, 2, 5, "You do not have permission to view %s"), _mailbox_fullpath); _genDialog->setToQuestionDialog( - GETMSG(DT_catd, 1, 7, "Mailer"), + CATGETS(DT_catd, 1, 7, "Mailer"), buf); // No choice at this state other than to OK. helpId = DTMAILHELPNOVIEW; answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 10, "OK"), + CATGETS(DT_catd, 3, 10, "OK"), helpId); delete [] buf; return; } else if ((DTMailError_t)error == DTME_IsDirectory) { - sprintf(buf, GETMSG(DT_catd, 2, 6, + sprintf(buf, CATGETS(DT_catd, 2, 6, "The mailbox %s is a directory and can not be opened."), _mailbox_fullpath); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 1, 8, "Mailer"), + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 1, 8, "Mailer"), buf); helpId = DTMAILHELPDIRECTORYONLY; - answer = _genDialog->post_and_return(GETMSG(DT_catd, 3, 11, "OK"), + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 11, "OK"), helpId); delete [] buf; return; } else if ((DTMailError_t)error == DTME_AlreadyOpened) { - sprintf(buf, GETMSG(DT_catd,20,1, + sprintf(buf, CATGETS(DT_catd,20,1, "The mailbox %s is already open."), _mailbox_fullpath); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 1, 8, "Mailer"), + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 1, 8, "Mailer"), buf); // there is no help message for this error // open a defect and put helpId later helpId = NULL; - answer = _genDialog->post_and_return(GETMSG(DT_catd, 3, 11, "OK"), + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 11, "OK"), helpId); delete [] buf; return; @@ -1790,13 +1790,13 @@ RoamMenuWindow::propsChanged(void) displayInCurrentWorkspace(); sprintf( buf, "%s", - GETMSG(DT_catd, 99, 99,"The INBOX path has changed.\nReopen?")); + CATGETS(DT_catd, 99, 99,"The INBOX path has changed.\nReopen?")); _genDialog->setToQuestionDialog( - GETMSG(DT_catd, 3, 22, "Mailer"), + CATGETS(DT_catd, 3, 22, "Mailer"), buf); answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 29, "OK"), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 3, 29, "OK"), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPERROR); rmw = ses->getRMW(inbox_path); @@ -2119,7 +2119,7 @@ RoamMenuWindow::mapnotify() if (NULL != _msgsPopupMoveMenu) XtSetSensitive(_msgsPopupMoveMenu, FALSE); - char * readonly = GETMSG(DT_catd, 20, 3, "Read Only"); + char * readonly = CATGETS(DT_catd, 20, 3, "Read Only"); setTitle(readonly); } @@ -2224,7 +2224,7 @@ RoamMenuWindow::message( char *text ) XmString labelStr; if (text_size > 0) { - str = GETMSG(DT_catd, 3, 12, "%s"); + str = CATGETS(DT_catd, 3, 12, "%s"); buf = new char[strlen(str) + text_size + 1]; sprintf(buf, str, text); labelStr = XmStringCreateLocalized(buf); @@ -2283,7 +2283,7 @@ RoamMenuWindow::message_summary( mailrc->getValue(error, "nerdmode", &value); if (error.isSet()) { - str = GETMSG(DT_catd, 3, 13, "Message %d of %d, %d new, %d deleted"); + str = CATGETS(DT_catd, 3, 13, "Message %d of %d, %d new, %d deleted"); } else { str = "Message 0x%x of 0x%x, ignoring 0x%x, 0x%x forgotten"; @@ -2319,7 +2319,7 @@ RoamMenuWindow::message_selected( * "Message 3 of 10, 2 new, 6 deleted" * This means ??? -- Explain to translator. */ - str = GETMSG(DT_catd, 3, 14, "Message %d of %d, %d new, %d deleted"); + str = CATGETS(DT_catd, 3, 14, "Message %d of %d, %d new, %d deleted"); buf = new char[strlen(str) + 20]; sprintf(buf, str, msg_num, num_msgs, num_new, num_deleted); @@ -2395,7 +2395,7 @@ RoamMenuWindow::queryExpunge() if (NULL != _mailbox && _mailbox->mailBoxWritable(error) == DTM_TRUE) { - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 15, "Saving...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 15, "Saving...")); if (_list->get_num_deleted_messages()) { @@ -2443,21 +2443,21 @@ RoamMenuWindow::queryExpunge() */ _genDialog->setToQuestionDialog( #ifdef undef - GETMSG(DT_catd, 3, 16, "Mailer"), - GETMSG(DT_catd, 3, 17, "Destroy the messages you have marked\nfor deletion in this mailbox?")); + CATGETS(DT_catd, 3, 16, "Mailer"), + CATGETS(DT_catd, 3, 17, "Destroy the messages you have marked\nfor deletion in this mailbox?")); #endif // undef /* NL_COMMENT * This dialog comes up when the user tries to quit the * mailbox. The user is asked if they want to destroy * the deleted messages. */ - GETMSG(DT_catd, 3, 87, "Mailer - Close"), - GETMSG(DT_catd, 3, 88, "Destroy the deleted messages and close this mailbox?")); + CATGETS(DT_catd, 3, 87, "Mailer - Close"), + CATGETS(DT_catd, 3, 88, "Destroy the deleted messages and close this mailbox?")); char * helpId = DTMAILHELPDESTROYMARKMSG; int answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 89, "Destroy and Close"), - GETMSG(DT_catd, 3, 73, "Cancel"), - GETMSG(DT_catd, 3, 90, "Retain and Close"), + CATGETS(DT_catd, 3, 89, "Destroy and Close"), + CATGETS(DT_catd, 3, 73, "Cancel"), + CATGETS(DT_catd, 3, 90, "Retain and Close"), helpId); if (answer == 1) { @@ -2541,7 +2541,7 @@ RoamMenuWindow::quit(Boolean delete_win) char *msg; busyCursor(); - msg = GETMSG( + msg = CATGETS( DT_catd, 21, 22, "Close pending: waiting for task to terminate ..."); setStatus(msg); @@ -2573,7 +2573,7 @@ RoamMenuWindow::quit_silently() if (_mailbox->mailBoxWritable(error) == DTM_TRUE) { - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 15, "Saving...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 15, "Saving...")); if (_list->get_num_deleted_messages()) { // We need to deal with deleted messages, based on what the @@ -2622,7 +2622,7 @@ RoamMenuWindow::quit_silently() char *msg; busyCursor(); - msg = GETMSG( + msg = CATGETS( DT_catd, 21, 22, "Close pending: waiting for task to terminate ..."); setStatus(msg); @@ -2680,7 +2680,7 @@ void RoamMenuWindow::view_mail_file(char *filename, DtMailBoolean create) char *plus_filename = NULL; char *relative_filename = NULL; - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 20, "Opening mailbox...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 20, "Opening mailbox...")); // If the first character of destname is alphanumeric, we can // safely assume that it is relative to the root folder directory. @@ -2715,9 +2715,9 @@ void RoamMenuWindow::view_mail_file(char *filename, DtMailBoolean create) sprintf( buf, - GETMSG(DT_catd, 3, 3, "The mailbox %s does not exist.\nCreate a mailbox with this name?"), + CATGETS(DT_catd, 3, 3, "The mailbox %s does not exist.\nCreate a mailbox with this name?"), filename); - dialog->setToQuestionDialog(GETMSG(DT_catd, 3, 22, "Mailer"), buf); + dialog->setToQuestionDialog(CATGETS(DT_catd, 3, 22, "Mailer"), buf); answer = dialog->post_and_return(DTMAILHELPERROR); delete [] buf; if (2 == answer) goto do_unbusy; @@ -2749,7 +2749,7 @@ RoamMenuWindow::move_callback(void *client_data, char *selection) mail_error.clear(); RoamMenuWindow *obj = (RoamMenuWindow *) client_data; - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 15, "Saving...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 15, "Saving...")); obj->_mailbox->save(); theRoamApp.unbusyAllWindows(); @@ -2766,7 +2766,7 @@ RoamMenuWindow::copy_callback(void *client_data, char *selection) mail_error.clear(); RoamMenuWindow *obj = (RoamMenuWindow *) client_data; - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 15, "Saving...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 15, "Saving...")); obj->_mailbox->save(); theRoamApp.unbusyAllWindows(); @@ -2793,9 +2793,9 @@ RoamMenuWindow::create_new_container(char *filename) char *buf = new char[2048]; sprintf( buf, - GETMSG(DT_catd, 3, 21, "%s already exists.\nOverwrite?"), + CATGETS(DT_catd, 3, 21, "%s already exists.\nOverwrite?"), filename); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 3, 22, "Mailer"), buf); + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 22, "Mailer"), buf); answer = _genDialog->post_and_return(DTMAILHELPERROR); if (answer == 2) { delete [] buf; @@ -2805,11 +2805,11 @@ RoamMenuWindow::create_new_container(char *filename) if (unlink(filename) < 0) { sprintf(buf, - GETMSG(DT_catd, 3, 23, + CATGETS(DT_catd, 3, 23, "Unable to overwrite %s.\nCheck file permissions and retry."), filename); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 3, 24, "Mailer"), buf); + _genDialog->setToErrorDialog(CATGETS(DT_catd, 3, 24, "Mailer"), buf); (void) _genDialog->post_and_return(DTMAILHELPERROR); delete [] buf; return; @@ -2851,7 +2851,7 @@ RoamMenuWindow::addToRowOfButtons() _delete_button = new DeleteCmd ( "Delete", - GETMSG(DT_catd, 1, 9, "Delete"), + CATGETS(DT_catd, 1, 9, "Delete"), TRUE, this ); ci = new ButtonInterface (_rowOfButtons, _delete_button); w = ci->baseWidget(); @@ -2868,7 +2868,7 @@ RoamMenuWindow::addToRowOfButtons() _next_button = new NextCmd ( "Next", - GETMSG(DT_catd, 1, 10, "Next"), + CATGETS(DT_catd, 1, 10, "Next"), TRUE, this ); ci = new ButtonInterface (_rowOfButtons, _next_button); w = ci->baseWidget(); @@ -2887,7 +2887,7 @@ RoamMenuWindow::addToRowOfButtons() _previous_button = new PrevCmd ( "Previous", - GETMSG(DT_catd, 1, 11, "Previous"), + CATGETS(DT_catd, 1, 11, "Previous"), TRUE, this ); ci = new ButtonInterface (_rowOfButtons, _previous_button); w = ci->baseWidget(); @@ -2906,7 +2906,7 @@ RoamMenuWindow::addToRowOfButtons() _replySender_button = new ReplyCmd ( "Reply to Sender", - GETMSG(DT_catd, 1, 12, "Reply to Sender"), + CATGETS(DT_catd, 1, 12, "Reply to Sender"), TRUE, this, FALSE ); @@ -2926,7 +2926,7 @@ RoamMenuWindow::addToRowOfButtons() prev_widget = w; - _print_button = new PrintCmd ( "Print", GETMSG(DT_catd, 1, 13, "Print"), + _print_button = new PrintCmd ( "Print", CATGETS(DT_catd, 1, 13, "Print"), TRUE, TRUE, this); ci = new ButtonInterface (_rowOfButtons, _print_button); w = ci->baseWidget(); @@ -3000,7 +3000,7 @@ RoamMenuWindow::addToRowOfLabels(MsgScrollingList *msglist) XmStringFree(spaces); spaces = XmStringCreateLocalized(" "); - basexms = XmStringCreateLocalized(GETMSG(DT_catd, 1, 14, "Sender")); + basexms = XmStringCreateLocalized(CATGETS(DT_catd, 1, 14, "Sender")); _sender_xms = XmStringConcat(basexms, spaces); _sender_key_xms = XmStringConcat(basexms, spaces_arrow); XmStringFree(basexms); @@ -3029,7 +3029,7 @@ RoamMenuWindow::addToRowOfLabels(MsgScrollingList *msglist) // printHelpId("Sender", _sender_lbl); // XtAddCallback(_sender_lbl, XmNhelpCallback, HelpCB, helpId); - basexms = XmStringCreateLocalized(GETMSG(DT_catd, 1, 15, "Subject")); + basexms = XmStringCreateLocalized(CATGETS(DT_catd, 1, 15, "Subject")); _subject_xms = XmStringConcat(basexms, spaces); _subject_key_xms = XmStringConcat(basexms, spaces_arrow); XmStringFree(basexms); @@ -3058,7 +3058,7 @@ RoamMenuWindow::addToRowOfLabels(MsgScrollingList *msglist) // printHelpId("Subject", _subject_lbl); // XtAddCallback(_subject_lbl, XmNhelpCallback, HelpCB, helpId); - basexms = XmStringCreateLocalized(GETMSG(DT_catd, 1, 16,"Date and Time")); + basexms = XmStringCreateLocalized(CATGETS(DT_catd, 1, 16,"Date and Time")); _date_xms = XmStringConcat(basexms, spaces); _date_key_xms = XmStringConcat(basexms, spaces_arrow); XmStringFree(basexms); @@ -3087,7 +3087,7 @@ RoamMenuWindow::addToRowOfLabels(MsgScrollingList *msglist) // printHelpId("DateTime", _subject_lbl); // XtAddCallback(_date_lbl, XmNhelpCallback, HelpCB, helpId); - basexms = XmStringCreateLocalized(GETMSG(DT_catd, 1, 17, "Size")); + basexms = XmStringCreateLocalized(CATGETS(DT_catd, 1, 17, "Size")); _size_xms = XmStringConcat(basexms, spaces); _size_key_xms = XmStringConcat(basexms, spaces_arrow); XmStringFree(basexms); @@ -3132,11 +3132,11 @@ RoamMenuWindow::addToRowOfMessageStatus() // Size of first label - labelStr1 = XmStringCreateLocalized(GETMSG(DT_catd, 3, 25, + labelStr1 = XmStringCreateLocalized(CATGETS(DT_catd, 3, 25, "Loading container...")); labelStr2 = XmStringCreateLocalized( - GETMSG(DT_catd, 3, 26, "Folder Summary Information")); + CATGETS(DT_catd, 3, 26, "Folder Summary Information")); _message = XtCreateManagedWidget( "Message_Status_Text", xmLabelWidgetClass, @@ -3292,15 +3292,15 @@ RoamMenuWindow::createOpenContainerList(CmdList * open_container) _open_container_inbox = new OpenInboxCmd( "Inbox", - GETMSG(DT_catd, 1, 221, "Inbox"), + CATGETS(DT_catd, 1, 221, "Inbox"), (FALSE == this->inbox()), this); _open_container_other = new UnifiedSelectMailboxCmd( "Open", - GETMSG(DT_catd, 1, 246, "Other Mailboxes..."), - GETMSG(DT_catd, 1, 26, "Mailer - Open"), - GETMSG(DT_catd, 1, 27, "Open"), + CATGETS(DT_catd, 1, 246, "Other Mailboxes..."), + CATGETS(DT_catd, 1, 26, "Mailer - Open"), + CATGETS(DT_catd, 1, 27, "Open"), TRUE, RoamMenuWindow::file_selection_callback, this, @@ -3383,34 +3383,34 @@ RoamMenuWindow::construct_file_menu() // Create the "Container" item in the menubar. And fill // with items below the "Container" item in the menubar. - cmdList = new CmdList( "Mailbox", GETMSG(DT_catd, 1, 18, "Mailbox") ); + cmdList = new CmdList( "Mailbox", CATGETS(DT_catd, 1, 18, "Mailbox") ); _file_cmdlist = cmdList; _file_check_new_mail = new CheckForNewMailCmd( "Check for New Mail", - GETMSG(DT_catd, 1, 19, "Check for New Mail"), + CATGETS(DT_catd, 1, 19, "Check for New Mail"), TRUE, this); if (this->inbox()) { // Deactivate the Open Inbox item _file_open_inbox = new OpenInboxCmd( "Open Inbox", - GETMSG(DT_catd, 1, 20, "Open Inbox"), + CATGETS(DT_catd, 1, 20, "Open Inbox"), FALSE, this); } else { // Activate the Open Inbox item. _file_open_inbox = new OpenInboxCmd( "Open Inbox", - GETMSG(DT_catd, 1, 21, "Open Inbox"), + CATGETS(DT_catd, 1, 21, "Open Inbox"), TRUE, this); } _file_new_container = new UnifiedSelectMailboxCmd( "New...", - GETMSG(DT_catd, 1, 22, "New..."), - GETMSG(DT_catd, 1, 23, "Mailer - New"), - GETMSG(DT_catd, 1, 24, "New"), + CATGETS(DT_catd, 1, 22, "New..."), + CATGETS(DT_catd, 1, 23, "Mailer - New"), + CATGETS(DT_catd, 1, 24, "New"), TRUE, RoamMenuWindow::create_container_callback, this, @@ -3419,9 +3419,9 @@ RoamMenuWindow::construct_file_menu() #if defined(USE_OLD_FILE_OPEN) _file_open = new UnifiedSelectMailboxCmd( "Open...", - GETMSG(DT_catd, 1, 25, "Open..."), - GETMSG(DT_catd, 1, 26, "Mailer - Open"), - GETMSG(DT_catd, 1, 27, "Open"), + CATGETS(DT_catd, 1, 25, "Open..."), + CATGETS(DT_catd, 1, 26, "Mailer - Open"), + CATGETS(DT_catd, 1, 27, "Open"), TRUE, RoamMenuWindow::file_selection_callback, this, @@ -3430,12 +3430,12 @@ RoamMenuWindow::construct_file_menu() _open_container_cmdlist = new CmdList( "Open Container", - GETMSG(DT_catd, 1, 245, "Open")); + CATGETS(DT_catd, 1, 245, "Open")); createOpenContainerList(_open_container_cmdlist); _file_destroy_deleted_msgs = new DestroyCmd( "Destroy Deleted Message", - GETMSG(DT_catd, 1, 28, + CATGETS(DT_catd, 1, 28, "Destroy Deleted Messages"), TRUE, this); @@ -3443,7 +3443,7 @@ RoamMenuWindow::construct_file_menu() _file_quit = new QuitCmd ( "Close", - GETMSG(DT_catd, 1, 29, "Close"), + CATGETS(DT_catd, 1, 29, "Close"), TRUE, this); @@ -3490,7 +3490,7 @@ RoamMenuWindow::createCopyList(CmdList * copy_to) _copyto_inbox = new CopyToInboxCmd( "Inbox", - GETMSG(DT_catd, 1, 221, "Inbox"), + CATGETS(DT_catd, 1, 221, "Inbox"), TRUE, this); @@ -3516,7 +3516,7 @@ RoamMenuWindow::createCopyList(CmdList * copy_to) _move_copy_button = new MoveCopyCmd ( "Other Mailboxes...", - GETMSG(DT_catd, 1, 65, "Other Mailboxes..."), + CATGETS(DT_catd, 1, 65, "Other Mailboxes..."), TRUE, RoamMenuWindow::move_callback, RoamMenuWindow::copy_callback, @@ -3524,8 +3524,8 @@ RoamMenuWindow::createCopyList(CmdList * copy_to) this->baseWidget(), only_show_mailboxes); _copyto_other = new CopyCmd( - GETMSG(DT_catd, 1, 237, "Copy"), - GETMSG(DT_catd, 1, 65, "Other Mailboxes..."), + CATGETS(DT_catd, 1, 237, "Copy"), + CATGETS(DT_catd, 1, 65, "Other Mailboxes..."), TRUE, this, (MoveCopyCmd *) _move_copy_button); @@ -3605,55 +3605,55 @@ RoamMenuWindow::construct_message_menu() _msg_open = new OpenMsgCmd( "Open", - GETMSG(DT_catd, 1, 30, "Open"), + CATGETS(DT_catd, 1, 30, "Open"), TRUE, this); _msg_save_as = new SaveAsTextCmd ( "Save As Text...", - GETMSG(DT_catd, 1, 31, "Save As Text..."), - GETMSG(DT_catd, 1, 32, "Mailer - Message - Save As Text"), + CATGETS(DT_catd, 1, 31, "Save As Text..."), + CATGETS(DT_catd, 1, 32, "Mailer - Message - Save As Text"), TRUE, get_editor()->textEditor(), this, this->baseWidget()); - _copyto_cmdlist = new CmdList("Copy To", GETMSG(DT_catd, 1, 33, "Copy To")); + _copyto_cmdlist = new CmdList("Copy To", CATGETS(DT_catd, 1, 33, "Copy To")); createCopyList(_copyto_cmdlist); _msg_print = new PrintCmd( "Print...", - GETMSG(DT_catd, 1, 34, "Print..."), + CATGETS(DT_catd, 1, 34, "Print..."), TRUE, FALSE, this); _msg_find = new FindCmd ( "Find...", - GETMSG(DT_catd, 1, 35, "Find..."), + CATGETS(DT_catd, 1, 35, "Find..."), TRUE, this ); _msg_select_all = new SelectAllCmd ( "Select All", - GETMSG(DT_catd, 1, 36, "Select All"), + CATGETS(DT_catd, 1, 36, "Select All"), TRUE, this ); _msg_delete = new DeleteCmd( "Delete", - GETMSG(DT_catd, 1, 37, "Delete"), + CATGETS(DT_catd, 1, 37, "Delete"), TRUE, this); _msg_undelete_last = new UndeleteCmd ( "Undelete Last", - GETMSG(DT_catd, 1, 38, "Undelete Last"), + CATGETS(DT_catd, 1, 38, "Undelete Last"), TRUE, this, FALSE ); _msg_undelete_from_list = new UndeleteCmd( "Undelete From List...", - GETMSG(DT_catd, 1, 39, + CATGETS(DT_catd, 1, 39, "Undelete From List..."), TRUE, this, TRUE); // Message Menu - cmdList = new CmdList( "Message", GETMSG(DT_catd, 1, 40, "Message") ); + cmdList = new CmdList( "Message", CATGETS(DT_catd, 1, 40, "Message") ); _msg_cmdlist = cmdList; cmdList->add(_msg_open); @@ -3690,7 +3690,7 @@ RoamMenuWindow::construct_message_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Messages", - GETMSG(DT_catd, 1, 42, "Mailer - Messages"), TRUE); + CATGETS(DT_catd, 1, 42, "Mailer - Messages"), TRUE); _msgsPopup_separator = new SeparatorCmd( "Separator","Separator", TRUE ); _msgsPopup_cmdlist->add(title); _msgsPopup_cmdlist->add(_msgsPopup_separator); @@ -3729,19 +3729,19 @@ RoamMenuWindow::construct_edit_menu() _edit_copy = new EditCopyCmd( "Copy", - GETMSG(DT_catd, 1, 43, "Copy"), + CATGETS(DT_catd, 1, 43, "Copy"), TRUE, this ); _edit_select_all = new EditSelectAllCmd( "Select All", - GETMSG(DT_catd, 1, 44, "Select All"), + CATGETS(DT_catd, 1, 44, "Select All"), TRUE, this ); - cmdList = new CmdList("Edit", GETMSG(DT_catd, 1, 45, "Edit")); + cmdList = new CmdList("Edit", CATGETS(DT_catd, 1, 45, "Edit")); _edit_cmdlist = cmdList; cmdList->add(_edit_copy); @@ -3760,7 +3760,7 @@ RoamMenuWindow::construct_text_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Text", - GETMSG(DT_catd, 1, 46, "Mailer - Text"), TRUE); + CATGETS(DT_catd, 1, 46, "Mailer - Text"), TRUE); _textPopup_separator = new SeparatorCmd( "Separator","Separator", TRUE ); _textPopup_cmdlist->add(title); @@ -3784,46 +3784,46 @@ void RoamMenuWindow::construct_view_menu() _view_next = new NextCmd ( "Next", - GETMSG(DT_catd, 1, 47, "Next"), TRUE, this ); + CATGETS(DT_catd, 1, 47, "Next"), TRUE, this ); _view_previous = new PrevCmd ( "Previous", - GETMSG(DT_catd, 1, 48, "Previous"), TRUE, this ); + CATGETS(DT_catd, 1, 48, "Previous"), TRUE, this ); _view_abbrev_headers = new AbbrevHeadersCmd( "Abbreviated Headers", - GETMSG(DT_catd, 1, 49, "Abbreviated Headers"), + CATGETS(DT_catd, 1, 49, "Abbreviated Headers"), this); _view_sortTD = new SortCmd ("By Date/Time", - GETMSG(DT_catd, 1, 50, "By Date/Time"), + CATGETS(DT_catd, 1, 50, "By Date/Time"), TRUE, this, SortTimeDate); _view_sortSender = new SortCmd ("By Sender", - GETMSG(DT_catd, 1, 51, "By Sender"), + CATGETS(DT_catd, 1, 51, "By Sender"), TRUE, this, SortSender); _view_sortSubject = new SortCmd ("By Subject", - GETMSG(DT_catd, 1, 52, "By Subject"), + CATGETS(DT_catd, 1, 52, "By Subject"), TRUE, this, SortSubject); _view_sortSize = new SortCmd ("By Size", - GETMSG(DT_catd, 1, 53, "By Size"), + CATGETS(DT_catd, 1, 53, "By Size"), TRUE, this, SortSize); _view_sortStatus = new SortCmd ("By Status", - GETMSG(DT_catd, 1, 54, "By Status"), + CATGETS(DT_catd, 1, 54, "By Status"), TRUE, this, SortStatus); // View Menu - cmdList = new CmdList( "View", GETMSG(DT_catd, 1, 55, "View") ); + cmdList = new CmdList( "View", CATGETS(DT_catd, 1, 55, "View") ); _view_cmdlist = cmdList; cmdList->add(_view_next); @@ -3853,46 +3853,46 @@ RoamMenuWindow::construct_compose_menu() _comp_new = new ComposeCmd ( "New Message", - GETMSG(DT_catd, 1, 56, "New Message"), + CATGETS(DT_catd, 1, 56, "New Message"), TRUE, this ); _comp_new_include = new ForwardCmd ( "New, Include All", - GETMSG(DT_catd, 1, 57, "New, Include All"), + CATGETS(DT_catd, 1, 57, "New, Include All"), TRUE, this, FALSE ); _comp_forward = new ForwardCmd ( "Forward Message", - GETMSG(DT_catd, 1, 58, "Forward Message"), + CATGETS(DT_catd, 1, 58, "Forward Message"), TRUE, this, TRUE ); _comp_replySender = new ReplyCmd ( "Reply to Sender", - GETMSG(DT_catd, 1, 59, "Reply to Sender"), + CATGETS(DT_catd, 1, 59, "Reply to Sender"), TRUE, this, FALSE ); _comp_replyAll = new ReplyAllCmd ( "Reply to All", - GETMSG(DT_catd, 1, 60, "Reply to All"), + CATGETS(DT_catd, 1, 60, "Reply to All"), TRUE, this, FALSE ); _comp_replySinclude= new ReplyCmd ( "Reply to Sender, Include", - GETMSG(DT_catd, 1, 61, "Reply to Sender, Include"), + CATGETS(DT_catd, 1, 61, "Reply to Sender, Include"), TRUE, this, TRUE ); _comp_replyAinclude= new ReplyAllCmd ( "Reply to All, Include", - GETMSG(DT_catd, 1, 62, "Reply to All, Include"), + CATGETS(DT_catd, 1, 62, "Reply to All, Include"), TRUE, this, TRUE ); @@ -3900,7 +3900,7 @@ RoamMenuWindow::construct_compose_menu() // Compose Menu - cmdList = new CmdList( "Compose", GETMSG(DT_catd, 1, 63, "Compose") ); + cmdList = new CmdList( "Compose", CATGETS(DT_catd, 1, 63, "Compose") ); _comp_cmdlist = cmdList; cmdList->add(_comp_new); cmdList->add(_comp_new_include); @@ -3929,21 +3929,21 @@ RoamMenuWindow::construct_move_menu() if (_move_cmdlist != NULL) delete _move_cmdlist; - _move_cmdlist = new CmdList( "Move", GETMSG(DT_catd, 1, 64, "Move") ); + _move_cmdlist = new CmdList( "Move", CATGETS(DT_catd, 1, 64, "Move") ); _move_separator = new SeparatorCmd("Separator","Separator", TRUE ); _move_inbox = new MoveToInboxCmd( "Inbox", - GETMSG(DT_catd, 1, 221, "Inbox"), + CATGETS(DT_catd, 1, 221, "Inbox"), TRUE, this); // We expect _move_copy_button to have been initialized already when // we constructed the copy menu. _move_other = new MoveCmd( - GETMSG(DT_catd, 1, 90, "Move"), - GETMSG(DT_catd, 1, 65, "Other Mailboxes..."), + CATGETS(DT_catd, 1, 90, "Move"), + CATGETS(DT_catd, 1, 65, "Other Mailboxes..."), TRUE, this, (MoveCopyCmd *) _move_copy_button); @@ -4032,8 +4032,8 @@ RoamMenuWindow::construct_attachment_menu() _att_save = new SaveAttachCmd ( "Save As...", - GETMSG(DT_catd, 1, 66, "Save As..."), - GETMSG(DT_catd, 1, 67, "Mailer - Attachments - Save As"), + CATGETS(DT_catd, 1, 66, "Save As..."), + CATGETS(DT_catd, 1, 67, "Mailer - Attachments - Save As"), FALSE, RoamMenuWindow::save_attachment_callback, this, @@ -4041,14 +4041,14 @@ RoamMenuWindow::construct_attachment_menu() _att_select_all = new SelectAllAttachsCmd( "Select All", - GETMSG( + CATGETS( DT_catd, 1, 68, "Select All" ), this); _att_cmdlist = new CmdList( "Attachments", - GETMSG( + CATGETS( DT_catd, 1, 69, "Attachments" ) @@ -4070,7 +4070,7 @@ RoamMenuWindow::construct_attachment_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Attachments", - GETMSG(DT_catd, 1, 70, "Mailer - Attachments"), TRUE); + CATGETS(DT_catd, 1, 70, "Mailer - Attachments"), TRUE); _attPopup_separator = new SeparatorCmd( "Separator","Separator", TRUE ); _attPopup_cmdlist->add(title); @@ -4091,19 +4091,19 @@ RoamMenuWindow::construct_help_menu() // Separator for menu items _help_separator= new SeparatorCmd( "Separator","Separator", TRUE ); - _help_overview = new OnAppCmd("Overview", GETMSG(DT_catd, 1, 71, "Overview"), + _help_overview = new OnAppCmd("Overview", CATGETS(DT_catd, 1, 71, "Overview"), TRUE, this); - _help_tasks = new TasksCmd("Tasks", GETMSG(DT_catd, 1, 72, "Tasks"), + _help_tasks = new TasksCmd("Tasks", CATGETS(DT_catd, 1, 72, "Tasks"), TRUE, this); _help_reference = new ReferenceCmd("Reference", - GETMSG(DT_catd, 1, 73, "Reference"), + CATGETS(DT_catd, 1, 73, "Reference"), TRUE, this); - _help_on_item = new OnItemCmd("On Item", GETMSG(DT_catd, 1, 74, "On Item"), + _help_on_item = new OnItemCmd("On Item", CATGETS(DT_catd, 1, 74, "On Item"), TRUE, this); _help_using_help = new UsingHelpCmd("Using Help", - GETMSG(DT_catd, 1, 75, "Using Help"), + CATGETS(DT_catd, 1, 75, "Using Help"), TRUE, this); - cmdList = new CmdList( "Help", GETMSG(DT_catd, 1, 76, "Help") ); + cmdList = new CmdList( "Help", CATGETS(DT_catd, 1, 76, "Help") ); _help_cmdlist = cmdList; cmdList->add ( _help_overview ); @@ -4117,7 +4117,7 @@ RoamMenuWindow::construct_help_menu() cmdList->add ( _help_separator ); _help_about_mailer = new RelNoteCmd("About Mailer...", - GETMSG(DT_catd, 1, 77, "About Mailer..."), + CATGETS(DT_catd, 1, 77, "About Mailer..."), TRUE, this); cmdList->add ( _help_about_mailer ); @@ -4168,7 +4168,7 @@ RoamMenuWindow::load_mailbox( // Now load the messages into the scrolling list. // This will get the DtMailMessageHandles into the _msgs array and // it will also get their XmStrings into the CharArray of the _list. - theRoamApp.busyAllWindows(GETMSG(DT_catd, 3, 27, "Loading...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 3, 27, "Loading...")); // Call load_headers() to get the XmStrings into the XmList! @@ -4183,7 +4183,7 @@ RoamMenuWindow::load_mailbox( // If no messages if (count == 0) { - this->message(GETMSG(DT_catd, 3, 28, "Empty container")); + this->message(CATGETS(DT_catd, 3, 28, "Empty container")); setIconName(EmptyIcon); } @@ -4286,12 +4286,12 @@ RoamMenuWindow::syncViewAndStore( case DTMC_BADSTATE: - errmsg = GETMSG(DT_catd, 1, 238, "Mailer is confused about the state of this mailbox.\nIt may be that another process has rewritten this mailbox in an unexpected way.\n\nSelecting OK will cause the Mailer to close and reopen the mailbox.\nNOTE that any changes made to the mailbox since the last save may be lost."); + errmsg = CATGETS(DT_catd, 1, 238, "Mailer is confused about the state of this mailbox.\nIt may be that another process has rewritten this mailbox in an unexpected way.\n\nSelecting OK will cause the Mailer to close and reopen the mailbox.\nNOTE that any changes made to the mailbox since the last save may be lost."); this->_genDialog->setToErrorDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), errmsg); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 3, 29, "OK"), + CATGETS(DT_catd, 3, 29, "OK"), DTMAILHELPUNKNOWNSTATE); this->reopen_mail_file(); @@ -4301,13 +4301,13 @@ RoamMenuWindow::syncViewAndStore( case DTMC_ACCESSFAILED: - errmsg = GETMSG(DT_catd, 1, 239, "Mailer can no longer access this mailbox.\nIt may be that another process has deleted the mailbox file.\n\nSelecting OK will cause the Mailer to close and reopen the mailbox.\nNOTE that any changes made to the mailbox since the last save may be lost.\n\nSelecting CANCEL will leave the mailbox unchanged."); + errmsg = CATGETS(DT_catd, 1, 239, "Mailer can no longer access this mailbox.\nIt may be that another process has deleted the mailbox file.\n\nSelecting OK will cause the Mailer to close and reopen the mailbox.\nNOTE that any changes made to the mailbox since the last save may be lost.\n\nSelecting CANCEL will leave the mailbox unchanged."); this->_genDialog->setToErrorDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), errmsg); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 3, 29, "OK"), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 3, 29, "OK"), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPUNKNOWNSTATE); this->normalCursor(); if (answer == 1) @@ -4327,11 +4327,11 @@ RoamMenuWindow::syncViewAndStore( sprintf(buffer, "%s", errmsgarg); this->_genDialog->setToTextFieldDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), buffer, DTM_TRUE); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 3, 29, "Ok"), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 3, 29, "Ok"), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPUNKNOWNSTATE); this->normalCursor(); delete [] buffer; @@ -4356,15 +4356,15 @@ RoamMenuWindow::syncViewAndStore( char *buffer = new char[2048]; char *errmsgarg = va_arg(args, char*); - errmsg = GETMSG(DT_catd, 1, 256, "Mail server access failed:\n%s"); + errmsg = CATGETS(DT_catd, 1, 256, "Mail server access failed:\n%s"); sprintf(buffer, errmsg, errmsgarg); this->_genDialog->setToErrorDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), buffer); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 1, 257, "Options..."), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 1, 257, "Options..."), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPUNKNOWNSTATE); this->normalCursor(); delete [] buffer; @@ -4386,15 +4386,15 @@ RoamMenuWindow::syncViewAndStore( char *errmsgarg = va_arg(args, char*); errmsg = - GETMSG(DT_catd, 1, 258, "User Getmail command failed:\n%s"); + CATGETS(DT_catd, 1, 258, "User Getmail command failed:\n%s"); sprintf(buffer, errmsg, errmsgarg); this->_genDialog->setToErrorDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), buffer); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 1, 257, "Options..."), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 1, 257, "Options..."), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPUNKNOWNSTATE); this->normalCursor(); delete [] buffer; @@ -4426,11 +4426,11 @@ RoamMenuWindow::syncViewAndStore( sprintf(buffer, "%s", errmsgarg); this->_genDialog->setToErrorDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), buffer); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 1, 257, "Options..."), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 1, 257, "Options..."), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPUNKNOWNSTATE); this->normalCursor(); delete [] buffer; @@ -4447,14 +4447,14 @@ RoamMenuWindow::syncViewAndStore( case DTMC_INODECHANGED: - errmsg = GETMSG(DT_catd, 1, 240, "Mailer can no longer access this mailbox.\nAnother process has rewritten the mailbox file changing the inode.\n\nSelecting OK will cause the Mailer to close and reopen the mailbox.\nNOTE that any changes made to the mailbox since the last save may be lost.\n\nSelecting CANCEL will leave the mailbox unchanged."); + errmsg = CATGETS(DT_catd, 1, 240, "Mailer can no longer access this mailbox.\nAnother process has rewritten the mailbox file changing the inode.\n\nSelecting OK will cause the Mailer to close and reopen the mailbox.\nNOTE that any changes made to the mailbox since the last save may be lost.\n\nSelecting CANCEL will leave the mailbox unchanged."); this->_genDialog->setToErrorDialog( - GETMSG(DT_catd, 2, 10, "Mailer"), + CATGETS(DT_catd, 2, 10, "Mailer"), errmsg); answer = this->_genDialog->post_and_return( - GETMSG(DT_catd, 3, 29, "OK"), - GETMSG(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 3, 29, "OK"), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPUNKNOWNSTATE); this->normalCursor(); if (answer == 1) @@ -4477,10 +4477,10 @@ RoamMenuWindow::syncViewAndStore( // The file is lock by another mailer. // Should we ask for the lock? - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 3, 16, "Mailer"), - GETMSG(DT_catd, 3, 82, "Someone else is using this mailbox.\nWould you like to demand exclusive access?")); - answer = _genDialog->post_and_return(GETMSG(DT_catd, 3, 18, "OK"), - GETMSG(DT_catd, 3, 19, "Cancel"), DTMAILHELPTAKELOCK); + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 16, "Mailer"), + CATGETS(DT_catd, 3, 82, "Someone else is using this mailbox.\nWould you like to demand exclusive access?")); + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 18, "OK"), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPTAKELOCK); this->normalCursor(); if (answer == 1) { @@ -4493,10 +4493,10 @@ RoamMenuWindow::syncViewAndStore( // We are not able to obtain a TT lock on this folder, // ask user if he wants to open it as read only. - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 3, 16, "Mailer"), - GETMSG(DT_catd, 3, 83, "Mailer is unable to obtain exclusive access to this mailbox.\nWould you like to open this mailbox read-only?")); - answer = _genDialog->post_and_return(GETMSG(DT_catd, 3, 18, "OK"), - GETMSG(DT_catd, 3, 19, "Cancel"), + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 16, "Mailer"), + CATGETS(DT_catd, 3, 83, "Mailer is unable to obtain exclusive access to this mailbox.\nWould you like to open this mailbox read-only?")); + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 18, "OK"), + CATGETS(DT_catd, 3, 19, "Cancel"), DTMAILHELPOPENREADONLY); this->normalCursor(); if (answer == 1) { @@ -4508,11 +4508,11 @@ RoamMenuWindow::syncViewAndStore( case DTMC_READWRITEOVERRIDE: // We are not able to obtain a lock on this folder, // ask user if he wants to open it as read only. - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 3, 16, "Mailer"), - GETMSG(DT_catd, 3, 94, "Mailer is unable to obtain exclusive access to this\nmailbox because the system is not responding.\n\nFor this time only, you can choose to open this mailbox\nread-only, or to open it read-write without exclusive\naccess (use only if no one else is using this mailbox).")); - answer = _genDialog->post_and_return(GETMSG(DT_catd, 3, 95, "Read-only"), - GETMSG(DT_catd, 3, 19, "Cancel"), - GETMSG(DT_catd, 3, 96, "Read-Write"), + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 3, 16, "Mailer"), + CATGETS(DT_catd, 3, 94, "Mailer is unable to obtain exclusive access to this\nmailbox because the system is not responding.\n\nFor this time only, you can choose to open this mailbox\nread-only, or to open it read-write without exclusive\naccess (use only if no one else is using this mailbox).")); + answer = _genDialog->post_and_return(CATGETS(DT_catd, 3, 95, "Read-only"), + CATGETS(DT_catd, 3, 19, "Cancel"), + CATGETS(DT_catd, 3, 96, "Read-Write"), DTMAILHELPOPENREADWRITEOVERRIDE); this->normalCursor(); // Now the tricky part - since this method can only return @@ -4536,10 +4536,10 @@ RoamMenuWindow::syncViewAndStore( char *buffer = new char[2048]; char *lockpath = va_arg(args, char*); char *errormsg = va_arg(args, char*); - char *cancel = GETMSG(DT_catd, 3, 19, "Cancel"); - char *ok = GETMSG(DT_catd, 3, 18, "OK"); - char *mailer = GETMSG(DT_catd, 3, 16, "Mailer"); - char *msgfmt = GETMSG(DT_catd, 3, 97, "%s\n\nThis may indicate that another Mailer has opened\n%s\n\nYou may open this mailbox READ ONLY by choosing '%s'.\n\nOtherwise, you may choose '%s',\nmake sure that another Mailer has not opened this mailbox,\ndelete %s,\nand reopen this mailbox."); + char *cancel = CATGETS(DT_catd, 3, 19, "Cancel"); + char *ok = CATGETS(DT_catd, 3, 18, "OK"); + char *mailer = CATGETS(DT_catd, 3, 16, "Mailer"); + char *msgfmt = CATGETS(DT_catd, 3, 97, "%s\n\nThis may indicate that another Mailer has opened\n%s\n\nYou may open this mailbox READ ONLY by choosing '%s'.\n\nOtherwise, you may choose '%s',\nmake sure that another Mailer has not opened this mailbox,\ndelete %s,\nand reopen this mailbox."); // We are not able to obtain a .dtmail lock on this folder, // ask user if he wants to open it as read only. @@ -4620,7 +4620,7 @@ RoamMenuWindow::showConversionStatus( if ((now_complete > (previously_complete + 5)) || (now_complete == 100)) { - str = GETMSG(DT_catd, 1, 79, "Converting... %d percent complete"); + str = CATGETS(DT_catd, 1, 79, "Converting... %d percent complete"); // Estimate 4 characters for numbers and 1 null terminator. buf = new char[strlen(str) + 5]; sprintf(buf, str, now_complete); @@ -4720,11 +4720,11 @@ RoamMenuWindow::postErrorDialog( // Assume that the char *text that comes in has already // been processed for i18n. - _genDialog->setToErrorDialog(GETMSG(DT_catd, 2, 13, "Mailer"), + _genDialog->setToErrorDialog(CATGETS(DT_catd, 2, 13, "Mailer"), (char *)text_str); helpId = DTMAILHELPERROR; - int i = _genDialog->post_and_return(GETMSG(DT_catd, 3, 31, "OK"), helpId); + int i = _genDialog->post_and_return(CATGETS(DT_catd, 3, 31, "OK"), helpId); // Clear the Error mail_error.clear(); @@ -4766,7 +4766,7 @@ RoamMenuWindow::expunge(void) // First order of business - busy out active windows // theRoamApp.busyAllWindows( - GETMSG(DT_catd, 3, 32, "Destroying deleted messages...")); + CATGETS(DT_catd, 3, 32, "Destroying deleted messages...")); // Before changing the state of any deleted/undeleted lists, // perform the destroy deleted operation and make sure that @@ -4971,11 +4971,11 @@ RoamMenuWindow::save_selected_attachment( _genDialog->setToErrorDialog( - GETMSG(DT_catd, 1, 80, "Mailer"), - GETMSG(DT_catd, 2, 14, "An attachment needs to be selected before issuing the\n\"Save As\" command to save to a file.") ); + CATGETS(DT_catd, 1, 80, "Mailer"), + CATGETS(DT_catd, 2, 14, "An attachment needs to be selected before issuing the\n\"Save As\" command to save to a file.") ); helpId = DTMAILHELPSELECTATTACH; answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 33, "OK"), helpId ); + CATGETS(DT_catd, 3, 33, "OK"), helpId ); return; } @@ -5398,7 +5398,7 @@ RoamMenuWindow::setTitle(char *suffix) DtMailEnv mail_error; MailSession *ses = theRoamApp.session(); DtMail::Session *d_session = ses->session(); - char *prefix = GETMSG(DT_catd, 1, 6, "Mailer"); + char *prefix = CATGETS(DT_catd, 1, 6, "Mailer"); char *path = NULL; char *new_title; char *format; @@ -5434,7 +5434,7 @@ void RoamMenuWindow::setVacationTitle() { // Add "[Vacation]" to the title of the roam menu window - char *vacation = GETMSG(DT_catd, 1, 3, "Vacation"); + char *vacation = CATGETS(DT_catd, 1, 3, "Vacation"); setTitle(vacation); } @@ -5471,12 +5471,12 @@ Widget parent=NULL; sprintf(errMsg,"Insufficient space on %s filesystem. Dtmail unable to show any new \n messages, delete messages, or save further changes to the open \n mailbox. Please contact your System Administrator to correct the \n filesystem space problem.",fsname); free(fsname); genDialog->setToErrorDialog( - GETMSG(DT_catd, 1, 6, "Mailer"), + CATGETS(DT_catd, 1, 6, "Mailer"), errMsg); XtFree(errMsg); genDialog->post_and_return( - GETMSG(DT_catd, 3, 9, "OK"), + CATGETS(DT_catd, 3, 9, "OK"), NULL); delete genDialog; } diff --git a/cde/programs/dtmail/dtmail/SendMsgDialog.C b/cde/programs/dtmail/dtmail/SendMsgDialog.C index 93961b2eb..58ea50b45 100644 --- a/cde/programs/dtmail/dtmail/SendMsgDialog.C +++ b/cde/programs/dtmail/dtmail/SendMsgDialog.C @@ -286,7 +286,7 @@ _header_list(16) if (! isInitializedDefaultHeaderList) for (DefaultHeaders * hl = DefaultHeaderList; hl->dflt_label; hl++) { hl->label = - GETMSG(DT_catd, hl->msg_set, hl->msg_number, hl->dflt_label); + CATGETS(DT_catd, hl->msg_set, hl->msg_number, hl->dflt_label); isInitializedDefaultHeaderList = TRUE; } @@ -694,7 +694,7 @@ SendMsgDialog::doAutoSave(char *filename) DtMailEnv error; busyCursor(); - setStatus(GETMSG(DT_catd, 3, 70, "Writing dead letter...")); + setStatus(CATGETS(DT_catd, 3, 70, "Writing dead letter...")); updateMsgHnd(); @@ -945,16 +945,16 @@ SendMsgDialog::changeHeaderState(const char * name) if (!hl->value || strcmp(value, hl->value) != 0) { char *buf = new char[256]; sprintf(buf, - GETMSG(DT_catd, 2, 17, + CATGETS(DT_catd, 2, 17, "You have edited \"%s\". Delete anyway?"), hl->label); - _genDialog->setToWarningDialog(GETMSG(DT_catd, 3, 71, + _genDialog->setToWarningDialog(CATGETS(DT_catd, 3, 71, "Mailer"), buf); char * helpId = DTMAILHELPERROR; int answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 72, "OK"), - GETMSG(DT_catd, 3, 73, "Cancel"), + CATGETS(DT_catd, 3, 72, "OK"), + CATGETS(DT_catd, 3, 73, "Cancel"), helpId); delete [] buf; if (answer == 2) { @@ -973,13 +973,13 @@ SendMsgDialog::changeHeaderState(const char * name) if (hl->show == SMD_SHOWN) { XtUnmanageChild(hl->form_widget); hl->show = SMD_HIDDEN; - sprintf(label, "%s ", GETMSG(DT_catd, 1, 228, "Add")); + sprintf(label, "%s ", CATGETS(DT_catd, 1, 228, "Add")); } else { XtManageChild(hl->form_widget); hl->show = SMD_SHOWN; - sprintf(label, "%s ", GETMSG(DT_catd, 1, 229, "Delete")); + sprintf(label, "%s ", CATGETS(DT_catd, 1, 229, "Delete")); } justifyHeaders(); @@ -990,7 +990,7 @@ SendMsgDialog::changeHeaderState(const char * name) strcat(label, hl->label); strcat(label, ":"); char *button_name = new char[100]; - sprintf(button_name, "%s ", GETMSG(DT_catd, 1, 228, "Add")); + sprintf(button_name, "%s ", CATGETS(DT_catd, 1, 228, "Add")); strcat(button_name, hl->label); strcat(button_name, ":"); @@ -1061,7 +1061,7 @@ SendMsgDialog::sendmailErrorProc (int, int status, void *data) * There was an error in one or more of the email addresses. * Ask the user to type in a valid address and try again. */ - sprintf(buf, "%s", GETMSG(DT_catd, 5, 5, + sprintf(buf, "%s", CATGETS(DT_catd, 5, 5, "Some of the addresses in the message are incorrect,\n\ and do not refer to any known users in the system.\n\ Please make sure all of the addresses are valid and try again.")); @@ -1075,7 +1075,7 @@ Please make sure all of the addresses are valid and try again.")); * applications so there will be more memory available. */ - sprintf(buf, "%s", GETMSG(DT_catd, 5, 6, + sprintf(buf, "%s", CATGETS(DT_catd, 5, 6, "Mailer does not have enough memory\n\ available to send this message.\n\ Try quitting other applications and\n\ @@ -1090,7 +1090,7 @@ resend this message.")); * There was an error from the mail transport (sendmail). */ - sprintf(buf, "%s", GETMSG(DT_catd, 5, 7, + sprintf(buf, "%s", CATGETS(DT_catd, 5, 7, "An error occurred while trying to send your message.\n\ Check to make sure the message was received. If not,\n\ you may have to resend this message.")); @@ -1103,9 +1103,9 @@ you may have to resend this message.")); smd->_close_button->activate(); // popup the error dialog - smd->_genDialog->setToErrorDialog(GETMSG(DT_catd, 2, 21, "Mailer"), + smd->_genDialog->setToErrorDialog(CATGETS(DT_catd, 2, 21, "Mailer"), (char *) buf); - smd->_genDialog->post_and_return(GETMSG(DT_catd, 3, 76, "OK"), helpId); + smd->_genDialog->post_and_return(CATGETS(DT_catd, 3, 76, "OK"), helpId); delete [] buf; } @@ -1152,7 +1152,7 @@ SendMsgDialog::send_message(const char * trans_impl, int trans_type) if (!this->hasAddressee()) { // Message has no valid addressee. Pop up error dialog. - sprintf(buf, "%s", GETMSG(DT_catd, 5, 8, + sprintf(buf, "%s", CATGETS(DT_catd, 5, 8, "Try Send after specifying recipient(s) of the message in \nthe To:, Cc:, or Bcc: fields.")); helpId = DTMAILHELPNEEDADDRESSEE; @@ -1164,9 +1164,9 @@ SendMsgDialog::send_message(const char * trans_impl, int trans_type) _send_button->activate(); _close_button->activate(); - _genDialog->setToErrorDialog(GETMSG(DT_catd, 2, 21, "Mailer"), + _genDialog->setToErrorDialog(CATGETS(DT_catd, 2, 21, "Mailer"), (char *) buf); - _genDialog->post_and_return(GETMSG(DT_catd, 3, 76, "OK"), helpId); + _genDialog->post_and_return(CATGETS(DT_catd, 3, 76, "OK"), helpId); // Reset the flag before we return. _already_sending = FALSE; @@ -1196,7 +1196,7 @@ SendMsgDialog::send_message(const char * trans_impl, int trans_type) numPendingActions = attachArea->getNumPendingActions(); - sprintf(buf, "%s", GETMSG( + sprintf(buf, "%s", CATGETS( DT_catd, 3, 77, @@ -1215,7 +1215,7 @@ SendMsgDialog::send_message(const char * trans_impl, int trans_type) */ _genDialog->setToQuestionDialog( - GETMSG(DT_catd, 5, 1, "Mailer"), + CATGETS(DT_catd, 5, 1, "Mailer"), buf); helpId = DTMAILHELPPENDINGACTIONS; @@ -1329,7 +1329,7 @@ SendMsgDialog::popupMemoryError(DtMailEnv &error) * Mailer ran out of memory. Ask the user to quit some other * applications so there will be more memory available. */ - sprintf(buf, "%s", GETMSG(DT_catd, 5, 6, + sprintf(buf, "%s", CATGETS(DT_catd, 5, 6, "Mailer does not have enough memory\n\ available to send this message.\n\ Try quitting other applications and\n\ @@ -1351,9 +1351,9 @@ resend this message.")); _close_button->activate(); // popup the error dialog - this->_genDialog->setToErrorDialog(GETMSG(DT_catd, 2, 21, "Mailer"), + this->_genDialog->setToErrorDialog(CATGETS(DT_catd, 2, 21, "Mailer"), (char *) buf); - this->_genDialog->post_and_return(GETMSG(DT_catd, 3, 76, "OK"), + this->_genDialog->post_and_return(CATGETS(DT_catd, 3, 76, "OK"), helpId); } delete [] buf; @@ -1447,7 +1447,7 @@ SendMsgDialog::createWorkArea ( Widget parent ) // Create the Send and Close buttons as children of rowCol _send_button = new SendCmd ( "Send", - GETMSG(DT_catd, 1, 230, "Send"), + CATGETS(DT_catd, 1, 230, "Send"), TRUE, this, 1); @@ -1466,7 +1466,7 @@ SendMsgDialog::createWorkArea ( Widget parent ) _close_button = new CloseCmd ( "Close", - GETMSG(DT_catd, 1, 118, "Close"), + CATGETS(DT_catd, 1, 118, "Close"), TRUE, this->baseWidget(), this ); @@ -1508,7 +1508,7 @@ SendMsgDialog::createWorkArea ( Widget parent ) (void) XmProcessTraversal(hl->field_widget, XmTRAVERSE_CURRENT); // Set the title to be New Message - //char *ttl = GETMSG(DT_catd, 1, 119, "New Message"); + //char *ttl = CATGETS(DT_catd, 1, 119, "New Message"); //this->setTitle(ttl); //this->setIconTitle(ttl); @@ -1672,11 +1672,11 @@ SendMsgDialog::doDynamicHeaderMenus(void) switch(hl->show) { case SMD_SHOWN: - sprintf(label, "%s ", GETMSG(DT_catd, 1, 229, "Delete")); + sprintf(label, "%s ", CATGETS(DT_catd, 1, 229, "Delete")); break; case SMD_HIDDEN: - sprintf(label, "%s ", GETMSG(DT_catd, 1, 228, "Add")); + sprintf(label, "%s ", CATGETS(DT_catd, 1, 228, "Add")); break; default: @@ -1740,7 +1740,7 @@ SendMsgDialog::include_file( // I don't need to open the file to see if it's readable if loadFile() // returns error status. if ( (fp = fopen(selection, "r")) == NULL ) { - sprintf(buf, GETMSG(DT_catd, 2, 18, "Error: Cannot include file %s"), + sprintf(buf, CATGETS(DT_catd, 2, 18, "Error: Cannot include file %s"), selection); theInfoDialogManager->post( "Mailer", @@ -1785,10 +1785,10 @@ SendMsgDialog::confirm_add_attachment(char *file, int size) int answer; format = - GETMSG(DT_catd, 1, 263, + CATGETS(DT_catd, 1, 263, "The attachment '%s' is %d kilobytes.\nAdd as attachment?"); sprintf(buf, format, file, size/1024); - _genDialog->setToQuestionDialog(GETMSG(DT_catd, 5, 2, "Mailer"), buf); + _genDialog->setToQuestionDialog(CATGETS(DT_catd, 5, 2, "Mailer"), buf); answer = _genDialog->post_and_return(NULL); return (answer==1); } @@ -1877,11 +1877,11 @@ SendMsgDialog::save_selected_attachment( _genDialog->setToErrorDialog( - GETMSG(DT_catd, 1, 120, "Mailer"), - GETMSG(DT_catd, 2, 19, "An attachment needs to be selected before issuing the\n\"Save As\" command to save to a file.") ); + CATGETS(DT_catd, 1, 120, "Mailer"), + CATGETS(DT_catd, 2, 19, "An attachment needs to be selected before issuing the\n\"Save As\" command to save to a file.") ); helpId = DTMAILHELPSELECTATTACH; answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 74, "OK"), helpId ); + CATGETS(DT_catd, 3, 74, "OK"), helpId ); return; } @@ -2013,15 +2013,15 @@ SendMsgDialog::createMenuPanes() _separator = new SeparatorCmd( "Separator","Separator", TRUE ); // File - cmdList = new CmdList( "File", GETMSG(DT_catd, 1, 121, "File") ); + cmdList = new CmdList( "File", CATGETS(DT_catd, 1, 121, "File") ); // Default directory is set below at the same time as the default // directory for att_add. _file_include = new UnifiedSelectFileCmd ( "Include...", - GETMSG(DT_catd, 1, 122, "Include..."), - GETMSG(DT_catd, 1, 123, "Mailer - Include"), - GETMSG(DT_catd, 1, 124, "Include"), + CATGETS(DT_catd, 1, 122, "Include..."), + CATGETS(DT_catd, 1, 123, "Mailer - Include"), + CATGETS(DT_catd, 1, 124, "Include"), TRUE, SendMsgDialog::include_file_cb, this, @@ -2030,12 +2030,12 @@ SendMsgDialog::createMenuPanes() // Remap OK button to Include // XtVaSetValues(_file_include->fileBrowser, - // XmNokLabelString, GETMSG(DT_catd, + // XmNokLabelString, CATGETS(DT_catd, // 1, 77, "Include"), NULL); _file_save_as = new SaveAsTextCmd( "Save As Text...", - GETMSG(DT_catd, 1, 125, "Save As Text..."), - GETMSG(DT_catd, 1, 126, "Mailer - Save As Text"), + CATGETS(DT_catd, 1, 125, "Save As Text..."), + CATGETS(DT_catd, 1, 126, "Mailer - Save As Text"), TRUE, get_editor()->textEditor(), this, @@ -2043,13 +2043,13 @@ SendMsgDialog::createMenuPanes() _file_log = new LogMsgCmd ( "Log Message", - GETMSG(DT_catd, 1, 127, "Log Message"), TRUE, this); + CATGETS(DT_catd, 1, 127, "Log Message"), TRUE, this); // 1 for default transport. _file_send = new SendCmd ( "Send", - GETMSG(DT_catd, 1, 117, "Send"), + CATGETS(DT_catd, 1, 117, "Send"), TRUE, this, 1 ); @@ -2066,7 +2066,7 @@ SendMsgDialog::createMenuPanes() CmdList *subcmdList1 = new CmdList ( "Send As", - GETMSG(DT_catd, 1, 128, "Send As") ); + CATGETS(DT_catd, 1, 128, "Send As") ); d_session = theRoamApp.session()->session(); const char **impls = d_session->enumerateImpls(error); @@ -2090,7 +2090,7 @@ SendMsgDialog::createMenuPanes() _file_close = new CloseCmd ( "Close", - GETMSG(DT_catd, 1, 129, "Close"), + CATGETS(DT_catd, 1, 129, "Close"), TRUE, _menuBar->baseWidget(), this ); @@ -2116,56 +2116,56 @@ SendMsgDialog::createMenuPanes() // Edit - cmdList = new CmdList( "Edit", GETMSG(DT_catd, 1, 130, "Edit") ); + cmdList = new CmdList( "Edit", CATGETS(DT_catd, 1, 130, "Edit") ); _edit_undo = new EditUndoCmd ( "Undo", - GETMSG(DT_catd, 1, 131, "Undo"), + CATGETS(DT_catd, 1, 131, "Undo"), TRUE, this ); _edit_cut = new EditCutCmd ( "Cut", - GETMSG(DT_catd, 1, 132, "Cut"), + CATGETS(DT_catd, 1, 132, "Cut"), TRUE, this ); _edit_copy = new EditCopyCmd ( "Copy", - GETMSG(DT_catd, 1, 133, "Copy"), + CATGETS(DT_catd, 1, 133, "Copy"), TRUE, this ); _edit_paste = new EditPasteCmd ( "Paste", - GETMSG(DT_catd, 1, 134 , "Paste"), + CATGETS(DT_catd, 1, 134 , "Paste"), TRUE, this ); // Begin Paste Special submenu - subcmdList1 = new CmdList ( "Paste Special", GETMSG(DT_catd, 1, 135 , "Paste Special") ); + subcmdList1 = new CmdList ( "Paste Special", CATGETS(DT_catd, 1, 135 , "Paste Special") ); _edit_paste_special[0] = new EditPasteSpecialCmd ( "Bracketed", - GETMSG(DT_catd, 1, 136 , "Bracketed"), + CATGETS(DT_catd, 1, 136 , "Bracketed"), TRUE, this, Editor::IF_BRACKETED ); subcmdList1->add(_edit_paste_special[0]); _edit_paste_special[1] = new EditPasteSpecialCmd ( "Indented", - GETMSG(DT_catd, 1, 137 , "Indented"), + CATGETS(DT_catd, 1, 137 , "Indented"), TRUE, this, Editor::IF_INDENTED ); subcmdList1->add(_edit_paste_special[1]); // End Paste Special submenu - _edit_clear = new EditClearCmd ( "Clear", GETMSG(DT_catd, 1, 138, "Clear"), + _edit_clear = new EditClearCmd ( "Clear", CATGETS(DT_catd, 1, 138, "Clear"), TRUE, this ); - _edit_delete = new EditDeleteCmd ( "Delete", GETMSG(DT_catd, 1, 139, "Delete"), + _edit_delete = new EditDeleteCmd ( "Delete", CATGETS(DT_catd, 1, 139, "Delete"), TRUE, this ); _edit_select_all = new EditSelectAllCmd ( "Select All", - GETMSG(DT_catd, 1, 140, "Select All"), + CATGETS(DT_catd, 1, 140, "Select All"), TRUE, this ); _format_find_change = new FindChangeCmd ( "Find/Change...", - GETMSG(DT_catd, 1, 155, "Find/Change..."), + CATGETS(DT_catd, 1, 155, "Find/Change..."), TRUE, this ); _format_spell = new SpellCmd ( "Check Spelling...", - GETMSG(DT_catd, 1, 156, "Check Spelling..."), + CATGETS(DT_catd, 1, 156, "Check Spelling..."), TRUE, this ); @@ -2210,13 +2210,13 @@ SendMsgDialog::createMenuPanes() cmdList = new CmdList( "Attachments", - GETMSG(DT_catd, 1, 141, "Attachments")); + CATGETS(DT_catd, 1, 141, "Attachments")); _att_add = new UnifiedSelectFileCmd ( "Add File...", - GETMSG(DT_catd, 1, 142, "Add File..."), - GETMSG(DT_catd, 1, 143, "Mailer - Add"), - GETMSG(DT_catd, 1, 144, "Add"), + CATGETS(DT_catd, 1, 142, "Add File..."), + CATGETS(DT_catd, 1, 143, "Mailer - Add"), + CATGETS(DT_catd, 1, 144, "Add"), TRUE, SendMsgDialog::add_att_cb, this, @@ -2224,8 +2224,8 @@ SendMsgDialog::createMenuPanes() _att_save = new SaveAttachCmd ( "Save As...", - GETMSG(DT_catd, 1, 145, "Save As..."), - GETMSG(DT_catd, 1, 146, + CATGETS(DT_catd, 1, 145, "Save As..."), + CATGETS(DT_catd, 1, 146, "Mailer - Attachments - Save As"), FALSE, SendMsgDialog::save_att_cb, @@ -2233,23 +2233,23 @@ SendMsgDialog::createMenuPanes() this->baseWidget()); _att_delete = new DeleteAttachCmd ( "Delete", - GETMSG(DT_catd, 1, 147, "Delete"), + CATGETS(DT_catd, 1, 147, "Delete"), FALSE, this); _att_undelete = new UndeleteAttachCmd ( "Undelete", - GETMSG(DT_catd, 1, 148, "Undelete"), + CATGETS(DT_catd, 1, 148, "Undelete"), FALSE, this); _att_rename = new RenameAttachCmd( "Rename", - GETMSG(DT_catd, 1, 149, "Rename"), + CATGETS(DT_catd, 1, 149, "Rename"), FALSE, this); _att_select_all = new SelectAllAttachsCmd( "Select All", - GETMSG(DT_catd, 1, 150, "Select All"), + CATGETS(DT_catd, 1, 150, "Select All"), this); /* NL_COMMENT @@ -2259,7 +2259,7 @@ SendMsgDialog::createMenuPanes() */ _att_show_pane = new ShowAttachPaneCmd( "Show List", - GETMSG(DT_catd, 1, 226, "Show List"), + CATGETS(DT_catd, 1, 226, "Show List"), this ); cmdList->add( _att_add ); @@ -2298,22 +2298,22 @@ SendMsgDialog::createMenuPanes() createFormatMenu(); _overview = new OnAppCmd("Overview", - GETMSG(DT_catd, 1, 71, "Overview"), + CATGETS(DT_catd, 1, 71, "Overview"), TRUE, this); - _tasks = new TasksCmd("Tasks", GETMSG(DT_catd, 1, 72, "Tasks"), + _tasks = new TasksCmd("Tasks", CATGETS(DT_catd, 1, 72, "Tasks"), TRUE, this); _reference = new ReferenceCmd("Reference", - GETMSG(DT_catd, 1, 73, "Reference"), + CATGETS(DT_catd, 1, 73, "Reference"), TRUE, this); - _on_item = new OnItemCmd("On Item", GETMSG(DT_catd, 1, 74, "On Item"), + _on_item = new OnItemCmd("On Item", CATGETS(DT_catd, 1, 74, "On Item"), TRUE, this); _using_help = new UsingHelpCmd("Using Help", - GETMSG(DT_catd, 1, 75, "Using Help"), + CATGETS(DT_catd, 1, 75, "Using Help"), TRUE, this); _about_mailer = new RelNoteCmd("About Mailer...", - GETMSG(DT_catd, 1, 77, "About Mailer..."), + CATGETS(DT_catd, 1, 77, "About Mailer..."), TRUE, this); - cmdList = new CmdList("Help", GETMSG(DT_catd, 1, 76, "Help")); + cmdList = new CmdList("Help", CATGETS(DT_catd, 1, 76, "Help")); cmdList->add(_overview); cmdList->add(_separator); cmdList->add(_tasks); @@ -2335,7 +2335,7 @@ SendMsgDialog::construct_attachment_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Attachments", - GETMSG(DT_catd, 1, 158, "Mailer - Attachments"), TRUE); + CATGETS(DT_catd, 1, 158, "Mailer - Attachments"), TRUE); SeparatorCmd *separator = new SeparatorCmd( "Separator","Separator", TRUE ); _attachmentPopupMenuList->add(title); @@ -2362,7 +2362,7 @@ SendMsgDialog::construct_text_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Compose", - GETMSG(DT_catd, 1, 159, "Mailer - Compose"), TRUE); + CATGETS(DT_catd, 1, 159, "Mailer - Compose"), TRUE); SeparatorCmd *separator = new SeparatorCmd("Separator", "Separator", TRUE ); _textPopupMenuList->add(title); @@ -2511,13 +2511,13 @@ SendMsgDialog::createAliasPopupMenu( OtherAliasesCmd *otherAliases = new OtherAliasesCmd( "Other Aliases...", - GETMSG(DT_catd, 1, 247, "Other Aliases..."), + CATGETS(DT_catd, 1, 247, "Other Aliases..."), TRUE); #if defined(USE_TITLED_ALIAS_POPUPS) LabelCmd *title = new LabelCmd( "Mailer - Aliases", - GETMSG(DT_catd, 1, 248, "Mailer - Aliases"), + CATGETS(DT_catd, 1, 248, "Mailer - Aliases"), TRUE); #endif SeparatorCmd *separator = @@ -2666,15 +2666,15 @@ SendMsgDialog::createFormatMenu() CmdList *cmdList; _format_separator = new SeparatorCmd( "Separator","Separator", TRUE ); - cmdList = new CmdList( "Format", GETMSG(DT_catd, 1, 152,"Format") ); + cmdList = new CmdList( "Format", CATGETS(DT_catd, 1, 152,"Format") ); _format_word_wrap = new WordWrapCmd ( "Word Wrap", - GETMSG(DT_catd, 1, 153, "Word Wrap"), + CATGETS(DT_catd, 1, 153, "Word Wrap"), TRUE, this ); _format_settings = new FormatCmd ( "Settings...", - GETMSG(DT_catd, 1, 154, "Settings..."), + CATGETS(DT_catd, 1, 154, "Settings..."), TRUE, this ); @@ -2682,7 +2682,7 @@ SendMsgDialog::createFormatMenu() cmdList->add( _format_settings ); cmdList->add( _format_separator); - _templates = new CmdList ( "Templates", GETMSG(DT_catd, 1, 157, "Templates") ); + _templates = new CmdList ( "Templates", CATGETS(DT_catd, 1, 157, "Templates") ); addTemplates(_templates); cmdList->add(_templates); @@ -2756,7 +2756,7 @@ SendMsgDialog::initialize() XmRepTypeInstallTearOffModelConverter(); MenuWindow::initialize(); - char *ttl = GETMSG(DT_catd, 1, 160, "New Message"); + char *ttl = CATGETS(DT_catd, 1, 160, "New Message"); setTitle(ttl); XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING); n++; @@ -3394,11 +3394,11 @@ SendMsgDialog::renameAttachmentOK() if (attachArea->getIconSelectedCount() > 1) { char *buf = new char[512]; - sprintf(buf, "%s", GETMSG(DT_catd, 5, 4, "Select only one attachment\n\ + sprintf(buf, "%s", CATGETS(DT_catd, 5, 4, "Select only one attachment\n\ and then choose rename")); _genDialog->setToQuestionDialog( - GETMSG(DT_catd, 5, 2, "Mailer"), + CATGETS(DT_catd, 5, 2, "Mailer"), buf); char * helpId = DTMAILHELPSELECTONEATTACH; @@ -3618,12 +3618,12 @@ SendMsgDialog::handleQuitDialog() DtMailGenDialog *dialog = this->genDialog(); dialog->setToQuestionDialog( - GETMSG( + CATGETS( DT_catd, 1, 99, "Mailer - Close"), - GETMSG( + CATGETS( DT_catd, 3, 58, @@ -3634,12 +3634,12 @@ Close the Compose window?") ); helpId = DTMAILHELPCLOSECOMPOSEWINDOW; if ( dialog->post_and_return( - GETMSG( + CATGETS( DT_catd, 1, 100, "OK"), - GETMSG( + CATGETS( DT_catd, 1, 101, @@ -3843,7 +3843,7 @@ Compose::getWin() // Get new Message Handle newsend->setMsgHnd(); - char *ttl = GETMSG(DT_catd, 1, 160, "New Message"); + char *ttl = CATGETS(DT_catd, 1, 160, "New Message"); newsend->setTitle(ttl); newsend->setIconTitle(ttl); return newsend; @@ -3854,7 +3854,7 @@ void SendMsgDialog::setTitle(char *subject) { char *format = "%s - %s"; - char *prefix = GETMSG(DT_catd, 1, 6, "Mailer"); + char *prefix = CATGETS(DT_catd, 1, 6, "Mailer"); char *new_title; int len; diff --git a/cde/programs/dtmail/dtmail/SortCmd.C b/cde/programs/dtmail/dtmail/SortCmd.C index f13fcbd59..0621da6eb 100644 --- a/cde/programs/dtmail/dtmail/SortCmd.C +++ b/cde/programs/dtmail/dtmail/SortCmd.C @@ -50,7 +50,7 @@ SortCmd::doit() DtMail::MailBox *mbox; int current_msg; - theRoamApp.busyAllWindows(GETMSG(DT_catd, 1, 219, "Sorting...")); + theRoamApp.busyAllWindows(CATGETS(DT_catd, 1, 219, "Sorting...")); // Get Mailbox mbox = _sortparent->mailbox(); diff --git a/cde/programs/dtmail/dtmail/Undelete.C b/cde/programs/dtmail/dtmail/Undelete.C index 7f0ec36b4..7aaee0b92 100644 --- a/cde/programs/dtmail/dtmail/Undelete.C +++ b/cde/programs/dtmail/dtmail/Undelete.C @@ -313,7 +313,7 @@ UndelFromListDialog::createWorkArea ( Widget parent ) XmNentryAlignment, XmALIGNMENT_CENTER, NULL); - labelStr = XmStringCreateLocalized(GETMSG(DT_catd, 1, 14, + labelStr = XmStringCreateLocalized(CATGETS(DT_catd, 1, 14, "Sender")); l1 = XtVaCreateManagedWidget("Label1", xmLabelGadgetClass, @@ -327,7 +327,7 @@ UndelFromListDialog::createWorkArea ( Widget parent ) // XtAddCallback(l1, XmNhelpCallback, HelpCB, helpId); - labelStr = XmStringCreateLocalized(GETMSG(DT_catd, 1, 15, + labelStr = XmStringCreateLocalized(CATGETS(DT_catd, 1, 15, "Subject")); l2 = XtVaCreateManagedWidget("Label2", xmLabelGadgetClass, rowOfLabels, @@ -341,7 +341,7 @@ UndelFromListDialog::createWorkArea ( Widget parent ) /* add help callback */ // XtAddCallback(l2, XmNhelpCallback, HelpCB, helpId); - labelStr = XmStringCreateLocalized(GETMSG(DT_catd, 1, 16, + labelStr = XmStringCreateLocalized(CATGETS(DT_catd, 1, 16, "Date and Time")); l3 = XtVaCreateManagedWidget("Label3", xmLabelGadgetClass, rowOfLabels, @@ -353,7 +353,7 @@ UndelFromListDialog::createWorkArea ( Widget parent ) /* add help callback */ // XtAddCallback(l3, XmNhelpCallback, HelpCB, helpId); - labelStr = XmStringCreateLocalized(GETMSG(DT_catd, 1, 17, + labelStr = XmStringCreateLocalized(CATGETS(DT_catd, 1, 17, "Size")); l4 = XtVaCreateManagedWidget("Label4", xmLabelGadgetClass, rowOfLabels, @@ -506,7 +506,7 @@ UndelFromListDialog::addToRowOfButtons() _undelete_button = new DoUndeleteCmd( "Undelete", - GETMSG(DT_catd, 1, 115, "Undelete"), + CATGETS(DT_catd, 1, 115, "Undelete"), TRUE, this); ci = new ButtonInterface (rowOfButtons, _undelete_button); @@ -522,7 +522,7 @@ UndelFromListDialog::addToRowOfButtons() _close_button = new CloseUndelCmd( "Close", - GETMSG(DT_catd, 1, 116, "Close"), + CATGETS(DT_catd, 1, 116, "Close"), TRUE, this); ci = new ButtonInterface (rowOfButtons, _close_button); diff --git a/cde/programs/dtmail/dtmail/ViewMsgDialog.C b/cde/programs/dtmail/dtmail/ViewMsgDialog.C index 6bc111484..3db3c0b53 100644 --- a/cde/programs/dtmail/dtmail/ViewMsgDialog.C +++ b/cde/programs/dtmail/dtmail/ViewMsgDialog.C @@ -356,19 +356,19 @@ ViewMsgDialog::construct_edit_menu() _edit_copy = new EditCopyCmd( "Copy", - GETMSG(DT_catd, 1, 161, "Copy"), + CATGETS(DT_catd, 1, 161, "Copy"), TRUE, this ); _edit_select_all = new EditSelectAllCmd( "Select All", - GETMSG(DT_catd, 1, 162, "Select All"), + CATGETS(DT_catd, 1, 162, "Select All"), TRUE, this ); - cmdList = new CmdList("Edit", GETMSG(DT_catd, 1, 163, "Edit")); + cmdList = new CmdList("Edit", CATGETS(DT_catd, 1, 163, "Edit")); cmdList->add(_edit_copy); cmdList->add(_edit_select_all); @@ -385,8 +385,8 @@ ViewMsgDialog::construct_attachment_menu() _attach_save_as = new SaveAttachCmd ( "Save As...", - GETMSG(DT_catd, 1, 164, "Save As..."), - GETMSG(DT_catd, 1, 165, "Mailer - Attachments - Save As"), + CATGETS(DT_catd, 1, 164, "Save As..."), + CATGETS(DT_catd, 1, 165, "Mailer - Attachments - Save As"), FALSE, ViewMsgDialog::save_attachment_callback, this, @@ -394,12 +394,12 @@ ViewMsgDialog::construct_attachment_menu() _attach_select_all = new SelectAllAttachsCmd( "Select All", - GETMSG(DT_catd, 1, 166, "Select All"), + CATGETS(DT_catd, 1, 166, "Select All"), this); _attachmentMenuList = new CmdList( "Attachments", - GETMSG(DT_catd, 1, 167, "Attachments") ); + CATGETS(DT_catd, 1, 167, "Attachments") ); _attachmentMenuList->add(_attach_save_as); _attachmentMenuList->add(_attach_select_all); @@ -415,7 +415,7 @@ ViewMsgDialog::construct_attachment_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Attachments", - GETMSG(DT_catd, 1, 168, "Mailer - Attachments"), TRUE); + CATGETS(DT_catd, 1, 168, "Mailer - Attachments"), TRUE); SeparatorCmd *separator = new SeparatorCmd("Separator","Separator", TRUE ); _attachmentPopupMenuList->add(title); @@ -438,7 +438,7 @@ ViewMsgDialog::construct_text_popup(void) LabelCmd *title = new LabelCmd ( "Mailer - Text", - GETMSG(DT_catd, 1, 169, "Mailer - Text"), TRUE); + CATGETS(DT_catd, 1, 169, "Mailer - Text"), TRUE); SeparatorCmd *separator = new SeparatorCmd("Separator", "Separator", TRUE ); _textPopupMenuList->add(title); @@ -462,20 +462,20 @@ ViewMsgDialog::construct_help_menu() // Separator for menu items SeparatorCmd *separator= new SeparatorCmd("Separator", "Separator", TRUE ); - _overview = new OnAppCmd("Overview", GETMSG(DT_catd, 1, 170, "Overview"), + _overview = new OnAppCmd("Overview", CATGETS(DT_catd, 1, 170, "Overview"), TRUE, this); - _tasks = new TasksCmd("Tasks", GETMSG(DT_catd, 1, 171, "Tasks"), + _tasks = new TasksCmd("Tasks", CATGETS(DT_catd, 1, 171, "Tasks"), TRUE, this); _reference = new ReferenceCmd("Reference", - GETMSG(DT_catd, 1, 172, "Reference"), + CATGETS(DT_catd, 1, 172, "Reference"), TRUE, this); _on_item = new OnItemCmd("On Item", - GETMSG(DT_catd, 1, 173, "On Item"), + CATGETS(DT_catd, 1, 173, "On Item"), TRUE, this); _using_help = new UsingHelpCmd("Using Help", - GETMSG(DT_catd, 1, 174, "Using Help"), + CATGETS(DT_catd, 1, 174, "Using Help"), TRUE, this); - cmdList = new CmdList( "Help", GETMSG(DT_catd, 1, 175, "Help") ); + cmdList = new CmdList( "Help", CATGETS(DT_catd, 1, 175, "Help") ); cmdList->add ( _overview ); cmdList->add ( separator ); cmdList->add ( _tasks ); @@ -487,7 +487,7 @@ ViewMsgDialog::construct_help_menu() cmdList->add ( separator ); _about_mailer = new RelNoteCmd("About Mailer", - GETMSG(DT_catd, 1, 176, "About Mailer..."), + CATGETS(DT_catd, 1, 176, "About Mailer..."), TRUE, this); cmdList->add ( _about_mailer ); @@ -535,11 +535,11 @@ ViewMsgDialog::save_selected_attachment( _genDialog->setToErrorDialog( - GETMSG(DT_catd, 1, 177, "Mailer"), - GETMSG(DT_catd, 2, 20, "An attachment needs to be selected before issuing the\n\"Save As\" command to save to a file.") ); + CATGETS(DT_catd, 1, 177, "Mailer"), + CATGETS(DT_catd, 2, 20, "An attachment needs to be selected before issuing the\n\"Save As\" command to save to a file.") ); helpId = DTMAILHELPSELECTATTACH; answer = _genDialog->post_and_return( - GETMSG(DT_catd, 3, 75, "OK"), helpId ); + CATGETS(DT_catd, 3, 75, "OK"), helpId ); return; } diff --git a/cde/programs/dtmail/dtmail/XmTextEditor.C b/cde/programs/dtmail/dtmail/XmTextEditor.C index 24e883216..2e5eab027 100644 --- a/cde/programs/dtmail/dtmail/XmTextEditor.C +++ b/cde/programs/dtmail/dtmail/XmTextEditor.C @@ -781,10 +781,10 @@ XmTextEditor::modifyPasteData( { if( !begin_ins_bracket) - begin_ins_bracket = GETMSG(DT_catd, 1, 199, + begin_ins_bracket = CATGETS(DT_catd, 1, 199, "\n------------- Begin Included Message -------------\n"); if(!end_ins_bracket) - end_ins_bracket = GETMSG(DT_catd, 1, 200, + end_ins_bracket = CATGETS(DT_catd, 1, 200, "\n------------- End Included Message -------------\n"); size_t begin_len = strlen(begin_ins_bracket); diff --git a/cde/programs/dtmail/dtmail/options_ui.C b/cde/programs/dtmail/dtmail/options_ui.C index 79a4540e4..889f80e4b 100644 --- a/cde/programs/dtmail/dtmail/options_ui.C +++ b/cde/programs/dtmail/dtmail/options_ui.C @@ -1637,7 +1637,7 @@ dtb_options_dialog_create( if (instance->dialog == NULL) { n = 0; XtSetArg(args[n], XmNallowShellResize, True); ++n; - XtSetArg(args[n], XmNtitle, GETMSG(Dtb_project_catd, 2, 1, "Mailer - Mail Options")); ++n; + XtSetArg(args[n], XmNtitle, CATGETS(Dtb_project_catd, 2, 1, "Mailer - Mail Options")); ++n; XtSetArg(args[n], XmNbackground, dtb_cvt_string_to_pixel(parent, "white")); ++n; instance->dialog = XmCreateDialogShell(parent, @@ -1845,7 +1845,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 2, "Category:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 2, "Category:")); instance->category_opmenu_label = XtVaCreateWidget("dtb_options_category_opmenu_label", xmLabelWidgetClass, @@ -1872,7 +1872,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Message_Header_List_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 3, "Message Header List")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 3, "Message Header List")); instance->category_opmenu_items.Message_Header_List_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_message_header_list_item", xmPushButtonWidgetClass, @@ -1886,7 +1886,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Message_View_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 4, "Message View")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 4, "Message View")); instance->category_opmenu_items.Message_View_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_message_view_item", xmPushButtonWidgetClass, @@ -1900,7 +1900,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Compose_Window_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 5, "Compose Window")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 5, "Compose Window")); instance->category_opmenu_items.Compose_Window_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_compose_window_item", xmPushButtonWidgetClass, @@ -1914,7 +1914,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Message_Filing_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 6, "Message Filing")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 6, "Message Filing")); instance->category_opmenu_items.Message_Filing_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_message_filing_item", xmPushButtonWidgetClass, @@ -1928,7 +1928,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Vacation_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 7, "Vacation")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 7, "Vacation")); instance->category_opmenu_items.Vacation_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_vacation_item", xmPushButtonWidgetClass, @@ -1942,7 +1942,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Templates_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 8, "Templates")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 8, "Templates")); instance->category_opmenu_items.Templates_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_templates_item", xmPushButtonWidgetClass, @@ -1956,7 +1956,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Aliases_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 9, "Aliases")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 9, "Aliases")); instance->category_opmenu_items.Aliases_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_aliases_item", xmPushButtonWidgetClass, @@ -1970,7 +1970,7 @@ dtb_options_category_opmenu_create( return -1; if (instance->category_opmenu_items.Advanced_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 10, "Advanced")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 10, "Advanced")); instance->category_opmenu_items.Advanced_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_advanced_item", xmPushButtonWidgetClass, @@ -1985,7 +1985,7 @@ dtb_options_category_opmenu_create( if (instance->category_opmenu_items.Printing_item == NULL) { label_xmstring = - XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 92, "Printing")); + XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 92, "Printing")); instance->category_opmenu_items.Printing_item = XtVaCreateManagedWidget("dtb_options_category_opmenu_printing_item", xmPushButtonWidgetClass, @@ -2001,7 +2001,7 @@ dtb_options_category_opmenu_create( if (instance->category_opmenu_items.MailRetrieval_item == NULL) { label_xmstring = XmStringCreateLocalized( - GETMSG(Dtb_project_catd, 2, 93, "Mail Retrieval")); + CATGETS(Dtb_project_catd, 2, 93, "Mail Retrieval")); instance->category_opmenu_items.MailRetrieval_item = XtVaCreateManagedWidget( "dtb_options_category_opmenu_mailretrieval_item", @@ -2415,7 +2415,7 @@ dtb_options_checkbox_create( return -1; if (instance->checkbox_items.Show_To_recipient_when_mail_is_from_me_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 11, "Show To: recipient when mail is from me")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 11, "Show To: recipient when mail is from me")); instance->checkbox_items.Show_To_recipient_when_mail_is_from_me_item = XtVaCreateManagedWidget("dtb_options_checkbox_show_to_recipient_when_mail_is_from_me_item", xmToggleButtonWidgetClass, @@ -2430,7 +2430,7 @@ dtb_options_checkbox_create( return -1; if (instance->checkbox_items.Display_message_numbers_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 12, "Display message numbers")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 12, "Display message numbers")); instance->checkbox_items.Display_message_numbers_item = XtVaCreateManagedWidget("dtb_options_checkbox_display_message_numbers_item", xmToggleButtonWidgetClass, @@ -2552,7 +2552,7 @@ dtb_options_destroy_del_msg_lbl_create( XmString label_xmstring = NULL; if (instance->destroy_del_msg_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 20, "Destroy Deleted Messages:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 20, "Destroy Deleted Messages:")); instance->destroy_del_msg_lbl = XtVaCreateWidget("dtb_options_destroy_del_msg_lbl", xmLabelWidgetClass, @@ -2615,7 +2615,7 @@ dtb_options_deleted_msg_cb_create( return -1; if (instance->deleted_msg_cb_items.When_I_close_the_mailbox_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 21, "When I close the mailbox")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 21, "When I close the mailbox")); instance->deleted_msg_cb_items.When_I_close_the_mailbox_item = XtVaCreateManagedWidget("dtb_options_deleted_msg_cb_when_i_close_the_mailbox_item", xmToggleButtonWidgetClass, @@ -2630,7 +2630,7 @@ dtb_options_deleted_msg_cb_create( return -1; if (instance->deleted_msg_cb_items.Show_confirmation_notice_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 22, "Show confirmation notice")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 22, "Show confirmation notice")); instance->deleted_msg_cb_items.Show_confirmation_notice_item = XtVaCreateManagedWidget("dtb_options_deleted_msg_cb_show_confirmation_notice_item", xmToggleButtonWidgetClass, @@ -2782,7 +2782,7 @@ dtb_options_mail_check_sb_create( return -1; if (instance->mail_check_sb_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 13, "Check for new mail every:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 13, "Check for new mail every:")); instance->mail_check_sb_label = XtVaCreateWidget("dtb_options_mail_check_sb_label", xmLabelWidgetClass, @@ -2827,7 +2827,7 @@ dtb_options_seconds_lbl_create( XmString label_xmstring = NULL; if (instance->seconds_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 14, "Seconds")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 14, "Seconds")); instance->seconds_lbl = XtVaCreateWidget("dtb_options_seconds_lbl", xmLabelWidgetClass, @@ -2888,7 +2888,7 @@ dtb_options_signal_sb_create( return -1; if (instance->signal_sb_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 15, "Signal new mail with:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 15, "Signal new mail with:")); instance->signal_sb_label = XtVaCreateWidget("dtb_options_signal_sb_label", xmLabelWidgetClass, @@ -2933,7 +2933,7 @@ dtb_options_beeps_lbl_create( XmString label_xmstring = NULL; if (instance->beeps_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 16, "Beep(s)")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 16, "Beep(s)")); instance->beeps_lbl = XtVaCreateWidget("dtb_options_beeps_lbl", xmLabelWidgetClass, @@ -2994,7 +2994,7 @@ dtb_options_spinbox2_create( return -1; if (instance->spinbox2_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 91, " ")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 91, " ")); instance->spinbox2_label = XtVaCreateWidget("dtb_options_spinbox2_label", xmLabelWidgetClass, @@ -3039,7 +3039,7 @@ dtb_options_flashes_lbl_create( XmString label_xmstring = NULL; if (instance->flashes_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 17, "Flash(es)")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 17, "Flash(es)")); instance->flashes_lbl = XtVaCreateWidget("dtb_options_flashes_lbl", xmLabelWidgetClass, @@ -3100,7 +3100,7 @@ dtb_options_display_sb_create( return -1; if (instance->display_sb_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 18, "Display")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 18, "Display")); instance->display_sb_label = XtVaCreateWidget("dtb_options_display_sb_label", xmLabelWidgetClass, @@ -3145,7 +3145,7 @@ dtb_options_headers_lbl_create( XmString label_xmstring = NULL; if (instance->headers_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 19, "Headers")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 19, "Headers")); instance->headers_lbl = XtVaCreateWidget("dtb_options_headers_lbl", xmLabelWidgetClass, @@ -3215,7 +3215,7 @@ dtb_options_abr_header_lbl_create( XmString label_xmstring = NULL; if (instance->abr_header_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 23, "Abbreviated header will not include:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 23, "Abbreviated header will not include:")); instance->abr_header_lbl = XtVaCreateWidget("dtb_options_abr_header_lbl", xmLabelWidgetClass, @@ -3420,7 +3420,7 @@ dtb_options_display_row_sb_create( return -1; if (instance->display_row_sb_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 18, "Display")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 18, "Display")); instance->display_row_sb_label = XtVaCreateWidget("dtb_options_display_row_sb_label", xmLabelWidgetClass, @@ -3465,7 +3465,7 @@ dtb_options_rows_lbl_create( XmString label_xmstring = NULL; if (instance->rows_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 33, "Rows")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 33, "Rows")); instance->rows_lbl = XtVaCreateWidget("dtb_options_rows_lbl", xmLabelWidgetClass, @@ -3526,7 +3526,7 @@ dtb_options_characters_wide_sb_create( return -1; if (instance->characters_wide_sb_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 91, " ")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 91, " ")); instance->characters_wide_sb_label = XtVaCreateWidget("dtb_options_characters_wide_sb_label", xmLabelWidgetClass, @@ -3571,7 +3571,7 @@ dtb_options_char_wide_lbl_create( XmString label_xmstring = NULL; if (instance->char_wide_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 34, "Characters Wide")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 34, "Characters Wide")); instance->char_wide_lbl = XtVaCreateWidget("dtb_options_char_wide_lbl", xmLabelWidgetClass, @@ -3679,9 +3679,9 @@ dtb_options_hidden_fields_list_create( /* * Convert char* strings to XmStrings */ - hidden_fields_list_list_xmstrings[i++] = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 25, "x-lines")); - hidden_fields_list_list_xmstrings[i++] = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 26, "email-version")); - hidden_fields_list_list_xmstrings[i++] = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 27, "expires")); + hidden_fields_list_list_xmstrings[i++] = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 25, "x-lines")); + hidden_fields_list_list_xmstrings[i++] = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 26, "email-version")); + hidden_fields_list_list_xmstrings[i++] = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 27, "expires")); if (instance->hidden_fields_list == NULL) { n = 0; XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmAUTOMATIC); ++n; @@ -3720,7 +3720,7 @@ dtb_options_hidden_fields_lbl_create( XmString label_xmstring = NULL; if (instance->hidden_fields_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 28, "Hidden Fields:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 28, "Hidden Fields:")); instance->hidden_fields_lbl = XtVaCreateWidget("dtb_options_hidden_fields_lbl", xmLabelWidgetClass, @@ -3757,7 +3757,7 @@ dtb_options_header_fields_lbl_create( XmString label_xmstring = NULL; if (instance->header_fields_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 24, "Header Field:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 24, "Header Field:")); instance->header_fields_lbl = XtVaCreateWidget("dtb_options_header_fields_lbl", xmLabelWidgetClass, @@ -3794,7 +3794,7 @@ dtb_options_h_field_add_create( XmString label_xmstring = NULL; if (instance->h_field_add == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 29, "Add")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 29, "Add")); instance->h_field_add = XtVaCreateWidget("dtb_options_h_field_add", xmPushButtonWidgetClass, @@ -3831,7 +3831,7 @@ dtb_options_h_field_delete_create( XmString label_xmstring = NULL; if (instance->h_field_delete == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 30, "Delete")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 30, "Delete")); instance->h_field_delete = XtVaCreateWidget("dtb_options_h_field_delete", xmPushButtonWidgetClass, @@ -3868,7 +3868,7 @@ dtb_options_h_field_change_create( XmString label_xmstring = NULL; if (instance->h_field_change == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 31, "Change")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 31, "Change")); instance->h_field_change = XtVaCreateWidget("dtb_options_h_field_change", xmPushButtonWidgetClass, @@ -3932,7 +3932,7 @@ dtb_options_wrap_checkbox_create( return -1; if (instance->wrap_checkbox_items.Show_Attachment_List_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 36, "Show Attachment List")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 36, "Show Attachment List")); instance->wrap_checkbox_items.Show_Attachment_List_item = XtVaCreateManagedWidget("dtb_options_wrap_checkbox_show_attachment_list_item", xmToggleButtonWidgetClass, @@ -4014,7 +4014,7 @@ dtb_options_confirm_attachment_create( if (instance->cfrm_att_checkbox_items.Confirm_Attachment_item == NULL) { label_xmstring = XmStringCreateLocalized( - GETMSG(Dtb_project_catd, 2, 94, "Confirm attachments over:")); + CATGETS(Dtb_project_catd, 2, 94, "Confirm attachments over:")); instance->cfrm_att_checkbox_items.Confirm_Attachment_item = XtVaCreateManagedWidget( @@ -4061,7 +4061,7 @@ dtb_options_confirm_attachment_create( if (instance->visit_mailb_lbl == NULL) { label_xmstring = - XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 95, "kilobytes")); + XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 95, "kilobytes")); instance->cfrm_att_size_mb_lbl = XtVaCreateManagedWidget("dtb_options_cfrm_att_size_mb_lbl", xmLabelWidgetClass, @@ -4192,7 +4192,7 @@ dtb_options_deadletter_field_create( return -1; if (instance->deadletter_field_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 38, "Dead Letter Folder:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 38, "Dead Letter Folder:")); instance->deadletter_field_label = XtVaCreateWidget("dtb_options_deadletter_field_label", xmLabelWidgetClass, @@ -4263,7 +4263,7 @@ dtb_options_format_menu_lbl_create( XmString label_xmstring = NULL; if (instance->format_menu_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 39, "Format Menu Custom Fields")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 39, "Format Menu Custom Fields")); instance->format_menu_lbl = XtVaCreateWidget("dtb_options_format_menu_lbl", xmLabelWidgetClass, @@ -4371,7 +4371,7 @@ dtb_options_indent_str_tf_create( XtSetArg(args[n], XmNleftOffset, 4); ++n; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); ++n; XtSetArg(args[n], XmNtopAttachment, XmATTACH_NONE); ++n; - XtSetArg(args[n], XmNvalue, GETMSG(Dtb_project_catd, 2, 37, ">")); ++n; + XtSetArg(args[n], XmNvalue, CATGETS(Dtb_project_catd, 2, 37, ">")); ++n; XtSetArg(args[n], XmNmaxLength, 80); ++n; XtSetArg(args[n], XmNeditable, True); ++n; XtSetArg(args[n], XmNcursorPositionVisible, True); ++n; @@ -4428,7 +4428,7 @@ dtb_options_indent_str_lbl_create( XmString label_xmstring = NULL; if (instance->indent_str_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 52, "Indent string")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 52, "Indent string")); instance->indent_str_lbl = XtVaCreateWidget("dtb_options_indent_str_lbl", xmLabelWidgetClass, @@ -4458,7 +4458,7 @@ dtb_options_reply_include_lbl_create( XmString label_xmstring = NULL; if (instance->reply_include_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 53, "for Reply Include:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 53, "for Reply Include:")); instance->reply_include_lbl = XtVaCreateWidget("dtb_options_reply_include_lbl", xmLabelWidgetClass, @@ -4526,8 +4526,8 @@ dtb_options_list_create( /* * Convert char* strings to XmStrings */ - list_list_xmstrings[i++] = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 40, "bcc")); - list_list_xmstrings[i++] = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 41, "return-receipt")); + list_list_xmstrings[i++] = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 40, "bcc")); + list_list_xmstrings[i++] = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 41, "return-receipt")); if (instance->list == NULL) { n = 0; XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmAUTOMATIC); ++n; @@ -4566,7 +4566,7 @@ dtb_options_menu_labels_lbl_create( XmString label_xmstring = NULL; if (instance->menu_labels_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 42, "Menu Labels:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 42, "Menu Labels:")); instance->menu_labels_lbl = XtVaCreateWidget("dtb_options_menu_labels_lbl", xmLabelWidgetClass, @@ -4669,7 +4669,7 @@ dtb_options_hdr_field_lbl_create( XmString label_xmstring = NULL; if (instance->hdr_field_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 50, "Header Field:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 50, "Header Field:")); instance->hdr_field_lbl = XtVaCreateWidget("dtb_options_hdr_field_lbl", xmLabelWidgetClass, @@ -4707,7 +4707,7 @@ dtb_options_def_value_lbl_create( XmString label_xmstring = NULL; if (instance->def_value_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 51, "Default Value:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 51, "Default Value:")); instance->def_value_lbl = XtVaCreateWidget("dtb_options_def_value_lbl", xmLabelWidgetClass, @@ -4745,7 +4745,7 @@ dtb_options_add_button_create( XmString label_xmstring = NULL; if (instance->add_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 29, "Add")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 29, "Add")); instance->add_button = XtVaCreateWidget("dtb_options_add_button", xmPushButtonWidgetClass, @@ -4782,7 +4782,7 @@ dtb_options_del_button_create( XmString label_xmstring = NULL; if (instance->del_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 30, "Delete")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 30, "Delete")); instance->del_button = XtVaCreateWidget("dtb_options_del_button", xmPushButtonWidgetClass, @@ -4819,7 +4819,7 @@ dtb_options_change_button_create( XmString label_xmstring = NULL; if (instance->change_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 31, "Change")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 31, "Change")); instance->change_button = XtVaCreateWidget("dtb_options_change_button", xmPushButtonWidgetClass, @@ -4948,7 +4948,7 @@ dtb_options_mailb_for_sent_lbl_create( XmString label_xmstring = NULL; if (instance->mailb_for_sent_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 61, "Mailbox for sent messages:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 61, "Mailbox for sent messages:")); instance->mailb_for_sent_lbl = XtVaCreateWidget("dtb_options_mailb_for_sent_lbl", xmLabelWidgetClass, @@ -5068,7 +5068,7 @@ dtb_options_dpy_up_mbox_cb_create( return -1; if (instance->dpy_up_mbox_cb_items.Display_up_to_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 59, "Display up to:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 59, "Display up to:")); instance->dpy_up_mbox_cb_items.Display_up_to_item = XtVaCreateManagedWidget("dtb_options_dpy_up_mbox_cb_display_up_to_item", xmToggleButtonWidgetClass, @@ -5128,7 +5128,7 @@ dtb_options_visit_mailb_lbl_create( XmString label_xmstring = NULL; if (instance->visit_mailb_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 60, "Recently visited mailboxes")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 60, "Recently visited mailboxes")); instance->visit_mailb_lbl = XtVaCreateWidget("dtb_options_visit_mailb_lbl", xmLabelWidgetClass, @@ -5212,7 +5212,7 @@ dtb_options_log_cb_create( return -1; if (instance->log_cb_items.Log_all_sent_messages_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 62, "Log all sent messages")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 62, "Log all sent messages")); instance->log_cb_items.Log_all_sent_messages_item = XtVaCreateManagedWidget("dtb_options_log_cb_log_all_sent_messages_item", xmToggleButtonWidgetClass, @@ -5374,7 +5374,7 @@ dtb_options_move_menu_lbl_create( XmString label_xmstring = NULL; if (instance->move_menu_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 57, "Move Menu")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 57, "Move Menu")); instance->move_menu_lbl = XtVaCreateWidget("dtb_options_move_menu_lbl", xmLabelWidgetClass, @@ -5411,7 +5411,7 @@ dtb_options_move_menu_lbl2_create( XmString label_xmstring = NULL; if (instance->move_menu_lbl2 == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 58, "and Copy To Menu:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 58, "and Copy To Menu:")); instance->move_menu_lbl2 = XtVaCreateWidget("dtb_options_move_menu_lbl2", xmLabelWidgetClass, @@ -5448,7 +5448,7 @@ dtb_options_path_file_lbl_create( XmString label_xmstring = NULL; if (instance->path_file_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 54, "Path / File Name:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 54, "Path / File Name:")); instance->path_file_lbl = XtVaCreateWidget("dtb_options_path_file_lbl", xmLabelWidgetClass, @@ -5486,7 +5486,7 @@ dtb_options_start_look_lbl_create( XmString label_xmstring = NULL; if (instance->start_look_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 55, "Start looking in:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 55, "Start looking in:")); instance->start_look_lbl = XtVaCreateWidget("dtb_options_start_look_lbl", xmLabelWidgetClass, @@ -5524,7 +5524,7 @@ dtb_options_mm_add_butt_create( XmString label_xmstring = NULL; if (instance->mm_add_butt == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 29, "Add")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 29, "Add")); instance->mm_add_butt = XtVaCreateWidget("dtb_options_mm_add_butt", xmPushButtonWidgetClass, @@ -5561,7 +5561,7 @@ dtb_options_mm_delete_butt_create( XmString label_xmstring = NULL; if (instance->mm_delete_butt == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 30, "Delete")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 30, "Delete")); instance->mm_delete_butt = XtVaCreateWidget("dtb_options_mm_delete_butt", xmPushButtonWidgetClass, @@ -5598,7 +5598,7 @@ dtb_options_mm_change_butt_create( XmString label_xmstring = NULL; if (instance->mm_change_butt == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 31, "Change")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 31, "Change")); instance->mm_change_butt = XtVaCreateWidget("dtb_options_mm_change_butt", xmPushButtonWidgetClass, @@ -5635,7 +5635,7 @@ dtb_options_vacation_lbl_create( XmString label_xmstring = NULL; if (instance->vacation_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 66, "Vacation Precedence = junk")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 66, "Vacation Precedence = junk")); instance->vacation_lbl = XtVaCreateWidget("dtb_options_vacation_lbl", xmLabelWidgetClass, @@ -5730,7 +5730,7 @@ dtb_options_vacation_rb_create( return -1; if (instance->vacation_rb_items.On_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 64, "On")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 64, "On")); instance->vacation_rb_items.On_item = XtVaCreateManagedWidget("dtb_options_vacation_rb_on_item", xmToggleButtonWidgetClass, @@ -5745,7 +5745,7 @@ dtb_options_vacation_rb_create( return -1; if (instance->vacation_rb_items.Off_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 65, "Off")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 65, "Off")); instance->vacation_rb_items.Off_item = XtVaCreateManagedWidget("dtb_options_vacation_rb_off_item", xmToggleButtonWidgetClass, @@ -5822,7 +5822,7 @@ dtb_options_subject_tf_create( XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION); ++n; XtSetArg(args[n], XmNtopOffset, 4); ++n; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); ++n; - XtSetArg(args[n], XmNvalue, GETMSG(Dtb_project_catd, 2, 68, "Out of the office")); ++n; + XtSetArg(args[n], XmNvalue, CATGETS(Dtb_project_catd, 2, 68, "Out of the office")); ++n; XtSetArg(args[n], XmNmaxLength, 80); ++n; XtSetArg(args[n], XmNeditable, True); ++n; XtSetArg(args[n], XmNcursorPositionVisible, True); ++n; @@ -5847,7 +5847,7 @@ dtb_options_msg_list_lbl_create( XmString label_xmstring = NULL; if (instance->msg_list_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 69, "Message:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 69, "Message:")); instance->msg_list_lbl = XtVaCreateWidget("dtb_options_msg_list_lbl", xmLabelWidgetClass, @@ -5884,7 +5884,7 @@ dtb_options_subject_lbl_create( XmString label_xmstring = NULL; if (instance->subject_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 67, "Subject:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 67, "Subject:")); instance->subject_lbl = XtVaCreateWidget("dtb_options_subject_lbl", xmLabelWidgetClass, @@ -5922,7 +5922,7 @@ dtb_options_vacation_rb_lbl_create( XmString label_xmstring = NULL; if (instance->vacation_rb_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 63, "Vacation:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 63, "Vacation:")); instance->vacation_rb_lbl = XtVaCreateWidget("dtb_options_vacation_rb_lbl", xmLabelWidgetClass, @@ -6127,7 +6127,7 @@ dtb_options_templates_list_lbl_create( XmString label_xmstring = NULL; if (instance->templates_list_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 72, "Templates:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 72, "Templates:")); instance->templates_list_lbl = XtVaCreateWidget("dtb_options_templates_list_lbl", xmLabelWidgetClass, @@ -6164,7 +6164,7 @@ dtb_options_menu_label_lbl_create( XmString label_xmstring = NULL; if (instance->menu_label_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 71, "Menu Label:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 71, "Menu Label:")); instance->menu_label_lbl = XtVaCreateWidget("dtb_options_menu_label_lbl", xmLabelWidgetClass, @@ -6202,7 +6202,7 @@ dtb_options_path_filename_label_lbl_create( XmString label_xmstring = NULL; if (instance->path_filename_label_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 54, "Path / File Name:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 54, "Path / File Name:")); instance->path_filename_label_lbl = XtVaCreateWidget("dtb_options_path_filename_label_lbl", xmLabelWidgetClass, @@ -6240,7 +6240,7 @@ dtb_options_tem_add_but_create( XmString label_xmstring = NULL; if (instance->tem_add_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 29, "Add")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 29, "Add")); instance->tem_add_but = XtVaCreateWidget("dtb_options_tem_add_but", xmPushButtonWidgetClass, @@ -6277,7 +6277,7 @@ dtb_options_tem_del_but_create( XmString label_xmstring = NULL; if (instance->tem_del_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 30, "Delete")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 30, "Delete")); instance->tem_del_but = XtVaCreateWidget("dtb_options_tem_del_but", xmPushButtonWidgetClass, @@ -6314,7 +6314,7 @@ dtb_options_tem_change_but_create( XmString label_xmstring = NULL; if (instance->tem_change_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 31, "Change")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 31, "Change")); instance->tem_change_but = XtVaCreateWidget("dtb_options_tem_change_but", xmPushButtonWidgetClass, @@ -6518,7 +6518,7 @@ dtb_options_alias_list_lbl_create( XmString label_xmstring = NULL; if (instance->alias_list_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 75, "Aliases:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 75, "Aliases:")); instance->alias_list_lbl = XtVaCreateWidget("dtb_options_alias_list_lbl", xmLabelWidgetClass, @@ -6555,7 +6555,7 @@ dtb_options_alias_tf_lbl_create( XmString label_xmstring = NULL; if (instance->alias_tf_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 73, "Alias:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 73, "Alias:")); instance->alias_tf_lbl = XtVaCreateWidget("dtb_options_alias_tf_lbl", xmLabelWidgetClass, @@ -6593,7 +6593,7 @@ dtb_options_address_tf_lbl_create( XmString label_xmstring = NULL; if (instance->address_tf_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 74, "Addresses:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 74, "Addresses:")); instance->address_tf_lbl = XtVaCreateWidget("dtb_options_address_tf_lbl", xmLabelWidgetClass, @@ -6631,7 +6631,7 @@ dtb_options_alias_add_but_create( XmString label_xmstring = NULL; if (instance->alias_add_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 29, "Add")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 29, "Add")); instance->alias_add_but = XtVaCreateWidget("dtb_options_alias_add_but", xmPushButtonWidgetClass, @@ -6668,7 +6668,7 @@ dtb_options_alias_delete_but_create( XmString label_xmstring = NULL; if (instance->alias_delete_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 30, "Delete")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 30, "Delete")); instance->alias_delete_but = XtVaCreateWidget("dtb_options_alias_delete_but", xmPushButtonWidgetClass, @@ -6705,7 +6705,7 @@ dtb_options_al_change_but_create( XmString label_xmstring = NULL; if (instance->al_change_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 31, "Change")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 31, "Change")); instance->al_change_but = XtVaCreateWidget("dtb_options_al_change_but", xmPushButtonWidgetClass, @@ -6780,7 +6780,7 @@ dtb_options_update_mailb_lbl_create( XmString label_xmstring = NULL; if (instance->update_mailb_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 76, "Update mailbox state:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 76, "Update mailbox state:")); instance->update_mailb_lbl = XtVaCreateWidget("dtb_options_update_mailb_lbl", xmLabelWidgetClass, @@ -6816,7 +6816,7 @@ dtb_options_frequently_lbl_create( XmString label_xmstring = NULL; if (instance->frequently_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 77, "Frequently")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 77, "Frequently")); instance->frequently_lbl = XtVaCreateWidget("dtb_options_frequently_lbl", xmLabelWidgetClass, @@ -6852,7 +6852,7 @@ dtb_options_seldom_lbl_create( XmString label_xmstring = NULL; if (instance->seldom_lbl == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 78, "Seldom")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 78, "Seldom")); instance->seldom_lbl = XtVaCreateWidget("dtb_options_seldom_lbl", xmLabelWidgetClass, @@ -6947,7 +6947,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_label == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 79, "Defaults:")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 79, "Defaults:")); instance->adv_def_cb_label = XtVaCreateWidget("dtb_options_adv_def_cb_label", xmLabelWidgetClass, @@ -6980,7 +6980,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_items.Show_confirmation_notices_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 80, "Show confirmation notices")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 80, "Show confirmation notices")); instance->adv_def_cb_items.Show_confirmation_notices_item = XtVaCreateManagedWidget("dtb_options_adv_def_cb_show_confirmation_notices_item", xmToggleButtonWidgetClass, @@ -6995,7 +6995,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_items.Use_strict_MIME_character_encoding_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 81, "Use strict MIME character encoding")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 81, "Use strict MIME character encoding")); instance->adv_def_cb_items.Use_strict_MIME_character_encoding_item = XtVaCreateManagedWidget("dtb_options_adv_def_cb_use_strict_m_i_m_e_character_encoding_item", xmToggleButtonWidgetClass, @@ -7010,7 +7010,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_items.Use_network_aware_mail_file_locking_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 82, "Use network aware mail file locking")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 82, "Use network aware mail file locking")); instance->adv_def_cb_items.Use_network_aware_mail_file_locking_item = XtVaCreateManagedWidget("dtb_options_adv_def_cb_use_network_aware_mail_file_locking_item", xmToggleButtonWidgetClass, @@ -7025,7 +7025,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_items.Ignore_host_name_in_address_allnet_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 83, "Ignore host name in address (allnet)")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 83, "Ignore host name in address (allnet)")); instance->adv_def_cb_items.Ignore_host_name_in_address_allnet_item = XtVaCreateManagedWidget("dtb_options_adv_def_cb_ignore_host_name_in_address_allnet_item", xmToggleButtonWidgetClass, @@ -7040,7 +7040,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_items.Include_me_when_I_Reply_to_all_metoo_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 84, "Include me when I \"Reply to All\" (metoo)")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 84, "Include me when I \"Reply to All\" (metoo)")); instance->adv_def_cb_items.Include_me_when_I_Reply_to_all_metoo_item = XtVaCreateManagedWidget("dtb_options_adv_def_cb_include_me_when_i_reply_to_all_metoo_item", xmToggleButtonWidgetClass, @@ -7055,7 +7055,7 @@ dtb_options_adv_def_cb_create( return -1; if (instance->adv_def_cb_items.Use_local_name_username_item == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 85, "Use local name: username =")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 85, "Use local name: username =")); instance->adv_def_cb_items.Use_local_name_username_item = XtVaCreateManagedWidget("dtb_options_adv_def_cb_use_local_name_username_item", xmToggleButtonWidgetClass, @@ -7214,7 +7214,7 @@ dtb_options_local_name_add_but_create( XmString label_xmstring = NULL; if (instance->local_name_add_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 29, "Add")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 29, "Add")); instance->local_name_add_but = XtVaCreateWidget("dtb_options_local_name_add_but", xmPushButtonWidgetClass, @@ -7251,7 +7251,7 @@ dtb_options_local_name_del_but_create( XmString label_xmstring = NULL; if (instance->local_name_del_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 30, "Delete")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 30, "Delete")); instance->local_name_del_but = XtVaCreateWidget("dtb_options_local_name_del_but", xmPushButtonWidgetClass, @@ -7288,7 +7288,7 @@ dtb_options_local_name_chg_but_create( XmString label_xmstring = NULL; if (instance->local_name_chg_but == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 31, "Change")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 31, "Change")); instance->local_name_chg_but = XtVaCreateWidget("dtb_options_local_name_chg_but", xmPushButtonWidgetClass, @@ -7325,7 +7325,7 @@ dtb_options_ok_button_create( XmString label_xmstring = NULL; if (instance->ok_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 86, "OK")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 86, "OK")); instance->ok_button = XtVaCreateWidget("dtb_options_ok_button", xmPushButtonWidgetClass, @@ -7365,7 +7365,7 @@ dtb_options_reset_button_create( XmString label_xmstring = NULL; if (instance->reset_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 87, "Reset")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 87, "Reset")); instance->reset_button = XtVaCreateWidget("dtb_options_reset_button", xmPushButtonWidgetClass, @@ -7405,7 +7405,7 @@ dtb_options_cancel_button_create( XmString label_xmstring = NULL; if (instance->cancel_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 88, "Cancel")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 88, "Cancel")); instance->cancel_button = XtVaCreateWidget("dtb_options_cancel_button", xmPushButtonWidgetClass, @@ -7476,7 +7476,7 @@ dtb_options_apply_button_create( XmString label_xmstring = NULL; if (instance->apply_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 89, "Apply")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 89, "Apply")); instance->apply_button = XtVaCreateWidget("dtb_options_apply_button", xmPushButtonWidgetClass, @@ -7516,7 +7516,7 @@ dtb_options_help_button_create( XmString label_xmstring = NULL; if (instance->help_button == NULL) { - label_xmstring = XmStringCreateLocalized(GETMSG(Dtb_project_catd, 2, 90, "Help")); + label_xmstring = XmStringCreateLocalized(CATGETS(Dtb_project_catd, 2, 90, "Help")); instance->help_button = XtVaCreateWidget("dtb_options_help_button", xmPushButtonWidgetClass, diff --git a/cde/programs/dtmail/include/DtMail/Common.h b/cde/programs/dtmail/include/DtMail/Common.h index b95cbd627..7e709f928 100644 --- a/cde/programs/dtmail/include/DtMail/Common.h +++ b/cde/programs/dtmail/include/DtMail/Common.h @@ -44,7 +44,7 @@ #define _COMMON_H #include -#include +#include
// XPG3 compatible. NL_CAT_LOCALE is set to non-zero in XPG4. Use NL_CAT_LOCALE // for all catopen() calls. diff --git a/cde/programs/dtmail/include/DtMail/DtMail.hh b/cde/programs/dtmail/include/DtMail/DtMail.hh index 7c9e40742..f8d575bb0 100644 --- a/cde/programs/dtmail/include/DtMail/DtMail.hh +++ b/cde/programs/dtmail/include/DtMail/DtMail.hh @@ -52,7 +52,7 @@ #include #endif #include -/*#include */ +/*#include
*/ #include #include #include diff --git a/cde/programs/dtmail/include/DtMail/DtMailError.hh b/cde/programs/dtmail/include/DtMail/DtMailError.hh index f86e71796..5d6b314f2 100644 --- a/cde/programs/dtmail/include/DtMail/DtMailError.hh +++ b/cde/programs/dtmail/include/DtMail/DtMailError.hh @@ -48,7 +48,7 @@ #include #include #include -#include +#include
// // Name of the messaging database file. diff --git a/cde/programs/dtmail/include/MotifApp/dtmailopts.h b/cde/programs/dtmail/include/MotifApp/dtmailopts.h index 3c16ac37e..a96c51574 100644 --- a/cde/programs/dtmail/include/MotifApp/dtmailopts.h +++ b/cde/programs/dtmail/include/MotifApp/dtmailopts.h @@ -43,7 +43,7 @@ #include #include -#include +#include
#define DTB_PROJECT_CATALOG "dtmailopts" /* Handle for standard message catalog for the project */ extern nl_catd Dtb_project_catd; diff --git a/cde/programs/dtmail/include/utils/NLS.hh b/cde/programs/dtmail/include/utils/NLS.hh deleted file mode 100644 index e56ea5006..000000000 --- a/cde/programs/dtmail/include/utils/NLS.hh +++ /dev/null @@ -1,53 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -// $XConsortium: NLS.hh /main/2 1996/05/09 20:05:27 drk $ -/* - *+SNOTICE - * - * RESTRICTED CONFIDENTIAL INFORMATION: - * - * The information in this document is subject to special - * restrictions in a confidential disclosure agreement bertween - * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this - * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout - * Sun's specific written approval. This documment and all copies - * and derivative works thereof must be returned or destroyed at - * Sun's request. - * - * Copyright 1993 Sun Microsystems, Inc. All rights reserved. - * - *+ENOTICE - */ - -#ifndef _NLS_HH -#define _NLS_HH - -char *catgets_cache2(nl_catd catd, int set, int num, char *dflt); - -#ifdef hpV4 -# define GETMSG(catd, set_num, msg_num, def_str) catgets_cache2(catd, set_num, msg_num, def_str) -#else -# define GETMSG(catd, set_num, msg_num, def_str) catgets(catd, set_num, msg_num, def_str) -#endif - -#endif diff --git a/cde/programs/dtmail/libDtMail/Common/DtMailError.C b/cde/programs/dtmail/libDtMail/Common/DtMailError.C index 6a22794b2..3e2e9f420 100644 --- a/cde/programs/dtmail/libDtMail/Common/DtMailError.C +++ b/cde/programs/dtmail/libDtMail/Common/DtMailError.C @@ -400,12 +400,6 @@ DtMailEnv::DtMailEnv() _error_minor_code = DTME_NoError; } -#ifdef hpV4 -#define GETMSG(catd, set, msg, dft) _DtCatgetsCached(catd, set, msg, dft) -#else -#define GETMSG(catd, set, msg, dft) catgets(catd, set, msg, dft) -#endif - char * DtMailEnv::getMessageText(int set, int msg, char *dft) { @@ -415,10 +409,10 @@ DtMailEnv::getMessageText(int set, int msg, char *dft) if ((oneTimeFlag == 0) && (_errorCatalog == (nl_catd) -1)) { oneTimeFlag++; - _errorCatalog = catopen((char*) DtMailCatalogDataFile, NL_CAT_LOCALE); + _errorCatalog = CATOPEN((char*) DtMailCatalogDataFile, NL_CAT_LOCALE); } if (_errorCatalog != (nl_catd) -1) - message = GETMSG(_errorCatalog, set, msg, dft); + message = CATGETS(_errorCatalog, set, msg, dft); return message; } diff --git a/cde/programs/dtpad/dtpad.c b/cde/programs/dtpad/dtpad.c index ab16cb2b8..12779a29c 100644 --- a/cde/programs/dtpad/dtpad.c +++ b/cde/programs/dtpad/dtpad.c @@ -61,7 +61,7 @@ #ifndef NO_MESSAGE_CATALOG # define TRUE 1 # define FALSE 0 -# include +# include
#endif extern Editor *pPadList; /* declared in main.c */ diff --git a/cde/programs/dtpad/dtpad.h b/cde/programs/dtpad/dtpad.h index 711e15da1..ff0c9db3d 100644 --- a/cde/programs/dtpad/dtpad.h +++ b/cde/programs/dtpad/dtpad.h @@ -745,7 +745,7 @@ extern void RestoreInitialServerResources( extern char * _DtpadGetMessage( int set, int number, - char *string); + const char *string); #endif diff --git a/cde/programs/dtpad/main.c b/cde/programs/dtpad/main.c index 84b31aa5a..583035042 100644 --- a/cde/programs/dtpad/main.c +++ b/cde/programs/dtpad/main.c @@ -113,7 +113,7 @@ #ifndef NO_MESSAGE_CATALOG # define TRUE 1 # define FALSE 0 -# include +# include
# if !defined(NL_CAT_LOCALE) # define NL_CAT_LOCALE 0 # endif @@ -1703,27 +1703,19 @@ char * _DtpadGetMessage( int set, int number, - char *string ) + const char *string) { - char *msg; - nl_catd catopen(); - char *catgets(); static int first = 1; - static nl_catd nlmsg_fd; + static nl_catd nlmsg_fd = (nl_catd) -1; if ( first ) { first = 0; - nlmsg_fd = catopen(_DTPAD_CAT_NAME, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(_DTPAD_CAT_NAME, NL_CAT_LOCALE); - if (nlmsg_fd == -1) + if (nlmsg_fd == (nl_catd) -1) perror("catopen"); } -#if defined(hpV4) - msg = _DtCatgetsCached(nlmsg_fd, set, number, string); -#else - msg = catgets(nlmsg_fd, set, number, string); -#endif - return (msg); + return CATGETS(nlmsg_fd, set, number, string); } #endif /* NO_MESSAGE_CATALOG */ diff --git a/cde/programs/dtpdm/PdmMsgs.c b/cde/programs/dtpdm/PdmMsgs.c index 177759384..fb1d7ecc9 100644 --- a/cde/programs/dtpdm/PdmMsgs.c +++ b/cde/programs/dtpdm/PdmMsgs.c @@ -36,7 +36,7 @@ #ifdef I18N_MSG -#include +#include
#if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 @@ -81,21 +81,14 @@ DtPdmGetMessage( int n, char * s) { - char *msg; - nl_catd catopen(); - char *catgets(); static int first = 1; static nl_catd nlmsg_fd; - - if(set == -1 || n == -1) - return s; - + if(first) { first = 0; - nlmsg_fd = catopen(DTPDM_CAT_NAME, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN(DTPDM_CAT_NAME, NL_CAT_LOCALE); } - msg=catgets(nlmsg_fd,set,n,s); - return (msg); + return CATGETS(nlmsg_fd,set,n,s); } #endif /* I18N_MSG */ diff --git a/cde/programs/dtpdm/PdmMsgs.h b/cde/programs/dtpdm/PdmMsgs.h index a23d6c80a..98b63519c 100644 --- a/cde/programs/dtpdm/PdmMsgs.h +++ b/cde/programs/dtpdm/PdmMsgs.h @@ -37,7 +37,7 @@ #define _PdmMsgs_h #ifdef I18N_MSG -#include +#include
#define DTPDM_GETMESSAGE(set, number, string) \ DtPdmGetMessage(set, number, string) diff --git a/cde/programs/dtpdmd/Imakefile b/cde/programs/dtpdmd/Imakefile index 8dc7eb5fc..5e4db97b8 100644 --- a/cde/programs/dtpdmd/Imakefile +++ b/cde/programs/dtpdmd/Imakefile @@ -34,13 +34,12 @@ SRCS = dispatch.c dtpdmd.c mailbox.c \ OBJS = dispatch.o dtpdmd.o mailbox.o \ manager.o records.o setup.o \ - util.o nlmsg.o + util.o nlmsg.o \ + $(CDELIBSRC)/DtSvc/DtUtil2/MsgCat.o #if defined(LinuxArchitecture) || defined(BSDArchitecture) /* On Linux, just use the system provided Xau */ DEPXAUTHLIB = #endif - ComplexProgramTarget(dtpdmd) - diff --git a/cde/programs/dtpdmd/nlmsg.c b/cde/programs/dtpdmd/nlmsg.c index 4aa862c5c..23ba55c77 100644 --- a/cde/programs/dtpdmd/nlmsg.c +++ b/cde/programs/dtpdmd/nlmsg.c @@ -34,18 +34,12 @@ * (c) Copyright 1996 Hitachi. */ -#ifdef I18N_MSG - -#include +#include "nlmsg.h" #if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 #endif -#define DTPDMD_CAT_NAME "dtpdmd" - -#endif /* I18N_MSG */ - /* * ------------------------------------------------------------------------ * Default message values @@ -108,8 +102,6 @@ const char DtPdmdMsg_0015[] = "\ const char DtPdmdMsg_0016[] = "%1$s: error, cannot open log file \"%2$s\". Turning off stderr message logging\n"; -#ifdef I18N_MSG - /* * ------------------------------------------------------------------------ * Name: DtPdmdGetMessage @@ -126,26 +118,17 @@ const char DtPdmdMsg_0016[] = "%1$s: error, cannot open log file \"%2$s\". Turni * Returns: the string for set 'set' and number 'n'. */ const char * -DtPdmdGetMessage( - int set, - int n, - char * s) +DtPdmdGetMessage(int set, + int n, + const char *s) { - char *msg; - nl_catd catopen(); - char *catgets(); static int first = 1; - static nl_catd nlmsg_fd; - - if(set == -1 || n == -1) - return s; - - if(first) + static nl_catd nlmsg_fd = (nl_catd) -1; + + if (first) { first = 0; - nlmsg_fd = catopen(DTPDMD_CAT_NAME, NL_CAT_LOCALE); + nlmsg_fd = CATOPEN("dtpdmd", NL_CAT_LOCALE); } - msg=catgets(nlmsg_fd,set,n,s); - return (msg); + return CATGETS(nlmsg_fd, set, n, s); } -#endif /* I18N_MSG */ diff --git a/cde/programs/dtpdmd/nlmsg.h b/cde/programs/dtpdmd/nlmsg.h index 157d3b78b..c3bf1dd69 100644 --- a/cde/programs/dtpdmd/nlmsg.h +++ b/cde/programs/dtpdmd/nlmsg.h @@ -36,65 +36,46 @@ #ifndef _PdmdMsgs_h #define _PdmdMsgs_h -#ifdef I18N_MSG -#include -#define DTPDMD_GETMESSAGE(set, number, string) \ - DtPdmdGetMessage(set, number, string) +#include
-#else /* I18N_MSG */ -#define DTPDMD_GETMESSAGE(set, number, string) (string) -#endif /* I18N_MSG */ +#define PDMD_MSG_1 DtPdmdGetMessage(1, 1, DtPdmdMsg_0001) +#define PDMD_MSG_2 DtPdmdGetMessage(1, 2, DtPdmdMsg_0002) +#define PDMD_MSG_3 DtPdmdGetMessage(1, 3, DtPdmdMsg_0003) +#define PDMD_MSG_4 DtPdmdGetMessage(1, 4, DtPdmdMsg_0004) +#define PDMD_MSG_5 DtPdmdGetMessage(1, 5, DtPdmdMsg_0005) +#define PDMD_MSG_6 DtPdmdGetMessage(1, 6, DtPdmdMsg_0006) +#define PDMD_MSG_7 DtPdmdGetMessage(1, 7, DtPdmdMsg_0007) +#define PDMD_MSG_8 DtPdmdGetMessage(1, 8, DtPdmdMsg_0008) +#define PDMD_MSG_9 DtPdmdGetMessage(1, 9, DtPdmdMsg_0009) +#define PDMD_MSG_10 DtPdmdGetMessage(1, 10, DtPdmdMsg_0010) +#define PDMD_MSG_11 DtPdmdGetMessage(1, 11, DtPdmdMsg_0011) +#define PDMD_MSG_12 DtPdmdGetMessage(1, 12, DtPdmdMsg_0012) +#define PDMD_MSG_13 DtPdmdGetMessage(1, 13, DtPdmdMsg_0013) +#define PDMD_MSG_14 DtPdmdGetMessage(1, 14, DtPdmdMsg_0014) +#define PDMD_MSG_15 DtPdmdGetMessage(1, 15, DtPdmdMsg_0015) +#define PDMD_MSG_16 DtPdmdGetMessage(1, 16, DtPdmdMsg_0016) -/*** const causes the HP compiler to complain. Remove reference until *** - *** the build and integration people can figure out how to get this to *** - *** work. ***/ - -/* #define CONST const */ -#define CONST - -#define PDMD_MSG_1 DTPDMD_GETMESSAGE(1, 1, DtPdmdMsg_0001) -#define PDMD_MSG_2 DTPDMD_GETMESSAGE(1, 2, DtPdmdMsg_0002) -#define PDMD_MSG_3 DTPDMD_GETMESSAGE(1, 3, DtPdmdMsg_0003) -#define PDMD_MSG_4 DTPDMD_GETMESSAGE(1, 4, DtPdmdMsg_0004) -#define PDMD_MSG_5 DTPDMD_GETMESSAGE(1, 5, DtPdmdMsg_0005) -#define PDMD_MSG_6 DTPDMD_GETMESSAGE(1, 6, DtPdmdMsg_0006) -#define PDMD_MSG_7 DTPDMD_GETMESSAGE(1, 7, DtPdmdMsg_0007) -#define PDMD_MSG_8 DTPDMD_GETMESSAGE(1, 8, DtPdmdMsg_0008) -#define PDMD_MSG_9 DTPDMD_GETMESSAGE(1, 9, DtPdmdMsg_0009) -#define PDMD_MSG_10 DTPDMD_GETMESSAGE(1, 10, DtPdmdMsg_0010) -#define PDMD_MSG_11 DTPDMD_GETMESSAGE(1, 11, DtPdmdMsg_0011) -#define PDMD_MSG_12 DTPDMD_GETMESSAGE(1, 12, DtPdmdMsg_0012) -#define PDMD_MSG_13 DTPDMD_GETMESSAGE(1, 13, DtPdmdMsg_0013) -#define PDMD_MSG_14 DTPDMD_GETMESSAGE(1, 14, DtPdmdMsg_0014) -#define PDMD_MSG_15 DTPDMD_GETMESSAGE(1, 15, DtPdmdMsg_0015) -#define PDMD_MSG_16 DTPDMD_GETMESSAGE(1, 16, DtPdmdMsg_0016) - -extern CONST char DtPdmdMsg_0001[]; -extern CONST char DtPdmdMsg_0002[]; -extern CONST char DtPdmdMsg_0003[]; -extern CONST char DtPdmdMsg_0004[]; -extern CONST char DtPdmdMsg_0005[]; -extern CONST char DtPdmdMsg_0006[]; -extern CONST char DtPdmdMsg_0007[]; -extern CONST char DtPdmdMsg_0008[]; -extern CONST char DtPdmdMsg_0009[]; -extern CONST char DtPdmdMsg_0010[]; -extern CONST char DtPdmdMsg_0011[]; -extern CONST char DtPdmdMsg_0012[]; -extern CONST char DtPdmdMsg_0013[]; -extern CONST char DtPdmdMsg_0014[]; -extern CONST char DtPdmdMsg_0015[]; -extern CONST char DtPdmdMsg_0016[]; - -#ifdef I18N_MSG +extern const char DtPdmdMsg_0001[]; +extern const char DtPdmdMsg_0002[]; +extern const char DtPdmdMsg_0003[]; +extern const char DtPdmdMsg_0004[]; +extern const char DtPdmdMsg_0005[]; +extern const char DtPdmdMsg_0006[]; +extern const char DtPdmdMsg_0007[]; +extern const char DtPdmdMsg_0008[]; +extern const char DtPdmdMsg_0009[]; +extern const char DtPdmdMsg_0010[]; +extern const char DtPdmdMsg_0011[]; +extern const char DtPdmdMsg_0012[]; +extern const char DtPdmdMsg_0013[]; +extern const char DtPdmdMsg_0014[]; +extern const char DtPdmdMsg_0015[]; +extern const char DtPdmdMsg_0016[]; /* Message IDs */ -extern const char * DtPdmGetMessage( - int set, - int n, - const char * s); - -#endif /* I18N_MSG */ +const char *DtPdmdGetMessage(int set, + int n, + const char *s); #endif /* _PdmdMsgs_h */ diff --git a/cde/programs/dtprintinfo/DtPrintinfo.C b/cde/programs/dtprintinfo/DtPrintinfo.C index dbc12fb0e..8e4c92b7b 100644 --- a/cde/programs/dtprintinfo/DtPrintinfo.C +++ b/cde/programs/dtprintinfo/DtPrintinfo.C @@ -52,7 +52,7 @@ extern "C" { extern int seteuid(uid_t); } #ifdef hpux static char **msg_strings = NULL; -// Cannot use multiple catgets paramemter calls in functions because the +// Cannot use multiple catgets parameter calls in functions because the // previous catgets returned value is overwritten by later catgets calls // Example: this would fail on HP systems // sprintf(buf, "%s %s" catgets(...), catgets(...)) @@ -63,7 +63,7 @@ char *Catgets(nl_catd catd, int set_num, int msg_num, char *s) return s; if (!msg_strings[msg_num]) - msg_strings[msg_num] = strdup(catgets(catd, set_num, msg_num, s)); + msg_strings[msg_num] = strdup(CATGETS(catd, set_num, msg_num, s)); return msg_strings[msg_num]; } #endif @@ -89,9 +89,9 @@ int main(int argc, char **argv) errno = 0; #ifdef NL_CAT_LOCALE - dtprintinfo_cat = catopen("dtprintinfo", NL_CAT_LOCALE); + dtprintinfo_cat = CATOPEN("dtprintinfo", NL_CAT_LOCALE); #else - dtprintinfo_cat = catopen("dtprintinfo", 0); + dtprintinfo_cat = CATOPEN("dtprintinfo", 0); #endif if ((nl_catd) errno) diff --git a/cde/programs/dtprintinfo/dtprintinfomsg.h b/cde/programs/dtprintinfo/dtprintinfomsg.h index 9769efa32..e68daba4c 100644 --- a/cde/programs/dtprintinfo/dtprintinfomsg.h +++ b/cde/programs/dtprintinfo/dtprintinfomsg.h @@ -33,7 +33,7 @@ extern "C" { #endif -#include +#include
#include #include "dtprintinfo_msg.h" @@ -41,14 +41,8 @@ extern "C" { extern nl_catd dtprintinfo_cat; -#ifdef hpux -extern char *Catgets(nl_catd catd, int set_num, int msg_num, char *s); #define MESSAGE(msg) \ - Catgets(dtprintinfo_cat,DTPRINTER_SET,msg,TXT_DTPRINTER_SET_ ## msg) -#else -#define MESSAGE(msg) \ - catgets(dtprintinfo_cat,DTPRINTER_SET,msg,TXT_DTPRINTER_SET_ ## msg) -#endif + CATGETS(dtprintinfo_cat,DTPRINTER_SET,msg,TXT_DTPRINTER_SET_ ## msg) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ diff --git a/cde/programs/dtscreen/dtscreen.c b/cde/programs/dtscreen/dtscreen.c index a02444502..e51a053e1 100644 --- a/cde/programs/dtscreen/dtscreen.c +++ b/cde/programs/dtscreen/dtscreen.c @@ -101,10 +101,10 @@ /* include file for message texts */ #include -#include +#include
#define MF_DTSCREEN "dtscreen" -#include +#include
#include nl_catd scmc_catd; /* Cat descriptor for scmc conversion */ @@ -198,7 +198,7 @@ allocpixel(Colormap cmap, char *name, char *def) name, def); #else - fprintf(stderr, catgets(scmc_catd, 2, 35, + fprintf(stderr, CATGETS(scmc_catd, 2, 35, "couldn't allocate: %s, using %s instead\n"), name, def); #endif @@ -225,7 +225,7 @@ main(int argc, char *argv[]) /* set locale to what is defined by local environment */ setlocale(LC_ALL,""); - scmc_catd = catopen(MF_DTSCREEN, NL_CAT_LOCALE); + scmc_catd = CATOPEN(MF_DTSCREEN, NL_CAT_LOCALE); ProgramName = strrchr(argv[0], '/'); if (ProgramName) @@ -264,7 +264,7 @@ main(int argc, char *argv[]) */ if (!DtSaverGetWindows(dsp, &winprop, &nitems)) { - fprintf(stderr, catgets(scmc_catd, 2, 40, + fprintf(stderr, CATGETS(scmc_catd, 2, 40, "%s: Cannot locate window in which to draw. Using the -create\n" "option will cause %s to create its own window.\n"), ProgramName, ProgramName); diff --git a/cde/programs/dtscreen/resource.c b/cde/programs/dtscreen/resource.c index 6d16b235d..ab2758f91 100644 --- a/cde/programs/dtscreen/resource.c +++ b/cde/programs/dtscreen/resource.c @@ -61,7 +61,7 @@ /* include file for message texts */ #include -#include +#include
#define MF_DTSCREEN "dtscreen.cat" #include @@ -247,7 +247,7 @@ Syntax(char *badOption) fprintf(stderr, "%s: bad command line option: %s.\n\n", ProgramName, badOption); #else - fprintf(stderr, catgets(scmc_catd, 2, 1, + fprintf(stderr, CATGETS(scmc_catd, 2, 1, "%s: Bad command line option: %s.\n\n"), ProgramName, badOption); #endif @@ -286,7 +286,7 @@ Syntax(char *badOption) fprintf(stderr, "\nType %s -help for a full description.\n\n", ProgramName); #else - fprintf(stderr, catgets(scmc_catd, 2, 2, + fprintf(stderr, CATGETS(scmc_catd, 2, 2, "\nType %s -help for a full description.\n\n"), ProgramName); #endif @@ -303,7 +303,7 @@ Help(void) fprintf(stderr, "where options include:\n"); #else - fprintf(stderr, catgets(scmc_catd, 2, 3, + fprintf(stderr, CATGETS(scmc_catd, 2, 3, "Usage:\n %s [-options ...]\n\n\ where options include:\n"), ProgramName); #endif @@ -316,7 +316,7 @@ Help(void) fprintf(stderr, " %-28s %s\n", "-mode mode", "animation mode"); fprintf(stderr, " where mode is one of:\n"); #else - fprintf(stderr, catgets(scmc_catd, 2, 5, + fprintf(stderr, CATGETS(scmc_catd, 2, 5, " %-28s %s\n\t where mode is one of:\n"), "-mode mode", "animation mode"); #endif @@ -398,7 +398,7 @@ GetResource(XrmDatabase database, char *parentname, char *parentclass, error("%s: GetResource - couldn't allocate memory"); #else { - fprintf(stderr, catgets(scmc_catd, 2, 18, + fprintf(stderr, CATGETS(scmc_catd, 2, 18, "%s: GetResource - couldn't allocate memory.\n"),ProgramName); exit(1); } @@ -502,7 +502,7 @@ open_display(void) error("%s: Malformed -display argument, \"%s\"\n", display); #else { - fprintf(stderr, catgets(scmc_catd, 2, 19, + fprintf(stderr, CATGETS(scmc_catd, 2, 19, "%s: Malformed -display argument: %s.\n"), ProgramName,display); exit(1); } @@ -515,7 +515,7 @@ open_display(void) error("%s: unable to open display %s.\n", display); #else { - fprintf(stderr, catgets(scmc_catd, 2, 17, + fprintf(stderr, CATGETS(scmc_catd, 2, 17, "%s: Unable to open display %s.\n"),ProgramName, display); exit(1); } @@ -716,7 +716,7 @@ void CheckResources(void) #ifdef MIT_R5 fprintf(stderr, "Unknown mode: "); #else - fprintf(stderr, "%s", catgets(scmc_catd, 2, 7, + fprintf(stderr, "%s", CATGETS(scmc_catd, 2, 7, "Unknown mode: ")); #endif Syntax(mode); diff --git a/cde/programs/dtsr/Imakefile b/cde/programs/dtsr/Imakefile index e7c801b9d..b58c478bd 100644 --- a/cde/programs/dtsr/Imakefile +++ b/cde/programs/dtsr/Imakefile @@ -10,7 +10,7 @@ # INCLUDES = -I. -I$(DTSEARCHSRC) -I$(DTSEARCHSRC)/raima -DEFINES = -DMAIN_PROGRAM +DEFINES = -DMAIN_PROGRAM -DNO_XLIB #ifdef AlphaArchitecture EXTRA_DEFINES = -DBYTE_SWAP -D_XOPEN_SOURCE -D_OSF_SOURCE @@ -36,41 +36,43 @@ SYS_LIBRARIES = -lc -lm PROGRAMS = $(PROGRAM1) $(PROGRAM2) $(PROGRAM3) $(PROGRAM4) $(PROGRAM5) \ $(PROGRAM6) $(PROGRAM7) $(PROGRAM9) $(PROGRAM10) +EXTRA_OBJS = MsgCat.o + PROGRAM1 = dtsrcreate SRCS1 = dtsrcreate.c -OBJS1 = dtsrcreate.o +OBJS1 = dtsrcreate.o $(EXTRA_OBJS) PROGRAM2 = dtsrdbrec SRCS2 = dtsrdbrec.c -OBJS2 = dtsrdbrec.o +OBJS2 = dtsrdbrec.o $(EXTRA_OBJS) PROGRAM3 = dtsrhan SRCS3 = dtsrhan.c -OBJS3 = dtsrhan.o +OBJS3 = dtsrhan.o $(EXTRA_OBJS) PROGRAM4 = dtsrload SRCS4 = dtsrload.c -OBJS4 = dtsrload.o +OBJS4 = dtsrload.o $(EXTRA_OBJS) PROGRAM5 = dtsrindex SRCS5 = dtsrindex.c -OBJS5 = dtsrindex.o +OBJS5 = dtsrindex.o $(EXTRA_OBJS) PROGRAM6 = dtsrdelete SRCS6 = tomita.c -OBJS6 = tomita.o +OBJS6 = tomita.o $(EXTRA_OBJS) PROGRAM7 = dtsrclean SRCS7 = dtsrclean.c -OBJS7 = dtsrclean.o +OBJS7 = dtsrclean.o $(EXTRA_OBJS) PROGRAM9 = huffcode SRCS9 = huffcode.c -OBJS9 = huffcode.o +OBJS9 = huffcode.o $(EXTRA_OBJS) PROGRAM10 = dtsrkdump SRCS10 = dtsrkdump.c -OBJS10 = dtsrkdump.o +OBJS10 = dtsrkdump.o $(EXTRA_OBJS) ComplexProgramTarget_1($(PROGRAM1),$(LOCAL_LIBRARIES), /* */) ComplexProgramTarget_2($(PROGRAM2),$(LOCAL_LIBRARIES), /* */) @@ -81,3 +83,5 @@ ComplexProgramTarget_6($(PROGRAM6),$(LOCAL_LIBRARIES), /* */) ComplexProgramTarget_7($(PROGRAM7),$(LOCAL_LIBRARIES) $(BYTE_SWAP_LIB), /* */) ComplexProgramTarget_9($(PROGRAM9),$(LOCAL_LIBRARIES), /* */) ComplexProgramTarget_10($(PROGRAM10),$(LOCAL_LIBRARIES), /* */) + +LinkSourceFile(MsgCat.c,$(DTSVCSRC)/DtUtil2) diff --git a/cde/programs/dtsr/dtsrclean.c b/cde/programs/dtsr/dtsrclean.c index 235b9c829..392b30de4 100644 --- a/cde/programs/dtsr/dtsrclean.c +++ b/cde/programs/dtsr/dtsrclean.c @@ -196,7 +196,7 @@ static void signal_shutdown (int sig) /* Prints usage statement to stderr. */ static void print_usage (void) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 1, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 1, "\nUSAGE: %s [options] \n" " Compresses unused d99 space and validates d00-d99 links.\n" " -p Progress dots printed every records (default %lu).\n" @@ -250,12 +250,12 @@ static void print_progress (char *label) } TERMINATE_LINE (); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 2, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 2, "%s: %s Compression %d%% (about %lu KB) in %ld:%02ld min:sec.\n") , aa_argv0, label, compression, bytes_in / 1000L, seconds / 60UL, seconds % 60UL); if (*label == 'F') - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 3, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 3, "%s: Counted %ld WORDS in %s.d99.\n") , aa_argv0, (long)reccount, arg_dbname); return; @@ -275,21 +275,21 @@ static void end_of_job (int exitcode, int show_flags) { TERMINATE_LINE (); if (exitcode >= 100) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 66, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 66, "%s Aborting after interrupt signal %d.\n"), PROGNAME"66", exitcode - 100); } if (validation_mode && corruption_count == 0L) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 4, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 4, "%s: No corrupted links detected.\n") , aa_argv0); if (corruption_count > 0L) { if (max_corruption > 0L && corruption_count >= max_corruption) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 193, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 193, "%s Aborting at %ld corrupted links.\n"), PROGNAME"193", corruption_count); else - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 194, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 194, "%s Detected%s %ld corrupted/incomplete link(s).\n"), PROGNAME"194", (validation_mode) ? " and corrected" : "", @@ -301,7 +301,7 @@ static void end_of_job (int exitcode, int show_flags) if (show_flags & SHOW_USAGE) print_usage (); if (show_flags & SHOW_EXITCODE) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 5, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 5, "%s: Exit code = %d.\n") , aa_argv0, exitcode); DtSearchExit (exitcode); } /* end_of_job() */ @@ -342,7 +342,7 @@ static void user_args_processor (int argc, char **argv) goto UNKNOWN_ARG; case 'm': - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 301, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 301, "%s The -m argument is no longer necessary.\n"), PROGNAME"301"); break; @@ -356,7 +356,7 @@ static void user_args_processor (int argc, char **argv) else { INVALID_ARG: fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 177, + CATGETS(dtsearch_catd, MS_dtsrclean, 177, "%s Invalid %.2s argument.\n"), PROGNAME"177", argptr); oops = TRUE; @@ -368,7 +368,7 @@ static void user_args_processor (int argc, char **argv) if (argptr[2] != '\0') { if ((frecids = fopen (argptr + 2, "w")) == NULL) { fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 802, + CATGETS(dtsearch_catd, MS_dtsrclean, 802, "%s Unable to open '%s' to output" " unreferenced d00 records:\n %s\n"), PROGNAME"802", argptr, strerror(errno)); @@ -395,7 +395,7 @@ static void user_args_processor (int argc, char **argv) UNKNOWN_ARG: default: - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 159, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 159, "%s Unknown argument: '%s'.\n"), PROGNAME"159", argptr); oops = TRUE; @@ -409,15 +409,15 @@ static void user_args_processor (int argc, char **argv) */ if (argc != 2) { if (argc <= 0) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 210, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 210, "%s Missing required dbname argument.\n"), PROGNAME"210"); if (argc <= 1) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 211, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 211, "%s Missing required newpath argument.\n"), PROGNAME"211"); if (argc > 2) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 212, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 212, "%s Too many arguments.\n"), PROGNAME"212"); oops = TRUE; @@ -428,7 +428,7 @@ static void user_args_processor (int argc, char **argv) /* DBNAME */ arg_dbname = argv[0]; if (strlen (arg_dbname) > 8) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 229, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 229, "%s Invalid database name '%s'.\n"), PROGNAME"229", arg_dbname); end_of_job (2, SHOW_USAGE); @@ -464,7 +464,7 @@ static void validation_error (DB_ADDR dbaorig) slot = ((slot + 1) * recslots - dba_offset) | (OR_D00 << 24); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 6, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 6, " DBA = %d:%ld (x%02x:%06lx), orig addr val = x%08lx\n" " Word='%c%s' offset=%ld addrs=%ld free=%d\n") , OR_D00, slot, OR_D00, slot, dbaorig, @@ -490,14 +490,14 @@ static void open_all_files struct stat fstatbuf; if ((*fp = fopen (fname, mode)) == NULL) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 439, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 439, "%s Can't open %s: %s\n"), PROGNAME"439", fname, strerror (errno)); *oops = TRUE; return; } if (fstat (fileno (*fp), &fstatbuf) == -1) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 440, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 440, "%s Can't access status of %s: %s\n"), PROGNAME"440", fname, strerror (errno)); *oops = TRUE; @@ -505,7 +505,7 @@ static void open_all_files } if (size) if ((*size = fstatbuf.st_size) <= 0L) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 499, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 499, "%s %s is empty.\n"), PROGNAME"499", fname); *oops = TRUE; @@ -524,7 +524,7 @@ static void copy_old_d2x_to_new char readbuf[1024 + 32]; int i, j; - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 7, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 7, "%s: Copying from old d2x files to %s...\n") , aa_argv0, fname_new); for (;;) { /* loop ends when eof set on input stream */ @@ -532,14 +532,14 @@ static void copy_old_d2x_to_new i = fread (readbuf, 1, sizeof (readbuf), fp_old); /* byte swap not required on pure copy operation */ if (errno) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 517, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 517, "%s Read error on %s: %s.\n"), PROGNAME"517", fname_old, strerror (errno)); end_of_job (3, SHOW_EXITCODE); } j = fwrite (readbuf, 1, i, fp_new); if (i != j) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 489, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 489, "%s Write error on %s: %s.\n"), PROGNAME"489", fname_new, strerror (errno)); end_of_job (3, SHOW_EXITCODE); @@ -705,7 +705,7 @@ static void copy_new_d99 (long keyfield) ret = fread (word_addrs, sizeof(DB_ADDR), (size_t)num_reads, fp_d99_old); if (errno || -1 == ret) { TERMINATE_LINE (); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 657, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 657, "%s Read error on %s: %s.\n"), PROGNAME"657", fname_d99_old, strerror (errno)); end_of_job (4, SHOW_PROGRESS + SHOW_EXITCODE); @@ -779,7 +779,7 @@ static void copy_new_d99 (long keyfield) if (dbaorig == -1L) { TERMINATE_LINE (); fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 111, + CATGETS(dtsearch_catd, MS_dtsrclean, 111, "*** %s DBA in d99 = -1. " "Probable overrun into expansion\n" " area due to incorrect count values " @@ -806,7 +806,7 @@ static void copy_new_d99 (long keyfield) if (dba >= total_num_addrs) { TERMINATE_LINE (); fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 222, + CATGETS(dtsearch_catd, MS_dtsrclean, 222, "*** %s DBA in d99 not in d00," " slot > max num docs.\n"), PROGNAME"222"); @@ -833,7 +833,7 @@ static void copy_new_d99 (long keyfield) *bvptr |= (is_odd_nibble) ? 0x04 : 0x40; TERMINATE_LINE (); fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 333, + CATGETS(dtsearch_catd, MS_dtsrclean, 333, "*** %s DBA in d99 does not exist in d00.\n"), PROGNAME"333"); validation_error (dbaorig); @@ -921,7 +921,7 @@ static void copy_new_d99 (long keyfield) if (num_writes != num_reads) { WRITE_ERROR: fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 665, + CATGETS(dtsearch_catd, MS_dtsrclean, 665, "%s Write error on %s: %s.\n"), PROGNAME"665", fname_d99_new, strerror(errno)); end_of_job (4, SHOW_PROGRESS + SHOW_EXITCODE); @@ -1001,13 +1001,13 @@ int main (int argc, char *argv[]) aa_argv0 = argv[0]; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); time (&starttime); strftime (dbfpath, sizeof (dbfpath), /* just use any ol' buffer */ - catgets (dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), localtime (&starttime)); - printf ( catgets(dtsearch_catd, MS_dtsrclean, 11, + printf ( CATGETS(dtsearch_catd, MS_dtsrclean, 11, "%s Version %s. Run %s.\n") , aa_argv0, AUSAPI_VERSION, dbfpath); @@ -1037,11 +1037,11 @@ int main (int argc, char *argv[]) if ((ptr = getenv ("DBFPATH")) != NULL) { if (*ptr == 0) fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 12, + CATGETS(dtsearch_catd, MS_dtsrclean, 12, "%s: Ignoring empty DBFPATH environment variable.\n") , aa_argv0); else { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 13, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 13, "%s: Using DBFPATH = '%s'.\n") , aa_argv0, ptr); snprintf(full_dbname_old, sizeof(full_dbname_old), "%s", ptr); @@ -1068,7 +1068,7 @@ int main (int argc, char *argv[]) *ptr = '\0'; } if (strcmp (full_dbname_old, full_dbname_new) == 0) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 393, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 393, "%s Old and new directories are identical: '%s'.\n"), PROGNAME"393", full_dbname_old); end_of_job (2, SHOW_USAGE); @@ -1079,10 +1079,10 @@ int main (int argc, char *argv[]) */ strcat (full_dbname_old, arg_dbname); strcat (full_dbname_new, arg_dbname); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 14, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 14, "%s: Old files: '%s.d2x, .d99'.\n") , aa_argv0, full_dbname_old); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 15, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 15, "%s: New files: '%s.d2x, .d99'.\n") , aa_argv0, full_dbname_new); @@ -1126,16 +1126,16 @@ int main (int argc, char *argv[]) oops = TRUE; } if (oops) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 24, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 24, "%s: One or more new files already exist.\n") , aa_argv0); if (overlay_no) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 463, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 463, "%s Command line argument disallows file overlay.\n"), PROGNAME"463"); end_of_job (2, SHOW_EXITCODE); } - fputs (catgets(dtsearch_catd, MS_dtsrclean, 45, + fputs (CATGETS(dtsearch_catd, MS_dtsrclean, 45, " Is it ok to overlay files in new directory? [y/n] "), aa_stderr); @@ -1203,7 +1203,7 @@ int main (int argc, char *argv[]) * all holes were filled with good records. */ total_num_addrs = (dbrec.or_maxdba - (dba & 0xffffff) + 1) / recslots + 1; - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 25, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 25, "%s: curr reccnt=%ld, mxdba=%ld, sl/rec=%ld, tot#adr=%ld.\n") , aa_argv0, (long)dbrec.or_reccount, (long)dbrec.or_maxdba, (long)dbrec.or_recslots, (long)total_num_addrs); @@ -1216,7 +1216,7 @@ int main (int argc, char *argv[]) */ max_bitvec = (total_num_addrs >> 1) + 2; if ((bit_vector = malloc ((size_t)max_bitvec + 64)) == NULL) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 465, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 465, "%s WARNING: Can't allocate memory for bit vector.\n" " 'Validate' mode switched off.\n"), PROGNAME"465"); @@ -1233,7 +1233,7 @@ int main (int argc, char *argv[]) * records. */ x = dbrec.or_reccount / 50 + 1; /* x = recs per dot */ - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 26, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 26, "%s: Reading d00 file. Each dot appx %ld database documents...\n"), aa_argv0, (long)x); reccount = 0; @@ -1260,7 +1260,7 @@ int main (int argc, char *argv[]) dba1 = (dba + dba_offset) / recslots; /* ="rec number", base 1 */ if (dba1 >= total_num_addrs) { TERMINATE_LINE (); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 561, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 561, "%s DBA '%d:%ld' (rec #%ld) in d00 exceeds " "total num addrs %ld;\n" " Bit vector overflow because maxdba %ld" @@ -1286,12 +1286,12 @@ int main (int argc, char *argv[]) /* confirm that RECCOUNT record holds the correct number */ if (dbrec.or_reccount == reccount) { fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 27, + CATGETS(dtsearch_catd, MS_dtsrclean, 27, "%s: Confirmed %ld DOCUMENTS in %s.d00.\n") , aa_argv0, (long)dbrec.or_reccount, arg_dbname); } else { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 28, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 28, "%s: %ld DOCUMENTS actually in %s.d00 not =" " %ld count stored there.\n" " Count will be corrected in new d00 file.\n") , @@ -1310,7 +1310,7 @@ EXIT_INIT_VALIDATION:; dot_count = DOTS_PER_MSG; /* force initial msg after first * blk of recs */ TERMINATE_LINE (); - fprintf (aa_stderr, catgets(dtsearch_catd, MS_dtsrclean, 29, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_dtsrclean, 29, "%s: Compressing into %s. Each dot appx %lu words...\n") , aa_argv0, arg_newpath, (unsigned long)recs_per_dot); @@ -1362,7 +1362,7 @@ EXIT_INIT_VALIDATION:; CRSET (PROGNAME "734", &dba, 0); CRREAD (PROGNAME "735", OR_OBJKEY, readbuf, 0); fprintf (aa_stderr, - catgets(dtsearch_catd, MS_dtsrclean, 444, + CATGETS(dtsearch_catd, MS_dtsrclean, 444, "*** %s d00 record '%s' is not referenced in d99.\n" " DBA = %d:%ld (x%02x:%06lx).\n") , PROGNAME"444", readbuf, OR_D00, diff --git a/cde/programs/dtsr/dtsrcreate.c b/cde/programs/dtsr/dtsrcreate.c index 18ca62a28..728dbe57a 100644 --- a/cde/programs/dtsr/dtsrcreate.c +++ b/cde/programs/dtsr/dtsrcreate.c @@ -169,7 +169,7 @@ static void confirm_ok_to_overwrite (char *fname) return; fclose (fptr); - printf ( catgets(dtsearch_catd, MS_initausd, 12, + printf ( CATGETS(dtsearch_catd, MS_initausd, 12, "\nFile '%s' already exists.\n" "Is it ok to overwrite it and other database files? [y,n] ") , newpath); @@ -198,7 +198,7 @@ static int change_max_wordsize (char *new_size) /* error if min and max specifications incompatible */ if (minwordsz > maxwordsz) { - printf (catgets (dtsearch_catd, MS_initausd, 5, + printf (CATGETS(dtsearch_catd, MS_initausd, 5, PROGNAME" Minimum word size %d greater " "than maximum word size %d.\n"), minwordsz, maxwordsz); @@ -218,13 +218,13 @@ static int change_max_wordsize (char *new_size) } if (maxwordsz != users_newsize) - printf (catgets (dtsearch_catd, MS_initausd, 8, + printf (CATGETS(dtsearch_catd, MS_initausd, 8, PROGNAME " Adjusted maximum word size to %d.\n"), maxwordsz); /* Give user a final warning about large word sizes */ if (maxwordsz > STANDARD_MAXWORD && language != DtSrLaDEU && !quiet_mode) - printf ("%s", catgets (dtsearch_catd, MS_initausd, 10, + printf ("%s", CATGETS(dtsearch_catd, MS_initausd, 10, PROGNAME" Specifying large maximum word sizes may " "significantly\n increase storage requirements.\n")); return TRUE; @@ -247,7 +247,7 @@ static int change_min_wordsize (char *new_size) /* error if min and max specifications incompatible */ if (minwordsz > maxwordsz) { - printf (catgets (dtsearch_catd, MS_initausd, 5, + printf (CATGETS(dtsearch_catd, MS_initausd, 5, PROGNAME " Minimum word size %d greater than " "maximum word size %d.\n"), minwordsz, maxwordsz); @@ -256,13 +256,13 @@ static int change_min_wordsize (char *new_size) if (!quiet_mode) { if (minwordsz != old_minwordsz) - printf (catgets (dtsearch_catd, MS_initausd, 6, + printf (CATGETS(dtsearch_catd, MS_initausd, 6, PROGNAME " Adjusted minimum word size to %d.\n"), minwordsz); /* give user a warning about short word sizes */ if (minwordsz < DEFAULT_MINWORD) - printf ("%s", catgets (dtsearch_catd, MS_initausd, 9, + printf ("%s", CATGETS(dtsearch_catd, MS_initausd, 9, PROGNAME " Specifying small minimum word sizes" " may require extensive\n" " editing of stopword file to prevent significantly\n" @@ -281,7 +281,7 @@ static void print_usage (void) { int i; - printf (catgets (dtsearch_catd, MS_initausd, + printf (CATGETS(dtsearch_catd, MS_initausd, 3, "\nUSAGE: %s [-options] dbname\n" " Creates and initializes DtSearch/AusText database files.\n" @@ -355,7 +355,7 @@ static void user_args_processor (int argc, char **argv) else { BAD_ARG: print_usage(); - printf (catgets (dtsearch_catd, MS_misc, 9, + printf (CATGETS(dtsearch_catd, MS_misc, 9, "%sInvalid command line argument '%s'.\a\n"), "\n"PROGNAME" ", ptr); DtSearchExit (2); @@ -418,7 +418,7 @@ BAD_ARG: if (language < 0) goto BAD_ARG; if (!quiet_mode && language > DtSrLaLAST) - printf ( catgets(dtsearch_catd, MS_initausd, 13, + printf ( CATGETS(dtsearch_catd, MS_initausd, 13, "%s Warning! you have specified " "an unsupported, custom language.\n" " You will have to provide your own " @@ -429,7 +429,7 @@ BAD_ARG: break; default: - printf (catgets (dtsearch_catd, MS_misc, 10, + printf (CATGETS(dtsearch_catd, MS_misc, 10, "%sIgnored unknown command line argument '%s'.\n"), PROGNAME " ", ptr); break; @@ -443,7 +443,7 @@ BAD_ARG: */ if (argc <= 0) { print_usage(); - printf (catgets (dtsearch_catd, MS_misc, 18, + printf (CATGETS(dtsearch_catd, MS_misc, 18, "%sDatabase name not specified.\n\a"), "\n"PROGNAME" "); DtSearchExit(2); } @@ -468,7 +468,7 @@ BAD_ARG: if (i < 1 || i > 8) { BAD_DBNAME: print_usage(); - printf (catgets (dtsearch_catd, MS_misc, 11, + printf (CATGETS(dtsearch_catd, MS_misc, 11, "%sInvalid database name '%s'.\a\n"), "\n"PROGNAME"346 ", ptr); DtSearchExit(2); @@ -482,7 +482,7 @@ BAD_DBNAME: /* Ensure semantic processing specified only for english language */ if (fzkeysz != 0 && language != DtSrLaENG && language != DtSrLaENG2) { print_usage(); - printf ( catgets(dtsearch_catd, MS_initausd, 14, + printf ( CATGETS(dtsearch_catd, MS_initausd, 14, "\n%s semantic processing is only available " "for English language databases.\n\a") , PROGNAME"340"); @@ -525,7 +525,7 @@ static void remove_d9x_file (char *extension) if (remove (newpath) != 0) { /* 'file not found' is not an error */ if (errno != ENOENT) { - printf (catgets (dtsearch_catd, MS_initausd, 244, + printf (CATGETS(dtsearch_catd, MS_initausd, 244, PROGNAME "244 Unable to remove '%s': %s\n"), newpath, strerror (errno)); DtSearchExit (5); @@ -562,14 +562,14 @@ static void create_new_dbd (FILE *f) confirm_ok_to_overwrite (newpath); if (chmod (newpath, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)) { if (errno != ENOENT) { - printf (catgets (dtsearch_catd, MS_initausd, 214, nocopy_msg), + printf (CATGETS(dtsearch_catd, MS_initausd, 214, nocopy_msg), PROGNAME"515", modelpath, newpath, strerror(errno)); DtSearchExit (15); } } if ((g = fopen (newpath, "w+b")) == NULL) { - printf (catgets (dtsearch_catd, MS_initausd, 214, nocopy_msg), + printf (CATGETS(dtsearch_catd, MS_initausd, 214, nocopy_msg), PROGNAME"509", modelpath, newpath, strerror(errno)); DtSearchExit (4); } @@ -577,7 +577,7 @@ static void create_new_dbd (FILE *f) while ((i = fgetc (f)) != EOF) fputc (i, g); if (errno) { - printf (catgets (dtsearch_catd, MS_initausd, 214, nocopy_msg), + printf (CATGETS(dtsearch_catd, MS_initausd, 214, nocopy_msg), PROGNAME"531", modelpath, newpath, strerror(errno)); DtSearchExit (13); } @@ -622,14 +622,14 @@ int main (int argc, char *argv[]) struct or_lwordrec lwordrec; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); aa_argv0 = argv[0]; max_ormisc_size = sizeof (miscrec.or_misc); maxwidth_sword = sizeof (swordrec.or_swordkey) - 1; maxwidth_lword = sizeof (lwordrec.or_lwordkey) - 1; - printf (catgets (dtsearch_catd, MS_misc, 4, + printf (CATGETS(dtsearch_catd, MS_misc, 4, "%s Version %s.\n"), aa_argv0, DtSrVERSION @@ -655,7 +655,7 @@ int main (int argc, char *argv[]) } else { print_usage(); - printf (catgets (dtsearch_catd, MS_initausd, 213, + printf (CATGETS(dtsearch_catd, MS_initausd, 213, default_unable_to_open_msg), "\n"PROGNAME"302", modelpath, strerror(errno)); DtSearchExit (4); @@ -676,7 +676,7 @@ int main (int argc, char *argv[]) } else if (errno != ENOENT) { print_usage(); - printf (catgets (dtsearch_catd, MS_initausd, 213, + printf (CATGETS(dtsearch_catd, MS_initausd, 213, default_unable_to_open_msg), "\n"PROGNAME"655", FNAME_MODEL, strerror(errno)); DtSearchExit (4); @@ -700,7 +700,7 @@ int main (int argc, char *argv[]) if (debug_mode) puts (PROGNAME"682 Never found it!"); print_usage(); - printf (catgets (dtsearch_catd, MS_initausd, 213, + printf (CATGETS(dtsearch_catd, MS_initausd, 213, default_unable_to_open_msg), "\n"PROGNAME"686", FNAME_MODEL, "Not found in either current or target directories. Use -d option\a"); @@ -715,7 +715,7 @@ DBD_OKAY: printf ("040*** d_open newpath = '%s'.\n", newpath); d_open (newpath, "o"); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_initausd, 230, + printf (CATGETS(dtsearch_catd, MS_initausd, 230, PROGNAME "230 Could not open database '%s'.\n"), newpath); puts (vista_msg (PROGNAME "231")); DtSearchExit (3); @@ -727,7 +727,7 @@ DBD_OKAY: printf ("042*** d_initialize.\n"); d_initialize (0); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_initausd, 239, + printf (CATGETS(dtsearch_catd, MS_initausd, 239, PROGNAME "239 Could not initialize database '%s'.\n"), newpath); puts (vista_msg (PROGNAME "240")); DtSearchExit (3); @@ -763,7 +763,7 @@ DBD_OKAY: if (i < 0) { /* Add in difference to INCREASE abstrsz */ dbrec.or_abstrsz -= i; - printf (catgets (dtsearch_catd, MS_misc, 433, + printf (CATGETS(dtsearch_catd, MS_misc, 433, "%1$sAdjusted maximum abstract size upward to %2$hd.\n"), PROGNAME "433 ", dbrec.or_abstrsz); } @@ -800,7 +800,7 @@ DBD_OKAY: printf ("060*** fillnew dbrec.\n"); d_fillnew (OR_DBREC, &dbrec, 0); if (db_status != S_OKAY) { - printf ("%s", catgets (dtsearch_catd, MS_initausd, 509, + printf ("%s", CATGETS(dtsearch_catd, MS_initausd, 509, PROGNAME "509 Could not initialize database header record.\n")); puts (vista_msg (PROGNAME "510")); DtSearchExit (3); @@ -816,7 +816,7 @@ DBD_OKAY: remove_d9x_file (".d99"); *newextp = 0; /* no extension suffixes for next msgs */ - printf (catgets (dtsearch_catd, MS_initausd, 24, + printf (CATGETS(dtsearch_catd, MS_initausd, 24, PROGNAME " Successfully initialized database '%s'.\n"), newpath); return 0; diff --git a/cde/programs/dtsr/dtsrdbrec.c b/cde/programs/dtsr/dtsrdbrec.c index 72ed69bd1..eec79c8f7 100644 --- a/cde/programs/dtsr/dtsrdbrec.c +++ b/cde/programs/dtsr/dtsrdbrec.c @@ -101,25 +101,25 @@ void print_dbrec (char *dbname, struct or_dbrec * dbrec) char *cptr; int blobs_are_possible = FALSE; - printf (catgets (dtsearch_catd, MS_dbrec, 1, + printf (CATGETS(dtsearch_catd, MS_dbrec, 1, "---------- System Values for Database '%s' ----------\n"), dbname); - printf (catgets (dtsearch_catd, MS_dbrec, 2, + printf (CATGETS(dtsearch_catd, MS_dbrec, 2, "Schema version number (version) is '%s'.\n"), dbrec->or_version); - printf (catgets (dtsearch_catd, MS_dbrec, 3, + printf (CATGETS(dtsearch_catd, MS_dbrec, 3, "Maximum object key size (sizeof(objkey)) is %ld bytes.\n"), DtSrMAX_DB_KEYSIZE); if (ORD_USEHUGEKEYS & dbrec->or_dbflags) - printf ("%s", catgets (dtsearch_catd, MS_dbrec, 4, + printf ("%s", CATGETS(dtsearch_catd, MS_dbrec, 4, "Optional 'Huge' keys enabled.\n")); - printf (catgets (dtsearch_catd, MS_dbrec, 12, + printf (CATGETS(dtsearch_catd, MS_dbrec, 12, "Maximum length of an abstract string (abstrsz) is %d.\n"), dbrec->or_abstrsz); if (dbrec->or_abstrsz == 0) - puts (catgets (dtsearch_catd, MS_dbrec, 14, + puts (CATGETS(dtsearch_catd, MS_dbrec, 14, " (Abstracts are not used in this database).")); else { /* @@ -127,88 +127,88 @@ void print_dbrec (char *dbname, struct or_dbrec * dbrec) * actually are */ if (dbrec->or_hufid != 0L) - printf (catgets (dtsearch_catd, MS_dbrec, 20, + printf (CATGETS(dtsearch_catd, MS_dbrec, 20, "Abstracts are %scompressed.\n"), (ORC_COMPABSTR & dbrec->or_compflags) ? "" : "not "); } - printf (catgets (dtsearch_catd, MS_dbrec, 22, + printf (CATGETS(dtsearch_catd, MS_dbrec, 22, "Parsing language is number %d, %s.\n"), dbrec->or_language, language_name(dbrec->or_language)); - printf (catgets (dtsearch_catd, MS_dbrec, 24, + printf (CATGETS(dtsearch_catd, MS_dbrec, 24, "Minimum word length (minwordsz) is %d.\n"), dbrec->or_minwordsz); - printf (catgets (dtsearch_catd, MS_dbrec, 26, + printf (CATGETS(dtsearch_catd, MS_dbrec, 26, "Maximum word length (maxwordsz) is %d.\n"), dbrec->or_maxwordsz); - printf (catgets (dtsearch_catd, MS_dbrec, 30, + printf (CATGETS(dtsearch_catd, MS_dbrec, 30, "Number of .d00 slots per object (recslots) is %d.\n"), dbrec->or_recslots); - printf (catgets (dtsearch_catd, MS_dbrec, 36, + printf (CATGETS(dtsearch_catd, MS_dbrec, 36, " (Maximum number of database objects is %ld).\n"), 0xffffffL / (long) dbrec->or_recslots); - printf (catgets (dtsearch_catd, MS_dbrec, 40, + printf (CATGETS(dtsearch_catd, MS_dbrec, 40, "Huffman compression table id (hufid) is %ld.\n"), dbrec->or_hufid); if (dbrec->or_hufid == 0L) - puts (catgets (dtsearch_catd, MS_dbrec, 42, + puts (CATGETS(dtsearch_catd, MS_dbrec, 42, " (Compression is disabled in this database).")); if (dbrec->or_hufid == -1L) - puts (catgets (dtsearch_catd, MS_dbrec, 44, + puts (CATGETS(dtsearch_catd, MS_dbrec, 44, " (Specific compression table is not yet determined).")); blobs_are_possible = FALSE; switch (dbrec->or_dbaccess) { case ORA_VARIES: - puts (catgets (dtsearch_catd, MS_dbrec, 50, + puts (CATGETS(dtsearch_catd, MS_dbrec, 50, "Engine accessibility to data may vary from object to object.")); blobs_are_possible = TRUE; break; case ORA_NOTAVAIL: - puts (catgets (dtsearch_catd, MS_dbrec, 54, + puts (CATGETS(dtsearch_catd, MS_dbrec, 54, "Data objects are not directly accessible from the engine.")); break; case ORA_BLOB: - puts (catgets (dtsearch_catd, MS_dbrec, 56, + puts (CATGETS(dtsearch_catd, MS_dbrec, 56, "Data objects are stored internally as blobs.")); blobs_are_possible = TRUE; break; case ORA_REFBLOB: - puts (catgets (dtsearch_catd, MS_dbrec, 60, + puts (CATGETS(dtsearch_catd, MS_dbrec, 60, "Only server file references to objects are stored in the blobs.")); break; case ORA_CREFBLOB: - puts (catgets (dtsearch_catd, MS_dbrec, 64, + puts (CATGETS(dtsearch_catd, MS_dbrec, 64, "Only client file references to objects are stored in the blobs.")); break; case ORA_REFKEY: - puts (catgets (dtsearch_catd, MS_dbrec, 68, + puts (CATGETS(dtsearch_catd, MS_dbrec, 68, "Object keys are server file references to the objects.")); break; case ORA_CREFKEY: - puts (catgets (dtsearch_catd, MS_dbrec, 72, + puts (CATGETS(dtsearch_catd, MS_dbrec, 72, "Object keys are client file references to the objects.")); break; case ORA_REFHUGEKEY: - puts (catgets (dtsearch_catd, MS_dbrec, 74, + puts (CATGETS(dtsearch_catd, MS_dbrec, 74, "Server file references to objects are " "stored in the 'huge' keys.")); break; case ORA_REFABSTR: - puts (catgets (dtsearch_catd, MS_dbrec, 80, + puts (CATGETS(dtsearch_catd, MS_dbrec, 80, "Server file references to objects are stored in the abstracts.")); break; case ORA_CREFABSTR: - puts (catgets (dtsearch_catd, MS_dbrec, 86, + puts (CATGETS(dtsearch_catd, MS_dbrec, 86, "Client file references to objects are stored in the abstracts.")); break; default: - printf (catgets (dtsearch_catd, MS_dbrec, 90, + printf (CATGETS(dtsearch_catd, MS_dbrec, 90, "Error: meaning of or_dbaccess value (%hd) is unknown.\n"), dbrec->or_dbaccess); blobs_are_possible = TRUE; @@ -221,59 +221,59 @@ void print_dbrec (char *dbname, struct or_dbrec * dbrec) * actually are */ if (dbrec->or_hufid != 0L) - printf (catgets (dtsearch_catd, MS_dbrec, 100, + printf (CATGETS(dtsearch_catd, MS_dbrec, 100, "Repository blobs are %scompressed.\n"), (ORC_COMPBLOB & dbrec->or_compflags) ? "" : "not "); } else - puts (catgets (dtsearch_catd, MS_dbrec, 110, + puts (CATGETS(dtsearch_catd, MS_dbrec, 110, "Repository blobs are not used in this database.")); - printf (catgets (dtsearch_catd, MS_dbrec, 120, + printf (CATGETS(dtsearch_catd, MS_dbrec, 120, "Database switches (dbflags) are 0x%lx:\n"), dbrec->or_dbflags); - printf (catgets (dtsearch_catd, MS_dbrec, 130, + printf (CATGETS(dtsearch_catd, MS_dbrec, 130, " Inverted index %s words exactly as parsed.\n"), (ORD_XWORDS & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 124, "INCLUDES") : - catgets (dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); + CATGETS(dtsearch_catd, MS_dbrec, 124, "INCLUDES") : + CATGETS(dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); - printf (catgets (dtsearch_catd, MS_dbrec, 140, + printf (CATGETS(dtsearch_catd, MS_dbrec, 140, " Inverted index %s word stems.\n"), (ORD_XSTEMS & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 124, "INCLUDES") : - catgets (dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); + CATGETS(dtsearch_catd, MS_dbrec, 124, "INCLUDES") : + CATGETS(dtsearch_catd, MS_dbrec, 125, "EXCLUDES")); - printf (catgets (dtsearch_catd, MS_dbrec, 160, + printf (CATGETS(dtsearch_catd, MS_dbrec, 160, " Use of optional 'huge' keys is %s.\n"), (ORD_USEHUGEKEYS & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 126, "ENABLED") : - catgets (dtsearch_catd, MS_dbrec, 127, "DISABLED")); + CATGETS(dtsearch_catd, MS_dbrec, 126, "ENABLED") : + CATGETS(dtsearch_catd, MS_dbrec, 127, "DISABLED")); - printf (catgets (dtsearch_catd, MS_dbrec, 162, + printf (CATGETS(dtsearch_catd, MS_dbrec, 162, " Mark-for-deletion is %s.\n"), (ORD_NOMARKDEL & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 127, "DISABLED") : - catgets (dtsearch_catd, MS_dbrec, 126, "ENABLED")); + CATGETS(dtsearch_catd, MS_dbrec, 127, "DISABLED") : + CATGETS(dtsearch_catd, MS_dbrec, 126, "ENABLED")); - printf (catgets (dtsearch_catd, MS_dbrec, 164, + printf (CATGETS(dtsearch_catd, MS_dbrec, 164, " Appendable user notes are %s.\n"), (ORD_NONOTES & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 127, "DISABLED") : - catgets (dtsearch_catd, MS_dbrec, 126, "ENABLED")); + CATGETS(dtsearch_catd, MS_dbrec, 127, "DISABLED") : + CATGETS(dtsearch_catd, MS_dbrec, 126, "ENABLED")); - printf (catgets (dtsearch_catd, MS_dbrec, 170, + printf (CATGETS(dtsearch_catd, MS_dbrec, 170, " Text characters are %s wide.\n"), (ORD_WIDECHAR & dbrec->or_dbflags) ? - catgets (dtsearch_catd, MS_dbrec, 172, "MULTIPLE bytes") : - catgets (dtsearch_catd, MS_dbrec, 174, "a SINGLE byte")); + CATGETS(dtsearch_catd, MS_dbrec, 172, "MULTIPLE bytes") : + CATGETS(dtsearch_catd, MS_dbrec, 174, "a SINGLE byte")); - printf (catgets (dtsearch_catd, MS_dbrec, 200, + printf (CATGETS(dtsearch_catd, MS_dbrec, 200, "Current number of database objects (reccount) is %ld.\n"), dbrec->or_reccount); - printf (catgets (dtsearch_catd, MS_dbrec, 210, + printf (CATGETS(dtsearch_catd, MS_dbrec, 210, "Last currently used slot number (maxdba) is %ld.\n"), dbrec->or_maxdba); @@ -301,21 +301,21 @@ int main (int argc, char *argv[]) aa_argv0 = argv[0]; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); - austools_catd = catopen (FNAME_AUSCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); + austools_catd = CATOPEN(FNAME_AUSCAT, 0); time (&now); strftime (renamebuf, sizeof (renamebuf), - catgets (dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), localtime (&now)); - printf (catgets (dtsearch_catd, MS_misc, 23, + printf (CATGETS(dtsearch_catd, MS_misc, 23, "%s: Version %s. Run %s.\n"), aa_argv0, DtSrVERSION, renamebuf); if (argc < 2) { - printf (catgets (dtsearch_catd, MS_dbrec, 310, + printf (CATGETS(dtsearch_catd, MS_dbrec, 310, "USAGE: %s \n"), aa_argv0); return 2; } @@ -323,21 +323,21 @@ int main (int argc, char *argv[]) db_oflag = O_RDONLY; /* db files may be read-only */ d_open (argv[1], "o"); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_dbrec, 330, + printf (CATGETS(dtsearch_catd, MS_dbrec, 330, "Could not open '%s' database.\n%s\n"), argv[1], vista_msg(PROGNAME"293")); return 3; } d_recfrst (OR_DBREC, 0); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_dbrec, 340, + printf (CATGETS(dtsearch_catd, MS_dbrec, 340, "No dbrec record in database '%s'.\n"), argv[1]); return 4; } d_recread (&dbrec, 0); if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_dbrec, 350, + printf (CATGETS(dtsearch_catd, MS_dbrec, 350, "Can't read dbrec record in database '%s'.\n%s\n"), argv[1], vista_msg(PROGNAME"306")); return 5; diff --git a/cde/programs/dtsr/dtsrhan.c b/cde/programs/dtsr/dtsrhan.c index 61fb4ddec..a0b6ad7ce 100644 --- a/cde/programs/dtsr/dtsrhan.c +++ b/cde/programs/dtsr/dtsrhan.c @@ -337,10 +337,10 @@ void open_outfile (void) if (!outmode_specified) if ((temp = fopen (outfile, "r")) != NULL) { fclose (temp); - printf ( catgets(dtsearch_catd, MS_chandel, 3, + printf ( CATGETS(dtsearch_catd, MS_chandel, 3, "Output file '%s' already exists.\n") , outfile); - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 4, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 4, "Append, overwrite, or quit? [a,o,q] ") ); i = tolower (getchar ()); @@ -355,7 +355,7 @@ void open_outfile (void) outstream = stdout; else { if ((outstream = fopen (outfile, outmode)) == NULL) { - printf ( catgets(dtsearch_catd, MS_chandel, 7, + printf ( CATGETS(dtsearch_catd, MS_chandel, 7, "Unable to open output file '%s'.\n") , outfile); exit (FILE_ERROR); } @@ -572,7 +572,7 @@ void process_profile (void) /*-- open file --*/ if ((prof = fopen (profile, "r")) == NULL) { - printf ( catgets(dtsearch_catd, MS_chandel, 11, + printf ( CATGETS(dtsearch_catd, MS_chandel, 11, "\nError - unable to open profile file '%s'.\n") , profile); exit (FILE_ERROR); } @@ -627,7 +627,7 @@ void process_profile (void) if (validate_id (tok)) strcpy (line_current->name, tok); else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -636,7 +636,7 @@ void process_profile (void) /*-- get first value token --*/ tok = my_strtok ('\0', del_string); if (!tok) { - printf ( catgets(dtsearch_catd, MS_chandel, 13, + printf ( CATGETS(dtsearch_catd, MS_chandel, 13, "Error line %d - identifier '%s' missing value(s).\n") , line_num, line_current->name); bad_profile = TRUE; @@ -647,7 +647,7 @@ void process_profile (void) else line_current->comp->column_number = atoi (tok); if (line_current->comp->column_number == 0) { - printf ( catgets(dtsearch_catd, MS_chandel, 14, + printf ( CATGETS(dtsearch_catd, MS_chandel, 14, "Error line %d - zero or bad value for '%s'.\n" " offensive token: %s.\n") , line_num, line_current->name, tok); @@ -658,7 +658,7 @@ void process_profile (void) tok = my_strtok ('\0', "\""); if (!tok) { if (line_current->comp->column_number == ANY) { - printf ( catgets(dtsearch_catd, MS_chandel, 15, + printf ( CATGETS(dtsearch_catd, MS_chandel, 15, "Error line %d - for identifier '%s', column has " "been set to ANY\n but there is no " "identifying signature string.\n") , @@ -694,7 +694,7 @@ void process_profile (void) else line_current->comp->column_number = atoi (tok); if (line_current->comp->column_number == 0) { - printf ( catgets(dtsearch_catd, MS_chandel, 16, + printf ( CATGETS(dtsearch_catd, MS_chandel, 16, "Error line %d - zero or bad value for " "identifier '%s'\n offensive token: %s.\n") , line_num, line_current->name, tok); @@ -705,13 +705,13 @@ void process_profile (void) tok = my_strtok ('\0', "\""); if (!tok) { if (line_current->comp->column_number == ANY) - printf ( catgets(dtsearch_catd, MS_chandel, 15, + printf ( CATGETS(dtsearch_catd, MS_chandel, 15, "Error line %d - for identifier '%s', column has " "been set to ANY\n but there is no " "identifying signature string.\n") , line_num, line_current->name); else - printf ( catgets(dtsearch_catd, MS_chandel, 18, + printf ( CATGETS(dtsearch_catd, MS_chandel, 18, "Error line %d - missing value for " "identifier '%s'\n") , line_num, line_current->name); @@ -753,7 +753,7 @@ void process_profile (void) field_current->is_month = TRUE; } else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -763,7 +763,7 @@ void process_profile (void) /*-- get constant value --*/ tok = my_strtok (NULL, "\""); if (!tok) { - printf ( catgets(dtsearch_catd, MS_chandel, 93, + printf ( CATGETS(dtsearch_catd, MS_chandel, 93, "Error line %d - '%s' string not " "enclosed in double quotes.\n"), line_num, field_current->name); @@ -777,7 +777,7 @@ void process_profile (void) /*-- get line id --*/ tok = my_strtok ('\0', del_string); if (!tok) { - printf ( catgets(dtsearch_catd, MS_chandel, 13, + printf ( CATGETS(dtsearch_catd, MS_chandel, 13, "Error line %d - identifier '%s' missing value(s).\n") , line_num, line_current->name); bad_profile = TRUE; @@ -788,7 +788,7 @@ void process_profile (void) /*-- get "string" --*/ tok = my_strtok ('\0', "\""); if (!tok) { - printf ( catgets(dtsearch_catd, MS_chandel, 93, + printf ( CATGETS(dtsearch_catd, MS_chandel, 93, "Error line %d - '%s' string not " "enclosed in double quotes.\n"), line_num, field_current->name); @@ -801,7 +801,7 @@ void process_profile (void) /*-- get offset --*/ tok = my_strtok ('\0', del_string); if (!tok) { - printf ( catgets(dtsearch_catd, MS_chandel, 13, + printf ( CATGETS(dtsearch_catd, MS_chandel, 13, "Error line %d - identifier '%s' missing value(s).\n") , line_num, line_current->name); bad_profile = TRUE; @@ -813,7 +813,7 @@ void process_profile (void) tok = my_strtok ('\0', del_string); /*******if (!tok && field_current->length == ANY) ************/ if (!tok) { - printf ( catgets(dtsearch_catd, MS_chandel, 13, + printf ( CATGETS(dtsearch_catd, MS_chandel, 13, "Error line %d - identifier '%s' missing value(s).\n") , line_num, line_current->name); bad_profile = TRUE; @@ -831,14 +831,14 @@ void process_profile (void) case DELIMITER: /*-- get next token - should be name of line --*/ if (warnings &&(bot_defined || top_defined)) - printf ( catgets(dtsearch_catd, MS_chandel, 23, + printf ( CATGETS(dtsearch_catd, MS_chandel, 23, "Warning line %d: Delimiter redefined.\n") , line_num); tok = my_strtok ('\0', del_string); if (validate_id (tok)) strcpy (top_rec_name, tok); else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n"), line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -857,7 +857,7 @@ void process_profile (void) bot_defined = TRUE; } else { BAD_DELIM_VAL: - printf ( catgets(dtsearch_catd, MS_chandel, 25, + printf ( CATGETS(dtsearch_catd, MS_chandel, 25, "Error line %d: delimiter not specified as " "'top' or 'bottom'.\n") , line_num); @@ -883,7 +883,7 @@ BAD_DELIM_VAL: } /* if it was a valid token */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 26, + printf ( CATGETS(dtsearch_catd, MS_chandel, 26, "Error line %d: invalid token '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -911,7 +911,7 @@ BAD_DELIM_VAL: } /* if it was a valid token */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 27, + printf ( CATGETS(dtsearch_catd, MS_chandel, 27, "Error line %d: invalid token '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -950,7 +950,7 @@ BAD_DELIM_VAL: } /* if in else */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, tok); bad_profile = TRUE; @@ -959,7 +959,7 @@ BAD_DELIM_VAL: } /* if validate... */ else { - printf (catgets(dtsearch_catd, MS_chandel, 12, + printf (CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -998,7 +998,7 @@ BAD_DELIM_VAL: } /* if in else */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, tok); bad_profile = TRUE; @@ -1007,7 +1007,7 @@ BAD_DELIM_VAL: } /* if validate... */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1046,7 +1046,7 @@ BAD_DELIM_VAL: } /* if in else */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, tok); bad_profile = TRUE; @@ -1055,7 +1055,7 @@ BAD_DELIM_VAL: } /* if validate... */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1094,7 +1094,7 @@ BAD_DELIM_VAL: } /* if in else */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, tok); bad_profile = TRUE; @@ -1103,7 +1103,7 @@ BAD_DELIM_VAL: } /* if validate... */ else { - printf ( catgets(dtsearch_catd, MS_chandel, 12, + printf ( CATGETS(dtsearch_catd, MS_chandel, 12, "Error line %d: invalid identifier '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1116,13 +1116,13 @@ BAD_DELIM_VAL: goto BAD_IMAGE; for (i = 0; i < strlen (tok); i++) tok[i] = tolower (tok[i]); - if (strcmp (tok, catgets (dtsearch_catd, MS_chandel, 34,"all")) == 0) + if (strcmp (tok, CATGETS(dtsearch_catd, MS_chandel, 34,"all")) == 0) imagemode = INCLUDE; - else if (strcmp (tok, catgets (dtsearch_catd, MS_chandel, 35, "none")) == 0) + else if (strcmp (tok, CATGETS(dtsearch_catd, MS_chandel, 35, "none")) == 0) imagemode = EXCLUDE; else { BAD_IMAGE: - printf ( catgets(dtsearch_catd, MS_chandel, 36, + printf ( CATGETS(dtsearch_catd, MS_chandel, 36, "Error line %d: image mode must be 'all' or " "'none' -'%s' not recognized.\n") , NULLORSTR(tok)); @@ -1143,7 +1143,7 @@ BAD_IMAGE: textmode = EXCLUDE; else { BAD_TEXT: - printf ( catgets(dtsearch_catd, MS_chandel, 37, + printf ( CATGETS(dtsearch_catd, MS_chandel, 37, "Error line %d: text mode must be 'all' or " "'none' - '%s' not recognized.\n") , NULLORSTR(tok)); bad_profile = TRUE; @@ -1154,14 +1154,14 @@ BAD_TEXT: case KEYCHAR: /*-- get next token - should be character for key type --*/ if (warnings && key_defined) - printf ( catgets(dtsearch_catd, MS_chandel, 38, + printf ( CATGETS(dtsearch_catd, MS_chandel, 38, "Warning line %d: Key character redefined.\n") , line_num); tok = my_strtok ('\0', del_string); if (validate_id (tok)) key_char = tok[0]; else { - printf ( catgets(dtsearch_catd, MS_chandel, 39, + printf ( CATGETS(dtsearch_catd, MS_chandel, 39, "Error line %d: invalid Key Character:'%c'.\n") , line_num, (tok)?tok[0]:'?'); bad_profile = TRUE; @@ -1172,7 +1172,7 @@ BAD_TEXT: case DATEFLD: if (date_pos_defined) { - printf ( catgets(dtsearch_catd, MS_chandel, 110, + printf ( CATGETS(dtsearch_catd, MS_chandel, 110, "Warning line %d - date field redefined.\n") , line_num); null_date_specified = FALSE; @@ -1187,7 +1187,7 @@ BAD_TEXT: strcpy (date_current->field_id, tok); else { /* Msg #111 used two places */ - printf ( catgets(dtsearch_catd, MS_chandel, 111, + printf ( CATGETS(dtsearch_catd, MS_chandel, 111, "Error line %d - bad identifier '%s' for date.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1211,7 +1211,7 @@ BAD_TEXT: strcpy (date_current->field_id, tok); else { /* Msg #111 used two places */ - printf ( catgets(dtsearch_catd, MS_chandel, 111, + printf ( CATGETS(dtsearch_catd, MS_chandel, 111, "Error line %d - bad identifier '%s' for date.\n"), line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1225,7 +1225,7 @@ BAD_TEXT: case KEY: /*-- building the key --*/ if (warnings && key_pos_defined) - printf ( catgets(dtsearch_catd, MS_chandel, 40, + printf ( CATGETS(dtsearch_catd, MS_chandel, 40, "Warning line %d - key field redefined.\n") , line_num); key_table = (struct key_id *) malloc (sizeof (struct key_id)); @@ -1245,7 +1245,7 @@ BAD_TEXT: strcpy (key_current->field_id, tok); } else { - printf ( catgets(dtsearch_catd, MS_chandel, 43, + printf ( CATGETS(dtsearch_catd, MS_chandel, 43, "Error line %d - bad identifier '%s' for key.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1260,7 +1260,7 @@ BAD_TEXT: if (validate_id (tok)) strcpy (key_current->field_id, tok); else { - printf ( catgets(dtsearch_catd, MS_chandel, 43, + printf ( CATGETS(dtsearch_catd, MS_chandel, 43, "Error line %d - bad identifier '%s' for key.\n") , line_num, tok); bad_profile = TRUE; @@ -1283,7 +1283,7 @@ BAD_TEXT: discard = FALSE; else { BAD_DISCARD: - printf ( catgets(dtsearch_catd, MS_chandel, 45, + printf ( CATGETS(dtsearch_catd, MS_chandel, 45, "Error line %d: unknown option for 'discard': " "'%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1302,7 +1302,7 @@ BAD_DISCARD: del_blanklines = FALSE; else { BAD_DELBLANKLINES: - printf ( catgets(dtsearch_catd, MS_chandel, 46, + printf ( CATGETS(dtsearch_catd, MS_chandel, 46, "Error line %d: unknown option for " "'delblanklines': '%s'.\n") , line_num, NULLORSTR(tok)); @@ -1342,7 +1342,7 @@ BAD_DELBLANKLINES: break; default: BAD_ABSTR: - printf ( catgets(dtsearch_catd, MS_chandel, 47, + printf ( CATGETS(dtsearch_catd, MS_chandel, 47, "Error line %d: Unknown option for abstract :'%s'\n"), line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1351,7 +1351,7 @@ BAD_ABSTR: break; default: - printf ( catgets(dtsearch_catd, MS_chandel, 48, + printf ( CATGETS(dtsearch_catd, MS_chandel, 48, "Error line %d -unknown identifier type '%s'.\n") , line_num, NULLORSTR(tok)); bad_profile = TRUE; @@ -1359,7 +1359,7 @@ BAD_ABSTR: } /* main switch for each line in profile */ } while (TRUE); /* read-a-line do loop */ if (!date_pos_defined) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_chandel, 115, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_chandel, 115, "%s Default object dates will be '%s'.\n") , PROGNAME"1288", now_str); if (bad_profile) @@ -1368,17 +1368,17 @@ BAD_ABSTR: /*---- Process tables, and check for identifiers referenced ----*/ if (!top_defined && !bot_defined) { bad_profile = TRUE; - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 49, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 49, "Error - delimiter not defined.\n") ); } if (!key_defined) { bad_profile = TRUE; - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 50, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 50, "Error - key-type character never defined.\n") ); } if (!key_pos_defined) { bad_profile = TRUE; - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 51, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 51, "Error - key never defined.\n") ); } if (bad_profile) @@ -1392,12 +1392,12 @@ BAD_ABSTR: line_current = line_current->next; } if (top_rec_name[0] != 0 && top_rec == NULL) { - printf ( catgets(dtsearch_catd, MS_chandel, 52, + printf ( CATGETS(dtsearch_catd, MS_chandel, 52, "Error - delimiter defined as '%s' was never found.\n") , top_rec_name); bad_profile = TRUE; } else if (strcmp (top_rec->head->text, line_mode) == 0) { - printf ( catgets(dtsearch_catd, MS_chandel, 53, + printf ( CATGETS(dtsearch_catd, MS_chandel, 53, "Error - delimiter defined as '%s' references a physical " "line in the record.\n Since the delimiter defines the " "physical lines\n it cannot be referenced as a physical line.\n"), @@ -1416,7 +1416,7 @@ BAD_ABSTR: line_current = line_current->next; } if (!found && !field_current->constant) { - printf ( catgets(dtsearch_catd, MS_chandel, 54, + printf ( CATGETS(dtsearch_catd, MS_chandel, 54, "Error - for field '%s', no line identifier matches '%s'.\n") , field_current->name, field_current->line_id); bad_profile = TRUE; @@ -1436,7 +1436,7 @@ BAD_ABSTR: field_current = field_current->next; } if (!found) { - printf ( catgets(dtsearch_catd, MS_chandel, 55, + printf ( CATGETS(dtsearch_catd, MS_chandel, 55, "Error - field include/exclude list included\n" " the field '%s', which was never defined.\n") , finclude_current->field_id); @@ -1457,7 +1457,7 @@ BAD_ABSTR: line_current = line_current->next; } if (!found) { - printf ( catgets(dtsearch_catd, MS_chandel, 56, + printf ( CATGETS(dtsearch_catd, MS_chandel, 56, "Error - image include/exclude list included\n" " the line '%s', which was never defined.\n") , include_current->line_id); @@ -1478,7 +1478,7 @@ BAD_ABSTR: line_current = line_current->next; } if (!found) { - printf ( catgets(dtsearch_catd, MS_chandel, 57, + printf ( CATGETS(dtsearch_catd, MS_chandel, 57, "Error - text include/exclude list included\n" " the line '%s', which was never defined.\n") , include_current->line_id); @@ -1505,7 +1505,7 @@ BAD_ABSTR: } } if (!found) { - printf ( catgets(dtsearch_catd, MS_chandel, 116, + printf ( CATGETS(dtsearch_catd, MS_chandel, 116, "Error - date references undefined field '%s'.\n"), date_current->field_id); bad_profile = TRUE; @@ -1538,7 +1538,7 @@ END_DATE_TABLE: field_current = field_current->next; } if (!found) { - printf ( catgets(dtsearch_catd, MS_chandel, 58, + printf ( CATGETS(dtsearch_catd, MS_chandel, 58, "Error - key definition references field '%s'\n" " which was never defined.\n") , key_current->field_id); @@ -1558,7 +1558,7 @@ END_DATE_TABLE: field_current = field_current->next; } if (!found) { - printf ( catgets(dtsearch_catd, MS_chandel, 59, + printf ( CATGETS(dtsearch_catd, MS_chandel, 59, "Error - abstract definition references field '%s'\n" " which was never defined.\n") , abstract_current->field_id); @@ -1691,7 +1691,7 @@ void write_record (void) /* Test final record write to check for full filesystem */ if (fprintf (outstream, "%c\n", CNTRL_L) <= 0) { - printf ( catgets(dtsearch_catd, MS_chandel, 124, + printf ( CATGETS(dtsearch_catd, MS_chandel, 124, "%s Unable to write to output file '%s':\n %s\n") , PROGNAME"1663", outfile, strerror(errno)); DtSearchExit (2); @@ -1715,7 +1715,7 @@ static void mmm_to_digits (struct field_id *fld) int i; if (months == NULL) - months = strdup (catgets(dtsearch_catd, MS_chandel, 125, + months = strdup (CATGETS(dtsearch_catd, MS_chandel, 125, "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC")); for (i=0; i<3; i++) valbuf[i] = toupper (fld->value[i]); @@ -1954,7 +1954,7 @@ void process_record (void) BAD_DATE_VALUE: objdate_tmptr = &nowtm; - printf ( catgets(dtsearch_catd, MS_chandel, 133, + printf ( CATGETS(dtsearch_catd, MS_chandel, 133, "Warning - '%s' is invalid date specification.\n" " Using '%s' date for record number %ld that began: %.30s\n") , date_value, now_str, rec_count, record_head->text); @@ -1981,12 +1981,12 @@ void process_record (void) key_current = key_current->next; } if (dummy && warnings) { - printf ( catgets(dtsearch_catd, MS_chandel, 68, + printf ( CATGETS(dtsearch_catd, MS_chandel, 68, "Warning - fields necessary for key not found.\n" " discarding record #%ld that began:\n %s\n") , rec_count, record_head->text); } else if (discard && meaningless && warnings) { - printf ( catgets(dtsearch_catd, MS_chandel, 69, + printf ( CATGETS(dtsearch_catd, MS_chandel, 69, "Warning - record #ld deemed meaningless, discarding...\n" " record began: %.60s\n") , rec_count, record_head->text); @@ -2061,7 +2061,7 @@ void process_infile (void) instream = stdin; else { if ((instream = fopen (infile, "rt")) == NULL) { - printf ( catgets(dtsearch_catd, MS_chandel, 70, + printf ( CATGETS(dtsearch_catd, MS_chandel, 70, " Unable to open input file '%s'.\n") , infile); exit (FILE_ERROR); } @@ -2197,7 +2197,7 @@ static void usage_msg (void) if (!warnings) return; - printf (catgets (dtsearch_catd, MS_chandel, 71, default_text), + printf (CATGETS(dtsearch_catd, MS_chandel, 71, default_text), aa_argv0, EXT_FZKEY); return; } /* usage_msg() */ @@ -2225,7 +2225,7 @@ static void user_arg_processor (int argc, char **argv) case 'w': if ((screen_width = atoi (argptr + 2)) == 0) { - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 72, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 72, "Invalid screen width specified.\n") ); bad_parm = TRUE; } @@ -2242,7 +2242,7 @@ static void user_arg_processor (int argc, char **argv) else if (argptr[2] == 'a') strcpy (outmode, "a"); else { - printf ( catgets(dtsearch_catd, MS_chandel, 75, + printf ( CATGETS(dtsearch_catd, MS_chandel, 75, "'%s' is invalid output mode.\n") , argptr); bad_parm = TRUE; } /* else */ @@ -2250,14 +2250,14 @@ static void user_arg_processor (int argc, char **argv) break; default: - printf ( catgets(dtsearch_catd, MS_chandel, 76, + printf ( CATGETS(dtsearch_catd, MS_chandel, 76, "Unknown command line argument '%s'.\n") , argptr); bad_parm = TRUE; } /*--switch--*/ } /*--while--*/ if (argc-- <= 0) { - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 77, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 77, "Missing required profile-file name.\n") ); bad_parm = TRUE; } @@ -2274,7 +2274,7 @@ static void user_arg_processor (int argc, char **argv) } if (argc-- <= 0) { - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 78, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 78, "Missing required input-file name.\n") ); bad_parm = TRUE; } @@ -2292,7 +2292,7 @@ static void user_arg_processor (int argc, char **argv) strcat(outfile,EXT_FZKEY); *****************/ if (strcmp (infile, "-") == 0) { - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 79, "Error - using " + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 79, "Error - using " "stdin as input, output filename is required!\n") ); exit (FILE_ERROR); } else { @@ -2321,38 +2321,38 @@ static void user_arg_processor (int argc, char **argv) /*-- Sanity checks --*/ /*-- duplicates? --*/ if (strcmp (infile, profile) == 0) { - printf ( catgets(dtsearch_catd, MS_chandel, 80, + printf ( CATGETS(dtsearch_catd, MS_chandel, 80, "Profile file and input file have same name:'%s'.\n") , infile); bad_parm = TRUE; } /* if */ if (strcmp (infile, outfile) == 0 && strcmp (infile, "-")) { - printf ( catgets(dtsearch_catd, MS_chandel, 81, + printf ( CATGETS(dtsearch_catd, MS_chandel, 81, "Input file and output file have same name:'%s'.\n") , infile); bad_parm = TRUE; } /* if */ if (strcmp (profile, outfile) == 0) { - printf ( catgets(dtsearch_catd, MS_chandel, 82, + printf ( CATGETS(dtsearch_catd, MS_chandel, 82, "Profile file and output file have same name:'%s'.\n") , profile); bad_parm = TRUE; } /* if */ if(warnings) { - printf ( catgets(dtsearch_catd, MS_chandel, 83, + printf ( CATGETS(dtsearch_catd, MS_chandel, 83, " Profile file: %s\n") , profile); if (strcmp (infile, "-") == 0) - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 84, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 84, " Input file: stdin\n") ); else - printf ( catgets(dtsearch_catd, MS_chandel, 85, + printf ( CATGETS(dtsearch_catd, MS_chandel, 85, " Input file: %s\n") , infile); if (strcmp (outfile, "-") == 0) - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 86, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 86, " Output file: stdout\n") ); else - printf ( catgets(dtsearch_catd, MS_chandel, 87, + printf ( CATGETS(dtsearch_catd, MS_chandel, 87, " Output file: %s\n") , outfile); } } /*--user_args_processor--*/ @@ -2377,8 +2377,8 @@ int main (int argc, char **argv) /*-- Initialization --*/ aa_argv0 = argv[0]; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); - printf ( catgets(dtsearch_catd, MS_chandel, 88, + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); + printf ( CATGETS(dtsearch_catd, MS_chandel, 88, "%s. %s %s Text Filter.\n") , aa_argv0, PRODNAME, DtSrVERSION); @@ -2399,7 +2399,7 @@ int main (int argc, char **argv) signal (SIGINT, flag_shutdown); signal (SIGTERM, flag_shutdown); open_outfile (); - printf ( catgets(dtsearch_catd, MS_chandel, 89, + printf ( CATGETS(dtsearch_catd, MS_chandel, 89, "\nInterrupt with CTRL-C to exit gracefully " "at record boundary.\n Each dot is %ld records...\n"), RECS_PER_DOT); @@ -2407,17 +2407,17 @@ int main (int argc, char **argv) oops = fclose (outstream); fclose (instream); if (oops < 0) { - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 90, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 90, "\nError closing output file - disk full?\n") ); exit (FILE_ERROR); } } else { - printf ( "%s", catgets(dtsearch_catd, MS_chandel, 91, + printf ( "%s", CATGETS(dtsearch_catd, MS_chandel, 91, "Quitting due to errors in profile file.\n") ); exit (BAD_PROFILE); } - printf ( catgets(dtsearch_catd, MS_chandel, 92, + printf ( CATGETS(dtsearch_catd, MS_chandel, 92, "\n%s: Normal completion. %ld records processed. Exit code = 0.\n"), aa_argv0, rec_count); return 0; diff --git a/cde/programs/dtsr/dtsrindex.c b/cde/programs/dtsr/dtsrindex.c index bd2fc2384..26ab3005a 100644 --- a/cde/programs/dtsr/dtsrindex.c +++ b/cde/programs/dtsr/dtsrindex.c @@ -295,7 +295,7 @@ static void print_exit_code (int exit_code) /* Put total seconds into totalstart */ if (totalstart > 0) totalstart = time (NULL) - totalstart; - printf (catgets (dtsearch_catd, MS_cborodin, 206, + printf (CATGETS(dtsearch_catd, MS_cborodin, 206, "%s: Exit Code = %d, Total elapsed time %ldm %lds.\n"), aa_argv0, exit_code, totalstart / 60L, totalstart % 60L); return; @@ -380,7 +380,7 @@ void write_to_file (TREENODE * output_node) print_dba = print_dba->next_dba; num_addrs_for_word++; if (num_addrs_for_word >= batch_size) { - printf (catgets (dtsearch_catd, MS_cborodin, 280, + printf (CATGETS(dtsearch_catd, MS_cborodin, 280, "\n%s num_addrs_for_word (%ld) >= batchsz (%ld).\n"), PROGNAME"280", (long)num_addrs_for_word, (long)batch_size); DtSearchExit (91); @@ -449,7 +449,7 @@ void traverse_tree (void) /* Dheck for the empty tree */ if (root_node == NULL) { - printf (catgets (dtsearch_catd, MS_cborodin, 288, + printf (CATGETS(dtsearch_catd, MS_cborodin, 288, "%s Abort. There are no words in the input file %s.\n"), PROGNAME"288", fname_input); DtSearchExit (34); @@ -522,7 +522,7 @@ void traverse_tree (void) /********************************************************/ static void print_usage_msg (void) { - printf (catgets (dtsearch_catd, MS_cborodin, 17, + printf (CATGETS(dtsearch_catd, MS_cborodin, 17, "\n" "USAGE: %s -d [options] \n" " Listed default file name extensions can be overridden.\n" @@ -631,7 +631,7 @@ void user_args_processor (int argc, char **argv) case 'r': if ((recs_per_dot = atoi (argptr + 2)) <= 0) { - printf (catgets (dtsearch_catd, MS_cborodin, 577, + printf (CATGETS(dtsearch_catd, MS_cborodin, 577, "%s Invalid arg '%s'. Using default -r%d.\n"), PROGNAME"577", argptr, RECS_PER_DOT); recs_per_dot = RECS_PER_DOT; @@ -641,7 +641,7 @@ void user_args_processor (int argc, char **argv) case 'h': duprec_hashsize = atol (argptr + 2); if (duprec_hashsize == 0UL) - printf (catgets (dtsearch_catd, MS_cborodin, 539, + printf (CATGETS(dtsearch_catd, MS_cborodin, 539, "%s Duplicate record id checking disabled.\n"), PROGNAME"539"); break; @@ -649,7 +649,7 @@ void user_args_processor (int argc, char **argv) case 'b': batch_size = atol (argptr + 2); if (batch_size <= 0L) { - printf (catgets (dtsearch_catd, MS_cborodin, 595, + printf (CATGETS(dtsearch_catd, MS_cborodin, 595, "%s Invalid batch size argument '%s'.\n"), PROGNAME"595", argptr); goto BADPARM; @@ -666,7 +666,7 @@ void user_args_processor (int argc, char **argv) else cache_size = CACHE_SIZE; CACHE_ADJUSTED: - printf (catgets (dtsearch_catd, MS_cborodin, 600, + printf (CATGETS(dtsearch_catd, MS_cborodin, 600, "%sCache size readjusted to %d.\n"), PROGNAME "600 ", cache_size); break; @@ -703,7 +703,7 @@ CACHE_ADJUSTED: case 'd': /* May include both dicname and dicpath */ if (!segregate_dicname (argptr + 2)) { - printf (catgets (dtsearch_catd, MS_cborodin, 550, + printf (CATGETS(dtsearch_catd, MS_cborodin, 550, "%s '%s' is invalid path/database name.\n"), PROGNAME"550", argptr); goto BADPARM; @@ -712,7 +712,7 @@ CACHE_ADJUSTED: case 'i': /* (I)nput buffer size */ if ((inbufsz = atol (argptr + 2)) <= 0) { - printf (catgets (dtsearch_catd, MS_cborodin, 558, + printf (CATGETS(dtsearch_catd, MS_cborodin, 558, "%s Invalid input buffer size '%s'.\n"), PROGNAME"558", argptr); goto BADPARM; @@ -720,7 +720,7 @@ CACHE_ADJUSTED: break; default: - printf (catgets (dtsearch_catd, MS_cborodin, 567, + printf (CATGETS(dtsearch_catd, MS_cborodin, 567, "%s Unknown command line argument '%s'.\n"), PROGNAME"567", argptr); BADPARM: @@ -732,7 +732,7 @@ BADPARM: /* Validate input file name */ if (argc-- <= 0) { - printf (catgets (dtsearch_catd, MS_cborodin, 580, + printf (CATGETS(dtsearch_catd, MS_cborodin, 580, "%s Missing required input file name.\n"), PROGNAME"580"); goto BADPARM; @@ -743,7 +743,7 @@ BADPARM: /* Check for missing database name */ if (dicname[0] == 0) { - printf (catgets (dtsearch_catd, MS_cborodin, 589, + printf (CATGETS(dtsearch_catd, MS_cborodin, 589, "%s No database name specified (-d argument).\a\n"), PROGNAME"589"); goto BADPARM; @@ -786,7 +786,7 @@ static void put_addrs_2_dtbs_addr_file ( DtSrINT32 num_addrs; if (nitems >= batch_size) { - printf ( catgets(dtsearch_catd, MS_cborodin, 6, + printf ( CATGETS(dtsearch_catd, MS_cborodin, 6, "put_addrs_2_dtbs_addr_file() nitems=%d, batchsz=%ld\n") , (int)nitems, (long)batch_size); DtSearchExit (58); @@ -837,7 +837,7 @@ static void put_addrs_2_dtbs_addr_file ( num_writes = fwrite (word_addrs_ii, sizeof(DB_ADDR), (size_t)num_addrs, dtbs_addr_fp); if (num_writes != num_addrs) { - printf (catgets (dtsearch_catd, MS_cborodin, 776, msg_776), + printf (CATGETS(dtsearch_catd, MS_cborodin, 776, msg_776), PROGNAME"776", strerror(errno)); DtSearchExit (76); } @@ -848,7 +848,7 @@ static void put_addrs_2_dtbs_addr_file ( num_writes = fwrite (addrs_array, sizeof(DB_ADDR), (size_t)got_word.or_hwfree, dtbs_addr_fp); if (num_writes != got_word.or_hwfree) { - printf (catgets (dtsearch_catd, MS_cborodin, 776, msg_776), + printf (CATGETS(dtsearch_catd, MS_cborodin, 776, msg_776), PROGNAME"786", strerror(errno)); DtSearchExit (86); } @@ -863,7 +863,7 @@ static void put_addrs_2_dtbs_addr_file ( num_writes = fwrite (addrs_array, sizeof(DB_ADDR), (size_t)nitems, dtbs_addr_fp); if (num_writes != nitems) { - printf (catgets (dtsearch_catd, MS_cborodin, 776, msg_776), + printf (CATGETS(dtsearch_catd, MS_cborodin, 776, msg_776), PROGNAME"798", strerror(errno)); DtSearchExit (87); } @@ -871,7 +871,7 @@ static void put_addrs_2_dtbs_addr_file ( num_writes = fwrite (word_addrs_ii, sizeof(DB_ADDR), (size_t)num_addrs, dtbs_addr_fp); if (num_writes != num_addrs) { - printf (catgets (dtsearch_catd, MS_cborodin, 776, msg_776), + printf (CATGETS(dtsearch_catd, MS_cborodin, 776, msg_776), PROGNAME"889", strerror(errno)); DtSearchExit (89); } @@ -934,7 +934,7 @@ void write_2_dtbs_addr_file (void) num_addrs_ii = got_word.or_hwaddrs; if (num_addrs_ii > or_reccount) { - printf (catgets (dtsearch_catd, MS_cborodin, 713, + printf (CATGETS(dtsearch_catd, MS_cborodin, 713, "\n%s Word '%s' occurs in %ld records,\n" " but there are only %ld records in database!\n" " (This may be a good candidate for the stoplist).\n"), @@ -947,7 +947,7 @@ void write_2_dtbs_addr_file (void) if (fseek (dtbs_addr_fp, (long) got_word.or_hwoffset, SEEK_SET) != 0) { - printf (catgets (dtsearch_catd, MS_cborodin, 875, + printf (CATGETS(dtsearch_catd, MS_cborodin, 875, "\n%s Could not fseek d99 file to offset %ld.\n"), PROGNAME"875", got_word.or_hwoffset); DtSearchExit (98); @@ -955,7 +955,7 @@ void write_2_dtbs_addr_file (void) num_reads = fread (word_addrs_ii, sizeof(DB_ADDR), (size_t)num_addrs_ii, dtbs_addr_fp); if (num_reads != num_addrs_ii) { - printf (catgets (dtsearch_catd, MS_cborodin, 848, + printf (CATGETS(dtsearch_catd, MS_cborodin, 848, "\n%s Could not fread %ld bytes (%ld dba's) of d99 file\n" " at offset %ld. Number of dba's read (return code) = %ld.\n"), PROGNAME"848", sizeof(DB_ADDR) * num_addrs_ii, (long)num_addrs_ii, @@ -990,7 +990,7 @@ void write_2_dtbs_addr_file (void) temp1 = (*(word_addrs_ii + i) >> 8) - 1; /* = rec#, base 0 */ cur_byte = temp1 >> 3; /* get matching byte# in bit vector */ if (cur_byte >= bit_vector_size) { - printf ( catgets(dtsearch_catd, MS_cborodin, 9, + printf ( CATGETS(dtsearch_catd, MS_cborodin, 9, "\n%s Corrupted d99 file for word '%s',\n" " database address %ld @ file position %ld => bitvector[%ld]," " but max bitvector allocation = %ld.\n") , @@ -1134,7 +1134,7 @@ void write_new_word_2_dtbs (void) num_writes = fwrite (record_addr_word, sizeof(DB_ADDR), (size_t)got_word.or_hwfree, dtbs_addr_fp); if (num_writes != got_word.or_hwfree) { - printf (catgets (dtsearch_catd, MS_cborodin, 776, msg_776), + printf (CATGETS(dtsearch_catd, MS_cborodin, 776, msg_776), PROGNAME"960", strerror(errno)); DtSearchExit (96); } @@ -1167,7 +1167,7 @@ void fill_data1 (char *node_word) count_word_ii++; if (shutdown_now) { - printf (catgets (dtsearch_catd, MS_cborodin, 164, + printf (CATGETS(dtsearch_catd, MS_cborodin, 164, "\n%s Abort due to signal %d. Database %s\n" " probably corrupted. Restore backup database.\n"), PROGNAME"164", shutdown_now, dicname); @@ -1186,7 +1186,7 @@ void fill_data1 (char *node_word) (((float) num_of_diff_words / (float) count_word_ii - 1.) * (float) (time (NULL) - timestart)); - printf (catgets (dtsearch_catd, MS_cborodin, 849, + printf (CATGETS(dtsearch_catd, MS_cborodin, 849, "\n%s: Word #%ld, %.0f%% done. Est %lum %02lus " "to completion.\n"), aa_argv0, count_word_ii, @@ -1296,7 +1296,7 @@ static void load_into_bintree ( */ else { if ((newdba = malloc (sizeof(DBALIST))) == NULL) { - printf (catgets (dtsearch_catd, MS_cborodin, 374, + printf (CATGETS(dtsearch_catd, MS_cborodin, 374, msg_374), PROGNAME"1150"); DtSearchExit (26); } @@ -1379,15 +1379,15 @@ main (int argc, char **argv) /******************* INITIALIZE ******************/ setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); aa_argv0 = strdup (argv[0]); time (&elapsed); tmptr = localtime (&elapsed); strftime (buf, sizeof(buf), - catgets (dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), tmptr); - printf (catgets (dtsearch_catd, MS_cborodin, 1, "%s. Run %s.\n"), + printf (CATGETS(dtsearch_catd, MS_cborodin, 1, "%s. Run %s.\n"), aa_argv0, buf); austext_exit_last = print_exit_code; batch_size = BATCH_SIZE; @@ -1430,7 +1430,7 @@ main (int argc, char **argv) /* Load database's parser, stemmer, and linguistic files into dblk. */ if (!load_language (&dblk, NULL)) { puts (DtSearchGetMessages()); - printf (catgets (dtsearch_catd, MS_cborodin, 1097, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1097, "%s Aborting due to errors in loading language files.\n"), PROGNAME"1097"); DtSearchExit(3); @@ -1481,7 +1481,7 @@ main (int argc, char **argv) new_dtbs_file = TRUE; if (dtbs_addr_fp == NULL) { /* msg 1068 used multiple places */ - printf (catgets (dtsearch_catd, MS_cborodin, 1068, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1068, "%s Can't open new inverted index file '%s': %s\n"), PROGNAME"1068", dtbs_addr_file, strerror(errno)); DtSearchExit (13); @@ -1493,7 +1493,7 @@ main (int argc, char **argv) /* read Header Information from d99 file */ if (!fread_d99_header (&fl_hdr, dtbs_addr_fp)) { /* msg 1068 used multiple places */ - printf (catgets (dtsearch_catd, MS_cborodin, 1068, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1068, "%s Can't read header data for '%s': %s\n"), PROGNAME"1422", dtbs_addr_file, strerror(errno)); DtSearchExit (13); @@ -1506,14 +1506,14 @@ main (int argc, char **argv) printf (PROGNAME"1336 Can't getcwd: %s.\n", strerror(errno)); if (!src) src = getenv ("PWD"); - printf (catgets (dtsearch_catd, MS_misc, 24, + printf (CATGETS(dtsearch_catd, MS_misc, 24, "%s: current working directory = '%s', .fzk file = '%s'\n"), aa_argv0, - (src) ? src : catgets (dtsearch_catd, MS_misc, 6, ""), + (src) ? src : CATGETS(dtsearch_catd, MS_misc, 6, ""), fname_input); if ((instream = fopen (fname_input, "rt")) == NULL) { BAD_INPUT_FILE: - printf (catgets (dtsearch_catd, MS_cborodin, 1083, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1083, "%s Can't read input file '%s': %s\n"), PROGNAME"1083", fname_input, strerror(errno)); DtSearchExit (14); @@ -1538,7 +1538,7 @@ BAD_INPUT_FILE: * the language's parser() a 'word' at a time, which * ultimately means a byte at a time. */ - printf (catgets (dtsearch_catd, MS_cborodin, 1108, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1108, "%s: Beginning Pass 1, reading records from '%s'.\n" " Each dot = %d records.\n"), aa_argv0, fname_input, recs_per_dot); @@ -1560,7 +1560,7 @@ BAD_INPUT_FILE: inbuf [inbufsz] = 0; /* just to be sure */ if (shutdown_now) { - printf (catgets (dtsearch_catd, MS_cborodin, 164, + printf (CATGETS(dtsearch_catd, MS_cborodin, 164, "\n%s: %s Abort due to signal %d. Database %s\n" " possibly corrupted. Restore backup database.\n"), aa_argv0, PROGNAME"1299", shutdown_now, dicname); @@ -1576,7 +1576,7 @@ BAD_INPUT_FILE: /*----- READ LINE #2, abstract -----*/ if (fgets (inbuf, inbufsz, instream) == NULL) { INVALID_FZK_FORMAT: - printf (catgets (dtsearch_catd, MS_cborodin, 1129, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1129, "%s: %s Invalid .fzk file format.\n"), fname_input, PROGNAME"1129"); DtSearchExit (22); @@ -1593,7 +1593,7 @@ INVALID_FZK_FORMAT: /* If necessary, discard long keys exactly like cravel */ if (strlen (cptr) >= DtSrMAX_DB_KEYSIZE) { - printf (catgets (dtsearch_catd, MS_cborodin, 659, + printf (CATGETS(dtsearch_catd, MS_cborodin, 659, "\n%s: %s Discarding record, key too long:\n '%s'.\n"), aa_argv0, PROGNAME"659", cptr); discard_to_ETX (&parg); @@ -1604,7 +1604,7 @@ INVALID_FZK_FORMAT: /* Skip duplicate record ids in same order as dtsrload */ i = is_duprec (db_key); if (i == 2) { /* out of memory */ - printf (catgets (dtsearch_catd, MS_cborodin, 374, msg_374), + printf (CATGETS(dtsearch_catd, MS_cborodin, 374, msg_374), PROGNAME"1317"); DtSearchExit (57); } @@ -1612,7 +1612,7 @@ INVALID_FZK_FORMAT: duplicate_recids++; if (dotcount > 0) putchar ('\n'); - printf (catgets (dtsearch_catd, MS_cborodin, 1402, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1402, "%s: Discarded duplicate rec #%lu '%s'.\n"), aa_argv0, record_count, db_key); discard_to_ETX (&parg); @@ -1631,7 +1631,7 @@ INVALID_FZK_FORMAT: normal_retncode = 1; /* = 'warning' */ if (dotcount > 0) putchar ('\n'); - printf (catgets (dtsearch_catd, MS_cborodin, 1168, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1168, "%s: %s Discarded '%s', key not in database.\n"), aa_argv0, PROGNAME"1168", displayable(db_key)); discard_to_ETX (&parg); @@ -1653,7 +1653,7 @@ INVALID_FZK_FORMAT: * if user failed to run dtsrload before dtsrindex? */ if (dba < 1 || dba > or_maxdba) { - printf ( catgets(dtsearch_catd, MS_cborodin, 21, + printf ( CATGETS(dtsearch_catd, MS_cborodin, 21, "\n%s '%s' record overflows word counter array.\n" "Record number %ld > maxdba %ld, dba=%ld, " "recslots=%ld, offs=%d.\n") , @@ -1665,7 +1665,7 @@ INVALID_FZK_FORMAT: temp_dba = dba - 1; /* = rec# starting at 0 */ cur_byte = temp_dba >> 3; /* bits to bytes: div by 8 */ if (cur_byte >= bit_vector_size) { - printf ( catgets(dtsearch_catd, MS_cborodin, 22, + printf ( CATGETS(dtsearch_catd, MS_cborodin, 22, "\n%s '%s' record in database (dba=%ld)\n" " overflows bitvector allocation (%ld >= %ld).\n") , PROGNAME"1475", displayable(db_key), (long)dba, @@ -1687,7 +1687,7 @@ INVALID_FZK_FORMAT: (((float) fstat_input.st_size / (float) bytes_in - 1.) * (float) (time (NULL) - timestart)); - printf (catgets (dtsearch_catd, MS_cborodin, 1190, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1190, "\n%s: Rec #%lu, %.0f%% done. " "Est %lum %02lus to end Pass 1.\n"), aa_argv0, @@ -1748,20 +1748,20 @@ INVALID_FZK_FORMAT: } if (duplicate_recids > 0L) { normal_retncode = 1; /* 'warning' */ - sprintf (buf, catgets (dtsearch_catd, MS_cborodin, 40, + sprintf (buf, CATGETS(dtsearch_catd, MS_cborodin, 40, "Ignored %ld duplicate records"), duplicate_recids); } else - strcpy (buf, catgets (dtsearch_catd, MS_cborodin, 41, + strcpy (buf, CATGETS(dtsearch_catd, MS_cborodin, 41, "No duplicate records found")); - printf (catgets (dtsearch_catd, MS_cborodin, 1225, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1225, "%s: Pass 1 completed in %lum %lus, read %lu records.\n" " %s, parsed %lu words.\n"), aa_argv0, elapsed / 60L, elapsed % 60L, record_count, buf, num_of_diff_words); if (record_count > batch_size) { - printf (catgets (dtsearch_catd, MS_cborodin, 33, + printf (CATGETS(dtsearch_catd, MS_cborodin, 33, "\n%s Number of incoming records exceeded %d.\n" " This will usually result in 'Out of Paging Space' " "error in Pass 2\n" @@ -1774,7 +1774,7 @@ INVALID_FZK_FORMAT: /*----------------- PASS 2: ----------------- * Traverse completed binary tree and write it to d99 file. */ - printf (catgets (dtsearch_catd, MS_cborodin, 1233, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1233, "%s: Beginning Pass 2: batch index traversal and database update.\n" " Each dot = %d words.\n"), aa_argv0, words_per_dot); @@ -1788,7 +1788,7 @@ INVALID_FZK_FORMAT: /* Write header information to the d99 file */ if (!fwrite_d99_header (&fl_hdr, dtbs_addr_fp)) { - printf (catgets (dtsearch_catd, MS_cborodin, 776, msg_776), + printf (CATGETS(dtsearch_catd, MS_cborodin, 776, msg_776), PROGNAME"1723", strerror(errno)); DtSearchExit (13); } @@ -1796,11 +1796,11 @@ INVALID_FZK_FORMAT: fclose (dtbs_addr_fp); elapsed = time (NULL) - timestart; - printf (catgets (dtsearch_catd, MS_cborodin, 1246, + printf (CATGETS(dtsearch_catd, MS_cborodin, 1246, "%s: Pass 2 completed in %lum %lus, updated %lu words.\n"), aa_argv0, elapsed / 60L, elapsed % 60L, count_word_ii); if (normal_retncode == 1) - printf (catgets (dtsearch_catd, MS_cborodin, 2, + printf (CATGETS(dtsearch_catd, MS_cborodin, 2, "%s: Warnings were detected.\n"), aa_argv0); DtSearchExit (normal_retncode); diff --git a/cde/programs/dtsr/dtsrkdump.c b/cde/programs/dtsr/dtsrkdump.c index c3cd233a8..0a025b942 100644 --- a/cde/programs/dtsr/dtsrkdump.c +++ b/cde/programs/dtsr/dtsrkdump.c @@ -117,7 +117,7 @@ void count_words (int index) else if (index == 4) vista_field = OR_HWORDKEY; else { - printf (catgets (dtsearch_catd, MS_dtsrkdump, 1, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 1, "%s Program Error Abort.\a\n"), PROGNAME"030"); DtSearchExit (4); @@ -164,7 +164,7 @@ void count_words (int index) printf ("\" "); while (tabstop++ < 22) putchar (' '); - printf (catgets(dtsearch_catd, MS_dtsrkdump, 2, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 2, "%c dba=%d:%-7ld ofs=%-9ld adr=%-6ld fre=%ld\n"), (addrs >= dbrec.or_reccount) ? '*' : ' ', dba >> 24, dba & 0xffffff, offset, addrs, free); @@ -227,17 +227,17 @@ int main (int argc, char *argv[]) sscanf ("$Revision: /main/3 $", "%*s %s", rcs_revision); setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); strftime (buf, sizeof (buf), "%m/%d/%Y, %I:%M %p", localtime (&now)); - printf (catgets(dtsearch_catd, MS_dtsrkdump, 3, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 3, "%s %s, engine %s. %s.\n"), aa_argv0, rcs_revision, AUSAPI_VERSION, buf); if (argc <= 1) { PRINT_USAGE: - printf (catgets(dtsearch_catd, MS_dtsrkdump, 4, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 4, "\nUSAGE: %s -o|w|ow [-v] [-t | -p] dbname\n" " Reads DtSearch key files and prints summary report.\n" " -o Keys examined are OBJECT record keys.\n" @@ -291,7 +291,7 @@ PRINT_USAGE: percent = atof (ptr + 1); if (percent <= 0.0 || percent > 100.0) { fprintf (stderr, - catgets (dtsearch_catd, MS_dtsrkdump, 5, + CATGETS(dtsearch_catd, MS_dtsrkdump, 5, "%s Invalid percent value %lf.\a\n"), PROGNAME"195", percent); goto PRINT_USAGE; @@ -304,7 +304,7 @@ PRINT_USAGE: do_wordkeys = TRUE; if ((min_threshold = atol (ptr + 1)) <= 0L) { fprintf (stderr, - catgets (dtsearch_catd, MS_dtsrkdump, 53, + CATGETS(dtsearch_catd, MS_dtsrkdump, 53, "%s Invalid threshold value.\a\n"), PROGNAME"198"); goto PRINT_USAGE; @@ -314,7 +314,7 @@ PRINT_USAGE: default: fprintf (stderr, - catgets (dtsearch_catd, MS_dtsrkdump, 55, + CATGETS(dtsearch_catd, MS_dtsrkdump, 55, "%s Unknown command line argument '%c'.\a\n"), PROGNAME"278", *ptr); goto PRINT_USAGE; @@ -325,13 +325,13 @@ PRINT_USAGE: oops = FALSE; if (argc <= 0) { - printf (catgets (dtsearch_catd, MS_dtsrkdump, 56, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 56, "%s Missing required database name.\a\n"), PROGNAME"267"); oops = TRUE; } if (!do_wordkeys && !do_objkeys) { - printf (catgets (dtsearch_catd, MS_dtsrkdump, 57, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 57, "%s Either -o or -w must be specified.\a\n"), PROGNAME"271"); oops = TRUE; @@ -359,7 +359,7 @@ PRINT_USAGE: /* test for valid database name */ i = strlen (ptr); if (i < 1 || i > 8) { - fprintf (stderr, catgets (dtsearch_catd, MS_dtsrkdump, 58, + fprintf (stderr, CATGETS(dtsearch_catd, MS_dtsrkdump, 58, "%s Invalid database name '%s'.\a\n"), PROGNAME"297", ptr); goto PRINT_USAGE; @@ -375,7 +375,7 @@ PRINT_USAGE: } maxdba = dbrec.or_maxdba; - printf (catgets(dtsearch_catd, MS_dtsrkdump, 60, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 60, "%s: '%s' reccount=%ld maxdba=%ld recslots=%hd minw=%hd maxw=%hd\n"), aa_argv0, dbname, dbrec.or_reccount, dbrec.or_maxdba, dbrec.or_recslots, @@ -392,7 +392,7 @@ PRINT_USAGE: if (min_threshold > 1 && min_threshold < dbrec.or_reccount) { - printf (catgets(dtsearch_catd, MS_dtsrkdump, 70, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 70, "%s Will only list words occurring " "in %ld or more records.\n"), aa_argv0, min_threshold); @@ -400,7 +400,7 @@ PRINT_USAGE: (float) min_threshold / (float) dbrec.or_reccount > .90; } else { - printf (catgets(dtsearch_catd, MS_dtsrkdump, 80, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 80, "%s: Listing all words in database.\n"), aa_argv0); listing_most_words = TRUE; @@ -445,7 +445,7 @@ PRINT_USAGE: while (i++ < DtSrMAX_DB_KEYSIZE) putchar (' '); - printf (catgets(dtsearch_catd, MS_dtsrkdump, 100, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 100, "dba x%08lx, %6ld\n"), dba, dba); } /* end verbose */ @@ -471,11 +471,11 @@ PRINT_USAGE: if (dbpath[0] == 0) buf[0] = 0; else - sprintf (buf, catgets(dtsearch_catd, MS_dtsrkdump, 110, + sprintf (buf, CATGETS(dtsearch_catd, MS_dtsrkdump, 110, " in %s"), dbpath); - printf (catgets(dtsearch_catd, MS_dtsrkdump, 120, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 120, "Object Summary for '%s'%s:\n"), dbname, buf); - puts (catgets(dtsearch_catd, MS_dtsrkdump, 130, + puts (CATGETS(dtsearch_catd, MS_dtsrkdump, 130, "Object Count by Keytypes:")); total = 0L; for (i = 0; i < 256; i++) { @@ -487,16 +487,16 @@ PRINT_USAGE: printf (" x%02x %6ld\n", i, counters[i]); } } - printf (catgets(dtsearch_catd, MS_dtsrkdump, 160, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 160, "TOTAL Objects Count = %ld\n"), total); - printf (catgets(dtsearch_catd, MS_dtsrkdump, 170, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 170, "Largest Object DBA = %ld\n"), maxdba); free (counters); } /* end do_objkeys */ if (do_wordkeys) { if (listing_most_words) - printf (catgets(dtsearch_catd, MS_dtsrkdump, 180, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 180, "%s: * Words marked with asterisk occur in every record.\n"), aa_argv0); @@ -519,16 +519,16 @@ PRINT_USAGE: if (dbpath[0] == 0) buf[0] = 0; else - sprintf (buf, catgets(dtsearch_catd, MS_dtsrkdump, 110, + sprintf (buf, CATGETS(dtsearch_catd, MS_dtsrkdump, 110, " in %s"), dbpath); - printf (catgets(dtsearch_catd, MS_dtsrkdump, 200, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 200, "Words Summary for '%s'%s:\n"), dbname, buf); total = 0L; for (i = 0; i < 6; i++) { printf (word_labels[i], counters[i]); total += counters[i]; } - printf (catgets(dtsearch_catd, MS_dtsrkdump, 210, + printf (CATGETS(dtsearch_catd, MS_dtsrkdump, 210, "TOTAL Words Count = %ld\n"), total); free (counters); } /* end do_wordkeys */ diff --git a/cde/programs/dtsr/dtsrload.c b/cde/programs/dtsr/dtsrload.c index efb3ac551..6fb7e0731 100644 --- a/cde/programs/dtsr/dtsrload.c +++ b/cde/programs/dtsr/dtsrload.c @@ -225,7 +225,7 @@ static void user_args_processor (int argc, char **argv) if (argc <= 1) { PRINT_USAGE: - printf (catgets (dtsearch_catd, MS_cravel, 1, + printf (CATGETS(dtsearch_catd, MS_cravel, 1, "\nUSAGE: %s -d [options] infile\n" " Listed default file name extensions can be overridden.\n" " -d 1 - 8 char database name, incl optional path prefix.\n" @@ -261,7 +261,7 @@ PRINT_USAGE: case 'd': /* (D)ictionary */ /* May include both dicname and dicpath */ if (!segregate_dicname (argptr + 2)) { - printf (catgets (dtsearch_catd, MS_cravel, 246, + printf (CATGETS(dtsearch_catd, MS_cravel, 246, "\n%s '%s' is invalid path/dictionary name.\n"), PROGNAME, argptr); goto PRINT_USAGE; @@ -286,7 +286,7 @@ PRINT_USAGE: case 'p': if ((recs_per_dot = atoi (argptr + 2)) <= 0) { recs_per_dot = RECS_PER_DOT; - printf (catgets (dtsearch_catd, MS_cravel, 582, + printf (CATGETS(dtsearch_catd, MS_cravel, 582, "%sIgnored invalid progress dot argument '%s'.\n"), PROGNAME "582 ", argptr); } @@ -300,7 +300,7 @@ PRINT_USAGE: case 'h': duprec_hashsize = atol (argptr + 2); if (duprec_hashsize == 0UL) - printf (catgets (dtsearch_catd, MS_cravel, 13, + printf (CATGETS(dtsearch_catd, MS_cravel, 13, "%s Duplicate record id checking disabled.\n"), PROGNAME); break; @@ -312,7 +312,7 @@ PRINT_USAGE: default: UNKNOWN_ARG: - printf (catgets (dtsearch_catd, MS_cravel, 14, + printf (CATGETS(dtsearch_catd, MS_cravel, 14, "\n%s Unknown command line argument '%s'.\n"), PROGNAME, argptr); } /* endswitch */ @@ -320,7 +320,7 @@ UNKNOWN_ARG: /* validate input file name */ if (argc <= 0) { - puts (catgets (dtsearch_catd, MS_cravel, 15, + puts (CATGETS(dtsearch_catd, MS_cravel, 15, "\nMissing required input file name.\a")); goto PRINT_USAGE; } @@ -329,7 +329,7 @@ UNKNOWN_ARG: /* check for missing database name */ if (dicname[0] == 0) { - puts (catgets (dtsearch_catd, MS_cravel, 16, + puts (CATGETS(dtsearch_catd, MS_cravel, 16, "\nNo database name specified (-d argument).\a")); goto PRINT_USAGE; } @@ -351,7 +351,7 @@ static void count_all_records (void) { char keybuf[DtSrMAX_DB_KEYSIZE + 4]; - printf (catgets (dtsearch_catd, MS_cravel, 17, + printf (CATGETS(dtsearch_catd, MS_cravel, 17, "%s Initializing total record count " "in database by actually counting...\n"), PROGNAME); @@ -388,7 +388,7 @@ static void read_dbrec (void) { RECFRST (PROGNAME "285", OR_DBREC, 0); /* seqtl retrieval */ if (db_status != S_OKAY) { - printf (catgets (dtsearch_catd, MS_misc, 13, + printf (CATGETS(dtsearch_catd, MS_misc, 13, "%sNo DB record in database '%s'.\n" " The usual cause is failure to initialize " "the database (run initausd).\n"), @@ -426,7 +426,7 @@ static void read_dbrec (void) /* Confirm compatible program-database version numbers */ if (!is_compatible_version (dbrec.or_version, SCHEMA_VERSION)) { - printf (catgets(dtsearch_catd, MS_misc, 14, + printf (CATGETS(dtsearch_catd, MS_misc, 14, "%s Program schema version '%s' incompatible with " "database '%s' version '%s'.\n") , PROGNAME"245", SCHEMA_VERSION, dicname, dbrec.or_version); @@ -443,7 +443,7 @@ static void read_dbrec (void) blobs_are_used = TRUE; if (!(dbrec.or_compflags & ORC_COMPBLOB)) { /* = don't compress blobs */ - printf (catgets (dtsearch_catd, MS_cravel, 717, + printf (CATGETS(dtsearch_catd, MS_cravel, 717, "%s Aborting: Uncompressed blobs not yet supported.\n"), PROGNAME"717"); DtSearchExit (5); @@ -464,7 +464,7 @@ static void read_dbrec (void) maxdba = dbrec.or_maxdba; } - printf (catgets (dtsearch_catd, MS_cravel, 18, + printf (CATGETS(dtsearch_catd, MS_cravel, 18, "%s: '%s' schema ver = %s, rec count = %ld, last slot = %ld.\n"), aa_argv0, dicname, dbrec.or_version, (long)system_reccount, (long)maxdba); @@ -500,7 +500,7 @@ static void write_dbrec (void) } if (db_status != S_OKAY) vista_abort (PROGNAME "344"); - printf (catgets (dtsearch_catd, MS_cravel, 19, + printf (CATGETS(dtsearch_catd, MS_cravel, 19, "%s: Final database record count = %ld, last slot = %ld.\n"), aa_argv0, (long)system_reccount, (long)maxdba); return; @@ -521,7 +521,7 @@ static void print_progress (void) if (bytes_in <= 0L) bytes_in = fstat_input.st_size; /* make final msg "100%" */ TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 20, + printf (CATGETS(dtsearch_catd, MS_cravel, 20, "%s: %ld input records processed in %ldm %lds, (%ld%%).\n" " %ld duplicates, %ld new, %ld updates.\n"), aa_argv0, @@ -545,7 +545,7 @@ static void print_exit_code (int exit_code) putchar ('\n'); dotcount = 0; } - printf ( catgets(dtsearch_catd, MS_cravel, 2, + printf ( CATGETS(dtsearch_catd, MS_cravel, 2, "%s: Exit code = %d\n") , aa_argv0, exit_code); fflush (aa_stderr); @@ -589,7 +589,7 @@ static int load_next_miscrec (int first_call) if ((totbytes = dbrec.or_fzkeysz + dbrec.or_abstrsz) <= 0) return FALSE; if (dbrec.or_fzkeysz > 0) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_cravel, 522, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_cravel, 522, "%s This version of %s does not support semantic databases.\n"), PROGNAME"522", aa_argv0); DtSearchExit (13); @@ -638,7 +638,7 @@ static int load_next_miscrec (int first_call) break; default: - fprintf (aa_stderr, catgets (dtsearch_catd, MS_misc, 25, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_misc, 25, "%sAbort due to program error.\n"), PROGNAME "549 "); DtSearchExit (54); @@ -877,16 +877,16 @@ int main (int argc, char *argv[]) /* Init globals */ setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); aa_argv0 = argv[0]; time (&starttime); tmptr = localtime (&starttime); starttimeobjd = tm2objdate (tmptr); strftime (linebuf, sizeof (linebuf), - catgets (dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), tmptr); - printf (catgets (dtsearch_catd, MS_misc, 23, + printf (CATGETS(dtsearch_catd, MS_misc, 23, "%s: Version %s. Run %s.\n"), aa_argv0, DtSrVERSION, @@ -919,13 +919,13 @@ int main (int argc, char *argv[]) src = getcwd (linebuf, sizeof (linebuf)); if (!src) src = getenv ("PWD"); - printf (catgets (dtsearch_catd, MS_misc, 24, + printf (CATGETS(dtsearch_catd, MS_misc, 24, "%s: cwd = '%s', fzkfile = '%s'\n"), aa_argv0, - (src) ? src : catgets (dtsearch_catd, MS_misc, 6, ""), + (src) ? src : CATGETS(dtsearch_catd, MS_misc, 6, ""), fname_input); if ((infile = fopen (fname_input, "r")) == NULL) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_misc, 12, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_misc, 12, "%sUnable to open %s:\n %s\n"), PROGNAME "326 ", fname_input, strerror (errno)); DtSearchExit (6); @@ -939,7 +939,7 @@ int main (int argc, char *argv[]) * create correctly sized buffers for them. */ if (dbrec.or_fzkeysz > 0) { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_cravel, 522, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_cravel, 522, "%s This version of %s does not support semantic databases.\n"), PROGNAME"523", aa_argv0); DtSearchExit (13); @@ -950,19 +950,19 @@ int main (int argc, char *argv[]) /* Get input file size for progress msgs */ if (fstat (fileno (infile), &fstat_input) == -1) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_cravel, 29, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_cravel, 29, "%s Unable to get status for %s: %s\n"), PROGNAME"337", fname_input, strerror (errno)); DtSearchExit (10); } if (fstat_input.st_size <= 0L) { - fprintf (aa_stderr, catgets (dtsearch_catd, MS_cravel, 30, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_cravel, 30, "%s File %s is empty.\n"), PROGNAME"343", fname_input); DtSearchExit (7); } - printf (catgets (dtsearch_catd, MS_cravel, 31, + printf (CATGETS(dtsearch_catd, MS_cravel, 31, "%s: Each dot = %d records processed.\n"), aa_argv0, recs_per_dot); @@ -1016,7 +1016,7 @@ int main (int argc, char *argv[]) if (shutdown_now) { TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_misc, 15, + printf (CATGETS(dtsearch_catd, MS_misc, 15, "%sReceived abort signal %d.\n"), PROGNAME"373 ", shutdown_now); write_dbrec (); /* at least update reccount and maxdba */ @@ -1040,7 +1040,7 @@ int main (int argc, char *argv[]) INVALID_FORMAT: normal_exitcode = EXIT_WARNING; TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 579, + printf (CATGETS(dtsearch_catd, MS_cravel, 579, "%s Discarded rec #%ld: Invalid .fzk file format.\n"), cptr, input_reccount); if (strcmp (linebuf, parg.etxdelim) != 0) @@ -1081,7 +1081,7 @@ int main (int argc, char *argv[]) if (strlen (db_key) > DtSrMAX_DB_KEYSIZE - 1) { normal_exitcode = EXIT_WARNING; TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 33, + printf (CATGETS(dtsearch_catd, MS_cravel, 33, "%s Discarded rec #%ld: Key too long:\n '%s'.\n"), PROGNAME"606", input_reccount, db_key); discard_to_ETX (&parg); @@ -1090,7 +1090,7 @@ int main (int argc, char *argv[]) if (!isalnum (db_key[0])) { normal_exitcode = EXIT_WARNING; TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 927, + printf (CATGETS(dtsearch_catd, MS_cravel, 927, "%s Discarded rec #%ld: First char (keytype) of key\n" " '%s' is not alphanumeric.\n"), PROGNAME"927", input_reccount, db_key); @@ -1102,7 +1102,7 @@ int main (int argc, char *argv[]) i = is_duprec (db_key); if (i == 2) { TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 34, + printf (CATGETS(dtsearch_catd, MS_cravel, 34, "%s Out of Memory! " "Set -h arg to a smaller number,\n" " or reduce the number of input records.\n"), @@ -1112,7 +1112,7 @@ int main (int argc, char *argv[]) else if (i == 1) { /* skip duplicate record id */ normal_exitcode = EXIT_WARNING; TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 35, + printf (CATGETS(dtsearch_catd, MS_cravel, 35, "%s: Discarded duplicate rec #%ld '%s'.\n"), aa_argv0, input_reccount, db_key); duplicate_recids++; @@ -1157,7 +1157,7 @@ int main (int argc, char *argv[]) goto INVALID_FORMAT; } TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 1086, + printf (CATGETS(dtsearch_catd, MS_cravel, 1086, "%s Record '%s' has invalid date format--" "using run date.\n"), PROGNAME"1086", uniqkey); @@ -1202,7 +1202,7 @@ int main (int argc, char *argv[]) gen_vec (fname_huffcode_tab); if (dbrec_hufid != gen_vec_hufid && dbrec_hufid != -1L) { TERMINATE_LINE - printf (catgets (dtsearch_catd, MS_cravel, 1153, + printf (CATGETS(dtsearch_catd, MS_cravel, 1153, "%s Current data compression table id" " in '%s' is %ld.\n" " Database '%s' previously compressed" @@ -1223,7 +1223,7 @@ int main (int argc, char *argv[]) if ((linebuf[0] = readchar_ftext (&parg)) == 0) { normal_exitcode = EXIT_WARNING; TERMINATE_LINE - printf ( catgets(dtsearch_catd, MS_cravel, 1215, + printf ( CATGETS(dtsearch_catd, MS_cravel, 1215, "%s Warning. Record '%s' has no text.\n"), PROGNAME"1215" , uniqkey); continue; @@ -1273,7 +1273,7 @@ int main (int argc, char *argv[]) */ if (created_reccount <= 0L && updated_reccount <= 0L) { normal_exitcode = EXIT_VANISH; - fprintf (stderr, catgets (dtsearch_catd, MS_cravel, 1048, + fprintf (stderr, CATGETS(dtsearch_catd, MS_cravel, 1048, "%sDatabase objects not changed because input " "file effectively empty.\n"), PROGNAME "1048 "); diff --git a/cde/programs/dtsr/huffcode.c b/cde/programs/dtsr/huffcode.c index 2215ba683..ea50fcab0 100644 --- a/cde/programs/dtsr/huffcode.c +++ b/cde/programs/dtsr/huffcode.c @@ -266,14 +266,14 @@ static int build_tree (void) * tree level, quit. */ if (hctree1[i].sort > MAX_BITLEN) { - fprintf (stderr, "%s", catgets(dtsearch_catd, MS_huff, 30, + fprintf (stderr, "%s", CATGETS(dtsearch_catd, MS_huff, 30, "\n183 Bit strings have grown too large. You probably " "have literals\n turned off with grossly unbalanced " "character counts.\n\7")); exit (2); } if (hctree1[curr].count >= total_count) { - fprintf (stderr, "%s", catgets(dtsearch_catd, MS_huff, 31, + fprintf (stderr, "%s", CATGETS(dtsearch_catd, MS_huff, 31, "\n191 Programming Error: Still trying to build\n" " Huffman Code Tree after root created.\n\7")); exit (2); @@ -391,7 +391,7 @@ static char *char_label (int x) return buf; } else if (x >= 128) { - snprintf(buf, sizeof(buf), "%s", catgets(dtsearch_catd, MS_huff, 32, + snprintf(buf, sizeof(buf), "%s", CATGETS(dtsearch_catd, MS_huff, 32, "(nonascii char, high bit set)")); return buf; } @@ -476,7 +476,7 @@ static void init_treebase (void) != NULL) { i = atoi (strtok (filebuf, DELIMITERS)); /* char */ if (i < 0 || i > 256) { - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 33, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 33, "366 Invalid file format for %s.\n"), filename_huf); exit (2); @@ -534,13 +534,13 @@ static void huffman_code (time_t idstamp) * Open both output files and verify they are not write protected. */ if ((outstream_huc = fopen (filename_huc, "w")) == NULL) { - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 34, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 34, "424 File '%s' failed to open for write. Is it read-only?\n"), filename_huc); exit (2); } if ((outstream_huf = fopen (filename_huf, "w")) == NULL) { - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 34, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 34, "439 File '%s' failed to open for write. Is it read-only?\n"), filename_huf); exit (2); @@ -602,7 +602,7 @@ static void huffman_code (time_t idstamp) /****************************************/ static void print_usage (void) { - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 35, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 35, "USAGE: huffcode [-lN | -l-] [-o] []\n" " -l specifies the 'literal' threshold count. Any character occurring\n" " <= times will be coded with the Huffman literal. Default is -l0,\n" @@ -663,7 +663,7 @@ static void user_args_processor (int argc, char **argv) BADARG: default: - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 36, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 36, "'%s' is invalid argument.\n"), argptr); print_usage (); exit (2); /* ABORT program */ @@ -673,7 +673,7 @@ static void user_args_processor (int argc, char **argv) /* test for required tree file name */ if (argc <= 0) { - fprintf (stderr, "%s", catgets(dtsearch_catd, MS_huff, 37, + fprintf (stderr, "%s", CATGETS(dtsearch_catd, MS_huff, 37, "576 Missing Huffman Code file names prefix.\n")); print_usage (); exit (2); @@ -695,7 +695,7 @@ static void user_args_processor (int argc, char **argv) if (!OK_to_overwrite) if ((stream = fopen (filename_huc, "r")) != NULL) { fclose (stream); - printf (catgets(dtsearch_catd, MS_huff, 38, + printf (CATGETS(dtsearch_catd, MS_huff, 38, "Decode file '%s' already exists. " "Is it OK to overwrite it? [y/n] "), filename_huc); @@ -729,8 +729,8 @@ int main (int argc, char *argv[]) time_t now, start_stamp; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); - printf (catgets(dtsearch_catd, MS_huff, 40, + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); + printf (CATGETS(dtsearch_catd, MS_huff, 40, "HUFFCODE Version %s\n"), AUSAPI_VERSION); /* validate user's command line arguments */ @@ -739,15 +739,15 @@ int main (int argc, char *argv[]) /* initialize tree table, using the table file if it exists */ init_treebase (); if (total_count == 0L) - printf ("%s", catgets(dtsearch_catd, MS_huff, 41, + printf ("%s", CATGETS(dtsearch_catd, MS_huff, 41, "Huffman Code Tables will be newly created.\n")); else - printf (catgets(dtsearch_catd, MS_huff, 42, + printf (CATGETS(dtsearch_catd, MS_huff, 42, "Table '%s' already contains %ld Kbytes from previous runs.\n"), filename_huf, total_count / 1000L); if (!input_file_specified && no_huffcode_file) { - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 43, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 43, "645 Input file not specified and '%s' table file\n" " doesn't exist--nothing to do!\n"), filename_huf); @@ -759,14 +759,14 @@ int main (int argc, char *argv[]) if (input_file_specified) { if ((instream = fopen (filename_input, "rb")) == NULL) { BAD_INPUT_FILE: - fprintf (stderr, catgets(dtsearch_catd, MS_huff, 44, + fprintf (stderr, CATGETS(dtsearch_catd, MS_huff, 44, "Could not open input file '%s' or access status: %s\n"), filename_input, strerror (errno)); exit (2); } if (fstat (fileno (instream), &fstat_input) == -1) goto BAD_INPUT_FILE; - printf (catgets(dtsearch_catd, MS_huff, 45, + printf (CATGETS(dtsearch_catd, MS_huff, 45, "Input file '%s' contains about %ld Kbytes.\n"), filename_input, fstat_input.st_size / 1000L); @@ -777,7 +777,7 @@ int main (int argc, char *argv[]) /* echo progress to user every so often */ if (!(++bytes_in % 10000L)) - printf (catgets(dtsearch_catd, MS_huff, 46, + printf (CATGETS(dtsearch_catd, MS_huff, 46, "\r%ld%% done. %2ld Kbytes read. " "Estimate %3ld seconds to completion. "), (bytes_in * 100L) / fstat_input.st_size, @@ -793,13 +793,13 @@ int main (int argc, char *argv[]) /* build huffman code tree, write out files */ time (&now); /* this will be the official tree id time * stamp */ - printf (catgets(dtsearch_catd, MS_huff, 47, + printf (CATGETS(dtsearch_catd, MS_huff, 47, "Identifying timestamp will be '%ld'.\n" "%s Huffman Code Tables in '%s' and '%s'..."), now, (no_huffcode_file) ? - catgets(dtsearch_catd, MS_huff, 48, "Creating") : - catgets(dtsearch_catd, MS_huff, 49, "Rebuilding"), + CATGETS(dtsearch_catd, MS_huff, 48, "Creating") : + CATGETS(dtsearch_catd, MS_huff, 49, "Rebuilding"), filename_huf, filename_huc); huffman_code (now); diff --git a/cde/programs/dtsr/tomita.c b/cde/programs/dtsr/tomita.c index 31c1efc98..3b96ff639 100644 --- a/cde/programs/dtsr/tomita.c +++ b/cde/programs/dtsr/tomita.c @@ -126,7 +126,7 @@ char parsed_recid [2048]; /* Called from inside DtSearchExit() at austext_exit_last */ static void print_exit_code (int exit_code) { - printf ( catgets(dtsearch_catd, MS_tomita, 3, + printf ( CATGETS(dtsearch_catd, MS_tomita, 3, "%s: Exit Code = %d.\n") , aa_argv0, exit_code); return; @@ -145,7 +145,7 @@ static void print_exit_code (int exit_code) static void kill_delete (int sig) { shutdown_now = TRUE; - printf ( catgets(dtsearch_catd, MS_tomita, 1, + printf ( CATGETS(dtsearch_catd, MS_tomita, 1, "\n%s Received interrupt %d.\n" " Program will stop after current batch of deletions.\n") , PROGNAME"069", sig); @@ -190,14 +190,14 @@ static int change_database (char *newname) /* Invalid newname. If deleting, just say which database is invalid. */ retncode = 1; - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 4, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 4, "%s Database '%s' not found.\n") , PROGNAME"114", newname); if (prog == 'D') return FALSE; /* If browsing, tell user his options */ - fprintf (aa_stderr, "%s", catgets(dtsearch_catd, MS_tomita, 5, + fprintf (aa_stderr, "%s", CATGETS(dtsearch_catd, MS_tomita, 5, "Available choices are:") ); for (db = usrblk.dblist; db != NULL; db = db->link) fprintf (aa_stderr, " '%s'", db->name); @@ -233,7 +233,7 @@ static int parse_infbuf (char *infbuf) /* Parse first token (database name) */ if ((ptr = strtok (mybuf, " \t")) == NULL) { /* Msg #8 is used in two places */ - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 8, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 8, "%s Invalid input format: %.30s...\n") , PROGNAME"152", infbuf); retncode = 1; @@ -259,7 +259,7 @@ static int parse_infbuf (char *infbuf) ptr = strtok (ptr, (*ptr == '\"') ? "\"" : " \t"); if (ptr == NULL) { /* Msg #8 is used in two places */ - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 8, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 8, "%s Invalid input format: %.30s...\n") , PROGNAME"176", infbuf); retncode = 1; @@ -306,7 +306,7 @@ static int browser (void) } /* Write main menu prompt */ - printf ( catgets(dtsearch_catd, MS_tomita, 10, + printf ( CATGETS(dtsearch_catd, MS_tomita, 10, "\n---------- SHOW NEXT RECORD ----------- Database = '%s'\n" "q QUIT. Current Record Count = %ld\n" "p Toggle PAUSE from %s.\n" @@ -352,7 +352,7 @@ static int browser (void) case 'r': if (usrblk.objrec.or_objkey[0] == 0) { fprintf (aa_stderr, - catgets(dtsearch_catd, MS_tomita, 11, + CATGETS(dtsearch_catd, MS_tomita, 11, "%s Record buffer empty.\n"), PROGNAME"267"); continue; @@ -369,7 +369,7 @@ static int browser (void) case 'n': if (inf == NULL) { fprintf (aa_stderr, - catgets(dtsearch_catd, MS_tomita, 12, + CATGETS(dtsearch_catd, MS_tomita, 12, "%s Input file unavailable.\n"), PROGNAME"282"); continue; @@ -378,7 +378,7 @@ static int browser (void) if ((fgets (infbuf, sizeof (infbuf), inf)) == NULL) { fprintf (aa_stderr, - catgets(dtsearch_catd, MS_tomita, 13, + CATGETS(dtsearch_catd, MS_tomita, 13, "%s No more records in input file.\n"), PROGNAME"288"); fclose (inf); @@ -400,7 +400,7 @@ static int browser (void) ptr = strtok (userbuf, "\""); if (ptr == NULL || *ptr == 0) { fprintf (aa_stderr, - catgets(dtsearch_catd, MS_tomita, 14, + CATGETS(dtsearch_catd, MS_tomita, 14, "%s Invalid Record ID.\n"), PROGNAME"303"); continue; @@ -417,13 +417,13 @@ static int browser (void) */ fprintf (outf, DISCARD_FORMAT, usrblk.dblk->name, usrblk.objrec.or_objkey, usrblk.userid, datestr); - printf ( catgets(dtsearch_catd, MS_tomita, 15, + printf ( CATGETS(dtsearch_catd, MS_tomita, 15, "%s '%s' appended to file of confirmed deletions.\n") , PROGNAME"317", usrblk.objrec.or_objkey); continue; default: - printf ("%s", catgets(dtsearch_catd, MS_tomita, 16, "...what?\n")); + printf ("%s", CATGETS(dtsearch_catd, MS_tomita, 16, "...what?\n")); continue; } /* end switch */ @@ -439,7 +439,7 @@ static int browser (void) * address */ if (usrblk.retncode == OE_WRAPPED) - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 17, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 17, "%s %s Engine wrapped to next record.\n") , PROGNAME"333", OE_prodname); else if (usrblk.retncode != OE_OK) @@ -453,14 +453,14 @@ static int browser (void) DISPLAY_RECORD: /* display the record's cleartext, character by character */ - printf ( catgets(dtsearch_catd, MS_tomita, 18, + printf ( CATGETS(dtsearch_catd, MS_tomita, 18, "\n\n" "Record: '%s'\n" "Abstract: '%s'\n" "--------------------------------------\n") , usrblk.objrec.or_objkey, (usrblk.abstrbufsz > 0) ? usrblk.abstrbuf : - catgets (dtsearch_catd, MS_misc, 1, "")); + CATGETS(dtsearch_catd, MS_misc, 1, "")); pause_counter = 0; for (ptr = usrblk.cleartext; *ptr != 0; ptr++) { @@ -472,7 +472,7 @@ DISPLAY_RECORD: if (pausing && *ptr == '\n') { if (++pause_counter >= PAUSE_ROWS) { /* Msg 21 is used in two places */ - printf ( "%s", catgets(dtsearch_catd, MS_tomita, 21, + printf ( "%s", CATGETS(dtsearch_catd, MS_tomita, 21, "\n...push ENTER to continue... ") ); *userbuf = '\0'; @@ -491,7 +491,7 @@ DISPLAY_RECORD: /* display the user notes if any, character by character */ if (usrblk.notes != NULL) { - printf ( catgets(dtsearch_catd, MS_tomita, 20, + printf ( CATGETS(dtsearch_catd, MS_tomita, 20, "--------------------------------------\n" "End of Text Blob for '%s':\n\n" "User Notes:\n" @@ -504,7 +504,7 @@ DISPLAY_RECORD: if (pausing && *ptr == '\n') if (++pause_counter >= PAUSE_ROWS) { /* Msg 21 is used in two places */ - printf ( "%s", catgets(dtsearch_catd, MS_tomita, 21, + printf ( "%s", CATGETS(dtsearch_catd, MS_tomita, 21, "\n...push ENTER to continue... ") ); *userbuf = '\0'; @@ -633,7 +633,7 @@ KEEP_READING: first_err = FALSE; fputc ('\n', aa_stderr); } - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 24, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 24, "%s Database %s, '%s' not found.\n") , PROGNAME"482", parsed_dbname, parsed_recid); continue; @@ -676,7 +676,7 @@ static void deleter (char *infname) char buf[128]; if (!yesarg) { - printf ( catgets(dtsearch_catd, MS_tomita, 25, + printf ( CATGETS(dtsearch_catd, MS_tomita, 25, "\nDO NOT CONTINUE under any of the following circumstances:\n" "-> If the input file which lists record ids to be deleted is not\n" " named '%s'.\n" @@ -738,7 +738,7 @@ static void deleter (char *infname) seconds = elapsed - (3600L * hours); /* remaining after hours */ minutes = seconds / 60L; seconds = seconds - (60L * minutes); - printf ( catgets(dtsearch_catd, MS_tomita, 26, + printf ( CATGETS(dtsearch_catd, MS_tomita, 26, "%s %ld read, %ld deleted, %ldh %2ldm %2lds elapsed.\n" " Database '%s': Current record count = %ld, Batch size = %d.\n") , aa_argv0, records_read, records_deleted, @@ -768,7 +768,7 @@ static void deleter (char *infname) minutes = seconds / 60L; seconds = seconds - (60L * minutes); /* remaining after hours * & mins */ - printf ( catgets(dtsearch_catd, MS_tomita, 27, + printf ( CATGETS(dtsearch_catd, MS_tomita, 27, "%s %ld records read from input file. %ld were deleted and\n" " %ld were not found in %ld hours, %ld minutes, %ld seconds,\n") , aa_argv0, records_read, records_deleted, @@ -779,7 +779,7 @@ static void deleter (char *infname) elapsed = (records_deleted) ? elapsed / records_deleted : 0L; minutes = elapsed / 60L; seconds = elapsed - (60L * minutes); - printf ( catgets(dtsearch_catd, MS_tomita, 28, + printf ( CATGETS(dtsearch_catd, MS_tomita, 28, " or an average of %ld minutes, %ld seconds per record deleted.\n"), minutes, seconds); return; @@ -799,12 +799,12 @@ int main (int argc, char *argv[]) aa_argv0 = argv[0]; setlocale (LC_ALL, ""); - dtsearch_catd = catopen (FNAME_DTSRCAT, 0); + dtsearch_catd = CATOPEN(FNAME_DTSRCAT, 0); time (&mytime); strftime (timebuf, sizeof (timebuf), - catgets(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), + CATGETS(dtsearch_catd, MS_misc, 22, "%A, %b %d %Y, %I:%M %p"), localtime (&mytime)); - printf (catgets(dtsearch_catd, MS_tomita, 29, + printf (CATGETS(dtsearch_catd, MS_tomita, 29, "%s. Run %s.\n") , aa_argv0, timebuf); austext_exit_last = print_exit_code; @@ -816,7 +816,7 @@ int main (int argc, char *argv[]) /* Validate program number argument */ if (argc < 2) { BAD_ARGS: - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 30, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 30, "\nUSAGE: %s [options]\n" " -i Input file name. If not specified, defaults to %s.\n" " -d[v] Print debug statements.\n" @@ -877,7 +877,7 @@ BAD_ARGS: break; default: - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 31, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 31, "\n%s Unknown argument '%s'.\n") , PROGNAME"689", arg); goto BAD_ARGS; @@ -891,7 +891,7 @@ BAD_ARGS: */ if ((inf = fopen (infname, "r")) == NULL) { if (prog == 'D') { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 32, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 32, "%s Unable to open input file '%s'.\n") , PROGNAME"710", infname); goto BAD_ARGS; @@ -905,7 +905,7 @@ BAD_ARGS: if ((outf = fopen (outfname, "a ")) == NULL) /* the blank in "a " works around old aix bug */ { - fprintf (aa_stderr, catgets(dtsearch_catd, MS_tomita, 33, + fprintf (aa_stderr, CATGETS(dtsearch_catd, MS_tomita, 33, "\n%s Unable to open output file '%s'.\n") , PROGNAME"721", outfname); goto BAD_ARGS; @@ -913,7 +913,7 @@ BAD_ARGS: } /* Initialize the opera engine, i.e. open the database */ - printf ( catgets(dtsearch_catd, MS_tomita, 34, + printf ( CATGETS(dtsearch_catd, MS_tomita, 34, "Initializing %s engine...\n"), OE_prodname); strcpy (usrblk.userid, "ToMiTa"); @@ -931,7 +931,7 @@ BAD_ARGS: usrblk.request = OE_SHUTDOWN; Opera_Engine (); - printf ( "%s", catgets(dtsearch_catd, MS_tomita, 36, + printf ( "%s", CATGETS(dtsearch_catd, MS_tomita, 36, "Normal engine shutdown.\n") ); DtSearchExit (0); } /* main() */ diff --git a/cde/programs/dtstyle/Main.c b/cde/programs/dtstyle/Main.c index e6a6e8e4a..9a393a435 100644 --- a/cde/programs/dtstyle/Main.c +++ b/cde/programs/dtstyle/Main.c @@ -54,7 +54,7 @@ # include #endif #ifndef NO_MESSAGE_CATALOG -# include +# include
# define TRUE 1 # define FALSE 0 #endif diff --git a/cde/programs/dtudcexch/selectx.c b/cde/programs/dtudcexch/selectx.c index 520da5e6f..6124c9c6e 100644 --- a/cde/programs/dtudcexch/selectx.c +++ b/cde/programs/dtudcexch/selectx.c @@ -35,7 +35,7 @@ #include #include /* dtex add */ #include /* dtex add */ -#include +#include
#include #include diff --git a/cde/programs/dtudcexch/selectxlfd.c b/cde/programs/dtudcexch/selectxlfd.c index cfdfa9fd1..9d16924c5 100644 --- a/cde/programs/dtudcexch/selectxlfd.c +++ b/cde/programs/dtudcexch/selectxlfd.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include
#include #include #include diff --git a/cde/programs/dtudcexch/xlfdutil.c b/cde/programs/dtudcexch/xlfdutil.c index 3c21a5657..7c76719d4 100644 --- a/cde/programs/dtudcexch/xlfdutil.c +++ b/cde/programs/dtudcexch/xlfdutil.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include
#include diff --git a/cde/programs/dtudcfonted/cpyx.c b/cde/programs/dtudcfonted/cpyx.c index 0de53a710..93ae38251 100644 --- a/cde/programs/dtudcfonted/cpyx.c +++ b/cde/programs/dtudcfonted/cpyx.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include
#include #include diff --git a/cde/programs/dtudcfonted/selectx.c b/cde/programs/dtudcfonted/selectx.c index cd86af2f8..3cac1de09 100644 --- a/cde/programs/dtudcfonted/selectx.c +++ b/cde/programs/dtudcfonted/selectx.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include
#include #include diff --git a/cde/programs/dtudcfonted/xutil.c b/cde/programs/dtudcfonted/xutil.c index b4e2e28e5..8430b88d6 100644 --- a/cde/programs/dtudcfonted/xutil.c +++ b/cde/programs/dtudcfonted/xutil.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include
#include diff --git a/cde/programs/localized/util/Imakefile b/cde/programs/localized/util/Imakefile index 72b0650e8..b34269b6a 100644 --- a/cde/programs/localized/util/Imakefile +++ b/cde/programs/localized/util/Imakefile @@ -1,10 +1,13 @@ XCOMM $XConsortium: Imakefile /main/5 1996/09/30 14:12:43 drk $ -SRCS = merge.c mkcatdefs.c +DEFINES = -DNO_XLIB + +SRCS = merge.c mkcatdefs.c MsgCat.c all:: merge mkcatdefs -NormalProgramTarget(merge,merge.o,,,) +NormalProgramTarget(merge,merge.o MsgCat.o,,,) NormalProgramTarget(mkcatdefs,mkcatdefs.o,,,) DependTarget() +LinkSourceFile(MsgCat.c,$(DTSVCSRC)/DtUtil2) diff --git a/cde/programs/localized/util/merge.c b/cde/programs/localized/util/merge.c index e51d1952f..3a1d61d7a 100644 --- a/cde/programs/localized/util/merge.c +++ b/cde/programs/localized/util/merge.c @@ -95,9 +95,10 @@ #include #include #include -#include +#include
-nl_catd catfile[2] = {NULL, NULL}; /* [0] for primary, [1] for default */ +/* [0] for primary, [1] for default */ +nl_catd catfile[2] = {(nl_catd) -1, (nl_catd) -1}; char *big_buff; char *lang = NULL; char envvar[100]; @@ -164,11 +165,8 @@ void main (int argc, char *argv []) c = get_char (); } - if ( catfile[0] ) - catclose(catfile[0]); - - if ( catfile[1] ) - catclose(catfile[1]); + CATCLOSE(catfile[0]); + CATCLOSE(catfile[1]); unlink("./.dt_pfile.cat"); unlink("./.dt_dfile.cat"); @@ -247,7 +245,7 @@ void cat_open (void) } } - catfile[0] = catopen("./.dt_pfile.cat",0); + catfile[0] = CATOPEN("./.dt_pfile.cat",0); if(dfile != NULL) { @@ -259,10 +257,10 @@ void cat_open (void) } - catfile[1] = catopen("./.dt_dfile.cat",0); + catfile[1] = CATOPEN("./.dt_dfile.cat",0); /* if all fails */ - if(catfile[0] == NULL && catfile[1] == NULL) + if((catfile[0] == (nl_catd) -1) && (catfile[1] == (nl_catd) -1)) fatal("Can't open message files.\n", 0, 9); } @@ -276,9 +274,9 @@ int find_message (int msg) { int ret = 0; - if(catfile[0] != NULL) + if(catfile[0] != (nl_catd) -1) ret = find_msg_in_file(msg, 0); - if(ret == 0 && catfile[1] != NULL) + if(ret == 0 && catfile[1] != (nl_catd) -1) ret = find_msg_in_file(msg, 1); return ret; } @@ -293,7 +291,7 @@ int find_message (int msg) */ int find_msg_in_file (int msg, int file) { - big_buff = catgets(catfile[file],1,msg,"MSG_NOT_FOUND"); + big_buff = CATGETS(catfile[file],1,msg,"MSG_NOT_FOUND"); if ( strcmp(big_buff,"MSG_NOT_FOUND") ) return(1); else diff --git a/cde/programs/util/dttypes/dttypes.c b/cde/programs/util/dttypes/dttypes.c index 164da2f5f..fa50889a2 100644 --- a/cde/programs/util/dttypes/dttypes.c +++ b/cde/programs/util/dttypes/dttypes.c @@ -46,11 +46,11 @@ static int rexp_errno = 0; #else #include #endif -#include #include
#include
#include
#include
+#include
#if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 @@ -185,7 +185,7 @@ rec_list(List *l) #endif { /* error */ - fprintf(stderr, catgets(dtcatd, 1, 36, "error in regular expression %s\n"), l->rec_name?l->rec_name:"(NULL)"); + fprintf(stderr, CATGETS(dtcatd, 1, 36, "error in regular expression %s\n"), l->rec_name?l->rec_name:"(NULL)"); exit(1); } @@ -199,7 +199,7 @@ rec_list(List *l) #endif { /* error */ - fprintf(stderr, catgets(dtcatd, 1, 36, "error in regular expression %s\n"), l->fld_name?l->fld_name:"(NULL)"); + fprintf(stderr, CATGETS(dtcatd, 1, 36, "error in regular expression %s\n"), l->fld_name?l->fld_name:"(NULL)"); exit(1); } @@ -213,7 +213,7 @@ rec_list(List *l) #endif { /* error */ - fprintf(stderr, catgets(dtcatd, 1, 36, "error in regular expression %s\n"), l->fld_value?l->fld_value:"(NULL)"); + fprintf(stderr, CATGETS(dtcatd, 1, 36, "error in regular expression %s\n"), l->fld_value?l->fld_value:"(NULL)"); exit(1); } @@ -227,7 +227,7 @@ rec_list(List *l) #endif { /* error */ - fprintf(stderr, catgets(dtcatd, 1, 36, "error in regular expression %s\n"), l->display_fld?l->display_fld:"(NULL)"); + fprintf(stderr, CATGETS(dtcatd, 1, 36, "error in regular expression %s\n"), l->display_fld?l->display_fld:"(NULL)"); exit(1); } @@ -259,14 +259,14 @@ rec_list(List *l) if((regexec(®ex_fn, fn, 0, NULL, 0) == 0) && ((fld_ptr->fieldValue==0? regexec(®ex_fv, - catgets(dtcatd, 1, 4, "NULL"), + CATGETS(dtcatd, 1, 4, "NULL"), 0, NULL, 0): regexec(®ex_fv, fv, 0, NULL, 0)) == 0)) #else if((advance(fn, expbuf_fn) != 0) && - ((fld_ptr->fieldValue==0?advance(catgets(dtcatd, 1, 4, "NULL"), expbuf_fv):advance(fv, expbuf_fv)) != 0)) + ((fld_ptr->fieldValue==0?advance(CATGETS(dtcatd, 1, 4, "NULL"), expbuf_fv):advance(fv, expbuf_fv)) != 0)) #endif { add_rec(rec, l); @@ -289,19 +289,19 @@ rec_list(List *l) (l->display_list&(1<display_list&(1<recordName?(char *)_DtDtsMMBosonToString(rec_ptr->recordName):catgets(dtcatd, 1, 6, "")); + printf(CATGETS(dtcatd, 1, 5, "=============== %s ===============\n"), + rec_ptr->recordName?(char *)_DtDtsMMBosonToString(rec_ptr->recordName):CATGETS(dtcatd, 1, 6, "")); } else if (l->display_list&(1<recordName?(char *)_DtDtsMMBosonToString(rec_ptr->recordName):catgets(dtcatd, 1, 8, "")); + printf(CATGETS(dtcatd, 1, 7, "%s\n"), + rec_ptr->recordName?(char *)_DtDtsMMBosonToString(rec_ptr->recordName):CATGETS(dtcatd, 1, 8, "")); } if(l->display_list&(1<pathId); - printf(catgets(dtcatd, 1, 9, "loaded from %s\n"), path?path:catgets(dtcatd, 1, 10, "Unknown")); + printf(CATGETS(dtcatd, 1, 9, "loaded from %s\n"), path?path:CATGETS(dtcatd, 1, 10, "Unknown")); } fld_ptr_list = _DtDtsMMGetPtr(rec_ptr->fieldList); @@ -324,12 +324,12 @@ rec_list(List *l) if(advance(fn, expbuf_df) !=0) #endif { - printf(catgets(dtcatd, 1, 11, "\t%s"), - fn?fn:catgets(dtcatd, 1, 12, "")); - printf(catgets(dtcatd, 1, 13, " :\t%s"), + printf(CATGETS(dtcatd, 1, 11, "\t%s"), + fn?fn:CATGETS(dtcatd, 1, 12, "")); + printf(CATGETS(dtcatd, 1, 13, " :\t%s"), fld_ptr->fieldValue?fv: - catgets(dtcatd, 1, 14, "")); - printf("%s", catgets(dtcatd, 1, 15, "\n")); + CATGETS(dtcatd, 1, 14, "")); + printf("%s", CATGETS(dtcatd, 1, 15, "\n")); } } @@ -337,15 +337,15 @@ rec_list(List *l) { if(l->display_list&(1<fieldName?fn:catgets(dtcatd, 1, 12, "")); + printf(CATGETS(dtcatd, 1, 11, "\t%s"), fld_ptr->fieldName?fn:CATGETS(dtcatd, 1, 12, "")); term++; } if(l->display_list&(1<fieldValue?fv:catgets(dtcatd, 1, 14, "")); + printf(CATGETS(dtcatd, 1, 13, " :\t%s"), fld_ptr->fieldValue?fv:CATGETS(dtcatd, 1, 14, "")); term++; } - if(term)printf("%s", catgets(dtcatd, 1, 15, "\n")); + if(term)printf("%s", CATGETS(dtcatd, 1, 15, "\n")); } _DtDtsMMSafeFree(fn); _DtDtsMMSafeFree(fv); @@ -378,7 +378,7 @@ parse_args(List *l, int argc, char **argv) for(i = 1; i < argc; i++) { - if(strcmp(argv[i], catgets(dtcatd, 1, 16, "-db")) == 0) + if(strcmp(argv[i], CATGETS(dtcatd, 1, 16, "-db")) == 0) { if(argv[i+1]) { @@ -393,15 +393,15 @@ parse_args(List *l, int argc, char **argv) error |= 1<display_list |= 1<display_fld = argv[++i]; } @@ -474,7 +474,7 @@ parse_args(List *l, int argc, char **argv) error |= 1<rec_name = new; l->db_name = "DATA_ATTRIBUTES"; l->display_list|= 1< Date: Sun, 31 Jan 2021 18:31:06 -0700 Subject: [PATCH 05/90] .gitignore: Add some MsgCat.c generated files --- cde/.gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cde/.gitignore b/cde/.gitignore index 18675565c..5f7da6313 100644 --- a/cde/.gitignore +++ b/cde/.gitignore @@ -2233,3 +2233,10 @@ util/scripts/xmkmf debian/cde-desktop debian/patches debian/.debhelper + +# MSGCAT changes +programs/dtdspmsg/MsgCat.c +programs/dtexec/MsgCat.c +programs/dtsr/MsgCat.c +programs/localized/util/MsgCat.c + From de23f29722aa8433eb2fc69233e5a4d1970f1333 Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Mon, 1 Feb 2021 17:06:48 -0700 Subject: [PATCH 06/90] Avoid Global Offset Table (GOT) limits by enabling -fPIC on the BSDs. config/cf/bsdLib.rules: Switch -fpic to -fPIC lib/DtXinerama/Imakefile: Use $(PICFLAGS) instead of -fpic Several tickets have been opened by users encountering the low 8KiB GOT limit on SPARC systems running BSD. This change makes CDE builds on BSD more consistent with those on Linux, where -fPIC has been the default without any reported issues. --- cde/config/cf/bsdLib.rules | 2 +- cde/lib/DtXinerama/Imakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/config/cf/bsdLib.rules b/cde/config/cf/bsdLib.rules index c55b67c62..f0351aeab 100644 --- a/cde/config/cf/bsdLib.rules +++ b/cde/config/cf/bsdLib.rules @@ -23,7 +23,7 @@ XCOMM $XConsortium: bsdLib.rules /main/3 1996/09/28 16:09:18 rws $ #define SharedLibraryLoadFlags -shared #endif #ifndef PositionIndependentCFlags -#define PositionIndependentCFlags -fpic +#define PositionIndependentCFlags -fPIC #endif /* diff --git a/cde/lib/DtXinerama/Imakefile b/cde/lib/DtXinerama/Imakefile index 3186345d1..1b3b0a25c 100644 --- a/cde/lib/DtXinerama/Imakefile +++ b/cde/lib/DtXinerama/Imakefile @@ -40,7 +40,7 @@ OBJS = DtXinerama.o INCLUDES = -I. XCOMM -fpic is required for static libDtXinerama to link with libDtSvc properly -CCOPTIONS += -fpic +CCOPTIONS += $(PICFLAGS) DependTarget() From 3685f61cfa06f1cb5674d0b187ce15eff9d31b6d Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Sat, 6 Feb 2021 12:53:58 -0700 Subject: [PATCH 07/90] Purge unused Freetype dependency from CDE config/cf/{DragonFly,OpenBSD,darwin}.cf: Remove Freetype imake settings config/cf/darwinLib.tmpl: Do not link against Freetype debian/control: Remove Freetype and Xft dependencies */Imakefile: Purge Freetype includes lib/DtWidget/ComboBoxP.h lib/DtWidget/SpinBoxP.h programs/dtfile/ChangeDirP.c programs/dtlogin/vgcallback.c Undefine USE_XFT so Motif 2.3 doesn't pull in Freetype CDE included Freetype and Xft solely to satisfy builds of Motif with Xft support enabled. However, as CDE only supports bitmap fonts, this dependency was entirely superfluous and unnecessarily broke backwards compatibility with older systems. --- cde/config/cf/DragonFly.cf | 16 ---------------- cde/config/cf/OpenBSD.cf | 1 - cde/config/cf/darwin.cf | 3 --- cde/config/cf/darwinLib.tmpl | 2 +- cde/debian/control | 4 ---- cde/lib/DtWidget/ComboBoxP.h | 1 + cde/lib/DtWidget/Imakefile | 8 -------- cde/lib/DtWidget/SpinBoxP.h | 1 + cde/programs/dtfile/ChangeDirP.c | 1 + cde/programs/dtfile/Imakefile | 8 +------- cde/programs/dtlogin/Imakefile | 9 --------- cde/programs/dtlogin/vgcallback.c | 1 + 12 files changed, 6 insertions(+), 49 deletions(-) diff --git a/cde/config/cf/DragonFly.cf b/cde/config/cf/DragonFly.cf index 25ea2d529..5f45c053c 100644 --- a/cde/config/cf/DragonFly.cf +++ b/cde/config/cf/DragonFly.cf @@ -218,16 +218,6 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion) (OSRelVersio # define ExpatDir LocalBase #endif -#ifndef HasFreetype2 -# define HasFreetype2 NO /* set this to YES once DragonFly ships FT218 */ -# define Freetype2Dir LocalBase -#endif - -#ifndef HasFontconfig -# define HasFontconfig YES -# define FontconfigDir X11Base -#endif - #ifndef HasLibpng # define HasLibpng YES # define LibpngDir LocalBase @@ -330,12 +320,6 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion) (OSRelVersio #ifndef PreloadFontSetup #define PreloadFontSetup LD_PRELOAD="`(cd $(XENVLIBDIR); echo $(XFONTPRELOADPATTERN))`" #endif -#ifndef PreloadFreetypeSetup -#define PreloadFreetypeSetup LD_PRELOAD="`(cd $(XENVLIBDIR); echo $(FT2PRELOADPATTERN))`" -#endif -#ifndef PreloadXFTSetup -#define PreloadXFTSetup LD_PRELOAD="`(cd $(XENVLIBDIR); echo $(FT2PRELOADPATTERN) $(XFTPRELOADPATTERN) $(XRENDERPRELOADPATTERN) $(FCPRELOADPATTERN))`" -#endif #endif #ifndef HasCookieMaker diff --git a/cde/config/cf/OpenBSD.cf b/cde/config/cf/OpenBSD.cf index 212f5e68a..68a79f2a0 100644 --- a/cde/config/cf/OpenBSD.cf +++ b/cde/config/cf/OpenBSD.cf @@ -1009,7 +1009,6 @@ CXXDEPENDINCLUDE != CcCmd -v -x c++ /dev/null -fsyntax-only \ # define SharedLibXdmGreet NO #endif -#define HasFreetype2 NO #define HasExpat NO #define BuildXterm BuildClients diff --git a/cde/config/cf/darwin.cf b/cde/config/cf/darwin.cf index f7514fe27..3dc456032 100644 --- a/cde/config/cf/darwin.cf +++ b/cde/config/cf/darwin.cf @@ -51,9 +51,6 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #ifndef HasGcc3 # define HasGcc3 NO #endif -#ifndef HasFreetype2 -# define HasFreetype2 NO -#endif #ifndef HasExpat # define HasExpat NO #endif diff --git a/cde/config/cf/darwinLib.tmpl b/cde/config/cf/darwinLib.tmpl index 0d3c4368f..7bedf9507 100644 --- a/cde/config/cf/darwinLib.tmpl +++ b/cde/config/cf/darwinLib.tmpl @@ -19,7 +19,7 @@ XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB) #endif #define SharedXlibi18nReqs $(LDPRELIB) $(XLIBONLY) -#define SharedXfontReqs $(LDPRELIB) $(FONTSTUBLIB) GzipLibrary $(FREETYPE2LIB) -flat_namespace +#define SharedXfontReqs $(LDPRELIB) $(FONTSTUBLIB) GzipLibrary -flat_namespace #define SharedAppleWMReqs $(LDPRELIB) $(XLIB) #define SharedFontencReqs $(LDPRELIB) GzipLibrary diff --git a/cde/debian/control b/cde/debian/control index 54b5afdca..945d81ac8 100644 --- a/cde/debian/control +++ b/cde/debian/control @@ -6,7 +6,6 @@ Build-Depends: debhelper (>= 10), automake, libxt-dev, libxmu-dev, - libxft-dev, libxinerama-dev, libxpm-dev, libmrm4, @@ -17,7 +16,6 @@ Build-Depends: debhelper (>= 10), libtirpc-dev, x11-xserver-utils, libjpeg62-dev, - libfreetype6-dev, libssl-dev, tcl-dev, ksh, @@ -38,7 +36,6 @@ Package: cde-desktop Architecture: any Depends: libxt6, libxmu6, - libxft2, libxinerama1, libxpm4, libmrm4, @@ -48,7 +45,6 @@ Depends: libxt6, libtirpc1, x11-xserver-utils, libjpeg62, - libfreetype6, libuil4, tcl, ksh, diff --git a/cde/lib/DtWidget/ComboBoxP.h b/cde/lib/DtWidget/ComboBoxP.h index 00991970e..e4bd1f311 100644 --- a/cde/lib/DtWidget/ComboBoxP.h +++ b/cde/lib/DtWidget/ComboBoxP.h @@ -62,6 +62,7 @@ express or implied warranty. #include #include #include +#undef USE_XFT #include #include #include diff --git a/cde/lib/DtWidget/Imakefile b/cde/lib/DtWidget/Imakefile index 482fd30b4..bc69a657d 100644 --- a/cde/lib/DtWidget/Imakefile +++ b/cde/lib/DtWidget/Imakefile @@ -14,15 +14,7 @@ XCOMM $XConsortium: Imakefile /main/8 1996/04/21 19:11:16 drk $ #endif DEPEND_DEFINES = $(DEPENDDEFINES) DEFINES = DtWidgetDefines -#if defined(LinuxArchitecture) -INCLUDES = -I. -I/usr/include/freetype2 -#elif defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) -INCLUDES = -I. -I$(XPROJECTROOT)/include/freetype2 -#elif defined(NetBSDArchitecture) -INCLUDES = -I. -I$(XPROJECTROOT)/include -I$(XPROJECTROOT)/include/freetype2 -#else INCLUDES = -I. -#endif #ifdef SharedDtWidgetReqs REQUIREDLIBS = SharedDtWidgetReqs diff --git a/cde/lib/DtWidget/SpinBoxP.h b/cde/lib/DtWidget/SpinBoxP.h index f7d993b01..a71b7e8ba 100644 --- a/cde/lib/DtWidget/SpinBoxP.h +++ b/cde/lib/DtWidget/SpinBoxP.h @@ -54,6 +54,7 @@ express or implied warranty. #define _SpinBoxP_h #include +#undef USE_XFT #include #include #include diff --git a/cde/programs/dtfile/ChangeDirP.c b/cde/programs/dtfile/ChangeDirP.c index cbe885e22..412749907 100644 --- a/cde/programs/dtfile/ChangeDirP.c +++ b/cde/programs/dtfile/ChangeDirP.c @@ -62,6 +62,7 @@ #include #include #include +#undef USE_XFT #include #include #include diff --git a/cde/programs/dtfile/Imakefile b/cde/programs/dtfile/Imakefile index 7e4702014..19e1023ab 100644 --- a/cde/programs/dtfile/Imakefile +++ b/cde/programs/dtfile/Imakefile @@ -37,13 +37,7 @@ EXTRA_DEFINES = -DFILE_MAP_OPTIMIZE EXTRA_CCOPTIONS = -xF #endif -#if defined(LinuxArchitecture) -EXTRA_INCLUDES = -I/usr/include/freetype2 -EXTRA_DEFINES = -DFILE_MAP_OPTIMIZE -#endif - -#if defined(BSDArchitecture) -EXTRA_INCLUDES = -I$(XPROJECTROOT)/include/freetype2 +#if defined(LinuxArchitecture) || defined(BSDArchitecture) EXTRA_DEFINES = -DFILE_MAP_OPTIMIZE #endif diff --git a/cde/programs/dtlogin/Imakefile b/cde/programs/dtlogin/Imakefile index 6725b7286..7e1249749 100644 --- a/cde/programs/dtlogin/Imakefile +++ b/cde/programs/dtlogin/Imakefile @@ -130,15 +130,6 @@ DEPXAUTHLIB = DEPXDMCPLIB = #endif -/* Add in freetype header locations, required for modern Motif libs */ -#ifdef LinuxArchitecture -INCLUDES = -I/usr/include/freetype2 -#endif - -#if defined(BSDArchitecture) -INCLUDES = -I$(XPROJECTROOT)/include/freetype2 -#endif - /************************************************************************** * * Source and object modules diff --git a/cde/programs/dtlogin/vgcallback.c b/cde/programs/dtlogin/vgcallback.c index 6f134ad66..f5f081a71 100644 --- a/cde/programs/dtlogin/vgcallback.c +++ b/cde/programs/dtlogin/vgcallback.c @@ -63,6 +63,7 @@ #include #include #include +#undef USE_XFT #include #include #include From 210a8327f2469a2cb141b7e503b6bddaf148ee27 Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Sat, 6 Feb 2021 13:15:35 -0700 Subject: [PATCH 08/90] Switch default backdrop from SkyLight to KnitLight programs/dtwm/Dtwm.defs.src: Update default Dtwm backdrop localized/*/app-defaults/Dtwm.tmsg: Update translations to reflect change For CDE users with sufficiently high resolution screens, the abrupt transition towards the end of the default SkyLight backdrop image bore a close enough resemblance to graphical corruption to spur bug reports. This problem likely did not manifest to the original CDE developers using the typical monitors of the 1990s. This patch changes the default backdrop to KnitLight, which comports well with CDE's low distraction UI while still offering something visually interesting enough to showcase CDE's support for bitmap backdrops. Because of the repeating pattern within KnitLight, this problem will not occur in the future. Additionally, SkyLight will be retained as a CDE backdrop. --- cde/programs/dtwm/Dtwm.defs.src | 4 ++-- cde/programs/localized/C/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/de_DE.UTF-8/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/el_GR.UTF-8/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/es_ES.UTF-8/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/fr_FR.UTF-8/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/it_IT.UTF-8/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/ja_JP.dt-eucJP/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/ko_KR.dt-eucKR/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/zh_CN.dt-eucCN/app-defaults/Dtwm.tmsg | 4 ++-- cde/programs/localized/zh_TW.dt-eucTW/app-defaults/Dtwm.tmsg | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cde/programs/dtwm/Dtwm.defs.src b/cde/programs/dtwm/Dtwm.defs.src index c20e6f0f4..adc127b43 100644 --- a/cde/programs/dtwm/Dtwm.defs.src +++ b/cde/programs/dtwm/Dtwm.defs.src @@ -141,8 +141,8 @@ Dtwm*ws3*title: %|nls-5-#Four#| !# !# Defaults are no image at all (the normal root background). !### -Dtwm*backdrop*image: %|nls-11-#SkyLight#| -Dtwm*ws0*backdrop*image: %|nls-12-#SkyLight#| +Dtwm*backdrop*image: %|nls-11-#KnitLight#| +Dtwm*ws0*backdrop*image: %|nls-12-#KnitLight#| Dtwm*ws1*backdrop*image: %|nls-13-#WaterDrops#| Dtwm*ws2*backdrop*image: %|nls-14-#RicePaper#| Dtwm*ws3*backdrop*image: %|nls-15-#Pebbles#| diff --git a/cde/programs/localized/C/app-defaults/Dtwm.tmsg b/cde/programs/localized/C/app-defaults/Dtwm.tmsg index 7758ee066..75f736f45 100644 --- a/cde/programs/localized/C/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/C/app-defaults/Dtwm.tmsg @@ -61,7 +61,7 @@ $ ---------------------------------------------------------------------------- $ Do not translate message 11. $ ---------------------------------------------------------------------------- $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -73,7 +73,7 @@ $ ---------------------------------------------------------------------------- $ Do not translate messages 12-15. $ ---------------------------------------------------------------------------- $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: diff --git a/cde/programs/localized/de_DE.UTF-8/app-defaults/Dtwm.tmsg b/cde/programs/localized/de_DE.UTF-8/app-defaults/Dtwm.tmsg index 8ee46023d..3472e8a3a 100644 --- a/cde/programs/localized/de_DE.UTF-8/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/de_DE.UTF-8/app-defaults/Dtwm.tmsg @@ -73,7 +73,7 @@ $ Do not translate message 11. $ ---------------------------------------------------------------------------- $ * Dtwm*backdrop*image -11 "SkyLight" +11 "KnitLight" $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -86,7 +86,7 @@ $ Do not translate messages 12-15. $ ---------------------------------------------------------------------------- $ * Dtwm*ws0*backdrop*image: -12 "SkyLight" +12 "KnitLight" $ * Dtwm*ws1*backdrop*image: 13 "WaterDrops" diff --git a/cde/programs/localized/el_GR.UTF-8/app-defaults/Dtwm.tmsg b/cde/programs/localized/el_GR.UTF-8/app-defaults/Dtwm.tmsg index 62d1d30c5..02a79c8c0 100644 --- a/cde/programs/localized/el_GR.UTF-8/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/el_GR.UTF-8/app-defaults/Dtwm.tmsg @@ -61,7 +61,7 @@ $ ---------------------------------------------------------------------------- $ Do not translate message 11. $ ---------------------------------------------------------------------------- $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -73,7 +73,7 @@ $ ---------------------------------------------------------------------------- $ Do not translate messages 12-15. $ ---------------------------------------------------------------------------- $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: diff --git a/cde/programs/localized/es_ES.UTF-8/app-defaults/Dtwm.tmsg b/cde/programs/localized/es_ES.UTF-8/app-defaults/Dtwm.tmsg index 08f6b4a5d..9291f79fa 100644 --- a/cde/programs/localized/es_ES.UTF-8/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/es_ES.UTF-8/app-defaults/Dtwm.tmsg @@ -73,7 +73,7 @@ $ Do not translate message 11. $ ---------------------------------------------------------------------------- $ * Dtwm*backdrop*image -11 "SkyLight" +11 "KnitLight" $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -86,7 +86,7 @@ $ Do not translate messages 12-15. $ ---------------------------------------------------------------------------- $ * Dtwm*ws0*backdrop*image: -12 "SkyLight" +12 "KnitLight" $ * Dtwm*ws1*backdrop*image: 13 "WaterDrops" diff --git a/cde/programs/localized/fr_FR.UTF-8/app-defaults/Dtwm.tmsg b/cde/programs/localized/fr_FR.UTF-8/app-defaults/Dtwm.tmsg index a4630983b..b33328ebe 100644 --- a/cde/programs/localized/fr_FR.UTF-8/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/fr_FR.UTF-8/app-defaults/Dtwm.tmsg @@ -73,7 +73,7 @@ $ Do not translate message 11. $ ---------------------------------------------------------------------------- $ * Dtwm*backdrop*image -11 "SkyLight" +11 "KnitLight" $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -86,7 +86,7 @@ $ Do not translate messages 12-15. $ ---------------------------------------------------------------------------- $ * Dtwm*ws0*backdrop*image: -12 "SkyLight" +12 "KnitLight" $ * Dtwm*ws1*backdrop*image: 13 "WaterDrops" diff --git a/cde/programs/localized/it_IT.UTF-8/app-defaults/Dtwm.tmsg b/cde/programs/localized/it_IT.UTF-8/app-defaults/Dtwm.tmsg index f0d7f1082..de8ab0465 100644 --- a/cde/programs/localized/it_IT.UTF-8/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/it_IT.UTF-8/app-defaults/Dtwm.tmsg @@ -61,7 +61,7 @@ $ ---------------------------------------------------------------------------- $ Do not translate message 11. $ ---------------------------------------------------------------------------- $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -73,7 +73,7 @@ $ ---------------------------------------------------------------------------- $ Do not translate messages 12-15. $ ---------------------------------------------------------------------------- $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: diff --git a/cde/programs/localized/ja_JP.dt-eucJP/app-defaults/Dtwm.tmsg b/cde/programs/localized/ja_JP.dt-eucJP/app-defaults/Dtwm.tmsg index 044c7fd79..8dafa9527 100644 --- a/cde/programs/localized/ja_JP.dt-eucJP/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/ja_JP.dt-eucJP/app-defaults/Dtwm.tmsg @@ -58,7 +58,7 @@ $ * Specify the default backdrop for all workspace. This backdrop will $ * be used unless overridden by those set in the next section. $ * $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -67,7 +67,7 @@ $ * the default value above because the resources apply to specific $ * workspaces. $ * $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: diff --git a/cde/programs/localized/ko_KR.dt-eucKR/app-defaults/Dtwm.tmsg b/cde/programs/localized/ko_KR.dt-eucKR/app-defaults/Dtwm.tmsg index 92aa237f3..9da716b28 100644 --- a/cde/programs/localized/ko_KR.dt-eucKR/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/ko_KR.dt-eucKR/app-defaults/Dtwm.tmsg @@ -62,7 +62,7 @@ $ * Specify the default backdrop for all workspace. This backdrop will $ * be used unless overridden by those set in the next section. $ * $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -71,7 +71,7 @@ $ * the default value above because the resources apply to specific $ * workspaces. $ * $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: diff --git a/cde/programs/localized/zh_CN.dt-eucCN/app-defaults/Dtwm.tmsg b/cde/programs/localized/zh_CN.dt-eucCN/app-defaults/Dtwm.tmsg index 9d418e7d4..f1369ac8d 100644 --- a/cde/programs/localized/zh_CN.dt-eucCN/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/zh_CN.dt-eucCN/app-defaults/Dtwm.tmsg @@ -58,7 +58,7 @@ $ * Specify the default backdrop for all workspace. This backdrop will $ * be used unless overridden by those set in the next section. $ * $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -67,7 +67,7 @@ $ * the default value above because the resources apply to specific $ * workspaces. $ * $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: diff --git a/cde/programs/localized/zh_TW.dt-eucTW/app-defaults/Dtwm.tmsg b/cde/programs/localized/zh_TW.dt-eucTW/app-defaults/Dtwm.tmsg index c24f70f54..de45ed1a9 100644 --- a/cde/programs/localized/zh_TW.dt-eucTW/app-defaults/Dtwm.tmsg +++ b/cde/programs/localized/zh_TW.dt-eucTW/app-defaults/Dtwm.tmsg @@ -58,7 +58,7 @@ $ * Specify the default backdrop for all workspace. This backdrop will $ * be used unless overridden by those set in the next section. $ * $ * Dtwm*backdrop*image -11 SkyLight +11 KnitLight $ * $ * $ * Specify backdrops for individual workspaces. This names backdrops @@ -67,7 +67,7 @@ $ * the default value above because the resources apply to specific $ * workspaces. $ * $ * Dtwm*ws0*backdrop*image: -12 SkyLight +12 KnitLight $ * Dtwm*ws1*backdrop*image: 13 WaterDrops $ * Dtwm*ws2*backdrop*image: From 7b2aae0911152ba79ce8a7911631a8d8f66b37f0 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Fri, 5 Feb 2021 05:02:19 +0800 Subject: [PATCH 09/90] ttsnoop: fix a segfault that occurred when clicking "Version..." in the "Snoop" menu. --- cde/programs/ttsnoop/ttsnoop_stubs.C.src | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cde/programs/ttsnoop/ttsnoop_stubs.C.src b/cde/programs/ttsnoop/ttsnoop_stubs.C.src index 0ee8414ad..8eb7b0cf1 100644 --- a/cde/programs/ttsnoop/ttsnoop_stubs.C.src +++ b/cde/programs/ttsnoop/ttsnoop_stubs.C.src @@ -1357,7 +1357,9 @@ printVersion( /*** DTB_USER_CODE_START vvv Add C code below vvv ***/ snoopStream << "ttsnoop: " << globalVersionString << endl; snoopStream << "tt_c.h: " << TT_VERSION << endl; - snoopStream << "libtt: " << _tt_lib_version << endl; + + if (_tt_lib_version) + snoopStream << "libtt: " << _tt_lib_version << endl; /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/ } From bb0b2838a5c8b8deb7f98747108c05ec8981d215 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 8 Feb 2021 05:47:05 +0800 Subject: [PATCH 10/90] dtappbuilder: apply graceful degradation for font loading to avoid a segmentation fault. --- cde/programs/dtappbuilder/src/ab/brws.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/brws.c b/cde/programs/dtappbuilder/src/ab/brws.c index 267d477cf..cbc9de320 100644 --- a/cde/programs/dtappbuilder/src/ab/brws.c +++ b/cde/programs/dtappbuilder/src/ab/brws.c @@ -1881,12 +1881,14 @@ setup_vwr_graphics( GCForeground|GCBackground|GCGraphicsExposures|GCLineWidth, &gcvalues); } - if (!ui_handle->sm_font) - { + if (!ui_handle->sm_font) ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, sm_font_name); - XSetFont(dpy, ui_handle->normal_gc, ui_handle->sm_font->fid); - XSetFont(dpy, ui_handle->select_gc, ui_handle->sm_font->fid); - } + + if (!ui_handle->sm_font) + ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, XmDEFAULT_FONT); + + XSetFont(dpy, ui_handle->normal_gc, ui_handle->sm_font->fid); + XSetFont(dpy, ui_handle->select_gc, ui_handle->sm_font->fid); } /* From a3d1e17c3281b394f049a9296947dc6d2967eb14 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 8 Feb 2021 07:23:10 +0800 Subject: [PATCH 11/90] dtappbuilder: fix a segmentation fault that occurred when clicking "Edit" in the "Revolving Property Editor". --- cde/programs/dtappbuilder/src/ab/prop_items.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/dtappbuilder/src/ab/prop_items.c b/cde/programs/dtappbuilder/src/ab/prop_items.c index 0767ecdf4..ee37a28ec 100644 --- a/cde/programs/dtappbuilder/src/ab/prop_items.c +++ b/cde/programs/dtappbuilder/src/ab/prop_items.c @@ -1536,7 +1536,7 @@ set_edit_menu_stateCB( BOOL clipboard_full = False; WidgetList menu_items; int num_menu_items; - int item_key; + XtArgVal item_key; int i; listitem_exists = (pis->current_item != NULL); From 97bfb63551b37cc461c142edfbe0c63feb2e08fa Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 8 Feb 2021 07:32:01 +0800 Subject: [PATCH 12/90] dtappbuilder: fix a segmentation fault that occurred when repeating "Add Item" -> "Delete" -> "Add Item" in the "Revolving Property Editor". --- cde/programs/dtappbuilder/src/ab/prop_items.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/prop_items.c b/cde/programs/dtappbuilder/src/ab/prop_items.c index ee37a28ec..0b84c095c 100644 --- a/cde/programs/dtappbuilder/src/ab/prop_items.c +++ b/cde/programs/dtappbuilder/src/ab/prop_items.c @@ -1026,8 +1026,8 @@ delete_selected_item( ) { ABObj current_obj; - ABObj *iobj_list, - *new_iobj_list; + ABObj *iobj_list; + ABObj *new_iobj_list = NULL; int num_items; int select_pos; int i, j; From d7445d11790453a9dcc981e63802269226d3b096 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 8 Feb 2021 07:36:53 +0800 Subject: [PATCH 13/90] dtappbuilder: fix a segmentation fault that occurred when clicking "Edit" in the "Menu Property Editor". --- cde/programs/dtappbuilder/src/ab/pal_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_menu.c b/cde/programs/dtappbuilder/src/ab/pal_menu.c index 079fec43c..ed9a2bc78 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_menu.c +++ b/cde/programs/dtappbuilder/src/ab/pal_menu.c @@ -722,7 +722,7 @@ set_edit_menu_stateCB( BOOL clipboard_full = False; WidgetList menu_items; int num_menu_items; - int value; + XtArgVal value; AB_EDIT_TYPE item_key; int i; From 431e90db13a305cebcd3c87d660948913b98ccee Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Thu, 11 Feb 2021 03:55:20 +0800 Subject: [PATCH 14/90] csa: replace sprintf with asprintf to avoid segfaults. --- cde/lib/csa/iso8601.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/cde/lib/csa/iso8601.c b/cde/lib/csa/iso8601.c index 75b8111ac..f46ac9fa1 100644 --- a/cde/lib/csa/iso8601.c +++ b/cde/lib/csa/iso8601.c @@ -164,7 +164,7 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out) { struct tm *time_str; time_t tk=tick; - char tz_orig[BUFSIZ]; + char tz_orig[BUFSIZ], *s; boolean_t orig_tzset = B_FALSE; _Xgtimeparams gmtime_buf; @@ -197,7 +197,7 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out) #endif /* !linux && !CSGRC_BASED */ /* format string forces fixed width (zero-padded) fields */ - sprintf(buf_out, "%04d%02d%02dT%02d%02d%02dZ", + asprintf(&s, "%04d%02d%02dT%02d%02d%02dZ", time_str->tm_year + 1900, time_str->tm_mon + 1, time_str->tm_mday, @@ -205,7 +205,10 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out) time_str->tm_min, time_str->tm_sec); - return (0); + strcpy(buf_out, s); + free(s); + + return (0); } /* @@ -258,7 +261,7 @@ _csa_iso8601_to_range(char *buf, time_t *start, time_t *end) int _csa_range_to_iso8601(time_t start, time_t end, char *buf) { - char tmpstr1[BUFSIZ], tmpstr2[BUFSIZ]; + char tmpstr1[BUFSIZ], tmpstr2[BUFSIZ], *s; /* validate: ticks must be +ve, and end can't precede start */ if ((start < 0) || (end < 0) || (end < start)) { @@ -272,11 +275,15 @@ _csa_range_to_iso8601(time_t start, time_t end, char *buf) return (-1); } - if (sprintf(buf, "%s/%s", tmpstr1, tmpstr2) < 0) { + if (asprintf(&s, "%s/%s", tmpstr1, tmpstr2) < 0) { + free(s); return (-1); } - else + else { + strcpy(buf, s); + free(s); return(0); + } } static int @@ -340,7 +347,11 @@ _csa_iso8601_to_duration(char *buf, time_t *sec) int _csa_duration_to_iso8601(time_t sec, char *buf) { - sprintf(buf, "%cPT%dS", (sec < 0) ? '-': '+', abs(sec)); - return(0); -} + char *s; + asprintf(&s, "%cPT%dS", (sec < 0) ? '-': '+', abs(sec)); + strcpy(buf, s); + free(s); + + return(0); +} From a27d05f788728d6e9ddfe1044078d3964a603afe Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Thu, 11 Feb 2021 21:01:41 +0800 Subject: [PATCH 15/90] dtcm: fix a segfault when "Drag Appt" in the dtcm_editor. --- cde/programs/dtcm/libDtCmP/cm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/dtcm/libDtCmP/cm_tty.c b/cde/programs/dtcm/libDtCmP/cm_tty.c index 4e20b938e..ae2401e26 100644 --- a/cde/programs/dtcm/libDtCmP/cm_tty.c +++ b/cde/programs/dtcm/libDtCmP/cm_tty.c @@ -1684,7 +1684,7 @@ attrs_to_string(CSA_attribute * attrs, int num_attrs) CSA_access_list a_ptr; char *buffer = malloc(1); char tmp_buf[MAXNAMELEN]; - int advance_time; + time_t advance_time; buffer[0] = '\0'; for (i = 0; i < num_attrs; i++) { From 49b550566730d61b7d8f03faf8821205f12be3ca Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Fri, 12 Feb 2021 18:25:25 +0800 Subject: [PATCH 16/90] dtcm: fix a segfault that occurred when opening the "Appointment List..." in the "View" menu. --- cde/programs/dtcm/dtcm/editor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cde/programs/dtcm/dtcm/editor.c b/cde/programs/dtcm/dtcm/editor.c index 0a9d7e624..193c99782 100644 --- a/cde/programs/dtcm/dtcm/editor.c +++ b/cde/programs/dtcm/dtcm/editor.c @@ -1922,6 +1922,12 @@ show_editor_view(Calendar *c, Glance glance) { Editor *e = (Editor *)c->editor; Props_pu *p = (Props_pu *)c->properties_pu; + if (get_data_version(c->cal_handle) <= CMS_VERS_2) { + backend_err_msg(c->frame, c->view->current_calendar, + CSA_E_NOT_SUPPORTED, p->xm_error_pixmap); + return; + } + if (!e->view_frame) { e->cal = c; e_build_view_popup(e); From 80f7fe773970de3c087a6518c9b48ea8c019e721 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 13 Feb 2021 02:23:01 +0800 Subject: [PATCH 17/90] dtfile: fix a segmentation fault that occurred when drag and drop file with the same name. --- cde/programs/dtfile/OverWrite.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtfile/OverWrite.c b/cde/programs/dtfile/OverWrite.c index dc73bbb3b..59fb7bbab 100644 --- a/cde/programs/dtfile/OverWrite.c +++ b/cde/programs/dtfile/OverWrite.c @@ -1153,9 +1153,14 @@ create_replace_rename_dialog(Widget parent_widget, XtFree(title); - XtFree(actions.actionList[1].label); - actions.actionList[1].label = orig_label; + + if (actions.actionList[1].label != orig_label) { + XtFree(actions.actionList[1].label); + actions.actionList[1].label = orig_label; + } + actions.actionList[1].msg_num = orig_msg_num; + return; } /* end create_replace_rename_dialog */ From 61436fbe971fe80280f22294357bb63ce9bbe43d Mon Sep 17 00:00:00 2001 From: Lev Kujawski Date: Thu, 11 Feb 2021 19:02:46 -0700 Subject: [PATCH 18/90] Specify SPARC and SPARC64 as big endian platforms config/cf/DtInfo.tmpl: Modify ByteOrderDefines define --- cde/config/cf/DtInfo.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/config/cf/DtInfo.tmpl b/cde/config/cf/DtInfo.tmpl index ecbdff458..bef360eb4 100644 --- a/cde/config/cf/DtInfo.tmpl +++ b/cde/config/cf/DtInfo.tmpl @@ -414,7 +414,7 @@ TEMPLATE_OBJS=TemplateDB//**/*.o #if defined(i386Architecture) || defined(AMD64Architecture) || defined(AlphaArchitecture) || defined(ARMArchitecture) || defined(AArch64Architecture) # define ByteOrderDefines LittleEndianDefines -#elif defined(HAL32V7Architecture) || defined(SunArchitecture) || defined(AIXArchitecture) || defined(HPArchitecture) || defined(PpcArchitecture) +#elif defined(HAL32V7Architecture) || defined(SunArchitecture) || defined(SparcArchitecture) || defined(Sparc64Architecture) || defined(AIXArchitecture) || defined(HPArchitecture) || defined(PpcArchitecture) # define ByteOrderDefines BigEndianDefines #else # define ByteOrderDefines DefaultEndianDefines From 49b92e63a7912a243d9457647ab4120af0d98cd6 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 15 Feb 2021 01:46:25 +0800 Subject: [PATCH 19/90] dtcm: Avoid to leave an unclosable window when there is no appointment in "Appointment List...". --- cde/programs/dtcm/dtcm/editor.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cde/programs/dtcm/dtcm/editor.c b/cde/programs/dtcm/dtcm/editor.c index 193c99782..23b3a6ee2 100644 --- a/cde/programs/dtcm/dtcm/editor.c +++ b/cde/programs/dtcm/dtcm/editor.c @@ -1952,15 +1952,13 @@ show_editor_view(Calendar *c, Glance glance) { XtFree(ident1); XtFree(text); XtFree(title); - XtUnmanageChild(e->view_form); - e->editor_view_is_up = False; } else { if (!editor_view_showing(e)) ds_position_popup(c->frame, e->view_frame, DS_POPUP_LOR); - XtManageChild(e->view_form); - e->editor_view_is_up = True; } + XtManageChild(e->view_form); + e->editor_view_is_up = True; /* if (e->frame) XtPopup(e->frame, XtGrabNone); */ if (e->view_frame) XtPopup(e->view_frame, XtGrabNone); } From 1fcba2048bf26b0c37dc46599f8175be3e18da71 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 15 Feb 2021 21:18:27 +0800 Subject: [PATCH 20/90] dtappbuilder: ensure the subtypes of widgets are properly initialized. --- cde/programs/dtappbuilder/src/ab/pal_create.c | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_create.c b/cde/programs/dtappbuilder/src/ab/pal_create.c index 370c9a2f3..deaf8c80a 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_create.c +++ b/cde/programs/dtappbuilder/src/ab/pal_create.c @@ -76,6 +76,11 @@ #include "dtbuilder.h" #include "palette_ui.h" +#define MAX_SUBTYPES 30 + +static int subtypes[MAX_SUBTYPES]; +static int subtype_item_cnt = 0; + const int AB_max_item_height = 64; const int AB_max_item_width = 256; @@ -181,15 +186,30 @@ pal_enable_item_drag( int subtype ) { - static int st_subtype; + int i; + XtPointer psubtype; + + for (i = 0; i < MAX_SUBTYPES; ++i) if (subtypes[i] == subtype) break; + + if (i == MAX_SUBTYPES) i = subtype_item_cnt++; + + if (i >= MAX_SUBTYPES) { + if (util_get_verbosity() > 0) + fprintf(stderr, "pal_enable_item_drag: subtype table full\n"); + + return; + } + + subtypes[i] = subtype; + + psubtype = &subtypes[i]; - st_subtype = subtype; XtInsertEventHandler(widget, ButtonPressMask, FALSE, - palitem_select_event, (XtPointer)&st_subtype, XtListHead); + palitem_select_event, psubtype, XtListHead); XtInsertEventHandler(widget, ButtonReleaseMask, FALSE, - palitem_release_event, (XtPointer)&st_subtype, XtListHead); + palitem_release_event, psubtype, XtListHead); XtAddEventHandler(widget, EnterWindowMask|LeaveWindowMask, FALSE, - palitem_update_type, (XtPointer)&st_subtype); + palitem_update_type, psubtype); /* We need to keep track of the main palette widget * for drag-behavior purposes From 64cfdf321354639a06326fcf730cf4170f50ed2e Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Tue, 16 Feb 2021 17:40:05 +0800 Subject: [PATCH 21/90] dtappbuilder: ensure mouse operations are not interfering by key masks (e.g., Caps Lock, Num Lock, etc.) when editing (resize, double-click, etc.) widgets. --- cde/programs/dtappbuilder/src/ab/abobj_events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_events.c b/cde/programs/dtappbuilder/src/ab/abobj_events.c index 39699c117..3bbd5326c 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_events.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_events.c @@ -1000,7 +1000,7 @@ object_button_press( { bevent = (XButtonEvent*)event; - if (bevent->state == 0 && + if ((bevent->state & ShiftMask) == 0 && (bevent->button == 1 || (AB_btn1_transfer != True && bevent->button == 2))) /* MOVE, RESIZE or RUBBERBAND-SELECT */ @@ -1137,8 +1137,9 @@ interpose_button_event( d_click->waiting = False; object_invoke_props(widget, event, NULL, 0); } - else if (bevent->state == 0) /* Start timing for double-click */ + else if ((bevent->state & ControlMask) == 0) { + /* Start timing for double-click */ event_cpy = *event; d_click->waiting = True; d_click->widget = widget; From 0cdf0f774f03fe79819420d9f42b3a76bd679c25 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 01:52:47 +0800 Subject: [PATCH 22/90] dtappbuilder: adjust data types to avoid type casting errors. --- cde/programs/dtappbuilder/src/ab/prop.c | 8 ++++---- cde/programs/dtappbuilder/src/ab/prop.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/prop.c b/cde/programs/dtappbuilder/src/ab/prop.c index 86ec99555..52eeef1a3 100644 --- a/cde/programs/dtappbuilder/src/ab/prop.c +++ b/cde/programs/dtappbuilder/src/ab/prop.c @@ -678,7 +678,7 @@ prop_checkbox_init( Widget checkbox, int num_items, WidgetList items, - int *item_keys, + XtArgVal *item_keys, Widget changebar ) { @@ -693,7 +693,7 @@ prop_checkbox_init( for (i=0; i < num_items; i++) { - XtVaSetValues(items[i], XmNuserData, (XtArgVal)item_keys[i], NULL); + XtVaSetValues(items[i], XmNuserData, item_keys[i], NULL); XtAddCallback(items[i], XmNvalueChangedCallback, propP_setting_chgCB, (XtPointer)changebar); } @@ -1060,7 +1060,7 @@ prop_footer_init( Widget checkbox, int num_items, WidgetList items, - int *item_keys, + XtArgVal *item_keys, Widget field, Widget changebar ) @@ -1082,7 +1082,7 @@ prop_footer_init( for (i=0; i < num_items; i++) { - XtVaSetValues(items[i], XmNuserData, (XtArgVal)item_keys[i], NULL); + XtVaSetValues(items[i], XmNuserData, item_keys[i], NULL); XtAddCallback(items[i], XmNvalueChangedCallback, propP_setting_chgCB, (XtPointer)changebar); } diff --git a/cde/programs/dtappbuilder/src/ab/prop.h b/cde/programs/dtappbuilder/src/ab/prop.h index e237d1388..80084ef29 100644 --- a/cde/programs/dtappbuilder/src/ab/prop.h +++ b/cde/programs/dtappbuilder/src/ab/prop.h @@ -292,7 +292,7 @@ extern void prop_checkbox_init( Widget checkbox, int num_items, WidgetList items, - int *item_keys, + XtArgVal *item_keys, Widget changebar ); extern BOOL prop_checkbox_get_value( @@ -391,7 +391,7 @@ extern void prop_footer_init( Widget checkbox, int num_items, WidgetList items, - int *item_keys, + XtArgVal *item_keys, Widget field, Widget changebar ); From 73cab7551102656671f6a9a8493b67c6399ac494 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 01:59:40 +0800 Subject: [PATCH 23/90] dtappbuilder: fix issues of property settings for text pane. --- cde/programs/dtappbuilder/src/ab/pal_textp.c | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_textp.c b/cde/programs/dtappbuilder/src/ab/pal_textp.c index dd22530da..993674fcf 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_textp.c +++ b/cde/programs/dtappbuilder/src/ab/pal_textp.c @@ -198,7 +198,8 @@ textp_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropTextpSettingsRec *pts = &(prop_textp_settings_rec[type]); Widget item[10]; - int item_val[10]; + XtArgVal item_val[10]; + XtPointer item_ptr[10]; int n; if (type == AB_PROP_REVOLVING) @@ -268,38 +269,38 @@ textp_prop_init( /* Scrolling */ n = 0; item[n] = cgen->scroll_rbox_items.Never_item; - item_val[n] = AB_SCROLLBAR_NEVER; n++; + item_ptr[n] = AB_SCROLLBAR_NEVER; n++; item[n] = cgen->scroll_rbox_items.Always_item; - item_val[n] = AB_SCROLLBAR_ALWAYS; n++; + item_ptr[n] = AB_SCROLLBAR_ALWAYS; n++; prop_radiobox_init(&(pts->scrolling), cgen->scroll_rbox_label, - cgen->scroll_rbox, n, item, (XtPointer*)item_val, + cgen->scroll_rbox, n, item, item_ptr, cgen->scroll_cb); /* Border Frame */ n = 0; item[n] = cgen->bframe_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->bframe_opmenu_items.Shadow_Out_item; - item_val[n] = AB_LINE_SHADOW_OUT; n++; + item_ptr[n] = AB_LINE_SHADOW_OUT; n++; item[n] = cgen->bframe_opmenu_items.Shadow_In_item; - item_val[n] = AB_LINE_SHADOW_IN; n++; + item_ptr[n] = AB_LINE_SHADOW_IN; n++; item[n] = cgen->bframe_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->bframe_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; prop_options_init(&(pts->frame), cgen->bframe_opmenu_label, cgen->bframe_opmenu, cgen->bframe_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->bframe_cb); /* Operation */ n = 0; item[n] = cgen->op_rbox_items.Editable_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; item[n] = cgen->op_rbox_items.Read_Only_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; prop_radiobox_init(&(pts->op), cgen->op_rbox_label, - cgen->op_rbox, n, item, (XtPointer*)item_val, + cgen->op_rbox, n, item, item_ptr, cgen->op_cb); /* Wrap */ @@ -341,13 +342,13 @@ textp_prop_init( n = 0; item[n] = cgen->size_opmenu_items.Characters_item; - item_val[n] = SIZE_IN_CHARS_KEY; n++; + item_ptr[n] = SIZE_IN_CHARS_KEY; n++; item[n] = cgen->size_opmenu_items.Pixels_item; - item_val[n] = SIZE_IN_PIXELS_KEY; n++; + item_ptr[n] = SIZE_IN_PIXELS_KEY; n++; prop_options_init(&(pts->size_metric), cgen->size_opmenu_label, cgen->size_opmenu, cgen->size_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->size_cb); /* Initial State */ From a90c07f0276d38a35431c418028b8c633cc2a14a Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 06:19:02 +0800 Subject: [PATCH 24/90] dtappbuilder: adjust data types to avoid type casting errors. --- cde/programs/dtappbuilder/src/ab/prop.h | 8 ++++---- cde/programs/dtappbuilder/src/ab/prop_items.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/prop.h b/cde/programs/dtappbuilder/src/ab/prop.h index 80084ef29..b0a67143c 100644 --- a/cde/programs/dtappbuilder/src/ab/prop.h +++ b/cde/programs/dtappbuilder/src/ab/prop.h @@ -404,12 +404,12 @@ extern void prop_item_editor_init( Widget list, Widget changebar, Widget add_button, - int insert_count, - WidgetList insert_items, - int *insert_enums, + int add_count, + WidgetList add_items, + XtArgVal *add_enum, int edit_count, WidgetList edit_items, - int *edit_enums, + XtArgVal *edit_enums, PropFieldSetting label_pfs, PropOptionsSetting label_type_pos, Widget label_graphic_hint, diff --git a/cde/programs/dtappbuilder/src/ab/prop_items.c b/cde/programs/dtappbuilder/src/ab/prop_items.c index 0b84c095c..a5f63b5c1 100644 --- a/cde/programs/dtappbuilder/src/ab/prop_items.c +++ b/cde/programs/dtappbuilder/src/ab/prop_items.c @@ -226,10 +226,10 @@ prop_item_editor_init( Widget add_button, int add_count, WidgetList add_item, - int *add_enum, + XtArgVal *add_enum, int edit_count, WidgetList edit_item, - int *edit_enum, + XtArgVal *edit_enum, PropFieldSetting label_pfs, PropOptionsSetting label_type_pos, Widget label_graphic_hint, @@ -289,13 +289,13 @@ prop_item_editor_init( /* Set Up Edit MenuButton */ for(i = 0; i < add_count; i++) { - XtVaSetValues(add_item[i], XmNuserData, (XtArgVal)add_enum[i], NULL); + XtVaSetValues(add_item[i], XmNuserData, add_enum[i], NULL); XtAddCallback(add_item[i], XmNactivateCallback, add_itemCB, (XtPointer)pis); } for(i=0; i < edit_count; i++) { - XtVaSetValues(edit_item[i], XmNuserData, (XtArgVal)edit_enum[i], NULL); + XtVaSetValues(edit_item[i], XmNuserData, edit_enum[i], NULL); XtAddCallback(edit_item[i], XmNactivateCallback, edit_itemCB, (XtPointer)pis); } From a9d7c58bd6e0ac88d565ce8b9ebe342d64ca67d7 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 06:38:27 +0800 Subject: [PATCH 25/90] dtappbuilder: fix issues of property settings for list. --- cde/programs/dtappbuilder/src/ab/pal_list.c | 43 +++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_list.c b/cde/programs/dtappbuilder/src/ab/pal_list.c index ba31ef723..754b5766a 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_list.c +++ b/cde/programs/dtappbuilder/src/ab/pal_list.c @@ -189,8 +189,8 @@ list_initialize( obj_set_unique_name(obj, "list"); - obj_set_num_rows(obj, 4); - obj_set_height(obj, -1); + obj_set_num_rows(obj, -1); + obj_set_height(obj, 100); obj_set_width(obj, list_init_width); obj_set_selection_mode(obj, AB_SELECT_BROWSE); obj_set_is_initially_visible(obj, True); @@ -227,9 +227,10 @@ list_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropListSettingsRec *pls = &(prop_list_settings_rec[type]); Widget item[8]; - int item_val[8]; + XtArgVal item_val[8]; + XtPointer item_ptr[8]; Widget item2[8]; - int item2_val[8]; + XtArgVal item2_val[8]; int n, j; int i; @@ -305,12 +306,12 @@ list_prop_init( /* Label, Type, Position */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pls->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); prop_field_init(&(pls->label), cgen->label_field_label, @@ -320,27 +321,27 @@ list_prop_init( n = 0; item[n] = cgen->labelpos_rbox_items.Above_item; - item_val[n] = AB_CP_NORTH; n++; + item_ptr[n] = AB_CP_NORTH; n++; item[n] = cgen->labelpos_rbox_items.Left_item; - item_val[n] = AB_CP_WEST; n++; + item_ptr[n] = AB_CP_WEST; n++; prop_options_init(&(pls->label_pos), cgen->labelpos_rbox_label, cgen->labelpos_rbox, cgen->labelpos_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); /* Selection Mode */ n = 0; item[n] = cgen->selmode_rbox_items.Single_Select_item; - item_val[n] = AB_SELECT_SINGLE; n++; + item_ptr[n] = AB_SELECT_SINGLE; n++; item[n] = cgen->selmode_rbox_items.Browse_Select_item; - item_val[n] = AB_SELECT_BROWSE; n++; + item_ptr[n] = AB_SELECT_BROWSE; n++; item[n] = cgen->selmode_rbox_items.Multiple_Select_item; - item_val[n] = AB_SELECT_MULTIPLE; n++; + item_ptr[n] = AB_SELECT_MULTIPLE; n++; item[n] = cgen->selmode_rbox_items.Browse_Multiple_Select_item; - item_val[n] = AB_SELECT_BROWSE_MULTIPLE; n++; + item_ptr[n] = AB_SELECT_BROWSE_MULTIPLE; n++; prop_options_init(&(pls->sel_mode), cgen->selmode_rbox_label, cgen->selmode_rbox, cgen->selmode_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->selmode_cb); /* Position */ @@ -353,11 +354,11 @@ list_prop_init( /* Width */ n = 0; item[n] = cgen->wpolicy_rbox_items.Longest_Item_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->wpolicy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pls->wth_policy), cgen->wpolicy_rbox_label, - cgen->wpolicy_rbox, n, item, (XtPointer*)item_val, + cgen->wpolicy_rbox, n, item, item_ptr, cgen->wpolicy_cb); for(i=0; i < n; i++) @@ -379,13 +380,13 @@ list_prop_init( n = 0; item[n] = cgen->hgt_opmenu_items.Lines_item; - item_val[n] = SIZE_IN_CHARS_KEY; n++; + item_ptr[n] = SIZE_IN_CHARS_KEY; n++; item[n] = cgen->hgt_opmenu_items.Pixels_item; - item_val[n] = SIZE_IN_PIXELS_KEY; n++; + item_ptr[n] = SIZE_IN_PIXELS_KEY; n++; prop_options_init(&(pls->hgt_metric), cgen->hgt_opmenu_label, cgen->hgt_opmenu, cgen->hgt_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->hgt_cb); /* Initial State */ From 473bb74440de2cbe7b25851d019bbe31949e544a Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 07:24:03 +0800 Subject: [PATCH 26/90] dtappbuilder: fix issues of property settings for button. --- cde/programs/dtappbuilder/src/ab/pal_button.c | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_button.c b/cde/programs/dtappbuilder/src/ab/pal_button.c index 369b4965a..f0ea4c8d6 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_button.c +++ b/cde/programs/dtappbuilder/src/ab/pal_button.c @@ -218,7 +218,8 @@ button_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropButtonSettingsRec *pbs = &(prop_button_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; int n; int i; @@ -292,13 +293,13 @@ button_prop_init( /* Button Type */ n = 0; item[n] = cgen->buttontype_rbox_items.Push_item; - item_val[n] = AB_BUT_PUSH; n++; + item_ptr[n] = AB_BUT_PUSH; n++; item[n] = cgen->buttontype_rbox_items.Drawn_item; - item_val[n] = AB_BUT_DRAWN; n++; + item_ptr[n] = AB_BUT_DRAWN; n++; item[n] = cgen->buttontype_rbox_items.Menu_item; - item_val[n] = AB_BUT_MENU; n++; + item_ptr[n] = AB_BUT_MENU; n++; prop_radiobox_init(&(pbs->button_type), cgen->buttontype_rbox_label, - cgen->buttontype_rbox, n, item, (XtPointer*)item_val, + cgen->buttontype_rbox, n, item, item_ptr, cgen->buttontype_cb); for(i=0; i < n; i++) XtAddCallback(item[i], XmNvalueChangedCallback, @@ -307,14 +308,14 @@ button_prop_init( /* Label Type */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; item[n] = cgen->labeltype_rbox_items.Arrow_item; - item_val[n] = AB_LABEL_ARROW_DOWN; n++; + item_ptr[n] = AB_LABEL_ARROW_DOWN; n++; prop_options_init(&(pbs->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); for(i=0; i < n; i++) XtAddCallback(item[i], XmNactivateCallback, @@ -344,29 +345,29 @@ button_prop_init( /* Label Align */ n = 0; item[n] = cgen->labelalign_opmenu_items.Left_item; - item_val[n] = AB_ALIGN_LEFT; n++; + item_ptr[n] = AB_ALIGN_LEFT; n++; item[n] = cgen->labelalign_opmenu_items.Centered_item; - item_val[n] = AB_ALIGN_CENTER; n++; + item_ptr[n] = AB_ALIGN_CENTER; n++; item[n] = cgen->labelalign_opmenu_items.Right_item; - item_val[n] = AB_ALIGN_RIGHT; n++; + item_ptr[n] = AB_ALIGN_RIGHT; n++; prop_options_init(&(pbs->label_align), cgen->labelalign_opmenu_label, cgen->labelalign_opmenu, cgen->labelalign_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labelalign_cb); /* Arrow Direction */ n = 0; item[n] = cgen->arrowdir_opmenu_items.Up_item; - item_val[n] = AB_LABEL_ARROW_UP; n++; + item_ptr[n] = AB_LABEL_ARROW_UP; n++; item[n] = cgen->arrowdir_opmenu_items.Down_item; - item_val[n] = AB_LABEL_ARROW_DOWN; n++; + item_ptr[n] = AB_LABEL_ARROW_DOWN; n++; item[n] = cgen->arrowdir_opmenu_items.Right_item; - item_val[n] = AB_LABEL_ARROW_RIGHT; n++; + item_ptr[n] = AB_LABEL_ARROW_RIGHT; n++; item[n] = cgen->arrowdir_opmenu_items.Left_item; - item_val[n] = AB_LABEL_ARROW_LEFT; n++; + item_ptr[n] = AB_LABEL_ARROW_LEFT; n++; prop_options_init(&(pbs->arrow_dir), cgen->arrowdir_opmenu_label, cgen->arrowdir_opmenu, cgen->arrowdir_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->arrowdir_cb); /* Menu Name Setting */ @@ -378,11 +379,11 @@ button_prop_init( /* Size Policy */ n = 0; item[n] = cgen->sizepolicy_rbox_items.Size_of_Label_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->sizepolicy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pbs->size_policy), cgen->sizepolicy_rbox_label, - cgen->sizepolicy_rbox, n, item, (XtPointer*)item_val, + cgen->sizepolicy_rbox, n, item, item_ptr, cgen->sizepolicy_cb); for(i=0; i < n; i++) From 4cbb0506dc5ef0b8b236e6a4e46a78213c2b8e53 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 07:42:04 +0800 Subject: [PATCH 27/90] dtappbuilder: fix issues of property settings for choice. --- cde/programs/dtappbuilder/src/ab/pal_choice.c | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_choice.c b/cde/programs/dtappbuilder/src/ab/pal_choice.c index 6bb6dd69d..c6f40babf 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_choice.c +++ b/cde/programs/dtappbuilder/src/ab/pal_choice.c @@ -264,9 +264,10 @@ choice_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropChoiceSettingsRec *pcs = &(prop_choice_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; Widget item2[6]; - int item2_val[6]; + XtArgVal item2_val[6]; int n, j; int i; @@ -341,12 +342,12 @@ choice_prop_init( /* Label, Type, Position */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pcs->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, cgen->labeltype_cb); + n, item, item_ptr, cgen->labeltype_cb); prop_field_init(&(pcs->label), cgen->label_field_label, cgen->label_field, cgen->label_cb); @@ -355,25 +356,25 @@ choice_prop_init( n = 0; item[n] = cgen->labelpos_rbox_items.Above_item; - item_val[n] = AB_CP_NORTH; n++; + item_ptr[n] = AB_CP_NORTH; n++; item[n] = cgen->labelpos_rbox_items.Left_item; - item_val[n] = AB_CP_WEST; n++; + item_ptr[n] = AB_CP_WEST; n++; prop_options_init(&(pcs->label_pos), cgen->labelpos_rbox_label, cgen->labelpos_rbox, cgen->labelpos_rbox_menu, - n, item, (XtPointer*)item_val, cgen->labeltype_cb); + n, item, item_ptr, cgen->labeltype_cb); /* Choice Type */ n = 0; item[n] = cgen->choicetype_rbox_items.Radio_Box_item; - item_val[n] = AB_CHOICE_EXCLUSIVE; n++; + item_ptr[n] = AB_CHOICE_EXCLUSIVE; n++; item[n] = cgen->choicetype_rbox_items.Check_Box_item; - item_val[n] = AB_CHOICE_NONEXCLUSIVE; n++; + item_ptr[n] = AB_CHOICE_NONEXCLUSIVE; n++; item[n] = cgen->choicetype_rbox_items.Option_Menu_item; - item_val[n] = AB_CHOICE_OPTION_MENU; n++; + item_ptr[n] = AB_CHOICE_OPTION_MENU; n++; prop_options_init(&(pcs->choice_type), cgen->choicetype_rbox_label, cgen->choicetype_rbox, cgen->choicetype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->choicetype_cb); for (i=0; i < n; i++) @@ -382,12 +383,12 @@ choice_prop_init( /* Rows/Columns */ n = 0; item[n] = cgen->layout_rbox_items.Columns_item; - item_val[n] = AB_ORIENT_VERTICAL; n++; + item_ptr[n] = AB_ORIENT_VERTICAL; n++; item[n] = cgen->layout_rbox_items.Rows_item; - item_val[n] = AB_ORIENT_HORIZONTAL; n++; + item_ptr[n] = AB_ORIENT_HORIZONTAL; n++; prop_radiobox_init(&(pcs->row_col), cgen->layout_rbox_label, cgen->layout_rbox, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->layout_cb); prop_field_init(&(pcs->row_col_count), NULL, @@ -426,12 +427,12 @@ choice_prop_init( /* Item Label Type */ n = 0; item[n] = cgen->itemlabel_opmenu_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->itemlabel_opmenu_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pcs->item_label_type), cgen->itemlabel_type_label, cgen->itemlabel_opmenu, cgen->itemlabel_opmenu_menu, - n, item, (XtPointer*)item_val, cgen->itemlist_cb); + n, item, item_ptr, cgen->itemlist_cb); for(i=0; i < n; i++) XtAddCallback(item[i], XmNactivateCallback, From feb4d1b49542b429ff97f705cd33b360e6d637af Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 07:54:41 +0800 Subject: [PATCH 28/90] dtappbuilder: fix issues of property settings for combo box. --- .../dtappbuilder/src/ab/pal_combobox.c | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_combobox.c b/cde/programs/dtappbuilder/src/ab/pal_combobox.c index 8900ce812..2236ae58c 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_combobox.c +++ b/cde/programs/dtappbuilder/src/ab/pal_combobox.c @@ -216,9 +216,10 @@ combo_box_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropComboboxSettingsRec *pcs = &(prop_combobox_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; Widget item2[6]; - int item2_val[6]; + XtArgVal item2_val[6]; int i, n, j; if (type == AB_PROP_REVOLVING) @@ -293,12 +294,12 @@ combo_box_prop_init( /* Label, Type, Position */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pcs->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); prop_field_init(&(pcs->label), cgen->label_field_label, @@ -308,22 +309,22 @@ combo_box_prop_init( n = 0; item[n] = cgen->labelpos_rbox_items.Above_item; - item_val[n] = AB_CP_NORTH; n++; + item_ptr[n] = AB_CP_NORTH; n++; item[n] = cgen->labelpos_rbox_items.Left_item; - item_val[n] = AB_CP_WEST; n++; + item_ptr[n] = AB_CP_WEST; n++; prop_options_init(&(pcs->label_pos), cgen->labelpos_rbox_label, cgen->labelpos_rbox, cgen->labelpos_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); /* Read Only */ n = 0; item[n] = cgen->comboboxtype_rbox_items.Static_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; item[n] = cgen->comboboxtype_rbox_items.Editable_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; prop_radiobox_init(&(pcs->combobox_type), cgen->comboboxtype_rbox_label, - cgen->comboboxtype_rbox, n, item, (XtPointer*)item_val, + cgen->comboboxtype_rbox, n, item, item_ptr, cgen->comboboxtype_cb); /* Position */ @@ -337,11 +338,11 @@ combo_box_prop_init( /* Width */ n = 0; item[n] = cgen->wpolicy_rbox_items.Longest_Item_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->wpolicy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pcs->wth_policy), cgen->wpolicy_rbox_label, - cgen->wpolicy_rbox, n, item, (XtPointer*)item_val, + cgen->wpolicy_rbox, n, item, item_ptr, cgen->wpolicy_cb); for(i=0; i < n; i++) From 0d92904b0605b9f83987757213a73a33318b68b4 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 08:08:16 +0800 Subject: [PATCH 29/90] dtappbuilder: fix issues of property settings for control pane. --- cde/programs/dtappbuilder/src/ab/pal_cpanel.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_cpanel.c b/cde/programs/dtappbuilder/src/ab/pal_cpanel.c index 011b39b6c..d8930fd1b 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_cpanel.c +++ b/cde/programs/dtappbuilder/src/ab/pal_cpanel.c @@ -210,7 +210,8 @@ cpanel_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropCPanelSettingsRec *pcs = &(prop_cpanel_settings_rec[type]); Widget item[10]; - int item_val[10]; + XtArgVal item_val[10]; + XtPointer item_ptr[10]; int i, n; if (type == AB_PROP_REVOLVING) @@ -279,18 +280,18 @@ cpanel_prop_init( /* Border Frame Setting */ n = 0; item[n] = cgen->bframe_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->bframe_opmenu_items.Shadow_Out_item; - item_val[n] = AB_LINE_SHADOW_OUT; n++; + item_ptr[n] = AB_LINE_SHADOW_OUT; n++; item[n] = cgen->bframe_opmenu_items.Shadow_In_item; - item_val[n] = AB_LINE_SHADOW_IN; n++; + item_ptr[n] = AB_LINE_SHADOW_IN; n++; item[n] = cgen->bframe_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->bframe_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; prop_options_init(&(pcs->frame), cgen->bframe_opmenu_label, cgen->bframe_opmenu, cgen->bframe_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->bframe_cb); /* Menu Title */ @@ -307,11 +308,11 @@ cpanel_prop_init( /* Size Policy */ n = 0; item[n] = cgen->size_policy_rbox_items.Fit_Contents_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->size_policy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pcs->size_policy), cgen->size_policy_rbox_label, - cgen->size_policy_rbox, n, item, (XtPointer*)item_val, + cgen->size_policy_rbox, n, item, item_ptr, cgen->size_policy_cb); for(i=0; i < n; i++) From 213ae1f8d7fc6bcb664d836cc826edae0fa23989 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 08:20:51 +0800 Subject: [PATCH 30/90] dtappbuilder: fix issues of property settings for custom dialog. --- .../dtappbuilder/src/ab/pal_custdlg.c | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_custdlg.c b/cde/programs/dtappbuilder/src/ab/pal_custdlg.c index 70c34cd8c..113b61915 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_custdlg.c +++ b/cde/programs/dtappbuilder/src/ab/pal_custdlg.c @@ -231,7 +231,8 @@ custdlg_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropCustdlgSettingsRec *pcs = &(prop_custdlg_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; int i, n; if (type == AB_PROP_REVOLVING) @@ -301,10 +302,10 @@ custdlg_prop_init( /* Window Parent */ n = 0; item[n] = cgen->winparent_opmenu_items.None_item; - item_val[n] = 0; n++; + item_ptr[n] = 0; n++; prop_obj_options_init(&(pcs->win_parent), cgen->winparent_opmenu_label, cgen->winparent_opmenu, cgen->winparent_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->winparent_cb, True, /* Display module */ &(pcs->current_obj), winparent_test_func); @@ -315,11 +316,11 @@ custdlg_prop_init( /* Resize Mode */ n = 0; item[n] = cgen->resizemode_rbox_items.Adjustable_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; item[n] = cgen->resizemode_rbox_items.Fixed_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; prop_radiobox_init(&(pcs->resize_mode), cgen->resizemode_rbox_label, - cgen->resizemode_rbox, n, item, (XtPointer*)item_val, + cgen->resizemode_rbox, n, item, item_ptr, cgen->resizemode_cb); /* Window Areas */ @@ -336,31 +337,31 @@ custdlg_prop_init( /* Default Button */ n = 0; item[n] = cgen->defaultb_opmenu_items.None_item; - item_val[n] = 0; n++; + item_ptr[n] = 0; n++; prop_obj_options_init(&(pcs->default_but), cgen->defaultb_opmenu_label, cgen->defaultb_opmenu, cgen->defaultb_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->default_button_cb, False, /* don't display module */ &(pcs->current_obj), button_test_func); /* Help Button */ n = 0; item[n] = cgen->helpb_opmenu_items.None_item; - item_val[n] = 0; n++; + item_ptr[n] = 0; n++; prop_obj_options_init(&(pcs->help_but), cgen->helpb_opmenu_label, cgen->helpb_opmenu, cgen->helpb_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->help_button_cb, False, /* don't display module */ &(pcs->current_obj), button_test_func); /* Size Policy */ n = 0; item[n] = cgen->size_policy_rbox_items.Fit_Contents_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->size_policy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pcs->size_policy), cgen->size_policy_rbox_label, - cgen->size_policy_rbox, n, item, (XtPointer*)item_val, + cgen->size_policy_rbox, n, item, item_ptr, cgen->size_policy_cb); for(i=0; i < n; i++) From d22ec65675e8f14bfe51925708654d425687d443 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 08:37:03 +0800 Subject: [PATCH 31/90] dtappbuilder: fix issues of property settings for draw area pane. --- cde/programs/dtappbuilder/src/ab/pal_drawp.c | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_drawp.c b/cde/programs/dtappbuilder/src/ab/pal_drawp.c index 3159e5acf..6e5798571 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_drawp.c +++ b/cde/programs/dtappbuilder/src/ab/pal_drawp.c @@ -201,7 +201,8 @@ drawp_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropDrawpSettingsRec *pds = &(prop_drawp_settings_rec[type]); Widget item[10]; - int item_val[10]; + XtArgVal item_val[10]; + XtPointer item_ptr[10]; int n, i; if (type == AB_PROP_REVOLVING) @@ -271,13 +272,13 @@ drawp_prop_init( /* Scrolling */ n = 0; item[n] = cgen->scrolldisp_rbox_items.Never_item; - item_val[n] = AB_SCROLLBAR_NEVER; n++; + item_ptr[n] = AB_SCROLLBAR_NEVER; n++; item[n] = cgen->scrolldisp_rbox_items.Always_item; - item_val[n] = AB_SCROLLBAR_ALWAYS; n++; + item_ptr[n] = AB_SCROLLBAR_ALWAYS; n++; item[n] = cgen->scrolldisp_rbox_items.When_Needed_item; - item_val[n] = AB_SCROLLBAR_WHEN_NEEDED; n++; + item_ptr[n] = AB_SCROLLBAR_WHEN_NEEDED; n++; prop_radiobox_init(&(pds->scrolling), cgen->scrolldisp_rbox_label, - cgen->scrolldisp_rbox, n, item, (XtPointer*)item_val, + cgen->scrolldisp_rbox, n, item, item_ptr, cgen->scroll_cb); for(i=0; i < n; i++) @@ -287,18 +288,18 @@ drawp_prop_init( /* Border Frame */ n = 0; item[n] = cgen->bframe_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->bframe_opmenu_items.Shadow_Out_item; - item_val[n] = AB_LINE_SHADOW_OUT; n++; + item_ptr[n] = AB_LINE_SHADOW_OUT; n++; item[n] = cgen->bframe_opmenu_items.Shadow_In_item; - item_val[n] = AB_LINE_SHADOW_IN; n++; + item_ptr[n] = AB_LINE_SHADOW_IN; n++; item[n] = cgen->bframe_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->bframe_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; prop_options_init(&(pds->frame), cgen->bframe_opmenu_label, cgen->bframe_opmenu, cgen->bframe_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->bframe_cb); /* Menu Title */ From 26508f3f76ace1c8e61ca4232ad4402150bc6d0f Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 09:23:18 +0800 Subject: [PATCH 32/90] dtappbuilder: fix issues of property settings for file selection dialog. --- cde/programs/dtappbuilder/src/ab/pal_fchooser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_fchooser.c b/cde/programs/dtappbuilder/src/ab/pal_fchooser.c index a71a52bd6..4d99504fc 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_fchooser.c +++ b/cde/programs/dtappbuilder/src/ab/pal_fchooser.c @@ -198,7 +198,8 @@ fchooser_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropFchooserSettingsRec *pcs = &(prop_fchooser_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; int n; if (type == AB_PROP_REVOLVING) @@ -280,13 +281,13 @@ fchooser_prop_init( /* Search Pattern Type */ n = 0; item[n] = cgen->pattern_type_rbox_items.Files_item; - item_val[n] = AB_FILE_REGULAR; n++; + item_ptr[n] = AB_FILE_REGULAR; n++; item[n] = cgen->pattern_type_rbox_items.Directories_item; - item_val[n] = AB_FILE_DIRECTORY; n++; + item_ptr[n] = AB_FILE_DIRECTORY; n++; item[n] = cgen->pattern_type_rbox_items.Both_item; - item_val[n] = AB_FILE_ANY; n++; + item_ptr[n] = AB_FILE_ANY; n++; prop_radiobox_init(&(pcs->pattern_type), cgen->pattern_type_rbox_label, - cgen->pattern_type_rbox, n, item, (XtPointer*)item_val, + cgen->pattern_type_rbox, n, item, item_ptr, cgen->pattern_type_cb); /* Search Pattern */ From 471afeaa2c4683e75fc18842068f7060b6014358 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 18:17:04 +0800 Subject: [PATCH 33/90] dtappbuilder: fix issues of property settings for group. --- cde/programs/dtappbuilder/src/ab/pal_group.c | 49 ++++++++++---------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_group.c b/cde/programs/dtappbuilder/src/ab/pal_group.c index 8e6e61a98..570f7b2c5 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_group.c +++ b/cde/programs/dtappbuilder/src/ab/pal_group.c @@ -669,7 +669,8 @@ group_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropGroupSettingsRec *pgs = &(prop_group_settings_rec[type]); Widget item[10]; - int item_val[10]; + XtArgVal item_val[10]; + XtPointer item_ptr[10]; int n; int i; @@ -740,32 +741,32 @@ group_prop_init( /* Border Frame Setting */ n = 0; item[n] = cgen->bframe_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->bframe_opmenu_items.Shadow_Out_item; - item_val[n] = AB_LINE_SHADOW_OUT; n++; + item_ptr[n] = AB_LINE_SHADOW_OUT; n++; item[n] = cgen->bframe_opmenu_items.Shadow_In_item; - item_val[n] = AB_LINE_SHADOW_IN; n++; + item_ptr[n] = AB_LINE_SHADOW_IN; n++; item[n] = cgen->bframe_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->bframe_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; prop_options_init(&(pgs->frame), cgen->bframe_opmenu_label, cgen->bframe_opmenu, cgen->bframe_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->bframe_cb); /* Layout Type */ n = 0; item[n] = cgen->layout_rbox_items.bitmaps_ggp_as_is_xbm_item; - item_val[n] = AB_GROUP_IGNORE; n++; + item_ptr[n] = AB_GROUP_IGNORE; n++; item[n] = cgen->layout_rbox_items.bitmaps_ggp_col_xbm_item; - item_val[n] = AB_GROUP_COLUMNS; n++; + item_ptr[n] = AB_GROUP_COLUMNS; n++; item[n] = cgen->layout_rbox_items.bitmaps_ggp_row_xbm_item; - item_val[n] = AB_GROUP_ROWS; n++; + item_ptr[n] = AB_GROUP_ROWS; n++; item[n] = cgen->layout_rbox_items.bitmaps_ggp_rowcol_xbm_item; - item_val[n] = AB_GROUP_ROWSCOLUMNS; n++; + item_ptr[n] = AB_GROUP_ROWSCOLUMNS; n++; prop_radiobox_init(&(pgs->layout_type), cgen->layout_rbox_label, - cgen->layout_rbox, n, item, (XtPointer*)item_val, + cgen->layout_rbox, n, item, item_ptr, cgen->layout_cb1); for (i=0; i < n; i++) @@ -779,11 +780,11 @@ group_prop_init( /* Grid Row/Columns */ n = 0; item[n] = cgen->gridrowcol_rbox_items.Rows_item; - item_val[n] = AB_ORIENT_HORIZONTAL; n++; + item_ptr[n] = AB_ORIENT_HORIZONTAL; n++; item[n] = cgen->gridrowcol_rbox_items.Columns_item; - item_val[n] = AB_ORIENT_VERTICAL; n++; + item_ptr[n] = AB_ORIENT_VERTICAL; n++; prop_radiobox_init(&(pgs->grid_rowcol), NULL, - cgen->gridrowcol_rbox, n, item, (XtPointer*)item_val, + cgen->gridrowcol_rbox, n, item, item_ptr, cgen->gridrowcol_cb); /* Grid Row/Column count */ @@ -793,16 +794,16 @@ group_prop_init( /* Vertical Alignment */ n = 0; item[n] = cgen->valign_opmenu_items.bitmaps_align_left_xbm_item; - item_val[n] = AB_ALIGN_LEFT; n++; + item_ptr[n] = AB_ALIGN_LEFT; n++; item[n] = cgen->valign_opmenu_items.bitmaps_align_labels_xbm_item; - item_val[n] = AB_ALIGN_LABELS; n++; + item_ptr[n] = AB_ALIGN_LABELS; n++; item[n] = cgen->valign_opmenu_items.bitmaps_align_vcenter_xbm_item; - item_val[n] = AB_ALIGN_VCENTER; n++; + item_ptr[n] = AB_ALIGN_VCENTER; n++; item[n] = cgen->valign_opmenu_items.bitmaps_align_right_xbm_item; - item_val[n] = AB_ALIGN_RIGHT; n++; + item_ptr[n] = AB_ALIGN_RIGHT; n++; prop_options_init(&(pgs->valign), cgen->valign_opmenu_label, cgen->valign_opmenu, cgen->valign_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->valign_cb); /* Vertical spacing value */ @@ -812,14 +813,14 @@ group_prop_init( /* Horizontal Alignment */ n = 0; item[n] = cgen->halign_opmenu_items.bitmaps_align_top_xbm_item; - item_val[n] = AB_ALIGN_TOP; n++; + item_ptr[n] = AB_ALIGN_TOP; n++; item[n] = cgen->halign_opmenu_items.bitmaps_align_hcenter_xbm_item; - item_val[n] = AB_ALIGN_HCENTER; n++; + item_ptr[n] = AB_ALIGN_HCENTER; n++; item[n] = cgen->halign_opmenu_items.bitmaps_align_bottom_xbm_item; - item_val[n] = AB_ALIGN_BOTTOM; n++; + item_ptr[n] = AB_ALIGN_BOTTOM; n++; prop_options_init(&(pgs->halign), cgen->halign_opmenu_label, cgen->halign_opmenu, cgen->halign_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->halign_cb); /* Horizontal spacing value */ From 933d48e5899a68b7e544b6af85467c1cac3e98fa Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 18:41:35 +0800 Subject: [PATCH 34/90] dtappbuilder: fix issues of property settings for label. --- cde/programs/dtappbuilder/src/ab/pal_label.c | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_label.c b/cde/programs/dtappbuilder/src/ab/pal_label.c index d9064b5ef..45c16a554 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_label.c +++ b/cde/programs/dtappbuilder/src/ab/pal_label.c @@ -183,7 +183,8 @@ label_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropLabelSettingsRec *pls = &(prop_label_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; int n; int i; @@ -255,12 +256,12 @@ label_prop_init( /* Label Type */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pls->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); /* Label */ @@ -272,24 +273,24 @@ label_prop_init( /* Label Align */ n = 0; item[n] = cgen->labelalign_opmenu_items.Left_item; - item_val[n] = AB_ALIGN_LEFT; n++; + item_ptr[n] = AB_ALIGN_LEFT; n++; item[n] = cgen->labelalign_opmenu_items.Centered_item; - item_val[n] = AB_ALIGN_CENTER; n++; + item_ptr[n] = AB_ALIGN_CENTER; n++; item[n] = cgen->labelalign_opmenu_items.Right_item; - item_val[n] = AB_ALIGN_RIGHT; n++; + item_ptr[n] = AB_ALIGN_RIGHT; n++; prop_options_init(&(pls->label_align), cgen->labelalign_opmenu_label, cgen->labelalign_opmenu, cgen->labelalign_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labelalign_cb); /* Size Policy */ n = 0; item[n] = cgen->szpolicy_rbox_items.Size_of_Label_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->szpolicy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pls->size_policy), cgen->szpolicy_rbox_label, - cgen->szpolicy_rbox, n, item, (XtPointer*)item_val, + cgen->szpolicy_rbox, n, item, item_ptr, cgen->szpolicy_cb); for(i=0; i < n; i++) From 1b143dd7a71bcaee551a1df3a143273fbd244c9b Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 18:53:26 +0800 Subject: [PATCH 35/90] dtappbuilder: fix issues of property settings for main window. --- cde/programs/dtappbuilder/src/ab/pal_mainwin.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_mainwin.c b/cde/programs/dtappbuilder/src/ab/pal_mainwin.c index d8a21056e..6b429fa93 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_mainwin.c +++ b/cde/programs/dtappbuilder/src/ab/pal_mainwin.c @@ -199,7 +199,8 @@ mainwin_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropMainwinSettingsRec *pms = &(prop_mainwin_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; int i, n; if (type == AB_PROP_REVOLVING) @@ -273,11 +274,11 @@ mainwin_prop_init( /* Resize Mode */ n = 0; item[n] = cgen->resizemode_rbox_items.Adjustable_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; item[n] = cgen->resizemode_rbox_items.Fixed_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; prop_radiobox_init(&(pms->resize_mode), cgen->resizemode_rbox_label, - cgen->resizemode_rbox, n, item, (XtPointer*)item_val, + cgen->resizemode_rbox, n, item, item_ptr, cgen->resizemode_cb); /* Icon Filename */ @@ -307,11 +308,11 @@ mainwin_prop_init( /* Size Policy */ n = 0; item[n] = cgen->size_policy_rbox_items.Fit_Contents_item; - item_val[n] = SIZE_OF_CONTENTS_KEY; n++; + item_ptr[n] = SIZE_OF_CONTENTS_KEY; n++; item[n] = cgen->size_policy_rbox_items.Fixed_item; - item_val[n] = SIZE_FIXED_KEY; n++; + item_ptr[n] = SIZE_FIXED_KEY; n++; prop_radiobox_init(&(pms->size_policy), cgen->size_policy_rbox_label, - cgen->size_policy_rbox, n, item, (XtPointer*)item_val, + cgen->size_policy_rbox, n, item, item_ptr, cgen->size_policy_cb); for(i=0; i < n; i++) From 523c440536f5ae2107c826e81f86c90de56e67e9 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 19:14:51 +0800 Subject: [PATCH 36/90] dtappbuilder: fix issues of property settings for menu. --- cde/programs/dtappbuilder/src/ab/pal_menu.c | 39 +++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_menu.c b/cde/programs/dtappbuilder/src/ab/pal_menu.c index ed9a2bc78..cd0065d8e 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_menu.c +++ b/cde/programs/dtappbuilder/src/ab/pal_menu.c @@ -243,9 +243,10 @@ menu_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropMenuSettingsRec *pms = &(prop_menu_settings_rec[type]); Widget item[12]; - int item_val[12]; + XtArgVal item_val[12]; + XtPointer item_ptr[12]; Widget item2[12]; - int item2_val[12]; + XtArgVal item2_val[12]; int i, n, j; if (type == AB_PROP_REVOLVING) @@ -337,11 +338,11 @@ menu_prop_init( /* Tear-off */ n = 0; item[n] = cgen->tearoff_rbox_items.Enabled_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; item[n] = cgen->tearoff_rbox_items.Disabled_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; prop_radiobox_init(&(pms->tearoff), cgen->tearoff_rbox_label, - cgen->tearoff_rbox, n, item, (XtPointer*)item_val, + cgen->tearoff_rbox, n, item, item_ptr, cgen->tearoff_cb); /* Color */ @@ -366,14 +367,14 @@ menu_prop_init( cgen->itemlabel_field, cgen->itemlist_cb); n = 0; item[n] = cgen->itemlabeltype_opmenu_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->itemlabeltype_opmenu_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; item[n] = cgen->itemlabeltype_opmenu_items.Separator_item; - item_val[n] = AB_LABEL_SEPARATOR; n++; + item_ptr[n] = AB_LABEL_SEPARATOR; n++; prop_options_init(&(pms->item_label_type), cgen->itemlabeltype_opmenu_label, cgen->itemlabeltype_opmenu, cgen->itemlabeltype_opmenu_menu, - n, item, (XtPointer*)item_val, cgen->itemlist_cb); + n, item, item_ptr, cgen->itemlist_cb); for(i=0; i < n; i++) XtAddCallback(item[i], XmNactivateCallback, @@ -390,26 +391,26 @@ menu_prop_init( /* Item Line Style */ n = 0; item[n] = cgen->linestyle_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->linestyle_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; item[n] = cgen->linestyle_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->linestyle_opmenu_items.Etched_In_Dash_item; - item_val[n] = AB_LINE_ETCHED_IN_DASH; n++; + item_ptr[n] = AB_LINE_ETCHED_IN_DASH; n++; item[n] = cgen->linestyle_opmenu_items.Etched_Out_Dash_item; - item_val[n] = AB_LINE_ETCHED_OUT_DASH; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT_DASH; n++; item[n] = cgen->linestyle_opmenu_items.Single_Line_item; - item_val[n] = AB_LINE_SINGLE_LINE; n++; + item_ptr[n] = AB_LINE_SINGLE_LINE; n++; item[n] = cgen->linestyle_opmenu_items.Double_Line_item; - item_val[n] = AB_LINE_DOUBLE_LINE; n++; + item_ptr[n] = AB_LINE_DOUBLE_LINE; n++; item[n] = cgen->linestyle_opmenu_items.Single_Dashed_Line_item; - item_val[n] = AB_LINE_SINGLE_DASHED_LINE; n++; + item_ptr[n] = AB_LINE_SINGLE_DASHED_LINE; n++; item[n] = cgen->linestyle_opmenu_items.Double_Dashed_Line_item; - item_val[n] = AB_LINE_DOUBLE_DASHED_LINE; n++; + item_ptr[n] = AB_LINE_DOUBLE_DASHED_LINE; n++; prop_options_init(&(pms->item_line_style), cgen->linestyle_opmenu_label, cgen->linestyle_opmenu, cgen->linestyle_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->itemlist_cb); prop_options_set_value(&(pms->item_line_style), (XtPointer)AB_LINE_ETCHED_OUT, False); From fbb7e865a749f095d18dc5c85ce9b57048ba7e7e Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 19:23:52 +0800 Subject: [PATCH 37/90] dtappbuilder: fix issues of property settings for menubar. --- cde/programs/dtappbuilder/src/ab/pal_menubar.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_menubar.c b/cde/programs/dtappbuilder/src/ab/pal_menubar.c index e205dd139..d2036b80f 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_menubar.c +++ b/cde/programs/dtappbuilder/src/ab/pal_menubar.c @@ -211,9 +211,10 @@ menubar_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropMenubarSettingsRec *pms = &(prop_menubar_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; Widget item2[6]; - int item2_val[6]; + XtArgVal item2_val[6]; int i, n, j; if (type == AB_PROP_REVOLVING) @@ -312,12 +313,12 @@ menubar_prop_init( cgen->itemlabel_field, cgen->itemlist_cb); n = 0; item[n] = cgen->itemlabel_opmenu_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->itemlabel_opmenu_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pms->item_label_type), cgen->item_labeltype_label, cgen->itemlabel_opmenu, cgen->itemlabel_opmenu_menu, - n, item, (XtPointer*)item_val, cgen->itemlist_cb); + n, item, item_ptr, cgen->itemlist_cb); for(i=0; i < n; i++) XtAddCallback(item[i], XmNactivateCallback, From 69fbdb771b18479425860a9d722b059dc36be9ca Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 19:41:04 +0800 Subject: [PATCH 38/90] dtappbuilder: fix issues of property settings for scale. --- cde/programs/dtappbuilder/src/ab/pal_scale.c | 37 ++++++++++---------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_scale.c b/cde/programs/dtappbuilder/src/ab/pal_scale.c index c415d67e3..73395ace6 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_scale.c +++ b/cde/programs/dtappbuilder/src/ab/pal_scale.c @@ -218,7 +218,8 @@ scale_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropScaleSettingsRec *pss = &(prop_scale_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; int n; int i; @@ -290,13 +291,13 @@ scale_prop_init( /* Label, Type, Position */ n = 0; item[n] = cgen->labeltype_opmenu_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_opmenu_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pss->label_type), cgen->labeltype_opmenu_label, cgen->labeltype_opmenu, cgen->labeltype_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); prop_field_init(&(pss->label), cgen->label_field_label, @@ -306,23 +307,23 @@ scale_prop_init( n = 0; item[n] = cgen->labelpos_opmenu_items.Left_item; - item_val[n] = AB_CP_WEST; n++; + item_ptr[n] = AB_CP_WEST; n++; item[n] = cgen->labelpos_opmenu_items.Above_item; - item_val[n] = AB_CP_NORTH; n++; + item_ptr[n] = AB_CP_NORTH; n++; prop_options_init(&(pss->label_pos), cgen->labelpos_opmenu_label, cgen->labelpos_opmenu, cgen->labelpos_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); /* Scale Type */ n = 0; item[n] = cgen->scaletype_rbox_items.Scale_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; item[n] = cgen->scaletype_rbox_items.Gauge_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; prop_radiobox_init(&(pss->scale_type), cgen->scaletype_rbox_label, - cgen->scaletype_rbox, n, item, (XtPointer*)item_val, + cgen->scaletype_rbox, n, item, item_ptr, cgen->scaletype_cb); /* Geometry */ @@ -336,11 +337,11 @@ scale_prop_init( /* Orientation */ n = 0; item[n] = cgen->orient_rbox_items.Horizontal_item; - item_val[n] = AB_ORIENT_HORIZONTAL; n++; + item_ptr[n] = AB_ORIENT_HORIZONTAL; n++; item[n] = cgen->orient_rbox_items.Vertical_item; - item_val[n] = AB_ORIENT_VERTICAL; n++; + item_ptr[n] = AB_ORIENT_VERTICAL; n++; prop_radiobox_init(&(pss->orient), cgen->orient_rbox_label, - cgen->orient_rbox, n, item, (XtPointer*)item_val, + cgen->orient_rbox, n, item, item_ptr, cgen->orient_cb); for(i=0; i < n; i++) @@ -350,16 +351,16 @@ scale_prop_init( /* Direction */ n = 0; item[n] = cgen->dir_opmenu_items.Left_to_Right_item; - item_val[n] = AB_DIR_LEFT_TO_RIGHT; n++; + item_ptr[n] = AB_DIR_LEFT_TO_RIGHT; n++; item[n] = cgen->dir_opmenu_items.Right_to_Left_item; - item_val[n] = AB_DIR_RIGHT_TO_LEFT; n++; + item_ptr[n] = AB_DIR_RIGHT_TO_LEFT; n++; item[n] = cgen->dir_opmenu_items.Top_to_Bottom_item; - item_val[n] = AB_DIR_TOP_TO_BOTTOM; n++; + item_ptr[n] = AB_DIR_TOP_TO_BOTTOM; n++; item[n] = cgen->dir_opmenu_items.Bottom_to_Top_item; - item_val[n] = AB_DIR_BOTTOM_TO_TOP; n++; + item_ptr[n] = AB_DIR_BOTTOM_TO_TOP; n++; prop_options_init(&(pss->dir), cgen->dir_opmenu_label, cgen->dir_opmenu, cgen->dir_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->dir_cb); for (i=0; i < n; i++) From a52f25b08138ed3a831f2f1674028f67e66a1acd Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 20:09:19 +0800 Subject: [PATCH 39/90] dtappbuilder: fix issues of property settings for separator. --- cde/programs/dtappbuilder/src/ab/pal_sep.c | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_sep.c b/cde/programs/dtappbuilder/src/ab/pal_sep.c index 7f56dc4e6..433cfa091 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_sep.c +++ b/cde/programs/dtappbuilder/src/ab/pal_sep.c @@ -183,7 +183,8 @@ separator_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropSepSettingsRec *pss = &(prop_sep_settings_rec[type]); Widget item[14]; - int item_val[14]; + XtArgVal item_val[14]; + XtPointer item_ptr[14]; int n; if (type == AB_PROP_REVOLVING) @@ -253,36 +254,36 @@ separator_prop_init( /* Orientation */ n = 0; item[n] = cgen->orient_rbox_items.Horizontal_item; - item_val[n] = AB_ORIENT_HORIZONTAL; n++; + item_ptr[n] = AB_ORIENT_HORIZONTAL; n++; item[n] = cgen->orient_rbox_items.Vertical_item; - item_val[n] = AB_ORIENT_VERTICAL; n++; + item_ptr[n] = AB_ORIENT_VERTICAL; n++; prop_radiobox_init(&(pss->orient), cgen->orient_rbox_label, - cgen->orient_rbox, n, item, (XtPointer*)item_val, + cgen->orient_rbox, n, item, item_ptr, cgen->orient_cb); /* Line Style */ n = 0; item[n] = cgen->linestyle_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->linestyle_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; item[n] = cgen->linestyle_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->linestyle_opmenu_items.Etched_In_Dash_item; - item_val[n] = AB_LINE_ETCHED_IN_DASH; n++; + item_ptr[n] = AB_LINE_ETCHED_IN_DASH; n++; item[n] = cgen->linestyle_opmenu_items.Etched_Out_Dash_item; - item_val[n] = AB_LINE_ETCHED_OUT_DASH; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT_DASH; n++; item[n] = cgen->linestyle_opmenu_items.Single_Line_item; - item_val[n] = AB_LINE_SINGLE_LINE; n++; + item_ptr[n] = AB_LINE_SINGLE_LINE; n++; item[n] = cgen->linestyle_opmenu_items.Double_Line_item; - item_val[n] = AB_LINE_DOUBLE_LINE; n++; + item_ptr[n] = AB_LINE_DOUBLE_LINE; n++; item[n] = cgen->linestyle_opmenu_items.Single_Dashed_Line_item; - item_val[n] = AB_LINE_SINGLE_DASHED_LINE; n++; + item_ptr[n] = AB_LINE_SINGLE_DASHED_LINE; n++; item[n] = cgen->linestyle_opmenu_items.Double_Dashed_Line_item; - item_val[n] = AB_LINE_DOUBLE_DASHED_LINE; n++; + item_ptr[n] = AB_LINE_DOUBLE_DASHED_LINE; n++; prop_options_init(&(pss->line_style), cgen->linestyle_opmenu_label, cgen->linestyle_opmenu, cgen->linestyle_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->linestyle_cb); /* Geometry */ From ffe857f6cad7e06fa7866848f7919ce2af44a29f Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 20:22:00 +0800 Subject: [PATCH 40/90] dtappbuilder: fix issues of property settings for spin box. --- .../dtappbuilder/src/ab/pal_spinbox.c | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_spinbox.c b/cde/programs/dtappbuilder/src/ab/pal_spinbox.c index d670f47ac..af89b30ff 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_spinbox.c +++ b/cde/programs/dtappbuilder/src/ab/pal_spinbox.c @@ -214,9 +214,10 @@ spinbox_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropSpinboxSettingsRec *pss = &(prop_spinbox_settings_rec[type]); Widget item[6]; - int item_val[6]; + XtArgVal item_val[6]; + XtPointer item_ptr[6]; Widget item2[6]; - int item2_val[6]; + XtArgVal item2_val[6]; int i, n, j; if (type == AB_PROP_REVOLVING) @@ -291,11 +292,11 @@ spinbox_prop_init( /* Spinbox Type */ n = 0; item[n] = cgen->spinboxtype_rbox_items.Numeric_item; - item_val[n] = AB_TEXT_NUMERIC; n++; + item_ptr[n] = AB_TEXT_NUMERIC; n++; item[n] = cgen->spinboxtype_rbox_items.String_List_item; - item_val[n] = AB_TEXT_DEFINED_STRING; n++; + item_ptr[n] = AB_TEXT_DEFINED_STRING; n++; prop_radiobox_init(&(pss->spinbox_type), cgen->spinboxtype_rbox_label, - cgen->spinboxtype_rbox, n, item, (XtPointer*)item_val, + cgen->spinboxtype_rbox, n, item, item_ptr, cgen->spinboxtype_cb); for(i=0; i < n; i++) XtAddCallback(item[i], XmNvalueChangedCallback, @@ -304,12 +305,12 @@ spinbox_prop_init( /* Label, Type, Position */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pss->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); prop_field_init(&(pss->label), cgen->label_field_label, @@ -319,29 +320,29 @@ spinbox_prop_init( n = 0; item[n] = cgen->labelpos_rbox_items.Above_item; - item_val[n] = AB_CP_NORTH; n++; + item_ptr[n] = AB_CP_NORTH; n++; item[n] = cgen->labelpos_rbox_items.Left_item; - item_val[n] = AB_CP_WEST; n++; + item_ptr[n] = AB_CP_WEST; n++; prop_options_init(&(pss->label_pos), cgen->labeltype_rbox_label, cgen->labelpos_rbox, cgen->labelpos_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); /* Arrow Style */ n = 0; item[n] = cgen->arrowstyle_opmenu_items.Flat_Beginning_item; - item_val[n] = AB_ARROW_FLAT_BEGIN; n++; + item_ptr[n] = AB_ARROW_FLAT_BEGIN; n++; item[n] = cgen->arrowstyle_opmenu_items.Flat_End_item; - item_val[n] = AB_ARROW_FLAT_END; n++; + item_ptr[n] = AB_ARROW_FLAT_END; n++; item[n] = cgen->arrowstyle_opmenu_items.Beginning_item; - item_val[n] = AB_ARROW_BEGIN; n++; + item_ptr[n] = AB_ARROW_BEGIN; n++; item[n] = cgen->arrowstyle_opmenu_items.End_item; - item_val[n] = AB_ARROW_END; n++; + item_ptr[n] = AB_ARROW_END; n++; item[n] = cgen->arrowstyle_opmenu_items.Split_item; - item_val[n] = AB_ARROW_SPLIT; n++; + item_ptr[n] = AB_ARROW_SPLIT; n++; prop_options_init(&(pss->arrow_style), cgen->arrowstyle_opmenu_label, cgen->arrowstyle_opmenu, cgen->arrowstyle_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->arrowstyle_cb); /* Min & Max & Incr */ From 60b0fc29a978c5a907b3026739f9f13c22481652 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 20:33:08 +0800 Subject: [PATCH 41/90] dtappbuilder: fix issues of property settings for term pane. --- cde/programs/dtappbuilder/src/ab/pal_termp.c | 27 ++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_termp.c b/cde/programs/dtappbuilder/src/ab/pal_termp.c index ff86ff9a1..ad65ccc05 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_termp.c +++ b/cde/programs/dtappbuilder/src/ab/pal_termp.c @@ -193,7 +193,8 @@ termp_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropTermpSettingsRec *pts = &(prop_termp_settings_rec[type]); Widget item[10]; - int item_val[10]; + XtArgVal item_val[10]; + XtPointer item_ptr[10]; int n; if (type == AB_PROP_REVOLVING) @@ -263,28 +264,28 @@ termp_prop_init( /* Scrolling */ n = 0; item[n] = cgen->scroll_rbox_items.Never_item; - item_val[n] = AB_SCROLLBAR_NEVER; n++; + item_ptr[n] = AB_SCROLLBAR_NEVER; n++; item[n] = cgen->scroll_rbox_items.Always_item; - item_val[n] = AB_SCROLLBAR_ALWAYS; n++; + item_ptr[n] = AB_SCROLLBAR_ALWAYS; n++; prop_radiobox_init(&(pts->scrolling), cgen->scroll_rbox_label, - cgen->scroll_rbox, n, item, (XtPointer*)item_val, + cgen->scroll_rbox, n, item, item_ptr, cgen->scroll_cb); /* Border Frame */ n = 0; item[n] = cgen->bframe_opmenu_items.None_item; - item_val[n] = AB_LINE_NONE; n++; + item_ptr[n] = AB_LINE_NONE; n++; item[n] = cgen->bframe_opmenu_items.Shadow_Out_item; - item_val[n] = AB_LINE_SHADOW_OUT; n++; + item_ptr[n] = AB_LINE_SHADOW_OUT; n++; item[n] = cgen->bframe_opmenu_items.Shadow_In_item; - item_val[n] = AB_LINE_SHADOW_IN; n++; + item_ptr[n] = AB_LINE_SHADOW_IN; n++; item[n] = cgen->bframe_opmenu_items.Etched_Out_item; - item_val[n] = AB_LINE_ETCHED_OUT; n++; + item_ptr[n] = AB_LINE_ETCHED_OUT; n++; item[n] = cgen->bframe_opmenu_items.Etched_In_item; - item_val[n] = AB_LINE_ETCHED_IN; n++; + item_ptr[n] = AB_LINE_ETCHED_IN; n++; prop_options_init(&(pts->frame), cgen->bframe_opmenu_label, cgen->bframe_opmenu, cgen->bframe_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->bframe_cb); /* Menu Title */ prop_field_init(&(pts->menu_title), cgen->menutitle_field_label, @@ -318,13 +319,13 @@ termp_prop_init( n = 0; item[n] = cgen->size_opmenu_items.Characters_item; - item_val[n] = SIZE_IN_CHARS_KEY; n++; + item_ptr[n] = SIZE_IN_CHARS_KEY; n++; item[n] = cgen->size_opmenu_items.Pixels_item; - item_val[n] = SIZE_IN_PIXELS_KEY; n++; + item_ptr[n] = SIZE_IN_PIXELS_KEY; n++; prop_options_init(&(pts->size_metric), cgen->size_opmenu_label, cgen->size_opmenu, cgen->size_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->size_cb); /* Initial State */ From fb0bedaa48cce4898cf0e31c6ec63c11a66d1b20 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Wed, 17 Feb 2021 20:47:00 +0800 Subject: [PATCH 42/90] dtappbuilder: fix issues of property settings for text field. --- cde/programs/dtappbuilder/src/ab/pal_textf.c | 27 ++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/pal_textf.c b/cde/programs/dtappbuilder/src/ab/pal_textf.c index 5f3e0e001..80ce15154 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_textf.c +++ b/cde/programs/dtappbuilder/src/ab/pal_textf.c @@ -187,7 +187,8 @@ textf_prop_init( DtbRevolvPropDialogInfo rpd = &(dtb_revolv_prop_dialog); PropTextfSettingsRec *pts = &(prop_textf_settings_rec[type]); Widget item[10]; - int item_val[10]; + XtArgVal item_val[10]; + XtPointer item_ptr[10]; int n; if (type == AB_PROP_REVOLVING) @@ -257,12 +258,12 @@ textf_prop_init( /* Label, Type, Position */ n = 0; item[n] = cgen->labeltype_rbox_items.String_item; - item_val[n] = AB_LABEL_STRING; n++; + item_ptr[n] = AB_LABEL_STRING; n++; item[n] = cgen->labeltype_rbox_items.Graphic_item; - item_val[n] = AB_LABEL_GLYPH; n++; + item_ptr[n] = AB_LABEL_GLYPH; n++; prop_options_init(&(pts->label_type), cgen->labeltype_rbox_label, cgen->labeltype_rbox, cgen->labeltype_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); prop_field_init(&(pts->label), cgen->label_field_label, @@ -271,12 +272,12 @@ textf_prop_init( n = 0; item[n] = cgen->labelpos_rbox_items.Left_item; - item_val[n] = AB_CP_WEST; n++; + item_ptr[n] = AB_CP_WEST; n++; item[n] = cgen->labelpos_rbox_items.Above_item; - item_val[n] = AB_CP_NORTH; n++; + item_ptr[n] = AB_CP_NORTH; n++; prop_options_init(&(pts->label_pos), cgen->labelpos_rbox_label, cgen->labelpos_rbox, cgen->labelpos_rbox_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->labeltype_cb); /* Menu Name */ @@ -289,11 +290,11 @@ textf_prop_init( /* Operation */ n = 0; item[n] = cgen->op_rbox_items.Editable_item; - item_val[n] = False; n++; + item_ptr[n] = False; n++; item[n] = cgen->op_rbox_items.Read_Only_item; - item_val[n] = True; n++; + item_ptr[n] = True; n++; prop_radiobox_init(&(pts->op), cgen->op_rbox_label, - cgen->op_rbox, n, item, (XtPointer*)item_val, + cgen->op_rbox, n, item, item_ptr, cgen->op_cb); /* Maximum Chars */ @@ -320,13 +321,13 @@ textf_prop_init( n = 0; item[n] = cgen->width_opmenu_items.Characters_item; - item_val[n] = SIZE_IN_CHARS_KEY; n++; + item_ptr[n] = SIZE_IN_CHARS_KEY; n++; item[n] = cgen->width_opmenu_items.Pixels_item; - item_val[n] = SIZE_IN_PIXELS_KEY; n++; + item_ptr[n] = SIZE_IN_PIXELS_KEY; n++; prop_options_init(&(pts->size_metric), cgen->width_opmenu_label, cgen->width_opmenu, cgen->width_opmenu_menu, - n, item, (XtPointer*)item_val, + n, item, item_ptr, cgen->width_cb); /* Initial State */ From 8e076e164a99038600ea2aa270efd91d4e3a4c9b Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Fri, 19 Feb 2021 05:39:16 +0800 Subject: [PATCH 43/90] dtappbuilder: fix the rendering glitch of the list widget which contains a label. --- cde/programs/dtappbuilder/src/abmf/instances.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtappbuilder/src/abmf/instances.c b/cde/programs/dtappbuilder/src/abmf/instances.c index a1cc09f15..05b0ba7ee 100644 --- a/cde/programs/dtappbuilder/src/abmf/instances.c +++ b/cde/programs/dtappbuilder/src/abmf/instances.c @@ -1700,7 +1700,17 @@ write_list(GenCodeInfo genCodeInfo, ABObj list) int i; write_convert_strings_to_xmstrings(genCodeInfo, list); - genCodeInfo->cur_func.create_obj = list; + + /* + * genCodeInfo->cur_func.create_obj = list; + * + * TODO: Figure out the history of the above line. + * The original file contains this line. + * Actually, it breaks the hierarchy of widgets. + * Comment out it to make the list widget with a label to be rendered + * properly. + */ + write_create_widget_by_non_va_conv_func( genCodeInfo, list, "XmCreateScrolledList", FALSE); From 170a649363aa2d92d6f344cd0841d447fd3cf7f3 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Fri, 19 Feb 2021 05:58:17 +0800 Subject: [PATCH 44/90] ttsnoop: adjust the text field on ttChooser. --- cde/programs/ttsnoop/ttChooser.bil | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cde/programs/ttsnoop/ttChooser.bil b/cde/programs/ttsnoop/ttChooser.bil index f060cc1be..1dbc964c5 100644 --- a/cde/programs/ttsnoop/ttChooser.bil +++ b/cde/programs/ttsnoop/ttChooser.bil @@ -6,10 +6,8 @@ :element chooser ( :type :dialog - :x 58 - :y 506 - :width 477 - :height 196 + :width 520 + :height 215 :bg-color "white" :label "tt_message_handler_set" :resizable :true @@ -27,8 +25,8 @@ :container-type :relative :x 0 :y 0 - :width 473 - :height 192 + :width 516 + :height 211 :visible :true :border-frame :shadow-in :north-attachment (:point 0 0) @@ -45,7 +43,7 @@ :type :list :x 20 :y 10 - :width 433 + :width 476 :label-type :string :label "Tt_messages" :label-position :north @@ -66,7 +64,7 @@ :y 131 :label-type :string :label "Tt_message:" - :label-position :west + :label-position :north :num-columns 42 :max-length 80 :read-only :false @@ -80,7 +78,7 @@ ( :type :container :container-type :button-panel - :width 477 + :width 520 :height 48 :visible :true :border-frame :none From 09d3c8d6eed5c9d7a796dd95ad1078934fd47294 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 20 Feb 2021 00:57:33 +0800 Subject: [PATCH 45/90] ttsnoop: adjust data types to ensure the result of pointer comparison is correct. --- cde/programs/ttsnoop/ttChooser_stubs.C.src | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/cde/programs/ttsnoop/ttChooser_stubs.C.src b/cde/programs/ttsnoop/ttChooser_stubs.C.src index 9ef1c53ff..ef0e550c6 100644 --- a/cde/programs/ttsnoop/ttChooser_stubs.C.src +++ b/cde/programs/ttsnoop/ttChooser_stubs.C.src @@ -339,6 +339,7 @@ choiceOkayed( _DtTtChooserAction choice = (_DtTtChooserAction)ival; Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label; switch (choice) { + void *pval; int ival, fd; Tt_message msg; Tt_pattern pat; @@ -396,9 +397,9 @@ choiceOkayed( if (text == 0) { return; } - ival = 0; - sscanf( text, "%i", &ival ); - msg = (Tt_message) (intptr_t) ival; + pval = NULL; + sscanf( text, "%p", &pval ); + msg = (Tt_message) (intptr_t) pval; if (DtTtIndex( DTTT_MESSAGE, msg ) < 0) { return; } @@ -431,9 +432,9 @@ choiceOkayed( if (text == 0) { return; } - ival = 0; - sscanf( text, "%i", &ival ); - pat = (Tt_pattern) (intptr_t) ival; + pval = NULL; + sscanf( text, "%p", &pval ); + pat = (Tt_pattern) (intptr_t) pval; if (DtTtIndex( DTTT_PATTERN, pat ) < 0) { return; } @@ -465,9 +466,9 @@ choiceOkayed( if (text == 0) { return; } - ival = 0; - sscanf( text, "%i", &ival ); - pats = (Tt_pattern *) (intptr_t) ival; + pval = NULL; + sscanf( text, "%p", &pval ); + pats = (Tt_pattern *) (intptr_t) pval; if (DtTtIndex( DTTT_DTSESSION, pats ) < 0) { return; } @@ -491,9 +492,9 @@ choiceOkayed( if (text == 0) { return; } - ival = 0; - sscanf( text, "%i", &ival ); - pats = (Tt_pattern *) (intptr_t) ival; + pval = NULL; + sscanf( text, "%p", &pval ); + pats = (Tt_pattern *) (intptr_t) pval; if (DtTtIndex( DTTT_DTFILE, pats ) < 0) { return; } From eb83fca4b703f89d0727eb0b52110775bb602c79 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 20 Feb 2021 01:35:13 +0800 Subject: [PATCH 46/90] ttsnoop: check the return value from tt_message_op to avoid a segmentation fault. --- cde/programs/ttsnoop/DtTt.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/ttsnoop/DtTt.C b/cde/programs/ttsnoop/DtTt.C index ffd208fa9..8569cabf1 100644 --- a/cde/programs/ttsnoop/DtTt.C +++ b/cde/programs/ttsnoop/DtTt.C @@ -559,7 +559,7 @@ _DtTtChoices( std::ostringstream itemStream; itemStream << (void *)dtTtMessages[ i ]; char *op = tt_message_op( dtTtMessages[ i ] ); - if (! tt_is_err( tt_ptr_error( op ))) { + if (op && ! tt_is_err( tt_ptr_error( op ))) { itemStream << " " << op; tt_free( op ); } From 2b0c66f77e6a733ced662d6bb794da9a286941e3 Mon Sep 17 00:00:00 2001 From: WHR Date: Mon, 22 Feb 2021 21:11:16 +0800 Subject: [PATCH 47/90] Break building on subdirectories make(1) failed --- cde/config/cf/Imake.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/config/cf/Imake.rules b/cde/config/cf/Imake.rules index 42323f748..d12c4654e 100644 --- a/cde/config/cf/Imake.rules +++ b/cde/config/cf/Imake.rules @@ -2145,7 +2145,7 @@ name:: @@\ for i in dirs ;\ @@\ do \ @@\ echo verb "in $(CURRENT_DIR)/$$i..."; \ @@\ - (cd $$i && LANG=lang $(MAKE) $(MFLAGS) flags subname);\ @@\ + (cd $$i && LANG=lang $(MAKE) $(MFLAGS) flags subname) || exit;\ @@\ done #endif @@ -2179,7 +2179,7 @@ name:: @@\ for i in dirs ;\ @@\ do \ @@\ echo verb "in $(CURRENT_DIR)/$$i..."; \ @@\ - (cd $$i && $(MAKE) $(MFLAGS) flags subname); \ @@\ + (cd $$i && $(MAKE) $(MFLAGS) flags subname) || exit; \ @@\ done #endif From ec123a6c3ffc45f1e83b188a22b731d050ca18b9 Mon Sep 17 00:00:00 2001 From: WHR Date: Mon, 22 Feb 2021 21:34:06 +0800 Subject: [PATCH 48/90] Remove uses of ar(1) option '-l' --- cde/config/cf/Imake.tmpl | 18 +++--------------- cde/config/util/crayar.sh | 2 +- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/cde/config/cf/Imake.tmpl b/cde/config/cf/Imake.tmpl index 1874d0b11..5e51fa9b6 100644 --- a/cde/config/cf/Imake.tmpl +++ b/cde/config/cf/Imake.tmpl @@ -474,25 +474,13 @@ XCOMM the platform-specific parameters - edit site.def to change #define ArCmdBase ar #endif #ifndef ArCmd -#if HasLargeTmp || SystemV4 -#define ArCmd ArCmdBase cq -#else -#define ArCmd ArCmdBase clq -#endif +#define ArCmd ArCmdBase -cq #endif #ifndef ArAddCmd -#if HasLargeTmp || SystemV4 -#define ArAddCmd ArCmdBase ru -#else -#define ArAddCmd ArCmdBase rul -#endif +#define ArAddCmd ArCmdBase -ru #endif #ifndef ArExtCmd -#if HasLargeTmp || SystemV4 -#define ArExtCmd ArCmdBase x -#else -#define ArExtCmd ArCmdBase xl -#endif +#define ArExtCmd ArCmdBase -x #endif #ifndef BootstrapCFlags #define BootstrapCFlags /**/ diff --git a/cde/config/util/crayar.sh b/cde/config/util/crayar.sh index 6296de51d..56c260e50 100755 --- a/cde/config/util/crayar.sh +++ b/cde/config/util/crayar.sh @@ -4,6 +4,6 @@ shift if cray2; then bld cr $lib `lorder $* | tsort` else - ar clq $lib $* + ar -cq $lib $* fi From cdffbc9b696759983f5bd6b8ec0e319fd2f5ae9a Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 28 Feb 2021 21:03:18 -0700 Subject: [PATCH 49/90] videoTypes.dt: remove duplicate LABEL field --- cde/programs/types/videoTypes.dt | 1 - 1 file changed, 1 deletion(-) diff --git a/cde/programs/types/videoTypes.dt b/cde/programs/types/videoTypes.dt index 802cd6384..7965713e4 100644 --- a/cde/programs/types/videoTypes.dt +++ b/cde/programs/types/videoTypes.dt @@ -320,7 +320,6 @@ ACTION Open ACTION Print { LABEL %|nls-2-Print| - LABEL Print ARG_TYPE AVI TYPE MAP MAP_ACTION NoPrint From 915ba5d5a94993feda88b7922b6e130ed2c671a3 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 20 Feb 2021 22:15:56 +0800 Subject: [PATCH 50/90] dtappbuilder: set limits on the resize rectangle to avoid rollover. --- .../dtappbuilder/src/ab/abobj_resize.c | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_resize.c b/cde/programs/dtappbuilder/src/ab/abobj_resize.c index 680441f56..293581aa2 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_resize.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_resize.c @@ -794,51 +794,51 @@ make_rect ( { case NORTH: new_r->x = r->x; - new_r->y = y; + new_r->y = min(y, rect_bottom(r)); new_r->width = r->width; - new_r->height = (r->y + r->height) - y; + new_r->height = max(0, r->y + r->height - y); break; case SOUTH: new_r->x = r->x; new_r->y = r->y; new_r->width = r->width; - new_r->height = y - r->y; + new_r->height = max(0, y - r->y); break; case EAST: new_r->x = r->x; new_r->y = r->y; - new_r->width = x - r->x; + new_r->width = max(0, x - r->x); new_r->height = r->height; break; case WEST: - new_r->x = x; + new_r->x = min(x, rect_right(r)); new_r->y = r->y; - new_r->width = (r->x + r->width) - x; + new_r->width = max(0, r->x + r->width - x); new_r->height = r->height; break; case NORTH_EAST: new_r->x = r->x; - new_r->y = y; - new_r->width = x - r->x; - new_r->height = (r->y + r->height) - y; + new_r->y = min(y, rect_bottom(r)); + new_r->width = max(0, x - r->x); + new_r->height = max(0, r->y + r->height - y); break; case NORTH_WEST: - new_r->x = x; - new_r->y = y; - new_r->width = (r->x + r->width) - x; - new_r->height = (r->y + r->height) - y; + new_r->x = min(x, rect_right(r)); + new_r->y = min(y, rect_bottom(r)); + new_r->width = max(0, r->x + r->width - x); + new_r->height = max(0, r->y + r->height - y); break; case SOUTH_EAST: new_r->x = r->x; new_r->y = r->y; - new_r->width = x - r->x; - new_r->height = y - r->y; + new_r->width = max(0, x - r->x); + new_r->height = max(0, y - r->y); break; case SOUTH_WEST: - new_r->x = x; + new_r->x = min(x, rect_right(r)); new_r->y = r->y; - new_r->width = (r->x + r->width) - x; - new_r->height = y - r->y; + new_r->width = max(0, r->x + r->width - x); + new_r->height = max(0, y - r->y); break; } } From 3a99e98d6a7482743d1409ef5798d691e42e033b Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 21 Feb 2021 06:52:32 +0800 Subject: [PATCH 51/90] dtappbuilder: ensure the resize box always inside the main window to avoid the rendering glitch. --- .../dtappbuilder/src/ab/abobj_resize.c | 65 ++++++++++++++++--- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_resize.c b/cde/programs/dtappbuilder/src/ab/abobj_resize.c index 293581aa2..82a85ae47 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_resize.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_resize.c @@ -72,6 +72,16 @@ static void make_rect( RESIZE_DIR dir ); +static void +make_rect_in_rect( + XRectangle *pr, + XRectangle *new_r, + XRectangle *r, + int x, + int y, + RESIZE_DIR dir +); + static void undo_resize( ABUndoRec undo_rec ); @@ -355,9 +365,9 @@ abobjP_resize_object_outline( static Widget parent; static Window rootwin; static Display *dpy; - static XRectangle orig_r, r; + static XRectangle orig_r, r, p_rect; static int last_x, last_y; - int x,y; + int x, y, x_tmp, y_tmp; char buf[80]; if (event->type == MotionNotify) @@ -399,6 +409,16 @@ abobjP_resize_object_outline( rootwin = RootWindowOfScreen(XtScreen(xy_widget)); x_get_widget_rect(xy_widget, &orig_r); + + x_get_widget_rect(parent, &p_rect); + + XTranslateCoordinates(dpy, XtWindow(parent), + rootwin, p_rect.x, p_rect.y, &x_tmp, &y_tmp, + &win); + + p_rect.x = x_tmp; + p_rect.y = y_tmp; + if (obj_has_border_frame(obj)) /* We have a border-frame to deal with */ { XRectangle pane_r; @@ -412,8 +432,8 @@ abobjP_resize_object_outline( else border_w = 0; - orig_r.width--; - orig_r.height--; + if (orig_r.width > 0) orig_r.width--; + if (orig_r.height > 0) orig_r.height--; r = orig_r; @@ -431,7 +451,7 @@ abobjP_resize_object_outline( } else /* erase previous outline */ { - make_rect(&resize_rect, &r, last_x, last_y, dir); + make_rect_in_rect(&p_rect, &resize_rect, &r, last_x, last_y, dir); x_fullscreen_box(xy_widget, rootwin, resize_rect.x, resize_rect.y, rect_right(&resize_rect), @@ -439,7 +459,7 @@ abobjP_resize_object_outline( } - make_rect(&resize_rect, &r, x, y, dir); + make_rect_in_rect(&p_rect, &resize_rect, &r, x, y, dir); x_fullscreen_box(xy_widget, rootwin, resize_rect.x, resize_rect.y, rect_right(&resize_rect), @@ -508,8 +528,8 @@ abobj_resize( XTranslateCoordinates(dpy, rootwin, XtWindow(parent), orig_x , orig_y, &trans_x, &trans_y, &win); - resize_rect.width++; - resize_rect.height++; + resize_rect.width++; if (!resize_rect.width) --resize_rect.width; + resize_rect.height++; if (!resize_rect.height) --resize_rect.height; /* Ensure new geometry fits within parent */ @@ -843,6 +863,35 @@ make_rect ( } } +/* + * calculate resize rect based on resize-direction & obj dimensions & a + * boundary. + */ +static void +make_rect_in_rect( + XRectangle *pr, + XRectangle *new_r, + XRectangle *r, + int x, + int y, + RESIZE_DIR dir +) +{ + int x_tmp, y_tmp; + int pr_right = rect_right(pr); + int pr_bottom = rect_bottom(pr); + + if (x < pr->x) x_tmp = pr->x; + else if (x > pr_right) x_tmp = pr_right; + else x_tmp = x; + + if (y < pr->y) y_tmp = pr->y; + else if (y > pr_bottom) y_tmp = pr_bottom; + else y_tmp = y; + + make_rect(new_r, r, x_tmp, y_tmp, dir); +} + /* * Function for undoing RESIZE */ From f70877daa246ab4252e63aed8b36366d93471ed8 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 22 Feb 2021 06:27:34 +0800 Subject: [PATCH 52/90] dtappbuilder: set the default size (in pixels) for terminal pane. --- cde/programs/dtappbuilder/src/ab/pal_termp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cde/programs/dtappbuilder/src/ab/pal_termp.c b/cde/programs/dtappbuilder/src/ab/pal_termp.c index ad65ccc05..1049d061f 100644 --- a/cde/programs/dtappbuilder/src/ab/pal_termp.c +++ b/cde/programs/dtappbuilder/src/ab/pal_termp.c @@ -174,6 +174,8 @@ termp_initialize( { obj_set_num_rows(obj, 6); obj_set_num_columns(obj, 12); + obj_set_width(obj, termp_init_width); + obj_set_height(obj, termp_init_width); } obj_set_process_string(obj, "/bin/csh"); From 512269a3304cc91c891986a37df9cf1821e824fa Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 14 Mar 2021 14:51:54 -0600 Subject: [PATCH 53/90] dtprintinfo: try to mitigate some stupid in ParseJob.C for sun Marco Ivaldi pointed me to some unsafe code in ParseJob.c. I do not have a sun machine (well, not currently operational anyway), so the code is not tested. But seriously, this is some horrible code. This local parser for sun needs to be rewritten! --- .../dtprintinfo/objects/PrintObj/ParseJobs.C | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C b/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C index 2c532c8aa..de1781acc 100644 --- a/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C +++ b/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C @@ -53,6 +53,8 @@ extern "C" in_addr_t inet_addr(const char *); #include #include +#include + #include "dtprintinfomsg.h" #ifdef NO_REGCOMP @@ -342,6 +344,15 @@ void LocalPrintJobs(char *printer, char **job_list, int *n_jobs) #if defined(sun) +// JET - this *really* needs to be re-written for sun + +// I tried to mitigate some of the more stupider code segments in +// check_dir() for example, but... It's a C++ file, yet someone who +// does not appear to know C++ very well wrote this crap in... C, sort +// of. + +#warning "This SUN local parser code is unsafe, please re-write" + // SUN LOCAL PARSER, actually this gets the local information from the file // system, it should have the good performance since no processes (lpstat) // are needed. @@ -438,6 +449,7 @@ void LocalPrintJobs(char *printer, char **return_job_list, int *return_n_jobs) SETEUID(getuid()); } +// JET - this whole function is atrocious and should be re-written in C++ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, int *n_jobs, int prev_n_jobs) { @@ -466,11 +478,11 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, char *spool_dir = new char[300]; if (getenv("REQ_DIR")) - sprintf(request, getenv("REQ_DIR"), tmp_dir); + snprintf(request, sizeof(request), "%s/%s", getenv("REQ_DIR"), tmp_dir); else - sprintf(request, REQ_DIR, tmp_dir); + sprintf(request, sizeof(request), "%s", REQ_DIR, tmp_dir); req_len = strlen(request); - sprintf(spool_dir, SPOOL_DIR, tmp_dir); + snprintf(spool_dir, sizeof(spool_dir), "%s/%s", SPOOL_DIR, tmp_dir); spool_len = strlen(spool_dir); if (!(lp_tmp_dir = opendir("."))) @@ -490,9 +502,13 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, continue; if (strcmp(dir_struct->d_name + len - 2, "-0")) continue; - *(request + req_len) = '\0'; - strcat(request + req_len, dir_struct->d_name); - if (!(req = fopen(request, "r"))) + +// *(request + req_len) = '\0'; +// strcat(request + req_len, dir_struct->d_name); + std:string file_req(request); + file_req.append(dir_struct->d_name); + + if (!(req = fopen(file_req.c_str(), "r"))) continue; if (!(job = fopen(dir_struct->d_name, "r"))) { @@ -521,14 +537,19 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list, found = 0; break; case 'F': - *(spool_dir + spool_len) = '\0'; - strncat(spool_dir, dir_struct->d_name, len - 1); - strcat(spool_dir, "1"); - if (strcmp(spool_dir, line + 2)) - strcpy(filename1, line + 2); + { +// *(spool_dir + spool_len) = '\0'; +// strncat(spool_dir, dir_struct->d_name, len - 1); +// strcat(spool_dir, "1"); + std::string spool_chk(spool_dir); + spool_chk.append(dir_struct->d_name); + spool_chk.append("1"); + if (strcmp(spool_chk.c_str(), line + 2)) + snprintf(filename1, sizeof(filename1), "%s", line + 2); else *filename1 = '\0'; - break; + } + break; case 'O': if (s = strrchr(line, ':')) *s = '\0'; From c3fa950f8f7e96be70008c1f49111c917ccffb31 Mon Sep 17 00:00:00 2001 From: Edmond Orignac Date: Sat, 3 Apr 2021 22:25:23 +0200 Subject: [PATCH 54/90] misc.c: in cm_mbchar check string!=NULL before dereferencing it --- cde/programs/dtcm/dtcm/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtcm/dtcm/misc.c b/cde/programs/dtcm/dtcm/misc.c index 051547cba..947e0d67c 100644 --- a/cde/programs/dtcm/dtcm/misc.c +++ b/cde/programs/dtcm/dtcm/misc.c @@ -639,7 +639,7 @@ cm_mbchar(char *str) { free(buf); buf = NULL; } - if ( *string == '\0' ) { + if ( string != NULL && *string == '\0' ) { free(string_head); string_head = NULL; string = NULL; @@ -652,7 +652,7 @@ cm_mbchar(char *str) { string += num_byte; } } - + return buf; } From 2851d666eb9cca30422033842b97a44e43a0b2b7 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 22 Feb 2021 08:09:24 +0800 Subject: [PATCH 55/90] dtappbuilder: set the minimum limit for rows and columns to avoid rollover. --- cde/programs/dtappbuilder/src/ab/ui_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/ui_util.c b/cde/programs/dtappbuilder/src/ab/ui_util.c index 40e696749..1429f86c2 100644 --- a/cde/programs/dtappbuilder/src/ab/ui_util.c +++ b/cde/programs/dtappbuilder/src/ab/ui_util.c @@ -720,7 +720,7 @@ ui_size_to_row_col( XFontStruct *font; unsigned long charwidth; unsigned long lineheight; - Dimension pane_width, pane_height; + int pane_width, pane_height; if (XtIsSubclass(text, dtTermWidgetClass)) XtVaGetValues(text, @@ -776,8 +776,8 @@ ui_size_to_row_col( pane_width = width - (vsb_width + spacing) - (2*p_margin_w); pane_height = height - (hsb_height + spacing) - (2*p_margin_h); - *row_ptr = (int)((pane_height - (2*margin_h))/lineheight); - *col_ptr = (int)((pane_width - (2*margin_w))/charwidth); + *row_ptr = (int)(max(0, pane_height - 2 * margin_h) / lineheight); + *col_ptr = (int)(max(0, pane_width - 2 * margin_w) / charwidth); /* For some reason, above calculations result in rows being 1 too * large for a scrolled list widget; put in workaround until From 7287f262ad418ab2cc4d7d97c272dc3b0c56d696 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 4 Apr 2021 09:13:55 +0800 Subject: [PATCH 56/90] dtappbuilder: Fix a crash when resize a text pane. The crash is occurred when drag on the scrollbar to resize. --- cde/programs/dtappbuilder/src/ab/abobj_set.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_set.c b/cde/programs/dtappbuilder/src/ab/abobj_set.c index 868bb1a47..ff2d15a90 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_set.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_set.c @@ -1063,9 +1063,7 @@ abobj_set_num_columns( (obj_is_text(obj) || obj_is_term_pane(obj))) { objxm_obj_set_ui_arg(subObj, AB_ARG_INT, XmNcolumns, num_cols); -/* - obj_clear_flag(obj, InstantiatedFlag); -*/ + if (obj_is_text(obj)) obj_clear_flag(obj, InstantiatedFlag); obj_clear_flag(subObj, InstantiatedFlag); } else if (obj_is_choice(obj)) From 5afe94ea3ebd26835ad7e80a76e7f4a46151d040 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 5 Apr 2021 07:11:24 +0800 Subject: [PATCH 57/90] dtappbuilder: Fix unsigned integer rollover. --- cde/programs/dtappbuilder/src/ab/abobj_resize.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cde/programs/dtappbuilder/src/ab/abobj_resize.c b/cde/programs/dtappbuilder/src/ab/abobj_resize.c index 82a85ae47..30a4e59d8 100644 --- a/cde/programs/dtappbuilder/src/ab/abobj_resize.c +++ b/cde/programs/dtappbuilder/src/ab/abobj_resize.c @@ -536,7 +536,7 @@ abobj_resize( if (trans_x < 0) { resize_rect.x = 0; - resize_rect.width += trans_x; + resize_rect.width = max(0, resize_rect.width + trans_x); if (obj_is_pane(obj) || obj_is_separator(obj)) /* If a pane, attach to parent's edge */ obj_set_attachment(xy_obj, AB_CP_WEST, AB_ATTACH_OBJ, obj_get_parent(xy_obj), 0); @@ -555,7 +555,7 @@ abobj_resize( if (trans_y < 0) { resize_rect.y = 0; - resize_rect.height += trans_y; + resize_rect.height = max(0, resize_rect.height + trans_y); if (obj_is_pane(obj) || obj_is_separator(obj)) /* If a pane, attach to parent's edge */ obj_set_attachment(xy_obj, AB_CP_NORTH, AB_ATTACH_OBJ, obj_get_parent(xy_obj), 0); @@ -573,7 +573,7 @@ abobj_resize( if (resize_rect.x + (short)resize_rect.width >= (short)p_rect.width) { - resize_rect.width = (short)p_rect.width - resize_rect.x - 1; + resize_rect.width = max(0, (short)p_rect.width - resize_rect.x - 1); if (obj_is_pane(obj) || obj_is_separator(obj)) /* If a pane, attach to parent's edge */ obj_set_attachment(xy_obj, AB_CP_EAST, AB_ATTACH_OBJ, obj_get_parent(xy_obj), 0); @@ -589,7 +589,7 @@ abobj_resize( if (resize_rect.y + (short)resize_rect.height > (short)p_rect.height) { - resize_rect.height = (short)p_rect.height - resize_rect.y - 1; + resize_rect.height = max(0, (short)p_rect.height - resize_rect.y - 1); if (obj_is_pane(obj) || obj_is_separator(obj)) /* If a pane, attach to parent's edge */ obj_set_attachment(xy_obj, AB_CP_SOUTH, AB_ATTACH_OBJ, obj_get_parent(xy_obj), 0); From fbe2b20bc6b183c1dda3d93f8ed3b75fab5073d2 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 17 Apr 2021 01:55:43 +0800 Subject: [PATCH 58/90] dtterm: Change the default log host to localhost. To check the log function, add -DLOG_USAGE to the Imakefile then build the dtterm. There are a logger in the util directory, run it to receive log messages. --- cde/programs/dtterm/DtTermLogit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtterm/DtTermLogit.c b/cde/programs/dtterm/DtTermLogit.c index 68d2eeb47..02ac53c00 100644 --- a/cde/programs/dtterm/DtTermLogit.c +++ b/cde/programs/dtterm/DtTermLogit.c @@ -46,8 +46,8 @@ #include #include -#define LOG_HOST "hpcvusj.cv.hp.com" -#define LOG_ADDR "15.0.209.35" +#define LOG_HOST "localhost" +#define LOG_ADDR "127.0.0.1" #define LOG_PORT "4444" #define WAIT_INTERVAL 5 #define RETRIES 5 @@ -301,7 +301,11 @@ doLog(int noFork, char *msg) } if (!noFork) { +#ifdef _NFILE for (i1 = 0; i1 < _NFILE; i1++) { +#else + for (i1 = 0; i1 < sysconf(_SC_OPEN_MAX); i1++) { +#endif if (i1 != s) { (void) close(i1); } From 29d6a297083ab6dc0eb9d2a2419f71bf167e5c6b Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Tue, 4 May 2021 03:00:57 +0800 Subject: [PATCH 59/90] dtinfo: Fix a segmentation fault. The return value from CanvasRenderer::_dofont is a pointer. It will be passed to the free function. Ensure that pointer always points to a dynamically allocated memory to avoid segmentation faults. --- cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C index bc047b653..0c82adfe7 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C @@ -621,7 +621,7 @@ CanvasRenderer::_dofont(const FeatureSet &fs, Symbol** symbols) // if we still can't find one go with whatever. else { - xlfd = (char*)"-*-*-*-*-*-*-*-*-*-*-*-*-*"; + xlfd = strdup("-*-*-*-*-*-*-*-*-*-*-*-*-*"); } #ifdef FONT_DEBUG fprintf(stderr, "resulting in \"%s\".\n", xlfd); From 65e7a65d8bea4a98c296222ee3ed3063c1833dc6 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Thu, 28 Jan 2021 07:45:13 +0800 Subject: [PATCH 60/90] Add lib DtPamSvc. --- cde/config/cf/cde.tmpl | 23 +++ cde/lib/DtPamSvc/Imakefile | 18 +++ cde/lib/DtPamSvc/PamSvc.c | 322 +++++++++++++++++++++++++++++++++++++ cde/lib/DtPamSvc/PamSvc.h | 62 +++++++ cde/lib/Imakefile | 10 +- 5 files changed, 433 insertions(+), 2 deletions(-) create mode 100644 cde/lib/DtPamSvc/Imakefile create mode 100644 cde/lib/DtPamSvc/PamSvc.c create mode 100644 cde/lib/DtPamSvc/PamSvc.h diff --git a/cde/config/cf/cde.tmpl b/cde/config/cf/cde.tmpl index 24707b2f8..59f512474 100644 --- a/cde/config/cf/cde.tmpl +++ b/cde/config/cf/cde.tmpl @@ -55,6 +55,22 @@ XCOMM $XConsortium: cde.tmpl /main/2 1996/12/04 10:13:09 swick $ # define SharedPamRev CDESharedRev #endif +#ifndef SharedLibDtPamSvc +# define SharedLibDtPamSvc HasSharedLibraries +#endif +#ifndef NormalLibDtPamSvc +# define NormalLibDtPamSvc (!SharedLibDtPamSvc | ForceNormalLib) +#endif +#ifndef DebugLibDtPamSvc +# define DebugLibDtPamSvc NO +#endif +#ifndef ProfileLibDtPamSvc +# define ProfileLibDtPamSvc NO +#endif +#ifndef SharedDtPamSvcRev +# define SharedDtPamSvcRev CDESharedRev +#endif + #ifndef SharedLibTt # define SharedLibTt HasSharedLibraries #endif @@ -280,6 +296,7 @@ XCOMM $XConsortium: cde.tmpl /main/2 1996/12/04 10:13:09 swick $ TOP_CDE_INCLUDES = -I$(CDEINCLUDESRC) CDELIBSRC = $(CDETOP)/lib PAMSRC = $(CDELIBSRC)/pam/libpam + DTPAMSVCSRC = $(CDELIBSRC)/DtPamSvc TTSRC = $(CDELIBSRC)/tt DTSVCSRC = $(CDELIBSRC)/DtSvc DTSEARCHSRC = $(CDELIBSRC)/DtSearch @@ -350,6 +367,12 @@ SharedLibReferences(PAM,pam,$(PAMSRC),SOPAMREV,SharedPamRev) ProjectUnsharedLibReferences(PAM,pam,$(PAMSRC),CDEBuildLibDir) #endif +#if SharedLibDtPamSvc +SharedLibReferences(DTPAMSVC,dtpamsvc,$(DTPAMSVCSRC),SODTPAMSVCREV,SharedDtPamSvcRev) +#else +ProjectUnsharedLibReferences(DTPAMSVC,dtpamsvc,$(DTPAMSVCSRC),CDEBuildLibDir) +#endif + #if SharedLibTt SharedLibReferences(TT,tt,$(TTSRC)/lib,SOTTREV,SharedTtRev) #else diff --git a/cde/lib/DtPamSvc/Imakefile b/cde/lib/DtPamSvc/Imakefile new file mode 100644 index 000000000..9a6ed5fdd --- /dev/null +++ b/cde/lib/DtPamSvc/Imakefile @@ -0,0 +1,18 @@ +#define DoNormalLib NormalLibDtPamSvc +#define DoSharedLib SharedLibDtPamSvc +#define DoDebugLib DebugLibDtPamSvc +#define DoProfileLib ProfileLibDtPamSvc +#define LibName DtPamSvc +#define SoRev SOPAMREV +#define LibHeaders NO + +#include + +HEADERS = PamSvc.h +SRCS = PamSvc.c +OBJS = PamSvc.o +REQUIREDLIBS = -lpam + +#include + +DependTarget() diff --git a/cde/lib/DtPamSvc/PamSvc.c b/cde/lib/DtPamSvc/PamSvc.c new file mode 100644 index 000000000..376bcd776 --- /dev/null +++ b/cde/lib/DtPamSvc/PamSvc.c @@ -0,0 +1,322 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ +/* $TOG: pam_svc.c /main/5 1997/06/04 16:30:21 samborn $ */ +/******************************************************************************* + ** + ** pam_svc.c 1.10 95/11/25 + ** + ** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved. + ** + ** This file contains procedures specific to use of + ** PAM (Pluggable Authentication Module) security library. + ** + *******************************************************************************/ +/* * + * (c) Copyright 1993, 1994 Hewlett-Packard Company * + * (c) Copyright 1993, 1994 International Business Machines Corp. * + * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc. * + * (c) Copyright 1993, 1994 Novell, Inc. * + */ + +/* + * Header Files + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#include +#else +#include +#endif +#include "PamSvc.h" + +/* + * Local function declarations + */ + +static int login_conv(int num_msg, const struct pam_message **msg, + struct pam_response **response, void *appdata_ptr); + +static char* create_devname(char* short_devname); + +/* + * Local structures and variables + */ + +static struct pam_conv pam_conv = {login_conv, NULL}; +static char *saved_user_passwd; +static pam_handle_t *pamh = NULL; +static int pam_auth_trys = 0; + +/**************************************************************************** + * PamInit + * + * Initialize or Update PAM datastructures. + * + ****************************************************************************/ + +static int PamInit(char* prog_name, + char* user, + char* line_dev, + char* display_name) +{ + int status=PAM_SUCCESS; + + if (!pamh) { + /* Open PAM (Plugable Authentication module ) connection */ + status = pam_start( prog_name, user, &pam_conv, &pamh ); + if (status != PAM_SUCCESS) pamh = NULL; + } else { + if (prog_name) pam_set_item(pamh, PAM_SERVICE, prog_name); + if (user) pam_set_item(pamh, PAM_USER, user); + } + + if (status == PAM_SUCCESS) { + if (line_dev) pam_set_item(pamh, PAM_TTY, line_dev); + if (display_name) pam_set_item(pamh, PAM_RHOST, display_name); + } + + return(status); +} + +/**************************************************************************** + * _DtAuthentication + * + * Authenticate that user / password combination is legal for this system + * + ****************************************************************************/ + +int _DtAuthentication ( char* prog_name, + char* display_name, + char* user_passwd, + char* user, + char* line ) +{ + int status; + char* line_str = line ? line : "NULL"; + char* line_dev = create_devname(line_str); + + if (!user_passwd) + /* Password challenge required for dtlogin authentication */ + return(PAM_AUTH_ERR); + + status = PamInit(prog_name, user, line_dev, display_name); + + if (status == PAM_SUCCESS) { + struct passwd *pwd; + + saved_user_passwd = user_passwd; + status = pam_authenticate( pamh, 0 ); + pam_auth_trys++; + + if (status != PAM_SUCCESS) { + sleep(PAM_LOGIN_SLEEPTIME); + if (pam_auth_trys > PAM_LOGIN_MAXTRIES) { + sleep(PAM_LOGIN_DISABLETIME); + } + } + }; + + if (status != PAM_SUCCESS) { + if (pamh) { + pam_end(pamh, PAM_ABORT); + pamh=NULL; + } + } + + return(status); +} + +/**************************************************************************** + * _DtAccounting + * + * Work related to open and close of user sessions + ****************************************************************************/ + +int _DtAccounting( char* prog_name, + char* display_name, + char* entry_id, + char* user, + char* line, + pid_t pid, + int entry_type, + int exitcode ) +{ + int session_type, status; + char *line_str = line ? line : "NULL"; + char *line_dev = create_devname(line_str); + + /* Open PAM (Plugable Authentication module ) connection */ + + status = PamInit(prog_name, user, line_dev, display_name); + + /* Session accounting */ + + if (status == PAM_SUCCESS) switch(entry_type) { + case DEAD_PROCESS: + status = pam_close_session(pamh, 0); + break; + + case USER_PROCESS: + case LOGIN_PROCESS: + default: + status = pam_open_session(pamh, 0); + break; + } + + free(line_dev); + return(status); +} + +/**************************************************************************** + * _DtSetCred + * + * Set Users login credentials: uid, gid, and group lists + ****************************************************************************/ + +int _DtSetCred(char* prog_name, char* user, uid_t uid, gid_t gid) +{ + int cred_type, status; + + status = PamInit(prog_name, user, NULL, NULL); + + /* Set users credentials */ + + if (status == PAM_SUCCESS && setgid(gid) == -1) + status = DT_BAD_GID; + + if (status == PAM_SUCCESS && + ( !user) || (initgroups(user, gid) == -1) ) + status = DT_INITGROUP_FAIL; + + if (status == PAM_SUCCESS) + status = pam_setcred(pamh, PAM_ESTABLISH_CRED); + + if (status == PAM_SUCCESS && (setuid(uid) == -1)) + status = DT_BAD_UID; + + return(status); +} + +/*************************************************************************** + * create_devname + * + * A utility function. Takes short device name like "console" and returns + * a long device name like "/dev/console" + ***************************************************************************/ + +static char* create_devname(char* short_devname) +{ + char* long_devname; + + if (short_devname == NULL) + short_devname = ""; + + long_devname = (char *) malloc (strlen(short_devname) + 5); + + if (long_devname == NULL) + return(NULL); + + strcpy(long_devname,"/dev/"); + strcat(long_devname, short_devname); + + return(long_devname); +} + +/***************************************************************************** + * login_conv(): + * + * This is a conv (conversation) function called from the PAM + * authentication scheme. It returns the user's password when requested by + * internal PAM authentication modules and also logs any internal PAM error + * messages. + *****************************************************************************/ + +static int login_conv(int num_msg, const struct pam_message **msg, + struct pam_response **response, void *appdata_ptr) +{ + const struct pam_message *m; + struct pam_response *r; + char *temp; + int k; + +#ifdef lint + conv_id = conv_id; +#endif + if (num_msg <= 0) + return (PAM_CONV_ERR); + + *response = (struct pam_response*) + calloc(num_msg, sizeof (struct pam_response)); + if (*response == NULL) + return (PAM_CONV_ERR); + + (void) memset(*response, 0, sizeof (struct pam_response)); + + k = num_msg; + m = *msg; + r = *response; + while (k--) { + + switch (m->msg_style) { + + case PAM_PROMPT_ECHO_OFF: + if (saved_user_passwd != NULL) { + r->resp = (char *) malloc(strlen(saved_user_passwd)+1); + if (r->resp == NULL) { + /* __pam_free_resp(num_msg, *response); */ + *response = NULL; + return (PAM_CONV_ERR); + } + (void) strcpy(r->resp, saved_user_passwd); + r->resp_retcode=0; + } + + m++; + r++; + break; + + case PAM_ERROR_MSG: + m++; + r++; + break; + + case PAM_TEXT_INFO: + m++; + r++; + break; + + default: + break; + } + } + + return (PAM_SUCCESS); +} diff --git a/cde/lib/DtPamSvc/PamSvc.h b/cde/lib/DtPamSvc/PamSvc.h new file mode 100644 index 000000000..d28b42a85 --- /dev/null +++ b/cde/lib/DtPamSvc/PamSvc.h @@ -0,0 +1,62 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ +/* $XConsortium: pam_svc.h /main/3 1996/10/30 11:13:40 drk $ */ +/******************************************************************************* +** +** "@(#)pam_svc.h 1.4 95/09/12 +** +** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved. +** +** This file contains header info related to use of PAM +** (Pluggable Authentication Module) library. +** +*******************************************************************************/ +/* * + * (c) Copyright 1993, 1994 Hewlett-Packard Company * + * (c) Copyright 1993, 1994 International Business Machines Corp. * + * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc. * + * (c) Copyright 1993, 1994 Novell, Inc. * + */ + +#ifndef _DT_PAM_SVC_H +#define _DT_PAM_SVC_H + +#include + +#define PAM_LOGIN_MAXTRIES 5 +#define PAM_LOGIN_SLEEPTIME 4 +#define PAM_LOGIN_DISABLETIME 20 + +#define DT_BAD_GID 29 /* Invalid Group ID */ +#define DT_INITGROUP_FAIL 30 /* group IDs init failed */ +#define DT_BAD_UID 31 /* Invaid User ID */ + +/* + * External procedure declarations + */ + +extern int _DtAuthentication(char*, char*, char*, char*, char*); +extern int _DtAccounting(char*, char*, char[], char*, char*, pid_t, int, int); +extern int _DtSetCred(char*, char *, uid_t, gid_t); + +#endif /* _DT_PAM_SVC_H */ diff --git a/cde/lib/Imakefile b/cde/lib/Imakefile index df37a00cc..dfe408f17 100644 --- a/cde/lib/Imakefile +++ b/cde/lib/Imakefile @@ -12,8 +12,14 @@ PAMDIR = pam PAMDIR = #endif -SUBDIRS = $(XINDIR) $(PAMDIR) tt DtSvc DtSearch DtWidget DtHelp DtPrint \ - DtTerm DtMrm csa +#if defined(HasPamLibrary) && HasPamLibrary +DTPAMSVCDIR = DtPamSvc +#else +DTPAMSVCDIR = +#endif + +SUBDIRS = $(XINDIR) $(PAMDIR) $(DTPAMSVCDIR) tt DtSvc DtSearch DtWidget DtHelp \ + DtPrint DtTerm DtMrm csa MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) From fa2f6a39ccf78b198bb56f20f2bf2703606acfa3 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sat, 30 Jan 2021 09:41:14 +0800 Subject: [PATCH 61/90] Add PAM support to dtlogin. --- cde/programs/dtlogin/Imakefile | 10 ++++- cde/programs/dtlogin/account.c | 39 ++++++++++++++++++- cde/programs/dtlogin/config/Imakefile | 15 ++++++- cde/programs/dtlogin/config/Xsetup.src | 15 +++++++ .../dtlogin/config/dtlogin.pam.conf.src | 11 ++++++ cde/programs/dtlogin/session.c | 29 ++++++++++++-- cde/programs/dtlogin/sysauth.c | 18 ++++++--- 7 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 cde/programs/dtlogin/config/dtlogin.pam.conf.src diff --git a/cde/programs/dtlogin/Imakefile b/cde/programs/dtlogin/Imakefile index 7e1249749..057b7fb25 100644 --- a/cde/programs/dtlogin/Imakefile +++ b/cde/programs/dtlogin/Imakefile @@ -130,6 +130,13 @@ DEPXAUTHLIB = DEPXDMCPLIB = #endif +#ifdef HasPamLibrary +DTPAMSVCLIB = -lDtPamSvc +EXTRA_DEFINES += -DHAS_PAM_LIBRARY +#else +DTPAMSVCLIB = +#endif + /************************************************************************** * * Source and object modules @@ -291,7 +298,8 @@ EXTRA_RES_DEFINES = \ $(DEPXTOOLLIB) $(DEPXLIB) DEPLIBS3 = $(DEPXDMCPLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB) - BASE_LIBS1 = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(LOGINXLIB) + BASE_LIBS1 = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(LOGINXLIB) \ + $(DTPAMSVCLIB) BASE_LIBS2 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) \ $(XTOOLLIB) $(XLIB) $(XINLIB) BASE_LIBS3 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XDMCPLIB) $(XMLIB) \ diff --git a/cde/programs/dtlogin/account.c b/cde/programs/dtlogin/account.c index 3ea5c320f..b70276573 100644 --- a/cde/programs/dtlogin/account.c +++ b/cde/programs/dtlogin/account.c @@ -137,9 +137,14 @@ Account( struct display *d, char *user, char *line, pid_t pid, #endif /* NeedWidePrototypes */ waitType exitcode ) { -#if !defined(CSRG_BASED) /* we cannot do this on BSD ... */ +#if !defined(CSRG_BASED) || defined(HAS_PAM_LIBRARY) +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 + struct utmpx utmp; /* local struct for new entry */ + struct utmpx *u; /* pointer to entry in utmp file */ +#else struct utmp utmp; /* local struct for new entry */ struct utmp *u; /* pointer to entry in utmp file */ +#endif int fd; char buf[32]; char* user_str = user ? user : "NULL"; @@ -169,6 +174,9 @@ Account( struct display *d, char *user, char *line, pid_t pid, #ifdef PAM PamAccounting("dtlogin", d->name, d->utmpId, user, line, pid, type, exitcode); +#elif defined(HAS_PAM_LIBRARY) + _DtAccounting("dtlogin", d->name, d->utmpId, user, + line, pid, type, exitcode); #else # ifdef SUNAUTH solaris_accounting("dtlogin", d->name, d->utmpId, user, @@ -178,14 +186,23 @@ Account( struct display *d, char *user, char *line, pid_t pid, #ifdef sun return; +#else +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 + bzero(&utmp, sizeof(struct utmpx)); #else bzero(&utmp, sizeof(struct utmp)); +#endif strncpy(utmp.ut_id, d->utmpId, sizeof(u->ut_id) - 1); utmp.ut_type = LOGIN_PROCESS; +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 + setutxent(); + if ( (u = getutxid(&utmp)) == NULL ) u = &utmp; +#else setutent(); if ( (u = getutid(&utmp)) == NULL ) u = &utmp; +#endif /* * make sure process ID's match if this is DEAD_PROCESS... @@ -195,7 +212,11 @@ Account( struct display *d, char *user, char *line, pid_t pid, if ((type == DEAD_PROCESS && pid != 0 && u->ut_pid != pid) || (type == DEAD_PROCESS && u->ut_type == DEAD_PROCESS) ) { +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 + endutxent(); +#else endutent(); +#endif return; } @@ -247,8 +268,10 @@ Account( struct display *d, char *user, char *line, pid_t pid, if (type) { u->ut_type = type; if (type == DEAD_PROCESS) { +#if !(defined(__FreeBSD__) && OSMAJORVERSION > 8) u->ut_exit.e_termination = waitSig(exitcode); u->ut_exit.e_exit = waitCode(exitcode); +#endif #ifndef SVR4 (void) memset((char *) u->ut_host, '\0', sizeof(u->ut_host)); #endif @@ -263,11 +286,17 @@ Account( struct display *d, char *user, char *line, pid_t pid, #endif } +#if !(defined(__FreeBSD__) && OSMAJORVERSION > 8) if (type == USER_PROCESS) u->ut_exit.e_exit = (d->displayType.location == Local ? 1 : 0 ); +#endif } +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 + (void) time(&u->ut_tv); +#else (void) time(&u->ut_time); +#endif /* * write to utmp... @@ -277,9 +306,14 @@ Account( struct display *d, char *user, char *line, pid_t pid, * to wtmp!) */ +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 + pututxline(u); +#else pututline(u); +#endif +#if !(defined(__FreeBSD__) && OSMAJORVERSION > 8) /* * write the same entry to wtmp... */ @@ -297,6 +331,9 @@ Account( struct display *d, char *user, char *line, pid_t pid, */ endutent(); +#else + endutxent(); +#endif #ifdef __PASSWD_ETC /* Now fill in the "rgy utmp" struct */ diff --git a/cde/programs/dtlogin/config/Imakefile b/cde/programs/dtlogin/config/Imakefile index b07623e40..4728678e2 100644 --- a/cde/programs/dtlogin/config/Imakefile +++ b/cde/programs/dtlogin/config/Imakefile @@ -26,6 +26,14 @@ LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \ LOCAL_CPP_DEFINES += -DFREEBSD #endif +#ifdef HasPamLibrary +LOCAL_CPP_DEFINES += -DHAS_PAM_LIBRARY +#ifdef PamAuthenticationModule +PAM_AUTHENTICATION_MODULE=PamAuthenticationModule +LOCAL_CPP_DEFINES += -DPAM_AUTHENTICATION_MODULE=$(PAM_AUTHENTICATION_MODULE) +#endif +#endif + #ifdef SunArchitecture EXTRA_CPP_TARGETS = \ 0015.sun.env \ @@ -48,7 +56,8 @@ CPP_TARGETS = \ Xstartup current.session \ display.current.session display.home.session \ dtlslocale dtprofile \ - home.session $(EXTRA_CPP_TARGETS) + home.session dtlogin.pam.conf \ + $(EXTRA_CPP_TARGETS) AllTarget($(CPP_TARGETS)) @@ -81,3 +90,7 @@ CppSourceFile(display.home.session,display.home.session.src,$(LOCAL_CPP_DEFINES) CppSourceFile(dtlslocale,dtlslocale.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(dtprofile,dtprofile.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(home.session,home.session.src,$(LOCAL_CPP_DEFINES),) + +#ifdef HasPamLibrary +CppSourceFile(dtlogin.pam.conf,dtlogin.pam.conf.src,$(LOCAL_CPP_DEFINES),) +#endif diff --git a/cde/programs/dtlogin/config/Xsetup.src b/cde/programs/dtlogin/config/Xsetup.src index 3c6a0e63f..b4a06f870 100644 --- a/cde/programs/dtlogin/config/Xsetup.src +++ b/cde/programs/dtlogin/config/Xsetup.src @@ -80,3 +80,18 @@ fi fi fi #endif + +#ifdef HAS_PAM_LIBRARY +#ifdef __FreeBSD__ +#define PAM_D /usr/local/etc/pam.d +#else +#define PAM_D /etc/pam.d +#endif + + if [ ! -f PAM_D/dtlogin ]; then + if [ -f CDE_INSTALLATION_TOP/config/dtlogin.pam.conf ]; then + /bin/cp CDE_INSTALLATION_TOP/config/dtlogin.pam.conf PAM_D/dtlogin + /bin/chmod 644 PAM_D/dtlogin + fi + fi +#endif diff --git a/cde/programs/dtlogin/config/dtlogin.pam.conf.src b/cde/programs/dtlogin/config/dtlogin.pam.conf.src new file mode 100644 index 000000000..72db900b3 --- /dev/null +++ b/cde/programs/dtlogin/config/dtlogin.pam.conf.src @@ -0,0 +1,11 @@ +#ifdef PAM_AUTHENTICATION_MODULE +auth sufficient PAM_AUTHENTICATION_MODULE +#endif +auth required pam_unix.so + +account required pam_nologin.so +account required pam_unix.so + +session required pam_lastlog.so + +password required pam_deny.so diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c index c5b587fe2..e5771038c 100644 --- a/cde/programs/dtlogin/session.c +++ b/cde/programs/dtlogin/session.c @@ -166,6 +166,7 @@ struct greet_state { }; char *globalDisplayName; +extern char *progName; /* Global argv[0]; dtlogin name and path */ /*************************************************************************** * @@ -276,9 +277,10 @@ SessionPingFailed( struct display *d ) AbortClient (clientPid); source (&verify, d->reset); + char* user = getEnv (verify.userEnviron, "USER"); + #if defined (PAM) || defined(SUNAUTH) { - char* user = getEnv (verify.userEnviron, "USER"); char* ttyLine = d->gettyLine; #ifdef DEF_NETWORK_DEV @@ -310,6 +312,9 @@ SessionPingFailed( struct display *d ) } #endif +#if !defined(sun) && defined(HAS_PAM_LIBRARY) + Account(d, user, NULL, clientPid, DEAD_PROCESS, NULL); +#endif } SessionExit (d, RESERVER_DISPLAY); } @@ -597,9 +602,10 @@ ManageSession( struct display *d ) Debug ("Source reset program %s\n", d->reset); source (&verify, d->reset); + char* user = getEnv (verify.userEnviron, "USER"); + #if defined(PAM) || defined(SUNAUTH) { - char* user = getEnv (verify.userEnviron, "USER"); char* ttyLine = d->gettyLine; # ifdef DEF_NETWORK_DEV @@ -631,6 +637,10 @@ ManageSession( struct display *d ) } #endif +#if !defined(sun) && defined(HAS_PAM_LIBRARY) + Account(d, user, NULL, clientPid, DEAD_PROCESS, NULL); +#endif + SessionExit (d, OBEYSESS_DISPLAY); } @@ -1262,7 +1272,7 @@ StartClient( struct verify_info *verify, struct display *d, int *pidp ) } #endif -#if !defined(sun) && !defined(CSRG_BASED) +#if !defined(sun) && (!defined(CSRG_BASED) || defined(HAS_PAM_LIBRARY)) Account(d, user, NULL, getpid(), USER_PROCESS, status); #endif @@ -1344,6 +1354,18 @@ StartClient( struct verify_info *verify, struct display *d, int *pidp ) Debug("Can't set User's Credentials (user=%s)\n",user); return(0); } +#elif defined(HAS_PAM_LIBRARY) + char *prog_name = strrchr(progName, '/'); + if (!prog_name || _DtSetCred(prog_name + 1, user, verify->uid, +#ifdef NGROUPS + verify->groups[0] +#else + verify->gid +#endif + ) > 0 ) { + Debug("Can't set User's Credentials (user=%s)\n",user); + return(0); + } #endif #ifdef SUNAUTH @@ -1843,7 +1865,6 @@ execute(char **argv, char **environ ) #define MSGSIZE 512 extern int session_set; -extern char *progName; /* Global argv[0]; dtlogin name and path */ int response[2], request[2]; diff --git a/cde/programs/dtlogin/sysauth.c b/cde/programs/dtlogin/sysauth.c index 34a987b28..fd7d453c2 100644 --- a/cde/programs/dtlogin/sysauth.c +++ b/cde/programs/dtlogin/sysauth.c @@ -84,7 +84,7 @@ #include #include -#ifdef PAM +#if defined(PAM) || defined(HAS_PAM_LIBRARY) #include #endif @@ -114,7 +114,8 @@ /* * Define as generic those without platform specific code. */ -#if !(defined(__hpux) || defined(_AIX) || defined(sun)) +#if !(defined(__hpux) || defined(_AIX) || defined(sun) || \ + defined(HAS_PAM_LIBRARY)) #define generic #endif @@ -1061,7 +1062,8 @@ WriteBtmp( char *name ) ***************************************************************************/ -#ifdef sun +#if defined(sun) || defined(HAS_PAM_LIBRARY) + /*************************************************************************** * * Start authentication routines (SUN) @@ -1150,8 +1152,14 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg ) * Authenticate user and return status */ -#ifdef PAM - status = PamAuthenticate("dtlogin", d->name, passwd, name, ttyLine); +#if defined(PAM) || defined(HAS_PAM_LIBRARY) + status = +#ifdef PAM + PamAuthenticate +#else + _DtAuthentication +#endif + ("dtlogin", d->name, passwd, name, ttyLine); switch(status) { case PAM_SUCCESS: From 085c8bdc3770ac7356c1cf7651966bc286378dec Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 01:56:14 +0800 Subject: [PATCH 62/90] dtlogin: get rid of some warnings. --- cde/programs/dtlogin/Imakefile | 2 +- cde/programs/dtlogin/config/Imakefile | 4 ++-- cde/programs/dtlogin/session.c | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cde/programs/dtlogin/Imakefile b/cde/programs/dtlogin/Imakefile index 057b7fb25..66ea26222 100644 --- a/cde/programs/dtlogin/Imakefile +++ b/cde/programs/dtlogin/Imakefile @@ -130,7 +130,7 @@ DEPXAUTHLIB = DEPXDMCPLIB = #endif -#ifdef HasPamLibrary +#if defined(HasPamLibrary) && HasPamLibrary DTPAMSVCLIB = -lDtPamSvc EXTRA_DEFINES += -DHAS_PAM_LIBRARY #else diff --git a/cde/programs/dtlogin/config/Imakefile b/cde/programs/dtlogin/config/Imakefile index 4728678e2..3f6b46ac0 100644 --- a/cde/programs/dtlogin/config/Imakefile +++ b/cde/programs/dtlogin/config/Imakefile @@ -26,7 +26,7 @@ LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \ LOCAL_CPP_DEFINES += -DFREEBSD #endif -#ifdef HasPamLibrary +#if defined(HasPamLibrary) && HasPamLibrary LOCAL_CPP_DEFINES += -DHAS_PAM_LIBRARY #ifdef PamAuthenticationModule PAM_AUTHENTICATION_MODULE=PamAuthenticationModule @@ -91,6 +91,6 @@ CppSourceFile(dtlslocale,dtlslocale.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(dtprofile,dtprofile.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(home.session,home.session.src,$(LOCAL_CPP_DEFINES),) -#ifdef HasPamLibrary +#if defined(HasPamLibrary) && HasPamLibrary CppSourceFile(dtlogin.pam.conf,dtlogin.pam.conf.src,$(LOCAL_CPP_DEFINES),) #endif diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c index e5771038c..7de230dd8 100644 --- a/cde/programs/dtlogin/session.c +++ b/cde/programs/dtlogin/session.c @@ -105,6 +105,10 @@ #include "rgy_base.h" #endif +#ifdef HAS_PAM_LIBRARY +#include +#endif + #ifdef SIA static SIAENTITY *siaHandle = NULL; @@ -313,7 +317,7 @@ SessionPingFailed( struct display *d ) #endif #if !defined(sun) && defined(HAS_PAM_LIBRARY) - Account(d, user, NULL, clientPid, DEAD_PROCESS, NULL); + Account(d, user, NULL, clientPid, DEAD_PROCESS, 0); #endif } SessionExit (d, RESERVER_DISPLAY); @@ -638,7 +642,7 @@ ManageSession( struct display *d ) #endif #if !defined(sun) && defined(HAS_PAM_LIBRARY) - Account(d, user, NULL, clientPid, DEAD_PROCESS, NULL); + Account(d, user, NULL, clientPid, DEAD_PROCESS, 0); #endif SessionExit (d, OBEYSESS_DISPLAY); From f13fdec2fbc28518d13a9d6253a17d7641c825d4 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 02:14:34 +0800 Subject: [PATCH 63/90] Add PAM support to dtsession. --- cde/programs/dtsession/Imakefile | 12 +++++++++- cde/programs/dtsession/SmLock.c | 22 +++++++++++++++++-- cde/programs/dtsession/config/Imakefile | 13 +++++++++++ .../dtsession/config/dtsession.pam.conf.src | 10 +++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 cde/programs/dtsession/config/Imakefile create mode 100644 cde/programs/dtsession/config/dtsession.pam.conf.src diff --git a/cde/programs/dtsession/Imakefile b/cde/programs/dtsession/Imakefile index cdd0fa30a..10564e038 100644 --- a/cde/programs/dtsession/Imakefile +++ b/cde/programs/dtsession/Imakefile @@ -4,6 +4,12 @@ DEPEND_DEFINES = $(DEPENDDEFINES) DEFINES = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \ -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" +#if defined(HasPamLibrary) && HasPamLibrary +DTPAMSVCLIB = -lDtPamSvc +#else +DTPAMSVCLIB = +#endif + #if defined(SunArchitecture) DEPLIBS = $(DEPDTWIDGETLIB) $(DEPDTSVCLIB) $(DEPTTLIB) \ $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB) @@ -13,7 +19,7 @@ LOCAL_LIBRARIES = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) \ DEPLIBS = $(DEPDTHELPLIB) $(DEPDTWIDGETLIB) $(DEPDTSVCLIB) $(DEPTTLIB) \ $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB) LOCAL_LIBRARIES = $(DTHELPLIB) $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) \ - $(XMLIB) $(XTOOLLIB) $(USE_XHPLIB) $(XLIB) + $(XMLIB) $(XTOOLLIB) $(USE_XHPLIB) $(XLIB) $(DTPAMSVCLIB) #endif /* SunArchitecture */ SYS_LIBRARIES = -lm @@ -62,6 +68,10 @@ EXTRA_DEFINES = -D${PROGRAMS} $(XINOPT) -DUSE_X11SSEXT SYS_LIBRARIES = $(XINLIB) -lXss -lcrypt -lm #endif +#if defined(HasPamLibrary) && HasPamLibrary +EXTRA_DEFINES += -DHAS_PAM_LIBRARY +#endif + PROGRAMS=dtsession /**** Every .o except version.o may only be built in a remote diff --git a/cde/programs/dtsession/SmLock.c b/cde/programs/dtsession/SmLock.c index e20207131..46a0e8f77 100644 --- a/cde/programs/dtsession/SmLock.c +++ b/cde/programs/dtsession/SmLock.c @@ -85,6 +85,10 @@ #include #endif +#ifdef HAS_PAM_LIBRARY +#include +#endif + #include "Sm.h" #include "SmGlobals.h" #include "SmUI.h" @@ -1602,7 +1606,22 @@ localAuthenticate( char *name, uid_t uid, char *passwd ) -#ifdef SIA +#if defined(HAS_PAM_LIBRARY) +{ + char *service; + struct passwd *pwent; + + if (!(name || passwd)) return True; + if (!passwd) return False; + if (!(pwent = name ? getpwnam(name) : getpwuid(uid))) return False; + + endpwent(); + + if (!(service = strrchr(smGD.programName, '/'))) return False; + + return !_DtAuthentication(service + 1, NULL, passwd, pwent->pw_name, NULL); +} +#elif defined(SIA) @@ -1962,4 +1981,3 @@ Authenticate( return(arc == 0 ? True : False); } #endif /* _AIX && _POWER */ - diff --git a/cde/programs/dtsession/config/Imakefile b/cde/programs/dtsession/config/Imakefile new file mode 100644 index 000000000..702ea0456 --- /dev/null +++ b/cde/programs/dtsession/config/Imakefile @@ -0,0 +1,13 @@ +#if defined(HasPamLibrary) && HasPamLibrary +LOCAL_CPP_DEFINES = -DHAS_PAM_LIBRARY +#ifdef PamAuthenticationModule +PAM_AUTHENTICATION_MODULE=PamAuthenticationModule +LOCAL_CPP_DEFINES += -DPAM_AUTHENTICATION_MODULE=$(PAM_AUTHENTICATION_MODULE) +#endif + +CPP_TARGETS = dtsession.pam.conf + +AllTarget($(CPP_TARGETS)) + +CppSourceFile(dtsession.pam.conf,dtsession.pam.conf.src,$(LOCAL_CPP_DEFINES),) +#endif diff --git a/cde/programs/dtsession/config/dtsession.pam.conf.src b/cde/programs/dtsession/config/dtsession.pam.conf.src new file mode 100644 index 000000000..04338e27b --- /dev/null +++ b/cde/programs/dtsession/config/dtsession.pam.conf.src @@ -0,0 +1,10 @@ +#ifdef PAM_AUTHENTICATION_MODULE +auth sufficient PAM_AUTHENTICATION_MODULE +#endif +auth required pam_unix.so + +account required pam_deny.so + +session required pam_deny.so + +password required pam_deny.so From 704b1562571b2c984d037917bc9dba664858d98b Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 02:16:51 +0800 Subject: [PATCH 64/90] DtPamSvc: update Imakefile. --- cde/lib/DtPamSvc/Imakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/lib/DtPamSvc/Imakefile b/cde/lib/DtPamSvc/Imakefile index 9a6ed5fdd..18630466d 100644 --- a/cde/lib/DtPamSvc/Imakefile +++ b/cde/lib/DtPamSvc/Imakefile @@ -4,7 +4,7 @@ #define DoProfileLib ProfileLibDtPamSvc #define LibName DtPamSvc #define SoRev SOPAMREV -#define LibHeaders NO +#define LibHeaders YES #include From 59a3d8221c3761cade00cb10ed4abd4ee3036a89 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 04:31:27 +0800 Subject: [PATCH 65/90] dtlogin: rename PAM config file. --- cde/programs/dtlogin/config/Imakefile | 4 ++-- cde/programs/dtlogin/config/Xsetup.src | 13 +++++++++---- .../{dtlogin.pam.conf.src => pam.d.dtlogin.src} | 0 3 files changed, 11 insertions(+), 6 deletions(-) rename cde/programs/dtlogin/config/{dtlogin.pam.conf.src => pam.d.dtlogin.src} (100%) diff --git a/cde/programs/dtlogin/config/Imakefile b/cde/programs/dtlogin/config/Imakefile index 3f6b46ac0..91d21274b 100644 --- a/cde/programs/dtlogin/config/Imakefile +++ b/cde/programs/dtlogin/config/Imakefile @@ -56,7 +56,7 @@ CPP_TARGETS = \ Xstartup current.session \ display.current.session display.home.session \ dtlslocale dtprofile \ - home.session dtlogin.pam.conf \ + home.session pam.d.dtlogin \ $(EXTRA_CPP_TARGETS) AllTarget($(CPP_TARGETS)) @@ -92,5 +92,5 @@ CppSourceFile(dtprofile,dtprofile.src,$(LOCAL_CPP_DEFINES),) CppSourceFile(home.session,home.session.src,$(LOCAL_CPP_DEFINES),) #if defined(HasPamLibrary) && HasPamLibrary -CppSourceFile(dtlogin.pam.conf,dtlogin.pam.conf.src,$(LOCAL_CPP_DEFINES),) +CppSourceFile(pam.d.dtlogin,pam.d.dtlogin.src,$(LOCAL_CPP_DEFINES),) #endif diff --git a/cde/programs/dtlogin/config/Xsetup.src b/cde/programs/dtlogin/config/Xsetup.src index b4a06f870..75741ea8e 100644 --- a/cde/programs/dtlogin/config/Xsetup.src +++ b/cde/programs/dtlogin/config/Xsetup.src @@ -88,10 +88,15 @@ fi #define PAM_D /etc/pam.d #endif - if [ ! -f PAM_D/dtlogin ]; then - if [ -f CDE_INSTALLATION_TOP/config/dtlogin.pam.conf ]; then - /bin/cp CDE_INSTALLATION_TOP/config/dtlogin.pam.conf PAM_D/dtlogin - /bin/chmod 644 PAM_D/dtlogin +for i in CDE_INSTALLATION_TOP/config/pam.d.* +do + conf=PAM_D/${i##*.} + + if [ ! -f $conf ]; then + if [ -f $i ]; then + /bin/cp $i $conf + /bin/chmod 644 $conf fi fi +done #endif diff --git a/cde/programs/dtlogin/config/dtlogin.pam.conf.src b/cde/programs/dtlogin/config/pam.d.dtlogin.src similarity index 100% rename from cde/programs/dtlogin/config/dtlogin.pam.conf.src rename to cde/programs/dtlogin/config/pam.d.dtlogin.src From b0037af61a72c9eaae454b4b0a0c75960493bcdc Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 04:43:31 +0800 Subject: [PATCH 66/90] dtsession: rename PAM config file. --- cde/programs/dtsession/config/Imakefile | 4 ++-- .../config/{dtsession.pam.conf.src => pam.d.dtsession.src} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename cde/programs/dtsession/config/{dtsession.pam.conf.src => pam.d.dtsession.src} (100%) diff --git a/cde/programs/dtsession/config/Imakefile b/cde/programs/dtsession/config/Imakefile index 702ea0456..69699c6db 100644 --- a/cde/programs/dtsession/config/Imakefile +++ b/cde/programs/dtsession/config/Imakefile @@ -5,9 +5,9 @@ PAM_AUTHENTICATION_MODULE=PamAuthenticationModule LOCAL_CPP_DEFINES += -DPAM_AUTHENTICATION_MODULE=$(PAM_AUTHENTICATION_MODULE) #endif -CPP_TARGETS = dtsession.pam.conf +CPP_TARGETS = pam.d.dtsession AllTarget($(CPP_TARGETS)) -CppSourceFile(dtsession.pam.conf,dtsession.pam.conf.src,$(LOCAL_CPP_DEFINES),) +CppSourceFile(pam.d.dtsession,pam.d.dtsession.src,$(LOCAL_CPP_DEFINES),) #endif diff --git a/cde/programs/dtsession/config/dtsession.pam.conf.src b/cde/programs/dtsession/config/pam.d.dtsession.src similarity index 100% rename from cde/programs/dtsession/config/dtsession.pam.conf.src rename to cde/programs/dtsession/config/pam.d.dtsession.src From 4f2d356d311cb9039811dc590135d81fc11128f2 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 05:37:52 +0800 Subject: [PATCH 67/90] Enable PAM support for dtlogin and dtsession. --- cde/config/cf/FreeBSD.cf | 8 ++++++++ cde/config/cf/NetBSD.cf | 8 ++++++++ cde/config/cf/linux.cf | 4 ++++ cde/databases/CDE-MIN.udb | 19 +++++++++++++++++++ cde/databases/CDE-RUN.udb | 9 +++++++++ cde/databases/Imakefile | 17 +++++++++++------ 6 files changed, 59 insertions(+), 6 deletions(-) diff --git a/cde/config/cf/FreeBSD.cf b/cde/config/cf/FreeBSD.cf index faf94894c..48ac23c73 100644 --- a/cde/config/cf/FreeBSD.cf +++ b/cde/config/cf/FreeBSD.cf @@ -247,4 +247,12 @@ ICONVSYSLIB != if test -f /usr/local/include/iconv.h; then echo -liconv; else ec #define CDESharedRev 2 +#if !defined(HasPamLibrary) +#define HasPamLibrary YES +#endif + +#if !defined(PamAuthenticationModule) +#define PamAuthenticationModule /usr/local/lib/security/pam_pwauth_suid.so +#endif + #include diff --git a/cde/config/cf/NetBSD.cf b/cde/config/cf/NetBSD.cf index 627c46666..c6449989f 100644 --- a/cde/config/cf/NetBSD.cf +++ b/cde/config/cf/NetBSD.cf @@ -316,3 +316,11 @@ CXXDEPENDINCLUDE != CppCmd -x c++ -Wp,-v < /dev/null \ #ifndef KornShell #define KornShell /usr/pkg/bin/ksh93 #endif + +#if !defined(HasPamLibrary) +#define HasPamLibrary YES +#endif + +#if !defined(PamAuthenticationModule) +#define PamAuthenticationModule /usr/pkg/lib/security/pam_pwauth_suid.so +#endif diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index 8e40b576b..fe0509b7c 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -299,5 +299,9 @@ XCOMM This is needed for CDE currently #define SharedTtReqs $(TIRPCLIB) $(LDPRELIBS) SharedXReqs $(CXXLIB) +#if !defined(HasPamLibrary) +#define HasPamLibrary YES +#endif + #include #include diff --git a/cde/databases/CDE-MIN.udb b/cde/databases/CDE-MIN.udb index 409e26c11..d96fda7e1 100644 --- a/cde/databases/CDE-MIN.udb +++ b/cde/databases/CDE-MIN.udb @@ -252,3 +252,22 @@ programs/dtdbcache/dtdbcache install_target = /usr/dt/bin/dtdbcache mode = 0555 } + +# +# PAM configuration files. +# +#ifdef HAS_PAM_LIBRARY +programs/dtlogin/config/pam.d.dtlogin +{ default + install_target = /usr/dt/config/pam.d.dtlogin + mode = 0644 + owner = root +} +# +programs/dtsession/config/pam.d.dtsession +{ default + install_target = /usr/dt/config/pam.d.dtsession + mode = 0644 + owner = root +} +#endif diff --git a/cde/databases/CDE-RUN.udb b/cde/databases/CDE-RUN.udb index 968cae138..86284ef1d 100644 --- a/cde/databases/CDE-RUN.udb +++ b/cde/databases/CDE-RUN.udb @@ -1523,12 +1523,21 @@ programs/dtfile/dtcopy/dtfile_copy mode = 0555 } # +#ifdef HAS_PAM_LIBRARY +programs/dtsession/dtsession +{ default + install_target = /usr/dt/bin/dtsession + owner = root + mode = 0555 +} +#else programs/dtsession/dtsession { default install_target = /usr/dt/bin/dtsession owner = root mode = 04555 } +#endif # programs/dtsession/dtloadresources { default diff --git a/cde/databases/Imakefile b/cde/databases/Imakefile index 958b53294..2009bd973 100644 --- a/cde/databases/Imakefile +++ b/cde/databases/Imakefile @@ -34,6 +34,10 @@ UDB_RELEASE_OPT = -ReleaseStream netbsd */ UDB_CPP_UNDEF_LIST = -UhpV4 -Uhpux -Uaix -Usun -Uunix -Ulinux -Uopenbsd -Ufreebsd -Unetbsd +#if defined(HasPamLibrary) && HasPamLibrary +UDB_CPP_DEF_LIST = -DHAS_PAM_LIBRARY +#endif + #if defined UTF8_NLS_SUPPORT # define UTF8_NLS_SUPPORT_OPT -DUTF8_NLS_SUPPORT #else @@ -196,7 +200,8 @@ clean:: /* * Default locale (C) */ -LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_ENGLISH_ UTF8_NLS_SUPPORT_OPT +LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_ENGLISH_ \ + UTF8_NLS_SUPPORT_OPT CppSourceFile(CDE-LOC-C.tmp,CDE-LOC.src,$(LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-C.tmp,CDE-HELP-LOC.src,$(LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-C.tmp,CDE-MSG-LOC.src,$(LOC_CPP_LIST),) @@ -206,7 +211,7 @@ CreateLocalizedFilesets(C,C,C,CDE-RUN,CDE-ENG-A-HELP,CDE-ENG-A-MSG,C,C,CDE-LOC-C /* * German */ -DE_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_GERMAN_ +DE_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_GERMAN_ CppSourceFile(CDE-LOC-DE.tmp,CDE-LOC.src,$(DE_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-DE.tmp,CDE-HELP-LOC.src,$(DE_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-DE.tmp,CDE-MSG-LOC.src,$(DE_LOC_CPP_LIST),) @@ -216,7 +221,7 @@ CreateLocalizedFilesets(DE,de_DE.UTF-8,German,CDE-LANGS,CDE-GER-I-HELP,CDE-GER-I /* * Spanish */ -ES_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_SPANISH_ +ES_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_SPANISH_ CppSourceFile(CDE-LOC-ES.tmp,CDE-LOC.src,$(ES_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-ES.tmp,CDE-HELP-LOC.src,$(ES_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-ES.tmp,CDE-MSG-LOC.src,$(ES_LOC_CPP_LIST),) @@ -226,7 +231,7 @@ CreateLocalizedFilesets(ES,es_ES.UTF-8,Spanish,CDE-LANGS,CDE-SPA-I-HELP,CDE-SPA- /* * French */ -FR_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_FRENCH_ +FR_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_FRENCH_ CppSourceFile(CDE-LOC-FR.tmp,CDE-LOC.src,$(FR_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-FR.tmp,CDE-HELP-LOC.src,$(FR_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-FR.tmp,CDE-MSG-LOC.src,$(FR_LOC_CPP_LIST),) @@ -236,7 +241,7 @@ CreateLocalizedFilesets(FR,fr_FR.UTF-8,French,CDE-LANGS,CDE-FRE-I-HELP,CDE-FRE-I /* * Italian */ -IT_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_ITALIAN_ +IT_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_ITALIAN_ CppSourceFile(CDE-LOC-IT.tmp,CDE-LOC.src,$(IT_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-IT.tmp,CDE-HELP-LOC.src,$(IT_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-IT.tmp,CDE-MSG-LOC.src,$(IT_LOC_CPP_LIST),) @@ -246,7 +251,7 @@ CreateLocalizedFilesets(IT,it_IT.UTF-8,Italian,CDE-LANGS,CDE-ITA-I-HELP,CDE-ITA- /* * Japanese */ -JP_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_JAPANESE_ +JP_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_JAPANESE_ CppSourceFile(CDE-LOC-JP.tmp,CDE-LOC.src,$(JP_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-JP.tmp,CDE-HELP-LOC.src,$(JP_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-JP.tmp,CDE-MSG-LOC.src,$(JP_LOC_CPP_LIST),) From 1d287720ad9abff49cf3b4e37e7425bd85835457 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 08:31:43 +0800 Subject: [PATCH 68/90] dtlogin: use utmpx when PAM is enabled. --- cde/programs/dtlogin/account.c | 20 ++++++++++---------- cde/programs/dtlogin/session.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cde/programs/dtlogin/account.c b/cde/programs/dtlogin/account.c index b70276573..3f4face0e 100644 --- a/cde/programs/dtlogin/account.c +++ b/cde/programs/dtlogin/account.c @@ -51,7 +51,7 @@ #endif #include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 || defined(HAS_PAM_LIBRARY) #include #else #include @@ -138,7 +138,7 @@ Account( struct display *d, char *user, char *line, pid_t pid, waitType exitcode ) { #if !defined(CSRG_BASED) || defined(HAS_PAM_LIBRARY) -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#ifdef HAS_PAM_LIBRARY struct utmpx utmp; /* local struct for new entry */ struct utmpx *u; /* pointer to entry in utmp file */ #else @@ -187,7 +187,7 @@ Account( struct display *d, char *user, char *line, pid_t pid, #ifdef sun return; #else -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#ifdef HAS_PAM_LIBRARY bzero(&utmp, sizeof(struct utmpx)); #else bzero(&utmp, sizeof(struct utmp)); @@ -196,7 +196,7 @@ Account( struct display *d, char *user, char *line, pid_t pid, strncpy(utmp.ut_id, d->utmpId, sizeof(u->ut_id) - 1); utmp.ut_type = LOGIN_PROCESS; -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#ifdef HAS_PAM_LIBRARY setutxent(); if ( (u = getutxid(&utmp)) == NULL ) u = &utmp; #else @@ -212,7 +212,7 @@ Account( struct display *d, char *user, char *line, pid_t pid, if ((type == DEAD_PROCESS && pid != 0 && u->ut_pid != pid) || (type == DEAD_PROCESS && u->ut_type == DEAD_PROCESS) ) { -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#ifdef HAS_PAM_LIBRARY endutxent(); #else endutent(); @@ -268,7 +268,7 @@ Account( struct display *d, char *user, char *line, pid_t pid, if (type) { u->ut_type = type; if (type == DEAD_PROCESS) { -#if !(defined(__FreeBSD__) && OSMAJORVERSION > 8) +#ifndef HAS_PAM_LIBRARY u->ut_exit.e_termination = waitSig(exitcode); u->ut_exit.e_exit = waitCode(exitcode); #endif @@ -286,13 +286,13 @@ Account( struct display *d, char *user, char *line, pid_t pid, #endif } -#if !(defined(__FreeBSD__) && OSMAJORVERSION > 8) +#ifndef HAS_PAM_LIBRARY if (type == USER_PROCESS) u->ut_exit.e_exit = (d->displayType.location == Local ? 1 : 0 ); #endif } -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#ifdef HAS_PAM_LIBRARY (void) time(&u->ut_tv); #else (void) time(&u->ut_time); @@ -306,14 +306,14 @@ Account( struct display *d, char *user, char *line, pid_t pid, * to wtmp!) */ -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#ifdef HAS_PAM_LIBRARY pututxline(u); #else pututline(u); #endif -#if !(defined(__FreeBSD__) && OSMAJORVERSION > 8) +#ifndef HAS_PAM_LIBRARY /* * write the same entry to wtmp... */ diff --git a/cde/programs/dtlogin/session.c b/cde/programs/dtlogin/session.c index 7de230dd8..cd28e5845 100644 --- a/cde/programs/dtlogin/session.c +++ b/cde/programs/dtlogin/session.c @@ -66,7 +66,7 @@ # include # include # include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 +#if defined(__FreeBSD__) && OSMAJORVERSION > 8 || defined(HAS_PAM_LIBRARY) # include #else # include From d4f8a378528461120a3a6bc5f9ff5d3faf56fbbe Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 09:29:07 +0800 Subject: [PATCH 69/90] DtPamSvc: use utmpx. --- cde/lib/DtPamSvc/PamSvc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cde/lib/DtPamSvc/PamSvc.c b/cde/lib/DtPamSvc/PamSvc.c index 376bcd776..94f802916 100644 --- a/cde/lib/DtPamSvc/PamSvc.c +++ b/cde/lib/DtPamSvc/PamSvc.c @@ -50,11 +50,7 @@ #include #include #include -#if defined(__FreeBSD__) && OSMAJORVERSION > 8 #include -#else -#include -#endif #include "PamSvc.h" /* From 63520552c15075aea64086eba002640a3d55b945 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 31 Jan 2021 20:09:36 +0800 Subject: [PATCH 70/90] dtsession: add rules for config dir into Imakefile. --- cde/programs/dtsession/Imakefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cde/programs/dtsession/Imakefile b/cde/programs/dtsession/Imakefile index 10564e038..31877ef8f 100644 --- a/cde/programs/dtsession/Imakefile +++ b/cde/programs/dtsession/Imakefile @@ -1,4 +1,10 @@ XCOMM $TOG: Imakefile /main/22 1998/04/06 13:33:41 mgreess $ +#define IHaveSubdirs +#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' + +SUBDIRS = config +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) DEPEND_DEFINES = $(DEPENDDEFINES) DEFINES = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \ From 00ab939165b83e96b754babe18dcbb95a8e00d93 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 1 Feb 2021 04:06:21 +0800 Subject: [PATCH 71/90] databases: use "src" files to generate CDE-MIN.udb and CDE-RUN.udb. --- cde/databases/{CDE-MIN.udb => CDE-MIN.src} | 184 ++- cde/databases/{CDE-RUN.udb => CDE-RUN.src} | 1181 ++++++++++---------- cde/databases/CDE-SHLIBS.src | 53 + cde/databases/Imakefile | 18 +- 4 files changed, 743 insertions(+), 693 deletions(-) rename cde/databases/{CDE-MIN.udb => CDE-MIN.src} (59%) rename cde/databases/{CDE-RUN.udb => CDE-RUN.src} (87%) diff --git a/cde/databases/CDE-MIN.udb b/cde/databases/CDE-MIN.src similarity index 59% rename from cde/databases/CDE-MIN.udb rename to cde/databases/CDE-MIN.src index d96fda7e1..a4cb868d1 100644 --- a/cde/databases/CDE-MIN.udb +++ b/cde/databases/CDE-MIN.src @@ -1,14 +1,14 @@ -# $XConsortium: CDE-MIN.udb /main/6 1996/07/24 15:55:57 drk $ -#>>------------------------------ -# CDE-MIN.udb CDE Runtime Support -#-------------------------------- -# -#>>------------------------------ -# Defaults for: hpux -#<<------------------------------ -# +XCOMM $XConsortium: CDE-MIN.udb /main/6 1996/07/24 15:55:57 drk $ +XCOMM>>------------------------------ +XCOMM CDE-MIN.udb CDE Runtime Support +XCOMM-------------------------------- +XCOMM +XCOMM>>------------------------------ +XCOMM Defaults for: hpux +XCOMM<<------------------------------ +XCOMM { hpux : defaults - install_target = + install_target = fileset = CDE-MIN type = file status = di---- @@ -18,18 +18,18 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: hpux 10.0 -#<<------------------------------ -# +XCOMM>>------------------------------ +XCOMM Defaults for: hpux 10.0 +XCOMM<<------------------------------ +XCOMM { hpV4 : defaults - install_target = + install_target = fileset = CDE-MIN type = file status = di---- @@ -39,18 +39,18 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: aix -#<<------------------------------ -# +XCOMM>>------------------------------ +XCOMM Defaults for: aix +XCOMM<<------------------------------ +XCOMM { aix : defaults - install_target = + install_target = fileset = CDE-MIN type = file status = di---- @@ -60,17 +60,17 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: sun -#<<------------------------------ -# +XCOMM>>------------------------------ +XCOMM Defaults for: sun +XCOMM<<------------------------------ +XCOMM { sun : defaults install_target = fileset = CDE-MIN @@ -89,12 +89,12 @@ responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: standalone product -#<<------------------------------ -# +XCOMM>>------------------------------ +XCOMM Defaults for: standalone product +XCOMM<<------------------------------ +XCOMM { standalone : defaults - install_target = + install_target = fileset = CDE-MIN type = file status = di---- @@ -104,31 +104,31 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: nls internationalized files -#<<------------------------------ -# +XCOMM>>------------------------------ +XCOMM Defaults for: nls internationalized files +XCOMM<<------------------------------ +XCOMM { nls : defaults - install_target = + install_target = processor = 378 type = file mode = 0444 owner = bin group = bin } -#>>------------------------------------------------- -# Defaults for: everything else (identical to hpux) -#<<------------------------------------------------- -# +XCOMM>>------------------------------------------------- +XCOMM Defaults for: everything else (identical to hpux) +XCOMM<<------------------------------------------------- +XCOMM { default : defaults - install_target = + install_target = fileset = CDE-MIN type = file status = di---- @@ -138,49 +138,49 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -# -#>>----------------------------- -# the copyright message -#<<----------------------------- -# +XCOMM +XCOMM>>----------------------------- +XCOMM the copyright message +XCOMM<<----------------------------- +XCOMM copyright { default install_target = /usr/dt/copyright mode = 0644 } -# -#>>----------------------------- -# the COPYING file -#<<----------------------------- -# +XCOMM +XCOMM>>----------------------------- +XCOMM the COPYING file +XCOMM<<----------------------------- +XCOMM COPYING { default install_target = /usr/dt/COPYING mode = 0644 } -# -#>>----------------------------- -# the CONTRIBUTORS file -#<<----------------------------- -# +XCOMM +XCOMM>>----------------------------- +XCOMM the CONTRIBUTORS file +XCOMM<<----------------------------- +XCOMM CONTRIBUTORS { default install_target = /usr/dt/CONTRIBUTORS mode = 0644 } -# -# PAM configuration file. -# +XCOMM +XCOMM PAM configuration file. +XCOMM lib/pam/libpam/pam.conf { sun install_target = /usr/dt/config/sys.pam.conf @@ -188,86 +188,82 @@ lib/pam/libpam/pam.conf owner = root } -# -# A collection of script functions -# +XCOMM +XCOMM A collection of script functions +XCOMM programs/dtksh/DtFuncs.sh { default install_target = /usr/dt/lib/dtksh/DtFuncs.dtsh } -# +XCOMM programs/dtspcd/dtspcd { default install_target = /usr/dt/bin/dtspcd mode = 0555 } -# +XCOMM programs/dtappintegrate/dtappintegrate { default install_target = /usr/dt/bin/dtappintegrate mode = 0555 } -# +XCOMM programs/dtksh/dtksh { default install_target = /usr/dt/bin/dtksh mode = 0555 } -# +XCOMM programs/dtksh/ksh93/bin/suid_exec { default install_target = /usr/dt/bin/suid_exec owner = root mode = 0555 } -# +XCOMM programs/dtksh/Dtksh { default install_target = /usr/dt/app-defaults/C/Dtksh } -# +XCOMM programs/dtspcd/dtspcdenv { default install_target = /usr/dt/config/dtspcdenv } -# -#>>----------------------------- -# dtexec client -#<<----------------------------- -# +XCOMM +XCOMM>>----------------------------- +XCOMM dtexec client +XCOMM<<----------------------------- +XCOMM programs/dtexec/dtexec { default install_target = /usr/dt/bin/dtexec mode = 0555 } -# -#>>----------------------------- -# dtdbcache client -#<<----------------------------- -# +XCOMM +XCOMM>>----------------------------- +XCOMM dtdbcache client +XCOMM<<----------------------------- +XCOMM programs/dtdbcache/dtdbcache { default install_target = /usr/dt/bin/dtdbcache mode = 0555 } -# -# PAM configuration files. -# +XCOMM +XCOMM PAM configuration files. +XCOMM #ifdef HAS_PAM_LIBRARY programs/dtlogin/config/pam.d.dtlogin { default install_target = /usr/dt/config/pam.d.dtlogin - mode = 0644 - owner = root } -# +XCOMM programs/dtsession/config/pam.d.dtsession { default install_target = /usr/dt/config/pam.d.dtsession - mode = 0644 - owner = root } #endif diff --git a/cde/databases/CDE-RUN.udb b/cde/databases/CDE-RUN.src similarity index 87% rename from cde/databases/CDE-RUN.udb rename to cde/databases/CDE-RUN.src index 86284ef1d..2536c9043 100644 --- a/cde/databases/CDE-RUN.udb +++ b/cde/databases/CDE-RUN.src @@ -1,14 +1,14 @@ -# $TOG: CDE-RUN.udb /main/52 1999/05/27 11:56:18 samborn $ -#>>------------------------------ -# CDE-RUN.udb CDE runtime product universal database -#-------------------------------- -# -#>>------------------------------ -# Defaults for: hpux -#<<------------------------------ -# +XCOMM $TOG: CDE-RUN.udb /main/52 1999/05/27 11:56:18 samborn $ +XCOMM >>------------------------------ +XCOMM CDE-RUN.udb CDE runtime product universal database +XCOMM -------------------------------- +XCOMM +XCOMM >>------------------------------ +XCOMM Defaults for: hpux +XCOMM <<------------------------------ +XCOMM { hpux : defaults - install_target = + install_target = fileset = CDE-RUN type = file status = di---- @@ -18,18 +18,18 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: hpux 10.0 -#<<------------------------------ -# +XCOMM >>------------------------------ +XCOMM Defaults for: hpux 10.0 +XCOMM <<------------------------------ +XCOMM { hpV4 : defaults - install_target = + install_target = fileset = CDE-RUN type = file status = di---- @@ -39,18 +39,18 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: aix -#<<------------------------------ -# +XCOMM >>------------------------------ +XCOMM Defaults for: aix +XCOMM <<------------------------------ +XCOMM { aix : defaults - install_target = + install_target = fileset = CDE-RUN type = file status = di---- @@ -60,17 +60,17 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: sun -#<<------------------------------ -# +XCOMM >>------------------------------ +XCOMM Defaults for: sun +XCOMM <<------------------------------ +XCOMM { sun : defaults install_target = fileset = CDE-RUN @@ -89,12 +89,12 @@ responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: standalone product -#<<------------------------------ -# +XCOMM >>------------------------------ +XCOMM Defaults for: standalone product +XCOMM <<------------------------------ +XCOMM { standalone : defaults - install_target = + install_target = fileset = CDE-RUN type = file status = di---- @@ -104,31 +104,31 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -#>>------------------------------ -# Defaults for: nls internationalized files -#<<------------------------------ -# +XCOMM >>------------------------------ +XCOMM Defaults for: nls internationalized files +XCOMM <<------------------------------ +XCOMM { nls : defaults - install_target = + install_target = processor = 378 type = file mode = 0444 owner = bin group = bin } -#>>------------------------------------------------- -# Defaults for: everything else (identical to hpux) -#<<------------------------------------------------- -# +XCOMM >>------------------------------------------------- +XCOMM Defaults for: everything else (identical to hpux) +XCOMM <<------------------------------------------------- +XCOMM { default : defaults - install_target = + install_target = fileset = CDE-RUN type = file status = di---- @@ -138,49 +138,49 @@ group = bin link_source = build_target = / - install_rule_name = - install_flags = + install_rule_name = + install_flags = a_out_location = order = 0 responsible_project = cde_dt } -# -#>>----------------------------- -# dtlogin -#<<----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM dtlogin +XCOMM <<----------------------------- +XCOMM programs/dtlogin/config/Xfailsafe { default install_target = /usr/dt/config/Xfailsafe mode = 0555 } -# +XCOMM programs/dtconfig/hp/dtrc { hpux install_target = /usr/dt/bin/dtrc mode = 0544 } -# +XCOMM programs/dtconfig/hp/dtrc { hpV4 install_target = /usr/dt/bin/dtrc mode = 0544 } -# +XCOMM { hpV4 type = directory - install_target = /usr/dt/config/dtrc.d + install_target = /usr/dt/config/dtrc.d mode = 0555 status = ------ } -# +XCOMM programs/dtconfig/hp/dtrc.dtlogin_st -{ hpV4 +{ hpV4 install_target = /usr/dt/config/dtrc.d/90_dtlogin_st mode = 0544 } -# +XCOMM programs/dtconfig/hp/dtrc.getty_wait { hpV4 install_target = /usr/dt/config/dtrc.d/10_getty_wait @@ -191,294 +191,294 @@ programs/dtconfig/hp/dtrc.graph_conf install_target = /usr/dt/config/dtrc.d/20_graph_conf mode = 0544 } -# +XCOMM programs/dtconfig/ibm/rc.dt { aix install_target = /usr/dt/bin/rc.dt mode = 0544 } -# +XCOMM programs/dtlogin/config/Xconfig { default install_target = /usr/dt/config/Xconfig } -# +XCOMM programs/dtlogin/config/Xreset { default install_target = /usr/dt/config/Xreset mode = 0544 } -# +XCOMM programs/dtlogin/config/Xsetup { default install_target = /usr/dt/config/Xsetup mode = 0544 } -# +XCOMM programs/dtlogin/config/Xservers { default install_target = /usr/dt/config/Xservers } -# +XCOMM programs/dtlogin/config/Xaccess { default install_target = /usr/dt/config/Xaccess } -# +XCOMM programs/dtlogin/config/Xstartup { default install_target = /usr/dt/config/Xstartup mode = 0544 } -# +XCOMM programs/localized/C/config/Xresources { default install_target = /usr/dt/config/C/Xresources } -# +XCOMM programs/localized/C/config/sys.dtwmrc { default install_target = /usr/dt/config/C/sys.dtwmrc } -# +XCOMM programs/dtlogin/config/dtprofile { default install_target = /usr/dt/config/sys.dtprofile mode = 0555 } -# +XCOMM programs/localized/C/config/sys.resources { default install_target = /usr/dt/config/C/sys.resources } -# +XCOMM programs/localized/C/config/sys.session { default install_target = /usr/dt/config/C/sys.session } -# +XCOMM programs/localized/C/config/sys.font { default install_target = /usr/dt/config/C/sys.font } -# +XCOMM programs/dtconfig/sun/dtlogin.rc -{ sun +{ sun install_target = /usr/dt/config/dtlogin.rc mode = 0555 } -# +XCOMM programs/dtconfig/sun/dtlogin.xml { sun install_target = /usr/dt/config/dtlogin.xml mode = 0555 } -# +XCOMM programs/dtconfig/sun/dtconfig -{ sun +{ sun install_target = /usr/dt/bin/dtconfig mode = 0555 } -# +XCOMM programs/dtconfig/hp/dtconfig { hpV4 install_target = /usr/dt/bin/dtconfig mode = 0555 } -# +XCOMM programs/dtconfig/hp/dtlogin.rc { hpV4 install_target = /sbin/init.d/dtlogin.rc mode = 0555 } -# +XCOMM /sbin/init.d/dtlogin.rc { hpV4 install_target = /sbin/rc2.d/K100dtlogin.rc type = sym_link } -# +XCOMM /sbin/init.d/dtlogin.rc { hpV4 install_target = /sbin/rc3.d/S990dtlogin.rc type = sym_link } -# -# -# -#>>----------------------------- -# dtconfig for AIX -#<<----------------------------- -# +XCOMM +XCOMM +XCOMM +XCOMM >>----------------------------- +XCOMM dtconfig for AIX +XCOMM <<----------------------------- +XCOMM programs/dtconfig/ibm/dtconfig { aix install_target = /usr/dt/bin/dtconfig mode = 0555 } -# -#>>----------------------------- -# app-defaults -#<<----------------------------- -# -# -# -# +XCOMM +XCOMM >>----------------------------- +XCOMM app-defaults +XCOMM <<----------------------------- +XCOMM +XCOMM +XCOMM +XCOMM programs/localized/C/app-defaults/Dthello { default install_target = /usr/dt/app-defaults/C/Dthello } -# +XCOMM programs/localized/C/app-defaults/Dtsession { default install_target = /usr/dt/app-defaults/C/Dtsession } -# +XCOMM programs/localized/C/app-defaults/Dtwm { default install_target = /usr/dt/app-defaults/C/Dtwm } -# +XCOMM programs/localized/C/app-defaults/Dtfile { default install_target = /usr/dt/app-defaults/C/Dtfile } -# +XCOMM programs/localized/C/app-defaults/Dtstyle { default install_target = /usr/dt/app-defaults/C/Dtstyle } -# +XCOMM programs/localized/C/app-defaults/Dtpad { default install_target = /usr/dt/app-defaults/C/Dtpad } -# +XCOMM programs/localized/C/app-defaults/Dtscreen { default install_target = /usr/dt/app-defaults/C/Dtscreen } -# +XCOMM programs/localized/C/app-defaults/Dticon { default install_target = /usr/dt/app-defaults/C/Dticon } -# +XCOMM programs/localized/C/app-defaults/Dtcalc { default install_target = /usr/dt/app-defaults/C/Dtcalc } -# +XCOMM programs/localized/C/app-defaults/Dtterm { default install_target = /usr/dt/app-defaults/C/Dtterm } -# +XCOMM programs/localized/C/app-defaults/Dt { default install_target = /usr/dt/app-defaults/C/Dt } -# +XCOMM programs/localized/C/app-defaults/Dtcreate { default install_target = /usr/dt/app-defaults/C/Dtcreate } -# +XCOMM programs/dtimsstart/Dtimsstart { default install_target = /usr/dt/app-defaults/C/Dtimsstart } -# +XCOMM programs/dtprintinfo/Dtprintinfo { default install_target = /usr/dt/app-defaults/C/Dtprintinfo } -# +XCOMM programs/dtappbuilder/src/ab/Dtbuilder { default install_target = /usr/dt/app-defaults/C/Dtbuilder } -# +XCOMM lib/DtWidget/UNIXbindings { default install_target = /usr/dt/app-defaults/C/UNIXbindings } -# -#>>----------------------------- -# dtsession -#<<----------------------------- -# -# -# +XCOMM +XCOMM >>----------------------------- +XCOMM dtsession +XCOMM <<----------------------------- +XCOMM +XCOMM +XCOMM programs/dtlogin/config/Xsession { default install_target = /usr/dt/bin/Xsession mode = 0555 } -# +XCOMM programs/dtlogin/config/dtlslocale { aix install_target = /usr/dt/bin/dtlslocale mode = 0555 } -# +XCOMM programs/dtsearchpath/0010.dtpaths { default install_target = /usr/dt/config/Xsession.d/0010.dtpaths mode = 0555 } -# +XCOMM programs/dtimsstart/0020.dtims { default install_target = /usr/dt/config/Xsession.d/0020.dtims mode = 0555 } -# +XCOMM programs/dtsearchpath/0030.dttmpdir { default install_target = /usr/dt/config/Xsession.d/0030.dttmpdir mode = 0555 } -# +XCOMM programs/dtlogin/config/0060.dtsysenv { default install_target = /usr/dt/config/Xsession.d/0060.dtsysenv mode = 0555 } -# +XCOMM programs/dtsession/sys.font.iso { default install_target = /usr/dt/share/examples/sys.font.iso } -# +XCOMM -# -#>>----------------------------- -# dtprintinfo -#<<----------------------------- -# -# +XCOMM +XCOMM >>----------------------------- +XCOMM dtprintinfo +XCOMM <<----------------------------- +XCOMM +XCOMM programs/dtprintinfo/dtprintinfo { default install_target = /usr/dt/bin/dtprintinfo mode = 0555 owner = root } -# -#>>----------------------------- -# dtimsstart configuration file -#>>----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM dtimsstart configuration file +XCOMM >>----------------------------- +XCOMM programs/dtimsstart/conf/start.conf { default install_target = /usr/dt/config/ims/start.conf } -# -#>>----------------------------- -# dtfile configuration file -#>>----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM dtfile configuration file +XCOMM >>----------------------------- +XCOMM programs/localized/C/config/dtfile.config { default install_target = /usr/dt/config/C/dtfile.config @@ -489,124 +489,124 @@ programs/util/scripts/convertvf install_target = /usr/dt/bin/dtconvertvf mode = 0555 } -# +XCOMM programs/util/scripts/convertvf { hpV4 install_target = /usr/dt/bin/dtconvertvf mode = 0555 } -# -#>>------------------------------ -# dtpad -#<<----------------------------- -# -#programs/dtpad/adjust16 -#${ default -# install_target = /usr/dt/bin/adjust16 -# mode = 0555 -#} -# +XCOMM +XCOMM >>------------------------------ +XCOMM dtpad +XCOMM <<----------------------------- +XCOMM +XCOMM programs/dtpad/adjust16 +XCOMM ${ default +XCOMM install_target = /usr/dt/bin/adjust16 +XCOMM mode = 0555 +XCOMM } +XCOMM -# -#>>----------------------------- -# dtcreate client -#<<----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM dtcreate client +XCOMM <<----------------------------- +XCOMM programs/dtcreate/dtcreate { default install_target = /usr/dt/bin/dtcreate mode = 0555 } -# -# -#>>----------------------------- -# DT predefined actions -#<<----------------------------- -# +XCOMM +XCOMM +XCOMM >>----------------------------- +XCOMM DT predefined actions +XCOMM <<----------------------------- +XCOMM programs/dtsearchpath/dtappg/howto-customize { default install_target = /usr/dt/appconfig/appmanager/C/Information/README } -# +XCOMM programs/dtsearchpath/dtappg/howto-customize { default install_target = /usr/dt/appconfig/appmanager/C/System_Admin/README } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Bitmap mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/CodeGen mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Spell mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xclipboard mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Diff mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Compress mode = 0555 } -# +XCOMM programs/localized/C/types/action -{ default +{ default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DttermConsole mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Wc mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/XclockDig + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/XclockDig mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DuSort + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DuSort mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Df mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xfd mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DtwmrcEdit @@ -624,692 +624,692 @@ programs/localized/C/types/action install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/ExecuteCmd mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Env mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xlsfonts mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Nm mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xwininfo mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xprop mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Make + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Make mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xrefresh + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xrefresh mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/ReloadActions mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/ReloadApps mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DttermRlogin mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DttermDtspcd mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/XtermRlogin mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/XtermDtspcd mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/RestorePanel + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/RestorePanel mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Rm mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Grep mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xload mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Tar mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/TarList mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/TarUnpack mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/File + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/File mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Uncompress + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Uncompress mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Vi mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DttermErrorlog mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xterm + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xterm mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xdpyinfo mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xwd mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xwud + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Xwud mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/DtImsMode mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtappbuild mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtcalc mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtcm mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtcreate mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtfile + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtfile mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dticon mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dthelpview mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtmail mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtmanpageview mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/DtPrintManager mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtstyle mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtpad mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtterm + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtterm mode = 0555 } -# +XCOMM programs/localized/C/types/action { default - install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dttrash + install_target = /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dttrash mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Desktop_Tools/Dttypes mode = 0555 } -# Additional actions from Antonis Tsolomitis desktop_approots package +XCOMM Additional actions from Antonis Tsolomitis desktop_approots package programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Education/gcompris mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Education/geogebra mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Education/stellarium mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Education/tuxpaint mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/dreamchess mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/eboard mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/gcompris mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/ktuberling mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/lbreakout2 mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/powermanga mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/pychess mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/supertux mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Games/xboard mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Graphics/fontforge mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Graphics/gimp mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Graphics/inkscape mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Graphics/okular mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Graphics/xv mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Internet/chromium mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Internet/firefox mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Internet/nxclient mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Internet/skype mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Internet/thunderbird mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/amarok mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/brasero mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/k3b mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/k9copy mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/pavucontrol mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/rhythmbox mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/rosegarden mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/sound-juicer mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/vlc mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Media_Tools/xine mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/acroread mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-base mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-calc mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-draw mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-impress mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-main mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-math mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/libreoffice-writer mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/nedit mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/xournal mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/Office/xpdf mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/caja mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/engrampa mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/file-roller mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/firestarter mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/pgadmin mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/synaptic mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/virtualbox mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/System/wicd mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/acroread mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/emacs mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/gv mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/kile mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/mgv mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/TeX mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/xdvi mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/xournal mode = 0555 } -# +XCOMM programs/localized/C/types/action { default install_target = /usr/dt/appconfig/appmanager/C/TeX/xpdf @@ -1318,216 +1318,215 @@ programs/localized/C/types/action -# dtlp +XCOMM dtlp programs/dtprintegrate/dtlp { default install_target = /usr/dt/bin/dtlp mode = 0555 } -# -# -#>>----------------------------- -# backdrop files -#<<----------------------------- -# +XCOMM +XCOMM +XCOMM >>----------------------------- +XCOMM backdrop files +XCOMM <<----------------------------- +XCOMM programs/localized/C/palettes/desc.C { default install_target = /usr/dt/share/palettes/desc.C } -# +XCOMM programs/localized/C/backdrops/desc.C { default install_target = /usr/dt/share/backdrops/desc.C } -# +XCOMM programs/backdrops/Foreground.bm { default install_target = /usr/dt/share/backdrops/Foreground.bm } -# +XCOMM programs/backdrops/Background.bm { default install_target = /usr/dt/share/backdrops/Background.bm } -# +XCOMM programs/backdrops/NoBackdrop.pm { default install_target = /usr/dt/share/backdrops/NoBackdrop.pm } -# +XCOMM programs/backdrops/Ankh.bm { default install_target = /usr/dt/share/backdrops/Ankh.bm } -# +XCOMM programs/backdrops/BrickWall.bm { default install_target = /usr/dt/share/backdrops/BrickWall.bm } -# +XCOMM programs/backdrops/Concave.pm { default install_target = /usr/dt/share/backdrops/Concave.pm } -# +XCOMM programs/backdrops/Convex.pm { default install_target = /usr/dt/share/backdrops/Convex.pm } -# +XCOMM programs/backdrops/Corduroy.pm { default install_target = /usr/dt/share/backdrops/Corduroy.pm } -# +XCOMM programs/backdrops/Crochet.pm { default install_target = /usr/dt/share/backdrops/Crochet.pm } -# +XCOMM programs/backdrops/InlayColor.pm { default install_target = /usr/dt/share/backdrops/InlayColor.pm } -# +XCOMM programs/backdrops/InlayPlain.pm { default install_target = /usr/dt/share/backdrops/InlayPlain.pm } -# +XCOMM programs/backdrops/KnitLight.pm { default install_target = /usr/dt/share/backdrops/KnitLight.pm } -# +XCOMM programs/backdrops/Lattice.pm { default install_target = /usr/dt/share/backdrops/Lattice.pm } -# +XCOMM programs/backdrops/LatticeBig.pm { default install_target = /usr/dt/share/backdrops/LatticeBig.pm } -# +XCOMM programs/backdrops/Leaves.pm { default install_target = /usr/dt/share/backdrops/Leaves.pm } -# +XCOMM programs/backdrops/OldChars.pm { default install_target = /usr/dt/share/backdrops/OldChars.pm } -# +XCOMM programs/backdrops/Paver.pm { default install_target = /usr/dt/share/backdrops/Paver.pm } -# +XCOMM programs/backdrops/Pebbles.pm { default install_target = /usr/dt/share/backdrops/Pebbles.pm } -# +XCOMM programs/backdrops/PinStripe.pm { default install_target = /usr/dt/share/backdrops/PinStripe.pm } -# +XCOMM programs/backdrops/RakedSand.bm { default install_target = /usr/dt/share/backdrops/RakedSand.bm } -# +XCOMM programs/backdrops/RicePaper.pm { default install_target = /usr/dt/share/backdrops/RicePaper.pm } -# +XCOMM programs/backdrops/SkyDark.pm { default install_target = /usr/dt/share/backdrops/SkyDark.pm } -# +XCOMM programs/backdrops/SkyLight.pm { default install_target = /usr/dt/share/backdrops/SkyLight.pm } -# +XCOMM programs/backdrops/Sprinkles.pm { default install_target = /usr/dt/share/backdrops/Sprinkles.pm } -# -# +XCOMM +XCOMM programs/backdrops/SunLogo.pm { sun install_target = /usr/dt/share/backdrops/SunLogo.pm } -# +XCOMM programs/backdrops/Toronto.bm { default install_target = /usr/dt/share/backdrops/Toronto.bm } -# +XCOMM programs/backdrops/WaterDrops.pm { default install_target = /usr/dt/share/backdrops/WaterDrops.pm } -# +XCOMM programs/backdrops/Wooly.pm { default install_target = /usr/dt/share/backdrops/Wooly.pm } -# +XCOMM ./share/backdrops { default install_target = /usr/dt/backdrops type = sym_link } -# -# shell script -# +XCOMM +XCOMM shell script +XCOMM programs/dtfile/dtfile_error { default install_target = /usr/dt/bin/dtfile_error mode = 0555 } -# -#<<-------------------------------------------- -# The DT binaries follow -#>>-------------------------------------------- -# +XCOMM +XCOMM <<-------------------------------------------- +XCOMM The DT binaries follow +XCOMM >>-------------------------------------------- +XCOMM programs/dtappbuilder/src/ab/dtbuilder { default install_target = /usr/dt/bin/dtbuilder mode = 0555 } -# +XCOMM programs/dtappbuilder/src/abmf/dtcodegen { default install_target = /usr/dt/bin/dtcodegen mode = 0555 } -# +XCOMM programs/dtfile/dtfile { default install_target = /usr/dt/bin/dtfile mode = 0555 } -# +XCOMM programs/dtfile/dtcopy/dtfile_copy { default install_target = /usr/dt/bin/dtfile_copy mode = 0555 } -# #ifdef HAS_PAM_LIBRARY +XCOMM programs/dtsession/dtsession { default install_target = /usr/dt/bin/dtsession - owner = root mode = 0555 } #else @@ -1538,49 +1537,49 @@ programs/dtsession/dtsession mode = 04555 } #endif -# +XCOMM programs/dtsession/dtloadresources { default install_target = /usr/dt/bin/dtsession_res mode = 0555 } -# +XCOMM programs/dtwm/dtwm { default install_target = /usr/dt/bin/dtwm mode = 0555 } -# -# Prints the definition hierarchy of the front panel -# +XCOMM +XCOMM Prints the definition hierarchy of the front panel +XCOMM programs/dtwm/dtfplist { default install_target = /usr/dt/bin/dtfplist mode = 0555 } -# +XCOMM programs/dtlogin/dtlogin { default install_target = /usr/dt/bin/dtlogin mode = 0544 owner = root } -# +XCOMM programs/dtlogin/dtchooser { default install_target = /usr/dt/bin/dtchooser mode = 0544 owner = root } -# +XCOMM programs/dtlogin/dtgreet { default install_target = /usr/dt/bin/dtgreet mode = 0544 } -# -# Create hpterm link on hpux only -# +XCOMM +XCOMM Create hpterm link on hpux only +XCOMM /usr/bin/X11/hpterm { hpux install_target = /usr/dt/bin/hpterm @@ -1588,7 +1587,7 @@ programs/dtlogin/dtgreet type = sym_link mode = 04555 } -# +XCOMM /usr/bin/X11/hpterm { hpV4 install_target = /usr/dt/bin/hpterm @@ -1596,19 +1595,19 @@ programs/dtlogin/dtgreet type = sym_link mode = 04555 } -# +XCOMM /usr/bin/X11/aixterm { aix install_target = /usr/dt/bin/aixterm type = sym_link } -# +XCOMM programs/dthello/dthello { default install_target = /usr/dt/bin/dthello mode = 0555 } -# +XCOMM programs/dtaction/dtaction { default install_target = /usr/dt/bin/dtaction @@ -1616,7 +1615,7 @@ programs/dtaction/dtaction group = sys mode = 06555 } -# +XCOMM programs/dtaction/dtaction { hpux install_target = /usr/dt/bin/dtaction @@ -1624,7 +1623,7 @@ programs/dtaction/dtaction group = sys mode = 06555 } -# +XCOMM programs/dtaction/dtaction { hpV4 install_target = /usr/dt/bin/dtaction @@ -1632,7 +1631,7 @@ programs/dtaction/dtaction group = sys mode = 06555 } -# +XCOMM programs/dtaction/dtaction { aix install_target = /usr/dt/bin/dtaction @@ -1640,7 +1639,7 @@ programs/dtaction/dtaction group = sys mode = 06555 } -# +XCOMM programs/dtaction/dtaction { sun install_target = /usr/dt/bin/dtaction @@ -1648,166 +1647,166 @@ programs/dtaction/dtaction group = sys mode = 06555 } -# +XCOMM programs/dtpad/dtpad { default install_target = /usr/dt/bin/dtpad mode = 0555 } -# +XCOMM programs/dtstyle/dtstyle { default install_target = /usr/dt/bin/dtstyle mode = 0555 } -# +XCOMM programs/dtscreen/dtscreen { default install_target = /usr/dt/bin/dtscreen mode = 0555 } -# +XCOMM programs/dticon/dticon { default install_target = /usr/dt/bin/dticon mode = 0555 } -# +XCOMM programs/dtcalc/dtcalc { default install_target = /usr/dt/bin/dtcalc mode = 0555 } -# +XCOMM programs/dtudcfonted/dtudcfonted { default install_target = /usr/dt/bin/dtudcfonted mode = 0555 } -# +XCOMM programs/localized/C/app-defaults/Dtudcfonted { default install_target = /usr/dt/app-defaults/C/Dtudcfonted } -# +XCOMM programs/dtudcexch/dtudcexch { default install_target = /usr/dt/bin/dtudcexch mode = 0555 } -# +XCOMM programs/dtudcfonted/dtaddcpf/dtaddcpf { default install_target = /usr/dt/lib/dtudcfonted/dtaddcpf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtbdftocpf/dtbdftocpf { default install_target = /usr/dt/lib/dtudcfonted/dtbdftocpf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtcpftobdf/dtcpftobdf { default install_target = /usr/dt/lib/dtudcfonted/dtcpftobdf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtcpftogpf/dtcpftogpf { default install_target = /usr/dt/lib/dtudcfonted/dtcpftogpf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtcpgpf/dtcpgpf { default install_target = /usr/dt/lib/dtudcfonted/dtcpgpf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtgpftobdf/dtgpftobdf { default install_target = /usr/dt/lib/dtudcfonted/dtgpftobdf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtgpftocpf/dtgpftocpf { default install_target = /usr/dt/lib/dtudcfonted/dtgpftocpf mode = 0555 } -# +XCOMM programs/dtudcfonted/dtlsgpf/dtlsgpf { default install_target = /usr/dt/lib/dtudcfonted/dtlsgpf mode = 0555 } -# +XCOMM programs/dtudcfonted/libfal/fonts.list { default install_target = /usr/dt/config/C/fonts.list } -# +XCOMM programs/dtterm/dtterm { default install_target = /usr/dt/bin/dtterm mode = 04555 owner = root } -# +XCOMM programs/dtterm/dtterm.ti { default install_target = /usr/dt/config/dtterm.ti } -# +XCOMM programs/dtsearchpath/dtsp/dtsp { default install_target = /usr/dt/bin/dtsearchpath mode = 0555 } -# +XCOMM programs/dtsearchpath/dtappg/dtappg { default install_target = /usr/dt/bin/dtappgather mode = 04555 owner = root } -# +XCOMM programs/util/dttypes/dttypes { default install_target = /usr/dt/bin/dttypes mode = 0555 } -# +XCOMM programs/dsdm/dsdm { default install_target = /usr/dt/bin/dsdm mode = 0555 } -# +XCOMM programs/dtimsstart/dtimsstart { default install_target = /usr/dt/bin/dtimsstart mode = 0555 } -# +XCOMM programs/dtpdm/dtpdm { default install_target = /usr/dt/bin/dtpdm mode = 0555 } -# +XCOMM programs/dtpdmd/dtpdmd { default install_target = /usr/dt/bin/dtpdmd mode = 0555 } -# -# CDE Calendar from SUN ... Brent Ayers -# +XCOMM +XCOMM CDE Calendar from SUN ... Brent Ayers +XCOMM -# executable files +XCOMM executable files programs/dtcm/server/rpc.cmsd { default @@ -1860,16 +1859,16 @@ programs/dtdspmsg/dtdspmsg install_target = /usr/dt/bin/dtdspmsg mode = 0555 } -# -# CDE mailer from SUN ... Neil Katin -# -# -# -------------------------- -# --- Dtmail files --- -# -------------------------- -# +XCOMM +XCOMM CDE mailer from SUN ... Neil Katin +XCOMM +XCOMM +XCOMM -------------------------- +XCOMM --- Dtmail files --- +XCOMM -------------------------- +XCOMM -# executable files +XCOMM executable files programs/dtmail/dtmail/dtmail { default install_target = /usr/dt/bin/dtmail @@ -1884,31 +1883,31 @@ programs/dtmail/dtmailpr/dtmailpr group = mail } -# data typing +XCOMM data typing programs/localized/C/types/dtmail.dt { default install_target = /usr/dt/appconfig/types/C/dtmail.dt } -# App-defaults +XCOMM App-defaults programs/localized/C/app-defaults/Dtmail { default install_target = /usr/dt/app-defaults/C/Dtmail } -#>>----------------------------- -# the Front Panel configuration file -# ------------------------------ -# +XCOMM >>----------------------------- +XCOMM the Front Panel configuration file +XCOMM ------------------------------ +XCOMM programs/localized/C/types/dtwm.fp { default install_target = /usr/dt/appconfig/types/C/dtwm.fp } -#>>----------------------------- -# Action and filetype databases -# ------------------------------ -# +XCOMM >>----------------------------- +XCOMM Action and filetype databases +XCOMM ------------------------------ +XCOMM programs/localized/C/types/autoStart.dt { default install_target = /usr/dt/appconfig/types/C/autoStart.dt @@ -1917,526 +1916,526 @@ programs/localized/C/types/uxstd.dt { default install_target = /usr/dt/appconfig/types/C/uxstd.dt } -# +XCOMM programs/localized/C/types/dt.dt { default install_target = /usr/dt/appconfig/types/C/dt.dt } -# +XCOMM programs/localized/C/types/develop.dt { default install_target = /usr/dt/appconfig/types/C/develop.dt } -# +XCOMM programs/localized/C/types/datatypes.dt { default install_target = /usr/dt/appconfig/types/C/datatypes.dt } -# +XCOMM programs/localized/C/types/dtappman.dt { default install_target = /usr/dt/appconfig/types/C/dtappman.dt } -# +XCOMM programs/localized/C/types/dtfile.dt { default install_target = /usr/dt/appconfig/types/C/dtfile.dt } -# +XCOMM programs/localized/C/types/dtpad.dt { default install_target = /usr/dt/appconfig/types/C/dtpad.dt } -# +XCOMM programs/localized/C/types/xclients.dt { default install_target = /usr/dt/appconfig/types/C/xclients.dt } -# +XCOMM programs/localized/C/types/print.dt { default install_target = /usr/dt/appconfig/types/C/print.dt } -# +XCOMM programs/localized/C/types/user-prefs.dt { default install_target = /usr/dt/appconfig/types/C/user-prefs.dt } -# +XCOMM programs/localized/C/types/dthelp.dt { default install_target = /usr/dt/appconfig/types/C/dthelp.dt } -# -#programs/localized/C/types/hp.dt -#{ hpux -# install_target = /usr/dt/appconfig/types/C/hp.dt -#} -# -#programs/localized/C/types/ibm.dt -#{ aix -# install_target = /usr/dt/appconfig/types/C/ibm.dt -#} -# +XCOMM +XCOMM programs/localized/C/types/hp.dt +XCOMM { hpux +XCOMM install_target = /usr/dt/appconfig/types/C/hp.dt +XCOMM } +XCOMM +XCOMM programs/localized/C/types/ibm.dt +XCOMM { aix +XCOMM install_target = /usr/dt/appconfig/types/C/ibm.dt +XCOMM } +XCOMM programs/localized/C/types/dtscreen.dt { default install_target = /usr/dt/appconfig/types/C/dtscreen.dt } -# +XCOMM programs/localized/C/types/dtims.dt { default install_target = /usr/dt/appconfig/types/C/dtims.dt } -# +XCOMM programs/localized/C/types/dtbuilder.dt { default install_target = /usr/dt/appconfig/types/C/dtbuilder.dt } -# Additional actions from Antonis Tsolomitis desktop_approots package +XCOMM Additional actions from Antonis Tsolomitis desktop_approots package programs/localized/C/types/Education.dt { default install_target = /usr/dt/appconfig/types/C/Education.dt } -# +XCOMM programs/localized/C/types/gcompris.dt { default install_target = /usr/dt/appconfig/types/C/gcompris.dt } -# +XCOMM programs/localized/C/types/geogebra.dt { default install_target = /usr/dt/appconfig/types/C/geogebra.dt } -# +XCOMM programs/localized/C/types/stellarium.dt { default install_target = /usr/dt/appconfig/types/C/stellarium.dt } -# +XCOMM programs/localized/C/types/tuxpaint.dt { default install_target = /usr/dt/appconfig/types/C/tuxpaint.dt } -# +XCOMM programs/localized/C/types/dreamchess.dt { default install_target = /usr/dt/appconfig/types/C/dreamchess.dt } -# +XCOMM programs/localized/C/types/eboard.dt { default install_target = /usr/dt/appconfig/types/C/eboard.dt } -# +XCOMM programs/localized/C/types/Games.dt { default install_target = /usr/dt/appconfig/types/C/Games.dt } -# +XCOMM programs/localized/C/types/gcompris.dt { default install_target = /usr/dt/appconfig/types/C/gcompris.dt } -# +XCOMM programs/localized/C/types/ktuberling.dt { default install_target = /usr/dt/appconfig/types/C/ktuberling.dt } -# +XCOMM programs/localized/C/types/lbreakout2.dt { default install_target = /usr/dt/appconfig/types/C/lbreakout2.dt } -# +XCOMM programs/localized/C/types/powermanga.dt { default install_target = /usr/dt/appconfig/types/C/powermanga.dt } -# +XCOMM programs/localized/C/types/pychess.dt { default install_target = /usr/dt/appconfig/types/C/pychess.dt } -# +XCOMM programs/localized/C/types/supertux.dt { default install_target = /usr/dt/appconfig/types/C/supertux.dt } -# +XCOMM programs/localized/C/types/xboard.dt { default install_target = /usr/dt/appconfig/types/C/xboard.dt } -# +XCOMM programs/localized/C/types/fontforge.dt { default install_target = /usr/dt/appconfig/types/C/fontforge.dt } -# +XCOMM programs/localized/C/types/gimp.dt { default install_target = /usr/dt/appconfig/types/C/gimp.dt } -# +XCOMM programs/localized/C/types/Graphics.dt { default install_target = /usr/dt/appconfig/types/C/Graphics.dt } -# +XCOMM programs/localized/C/types/inkscape.dt { default install_target = /usr/dt/appconfig/types/C/inkscape.dt } -# +XCOMM programs/localized/C/types/okular.dt { default install_target = /usr/dt/appconfig/types/C/okular.dt } -# +XCOMM programs/localized/C/types/xv.dt { default install_target = /usr/dt/appconfig/types/C/xv.dt } -# +XCOMM programs/localized/C/types/chromium.dt { default install_target = /usr/dt/appconfig/types/C/chromium.dt } -# +XCOMM programs/localized/C/types/firefox.dt { default install_target = /usr/dt/appconfig/types/C/firefox.dt } -# +XCOMM programs/localized/C/types/Internet.dt { default install_target = /usr/dt/appconfig/types/C/Internet.dt } -# +XCOMM programs/localized/C/types/nxclient.dt { default install_target = /usr/dt/appconfig/types/C/nxclient.dt } -# +XCOMM programs/localized/C/types/skype.dt { default install_target = /usr/dt/appconfig/types/C/skype.dt } -# +XCOMM programs/localized/C/types/thunderbird.dt { default install_target = /usr/dt/appconfig/types/C/thunderbird.dt } -# +XCOMM programs/localized/C/types/amarok.dt { default install_target = /usr/dt/appconfig/types/C/amarok.dt } -# +XCOMM programs/localized/C/types/brasero.dt { default install_target = /usr/dt/appconfig/types/C/brasero.dt } -# +XCOMM programs/localized/C/types/k3b.dt { default install_target = /usr/dt/appconfig/types/C/k3b.dt } -# +XCOMM programs/localized/C/types/k9copy.dt { default install_target = /usr/dt/appconfig/types/C/k9copy.dt } -# +XCOMM programs/localized/C/types/Media_Tools.dt { default install_target = /usr/dt/appconfig/types/C/Media_Tools.dt } -# +XCOMM programs/localized/C/types/pavucontrol.dt { default install_target = /usr/dt/appconfig/types/C/pavucontrol.dt } -# +XCOMM programs/localized/C/types/rhythmbox.dt { default install_target = /usr/dt/appconfig/types/C/rhythmbox.dt } -# +XCOMM programs/localized/C/types/rosegarden.dt { default install_target = /usr/dt/appconfig/types/C/rosegarden.dt } -# +XCOMM programs/localized/C/types/sound-juicer.dt { default install_target = /usr/dt/appconfig/types/C/sound-juicer.dt } -# +XCOMM programs/localized/C/types/vlc.dt { default install_target = /usr/dt/appconfig/types/C/vlc.dt } -# +XCOMM programs/localized/C/types/xine.dt { default install_target = /usr/dt/appconfig/types/C/xine.dt } -# +XCOMM programs/localized/C/types/libreoffice-base.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-base.dt } -# +XCOMM programs/localized/C/types/libreoffice-calc.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-calc.dt } -# +XCOMM programs/localized/C/types/libreoffice-draw.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-draw.dt } -# +XCOMM programs/localized/C/types/libreoffice-impress.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-impress.dt } -# +XCOMM programs/localized/C/types/libreoffice-main.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-main.dt } -# +XCOMM programs/localized/C/types/libreoffice-math.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-math.dt } -# +XCOMM programs/localized/C/types/libreoffice-writer.dt { default install_target = /usr/dt/appconfig/types/C/libreoffice-writer.dt } -# +XCOMM programs/localized/C/types/nedit.dt { default install_target = /usr/dt/appconfig/types/C/nedit.dt } -# +XCOMM programs/localized/C/types/Office.dt { default install_target = /usr/dt/appconfig/types/C/Office.dt } -# +XCOMM programs/localized/C/types/xournal.dt { default install_target = /usr/dt/appconfig/types/C/xournal.dt } -# +XCOMM programs/localized/C/types/caja.dt { default install_target = /usr/dt/appconfig/types/C/caja.dt } -# +XCOMM programs/localized/C/types/engrampa.dt { default install_target = /usr/dt/appconfig/types/C/engrampa.dt } -# +XCOMM programs/localized/C/types/file-roller.dt { default install_target = /usr/dt/appconfig/types/C/file-roller.dt } -# +XCOMM programs/localized/C/types/firestarter.dt { default install_target = /usr/dt/appconfig/types/C/firestarter.dt } -# +XCOMM programs/localized/C/types/pgadmin.dt { default install_target = /usr/dt/appconfig/types/C/pgadmin.dt } -# +XCOMM programs/localized/C/types/synaptic.dt { default install_target = /usr/dt/appconfig/types/C/synaptic.dt } -# +XCOMM programs/localized/C/types/System.dt { default install_target = /usr/dt/appconfig/types/C/System.dt } -# +XCOMM programs/localized/C/types/virtualbox.dt { default install_target = /usr/dt/appconfig/types/C/virtualbox.dt } -# +XCOMM programs/localized/C/types/wicd.dt { default install_target = /usr/dt/appconfig/types/C/wicd.dt } -# +XCOMM programs/localized/C/types/acroread.dt { default install_target = /usr/dt/appconfig/types/C/acroread.dt } -# +XCOMM programs/localized/C/types/emacs.dt { default install_target = /usr/dt/appconfig/types/C/emacs.dt } -# +XCOMM programs/localized/C/types/gv.dt { default install_target = /usr/dt/appconfig/types/C/gv.dt } -# +XCOMM programs/localized/C/types/kile.dt { default install_target = /usr/dt/appconfig/types/C/kile.dt } -# +XCOMM programs/localized/C/types/mgv.dt { default install_target = /usr/dt/appconfig/types/C/mgv.dt } -# +XCOMM programs/localized/C/types/TeX.dt { default install_target = /usr/dt/appconfig/types/C/TeX.dt } -# +XCOMM programs/localized/C/types/xdvi.dt { default install_target = /usr/dt/appconfig/types/C/xdvi.dt } -# +XCOMM programs/localized/C/types/xournal.dt { default install_target = /usr/dt/appconfig/types/C/xournal.dt } -# +XCOMM programs/localized/C/types/xpdf.dt { default install_target = /usr/dt/appconfig/types/C/xpdf.dt } -# +XCOMM programs/localized/C/types/DisplayImage.dt { default install_target = /usr/dt/appconfig/types/C/DisplayImage.dt } -# +XCOMM programs/localized/C/types/DisplayPDF.dt { default install_target = /usr/dt/appconfig/types/C/DisplayPDF.dt } -# +XCOMM programs/localized/C/types/DisplayVideo.dt { default install_target = /usr/dt/appconfig/types/C/DisplayVideo.dt } -# +XCOMM programs/localized/C/types/DisplayPS.dt { default install_target = /usr/dt/appconfig/types/C/DisplayPS.dt } -# +XCOMM programs/localized/C/types/videoTypes.dt { default install_target = /usr/dt/appconfig/types/C/videoTypes.dt } -# +XCOMM programs/localized/C/types/IconBrowse.dt { default install_target = /usr/dt/share/examples/types/C/IconBrowse.dt } -# +XCOMM programs/localized/C/types/miscActions.dt { default install_target = /usr/dt/share/examples/types/C/miscActions.dt } -# +XCOMM programs/localized/C/types/miscImages.dt { default install_target = /usr/dt/share/examples/types/C/miscImages.dt } -# +XCOMM programs/types/error.ds { default install_target = /usr/dt/bin/dterror.ds @@ -2448,55 +2447,55 @@ programs/types/error.ds install_target = /usr/dt/examples type = sym_link } -# -#>>----------------------------- -# -# dtsearch -# -#<<----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM +XCOMM dtsearch +XCOMM +XCOMM <<----------------------------- +XCOMM programs/dtsr/dtsrclean { default install_target = /usr/dt/bin/dtsrclean mode = 0555 } -# +XCOMM programs/dtsr/dtsrcreate { default install_target = /usr/dt/bin/dtsrcreate mode = 0555 } -# +XCOMM programs/dtsr/dtsrdbrec { default install_target = /usr/dt/bin/dtsrdbrec mode = 0555 } -# +XCOMM programs/dtsr/dtsrdelete { default install_target = /usr/dt/bin/dtsrdelete mode = 0555 } -# +XCOMM programs/dtsr/dtsrhan { default install_target = /usr/dt/bin/dtsrhan mode = 0555 } -# +XCOMM programs/dtsr/dtsrindex { default install_target = /usr/dt/bin/dtsrindex mode = 0555 } -# +XCOMM programs/dtsr/dtsrkdump { default install_target = /usr/dt/bin/dtsrkdump mode = 0555 } -# +XCOMM programs/dtsr/dtsrload { default install_target = /usr/dt/bin/dtsrload @@ -2512,197 +2511,197 @@ programs/dtsr/dtsearch.dbd install_target = /usr/dt/infolib/etc/dtsr/dtsearch.dbd mode = 0555 } -# -#>>----------------------------- -# -# dtinfo -# -#<<----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM +XCOMM dtinfo +XCOMM +XCOMM <<----------------------------- +XCOMM programs/dtinfo/dtinfo/src/dtinfo { default install_target = /usr/dt/bin/dtinfo mode = 0555 } -# +XCOMM programs/dtinfo/clients/dtinfo_start/dtinfo_start { default install_target = /usr/dt/infolib/etc/dtinfo_start mode = 0555 } -# -# -#>>----------------------------- -# -# dtinfogen -# -#<<----------------------------- -# +XCOMM +XCOMM +XCOMM >>----------------------------- +XCOMM +XCOMM dtinfogen +XCOMM +XCOMM <<----------------------------- +XCOMM programs/dtinfo/dtinfogen/infolib/etc/dtinfogen { default install_target = /usr/dt/bin/dtinfogen mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker { default install_target = /usr/dt/infolib/etc/dtinfogen_worker mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/infolib/etc/MixedGen { default install_target = /usr/dt/infolib/etc/MixedGen mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/infolib/etc/NCFGen { default install_target = /usr/dt/infolib/etc/NCFGen mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/infolib/etc/NodeParser { default install_target = /usr/dt/infolib/etc/NodeParser mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/infolib/etc/StyleUpdate { default install_target = /usr/dt/infolib/etc/StyleUpdate mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/install/valBase { default install_target = /usr/dt/infolib/etc/valBase mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/install/ChangeCaseTitle { default install_target = /usr/dt/infolib/etc/ChangeCaseTitle mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/install/InstallBase { default install_target = /usr/dt/infolib/etc/InstallBase mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/install/DeInstallBase { default install_target = /usr/dt/infolib/etc/DeInstallBase mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/install/Librarian { default install_target = /usr/dt/infolib/etc/Librarian mode = 0555 } -# +XCOMM programs/nsgmls/nsgmls { default install_target = /usr/dt/infolib/etc/nsgmls mode = 0555 } -# -#>>----------------------------- -# -# MMDB -# -#<<----------------------------- -# +XCOMM +XCOMM >>----------------------------- +XCOMM +XCOMM MMDB +XCOMM +XCOMM <<----------------------------- +XCOMM programs/dtinfo/dtinfogen/mmdb/src/dbdrv { default install_target = /usr/dt/infolib/etc/dbdrv mode = 0555 } -# +XCOMM programs/dtinfo/dtinfogen/mmdb/StyleSheet/validator { default install_target = /usr/dt/infolib/etc/validator mode = 0555 } -# -#>>----------------------------- -# -# DtSearch entries -# -#<<----------------------------- -# -# +XCOMM +XCOMM >>----------------------------- +XCOMM +XCOMM DtSearch entries +XCOMM +XCOMM <<----------------------------- +XCOMM +XCOMM programs/localized/C/dtsr/eng.sfx { default install_target = /usr/dt/infolib/etc/C/dtsr/eng.sfx } -# +XCOMM programs/localized/C/dtsr/eng.stp { default install_target = /usr/dt/infolib/etc/C/dtsr/eng.stp } -# +XCOMM programs/localized/de_DE.UTF-8/dtsr/deu.sfx { default install_target = /usr/dt/infolib/etc/de_DE.UTF-8/dtsr/deu.sfx } -# +XCOMM programs/localized/de_DE.UTF-8/dtsr/deu.stp { default install_target = /usr/dt/infolib/etc/de_DE.UTF-8/dtsr/deu.stp } -# +XCOMM programs/localized/es_ES.UTF-8/dtsr/esp.sfx { default install_target = /usr/dt/infolib/etc/es_ES.UTF-8/dtsr/esp.sfx } -# +XCOMM programs/localized/es_ES.UTF-8/dtsr/esp.stp { default install_target = /usr/dt/infolib/etc/es_ES.UTF-8/dtsr/esp.stp } -# +XCOMM programs/localized/fr_FR.UTF-8/dtsr/fra.sfx { default install_target = /usr/dt/infolib/etc/fr_FR.UTF-8/dtsr/fra.sfx } -# +XCOMM programs/localized/fr_FR.UTF-8/dtsr/fra.stp { default install_target = /usr/dt/infolib/etc/fr_FR.UTF-8/dtsr/fra.stp } -# +XCOMM programs/localized/it_IT.UTF-8/dtsr/ita.sfx { default install_target = /usr/dt/infolib/etc/it_IT.UTF-8/dtsr/ita.sfx } -# +XCOMM programs/localized/it_IT.UTF-8/dtsr/ita.stp { default install_target = /usr/dt/infolib/etc/it_IT.UTF-8/dtsr/ita.stp } -# +XCOMM programs/localized/ja_JP.dt-eucJP/dtsr/jpn.knj { default install_target = /usr/dt/infolib/etc/ja_JP.EUC-JP/dtsr/jpn.knj } -# -#>>----------------------------- -# -# dtopen entries -# -#<<----------------------------- -# -# +XCOMM +XCOMM >>----------------------------- +XCOMM +XCOMM dtopen entries +XCOMM +XCOMM <<----------------------------- +XCOMM +XCOMM programs/dtopen/dtopen { default install_target = /usr/dt/bin/dtopen mode = 0555 } -# Now the dtopen symlinks +XCOMM Now the dtopen symlinks ./dtopen { default install_target = /usr/dt/bin/dtopen_image diff --git a/cde/databases/CDE-SHLIBS.src b/cde/databases/CDE-SHLIBS.src index 2e487a369..adad53c77 100644 --- a/cde/databases/CDE-SHLIBS.src +++ b/cde/databases/CDE-SHLIBS.src @@ -461,6 +461,26 @@ XCOMM install_target = /usr/dt/lib/libDtMmdb.so type = sym_link } +#ifdef HAS_PAM_LIBRARY +XCOMM +lib/DtPamSvc/libDtPamSvc.so.2.1 +{ linux + install_target = /usr/dt/lib/libDtPamSvc.so.2.1 + mode = 0755 +} +XCOMM +./libDtPamSvc.so.2.1 +{ linux + install_target = /usr/dt/lib/libDtPamSvc.so.2 + type = sym_link +} +XCOMM +./libDtPamSvc.so.2.1 +{ linux + install_target = /usr/dt/lib/libDtPamSvc.so + type = sym_link +} +#endif XCOMM @@ -859,6 +879,20 @@ XCOMM install_target = /usr/dt/lib/libDtMmdb.so type = sym_link } +#ifdef HAS_PAM_LIBRARY +XCOMM +lib/DtPamSvc/libDtPamSvc.so.2 +{ freebsd + install_target = /usr/dt/lib/libDtPamSvc.so.2 + mode = 0555 +} +XCOMM +./libDtPamSvc.so.2 +{ freebsd + install_target = /usr/dt/lib/libDtPamSvc.so + type = sym_link +} +#endif XCOMM XCOMM @@ -1046,4 +1080,23 @@ XCOMM install_target = /usr/dt/lib/libDtMmdb.so type = sym_link } +#ifdef HAS_PAM_LIBRARY XCOMM +lib/DtPamSvc/libDtPamSvc.so.2.1 +{ netbsd + install_target = /usr/dt/lib/libDtPamSvc.so.2.1 + mode = 0755 +} +XCOMM +./libDtPamSvc.so.2.1 +{ netbsd + install_target = /usr/dt/lib/libDtPamSvc.so.2 + type = sym_link +} +XCOMM +./libDtPamSvc.so.2.1 +{ netbsd + install_target = /usr/dt/lib/libDtPamSvc.so + type = sym_link +} +#endif diff --git a/cde/databases/Imakefile b/cde/databases/Imakefile index 2009bd973..509dd1850 100644 --- a/cde/databases/Imakefile +++ b/cde/databases/Imakefile @@ -111,7 +111,10 @@ CONVERSION= -toDB all:: -CppSourceFile(CDE-SHLIBS.udb,CDE-SHLIBS.src,$(UDB_CPP_UNDEF_LIST),) +UDB_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) +CppSourceFile(CDE-SHLIBS.udb,CDE-SHLIBS.src,$(UDB_CPP_LIST),) +CppSourceFile(CDE-MIN.udb,CDE-MIN.src,$(UDB_CPP_LIST),) +CppSourceFile(CDE-RUN.udb,CDE-RUN.src,$(UDB_CPP_LIST),) UDBS = \ CDE-DEMOS.udb \ @@ -200,8 +203,7 @@ clean:: /* * Default locale (C) */ -LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_ENGLISH_ \ - UTF8_NLS_SUPPORT_OPT +LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_ENGLISH_ UTF8_NLS_SUPPORT_OPT CppSourceFile(CDE-LOC-C.tmp,CDE-LOC.src,$(LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-C.tmp,CDE-HELP-LOC.src,$(LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-C.tmp,CDE-MSG-LOC.src,$(LOC_CPP_LIST),) @@ -211,7 +213,7 @@ CreateLocalizedFilesets(C,C,C,CDE-RUN,CDE-ENG-A-HELP,CDE-ENG-A-MSG,C,C,CDE-LOC-C /* * German */ -DE_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_GERMAN_ +DE_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_GERMAN_ CppSourceFile(CDE-LOC-DE.tmp,CDE-LOC.src,$(DE_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-DE.tmp,CDE-HELP-LOC.src,$(DE_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-DE.tmp,CDE-MSG-LOC.src,$(DE_LOC_CPP_LIST),) @@ -221,7 +223,7 @@ CreateLocalizedFilesets(DE,de_DE.UTF-8,German,CDE-LANGS,CDE-GER-I-HELP,CDE-GER-I /* * Spanish */ -ES_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_SPANISH_ +ES_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_SPANISH_ CppSourceFile(CDE-LOC-ES.tmp,CDE-LOC.src,$(ES_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-ES.tmp,CDE-HELP-LOC.src,$(ES_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-ES.tmp,CDE-MSG-LOC.src,$(ES_LOC_CPP_LIST),) @@ -231,7 +233,7 @@ CreateLocalizedFilesets(ES,es_ES.UTF-8,Spanish,CDE-LANGS,CDE-SPA-I-HELP,CDE-SPA- /* * French */ -FR_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_FRENCH_ +FR_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_FRENCH_ CppSourceFile(CDE-LOC-FR.tmp,CDE-LOC.src,$(FR_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-FR.tmp,CDE-HELP-LOC.src,$(FR_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-FR.tmp,CDE-MSG-LOC.src,$(FR_LOC_CPP_LIST),) @@ -241,7 +243,7 @@ CreateLocalizedFilesets(FR,fr_FR.UTF-8,French,CDE-LANGS,CDE-FRE-I-HELP,CDE-FRE-I /* * Italian */ -IT_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_ITALIAN_ +IT_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_ITALIAN_ CppSourceFile(CDE-LOC-IT.tmp,CDE-LOC.src,$(IT_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-IT.tmp,CDE-HELP-LOC.src,$(IT_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-IT.tmp,CDE-MSG-LOC.src,$(IT_LOC_CPP_LIST),) @@ -251,7 +253,7 @@ CreateLocalizedFilesets(IT,it_IT.UTF-8,Italian,CDE-LANGS,CDE-ITA-I-HELP,CDE-ITA- /* * Japanese */ -JP_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) $(UDB_CPP_DEF_LIST) -D_JAPANESE_ +JP_LOC_CPP_LIST = $(UDB_CPP_UNDEF_LIST) -D_JAPANESE_ CppSourceFile(CDE-LOC-JP.tmp,CDE-LOC.src,$(JP_LOC_CPP_LIST),) CppSourceFile(CDE-HELP-LOC-JP.tmp,CDE-HELP-LOC.src,$(JP_LOC_CPP_LIST),) CppSourceFile(CDE-MSG-LOC-JP.tmp,CDE-MSG-LOC.src,$(JP_LOC_CPP_LIST),) From 051e5a3cc2fb3908ae5f517b78b59c7e7f494482 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Fri, 29 Jan 2021 23:59:22 -0500 Subject: [PATCH 72/90] dtlogin: add utmpx support to UtmpIdOpen. --- cde/programs/dtlogin/account.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtlogin/account.c b/cde/programs/dtlogin/account.c index 3f4face0e..96019858a 100644 --- a/cde/programs/dtlogin/account.c +++ b/cde/programs/dtlogin/account.c @@ -406,11 +406,18 @@ Account( struct display *d, char *user, char *line, pid_t pid, int UtmpIdOpen( char *utmpId ) { - struct utmp *u; /* pointer to entry in utmp file */ int status = 1; /* return code */ -#if !defined(CSRG_BASED) +#if !defined(CSRG_BASED) || defined(HAS_PAM_LIBRARY) +#ifdef HAS_PAM_LIBRARY + struct utmpx *u; /* pointer to entry in utmp file */ + + while ( (u = getutxent()) != NULL ) { +#else + struct utmp *u; /* pointer to entry in utmp file */ + while ( (u = getutent()) != NULL ) { +#endif if ( (strncmp(u->ut_id, utmpId, 4) == 0 ) && u->ut_type != DEAD_PROCESS ) { @@ -420,7 +427,11 @@ UtmpIdOpen( char *utmpId ) } } +#ifdef HAS_PAM_LIBRARY + endutxent(); +#else endutent(); +#endif #endif return (status); } From 468aa1642da1be2f6f0d2da8128efdb57a041f5b Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 1 Feb 2021 08:06:07 +0800 Subject: [PATCH 73/90] dtsession: revise localAuthenticate. --- cde/programs/dtsession/SmLock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cde/programs/dtsession/SmLock.c b/cde/programs/dtsession/SmLock.c index 46a0e8f77..d881dfd54 100644 --- a/cde/programs/dtsession/SmLock.c +++ b/cde/programs/dtsession/SmLock.c @@ -1611,6 +1611,9 @@ localAuthenticate( char *service; struct passwd *pwent; + if (!(name && name[0])) name = NULL; + if (uid < 0) uid = 0; + if (!(name || passwd)) return True; if (!passwd) return False; if (!(pwent = name ? getpwnam(name) : getpwuid(uid))) return False; From 32a2fd8cc986b4daf132537a625f3fe4b1e87d1a Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Mon, 1 Feb 2021 23:43:52 +0800 Subject: [PATCH 74/90] DtPamSvc: Improve user experience. --- cde/lib/DtPamSvc/PamSvc.c | 17 +++-------------- cde/lib/DtPamSvc/PamSvc.h | 4 ---- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/cde/lib/DtPamSvc/PamSvc.c b/cde/lib/DtPamSvc/PamSvc.c index 94f802916..1e8c571e9 100644 --- a/cde/lib/DtPamSvc/PamSvc.c +++ b/cde/lib/DtPamSvc/PamSvc.c @@ -48,9 +48,9 @@ #include #include #include -#include #include #include +#include #include "PamSvc.h" /* @@ -69,7 +69,6 @@ static char* create_devname(char* short_devname); static struct pam_conv pam_conv = {login_conv, NULL}; static char *saved_user_passwd; static pam_handle_t *pamh = NULL; -static int pam_auth_trys = 0; /**************************************************************************** * PamInit @@ -126,18 +125,8 @@ int _DtAuthentication ( char* prog_name, status = PamInit(prog_name, user, line_dev, display_name); if (status == PAM_SUCCESS) { - struct passwd *pwd; - saved_user_passwd = user_passwd; status = pam_authenticate( pamh, 0 ); - pam_auth_trys++; - - if (status != PAM_SUCCESS) { - sleep(PAM_LOGIN_SLEEPTIME); - if (pam_auth_trys > PAM_LOGIN_MAXTRIES) { - sleep(PAM_LOGIN_DISABLETIME); - } - } }; if (status != PAM_SUCCESS) { @@ -208,8 +197,8 @@ int _DtSetCred(char* prog_name, char* user, uid_t uid, gid_t gid) if (status == PAM_SUCCESS && setgid(gid) == -1) status = DT_BAD_GID; - if (status == PAM_SUCCESS && - ( !user) || (initgroups(user, gid) == -1) ) + if ((status == PAM_SUCCESS && + !user) || (initgroups(user, gid) == -1)) status = DT_INITGROUP_FAIL; if (status == PAM_SUCCESS) diff --git a/cde/lib/DtPamSvc/PamSvc.h b/cde/lib/DtPamSvc/PamSvc.h index d28b42a85..d76ff3e33 100644 --- a/cde/lib/DtPamSvc/PamSvc.h +++ b/cde/lib/DtPamSvc/PamSvc.h @@ -43,10 +43,6 @@ #include -#define PAM_LOGIN_MAXTRIES 5 -#define PAM_LOGIN_SLEEPTIME 4 -#define PAM_LOGIN_DISABLETIME 20 - #define DT_BAD_GID 29 /* Invalid Group ID */ #define DT_INITGROUP_FAIL 30 /* group IDs init failed */ #define DT_BAD_UID 31 /* Invaid User ID */ From 4d67fc93029b6a5c1187ee027b08fef74d20ddee Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Tue, 2 Feb 2021 02:22:52 +0800 Subject: [PATCH 75/90] dtlogin: revise the Imakefile for config. --- cde/programs/dtlogin/config/Imakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtlogin/config/Imakefile b/cde/programs/dtlogin/config/Imakefile index 91d21274b..f86532a57 100644 --- a/cde/programs/dtlogin/config/Imakefile +++ b/cde/programs/dtlogin/config/Imakefile @@ -28,6 +28,7 @@ LOCAL_CPP_DEFINES += -DFREEBSD #if defined(HasPamLibrary) && HasPamLibrary LOCAL_CPP_DEFINES += -DHAS_PAM_LIBRARY +EXTRA_CPP_TARGETS += pam.d.dtlogin #ifdef PamAuthenticationModule PAM_AUTHENTICATION_MODULE=PamAuthenticationModule LOCAL_CPP_DEFINES += -DPAM_AUTHENTICATION_MODULE=$(PAM_AUTHENTICATION_MODULE) @@ -56,8 +57,7 @@ CPP_TARGETS = \ Xstartup current.session \ display.current.session display.home.session \ dtlslocale dtprofile \ - home.session pam.d.dtlogin \ - $(EXTRA_CPP_TARGETS) + home.session $(EXTRA_CPP_TARGETS) AllTarget($(CPP_TARGETS)) From 2634630dd6ec72dd6c3f24eecf685eaeee4b3ac0 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 22 May 2021 12:49:36 -0600 Subject: [PATCH 76/90] NetBSD.cf: add a link comment to list package needed for PAM support --- cde/config/cf/NetBSD.cf | 1 + 1 file changed, 1 insertion(+) diff --git a/cde/config/cf/NetBSD.cf b/cde/config/cf/NetBSD.cf index c6449989f..67d6c11ff 100644 --- a/cde/config/cf/NetBSD.cf +++ b/cde/config/cf/NetBSD.cf @@ -318,6 +318,7 @@ CXXDEPENDINCLUDE != CppCmd -x c++ -Wp,-v < /dev/null \ #endif #if !defined(HasPamLibrary) +XCOMM need to install pam-pwauth_suid package for this to work #define HasPamLibrary YES #endif From 0ffd6762d7598b1bba3d301547ae77f965b56c51 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 22 May 2021 12:50:25 -0600 Subject: [PATCH 77/90] FreeBSD.cf,DragonFly.cf: disable PAM support by default These system can support PAM, but it requires a port of the NetBSD module to do so. As a result, this support is disabled by default. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253073 for a patch to add this support to the OS. Then you can set HasPamLibrary to YES in the respective .cf files, rebuild CDE, and try it out. --- cde/config/cf/DragonFly.cf | 6 ++++-- cde/config/cf/FreeBSD.cf | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cde/config/cf/DragonFly.cf b/cde/config/cf/DragonFly.cf index 5f45c053c..8a5b287f8 100644 --- a/cde/config/cf/DragonFly.cf +++ b/cde/config/cf/DragonFly.cf @@ -190,8 +190,10 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion) (OSRelVersio # define HasZlib YES #endif -#ifndef HasPam -# define HasPam YES +#ifndef HasPamLibrary +XCOMM See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253073 +XCOMM to enable pam support +# define HasPamLibrary NO #endif /* Take from FreeBSD */ diff --git a/cde/config/cf/FreeBSD.cf b/cde/config/cf/FreeBSD.cf index 48ac23c73..77eace491 100644 --- a/cde/config/cf/FreeBSD.cf +++ b/cde/config/cf/FreeBSD.cf @@ -248,7 +248,9 @@ ICONVSYSLIB != if test -f /usr/local/include/iconv.h; then echo -liconv; else ec #define CDESharedRev 2 #if !defined(HasPamLibrary) -#define HasPamLibrary YES +XCOMM See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253073 +XCOMM to enable pam support +#define HasPamLibrary NO #endif #if !defined(PamAuthenticationModule) From 616dd16c703aa88ae0bcceb63f257accd4452067 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 22 May 2021 15:30:58 -0600 Subject: [PATCH 78/90] Bump devel version to 2.3.2c --- cde/Makefile | 2 +- cde/copyright | 4 ++-- cde/doc/common/help/HELPEnt.sgm | 2 +- cde/lib/DtSvc/DtUtil1/Dt.h | 2 +- cde/lib/tt/bin/ttauth/ttauth.man | 2 +- cde/lib/tt/tooltalk.tmpl | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cde/Makefile b/cde/Makefile index abc4e51ca..4be80adce 100644 --- a/cde/Makefile +++ b/cde/Makefile @@ -1,5 +1,5 @@ # $TOG: Makefile /main/15 1999/10/12 09:33:30 mgreess $ - RELEASE = Release 2.3.2b + RELEASE = Release 2.3.2c PRODUCT = CDE SHELL = /bin/sh RM = rm -f diff --git a/cde/copyright b/cde/copyright index 5a15917e9..0aed25774 100644 --- a/cde/copyright +++ b/cde/copyright @@ -1,10 +1,10 @@ - Common Desktop Environment Version 2.3.2b (devel) + Common Desktop Environment Version 2.3.2c (devel) (c) Copyright 1993-2012 The Open Group -(c) Copyright 2012-2021 CDE Project contributors, see CONTRIBUTORS for details +(c) Copyright 2012-2022 CDE Project contributors, see CONTRIBUTORS for details Project Website: http://cdesktopenv.sourceforge.net/ diff --git a/cde/doc/common/help/HELPEnt.sgm b/cde/doc/common/help/HELPEnt.sgm index 2a2e8c5c9..bed290b99 100644 --- a/cde/doc/common/help/HELPEnt.sgm +++ b/cde/doc/common/help/HELPEnt.sgm @@ -1,5 +1,5 @@ -Common Desktop Environment 2.3.2b, +Common Desktop Environment 2.3.2c, © Copyright 1993-2012 The Open Group © Copyright 2012-2020 CDE Project contributors, see CONTRIBUTORS for details diff --git a/cde/lib/DtSvc/DtUtil1/Dt.h b/cde/lib/DtSvc/DtUtil1/Dt.h index 8411ee30a..d83f7d226 100644 --- a/cde/lib/DtSvc/DtUtil1/Dt.h +++ b/cde/lib/DtSvc/DtUtil1/Dt.h @@ -58,7 +58,7 @@ extern "C" { DtREVISION * 100 + \ DtUPDATE_LEVEL) -#define DtVERSION_STRING "CDE Version 2.3.2b" +#define DtVERSION_STRING "CDE Version 2.3.2c" /* diff --git a/cde/lib/tt/bin/ttauth/ttauth.man b/cde/lib/tt/bin/ttauth/ttauth.man index 34cfd2717..831ab9b8e 100644 --- a/cde/lib/tt/bin/ttauth/ttauth.man +++ b/cde/lib/tt/bin/ttauth/ttauth.man @@ -18,7 +18,7 @@ .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. -.TH TTAUTH 1 "Release 2.3.2b" "CDE" +.TH TTAUTH 1 "Release 2.3.2c" "CDE" .SH NAME ttauth \- ToolTalk authority file utility .SH SYNOPSIS diff --git a/cde/lib/tt/tooltalk.tmpl b/cde/lib/tt/tooltalk.tmpl index a749ace2d..65998b4e5 100644 --- a/cde/lib/tt/tooltalk.tmpl +++ b/cde/lib/tt/tooltalk.tmpl @@ -6,7 +6,7 @@ /* TT_VERSION defines the version string which is imbedded in all the */ /* binaries and shipped libraries. */ -TT_VERSION = "CDE Version 2.3.2b" +TT_VERSION = "CDE Version 2.3.2c" TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" From 3c4e5b3124aa184413e2fde82a3c42726df3c539 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Tue, 20 Apr 2021 08:46:54 +0800 Subject: [PATCH 79/90] DtTerm: Add pts driver support. --- cde/lib/DtTerm/TermPrim/Imakefile | 4 + cde/lib/DtTerm/TermPrim/TermPrimGetPty-pts.c | 104 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 cde/lib/DtTerm/TermPrim/TermPrimGetPty-pts.c diff --git a/cde/lib/DtTerm/TermPrim/Imakefile b/cde/lib/DtTerm/TermPrim/Imakefile index 0f209613f..46cf8b4ae 100644 --- a/cde/lib/DtTerm/TermPrim/Imakefile +++ b/cde/lib/DtTerm/TermPrim/Imakefile @@ -77,6 +77,9 @@ OBJS = \ #include +#if defined(HasPtsDriver) && HasPtsDriver +LinkFile(TermPrimGetPty.c,TermPrimGetPty-pts.c) +#else /* These should be cleaned up. Test SVR4Architecture? */ #ifdef AlphaArchitecture LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c) @@ -105,6 +108,7 @@ LinkFile(TermPrimGetPty.c,TermPrimGetPty-svr4.c) #ifdef BSDArchitecture LinkFile(TermPrimGetPty.c,TermPrimGetPty-bsd.c) #endif +#endif SubdirLibraryRule($(OBJS)) diff --git a/cde/lib/DtTerm/TermPrim/TermPrimGetPty-pts.c b/cde/lib/DtTerm/TermPrim/TermPrimGetPty-pts.c new file mode 100644 index 000000000..ed5b0af73 --- /dev/null +++ b/cde/lib/DtTerm/TermPrim/TermPrimGetPty-pts.c @@ -0,0 +1,104 @@ +/* + * CDE - Common Desktop Environment + * + * Copyright (c) 1993-2012, The Open Group. All rights reserved. + * + * These libraries and programs are free software; you can + * redistribute them and/or modify them under the terms of the GNU + * Lesser General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * These libraries and programs are distributed in the hope that + * they will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with these libraries and programs; if not, write + * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + * Floor, Boston, MA 02110-1301 USA + */ +/* * + * (c) Copyright 1993, 1994 Hewlett-Packard Company * + * (c) Copyright 1993, 1994 International Business Machines Corp. * + * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * + * (c) Copyright 1993, 1994 Novell, Inc. * + */ + +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 600 +#endif + +#include "TermPrim.h" +#include "TermPrimDebug.h" +#include "TermHeader.h" +#include +#include +#include + +int +_DtTermPrimGetPty(char **ptySlave, char **ptyMaster) +{ + char *c; + int ptyFd; + + *ptyMaster = NULL; + + if (isDebugFSet('p', 10)) { +#ifdef BBA +#pragma BBA_IGNORE +#endif /*BBA*/ + return(-1); + } + + if ((ptyFd = posix_openpt(O_RDWR)) >= 0) { + + /* use grantpt to prevent other processes from grabbing the tty that + * goes with the pty master we have opened. It is a mandatory step + * in the SVR4 pty-tty initialization. Note that /dev must be + * mounted read/write... + */ + Debug('T', timeStamp("_DtTermPrimGetPty() calling grantpt()")); + if (grantpt(ptyFd) == -1) { + (void) perror("grantpt"); + (void) close(ptyFd); + return(-1); + } + + /* Unlock the pty master/slave pair so the slave can be opened later */ + Debug('T', timeStamp("_DtTermPrimGetPty() calling unlockpt()")); + if (unlockpt(ptyFd) == -1) { + (void) perror("unlockpt"); + (void) close(ptyFd); + return(-1); + } + Debug('T', timeStamp("_DtTermPrimGetPty() unlockpt() finished")); + + /* get the pty slave name... */ + if (c = ptsname(ptyFd)) { + *ptySlave = malloc(strlen(c) + 1); + (void) strcpy(*ptySlave, c); + return(ptyFd); + } else { + /* ptsname on the pty master failed. This should not happen!... */ + (void) perror("ptsname"); + (void) close(ptyFd); + } + } else { + (void) perror("posix_openpt"); + } + return(-1); +} + +/* dummy functions */ + +void _DtTermPrimReleasePty(char *ptySlave) {} +void _DtTermPrimPtyCleanup(void) {} + +int +_DtTermPrimSetupPty(char *ptySlave, int ptyFd) +{ + return(0); +} From 8f52a65638cbb2f9b8d5cd155bab64e88ca8df7c Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 25 Apr 2021 00:06:33 +0800 Subject: [PATCH 80/90] DtTerm: Add libutempter support for utmp/wtmp updates. --- cde/lib/DtTerm/Imakefile | 7 ++++++- cde/lib/DtTerm/TermPrim/Imakefile | 9 +++++++-- cde/lib/DtTerm/TermPrim/TermPrim.c | 14 ++++++++++++++ cde/lib/DtTerm/TermPrim/TermPrimSubproc.c | 4 ++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/cde/lib/DtTerm/Imakefile b/cde/lib/DtTerm/Imakefile index 6646e7d65..ab700594f 100644 --- a/cde/lib/DtTerm/Imakefile +++ b/cde/lib/DtTerm/Imakefile @@ -53,7 +53,6 @@ TERMPRIM_OBJS = \ TermPrim/TermPrimScroll.o \ TermPrim/TermPrimSelect.o \ TermPrim/TermPrimSetPty.o \ - TermPrim/TermPrimSetUtmp.o \ TermPrim/TermPrimSubproc.o \ TermPrim/TermPrimUtil.o \ TermPrim/TermPrimVersion.o \ @@ -78,6 +77,12 @@ TERMVIEW_OBJS = \ TermView/TermViewGlobalDialog.o \ TermView/TermViewTerminalDialog.o +#if defined(HasUtempterLibrary) && HasUtempterLibrary +REQUIREDLIBS += -lutempter +#else +TERMPRIM_OBJS += TermPrim/TermPrimSetUtmp.o +#endif + OBJS = \ $(TERMPRIM_OBJS) \ $(TERM_OBJS) \ diff --git a/cde/lib/DtTerm/TermPrim/Imakefile b/cde/lib/DtTerm/TermPrim/Imakefile index 46cf8b4ae..74cbdf12f 100644 --- a/cde/lib/DtTerm/TermPrim/Imakefile +++ b/cde/lib/DtTerm/TermPrim/Imakefile @@ -40,7 +40,6 @@ SRCS = \ TermPrimScroll.c \ TermPrimSelect.c \ TermPrimSetPty.c \ - TermPrimSetUtmp.c \ TermPrimSubproc.c \ TermPrimUtil.c \ TermPrimVersion.c \ @@ -69,12 +68,18 @@ OBJS = \ TermPrimScroll.o \ TermPrimSelect.o \ TermPrimSetPty.o \ - TermPrimSetUtmp.o \ TermPrimSubproc.o \ TermPrimUtil.o \ TermPrimVersion.o \ TermPrimWMProtocols.o +#if defined(HasUtempterLibrary) && HasUtempterLibrary +EXTRA_DEFINES = -DHAS_UTEMPTER_LIBRARY +#else +SRCS += TermPrimSetUtmp.c +OBJS += TermPrimSetUtmp.o +#endif + #include #if defined(HasPtsDriver) && HasPtsDriver diff --git a/cde/lib/DtTerm/TermPrim/TermPrim.c b/cde/lib/DtTerm/TermPrim/TermPrim.c index 16053c2c3..3688e4623 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrim.c +++ b/cde/lib/DtTerm/TermPrim/TermPrim.c @@ -82,6 +82,10 @@ extern char * _DtTermPrimGetMessage( char *filename, int set, int n, char *s ); # include #endif +#ifdef HAS_UTEMPTER_LIBRARY +#include +#endif + extern void TermReadKey(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ClassInitialize(void); @@ -1068,7 +1072,9 @@ Initialize(Widget ref_w, Widget w, Arg *args, Cardinal *num_args) /* ** Initialize the utmp stuff... */ +#ifndef HAS_UTEMPTER_LIBRARY _DtTermPrimUtmpInit(w); +#endif /* ** Initialize the selection inforamtion @@ -2478,8 +2484,12 @@ Realize(Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) /* get the utmp line name to use for searching later... */ if (tw->term.pty >= 0) { +#ifdef HAS_UTEMPTER_LIBRARY + utempter_add_record(tw->term.pty, DisplayString(XtDisplay(w))); +#else tw->term.tpd->utmpId = _DtTermPrimUtmpGetUtLine(-1, tw->term.ptySlaveName); +#endif } /* @@ -2620,11 +2630,15 @@ Destroy(Widget w) _DtTermPrimToggleSuidRoot(False); /* clean up our utmp entry... */ +#ifdef HAS_UTEMPTER_LIBRARY + utempter_remove_added_record(); +#else if (tw->term.tpd && tw->term.tpd->utmpId && *tw->term.tpd->utmpId) { _DtTermPrimUtmpEntryDestroy(w, tw->term.tpd->utmpId); (void) XtFree(tw->term.tpd->utmpId); tw->term.tpd->utmpId = (char *) 0; } +#endif /* close and release the... */ diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c b/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c index 367cf694d..c61d472df 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c @@ -573,8 +573,10 @@ _DtTermPrimSubprocExec(Widget w, } /* set our utmp entry... */ +#ifndef HAS_UTEMPTER_LIBRARY (void) _DtTermPrimUtmpEntryCreate(w, getpid(), ((DtTermPrimitiveWidget)w)->term.tpd->utmpId); +#endif if (isDebugSet('T')) { #ifdef BBA @@ -652,7 +654,9 @@ _DtTermPrimSubprocExec(Widget w, /* assume that our child set up a utmp entry (since we have no way * for it to report to us) and add it to the list to cleanup)... */ +#ifndef HAS_UTEMPTER_LIBRARY _DtTermPrimUtmpAddEntry(((DtTermPrimitiveWidget)w)->term.tpd->utmpId); +#endif return(pid); } From 2536c2c1ba4398c76e11b022e8ff8b18245d7673 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 25 Apr 2021 00:30:37 +0800 Subject: [PATCH 81/90] dtterm: Add libutempter support for utmp/wtmp updates. --- cde/programs/dtterm/DtTermMain.c | 2 ++ cde/programs/dtterm/Imakefile | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/cde/programs/dtterm/DtTermMain.c b/cde/programs/dtterm/DtTermMain.c index d6229b543..51f00f773 100644 --- a/cde/programs/dtterm/DtTermMain.c +++ b/cde/programs/dtterm/DtTermMain.c @@ -840,7 +840,9 @@ SignalHandler { DebugF('s', 10, fprintf(stderr, ">>SignalHandler() starting\n")); _DtTermPrimPtyCleanup(); +#ifndef HAS_UTEMPTER_LIBRARY _DtTermPrimUtmpCleanup(); +#endif _DtTermPrimLogFileCleanup(); DebugF('s', 10, fprintf(stderr, ">>SignalHandler() finished\n")); (void) exit(0); diff --git a/cde/programs/dtterm/Imakefile b/cde/programs/dtterm/Imakefile index 844494151..2f900e8f7 100644 --- a/cde/programs/dtterm/Imakefile +++ b/cde/programs/dtterm/Imakefile @@ -18,6 +18,10 @@ DEFINES = $(ARCHITECTURE_DEFINES) -DSUN_TERMINAL_SERVER EXTRA_DEFINES = -DBUILD_HPVUE -DHPVUE #endif /* Build_HpVue */ +#if defined(HasUtempterLibrary) && HasUtempterLibrary +EXTRA_DEFINES = -DHAS_UTEMPTER_LIBRARY +#endif + #ifdef SunArchitecture HELPLIB = $(DTSVCLIB) $(TTLIB) DEPHELPLIB = $(DEPDTSVCLIB) $(DEPTTLIB) From 2887eed4700787fdeb11bcb914968271aa74893a Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 25 Apr 2021 00:56:24 +0800 Subject: [PATCH 82/90] databases: Install dtterm as an unprivileged program when PTS driver and libutempter are available. --- cde/databases/CDE-RUN.src | 9 +++++++++ cde/databases/Imakefile | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/cde/databases/CDE-RUN.src b/cde/databases/CDE-RUN.src index 2536c9043..347391864 100644 --- a/cde/databases/CDE-RUN.src +++ b/cde/databases/CDE-RUN.src @@ -1747,13 +1747,22 @@ programs/dtudcfonted/libfal/fonts.list { default install_target = /usr/dt/config/C/fonts.list } +#if defined(HAS_PTS_DRIVER) && defined(HAS_UTEMPTER_LIBRARY) XCOMM programs/dtterm/dtterm +{ default + install_target = /usr/dt/bin/dtterm + mode = 0555 + owner = root +} +#else +programs/dtterm/dtterm { default install_target = /usr/dt/bin/dtterm mode = 04555 owner = root } +#endif XCOMM programs/dtterm/dtterm.ti { default diff --git a/cde/databases/Imakefile b/cde/databases/Imakefile index 509dd1850..a56806b23 100644 --- a/cde/databases/Imakefile +++ b/cde/databases/Imakefile @@ -38,6 +38,14 @@ UDB_CPP_UNDEF_LIST = -UhpV4 -Uhpux -Uaix -Usun -Uunix -Ulinux -Uopenbsd -Ufreebs UDB_CPP_DEF_LIST = -DHAS_PAM_LIBRARY #endif +#if defined(HasPtsDriver) && HasPtsDriver +UDB_CPP_DEF_LIST += -DHAS_PTS_DRIVER +#endif + +#if defined(HasUtempterLibrary) && HasUtempterLibrary +UDB_CPP_DEF_LIST += -DHAS_UTEMPTER_LIBRARY +#endif + #if defined UTF8_NLS_SUPPORT # define UTF8_NLS_SUPPORT_OPT -DUTF8_NLS_SUPPORT #else From fad5b988c1574e54ee270548f45e5f62320e3bcc Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Sun, 25 Apr 2021 01:08:01 +0800 Subject: [PATCH 83/90] FreeBSD.cf: Enable PTS driver and libutempter. --- cde/config/cf/FreeBSD.cf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cde/config/cf/FreeBSD.cf b/cde/config/cf/FreeBSD.cf index 77eace491..5e418e9b3 100644 --- a/cde/config/cf/FreeBSD.cf +++ b/cde/config/cf/FreeBSD.cf @@ -257,4 +257,12 @@ XCOMM to enable pam support #define PamAuthenticationModule /usr/local/lib/security/pam_pwauth_suid.so #endif +#if !defined(HasPtsDriver) +#define HasPtsDriver YES +#endif + +#if !defined(HasUtempterLibrary) +#define HasUtempterLibrary YES +#endif + #include From 51a15d0b38257e1daa17b09304e66f705df0e6c0 Mon Sep 17 00:00:00 2001 From: Liang Chang Date: Fri, 23 Apr 2021 01:10:40 -0400 Subject: [PATCH 84/90] linux.cf: Enable PTS driver and libutempter. --- cde/config/cf/linux.cf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index fe0509b7c..ac41511da 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -303,5 +303,13 @@ XCOMM This is needed for CDE currently #define HasPamLibrary YES #endif +#if !defined(HasPtsDriver) +#define HasPtsDriver YES +#endif + +#if !defined(HasUtempterLibrary) +#define HasUtempterLibrary YES +#endif + #include #include From b70be7b188803267ecb70d4d9ad6b6c21cef4930 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 30 May 2021 15:54:11 -0600 Subject: [PATCH 85/90] debin/control: add libpam and libutempter --- cde/debian/control | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cde/debian/control b/cde/debian/control index 945d81ac8..5f27c61fa 100644 --- a/cde/debian/control +++ b/cde/debian/control @@ -14,6 +14,8 @@ Build-Depends: debhelper (>= 10), libx11-dev, libxss-dev, libtirpc-dev, + libutempter-dev, + libpam-dev, x11-xserver-utils, libjpeg62-dev, libssl-dev, @@ -43,6 +45,8 @@ Depends: libxt6, libx11-6, libxss1, libtirpc1, + libutempter, + libpam, x11-xserver-utils, libjpeg62, libuil4, From 072d289a5e2fe271bd083a8630fbfd2145ef8ff6 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 30 May 2021 16:16:44 -0600 Subject: [PATCH 86/90] .gitignore: update for PAM changes --- cde/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cde/.gitignore b/cde/.gitignore index 5f7da6313..0d32f8329 100644 --- a/cde/.gitignore +++ b/cde/.gitignore @@ -122,6 +122,8 @@ xmakefile # generated db files databases/*\.db databases/*\.tmp +databases/CDE-MIN.udb +databases/CDE-RUN.udb databases/CDE-C.udb databases/CDE-DE.udb databases/CDE-ES.udb @@ -179,6 +181,7 @@ programs/dtsearchpath/dtsp/dtsp programs/dtsession/Dtsession programs/dtsession/dtloadresources programs/dtsession/dtsession +programs/dtsession/config/pam.d.dtsession programs/dtspcd/dtspcd programs/dtspcd/dtspcdenv programs/dtsr/dtsrclean @@ -959,6 +962,7 @@ programs/dtlogin/config/display.home.session programs/dtlogin/config/dtlslocale programs/dtlogin/config/dtprofile programs/dtlogin/config/home.session +programs/dtlogin/config/pam.d.dtlogin # programs/dtprintinfo programs/dtprintinfo/dtprintinfo.msg From a5da0c39db3cf4b61e51f588c944235df34b10c0 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 30 May 2021 16:24:51 -0600 Subject: [PATCH 87/90] Apply a patch from Roger Brown for risc-v and other minor fixes Summary: cde/config/cf/DtInfo.tmpl - add RISCVArchitecture as little endian cde/config/cf/Imake.cf - add AArch64Architecture for NetBSD cde/config/cf/Imake.cf - add RISCVArchitecture for Linux cde/config/cf/linux.cf - add RISCVArchitecture bit order cde/lib/DtHelp/Imakefile - add -ljpeg for OpenBSD --- cde/config/cf/DtInfo.tmpl | 2 +- cde/config/cf/Imake.cf | 8 ++++++++ cde/config/cf/linux.cf | 8 ++++++++ cde/lib/DtHelp/Imakefile | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cde/config/cf/DtInfo.tmpl b/cde/config/cf/DtInfo.tmpl index bef360eb4..e4a205c5b 100644 --- a/cde/config/cf/DtInfo.tmpl +++ b/cde/config/cf/DtInfo.tmpl @@ -412,7 +412,7 @@ TEMPLATE_OBJS=TemplateDB//**/*.o #define TemplateObjs $(TEMPLATE_OBJS) -#if defined(i386Architecture) || defined(AMD64Architecture) || defined(AlphaArchitecture) || defined(ARMArchitecture) || defined(AArch64Architecture) +#if defined(i386Architecture) || defined(AMD64Architecture) || defined(AlphaArchitecture) || defined(ARMArchitecture) || defined(AArch64Architecture) || defined(RISCVArchitecture) # define ByteOrderDefines LittleEndianDefines #elif defined(HAL32V7Architecture) || defined(SunArchitecture) || defined(SparcArchitecture) || defined(Sparc64Architecture) || defined(AIXArchitecture) || defined(HPArchitecture) || defined(PpcArchitecture) # define ByteOrderDefines BigEndianDefines diff --git a/cde/config/cf/Imake.cf b/cde/config/cf/Imake.cf index b28af3ce9..3b3452ec0 100644 --- a/cde/config/cf/Imake.cf +++ b/cde/config/cf/Imake.cf @@ -166,6 +166,10 @@ XCOMM $TOG: Imake.cf /main/30 1998/04/28 13:55:25 barstow $ # define SparcArchitecture # undef sparc # endif +# ifdef __aarch64__ +# define AArch64Architecture +# undef __aarch64__ +# endif #endif /* NetBSD */ #ifdef __FreeBSD__ @@ -470,6 +474,10 @@ XCOMM $TOG: Imake.cf /main/30 1998/04/28 13:55:25 barstow $ # endif # undef __powerpc__ # endif +# ifdef __riscv +# define RISCVArchitecture +# undef __riscv +# endif /* __riscv */ # if defined(__amd64__) || defined (__x86_64__) # undef __amd64__ # undef __x86_64__ diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index ac41511da..3a37c69f4 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -258,6 +258,14 @@ TIRPCINC = # define LinuxMachineDefines -D__alpha__ #endif /* AlphaArchitecture */ +#ifdef RISCVArchitecture +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif +# define LinuxMachineDefines -D__riscv__ +# define LSBBitOrder YES +#endif /* RISCVArchitecture */ + #ifdef Mc68020Architecture # ifndef OptimizedCDebugFlags # define OptimizedCDebugFlags DefaultGcc2i386Opt diff --git a/cde/lib/DtHelp/Imakefile b/cde/lib/DtHelp/Imakefile index a091a3d3c..aa1590131 100644 --- a/cde/lib/DtHelp/Imakefile +++ b/cde/lib/DtHelp/Imakefile @@ -38,7 +38,7 @@ DEFINES = -DDTLIB $(LOCAL_DEFINES) \ -DOSMINORVERSION=OSMinorVersion \ $(ICONV_INBUF_DEFINE) $(BIT_ORDER_DEFINES) -#if defined(FreeBSDArchitecture) +#if defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) JPEGLIB = -ljpeg #endif From 456abe8415f138e5f5fa7d4a0a3de82283497dc0 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 26 Jun 2021 13:39:26 -0600 Subject: [PATCH 88/90] Removed cde/programs/dtksh/ksh93 submodule at commit 66e1d446429543be0f9d47d9364e472932dc53f1 --- cde/programs/dtksh/ksh93 | 1 - 1 file changed, 1 deletion(-) delete mode 160000 cde/programs/dtksh/ksh93 diff --git a/cde/programs/dtksh/ksh93 b/cde/programs/dtksh/ksh93 deleted file mode 160000 index 66e1d4464..000000000 --- a/cde/programs/dtksh/ksh93 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 66e1d446429543be0f9d47d9364e472932dc53f1 From 12bbb66931feaac778ef4e47b67375ec9b58e839 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 26 Jun 2021 13:39:31 -0600 Subject: [PATCH 89/90] Squashed 'cde/programs/dtksh/ksh93/' content from commit 66e1d4464 git-subtree-dir: cde/programs/dtksh/ksh93 git-subtree-split: 66e1d446429543be0f9d47d9364e472932dc53f1 --- .github/workflows/ci.yml | 19 + .gitignore | 60 + LICENSE.md | 87 + NEWS | 892 + README.md | 211 + TODO | 36 + bin/Mamfile_indent | 33 + bin/ignore | 42 + bin/mamprobe | 273 + bin/package | 7429 ++++++++ bin/shtests | 54 + bin/silent | 41 + docs/index.html | 6 + docs/ksh/builtins.html | 710 + docs/ksh/examples.html | 55 + docs/ksh/faq.html | 1004 ++ docs/ksh/features.html | 207 + docs/ksh/functions/dirs.txt | 111 + docs/ksh/functions/emacs_keybind.txt | 12 + docs/ksh/functions/getopt.txt | 28 + docs/ksh/functions/keybind.txt | 14 + docs/ksh/functions/popd.txt | 111 + docs/ksh/functions/pushd.txt | 111 + docs/ksh/functions/title.txt | 54 + docs/ksh/functions/vi_keybind.txt | 10 + docs/ksh/index.html | 10 + docs/ksh/ksh.html | 118 + docs/ksh/scripts/cgi-lib.ksh.txt | 129 + docs/ksh/scripts/dump-cgi.ksh.txt | 17 + docs/ksh/scripts/env.txt | 66 + docs/ksh/scripts/line.txt | 2 + docs/ksh/scripts/which.txt | 2 + lib/package/CONVERT.mk | 260 + lib/package/INIT.README | 1029 ++ lib/package/INIT.html | 1007 ++ lib/package/INIT.pkg | 12 + lib/package/INIT.req | 0 lib/package/INIT.ver | 1 + lib/package/ast-ast.pkg | 11 + lib/package/ast-base.pkg | 22 + lib/package/ast-base.req | 0 lib/package/ast-base.ver | 1 + lib/package/ast-dss.pkg | 13 + lib/package/ast-ksh.pkg | 89 + lib/package/ast-ksh.req | 0 lib/package/ast-ksh.ver | 1 + lib/package/ast-make.pkg | 19 + lib/package/ast-open.pkg | 20 + lib/package/ast-open.req | 0 lib/package/ast-open.ver | 1 + lib/package/ast.def | 49 + lib/package/ast.lic | 5 + lib/package/bsd.def | 45 + lib/package/bsd.lic | 1 + lib/package/epl.def | 8 + lib/package/ksh.pkg | 14 + lib/package/package.mk | 1537 ++ lib/package/zlib.def | 39 + lib/package/zlib.lic | 1 + src/Mamfile | 16 + src/cmd/INIT/C+probe | 870 + src/cmd/INIT/CONVERT.mk | 260 + src/cmd/INIT/MAPLIB.mk | 45 + src/cmd/INIT/MSGFUN.mk | 2 + src/cmd/INIT/MSGKEY.mk | 2 + src/cmd/INIT/Mamfile | 1393 ++ src/cmd/INIT/PROBE.mk | 13 + src/cmd/INIT/RELEASE | 934 + src/cmd/INIT/TEST.mk | 197 + src/cmd/INIT/WWW.mk | 450 + src/cmd/INIT/ar.freebsd12.amd64 | 6 + src/cmd/INIT/ar.ibm.risc | 9 + src/cmd/INIT/ar.linux.i386-64 | 6 + src/cmd/INIT/cc.darwin | 52 + src/cmd/INIT/cc.darwin07 | 71 + src/cmd/INIT/cc.darwin11 | 71 + src/cmd/INIT/cc.freebsd | 9 + src/cmd/INIT/cc.hp.ia64 | 13 + src/cmd/INIT/cc.hp.pa | 13 + src/cmd/INIT/cc.hp.pa64 | 11 + src/cmd/INIT/cc.ibm.risc | 63 + src/cmd/INIT/cc.ibm.risc.gcc | 36 + src/cmd/INIT/cc.linux.aarch64 | 9 + src/cmd/INIT/cc.linux.i386-64 | 9 + src/cmd/INIT/cc.linux.i386-64-icc | 22 + src/cmd/INIT/cc.linux.i386-icc | 22 + src/cmd/INIT/cc.linux.ia64-icc | 22 + src/cmd/INIT/cc.lynxos.i386 | 81 + src/cmd/INIT/cc.lynxos.ppc | 85 + src/cmd/INIT/cc.mvs.390 | 279 + src/cmd/INIT/cc.next.i386 | 158 + src/cmd/INIT/cc.next.m68k | 9 + src/cmd/INIT/cc.openbsd | 9 + src/cmd/INIT/cc.osf.alpha | 9 + src/cmd/INIT/cc.pentium4 | 26 + src/cmd/INIT/cc.sco.i386 | 9 + src/cmd/INIT/cc.sgi.mips2 | 68 + src/cmd/INIT/cc.sgi.mips3 | 110 + src/cmd/INIT/cc.sgi.mips3-o32 | 65 + src/cmd/INIT/cc.sgi.mips4 | 90 + src/cmd/INIT/cc.sgi.mips4-n32 | 65 + src/cmd/INIT/cc.sol11.i386 | 18 + src/cmd/INIT/cc.sol11.i386-64 | 18 + src/cmd/INIT/cc.sol11.sparc | 18 + src/cmd/INIT/cc.sol11.sparc-64 | 18 + src/cmd/INIT/cc.specialize | 35 + src/cmd/INIT/cc.unix.mc68k | 76 + src/cmd/INIT/cc.unixware.i386 | 9 + src/cmd/INIT/crossexec.sh | 141 + src/cmd/INIT/db.c | 37 + src/cmd/INIT/ditto.sh | 460 + src/cmd/INIT/dl.c | 33 + src/cmd/INIT/execrate.sh | 187 + src/cmd/INIT/filter.sh | 102 + src/cmd/INIT/gdbm.c | 37 + src/cmd/INIT/gdbm1.c | 37 + src/cmd/INIT/gdbm2.c | 37 + src/cmd/INIT/hello.c | 23 + src/cmd/INIT/hosttype.tst | 6 + src/cmd/INIT/hurl.sh | 209 + src/cmd/INIT/iconv.c | 29 + src/cmd/INIT/iffe.sh | 4674 +++++ src/cmd/INIT/iffe.tst | 1945 +++ src/cmd/INIT/ignore.sh | 42 + src/cmd/INIT/intl.c | 29 + src/cmd/INIT/ld.hp.pa | 5 + src/cmd/INIT/ldd.cygwin.i386 | 22 + src/cmd/INIT/ldd.darwin | 2 + src/cmd/INIT/ldd.hp.pa | 21 + src/cmd/INIT/ldd.ibm.risc | 16 + src/cmd/INIT/ldd.lynxos | 1 + src/cmd/INIT/ldd.mvs.390 | 18 + src/cmd/INIT/ldd.sgi | 2 + src/cmd/INIT/m.c | 34 + src/cmd/INIT/m2.c | 36 + src/cmd/INIT/m3.c | 36 + src/cmd/INIT/m4.c | 32 + src/cmd/INIT/m5.c | 32 + src/cmd/INIT/m6.c | 34 + src/cmd/INIT/make.probe | 2241 +++ src/cmd/INIT/mamake.c | 2381 +++ src/cmd/INIT/mamake.rt | 40 + src/cmd/INIT/mamake.tst | 63 + src/cmd/INIT/mamprobe.sh | 273 + src/cmd/INIT/mkdir.sh | 83 + src/cmd/INIT/mktest.sh | 641 + src/cmd/INIT/mprobe.sh | 30 + src/cmd/INIT/nsl.c | 31 + src/cmd/INIT/p.c | 24 + src/cmd/INIT/package.mk | 1537 ++ src/cmd/INIT/package.sh | 7428 ++++++++ src/cmd/INIT/probe.win32 | 283 + src/cmd/INIT/proto.c | 5289 ++++++ src/cmd/INIT/ratz.c | 5312 ++++++ src/cmd/INIT/regress.sh | 1463 ++ src/cmd/INIT/release.c | 367 + src/cmd/INIT/rt.sh | 479 + src/cmd/INIT/silent.sh | 41 + src/cmd/INIT/socket.c | 33 + src/cmd/INIT/w.c | 30 + src/cmd/INIT/w2.c | 27 + src/cmd/Mamfile | 16 + src/cmd/builtin/Mamfile | 106 + src/cmd/builtin/RELEASE | 10 + src/cmd/builtin/features/pty | 60 + src/cmd/builtin/pty.c | 1124 ++ src/cmd/ksh93/COMPATIBILITY | 224 + src/cmd/ksh93/DESIGN | 171 + src/cmd/ksh93/Mamfile | 1589 ++ src/cmd/ksh93/OBSOLETE | 152 + src/cmd/ksh93/PROMO.mm | 141 + src/cmd/ksh93/README | 199 + src/cmd/ksh93/RELEASE | 3110 ++++ src/cmd/ksh93/RELEASE88 | 422 + src/cmd/ksh93/RELEASE93 | 455 + src/cmd/ksh93/SHOPT.sh | 40 + src/cmd/ksh93/TYPES | 182 + src/cmd/ksh93/bltins/alarm.c | 286 + src/cmd/ksh93/bltins/cd_pwd.c | 257 + src/cmd/ksh93/bltins/cflow.c | 120 + src/cmd/ksh93/bltins/enum.c | 275 + src/cmd/ksh93/bltins/getopts.c | 203 + src/cmd/ksh93/bltins/hist.c | 290 + src/cmd/ksh93/bltins/misc.c | 574 + src/cmd/ksh93/bltins/mkservice.c | 490 + src/cmd/ksh93/bltins/print.c | 1112 ++ src/cmd/ksh93/bltins/read.c | 822 + src/cmd/ksh93/bltins/regress.c | 343 + src/cmd/ksh93/bltins/sleep.c | 148 + src/cmd/ksh93/bltins/test.c | 705 + src/cmd/ksh93/bltins/trap.c | 489 + src/cmd/ksh93/bltins/typeset.c | 1561 ++ src/cmd/ksh93/bltins/ulimit.c | 216 + src/cmd/ksh93/bltins/umask.c | 98 + src/cmd/ksh93/bltins/whence.c | 314 + src/cmd/ksh93/builtins.mm | 648 + src/cmd/ksh93/data/aliases.c | 35 + src/cmd/ksh93/data/builtins.c | 2046 +++ src/cmd/ksh93/data/keywords.c | 62 + src/cmd/ksh93/data/lexstates.c | 416 + src/cmd/ksh93/data/limits.c | 62 + src/cmd/ksh93/data/math.tab | 75 + src/cmd/ksh93/data/msg.c | 206 + src/cmd/ksh93/data/options.c | 100 + src/cmd/ksh93/data/signals.c | 251 + src/cmd/ksh93/data/strdata.c | 104 + src/cmd/ksh93/data/testops.c | 170 + src/cmd/ksh93/data/variables.c | 131 + src/cmd/ksh93/edit/completion.c | 570 + src/cmd/ksh93/edit/edit.c | 1876 ++ src/cmd/ksh93/edit/emacs.c | 1601 ++ src/cmd/ksh93/edit/hexpand.c | 734 + src/cmd/ksh93/edit/history.c | 1218 ++ src/cmd/ksh93/edit/vi.c | 2785 +++ src/cmd/ksh93/features/cmds | 4 + src/cmd/ksh93/features/dynamic | 5 + src/cmd/ksh93/features/externs | 135 + src/cmd/ksh93/features/locale | 27 + src/cmd/ksh93/features/math.sh | 313 + src/cmd/ksh93/features/options | 47 + src/cmd/ksh93/features/poll | 155 + src/cmd/ksh93/features/rlimits | 27 + src/cmd/ksh93/features/setjmp | 18 + src/cmd/ksh93/features/sigfeatures | 49 + src/cmd/ksh93/features/time | 59 + src/cmd/ksh93/features/ttys | 3 + src/cmd/ksh93/fun/dirs | 112 + src/cmd/ksh93/fun/popd | 111 + src/cmd/ksh93/fun/pushd | 111 + src/cmd/ksh93/include/argnod.h | 145 + src/cmd/ksh93/include/builtins.h | 213 + src/cmd/ksh93/include/defs.h | 478 + src/cmd/ksh93/include/edit.h | 275 + src/cmd/ksh93/include/fault.h | 123 + src/cmd/ksh93/include/fcin.h | 71 + src/cmd/ksh93/include/history.h | 75 + src/cmd/ksh93/include/io.h | 122 + src/cmd/ksh93/include/jobs.h | 193 + src/cmd/ksh93/include/lexstates.h | 157 + src/cmd/ksh93/include/name.h | 271 + src/cmd/ksh93/include/national.h | 37 + src/cmd/ksh93/include/nval.h | 318 + src/cmd/ksh93/include/path.h | 148 + src/cmd/ksh93/include/regress.h | 66 + src/cmd/ksh93/include/shell.h | 269 + src/cmd/ksh93/include/shlex.h | 159 + src/cmd/ksh93/include/shnodes.h | 221 + src/cmd/ksh93/include/shtable.h | 66 + src/cmd/ksh93/include/streval.h | 205 + src/cmd/ksh93/include/terminal.h | 207 + src/cmd/ksh93/include/test.h | 72 + src/cmd/ksh93/include/timeout.h | 30 + src/cmd/ksh93/include/ulimit.h | 174 + src/cmd/ksh93/include/variables.h | 96 + src/cmd/ksh93/include/version.h | 46 + src/cmd/ksh93/ksh-regress.rt | 71 + src/cmd/ksh93/ksh-regress.tst | 22544 +++++++++++++++++++++++++ src/cmd/ksh93/mamexec | 307 + src/cmd/ksh93/mamstate.c | 73 + src/cmd/ksh93/nval.3 | 688 + src/cmd/ksh93/sh.1 | 8483 ++++++++++ src/cmd/ksh93/sh.memo | 3248 ++++ src/cmd/ksh93/sh/args.c | 784 + src/cmd/ksh93/sh/arith.c | 571 + src/cmd/ksh93/sh/array.c | 1839 ++ src/cmd/ksh93/sh/defs.c | 48 + src/cmd/ksh93/sh/deparse.c | 603 + src/cmd/ksh93/sh/expand.c | 388 + src/cmd/ksh93/sh/fault.c | 674 + src/cmd/ksh93/sh/fcin.c | 170 + src/cmd/ksh93/sh/init.c | 2122 +++ src/cmd/ksh93/sh/io.c | 2692 +++ src/cmd/ksh93/sh/jobs.c | 1967 +++ src/cmd/ksh93/sh/lex.c | 2525 +++ src/cmd/ksh93/sh/macro.c | 2847 ++++ src/cmd/ksh93/sh/main.c | 771 + src/cmd/ksh93/sh/name.c | 3652 ++++ src/cmd/ksh93/sh/nvdisc.c | 1496 ++ src/cmd/ksh93/sh/nvtree.c | 1147 ++ src/cmd/ksh93/sh/nvtype.c | 1682 ++ src/cmd/ksh93/sh/parse.c | 2079 +++ src/cmd/ksh93/sh/path.c | 1825 ++ src/cmd/ksh93/sh/pmain.c | 46 + src/cmd/ksh93/sh/shcomp.c | 179 + src/cmd/ksh93/sh/streval.c | 1029 ++ src/cmd/ksh93/sh/string.c | 743 + src/cmd/ksh93/sh/subshell.c | 923 + src/cmd/ksh93/sh/suid_exec.c | 516 + src/cmd/ksh93/sh/tdump.c | 262 + src/cmd/ksh93/sh/timers.c | 248 + src/cmd/ksh93/sh/trestore.c | 336 + src/cmd/ksh93/sh/waitevent.c | 54 + src/cmd/ksh93/sh/xec.c | 3807 +++++ src/cmd/ksh93/shell.3 | 420 + src/cmd/ksh93/tests/alias.sh | 117 + src/cmd/ksh93/tests/append.sh | 119 + src/cmd/ksh93/tests/arith.sh | 768 + src/cmd/ksh93/tests/arrays.sh | 721 + src/cmd/ksh93/tests/arrays2.sh | 244 + src/cmd/ksh93/tests/attributes.sh | 617 + src/cmd/ksh93/tests/basic.sh | 842 + src/cmd/ksh93/tests/bracket.sh | 425 + src/cmd/ksh93/tests/builtins.sh | 1016 ++ src/cmd/ksh93/tests/case.sh | 87 + src/cmd/ksh93/tests/comvar.sh | 718 + src/cmd/ksh93/tests/comvario.sh | 686 + src/cmd/ksh93/tests/coprocess.sh | 373 + src/cmd/ksh93/tests/cubetype.sh | 215 + src/cmd/ksh93/tests/enum.sh | 77 + src/cmd/ksh93/tests/exit.sh | 79 + src/cmd/ksh93/tests/expand.sh | 128 + src/cmd/ksh93/tests/functions.sh | 1327 ++ src/cmd/ksh93/tests/glob.sh | 379 + src/cmd/ksh93/tests/grep.sh | 104 + src/cmd/ksh93/tests/heredoc.sh | 534 + src/cmd/ksh93/tests/io.sh | 701 + src/cmd/ksh93/tests/leaks.sh | 422 + src/cmd/ksh93/tests/locale.sh | 335 + src/cmd/ksh93/tests/math.sh | 245 + src/cmd/ksh93/tests/nameref.sh | 696 + src/cmd/ksh93/tests/namespace.sh | 105 + src/cmd/ksh93/tests/options.sh | 577 + src/cmd/ksh93/tests/path.sh | 612 + src/cmd/ksh93/tests/pointtype.sh | 140 + src/cmd/ksh93/tests/pty.sh | 576 + src/cmd/ksh93/tests/quoting.sh | 374 + src/cmd/ksh93/tests/quoting2.sh | 262 + src/cmd/ksh93/tests/readcsv.sh | 75 + src/cmd/ksh93/tests/recttype.sh | 72 + src/cmd/ksh93/tests/restricted.sh | 88 + src/cmd/ksh93/tests/return.sh | 182 + src/cmd/ksh93/tests/select.sh | 66 + src/cmd/ksh93/tests/shtests | 458 + src/cmd/ksh93/tests/sigchld.sh | 162 + src/cmd/ksh93/tests/signal.sh | 531 + src/cmd/ksh93/tests/statics.sh | 690 + src/cmd/ksh93/tests/subshell.sh | 918 + src/cmd/ksh93/tests/substring.sh | 700 + src/cmd/ksh93/tests/tilde.sh | 100 + src/cmd/ksh93/tests/timetype.sh | 83 + src/cmd/ksh93/tests/treemove.sh | 165 + src/cmd/ksh93/tests/types.sh | 646 + src/cmd/ksh93/tests/variables.sh | 1189 ++ src/cmd/ksh93/tests/vartree1.sh | 219 + src/cmd/ksh93/tests/vartree2.sh | 339 + src/lib/Mamfile | 16 + src/lib/libast/Mamfile | 7345 ++++++++ src/lib/libast/README | 95 + src/lib/libast/RELEASE | 1808 ++ src/lib/libast/aso/aso-fcntl.c | 188 + src/lib/libast/aso/aso-sem.c | 193 + src/lib/libast/aso/aso.c | 867 + src/lib/libast/aso/asohdr.h | 71 + src/lib/libast/aso/asolock.c | 55 + src/lib/libast/aso/asometh.c | 43 + src/lib/libast/aso/asorelax.c | 56 + src/lib/libast/astsa/README-astsa | 15 + src/lib/libast/astsa/aso.c | 56 + src/lib/libast/astsa/aso.h | 32 + src/lib/libast/astsa/ast.c | 85 + src/lib/libast/astsa/ast.h | 156 + src/lib/libast/astsa/ast_common.h | 49 + src/lib/libast/astsa/astsa.manifest | 50 + src/lib/libast/astsa/astsa.mm | 33 + src/lib/libast/astsa/astsa.omk | 82 + src/lib/libast/astsa/ccode.h | 34 + src/lib/libast/astsa/debug.h | 29 + src/lib/libast/astsa/error.c | 103 + src/lib/libast/astsa/error.h | 66 + src/lib/libast/astsa/hashkey.h | 61 + src/lib/libast/astsa/mkast_sa | 150 + src/lib/libast/astsa/option.h | 106 + src/lib/libast/astsa/optlib.h | 105 + src/lib/libast/astsa/sfstr.c | 246 + src/lib/libast/astsa/sfstr.h | 60 + src/lib/libast/astsa/strdup.c | 37 + src/lib/libast/astsa/strmatch.c | 597 + src/lib/libast/astsa/times.h | 27 + src/lib/libast/astsa/vmalloc.c | 102 + src/lib/libast/astsa/vmalloc.h | 61 + src/lib/libast/cdt/cdtlib.h | 183 + src/lib/libast/cdt/dtclose.c | 66 + src/lib/libast/cdt/dtcomp.c | 54 + src/lib/libast/cdt/dtdisc.c | 88 + src/lib/libast/cdt/dthash.c | 453 + src/lib/libast/cdt/dthdr.h | 37 + src/lib/libast/cdt/dtlist.c | 384 + src/lib/libast/cdt/dtmethod.c | 107 + src/lib/libast/cdt/dtnew.c | 81 + src/lib/libast/cdt/dtopen.c | 155 + src/lib/libast/cdt/dtstat.c | 54 + src/lib/libast/cdt/dtstrhash.c | 59 + src/lib/libast/cdt/dttree.c | 705 + src/lib/libast/cdt/dtuser.c | 59 + src/lib/libast/cdt/dtview.c | 157 + src/lib/libast/cdt/dtwalk.c | 53 + src/lib/libast/comp/atexit.c | 115 + src/lib/libast/comp/basename.c | 55 + src/lib/libast/comp/catopen.c | 182 + src/lib/libast/comp/closelog.c | 51 + src/lib/libast/comp/conf.sh | 1651 ++ src/lib/libast/comp/conf.tab | 611 + src/lib/libast/comp/creat64.c | 38 + src/lib/libast/comp/dirname.c | 61 + src/lib/libast/comp/dup2.c | 46 + src/lib/libast/comp/eaccess.c | 139 + src/lib/libast/comp/errno.c | 40 + src/lib/libast/comp/execlp.c | 50 + src/lib/libast/comp/execve.c | 70 + src/lib/libast/comp/execvp.c | 50 + src/lib/libast/comp/execvpe.c | 78 + src/lib/libast/comp/fakelink.h | 34 + src/lib/libast/comp/fcntl.c | 98 + src/lib/libast/comp/fmtmsg.h | 141 + src/lib/libast/comp/fmtmsglib.c | 335 + src/lib/libast/comp/fnmatch.c | 79 + src/lib/libast/comp/fnmatch.h | 61 + src/lib/libast/comp/frexp.c | 153 + src/lib/libast/comp/frexpl.c | 161 + src/lib/libast/comp/fsync.c | 46 + src/lib/libast/comp/ftw.c | 50 + src/lib/libast/comp/ftw.h | 60 + src/lib/libast/comp/getdate.c | 83 + src/lib/libast/comp/getgroups.c | 78 + src/lib/libast/comp/getlogin.c | 42 + src/lib/libast/comp/getopt.c | 78 + src/lib/libast/comp/getopt.h | 51 + src/lib/libast/comp/getoptl.c | 151 + src/lib/libast/comp/getpgrp.c | 47 + src/lib/libast/comp/getsubopt.c | 84 + src/lib/libast/comp/getwd.c | 37 + src/lib/libast/comp/gross.c | 99 + src/lib/libast/comp/gross_sgi.h | 188 + src/lib/libast/comp/hsearch.c | 138 + src/lib/libast/comp/iconv.c | 1599 ++ src/lib/libast/comp/killpg.c | 40 + src/lib/libast/comp/libgen.h | 52 + src/lib/libast/comp/link.c | 47 + src/lib/libast/comp/localeconv.c | 100 + src/lib/libast/comp/lstat.c | 39 + src/lib/libast/comp/memccpy.c | 51 + src/lib/libast/comp/memchr.c | 49 + src/lib/libast/comp/memcmp.c | 45 + src/lib/libast/comp/memcpy.c | 60 + src/lib/libast/comp/memmove.c | 53 + src/lib/libast/comp/memset.c | 42 + src/lib/libast/comp/mkdir.c | 62 + src/lib/libast/comp/mkfifo.c | 50 + src/lib/libast/comp/mknod.c | 50 + src/lib/libast/comp/mktemp.c | 85 + src/lib/libast/comp/mktime.c | 77 + src/lib/libast/comp/mount.c | 49 + src/lib/libast/comp/nftw.c | 61 + src/lib/libast/comp/omitted.c | 1152 ++ src/lib/libast/comp/open.c | 119 + src/lib/libast/comp/openlog.c | 58 + src/lib/libast/comp/putenv.c | 53 + src/lib/libast/comp/re_comp.c | 81 + src/lib/libast/comp/re_comp.h | 41 + src/lib/libast/comp/readlink.c | 61 + src/lib/libast/comp/realpath.c | 53 + src/lib/libast/comp/regcmp.c | 224 + src/lib/libast/comp/regexp.c | 123 + src/lib/libast/comp/regexp.h | 129 + src/lib/libast/comp/remove.c | 49 + src/lib/libast/comp/rename.c | 98 + src/lib/libast/comp/resolvepath.c | 72 + src/lib/libast/comp/rmdir.c | 66 + src/lib/libast/comp/setenv.c | 58 + src/lib/libast/comp/setlocale.c | 2869 ++++ src/lib/libast/comp/setlogmask.c | 48 + src/lib/libast/comp/setpgid.c | 80 + src/lib/libast/comp/setsid.c | 90 + src/lib/libast/comp/sigflag.c | 52 + src/lib/libast/comp/sigunblock.c | 63 + src/lib/libast/comp/spawnveg.c | 299 + src/lib/libast/comp/statvfs.c | 163 + src/lib/libast/comp/strcasecmp.c | 58 + src/lib/libast/comp/strchr.c | 57 + src/lib/libast/comp/strftime.c | 104 + src/lib/libast/comp/strncasecmp.c | 62 + src/lib/libast/comp/strptime.c | 82 + src/lib/libast/comp/strrchr.c | 60 + src/lib/libast/comp/strstr.c | 76 + src/lib/libast/comp/strtod.c | 31 + src/lib/libast/comp/strtol.c | 34 + src/lib/libast/comp/strtold.c | 52 + src/lib/libast/comp/strtoll.c | 44 + src/lib/libast/comp/strtoul.c | 35 + src/lib/libast/comp/strtoull.c | 45 + src/lib/libast/comp/swab.c | 60 + src/lib/libast/comp/symlink.c | 59 + src/lib/libast/comp/syslog.c | 369 + src/lib/libast/comp/syslog.h | 132 + src/lib/libast/comp/sysloglib.h | 54 + src/lib/libast/comp/system.c | 55 + src/lib/libast/comp/tempnam.c | 58 + src/lib/libast/comp/tmpnam.c | 51 + src/lib/libast/comp/transition.c | 86 + src/lib/libast/comp/tsearch.c | 240 + src/lib/libast/comp/unlink.c | 38 + src/lib/libast/comp/unsetenv.c | 50 + src/lib/libast/comp/vfork.c | 55 + src/lib/libast/comp/waitpid.c | 199 + src/lib/libast/comp/wc.c | 139 + src/lib/libast/comp/wordexp.c | 217 + src/lib/libast/comp/wordexp.h | 63 + src/lib/libast/dir/dirlib.h | 168 + src/lib/libast/dir/dirstd.h | 59 + src/lib/libast/dir/getdents.c | 166 + src/lib/libast/dir/opendir.c | 97 + src/lib/libast/dir/readdir.c | 61 + src/lib/libast/dir/rewinddir.c | 46 + src/lib/libast/dir/seekdir.c | 56 + src/lib/libast/dir/telldir.c | 43 + src/lib/libast/disc/memfatal.c | 82 + src/lib/libast/disc/sfdcdio.c | 229 + src/lib/libast/disc/sfdcdos.c | 416 + src/lib/libast/disc/sfdcfilter.c | 186 + src/lib/libast/disc/sfdchdr.h | 28 + src/lib/libast/disc/sfdcmore.c | 369 + src/lib/libast/disc/sfdcprefix.c | 153 + src/lib/libast/disc/sfdcseekable.c | 227 + src/lib/libast/disc/sfdcslow.c | 84 + src/lib/libast/disc/sfdcsubstr.c | 217 + src/lib/libast/disc/sfdctee.c | 102 + src/lib/libast/disc/sfdcunion.c | 203 + src/lib/libast/disc/sfkeyprintf.c | 392 + src/lib/libast/disc/sfstrtmp.c | 62 + src/lib/libast/features/align.c | 188 + src/lib/libast/features/api | 15 + src/lib/libast/features/aso | 628 + src/lib/libast/features/asometh | 44 + src/lib/libast/features/botch.c | 72 + src/lib/libast/features/ccode | 81 + src/lib/libast/features/common | 636 + src/lib/libast/features/dirent | 275 + src/lib/libast/features/eaccess | 11 + src/lib/libast/features/errno | 31 + src/lib/libast/features/fcntl.c | 370 + src/lib/libast/features/float | 1232 ++ src/lib/libast/features/fs | 251 + src/lib/libast/features/hack | 1 + src/lib/libast/features/iconv | 116 + src/lib/libast/features/lib | 737 + src/lib/libast/features/libpath.sh | 79 + src/lib/libast/features/limits.c | 339 + src/lib/libast/features/locale | 28 + src/lib/libast/features/map.c | 565 + src/lib/libast/features/mmap | 342 + src/lib/libast/features/mode.c | 218 + src/lib/libast/features/ndbm | 29 + src/lib/libast/features/nl_types | 64 + src/lib/libast/features/omitted | 110 + src/lib/libast/features/options | 1 + src/lib/libast/features/param.sh | 53 + src/lib/libast/features/preroot.sh | 52 + src/lib/libast/features/prog | 12 + src/lib/libast/features/sfinit.c | 94 + src/lib/libast/features/sfio | 174 + src/lib/libast/features/sig.sh | 138 + src/lib/libast/features/siglist | 14 + src/lib/libast/features/signal.c | 375 + src/lib/libast/features/sizeof | 15 + src/lib/libast/features/standards | 185 + src/lib/libast/features/stdio | 571 + src/lib/libast/features/sys | 280 + src/lib/libast/features/syscall | 18 + src/lib/libast/features/time | 51 + src/lib/libast/features/tmlib | 45 + src/lib/libast/features/tmx | 106 + src/lib/libast/features/tty | 127 + src/lib/libast/features/tv | 81 + src/lib/libast/features/tvlib | 80 + src/lib/libast/features/uwin | 10 + src/lib/libast/features/vfork | 13 + src/lib/libast/features/vmalloc | 220 + src/lib/libast/features/wait | 9 + src/lib/libast/features/wchar | 163 + src/lib/libast/features/wctype | 14 + src/lib/libast/hash/hashalloc.c | 200 + src/lib/libast/hash/hashdump.c | 173 + src/lib/libast/hash/hashfree.c | 144 + src/lib/libast/hash/hashlast.c | 43 + src/lib/libast/hash/hashlib.h | 104 + src/lib/libast/hash/hashlook.c | 367 + src/lib/libast/hash/hashscan.c | 139 + src/lib/libast/hash/hashsize.c | 84 + src/lib/libast/hash/hashview.c | 88 + src/lib/libast/hash/hashwalk.c | 51 + src/lib/libast/hash/memhash.c | 45 + src/lib/libast/hash/memsum.c | 53 + src/lib/libast/hash/strhash.c | 45 + src/lib/libast/hash/strkey.c | 49 + src/lib/libast/hash/strsum.c | 53 + src/lib/libast/include/aso.h | 183 + src/lib/libast/include/ast.h | 422 + src/lib/libast/include/ast_dir.h | 77 + src/lib/libast/include/ast_getopt.h | 42 + src/lib/libast/include/ast_std.h | 388 + src/lib/libast/include/ast_windows.h | 39 + src/lib/libast/include/ccode.h | 90 + src/lib/libast/include/cdt.h | 358 + src/lib/libast/include/cmdarg.h | 92 + src/lib/libast/include/debug.h | 109 + src/lib/libast/include/dt.h | 41 + src/lib/libast/include/error.h | 188 + src/lib/libast/include/find.h | 86 + src/lib/libast/include/fnv.h | 72 + src/lib/libast/include/fts.h | 162 + src/lib/libast/include/ftwalk.h | 124 + src/lib/libast/include/glob.h | 146 + src/lib/libast/include/hash.h | 202 + src/lib/libast/include/hashkey.h | 62 + src/lib/libast/include/hashpart.h | 51 + src/lib/libast/include/ip6.h | 40 + src/lib/libast/include/ls.h | 88 + src/lib/libast/include/magic.h | 86 + src/lib/libast/include/magicid.h | 46 + src/lib/libast/include/mc.h | 96 + src/lib/libast/include/mime.h | 91 + src/lib/libast/include/mnt.h | 58 + src/lib/libast/include/modecanon.h | 65 + src/lib/libast/include/modex.h | 51 + src/lib/libast/include/namval.h | 42 + src/lib/libast/include/option.h | 106 + src/lib/libast/include/proc.h | 108 + src/lib/libast/include/recfmt.h | 83 + src/lib/libast/include/regex.h | 254 + src/lib/libast/include/sfdisc.h | 70 + src/lib/libast/include/sfio.h | 464 + src/lib/libast/include/sfio_s.h | 51 + src/lib/libast/include/sfio_t.h | 133 + src/lib/libast/include/shcmd.h | 112 + src/lib/libast/include/stack.h | 83 + src/lib/libast/include/stak.h | 55 + src/lib/libast/include/stk.h | 78 + src/lib/libast/include/swap.h | 53 + src/lib/libast/include/tar.h | 118 + src/lib/libast/include/times.h | 54 + src/lib/libast/include/tm.h | 192 + src/lib/libast/include/tok.h | 47 + src/lib/libast/include/usage.h | 37 + src/lib/libast/include/vdb.h | 46 + src/lib/libast/include/vecargs.h | 45 + src/lib/libast/include/vmalloc.h | 337 + src/lib/libast/include/wait.h | 98 + src/lib/libast/man/LIBAST.3 | 98 + src/lib/libast/man/aso.3 | 357 + src/lib/libast/man/ast.3 | 272 + src/lib/libast/man/astsa.3 | 161 + src/lib/libast/man/cdt.3 | 940 ++ src/lib/libast/man/chr.3 | 126 + src/lib/libast/man/compat.3 | 103 + src/lib/libast/man/error.3 | 283 + src/lib/libast/man/find.3 | 89 + src/lib/libast/man/fmt.3 | 213 + src/lib/libast/man/fmtls.3 | 143 + src/lib/libast/man/ftwalk.3 | 235 + src/lib/libast/man/getcwd.3 | 67 + src/lib/libast/man/hash.3 | 644 + src/lib/libast/man/iblocks.3 | 62 + src/lib/libast/man/int.3 | 68 + src/lib/libast/man/ip6.3 | 85 + src/lib/libast/man/magic.3 | 493 + src/lib/libast/man/mem.3 | 98 + src/lib/libast/man/mime.3 | 117 + src/lib/libast/man/modecanon.3 | 104 + src/lib/libast/man/optget.3 | 68 + src/lib/libast/man/path.3 | 387 + src/lib/libast/man/preroot.3 | 147 + src/lib/libast/man/proc.3 | 319 + src/lib/libast/man/re.3 | 214 + src/lib/libast/man/regex.3 | 163 + src/lib/libast/man/setenviron.3 | 79 + src/lib/libast/man/sfdisc.3 | 118 + src/lib/libast/man/sfio.3 | 2373 +++ src/lib/libast/man/sig.3 | 75 + src/lib/libast/man/spawnveg.3 | 97 + src/lib/libast/man/stak.3 | 170 + src/lib/libast/man/stk.3 | 166 + src/lib/libast/man/strcopy.3 | 54 + src/lib/libast/man/strdup.3 | 55 + src/lib/libast/man/strelapsed.3 | 77 + src/lib/libast/man/strerror.3 | 53 + src/lib/libast/man/stresc.3 | 53 + src/lib/libast/man/streval.3 | 83 + src/lib/libast/man/strgid.3 | 53 + src/lib/libast/man/strmatch.3 | 101 + src/lib/libast/man/stropt.3 | 130 + src/lib/libast/man/strperm.3 | 109 + src/lib/libast/man/strsignal.3 | 53 + src/lib/libast/man/strsort.3 | 73 + src/lib/libast/man/strtape.3 | 86 + src/lib/libast/man/strton.3 | 97 + src/lib/libast/man/struid.3 | 53 + src/lib/libast/man/swap.3 | 138 + src/lib/libast/man/tab.3 | 74 + src/lib/libast/man/tm.3 | 775 + src/lib/libast/man/tmx.3 | 576 + src/lib/libast/man/tok.3 | 217 + src/lib/libast/man/touch.3 | 68 + src/lib/libast/man/tv.3 | 173 + src/lib/libast/man/vecargs.3 | 126 + src/lib/libast/man/vmalloc.3 | 658 + src/lib/libast/misc/astintercept.c | 53 + src/lib/libast/misc/cmdarg.c | 412 + src/lib/libast/misc/cmdlib.h | 57 + src/lib/libast/misc/conformance.c | 151 + src/lib/libast/misc/debug.c | 65 + src/lib/libast/misc/error.c | 659 + src/lib/libast/misc/errorf.c | 41 + src/lib/libast/misc/errormsg.c | 41 + src/lib/libast/misc/errorx.c | 50 + src/lib/libast/misc/fastfind.c | 1282 ++ src/lib/libast/misc/findlib.h | 123 + src/lib/libast/misc/fmtrec.c | 102 + src/lib/libast/misc/fts.c | 1602 ++ src/lib/libast/misc/ftwalk.c | 156 + src/lib/libast/misc/ftwflags.c | 35 + src/lib/libast/misc/getcwd.c | 327 + src/lib/libast/misc/getenv.c | 109 + src/lib/libast/misc/glob.c | 831 + src/lib/libast/misc/intercepts.h | 40 + src/lib/libast/misc/magic.c | 2497 +++ src/lib/libast/misc/magic.tab | 1723 ++ src/lib/libast/misc/mime.c | 839 + src/lib/libast/misc/mimelib.h | 52 + src/lib/libast/misc/mimetype.c | 69 + src/lib/libast/misc/optctx.c | 70 + src/lib/libast/misc/optesc.c | 93 + src/lib/libast/misc/optget.c | 5774 +++++++ src/lib/libast/misc/optjoin.c | 129 + src/lib/libast/misc/optlib.h | 115 + src/lib/libast/misc/procclose.c | 98 + src/lib/libast/misc/procfree.c | 43 + src/lib/libast/misc/proclib.h | 65 + src/lib/libast/misc/procopen.c | 942 ++ src/lib/libast/misc/procrun.c | 49 + src/lib/libast/misc/recfmt.c | 165 + src/lib/libast/misc/reclen.c | 71 + src/lib/libast/misc/recstr.c | 206 + src/lib/libast/misc/setenviron.c | 136 + src/lib/libast/misc/sigcrit.c | 199 + src/lib/libast/misc/sigdata.c | 40 + src/lib/libast/misc/signal.c | 136 + src/lib/libast/misc/stack.c | 172 + src/lib/libast/misc/state.c | 42 + src/lib/libast/misc/stk.c | 564 + src/lib/libast/misc/systrace.c | 68 + src/lib/libast/misc/translate.c | 434 + src/lib/libast/misc/univdata.c | 58 + src/lib/libast/misc/univlib.h | 93 + src/lib/libast/obsolete/spawn.c | 152 + src/lib/libast/path/pathaccess.c | 69 + src/lib/libast/path/pathbin.c | 46 + src/lib/libast/path/pathcanon.c | 189 + src/lib/libast/path/pathcat.c | 85 + src/lib/libast/path/pathcd.c | 142 + src/lib/libast/path/pathcheck.c | 91 + src/lib/libast/path/pathexists.c | 134 + src/lib/libast/path/pathfind.c | 168 + src/lib/libast/path/pathgetlink.c | 102 + src/lib/libast/path/pathkey.c | 312 + src/lib/libast/path/pathnative.c | 126 + src/lib/libast/path/pathpath.c | 127 + src/lib/libast/path/pathposix.c | 128 + src/lib/libast/path/pathprobe.c | 326 + src/lib/libast/path/pathprog.c | 128 + src/lib/libast/path/pathrepl.c | 93 + src/lib/libast/path/pathsetlink.c | 72 + src/lib/libast/path/pathshell.c | 112 + src/lib/libast/path/pathstat.c | 45 + src/lib/libast/path/pathtemp.c | 337 + src/lib/libast/path/pathtmp.c | 41 + src/lib/libast/port/astconf.c | 1706 ++ src/lib/libast/port/astcopy.c | 90 + src/lib/libast/port/astdynamic.c | 132 + src/lib/libast/port/astlicense.c | 1303 ++ src/lib/libast/port/astmath.c | 72 + src/lib/libast/port/astquery.c | 114 + src/lib/libast/port/aststatic.c | 44 + src/lib/libast/port/astwinsize.c | 143 + src/lib/libast/port/atmain.C | 37 + src/lib/libast/port/iblocks.c | 95 + src/lib/libast/port/lc.c | 883 + src/lib/libast/port/lc.tab | 275 + src/lib/libast/port/lcgen.c | 791 + src/lib/libast/port/lclang.h | 120 + src/lib/libast/port/lclib.h | 71 + src/lib/libast/port/mc.c | 675 + src/lib/libast/port/mnt.c | 811 + src/lib/libast/port/touch.c | 74 + src/lib/libast/preroot/getpreroot.c | 165 + src/lib/libast/preroot/ispreroot.c | 71 + src/lib/libast/preroot/realopen.c | 47 + src/lib/libast/preroot/setpreroot.c | 75 + src/lib/libast/regex/regalloc.c | 36 + src/lib/libast/regex/regcache.c | 198 + src/lib/libast/regex/regclass.c | 298 + src/lib/libast/regex/regcoll.c | 120 + src/lib/libast/regex/regcomp.c | 3564 ++++ src/lib/libast/regex/regdecomp.c | 448 + src/lib/libast/regex/regerror.c | 95 + src/lib/libast/regex/regexec.c | 90 + src/lib/libast/regex/regfatal.c | 49 + src/lib/libast/regex/reginit.c | 412 + src/lib/libast/regex/reglib.h | 588 + src/lib/libast/regex/regnexec.c | 2082 +++ src/lib/libast/regex/regrecord.c | 34 + src/lib/libast/regex/regrexec.c | 181 + src/lib/libast/regex/regstat.c | 53 + src/lib/libast/regex/regsub.c | 269 + src/lib/libast/regex/regsubcomp.c | 377 + src/lib/libast/regex/regsubexec.c | 237 + src/lib/libast/sfio/_sfclrerr.c | 34 + src/lib/libast/sfio/_sfdlen.c | 34 + src/lib/libast/sfio/_sfeof.c | 34 + src/lib/libast/sfio/_sferror.c | 34 + src/lib/libast/sfio/_sffileno.c | 34 + src/lib/libast/sfio/_sfgetc.c | 34 + src/lib/libast/sfio/_sfgetl.c | 42 + src/lib/libast/sfio/_sfgetl2.c | 50 + src/lib/libast/sfio/_sfgetu.c | 42 + src/lib/libast/sfio/_sfgetu2.c | 50 + src/lib/libast/sfio/_sfllen.c | 34 + src/lib/libast/sfio/_sfopen.c | 232 + src/lib/libast/sfio/_sfputc.c | 35 + src/lib/libast/sfio/_sfputd.c | 96 + src/lib/libast/sfio/_sfputl.c | 82 + src/lib/libast/sfio/_sfputm.c | 78 + src/lib/libast/sfio/_sfputu.c | 75 + src/lib/libast/sfio/_sfslen.c | 33 + src/lib/libast/sfio/_sfstacked.c | 34 + src/lib/libast/sfio/_sfulen.c | 34 + src/lib/libast/sfio/_sfvalue.c | 34 + src/lib/libast/sfio/sfclose.c | 178 + src/lib/libast/sfio/sfclrlock.c | 63 + src/lib/libast/sfio/sfcvt.c | 542 + src/lib/libast/sfio/sfdisc.c | 271 + src/lib/libast/sfio/sfdlen.c | 58 + src/lib/libast/sfio/sfecvt.c | 38 + src/lib/libast/sfio/sfexcept.c | 133 + src/lib/libast/sfio/sfextern.c | 99 + src/lib/libast/sfio/sffcvt.c | 38 + src/lib/libast/sfio/sffilbuf.c | 116 + src/lib/libast/sfio/sfflsbuf.c | 126 + src/lib/libast/sfio/sfgetd.c | 79 + src/lib/libast/sfio/sfgetl.c | 70 + src/lib/libast/sfio/sfgetm.c | 68 + src/lib/libast/sfio/sfgetr.c | 169 + src/lib/libast/sfio/sfgetu.c | 67 + src/lib/libast/sfio/sfhdr.h | 1313 ++ src/lib/libast/sfio/sfllen.c | 39 + src/lib/libast/sfio/sfmode.c | 600 + src/lib/libast/sfio/sfmove.c | 242 + src/lib/libast/sfio/sfmutex.c | 69 + src/lib/libast/sfio/sfnew.c | 129 + src/lib/libast/sfio/sfnotify.c | 38 + src/lib/libast/sfio/sfnputc.c | 81 + src/lib/libast/sfio/sfopen.c | 40 + src/lib/libast/sfio/sfpeek.c | 89 + src/lib/libast/sfio/sfpkrd.c | 222 + src/lib/libast/sfio/sfpoll.c | 250 + src/lib/libast/sfio/sfpool.c | 369 + src/lib/libast/sfio/sfpopen.c | 293 + src/lib/libast/sfio/sfprintf.c | 119 + src/lib/libast/sfio/sfprints.c | 128 + src/lib/libast/sfio/sfpurge.c | 98 + src/lib/libast/sfio/sfputd.c | 35 + src/lib/libast/sfio/sfputl.c | 35 + src/lib/libast/sfio/sfputm.c | 36 + src/lib/libast/sfio/sfputr.c | 135 + src/lib/libast/sfio/sfputu.c | 35 + src/lib/libast/sfio/sfraise.c | 107 + src/lib/libast/sfio/sfrd.c | 317 + src/lib/libast/sfio/sfread.c | 140 + src/lib/libast/sfio/sfreserve.c | 210 + src/lib/libast/sfio/sfresize.c | 83 + src/lib/libast/sfio/sfscanf.c | 102 + src/lib/libast/sfio/sfseek.c | 281 + src/lib/libast/sfio/sfset.c | 99 + src/lib/libast/sfio/sfsetbuf.c | 426 + src/lib/libast/sfio/sfsetfd.c | 136 + src/lib/libast/sfio/sfsize.c | 109 + src/lib/libast/sfio/sfsk.c | 106 + src/lib/libast/sfio/sfstack.c | 115 + src/lib/libast/sfio/sfstrtod.c | 157 + src/lib/libast/sfio/sfstrtof.h | 568 + src/lib/libast/sfio/sfswap.c | 119 + src/lib/libast/sfio/sfsync.c | 172 + src/lib/libast/sfio/sftable.c | 541 + src/lib/libast/sfio/sftell.c | 59 + src/lib/libast/sfio/sftmp.c | 416 + src/lib/libast/sfio/sfungetc.c | 108 + src/lib/libast/sfio/sfvprintf.c | 1445 ++ src/lib/libast/sfio/sfvscanf.c | 1097 ++ src/lib/libast/sfio/sfwalk.c | 67 + src/lib/libast/sfio/sfwr.c | 252 + src/lib/libast/sfio/sfwrite.c | 171 + src/lib/libast/sfio/vthread.h | 219 + src/lib/libast/std/bytesex.h | 43 + src/lib/libast/std/dirent.h | 22 + src/lib/libast/std/endian.h | 54 + src/lib/libast/std/iconv.h | 22 + src/lib/libast/std/nl_types.h | 22 + src/lib/libast/std/stdio.h | 22 + src/lib/libast/std/wchar.h | 22 + src/lib/libast/std/wctype.h | 22 + src/lib/libast/stdio/_doprnt.c | 32 + src/lib/libast/stdio/_doscan.c | 32 + src/lib/libast/stdio/_filbuf.c | 36 + src/lib/libast/stdio/_flsbuf.c | 44 + src/lib/libast/stdio/_stdfun.c | 80 + src/lib/libast/stdio/_stdopen.c | 32 + src/lib/libast/stdio/_stdprintf.c | 38 + src/lib/libast/stdio/_stdscanf.c | 38 + src/lib/libast/stdio/_stdsprnt.c | 38 + src/lib/libast/stdio/_stdvbuf.c | 32 + src/lib/libast/stdio/_stdvsnprnt.c | 32 + src/lib/libast/stdio/_stdvsprnt.c | 32 + src/lib/libast/stdio/_stdvsscn.c | 32 + src/lib/libast/stdio/asprintf.c | 36 + src/lib/libast/stdio/clearerr.c | 33 + src/lib/libast/stdio/fclose.c | 32 + src/lib/libast/stdio/fcloseall.c | 57 + src/lib/libast/stdio/fdopen.c | 34 + src/lib/libast/stdio/feof.c | 42 + src/lib/libast/stdio/ferror.c | 42 + src/lib/libast/stdio/fflush.c | 41 + src/lib/libast/stdio/fgetc.c | 32 + src/lib/libast/stdio/fgetpos.c | 48 + src/lib/libast/stdio/fgets.c | 110 + src/lib/libast/stdio/fgetwc.c | 35 + src/lib/libast/stdio/fgetws.c | 52 + src/lib/libast/stdio/fileno.c | 42 + src/lib/libast/stdio/flockfile.c | 32 + src/lib/libast/stdio/fmemopen.c | 32 + src/lib/libast/stdio/fopen.c | 30 + src/lib/libast/stdio/fprintf.c | 39 + src/lib/libast/stdio/fpurge.c | 32 + src/lib/libast/stdio/fputc.c | 42 + src/lib/libast/stdio/fputs.c | 32 + src/lib/libast/stdio/fputwc.c | 33 + src/lib/libast/stdio/fputws.c | 36 + src/lib/libast/stdio/fread.c | 34 + src/lib/libast/stdio/freopen.c | 32 + src/lib/libast/stdio/fscanf.c | 39 + src/lib/libast/stdio/fseek.c | 48 + src/lib/libast/stdio/fseeko.c | 48 + src/lib/libast/stdio/fsetpos.c | 48 + src/lib/libast/stdio/ftell.c | 48 + src/lib/libast/stdio/ftello.c | 48 + src/lib/libast/stdio/ftrylockfile.c | 32 + src/lib/libast/stdio/funlockfile.c | 32 + src/lib/libast/stdio/fwide.c | 51 + src/lib/libast/stdio/fwprintf.c | 36 + src/lib/libast/stdio/fwrite.c | 34 + src/lib/libast/stdio/fwscanf.c | 39 + src/lib/libast/stdio/getc.c | 42 + src/lib/libast/stdio/getchar.c | 40 + src/lib/libast/stdio/getdelim.c | 96 + src/lib/libast/stdio/getline.c | 36 + src/lib/libast/stdio/getw.c | 34 + src/lib/libast/stdio/getwc.c | 31 + src/lib/libast/stdio/getwchar.c | 31 + src/lib/libast/stdio/pclose.c | 32 + src/lib/libast/stdio/popen.c | 30 + src/lib/libast/stdio/printf.c | 36 + src/lib/libast/stdio/putc.c | 42 + src/lib/libast/stdio/putchar.c | 40 + src/lib/libast/stdio/puts.c | 30 + src/lib/libast/stdio/putw.c | 32 + src/lib/libast/stdio/putwc.c | 31 + src/lib/libast/stdio/putwchar.c | 31 + src/lib/libast/stdio/rewind.c | 33 + src/lib/libast/stdio/scanf.c | 36 + src/lib/libast/stdio/setbuf.c | 32 + src/lib/libast/stdio/setbuffer.c | 32 + src/lib/libast/stdio/setlinebuf.c | 33 + src/lib/libast/stdio/setvbuf.c | 48 + src/lib/libast/stdio/snprintf.c | 36 + src/lib/libast/stdio/sprintf.c | 36 + src/lib/libast/stdio/sscanf.c | 36 + src/lib/libast/stdio/stdhdr.h | 115 + src/lib/libast/stdio/stdio_c99.c | 118 + src/lib/libast/stdio/swprintf.c | 36 + src/lib/libast/stdio/swscanf.c | 36 + src/lib/libast/stdio/tmpfile.c | 30 + src/lib/libast/stdio/ungetc.c | 32 + src/lib/libast/stdio/ungetwc.c | 39 + src/lib/libast/stdio/vasprintf.c | 45 + src/lib/libast/stdio/vfprintf.c | 32 + src/lib/libast/stdio/vfscanf.c | 32 + src/lib/libast/stdio/vfwprintf.c | 68 + src/lib/libast/stdio/vfwscanf.c | 129 + src/lib/libast/stdio/vprintf.c | 30 + src/lib/libast/stdio/vscanf.c | 30 + src/lib/libast/stdio/vsnprintf.c | 52 + src/lib/libast/stdio/vsprintf.c | 30 + src/lib/libast/stdio/vsscanf.c | 30 + src/lib/libast/stdio/vswprintf.c | 55 + src/lib/libast/stdio/vswscanf.c | 51 + src/lib/libast/stdio/vwprintf.c | 30 + src/lib/libast/stdio/vwscanf.c | 30 + src/lib/libast/stdio/wprintf.c | 36 + src/lib/libast/stdio/wscanf.c | 36 + src/lib/libast/string/base64.c | 312 + src/lib/libast/string/ccmap.c | 746 + src/lib/libast/string/ccmapid.c | 173 + src/lib/libast/string/ccnative.c | 56 + src/lib/libast/string/chresc.c | 237 + src/lib/libast/string/chrtoi.c | 55 + src/lib/libast/string/fmtbase.c | 70 + src/lib/libast/string/fmtbuf.c | 69 + src/lib/libast/string/fmtclock.c | 63 + src/lib/libast/string/fmtdev.c | 60 + src/lib/libast/string/fmtelapsed.c | 61 + src/lib/libast/string/fmterror.c | 37 + src/lib/libast/string/fmtesc.c | 248 + src/lib/libast/string/fmtfmt.c | 205 + src/lib/libast/string/fmtfs.c | 100 + src/lib/libast/string/fmtgid.c | 101 + src/lib/libast/string/fmtident.c | 77 + src/lib/libast/string/fmtint.c | 122 + src/lib/libast/string/fmtip4.c | 43 + src/lib/libast/string/fmtip6.c | 175 + src/lib/libast/string/fmtls.c | 120 + src/lib/libast/string/fmtmatch.c | 286 + src/lib/libast/string/fmtmode.c | 47 + src/lib/libast/string/fmtnum.c | 92 + src/lib/libast/string/fmtperm.c | 91 + src/lib/libast/string/fmtre.c | 226 + src/lib/libast/string/fmtscale.c | 94 + src/lib/libast/string/fmtsignal.c | 62 + src/lib/libast/string/fmttime.c | 41 + src/lib/libast/string/fmttmx.c | 45 + src/lib/libast/string/fmttv.c | 44 + src/lib/libast/string/fmtuid.c | 101 + src/lib/libast/string/fmtversion.c | 53 + src/lib/libast/string/memdup.c | 44 + src/lib/libast/string/modedata.c | 69 + src/lib/libast/string/modei.c | 55 + src/lib/libast/string/modelib.h | 55 + src/lib/libast/string/modex.c | 75 + src/lib/libast/string/stracmp.c | 62 + src/lib/libast/string/strcopy.c | 36 + src/lib/libast/string/strdup.c | 69 + src/lib/libast/string/strelapsed.c | 154 + src/lib/libast/string/strerror.c | 148 + src/lib/libast/string/stresc.c | 67 + src/lib/libast/string/streval.c | 50 + src/lib/libast/string/strexpr.c | 294 + src/lib/libast/string/strgid.c | 121 + src/lib/libast/string/strlcat.c | 83 + src/lib/libast/string/strlcpy.c | 71 + src/lib/libast/string/strlook.c | 50 + src/lib/libast/string/strmatch.c | 207 + src/lib/libast/string/strmode.c | 51 + src/lib/libast/string/strnacmp.c | 66 + src/lib/libast/string/strncopy.c | 46 + src/lib/libast/string/strnpcmp.c | 51 + src/lib/libast/string/strntod.c | 32 + src/lib/libast/string/strntol.c | 31 + src/lib/libast/string/strntold.c | 32 + src/lib/libast/string/strntoll.c | 31 + src/lib/libast/string/strnton.c | 32 + src/lib/libast/string/strntonll.c | 32 + src/lib/libast/string/strntoul.c | 32 + src/lib/libast/string/strntoull.c | 32 + src/lib/libast/string/strnvcmp.c | 86 + src/lib/libast/string/stropt.c | 188 + src/lib/libast/string/strpcmp.c | 44 + src/lib/libast/string/strperm.c | 267 + src/lib/libast/string/strpsearch.c | 125 + src/lib/libast/string/strsearch.c | 57 + src/lib/libast/string/strsort.c | 57 + src/lib/libast/string/strtape.c | 148 + src/lib/libast/string/strtoi.h | 640 + src/lib/libast/string/strtoip4.c | 150 + src/lib/libast/string/strtoip6.c | 204 + src/lib/libast/string/strton.c | 31 + src/lib/libast/string/strtonll.c | 31 + src/lib/libast/string/struid.c | 109 + src/lib/libast/string/struniq.c | 51 + src/lib/libast/string/strvcmp.c | 74 + src/lib/libast/string/swapget.c | 57 + src/lib/libast/string/swapmem.c | 109 + src/lib/libast/string/swapop.c | 59 + src/lib/libast/string/swapput.c | 50 + src/lib/libast/string/tok.c | 190 + src/lib/libast/string/tokline.c | 193 + src/lib/libast/string/tokscan.c | 360 + src/lib/libast/string/wc2utf8.c | 74 + src/lib/libast/tm/tmdata.c | 291 + src/lib/libast/tm/tmdate.c | 41 + src/lib/libast/tm/tmequiv.c | 57 + src/lib/libast/tm/tmfix.c | 173 + src/lib/libast/tm/tmfmt.c | 41 + src/lib/libast/tm/tmform.c | 44 + src/lib/libast/tm/tmgoff.c | 77 + src/lib/libast/tm/tminit.c | 477 + src/lib/libast/tm/tmleap.c | 41 + src/lib/libast/tm/tmlex.c | 67 + src/lib/libast/tm/tmlocale.c | 644 + src/lib/libast/tm/tmmake.c | 41 + src/lib/libast/tm/tmpoff.c | 62 + src/lib/libast/tm/tmscan.c | 41 + src/lib/libast/tm/tmsleep.c | 42 + src/lib/libast/tm/tmtime.c | 41 + src/lib/libast/tm/tmtype.c | 57 + src/lib/libast/tm/tmweek.c | 87 + src/lib/libast/tm/tmword.c | 89 + src/lib/libast/tm/tmxdate.c | 1756 ++ src/lib/libast/tm/tmxduration.c | 80 + src/lib/libast/tm/tmxfmt.c | 724 + src/lib/libast/tm/tmxgettime.c | 44 + src/lib/libast/tm/tmxleap.c | 51 + src/lib/libast/tm/tmxmake.c | 140 + src/lib/libast/tm/tmxscan.c | 537 + src/lib/libast/tm/tmxsettime.c | 45 + src/lib/libast/tm/tmxsleep.c | 41 + src/lib/libast/tm/tmxtime.c | 137 + src/lib/libast/tm/tmxtouch.c | 81 + src/lib/libast/tm/tmzone.c | 143 + src/lib/libast/tm/tvcmp.c | 46 + src/lib/libast/tm/tvgettime.c | 70 + src/lib/libast/tm/tvsettime.c | 72 + src/lib/libast/tm/tvsleep.c | 213 + src/lib/libast/tm/tvtouch.c | 297 + src/lib/libast/uwin/a64l.c | 76 + src/lib/libast/uwin/acosh.c | 108 + src/lib/libast/uwin/asinh.c | 107 + src/lib/libast/uwin/atanh.c | 89 + src/lib/libast/uwin/cbrt.c | 38 + src/lib/libast/uwin/crypt.c | 959 ++ src/lib/libast/uwin/erf.c | 403 + src/lib/libast/uwin/err.c | 124 + src/lib/libast/uwin/exp.c | 213 + src/lib/libast/uwin/exp__E.c | 142 + src/lib/libast/uwin/expm1.c | 173 + src/lib/libast/uwin/gamma.c | 343 + src/lib/libast/uwin/getpass.c | 79 + src/lib/libast/uwin/lgamma.c | 316 + src/lib/libast/uwin/log.c | 496 + src/lib/libast/uwin/log1p.c | 176 + src/lib/libast/uwin/log__L.c | 116 + src/lib/libast/uwin/mathimpl.h | 103 + src/lib/libast/uwin/mini.sym | 84 + src/lib/libast/uwin/rand48.c | 177 + src/lib/libast/uwin/random.c | 381 + src/lib/libast/uwin/rcmd.c | 571 + src/lib/libast/uwin/rint.c | 41 + src/lib/libast/uwin/rlib.h | 80 + src/lib/libast/uwin/support.c | 605 + src/lib/libast/vec/vecargs.c | 76 + src/lib/libast/vec/vecfile.c | 62 + src/lib/libast/vec/vecfree.c | 48 + src/lib/libast/vec/vecload.c | 96 + src/lib/libast/vec/vecstring.c | 46 + src/lib/libast/vmalloc/malloc.c | 1476 ++ src/lib/libast/vmalloc/vmbest.c | 1399 ++ src/lib/libast/vmalloc/vmclear.c | 85 + src/lib/libast/vmalloc/vmclose.c | 91 + src/lib/libast/vmalloc/vmdcheap.c | 63 + src/lib/libast/vmalloc/vmdebug.c | 745 + src/lib/libast/vmalloc/vmdisc.c | 55 + src/lib/libast/vmalloc/vmexit.c | 100 + src/lib/libast/vmalloc/vmgetmem.c | 51 + src/lib/libast/vmalloc/vmhdr.h | 532 + src/lib/libast/vmalloc/vmlast.c | 431 + src/lib/libast/vmalloc/vmmopen.c | 515 + src/lib/libast/vmalloc/vmopen.c | 180 + src/lib/libast/vmalloc/vmpool.c | 316 + src/lib/libast/vmalloc/vmprivate.c | 290 + src/lib/libast/vmalloc/vmprofile.c | 709 + src/lib/libast/vmalloc/vmregion.c | 61 + src/lib/libast/vmalloc/vmsegment.c | 58 + src/lib/libast/vmalloc/vmset.c | 62 + src/lib/libast/vmalloc/vmstat.c | 144 + src/lib/libast/vmalloc/vmstrdup.c | 48 + src/lib/libast/vmalloc/vmtrace.c | 286 + src/lib/libast/vmalloc/vmwalk.c | 69 + src/lib/libcmd/Mamfile | 922 + src/lib/libcmd/RELEASE | 334 + src/lib/libcmd/basename.c | 139 + src/lib/libcmd/cat.c | 557 + src/lib/libcmd/chgrp.c | 501 + src/lib/libcmd/chmod.c | 325 + src/lib/libcmd/chown.c | 39 + src/lib/libcmd/cksum.c | 632 + src/lib/libcmd/cmd.h | 163 + src/lib/libcmd/cmdinit.c | 75 + src/lib/libcmd/cmp.c | 389 + src/lib/libcmd/comm.c | 203 + src/lib/libcmd/cp.c | 1003 ++ src/lib/libcmd/cut.c | 700 + src/lib/libcmd/date.c | 516 + src/lib/libcmd/dirname.c | 139 + src/lib/libcmd/expr.c | 535 + src/lib/libcmd/fds.c | 360 + src/lib/libcmd/features/ids | 9 + src/lib/libcmd/features/sockets | 3 + src/lib/libcmd/features/symlink | 23 + src/lib/libcmd/features/utsname | 15 + src/lib/libcmd/fmt.c | 635 + src/lib/libcmd/fold.c | 240 + src/lib/libcmd/fts_fix.c | 57 + src/lib/libcmd/fts_fix.h | 49 + src/lib/libcmd/getconf.c | 405 + src/lib/libcmd/head.c | 150 + src/lib/libcmd/id.c | 472 + src/lib/libcmd/join.c | 984 ++ src/lib/libcmd/lib.c | 25 + src/lib/libcmd/ln.c | 35 + src/lib/libcmd/logname.c | 78 + src/lib/libcmd/md5sum.c | 35 + src/lib/libcmd/mkdir.c | 189 + src/lib/libcmd/mkfifo.c | 96 + src/lib/libcmd/mktemp.c | 169 + src/lib/libcmd/mv.c | 35 + src/lib/libcmd/paste.c | 288 + src/lib/libcmd/pathchk.c | 265 + src/lib/libcmd/pids.c | 124 + src/lib/libcmd/rev.c | 168 + src/lib/libcmd/rev.h | 34 + src/lib/libcmd/revlib.c | 112 + src/lib/libcmd/rm.c | 401 + src/lib/libcmd/rmdir.c | 126 + src/lib/libcmd/stty.c | 971 ++ src/lib/libcmd/sum.c | 35 + src/lib/libcmd/sync.c | 79 + src/lib/libcmd/tail.c | 790 + src/lib/libcmd/tee.c | 204 + src/lib/libcmd/tty.c | 105 + src/lib/libcmd/uname.c | 514 + src/lib/libcmd/uniq.c | 342 + src/lib/libcmd/vmstate.c | 198 + src/lib/libcmd/wc.c | 188 + src/lib/libcmd/wc.h | 59 + src/lib/libcmd/wclib.c | 515 + src/lib/libdll/Mamfile | 333 + src/lib/libdll/RELEASE | 53 + src/lib/libdll/dlfcn.c | 536 + src/lib/libdll/dll_lib.c | 188 + src/lib/libdll/dllcheck.c | 85 + src/lib/libdll/dllerror.c | 52 + src/lib/libdll/dllfind.c | 46 + src/lib/libdll/dlllib.h | 34 + src/lib/libdll/dlllook.c | 49 + src/lib/libdll/dllnext.c | 223 + src/lib/libdll/dllopen.c | 93 + src/lib/libdll/dllplug.c | 126 + src/lib/libdll/dllscan.c | 526 + src/lib/libdll/features/dll | 266 + src/lib/libsum/Mamfile | 258 + src/lib/libsum/RELEASE | 16 + src/lib/libsum/features/sum | 4 + src/lib/libsum/sum-ast4.c | 120 + src/lib/libsum/sum-att.c | 60 + src/lib/libsum/sum-bsd.c | 48 + src/lib/libsum/sum-crc.c | 191 + src/lib/libsum/sum-lmd.c | 330 + src/lib/libsum/sum-md5.c | 355 + src/lib/libsum/sum-prng.c | 113 + src/lib/libsum/sum-sha1.c | 323 + src/lib/libsum/sum-sha2.c | 1229 ++ src/lib/libsum/sum.h | 65 + src/lib/libsum/sumlib.c | 376 + 1269 files changed, 369117 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 NEWS create mode 100644 README.md create mode 100644 TODO create mode 100755 bin/Mamfile_indent create mode 100755 bin/ignore create mode 100755 bin/mamprobe create mode 100755 bin/package create mode 100755 bin/shtests create mode 100755 bin/silent create mode 100644 docs/index.html create mode 100644 docs/ksh/builtins.html create mode 100644 docs/ksh/examples.html create mode 100644 docs/ksh/faq.html create mode 100644 docs/ksh/features.html create mode 100644 docs/ksh/functions/dirs.txt create mode 100644 docs/ksh/functions/emacs_keybind.txt create mode 100644 docs/ksh/functions/getopt.txt create mode 100644 docs/ksh/functions/keybind.txt create mode 100644 docs/ksh/functions/popd.txt create mode 100644 docs/ksh/functions/pushd.txt create mode 100644 docs/ksh/functions/title.txt create mode 100644 docs/ksh/functions/vi_keybind.txt create mode 100644 docs/ksh/index.html create mode 100644 docs/ksh/ksh.html create mode 100644 docs/ksh/scripts/cgi-lib.ksh.txt create mode 100644 docs/ksh/scripts/dump-cgi.ksh.txt create mode 100644 docs/ksh/scripts/env.txt create mode 100644 docs/ksh/scripts/line.txt create mode 100644 docs/ksh/scripts/which.txt create mode 100644 lib/package/CONVERT.mk create mode 100644 lib/package/INIT.README create mode 100644 lib/package/INIT.html create mode 100644 lib/package/INIT.pkg create mode 100644 lib/package/INIT.req create mode 100644 lib/package/INIT.ver create mode 100644 lib/package/ast-ast.pkg create mode 100644 lib/package/ast-base.pkg create mode 100644 lib/package/ast-base.req create mode 100644 lib/package/ast-base.ver create mode 100644 lib/package/ast-dss.pkg create mode 100644 lib/package/ast-ksh.pkg create mode 100644 lib/package/ast-ksh.req create mode 100644 lib/package/ast-ksh.ver create mode 100644 lib/package/ast-make.pkg create mode 100644 lib/package/ast-open.pkg create mode 100644 lib/package/ast-open.req create mode 100644 lib/package/ast-open.ver create mode 100644 lib/package/ast.def create mode 100644 lib/package/ast.lic create mode 100644 lib/package/bsd.def create mode 100644 lib/package/bsd.lic create mode 100644 lib/package/epl.def create mode 100644 lib/package/ksh.pkg create mode 100644 lib/package/package.mk create mode 100644 lib/package/zlib.def create mode 100644 lib/package/zlib.lic create mode 100644 src/Mamfile create mode 100644 src/cmd/INIT/C+probe create mode 100644 src/cmd/INIT/CONVERT.mk create mode 100644 src/cmd/INIT/MAPLIB.mk create mode 100644 src/cmd/INIT/MSGFUN.mk create mode 100644 src/cmd/INIT/MSGKEY.mk create mode 100644 src/cmd/INIT/Mamfile create mode 100644 src/cmd/INIT/PROBE.mk create mode 100644 src/cmd/INIT/RELEASE create mode 100644 src/cmd/INIT/TEST.mk create mode 100644 src/cmd/INIT/WWW.mk create mode 100755 src/cmd/INIT/ar.freebsd12.amd64 create mode 100755 src/cmd/INIT/ar.ibm.risc create mode 100755 src/cmd/INIT/ar.linux.i386-64 create mode 100755 src/cmd/INIT/cc.darwin create mode 100755 src/cmd/INIT/cc.darwin07 create mode 100755 src/cmd/INIT/cc.darwin11 create mode 100755 src/cmd/INIT/cc.freebsd create mode 100755 src/cmd/INIT/cc.hp.ia64 create mode 100755 src/cmd/INIT/cc.hp.pa create mode 100755 src/cmd/INIT/cc.hp.pa64 create mode 100755 src/cmd/INIT/cc.ibm.risc create mode 100755 src/cmd/INIT/cc.ibm.risc.gcc create mode 100755 src/cmd/INIT/cc.linux.aarch64 create mode 100755 src/cmd/INIT/cc.linux.i386-64 create mode 100755 src/cmd/INIT/cc.linux.i386-64-icc create mode 100755 src/cmd/INIT/cc.linux.i386-icc create mode 100755 src/cmd/INIT/cc.linux.ia64-icc create mode 100755 src/cmd/INIT/cc.lynxos.i386 create mode 100755 src/cmd/INIT/cc.lynxos.ppc create mode 100755 src/cmd/INIT/cc.mvs.390 create mode 100755 src/cmd/INIT/cc.next.i386 create mode 100755 src/cmd/INIT/cc.next.m68k create mode 100755 src/cmd/INIT/cc.openbsd create mode 100755 src/cmd/INIT/cc.osf.alpha create mode 100755 src/cmd/INIT/cc.pentium4 create mode 100755 src/cmd/INIT/cc.sco.i386 create mode 100755 src/cmd/INIT/cc.sgi.mips2 create mode 100755 src/cmd/INIT/cc.sgi.mips3 create mode 100755 src/cmd/INIT/cc.sgi.mips3-o32 create mode 100755 src/cmd/INIT/cc.sgi.mips4 create mode 100755 src/cmd/INIT/cc.sgi.mips4-n32 create mode 100755 src/cmd/INIT/cc.sol11.i386 create mode 100755 src/cmd/INIT/cc.sol11.i386-64 create mode 100755 src/cmd/INIT/cc.sol11.sparc create mode 100755 src/cmd/INIT/cc.sol11.sparc-64 create mode 100755 src/cmd/INIT/cc.specialize create mode 100755 src/cmd/INIT/cc.unix.mc68k create mode 100755 src/cmd/INIT/cc.unixware.i386 create mode 100644 src/cmd/INIT/crossexec.sh create mode 100644 src/cmd/INIT/db.c create mode 100644 src/cmd/INIT/ditto.sh create mode 100644 src/cmd/INIT/dl.c create mode 100644 src/cmd/INIT/execrate.sh create mode 100644 src/cmd/INIT/filter.sh create mode 100644 src/cmd/INIT/gdbm.c create mode 100644 src/cmd/INIT/gdbm1.c create mode 100644 src/cmd/INIT/gdbm2.c create mode 100644 src/cmd/INIT/hello.c create mode 100644 src/cmd/INIT/hosttype.tst create mode 100644 src/cmd/INIT/hurl.sh create mode 100644 src/cmd/INIT/iconv.c create mode 100644 src/cmd/INIT/iffe.sh create mode 100644 src/cmd/INIT/iffe.tst create mode 100644 src/cmd/INIT/ignore.sh create mode 100644 src/cmd/INIT/intl.c create mode 100755 src/cmd/INIT/ld.hp.pa create mode 100755 src/cmd/INIT/ldd.cygwin.i386 create mode 100755 src/cmd/INIT/ldd.darwin create mode 100755 src/cmd/INIT/ldd.hp.pa create mode 100755 src/cmd/INIT/ldd.ibm.risc create mode 100755 src/cmd/INIT/ldd.lynxos create mode 100755 src/cmd/INIT/ldd.mvs.390 create mode 100755 src/cmd/INIT/ldd.sgi create mode 100644 src/cmd/INIT/m.c create mode 100644 src/cmd/INIT/m2.c create mode 100644 src/cmd/INIT/m3.c create mode 100644 src/cmd/INIT/m4.c create mode 100644 src/cmd/INIT/m5.c create mode 100644 src/cmd/INIT/m6.c create mode 100644 src/cmd/INIT/make.probe create mode 100644 src/cmd/INIT/mamake.c create mode 100644 src/cmd/INIT/mamake.rt create mode 100644 src/cmd/INIT/mamake.tst create mode 100644 src/cmd/INIT/mamprobe.sh create mode 100644 src/cmd/INIT/mkdir.sh create mode 100755 src/cmd/INIT/mktest.sh create mode 100644 src/cmd/INIT/mprobe.sh create mode 100644 src/cmd/INIT/nsl.c create mode 100644 src/cmd/INIT/p.c create mode 100644 src/cmd/INIT/package.mk create mode 100644 src/cmd/INIT/package.sh create mode 100644 src/cmd/INIT/probe.win32 create mode 100644 src/cmd/INIT/proto.c create mode 100644 src/cmd/INIT/ratz.c create mode 100644 src/cmd/INIT/regress.sh create mode 100644 src/cmd/INIT/release.c create mode 100644 src/cmd/INIT/rt.sh create mode 100644 src/cmd/INIT/silent.sh create mode 100644 src/cmd/INIT/socket.c create mode 100644 src/cmd/INIT/w.c create mode 100644 src/cmd/INIT/w2.c create mode 100644 src/cmd/Mamfile create mode 100644 src/cmd/builtin/Mamfile create mode 100644 src/cmd/builtin/RELEASE create mode 100755 src/cmd/builtin/features/pty create mode 100644 src/cmd/builtin/pty.c create mode 100644 src/cmd/ksh93/COMPATIBILITY create mode 100644 src/cmd/ksh93/DESIGN create mode 100644 src/cmd/ksh93/Mamfile create mode 100644 src/cmd/ksh93/OBSOLETE create mode 100644 src/cmd/ksh93/PROMO.mm create mode 100644 src/cmd/ksh93/README create mode 100644 src/cmd/ksh93/RELEASE create mode 100644 src/cmd/ksh93/RELEASE88 create mode 100644 src/cmd/ksh93/RELEASE93 create mode 100644 src/cmd/ksh93/SHOPT.sh create mode 100644 src/cmd/ksh93/TYPES create mode 100644 src/cmd/ksh93/bltins/alarm.c create mode 100644 src/cmd/ksh93/bltins/cd_pwd.c create mode 100644 src/cmd/ksh93/bltins/cflow.c create mode 100644 src/cmd/ksh93/bltins/enum.c create mode 100644 src/cmd/ksh93/bltins/getopts.c create mode 100644 src/cmd/ksh93/bltins/hist.c create mode 100644 src/cmd/ksh93/bltins/misc.c create mode 100644 src/cmd/ksh93/bltins/mkservice.c create mode 100644 src/cmd/ksh93/bltins/print.c create mode 100644 src/cmd/ksh93/bltins/read.c create mode 100644 src/cmd/ksh93/bltins/regress.c create mode 100644 src/cmd/ksh93/bltins/sleep.c create mode 100644 src/cmd/ksh93/bltins/test.c create mode 100644 src/cmd/ksh93/bltins/trap.c create mode 100644 src/cmd/ksh93/bltins/typeset.c create mode 100644 src/cmd/ksh93/bltins/ulimit.c create mode 100644 src/cmd/ksh93/bltins/umask.c create mode 100644 src/cmd/ksh93/bltins/whence.c create mode 100644 src/cmd/ksh93/builtins.mm create mode 100644 src/cmd/ksh93/data/aliases.c create mode 100644 src/cmd/ksh93/data/builtins.c create mode 100644 src/cmd/ksh93/data/keywords.c create mode 100644 src/cmd/ksh93/data/lexstates.c create mode 100644 src/cmd/ksh93/data/limits.c create mode 100644 src/cmd/ksh93/data/math.tab create mode 100644 src/cmd/ksh93/data/msg.c create mode 100644 src/cmd/ksh93/data/options.c create mode 100644 src/cmd/ksh93/data/signals.c create mode 100644 src/cmd/ksh93/data/strdata.c create mode 100644 src/cmd/ksh93/data/testops.c create mode 100644 src/cmd/ksh93/data/variables.c create mode 100644 src/cmd/ksh93/edit/completion.c create mode 100644 src/cmd/ksh93/edit/edit.c create mode 100644 src/cmd/ksh93/edit/emacs.c create mode 100644 src/cmd/ksh93/edit/hexpand.c create mode 100644 src/cmd/ksh93/edit/history.c create mode 100644 src/cmd/ksh93/edit/vi.c create mode 100644 src/cmd/ksh93/features/cmds create mode 100644 src/cmd/ksh93/features/dynamic create mode 100644 src/cmd/ksh93/features/externs create mode 100644 src/cmd/ksh93/features/locale create mode 100644 src/cmd/ksh93/features/math.sh create mode 100644 src/cmd/ksh93/features/options create mode 100644 src/cmd/ksh93/features/poll create mode 100644 src/cmd/ksh93/features/rlimits create mode 100644 src/cmd/ksh93/features/setjmp create mode 100644 src/cmd/ksh93/features/sigfeatures create mode 100644 src/cmd/ksh93/features/time create mode 100644 src/cmd/ksh93/features/ttys create mode 100755 src/cmd/ksh93/fun/dirs create mode 100755 src/cmd/ksh93/fun/popd create mode 100755 src/cmd/ksh93/fun/pushd create mode 100644 src/cmd/ksh93/include/argnod.h create mode 100644 src/cmd/ksh93/include/builtins.h create mode 100644 src/cmd/ksh93/include/defs.h create mode 100644 src/cmd/ksh93/include/edit.h create mode 100644 src/cmd/ksh93/include/fault.h create mode 100644 src/cmd/ksh93/include/fcin.h create mode 100644 src/cmd/ksh93/include/history.h create mode 100644 src/cmd/ksh93/include/io.h create mode 100644 src/cmd/ksh93/include/jobs.h create mode 100644 src/cmd/ksh93/include/lexstates.h create mode 100644 src/cmd/ksh93/include/name.h create mode 100644 src/cmd/ksh93/include/national.h create mode 100644 src/cmd/ksh93/include/nval.h create mode 100644 src/cmd/ksh93/include/path.h create mode 100644 src/cmd/ksh93/include/regress.h create mode 100644 src/cmd/ksh93/include/shell.h create mode 100644 src/cmd/ksh93/include/shlex.h create mode 100644 src/cmd/ksh93/include/shnodes.h create mode 100644 src/cmd/ksh93/include/shtable.h create mode 100644 src/cmd/ksh93/include/streval.h create mode 100644 src/cmd/ksh93/include/terminal.h create mode 100644 src/cmd/ksh93/include/test.h create mode 100644 src/cmd/ksh93/include/timeout.h create mode 100644 src/cmd/ksh93/include/ulimit.h create mode 100644 src/cmd/ksh93/include/variables.h create mode 100644 src/cmd/ksh93/include/version.h create mode 100644 src/cmd/ksh93/ksh-regress.rt create mode 100644 src/cmd/ksh93/ksh-regress.tst create mode 100755 src/cmd/ksh93/mamexec create mode 100644 src/cmd/ksh93/mamstate.c create mode 100644 src/cmd/ksh93/nval.3 create mode 100644 src/cmd/ksh93/sh.1 create mode 100644 src/cmd/ksh93/sh.memo create mode 100644 src/cmd/ksh93/sh/args.c create mode 100644 src/cmd/ksh93/sh/arith.c create mode 100644 src/cmd/ksh93/sh/array.c create mode 100644 src/cmd/ksh93/sh/defs.c create mode 100644 src/cmd/ksh93/sh/deparse.c create mode 100644 src/cmd/ksh93/sh/expand.c create mode 100644 src/cmd/ksh93/sh/fault.c create mode 100644 src/cmd/ksh93/sh/fcin.c create mode 100644 src/cmd/ksh93/sh/init.c create mode 100644 src/cmd/ksh93/sh/io.c create mode 100644 src/cmd/ksh93/sh/jobs.c create mode 100644 src/cmd/ksh93/sh/lex.c create mode 100644 src/cmd/ksh93/sh/macro.c create mode 100644 src/cmd/ksh93/sh/main.c create mode 100644 src/cmd/ksh93/sh/name.c create mode 100644 src/cmd/ksh93/sh/nvdisc.c create mode 100644 src/cmd/ksh93/sh/nvtree.c create mode 100644 src/cmd/ksh93/sh/nvtype.c create mode 100644 src/cmd/ksh93/sh/parse.c create mode 100644 src/cmd/ksh93/sh/path.c create mode 100644 src/cmd/ksh93/sh/pmain.c create mode 100644 src/cmd/ksh93/sh/shcomp.c create mode 100644 src/cmd/ksh93/sh/streval.c create mode 100644 src/cmd/ksh93/sh/string.c create mode 100644 src/cmd/ksh93/sh/subshell.c create mode 100644 src/cmd/ksh93/sh/suid_exec.c create mode 100644 src/cmd/ksh93/sh/tdump.c create mode 100644 src/cmd/ksh93/sh/timers.c create mode 100644 src/cmd/ksh93/sh/trestore.c create mode 100644 src/cmd/ksh93/sh/waitevent.c create mode 100644 src/cmd/ksh93/sh/xec.c create mode 100644 src/cmd/ksh93/shell.3 create mode 100755 src/cmd/ksh93/tests/alias.sh create mode 100755 src/cmd/ksh93/tests/append.sh create mode 100755 src/cmd/ksh93/tests/arith.sh create mode 100755 src/cmd/ksh93/tests/arrays.sh create mode 100755 src/cmd/ksh93/tests/arrays2.sh create mode 100755 src/cmd/ksh93/tests/attributes.sh create mode 100755 src/cmd/ksh93/tests/basic.sh create mode 100755 src/cmd/ksh93/tests/bracket.sh create mode 100755 src/cmd/ksh93/tests/builtins.sh create mode 100755 src/cmd/ksh93/tests/case.sh create mode 100755 src/cmd/ksh93/tests/comvar.sh create mode 100755 src/cmd/ksh93/tests/comvario.sh create mode 100755 src/cmd/ksh93/tests/coprocess.sh create mode 100755 src/cmd/ksh93/tests/cubetype.sh create mode 100755 src/cmd/ksh93/tests/enum.sh create mode 100755 src/cmd/ksh93/tests/exit.sh create mode 100755 src/cmd/ksh93/tests/expand.sh create mode 100755 src/cmd/ksh93/tests/functions.sh create mode 100755 src/cmd/ksh93/tests/glob.sh create mode 100755 src/cmd/ksh93/tests/grep.sh create mode 100755 src/cmd/ksh93/tests/heredoc.sh create mode 100755 src/cmd/ksh93/tests/io.sh create mode 100755 src/cmd/ksh93/tests/leaks.sh create mode 100755 src/cmd/ksh93/tests/locale.sh create mode 100755 src/cmd/ksh93/tests/math.sh create mode 100755 src/cmd/ksh93/tests/nameref.sh create mode 100755 src/cmd/ksh93/tests/namespace.sh create mode 100755 src/cmd/ksh93/tests/options.sh create mode 100755 src/cmd/ksh93/tests/path.sh create mode 100755 src/cmd/ksh93/tests/pointtype.sh create mode 100755 src/cmd/ksh93/tests/pty.sh create mode 100755 src/cmd/ksh93/tests/quoting.sh create mode 100755 src/cmd/ksh93/tests/quoting2.sh create mode 100755 src/cmd/ksh93/tests/readcsv.sh create mode 100755 src/cmd/ksh93/tests/recttype.sh create mode 100755 src/cmd/ksh93/tests/restricted.sh create mode 100755 src/cmd/ksh93/tests/return.sh create mode 100755 src/cmd/ksh93/tests/select.sh create mode 100755 src/cmd/ksh93/tests/shtests create mode 100755 src/cmd/ksh93/tests/sigchld.sh create mode 100755 src/cmd/ksh93/tests/signal.sh create mode 100755 src/cmd/ksh93/tests/statics.sh create mode 100755 src/cmd/ksh93/tests/subshell.sh create mode 100755 src/cmd/ksh93/tests/substring.sh create mode 100755 src/cmd/ksh93/tests/tilde.sh create mode 100755 src/cmd/ksh93/tests/timetype.sh create mode 100755 src/cmd/ksh93/tests/treemove.sh create mode 100755 src/cmd/ksh93/tests/types.sh create mode 100755 src/cmd/ksh93/tests/variables.sh create mode 100755 src/cmd/ksh93/tests/vartree1.sh create mode 100755 src/cmd/ksh93/tests/vartree2.sh create mode 100644 src/lib/Mamfile create mode 100644 src/lib/libast/Mamfile create mode 100644 src/lib/libast/README create mode 100644 src/lib/libast/RELEASE create mode 100644 src/lib/libast/aso/aso-fcntl.c create mode 100644 src/lib/libast/aso/aso-sem.c create mode 100644 src/lib/libast/aso/aso.c create mode 100644 src/lib/libast/aso/asohdr.h create mode 100644 src/lib/libast/aso/asolock.c create mode 100644 src/lib/libast/aso/asometh.c create mode 100644 src/lib/libast/aso/asorelax.c create mode 100644 src/lib/libast/astsa/README-astsa create mode 100644 src/lib/libast/astsa/aso.c create mode 100644 src/lib/libast/astsa/aso.h create mode 100644 src/lib/libast/astsa/ast.c create mode 100644 src/lib/libast/astsa/ast.h create mode 100644 src/lib/libast/astsa/ast_common.h create mode 100644 src/lib/libast/astsa/astsa.manifest create mode 100644 src/lib/libast/astsa/astsa.mm create mode 100644 src/lib/libast/astsa/astsa.omk create mode 100644 src/lib/libast/astsa/ccode.h create mode 100644 src/lib/libast/astsa/debug.h create mode 100644 src/lib/libast/astsa/error.c create mode 100644 src/lib/libast/astsa/error.h create mode 100644 src/lib/libast/astsa/hashkey.h create mode 100755 src/lib/libast/astsa/mkast_sa create mode 100644 src/lib/libast/astsa/option.h create mode 100644 src/lib/libast/astsa/optlib.h create mode 100644 src/lib/libast/astsa/sfstr.c create mode 100644 src/lib/libast/astsa/sfstr.h create mode 100644 src/lib/libast/astsa/strdup.c create mode 100644 src/lib/libast/astsa/strmatch.c create mode 100644 src/lib/libast/astsa/times.h create mode 100644 src/lib/libast/astsa/vmalloc.c create mode 100644 src/lib/libast/astsa/vmalloc.h create mode 100644 src/lib/libast/cdt/cdtlib.h create mode 100644 src/lib/libast/cdt/dtclose.c create mode 100644 src/lib/libast/cdt/dtcomp.c create mode 100644 src/lib/libast/cdt/dtdisc.c create mode 100644 src/lib/libast/cdt/dthash.c create mode 100644 src/lib/libast/cdt/dthdr.h create mode 100644 src/lib/libast/cdt/dtlist.c create mode 100644 src/lib/libast/cdt/dtmethod.c create mode 100644 src/lib/libast/cdt/dtnew.c create mode 100644 src/lib/libast/cdt/dtopen.c create mode 100644 src/lib/libast/cdt/dtstat.c create mode 100644 src/lib/libast/cdt/dtstrhash.c create mode 100644 src/lib/libast/cdt/dttree.c create mode 100644 src/lib/libast/cdt/dtuser.c create mode 100644 src/lib/libast/cdt/dtview.c create mode 100644 src/lib/libast/cdt/dtwalk.c create mode 100644 src/lib/libast/comp/atexit.c create mode 100644 src/lib/libast/comp/basename.c create mode 100644 src/lib/libast/comp/catopen.c create mode 100644 src/lib/libast/comp/closelog.c create mode 100644 src/lib/libast/comp/conf.sh create mode 100644 src/lib/libast/comp/conf.tab create mode 100644 src/lib/libast/comp/creat64.c create mode 100644 src/lib/libast/comp/dirname.c create mode 100644 src/lib/libast/comp/dup2.c create mode 100644 src/lib/libast/comp/eaccess.c create mode 100644 src/lib/libast/comp/errno.c create mode 100644 src/lib/libast/comp/execlp.c create mode 100644 src/lib/libast/comp/execve.c create mode 100644 src/lib/libast/comp/execvp.c create mode 100644 src/lib/libast/comp/execvpe.c create mode 100644 src/lib/libast/comp/fakelink.h create mode 100644 src/lib/libast/comp/fcntl.c create mode 100644 src/lib/libast/comp/fmtmsg.h create mode 100644 src/lib/libast/comp/fmtmsglib.c create mode 100644 src/lib/libast/comp/fnmatch.c create mode 100644 src/lib/libast/comp/fnmatch.h create mode 100644 src/lib/libast/comp/frexp.c create mode 100644 src/lib/libast/comp/frexpl.c create mode 100644 src/lib/libast/comp/fsync.c create mode 100644 src/lib/libast/comp/ftw.c create mode 100644 src/lib/libast/comp/ftw.h create mode 100644 src/lib/libast/comp/getdate.c create mode 100644 src/lib/libast/comp/getgroups.c create mode 100644 src/lib/libast/comp/getlogin.c create mode 100644 src/lib/libast/comp/getopt.c create mode 100644 src/lib/libast/comp/getopt.h create mode 100644 src/lib/libast/comp/getoptl.c create mode 100644 src/lib/libast/comp/getpgrp.c create mode 100644 src/lib/libast/comp/getsubopt.c create mode 100644 src/lib/libast/comp/getwd.c create mode 100644 src/lib/libast/comp/gross.c create mode 100644 src/lib/libast/comp/gross_sgi.h create mode 100644 src/lib/libast/comp/hsearch.c create mode 100644 src/lib/libast/comp/iconv.c create mode 100644 src/lib/libast/comp/killpg.c create mode 100644 src/lib/libast/comp/libgen.h create mode 100644 src/lib/libast/comp/link.c create mode 100644 src/lib/libast/comp/localeconv.c create mode 100644 src/lib/libast/comp/lstat.c create mode 100644 src/lib/libast/comp/memccpy.c create mode 100644 src/lib/libast/comp/memchr.c create mode 100644 src/lib/libast/comp/memcmp.c create mode 100644 src/lib/libast/comp/memcpy.c create mode 100644 src/lib/libast/comp/memmove.c create mode 100644 src/lib/libast/comp/memset.c create mode 100644 src/lib/libast/comp/mkdir.c create mode 100644 src/lib/libast/comp/mkfifo.c create mode 100644 src/lib/libast/comp/mknod.c create mode 100644 src/lib/libast/comp/mktemp.c create mode 100644 src/lib/libast/comp/mktime.c create mode 100644 src/lib/libast/comp/mount.c create mode 100644 src/lib/libast/comp/nftw.c create mode 100644 src/lib/libast/comp/omitted.c create mode 100644 src/lib/libast/comp/open.c create mode 100644 src/lib/libast/comp/openlog.c create mode 100644 src/lib/libast/comp/putenv.c create mode 100644 src/lib/libast/comp/re_comp.c create mode 100644 src/lib/libast/comp/re_comp.h create mode 100644 src/lib/libast/comp/readlink.c create mode 100644 src/lib/libast/comp/realpath.c create mode 100644 src/lib/libast/comp/regcmp.c create mode 100644 src/lib/libast/comp/regexp.c create mode 100644 src/lib/libast/comp/regexp.h create mode 100644 src/lib/libast/comp/remove.c create mode 100644 src/lib/libast/comp/rename.c create mode 100644 src/lib/libast/comp/resolvepath.c create mode 100644 src/lib/libast/comp/rmdir.c create mode 100644 src/lib/libast/comp/setenv.c create mode 100644 src/lib/libast/comp/setlocale.c create mode 100644 src/lib/libast/comp/setlogmask.c create mode 100644 src/lib/libast/comp/setpgid.c create mode 100644 src/lib/libast/comp/setsid.c create mode 100644 src/lib/libast/comp/sigflag.c create mode 100644 src/lib/libast/comp/sigunblock.c create mode 100644 src/lib/libast/comp/spawnveg.c create mode 100644 src/lib/libast/comp/statvfs.c create mode 100644 src/lib/libast/comp/strcasecmp.c create mode 100644 src/lib/libast/comp/strchr.c create mode 100644 src/lib/libast/comp/strftime.c create mode 100644 src/lib/libast/comp/strncasecmp.c create mode 100644 src/lib/libast/comp/strptime.c create mode 100644 src/lib/libast/comp/strrchr.c create mode 100644 src/lib/libast/comp/strstr.c create mode 100644 src/lib/libast/comp/strtod.c create mode 100644 src/lib/libast/comp/strtol.c create mode 100644 src/lib/libast/comp/strtold.c create mode 100644 src/lib/libast/comp/strtoll.c create mode 100644 src/lib/libast/comp/strtoul.c create mode 100644 src/lib/libast/comp/strtoull.c create mode 100644 src/lib/libast/comp/swab.c create mode 100644 src/lib/libast/comp/symlink.c create mode 100644 src/lib/libast/comp/syslog.c create mode 100644 src/lib/libast/comp/syslog.h create mode 100644 src/lib/libast/comp/sysloglib.h create mode 100644 src/lib/libast/comp/system.c create mode 100644 src/lib/libast/comp/tempnam.c create mode 100644 src/lib/libast/comp/tmpnam.c create mode 100644 src/lib/libast/comp/transition.c create mode 100644 src/lib/libast/comp/tsearch.c create mode 100644 src/lib/libast/comp/unlink.c create mode 100644 src/lib/libast/comp/unsetenv.c create mode 100644 src/lib/libast/comp/vfork.c create mode 100644 src/lib/libast/comp/waitpid.c create mode 100644 src/lib/libast/comp/wc.c create mode 100644 src/lib/libast/comp/wordexp.c create mode 100644 src/lib/libast/comp/wordexp.h create mode 100644 src/lib/libast/dir/dirlib.h create mode 100644 src/lib/libast/dir/dirstd.h create mode 100644 src/lib/libast/dir/getdents.c create mode 100644 src/lib/libast/dir/opendir.c create mode 100644 src/lib/libast/dir/readdir.c create mode 100644 src/lib/libast/dir/rewinddir.c create mode 100644 src/lib/libast/dir/seekdir.c create mode 100644 src/lib/libast/dir/telldir.c create mode 100644 src/lib/libast/disc/memfatal.c create mode 100644 src/lib/libast/disc/sfdcdio.c create mode 100644 src/lib/libast/disc/sfdcdos.c create mode 100644 src/lib/libast/disc/sfdcfilter.c create mode 100644 src/lib/libast/disc/sfdchdr.h create mode 100644 src/lib/libast/disc/sfdcmore.c create mode 100644 src/lib/libast/disc/sfdcprefix.c create mode 100644 src/lib/libast/disc/sfdcseekable.c create mode 100644 src/lib/libast/disc/sfdcslow.c create mode 100644 src/lib/libast/disc/sfdcsubstr.c create mode 100644 src/lib/libast/disc/sfdctee.c create mode 100644 src/lib/libast/disc/sfdcunion.c create mode 100644 src/lib/libast/disc/sfkeyprintf.c create mode 100644 src/lib/libast/disc/sfstrtmp.c create mode 100644 src/lib/libast/features/align.c create mode 100644 src/lib/libast/features/api create mode 100644 src/lib/libast/features/aso create mode 100644 src/lib/libast/features/asometh create mode 100644 src/lib/libast/features/botch.c create mode 100644 src/lib/libast/features/ccode create mode 100644 src/lib/libast/features/common create mode 100644 src/lib/libast/features/dirent create mode 100644 src/lib/libast/features/eaccess create mode 100644 src/lib/libast/features/errno create mode 100644 src/lib/libast/features/fcntl.c create mode 100644 src/lib/libast/features/float create mode 100644 src/lib/libast/features/fs create mode 100644 src/lib/libast/features/hack create mode 100644 src/lib/libast/features/iconv create mode 100644 src/lib/libast/features/lib create mode 100644 src/lib/libast/features/libpath.sh create mode 100644 src/lib/libast/features/limits.c create mode 100644 src/lib/libast/features/locale create mode 100644 src/lib/libast/features/map.c create mode 100644 src/lib/libast/features/mmap create mode 100644 src/lib/libast/features/mode.c create mode 100644 src/lib/libast/features/ndbm create mode 100644 src/lib/libast/features/nl_types create mode 100644 src/lib/libast/features/omitted create mode 100644 src/lib/libast/features/options create mode 100644 src/lib/libast/features/param.sh create mode 100644 src/lib/libast/features/preroot.sh create mode 100644 src/lib/libast/features/prog create mode 100644 src/lib/libast/features/sfinit.c create mode 100644 src/lib/libast/features/sfio create mode 100644 src/lib/libast/features/sig.sh create mode 100644 src/lib/libast/features/siglist create mode 100644 src/lib/libast/features/signal.c create mode 100644 src/lib/libast/features/sizeof create mode 100644 src/lib/libast/features/standards create mode 100644 src/lib/libast/features/stdio create mode 100644 src/lib/libast/features/sys create mode 100644 src/lib/libast/features/syscall create mode 100644 src/lib/libast/features/time create mode 100644 src/lib/libast/features/tmlib create mode 100644 src/lib/libast/features/tmx create mode 100644 src/lib/libast/features/tty create mode 100644 src/lib/libast/features/tv create mode 100644 src/lib/libast/features/tvlib create mode 100644 src/lib/libast/features/uwin create mode 100644 src/lib/libast/features/vfork create mode 100644 src/lib/libast/features/vmalloc create mode 100644 src/lib/libast/features/wait create mode 100644 src/lib/libast/features/wchar create mode 100644 src/lib/libast/features/wctype create mode 100644 src/lib/libast/hash/hashalloc.c create mode 100644 src/lib/libast/hash/hashdump.c create mode 100644 src/lib/libast/hash/hashfree.c create mode 100644 src/lib/libast/hash/hashlast.c create mode 100644 src/lib/libast/hash/hashlib.h create mode 100644 src/lib/libast/hash/hashlook.c create mode 100644 src/lib/libast/hash/hashscan.c create mode 100644 src/lib/libast/hash/hashsize.c create mode 100644 src/lib/libast/hash/hashview.c create mode 100644 src/lib/libast/hash/hashwalk.c create mode 100644 src/lib/libast/hash/memhash.c create mode 100644 src/lib/libast/hash/memsum.c create mode 100644 src/lib/libast/hash/strhash.c create mode 100644 src/lib/libast/hash/strkey.c create mode 100644 src/lib/libast/hash/strsum.c create mode 100644 src/lib/libast/include/aso.h create mode 100644 src/lib/libast/include/ast.h create mode 100644 src/lib/libast/include/ast_dir.h create mode 100644 src/lib/libast/include/ast_getopt.h create mode 100644 src/lib/libast/include/ast_std.h create mode 100644 src/lib/libast/include/ast_windows.h create mode 100644 src/lib/libast/include/ccode.h create mode 100644 src/lib/libast/include/cdt.h create mode 100644 src/lib/libast/include/cmdarg.h create mode 100644 src/lib/libast/include/debug.h create mode 100644 src/lib/libast/include/dt.h create mode 100644 src/lib/libast/include/error.h create mode 100644 src/lib/libast/include/find.h create mode 100644 src/lib/libast/include/fnv.h create mode 100644 src/lib/libast/include/fts.h create mode 100644 src/lib/libast/include/ftwalk.h create mode 100644 src/lib/libast/include/glob.h create mode 100644 src/lib/libast/include/hash.h create mode 100644 src/lib/libast/include/hashkey.h create mode 100644 src/lib/libast/include/hashpart.h create mode 100644 src/lib/libast/include/ip6.h create mode 100644 src/lib/libast/include/ls.h create mode 100644 src/lib/libast/include/magic.h create mode 100644 src/lib/libast/include/magicid.h create mode 100644 src/lib/libast/include/mc.h create mode 100644 src/lib/libast/include/mime.h create mode 100644 src/lib/libast/include/mnt.h create mode 100644 src/lib/libast/include/modecanon.h create mode 100644 src/lib/libast/include/modex.h create mode 100644 src/lib/libast/include/namval.h create mode 100644 src/lib/libast/include/option.h create mode 100644 src/lib/libast/include/proc.h create mode 100644 src/lib/libast/include/recfmt.h create mode 100644 src/lib/libast/include/regex.h create mode 100644 src/lib/libast/include/sfdisc.h create mode 100644 src/lib/libast/include/sfio.h create mode 100644 src/lib/libast/include/sfio_s.h create mode 100644 src/lib/libast/include/sfio_t.h create mode 100644 src/lib/libast/include/shcmd.h create mode 100644 src/lib/libast/include/stack.h create mode 100644 src/lib/libast/include/stak.h create mode 100644 src/lib/libast/include/stk.h create mode 100644 src/lib/libast/include/swap.h create mode 100644 src/lib/libast/include/tar.h create mode 100644 src/lib/libast/include/times.h create mode 100644 src/lib/libast/include/tm.h create mode 100644 src/lib/libast/include/tok.h create mode 100644 src/lib/libast/include/usage.h create mode 100644 src/lib/libast/include/vdb.h create mode 100644 src/lib/libast/include/vecargs.h create mode 100644 src/lib/libast/include/vmalloc.h create mode 100644 src/lib/libast/include/wait.h create mode 100644 src/lib/libast/man/LIBAST.3 create mode 100644 src/lib/libast/man/aso.3 create mode 100644 src/lib/libast/man/ast.3 create mode 100644 src/lib/libast/man/astsa.3 create mode 100644 src/lib/libast/man/cdt.3 create mode 100644 src/lib/libast/man/chr.3 create mode 100644 src/lib/libast/man/compat.3 create mode 100644 src/lib/libast/man/error.3 create mode 100644 src/lib/libast/man/find.3 create mode 100644 src/lib/libast/man/fmt.3 create mode 100644 src/lib/libast/man/fmtls.3 create mode 100644 src/lib/libast/man/ftwalk.3 create mode 100644 src/lib/libast/man/getcwd.3 create mode 100644 src/lib/libast/man/hash.3 create mode 100644 src/lib/libast/man/iblocks.3 create mode 100644 src/lib/libast/man/int.3 create mode 100644 src/lib/libast/man/ip6.3 create mode 100644 src/lib/libast/man/magic.3 create mode 100644 src/lib/libast/man/mem.3 create mode 100644 src/lib/libast/man/mime.3 create mode 100644 src/lib/libast/man/modecanon.3 create mode 100644 src/lib/libast/man/optget.3 create mode 100644 src/lib/libast/man/path.3 create mode 100644 src/lib/libast/man/preroot.3 create mode 100644 src/lib/libast/man/proc.3 create mode 100644 src/lib/libast/man/re.3 create mode 100644 src/lib/libast/man/regex.3 create mode 100644 src/lib/libast/man/setenviron.3 create mode 100644 src/lib/libast/man/sfdisc.3 create mode 100644 src/lib/libast/man/sfio.3 create mode 100644 src/lib/libast/man/sig.3 create mode 100644 src/lib/libast/man/spawnveg.3 create mode 100644 src/lib/libast/man/stak.3 create mode 100644 src/lib/libast/man/stk.3 create mode 100644 src/lib/libast/man/strcopy.3 create mode 100644 src/lib/libast/man/strdup.3 create mode 100644 src/lib/libast/man/strelapsed.3 create mode 100644 src/lib/libast/man/strerror.3 create mode 100644 src/lib/libast/man/stresc.3 create mode 100644 src/lib/libast/man/streval.3 create mode 100644 src/lib/libast/man/strgid.3 create mode 100644 src/lib/libast/man/strmatch.3 create mode 100644 src/lib/libast/man/stropt.3 create mode 100644 src/lib/libast/man/strperm.3 create mode 100644 src/lib/libast/man/strsignal.3 create mode 100644 src/lib/libast/man/strsort.3 create mode 100644 src/lib/libast/man/strtape.3 create mode 100644 src/lib/libast/man/strton.3 create mode 100644 src/lib/libast/man/struid.3 create mode 100644 src/lib/libast/man/swap.3 create mode 100644 src/lib/libast/man/tab.3 create mode 100644 src/lib/libast/man/tm.3 create mode 100644 src/lib/libast/man/tmx.3 create mode 100644 src/lib/libast/man/tok.3 create mode 100644 src/lib/libast/man/touch.3 create mode 100644 src/lib/libast/man/tv.3 create mode 100644 src/lib/libast/man/vecargs.3 create mode 100644 src/lib/libast/man/vmalloc.3 create mode 100644 src/lib/libast/misc/astintercept.c create mode 100644 src/lib/libast/misc/cmdarg.c create mode 100644 src/lib/libast/misc/cmdlib.h create mode 100644 src/lib/libast/misc/conformance.c create mode 100644 src/lib/libast/misc/debug.c create mode 100644 src/lib/libast/misc/error.c create mode 100644 src/lib/libast/misc/errorf.c create mode 100644 src/lib/libast/misc/errormsg.c create mode 100644 src/lib/libast/misc/errorx.c create mode 100644 src/lib/libast/misc/fastfind.c create mode 100644 src/lib/libast/misc/findlib.h create mode 100644 src/lib/libast/misc/fmtrec.c create mode 100644 src/lib/libast/misc/fts.c create mode 100644 src/lib/libast/misc/ftwalk.c create mode 100644 src/lib/libast/misc/ftwflags.c create mode 100644 src/lib/libast/misc/getcwd.c create mode 100644 src/lib/libast/misc/getenv.c create mode 100644 src/lib/libast/misc/glob.c create mode 100644 src/lib/libast/misc/intercepts.h create mode 100644 src/lib/libast/misc/magic.c create mode 100644 src/lib/libast/misc/magic.tab create mode 100644 src/lib/libast/misc/mime.c create mode 100644 src/lib/libast/misc/mimelib.h create mode 100644 src/lib/libast/misc/mimetype.c create mode 100644 src/lib/libast/misc/optctx.c create mode 100644 src/lib/libast/misc/optesc.c create mode 100644 src/lib/libast/misc/optget.c create mode 100644 src/lib/libast/misc/optjoin.c create mode 100644 src/lib/libast/misc/optlib.h create mode 100644 src/lib/libast/misc/procclose.c create mode 100644 src/lib/libast/misc/procfree.c create mode 100644 src/lib/libast/misc/proclib.h create mode 100644 src/lib/libast/misc/procopen.c create mode 100644 src/lib/libast/misc/procrun.c create mode 100644 src/lib/libast/misc/recfmt.c create mode 100644 src/lib/libast/misc/reclen.c create mode 100644 src/lib/libast/misc/recstr.c create mode 100644 src/lib/libast/misc/setenviron.c create mode 100644 src/lib/libast/misc/sigcrit.c create mode 100644 src/lib/libast/misc/sigdata.c create mode 100644 src/lib/libast/misc/signal.c create mode 100644 src/lib/libast/misc/stack.c create mode 100644 src/lib/libast/misc/state.c create mode 100644 src/lib/libast/misc/stk.c create mode 100644 src/lib/libast/misc/systrace.c create mode 100644 src/lib/libast/misc/translate.c create mode 100644 src/lib/libast/misc/univdata.c create mode 100644 src/lib/libast/misc/univlib.h create mode 100644 src/lib/libast/obsolete/spawn.c create mode 100644 src/lib/libast/path/pathaccess.c create mode 100644 src/lib/libast/path/pathbin.c create mode 100644 src/lib/libast/path/pathcanon.c create mode 100644 src/lib/libast/path/pathcat.c create mode 100644 src/lib/libast/path/pathcd.c create mode 100644 src/lib/libast/path/pathcheck.c create mode 100644 src/lib/libast/path/pathexists.c create mode 100644 src/lib/libast/path/pathfind.c create mode 100644 src/lib/libast/path/pathgetlink.c create mode 100644 src/lib/libast/path/pathkey.c create mode 100644 src/lib/libast/path/pathnative.c create mode 100644 src/lib/libast/path/pathpath.c create mode 100644 src/lib/libast/path/pathposix.c create mode 100644 src/lib/libast/path/pathprobe.c create mode 100644 src/lib/libast/path/pathprog.c create mode 100644 src/lib/libast/path/pathrepl.c create mode 100644 src/lib/libast/path/pathsetlink.c create mode 100644 src/lib/libast/path/pathshell.c create mode 100644 src/lib/libast/path/pathstat.c create mode 100644 src/lib/libast/path/pathtemp.c create mode 100644 src/lib/libast/path/pathtmp.c create mode 100644 src/lib/libast/port/astconf.c create mode 100644 src/lib/libast/port/astcopy.c create mode 100644 src/lib/libast/port/astdynamic.c create mode 100644 src/lib/libast/port/astlicense.c create mode 100644 src/lib/libast/port/astmath.c create mode 100644 src/lib/libast/port/astquery.c create mode 100644 src/lib/libast/port/aststatic.c create mode 100644 src/lib/libast/port/astwinsize.c create mode 100644 src/lib/libast/port/atmain.C create mode 100644 src/lib/libast/port/iblocks.c create mode 100644 src/lib/libast/port/lc.c create mode 100644 src/lib/libast/port/lc.tab create mode 100644 src/lib/libast/port/lcgen.c create mode 100644 src/lib/libast/port/lclang.h create mode 100644 src/lib/libast/port/lclib.h create mode 100644 src/lib/libast/port/mc.c create mode 100644 src/lib/libast/port/mnt.c create mode 100644 src/lib/libast/port/touch.c create mode 100644 src/lib/libast/preroot/getpreroot.c create mode 100644 src/lib/libast/preroot/ispreroot.c create mode 100644 src/lib/libast/preroot/realopen.c create mode 100644 src/lib/libast/preroot/setpreroot.c create mode 100644 src/lib/libast/regex/regalloc.c create mode 100644 src/lib/libast/regex/regcache.c create mode 100644 src/lib/libast/regex/regclass.c create mode 100644 src/lib/libast/regex/regcoll.c create mode 100644 src/lib/libast/regex/regcomp.c create mode 100644 src/lib/libast/regex/regdecomp.c create mode 100644 src/lib/libast/regex/regerror.c create mode 100644 src/lib/libast/regex/regexec.c create mode 100644 src/lib/libast/regex/regfatal.c create mode 100644 src/lib/libast/regex/reginit.c create mode 100644 src/lib/libast/regex/reglib.h create mode 100644 src/lib/libast/regex/regnexec.c create mode 100644 src/lib/libast/regex/regrecord.c create mode 100644 src/lib/libast/regex/regrexec.c create mode 100644 src/lib/libast/regex/regstat.c create mode 100644 src/lib/libast/regex/regsub.c create mode 100644 src/lib/libast/regex/regsubcomp.c create mode 100644 src/lib/libast/regex/regsubexec.c create mode 100644 src/lib/libast/sfio/_sfclrerr.c create mode 100644 src/lib/libast/sfio/_sfdlen.c create mode 100644 src/lib/libast/sfio/_sfeof.c create mode 100644 src/lib/libast/sfio/_sferror.c create mode 100644 src/lib/libast/sfio/_sffileno.c create mode 100644 src/lib/libast/sfio/_sfgetc.c create mode 100644 src/lib/libast/sfio/_sfgetl.c create mode 100644 src/lib/libast/sfio/_sfgetl2.c create mode 100644 src/lib/libast/sfio/_sfgetu.c create mode 100644 src/lib/libast/sfio/_sfgetu2.c create mode 100644 src/lib/libast/sfio/_sfllen.c create mode 100644 src/lib/libast/sfio/_sfopen.c create mode 100644 src/lib/libast/sfio/_sfputc.c create mode 100644 src/lib/libast/sfio/_sfputd.c create mode 100644 src/lib/libast/sfio/_sfputl.c create mode 100644 src/lib/libast/sfio/_sfputm.c create mode 100644 src/lib/libast/sfio/_sfputu.c create mode 100644 src/lib/libast/sfio/_sfslen.c create mode 100644 src/lib/libast/sfio/_sfstacked.c create mode 100644 src/lib/libast/sfio/_sfulen.c create mode 100644 src/lib/libast/sfio/_sfvalue.c create mode 100644 src/lib/libast/sfio/sfclose.c create mode 100644 src/lib/libast/sfio/sfclrlock.c create mode 100644 src/lib/libast/sfio/sfcvt.c create mode 100644 src/lib/libast/sfio/sfdisc.c create mode 100644 src/lib/libast/sfio/sfdlen.c create mode 100644 src/lib/libast/sfio/sfecvt.c create mode 100644 src/lib/libast/sfio/sfexcept.c create mode 100644 src/lib/libast/sfio/sfextern.c create mode 100644 src/lib/libast/sfio/sffcvt.c create mode 100644 src/lib/libast/sfio/sffilbuf.c create mode 100644 src/lib/libast/sfio/sfflsbuf.c create mode 100644 src/lib/libast/sfio/sfgetd.c create mode 100644 src/lib/libast/sfio/sfgetl.c create mode 100644 src/lib/libast/sfio/sfgetm.c create mode 100644 src/lib/libast/sfio/sfgetr.c create mode 100644 src/lib/libast/sfio/sfgetu.c create mode 100644 src/lib/libast/sfio/sfhdr.h create mode 100644 src/lib/libast/sfio/sfllen.c create mode 100644 src/lib/libast/sfio/sfmode.c create mode 100644 src/lib/libast/sfio/sfmove.c create mode 100644 src/lib/libast/sfio/sfmutex.c create mode 100644 src/lib/libast/sfio/sfnew.c create mode 100644 src/lib/libast/sfio/sfnotify.c create mode 100644 src/lib/libast/sfio/sfnputc.c create mode 100644 src/lib/libast/sfio/sfopen.c create mode 100644 src/lib/libast/sfio/sfpeek.c create mode 100644 src/lib/libast/sfio/sfpkrd.c create mode 100644 src/lib/libast/sfio/sfpoll.c create mode 100644 src/lib/libast/sfio/sfpool.c create mode 100644 src/lib/libast/sfio/sfpopen.c create mode 100644 src/lib/libast/sfio/sfprintf.c create mode 100644 src/lib/libast/sfio/sfprints.c create mode 100644 src/lib/libast/sfio/sfpurge.c create mode 100644 src/lib/libast/sfio/sfputd.c create mode 100644 src/lib/libast/sfio/sfputl.c create mode 100644 src/lib/libast/sfio/sfputm.c create mode 100644 src/lib/libast/sfio/sfputr.c create mode 100644 src/lib/libast/sfio/sfputu.c create mode 100644 src/lib/libast/sfio/sfraise.c create mode 100644 src/lib/libast/sfio/sfrd.c create mode 100644 src/lib/libast/sfio/sfread.c create mode 100644 src/lib/libast/sfio/sfreserve.c create mode 100644 src/lib/libast/sfio/sfresize.c create mode 100644 src/lib/libast/sfio/sfscanf.c create mode 100644 src/lib/libast/sfio/sfseek.c create mode 100644 src/lib/libast/sfio/sfset.c create mode 100644 src/lib/libast/sfio/sfsetbuf.c create mode 100644 src/lib/libast/sfio/sfsetfd.c create mode 100644 src/lib/libast/sfio/sfsize.c create mode 100644 src/lib/libast/sfio/sfsk.c create mode 100644 src/lib/libast/sfio/sfstack.c create mode 100644 src/lib/libast/sfio/sfstrtod.c create mode 100644 src/lib/libast/sfio/sfstrtof.h create mode 100644 src/lib/libast/sfio/sfswap.c create mode 100644 src/lib/libast/sfio/sfsync.c create mode 100644 src/lib/libast/sfio/sftable.c create mode 100644 src/lib/libast/sfio/sftell.c create mode 100644 src/lib/libast/sfio/sftmp.c create mode 100644 src/lib/libast/sfio/sfungetc.c create mode 100644 src/lib/libast/sfio/sfvprintf.c create mode 100644 src/lib/libast/sfio/sfvscanf.c create mode 100644 src/lib/libast/sfio/sfwalk.c create mode 100644 src/lib/libast/sfio/sfwr.c create mode 100644 src/lib/libast/sfio/sfwrite.c create mode 100644 src/lib/libast/sfio/vthread.h create mode 100644 src/lib/libast/std/bytesex.h create mode 100644 src/lib/libast/std/dirent.h create mode 100644 src/lib/libast/std/endian.h create mode 100644 src/lib/libast/std/iconv.h create mode 100644 src/lib/libast/std/nl_types.h create mode 100644 src/lib/libast/std/stdio.h create mode 100644 src/lib/libast/std/wchar.h create mode 100644 src/lib/libast/std/wctype.h create mode 100644 src/lib/libast/stdio/_doprnt.c create mode 100644 src/lib/libast/stdio/_doscan.c create mode 100644 src/lib/libast/stdio/_filbuf.c create mode 100644 src/lib/libast/stdio/_flsbuf.c create mode 100644 src/lib/libast/stdio/_stdfun.c create mode 100644 src/lib/libast/stdio/_stdopen.c create mode 100644 src/lib/libast/stdio/_stdprintf.c create mode 100644 src/lib/libast/stdio/_stdscanf.c create mode 100644 src/lib/libast/stdio/_stdsprnt.c create mode 100644 src/lib/libast/stdio/_stdvbuf.c create mode 100644 src/lib/libast/stdio/_stdvsnprnt.c create mode 100644 src/lib/libast/stdio/_stdvsprnt.c create mode 100644 src/lib/libast/stdio/_stdvsscn.c create mode 100644 src/lib/libast/stdio/asprintf.c create mode 100644 src/lib/libast/stdio/clearerr.c create mode 100644 src/lib/libast/stdio/fclose.c create mode 100644 src/lib/libast/stdio/fcloseall.c create mode 100644 src/lib/libast/stdio/fdopen.c create mode 100644 src/lib/libast/stdio/feof.c create mode 100644 src/lib/libast/stdio/ferror.c create mode 100644 src/lib/libast/stdio/fflush.c create mode 100644 src/lib/libast/stdio/fgetc.c create mode 100644 src/lib/libast/stdio/fgetpos.c create mode 100644 src/lib/libast/stdio/fgets.c create mode 100644 src/lib/libast/stdio/fgetwc.c create mode 100644 src/lib/libast/stdio/fgetws.c create mode 100644 src/lib/libast/stdio/fileno.c create mode 100644 src/lib/libast/stdio/flockfile.c create mode 100644 src/lib/libast/stdio/fmemopen.c create mode 100644 src/lib/libast/stdio/fopen.c create mode 100644 src/lib/libast/stdio/fprintf.c create mode 100644 src/lib/libast/stdio/fpurge.c create mode 100644 src/lib/libast/stdio/fputc.c create mode 100644 src/lib/libast/stdio/fputs.c create mode 100644 src/lib/libast/stdio/fputwc.c create mode 100644 src/lib/libast/stdio/fputws.c create mode 100644 src/lib/libast/stdio/fread.c create mode 100644 src/lib/libast/stdio/freopen.c create mode 100644 src/lib/libast/stdio/fscanf.c create mode 100644 src/lib/libast/stdio/fseek.c create mode 100644 src/lib/libast/stdio/fseeko.c create mode 100644 src/lib/libast/stdio/fsetpos.c create mode 100644 src/lib/libast/stdio/ftell.c create mode 100644 src/lib/libast/stdio/ftello.c create mode 100644 src/lib/libast/stdio/ftrylockfile.c create mode 100644 src/lib/libast/stdio/funlockfile.c create mode 100644 src/lib/libast/stdio/fwide.c create mode 100644 src/lib/libast/stdio/fwprintf.c create mode 100644 src/lib/libast/stdio/fwrite.c create mode 100644 src/lib/libast/stdio/fwscanf.c create mode 100644 src/lib/libast/stdio/getc.c create mode 100644 src/lib/libast/stdio/getchar.c create mode 100644 src/lib/libast/stdio/getdelim.c create mode 100644 src/lib/libast/stdio/getline.c create mode 100644 src/lib/libast/stdio/getw.c create mode 100644 src/lib/libast/stdio/getwc.c create mode 100644 src/lib/libast/stdio/getwchar.c create mode 100644 src/lib/libast/stdio/pclose.c create mode 100644 src/lib/libast/stdio/popen.c create mode 100644 src/lib/libast/stdio/printf.c create mode 100644 src/lib/libast/stdio/putc.c create mode 100644 src/lib/libast/stdio/putchar.c create mode 100644 src/lib/libast/stdio/puts.c create mode 100644 src/lib/libast/stdio/putw.c create mode 100644 src/lib/libast/stdio/putwc.c create mode 100644 src/lib/libast/stdio/putwchar.c create mode 100644 src/lib/libast/stdio/rewind.c create mode 100644 src/lib/libast/stdio/scanf.c create mode 100644 src/lib/libast/stdio/setbuf.c create mode 100644 src/lib/libast/stdio/setbuffer.c create mode 100644 src/lib/libast/stdio/setlinebuf.c create mode 100644 src/lib/libast/stdio/setvbuf.c create mode 100644 src/lib/libast/stdio/snprintf.c create mode 100644 src/lib/libast/stdio/sprintf.c create mode 100644 src/lib/libast/stdio/sscanf.c create mode 100644 src/lib/libast/stdio/stdhdr.h create mode 100644 src/lib/libast/stdio/stdio_c99.c create mode 100644 src/lib/libast/stdio/swprintf.c create mode 100644 src/lib/libast/stdio/swscanf.c create mode 100644 src/lib/libast/stdio/tmpfile.c create mode 100644 src/lib/libast/stdio/ungetc.c create mode 100644 src/lib/libast/stdio/ungetwc.c create mode 100644 src/lib/libast/stdio/vasprintf.c create mode 100644 src/lib/libast/stdio/vfprintf.c create mode 100644 src/lib/libast/stdio/vfscanf.c create mode 100644 src/lib/libast/stdio/vfwprintf.c create mode 100644 src/lib/libast/stdio/vfwscanf.c create mode 100644 src/lib/libast/stdio/vprintf.c create mode 100644 src/lib/libast/stdio/vscanf.c create mode 100644 src/lib/libast/stdio/vsnprintf.c create mode 100644 src/lib/libast/stdio/vsprintf.c create mode 100644 src/lib/libast/stdio/vsscanf.c create mode 100644 src/lib/libast/stdio/vswprintf.c create mode 100644 src/lib/libast/stdio/vswscanf.c create mode 100644 src/lib/libast/stdio/vwprintf.c create mode 100644 src/lib/libast/stdio/vwscanf.c create mode 100644 src/lib/libast/stdio/wprintf.c create mode 100644 src/lib/libast/stdio/wscanf.c create mode 100644 src/lib/libast/string/base64.c create mode 100644 src/lib/libast/string/ccmap.c create mode 100644 src/lib/libast/string/ccmapid.c create mode 100644 src/lib/libast/string/ccnative.c create mode 100644 src/lib/libast/string/chresc.c create mode 100644 src/lib/libast/string/chrtoi.c create mode 100644 src/lib/libast/string/fmtbase.c create mode 100644 src/lib/libast/string/fmtbuf.c create mode 100644 src/lib/libast/string/fmtclock.c create mode 100644 src/lib/libast/string/fmtdev.c create mode 100644 src/lib/libast/string/fmtelapsed.c create mode 100644 src/lib/libast/string/fmterror.c create mode 100644 src/lib/libast/string/fmtesc.c create mode 100644 src/lib/libast/string/fmtfmt.c create mode 100644 src/lib/libast/string/fmtfs.c create mode 100644 src/lib/libast/string/fmtgid.c create mode 100644 src/lib/libast/string/fmtident.c create mode 100644 src/lib/libast/string/fmtint.c create mode 100644 src/lib/libast/string/fmtip4.c create mode 100644 src/lib/libast/string/fmtip6.c create mode 100644 src/lib/libast/string/fmtls.c create mode 100644 src/lib/libast/string/fmtmatch.c create mode 100644 src/lib/libast/string/fmtmode.c create mode 100644 src/lib/libast/string/fmtnum.c create mode 100644 src/lib/libast/string/fmtperm.c create mode 100644 src/lib/libast/string/fmtre.c create mode 100644 src/lib/libast/string/fmtscale.c create mode 100644 src/lib/libast/string/fmtsignal.c create mode 100644 src/lib/libast/string/fmttime.c create mode 100644 src/lib/libast/string/fmttmx.c create mode 100644 src/lib/libast/string/fmttv.c create mode 100644 src/lib/libast/string/fmtuid.c create mode 100644 src/lib/libast/string/fmtversion.c create mode 100644 src/lib/libast/string/memdup.c create mode 100644 src/lib/libast/string/modedata.c create mode 100644 src/lib/libast/string/modei.c create mode 100644 src/lib/libast/string/modelib.h create mode 100644 src/lib/libast/string/modex.c create mode 100644 src/lib/libast/string/stracmp.c create mode 100644 src/lib/libast/string/strcopy.c create mode 100644 src/lib/libast/string/strdup.c create mode 100644 src/lib/libast/string/strelapsed.c create mode 100644 src/lib/libast/string/strerror.c create mode 100644 src/lib/libast/string/stresc.c create mode 100644 src/lib/libast/string/streval.c create mode 100644 src/lib/libast/string/strexpr.c create mode 100644 src/lib/libast/string/strgid.c create mode 100644 src/lib/libast/string/strlcat.c create mode 100644 src/lib/libast/string/strlcpy.c create mode 100644 src/lib/libast/string/strlook.c create mode 100644 src/lib/libast/string/strmatch.c create mode 100644 src/lib/libast/string/strmode.c create mode 100644 src/lib/libast/string/strnacmp.c create mode 100644 src/lib/libast/string/strncopy.c create mode 100644 src/lib/libast/string/strnpcmp.c create mode 100644 src/lib/libast/string/strntod.c create mode 100644 src/lib/libast/string/strntol.c create mode 100644 src/lib/libast/string/strntold.c create mode 100644 src/lib/libast/string/strntoll.c create mode 100644 src/lib/libast/string/strnton.c create mode 100644 src/lib/libast/string/strntonll.c create mode 100644 src/lib/libast/string/strntoul.c create mode 100644 src/lib/libast/string/strntoull.c create mode 100644 src/lib/libast/string/strnvcmp.c create mode 100644 src/lib/libast/string/stropt.c create mode 100644 src/lib/libast/string/strpcmp.c create mode 100644 src/lib/libast/string/strperm.c create mode 100644 src/lib/libast/string/strpsearch.c create mode 100644 src/lib/libast/string/strsearch.c create mode 100644 src/lib/libast/string/strsort.c create mode 100644 src/lib/libast/string/strtape.c create mode 100644 src/lib/libast/string/strtoi.h create mode 100644 src/lib/libast/string/strtoip4.c create mode 100644 src/lib/libast/string/strtoip6.c create mode 100644 src/lib/libast/string/strton.c create mode 100644 src/lib/libast/string/strtonll.c create mode 100644 src/lib/libast/string/struid.c create mode 100644 src/lib/libast/string/struniq.c create mode 100644 src/lib/libast/string/strvcmp.c create mode 100644 src/lib/libast/string/swapget.c create mode 100644 src/lib/libast/string/swapmem.c create mode 100644 src/lib/libast/string/swapop.c create mode 100644 src/lib/libast/string/swapput.c create mode 100644 src/lib/libast/string/tok.c create mode 100644 src/lib/libast/string/tokline.c create mode 100644 src/lib/libast/string/tokscan.c create mode 100644 src/lib/libast/string/wc2utf8.c create mode 100644 src/lib/libast/tm/tmdata.c create mode 100644 src/lib/libast/tm/tmdate.c create mode 100644 src/lib/libast/tm/tmequiv.c create mode 100644 src/lib/libast/tm/tmfix.c create mode 100644 src/lib/libast/tm/tmfmt.c create mode 100644 src/lib/libast/tm/tmform.c create mode 100644 src/lib/libast/tm/tmgoff.c create mode 100644 src/lib/libast/tm/tminit.c create mode 100644 src/lib/libast/tm/tmleap.c create mode 100644 src/lib/libast/tm/tmlex.c create mode 100644 src/lib/libast/tm/tmlocale.c create mode 100644 src/lib/libast/tm/tmmake.c create mode 100644 src/lib/libast/tm/tmpoff.c create mode 100644 src/lib/libast/tm/tmscan.c create mode 100644 src/lib/libast/tm/tmsleep.c create mode 100644 src/lib/libast/tm/tmtime.c create mode 100644 src/lib/libast/tm/tmtype.c create mode 100644 src/lib/libast/tm/tmweek.c create mode 100644 src/lib/libast/tm/tmword.c create mode 100644 src/lib/libast/tm/tmxdate.c create mode 100644 src/lib/libast/tm/tmxduration.c create mode 100644 src/lib/libast/tm/tmxfmt.c create mode 100644 src/lib/libast/tm/tmxgettime.c create mode 100644 src/lib/libast/tm/tmxleap.c create mode 100644 src/lib/libast/tm/tmxmake.c create mode 100644 src/lib/libast/tm/tmxscan.c create mode 100644 src/lib/libast/tm/tmxsettime.c create mode 100644 src/lib/libast/tm/tmxsleep.c create mode 100644 src/lib/libast/tm/tmxtime.c create mode 100644 src/lib/libast/tm/tmxtouch.c create mode 100644 src/lib/libast/tm/tmzone.c create mode 100644 src/lib/libast/tm/tvcmp.c create mode 100644 src/lib/libast/tm/tvgettime.c create mode 100644 src/lib/libast/tm/tvsettime.c create mode 100644 src/lib/libast/tm/tvsleep.c create mode 100644 src/lib/libast/tm/tvtouch.c create mode 100644 src/lib/libast/uwin/a64l.c create mode 100644 src/lib/libast/uwin/acosh.c create mode 100644 src/lib/libast/uwin/asinh.c create mode 100644 src/lib/libast/uwin/atanh.c create mode 100644 src/lib/libast/uwin/cbrt.c create mode 100644 src/lib/libast/uwin/crypt.c create mode 100644 src/lib/libast/uwin/erf.c create mode 100644 src/lib/libast/uwin/err.c create mode 100644 src/lib/libast/uwin/exp.c create mode 100644 src/lib/libast/uwin/exp__E.c create mode 100644 src/lib/libast/uwin/expm1.c create mode 100644 src/lib/libast/uwin/gamma.c create mode 100644 src/lib/libast/uwin/getpass.c create mode 100644 src/lib/libast/uwin/lgamma.c create mode 100644 src/lib/libast/uwin/log.c create mode 100644 src/lib/libast/uwin/log1p.c create mode 100644 src/lib/libast/uwin/log__L.c create mode 100644 src/lib/libast/uwin/mathimpl.h create mode 100644 src/lib/libast/uwin/mini.sym create mode 100644 src/lib/libast/uwin/rand48.c create mode 100644 src/lib/libast/uwin/random.c create mode 100644 src/lib/libast/uwin/rcmd.c create mode 100644 src/lib/libast/uwin/rint.c create mode 100644 src/lib/libast/uwin/rlib.h create mode 100644 src/lib/libast/uwin/support.c create mode 100644 src/lib/libast/vec/vecargs.c create mode 100644 src/lib/libast/vec/vecfile.c create mode 100644 src/lib/libast/vec/vecfree.c create mode 100644 src/lib/libast/vec/vecload.c create mode 100644 src/lib/libast/vec/vecstring.c create mode 100644 src/lib/libast/vmalloc/malloc.c create mode 100644 src/lib/libast/vmalloc/vmbest.c create mode 100644 src/lib/libast/vmalloc/vmclear.c create mode 100644 src/lib/libast/vmalloc/vmclose.c create mode 100644 src/lib/libast/vmalloc/vmdcheap.c create mode 100644 src/lib/libast/vmalloc/vmdebug.c create mode 100644 src/lib/libast/vmalloc/vmdisc.c create mode 100644 src/lib/libast/vmalloc/vmexit.c create mode 100644 src/lib/libast/vmalloc/vmgetmem.c create mode 100644 src/lib/libast/vmalloc/vmhdr.h create mode 100644 src/lib/libast/vmalloc/vmlast.c create mode 100644 src/lib/libast/vmalloc/vmmopen.c create mode 100644 src/lib/libast/vmalloc/vmopen.c create mode 100644 src/lib/libast/vmalloc/vmpool.c create mode 100644 src/lib/libast/vmalloc/vmprivate.c create mode 100644 src/lib/libast/vmalloc/vmprofile.c create mode 100644 src/lib/libast/vmalloc/vmregion.c create mode 100644 src/lib/libast/vmalloc/vmsegment.c create mode 100644 src/lib/libast/vmalloc/vmset.c create mode 100644 src/lib/libast/vmalloc/vmstat.c create mode 100644 src/lib/libast/vmalloc/vmstrdup.c create mode 100644 src/lib/libast/vmalloc/vmtrace.c create mode 100644 src/lib/libast/vmalloc/vmwalk.c create mode 100644 src/lib/libcmd/Mamfile create mode 100644 src/lib/libcmd/RELEASE create mode 100644 src/lib/libcmd/basename.c create mode 100644 src/lib/libcmd/cat.c create mode 100644 src/lib/libcmd/chgrp.c create mode 100644 src/lib/libcmd/chmod.c create mode 100644 src/lib/libcmd/chown.c create mode 100644 src/lib/libcmd/cksum.c create mode 100644 src/lib/libcmd/cmd.h create mode 100644 src/lib/libcmd/cmdinit.c create mode 100644 src/lib/libcmd/cmp.c create mode 100644 src/lib/libcmd/comm.c create mode 100644 src/lib/libcmd/cp.c create mode 100644 src/lib/libcmd/cut.c create mode 100644 src/lib/libcmd/date.c create mode 100644 src/lib/libcmd/dirname.c create mode 100644 src/lib/libcmd/expr.c create mode 100644 src/lib/libcmd/fds.c create mode 100644 src/lib/libcmd/features/ids create mode 100644 src/lib/libcmd/features/sockets create mode 100644 src/lib/libcmd/features/symlink create mode 100644 src/lib/libcmd/features/utsname create mode 100644 src/lib/libcmd/fmt.c create mode 100644 src/lib/libcmd/fold.c create mode 100644 src/lib/libcmd/fts_fix.c create mode 100644 src/lib/libcmd/fts_fix.h create mode 100644 src/lib/libcmd/getconf.c create mode 100644 src/lib/libcmd/head.c create mode 100644 src/lib/libcmd/id.c create mode 100644 src/lib/libcmd/join.c create mode 100644 src/lib/libcmd/lib.c create mode 100644 src/lib/libcmd/ln.c create mode 100644 src/lib/libcmd/logname.c create mode 100644 src/lib/libcmd/md5sum.c create mode 100644 src/lib/libcmd/mkdir.c create mode 100644 src/lib/libcmd/mkfifo.c create mode 100644 src/lib/libcmd/mktemp.c create mode 100644 src/lib/libcmd/mv.c create mode 100644 src/lib/libcmd/paste.c create mode 100644 src/lib/libcmd/pathchk.c create mode 100644 src/lib/libcmd/pids.c create mode 100644 src/lib/libcmd/rev.c create mode 100644 src/lib/libcmd/rev.h create mode 100644 src/lib/libcmd/revlib.c create mode 100644 src/lib/libcmd/rm.c create mode 100644 src/lib/libcmd/rmdir.c create mode 100644 src/lib/libcmd/stty.c create mode 100644 src/lib/libcmd/sum.c create mode 100644 src/lib/libcmd/sync.c create mode 100644 src/lib/libcmd/tail.c create mode 100644 src/lib/libcmd/tee.c create mode 100644 src/lib/libcmd/tty.c create mode 100644 src/lib/libcmd/uname.c create mode 100644 src/lib/libcmd/uniq.c create mode 100644 src/lib/libcmd/vmstate.c create mode 100644 src/lib/libcmd/wc.c create mode 100644 src/lib/libcmd/wc.h create mode 100644 src/lib/libcmd/wclib.c create mode 100644 src/lib/libdll/Mamfile create mode 100644 src/lib/libdll/RELEASE create mode 100644 src/lib/libdll/dlfcn.c create mode 100644 src/lib/libdll/dll_lib.c create mode 100644 src/lib/libdll/dllcheck.c create mode 100644 src/lib/libdll/dllerror.c create mode 100644 src/lib/libdll/dllfind.c create mode 100644 src/lib/libdll/dlllib.h create mode 100644 src/lib/libdll/dlllook.c create mode 100644 src/lib/libdll/dllnext.c create mode 100644 src/lib/libdll/dllopen.c create mode 100644 src/lib/libdll/dllplug.c create mode 100644 src/lib/libdll/dllscan.c create mode 100644 src/lib/libdll/features/dll create mode 100644 src/lib/libsum/Mamfile create mode 100644 src/lib/libsum/RELEASE create mode 100644 src/lib/libsum/features/sum create mode 100644 src/lib/libsum/sum-ast4.c create mode 100644 src/lib/libsum/sum-att.c create mode 100644 src/lib/libsum/sum-bsd.c create mode 100644 src/lib/libsum/sum-crc.c create mode 100644 src/lib/libsum/sum-lmd.c create mode 100644 src/lib/libsum/sum-md5.c create mode 100644 src/lib/libsum/sum-prng.c create mode 100644 src/lib/libsum/sum-sha1.c create mode 100644 src/lib/libsum/sum-sha2.c create mode 100644 src/lib/libsum/sum.h create mode 100644 src/lib/libsum/sumlib.c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..8da245115 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: [push] + +jobs: + + Linux: + name: Linux + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: bin/package make + - name: Regression tests + run: | + export TZ=UTC + ulimit -n 1024 + script -q -e -c "bin/shtests" diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..652d8f18f --- /dev/null +++ b/.gitignore @@ -0,0 +1,60 @@ +# Project-specific files +arch +tgz +lcl + +# Flat make libs, binaries, etc +/bin/.paths +/bin/ar +/bin/cc +/bin/crossexec +/bin/ditto +/bin/filter +/bin/hurl +/bin/iffe +/bin/ksh +/bin/mamake +/bin/mktest +/bin/ok/ +/bin/proto +/bin/pty +/bin/ratz +/bin/regress +/bin/release +/bin/rt +/bin/shcomp +/bin/suid_exec +/fun/ +/include/ +/lib/file/ +/lib/lib/ +/lib/libast.a +/lib/libcmd.a +/lib/libdll.a +/lib/libshell.a +/lib/libsum.a +/lib/make/ +/lib/package/gen/ +/lib/probe/ +/man/ + +# This one keeps changing its license header, causing git to show an +# uncommitted file. It's always re-copied anyway, and not for direct +# invocation, so exclude. The source file is: src/cmd/INIT/execrate.sh +bin/execrate + +# Miscellaneous artefacts +*.bak +*.sav +*.old +*.orig +.*.swp +*.DS_Store +*~ +.nfs* +*.tmp +*.rej +*.project +*.core +core +**/#*# diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..16cc69a52 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,87 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. diff --git a/NEWS b/NEWS new file mode 100644 index 000000000..bdea546ec --- /dev/null +++ b/NEWS @@ -0,0 +1,892 @@ +This documents significant changes in the 93u+m branch of AT&T ksh93. +For full details, see the git log at: https://github.com/ksh93/ksh + +Any uppercase BUG_* names are modernish shell bug IDs. + +2021-01-30: + +- The -x option to the 'command' built-in now causes it to bypass built-ins + so that it always runs/queries an external command. See 'command --man'. + +- Fixed a bug in 'command -x' that caused the minimum exit status to be 1 if + a command with many arguments was divided into several command invocations. + +- The 2020-08-16 fix is improved with a compile-time feature test that + detects if and how the OS uses data alignment in the arguments list, + maximising the efficiency of 'command -x' for the system it runs on. + +2021-01-24: + +- Fixed a bug in 'typeset': combining the -u option with -F or -E caused the + variable to become a hexadecimal floating point in error. + +- Fixed: an unquoted variable expansion evaluated in a DEBUG trap action caused + IFS field splitting to be deactivated in code executed after the trap action. + This bug was introduced in ksh 93t+ 2009-11-30. + +2021-01-23: + +- Fixed: when the DEBUG trap was redefined in a subshell, the DEBUG trap in + the parent environment was corrupted or the shell crashed. + When a redirection was used in a DEBUG trap action, the trap was disabled. + DEBUG traps were also incorrectly inherited by subshells and ksh functions. + All this was caused by a bug introduced in ksh 93t 2008-07-25. + +2021-01-22: + +- Compile-time shell options can now be edited in src/cmd/ksh93/SHOPT.sh + before building. + +2021-01-20: + +- Fixed: executing a DEBUG trap in a command substitution had side effects + on the exit status ($?) of non-trap commands. + This bug was introduced in ksh 93t 2008-11-04. + +- The typeset builtin command now gives an informative error message if an + incompatible combination of options is given. + +2021-01-19: + +- Fixed a crash when using 'cd' in a virtual/non-forking subshell in a + situation where the current working directory cannot be determined. + +2021-01-08: + +- Fixed a crash on exceeding the maximum size of the $PS1 prompt. + The maximum size is also increased from 160 to 256 bytes. + +2021-01-07: + +- Fixed a crash that could occur while ksh updated ${.sh.match}. + +- Any changes to the hash table (a.k.a. "tracked aliases", i.e. cached $PATH + searches) in a subshell now no longer affect the parent shell's hash table. + +2021-01-05: + +- Fixed a bug in 'cd' that caused 'cd ./foo' to search for 'foo' in $CDPATH. + +2021-01-03: + +- The invocation + $ ksh +s + caused an infinite loop and corrupted ~/.sh_history. This is now fixed so + that the '-s' option is automatically turned on if there are no non-option + command arguments, as documented in Bolsky & Korn (1995), p. 261. + +2020-10-22: + +- Fixed: 'typeset -F0', 'typeset -E0', and 'typeset -X0' floating point + numerics having a precision of 0 with variable assignment. + 'typeset -F0 x; x=4.56' worked but not 'typeset -F0 x=4.56'. + +2020-10-21: + +- Fixed: More concisely correct the exporting of uppercase and lowercase + variables when only the export and change case attributes were applied. + This fix improves upon the previous 2020-09-30 modifications. + +2020-10-06: + +- The security of virtual/non-forking subshells that locally change the present + working directory (PWD) using 'cd' has been improved in two ways. + 1. On entering a subshell, if the parent shell's PWD proves inaccessible upon + saving it, the subshell will now fork into a separate process so the + parent process never changes its PWD, avoiding the need to restore it. + 2. If some attack renders the parent shell's PWD unrestorable *after* ksh + enters a virtual subshell, ksh will now error out on exiting it, as + continuing would mean running arbitrary commands in the wrong PWD. + Hopefully this is an acceptable compromise between performance and security. + The proper fix would be to always fork a subshell when changing the working + directory within it, but the resulting slowdown would likely be unpopular. + +2020-09-30: + +- Fixed: 'typeset -xu' and 'typeset -xl' (export + change case) failed to + change the case of a variable's value in certain conditions. + +- A ksh 93u+ regression was fixed in the combination of ERR trap handling and + the 'pipefail' option. A pipeline now triggers the ERR trap correctly again + if the 'pipefail' option is active and any of the pipeline elements return a + nonzero exit status. Similarly, if both the 'errexit' and 'pipefail' options + are active, ksh now correctly exits if any pipeline element returns nonzero. + +- Autoloading a function no longer causes the calling script's $LINENO to be + off by the number of lines in the function definition file that was loaded. + This also corrects line numbers in warnings and error messages. + +2020-09-28: + +- While executing a ksh-style function, ksh 93u+ ignored all signals for which + the function had not set a local trap, except for SIGINT and SIGQUIT. This + was contrary to the manual, which states that a "trap condition that is not + caught or ignored by the function causes the function to terminate and the + condition to be passed on to the caller". This has now been fixed in 93u+m to + match the documentation, so that e.g. global traps work as expected again. + +2020-09-27: + +- The shell's lexical analysis of a 'case' statement within a do...done block + within a command substitution of the form $(...) has been fixed so that code + like the following no longer throws a spurious syntax error: + x=$(for i in 1; do case $i in word) true;; esac; done) + Previously, this required a leading parenthesis before 'word', although the + syntax error claimed that the ';;' was unexpected. + +2020-09-26: + +- 'whence -f' now completely ignores the existence of functions, as documented. + +- ksh now does not import environment variables whose names are not valid in + the shell language, as it would be impossible to change or unset them. + However, they stay in the environment to be passed to child processes. + +2020-09-25: + +- whence -v/-a now reports the path to the file that an "undefined" (i.e. + autoloadable) function will be loaded from when invoked, if found in $FPATH. + +- When ksh invoked a shell script that does not have a leading + #!/hashbang/path, 'ps' and /proc//cmdline showed corrupted output if + the new script's command line was shorter than that of the invoking script. + This has been fixed by wiping the arguments buffer correctly. + +2020-09-24: + +- An omission made it impossible to turn off brace expansion within command + substitutions (`...`, $(...) or ${ ...; }) as the code for parsing these + did not check the -B/braceexpand option. This check has now been added. + +2020-09-23: + +- Fixed a crash that could occur when running a pipeline containing + backtick-style command substitutions with job control enabled. + +- Fixed a crash that occurred when using 'typeset -u' or 'typeset -l' on a + special variable such as PATH, ENV or SHELL. + +2020-09-21: + +- A bug was fixed that caused command substitutions embedded in here-documents + to lose the output of the commands they ran. This bug occurred when ksh was + compiled with the SHOPT_SPAWN compile-time option. + +- Bugfix: var=$(< file) now reads the file even if the standard inout, standard + output and/or standard error file descriptors are closed. + +2020-09-20: + +- Bugfix: when whence -v/-a found an "undefined" (i.e. autoloadable) function + in $FPATH, it actually loaded the function as a side effect of reporting on + its existence. Now it only reports, as documented. + +- 'whence' will now canonicalise paths properly, resolving '.' and '..' + elements in paths given to it. It also no longer prefixes a spurious + double slash when doing something like 'cd / && whence bin/echo'. + +2020-09-18: + +- Setting the 'posix' option now turns off the 'braceexpand' option, as brace + expansion is not specified by POSIX and potentially incompatible with sh + scripts. In addition, 'set -o posix' now turns on the 'letoctal' option + instead of controlling that behaviour directly. 'set +o posix' does the + reverse of these. + +2020-09-17: + +- In the vi and emacs line editors, repeat count parameters can now also be + used for the arrow keys and the forward-delete key. E.g., in emacs mode, + 7 will now move the cursor seven positions to the left. + In vi control mode, this would be entered as: 7 . + +- When a background job on an interactive shell received SIGINT or SIGPIPE, the + job termination message was empty. It now shows "Interrupt" or "Broken Pipe". + +- The -m (-o monitor) option is no longer ignored when specified on the shell + invocation command line. + +- A script that is interrupted with Ctrl+C now terminates its background jobs + as expected, unless the -m (-o monitor) option was turned on. + +2020-09-14: + +- Corrected rounding of floating point values by ksh's printf %f formatting + operator. Fix contributed by @hyenias. + +- The forward-delete key now works as expected in emacs and vi editing modes. + +2020-09-11: + +- The 'command' regular builtin utility (which runs a simple command, removing + special properties) has been made fully POSIX compliant. + 1. The 'command' name can now result from an expansion (fixing BUG_CMDEXPAN), + e.g. 'c=command; "$c" ls' and 'set -- command ls; "$@"' now work. + 2. If and only if the POSIX mode (the new -o posix shell option) is active, + then the 'command' utility now disables not only "special" but also + "declaration" properties of builtin commands that it invokes, meaning: + a. arguments that start with a variable name followed by '=' are + always treated as regular words subject to normal shell syntax; + b. 'command' can now stop the shell from exiting if a command that it + invokes tries to modify a readonly variable (fixing BUG_CMDSPEXIT). + +- The 'history' (== 'hist -l') and 'r' (== 'hist -s') interactive shell + history commands have reverted to preset aliases and are now only loaded if + the shell is interactive and not initialised in POSIX mode. This avoids + unneeded conflicts with external commands by these names, particularly 'r'. + +2020-09-09: + +- Fixed BUG_LOOPRET2 and related bugs. The 'exit' and 'return' commands without + an argument now correctly default to passing down the exit status of the + last-run command. Tests like the following, in which the last-run command is + 'false', now correctly output 1 instead of 0: + fn() { return || true; }; false; fn; echo "$?" + fn() { while return; do true; done; }; false; fn; echo "$?" + fn() { for i in 1; do return; done; }; false; fn; echo "$?" + fn() { case 1 in 1) return ;; esac; }; false; fn; echo "$?" + fn() { { return; } 2>&1; }; false; fn; echo "$?" + +2020-09-05: + +- Fixed erroneous syntax errors in parameter expansions such as ${var:-wor)d} + or ${var+w(ord}. The parentheses now correctly lose their normal grammatical + meaning within the braces. Fix by Eric Scrivner backported from ksh2020. + +2020-09-04: + +- Fixed a bug that caused a syntax error to be thrown if the special parameter + expansions ${!} and ${$} (including braces) were used within a here-document. + Bug reported by @Saikiran-m on GitHub. + +2020-09-01: + +- The bash-style '&>file' redirection shorthand (for '>file 2>&1') is now + always recognised and not only when running rc/profile init scripts. It no + longer issues a warning. This brings ksh93 in line with mksh, bash and zsh. + +- A long-form shell option '-o posix' has been added, which implements a + mode for better compatibility with the POSIX standard. It is automatically + turned on if ksh is invoked under the name 'sh'. + For now, it: + * disables the &> redirection shorthand + * causes the 'let' arithmetic command to recognise octal numbers by + leading zeros regardless of the setting of the 'letoctal' option + * causes file descriptors > 2 to be left open when invoking another program + * makes the <> redirection operator default to stdin instead of stdout + (this keeps the 2020-05-13 BUG_REDIRIO fix for the POSIX mode while + restoring traditional ksh93 behaviour for backwards compatibility) + * disables a noncompliant 'test -t' == 'test -t 1' compatibility hack + * disables passing an exported variable's attributes (such as integer or + readonly) to a new ksh process through the environment + +2020-08-19: + +- Sped up the 'read' command on most systems by 15-25%. Fixed a hanging bug + on reading from a FIFO that could occur on macOS. + +2020-08-17: + +- 'command -p' incorrectly used the hash table entry (a.k.a. tracked alias) + for a command if its path was previously hashed. It has now been fixed so + it never consults the hash table. + +2020-08-16: + +- Fixed 'command -x' on macOS, Linux and Solaris by accounting for a 16-byte + argument alignment. If execution does fail, it now aborts with an internal + error message instead of entering an infinite retry loop. + +2020-08-13: + +- Fixed memory leaks and a crashing bug that occurred when defining and + running functions in subshells. + +2020-08-11: + +- Fixed an intermittent crash upon running a large number of subshells. + +2020-08-10: + +- A number of fixes have been applied to the printf formatting directives + %H and %#H (as well as the undocumented equivalents %(html)q and %(url)q): + 1. Both formatters have been made multibyte/UTF-8 aware, and no longer + delete multibyte characters. Invalid UTF-8 byte sequences are rendered + as ASCII question marks. + 2. %H no longer wrongly changes spaces to non-breaking spaces ( ). + 3. %H now converts the single quote (') to '%#39;' instead of ''' + which is not a valid entity in all HTML versions. + 4. %#H failed to encode some reserved characters (e.g. '?') while encoding + some unreserved ones (e.g. '~'). It now percent-encodes all characters + except those 'unreserved' as per RFC3986 (ASCII alphanumeric plus -._~). + +- Fixed a crash that occurred intermittently after running an external + command from a command substitution expanded from the $PS1 shell prompt. + +2020-08-09: + +- File name generation (a.k.a. pathname expansion, a.k.a. globbing) now + never matches the special navigational names '.' (current directory) and + '..' (parent directory). This change makes a pattern like .* useful; it + now matches all hidden files (dotfiles) in the current directory, without + the harmful inclusion of '.' and '..'. + +2020-08-08: + +- Argument checking in the 'redirect' builtin command (see 2020-06-11) has + been improved to error out before executing redirections. For example, an + error like 'redirect ls >foo.txt' now will not create 'foo.txt' and will + not leave your standard output permanently redirected to it. + +2020-08-06: + +- Added the '${.sh.pid}' variable as an alternative to Bash's '$BASHPID'. + This variable is set to the current shell's PID, unlike '$$' (which is + set to the parent shell's PID). In virtual subshells '${.sh.pid}' is not + changed from its previous value, while in forked subshells '${.sh.pid}' + is set to the subshell's process ID. + +2020-08-05: + +- Fixed a bug in functions that caused ksh to crash when an array with an + unset method was turned into a multidimensional array. + +- Fixed a bug that caused scripts to continue running after over-shifting + in a function when the function call had a redirection. + +- When generating shellquoted strings (such as with 'printf %q'), the + hexadecimal value of a quoted unprintable character was not protected with + square braces, e.g. 0x12 followed by '3' would be quoted as '\x123', which + is a different value. Such strings are now quoted like '\x[12]3' if the + next character is a hexadecimal digit. + +2020-07-31: + +- Fixed a bug that caused multidimensional associative arrays to be created + with an extra array member. + +- Fixed a bug that caused the expansions of positional parameters $1 - $9, + as well as special parameters such as $? and $-, to corrupt any multibyte + characters immediately following the expansion if a UTF-8 locale is active. + +2020-07-29: + +- On a ksh compiled to use fork(2) to run external commands, a bug has been + fixed that caused signals (such as SIGINT, Ctrl+C) to be ignored within a + non-forked subshell after running an external command within that subshell. + +2020-07-25: + +- Fixed BUG_MULTIBIFS: Multibyte characters can now be used as IFS + delimiters. "$*" was incorrectly joining positional parameters on + the first byte of a multibyte character. This was due to truncation + based on the incorrect assumption the IFS would never be larger + than a single byte. + +- Fixed a bug that caused the sleep builtin to continue after being given + an unrecognized option. 'sleep -: 1' will now show a usage message and + exit instead of sleep for one second. + +- Fixed a bug that caused the 'typeset' variable attributes -a, -A, -l, and + -u to leak out of a subshell if they were set without assigning a value. + +2020-07-23: + +- Fixed an infinite loop that could occur when ksh is the system's /bin/sh. + +- A command substitution that is run on the same line as a here-document + will no longer cause a syntax error. + +2020-07-22: + +- Fixed two race conditions when running external commands on + interactive shells with job control active. + +2020-07-20: + +- If a shell function and a built-in command by the same name exist, + 'whence -a' and 'type -a' now report both. + +- Fixed a bug that caused file descriptors opened with 'redirect' or 'exec' + to survive a subshell environment after exiting it. + +2020-07-19: + +- Fixed a crash that occurred in the '.' command when using kshdb. + +- Fixed a crash that occurred when attempting to use redirection with an + invalid file descriptor. + +2020-07-16: + +- The 'history' and 'r' default aliases have been made regular built-ins, + leaving zero default aliases. + +- Fixed a bug that caused 'sleep -s' to have no effect with intervals longer + than 30 seconds. + +- The accuracy of the sleep builtin has been improved. It no longer ignores + microseconds and doesn't add extra milliseconds when the interval is less + than 31 seconds. + +2020-07-15: + +- The 'autoload', 'compound', 'float', 'functions', 'integer' and 'nameref' + default aliases have been converted into regular built-in commands, so + that 'unalias -a' does not remove them. Shell functions can now use + these names, which improves compatibility with POSIX shell scripts. + +- The End key escape sequence '^[[F' is now handled in the emacs and vi editing + modes. The End key moves the cursor to the end of the line (in contrast to + the Home key doing the opposite). + +2020-07-14: + +- Fixed a bug that caused 'set -b' to have no effect. + +- Following the 'time' keyword, the 'times' builtin command now also + supports millisecond precision. + +2020-07-13: + +- Fixed a fork bomb that could occur when the vi editor was sent SIGTSTP + while running in a ksh script. + +- Appending a lone percent to the end of a format specifier no longer + causes a syntax error. The extra percent will be treated as a literal + '%', like in Bash and zsh. + +- The 'time' keyword now has proper support for millisecond precision. + Although this feature was previously documented, the 'time' keyword + only supported up to centisecond precision, which caused a command + like the one below to return '0.000' on certain operating systems: + $ TIMEFORMAT='%3R'; time sleep .003 + +- The 'time' keyword now zero-pads seconds less than ten (like mksh). + +2020-07-10: + +- Fixed a bug that caused types created with 'typeset -T' to throw an error + when used if the type name started with a lowercase 'a'. + +- A potential crash due to memory corruption when using many file + descriptors has been fixed. + +2020-07-09: + +- Fixed a crash on syntax error when sourcing/dotting multiple files. + +- Fixed a crash when listing indexed arrays. + +- Fixed a memory leak when restoring PATH when temporarily setting PATH + for a command (e.g. PATH=/foo/bar command ...) or in a virtual subshell. + +- Combining ((...)) with redirections no longer causes a syntax error + due to the parser handling '>' incorrectly. + +- Fixed a bug that corrupted KIA/CQL cross-reference databases created using + ksh's -R option; shell warnings were wrongly included in the database file. + +- The shell's quoting algorithm (used in xtrace, printf %q, and more) has been + fixed for UTF-8 (Unicode) locales; it no longer needlessly and inconsistently + encodes normal printable UTF-8 characters into hexadecimal \u[xxxx] codes. + +2020-07-07: + +- Four of the date formats accepted by 'printf %()T' have had their + functionality altered to the common behavior of date(1): + - '%k' and '%l' print the current hour with blank padding, the former + based on a 24-hour clock and the latter a twelve hour clock. These + are common extensions present on Linux and *BSD. + - '%f' prints a date with the format string '%Y.%m.%d-%H:%M:%S' (BusyBox). + - '%q' prints the quarter of the year (GNU). + +2020-07-06: + +- 'notty' is now written to the ksh auditing file instead of '(null)' if + the user's tty could not be determined. + +- Unsetting an associative array no longer causes a memory leak to occur. + +2020-07-05: + +- In UTF-8 locales, fix corruption of the shell's internal string quoting + algorithm (as used by xtrace, 'printf %q', and more) that occurred when + the processing of a multibyte character was interrupted. + +2020-07-03: + +- Backslashes are no longer escaped in the raw Bourne Shell-like editing + mode in multibyte locales, i.e. backslashes are no longer treated like + Control-V if the emacs and vi modes are disabled. + +- Deleting a backslash in vi mode with Control-H or Backspace now only + escapes a backslash if it was the previous input. This means erasing a + string such as 'ab\\\' will only cause the first backslash to escape a + Backspace as '^?', like in emacs mode. + +- An odd interaction with Backspace when the last character of a separate + buffer created with Shift-C was '\' has been fixed. '^?' will no longer + be output repeatedly when attempting to erase a separate buffer with + a Backspace. Note that buffers created with Shift-C are not meant to be + erasable: + https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html#tag_20_152_13_49 + +- The 'kill' builtin now supports the SIGINFO signal (on operating systems + with support for SIGINFO). + +2020-07-02: + +- Fixed a crash that occurred if a directory named '.paths' existed in any + directory listed in $PATH. The fix was to only read '.paths' if it is a + regular file or a symlink to a regular file. + +2020-06-30: + +- 'read -u' will no longer crash with a memory fault when given an out of + range or negative file descriptor. + +- The '=~' operator no longer raises an error if a regular expression + combines the '{x}' quantifier with a sub-expression. + +2020-06-28: + +- Variables created with 'typeset -RF' no longer cause a memory fault + when accessed. + +- Unsetting an array that was turned into a compound variable will no + longer cause silent memory corruption. + +- Variables created with 'readonly' in functions are now set to the + specified value instead of nothing. Note that 'readonly' does not + create a function-local scope, unlike 'typeset -r' which does. + +2020-06-26: + +- Changing to a directory that has a name starting with a '.' will no + longer fail if preceded by '../' (i.e. 'cd ../.local' will now work). + +2020-06-24: + +- Fixed buggy tab completion of tilde-expanded paths such as + ~/some in 'vi' mode. + +- In the raw/default Bourne Shell-like editing mode that occurs when neither + the 'emacs' nor the 'vi' shell option is active: + * tab completion is now correctly disabled, instead of enabled and broken; + * entering tab characters now moves the cursor the correct amount. + +2020-06-23: + +- Fixed a bug that caused combining process substitution with redirection + to create a bizarre file in the user's current working directory. + +- Using process substitution while the shell is interactive no longer + causes the process ID of the asynchronous process to be printed. + +2020-06-22: + +- The 'stop' and 'suspend' default aliases have been converted into regular + built-in commands, so that 'unalias -a' does not remove them, 'suspend' + can do a couple of sanity checks, and something like + cmd=stop; $cmd $! + will now work. See 'stop --man' and 'suspend --man' for more information. + +- Fixed a bug that caused the kill and stop commands to segfault when given + a non-existent job. + +- Nested functions no longer ignore variable assignments that were prefixed + to their parent function, i.e. 'VAR=foo func' will now set $VAR to 'foo' + in the scope of any nested function 'func' runs. + +2020-06-20: + +- Fixed a bug that caused setting the following variables as readonly in + a virtual subshell to affect the environment outside of the subshell: + $_ + ${.sh.name} + ${.sh.subscript} + ${.sh.level} + $RANDOM + $LINENO + +- Fixed two bugs that caused `unset .sh.lineno` to always produce a memory + fault and `(unset .sh.level)` to memory fault when run in nested + functions. + +2020-06-18: + +- A two decade old bug that caused 'whence -a' to base the path of + tracked aliases on the user's current working directory has been + fixed. Now the real path to tracked aliases is shown when '-a' is + passed to the whence command. + +2020-06-17: + +- A bug in 'unset -f' was fixed that prevented shell functions from + unsetting themselves while they were running. A POSIX function no longer + crashes when doing so, and a KornShell-style function no longer silently + ignores an 'unset -f' on itself. A function of either form now continues + running after unsetting itself, and is removed at the end of the run. + +2020-06-16: + +- Passing the '-d' flag to the read builtin will no longer cause the '-r' + flag to be discarded when 'read -r -d' is run. + +- Fix BUG_CMDSPASGN: preceding a "special builtin"[*] with 'command' now + prevents preceding invocation-local variable assignments from becoming global. + [*] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14 + +2020-06-15: + +- The 'source' alias has been converted into a regular built-in command. + +- Functions that set variables in a virtual subshell will no longer affect + variables of the same name outside of the virtual subshell's environment. + +- Terse usage messages written by builtin commands now point the user to + the --help and --man options for more information. + +2020-06-14: + +- 'read -S' is now able to correctly handle strings with double quotes + nested inside of double quotes. + +2020-06-13: + +- Fixed a timezone name determination bug on FreeBSD that caused the + output from `LC_ALL=C printf '%T' now` to print the wrong time zone name. + +2020-06-11: + +- Fixed a bug that caused running 'builtin -d' on a special builtin to + delete it. The man page for the 'builtin' command documents that special + builtins cannot be deleted. + +- POSIX compliance fix: It is now possible to set shell functions named + 'alias' or 'unalias', overriding the commands by the same names. In + technical terms, they are now regular builtins, not special builtins. + +- The redirect='command exec' alias has been converted to a regular + 'redirect' builtin command that only accepts I/O redirections, which + persist as in 'exec'. This means that: + * 'unlias -a' no longer removes the 'redirect' command; + * users no longer accidentally get logged out of their shells if + they type something intuitive but wrong, like 'redirect ls >file'. + +- The undocumented 'login' and 'newgrp' builtin commands have been removed. + These replaced your shell session with the external commands by the same + name, as in 'exec'. If an error occurred (e.g. due to a typo), you would + end up immediately logged out. + If you do want this behaviour, you can restore it by setting: + alias login='exec login' + alias newgrp='exec newgrp' + +2020-06-10: + +- The 'hash' utility is now a regular builtin instead of an alias to + 'alias -t --'. The functionality of the old command has been removed + from the alias builtin. + +- 'set +r' is no longer able to unset the restricted option. This change + makes the behavior of 'set +r' identical to 'set +o restricted'. + +2020-06-09: + +- The 'unalias' builtin will now return a non-zero status if it tries + to remove a previously set alias that is not currently set. + +2020-06-08: + +- Fix an issue with the up arrow key in Emacs editing mode. + Emacs editing mode is bugged in ksh93u+ and ksh2020. Let's + say you were to run the following commands after starting + a fresh instance of ksh: + $ alias foo='true' + $ unalias foo + If you type 'a' and then press the up arrow on your keyboard, + ksh will complete 'a' to `alias foo='true'` by doing a reverse + search for the last command that starts with 'a'. + Run the alias command again, then type 'u' and press the up + arrow key again. If ksh is in Vi mode, you will get `unalias foo`, + but in Emacs mode you will get `alias foo='true'` again. + All subsequent commands were ignored as ksh was saving the first + command and only based later searches off of it. + +- If 'set -u'/'set -o nounset' is active, then the shell now errors out if a + nonexistent positional parameter such as $1, $2, ... is accessed, as other + shells do and POSIX requires. (This does *not* apply to "$@" and "$*".) + +- If 'set -u'/'set -o nounset' is active, then the shell now errors out if $! + is accessed before the shell has launched any background process. + +- Removed support for an obscure early 1990s Bell Labs file system research + project called 3DFS, which has not existed for decades. This removes: + - an obnoxious default alias 2d='set -f;_2d' that turned off your file name + wildcard expansion and then tried to run a nonexistent '_2d' command + - undocumented builtins 'vmap' and 'vpath' that only printed error messages + - a non-functional -V unary operator for the test and [[ commands + +- If the last program run by a ksh script exits with a signal (e.g. crashed), + ksh itself now exits normally instead of repeating that same signal. + In addition, using 'exit x' for x > 256 no longer makes ksh issue a signal. + +2020-06-06: + +- The 'times' command is now a builtin command that conforms to POSIX + instead of an alias for the 'time' command. It displays the accumulated + user and system CPU times, one line with the times used by the shell and + another with those used by all of the shell's child processes. + https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_27 + +- The default aliases command='command ' and nohup='nohup ' have been + removed because they caused breakage in an attempt to circumvent other + breakage which is being fixed. In the unlikely even that anyone still + needs alias substitution to continue on the command argument following + 'command' or 'nohup', it's easy to set these aliases yourself. + +2020-06-05: + +- Fix a bug that caused special variables such as PATH, LANG, LC_ALL, + etc. to lose their effect after being unset in a subshell. For example: + (unset PATH; PATH=/dev/null; ls); : wrongly ran 'ls' + (unset LC_ALL; LC_ALL=badlocale); : failed to print a diagnostic + This also fixes BUG_KUNSETIFS: unsetting IFS in a subshell failed if IFS + was set to the empty value in the parent shell. + +- Fix crashes on some systems, including at least a crash in 'print -v' on + macOS, by eliminating an invalid/undefined use of memccpy() on overlapping + buffers in the commonly used sfputr() function. + +- Fix the ${.sh.subshell} level counter; it is no longer reset to zero when a + non-forked subshell happens to fork into a separate process for some reason + (an internal implementation detail that should be unnoticeable to scripts). + +2020-06-04: + +- Fix BUG_KBGPID: the $! special parameter was not set if a background job + (somecommand &) or co-process (somecommand |&) was launched as the only + command within a braces block with an attached redirection, for example: + { + somecommand & + } >&2 + With the bug, $! was unchanged; now it contains the PID of somecommand. + +2020-05-31: + +- Fix a bug in autoloading functions. Directories in the path search list + which should be skipped (e.g. because they don't exist) did not interact + correctly with autoloaded functions, so that a function to autoload was + not always found correctly. + Details: https://github.com/att/ast/issues/1454 + +2020-05-30: + +- Fix POSIX compliance of 'test'/'[' exit status on error. The command now + returns status 2 instead of 1 when given an invalid number or arithmetic + expression, e.g.: + [ 123 -eq 123x ]; echo $? + now outputs 2 instead of 1. + +2020-05-29: + +- Fix BUG_FNSUBSH: functions can now be correctly redefined and unset in + subshell environments (such as ( ... ), $(command substitutions), etc). + Before this fix, this was silently ignored, causing the function by the + same name from the parent shell environment to be executed instead. + fn() { echo mainsh; } + (fn() { echo subsh; }; fn); fn + This now correctly outputs "subsh mainsh" instead of "mainsh mainsh". + ls() { echo "ls executed"; } + (unset -f ls; ls); ls + This now correctly lists your directory and then prints "ls executed", + instead of printing "ls executed" twice. + +- Fix a similar bug with aliases. These can now be correctly unset + in subshell environments. + +2020-05-21: + +- Fix truncating of files with the combined redirections '<>;file' and + '<#pattern'. The bug was caused by out-of-sync streams. + Details and discussion: https://github.com/att/ast/issues/61 + +- Patched code injection vulnerability CVE-2019-14868. As a result, you can + no longer use expressions in imported numeric environment variables; only + integer literals are allowed. + +2020-05-20: + +- Fix BUG_ISSETLOOP. Expansions like ${var+set} remained static when used + within a 'for', 'while' or 'until' loop; the expansions din't change along + with the state of the variable, so they could not be used to check whether a + variable is set within a loop if the state of that variable changed in the + course of the loop. + +- Fix BUG_IFSISSET. ${IFS+s} always yielded 's', and [[ -v IFS ]] always + yielded true, even if IFS is unset. This applied to IFS only. + +2020-05-19: + +- Fix 'command -p'. The -p option causes the operating system's standard + utilities path (as output by 'getconf PATH') to be searched instead of $PATH. + Before this fix, this was broken on non-interactive shells as the internal + variable holding the default PATH value was not correctly initialised. + +2020-05-16: + +- Fix 'test -t 1', '[ -t 1 ]', '[[ -t 1 ]]' in command substitutions. + Standard output (file descriptor 1) tested as being on a terminal within a + command substitution, which makes no sense as the command substitution is + supposed to be catching standard output. + v=$(echo begincomsub + [ -t 1 ] && echo oops + echo endcomsub) + echo "$v" + This now does not output "oops". + +2020-05-14: + +- Fix syncing history when print -s -f is used. For example, the + following now correctly adds a 'cd' command to the history: + print -s -f 'cd -- %q\n' "$PWD" + Ref.: https://github.com/att/ast/issues/425 + https://github.com/att/ast/pull/442 + +- Fix BUG_PUTIOERR: Output builtins now correctly detect + input/output errors. This allows scripts to check for a nonzero exit + status on the 'print', 'printf' and 'echo' builtins and prevent possible + infinite loops if SIGPIPE is ignored. + +- Add a convenient bin/run_ksh_tests script to the source tree that + sets up the necessary environment and runs the ksh regression tests. + +2020-05-13: + +- Fix BUG_CASELIT: an undocumented 'case' pattern matching misbehaviour that + goes back to the original Bourne shell, but wasn't discovered until 2018. + If a pattern doesn't match as a pattern, it was tried again as a literal + string. This broke common validation use cases, e.g.: + n='[0-9]' + case $n in + ( [0-9] ) echo "$n is a number" ;; + esac + would output "[0-9] is a number" as the literal string fallback matches the + pattern. As this misbehaviour was never documented anywhere (not for Bourne, + ksh88, or ksh93), and it was never replicated in other shells (not even in + ksh88 clones pdksh and mksh), it is unlikely any scripts rely on it. + Of course, a literal string fallback, should it be needed, is trivial to + implement correctly without this breakage: + case $n in + ( [0-9] | "[0-9]") echo "$n is a number or the number pattern" ;; + esac + Ref.: https://github.com/att/ast/issues/476 + +- Fix BUG_REDIRIO: ksh used to redirect standard output by default when no + file descriptor was specified with the rarely used '<>' reading/writing + redirection operator. It now redirects standard input by default, as POSIX + specifies and as all other POSIX shells do. To redirect standard output + for reading and writing, you now need '1<>'. + Ref.: https://github.com/att/ast/issues/75 + http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_07 diff --git a/README.md b/README.md new file mode 100644 index 000000000..f2337accd --- /dev/null +++ b/README.md @@ -0,0 +1,211 @@ +![](https://github.com/ksh93/ksh/workflows/CI/badge.svg) + +# KornShell 93u+m + +This repository is used to develop bugfixes +to the last stable release (93u+ 2012-08-01) of +[ksh93](http://www.kornshell.com/), +formerly developed by AT&T Software Technology (AST). +The sources in this repository were forked from the +Github [AST repository](https://github.com/att/ast) +which is no longer under active development. + +For user-visible fixes, see [NEWS](https://github.com/ksh93/ksh/blame/master/NEWS) +and click on commit messages for full details. +For all fixes, see [the commit log](https://github.com/ksh93/ksh/commits/). +To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/issues). + +## Policy + +1. No new features; bug fixes only (but see items 3 and 4). + Feature development is for a future separate branch. +2. No major rewrites. No refactoring code that is not fully understood. +3. No changes in documented behaviour, except if required for compliance with the + [POSIX shell language standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html) + which David Korn [intended](http://www.kornshell.com/info/) for ksh to follow. +4. No 100% bug compatibility. Broken and undocumented behaviour gets fixed. +5. No bureaucracy, no formalities. Just fix it, or report it: create issues, + send pull requests. Every interested party is invited to contribute. +6. To help increase everyone's understanding of this code base, fixes and + significant changes should be fully documented in commit messages. +7. Code style varies somewhat in this historic code base. + Your changes should match the style of the code surrounding it. + Indent with tabs, assuming an 8-space tab width. + Comments always use `/*`...`*/`. +8. Good judgment may override this policy. + +## Why? + +Between 2017 and 2020 there was an ultimately unsuccessful +[attempt](https://github.com/att/ast/tree/2020.0.1) +to breathe new life into the KornShell by extensively refactoring the last +unstable AST beta version (93v-). +While that ksh2020 branch is now abandoned and still has many critical bugs, +it also had a lot of bugs fixed. More importantly, the AST issue tracker +now contains a lot of documentation on how to fix those bugs, which made +it possible to backport many of them to the last stable release instead. +This ksh 93u+m reboot now incorporates many of these bugfixes, as well as +many patches from Red Hat, Solaris, as well as new fixes from the community. +Though there are many bugs left to fix, we are confident at this point that +93u+m is already the least buggy branch of ksh93 ever released. + +## Build + +To build ksh with a custom configuration of features, edit +[`src/cmd/ksh93/SHOPT.sh`](https://github.com/ksh93/ksh/blob/master/src/cmd/ksh93/SHOPT.sh). + +Then `cd` to the top directory and run: +```sh +bin/package make +``` + +The compiled binaries are stored in the `arch` directory, in a subdirectory +that corresponds to your architecture. The command `bin/package host type` +outputs the name of this subdirectory. + +If you have trouble or want to tune the binaries, you may pass additional +compiler and linker flags. It is usually best to export these as environment +variables *before* running `bin/package` as they could change the name of +the build subdirectory of the `arch` directory, so exporting them is a +convenient way to keep them consistent between build and test commands. +**Note that this system uses `CCFLAGS` instead of the usual `CFLAGS`.** +An example that makes Solaris Studio cc produce a 64-bit binary: +```sh +export CCFLAGS="-xc99 -m64 -O" LDFLAGS="-m64" +bin/package make +``` +Alternatively you can append these to the command, and they will only be +used for that command. You can also specify an alternative shell in which +to run the build scripts this way. For example: +```sh +bin/package make SHELL=/bin/bash CCFLAGS="-O2 -I/opt/local/include" LDFLAGS="-L/opt/local/lib" +``` + +For more information run +```sh +bin/package help +``` +Many other commands in this repo self-document via the `--help`, `--man` and +`--html` options; those that do have no separate manual page. + +### Test + +After compiling, you can run the regression tests. +Start by reading the information printed by: +```sh +bin/shtests --man +``` + +### Install + +Automated installation is not supported. +To install manually: +```sh +cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/ +cp src/cmd/ksh93/sh.1 /usr/local/share/man/man1/ksh.1 +``` +(adapting the destination directories as required). + +## What is ksh93? + +The following is the official AT&T description from 1993 that came with the +ast-open distribution. The text is original, but hyperlinks were added here. + +---- + +KSH-93 is the most recent version of the KornShell Language described in +"The KornShell Command and Programming Language," by Morris Bolsky and David +Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. The KornShell is a shell +programming language, which is upward compatible with "sh" (the Bourne +Shell), and is intended to conform to the IEEE P1003.2/ISO 9945.2 +[Shell and Utilities standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html). +KSH-93 provides an enhanced programming environment in addition to the major +command-entry features of the BSD shell "csh". With KSH-93, medium-sized +programming tasks can be performed at shell-level without a significant loss +in performance. In addition, "sh" scripts can be run on KSH-93 without +modification. + +The code should conform to the +[IEEE POSIX 1003.1 standard](http://www.opengroup.org/austin/papers/posix_faq.html) +and to the proposed ANSI-C standard so that it should be portable to all +such systems. Like the previous version, KSH-88, it is designed to accept +eight bit character sets transparently, thereby making it internationally +compatible. It can support multi-byte characters sets with some +characteristics of the character set given at run time. + +KSH-93 provides the following features, many of which were also inherent in +KSH-88: + +* Enhanced Command Re-entry Capability: The KSH-93 history function records + commands entered at any shell level and stores them, up to a + user-specified limit, even after you log off. This allows you to re-enter + long commands with a few keystrokes - even those commands you entered + yesterday. The history file allows for eight bit characters in commands + and supports essentially unlimited size histories. +* In-line Editing: In "sh", the only way to fix mistyped commands is to + backspace or retype the line. KSH-93 allows you to edit a command line + using a choice of EMACS-TC or "vi" functions. You can use the in-line + editors to complete filenames as you type them. You may also use this + editing feature when entering command lines from your history file. A user + can capture keystrokes and rebind keys to customize the editing interface. +* Extended I/O Capabilities: KSH-93 provides several I/O capabilities not + available in "sh", including the ability to: + * specify a file descriptor for input and output + * start up and run co-processes + * produce a prompt at the terminal before a read + * easily format and interpret responses to a menu + * echo lines exactly as output without escape processing + * format output using printf formats. + * read and echo lines ending in "\\". +* Improved performance: KSH-93 executes many scripts faster than the System + V Bourne shell. A major reason for this is that many of the standard + utilities are built-in. To reduce the time to initiate a command, KSH-93 + allows commands to be added as built-ins at run time on systems that + support dynamic loading such as System V Release 4. +* Arithmetic: KSH-93 allows you to do integer arithmetic in any base from + two to sixty-four. You can also do double precision floating point + arithmetic. Almost the complete set of C language operators are available + with the same syntax and precedence. Arithmetic expressions can be used to + as an argument expansion or as a separate command. In addition there is an + arithmetic for command that works like the for statement in C. +* Arrays: KSH-93 supports both indexed and associative arrays. The subscript + for an indexed array is an arithmetic expression, whereas, the subscript + for an associative array is a string. +* Shell Functions and Aliases: Two mechanisms - functions and aliases - can + be used to assign a user-selected identifier to an existing command or + shell script. Functions allow local variables and provide scoping for + exception handling. Functions can be searched for and loaded on first + reference the way scripts are. +* Substring Capabilities: KSH-93 allows you to create a substring of any + given string either by specifying the starting offset and length, or by + stripping off leading or trailing substrings during parameter + substitution. You can also specify attributes, such as upper and lower + case, field width, and justification to shell variables. +* More pattern matching capabilities: KSH-93 allows you to specify extended + regular expressions for file and string matches. +* KSH-93 uses a hierarchal name space for variables. Compound variables can + be defined and variables can be passed by reference. In addition, each + variable can have one or more disciplines associated with it to intercept + assignments and references. +* Improved debugging: KSH-93 can generate line numbers on execution traces. + Also, I/O redirections are now traced. There is a DEBUG trap that gets + evaluated before each command so that errors can be localized. +* Job Control: On systems that support job control, including System V + Release 4, KSH-93 provides a job-control mechanism almost identical to + that of the BSD "csh", version 4.1. This feature allows you to stop and + restart programs, and to move programs between the foreground and the + background. +* Added security: KSH-93 can execute scripts which do not have read + permission and scripts which have the setuid and/or setgid set when + invoked by name, rather than as an argument to the shell. It is possible + to log or control the execution of setuid and/or setgid scripts. The + noclobber option prevents you from accidentally erasing a file by + redirecting to an existing file. +* KSH-93 can be extended by adding built-in commands at run time. In + addition, KSH-93 can be used as a library that can be embedded into an + application to allow scripting. + +Documentation for KSH-93 consists of an "Introduction to KSH-93", +"Compatibility with the Bourne Shell" and a manual page and a README file. +In addition, the "New KornShell Command and Programming Language" book is +available from Prentice Hall. diff --git a/TODO b/TODO new file mode 100644 index 000000000..aa6c8e839 --- /dev/null +++ b/TODO @@ -0,0 +1,36 @@ +TODO for AT&T ksh93, 93u+m bugfix branch + +See the issue tracker: +https://github.com/ksh93/ksh/issues + +______ +Fix regression test failures: + +- There are many regression test failures on NetBSD. + +______ +Fix build system: + +- ksh does not currently build on QNX. + +______ +Fix currently known bugs affecting shell scripting. These are identified by +their modernish IDs. For exact details, see code/comments in: +https://github.com/modernish/modernish/tree/0.16/lib/modernish/cap/ + +- BUG_BRACQUOT: shell quoting within bracket patterns has no effect. This + bug means the '-' retains it special meaning of 'character range', and an + initial ! (and, on some shells, ^) retains the meaning of negation, even + in quoted strings within bracket patterns, including quoted variables. + +- BUG_CSUBSTDO: If standard output (file descriptor 1) is closed before + entering a $(command substitution), and any other file descriptors are + redirected within the command substitution, commands such as 'echo' will + not work within the command substitution, acting as if standard output is + still closed. + +- BUG_IFSGLOBS: In glob pattern matching (as in case or parameter + substitution with # and %), if IFS starts with ? or * and the "$*" + parameter expansion inserts any IFS separator characters, those characters + are erroneously interpreted as wildcards when quoted "$*" is used as the + glob pattern. diff --git a/bin/Mamfile_indent b/bin/Mamfile_indent new file mode 100755 index 000000000..c67a2cd82 --- /dev/null +++ b/bin/Mamfile_indent @@ -0,0 +1,33 @@ +#!/usr/bin/env sh +IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches +let() { return $((!($1))); } + +# Automatically (re-)indent make...done blocks in a Mamfile. +# Usage: Mamfile_indent Mamfile.new +# +# Should work on all current POSIX compliant shells. +# By Martijn Dekker , 2021. Public domain. + +# Spacing per indentation level. Edit to change style. +indent=' ' # one tab + +# Remove existing indentation, add new indentation. +indentlvl=0 +sed 's/^[[:space:]]*//' \ +| while read -r line +do case $line in + '') continue ;; + done*) let "indentlvl -= 1" ;; + esac + + spc= + i=0 + while let "(i += 1) <= indentlvl" + do spc=$indent$spc + done + printf '%s\n' $spc$line + + case $line in + make*) let "indentlvl += 1" ;; + esac +done diff --git a/bin/ignore b/bin/ignore new file mode 100755 index 000000000..09611b70b --- /dev/null +++ b/bin/ignore @@ -0,0 +1,42 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# non-ksh script for the nmake ignore prefix +# @(#)ignore (AT&T Research) 1992-08-11 + +(command set -o posix) 2>/dev/null && set -o posix +modern_export=`v=; export v=ok 2>/dev/null; echo "$v"` + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $modern_export in + ok) export "$1" ;; + *) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" +exit 0 diff --git a/bin/mamprobe b/bin/mamprobe new file mode 100755 index 000000000..d3f513fc9 --- /dev/null +++ b/bin/mamprobe @@ -0,0 +1,273 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +### this script contains archaic constructs that work with all sh variants ### +# mamprobe - generate MAM cc probe info +# Glenn Fowler + +(command set -o posix) 2>/dev/null && set -o posix + +command=mamprobe + +bins=` + ( + userPATH=$PATH + PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH + getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH" + ) | sed 's/:/ /g' +` || exit + +# check the options + +opt= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: mamprobe (AT&T Labs Research) 2011-02-11 $ +] +[+NAME?mamprobe - generate MAM cc probe info] +[+DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1) + probe information for use by \bmamake\b(1). \acc-path\a is the + absolute path of the probed compiler and \ainfo-file\a is where + the information is placed. \ainfo-file\a is usually + \b$INSTALLROOT/lib/probe/C/mam/\b\ahash\a, where \ahash\a is a hash + of \acc-path\a. Any \ainfo-file\a directories are created if needed. + If \ainfo-file\a is \b-\b then the probe information is written to + the standard output.] +[+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of + \bpackage\b(1) installation before \bnmake\b(1) is built. The + probed variable names are the \bnmake\b(1) names with a \bmam_\b + prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b. + Additional variables are:]{ + [+_hosttype_?the \bpackage\b(1) host type] + [+mam_cc_L?\b-L\b\adir\a supported] + [+STDCAT?command to execute for \bcat\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCHMOD?command to execute for \bchmod\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCMP?command to execute for \bcmp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCP?command to execute for \bcp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDED?command to execute for \bed\b(1) or \bex\b(1)] + [+STDEDFLAGS?flags for \bSTDED\b] + [+STDLN?command to execute for \bln\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDMV?command to execute for \bmv\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDRM?command to execute for \brm\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] +} +[d:debug?Enable probe script debug trace.] + +info-file cc-path + +[+SEE ALSO?\bexecrate\b(1), \bpackage\b(1), \bmamake\b(1), \bnmake\b(1), + \bprobe\b(1)] +' + while getopts -a "$command" "$USAGE" OPT + do case $OPT in + d) opt=-d ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + -) break + ;; + -d) opt=-d + ;; + -*) echo $command: $1: unknown option >&2 + ;; + *) break + ;; + esac + set '' + break + done + ;; +esac + +# check the args + +case $1 in +-) ;; +/*) ;; +*) set '' ;; +esac +case $2 in +/*) ;; +*) set '' ;; +esac +case $# in +0|1) echo "Usage: $command info-file cc-path" >&2; exit 2 ;; +esac +info=$1 +shift +cc=$* + +# find the make probe script + +ifs=${IFS-' + '} +IFS=: +set $PATH +IFS=$ifs +script=lib/probe/C/make/probe +while : +do case $# in + 0) echo "$0: ../$script: probe script not found on PATH" >&2 + exit 1 + ;; + esac + case $1 in + '') continue ;; + esac + makeprobe=`echo $1 | sed 's,[^/]*$,'$script,` + if test -x $makeprobe + then break + fi + shift +done + +# create the info dir if necessary + +case $info in +/*) i=X$info + ifs=${IFS-' + '} + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $info in + //*) path=/ ;; + *) path= ;; + esac + while : + do case $# in + 0|1) break ;; + esac + comp=$1 + shift + case $comp in + '') continue ;; + esac + path=$path/$comp + if test ! -d $path + then mkdir $path || exit + fi + done + ;; +esac + +# generate info in a tmp file and rename when finished + +case $info in +-) ;; +*) tmp=${TMPDIR:-/tmp}/mam$$ + trap "exec >/dev/null; rm -f $tmp" 0 1 2 3 15 + exec > $tmp + echo "probing C language processor $cc for mam information" >&2 + ;; +esac + +echo "note generated by $0 for $cc" + +( + set '' $opt $cc + shift + . $makeprobe "$@" + + case " $CC_DIALECT " in + *" -L "*) echo "CC.L = 1" ;; + esac + +) | sed \ + -e '/^CC\./!d' \ + -e 's/^CC./setv mam_cc_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/ =//' \ + -e 's/\$("\([^"]*\)")/\1/g' \ + -e 's/\$(\([^)]*\))/${\1}/g' \ + -e 's/\${CC\./${mam_cc_}/g' + +echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}' + +# STD* are standard commands/flags with possible execrate(1) + +if ( +ed < /dev/null 2>&1 +then STDED=ed +else STDED=ex +fi +STDEDFLAGS=- +set STDCAT cat STDCHMOD chmod STDCMP cmp STDCP cp STDLN ln STDMV mv STDRM rm +while : +do case $# in + 0|1) break ;; + esac + p=$2 + for d in $bins + do if test -x $d/$p + then p=$d/$p + break + fi + done + eval $1=\$p + shift + shift +done +if execrate +then for n in STDCAT STDCHMOD STDCMP STDCP STDLN STDMV STDRM + do eval $n=\"execrate \$$n\" + done +fi +for n in STDCAT STDCHMOD STDCMP STDCP STDED STDEDFLAGS STDLN STDMV STDRM +do eval echo setv \$n \$$n +done + +# all done + +case $info in +-) ;; +*) exec >/dev/null + test -f "$info" && rm -f "$info" + cp "$tmp" "$info" + chmod -w "$info" + ;; +esac diff --git a/bin/package b/bin/package new file mode 100755 index 000000000..0d57a3bfa --- /dev/null +++ b/bin/package @@ -0,0 +1,7429 @@ +USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +### this script contains archaic constructs that work with all sh variants ### +# package - source and binary package control +# Glenn Fowler + +command=package + +(command set -o posix) 2>/dev/null && set -o posix +path=Bad +case $PATH in +Bad*) echo "Cannot be run by zsh in native mode; use a sh symlink to zsh" >&2 + exit 1 ;; +esac + +unset CDPATH +case $0 in +-*) + echo "dodgy \$0: $0" >&2 + exit 1 ;; +*/package) + mydir=`echo "$0" | sed 's,/package$,,'` + cd "$mydir" || exit + case $PWD in + */bin) ;; + *) echo "this script must live in bin/" >&2 + exit 1 ;; + esac + cd .. || exit + unset mydir ;; +package) + echo "this script must be invoked with a direct path, e.g. bin/package" >&2 + exit 1 ;; +*) + echo "this script must be named 'package'" >&2 + exit 1 ;; +esac + +# shell checks +checksh() +{ + "$1" -ec ' + # reject csh + case 1 in + 1) ;; + esac + # reject special use of $path (to use zsh, use a "sh -> zsh" symlink, which disables this) + path=Bad + case $PATH in + Bad*) exit 1 ;; + esac + # catch (our own) pipe/socket configuration mismatches + date | "$1" -c "read x" || exit 1 + # check Bourne/POSIX compatible trap exit status (should exit with status 0) + trap "exit 0" 0 + exit 1 + ' x "$1" 2>/dev/null || return 1 +} + +LC_ALL=C +export LC_ALL + +TMPDIR=${TMPDIR:-/tmp} +export TMPDIR + +src="cmd contrib etc lib" +use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" +usr="/home" +lib="" # nee /usr/local/lib /usr/local/shlib +ccs="/usr/kvm /usr/ccs/bin" +org="gnu GNU" +makefiles="Mamfile" # ksh 93u+m no longer uses these: Nmakefile nmakefile Makefile makefile +env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH" +checksum=md5sum +checksum_commands="$checksum md5" +checksum_empty="d41d8cd98f00b204e9800998ecf8427e" + +package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' + +PACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"} + +CROSS=0 + +admin_db=admin.db +admin_env=admin.env +admin_ditto="ditto --checksum --delete --verbose" +admin_ditto_update=--update +admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*" +admin_list='PACKAGE.$type.lst' +admin_ping="ping -c 1 -w 5" + +default_url=default.url +MAKESKIP=${MAKESKIP:-"*[-.]*"} +RATZ=ratz +SED= +TAR=tar +TARFLAGS=xv +TARPROBE=B +TR= + +all_types='*.*|sun4' # all but sun4 match *.* + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: package (AT&T Research) 2012-06-28 $ +]'$USAGE_LICENSE$' +[+NAME?package - source and binary package control] +[+DESCRIPTION?The \bpackage\b command controls source and binary + packages. It is a \bsh\b(1) script coded for maximal portability. All + package files are in the \b$PACKAGEROOT\b directory tree. + \b$PACKAGEROOT\b must at minimum contain a \bbin/package\b command or a + \blib/package\b directory. Binary package files are in the + \b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where + \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b + require the current directory to be under \b$PACKAGEROOT\b. See + \bDETAILS\b for more information.] +[+?Note that no environment variables need be set by the user; + \bpackage\b determines the environment based on the current working + directory. The \buse\b action starts a \bsh\b(1) with the environment + initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set + by explicit command argument assignments to override the defaults.] +[+?Packages are composed of components. Each component is built and + installed by an \bast\b \bnmake\b(1) makefile. Each package is also + described by an \bnmake\b makefile that lists its components and + provides a content description. The package makefile and component + makefiles provide all the information required to read, write, build + and install packages.] +[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and + install source packages, and \bsh\b to install binary packages. + \bnmake\b and \bksh93\b are required to write new packages. An + \b$INSTALLROOT/bin/cc\b script may be supplied for some architectures. + This script supplies a reasonable set of default options for compilers + that accept multiple dialects or generate multiple object/executable + formats.] +[+?The command arguments are composed of a sequence of words: zero or + more \aqualifiers\a, one \aaction\a, and zero or more action-specific + \aarguments\a, and zero or more \aname=value\a definitions. \apackage\a + names a particular package. The naming scheme is a \b-\b separated + hierarchy; the leftmost parts describe ownership, e.g., + \bgnu-fileutils\b, \bast-base\b. If no packages are specified then all + packages are operated on. \boptget\b(3) documentation options are also + supported. The default with no arguments is \bhost type\b.] +[+?The qualifiers are:] + { + [+authorize \aname\a?Remote authorization user name or license + acceptance phrase.] + [+debug|environment?Show environment and actions but do not + execute.] + [+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto + \b$PACKAGEROOT\b.] + [+force?Force the action to override saved state.] + [+never?Run make -N and show other actions.] + [+only?Only operate on the specified packages.] + [+password \apassword\a?Remote authorization or license + acceptance password.] + [+quiet?Do not list captured action output.] + [+show?Run make -n and show other actions.] + [+verbose?Provide detailed action output.] + [+DEBUG?Trace the package script actions in detail.] + } +[+?The actions are:] + { + [+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply + \aaction\a ... to the hosts listed in \afile\a. If \afile\a is + omitted then \badmin.db\b is assumed. The caller must have + \brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access + to the hosts. Output for \aaction\a is saved per-host in the + file \aaction\a\b.log/\b\ahost\a. Logs can be viewed by + \bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]]. + By default only local PACKAGEROOT hosts are selected from + \afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects + only hosts matching the \b|\b separated \apattern\a. \afile\a + contains four types of lines. Blank lines and lines beginning + with \b#\b are ignored. Lines starting with \aid\a=\avalue\a + are variable assignments. Set admin_ping to local conventions + if \"'$admin_ping$'\" fails. If a package list is not specified + on the command line the \aaction\a applies to all packages; a + variable assignment \bpackage\b=\"\alist\a\" applies \aaction\a + to the packages in \alist\a for subsequent hosts in \afile\a. + The remaining line type is a host description consisting of 6 + tab separated fields. The first 3 are mandatory; the remaining + 3 are updated by the \badmin\b action. \afile\a is saved in + \afile\a\b.old\b before update. The fields are:] + { + [+hosttype?The host type as reported by + \"\bpackage\b\".] + [+[user@]]host?The host name and optionally user name + for \brcp\b(1) and \brsh\b(1) access.] + [+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package + root directory and optionally the remote protocol (rsh + or ssh) if the directory is on a different server than + the master package root directory. If + \blib/package/admin/'$admin_env$'\b exists under this + directory then it is sourced by \bsh\b(1) before + \aaction\a is done. If this field begins with \b-\b + then the host is ignored. If this field contains \b:\b + then \bditto\b(1) is used to sync the remote \bsrc\b + directory hierarchy to the local one. If [\amaster\a]]: + is specified then the sync is deferred to the \amaster\a + host. If \amaster\a is omitted (two :) then the sync is + disabled. These directories must exist on the remote side: + \blib/package\b, \bsrc/cmd\b, \bsrc/lib\b.] + [+date?\aYYMMDD\a of the last action.] + [+time?Elapsed wall time for the last action.] + [+M T W?The \badmin\b action \bmake\b, \btest\b and + \bwrite\b action error counts. A non-numeric value in + any of these fields disables the corresponding action.] + [+owner?The owner contact information.] + [+attributes?\aname=value\a attributes. Should at least contain + \bcc\b=\acompiler-version\a.] + } + [+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this + deletes all generated files and directories for \aHOSTTYPE\a. + The hierarchy can be rebuilt by \bpackage make\b.] + [+contents\b [ \apackage\a ... ]]?List description and + components for \apackage\a on the standard output.] + [+copyright\b [ \apackage\a ... ]]?List the general copyright + notice(s) for \apackage\a on the standard output. Note that + individual components in \apackage\a may contain additional or + replacement notices.] + [+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for + \avariable\a, one per line. If the \bonly\b attribute is + specified then only the variable values are listed. If no + variables are specified then \b'$env$'\b are assumed.] + [+help\b [ \aaction\a ]]?Display help text on the standard + error (standard output for \aaction\a).] + [+host\b [ \aattribute\a ... ]]?List + architecture/implementation dependent host information on the + standard output. \btype\b is listed if no attributes are + specified. Information is listed on a single line in + \aattribute\a order. The attributes are:] + { + [+canon \aname\a?An external host type name to be + converted to \bpackage\b syntax.] + [+cpu?The number of cpus; 1 if the host is not a + multiprocessor.] + [+name?The host name.] + [+rating?The cpu rating in pseudo mips; the value is + useful useful only in comparisons with rating values of + other hosts. Other than a vax rating (mercifully) fixed + at 1, ratings can vary wildly but consistently from + vendor mips ratings. \bcc\b(1) may be required to + determine the rating.] + [+type?The host type, usually in the form + \avendor\a.\aarchitecture\a, with an optional trailing + -\aversion\a. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. OS point release information is + avoided as much as possible, but vendor resistance to + release incompatibilities has for the most part been + futile.] + } + [+html\b [ \aaction\a ]]?Display html help text on the standard + error (standard output for \aaction\a).] + [+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy + the package binary hierarchy to \adirectory\a. If + \aarchitecture\a is omitted then all architectures are + installed. If \bflat\b is specified then exactly one + \aarchitecture\a must be specified; this architecture will be + installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a + directory prefixes. Otherwise each architecture will be + installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of + \adirectory\a. The \aarchitecture\a \b-\b names the current + architecture. \adirectory\a must be an existing directory. If + \apackage\a is omitted then all binary packages are installed. + This action requires \bnmake\b.] + [+license\b [ \apackage\a ... ]]?List the source license(s) for + \apackage\a on the standard output. Note that individual + components in \apackage\a may contain additional or replacement + licenses.] + [+list\b [ \apackage\a ... ]]?List the name, version and + prerequisites for \apackage\a on the standard output.] + [+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build + and install. The default \atarget\a is \binstall\b, which makes + and installs \apackage\a. If the standard output is a terminal + then the output is also captured in + \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in + the \b$INSTALLROOT\b directory tree viewpathed on top of the + \b$PACKAGEROOT\b directory tree. If \bflat\b is specified then + the \b$INSTALLROOT\b { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be \bflat\b. Leaf directory names matching the + \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The + \bview\b action is done before making. \aoption\a operands are + passed to the underlying make command.] + [+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named + package or archive(s). Must be run from the package root + directory. Archives are searched for in \b.\b and + \blib/package/tgz\b. Each package archive is read only once. + The file \blib/package/tgz/\b\apackage\a[.\atype\a]]\b.tim\b + tracks the read time. See the \bwrite\b action for archive + naming conventions. Text file archive member are assumed to be + ASCII or UTF-8 encoded.] + [+regress?\bdiff\b(1) the current and previous \bpackage test\b + results.] + [+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display + recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to + [\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.) + If no dates are specified then changes for the last 4 months + are listed. \apackage\a may be a package or component name.] + [+remove\b [ \apackage\a ]]?Remove files installed for + \apackage\a.] + [+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List + results and interesting messages captured by the most recent + \bmake\b (default), \btest\b or \bwrite\b action. \bold\b + specifies the previous results, if any (current and previous + results are retained.) \b$HOME/.pkgresults\b, if it exists, + must contain an \begrep\b(1) expression of result lines to be + ignored. \bfailed\b lists failures only and \bpath\b lists the + results file path name only.] + [+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This + action initializes the current directory as a package root, runs the + \bupdate\b action to download new or out of date packages, and runs the + \bread\b action on those packages. If \bflat\b is specified then the + \b$INSTALLROOT\b { bin fun include lib } directories are linked to the + same directories in the package root. Only one architecture may be + \bflat\b. See the \bupdate\b and \bread\b action descriptions for + argument details.] + [+test\b [ \apackage\a ]]?Run the regression tests for + \apackage\a. If the standard output is a terminal then the + output is also captured in + \b$INSTALLROOT/lib/package/gen/test.out\b. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If \bonly\b is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested.] + [+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download + the latest release of the selected and required packages from \aurl\a + (e.g., \bhttp://www.research.att.com/sw/download\b) into the directory + \b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b accesses beta packages; + download these at your own risk. If \aarchitecture\a is omitted then + only architectures already present in the \btgz\b directory will be + downloaded. If \aarchitecture\a is \b-\b then all posted architectures + will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted + as a file containing shell variable assignments for \burl\b, + \bauthorize\b and \bpassword\b. If \aurl\a is omitted then the + definitions for \burl\b, \bauthorize\b and \bpassword\b in + \b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used. + If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it + is initialized with the current \burl\b, \bauthorize\b and \bpassword\b + values and read permission for the current user only. If \apackage\a is + omitted then only packages already present in the tgz directory will be + downloaded. If \apackage\a is \b-\b then all posted packages will be + downloaded. If \bsource\b and \bbinary\b are omitted then both source + and binary packages will be downloaded. If \bonly\b is specified then + only the named packages are updated; otherwise the closure of required + packages is updated. This action requires \bwget\b(1), \blynx\b(1), + \bcurl\b(1) or a shell that supports io to + \b/dev/tcp/\b\ahost\a/\aport\a.] + [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run + \acommand\a, or an interactive shell if \acommand\a is omitted, + with the environment initialized for using the package (can you + say \ashared\a \alibrary\a or \adll\a without cussing?) If + \auid\a or \apackage\a or \a.\a is specified then it is used + to determine a \b$PACKAGEROOT\b, possibly different from + the current directory. For example, to try out bozo`s package: + \bpackage use bozo\b. The \buse\b action may be run from any + directory. If the file \b$INSTALLROOT/lib/package/profile\b is + readable then it is sourced to initialize the environment. 32 or 64 + implies \b$PACKAGEROOT\b of . and specifies the target architecture + word size (which may be silently ignored.)] + [+verify\b [ \apackage\a ]]?Verify installed binary files + against the checksum files in + \b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum + files contain mode, user and group information. If the checksum + matches for a given file then the mode, user and group are + changed as necessary to match the checksum entry. A warning is + printed on the standard error for each mismatch. Requires the + \bast\b package \bcksum\b(1) command.] + [+view\b?Initialize the architecture specific viewpath + hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b { + bin fun include lib } directories are linked to the same + directories in the package root. Only one architecture may be + \bflat\b. The \bmake\b action implicitly calls this action.] + [+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write + a package archive for \apackage\a. All work is done in the + \b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific + files are placed in the \aformat\a subdirectory. A + \apackage\a[.\atype\a]]\b.tim\b file in this directory tracks + the write time and prevents a package from being read in the + same root it was written. If more than one file is generated + for a particular \aformat\a then those files are placed in the + \aformat\a/\apackage\a subdirectory. File names in the + \aformat\a subdirectory will contain the package name, a + \ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If + \apackage\a is omitted then an ordered list of previously + written packages is generated. If \bonly\b is specified then + only the named packages will be written; otherwise prerequisite + packages are written first. Package components must be listed + in \apackage\a\b.pkg\b. \aformat\a may be one of:] + { + [+cyg?Generate a \bcygwin\b package.] + [+exp?Generate an \bexptools\b maintainer source + archive and \aNPD\a file, suitable for \bexpmake\b(1)] + [+lcl?Generate a package archive suitable for + restoration into the local source tree (i.e., the + source is not annotated for licencing.)] + [+pkg?Generate a \bpkgmk\b(1) package suitable for + \bpkgadd\b(1).] + [+rpm?Generate an \brpm\b(1) package.] + [+tgz?Generate a \bgzip\b(1) \btar\b(1) package + archive. This is the default.] + [+tst?Generate a \btgz\b format package archive in the + \btst\b subdirectory. Version state files are not updated.] + } + [+?\btype\b specifies the package type which must be one of + \bsource\b, \bbinary\b or \bruntime\b. A source package + contains the source needed to build the corresponding binary + package. A binary package includes the libraries and headers + needed for compiling and linking against the public interfaces. + A runtime package contains the commands and required dynamic + libraries.] + [+?A package may be either a \bbase\b or \bdelta\b. A base + package contains a complete copy of all components. A delta + package contains only changes from a previous base package. + Delta recipients must have the \bast\b \bpax\b(1) command (in + the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is + specified, then the current base is overwritten if there are no + deltas referring to the current base. Only the \btgz\b and + \blcl\b formats support \bdelta\b. If \bbase\b is specified + then a new base and two delta archives are generated: one delta + to generate the new base from the old, and one delta to + generate the old base from the new; the old base is then + removed. If \bdelta\b is specified then a new delta referring + to the current base is written.] + [+?\apackage\a\b.pkg\b may reference other packages. By default + a pointer to those packages is written. The recipient \bpackage + read\b will then check that all required packages have been + downloaded. If \bclosure\b is specified then the components for + all package references are included in the generated package. + This may be useful for \blcl\b and versioning.] + [+?All formats but \blcl\b annotate each \bsource\b file (not + already annotated) with a license comment as it is written to + the package archive using \bproto\b(1).] + } +[+DETAILS?The package directory hierarchy is rooted at + \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two + level viewpath is used to separate source and binaries. The top view is + architecture specific, the bottom view is shared source. All building + is done in the architecture specific view; no source view files are + intentionally changed. This means that many different binary + architectures can be made from a single copy of the source.] +[+?Independent \b$PACKAGEROOT\b hierarchies can be combined by + appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The + \bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b + must have a \b$PACKAGEROOT/lib/package\b directory.] +[+?Each package contains one or more components. Component source for + the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source + for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This + naming is for convenience only; the underlying makefiles handle + inter-component build order. The \bINIT\b component, which contains + generic package support files, is always made first, then the + components named \bINIT\b*, then the component order determined by the + closure of component makefile dependencies.] +[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The + package naming convention is \agroup\a[-\apart\a]]; e.g., \bast-base\b, + \bgnu-fileutils\b. The *\b.pkg\b files are ast \bnmake\b(1) makefiles + that contain the package name, package components, references to other + packages, and a short package description. *\b.pkg\b files are used by + \bpackage write\b to generate new source and binary packages.] +[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license + information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1) + commands to generate source and binary license strings. \agroup\a is + determined by the first \b:PACKAGE:\b operator name listed in the + component \bnmake\b makefile. \agroup\a\b.lic\b files are part of the + licensing documentation. Each component may have its own \bLICENSE\b file + that overrides the \agroup\a\b.lic\b file. The full text of the licenses + are in the \b$PACKAGEROOT/lib/package/LICENSES\b and + \b$INSTALLROOT/lib/package/LICENSES\b directories.] +[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and + \b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line + consisting of \apackage version release\a \b1\b for the most recent + instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a + is the package name, \aversion\a is the \aYYYY-MM-DD\a base version, + and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a + for delta releases. \apackage\a\b.req\b contains *\b.ver\b entries for + the packages required by \apackage\a, except that the fourth field is + \b0\b instead of \b1\b. All packages except \bINIT\b require the + \bINIT\b package. A simple sort of \apackage\a\b.pkg\b and *\b.ver\b + determines if the required package have been read in. Finally, + \apackage\a\b.README\b and \apackage\a\a.html\b contain the README text + for \apackage\a and all its components. Included are all changes added + to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated + since the two most recent base releases. Component \bRELEASE\b files + contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or + \bdate\b(1) format dates) followed by README text, in reverse + chronological order (newer entries at the top of the file.) \bpackage + release\b lists this information, and \bpackage contents ...\b lists + the descriptions and components.] +[+?\b$HOSTYPE\b names the current binary architecture and is determined + by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming + scheme is used to separate incompatible executable and object formats. + All architecture specific binaries are placed under \b$INSTALLROOT\b + (\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match + against \b$HOSTTYPE\b when making binaries; these are limited to + makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b + then turn off the optimizer for these objects. All other architecture + dependent logic is handled either by the \bast\b \biffe\b(1) command or + by component specific configure scripts. Explicit \b$HOSTYPE\b + values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and + \bCCFLAGS\b. This is handy for build farms that support different + compilers on the same architecture.] +[+?Each component contains an \bast\b \bnmake\b(1) makefile (either + \bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine) + file (\bMamfile\b.) A Mamfile contains a portable makefile description + that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is + no support for old-make/gnu-make makefiles; if the binaries are just + being built then \bmamake\b will suffice; if source or makefile + modifications are anticipated then \bnmake\b (in the \bast-base\b + package) should be used. Mamfiles are automatically generated by + \bpackage write\b.] +[+?Most component C source is prototyped. If \b$CC\b (default value + \bcc\b) is not a prototyping C compiler then \bpackage make\b runs + \bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places + the converted output files in the \b$PACKAGEROOT/proto/src\b tree. + Converted files are then viewpathed over the original source. + \bproto\b(1) converts an ANSI C subset to code that is compatible with + K&R, ANSI, and C++ dialects.] +[+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b + relative pathnames (via the \bast\b \bpathpath\b(3) function); there + are no embedded absolute pathnames. This means that binaries generated + under \b$PACKAGEROOT\b may be copied to a different root; users need + only change their \b$PATH\b variable to reference the new installation + root \bbin\b directory. \bpackage install\b installs binary packages in + a new \b$INSTALLROOT\b.] + +[ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + +[+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1), + \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1), + \bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1), + \bsh\b(1), \btar\b(1), \boptget\b(3)] +' + case $* in + help) set -- --man ;; + esac + while getopts -a $command "$USAGE" OPT + do : + done + shift $OPTIND-1 + ;; +esac + +# check the args + +case $AR in +'') AR=ar ;; +esac +case $CC in +'') CC=cc ;; +esac +case $LD in +'') LD=ld ;; +esac +case $NM in +'') NM=nm ;; +esac + +action= +admin_all=1 +admin_on= +authorize= +bit= +exec= +flat=0 +force=0 +global= +hi= +html=0 +ifs=${IFS-' + '} +lo= +make= +makeflags='-K' +nmakeflags= +nmakesep= +nl=" +" +noexec= +only=0 +output= +package_src= +password= +quiet=0 +show=: +tab=" " +verbose=0 +AUTHORIZE= +DEBUG= +HURL= +PROTOROOT=- +SHELLMAGIC=- + +unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true + +while : +do case $# in + 0) set host type ;; + esac + case $1 in + admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST) + action=$1 + shift + break + ;; + authorize) + case $# in + 1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;; + esac + shift + authorize=$1 + shift + continue + ;; + debug|environment) + exec=echo make=echo show=echo + ;; + flat) flat=1 + ;; + force) force=1 + ;; + never) exec=echo noexec=-N + ;; + only) only=1 + ;; + password) + case $# in + 1) echo $command: $1: authorization password argument expected >&2; exit 1 ;; + esac + shift + password=$1 + shift + continue + ;; + quiet) quiet=1 + ;; + show) exec=echo noexec=-n + ;; + verbose)verbose=1 + ;; + DEBUG) DEBUG=1 + PS4='+$LINENO:$SECONDS+ ' + set -x + ;; + help|HELP|html|man|--[?m]*) + case $1 in + help) code=0 + case $2 in + '') exec 1>&2 ;; + esac + ;; + html) code=0 html=1 + ;; + *) code=2 + exec 1>&2 + ;; + esac + case $html in + 1) bO=" + +$2 package installation instructions + +" + eO=' +' + bH="

" + eH='

' + bP='

' + bL='

' + bL2='

' + eL='

' + bT='' + bD='' eD='' + bB='' eB='' + bI='' eI='' + bX='

'			eX='
' + bF='' eF='' + Camp='&' + Mcurl='curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + *) bO='' eO='' + bH='' eH=':' + bP='' + bL='' eL='' + bL2='' + bT=' ' + bD=' ' eD='' + bB='' eB='' + bI='' eI='' + bX='' eX='' + bF='"' eF='"' + Camp='&' + Mcurl='curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + esac + case $2 in + binary) echo "${bO} +${bH}Binary Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages.${eD} +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup binary \$URL ${bI}PACKAGE${eI} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + binary package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup binary${eX}${eD} +${bT}(6)${bD}The packaged binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(7)${bD}You can run the binaries directly from the package root, or you can + install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest + binary release is:${bX} + bin/package setup binary${eX}${eD}${eL} + +${bH}Binary Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + binary package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz | + ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + binary package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD.HOSTTYPE${eI}.exe bin/ratz + chmod +x bin/ratz + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD/HOSTTYPE${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + intro) echo "${bO} +${bH}Package Hierarchy Details${eH} +${bP} +The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and +binaries reside under this tree. A two level viewpath is used to separate +source and binaries. The top view is architecture specific, the bottom view +is shared source. All building is done in the architecture specific view; +no source view files are intentionally changed. This means that many +different binary architectures can be made from a single copy of the source. +${bP} +Each package contains one or more components. Component source for the ${bI}FOO${eI} +command is in ${bB}\$PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is +in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the +underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component, +which contains generic package support files, is always made first, then the +components named ${bB}INIT${eB}*, then the order determined by the closure of component +makefile dependencies. +${bP} +${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming +convention is ${bI}GROUP${eI}[${bI}-PART${eI}]; e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files +are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components, +references to other packages, and a short package description. *${bB}.pkg${eB} files +are used by ${bF}package write${eF} to generate new source and binary packages. +${bP} +${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that +is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and +binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator +name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the +licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that +overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the +${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB} +directories. +${bP} +A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and +${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX} + ${bI}PACKAGE VERSION RELEASE${eI} 1${eX} +for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where +${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version, +and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases. +${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by +${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages +except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB} +and *${bB}.ver${eB} determines if the required package have been read in. Finally, +${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its +components. Included are all changes added to the component ${bB}RELEASE${eB}, +${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base +releases. Component ${bB}RELEASE${eB} files contain tag lines of the form +[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README +text, in reverse chronological order (newer entries at the top of the +file.) ${bF}package release${eF} generates this information, and +${bF}package contents ...${eF} lists the descriptions and components. +${bP} +${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the +output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used +to separate incompatible executable and object formats. All architecture +specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$PACKAGEROOT/arch/\$HOSTTYPE${eB}.) +There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these +are limited to makefile compiler workarounds, e.g., if ${bB}\$HOSTTYPE${eB} matches +'hp.*' then turn off the optimizer for these objects. All other architecture +dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component +specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...] +optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build +farms that support different compilers on the same architecture. +${bP} +Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB}) +and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable +makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate +${bB}nmake${eB}. Currently there is no support for old-make/gnu-make makefiles; if +the binaries are just being built then ${bB}mamake${eB} will suffice; if source or +makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or +${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by +${bF}package write${eF}. +${bP} +Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a +prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the +${bB}\$PACKAGEROOT/src${eB} tree and places the converted output files in the +${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over the +original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code +that is compatible with K&R, ANSI, and C++ dialects. +${bP} +All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames; +there are no embedded absolute pathnames. This means that binaries generated +under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change +their ${bB}\$PATH${eB} variable to reference the new installation root bin directory. +${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}. +${eO}" + ;; + source) echo "${bO} +${bH}Source Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages. +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup source \$URL ${bB}PACKAGE${eB} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup source \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup source${eX}${eD} +${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI} + (${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}bin/package${eB} (with no + arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX} + bin/package make${eX}${eD} +${bT}(7)${bD}List make results and interesting errors:${bX} + bin/package results${eX} + Run the regression tests:${bX} + bin/package test${eX} + List test results and errors:${bX} + bin/package results test${eX}${eD} +${bT}(8)${bD}The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(9)${bD}You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle + for the latest source release is:${bX} + bin/package setup source + bin/package make + bin/package test${eX}${eD}${eL} + +${bH}Source Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + source package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz | ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + source package, compile it, and manually read the ${bB}INIT${eB} + source package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD${eI}.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + *) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + + The $command command controls source and binary packages. It must be run + within the package root directory tree. See \"$command help intro\" for + details. In the following, PACKAGE names either a package or a component + within a package; if omitted, all packages are operated on. The default + action is \"host type\". + + qualifier: + authorize NAME Remote authorization name or license acceptance phrase. + debug|environment Show environment and actions; do not execute. + flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT. + force Force the action to override saved state. + never Run make -N; otherwise show other actions. + only Only operate on the specified packages. + password PASSWORD Remote authorization or license acceptance password. + quiet Do not list captured make and test action output. + show Run make -n; otherwise show other actions. + DEBUG Trace the package script actions in detail for debugging. + action: + admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ] + Apply ACTION ... to the hosts listed in FILE. If FILE is + omitted then "admin.db" is assumed. The caller must have rcp(1) + and rsh(1) or scp(1) and ssh(1) access to the hosts. Output + for the action is saved per-host in ACTION.log/HOST. Logs + can be viewed by \"package admin [on HOST] results [ACTION]\". + By default only local PACKAGEROOT hosts are selected from FILE; + \"all\" selects all hosts. \"on PATTERN\" selects only + hosts matching the | separated PATTERN. FILE contains four + types of lines. Blank lines and lines beginning with # are + ignored. Lines starting with id=value are variable assignments. + Set admin_ping to local conventions if \"$admin_ping\" fails. + If a package list is not specified on the command line the + action applies to all packages; a variable assignment + package=list applies action to the packages in list for + subsequent hosts in FILE. The remaining line type is a host + description consisting of 6 tab separated fields. The first 3 + are mandatory; the remaining 3 are updated by the admin action: + hosttype + The host type as reported by package. + [user@]host + The host name and optionally user name for rcp(1) + and rsh(1) access. + [remote:[[master]:]]PACKAGEROOT + The absolute remote package root directory and + optionally the remote prorocol (rsh or ssh) if + the directory is on a different server than the + master package root directory. If + lib/package/admin/$admin_env exists under + this directory then it is sourced by sh(1) + before ACTION is done. If this field begins with - + then the host is ignored. If this field contains + : then ditto(1) is used to sync the remote src + directory hierarchy to the local one. If [master]: + is specified then the sync is deferred to the + master host. If master is omitted (two :) then + the sync is disabled. These directories must exist + on the remote side: lib/package, src/cmd, src/lib. + date YYMMDD of the last action. + date Elapsed wall time of the last action. + M T W The admin action make, test and write action error + counts. A non-numeric value in any of these fields + disables the corresponding action. + owner The owner contact information. + attributes + NAME=VALUE attributes. Should at least contain + cc=compiler-version. + clean | clobber + Delete the arch/HOSTTYPE hierarchy; this deletes all generated + files and directories for HOSTTYPE. The hierarchy can be rebuilt + by package make.] + contents [ package ... ] + List description and components for PACKAGE on the standard + output. + copyright [ package ... ] + List the general copyright notice(s) for PACKAGE on the + standard output. Note that individual components in PACKAGE + may contain additional or replacement notices. + export [ VARIABLE ... ] + List NAME=VALUE for each VARIABLE, one per line. If the + \"only\" attribute is specified then only the variable + values are listed. If no variables are specified then + $env are assumed. + help [ ACTION ] + Display help text on the standard error [ standard output + for ACTION ]. + host [ canon cpu name rating type ... ] + List architecture/implementation dependent host information + on the standard output. type is listed if no attributes are + specified. Information is listed on a single line in attributes + order. The attributes are: + canon The next argument is a host type name to be + converted to package syntax. + cpu The number of cpus; 1 if the host is not a + multiprocessor. + name The host name. + rating The cpu rating in pseudo mips; the value is useful + useful only in comparisons with rating values of + other hosts. Other than a vax rating fixed at 1, + ratings can vary wildly but consistently from + vendor mips ratings. cc(1) may be required to + determine the rating. + type The host type, usually of the form + vendor.architecture, with an optional trailing + -version. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. Os point release information is + avoided as much as possible, but vendor resistance + to release incompatibilities has for the most part + been futile. + html [ ACTION ] + Display html help text on the standard error [ standard output + for ACTION ]. + install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ] + Copy the package binary hierarchy to DIR. If ARCHITECTURE is + omitted then all architectures are installed. If the \"flat\" + attribute is specified then exactly one ARCHITECTURE must be + specified; this architecture will be installed in DIR without + the \"arch/HOSTTYPE\" directory prefixes. Otherwise each + architecture will be installed in a separate \"arch/HOSTTYPE\" + subdirectory of DIR. The ARCHITECTURE - names the current + architecture. DIR must be an existing directory. If PACKAGE + is omitted then all binary packages are installed. This action + requires nmake. + license [ package ... ] + List the source license(s) for PACKAGE on the standard output. + Note that individual components in PACKAGE may contain + additional or replacement licenses. + list [ PACKAGE ... ] + List the name, version and prerequisites for PACKAGE on the + standard output. + make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ] + Build and install. The default TARGET is install, which + makes and installs all packages. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/make.out. The build is done + in the \$INSTALLROOT directory tree viewpathed on top of + the \$PACKAGEROOT directory tree. If \"flat\" is specified then + the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only + one architecture may be flat. Leaf directory names matching + the |-separated shell pattern \$MAKESKIP are ignored. The + view action is done before making. OPTION operands are + passed to the underlying make command. + read [ package ... | archive ... ] + Read the named package archive(s). Must be run from the + package root directory. Archives are searched for in . + and lib/package/tgz. Each package is read only once. The + file lib/package/tgz/package[.type].tim tracks the read time. + See the write action for archive naming conventions. Text + file archive member are assumed to be ASCII or UTF-8 encoded. + regress diff(1) the current and previous package test results. + release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ] + Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd), + where - means lowest (or highest.) If no dates are specified + then changes for the last 4 months are listed. PACKAGE may + be a package or component name. + remove PACKAGE + Remove files installed for PACKAGE. + results [ path ] [ old ] [ make | test ] + List results and interesting messages captured by the most + recent make (default), test or write action. old specifies the + previous results, if any (current and previous results are + retained.) $HOME/.pkgresults, if it exists, must contain an + egrep(1) expression of result lines to be ignored. failed lists + failures only and path lists the results file path only. + setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + The action initializes the current directory as a package root, + runs the update action to download new or out of date packages, + and runs the read action on those packages. If \"flat\" is + specified then the \$INSTALLROOT { bin fun include lib } + directories are linked to the same directories in the package + root. Only one architecture may be flat. See the update and + read actions for argument details. + test [ PACKAGE ] + Run the regression tests for PACKAGE. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/test.out. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If only is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested. + update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + Download the latest release of the selected and required + packages from URL (e.g., + http://www.research.att.com/sw/download) into the directory + \$PACKAGEROOT/lib/package/tgz. beta accesses beta packages; + download these at your own risk. If ARCHITECTURE is omitted + then only architectures already present in the tgz directory + will be downloaded. If ARCHITECTURE is - then all posted + architectures will be downloaded. If URL matches *.url then + it is interpreted as a file containing shell variable + assignments for url, authorize and password. If URL is + omitted then the definitions for url, authorize and password + in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists, + are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does + not exist then it is initialized with the current url, + authorize and password values and read permission for the + current user only. If PACKAGE is omitted then only + packages already present in the tgz directory will be + downloaded. If PACKAGE is - then all posted packages will be + downloaded. If source and binary are omitted then both source + and binary packages will be downloaded. If \bonly\b is + specified then only the named packages are updated; otherwise + the closure of required packages is updated. This action + requires wget(1), lynx(1), curl(1) or a shell that supports + io to /dev/tcp/HOST/PORT. + use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ] + Run COMMAND or an interactive shell if COMMAND is omitted, with + the environment initialized for using the package (can you say + shared library without cussing?) If uid or PACKAGE or . is + specified then it is used to determine a \$PACKAGEROOT, + possibly different from the current directory. For example, to + try out bozo's package: \"package use bozo\". In this case the + command may be run from any directory. If the file + \$INSTALLROOT/lib/package/profile is readable then it is + sourced to initialize the environment. 32 or 64 implies + \$PACKAGEROOT of . and specifies the target architecture word + size (which may be silently ignored.) + verify [ PACKAGE ] + Verify installed binary files against the checksum files in + \$INSTALLROOT/lib/package/gen/*.sum. The checksum files contain + mode, user and group information. If the checksum matches + for a given file then the mode, user and group are changed + as necessary to match the checksum entry. A warning is printed + on the standard error for each mismatch. Requires the ast + package cksum(1) command. + view + Initialize the architecture specific viewpath hierarchy. The + make action implicitly calls this action. If \"flat\" is specified + then the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be flat. + write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta] + [binary|runtime|source] PACKAGE + Write a package archive for PACKAGE. All work is done in the + \$PACKAGEROOT/lib/package directory. FORMAT-specific files + are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim + file in this directory tracksthe write time and prevents a + package from being read in the same root it was written. If + more than one file is generated for a particular FORMAT then + those files are placed in the FORMAT/PACKAGE subdirectory. + File names in the FORMAT subdirectory will contain the package + name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE. + If PACKAGE is omitted then an ordered list of previously + written packages is generated. If \"only\" is specified then + only the named packages will be written; otherwise + prerequisite packages are written first. Package components + must be listed in PACKAGE.pkg. FORMAT may be one of: + cyg generate a cygwin package + exp generate an exptools(1) maintainer source archive + and NPD file in the exp subdirectory, suitable for + expmake(1); support files are placed in the + exp/PACKAGE subdirectory + lcl generate a package archive or delta in the lcl + subdirectory, suitable for restoration into the + primary source tree (no source licence annotation) + pkg generate a pkgmk(1) package, suitable for pkgadd(1) + rpm generate an rpm(1) package + tgz generate a gzip(1) tar(1) package archive; this is + the default + tst generate tgz FORMAT package archive in the tst + subdirectory; version state files are not updated + The package type must be one of source, binary or runtime. + A source package contains the source needed to build the + corresponding binary package. A binary package includes the + libraries and headers needed for compiling and linking + against the public interfaces. A runtime package contains + the commands and required dynamic libraries. A package may + be either a base or delta. A base package contains a + complete copy of all components. A delta package contains + only changes from a previous base package. Delta recipients + must have the ast pax(1) command (in the ast-base package.) + If neither base nor delta is specified, then the current + base is overwritten if there are no deltas referring to the + current base. Only the tgz and lcl formats support delta. + If base is specified then a new base and two delta archives + are generated: one delta to generate the new base from the + old, and one delta to generate the old base from the new; + the old base is then removed. If delta is specified then a + new delta referring to the current base is written. + package.pkg may reference other packages. By default a + pointer to those packages is written. The recipient package + read will then check that all required packages have been + downloaded. If closure is specified then the components for + all package references are included in the generated + package. This may be useful for lcl and versioning. All + formats but lcl annotate each source file (not already + annotated) with a license comment as it is written to the + package archive using proto(1). + name=value: + variable definition: typically CC=cc or CCFLAGS=-g." + ;; + esac + exit $code + ;; + *=*) set DEFAULT host type "$@" + ;; + *) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + exit 2 + ;; + esac + global="$global $1" + shift +done + +# gather HOSTTYPE *,* options +# ,*cc*,-*,... set CC and CCFLAGS + +hostopts() +{ + _ifs_=$IFS + IFS=, + set '' $HOSTTYPE + IFS=$_ifs_ + shift + while : + do case $# in + 0|1) break ;; + esac + shift + case $1 in + *cc*) CC=$1 + while : + do case $# in + 0|1) break ;; + esac + case $2 in + -*) case $assign_CCFLAGS in + ?*) assign_CCFLAGS="$assign_CCFLAGS " ;; + esac + assign_CCFLAGS="$assign_CCFLAGS$2" + shift + ;; + *) break + ;; + esac + done + ;; + esac + done +} + +# collect command line targets and definitions + +case $_PACKAGE_HOSTTYPE_ in +?*) HOSTTYPE=$_PACKAGE_HOSTTYPE_ + KEEP_HOSTTYPE=1 + ;; +*) KEEP_HOSTTYPE=0 + ;; +esac +KEEP_PACKAGEROOT=0 +KEEP_SHELL=0 +USER_VPATH= +args= +assign= +assign_CCFLAGS= +for i +do case $i in + *:*=*) args="$args $i" + continue + ;; + *=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','` + ;; + esac + case $i in + AR=*|LD=*|NM=*) + assign="$assign $n='$v'" + eval $n='$'v + ;; + CC=*) eval $n='$'v + ;; + CCFLAGS=*) + eval $n='$'v + assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\"" + ;; + HOSTTYPE=*) + eval $n='$'v + case $HOSTTYPE in + ?*) KEEP_HOSTTYPE=1 ;; + esac + ;; + HURL=*) eval $n='$'v + ;; + PACKAGEROOT=*) + eval $n='$'v + case $PACKAGEROOT in + ?*) KEEP_PACKAGEROOT=1 ;; + esac + ;; + SHELL=*)eval $n='$'v + case $SHELL in + ?*) KEEP_SHELL=1 ;; + esac + ;; + TAR=*) eval $n='$'v + ;; + TARFLAGS=*) + eval $n='$'v + ;; + VPATH=*)eval USER_$n='$'v + ;; + 'debug=1') + makeflags="$makeflags --debug-symbols" + ;; + 'strip=1') + makeflags="$makeflags --strip-symbols" + ;; + *=*) assign="$assign $n='$v'" + ;; + *) args="$args $i" + ;; + esac +done +case $HOSTTYPE in +*,*) hostopts $HOSTTYPE ;; +esac +case $assign_CCFLAGS in +?*) assign="$assign $assign_CCFLAGS" +esac +case $CC in +''|cc) ;; +*) export CC ;; +esac + +# Add build type flags via KSH_RELFLAGS, which is used in src/cmd/ksh93/Mamfile. +# (Avoid using CCFLAGS; setting it would overwrite autodetected optimization flags.) +ksh_relflags= +case `git branch 2>/dev/null` in +'' | *\*\ [0-9]*.[0-9]*) + # If we're not on a git branch (tarball) or on a branch that starts + # with a number (release branch), then compile as a release version + ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_ksh_release" ;; +*) # Otherwise, add 8-character git commit hash if available, and if the working dir is clean + git_commit=`git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD` + case $git_commit in + ????????) + ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_git_commit=\\\"$git_commit\\\"" ;; + esac + unset git_commit ;; +esac +case $ksh_relflags in +?*) # add the extra flags as an argument to mamake + assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;; +esac + +# Add ksh compile-options via KSH_SHOPTFLAGS. +SHOPT() +{ + case $1 in + *=?*) ksh_shoptflags="${ksh_shoptflags:+$ksh_shoptflags }-DSHOPT_$1" ;; + esac +} +ksh_shoptflags= +shopt_sh='src/cmd/ksh93/SHOPT.sh' # this script calls SHOPT() to set options +if test -f "$shopt_sh" +then . "$shopt_sh" +else echo "WARNING: $shopt_sh is missing" >&2 +fi +case $ksh_shoptflags in +?*) # add the extra flags as an argument to mamake + assign="${assign:+$assign }KSH_SHOPTFLAGS=\"\$ksh_shoptflags\"" ;; +esac + +# grab action specific args + +case $action in +admin) while : + do case $# in + 0) set list + break + ;; + esac + case $1 in + all) admin_all=1 + ;; + db) case $# in + 1) echo $command: $action: $1: db file argument expected >&2 + exit 1 + ;; + esac + shift + admin_db=$1 + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + admin_on=$1 + ;; + *) break + ;; + esac + shift + done + admin_action=$1 + admin_args=$* + for i + do case $i in + debug|environment|force|never|only|quiet|show|DEBUG) + ;; + *) admin_action=$i + break + ;; + esac + done + ;; +setup) PACKAGEROOT=${PWD:-`pwd`} + export PACKAGEROOT + KEEP_PACKAGEROOT=1 + ;; +use) case $1 in + .|32|64)case $1 in + 32|64) bit=$1 ;; + esac + shift + + # HOSTTYPE specific setup + + case $HOSTTYPE in + win32.*)sys=uwin + wow=`uname -i` + case $bit in + 32) case $HOSTTYPE in + *-64) HOSTTYPE=${HOSTTYPE%-64} ;; + esac + ;; + 64) case $HOSTTYPE in + *-64) ;; + *) HOSTTYPE=$HOSTTYPE-64 ;; + esac + case $wow in + */32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;; + esac + ;; + esac + case $bit in + '') PS1="($sys) " ;; + *) PS1="($sys-$bit) " ;; + esac + + $exec umask 002 + $exec unset MAKESKIP + + $exec export P=$PWD + $exec export A=$P/arch/$HOSTTYPE + + $exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package + $exec export INSTALLROOT=$A + $exec export PACKAGEROOT=$P + $exec export PATH=$A/bin:$P/bin:$PATH + $exec export PS1="$PS1" + $exec export VPATH=$A:$P + $exec export nativepp=/usr/lib + + if test '' != "$INSTALLROOT" -a -d $INSTALLROOT/include/ast + then $exec export PACKAGE_ast=$INSTALLROOT + elif test -d ${PWD%/*}/ast/arch/$HOSTTYPE + then $exec export PACKAGE_ast=${PWD%/*}/ast/arch/$HOSTTYPE + fi + + # run the command + + case $# in + 0) case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$@" + ;; + esac + exit + ;; + esac + PACKAGEROOT=${PWD:-`pwd`} + $show export PACKAGEROOT + esac + ;; +esac + +# true if arg is a valid PACKAGEROOT + +packageroot() # dir +{ + test -d $1/lib/$command -o -x $1/bin/$command +} + +# true if arg is executable + +executable() # [!] command +{ + case $1 in + '!') test ! -x "$2" -a ! -x "$2.exe"; return ;; + *) test -x "$1" -o -x "$1.exe"; return ;; + esac +} + +# initialize SHELLMAGIC +# tangible proof of cygwin's disdain for unix (well, this and execrate) + +shellmagic() +{ + case $SHELLMAGIC in + '') ;; + -) if test -f /emx/bin/sh.exe + then SHELLMAGIC='#!/emx/bin/sh.exe'$nl + elif test -f /bin/env.exe + then SHELLMAGIC='#!/bin/env sh'$nl + else SHELLMAGIC= + fi + ;; + esac +} + +# true if arg is executable command on $PATH + +onpath() # command +{ + _onpath_b=$1 + case $_onpath_b in + /*) if executable $_onpath_b + then _onpath_=$_onpath_b + return 0 + fi + return 1 + ;; + esac + IFS=':' + set '' $PATH + IFS=$ifs + shift + for _onpath_d + do case $_onpath_d in + '') _onpath_d=. ;; + esac + if executable "$_onpath_d/$_onpath_b" + then _onpath_=$_onpath_d/$_onpath_b + return 0 + fi + done + return 1 +} + +# true if no nmake or nmake not from AT&T or nmake too old + +nonmake() # nmake +{ + _nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) /dev/null || echo 19840919` + if test $_nonmake_version -lt 20001031 + then return 0 + fi + return 1 +} + +# determine local host attributes + +hostinfo() # attribute ... +{ + case $DEBUG in + 1) set -x ;; + esac + map= + something= + path=$PATH + for i in $ccs + do PATH=$PATH:$i + done + for i in $use + do for j in $org + do PATH=$PATH:$i/$j/bin + done + PATH=$PATH:$i/bin + done + # LD_LIBRARY_PATH may be out of sync with PATH here + case $SED in + '') SED=sed + $SED 1d < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$SED + then SED=$dir/$SED + break + fi + done + TR=tr + $TR < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$TR + then TR=$dir/$TR + break + fi + done + ;; + esac + case $PACKAGE_PATH in + ?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'` + do PATH=$PATH:$i/bin + done + ;; + esac + + # validate the args + + canon= + cc=$CC + for info + do case $canon in + -) canon=$info + ;; + *) case $info in + */*|*[cC][cC]) + cc=$info + ;; + canon) canon=- + something=1 + ;; + cpu|name|rating|type) + something=1 + ;; + *) echo "$command: $action: $info: unknown attribute" >&2 + exit 1 + ;; + esac + ;; + esac + done + case $canon in + -) echo "$command: $action: canon: host type name expected" >&2 + exit 1 + ;; + esac + case $something in + "") set "$@" type ;; + esac + case $DEBUG in + '') exec 9>&2 + exec 2>/dev/null + ;; + esac + + # compute the info + + _hostinfo_= + for info + do + case $info in + cpu) case $NPROC in + [123456789]*) + _hostinfo_="$_hostinfo_ $NPROC" + continue + ;; + esac + cpu=`sysctl -n hw.ncpu` + case $cpu in + [123456789]*) + _hostinfo_="$_hostinfo_ $cpu" + continue + ;; + esac + cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo` + case $cpu in + [123456789]*) + _hostinfo_="$_hostinfo_ $cpu" + continue + ;; + esac + cpu=1 + # exact match + set \ + hinv '^Processor [0123456789]' \ + psrinfo 'on-line' \ + 'cat /reg/LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + 'cat /proc/registry/HKEY_LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | grep -c "$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + case $cpu in + 0|1) set \ + /bin/mpstat + + while : + do case $# in + 0) break ;; + esac + if executable $1 + then case `$1 | grep -ic '^cpu '` in + 1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '` + break + ;; + esac + fi + shift + done + ;; + esac + case $cpu in + 0|1) # token match + set \ + /usr/kvm/mpstat 'cpu[0123456789]' \ + /usr/etc/cpustatus 'enable' \ + /usr/alliant/showsched 'CE' \ + 'ls /config/hw/system/cpu' 'cpu' \ + prtconf 'cpu-unit' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $TR ' ' ' + +' | grep -c "^$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + ;; + esac + case $cpu in + 0|1) # special match + set \ + \ + hinv \ + '/^[0123456789][0123456789]* .* Processors*$/' \ + '/[ ].*//' \ + \ + /usr/bin/hostinfo \ + '/^[0123456789][0123456789]* .* physically available\.*$/' \ + '/[ ].*//' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $SED -e "${2}!d" -e "s${3}"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift;shift + done + ;; + esac + case $cpu in + 0|1) cpu=`( + cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +int main() +{ + printf("%d\n", pthread_num_processors_np()); + return 0; +} +! + for o in -lpthread '' + do if $CC $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 + then ./$tmp.exe + break + fi + done + )` + case $cpu in + [0123456789]*) ;; + *) cpu=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $cpu" + ;; + name) _name_=`hostname || uname -n || cat /etc/whoami || echo local` + _hostinfo_="$_hostinfo_ $_name_" + ;; + rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'` + do case $rating in + [0123456789]*) break ;; + esac + done + case $rating in + [0123456789]*) ;; + *) cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +#if TD || TZ +#include +#else +extern time_t time(); +#endif +int main() +{ + register unsigned long i; + register unsigned long j; + register unsigned long k; + unsigned long l; + unsigned long m; + unsigned long t; + int x; +#if TD || TZ + struct timeval b; + struct timeval e; +#if TZ + struct timezone z; +#endif +#endif + l = 500; + m = 890; + x = 0; + for (;;) + { +#if TD || TZ +#if TZ + gettimeofday(&b, &z); +#else + gettimeofday(&b); +#endif +#else + t = (unsigned long)time((time_t*)0); +#endif + k = 0; + for (i = 0; i < l; i++) + for (j = 0; j < 50000; j++) + k += j; +#if TD || TZ +#if TZ + gettimeofday(&e, &z); +#else + gettimeofday(&e); +#endif + t = (e.tv_sec - b.tv_sec) * 1000 + (e.tv_usec - b.tv_usec) / 1000; + if (!x++ && t < 1000) + { + t = 10000 / t; + l = (l * t) / 10; + continue; + } +#else + t = ((unsigned long)time((time_t*)0) - t) * 1000; + if (!x++ && t < 20000) + { + t = 200000l / t; + l = (l * t) / 10; + continue; + } +#endif +#if PR + printf("[ k=%lu l=%lu m=%lu t=%lu ] ", k, l, m, t); +#endif + if (t == 0) + t = 1; + break; + } + printf("%lu\n", ((l * m) / 10) / t); + return k == 0; +} +! + rating= + for o in -DTZ -DTD '' + do if $CC $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 + then rating=`./$tmp.exe` + break + fi + done + case $rating in + [0123456789]*) ;; + *) rating=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $rating" + ;; + type|canon) + case $CROSS:$canon in + 0:) case $cc in + cc) case $KEEP_HOSTTYPE:$HOSTTYPE in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE + then KEEP_HOSTTYPE=1 + fi + ;; + esac + ;; + esac + case $KEEP_HOSTTYPE in + 1) _hostinfo_="$_hostinfo_ $HOSTTYPE" + continue + ;; + esac + ;; + esac + case $cc in + /*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *.*-*) _hostinfo_="$_hostinfo_ $a" + continue + ;; + *-*-*) case $canon in + '') canon=$a ;; + esac + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue + ;; + esac + ;; + esac + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + f=../lib/hostinfo/typemap + for i + do case $i in + "") i=. ;; + esac + case $canon in + '') case $cc in + /*|cc) ;; + *) if executable $i/$cc + then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *-*) canon=$a + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue 2 + ;; + esac + fi + ;; + esac + ;; + esac + if test -f "$i/$f" + then map="`grep -v '^#' $i/$f` $map" + fi + done + + # inconsistent -dumpmachine filtered here + + case -${canon}- in + --|*-powerpc-*) + h=`hostname || uname -n || cat /etc/whoami` + case $h in + '') h=local ;; + esac + a=`arch || uname -m || att uname -m || uname -s || att uname -s` + case $a in + *[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;; + esac + case $a in + '') a=unknown ;; + esac + m=`mach || machine || uname -p || att uname -p` + case $m in + *[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;; + esac + case $m in + '') m=unknown ;; + esac + x=`uname -a || att uname -a` + case $x in + '') x="unknown $host unknown unknown unknown unknown unknown" ;; + esac + set "" $h $a $m $x + expected=$1 host=$2 arch=$3 mach=$4 os=$5 sys=$6 rel=$7 ver=$8 + ;; + *) case $canon in + *-*) IFS=- + set "" $canon + shift + IFS=$ifs + case $# in + 2) host= mach= arch=$1 os=$2 sys= rel= ;; + *) host= mach=$2 arch=$1 os=$3 sys= rel= ;; + esac + case $os in + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'` + ;; + esac + ;; + *) arch=$canon mach= os= sys= rel= + ;; + esac + ;; + esac + type=unknown + case $host in + *.*) host=`echo $host | $SED -e 's/\..*//'` ;; + esac + case $mach in + unknown) + mach= + ;; + [Rr][0123][0123456789][0123456789][0123456789]) + mach=mips1 + ;; + [Rr][4][0123456789][0123456789][0123456789]) + mach=mips2 + ;; + [Rr][56789][0123456789][0123456789][0123456789]|[Rr][123456789][0123456789][0123456789][0123456789][0123456789]) + mach=mips4 + ;; + pc) arch=i386 + mach= + ;; + [Pp][Oo][Ww][Ee][Rr][Pp][Cc]) + arch=ppc + mach= + ;; + *) case $arch in + 34[0123456789][0123456789]) + os=ncr + arch=i386 + ;; + esac + ;; + esac + case $canon in + '') set \ + \ + /NextDeveloper -d next - \ + /config/hw/system/cpu -d tandem mach \ + + while : + do case $# in + 0) break ;; + esac + if test $2 $1 + then os=$3 + case $4 in + arch) mach=$arch ;; + mach) arch=$mach ;; + esac + break + fi + shift;shift;shift;shift + done + ;; + esac + case $os in + AIX*|aix*) + type=ibm.risc + ;; + HP-UX) case $arch in + 9000/[78]*) + type=hp.pa + ;; + */*) type=hp.`echo $arch | $SED 's,/,_,g'` + ;; + *) type=hp.$arch + ;; + esac + ;; + [Ii][Rr][Ii][Xx]*) + set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + shift + type=$1 + n= + case $2 in + r[0123][0123456789][0123456789][0123456789]) + n=1 + ;; + r[4][0123][0123456789][0123456789]) + n=2 + ;; + r[4][456789][0123456789][0123456789]|r[5][0123456789][0123456789][0123456789]) + n=3 + ;; + r[6789][0123456789][0123456789][0123456789]|r[123456789][0123456789][0123456789][0123456789][0123456789]) + n=4 + ;; + esac + case $rel in + [01234].*|5.[012]|5.[012].*) + case $n in + 1) ;; + *) n=2 ;; + esac + ;; + 5.*) case $n in + 2) n=3 ;; + esac + ;; + esac + if executable $cc + then a=$cc + else IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for i + do a=$i/$cc + if executable $a + then break + fi + done + fi + split=' +' + a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q` + case $a in + [0123456789]) n=$a ;; + esac + case $n in + 4) a=`$cc -${type}3 2>&1` + case $a in + *unknown*|*install*|*conflict*) + ;; + *) n=3 + ;; + esac + ;; + esac + a=`$cc -show F0oB@r.c 2>&1` + case $n:$a in + [!2]:*mips2*) n=2 ;; + [!23]:*mips3*) n=3 ;; + [!234]:*mips4*) n=4 ;; + esac + case $n:$a in + [!2]:*[Oo]32*) abi=-o32 ;; + [!3]:*[Nn]32*) abi=-n32 ;; + esac + mach=${type}$n + type=sgi.$mach + ;; + OSx*|SMP*|pyramid) + type=pyr + ;; + OS/390) type=mvs.390 + ;; + [Ss][Cc][Oo]*) + type=sco + ;; + [Ss]ol*) + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + case $arch in + '') case $mach in + '') arch=sun4 ;; + *) arch=$mach ;; + esac + ;; + esac + case $arch in + sparc) arch=sun4 ;; + esac + type=sol$v.$arch + ;; + [Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'` + case $type in + sparc) type=sun4 ;; + esac + case $rel in + [01234]*) + ;; + '') case $os in + *[Oo][Ss]) + ;; + *) type=sol.$type + ;; + esac + ;; + *) case $type in + '') case $mach in + sparc*) type=sun4 ;; + *) type=$mach ;; + esac + ;; + esac + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + type=sol$v.$type + ;; + esac + case $type in + sun*|*.*) + ;; + *) type=sun.$type + ;; + esac + ;; + [Uu][Nn][Ii][Xx]_[Ss][Vv]) + type=unixware + ;; + UTS*|uts*) + if test -x /bin/u370 -o -x /bin/u390 + then type=uts.390 + else case $arch in + '') arch=$mach ;; + esac + type=uts.$arch + fi + ;; + $host) type=$arch + case $type in + *.*|*[0123456789]*86|*68*) + ;; + *) case $mach in + *[0123456789]*86|*68*|mips) + type=$type.$mach + ;; + esac + ;; + esac + ;; + unknown) + case $arch in + ?*) case $arch in + sun*) mach= ;; + esac + type=$arch + case $mach in + ?*) type=$type.$mach ;; + esac + ;; + esac + ;; + *) case $ver in + FTX*|ftx*) + case $mach in + *[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'` + ;; + esac + type=stratus.$mach + ;; + *) case $arch in + [Oo][Ss][-/.]2) + type=os2 + arch=$rel + ;; + *) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'` + ;; + esac + case $type in + [Cc][Yy][Gg][Ww][Ii][Nn]_*) + type=cygwin + ;; + [Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt]) + type=win32 + arch=`echo $arch | $SED -e 's/_[^_]*$//'` + ;; + esac + case $arch in + '') case $mach in + ?*) type=$type.$mach ;; + esac + ;; + *) type=$type.$arch ;; + esac + ;; + esac + esac + case $type in + [0123456789]*) + case $mach in + ?*) type=$mach ;; + esac + case $type in + */MC) type=ncr.$type ;; + esac + ;; + *.*) ;; + *[0123456789]*86|*68*) + case $rel in + [34].[0123456789]*) + type=att.$type + ;; + esac + ;; + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + ;; + [abcdefghijklmnopqrstuvwxyz]*) case $mach in + $type) case $ver in + Fault*|fault*|FAULT*) + type=ft.$type + ;; + esac + ;; + ?*) case $arch in + '') type=$type.$mach ;; + *) type=$type.$arch ;; + esac + ;; + esac + ;; + esac + case $type in + *[-_]32|*[-_]64|*[-_]128) + bits=`echo $type | $SED 's,.*[-_],,'` + type=`echo $type | $SED 's,[-_][0-9]*$,,'` + ;; + *) bits= + ;; + esac + type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + case $type in + *.*) lhs=`echo $type | $SED -e 's/\..*//'` + rhs=`echo $type | $SED -e 's/.*\.//'` + case $rhs in + [x0123456789]*86) rhs=i$rhs ;; + 68*) rhs=m$rhs ;; + esac + case $rhs in + i[x23456789]86|i?[x23456789]86|*86pc) + rhs=i386 ;; + powerpc) rhs=ppc ;; + s[0123456789]*[0123456789]x) + rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;; + esac + case $rhs in + arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*) + rhs=arm ;; + hppa) rhs=pa ;; + esac + case $lhs in + ?*coff|?*dwarf|?*elf) + case $lhs in + ?*coff) x=coff ;; + ?*dwarf)x=coff ;; + ?*elf) x=elf ;; + esac + lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"` + ;; + esac + case $lhs in + bsdi) lhs=bsd ;; + darwin) case `/usr/bin/cc --version` in + *'(GCC)'*) case $rel in + [0-9].*|10.*) lhs=darwin07 ;; + *) lhs=darwin11 ;; + esac ;; + esac + ;; + freebsd) case $rel in + [01234].*) lhs=${lhs}4 ;; + [123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;; + esac + ;; + hpux) lhs=hp ;; + mvs) rhs=390 ;; + esac + case $lhs in + '') type=$rhs ;; + $rhs) type=$lhs ;; + *) type=$lhs.$rhs ;; + esac + ;; + esac + case $type in + sgi.mips*) + case $mach in + mips2) type=sgi.$mach + abi=-o32 + ;; + mips3) type=sgi.$mach + abi=-n32 + ;; + mips[456789]) + type=sgi.$mach + case $abi in + *-n32) ;; + *) abi=-64 ;; + esac + ;; + *) pwd=`pwd` + cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.a.c < $tmp.b.c </dev/null 2>&1 + rm -f $tmp.* + trap - 0 1 2 + cd $pwd + ;; + esac + case $type$abi in + sgi.mips2-o32) + ;; + sgi.mips3) + type=$type-o32 + ;; + sgi.mips3-n32) + ;; + sgi.mips4) + type=$type-o32 + ;; + sgi.mips[456789]-64) + ;; + *) type=$type$abi + ;; + esac + ;; + *) case $bits in + '') bits=` cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + echo 'int main() { return 0; }' > $tmp.a.c + $cc $CCFLAGS -o $tmp.a.exe $tmp.a.c /dev/null 2>&1 + file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ` + case $bits in + *64*) bits=64 ;; + *) bits= ;; + esac + ;; + esac + ;; + esac + case $bits in + 32) case $type in + *.i386) bits= ;; + esac + ;; + esac + case $bits in + ?*) type=$type-$bits ;; + esac + + # last chance mapping + + set "" "" $map + while : + do case $# in + [012]) break ;; + esac + shift;shift + eval " case \$type in + $1) type=\$2; break ;; + esac" + done + _hostinfo_="$_hostinfo_ $type" + ;; + esac + done + set '' $_hostinfo_ + shift + _hostinfo_=$* + + # restore the global state + + PATH=$path + case $DEBUG in + '') exec 2>&9 + exec 9>&- + ;; + esac +} + +# info message + +note() # message ... +{ + echo $command: "$@" >&2 +} + +# cc checks +# +# CC: compiler base name name +# cc: full path, empty if not found + +checkcc() +{ + cc= + if onpath $CC + then cc=$_onpath_ + else case $CC in + cc) if onpath gcc + then CC=gcc + cc=$_onpath_ + fi + ;; + esac + fi + case $cc in + '') case $action in + make|test) note "$CC: not found"; exit 1 ;; + *) note "warning: $CC: not found" ;; + esac + ;; + esac +} + +# some actions have their own PACKAGEROOT or kick out early + +case $action in +host) eval u=$package_use + case $u in + $PACKAGE_USE) + ;; + *) if onpath $0 + then case $_onpath_ in + */arch/$HOSTTYPE/bin/package) + KEEP_HOSTTYPE=1 + ;; + *) KEEP_HOSTTYPE=0 + ;; + esac + else KEEP_HOSTTYPE=0 + fi + ;; + esac + hostinfo $args + echo $_hostinfo_ + exit 0 + ;; +export|setup|use) + x= + ;; +*) x= + eval u=$package_use + case $u in + $PACKAGE_USE) + case :$PATH: in + *:$INSTALLROOT/bin:*) + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + x=1 + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; +esac +run=- +case $x in +1) : accept the current package use environment + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + INITROOT=$PACKAGEROOT/src/cmd/INIT + checkcc + ;; +*) hosttype= + case $KEEP_PACKAGEROOT in + 0) case $action in + use) PACKAGEROOT= + case $show in + echo) exec=echo make=echo show=echo ;; + esac + set '' $args + shift + case $# in + 0) ;; + *) case $1 in + -|.) ;; + /*) PACKAGEROOT=$1 + ;; + *) i=`echo ~$1` + if packageroot $i + then PACKAGEROOT=$i + else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use + do if packageroot $i/$1 + then PACKAGEROOT=$i/$1 + break + fi + done + case $PACKAGEROOT in + '') hosttype=$1 ;; + esac + fi + ;; + esac + shift + ;; + esac + run="$@" + ;; + esac + case $PACKAGEROOT in + '') PACKAGEROOT=${PWD:-`pwd`} ;; + esac + + # . must be within the PACKAGEROOT tree + + i=X$PACKAGEROOT + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $PACKAGEROOT in + //*) d=/ ;; + *) d= ;; + esac + case $1 in + home) k=1 ;; + *) k=0 ;; + esac + for i + do case $i in + '') continue ;; + esac + d=$d/$i + case $k in + 2) k=1 + ;; + 1) k=0 + ;; + 0) case $i in + arch) k=2 + ;; + *) if packageroot $d + then PACKAGEROOT=$d + fi + ;; + esac + ;; + esac + done + ;; + esac + INITROOT=$PACKAGEROOT/src/cmd/INIT + $show PACKAGEROOT=$PACKAGEROOT + $show export PACKAGEROOT + export PACKAGEROOT + + # initialize the architecture environment + + case $KEEP_HOSTTYPE in + 0) hostinfo type + HOSTTYPE=$_hostinfo_ + ;; + 1) _PACKAGE_HOSTTYPE_=$HOSTTYPE + export _PACKAGE_HOSTTYPE_ + ;; + esac + $show HOSTTYPE=$HOSTTYPE + $show export HOSTTYPE + export HOSTTYPE + INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE + case $action in + admin|install|make|read|remove|test|verify|view|write) + ;; + *) if test ! -d $INSTALLROOT + then INSTALLROOT=$PACKAGEROOT + fi + ;; + esac + $show INSTALLROOT=$INSTALLROOT + $show export INSTALLROOT + export INSTALLROOT + + # check the basic package hierarchy + + case $action in + export|use) + packageroot $PACKAGEROOT || { + echo "$command: $PACKAGEROOT: invalid package root directory" >&2 + exit 1 + } + case $KEEP_HOSTTYPE:$hosttype in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype + then KEEP_HOSTTYPE=1 + HOSTTYPE=$hosttype + else echo "$command: $hosttype: package root not found" >&2 + exit 1 + fi + ;; + esac + ;; + *) packageroot $PACKAGEROOT || { + case $KEEP_PACKAGEROOT in + 1) ;; + *) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2 + exit 1 + ;; + esac + } + + case $action in + admin) ;; + *) for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in lib + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update the basic package commands + + for i in execrate ignore mamprobe silent + do test -h $PACKAGEROOT/bin/$i 2>/dev/null || + case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.sh"*) + note update $PACKAGEROOT/bin/$i + shellmagic + case $SHELLMAGIC in + '') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit + ;; + *) case $exec in + '') { + echo "$SHELLMAGIC" + cat $INITROOT/$i.sh + } > $PACKAGEROOT/bin/$i || exit + ;; + *) echo "{ +echo \"$SHELLMAGIC\" +cat $INITROOT/$i.sh +} > $PACKAGEROOT/bin/$i" + ;; + esac + ;; + esac + $exec chmod +x $PACKAGEROOT/bin/$i || exit + ;; + esac + done + fi + ;; + esac + path=$PATH + PATH=$INSTALLROOT/bin:$PACKAGEROOT/bin:$PATH + checkcc + PATH=$path + case $cc in + ?*) if test -f $INITROOT/hello.c + then + # check if $CC (full path $cc) is a cross compiler + + ( + cd "$TMPDIR" || exit 3 + cp $INITROOT/hello.c pkg$$.c || exit 3 + $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { + if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 + then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2 + else cat pkg$$.e + echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2 + fi + exit 2 + } + if ./pkg$$.exe >/dev/null 2>&1 + then code=0 + else code=1 + fi + rm -f pkg$$.* + exit $code + ) + code=$? + case $code in + 1) CROSS=1 ;; + esac + fi + ;; + esac + EXECTYPE=$HOSTTYPE + EXECROOT=$INSTALLROOT + case $CROSS in + 0) # dll hackery -- why is this so complicated? + + abi= + case $HOSTTYPE in + sgi.mips[0123456789]*) + x=rld + if executable /lib32/$x || executable /lib64/$x + then case $INSTALLROOT in + */sgi.mips[0123456789]*) + u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'` + ;; + *) u= + ;; + esac + for a in "n=2 v= l=" "n=3 v=N32 l=lib32" "n=4-n32 v=N32 l=lib32" "n=4 v=64 l=lib64" + do eval $a + case $v in + N32) case $n:$HOSTTYPE in + *-n32:*-n32) ;; + *-n32:*) continue ;; + *:*-n32) continue ;; + esac + ;; + esac + case $l in + ?*) if executable ! /$l/$x + then continue + fi + ;; + esac + case $u in + '') case $HOSTTYPE in + sgi.mips$n|sgi.mips$n-*) + abi="$abi 'd=$INSTALLROOT v=$v'" + ;; + *) continue + ;; + esac + ;; + *) if test -d $u$n + then abi="$abi 'd=$u$n v=$v'" + fi + ;; + esac + done + fi + ;; + esac + case $abi in + '') abi="'d=$INSTALLROOT v='" ;; + esac + p=0 + eval " + for a in $abi + do eval \$a + eval \" + case \\\$LD_LIBRARY\${v}_PATH: in + \\\$d/lib:*) + ;; + *) x=\\\$LD_LIBRARY\${v}_PATH + case \\\$x in + ''|:*) ;; + *) x=:\\\$x ;; + esac + LD_LIBRARY\${v}_PATH=\$d/lib\\\$x + export LD_LIBRARY\${v}_PATH + p=1 + ;; + esac + \" + done + " + case $LD_LIBRARY_PATH in + '') ;; + *) for d in $lib + do case $HOSTTYPE in + *64) if test -d ${d}64 + then d=${d}64 + fi + ;; + esac + case :$LD_LIBRARY_PATH: in + *:$d:*) ;; + *) if test -d $d + then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d + p=1 + fi + ;; + esac + done + ;; + esac + case $p in + 1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH + $show export LD_LIBRARY_PATH + export LD_LIBRARY_PATH + ;; + esac + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + ;; + *) case $LIBPATH in + '') LIBPATH=/usr/lib:/lib ;; + esac + LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH + $show LIBPATH=$LIBPATH + $show export LIBPATH + export LIBPATH + ;; + esac + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + ;; + *) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH} + $show SHLIB_PATH=$SHLIB_PATH + $show export SHLIB_PATH + export SHLIB_PATH + ;; + esac + case $DYLD_LIBRARY_PATH: in + $INSTALLROOT/lib:*) + ;; + *) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} + $show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + $show export DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + ;; + esac + case $_RLD_ROOT in + $INSTALLROOT/arch*) ;; + ':') _RLD_ROOT=$INSTALLROOT/arch:/ ;; + /|*:/) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT ;; + *) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT:/ ;; + esac + $show _RLD_ROOT=$_RLD_ROOT + $show export _RLD_ROOT + export _RLD_ROOT + + # now set up PATH + # + # NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations + + case $PATH: in + $PACKAGEROOT/bin:*) + ;; + *) PATH=$PACKAGEROOT/bin:$PATH + ;; + esac + case $PATH: in + $INSTALLROOT/bin:*) + ;; + *) PATH=$INSTALLROOT/bin:$PATH + ;; + esac + $show PATH=$PATH + $show export PATH + export PATH + ;; + *) for i in package proto nmake + do if onpath $i + then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'` + EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'` + break + fi + done + case $HOSTTYPE in + $EXECTYPE) + OCC=$CC + CC=cc + hostinfo type + EXECTYPE=$_hostinfo_ + case $HOSTTYPE in + $EXECTYPE) + echo "$command: $CC: seems to be a cross-compiler" >&2 + echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2 + echo "$command: If not, your $TMPDIR directory may be mounted without execute permission." >&2 + echo "$command: Try exporting TMPDIR as a directory where you can execute binary files." >&2 + exit 1 + ;; + esac + ;; + esac + $show EXECTYPE=$EXECTYPE + $show export EXECTYPE + export EXECTYPE + ;; + esac + $show EXECROOT=$EXECROOT + $show export EXECROOT + export EXECROOT + + # use these if possible + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + + # grab a decent default shell + + checksh "$SHELL" || KEEP_SHELL=0 + case $KEEP_SHELL in + 0) save_PATH=$PATH + if PATH=`getconf PATH 2>/dev/null` + then PATH=$PATH:$path + else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path + fi + for i in ksh ksh93 mksh yash bash sh + do if onpath "$i" && checksh "$_onpath_" + then SHELL=$_onpath_ + KEEP_SHELL=1 + break + fi + done + PATH=$save_PATH + unset save_PATH + case $KEEP_SHELL in + 0) echo "Cannot find good default shell, please supply SHELL=/path/to/shell" >&2 + exit 1 ;; + esac + ;; + esac + export SHELL + $show SHELL=$SHELL + $show export SHELL + + # tame the environment + + case $action in + use) ;; + *) ENV= + ERROR_OPTIONS= + export ENV ERROR_OPTIONS + ;; + esac + + # finalize the views + + case $USER_VPATH in + '') case $VPATH in + ?*) IFS=':' + set '' $VPATH + shift + IFS=$ifs + USER_VPATH= + for i + do case $i in + */arch/$HOSTTYPE) ;; + */arch/*/*) ;; + */arch/*) continue ;; + esac + if packageroot $i + then case $USER_VPATH in + '') USER_VPATH=$i ;; + ?*) USER_VPATH=$USER_VPATH:$i ;; + esac + fi + done + esac + ;; + esac + case $USER_VPATH in + ?*) IFS=':' + set '' $USER_VPATH + shift + IFS=$ifs + USER_VPATH= + USER_VPATH_CHAIN= + p=$PACKAGEROOT + for i + do case $i in + ''|$PACKAGEROOT|$INSTALLROOT) + ;; + ?*) USER_VPATH=$USER_VPATH:$i + USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" + p=$i + case $PROTOROOT in + -) executable $i/bin/mamake && PROTOROOT= ;; + esac + ;; + esac + done + ;; + esac + ;; +esac + +PACKAGESRC=$PACKAGEROOT/lib/package +PACKAGEBIN=$INSTALLROOT/lib/package +case $action:$run in +use:-) set '' $args + shift + case $# in + 0) ;; + *) shift ;; + esac + run="$@" + ;; +esac + +# HOSTTYPE specific package profile + +if test -r $INSTALLROOT/lib/package/profile +then . $INSTALLROOT/lib/package/profile +fi + +# more cygwin hassles + +case $HOSTTYPE in +cygwin.*) + lose= + case $CYGWIN in + *nontsec*) + lose=ntsec + ;; + *ntsec*);; + *) exe=$TMPDIR/pkg$$.exe + rm -f "$exe" + : > "$exe" + if test -x "$exe" + then lose=ntsec + fi + ;; + esac + case $CYGWIN in + *nobinmode*) + case $lose in + '') lose=binmode ;; + *) lose="$lose binmode" ;; + esac + ;; + esac + case $lose in + ?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2 + exit 1 + ;; + esac + ;; +esac + +# set up the view state + +VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT" +VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH +$show VPATH=$VPATH +$show export VPATH +export VPATH +IFS=':' +set '' $VPATH +shift +IFS=$ifs +for i +do case $i in + */arch/*/*) + VIEW_src="$VIEW_src $i" + ;; + */arch/*) + VIEW_bin="$VIEW_bin $i" + ;; + *) + VIEW_src="$VIEW_src $i" + ;; + esac + VIEW_all="$VIEW_all $i" +done + +# return 0 if arg in src|bin|all view + +view() # [test] [-|type] [src|bin|all] file +{ + case $1 in + -[dfsx])_view_T_=$1; shift ;; + *) _view_T_=-f ;; + esac + case $1 in + -) _view_t_= ;; + *) _view_t_=$1 ;; + esac + shift + case $1 in + all) shift; _view_v_=$VIEW_all ;; + bin) shift; _view_v_=$VIEW_bin ;; + src) shift; _view_v_=$VIEW_src ;; + *) _view_v_=$VIEW_all ;; + esac + case $1 in + /*) if test $_view_T_ $1 + then _view_=$1 + return 0 + fi + ;; + *) for _view_d_ in $_view_v_ + do if test $_view_T_ $_view_d_/$1 + then _view_=$_view_d_/$1 + return 0 + fi + done + ;; + esac + _view_= + case $_view_t_ in + ?*) echo $command: $1: $_view_t_ not found >&2 ;; + esac + return 1 +} + +# determine the package and targets + +case $action in +admin) case $admin_action in + results)action=$admin_action + set '' $admin_args + shift;shift + admin_args="admin $*" + case $admin_on in + '') target=$admin_args ;; + *) target="on $admin_on $admin_args" ;; + esac + ;; + esac + ;; +release)set '' $args + target= + while : + do shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + target="$target $1" + ;; + *) break + ;; + esac + done + package=$* + ;; +setup) # { update read } with optional (bin|fun|include|lib) symlinks + # flat option sets up { bin fun include lib } symlinks from + # $INSTALLROOT to $PACKAGEROOT + + # . is the package root + + set '' $args + shift + types= + url= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + flat) flat=1 # backwards compatibility -- documentation dropped + ;; + *://*|*.url) + url=$1 + shift + break + ;; + *) types="$types $1" + ;; + esac + shift + done + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + fi + case " $types " in + *" source "*) + case " $* " in + ' ') ;; + *" INIT "*) + ;; + *) view - all src/cmd/INIT || + set INIT "$@" + ;; + esac + ;; + esac + packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT` + case $packages in + ?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT + esac + exit + ;; +*) package= + target= + set '' $args + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + ''|-) target="$target $package" + package= + ;; + *) if view - src "lib/package/$1.pkg" + then package="$package $1" + else target="$target $package $1" + package= + fi + ;; + esac + done + ;; +esac + +# flatten -- assumes symlink support + +case $flat in +1) case $action in + make|read|setup|update|use|view) + if test ! -d $INSTALLROOT + then $exec mkdir -p $INSTALLROOT || exit + fi + for i in bin include lib fun man share + do if test ! -d $INSTALLROOT/../../$i + then $exec mkdir $INSTALLROOT/../../$i + fi + if test ! -d $INSTALLROOT/$i + then if test ! -h $INSTALLROOT/$i + then $exec ln -s ../../$i $INSTALLROOT/$i + fi + elif test ! -h $INSTALLROOT/$i + then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/* + do if test -f $x -o -d $x + then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x + then $exec mv $x $INSTALLROOT/../../$i + fi + fi + done + $exec rm -rf $INSTALLROOT/$i + $exec ln -s ../../$i $INSTALLROOT/$i + fi + done + ;; + esac + ;; +esac + +# check that cmd args are up to date a.out's + +checkaout() # cmd ... +{ + case $PROTOROOT in + -) PROTOROOT= + case $* in + ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT + then test -f $INITROOT/hello.c || { + cat > $INITROOT/hello.c <<'!' +#ifndef printf +#include +#endif +int main() { int new = 0; printf("hello world\n"); return new;} +! + } + test -f $INITROOT/p.c || { + cat > $INITROOT/p.c <<'!' +/* + * small test for prototyping cc + */ + +int main(int argc, char** argv) { return argc || argv; } +! + } + fi + ;; + esac + test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || { + for i + do onpath $i || { + echo "$command: $i: command not found" >&2 + return 1 + } + done + return 0 + } + case $cc in + '') _PACKAGE_cc=0 + ;; + *) _PACKAGE_cc=1 + test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { + echo "$command: $INITROOT: INIT package source not found" >&2 + return 1 + } + executable $INSTALLROOT/bin/nmake || { + # check for prototyping cc + # NOTE: proto.c must be K&R compatible + + $CC -c $INITROOT/p.c >/dev/null 2>&1 + c=$? + rm -f p.* + test 0 != "$c" && { + checkaout proto || return + PROTOROOT=$PACKAGEROOT/proto + $show PROTOROOT=$PACKAGEROOT/proto + export PROTOROOT + INITPROTO=$PROTOROOT/src/cmd/INIT + note proto convert $PACKAGEROOT/src into $PROTOROOT/src + if test -d $PACKAGEROOT/src/cmd/nmake + then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" + else dirs="src" + fi + ( + if test -f $PROTOROOT/UPDATE + then newer="-newer $PROTOROOT/UPDATE" + else newer="" + fi + case $exec in + '') cd $PACKAGEROOT + find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto + ;; + *) $exec cd $PACKAGEROOT + $exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto" + ;; + esac + $exec touch $PROTOROOT/UPDATE + ) + VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + } + } + for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return + done + ;; + esac + ;; + esac + case $_PACKAGE_cc in + '') case $cc in + '') _PACKAGE_cc=0 ;; + *) _PACKAGE_cc=1 ;; + esac + ;; + esac + for i + do eval j=\$_PACKAGE_AOUT_$i + case $j in + '') eval _PACKAGE_AOUT_$i=1 ;; + *) continue ;; + esac + k=$_PACKAGE_cc + if test -f $INITROOT/$i.c + then k=${k}1 + else k=${k}0 + fi + if executable $EXECROOT/bin/$i + then k=${k}1 + else k=${k}0 + fi + : $k : compiler : source : binary : + case $k in + *00) view - bin/$i && continue ;; + esac + case $k in + 000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 110) case $CROSS in + 1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2 + return 1 + ;; + esac + ;; + ?01) : accept binary + continue + ;; + 011) : accept binary + continue + ;; + ??1) case $CROSS in + 1) continue ;; + esac + ;; + esac + case `ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.c"*) + note update $INSTALLROOT/bin/$i + if test proto != "$i" && executable $INSTALLROOT/bin/proto + then case $exec in + '') $INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c || return ;; + *) $exec "$INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c" ;; + esac + $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $i.c || return + $exec rm -f $i.c + else if test ! -d $INSTALLROOT/bin + then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return + done + fi + if test '' != "$PROTOROOT" -a -f $INITPROTO/$i.c + then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return + else $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return + fi + case $i:$exec in + proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include + $INSTALLROOT/bin/proto -f /dev/null > $i.c + cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h + rm $i.c + ;; + esac + fi + test -f $i.o && $exec rm -f $i.o + i=$PATH + PATH=/bin + PATH=$i + ;; + esac + done + return 0 +} + +# check package requirements against received packages + +requirements() # source|binary [ package ] +{ + case $1 in + binary) r=$VIEW_BIN ;; + source) r=$VIEW_SRC ;; + *) r=$VIEW_ALL ;; + esac + shift + case $1 in + '') x= ;; + *) x=$* ;; + esac + set '' + for d in $r + do set "$@" $d/gen/*.ver + case $x in + '') set "$@" $d/gen/*.req + ;; + *) for p in $x + do set "$@" $d/gen/$p.req + done + ;; + esac + done + shift + e=0 + x=$* + y= + n= + set '' + for i in $x + do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'` + if test -f $i + then set "$@" $i + y="$y $p" + else case $p in + '*') ;; + *) n="$n $p" ;; + esac + fi + done + for i in $n + do case " $y " in + *" $i "*) + ;; + *) echo "$command: $i: must read or write package" >&2 + e=1 + ;; + esac + done + case $e in + 1) exit 1 ;; + esac + shift + test 0 != "$#" && release=`sort -r "$@" | { + q= + e=0 + o= + while read p v r s + do q="$q +$v $r" + case $p in + $o) continue ;; + esac + case $s in + 0) e=1 + case $r in + base) echo "$command: base package $p.$v or newer required" >&2 ;; + *) echo "$command: delta package $p.$v.$r or newer required" >&2 ;; + esac + ;; + esac + o=$p + done + case $e in + 0) echo "$q" | sort | { read v r; read v r; echo $v; } ;; + 1) echo ERROR ;; + esac + }` + case $release in + ERROR) case $force in + 0) exit 1 ;; + esac + ;; + ?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'` + # slide back 4 months + case $mm in + 01) mm=09 dd=1 ;; + 02) mm=10 dd=1 ;; + 03) mm=11 dd=1 ;; + 04) mm=12 dd=1 ;; + 05) mm=01 dd=0 ;; + 06) mm=02 dd=0 ;; + 07) mm=03 dd=0 ;; + 08) mm=04 dd=0 ;; + 09) mm=05 dd=0 ;; + 10) mm=06 dd=0 ;; + 11) mm=07 dd=0 ;; + 12) mm=08 dd=0 ;; + esac + case $dd in + 1) yy=`expr $yy - 1` ;; + esac + release=$yy-$mm-01 + count=1 + lo=$release + release="-f $release -r $count" + ;; + esac +} + +# write ordered package prerequisite list to the standard output + +order() # [ package ] +{ + _order_t_=lib/package/tgz + case $action in + binary) _order_a_=.$HOSTTYPE ;; + *) _order_a_= ;; + esac + _order_n_=$# + case $_order_n_ in + 0) _order_p_= + for _order_v_ in $VIEW_all + do for _order_f_ in $_order_v_/lib/package/*.pkg + do if test -f $_order_f_ + then _order_p_="$_order_p_ $_order_f_" + fi + done + done + set '' $_order_p_ + shift + esac + { + if test ratz != "$*" + then for _order_f_ in ratz INIT + do if view -s - src $_order_t_/$_order_f_$_order_a_.tim + then echo $_order_f_ $_order_f_ + fi + done + fi + for _order_f_ + do while : + do view - src $_order_f_ && break + case $_order_f_ in + *.pkg) ;; + *) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;; + esac + case $_order_f_ in + */*) ;; + *) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;; + esac + echo "$command: $_order_f_: not a package" >&2 + continue 2 + done + _order_f_=$_view_ + _order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'` + case $_order_n_ in + 0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;; + esac + echo $_order_p_ $_order_p_ + case $_order_p_ in + INIT|ratz) + ;; + *) echo INIT $_order_p_ + ;; + esac + { + req= req_sep= + op=:: + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + for _order_i_ in $req + do if view - src lib/package/$_order_i_.pkg + then case $_order_u_ in + 0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;; + esac + echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_ + fi + done + } < $_order_f_ + done + } | tsort +} + +# generate the package component list in _components_ + +components() # [ package ] +{ + _components_= + for p + do case $p in + '') ;; + INIT) case " $_components_ " in + *" $p "*) ;; + *) _components_="$_components_ $p" ;; + esac + ;; + *) if view - src lib/package/$p.pkg + then p=$_view_ + op=:: + exec < $p + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :PACKAGE:) + case " $_components_ " in + *" $1 "*) ;; + *) _components_="$_components_ $1" ;; + esac + ;; + esac + ;; + esac + done + done + exec < /dev/null + elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p + then _components_="$_components_ $p" + else echo "$command: $p: package or component not found" >&2 + exit 1 + fi + ;; + esac + done +} + +# list main environment values + +showenv() +{ + case $1 in + ''|make)for __i__ in CC SHELL $env + do eval echo $__i__='$'$__i__ + done + ;; + esac +} + +# capture command output + +capture() # file command ... +{ + case $make:$noexec in + :) case $action in + install|make|view) + o=$action + ;; + *) case $package in + ''|*' '*) + o=$action + ;; + *) o=$package + ;; + esac + ;; + esac + case $action in + write) d=$PACKAGESRC/gen ;; + *) d=$PACKAGEBIN/gen ;; + esac + test -d $d || $exec mkdir $d + o=$d/$o + case $o in + $output)o=$o.out + s= + ;; + *) output=$o + if test -f $o.old + then mv $o.old $o.out.1 + if test -f $o.out + then mv $o.out $o.out.2 + fi + elif test -f $o.out + then for i in `ls -t $o.out.? 2>/dev/null` + do break + done + case $i in + *.1) i=2 ;; + *.2) i=3 ;; + *.3) i=4 ;; + *.4) i=5 ;; + *.5) i=6 ;; + *.6) i=7 ;; + *.7) i=8 ;; + *.8) i=9 ;; + *) i=1 ;; + esac + mv $o.out $o.out.$i + fi + o=$o.out + : > $o + note $action output captured in $o + s="$command: $action start at `date` in $INSTALLROOT" + case $quiet in + 0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;; + *) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;; + esac + ;; + esac + case $quiet in + 0) if executable ! $TEE + then TEE=tee + fi + # Connect 'tee' to a FIFO instead of a pipe, so that the build is invoked from + # the main shell environment and its exit status can be used for $error_status + rm -f $o.fifo + mkfifo -m 600 $o.fifo || exit + ( + sleep 1 + # unlink early + exec rm $o.fifo + ) & + $TEE -a $o < $o.fifo & + { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o.fifo 2>&1 + ;; + *) { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o 2>&1 + ;; + esac + ;; + *) $make "$@" + ;; + esac + exit_status=$? + if test "$exit_status" -gt "$error_status" + then error_status=$exit_status + fi +} + +package_install() # dest sum +{ + dest=$1 sum=$2 + ot= + code=0 + sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum | + while read mode user group arch dir file + do case $flat:$arch in + 1:*|?:.)t=$dest/$dir ;; + *) t=$dest/$arch/$dir ;; + esac + case $t in + $ot) ;; + *) if test ! -d "$t" + then $exec mkdir -p "$t" || exit + fi + ot=$t + ;; + esac + case $file in + ?*) case $arch in + .) f=$dir/$file ;; + *) f=$arch/$dir/$file ;; + esac + if test -f "$f" + then t=$t/$file + case $quiet in + 0) echo "$t" ;; + esac + $exec cp -f "$f" "$t" || code=1 + $exec chmod $mode "$t" || code=1 + fi + ;; + esac + done + return $code +} + +package_verify() # sum +{ + $exec $SUM -cp $1 +} + +make_recurse() # dir +{ + for _make_recurse_j in $makefiles + do if view - $1/$_make_recurse_j + then return + fi + done +} + +get() # host path [ file size ] +{ + case $HURL in + '') HURL=. + for i in wget lynx curl + do if onpath $i + then HURL=$i + break; + fi + done + AUTHORIZE="User-Agent: package AT&T Research\\r\\n" + case $HURL:$authorize in + .:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;; + esac + ;; + esac + getfd=8 + case $3 in + '') case $HURL in + .) host=$1 + path=$2 + while : + do eval "exec $getfd<> /dev/tcp/$host/80" || exit + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + cat <&8 > get.tmp + got=`sed -e 1q get.tmp` + case $got in + *" "200" "*) + got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d' get.tmp` + : > get.err + code=0 + break + ;; + *" "30[123]" "*) + got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp` + case $got in + '') rm get.tmp + echo "$command: $action: $url: redirect error" >&2 + exit 1 + ;; + esac + eval $got + ;; + *) rm get.tmp + echo "$command: $action: $url: $got" >&2 + echo '' "$got" > get.err + code=1 + break + ;; + esac + done + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err + code=$? + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp 2>/dev/null` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm -f get.tmp get.err + echo $command: $action: $2: download failed >&2 + exit 1 + fi + rm -f get.tmp get.err + ;; + *) case $exec in + '') echo "$3 ($4 bytes):" >&2 + case $HURL in + .) eval "exec $getfd<> /dev/tcp/$1/80" || exit + path=$2/$3 + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + read got <&$getfd + case $got in + *" 200 "*) + code=0 + : > get.err + ;; + *) echo '' "$got" > get.err + code=1 + ;; + esac + while read got <&$getfd + do case $got in + ''|?) break ;; + esac + done + cat <&$getfd > get.tmp + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$? + esac + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err + code=$? + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm get.tmp get.err + echo $command: $action: $3: download failed >&2 + exit 1 + fi + rm get.err + case $checksum:$5 in + :*|*:-) z=`wc -c < get.tmp` + case " $z " in + *" $4 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download error: expected $4 bytes, got $z >&2 + exit 1 + ;; + esac + ;; + *) z=`$checksum < get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + case " $z " in + *" $5 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download $checksum error: expected $5, got $z >&2 + exit 1 + ;; + esac + ;; + esac + mv get.tmp $3 || exit + ;; + *) echo "$3 ($4 bytes)" >&2 + ;; + esac + esac +} + +# generate copyright notice + +copyright() +{ + if test -f $1.lic + then echo $1 package general copyright notice + echo + proto -c'#' -p -s -l $1.lic -o type=verbose,author='*' /dev/null + return 0 + fi + case $1 in + *-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'` + if copyright $__i__ || copyright $__j__ + then return 0 + fi + ;; + esac + return 1 +} + +# run remote make on host + +remote() # host no-exec-background +{ + host=$1 + background=$2 + eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log + case $keep in + 1*) ;; + *) return ;; + esac + case $host in + $main) ;; + *) case $exec in + '') exec > $admin_log/$log 2>&1 ;; + *) echo "exec > $admin_log/$log 2>&1" ;; + esac + ;; + esac + if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1 + then cmd=". ./.profile" + case $root in + .) root= + ;; + *) cmd="$cmd && cd $root" + root=$root/ + ;; + esac + cmd="$cmd && { test -f lib/package/admin/$admin_env && . ./lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='" + case $admin_binary in + '') snarf= ;; + esac + case $snarf in + '') $exec $rsh $user$name "$cmd" $background + ;; + *?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp + case $background in + ?*) $exec "{" ;; + esac + $exec $rsh $user$name "$cmd" + eval lst=$admin_list + case $admin_pkgs in + '') filter=cat ;; + *) filter="egrep lib/package/tgz/($admin_pkgs)\\." ;; + esac + if $exec $rcp $user$name:${root}lib/package/tgz/$lst $PACKAGESRC/tgz + then $exec $rcp `$filter $PACKAGESRC/tgz/$lst | sed "s,^,$user$name:,"` $PACKAGESRC/tgz + else echo "$command: $user$name:${root}lib/package/tgz/$lst: not found" >&2 + fi + case $background in + ?*) $exec "} $background" ;; + esac + ;; + esac + else echo "$command: $name: down" >&2 + fi +} + +# update package_src + +checksrc() +{ + case $package_src in + '') package_src=$src + for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>/dev/null | sed 's/[-.].*//'` + do case " $package_src " in + *" $_i_ "*) + ;; + *) package_src="$package_src $_i_" + ;; + esac + done + ;; + esac +} + +# check for native ascii 0:yes 1:no + +__isascii__= + +isascii() +{ + case $__isascii__ in + '') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in + 005101|040412) __isascii__=0 ;; + *) __isascii__=1 ;; + esac + esac + return $__isascii__ +} + +error_status=0 + +case $action in + +admin) while test ! -f $admin_db + do case $admin_db in + /*) echo $command: $action: $admin_db: data file not found >&2 + exit 1 + ;; + esac + view file src lib/package/admin/$admin_db || exit 1 + admin_db=$_view_ + done + admin_components= + case $admin_action in + list) cat $admin_db + exit + ;; + test) set $admin_args + while : + do case $# in + 1) break ;; + esac + shift + case $1 in + *=*) ;; + *) admin_components=-$1 + break + ;; + esac + done + ;; + esac + : all work done in $PACKAGESRC/admin + cd $PACKAGESRC/admin || exit + checksrc + packages= + admin_log=${admin_action}${admin_components}.log + exec < $admin_db || exit + test -d $admin_log || $exec mkdir $admin_log || exit + case $admin_on in + '') admin_on="*" ;; + esac + hostname= + hosts= + logs= + local_hosts= + local_types= + pids= + remote_hosts= + sync_hosts= + admin_host=_admin_host_ + admin_out= + case " $admin_args " in + *" write binary "*|*" write "*" binary "*) + admin_binary=1 + ;; + *) admin_binary= + ;; + esac + case $only in + 1) admin_args="only $admin_args" ;; + esac + trap 'kill $pids >/dev/null 2>&1' 1 2 3 15 + index=0 + while read type host root date time make test write owner attributes + do case $type in + ''|'#'*);; + *=*) eval "$type $host $root $date $time $make $test $write $owner $attributes" + ;; + *) case $admin_action in + make|test|write) + eval f='$'$admin_action + case $f in + *[!0123456789]*) continue ;; + esac + ;; + esac + rsh=rsh + case $host in + *@*) IFS=@ + set '' $host + IFS=$ifs + user=${2}@ + host=$3 + ;; + *) user= + ;; + esac + : type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write : + name=$host + host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'` + eval x='$'${host}_index + eval ${host}_index=1 + case $x in + 1) i=0 + while : + do case $i in + $index) h='' + break + ;; + esac + i=`expr $i + 1` + eval h='$'${admin_host}${i}_name + case $h in + $host) host=${admin_host}${i} + eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root + break + ;; + esac + done + ;; + esac + case $root in + *:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;; + esac + case $root in + *:*:*) index=`expr $index + 1` + host=${admin_host}$index + ;; + *:*) case " $sync_hosts " in + *" $name ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $name) host=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + sync_hosts="$sync_hosts $name $host" + ;; + esac + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + ;; + esac + case $root in + -*) continue + ;; + *:*) case $admin_all in + 0) continue ;; + esac + case $root in + *:) root=${root}. ;; + esac + IFS=: + set '' $root + IFS=$ifs + sync=$host + case $hostname in + '') hostinfo name + hostname=$_hostinfo_ + ;; + esac + shift + case $# in + 0) ;; + 1) root=$1 + ;; + 2) rsh=$1 root=$2 + ;; + *) rsh=$1 sync=$2 root=$3 + case $sync in + ${admin_host}*) + ;; + ?*) case " $sync_hosts " in + *" $sync ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $sync) sync=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + x=${admin_host}$index + sync_hosts="$sync_hosts $sync $x" + sync=$x + ;; + esac + ;; + esac + ;; + esac + ;; + *) sync= + ;; + esac + case $name in + $admin_on) + keep=1 + ;; + *) case " $admin_on " in + *" $name "*) keep=1 ;; + *) keep=0 ;; + esac + ;; + esac + case " $admin_out " in + *" $name "*) + log=$name.$type + ;; + *) admin_out="$admin_out $name" + log=$name + ;; + esac + case $sync in + '') local_types="$local_types $type" ;; + esac + case $sync in + $host) remote_hosts="$remote_hosts $host" + ;; + ?*) eval ${sync}_share=\"\$${sync}_share $host\" + ;; + '') local_hosts="$local_hosts $host" + ;; + esac + eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log + ;; + esac + done + p= + for i in $admin_args + do p="$i $p" + done + admin_pkgs= + for i in $p + do if view - src "lib/package/$i.pkg" + then case $admin_pkgs in + '') admin_pkgs="$i" ;; + *) admin_pkgs="$admin_pkgs|$i" ;; + esac + fi + done + : "admin_binary :" $admin_binary + : "admin_args :" $admin_args + : "admin_pkgs :" $admin_pkgs + : "admin_on :" "$admin_on" + : "local_hosts :" $local_hosts + : "local_types :" $local_types + : "remote_hosts :" $remote_hosts + : "sync_hosts :" $sync_hosts + : "sync_share :" $sync_share + case $admin_binary in + 1) admin_bin_types= + admin_bin_main= + for main in $local_hosts $remote_hosts + do eval share=\$${main}_share keep=\$${main}_keep + case $keep in + 0*) continue ;; + esac + for host in $main $share + do case " $admin_bin_hosts " in + *" $host "*) + continue + ;; + esac + eval type=\$${host}_type + case " $admin_bin_types " in + *" $type "*) + continue + ;; + esac + case " $types " in + " ") ;; + *" $type "*) + ;; + *) continue + ;; + esac + admin_bin_hosts="$admin_bin_hosts $host" + admin_bin_types="$admin_bin_types $type" + case " $admin_bin_hosts " in + *" $main "*) + ;; + *) case " $admin_bin_main " in + *" $main "*) + ;; + *) admin_bin_main="$admin_bin_main $main" + ;; + esac + ;; + esac + done + done + local= + remote= + for host in $admin_bin_main $admin_bin_hosts + do case " $local_hosts " in + *" $host "*) + local="$local $host" + ;; + *) case " $remote_hosts " in + *" $host "*) + remote="$remote $host" + ;; + esac + ;; + esac + done + local_hosts=$local + remote_hosts=$remote + ;; + esac + for host in $remote_hosts $local_hosts + do eval share=\$${host}_share + case $share in + ?*) while : + do oshare=$share + for s in $share + do eval r='$'${s}_share + case $r in + ?*) case " $share " in + *" $r "*) ;; + *) share="$share $r" ;; + esac + ;; + esac + done + case $share in + $oshare) eval ${host}_share="'$share'" + break + ;; + esac + done + ;; + esac + done + for host in $remote_hosts + do eval type=\$${host}_type + case " $local_types " in + *" $type "*) + eval ${host}_snarf= + ;; + esac + eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share + for share in $share + do eval type=\$${share}_type keep=\$keep\$${share}_keep + case " $local_types " in + *" $type "*) + eval ${share}_snarf= + ;; + esac + done + case $keep in + 0*1*) keep=2$keep ;; + *1*) ;; + *) keep=0 ;; + esac + eval ${host}_keep=$keep + done + for host in $remote_hosts $local_hosts + do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep + case $keep in + 0*) continue ;; + esac + case $sync in + '') case $admin_action in + ditto) continue ;; + esac + case $admin_binary in + 1) case $keep in + 1*|?*1*);; + *) continue ;; + esac + ;; + esac + ;; + esac + eval main_log='$'${host}_log + main= + share_keep= + for i in $host $share + do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep + case $main:$k in + :*) ;; + *:0) continue ;; + esac + case $admin_binary in + 1) case $s:$q in + :?*) continue ;; + esac + case " $admin_bin_hosts " in + *" $i "*) + ;; + *) continue + ;; + esac + ;; + esac + case $main in + '') main=$i ;; + *) share_keep="$share_keep $i" ;; + esac + echo package "$admin_args" "[ $n $t ]" + case $exec in + '') : > $admin_log/$l ;; + *) $exec ": > $admin_log/$l" ;; + esac + done + host=$main + share=$share_keep + case $force in + 0) admin_ditto_update=--update ;; + *) admin_ditto_update= ;; + esac + case $exec in + '') { + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin + test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 & + pids="$pids $!" + ;; + esac + done + case $pids in + ?*) wait $pids ;; + esac + ;; + esac + } < /dev/null > $admin_log/$main_log 2>&1 & + pids="$pids $!" + ;; + *) echo "{" + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 "&" + pids=1 + ;; + esac + done + case $pids in + 1) echo wait ;; + esac + ;; + esac + echo "} < /dev/null > $admin_log/$main_log 2>&1 &" + ;; + esac + eval name='$'${main}_name + hosts="$hosts $name" + logs="$logs $main_log" + for share in $share + do eval keep=\$${share}_keep + case $keep in + 1) eval name='$'${share}_name log='$'${share}_log + hosts="$hosts $name" + logs="$logs $log" + ;; + esac + done + done + case $exec in + '') # track the progress + case $quiet in + 0) cd $admin_log + tail -t $PACKAGE_admin_tail_timeout -f $logs + cd .. + ;; + esac + # wait for the remote actions to complete + wait + trap - 1 2 3 15 + # update the db + exec < $admin_db || exit + exec 9>&1 + D=`date +%y%m%d` + while read line + do set -- $line + case $1 in + ''|'#'*|*=*) + ;; + *) case " $hosts " in + *" $2 "*) + : ast date command assumed : + E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\`` + M=$6 T=$7 W=$8 + case $admin_action in + make|view) + M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;; + test) T=`grep -ci 'fail[es]' $admin_log/$2` ;; + *) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;; + esac + case $1 in + ?|??|???|????|?????|??????|???????) + t1=' ' + ;; + ????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????) + t1=' ' + ;; + *) t1='' + ;; + esac + case $2 in + ?|??|???|????|?????|??????|???????) + t2=' ' + ;; + *) t2='' + ;; + esac + case $3 in + ?|??|???|????|?????|??????|???????) + t3=' ' + ;; + *) t3='' + ;; + esac + case $E in + ?????) E=" $E" ;; + ????) E=" $E" ;; + ???) E=" $E" ;; + ??) E=" $E" ;; + ?) E=" $E" ;; + esac + case $M in + ???) M="$M" ;; + ??) M=" $M" ;; + ?) M=" $M" ;; + '') M=" 0" ;; + esac + case $T in + ???) T="$T" ;; + ??) T=" $T" ;; + ?) T=" $T" ;; + '') T=" 0" ;; + esac + case $W in + ???) W="$W" ;; + ??) W=" $W" ;; + ?) W=" $W" ;; + '') W=" 0" ;; + esac + A=$1$t1 + H=$2$t2 + R=$3$t3 + case $# in + [0-8]) O= + K= + ;; + *) shift 8 + O=$1 + K=$2 + case $O in + ''|?|??|???) K=" $K" ;; + esac + case $# in + [0-2]) ;; + *) K="$K $*" ;; + esac + ;; + esac + echo "$A $H $R $D $E $M $T $W $O $K" + echo "$A $H $R $D $E $M $T $W $O $K" >&9 + continue + ;; + esac + ;; + esac + echo "$line" + done > $admin_db.new + mv $admin_db $admin_db.old + mv $admin_db.new $admin_db + ;; + esac + ;; + +clean|clobber) + cd $PACKAGEROOT + $exec rm -rf arch/$HOSTTYPE + if test "$flat" = 1 + then $exec rm -rf \ + bin/.paths \ + bin/ar \ + bin/cc \ + bin/crossexec \ + bin/ditto \ + bin/filter \ + bin/hurl \ + bin/iffe \ + bin/ksh \ + bin/mamake \ + bin/mktest \ + bin/ok/ \ + bin/proto \ + bin/pty \ + bin/ratz \ + bin/regress \ + bin/release \ + bin/rt \ + bin/shcomp \ + bin/suid_exec \ + bin/*.old \ + fun/ \ + include/ \ + lib/file/ \ + lib/lib/ \ + lib/libast.a \ + lib/libcmd.a \ + lib/libdll.a \ + lib/libshell.a \ + lib/libsum.a \ + lib/*.old \ + lib/make/ \ + lib/package/gen/ \ + lib/probe/ \ + man/ + fi + exit + ;; + +contents|list) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' *.pkg + case $2 in + '*.pkg') + echo $command: $action: no packages >&2 + exit 1 + ;; + esac + set '' `echo $* | sed 's,\.pkg,,g'` + shift + ;; + esac + sep="$nl " + echo packages in $PACKAGEROOT + case $action in + list) echo + echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t + ;; + esac + { + omit=: + for pkg + do if test ! -f $pkg.pkg + then echo $command: $action: $pkg: not a package >&2 + else if test -f gen/$pkg.ver + then set '' `cat gen/$pkg.ver` + case $3 in + $2) ver=base ;; + *) ver=$3 ;; + esac + if test -s tgz/$pkg.tim + then sts=local + else sts= + fi + else ver= + sts=unwritten + fi + typ= + txt= + cmp= cmp_sep= + req= req_sep= + op=:: + exec < $pkg.pkg + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :DESCRIPTION:) + txt="$txt$sep$line" + break + ;; + :PACKAGE:) + cmp="$cmp$cmp_sep$1" + cmp_sep=$nl + ;; + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + exec < /dev/null + case $txt in + ?*) txt="$nl$txt" ;; + esac + case :$ver: in + *::*) ;; + *) case $action in + list) case $sts in + '') case `ls -t "tgz/$pkg.$ver.base" "tgz/$pkg.tim" 2>/dev/null` in + "tgz/$pkg.tim"*) + sts=read + ;; + *) sts=unread + ;; + esac + ;; + esac + echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req" + case $typ in + '') omit=$omit$pkg.$ver.base: ;; + esac + ;; + *) case $req in + ?*) req=": $req" ;; + esac + echo + echo $pkg $ver $req "$txt" + case $cmp in + ?*) echo "${sep}Components in this package:$nl" + echo "$cmp" | pr -4 -o4 -t ;; + esac + ;; + esac + ;; + esac + fi + done + case $argc:$action in + 0:list) if test -d tgz + then cd tgz + # f:file p:package v:version r:release t:type u:update + for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r` + do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $t in + '') case $omit in + *:$p.$v.$r:*) continue ;; + esac + u=$p.tim + ;; + *) u=$p.$t.tim + ;; + esac + if test -s "$u" + then s=local + elif test -f "$u" + then case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) s=read ;; + *) s=unread ;; + esac + else s=unread + fi + echo "$p$nl$v$nl$r$nl$t$nl$s$nl" + done + fi + ;; + esac + } | + case $action in + list) pr -6 -a -o4 -t | sort -u ;; + *) cat ;; + esac + case $argc in + 0) if test -d $PACKAGEROOT/arch + then echo + echo architectures in $PACKAGEROOT + echo + for i in `ls $PACKAGEROOT/arch` + do if test -f $PACKAGEROOT/arch/$i/lib/package/gen/host + then h=`cat $PACKAGEROOT/arch/$i/lib/package/gen/host` + else h= + fi + echo $i + echo $h + echo + echo + done | pr -4 -a -o4 -t + fi + ;; + esac + ;; + +copyright) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' `echo *.lic | sed 's,\.lic,,g'` + shift + case $1 in + '*') echo $command: $action: no packages >&2 + exit 1 + ;; + esac + ;; + esac + checkaout proto || exit + for i + do copyright $i + done + ;; + +export) case $INSTALLROOT in + $PACKAGEROOT) + INSTALLROOT=$INSTALLROOT/arch/$HOSTTYPE + ;; + esac + case $only in + 0) v='$i=' ;; + *) v= ;; + esac + set '' $target $package + case $# in + 1) set '' $env ;; + esac + while : + do case $# in + 1) break ;; + esac + shift + i=$1 + eval echo ${v}'$'${i} + done + ;; + +install)cd $PACKAGEROOT + set '' $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + package=$* + requirements - $package + set '' $target + shift + case $1 in + flat) flat=1 # backwards compatibility -- documentation dropped + shift + ;; + esac + case $# in + 0) echo "$command: $action: target directory argument expected" >&2 + exit 1 + ;; + esac + target= + while : + do case $# in + 1) directory=$1 + break + ;; + esac + target="$target $1" + shift + done + if test ! -d $directory + then echo "$command: $action: $directory: target directory not found" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + makecheck=1 + for a in $target + do case $a in + -) a=$HOSTTYPE ;; + esac + case $flat:$a in + 1:*|?:.)dest=$directory + ;; + *) dest=$directory/arch/$a + if test "" = "$exec" -a ! -d $dest + then mkdir -p $dest || { + echo "$command: $dest: destination directory must exist" >&2 + exit 1 + } + fi + ;; + esac + for i in $package + do if test "ratz" = "$i" + then : skip + elif test -f arch/$a/lib/package/gen/$i.sum + then package_install $directory arch/$a/lib/package/gen/$i.sum || code=1 + elif test ! -d arch/$a/bin + then echo "$command: $a: invalid architecture" >&2 + elif test ! -d $dest + then echo "$command: $dest: destination directory must exist" >&2 + else if test "" != "$makecheck" + then if onpath $MAKE + then MAKE=$_onpath_ + else echo "$command: $MAKE: not found" >&2 + exit 1 + fi + makecheck= + fi + if test "" != "$exec" + then ( + trap - 0 1 2 15 + echo "=== $i installation manifest ===" + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u + ) + else ( + set - + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + echo lib/$command + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u | pax -drw -ps $dest + ) + fi + fi + done + done + exit $code + ;; + +license)# all work in $PACKAGESRC/LICENSES + + cd $PACKAGESRC/LICENSES || exit + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' * + shift + case $1 in + '*') echo $command: $action: no licenses >&2 + exit 1 + ;; + esac + ;; + *) checkaout proto || exit + a= + for i + do while : + do if test -f ../$i.lic + then j=`proto -df -l ../$i.lic -o query=type /dev/null 2>/dev/null` + case $j in + ?*) if test -f $j + then case " $a " in + *" $j "*) ;; + *) a="$a $j" ;; + esac + fi + break + ;; + esac + fi + case $i in + *-*) i=`echo $i | sed 's/-[^-]*$//'` + ;; + *) echo "$command: $i: package license not found" >&2 + break + ;; + esac + done + done + set '' $a + shift + ;; + esac + for i + do case $exec in + '') echo + echo " --- $i source license ---" + echo + cat $i + ;; + *) echo $PACKAGESRC/LICENSES/$i + ;; + esac + done + ;; + +make|view) + cd $PACKAGEROOT + case $package in + '') lic="lib/package/*.lic" + ;; + *) for i in $package + do lic="$lic lib/package/$i.lic" + case $i in + *-*) lic="$lic lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;; + esac + done + ;; + esac + checksrc + requirements source $package + components $package + package=$_components_ + + # check for some required commands + + must="$AR" + warn="$NM yacc bison" + test="$must $warn" + have= + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for t in $test + do if executable $t + then have="$have $t" + fi + done + for d + do for t in $test + do case " $have " in + *" $t "*) + ;; + *) if executable $d/$t + then have="$have $t" + fi + ;; + esac + done + done + case " $have " in + *" bison "*) ;; + *" yacc "*) have="$have bison" ;; + esac + case " $have " in + *" yacc "*) ;; + *" bison "*) have="$have yacc" ;; + esac + for t in $test + do case " $have " in + *" $t "*) + ;; + *) case " $must " in + *" $t "*) + echo "$command: $t: not found -- must be on PATH to $action" >&2 + exit 1 + ;; + *) echo "$command: warning: $t: not found -- some $action actions may fail" >&2 + ;; + esac + ;; + esac + done + + # verify the top view + + if test ! -d $PACKAGEROOT/src + then note no source packages to make + exit 0 + elif test ! -d $INSTALLROOT/src + then note initialize the $INSTALLROOT view + fi + for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in bin bin/$OK bin/$OK/lib fun include lib lib/package lib/package/gen src man man/man1 man/man3 man/man8 + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + make_recurse src + o= k= + for i in $makefiles + do case $o in + ?*) o="$o -o" k="$k|" ;; + esac + o="$o -name $i" + k="$k$i" + done + o="( $o ) -print" + for d in $package_src + do i=src/$d + if test -d $i + then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + make_recurse $i + for j in `cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u` + do case $j in + $k|$MAKESKIP) continue ;; + esac + test -d $INSTALLROOT/$i/$j || + $exec mkdir -p $INSTALLROOT/$i/$j || exit + done + fi + done + def= + for i in $lic + do test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + for j in `grep '^. .*\.def$' $i` + do case $j in + .) ;; + *) case " $def " in + *" $i "*) ;; + *) def="$def $i" ;; + esac + ;; + esac + done + done + for i in $def + do i=lib/package/$i + test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + done + + # check $CC and { ar cc ld ldd } intercepts + + h="${HOSTTYPE} ${HOSTTYPE}.*" + case $HOSTTYPE in + *.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'` + h="$h $t" + ;; + *) t=$HOSTTYPE + ;; + esac + case $t in + *[0123456789]) + t=`echo $t | sed 's/[0123456789]*$//'` + h="$h $t" + ;; + esac + case $CC in + cc) c=cc + b=$INSTALLROOT/bin/$c + t=$INSTALLROOT/lib/package/gen/$c.tim + intercept=0 + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + if cmp -s "$s" "$b" >/dev/null 2>&1 + then intercept=1 + break 2 + fi + case `ls -t "$t" "$b" "$s" 2>/dev/null` in + $t*) ;; + $b*) cc=$b + ;; + $s*) cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + eval '$'exec echo "'int main(){return 0;}' > $tmp.c" + if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && + test -x $tmp.exe + then case $HOSTTYPE in + *.mips*)$s -version >/dev/null 2>&1 || s= ;; + esac + case $s in + ?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit + $exec chmod +x "$b" || exit + cc=$b + intercept=1 + note update $b + ;; + esac + fi + $exec rm -f $tmp.* + $exec touch "$t" + cd $PACKAGEROOT + ;; + esac + break 2 + done + done + case $intercept in + 1) c=ld + b=$INSTALLROOT/bin/$c + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done + done + ;; + esac + ;; + esac + c=ldd + b=$INSTALLROOT/bin/$c + for t in $h + do s=$INITROOT/$c.$t + test -x "$s" || continue + onpath $c || + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done + c=ar + b=$INSTALLROOT/bin/$c + for t in $h + do s=$INITROOT/$c.$t + test -x "$s" || continue + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done +# following code stubbed out just in case ar.ibm.risc is needed +# c=ar +# b=$INSTALLROOT/bin/$c +# for t in $h +# do s=$INITROOT/$c.$t +# test -x "$s" || continue +# onpath $c || +# case `ls -t "$b" "$s" 2>/dev/null` in +# $b*) ;; +# $s*) x=`$s -tv /foo/bar.a 2>&1 | egrep -i 'option|usage'` +# case $x in +# '') $exec cp "$s" "$b" +# note update $b +# ;; +# esac +# ;; +# esac +# done + case $cc in + /*) ;; + *) echo "$command: $CC: not found -- set CC=C-compiler" >&2 + exit 1 + ;; + esac + case $exec in + '') cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + echo 'int main(){return 0;}' > $tmp.c + if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && + test -x $tmp.exe + then : ok + else echo "$command: $CC: failed to compile this program:" >&2 + cat $tmp.c >&2 + if test -s $tmp.err + then cat $tmp.err >&2 + else echo "$command: $CC: not a C compiler" >&2 + fi + rm -f $tmp.* + exit 1 + fi + rm -f $tmp.* + cd $PACKAGEROOT + ;; + esac + + # remember the default $CC + + case $CC in + cc) ;; + *) if test -x $INSTALLROOT/bin/cc + then case `sed 1q $INSTALLROOT/bin/cc` in + ": $CC :") + CC=cc + export CC + ;; + *) assign="$assign CC=\"\$CC\"" + ;; + esac + else case $CROSS in + 1) assign="$assign CC=\"\$CC\"" + ;; + *) case $exec in + '') { + echo ": $CC :" + echo "$CC \"\$@\"" + } > $INSTALLROOT/bin/cc + chmod +x $INSTALLROOT/bin/cc + ;; + *) note generate a $INSTALLROOT/bin/cc wrapper for $CC + ;; + esac + CC=cc + export CC + ;; + esac + fi + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update probe scripts + + for i in lib/probe lib/probe/C lib/probe/C/make + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + i=$INSTALLROOT/lib/probe/C/make/probe + j=$INITROOT/C+probe + k=$INITROOT/make.probe + case `ls -t $i $j $k 2>/dev/null` in + $i*) ;; + *) if test -f $j -a -f $k + then note update $i + shellmagic + case $exec in + '') { + case $SHELLMAGIC in + ?*) echo "$SHELLMAGIC" ;; + esac + cat $j $k + } > $i || exit + ;; + *) echo "{ +echo $SHELLMAGIC +cat $j $k +} > $i" + ;; + esac + $exec chmod +x $i || exit + fi + ;; + esac + fi + + # initialize a few mamake related commands + + checkaout mamake proto ratz release || exit + + # execrate if necessary + + if (execrate) >/dev/null 2>&1 + then execrate=execrate + $make cd $INSTALLROOT/bin + for i in chmod chgrp cmp cp ln mv rm + do if test ! -x $OK/$i -a -x /bin/$i.exe + then shellmagic + case $exec in + '') echo "$SHELLMAGIC"'execrate /bin/'$i' "$@"' > $OK/$i + chmod +x $OK/$i + ;; + *) $exec echo \'"$SHELLMAGIC"'execrate /bin/'$i' "$@"'\'' >' $OK/$i + $exec chmod +x $OK/$i + ;; + esac + fi + done + PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + else execrate= + fi + case $action in + view) exit 0 ;; + esac + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # record the build host name + + case $noexec in + '') hostinfo name + echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host + ;; + esac + + # make in parallel if possible + + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + + # separate flags from target list + + case $target in + *-*) a= + for t in $target + do case $t in + -[eiknFKNV]*|--*-symbols) + makeflags="$makeflags $t" + ;; + -*) nmakeflags="$nmakeflags $t" + ;; + *) a="$a $t" + ;; + esac + done + target=$a + ;; + esac + + # generate nmake first if possible + + if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake + then if nonmake $MAKE + then note make $NMAKE with mamake + c=$CC + a=$assign + case $HOSTTYPE in + win32*|cygwin*) + CC="$CC -D_BLD_STATIC" + accept="libast" + case $assign in + *' CC='*) ;; + *) assign="$assign CC=\"\$CC\"" ;; + esac + ;; + *) accept=nmake + ;; + esac + eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign + assign=$a + CC=$c + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + if test '' != "$PROTOROOT" + then VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + fi + note believe generated files for $accept + eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign + $exec touch $INSTALLROOT/bin/.paths + note make the remaining targets with $NMAKE + else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + fi + + # generate ksh next if possible + + if nonmake $MAKE + then : no need to generate ksh next -- it could be the only package + elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH + then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign + case $make$noexec in + '') if executable ! $KSH + then echo "$command: $action: errors making $KSH" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + + # mamprobe data should have been generated by this point + + case $exec in + '') if test ! -f $INSTALLROOT/bin/.paths -o -w $INSTALLROOT/bin/.paths + then N=' +' + b= f= h= n= p= u= B= L= + if test -f $INSTALLROOT/bin/.paths + then exec < $INSTALLROOT/bin/.paths + while read x + do case $x in + '#'?*) case $h in + '') h=$x ;; + esac + ;; + *BUILTIN_LIB=*) b=$x + ;; + *FPATH=*) f=$x + ;; + *PLUGIN_LIB=*) p=$x + ;; + *) case $u in + ?*) u=$u$N ;; + esac + u=$u$x + ;; + esac + done + fi + ifs=$IFS + m= + case $p in + ?*) b= + ;; + esac + case $b in + ?*) IFS='=' + set $b + IFS=$ifs + shift + p="PLUGIN_LIB=$*" + case $b in + [Nn][Oo]*) p=no$p ;; + esac + m=1 + ;; + esac + case $f in + '') f="FPATH=../fun" + m=1 + ;; + esac + case $h in + '') h='# use { no NO } prefix to permanently disable #' ;; + esac + case $p in + '') p="PLUGIN_LIB=cmd" + if grep '^setv mam_cc_DIALECT .* EXPORT=[AD]LL' $INSTALLROOT/lib/probe/C/mam/* >/dev/null 2>&1 + then p=no$p + fi + m=1 + ;; + esac + case $m in + 1) case $u in + ?*) u=$N$u ;; + esac + echo "$h$N$p$N$f$N$u" > $INSTALLROOT/bin/.paths + ;; + esac + fi + ;; + esac + + # run from separate copies since nmake and ksh may be rebuilt + + case $EXECROOT in + $INSTALLROOT) + $make cd $INSTALLROOT/bin + if executable /bin/cp + then cp=/bin/cp + else cp=cp + fi + if executable /bin/mv + then mv=/bin/mv + else mv=mv + fi + if executable /bin/rm + then rm=/bin/rm + else rm=rm + fi + for i in \ + ksh nmake tee cp ln mv rm \ + *ast*.dll *cmd*.dll *dll*.dll *shell*.dll + do executable $i && { + cmp -s $i $OK/$i 2>/dev/null || { + test -f $OK/$i && + $exec $execrate $rm $OK/$i &2 + exit 1 + ;; + esac + $exec $execrate $cp $i $OK/$i + } + } + done + if test -f ../lib/make/makerules.mo + then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo + fi + if executable $OK/nmake + then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib" + fi + if executable $OK/tee + then TEE=$INSTALLROOT/bin/$OK/tee + fi + if test "$KEEP_SHELL" != 1 && executable $OK/ksh + then SHELL=$INSTALLROOT/bin/$OK/ksh + export SHELL + fi + case :$PATH: in + *:$INSTALLROOT/bin/$OK:*) + ;; + *) PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + ;; + esac + $make cd $INSTALLROOT/src + ;; + esac + + # fall back to mamake if nmake not found or too old + + if nonmake $MAKE + then note make with mamake + case $target in + '') target="install" ;; + esac + eval capture mamake \$makeflags \$noexec \$target $assign + else case $target in + '') target="install cc-" ;; + esac + eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign + fi + ;; + +read) case ${PWD:-`pwd`} in + $PACKAGEROOT) + ;; + *) echo "$command: must be in package root directory" >&2 + exit 1 + ;; + esac + PAX= + if onpath pax + then case `$_onpath_ -rw --?meter 2>&1` in + *--meter*) PAX=pax ;; + esac + fi + code=0 + i= + x= + remove= + touch= + set '' $target + case $2 in + lcl|tgz)tgz=$2 + shift 2 + target=$* + ;; + *) tgz=tgz + ;; + esac + set '' $package $target + case $# in + 1) verbose=: + set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + ;; + *) verbose= + ;; + esac + shift + files= + for f + do if test -f "$f" + then : ok + elif test -f "lib/package/$tgz/$f" + then f=lib/package/$tgz/$f + else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else set '' `ls -r lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else echo "$command: $f: package archive not found" >&2 + continue + fi + fi + fi + files="$files $f" + done + case $files in + '') echo "$command: lib/package/$tgz: no package archives" >&2 + exit 1 + ;; + esac + set '' `ls -r $files 2>/dev/null` + shift + f1= f2= f3= f4= + for f + do case $f in + ratz.*|*/ratz.*) + f1="$f1 $f" + ;; + INIT.*|*/INIT.*) + f2="$f2 $f" + ;; + INIT*|*/INIT*) + f3="$f3 $f" + ;; + *) f4="$f4 $f" + ;; + esac + done + gen= + set '' $f1 $f2 $f3 $f4 + while : + do shift + case $# in + 0) break ;; + esac + f=$1 + case $f in + *.gz) : standalone packages unbundled manually + continue + ;; + *.md5) : tarball checksum + continue + ;; + *?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*) + ;; + *) echo "$command: $f: not a package archive" >&2 + code=1 + continue + ;; + esac + case $f in + */*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;; + *) d= a=$f ;; + esac + # f:file d:dir a:base p:package v:version r:release t:type + eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $r in + base) y=$p.base ;; + *) y=$p.delta ;; + esac + case " $x " in + *" $y "*) + continue + ;; + esac + case $t in + '') w=$PACKAGESRC + q= + Q= + m= + ;; + *) w=$PACKAGEROOT/arch/$t/lib/package + q=".$t" + Q="_$t" + m="[_.]$t" + ;; + esac + u=$d$p$q.tim + if test -s "$u" + then continue + else case $force in + 0) case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) case $verbose in + 1) note $p already read ;; + esac + continue + ;; + esac + ;; + esac + fi + case $p in + INIT) if test -f $PACKAGEROOT/bin/package + then $exec mv $PACKAGEROOT/bin/package $PACKAGEROOT/bin/package.old + fi + ;; + esac + z= + case $r in + base) # base archive + if test ratz = "$p" + then # ratz packages are not archives + case $t in + '') for i in src src/cmd src/cmd/INIT + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/src/cmd/INIT/$p.c + ;; + *) for i in arch arch/$t arch/$t/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/arch/$t/bin/$p && + $exec chmod +x $PACKAGEROOT/arch/$t/bin/$p + ;; + esac + elif test "" != "$PAX" + then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || { + code=1 + continue + } + else if onpath gunzip && onpath $TAR && isascii + then case $TARPROBE in + ?*) for i in $TARPROBE + do if $TAR ${i}f - /dev/null > /dev/null 2>&1 + then TARFLAGS=$TARFLAGS$i + fi + done + TARPROBE= + ;; + esac + if gunzip -l < "$f" > /dev/null 2>&1 + then case $exec in + '') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;; + *) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;; + esac || { + code=1 + continue + } + else $exec $TAR ${TARFLAGS}f "$f" || { + code=1 + continue + } + fi + else checkaout ratz && onpath ratz || { + code=1 + continue + } + RATZ=$_onpath_ + case $exec in + '') echo $f: + $exec $RATZ -lm < "$f" + ;; + *) $exec "$RATZ -lm < $f" + ;; + esac || { + code=1 + continue + } + fi + if test -f $PACKAGEBIN/gen/$p.sum + then while read md5 mode usr grp file + do case $file in + -*) file=./$file ;; + esac + case $mode in + [01234567][01234567][01234567][01234567]) + case $grp in + -) ;; + *) $exec chgrp $grp "$file" ;; + esac + case $usr in + -) ;; + *) $exec chown $usr "$file" ;; + esac + $exec chmod $mode "$file" + ;; + esac + done < $PACKAGEBIN/gen/$p.sum + fi + fi + ;; + *) # delta archive + test "" != "$PAX" || { + echo "$command: $f: pax required to read delta archive" >&2 + code=1 + continue + } + case `echo "$v: +$r:" | sort` in + $r:*) y=$p.base + b=${d}${p}_${r}${Q}.tgz + test -f "$b" || b=${d}${p}.${r}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + note $f: generate new base $d$p.$v$q.tgz + $exec pax -rf "$f" -z "$b" -wf $d$p.$v$q.tgz -x tgz || { + code=1 + continue + } + case $exec in + '') echo $p $v $v 1 > $w/gen/$p.ver + ;; + *) z=$d${p}[_.]$v$q.tgz + $exec "echo $p $v $v 1 > $w/gen/$p.ver" + gen="$gen $d$p.$v$q.tgz" + ;; + esac + case " $remove " in + *" $f "*) ;; + *) remove="$remove $f" ;; + esac + ;; + *) b=${d}${p}_${v}${Q}.tgz + test -f "$b" || b=${d}${p}.${v}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + ;; + esac + ;; + *) echo "$command: $f: unknown archive type" >&2 + code=1 + continue + ;; + esac + + # check for ini files + + if executable $w/$p.ini + then $exec $w/$p.ini read || { + code=1 + continue + } + fi + + # add to the obsolete list + + k= + for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null` + do case $i in + *.md5) continue + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + continue + ;; + esac + case $k in + ?*) case " $remove " in + *" $k "*) ;; + *) remove="$remove $k" ;; + esac + ;; + esac + k=$i + done + x="$x $y" + case " $touch " in + *" $u "*) ;; + *) touch="$touch $u" ;; + esac + done + if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old + then $exec cp $PACKAGEROOT/bin/package.old $PACKAGEROOT/bin/package + fi + + # drop obsolete archives + + case $remove in + ?*) $exec rm -f $remove ;; + esac + + # mark the updated archives + + case $touch in + ?*) sleep 1; $exec touch $touch ;; + esac + + # check the requirements + + case $code$exec in + 0) requirements - $x ;; + esac + exit $code + ;; + +regress)if test ! -d $PACKAGEBIN/gen + then echo "$command: 'package make' and 'package test' required for regression" >&2 + exit 1 + fi + dir=$PACKAGEBIN/gen + cd $dir + for s in out old + do case `ls -t regress.$s test.$s 2>/dev/null` in + regress*) + ;; + test*) if test -f regress.$s + then $exec mv regress.$s regress.old + fi + case $exec in + '') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s | + sed -e '/\*\*\* [0123456789]/d' \ + -e '/^TEST.\//s,/[^ ]*/,,' \ + -e 's,[ ][ ]*$,,' \ + -e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \ + -e 's/\.sh failed at .* with /.sh failed /' \ + > regress.$s + ;; + *) $exec filter test failures from $dir/test.$s to $dir/regress.$s + ;; + esac + ;; + esac + done + if test -f regress.out -a -f regress.old + then $exec diff -b regress.out regress.old + else echo "$command: at least 2 test runs required for regression" >&2 + exit 1 + fi + ;; + +release)count= lo= hi= + checksrc + checkaout release || exit + requirements source $package + components $package + package=$_components_ + set '' $target + shift + case $# in + 0) ;; + *) case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) lo= release= ;; + *) lo=$1 release="-f $1" ;; + esac + shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) hi= ;; + *) hi=$1 release="$release -t $1" ;; + esac + shift + ;; + esac + ;; + [0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*) + count=$1 + release="-r $count" + shift + ;; + esac + ;; + esac + case $# in + 0) case $package in + '') package=* ;; + esac + ;; + *) case $package in + '') package=$* + ;; + *) echo $command: $*: lo-date hi-date arguments expected >&2 + exit 1 + ;; + esac + ;; + esac + echo + case $count:$lo:$hi in + ::) echo "All recorded changes follow." ;; + 1::) echo "Changes since the last release follow." ;; + ?*::) echo "Changes since the last $count releases follow." ;; + 1:?*:) echo "Changes since $lo or the last release follow." ;; + *:?*:*) echo "Changes since $lo follow." ;; + *::?*) echo "Changes before $hi follow." ;; + *) echo "Changes between $lo and $hi follow." ;; + esac + x= + for r in $INSTALLROOT $PACKAGEROOT + do for s in $package_src + do d=$r/src/$s + if test -d $d + then cd $d + for i in $package + do if test -h $i 2>/dev/null + then continue + fi + case " $x " in + *" $i "*) continue ;; + esac + for f in RELEASE CHANGES ChangeLog + do if test -f $i/$f + then $exec release $release $i/$f + x="$x $i" + for f in $i/*/$f + do if test -f $f + then $exec release $release $f + fi + done + break + fi + done + done + fi + done + done + ;; + +remove) echo "$command: $action: not implemented yet" >&2 + exit 1 + ;; + +results)set '' $target + shift + def=make + dir=$PACKAGEBIN/gen + case $verbose in + 0) filter=yes ;; + *) filter=cat ;; + esac + path=0 + suf=out + on= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + admin) dir=$PACKAGESRC/admin + ;; + error*|fail*) + filter=errors + ;; + make|test|view|write) + def=$1 + case $filter:$1:$SHELL in + errors:*:*) ;; + *:test:*/ksh*) filter=rt ;; + esac + ;; + old) suf=old + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + case $on in + ?*) on="$on|" ;; + esac + on="$on$1" + ;; + path) path=1 + ;; + test) def=test + filter=rt + ;; + *) break + ;; + esac + shift + done + case $dir in + */admin)case $on in + '') on="*" ;; + *) on="@($on)" ;; + esac + def=$def.log/$on + ;; + esac + case $# in + 0) set "$def" ;; + esac + m= + t= + for i + do k=0 + eval set '""' $i - $i.$suf - $dir/$i - $dir/$i.$suf - + shift + for j + do case $j in + -) case $k in + 1) continue 2 ;; + esac + ;; + *) if test -f $j + then k=1 + case /$j in + */test.*) t="$t $j" ;; + *) m="$m $j" ;; + esac + fi + ;; + esac + done + echo "$command: $i action output not found" >&2 + exit 1 + done + sep= + case $t in + ?*) case $path in + 0) for j in $t + do echo "$sep==> $j <==" + sep=$nl + case $filter in + cat) $exec cat $j + ;; + errors) $exec egrep -i '\*\*\*|FAIL[ES]|^TEST.* [123456789][0123456789]* error|core.*dump' $j | sed -e '/^TEST.\//s,/[^ ]*/,,' + ;; + rt) $exec $KSH rt - $j + ;; + *) $exec egrep -i '^TEST|FAIL' $j + ;; + esac + done + ;; + 1) echo $t + ;; + esac + ;; + esac + case $m in + ?*) case $path in + 0) case $filter in + cat) cat $m + ;; + *) if test -f $HOME/.pkgresults + then i="`cat $HOME/.pkgresults`" + case $i in + '|'*) ;; + *) i="|$i" ;; + esac + else i= + fi + for j in $m + do echo "$sep==> $j <==" + sep=$nl + case $filter in + errors) $exeg egrep '^pax:|\*\*\*' $j + ;; + *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + $exec grep : + ;; + esac + done + ;; + esac + ;; + 1) echo $m + ;; + esac + esac + ;; + +test) requirements source $package + components $package + package=$_components_ + case $only in + 0) only= ;; + 1) only=--recurse=only ;; + esac + + # must have nmake + + if nonmake $MAKE + then echo $command: $action: must have $MAKE to test >&2 + exit 1 + fi + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # disable core dumps (could be disastrous over nfs) + + (ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0 + + # do the tests + + eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign + ;; + +update) # download the latest release.version for selected packages + + # all work in $PACKAGEROOT/lib/package/tgz + + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + $exec cd $PACKAGEROOT/lib/package/tgz + else cd $PACKAGEROOT/lib/package/tgz + fi + + # get the architectures, update query url, and packages + + set '' $args + op=update + tgz=tgz + source= + binary= + setup= + types= + url= + urlfile=$default_url + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + beta) op=beta + tgz=beta + ;; + binary) binary=1 + ;; + setup) setup=1 + ;; + source) source=1 + ;; + *://*) url=$1 + shift + break + ;; + *.url) urlfile=$1 + if test ! -s $urlfile + then echo $command: $urlfile: not found >&2; exit 1 + fi + break + ;; + $all_types) + binary=1 + types="$types $1" + ;; + *) break + ;; + esac + done + case $source:$binary in + :) source=1 binary=1 + ;; + :1) case $types in + '') types=$HOSTTYPE ;; + esac + ;; + esac + case $url in + '') case $urlfile in + $default_url) + if test ! -s $urlfile + then echo $command: url argument expected >&2; exit 1 + fi + ;; + *) default_url= + ;; + esac + url= + if grep '^url=' $urlfile >/dev/null + then a=$authorize + p=$password + case $urlfile in + */*) ;; + *) urlfile=./$urlfile ;; + esac + . $urlfile + case $a:$p in + $authorize:$password) + default_url= + ;; + *) case $a in + ?*) authorize=$a ;; + esac + case $p in + ?*) password=$p ;; + esac + ;; + esac + else url=`cat $urlfile` + fi + ;; + esac + case $exec in + ?*) default_url= ;; + esac + + # get the update list + + eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'` + get $host $dir/$op.html + + # get/check the package names + + case " $* " in + *" - "*)case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit=$* + ;; + " ") nl=" +" + case $source in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + ;; + *.????-??-??.????-??-??.*) + p=$p$nl$f + ;; + *.????-??-??.*.*) + ;; + *.????-??-??.*) + p=$p$nl$f + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + source_packages=$* + ;; + *) source_packages= + ;; + esac + case $binary in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.????-??-??.*) + ;; + *.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.*) + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + binary_packages=$* + ;; + *) binary_packages= + ;; + esac + package_hit="$source_packages $binary_packages" + ;; + *) case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit= + ;; + esac + + # get the latest updates + + types_test= + types_local= + dir=$dir/$tgz + case $default_url in + ?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url + case $authorize in + ?*) chmod go-rwx $default_url ;; + esac + ;; + esac + echo "$got" > got.tmp + case $only in + 0) exec < got.tmp + covered= + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $requires in + ''|-*) continue ;; + esac + IFS=: + set '' $requires + IFS=$ifs + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + for name + do case " $source_packages " in + *" $name "*) + ;; + *) source_packages="$source_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + for name + do case " $binary_packages " in + *" $name "*) + ;; + *) binary_packages="$binary_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + esac + done + case $covered in + ?*) x=$source_packages + source_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) source_packages="$source_packages $name" ;; + esac + done + x=$binary_packages + binary_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) binary_packages="$binary_packages $name" ;; + esac + done + ;; + esac + ;; + esac + checksum= + for i in $checksum_commands + do case `( $i ) < /dev/null 2> /dev/null` in + ${checksum_empty}|${checksum_empty}[\ \ ]*) + checksum=$i + break + ;; + esac + done + case $checksum in + '') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;; + esac + exec < got.tmp + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $verbose in + 1) case $type in + -) i= ;; + *) i=.$type ;; + esac + j="$name.$base$i.$suffix" + case $delta in + -) j="$j -" ;; + *) j="$j $name.$base.$delta$i.$suffix" ;; + esac + case $sync in + -) j="$j -" ;; + *) j="$j $name.$base.$sync$i.$suffix" ;; + esac + echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2 + esac + case " $package_hit " in + *" $name "*|*" - "*) + ;; + *) package_hit="$package_hit $name" + ;; + esac + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + if test -s $name.tim + then continue + fi + lcl=$name.$base.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$suffix + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + if test -s $name.$type.tim + then continue + fi + case " $types " in + *" - "*);; + " ") case " $types_test " in + *" $type "*) + ;; + *) types_test="$types_test $type" + for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.* + do if test -f $i + then types_local="$types_local $type" + fi + break + done + ;; + esac + case " $types_local " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + *) case " $types " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + esac + lcl=$name.$base.$type.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$type.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$type.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$type.$suffix + if test -f $lcl + then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + else sum=X + fi + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + esac + done + closure= + for name in $source_packages $binary_packages + do case $name in + -) ;; + *) case " $package_hit " in + *" $name "*) + case $setup in + 1) case " $closure " in + *" $name "*) + ;; + *) closure="$closure $name" + ;; + esac + ;; + esac + ;; + *) echo $command: $name: unknown package >&2 + ;; + esac + ;; + esac + done + exec <&- + rm -f got.tmp + case $closure in + ?*) echo $closure ;; + esac + ;; + +use) # finalize the environment + + x=:.. + for d in `( cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )` + do x=$x:$INSTALLROOT/$d + done + x=$x:$INSTALLROOT + case $CDPATH: in + $x:*) ;; + *) CDPATH=$x:$CDPATH + $show CDPATH=$CDPATH + $show export CDPATH + export CDPATH + ;; + esac + P=$PACKAGEROOT + $show P=$P + $show export P + export P + A=$INSTALLROOT + $show A=$A + $show export A + export A + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + eval PACKAGE_USE=$package_use + export PACKAGE_USE + + # run the command + + case $run in + '') case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$run" + ;; + esac + ;; + +verify) cd $PACKAGEROOT + requirements binary $package + if executable ! $SUM + then echo "$command: $action: $SUM command required" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + for a in $target + do case $package in + '') set '' arch/$a/lib/package/gen/*.sum + shift + if test -f $1 + then for i + do package_verify $i || code=1 + done + else echo "$command: warning: $a: no binary packages" >&2 + fi + ;; + *) for i in $package + do if test -f arch/$a/lib/package/gen/$i.sum + then package_verify arch/$a/lib/package/gen/$i.sum || code=1 + else echo "$command: warning: $a: no binary package for $i" >&2 + fi + done + ;; + esac + done + exit $code + ;; + +write) set '' $target + shift + action= + list= + qualifier= + while : + do case $1 in + base|closure|delta|exp|lcl|pkg|rpm|tgz) + qualifier="$qualifier $1" + ;; + binary) action=$1 + type=$HOSTTYPE + eval list=$PACKAGESRC/tgz/$admin_list + ;; + cyg) qualifier="$qualifier $1" + assign="$assign closure=1" + only=1 + ;; + runtime|source) + action=$1 + ;; + tst) qualifier="$qualifier tgz" + assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'" + ;; + nocopyright) + assign="$assign copyright=0" + ;; + *) break + ;; + esac + shift + done + case $action in + '') echo "$command: binary or source operand expected" >&2 + exit 1 + ;; + esac + set '' "$@" $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + if nonmake $MAKE + then echo "$command: must have $MAKE to generate archives" >&2 + exit 1 + fi + + # all work under $PACKAGEBIN + + $make cd $PACKAGEBIN + case $list in + ?*) $exec rm -f $list ;; + esac + + # go for it + + for package + do if view - all $package.pkg || view - all lib/package/$package.pkg + then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign + else echo "$command: $package: not a package" >&2 + fi + done + ;; + +TEST) set '' $target $package + shift + case $1 in + binary|source) + action=$1 + shift + ;; + esac + order "$@" + ;; + +*) echo "$command: $action: internal error" >&2 + exit 1 + ;; + +esac + +exit "$error_status" diff --git a/bin/shtests b/bin/shtests new file mode 100755 index 000000000..3755f18dc --- /dev/null +++ b/bin/shtests @@ -0,0 +1,54 @@ +#! /bin/sh +# Wrapper script to run the ksh93 regression tests without requiring nmake. +# By Martijn Dekker 2020-05-14 +# Public domain. http://creativecommons.org/publicdomain/zero/1.0/ +# +# The manual: bin/shtests --man +# Brief help: bin/shtests --help +# +# By default, this runs your compiled arch/*/bin/ksh. +# +# Note: The test suite actually uses $SHELL to indicate the shell to test. But +# we cannot use the $SHELL environment value on entry to this wrapper script, +# as that is already used for the user's default login shell on most systems. + +# Process and remove any assignment-argument indicating the shell to test +for arg do + case $arg in + ( SHELL=* | KSH=* ) + KSH=${arg#*=} ;; + ( * ) set -- "$@" "$1" ;; + esac + shift +done + +# Find root dir of ksh source +mydir=$(dirname "$0") \ +&& mydir=$(CDPATH='' cd -P -- "$mydir/.." && printf '%sX' "$PWD") \ +&& mydir=${mydir%X} \ +|| exit +myarch=$("$mydir/bin/package" host type) || exit + +# Check if there is a ksh to test. +case ${KSH+set} in +( '' ) KSH=$mydir/arch/$myarch/bin/ksh ;; +esac +if ! test -x "$KSH" || ! test -f "$KSH"; then + printf '%s: shell not found: %s\n' "${0##*/}" "$KSH" >&2 + printf 'Specify a shell like: KSH=path/to/ksh bin/shtests\n' >&2 + exit 1 +fi + +# Ensure absolute path to ksh +KSH=$(CDPATH='' cd -P -- "$(dirname "$KSH")" \ + && printf '%s/%sX' "$PWD" "${KSH##*/}") \ +&& KSH=${KSH%X} + +# Run the test suite +CDPATH='' cd -P -- "$mydir/src/cmd/ksh93/tests" || exit +SHELL=$KSH +INSTALLROOT=${INSTALLROOT:-$mydir/arch/$myarch} +export SHELL INSTALLROOT +unset -v KSH +printf '#### Regression-testing %s ####\n' "$SHELL" +exec "$SHELL" shtests "$@" diff --git a/bin/silent b/bin/silent new file mode 100755 index 000000000..77e85333b --- /dev/null +++ b/bin/silent @@ -0,0 +1,41 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# non-ksh stub for the nmake silent prefix +# @(#)silent (AT&T Research) 1992-08-11 + +(command set -o posix) 2>/dev/null && set -o posix +modern_export=`v=; export v=ok 2>/dev/null; echo "$v"` + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $modern_export in + ok) export "$1" ;; + *) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..1fedcdc14 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,6 @@ + +AST Software + +The KornShell
+ + diff --git a/docs/ksh/builtins.html b/docs/ksh/builtins.html new file mode 100644 index 000000000..2465fb54b --- /dev/null +++ b/docs/ksh/builtins.html @@ -0,0 +1,710 @@ + + + + + www/ksh/builtins.mm mm document + + + + + +
+ +

+

+

Guidelines for writing ksh-93 built-in commands

+
David G. Korn +

+

+

+

Abstract

+One of the features of ksh93, the latest version of ksh, +is the ability to add built-in commands at run time. +This feature only works on operating systems that have the ability +to load and link code into the current process at run time. +Some examples of the systems that have this feature +are Linux, System V Release 4, Solaris, Sun OS, HP-UX Release 8 and above, +AIX 3.2 and above, and Microsoft Windows systems. +

+This memo describes how to write and compile programs +that can be loaded into ksh at run time as built-in +commands. +

+


INTRODUCTION

+A built-in command is executed without creating a separate process. +Instead, the command is invoked as a C function by ksh. +If this function has no side effects in the shell process, +then the behavior of this built-in is identical to that of +the equivalent stand-alone command. The primary difference +in this case is performance. The overhead of process creation +is eliminated. For commands of short duration, the effect +can be dramatic. For example, on SUN OS 4.1, the time to +run wc on a small file of about 1000 bytes, runs +about 50 times faster as a built-in command. +

+In addition, built-in commands may have side effects on the +shell environment. +This is usually done to extend the application domain for +shell programming. For example, there is a group of X-windows extension +built-ins that make heavy use of the shell variable namespace. +These built-ins are added at run time and +result in a windowing shell that can be used to write +X-windows applications. +

+While there are definite advantages to adding built-in +commands, there are some disadvantages as well. +Since the built-in command and ksh share the same +address space, a coding error in the built-in program +may affect the behavior of ksh; perhaps causing +it to core dump or hang. +Debugging is also more complex since your code is now +a part of a larger entity. +The isolation provided by a separate process +guarantees that all resources used by the command +will be freed when the command completes. +Resources used by a built-in must be meticulously maintained and freed. +Also, since the address space of ksh will be larger when built-in are loaded, +it may increase the time it takes ksh to fork() and +exec() non-built-in commands. +It makes no sense to add a built-in command that takes +a long time to run or that is run only once, since the performance +benefits will be negligible. +Built-ins that have side effects in the current shell +environment have the disadvantage of increasing the +coupling between the built-in and ksh, making +the overall system less modular and more monolithic. +

+Despite these drawbacks, in many cases extending +ksh by adding built-in +commands makes sense and allows reuse of the shell +scripting ability in an application specific domain. +This memo describes how to write ksh extensions. +

+


WRITING BUILT-IN COMMANDS

+There is a development kit available for writing ksh +built-ins as part of the AST (AT&T Software Technology) Toolkit. +The development kit has three directories, +include, lib, and bin. +It is best to set the value of the environment variable +PACKAGE_ast to the pathname of the directory +containing the development kit. +The include directory contains a sub-directory +named ast that contains interface prototypes +for functions that you can call from built-ins. The lib +directory contains the ast library +and a library named cmd that contains a version +of several of the standard POSIX[1] +utilities that can be made run time built-ins. +The lib/ksh directory contains shared libraries +that implement other ksh built-ins. +The bin directory contains build tools such as nmake[2]. +To add built-ins at runtime, it is necessary to build a shared library +containing one or more built-ins that you wish to add. +The built-ins are then added by running builtin -f shared_lib. +Since the procedure for building share libraries is system dependent, +it is best to use +nmake +using the sample nmake makefile below as a prototype. +The AST Toolkit also contains some examples of built-in libraries under +the src/cmd/kshlib directory. +

+There are two ways to code adding built-ins. One method is to replace +the function main with a function +b_name, where name is the name +of the built-in you wish to define. +A built-in command has a calling convention similar to +the main function of a program, +int main(int argc, char *argv[]). +except that it takes a third argument of type Shbltin_t* which can +be passed as NULL if it is not used. The definition for +Shbltin_t* is in <ast/shcmd.h>. +Instead of exit, you need to use return +to terminate your command. +The return value will become the exit status of the command. +The open built-in, installed in lib/ksh in the AST Toolkit, uses this method. +The Shbltin_t structure contains a field named shp which is +a pointer the the shell data that is needed for shell library callbacks. +It also contains the fields, shrun, shtrap, shexit, +and shbltin +that are function pointers to the shell library functions sh_run, sh_trap +sh_exit, and sh_addbuiltin, respectively. These functions +can be invoked without the need for runtime symbol lookup when the +shell is statically linked with libshell. +

+The alternative method is to create a function lib_init and +use the Shbltin_t.shbltin() function to add one or more built-ins. +The lib_init function will be called with two arguments. The +first argument will be 0 when the library is loaded and the second +argument will be of type Shbltin_t*. +The dbm_t and dss shell built-ins use this method. +

+No matter which way you add built-ins you should add the line +SHLIB(identifier) as the last line of one +of the built-in source file, where identifier is any C identifier. +This line provides version information to the shell builtin command +that it uses to verify compatibility between the built-in and ksh +implementation versions. builtin fails with a diagnostic on version +mismatch. The diagnostic helps determine whether ksh is out of +date and requires an upgrade or the built-in is out of date and requires +recompilation. +

+The steps necessary to create and add a run time built-in are +illustrated in the following simple example. +Suppose you wish to add a built-in command named hello +which requires one argument and prints the word hello followed +by its argument. First, write the following program in the file +hello.c: +

+
+#include     <stdio.h>
+int b_hello(int argc, char *argv[], void *context)
+{
+        if(argc != 2)
+        {
+                fprintf(stderr,"Usage: hello arg\n");
+                return(2);
+        }
+        printf("hello %s\n",argv[1]);
+        return(0);
+}
+SHLIB(hello)
+
+ +

+Next, the program needs to be compiled. +If you are building with AT&T nmake use the following Makefile: +

+
+:PACKAGE: --shared ast
+hello plugin=ksh :LIBRARY: hello.c
+
+ +and run nmake install to compile, link, and install the built-in shared library +in lib/ksh/ under PACKAGE_ast. +If the built-in extension uses several .c files, list all of these on +the :LIBRARY: line. +

+Otherwise you will have to compile hello.c with an option +to pick up the AST include directory +(since the AST <stdio.h> is required for ksh compatibility) +and options required for generating shared libraries. +For example, on Linux use this to compile: +

+
+cc -fpic -I$PACKAGE_ast/include/ast -c hello.c
+
+ +and use the appropriate link line. +It really is best to use nmake because the 2 line Makefile above +will work on all systems that have ksh installed. +

+If you have several built-ins, it is desirable +to build a shared library that contains them all. +

+The final step is using the built-in. +This can be done with the ksh command builtin. +To load the shared library libhello.so from the current directory +and add the built-in hello, invoke the command, +

+
+builtin -f ./libhello.so hello
+
+ +The shared library prefix (lib here) and suffix (.so here) be omitted; +the shell will add an appropriate suffix +for the system that it is loading from. +If you install the shared library in lib/ksh/, where ../lib/ksh/ is +a directory on $PATH, the command +
+
+builtin -f hello hello
+
+ +will automatically find, load and install the built-in on any system. +Once this command has been invoked, you can invoke hello +as you do any other command. +If you are using lib_init method to add built-ins then no arguments +follow the -f option. +

+It is often desirable to make a command built-in +the first time that it is referenced. The first +time hello is invoked, ksh should load and execute it, +whereas for subsequent invocations ksh should just execute the built-in. +This can be done by creating a file named hello +with the following contents: +

+
+function hello
+{
+        unset -f hello
+        builtin -f hello hello
+        hello "$@"
+}
+
+ +This file hello needs to be placed in a directory that is +in your FPATH variable, and the built-in shared library +should be installed in lib/ksh/, as described above. +

+


CODING REQUIREMENTS AND CONVENTIONS

+As mentioned above, the entry point for built-ins must either be of +the form b_name or else be loaded from a function named +lib_init. +Your built-ins can call functions from the standard C library, +the ast library, interface functions provided by ksh, +and your own functions. +You should avoid using any global symbols beginning with +sh_, +nv_, +and +ed_ +since these are used by ksh itself. +#define constants in ksh interface +files use symbols beginning with SH_ and NV_, +so avoid using names beginning with these too. +

+

Header Files

+The development kit provides a portable interface +to the C library and to libast. +The header files in the development kit are compatible with +K&R C[3], +ANSI-C[4], +and C++[5]. +

+The best thing to do is to include the header file <shell.h>. +This header file causes the <ast.h> header, the +<error.h> header and the <stak.h> +header to be included as well as defining prototypes +for functions that you can call to get shell +services for your builtins. +The header file <ast.h> +provides prototypes for many libast functions +and all the symbol and function definitions from the +ANSI-C headers, <stddef.h>, +<stdlib.h>, <stdarg.h>, <limits.h>, +and <string.h>. +It also provides all the symbols and definitions for the +POSIX[6] +headers <sys/types.h>, <fcntl.h>, and +<unistd.h>. +You should include <ast.h> instead of one or more of +these headers. +The <error.h> header provides the interface to the error +and option parsing routines defined below. +The <stak.h> header provides the interface to the memory +allocation routines described below. +

+Programs that want to use the information in <sys/stat.h> +should include the file <ls.h> instead. +This provides the complete POSIX interface to stat() +related functions even on non-POSIX systems. +

+

+

Input/Output

+ksh uses sfio, +the Safe/Fast I/O library[7], +to perform all I/O operations. +The sfio library, which is part of libast, +provides a superset of the functionality provided by the standard +I/O library defined in ANSI-C. +If none of the additional functionality is required, +and if you are not familiar with sfio and +you do not want to spend the time learning it, +then you can use sfio via the stdio library +interface. The development kit contains the header <stdio.h> +which maps stdio calls to sfio calls. +In most instances the mapping is done +by macros or inline functions so that there is no overhead. +The man page for the sfio library is in an Appendix. +

+However, there are some very nice extensions and +performance improvements in sfio +and if you plan any major extensions I recommend +that you use it natively. +

+

Error Handling

+For error messages it is best to use the ast library +function errormsg() rather that sending output to +stderr or the equivalent sfstderr directly. +Using errormsg() will make error message appear +more uniform to the user. +Furthermore, using errormsg() should make it easier +to do error message translation for other locales +in future versions of ksh. +

+The first argument to +errormsg() specifies the dictionary in which the string +will be searched for translation. +The second argument to errormsg() contains that error type +and value. The third argument is a printf style format +and the remaining arguments are arguments to be printed +as part of the message. A new-line is inserted at the +end of each message and therefore, should not appear as +part of the format string. +The second argument should be one of the following: +

+
+
ERROR_exit(n):

+If n is not-zero, the builtin will exit value n after +printing the message. +
ERROR_system(n):

+Exit builtin with exit value n after printing the message. +The message will display the message corresponding to errno +enclosed within [ ] at the end of the message. +
ERROR_usage(n):

+Will generate a usage message and exit. If n is non-zero, +the exit value will be 2. Otherwise the exit value will be 0. +
ERROR_debug(n):

+Will print a level n debugging message and will then continue. +
ERROR_warn(n):

+Prints a warning message. n is ignored. +

+

Option Parsing

+The first thing that a built-in should do is to check +the arguments for correctness and to print any usage +messages on standard error. +For consistency with the rest of ksh, it is best +to use the libast functions optget() and +optusage()for this +purpose. +The header <error.h> includes prototypes for +these functions. +The optget() function is similar to the +System V C library function getopt(), +but provides some additional capabilities. +Built-ins that use optget() provide a more +consistent user interface. +

+The optget() function is invoked as +

+
+int optget(char *argv[], const char *optstring)
+
+ +where argv is the argument list and optstring +is a string that specifies the allowable arguments and +additional information that is used to format usage +messages. +In fact a complete man page in troff or html +can be generated by passing a usage string as described +by the getopts command. +Like getopt(), +single letter options are represented by the letter itself, +and options that take a string argument are followed by the : +character. +Option strings have the following special characters: +
+
+
:
+Used after a letter option to indicate that the option +takes an option argument. +The variable opt_info.arg will point to this +value after the given argument is encountered. +
#
+Used after a letter option to indicate that the option +can only take a numerical value. +The variable opt_info.num will contain this +value after the given argument is encountered. +
?
+Used after a : or # (and after the optional ?) +to indicate the the +preceding option argument is not required. +
[...]

+After a : or #, the characters contained +inside the brackets are used to identify the option +argument when generating a usage message. +
space

+The remainder of the string will only be used when generating +usage messages. +
+
+

+The optget() function returns the matching option letter if +one of the legal option is matched. +Otherwise, optget() returns +

+
+
':'
+If there is an error. In this case the variable opt_info.arg +contains the error string. +
0
+Indicates the end of options. +The variable opt_info.index contains the number of arguments +processed. +
'?'
+A usage message has been required. +You normally call optusage() to generate and display +the usage message. +
+
+

+The following is an example of the option parsing portion +of the wc utility. +

+
+#include <shell.h>
+while(1) switch(n=optget(argv,"xf:[file]"))
+{
+	case 'f':
+		file = opt_info.arg;
+		break;
+	case ':':
+		error(ERROR_exit(0), opt_info.arg);
+		break;
+	case '?':
+		error(ERROR_usage(2), opt_info.arg);
+		break;
+}
+
+ +

+

Storage Management

+It is important that any memory used by your built-in +be returned. Otherwise, if your built-in is called frequently, +ksh will eventually run out of memory. +You should avoid using malloc() for memory that must +be freed before returning from you built-in, because by default, +ksh will terminate you built-in in the event of an +interrupt and the memory will not be freed. +

+The best way to allocate variable sized storage is +through calls to the stak library +which is included in libast +and which is used extensively by ksh itself. +Objects allocated with the stakalloc() +function are freed when you function completes +or aborts. +The stak library provides a convenient way to +build variable length strings and other objects dynamically. +The man page for the stak library is contained +in the Appendix. +

+Before ksh calls each built-in command, it saves +the current stack location and restores it after +it returns. +It is not necessary to save and restore the stack +location in the b_ entry function, +but you may want to write functions that use this stack +are restore it when leaving the function. +The following coding convention will do this in +an efficient manner: +

+
+yourfunction()
+{
+        char	*savebase;
+        int	saveoffset;
+        if(saveoffset=staktell())
+        	savebase = stakfreeze(0);
+        ...
+        if(saveoffset)
+        	stakset(savebase,saveoffset);
+        else
+        	stakseek(0);
+}
+
+ +

+


CALLING ksh SERVICES

+Some of the more interesting applications are those that extend +the functionality of ksh in application specific directions. +A prime example of this is the X-windows extension which adds +builtins to create and delete widgets. +The nval library is used to interface with the shell +name space. +The shell library is used to access other shell services. +

+

The nval library

+A great deal of power is derived from the ability to use +portions of the hierarchal variable namespace provided by ksh-93 +and turn these names into active objects. +

+The nval library is used to interface with shell +variables. +A man page for this file is provided in an Appendix. +You need to include the header <nval.h> +to access the functions defined in the nval library. +All the functions provided by the nval library begin +with the prefix nv_. +Each shell variable is an object in an associative table +that is referenced by name. +The type Namval_t* is pointer to a shell variable. +To operate on a shell variable, you first get a handle +to the variable with the nv_open() function +and then supply the handle returned as the first +argument of the function that provides an operation +on the variable. +You must call nv_close() when you are finished +using this handle so that the space can be freed once +the value is unset. +The two most frequent operations are to get the value of +the variable, and to assign value to the variable. +The nv_getval() returns a pointer the the +value of the variable. +In some cases the pointer returned is to a region that +will be overwritten by the next nv_getval() call +so that if the value isn't used immediately, it should +be copied. +Many variables can also generate a numeric value. +The nv_getnum() function returns a numeric +value for the given variable pointer, calling the +arithmetic evaluator if necessary. +

+The nv_putval() function is used to assign a new +value to a given variable. +The second argument to putval() is the value +to be assigned +and the third argument is a flag which +is used in interpreting the second argument. +

+Each shell variable can have one or more attributes. +The nv_isattr() is used to test for the existence +of one or more attributes. +See the appendix for a complete list of attributes. +

+By default, each shell variable passively stores the string you +give with with nv_putval(), and returns the value +with getval(). However, it is possible to turn +any node into an active entity by assigning functions +to it that will be called whenever nv_putval() +and/or nv_getval() is called. +In fact there are up to five functions that can +associated with each variable to override the +default actions. +The type Namfun_t is used to define these functions. +Only those that are non-NULL override the +default actions. +To override the default actions, you must allocate an +instance of Namfun_t, and then assign +the functions that you wish to override. +The putval() +function is called by the nv_putval() function. +A NULL for the value argument +indicates a request to unset the variable. +The type argument might contain the NV_INTEGER +bit so you should be prepared to do a conversion if +necessary. +The getval() +function is called by nv_getval() +value and must return a string. +The getnum() +function is called by by the arithmetic evaluator +and must return double. +If omitted, then it will call nv_getval() and +convert the result to a number. +

+The functionality of a variable can further be increased +by adding discipline functions that +can be associated with the variable. +A discipline function allows a script that uses your +variable to define functions whose name is +varname.discname +where varname is the name of the variable, and discname +is the name of the discipline. +When the user defines such a function, the settrap() +function will be called with the name of the discipline and +a pointer to the parse tree corresponding to the discipline +function. +The application determines when these functions are actually +executed. +By default, ksh defines get, +set, and unset as discipline functions. +

+In addition, it is possible to provide a data area that +will be passed as an argument to +each of these functions whenever any of these functions are called. +To have private data, you need to define and allocate a structure +that looks like +

+
+struct yours
+{
+        Namfun_t	fun;
+	your_data_fields;
+};
+
+ +

+

The shell library

+There are several functions that are used by ksh itself +that can also be called from built-in commands. +The man page for these routines are in the Appendix. +

+The sh_addbuiltin() function can be used to add or delete +builtin commands. It takes the name of the built-in, the +address of the function that implements the built-in, and +a void* pointer that will be passed to this function +as the third argument whenever it is invoked. +If the function address is NULL, the specified built-in +will be deleted. However, special built-in functions cannot +be deleted or modified. +

+The sh_fmtq() function takes a string and returns +a string that is quoted as necessary so that it can +be used as shell input. +This function is used to implement the %q option +of the shell built-in printf command. +

+The sh_parse() function returns a parse tree corresponding +to a give file stream. The tree can be executed by supplying +it as the first argument to +the sh_trap() function and giving a value of 1 as the +second argument. +Alternatively, the sh_trap() function can parse and execute +a string by passing the string as the first argument and giving 0 +as the second argument. +

+The sh_isoption() function can be used to set to see whether one +or more of the option settings is enabled. +

+


References

+

+

+ +
[1]
+POSIX - Part 2: Shell and Utilities, +IEEE Std 1003.2-1992, ISO/IEC 9945-2:1993. +
[2]
+Glenn Fowler, +A Case for make, +Software - Practice and Experience, Vol. 20 No. S1, pp. 30-46, June 1990. +
[3]
+Brian W. Kernighan and Dennis M. Ritchie, +The C Programming Language, +Prentice Hall, 1978. +
[4]
+American National Standard for Information Systems - Programming +Language - C, ANSI X3.159-1989. +
[5]
+Bjarne Stroustroup, +C++, +Addison Wesley, xxxx +
[6]
+POSIX - Part 1: System Application Program Interface, +IEEE Std 1003.1-1990, ISO/IEC 9945-1:1990. +
[7]
+David Korn and Kiem-Phong Vo, +SFIO - A Safe/Fast Input/Output library, +Proceedings of the Summer Usenix, +pp. , 1991. +
+

+


+ + + + + + +
March 13, 2012
+

+ +

+ + + diff --git a/docs/ksh/examples.html b/docs/ksh/examples.html new file mode 100644 index 000000000..e17bc007f --- /dev/null +++ b/docs/ksh/examples.html @@ -0,0 +1,55 @@ + + + + + www/ksh/examples.mm mm document + + + + + +
+ + + +

+

Sample Functions

+

+ + + + +
+dirs    getopt    popd    title
+emacs_keybind    keybind    pushd    vi_keybind
+ +

+


Sample Scripts

+

+ + + + +
+cgi-lib.ksh    env    which     
+dump-cgi.ksh    line          
+

+


+ + + + + + +
March 13, 2012
+

+ +

+ + + diff --git a/docs/ksh/faq.html b/docs/ksh/faq.html new file mode 100644 index 000000000..43319e28f --- /dev/null +++ b/docs/ksh/faq.html @@ -0,0 +1,1004 @@ + + + + + general shell + + + + + + +
+ +

+

general

+
+
+ +
What is KornShell?
+ +KornShell is a command and scripting language that is a superset of the System V UNIX shell, +aka, BourneShell (or +sh). + +
What is ksh?
+ +ksh is the name of the program that implements the KornShell language. + +
What is the history of ksh?
+ +ksh was written by David Korn at Bell Telephone Laboratories. +David Korn is currently at AT&T Research. +The first version of ksh was in 1983. +It was the first shell to have command line editing with both emacs and vi style interaction. +The 1986 version was the first to offer multibyte support. +The 1988 version of ksh is the version that was adopted by System V Release 4 UNIX +and was a source document for the IEEE POSIX and ISO shell standards. +The 1993 version is a major rewrite of the 1988 version and focuses more on scripting. + +
Where is the official description of the KornShell language?
+ +The Bolsky and Korn book, +The KornShell Command and Programming Language, +published by Prentice Hall, defines the 1988 version. +The newer Bolsky and Korn book, +The New KornShell Command and Programming Language, +also published by Prentice Hall, describes the 1993 version. +There are many new features since this book was published and +the man page for ksh93 is kept up to date. + +
What are the major new features of KornShell 1993?
+ +The only major new interactive features are key binding and tab completion. +Major new language features are floating point arithmetic, +associative arrays, complete ANSI-C printf, name reference +variables, new expansion operators, dynamic loading of +built-in commands, active variables, and compound variables. +Active and compound variables allow shell variables to +behave like objects. The ability to define types was added in 2009. +In addition, ksh93 has been written to be +extensible with an C language API for programming extensions. + +
Are any further releases of ksh planned?
+ +Yes, the KornShell language and ksh implementation are in active development. +Most of the focus will be on scripting and reusability. + +
Why are newer release of ksh still called ksh93?
+ +We started the AST/ksh OpenSource release process in the late 90's. +At that point ksh93 was the well-known name for ksh. +The OpenSource release was finally granted in March 2000. +No one has since volunteered to repeat that process for kshXX. + +
How can I determine the release or version of a particular ksh?
+ +The current version and release string may be accessed by +${.sh.version} +and +$KSH_VERSION. +The format is Version features 93version[-/+] release: +
    +
  • +features -- +compile time features, typically enabled by SHOPT_foo state variables in the +ksh93 Makefile. +A single letter represents each feature: +
      +
    • +A +(SHOPT_AUDIT) +
    • +B +(SHOPT_BASH) +bash compatibility mode. +
    • +J +(SHOPT_COSHELL) +-lcoshell job pools. +
    • +j +(SHOPT_BGX) +
    • +L +(SHOPT_ACCT) +
    • +M +(SHOPT_MULTIBYTE) +
    • +P +(SHOPT_PFSH) +
    • +R +(SHOPT_REGRESS) +
    +
  • +version-- +a lower-case letter signifying major release points. +An optional - following features signifies an alpha release. +The first stable release has no -. +An optional + signifies a stable release with bug patches and minor enhancements. +
  • +release-- +the release date in YYYY-MM-DD form. +This date corresponds to AST package and git repository releases. +
+KSH_VERSION +in a numeric context is an integer that encodes the release +YYYYMMDD. + +
What new features are planned for ksh?
+ +We are in the early stage of planning but the likely additions +are namespaces, ability to read xml and json object into shell variables, +and handling of queued signals. +Support for multi-threading is also being considered. + +
Is KornShell public domain?
+ +Yes, the language description is public domain and +can be reimplemented. +Some of the KornShell language features have been reimplemented +in the GNU shell, bash, in zsh and mksh, and in pdksh, a public domain +implementation. + +
Is ksh public domain?
+ +No, earlier versions were owned by both AT&T and Novell. +The 1993 version is owned by both Lucent and AT&T. + +
Is source code available?
+ +Starting in March 2000, the ksh93 source is available +as part of a larger collection of software called +the ast-open software package which can be downloaded +from the +github page. + +
What are the licensing terms?
+ +The exact license terms can be found on the +licence page. + +
Does the license allow binaries to be freely redistributed?
+ +Yes, provided you make the license terms available to +everyone you distribute binaries to. + +
If I make changes to the code, do I have to make them public?
+ +No, you do not have to make them public. +However, if you distribute the changes, you must allow us to be able +to get these changes and distribute them along with the source. + +
Why do some vendors still ship ksh88, not ksh93?
+ +Since ksh88 was included in System V release 4, most vendors +have just included this version. However most Linux systems +and Mac OS provide ksh93 version 's' or later. Solaris11 uses +ksh93 as /bin/sh. + +
Do you provide support for ksh?
+ +No, we will try to fix any bugs we hear about in future +releases, but we do not provide any official support. + +
Is ksh supported commercially?
+ +Software vendors that supply ksh with +their systems typically support it for that system. + +
What is pdksh and is it related to ksh or KornShell?
+ +pdksh is a public domain version of a UNIX shell that is +unrelated to ksh. +It supports most of the 1988 KornShell language features and some of the 1993 features. +Some KornShell scripts will not run with pdksh. + +
How is the MKS Toolkit KornShell related to KornShell?
+ +MKS Toolkit KornShell is a completely independent implementation +that supports a subset of the 1988 KornShell language. + +
What systems does ksh run on?
+ +ksh has been written to be portable. +It has been ported to virtually run on every known UNIX system. +In addition it runs on non-UNIX systems such as IBM's MVS using OpenEdition, and +Microsoft's Windows 9X, Windows NT and Windows 2000. +ksh is part of the UWIN (Unix for Windows) +software, + +
Does ksh conform to the IEEE POSIX and ISO shell standard?
+ +The 1993 version should conform to the 1992 standard. +At one point it had passed the test suite created by X/OPEN. + +
Will KornShell 88 scripts run with KornShell 93?
+ +In almost all cases, the answer is yes. +However, the IEEE POSIX and ISO standards required a few +changes that could cause scripts to fail. +There is a separate document that lists all known incompatibilities. + +
Can ksh run as /bin/sh?
+ +We have installed ksh as /bin/sh on several systems without +encountering any problems. It is /bin/sh on Solaris11. +Our Linux systems use this instead of bash. + +
+
+ +

+


interactive

+
+
+ +
How do I get separate history files for shell?
+ +ksh uses a shared history file for all shells that +use the same history file name. +This means that commands entered in one window will be seen by +shells in other windows. +To get separate windows, the HISTFILE variable needs to be set to different name +before the first history command is created. + +
How do I get the time of day in my prompt?
+ +You can use printf with supports the %T format for time and date formatting. +For example, the format %(%H:%M:%S)T specifies time in hour, minute, second +format and if no argument is specified, the current time is used. Thus setting +PS1='$(printf "%(%H:%M:%S)T" $' will output the time of day before the +$ prompt. + +
Why does the screen width not function correctly when non-printing characters are in my prompt?
+ +The shell computes the screen width by subtracting the width of the prompt from the screen width. +To account for non-printing characters, for example escape sequences that display in the title +bar, follow these characters with a carriage return. +The shell starts recomputing the width after each carriage return. + +
What is the PS4 prompt and how is it used?
+ +The PS4 prompt is evaluated and displayed before each line when +running an execution trace. +If unset, a + and a <space> will +be output before each line in the trace. +Putting '$LINENO' inside PS4 will cause the line number to be displayed. +Putting '$SECONDS' in the PS4 prompt will cause the elapsed time +to be displayed before each line. +Note that single quotes are used to prevent the expansion from happening +when PS4 is defined. + +
How is keybinding done?
+ +ksh93 provides a KEYBD trap that gets executed whenever a key +is entered from the keyboard. +Using this trap, and the associative +array feature of ksh93, a keybind function can easily be written +which will map any entered key sequence to another key sequence. + +
How do I get the arrow keys to work?
+ +Starting with the 'h' point release, on most keyboards you +do not have to do anything to get the arrow keys to work. +However, if they do not generate standard escape sequences, +then you will have to use a keybinding function to get them +to work. + +
Does ksh support file name completion?
+ +Yes, it does. +The default key binding is <ESC><ESC> +however, starting with the 'g' point release, <TAB> also works +for completion. + +
Does ksh support command completion?
+ +If you perform completion on the first word of a command, +ksh will do completion using aliases, functions, and commands. + +
Is completion programmable?
+ +Yes, using the key binding mechanism, you can script the behavior +of any key and therefore cause the current contents of any +line to be replaced by any other line. + +
Is there any way to get the command-line editor to go to more than a single line?
+ +The multiline option (now on by default) allows lines longer than the width +of the screen to be displayed on multiple lines on the screen. +Also in vi-mode, if you hit 'v' while in control mode, it will bring +up a full screen version of vi on the current command. +The command +will execute when you exit vi. + +
What is predictive editing?
+In 2010, a compile option was added that cause the shell to try to predict +what you were trying to type by looking in the history file for all lines +that matched and presenting them as a menu. Any line starting with # would +use the characters you type to find matching lines from the history file. +If you find the line you wanted, you can enter the number followed by +<TAB> or newline. However bugs in earlier version led to core dumps. + + +
Can I use the shell line editor on other commands?
+ +The command ie, that comes along with shell, can be used +to run line input oriented commands with command line editing. + +
When I do echo $?, I am getting 267. What does this mean?
+ +ksh93 reports process that terminate with a signal as 256+signo. +Earlier versions used 128+signo but this makes it impossible +to distinguish from a command exit with that value. +If you run +
+
+kill -l $?
+
+ +on this signal number, it will give the the name of the signal +that caused this exit. + +
When I type builtin, I notice that some of these are full pathnames. What does this mean?
+ +Builtins that are not bound to pathnames are always searched +for before doing a path search. +Builtins that are bound +to pathnames are only executed when the path search would +bind to this pathname. + +
What is a self generating man page?
+ +A self generating man page is one that is generated by the +option parser within that command using an extended version +of the getopts function. +The man page can be generated in html, +troff, or directly for the terminal. +Most builtin commands +in the shell have self generating man pages so that you +can run for example, +kill --man +or +kill --html +to get +the description of kill to the screen or as an html file. +All self-documenting output is to the standard error, +so you must redirect 2>... to capture the output. +

+This same method can also be used for shell scripts. +Run +getopts --man +for more details. + +

What is autoloading?
+ +Autoloading was a method used in ksh88, and still permitted in ksh93 +to declare that a name corresponded to a function. +The function +would be loaded and executed when first referenced. +This was +necessary since FPATH was always searched after PATH with ksh88 +and therefore if you defined a function whose name was the same +as that of a program on your path, the program on your path +would have been executed. +With ksh93, when a pathname is +encountered that is on PATH, but also is in FPATH, this directory +is assumed to be a function directory. +Thus, you can have +function directories searched before program directories so +that autoloading is no longer needed. + +
Why does the output from 'time command 2> file' come out on the screen?
+ +The time command is a compound command in ksh and time is a reserved +word It can be followed by any pipeline. Thus, redirections applied +at the end are for the command, not to time itself. You can use +time {...;} 2> file to capture the timing output to a file. Note, +that with ksh, time works with all commands, for example, +time for i; do xxx;done. + +
When I run 'mv * ../elsewhere' I so that get '-ksh: mv: cannot execute [Arg list too long]', what causes this?
+ +UNIX systems have a limit to the space consumed by command arguments and +environment variables when running commands that are not built into +the shell. The configuration parameter ARG_MAX defines this limit. +You can run 'getconf ARG_MAX' to find the limit for your system. Note +that the shell expands * to the list of files in the current directory +before running mv. In many case the xargs or tw command can be +used to work around this problem by splitting the line into chunks +and invoking the command. Another way to work around this limit +is to make the command a builtin. On systems in which the cmd +library is installed, you can invoke 'builtin -f cmd mv' to make +mv a shell builtin in which case the line length limit no longer +applies. Another alternative is to use a for loop and invoke +the mv command for each file, for exampe, +'for i in *;do mv $i ../elsewhere;done'. +Starting with ksh93o+, a new feature was added to ksh to overcome +this limit in some cases. If a command is preceded by +'command -x', and it fails because there are two many arguments, +the command will be run multiple times with subsets of the arguments. +However, the change in ksh93o+ does not work in the above case +because the ../elsewhere is not used for each subset. This problem +was resolved starting in ksh93p so that +command -x mv * ../elsewhere +should work. Note that it is possible to do alias mv='command -x mv' + +
Is there any way to generate the list of .c files in the current directory and all the subdirectories?
+ +Starting with ksh93o+, the globstar option (set -G or set -o globstar) +was added. With globstar enabled, ** by itself matches zero or more +directories or files, and **/ matches zero or more directories so that +**/*.c will match all .c files under the current directory. + +
Is there any way to prevent sending a HUP signal to a job when I log out if I didn't nohup the job?
+ +Yes, the disown command tells ksh not to forward the HUP signal +to the specified jobs when it disconnects. + +
+
+ +

+


programming

+
+
+ +
What is the difference between * and @, for example, and ?
+ +When used outside of "", they are equivalent. +However, within +double quotes, "$@" produces one argument for each positional +parameter, and "$* produces a single argument. +Note that "$@" +preserves arguments lists, whereas $* may not unless both +word splitting and pathname expansion are disabled. + +
Why do I need spaces around { and } but not around ( and )?
+ +The characters ( and ) are shell metacharacters and are always +treated specially. +For historical reasons, { and } were +treated as reserved words and are only special as separate +words at locations in which a command can begin. + +
How do I get read to maintain the \ characters?
+ +Use read -r instead. + +
How can I a write a ksh script that responds directly to each character so that you user just has to enter y, not y<return>?
+ +There are two ways to do this. +The easiest is to use +
+
+read -n1 x
+
+ +Alternatively, you could do +
+
+function keytrap
+{
+	.sh.edchar=${sh.edchar}$'
+}
+trap keytrap KEYBD
+
+ +and then +
+
+read x
+
+ + +
What is the purpose of $'...'?
+ +The $'...' string literal syntax was added to ksh93 to solve the problem +of entering special characters in scripts. +It uses +ANSI-C rules to translate the string between the '...'. +It would have been cleaner to have all "..." strings handle +ANSI-C escapes, but that would not be backward compatible. + +
What is the -n option used for?
+ +You should always run ksh -n on each script you write. +The -n +option will check for syntax errors on paths that might not +even be checked when you run the script. +It also produces +a number of warning messages. + +
Why are both `...` and $(...) used for command substitution?
+ +The `...` method has some rather strange quoting rules +and does not nest easily. +$(...) was added to ksh88 to +make command substitution easy to use. +`...` is provided +for backwards compatibility only. + +
How can I tell if all the commands of a pipeline have succeeded?
+ +The pipefail option was added to the 'g' point release of ksh93. +With pipefail set, a pipeline will fail if any element of the +pipeline fails. +The exit status will be that of the first +command that has failed. + +
What is the difference between [...] and [[...]]?
+ +The [[...]] is processed as part of the shell grammar +whereas [...] is processed like any other command. +Operators and operands are detected when the command is +read, not after expansions are performed. +The shell does not +do word splitting or pathname generation inside [[...]]. +This allows patterns to be specified for string matching +purposes. You should use [[...]] instead of [...] and test. + +
How come [[ $foo == $bar ]] is true and [[ $bar == $foo ]] is false?
+ +The == operator is not symmetrical. +It takes a string on the left +and a pattern on the right. +However, if you double quote the right +hand side, which removes the special meaning of pattern match +characters, then this becomes a string comparison so that +[[ "$foo" == "bar" ]] and [[ "$bar" == "$foo" ]] are equivalent. + +
Why does ksh93 have print since echo already exists is is widely used?
+ +The behavior of echo varies from system to system. +The POSIX standard does not define the behavior of echo when +the first argument beings with a - or when any argument +contains a  character. +This makes echo pretty useless for +use in portable scripts. + +
What is $bar after running 'echo foo | read bar'?
+ +The answer is foo. +ksh runs the last component of a pipeline +in the current process. +Some shells run it as a subshell +as if you had invoked it as echo foo | (read bar). + +
How can I access a substring of a variable?
+ +The syntax ${varname:offset:len} can be used to generate +the string of length len starting at the the specified +offset. String offsets start at 0. If :len is omitted, +then the remainder of the string will be used. Both offset +and len can be arithmetic expressions. A negative offset is +subtracted from the last offset. + +
What is the difference between ((expr)) and $((expr))?
+ +((expr)) is a command that evaluates an arithmetic expression. +The exit status of this command is 0 if the expression +evaluates to non-zero and is 1 if it evaluates to 0. +0 is an string expansion that expands to a string +representation of the value of this arithmetic expression. +It can be used anywhere a variable substitution is permitted. +

+ +

What is the difference between $((x*y)) and $(($x*$y))?
+ +In the first case the value of x and the value of y are multiplied +together, and then their result is converted to a string. +In the +second case variables $x, *, and $y are concatenated to form +an arithmetic expression which is then evaluated. +This can +yield different results, for example, +
+
+x=2+3 y=4+5
+print $((x*y)) \$(($x*$y))
+45 19
+When x and y are numeric the first form is recommended for better
+performance.
+
+ + +
How do I handle filenames with spaces in them?
+ +To be POSIX conforming, ksh has to do word splitting and +pathname expansion the results of substitutions. +You can +enclose variable substitutions in "..." to prevent both +word splitting and pathname expansion. +Alternatively, +you can disable word splitting by setting IFS='' and +pathname generation with set -o noglob. + +
What are active variables?
+ +By default shell variables are passive. +They hold values +given to them on assignment, and return values on reference. +Active variables allow the assignment and reference (and +other actions) be controlled by functions specific to that +variable. +At the shell level, a 'get', 'set', or 'unset' +shell function can be defined for any variable to make them +active, so that the function foo.set will be invoked whenever +the variable foo is assigned a value. +At the C interface +level, several functions can be stacked together for an +active variable. + +
What is the difference between function name and name()?
+ +In ksh88 these were the same. +However, the POSIX standard +choose foo() for functions and defined System V Release 2 +semantics to them so that there are no local variables +and so that traps are not scoped. +ksh93 keeps the ksh88 +semantics for functions defined as function name, and +has changed the name() semantics to match the POSIX +semantics. +Clearly, +function +name +is more useful. + +
What is the naming conventions for files in FPATH and can one file contain more than one function definition?
+ +You can have more than one function defined in each file defined +in FPATH and all of them will be added to the list of known +functions. Any commands placed in this file outside of function +definitions will be invoked first. The name of the file must be +that of the first function you invoke. If you have several functions +defined in one file, then you should create a link to each of the +function names that can potentially be invoked first. + +
What are name reference variables and how are they used?
+ +Reference variables are variables in which all references +and assignments refer to the variable that they reference. +For example, +
+
+typeset -n name=$1
+name=value
+
+ +is equivalent to +
+
+eval \$1='value'
+
+ +References are most useful for passing arguments such as +arrays to functions. + +
If i=1 and var1=some value, how do I print var$i to get its value?
+ +Either use +
+
+eval print var\$i
+
+ +or +
+
+typeset -n x=var$i
+print $x
+
+ + +
How can I shift the elements of an array?
+ +The shift special builtin-command only works for positional +parameters. +However, noting that array subscripts start at 0, you can use +
+
+typeset -A name "${name[@]:1}"
+
+ +to shift the array. + +
Why are the braces required with array references, e.g. ${x[1]}?
+ +It would be nice to do $x[1], but the POSIX shell would expand $x +and then search for the file pattern resulting by concatenating [1]. +ksh is POSIX compatible. + +
How do I get the list of subscript names for an associative array?
+ +The prefix operator ! in variable expansions can be used to get names. +To get the names of subscripts for an array, associative +or indexed, use ${!var[@]}. + +
How do I do global substitutions on the contents of shell variables?
+ +Use // instead of / for global substitution, ${var//aa/bb} will +expand to the value of with each "aa" replace by "bb". + +
How can I convert %XX values to ascii?
+ +You can convert this to a sequence of ANSI C strings and then eval that +string, for example suppose the variable 'foo' contains %XX strings, then +
+
+eval print -r -- "\$'${foo//'%'@(??)/'\x\1"'\$'"}'"
+
+ +will print out the string in ascii. + +
I want to use exec to open a file. How do I prevent the script from exiting if the exec fails?
+ +If you run +
+
+command exec ... || error ...
+
+ +then error will be executed if the exec fails, but the script +will not terminate. +The command builtin will prevent the shell +from exiting when special built-ins fail. + +
How do I execute a builtin inside a function of the same name?
+ +You use the command builtin for this. +For example, +
+
+function cd
+{
+	command cd "$@" && title "$PWD"
+}
+
+ +will run the builtin command cd from within the function cd +rather than calling the function cd recursively. + +
How are variables scoped in ksh?
+ +The scoping of variables was not defined for ksh88 but in ksh93 +static scoping was specified. +For example the output from +
+
+function f1
+{
+	print foo=$foo
+}
+function f2
+{
+	typeset foo=local
+	f1
+}
+foo=global
+f2
+
+ +will be "global". +To get f2 to cause f1 to print the local +value of foo, f2 can run "foo=$foo f1" instead. + +
Can you write a self reproducing program in KornShell?
+ +Yes, the following program is self reproducing. +Any shorter ones? +
+
+n="
+" q="'" x="cat <<-!" y=! z='n="$n" q="$q" x="$x" y=$y z=$q$z$q$n$x$n$z$n$y'
+cat <<-!
+n="$n" q="$q" x="$x" y=$y z=$q$z$q$n$x$n$z$n$y
+!
+
+ + +
+
+ +

+


redirections

+
+
+ +
How do I redirect both standard input and standard output to a file?
+ +Add the following redirections to the command. +> file 2> &1. +This will redirect standard output (file descriptor 1) to "file" and +standard error (file descriptor 2) to the same place as file descriptor 1. +ksh redirection allows you to redirect any single digit file descriptor +by putting the descriptor number in front of the redirection operator +with no intervening space. + +
Is there a way for the shell to pick the file number when I open a file?
+ +Yes, a redirection operator operator can be preceded by {n} without any +intervening space where n is the name of a variable. The file descriptor +will be placed in variable n. + +
How do I connect to a socket from a shell script?
+ +exec 3<> /dev/tcp/hostname/portnum +will open a tcp connection to portnum on hostname for +reading and writing on file descriptor 3. +You can then +use read and print statements with file descriptor 3, +or redirection operators <&3 or >&3 to use these connections. + +
How do I seek to a given location in a file?
+ +The redirection operators <# and ># allow you to seek to a specified +location in a file. The operator can be followed by an arithmetic +expression contained in ((...)). The variables CUR and EOF can be used +in the arithmetic expression to get relative locations or locations +relative to the end of file respectively. +Alternatively, <# and ># can be followed by a shell pattern. In this +case, the file will be positioned to beginning of the next line +containing this pattern. + +
What is the the <<< redirection operator?
+ +It denotes a here-document in which the document is contained the +argument that follows <<< and therefore there is no delimiter. + +
What is the the >; redirection operator?
+ +This operator writes the output into a temporary file in the same +directory as the file specified after >;. If the command completes +successfully, then the the file is replaced. Otherwise, the +original file is unchanged and the temporary file removed. + +
What is the the <>; redirection operator?
+ +The file is opened for reading and writing as with <>. However, +when the file is closed it is truncated to the its current location. + +
+
+ +

+


extensions

+
+
+ +
Is there a shell compiler?
+ +There is a separate command named shcomp that will convert +a script into an intermediate machine independent form. +The shell will detect this format whenever it runs a script and execute +directly from this intermediate format. + +
What is the advantage of making commands built-in?
+ +The startup time is reduced by a couple of orders of magnitude. +In addition, built-in commands can access ksh internals. + +
What is the disadvantage of making commands built-in?
+ +Errors in these built-ins can cause the shell to crash. + +
How do I add built-in commands?
+ +There are two ways to do this. +One is write a shared library +with functions whose names are b_xxxx where xxxx is the name of +the builtin. +The function b_xxxx takes three arguments. +The first +two are the same as a mail program. +The third parameter is +a pointer argument which will point to the current shell context. +The second way is to write a shared library with a function named +lib_init(). +This function will be called with an argument of 0 +after the library is loaded. +This function can add built-ins +with the sh_addbuiltin() API function. +In both cases, the +library is loaded into the shell with the "builtin" utility. + +
Can ksh93 be embedded?
+ +Yes, ksh93 can be compiled as a shared or dynamically linked +library which can be embedded into applications. +There is +an API for interfacing to shell variables and to several of +the internal shell functions. + +
Can I write GUI applications with ksh?
+ +There are two extensions to ksh that can be used to write +GUI applications as shell script. +One is dtksh which +was written by Steve Pendergrast at Novell and is +included with the Common Desktop Environment, CDE. +The other is +tksh which was written by Jeff Korn. +tksh combines the tk graphics +package with ksh93 and reimplements the tcl language +as an extension so that both tcl and ksh scripts +can run in the same address space. +The source for tksh +is included in the ast-open package. + +
+
+ + + + + +
show all answershide all answers
+

+


+ + + + + + +
June 19, 2012
+

+ +

+ + + diff --git a/docs/ksh/features.html b/docs/ksh/features.html new file mode 100644 index 000000000..8c3abe0dd --- /dev/null +++ b/docs/ksh/features.html @@ -0,0 +1,207 @@ + + + + + www/ksh/features.mm mm document + + + + + +
+ + + +

+

ksh features

+KSH-93 is the most recent version of the KornShell Language described in +The KornShell Command and Programming Language, +by Morris Bolsky and David Korn of AT&T Research (nee Bell Laboratories). +The KornShell is a shell programming language, +which is upward compatible with +sh +(the Bourne Shell), +and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and +Utilities standard. +KSH-93 provides an enhanced programming environment in +addition to the major command-entry features of the BSD +shell +csh. +With KSH-93, medium-sized programming tasks can be +performed at shell-level without a significant loss in performance. +In addition, +sh +scripts can be run on KSH-93 without modification. +

+The code should conform to the IEEE POSIX 1003.1 standard and to the +proposed ANSI-C standard so that it should be portable to all +such systems. +Like the previous version, KSH-88, +it is designed to accept eight bit character sets +transparently, thereby making it internationally compatible. +It can support multi-byte characters sets with some characteristics +of the character set given at run time. +

+KSH-93 provides the following features, many of which were also inherent +in KSH-88: + +

+

Enhanced Command Re-entry Capability

+The KSH-93 history +function records commands entered at any shell level and stores +them, up to a user-specified limit, even after you log off. +This allows you to re-enter long commands with a few keystrokes +- even those commands you entered yesterday. +The history file allows for eight bit characters in +commands and supports essentially unlimited size histories. + +

+

In-line Editing

+In +sh +the only way to fix mistyped +commands is to backspace or retype the line. +KSH-93 allows you +to edit a command line using a choice of EMACS-TC or +vi +functions. +You can use the in-line editors to complete filenames as +you type them. +You may also use this editing feature when entering +command lines from your history file. +A user can capture keystrokes and rebind keys to customize the +editing interface. + +

+

Extended I/O Capabilities

+KSH-93 provides several I/O +capabilities not available in +sh, +including the ability to: +
    +
  • +specify a file descriptor for input and output +
  • +start up and run co-processes +
  • +produce a prompt at the terminal before a read +
  • +easily format and interpret responses to a menu +
  • +echo lines exactly as output without escape processing +
  • +format output using printf formats. +
  • +read and echo lines ending in "\e". +
+ +

+

Improved performance

+KSH-93 executes many scripts faster +than the System V Bourne shell. +A major reason for this is +that many of the standard utilities are built-in. +To reduce the time to initiate a command, KSH-93 allows +commands to be added as built-ins at run time +on systems that support dynamic loading such as System V Release 4. + +

+

Arithmetic

+KSH-93 allows you to do integer arithmetic in any +base from two to sixty-four. +You can also do double +precision floating point arithmetic. +Almost the complete set of C language operators are available +with the same syntax and precedence. +Arithmetic expressions can be used to as an argument expansion +or as a separate command. +In addition there is an arithmetic for command that works +like the for statement in C. + +

+

Arrays

+KSH-93 supports both indexed and associative arrays. +The subscript for an indexed array is an arithmetic expression, +whereas, the subscript for an associative array is a string. + +

+

Functions and Aliases

+Two mechanisms - functions and +aliases - can be used to assign a user-selected identifier to +an existing command or shell script. +Functions allow local variables and provide scoping +for exception handling. +Functions can be searched for and loaded on first reference the +way scripts are. + +

+

Substring Capabilities

+KSH-93 allows you to create a +substring of any given string either by specifying the starting +offset and length, or by stripping off leading +or trailing substrings during parameter substitution. +You can also specify attributes, such as upper and lower case, +field width, and justification to shell variables. + +

+

Enhanced pattern matching capabilities

+KSH-93 allows you to specify +regular expressions for file and string matches. + +

+

Improved debugging

+KSH-93 can generate line numbers on execution traces. +Also, I/O redirections are now traced. +There is a DEBUG trap that gets evaluated after each command +so that errors can be localized. + +

+

Job Control

+On systems that support job control, including +System V Release 4, KSH-93 +provides a job-control mechanism almost identical to that of +the BSD "csh", version 4.1. +This feature allows you +to stop and restart programs, and to move programs between the +foreground and the background. + +

+

Added security

+KSH-93 can execute scripts which do not have read permission +and scripts which have the setuid and/or setgid set when +invoked by name, rather than as an argument to the shell. +It is possible to log or control the execution of setuid and/or +setgid scripts. +The noclobber option prevents you from accidentally erasing +a file by redirecting to an existing file. + +

+

Documentation

+Documentation for KSH-93 consists of an +Introduction to KSH-93, +Compatibility with the Bourne Shell, +a manual page and a +README file. +In addition, the +New KornShell Command and Programming Language +book is available from Prentice Hall. +

+


+ + + + + + +
March 13, 2012
+

+ +

+ + + diff --git a/docs/ksh/functions/dirs.txt b/docs/ksh/functions/dirs.txt new file mode 100644 index 000000000..1bc9346f4 --- /dev/null +++ b/docs/ksh/functions/dirs.txt @@ -0,0 +1,111 @@ +# +# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS +# +# Uses global parameters _push_max _push_top _push_stack +integer _push_max=100 _push_top=100 +# Display directory stack -- $HOME displayed as ~ +function dirs +{ + typeset dir="${PWD#$HOME/}" + case $dir in + $HOME) + dir=\~ + ;; + /*) ;; + *) dir=\~/$dir + esac + print -r - "$dir ${_push_stack[@]}" +} + +# Change directory and put directory on front of stack +function pushd +{ + typeset dir= type=0 + integer i + case $1 in + "") # pushd + if ((_push_top >= _push_max)) + then print pushd: No other directory. + return 1 + fi + type=1 dir=${_push_stack[_push_top]} + ;; + +[1-9]|+[1-9][0-9]) # pushd +n + integer i=_push_top$1-1 + if ((i >= _push_max)) + then print pushd: Directory stack not that deep. + return 1 + fi + type=2 dir=${_push_stack[i]} + ;; + *) if ((_push_top <= 0)) + then print pushd: Directory stack overflow. + return 1 + fi + esac + case $dir in + \~*) dir=$HOME${dir#\~} + esac + cd "${dir:-$1}" > /dev/null || return 1 + dir=${OLDPWD#$HOME/} + case $dir in + $HOME) + dir=\~ + ;; + /*) ;; + *) dir=\~/$dir + esac + case $type in + 0) # pushd name + _push_stack[_push_top=_push_top-1]=$dir + ;; + 1) # pushd + _push_stack[_push_top]=$dir + ;; + 2) # push +n + type=${1#+} i=_push_top-1 + set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}" + shift $type + for dir + do (((i=i+1) < _push_max)) || break + _push_stack[i]=$dir + done + esac + dirs +} + +# Pops the top directory +function popd +{ + typeset dir + if ((_push_top >= _push_max)) + then print popd: Nothing to pop. + return 1 + fi + case $1 in + "") + dir=${_push_stack[_push_top]} + case $dir in + \~*) dir=$HOME${dir#\~} + esac + cd "$dir" || return 1 + ;; + +[1-9]|+[1-9][0-9]) + typeset savedir + integer i=_push_top$1-1 + if ((i >= _push_max)) + then print pushd: Directory stack not that deep. + return 1 + fi + while ((i > _push_top)) + do _push_stack[i]=${_push_stack[i-1]} + i=i-1 + done + ;; + *) print pushd: Bad directory. + return 1 + esac + unset '_push_stack[_push_top]' + _push_top=_push_top+1 + dirs +} diff --git a/docs/ksh/functions/emacs_keybind.txt b/docs/ksh/functions/emacs_keybind.txt new file mode 100644 index 000000000..1f2b8b747 --- /dev/null +++ b/docs/ksh/functions/emacs_keybind.txt @@ -0,0 +1,12 @@ +typeset -A Keytable +trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD +function emacs_keybind +{ + keybind $'\E[A' $'\020' # Up key + keybind $'\E[B' $'\016' # Down key + keybind $'\E[C' $'\06' # Right key + keybind $'\E[D' $'\02' # Left key + keybind $'\E[H' $'\01' # Home key + keybind $'\E[Y' $'\05' # End key + keybind $'\t' $'\E\E' # Tab for command-line completion +} diff --git a/docs/ksh/functions/getopt.txt b/docs/ksh/functions/getopt.txt new file mode 100644 index 000000000..fe1e97fb0 --- /dev/null +++ b/docs/ksh/functions/getopt.txt @@ -0,0 +1,28 @@ +function getopt +{ + typeset c optstring=$1 options= sep= + shift + while getopts $optstring c + do case $c in + [:?]) + exit 2 + ;; + *) + options="$options$sep-$c" + sep=' ' + if [[ $optstring == *$c:* ]] + then options=" $options $OPTARG" + fi + #then print -rn -- " -$c" "$OPTARG" + #else print -rn -- " -$c" + ;; + esac + done + print -rn -- "$options" + if [[ ${@:$OPTIND-1} != -- ]] + then print -rn -- " --" + fi + if [[ -n ${@:$OPTIND} ]] + then print -r -- " ${@:$OPTIND}" + fi +} diff --git a/docs/ksh/functions/keybind.txt b/docs/ksh/functions/keybind.txt new file mode 100644 index 000000000..501170a73 --- /dev/null +++ b/docs/ksh/functions/keybind.txt @@ -0,0 +1,14 @@ +typeset -A Keytable +trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD +function keybind # key action +{ + typeset key=$(print -f "%q" "$2") + case $# in + 2) Keytable[$1]='.sh.edchar=${.sh.edmode}'"$key" + ;; + 1) unset Keytable[$1] + ;; + *) print -u2 "Usage: $0 key [action]" + ;; + esac +} diff --git a/docs/ksh/functions/popd.txt b/docs/ksh/functions/popd.txt new file mode 100644 index 000000000..4924c1616 --- /dev/null +++ b/docs/ksh/functions/popd.txt @@ -0,0 +1,111 @@ +# +# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS +# +# Uses global parameters _push_max _push_top _push_stack +integer _push_max=100 _push_top=100 +# Display directory stack -- $HOME displayed as ~ +function dirs +{ + typeset dir="${PWD#$HOME/}" + case $dir in + $HOME) + dir=\~ + ;; + /*) ;; + *) dir=\~/$dir + esac + print -r - "$dir ${_push_stack[@]}" +} + +# Change directory and put directory on front of stack +function pushd +{ + typeset dir= type=0 + integer i + case $1 in + "") # pushd + if ((_push_top >= _push_max)) + then print pushd: No other directory. + return 1 + fi + type=1 dir=${_push_stack[_push_top]} + ;; + +[1-9]|+[1-9][0-9]) # pushd +n + integer i=_push_top$1-1 + if ((i >= _push_max)) + then print pushd: Directory stack not that deep. + return 1 + fi + type=2 dir=${_push_stack[i]} + ;; + *) if ((_push_top <= 0)) + then print pushd: Directory stack overflow. + return 1 + fi + esac + case $dir in + \~*) dir=$HOME${dir#~} + esac + cd "${dir:-$1}" > /dev/null || return 1 + dir=${OLDPWD#$HOME/} + case $dir in + $HOME) + dir=\~ + ;; + /*) ;; + *) dir=\~/$dir + esac + case $type in + 0) # pushd name + _push_stack[_push_top=_push_top-1]=$dir + ;; + 1) # pushd + _push_stack[_push_top]=$dir + ;; + 2) # push +n + type=${1#+} i=_push_top-1 + set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}" + shift $type + for dir + do (((i=i+1) < _push_max)) || break + _push_stack[i]=$dir + done + esac + dirs +} + +# Pops the top directory +function popd +{ + typeset dir + if ((_push_top >= _push_max)) + then print popd: Nothing to pop. + return 1 + fi + case $1 in + "") + dir=${_push_stack[_push_top]} + case $dir in + \~*) dir=$HOME${dir#~} + esac + cd "$dir" || return 1 + ;; + +[1-9]|+[1-9][0-9]) + typeset savedir + integer i=_push_top$1-1 + if ((i >= _push_max)) + then print pushd: Directory stack not that deep. + return 1 + fi + while ((i > _push_top)) + do _push_stack[i]=${_push_stack[i-1]} + i=i-1 + done + ;; + *) print pushd: Bad directory. + return 1 + esac + unset '_push_stack[_push_top]' + _push_top=_push_top+1 + dirs +} diff --git a/docs/ksh/functions/pushd.txt b/docs/ksh/functions/pushd.txt new file mode 100644 index 000000000..1bc9346f4 --- /dev/null +++ b/docs/ksh/functions/pushd.txt @@ -0,0 +1,111 @@ +# +# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS +# +# Uses global parameters _push_max _push_top _push_stack +integer _push_max=100 _push_top=100 +# Display directory stack -- $HOME displayed as ~ +function dirs +{ + typeset dir="${PWD#$HOME/}" + case $dir in + $HOME) + dir=\~ + ;; + /*) ;; + *) dir=\~/$dir + esac + print -r - "$dir ${_push_stack[@]}" +} + +# Change directory and put directory on front of stack +function pushd +{ + typeset dir= type=0 + integer i + case $1 in + "") # pushd + if ((_push_top >= _push_max)) + then print pushd: No other directory. + return 1 + fi + type=1 dir=${_push_stack[_push_top]} + ;; + +[1-9]|+[1-9][0-9]) # pushd +n + integer i=_push_top$1-1 + if ((i >= _push_max)) + then print pushd: Directory stack not that deep. + return 1 + fi + type=2 dir=${_push_stack[i]} + ;; + *) if ((_push_top <= 0)) + then print pushd: Directory stack overflow. + return 1 + fi + esac + case $dir in + \~*) dir=$HOME${dir#\~} + esac + cd "${dir:-$1}" > /dev/null || return 1 + dir=${OLDPWD#$HOME/} + case $dir in + $HOME) + dir=\~ + ;; + /*) ;; + *) dir=\~/$dir + esac + case $type in + 0) # pushd name + _push_stack[_push_top=_push_top-1]=$dir + ;; + 1) # pushd + _push_stack[_push_top]=$dir + ;; + 2) # push +n + type=${1#+} i=_push_top-1 + set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}" + shift $type + for dir + do (((i=i+1) < _push_max)) || break + _push_stack[i]=$dir + done + esac + dirs +} + +# Pops the top directory +function popd +{ + typeset dir + if ((_push_top >= _push_max)) + then print popd: Nothing to pop. + return 1 + fi + case $1 in + "") + dir=${_push_stack[_push_top]} + case $dir in + \~*) dir=$HOME${dir#\~} + esac + cd "$dir" || return 1 + ;; + +[1-9]|+[1-9][0-9]) + typeset savedir + integer i=_push_top$1-1 + if ((i >= _push_max)) + then print pushd: Directory stack not that deep. + return 1 + fi + while ((i > _push_top)) + do _push_stack[i]=${_push_stack[i-1]} + i=i-1 + done + ;; + *) print pushd: Bad directory. + return 1 + esac + unset '_push_stack[_push_top]' + _push_top=_push_top+1 + dirs +} diff --git a/docs/ksh/functions/title.txt b/docs/ksh/functions/title.txt new file mode 100644 index 000000000..2338ce6b4 --- /dev/null +++ b/docs/ksh/functions/title.txt @@ -0,0 +1,54 @@ +# add to (+), delete from (-), print (.), or set ([=]) window title +# arguments are eval'd before printing +# title text string exported in TITLE_TEXT + +function title # [+ | - | =] title ... +{ + typeset x t="$TITLE_TEXT" + + case $1 in + +) shift + case $# in + 0) ;; + *) for x + do case " $t " in + *" $x "*) ;; + " ") t=$x ;; + *) t="$t $x" ;; + esac + done + case $t in + $TITLE_TEXT) return 1 ;; + esac + ;; + esac + ;; + -) shift + case $# in + 0) ;; + *) for x + do case " $t " in + *" $x "*) t="${t%?( )$x*}${t##*$x?( )}" ;; + esac + done + case $t in + $TITLE_TEXT) return 1 ;; + esac + ;; + esac + ;; + .) print -r -- "$TITLE_TEXT" + return 0 + ;; + *) t="$*" + ;; + esac + export TITLE_TEXT="$t" + eval x=\"$t\" + case $TERM in + 630*) print -nr -- "[?${#x};0v$x" ;; + vt100|xterm*) print -nr -- "]0;$x" ;; + *) return 1 ;; + esac + return 0 +} diff --git a/docs/ksh/functions/vi_keybind.txt b/docs/ksh/functions/vi_keybind.txt new file mode 100644 index 000000000..56256bfa4 --- /dev/null +++ b/docs/ksh/functions/vi_keybind.txt @@ -0,0 +1,10 @@ +typeset -A Keytable +trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD +function vi_keybind +{ + keybind $'\E[A' k # Up key + keybind $'\E[B' j # Down key + keybind $'\E[C' l # Right key + keybind $'\E[D' h # Left key + keybind $'\t' '\' # Tab for command-line completion +} diff --git a/docs/ksh/index.html b/docs/ksh/index.html new file mode 100644 index 000000000..cf0663d35 --- /dev/null +++ b/docs/ksh/index.html @@ -0,0 +1,10 @@ + +KSH93 + +Overview
+FAQ
+Features
+Builtins
+Examples + + diff --git a/docs/ksh/ksh.html b/docs/ksh/ksh.html new file mode 100644 index 000000000..8df6639e8 --- /dev/null +++ b/docs/ksh/ksh.html @@ -0,0 +1,118 @@ + + + + + www/ksh/ksh.mm mm document + + + + + +
+ + + +

+

ksh overview

+The +KornShell +language was designed and developed by David G. Korn at AT&T Bell Laboratories and AT&T Research. +It is an interactive command language that provides access to the UNIX system and to many other systems, +on the many different computers and workstations on which it is implemented. +The +KornShell +language is also a complete, powerful, high-level programming language for writing applications, +often more easily and quickly than with other high-level languages. +This makes it especially suitable for prototyping. +There are two other widely used shells, the Bourne shell developed by Steven Bourne at AT&T Bell Laboratories, +and the C shell developed by Bill Joy at the University of California. +ksh +has the best features of both, plus many new features of its own. +Thus +ksh +can do much to enhance your productivity and the quality of your work, +both in interacting with the system, and in programming. +ksh +programs are easier to write, and are more concise and readable than programs written in a lower level language such as C. +

+The new version of +ksh +has the functionality of other scripting languages such as awk, icon, perl, rexx, and tcl. +For this and many other reasons, +ksh +is a much better scripting language than any of the other popular shells. +The code size for +ksh +is larger than the Bourne shell or C shell programs. +The revised version is even larger. +

+In spite of its increased size, +ksh +provides better performance. +You can write programs to run faster with +ksh +than with either the Bourne shell or the C shell, sometimes an order of magnitude faster. +ksh +has evolved and matured with extensive user feedback. +It has been used by many thousands of people at AT&T since 1982, and at many other companies and universities. +A survey conducted at one of the largest AT&T Bell Laboratories computer centers showed that 80% of their customers, both programmers and non-programmers, use +ksh. +ksh +is compatible with the Bourne shell. +Virtually all programs written for the Bourne shell run with +ksh. +If you are familiar with the Bourne shell, you can use +ksh +immediately, without retraining. +The new version of +ksh +is compatible with earlier versions of +ksh. +ksh +is readily available. +It is sold (source and binary) by AT&T and Novell, and by other companies under license from AT&T both in the USA and abroad. +It has been purchased by dozens of major corporations, and by many individuals for use on home computers. +ksh +is extensible. +

+The +KornShell +language uses the same syntax for built-in commands as for non built-in commands. +Therefore, system developers can add new commands "transparently" to the +KornShell +language; that is, with minimum effort and with no differences visible to users other than faster execution. +On systems with dynamic linking, it is possible to add new built-in commands at run time. +Novell has extended the new version of +ksh +to enable X-windows programming for their desktop +ksh +product, +dtksh. +dtksh +is a standard part of CDE, the Common Desktop Environment defined by COSE (Common Operating System Environment), supported by most major UNIX system hardware vendors. +An extended version of +ksh +that enables Tk programming, called tksh, is available as well. +

+ksh +is intended to conform to the Shell Language Standard developed by the IEEE POSIX 1003.2 Shell and Utilities Language Committee. +

+


+ + + + + + +
March 13, 2012
+

+ +

+ + + diff --git a/docs/ksh/scripts/cgi-lib.ksh.txt b/docs/ksh/scripts/cgi-lib.ksh.txt new file mode 100644 index 000000000..374b79bc6 --- /dev/null +++ b/docs/ksh/scripts/cgi-lib.ksh.txt @@ -0,0 +1,129 @@ +typeset -A COOKIE HEADER +typeset Cgi _CGI_c _CGI_multipart + +function cgi_header +{ + typeset h + for h in "${!HEADER[@]}" + do printf '%s: %s\n' "$h" "${HEADER[$h]}" + done + print +} + +function cgi_url +{ + if [[ $SERVER_PORT != 80 ]] + then print "http://$SERVER_NAME:$SERVER_PORT$SCRIPT_NAME" + else print "http://$SERVER_NAME$SCRIPT_NAME" + fi +} + +function cgi_parse +{ + if [[ $REQUEST_METHOD == POST ]] + then if [[ $CONTENT_TYPE == multipart/form-data* ]] + then _CGI_multipart=${TMPDIR-/tmp}/cgi-form-$$ + trap 'rm -rf "$_CGI_multipart"' EXIT + mkdir $_CGI_multipart + unset -f Cgi.set + typeset -A Cgi.file + typeset i b v + pax --nosummary --read --edit ",.*/,," --edit ",^,$_CGI_multipart/," + for i in $_CGI_multipart/* + do b=${i##*/} + if [[ $b == +([a-z]) ]] + then v=$(<$i) + eval Cgi.$b='$v' + else Cgi.file[$b]=$i + fi + done + else Cgi=$(<&0) # Read from stdin + fi + else Cgi="$QUERY_STRING" + fi + cgi_cookie "$HTTP_COOKIE" + HEADER["Content-type"]="text/html" +} + +function cgi_cookie +{ + typeset cookie=$1 name val c IFS=';' + set -- $cookie + for c + do + IFS='=' + set -- $c + name=${1##' '} val=${2##' '} # trim white space + name=${name%%' '} val=${val%%' '} + COOKIE[$name]=$val + done +} + +function cgi_setcookie # name value +{ + HEADER["Set-Cookie"]="$1=$2; path=$SCRIPT_NAME" +} + +## Cgi variable disciplines + +function Cgi.set +{ + set -f + typeset i j n val IFS='&' + set -- ${.sh.value} + for i + do n=${i%%=*} + [[ $n == [[:alpha:]_]*([[:alnum:]_]) ]] || continue + val=${i#$n=} + val=${val//+/ } + val=${val//@([\'\\])/'\'\1} + eval j=\${#${.sh.name}.${n}[@]} \ + "${.sh.name}.${n}[j]=\$'${val//'%'@(??)/'\x'\1"'\$'"}'" + done +} + +function cgi_C_init +{ + integer i + for ((i=1; i < 256; i++)) + do if (( i!=16#22 && i!=16#27 && i!=16#5C && i!=16#5B && i!=16#5D )) + then printf $'_CGI_c[$\'\\\\x%.2X\']=%%%.2X\n' $i $i + fi + done + print +} + +function cgi_encode +{ + typeset v=$1 + var=${v//' '/+} + cbrace='}' + eval var=${var//@([!a-zA-Z0-9_+])/\${_CGI_c[\\\1]$cbrace} + print -r -- "$var" +} + +function Cgi.get +{ + typeset i val name vname + if [[ ! ${_CGI_c[\\]} ]] + then val='"' + _CGI_c[""]=%00 + _CGI_c[$var]=%22 + _CGI_c[\']=%27 + _CGI_c[\]]=%5B + _CGI_c[\[]=%5D + _CGI_c[\\]=%5C + eval $(cgi_C_init) + unset -f cgi_C_init + fi + vname=${.sh.name} # .sh.name contains variable name + .sh.value= # .sh.value stores value + for i in ${!Cgi.@} + do + name=${i#$vname.} + nameref v=${i} + val=$(cgi_encode "$v") + .sh.value="${.sh.value}${.sh.value:+&}$name=$val" + done +} + diff --git a/docs/ksh/scripts/dump-cgi.ksh.txt b/docs/ksh/scripts/dump-cgi.ksh.txt new file mode 100644 index 000000000..579921626 --- /dev/null +++ b/docs/ksh/scripts/dump-cgi.ksh.txt @@ -0,0 +1,17 @@ +#!/bin/ksh + +. ./cgi-lib.ksh + +cgi_parse +cgi_header + +print "" +print "
"
+print -r "Url: $(cgi_url)"
+for i in ${!Cgi.*}
+do
+	nameref val=$i
+	print -r "$i = $val"
+done
+print "
" +print "" diff --git a/docs/ksh/scripts/env.txt b/docs/ksh/scripts/env.txt new file mode 100644 index 000000000..5989dd7e4 --- /dev/null +++ b/docs/ksh/scripts/env.txt @@ -0,0 +1,66 @@ +#! /usr/bin/ksh +# shell version of env command +case $(getopts '[-]' opt '--???man' 2>&1) in +version=[0-9]*) + usage=$'[-?@(#)env (AT&T Labs Research) 1999-05-20\n] + [-author?David Korn ] + [-license?http://www.research.att.com/sw/tools/reuse] + [+NAME?env - set environment for command invocation] + [+DESCRIPTION?\benv\b modifies the current environment according + to the \aname\a\b=\b\avalue\a arguments, and then + invokes \acommand\a with the modified environment.] + [+?If \acommand\a is not specified, the resulting environment + is written to standard output quoted as required for + reading by the \bsh\b.] + [i:ignore-environment?Invoke \acommand\a with the exact environment + specified by the \aname\a\b=\b\avalue\a arguments; inherited + environment variables are ignored. As an obsolete feature, + \b-\b by itself can be specified instead of \b-i\b.] + [u:unset]:[name?Unset the environment variable \aname\a if it was + in the environment. This option can be repeated to unset + additional variables.] + + [name=value]... [command ...] + + [+EXIT STATUS?If \acommand\a is invoked, the exit status of \benv\b + will be that of \acommand\a. Otherwise, it will be one of + the following:]{ + [+0?\benv\b completed successfully.] + [+126?\acommand\a was found but could not be invoked.] + [+127?\acommand\a could not be found.] + } + [+SEE ALSO?\bsh\b(1), \bexport\b(1)] + ' + ;; +*) + usage='iu:[name] [name=value]... [command ...]' + ;; +esac +clear= +while getopts "$usage" var +do case $var in + i) clear=1;; + u) command unset $OPTARG 2> /dev/null;; + esac +done +#[[ $var == "" ]] || exit 1 +shift $((OPTIND-1)) +if [[ $1 == - ]] # obsolete form +then clear=1 + shift +fi +if [[ $clear == 1 ]] +then typeset +x $(typeset +x) +fi +while true +do case $1 in + *=*) export "$1";; + *) break;; + esac + shift +done +if (( $# >0 )) +then exec "$@" +else export + exit 0 +fi diff --git a/docs/ksh/scripts/line.txt b/docs/ksh/scripts/line.txt new file mode 100644 index 000000000..7451ea51a --- /dev/null +++ b/docs/ksh/scripts/line.txt @@ -0,0 +1,2 @@ +#! /bin/ksh +read -r && print -r -- "$REPLY" diff --git a/docs/ksh/scripts/which.txt b/docs/ksh/scripts/which.txt new file mode 100644 index 000000000..1e4b009cb --- /dev/null +++ b/docs/ksh/scripts/which.txt @@ -0,0 +1,2 @@ +#! /bin/ksh +whence -p "$@" diff --git a/lib/package/CONVERT.mk b/lib/package/CONVERT.mk new file mode 100644 index 000000000..63a60ef5f --- /dev/null +++ b/lib/package/CONVERT.mk @@ -0,0 +1,260 @@ +/* + * {automake|configure} => {nmake|iffe} conversion support + * + * The first command line target overrides the default original source + * directory name $(MAKEFILE:D). The hard work is in the makefile using + * these assertions, since it must (manually) provide the nmake makefiles + * and config equivalent iffe scripts. The conversion makefile is typically + * named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory, + * and the conversion is run from the $PACKAGEROOT directory, e.g.: + * + * nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt + * + * The conversion requires the ast nmake, pax and tw commands. + * + * After the conversion you will be liberated from ./configure, *.in, + * *.am, automake, autom4te, libtool, make depend, and makefile + * recursion ordering. You can build from $PACKAGEROOT using the ast + * package(1) (which sets up the { HOSTTYPE PATH VPATH } environment): + * + * package make + * + * or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion + * of the hierarchy with the ast nmake(1) (after setting PATH and VPATH): + * + * nmake + * + * The conversion assertions are: + * + * package :CONVERT: file ... + * + * files in the original source directory are copied + * and converted into the ./src and ./lib subdirectories + * the default original source directory is ./original + * + * package package name + * file original source file that must exist + * + * :OMIT: pattern + * + * files matching pattern are not copied into the converted + * directory + * + * pattern ksh pattern of files to omit + * + * :COPY: from to [ file ... ] + * + * files in the from directory are copied to the to directory + * the action may contain :MOVE: exceptions to the copy + * + * from original directory subdirectory + * . names the original directory + * .. names the + * to converted subdirectory + * libNAME => src/lib/libNAME + * NAME => src/cmd/NAME + * file files or files in subdirectories to be copied; + * explicit files are copied to the to directory; + * if no files are specified then the from hierarchy + * is recursively copied to the converted directory + * + * :MOVE: to file ... + * + * :COPY: assertion exceptions placed in the assertion's action + * + * to files or subdirectory files are copied to this directory + * file file or files in subdirectories to be copied + * + * :FILE: to file <FD)" + original := $(D) + .ARGS : .CLEAR $(~.ARGS:O>1) + end + end + +.cvt.filter = +.cvt.package = + +.cvt.atom : .FUNCTION + local N V + V := $(%:O=1) + let .cvt.$(V) = .cvt.$(V) + 1 + return .cvt.$(V).$(.cvt.$(V)) + +.cvt.omit : .FUNCTION + return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)' + +.cvt.to : .FUNCTION + if "$(%)" == "." + return src + end + if "$(%)" == "*/*" + return src/$(%) + end + if "$(%)" == "lib*" + return src/lib/$(%) + end + return src/cmd/$(%) + +":CONVERT:" : .MAKE .OPERATOR + local I + package := $(<) + I := $(hierarchy:C,$,/Makefile) + init : .cvt.verify $(I) + $(I) : .ACCEPT + test -d $(<:D) || $(MKDIR) -p $(<:D) + echo :MAKE: > $(<) + .cvt.verify : .MAKE .FORCE .REPEAT + local I + if I = "$(.cvt.package:T!=F)" + error 3 $(original): not a $(package) source directory: missing $(I) + end + .cvt.package := $(>:C,^,$$(original)/,) + +":COPY:" : .MAKE .OPERATOR + local F T I A + F := $(>:O=1) + T := $(.cvt.to $(>:O=2)) + A := $(.cvt.atom copy) + copy : $(A) + $(A) : .VIRTUAL + if F == "." + $(A) : $(T) + $(T) : + test -d $(<) || $(MKDIR) -p $(<) + for I $(>:O>2) + eval + $$(A) : $(I:D=$(T):B:S) + $(I:D=$(T):B:S) : $$(original)/$(I) + $$(CP) $$(CPFLAGS) $$(*) $$(<) + end + end + elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))" + eval + $$(A) : $$(F) + test -d $(T) || $$(MKDIR) -p $(T) + cd $(T) + $$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter) + end + else + F := $$(original)/$(F) + if ! "$(@:V)" + eval + $$(A) : .FORCE + test -d $(T) || $$(MKDIR) -p $(T) + cd $(F:V) + $$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A) + end + else + .cvt.move = + : $(@:V:@R) + eval + $$(A) : .FORCE + test -d $(T) || $$(MKDIR) -p $(T) + cd $(F:V) + $$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A) + end + end + end + +":EDIT:" : .MAKE .OPERATOR + local A D F + D := $(>:O=1) + if D == "-" + A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G) + .cvt.filter += --action=$(A:@Q) + else + D := $(.cvt.to $(D)) + F := $(>:O>1:C,^,$(D)/,) + edit : $(F) + eval + $$(F) : + $$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)' + $(@:V) + w + q + $(here) + end + end + +":FILE:" : .MAKE .OPERATOR + local ( D F ) $(>) + local A + A := $(.cvt.atom file) + $(A) := $(@:V) + D := $(.cvt.to $(D)) + file : $(D)/$(F) + eval + $$(D)/$$(F) : + test -d $$(<:D) || $$(MKDIR) -p $$(<:D) + cat > $$(<) <<'$(here)' + $$($(A):V) + $(here) + end + +":MOVE:" : .MAKE .OPERATOR + local T I + T := ../../../$(.cvt.to $(>:O=1)) + for I $(>:O>1) + if I == "*/" + .cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)' + .cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)' + else + .cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)' + end + end + +":OMIT:" : .MAKE .OPERATOR + local P + for P $(>) + omit := $(omit)|$(P) + end diff --git a/lib/package/INIT.README b/lib/package/INIT.README new file mode 100644 index 000000000..6ee06f829 --- /dev/null +++ b/lib/package/INIT.README @@ -0,0 +1,1029 @@ +The INIT package is required by all but the standalone and self +extracting archive packages. It contains the package command, support +scripts, and utilities. The package command installs binary packages, +makes source packages, and generates new package tarballs. + +Source Package Installation Instructions: + + (1) Do not install packages as root/super-user. Although some components may + have setuid executables, few must be owned by root. These are best + changed manually when the security implications are understood. + (2) Choose a package root directory and cd to it. This will be a local work + area for all packages. + (3) These instructions bypass the click to download package links on the + download site. If you already clicked, or if your system does not have + curl(1), hurl(1), lynx(1) or wget(1) then use the alternate instructions + for (3),(4),(5) in plan B below. Plan B installs the hurl(1) + script which works with ksh and modern bash. The top level URL is: + URL=http://www.research.att.com/sw/download + (4) If the bin/package script does not exist then run: + test -d bin || mkdir bin + url=$URL/package + (wget -O - $url||curl -L $url||hurl $url) > bin/package + chmod +x bin/package + (5) Determine the list of package names you want from the download site, then + use the package(1) command to do the actual download: + bin/package authorize "NAME" password "PASSWORD" \ + setup source $URL PACKAGE ... + (Refer to the AUTHORIZATION paragraph on the main download page for + NAME/PASSWORD details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + package force ... is specified. Package content is verified using md5sum. + If the package root will contain only one architecture then you can install in bin and + lib instead of arch/HOSTTYPE/bin and arch/HOSTTYPE/lib by running this + instead: + bin/package authorize "NAME" password "PASSWORD" \ + flat setup source $URL PACKAGE ... + To update the same packages from the same URL run: + bin/package setup source + (6) Build and install; all generated files are placed under arch/HOSTTYPE + ($INSTALLROOT), where HOSTTYPE is the output of bin/package (with no + arguments.) name=value arguments are supported; CC and debug=1 (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in $INSTALLROOT/lib/package/gen/make.out: + bin/package make + (7) List make results and interesting errors: + bin/package results + Run the regression tests: + bin/package test + List test results and errors: + bin/package results test + (8) The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + file(1) and nmake(1), require the path of the bin directory to be + exported in PATH. + (9) You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the AT&T nmake(1) command): + bin/package flat install DIRECTORY PACKAGE + This will install in DIRECTORY/bin and DIRECTORY/lib. If you want to + preserve the arch/HOSTTYPE hierarchy under DIRECTORY then omit the + flat argument. If you don't have nmake(1) then the following will do a + flat install: + cd $INSTALLROOT + cp -p -r bin lib include DIRECTORY + (10) To summarize, after the first time the download, build, and test cycle + for the latest source release is: + bin/package setup source + bin/package make + bin/package test + +Source Package Installation Instructions -- Plan B: + + (3) Create the subdirectory lib/package/tgz and download all package archives + into that directory. + (4) If the bin/package script does not exist then manually read the INIT + source package: + gunzip < lib/package/tgz/INIT.YYYY-MM-DD.tgz | tar xvf - + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + tar xvf - lib/package/tgz/INIT.YYYY-MM-DD.tgz + If your system does not have tar(1) or gunzip(1) then download the ratz + source package, compile it, and manually read the INIT + source package: + mkdir bin + cp lib/package/tgz/ratz.YYYY-MM-DD.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.YYYY-MM-DD.tgz + (5) Read all unread package archive(s): + bin/package read + Both source and binary packages will be read by this step. + +All recorded changes follow. + +:::::::: INIT :::::::: + +12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output +12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo() +12-06-20 package.sh: use $KSH for rt in "results test" +12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB +12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB +12-06-13 package.sh: handle admin.db column output +12-06-08 iffe.sh: fix 12-06-06 typo +12-06-06 iffe.sh: check for -l* in reverse and accumulative order (e.g., for -last & -lm) +12-06-04 package.sh: always check $INSTALLROOT/lib/package/profile +12-05-31 Makefile: ID=ast; $(INSTALLROOT)/prototyped.h => $(INSTALLROOT)/$(ID)/prototyped.h +12-05-28 iffe.sh: api foo YYYYMMDD => FOOAPI(rel) test macro +12-05-24 package.sh: change admin.db comment => owner attributes +12-04-25 ratz.c: add sear -k option to keep installation tmp dir on exit +12-04-17 package.sh: skip sh version logic for ``use'' +12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features +12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE +12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness +12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list +12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH +12-02-29 package.sh: fix ksh vs -lcmd compatibility checks +12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics +12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static +12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE +12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts +12-02-07 package.sh: add { clean clobber } actions +12-02-02 regress.sh: fix ulimit -c defaults for --nokeep +12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison +12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib +12-01-21 Makefile: :PACKAGE: license=ast -- oops +12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err +12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs +11-12-13 iffe.sh: add /**/ test code comment to disable default #include +11-11-11 C+probe: test for .so before .sl +11-10-26 package.sh: don't forget about *.pkg for admin update +11-10-18 cc.*-icc: update and add more +11-10-11 package.sh: handle package make|view when no source installed +11-09-11 package.sh: count admin '*** termination code' errors +11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps +11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...'' +11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh +11-08-11 iffe.sh: handle ancient sort that doesn't have -k +11-06-01 make.probe: add more /lib64 logic +11-05-01 package.sh: fix admin ditto to sync LICENSES too +11-03-25 package.sh: initialize { $SED $TR } before first use! +11-03-21 package.sh: fix vpath probes +11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.* +11-02-24 package.sh: change curl usage to "curl -L ..." +11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archaic.*### +11-02-02 Makefile: add :MAPLIB: check for ancient -lw +11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64 +11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ] +11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks +11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream +11-01-07 iffe.sh: check debug==3 for is_hdr() failure +10-11-22 ditto.sh: fix timing problem between |& and exec &p +10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path +10-10-10 package.sh: list main env vars at start of make action +10-10-10 ratz.c: tweak windows delays +10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC +10-09-01 package.sh: fix ratz from source logic +10-08-25 package.mk: consolidate license file search in .package.licenses. +10-08-22 ratz.c: run sear bootstrap command detached +10-08-20 C+probe: version_stamp only if version_flags works +10-08-17 package.sh: unset makerules *DIR variables in env +10-08-15 package.sh: "make" action now lists some env values +10-08-11 mktest.sh: add "DO command ..." +10-07-27 rt.sh: handle "rt X=Y ..." +10-06-29 ratz.c: non-option sear args passed to sear_exec() +10-06-25 iffe.sh: "api" op changed to not do "map-libc" type mappings +10-06-25 package.sh: "force admin ditto" => no ditto --update option +10-06-22 C+probe: handle cc that require .[ci] input for version info +10-06-21 ditto.sh: change default remote access to ssh (about time) +10-06-12 regress.sh: DIAGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all +10-06-09 package.sh: add AT&T to usable nmake check +10-06-06 iffe.sh,iffe.tst: add { api ver } ops +10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info +10-04-15 iffe.sh: don't forget candidate headers for hdr|sys! +10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1) +10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH +10-02-11 package.sh: fix package admin make report error count +10-02-02 package.sh: fix write binary bug that did scp on local fs +10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst +10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check +10-01-01 make.probe: handle ['"] in CC.VERSION.STRING +09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS +09-11-30 mktest.sh: change RESET to STATE.RESET to make it global +09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs } +09-11-11 package.sh: re-order and combine cc checks +09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG +09-10-21 iffe.sh,Makefile: test -e is not in ksh88! +09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi) +09-10-06 package.sh: stub in ar intercept checks -- not used yet +09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!! +09-09-24 regress.sh: fix UMASK logic to create test support files before umask +09-08-28 release.c: change docs to mention stdin if no file operands +09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space +09-08-20 make.probe: add CC.SHARED.NAME +09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO } +09-08-11 package.sh: filter lines containing : for package results +09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany) +09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options +09-06-24 package.sh: fix admin.db output formatting +09-05-05 package.sh: export dll hackery environment vars +09-05-05 package.sh: handle non-identifier hostnames +09-05-05 mamake.c: pass undefined ${...} identifiers to the shell +09-05-05 mamake.rt: add macro expansion regression tests +09-05-01 iffe.sh: fix output initialization *again* +09-04-28 package.sh: handle admin.db contact field $9 +09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops +09-03-31 regress.sh: EXPORT before test => global ENVIRON[] +09-03-26 package.sh: test fail pattern is 'fail[es]' +09-03-26 UNIT - ... appends (options) to command line +09-03-19 TEST.mk: x.tst => x only if x is command target +09-03-15 regress.sh: add ${MAIN} for base name of main unit +09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir +09-03-03 regress.sh: allow command line unit to override UNIT +09-03-03 mktest.sh: handle IO == $'\n' +09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs +09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."! +09-01-27 package.sh: add isascii() to use ratz instead of tar +09-01-20 hurl.sh: add --size=bytes option +09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding +09-01-03 regress.sh: fix UNIT to allow command line override +09-01-03 mktest.sh: handle TWD +08-12-24 package.sh: fix cross-compile HOSTTYPE logic +08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 } +08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!! +08-09-30 rt.sh: fix ksh93 regression test signal count +08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input +08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo +08-09-20 make.probe: handle another /usr/bin/file shared lib description +08-09-20 regress.sh: add --pipefail for SET pipe-input ... +08-09-17 Makefile: add gdbm1.c for +08-09-10 make.probe: add CC.NOPROTECT +08-08-08 mktest.sh: add --width=width +08-08-05 dbm.req: favor sleepycat ndbm compatibility +08-08-04 C+probe: fix stdlib initialization logic +08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo +08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh +08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2 +08-06-11 regress.sh: fix bug that skipped the last test +08-05-20 regress.sh: add --local to put *.tmp dir in local fs +08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI +08-05-01 package.sh: package test => ulimit -c 0 +08-04-28 regress.sh: fix EXPORT quoting +08-04-28 regress.sh: fix UNIT set check args too +08-04-24 rt.sh: exit code > 256 => signal termination +08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround) +08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST +08-03-28 C+probe: add C++ #include (no extension) dir probes +08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally +08-02-28 make.probe: fix probe_warn to include ld! +08-02-02 make.probe: add CC.RUNPATH to match default -L order +08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH +08-01-31 iffe.sh: tweak ancient /bin/sh workarounds +08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace +08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es) +08-01-23 package.sh: fix checksum doc typo +08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list +07-12-14 iffe.sh: add set nooptimize +07-12-03 package.sh: add LC_ALL=C +07-11-27 package.sh: fix overaggressive *.md5 cleanup +07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal +07-11-05 package.sh: fix write op error count pattern +07-11-05 package.mk: fix $(~req) .ver binding +07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] +07-08-01 package.sh: handle 'package read lcl|tgz' +07-05-08 regress.sh: execute basename instead of absolute path for short $0 +07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer +07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh +07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...} +07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG +07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe +07-03-28 package.sh: fix binary tgz architecture type duplication +07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst +07-03-28 iffe.sh: add -F header to mac test +07-03-23 make.probe: handle file(1) that returns 'archive' for .so +07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF +07-03-11 package.sh: add nocopyright and tst => nocopyright +07-03-11 package.mk: add copyright=0 +07-03-08 C+probe: restore IFS after probe.ini +07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR} +07-01-05 package.sh: fix "admin write binary" logic +07-01-01 iffe.sh: add "cmd" --verbose trace +07-01-01 iffe.sh: sort => LC_ALL=C sort +07-01-01 C+probe: LC_ALL=C +06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local! +06-11-23 package.sh: *.md5 are not tarballs -- doh +06-11-23 iffe.sh: add -F, --features=feature-test-header +06-11-11 make.probe: favor lib64 over lib for hosttype==*64 +06-10-31 make.probe: add "-ignore-source-dir -iquote" test +06-10-31 iffe.sh: add status{...} code block +06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?) +06-10-11 package.sh: handle already gunzip'd *.tgz +06-10-06 iffe.sh: add reference for header content tests +06-09-27 regress.sh: fix UMASK to do DO too (duh) +06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics) +06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together +06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too +06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io +06-09-05 C+probe: add { probe_version version_stamp version_string } +06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING] +06-08-27 regress.sh,mktest.sh: add UMASK +06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE +06-08-25 mktest.sh: add IGNORESPACE +06-08-24 mktest.sh: handle \000 in data +06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR +06-08-16 package.sh: fix 'install flat' logic +06-08-11 rt.sh: handle style=shell %K date format +06-07-17 ratz.c: fix __MVS__ FAR definition +06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe +06-07-17 package.sh: differentiate urls vs. assignments +06-06-27 rt.sh: add --failed, --heading +06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0' +06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance +06-06-25 mktest.sh: implement PROG +06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk +06-05-06 package.sh: add PACKAGE_admin_tail_timeout +06-05-22 ratz.c: upgrade to zlib-1.2.3 +06-05-09 package.sh: fix admin.db docs +06-03-11 package.sh: fix `package use - command ...' +06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.` +06-02-14 package.sh: "results failed test" == "results test failed" + cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0 + cc.linux.ia64-icc: add for intel cc +06-02-02 package.sh: freebsd stuck with os version for all arch +06-02-01 package.mk: fix locale logic (tw -d requires dir arg) +06-01-31 package.sh: require $CC only for make|test +06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd + package.sh: add more pdksh => /bin/sh checks +06-01-26 package.sh: wget --http-pass => --http-password + package.sh: fix wget error logic + hurl.sh: wget --http-pass => --http-password +06-01-11 package.mk: pass package.license.class to make --mam too + package.mk: variants=pattern => --variants=pattern + package.sh: darwin rel<=7 => darwin7.ppc + package.sh: freebsd rel<=4 => freebsd4 + package.sh: freebsd rel<=5 => freebsd5 +05-12-07 iffe.sh: don't emit if | (XXX) +05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0 +05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ] +05-09-21 mktest.sh: fix --style=shell compare to ignore \r +05-09-12 TEST.mk: all --force to force %.rt regeneration +05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst +05-08-25 mktest.sh: add + TEST.mk: add %.rt=>%.tst for mktest +05-08-18 package.sh: 'package host cpu' now checks $NPROC first +05-07-17 iffe.sh: add { define extern include print } ops + iffe.sh: accept output{...}end output on success only -- doh +05-07-01 package.sh: add TARPROBE for tar B flag probe +05-06-24 package.sh: fix binary read chmod via *.sum +05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types +05-06-01 make.probe: verify that cc_pic works for hosted cc + cc.lynxos.ppc: make -mshared the default + package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation +05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT +05-05-24 iffe.sh: really fix grouping logic -- with tests this time + package.sh: pipe/socket configuration mismatches => use /bin/sh +05-04-28 TEST.mk: add $(TESTS) +05-04-19 package.sh: package results test uses rt if possible + iffe.sh: fix 'op var - ... - ...' grouping logic +05-04-15 rt.sh: handle autom4ate style +05-04-11 regress.sh: fix unit name when command line unit also specified + rt.sh: handle all ast package test output formats + package.sh: fix make docs for options passed to underlying make +05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime + regress.sh: add "TITLE name" to change TEST output title +05-04-01 rt.sh: add pretty make test + regress.sh wrapper +05-03-29 package.sh: test -e path => test -f path -o -d path +05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh +05-03-19 mamake.c: command line name=var also defines name.FORCE=var +05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd + package.sh: old make.out saved in circular make.out.[1-9] + mamake.c: sync with nmake :W=O: +05-03-01 package.sh: fix flat hierarchy initialization + package.sh: admin action now properly resets sibling remote logs + package.mk: relax unknown/unwritten package messages to warnings + package.sh: handle space in command line name=value + make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe +05-02-24 package.sh: hosttype *.powerpc => *.ppc + cc.lynxos.ppc,ldd.lynxos.ppc: add +05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug +05-02-20 probe.win32: handle /platformsdk mount +05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir +05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 - +05-02-14 package.sh: handle multiple architectures per host in admin.db + Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides + package.sh: normalize trailing [-_]bits in host type + iffe.sh: some ksh-compatible shells don't do *(pattern) +05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack + cc.lynxos.i386: -dynamic instead of -static default +05-02-10 package.sh: cyg usr/doc => usr/share/doc +05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08 + iffe.sh: work around old bash 0<... redirection bug +05-02-06 package.mk: source.tgz: update generated files only when they change +05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow +05-01-11 package.sh: update setup docs to include authorize+password + package.mk: fix .source.cyg final directory edit + package.mk: notice=1 for conspicuous empty NOTICE file + WWW.mk: fix *-index.html installation + filter.sh: retain input file suffix in tmp copy + mamexec.c: fix non-contiguous "exec" bug that skipped lines + iffe.sh: fix candidate lib test to try grouping subsequent libs + iffe.sh: fix child process stdin hijack that skipped input lines + iffe.sh: --shell=osh to force read -r compatibility command + iffe.sh: chop iffe input leading space before # for KnR compatibility +05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes + mamake.c: fix makefile scan to ignore lib*.[hH] + iffe.sh: immunize function/symbol tests from aggressive -O +04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator +04-12-21 ratz.c: make sure tmp dir is writable -- doh +04-12-08 iffe.sh: fix dat test for aggressive -O +04-12-01 iffe.sh: add `include file' to pull in #define's for `exp' +04-11-11 package.sh: default MAKESKIP is "*[-.]*" +04-10-22 ratz.c: change docs to note zlib license + mamake.c: handle --debug-symbols and --strip-symbols + package.sh: make (debug|strip)=1 => --(debug|strip)-symbols + package.mk: add :LICENSE: => package.license.class + mamake.c: fix recursive order logic +04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs +04-10-11 package.sh: add 'authorize name' and 'password password' +04-10-01 iffe.sh: double check $static link with ! $static + Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths + make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL} + package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths +04-09-21 package.mk: $(init)$(name) is now an implicit prereq +04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok +04-09-01 package.mk,package.sh: rename *.txt => *.README + package.mk: add the runtime package type (no *.[ah]) + iffe.sh: fix key test reports +04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] } +04-08-11 package.mk: handle HOSTTYPE for solaris > 9 + package.sh: add `checkaout proto' for { make view } + package.sh: check for { md5sum md5 } + iffe.sh: add {if|elif|else|endif} test ... + iffe.sh: add 'exp - expression' and '( expression )' + iffe.sh: add 'name = test ...' user defined macros + iffe.sh: add '! test ...' negation + TEST.mk: add implied { .c .sh } generated prereq + cc.darwin.ppc: handle 10.3 -dylib mess +04-08-01 package.mk: let include handle nested requirements -- duh +04-07-31 package.sh: attempt a second ping before admin assumes host down +04-07-26 package.sh: fix hp.ia64 HOSTTYPE +04-07-23 probe.win32: generalize #include dir order search +04-07-17 regress.sh: add INPUT -x for chmod +x +04-07-01 regress.sh: TMP => TWD +04-06-29 regress.sh: put COMMAND in $TWD too +04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs + TEST.mk: add :TEST: -- to disable .c .sh search +04-06-18 TEST.mk: add .SCAN.tst +04-06-17 regress.sh: TEST returns true if active, false otherwise + regress.sh: add CD to change test pwd from $TWD +04-06-16 regress.sh: add TWD for ./unit.tmp override + regress.sh: DO now flushes previous test + regress.sh: INPUT and OUTPUT handle -f for printf instead of print +04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH + package.sh: skip nmake if older than 2000-10-31 +04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate +04-05-11 package.sh: package verbose update lists closure for package setup + package.sh: add src/lib/libardir to nmake proto bootstrap + regress.sh: probe for rm -u vs. chmod -R u+rwx +04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH +04-04-15 make.probe: check probe_libdir false positives + package.sh: add lib/package/*.lic src package subdirs + package.mk: add mamfile=0 to inhibit Mamfile generation + iffe.sh: config name_DECLARED => HAVE_name_DECL + iffe.sh: fix mac to handle default value +04-04-11 iffe.sh: normalize sed [\\\\/] quoting +04-04-04 package.mk: only checksum generated tarballs + mamprobe.sh: add STDCHMOD +04-04-01 C+probe: set export LANG=C for uniform error messages + make.probe: another CC.STDLIB tweak + package.sh: fix regress core dump pattern, expand [a-z] match ranges +04-03-31 Makefile: add intl :MAPLIB: test + make.probe: fix CC.STDLIB search; drop CC.* path duplicates +04-03-28 iffe.sh: drop unused exec $stdin<&0 dup +04-03-25 Makefile: add iconv :MAPLIB: + package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override +04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: update base change on md5 sum instead of size + iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh +04-03-22 probe.win32: ncc => nld +04-03-19 CONVERT.mk: change the instructions and old source dir default + package.mk: fix recurse=list check + package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: fix update base/delta/sync existence check +04-03-18 iffe.sh: -d2 does not remove core dumps on exit +04-03-17 package.sh: fix make recurse arg/action order +04-02-29 package.sh: add regress action to compare current and previous tests + package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc + package.sh: add `export variable ...' + package.sh: admin action now handles host name with non-id chars + package.sh: non-numeric M T W in admin.db disables that action + package.sh: fix admin write binary local vs. shared clash + cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable + cc.hp.pa64: sync with cc.hp.pa + cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib + probe.win32: sync with make.probe + make.probe: fix last chance dynamic test + make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E + make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall + make.probe: move probe_dll_def to the end of probe_dll + package.mk: capture subcomponent mamfile recursion +04-02-24 make.probe: strip "..." from cc/ld traces + iffe.sh: add ``set [no]define'' to disable macro #define/#undef +04-02-23 make.probe: rework CC.LD search +04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export + make.probe: resurrect CC.PIC with separate semantics from CC.DLL + make.probe: add CC.SHARED.LD for CC.SHARED linker + C+probe: clear DISPLAY to stifle interactive windows +04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end + make.probe: add { CC.AR CC.SIZE }, fix cross command search + cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug +04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++ +04-02-04 package.sh: fix cross compilation bug that mixed binary formats +04-02-02 package.sh: package admin now ditto's bin/package too +04-01-30 cc.sgi.mips3: drop warning 3421 +04-01-11 regress.sh: output label#count for tests in loops +04-01-05 regress.sh: fix bug that ignored the first SAME +04-01-04 crossexec.sh: fix typo that did not recognize rcp +03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse() +03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency +03-09-23 ratz.c: fix tar header number parse bug that skipped to next number + regress.sh: rm cleanup now handles files matching -* +03-09-11 iffe.sh: add unnamed { ... } blocks + regress.sh: add COPY from to, like MOVE but comprison still done + regress.sh: rm -rfu to handle test dirs w/o u+rwx +03-08-14 Makefile: add hello.c to the manifest +03-08-11 package.sh: fix `html binary' generation +03-06-21 package.sh: fix INITROOT initialization bug + package.sh: make sure admin logs exists before tail'ing +03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make + cc.mvs.390: return code 4 yields exit code 3 but it's *really* ok + package.sh: fix onpath function global var conflict + make.probe: add CC.DIALECT { GNU -dD } + package.mk: add Mamfile to lcl manifest +03-06-10 package.sh: fix setup action typo that only checked the INIT package + package.sh: *.s390x => *.s390-64 +03-06-09 package.mk: add cyg :POSTINSTALL: +03-06-08 make.probe: fix CC.STDLIB logic + hurl.sh: add User-Agent identification + package.sh: tweak source and binary installation instructions + cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths + ldd.hp.pa: add +03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check + make.probe: add CC.STDLIB verification +03-06-04 make.probe: add +forceread +noforceread +03-05-11 hurl.sh: handle http://host:port/path +03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic +03-05-05 package.mk: fix cygwin tarball names +03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile +03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => "" + make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR) + make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD } + probe.win32: sync with latest CC.* +03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh +03-04-23 package.mk: fix dup "covered by" licenses +03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's + package.sh: fix admin write binary tarball snarf +03-04-21 package.mk: package covered *.@(pkg|lic) too +03-04-15 package.mk: don't generate incremental archives for lcl + package.mk: add incremental=[source:1 binary:0] archive control + package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc + package.sh: admin must ditto lib/package/*.@(pkg|lic) too + mamake.c: ignore time of ignore prereqs + mamake.c: -D2 lists propagated times +03-04-11 package.mk: tidy up cyg tarballs + package.sh: fix old shell clash between get() and $get +03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions + package.sh: add pthread_num_processors_np() last resort for cpu count + package.sh: use `make believe' to accept mamake generated files + package.sh: handle `make [make-flags] [target ...]' + mamake.c: ignore -e +03-03-21 package.mk: fix cyg old make typo + package.sh: switch to `package setup' instructions +03-03-19 package.sh: add registry checks for `host cpu' + package.sh: `results failed' now lists core dump messages +03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die + Makefile: install gcc wrapper if no cc + package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops +03-03-12 package.mk: add :DETAILS: for style-specific details +03-03-11 package.sh: add beta setup/update support + TEST.mk: add (TESTCC) prereq for .sh tests +03-03-07 hurl.sh: add +03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility + iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro +03-03-03 package.sh: check for curl or wget for update + package.sh: add setup action == update read make + package.sh: fix packageroot() typo that showed up in non ~user shells + mamake.c: treat name+=value args like name=value + mamake.c: add ${var?*|value?match?no-match?} + mamake.c: fix archive vs. dynamic bind logic +03-02-28 package.sh: add the "cyg" (cygwin) package type + package.mk: add "cyg" stubs, :CATEGORY: for category name(s) +03-02-25 mamake.c: add -D4 system(3) debug trace +03-02-24 package.mk: change --mismatch to --corrupt=accept +03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb" +03-02-12 Makefile: handle getconf LIBPATH with host pattern +03-01-31 package.mk: fix .lic search +03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere + package.sh: admin handles command outside of $PACKAGEROOT/bin + Makefile: install $(INSTALLROOT)/lib/make/package.mk +03-01-28 package.sh: admin remote commands on one line to please syslog +03-01-23 probe.win32: borland and mingw32 tweaks +03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh +03-01-16 ditto.sh: tw --chop on by default +03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/ + package.sh: admin now initiates remote exec and copy from local host +03-01-12 package.sh: handle admin "xxx:" default root +03-01-03 probe.win32: add /usr/include/borland path truncation workaround +02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc +02-12-06 probe.win32: fix inlcude => include typo, add lcc lib + probe.win32: CC.MAKE.OPTIONS = nativepp=0 +02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined +02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks +02-11-26 package.sh: package release now checks for second level files +02-11-22 package.sh: update action now uses HTTP/1.0 +02-11-21 probe.win32: update the vc include dir test +02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var +02-11-13 packahe.mk: fix list.install => list.installed typo +02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search + make.probe: add CC.LD.STRIP for link time a.out strip + package.sh: fix package_use vs. PACKAGE_USE check +02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post +02-10-23 mamake.c: fix unuinitialized time in make() + ratz.c: fix meter buffer overflow +02-10-20 package.sh: fix lib/probe/C/make/probe update test +02-10-18 probe.win32: update for mingw + make.probe: add bash workaround to SHELLMAGIC test + package.sh: work around yet another cygwin hassle +02-10-17 iffe.sh: short circuit id check for *[-+/\\]* +02-10-08 regress.sh: unset FIGNORE to avoid rm . errors + package.sh: unset FIGNORE to avoid rm . errors + package.sh: $CC must at least compile and executable hello world +02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz + package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS) + iffe.sh: add identifier checks for tests that (implicitly) require them + iffe.sh: disambiguate a few --config macros +02-10-02 iffe.sh: fix shell=bsh `hdr a/b' +02-09-30 package.sh: handle chmod of -* files + package.sh: verify that $SHELL is Bourne compatible + package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation + iffe.sh: fix bug that didn't define mac variable on success +02-09-22 package.sh: handle admin_action=ditto + iffe.sh: --config sizeof(foo) macro is SIZEOF_foo + iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long" + mamprobe.sh: convert $("foo") nmake string constants +02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout +02-09-11 make.probe: move from nmake src to be part of mamprobe.sh + mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end + mamake.c: pass cc absolute path to mamprobe + package.sh: generate mamprobe -- yuk (at least it's confined to INIT) + iffe.sh: lcl,nxt: drop default sys/ check + ditto.sh: tw --logical by default; add --physical +02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey +02-09-09 ditto.sh: test that remote .profile exists before sourcing +02-09-06 package.sh: don't ditto nfs junk + ditto.sh: --show now lists directory ops instead of enumerating all +02-09-05 ditto.sh: add --remote={rsh|ssh} + package.sh: add admin [[{rsh|ssh|-}]:]directory +02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility +02-09-01 cc.unix.mc68k: add for ancient 3b1 +02-08-22 package.sh: fix component() to test for components -- duh + Makefile: add LICENSE:.DONTCARE to workaround mam +02-08-11 iffe.sh: provide defaults for LD_* additions +02-08-07 ratz.c: change -m to use * instead of non-portable inverse video +02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin + package.sh: fix "type" to handle i1586 (P4) + package.sh: add the view action +02-06-28 package.sh: handle multiple packages for release action +02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc +02-06-14 package.sh: fix admin_action to not include qualifiers + package.sh: fix help/html doc typo +02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*' +02-06-07 WWW.mk: change substitute $("\n") to \n +02-06-06 package.sh: clarify output streams for help/html +02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH) +02-04-04 package.sh: fix update to differentiate *.sun4 and sun4 +02-03-27 package.sh: yacc/bison warning only if both missing +02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems +02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package + package.sh: precheck $CC, not `cc' + package.sh: fix install to use pax -ps to preserve set-uid/gid + package.sh: fix install to use list.installed for existing files only +02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read + package.sh: fix update delta sync fetch +02-02-14 iffe.sh: fix macro{ }end docs to include " + iffe.sh: add dfn to extract #define from headers + iffe.sh: handle nxt #include ok but no line sync + iffe.sh: drop local header clash logic + iffe.sh: add -X, --exclude=dir to exclude -I dirs + iffe.sh: lcl,nxt now generate <...> headers instead of "..." + package.sh: admin.db root dir matching -* disables host + package.mk: fix package.src.pat typo -- too many ) + package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: } + package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: } + Makefile: move proto.c generation to the proto component dir +02-02-02 execrate.sh: add for .exe challenged win32 systems/commands + mamprobe.sh: add STD* commands/flags + mamake.c: update mamprobe info when older than mamprobe executable + package.sh: move ed/ex workaround to mamprobe.sh + package.sh: fix `host type' bug that incorrectly assumed sun4 for sol + package.sh: add execrate(1) hooks for challenged systems + package.sh: add check for { cc ar nm yacc/bison } before make + ratz.c: fix "rb" vs. "r" macro tests + iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include + iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh +02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B* + iffe.sh: handle 'mem struct.a.b' +02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results + package.sh: uts.370 => uts.390 +02-01-18 package.sh: fix uts hosttype +02-01-17 package.sh: add 'results failed ...' to list failures only + package.sh: change ARCH internal var to all_types to avoid env conflict + iffe.sh: fix hdr/lib precheck that missed some -- ouch + iffe.sh: fix noexecute test that forgot to check compile first! +02-01-15 ratz.c: fix path[] type typo +02-01-01 package.mk: tighten license search +02-01-08 package.sh: `pwd` => ${PWD:-`pwd`} + package.mk: expand license file pattern match +02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value" + iffe.sh: fix initial check to honor --config +01-12-25 iffe.sh: fix bug where -o file restored old file +01-12-23 package.mk: uniq the closure lists +01-12-07 ratz.c: fix --meter to retain paths containing " -- " +01-11-30 ratz.c: use sear_system() to execute; should work on all windows +01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status +01-11-26 ditto.sh: drop n+=v for ksh compatibility +01-11-21 ditto.sh: add rsync script replacement [hey, it works!] + package.sh: add [ditto]:directory notation to admin.db +01-10-31 package.sh: handle *.sum paths with embedded space + package.sh: change executable() to onpath() + package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack) + package.sh: add os2 fix to `host type' + mamake.c: add .exe hack + iffe.sh: fix intrinsic function lib test + mamprobe.sh: update pic probe to match make.probe for linux.ia64 +01-10-30 package.sh: make action skeleton view now checks subdirs +01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP + package.mk: tarball package.notice replaces `license accepted' prompt + package.sh: eliminate `license accepted' prompt + package.sh: add update to download latest from a url + package.sh: use builtin arithmetic when we know it's ksh + iffe.sh: unkown -> unknown +01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN + package.mk: convert to YYYY-MM-DD delta releases instead of NNNN + ratz.c: fix -m for paths containing \f\n\r\v +01-10-16 ratz.c: _SEA_* => SEAR_* + ratz.c: preserve stdin for sear_exec() + ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup +01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC + package.sh: add nfs wakeup call to admin to avoid stale file handles +01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh) +01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH + package read: save cpy of bin/package when reading the INIT package + mamprobe.sh: allow cc path with optional arguments +01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization +01-09-19 package.mk: add recurse to list.package.* + package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32 +01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives +01-09-07 package.mk: fix output capture to not generate files names with spaces +01-09-07 package.mk: fix delta release number search +01-08-11 package.mk: handle single gz executable packages (e.g., for ksh) + package.sh: fix package install to require nmake only if no *.sum + iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash +01-07-17 package: fix use cross compile test to generate files in /tmp +01-06-27 ratz: handle hard and soft links if possible +01-06-07 Makefile: fix :MAPLIB: for sco +01-05-31 crossexec.sh: add + iffe.sh: add -x crosstype to run crossexec + iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end + package.sh: add package host canon external-host-type-name + package.sh: fix `use USER' lookup for shells that support ~USER + cc.*: add -dumpmachine to dump target HOSTTYPE +01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops +01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command +01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes + iffe.sh: fix run *.sh for shells that don't $* across . command + cc.mvs.390: recode for /bin/sh +01-04-25 package.mk: include non cc-g variants by default + package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh +01-04-24 TEST.mk: no tests for VARIANT=="DLL" +01-04-22 package.mk,package.sh: tarball text members are ascii encoded +01-04-18 package.mk: allow package name to be the same as one of its components + cc.mvs.390: handle .C .cpp .cxx + cc.mvs.390: compensate for -o that does not overwrite +01-04-01 regress: fix SAME that just skipped it -- we should regress regress! + iffe: fix bug that didn't emit _hdr_foo for internal hdr tests + iffe: fix lcl bug for cc -E that doesn't emit line syncs + ratz: add ascii=>ebcdic conversion for text archive members + mamake: fix buffer overlap bug that clobbered the probe file path +01-03-17 iffe: handle : separator as first arg +01-03-15 mamake.c,ratz.c,release.c: add and +01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op +01-02-22 cc.ibm.risc: handle SF_CLOSE clash in +01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc + C+probe: quote "$cc" when it's an argument! + mamake: execute actions with $SHELL, ignored signals back to default + package.sh: nmake check error output to /dev/null + package.sh: fix INIT a.out updates for knr cc + package.sh: package list now handles large tgz dirs + package.sh: *-ok executables moved to ok/* for *.dll systems + iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails! + mamake: handle `bind -lx [dontcare]' +01-02-12 ratz.c: fix _PACKAGE_ast includes + package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/ + package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE + iffe.sh: fix dat code that used previous $tmp.exe + iffe.sh: fix dat code for _DLL imports +01-02-09 iffe.sh: add copy() for shells with the disappearing here doc bug +01-02-08 Makefile: guard against null $(CC.HOSTTYPE) +01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged) +01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE + package.sh: create intermediate recursion makefiles when needed + package.sh: add $SECONDS to the DEBUG trace prompt +01-01-01 ratz.c: #ifdef for uwin ncc + iffe.sh,package.sh: check PACKAGE_PATH for local installations + package.sh: add psrinfo for osf.alpha host cpu + package.sh: change pax --meter probe; some hang on /dev/tty + package.sh: fix `install flat ARCH' + mamake: eliminate loops from scan order + C+probe: add probe_verbose -V for aix cc=xlc + cc.ibm.risc,ldd.ibm.risc: add + package.mk: list refs to top-level licenses only + package.mk: add local link table to change log html +00-12-25 package.sh: `no package archives' is a hard error, duh + package.sh: reorder host type logic for lame shells + mamake.c: getcwd => getwd for NeXT -- how about posix==default guys + iffe.sh: really gross workaround for NeXT -lposix stdout null's + iffe.sh: handle cc -E that insists on compiling +00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0 + *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh + package.sh: fix LD_LIBRARY*_PATH initialization + cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms +00-12-12 ratz: add --meter + package.sh: a few VPATH fixes + Makefile: don't override *.mips* cc if -version not accepted +00-12-11 package.mk: *.inx now contains name=value +00-12-07 package.sh: handle PC netscape . => _ pathname mangle + WWW.mk: .tar.gz => .tgz +00-11-27 package.sh: add checklicense() to do license checks at read time + package.mk: change component list from preformat to table +00-10-31 package.mk: *.pkg must assert closure + package.mk: add cc- variants to list.package.binary + package.sh: omit dups from package list + package.sh: invalid arg gives one line Usage + package.sh: relax checkaout checks for non-owners + package.sh: package use sets NPROC if not already set or [01] + proto.c: add $(INSTALLROOT)/include/ast hack +00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE: +00-10-25 package: fix install + package.mk: add list.install +00-10-22 regress: fix VIEW to skip empty dirs +00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake + iffe: validate #define identifiers +00-10-18 C+probe: mac os10 additions + package: add DYLD_LIBRARY_PATH initialization + add ldd.$(CC.HOSTTYPE) +00-10-01 iffe: handle -I* -L* options +00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs +00-09-19 C+probe: add probe_longlong +00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake +00-09-08 iffe: verify that $cc is a C compiler +00-06-14 mamprobe: fix win32.* probe + mamake: fix bug that used lower view path for generation + package: don't clobber $PACKAGEROOT/bin/nmake +00-06-01 C+probe: fix stdinclude *again* + package: fix write delta source to use default pax format + package: add disambiguating bias for sgi.mips3 over sgi.mips4 + package.mk: fix for directory content packages lib ast-locale +00-05-01 iffe: fix invalid _LIB_ macro identifier +00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude +00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected +00-03-17 package: all archives are .tgz for binary download + package: $(PACKAGEROOT)/LICENSES/* in source and binary archives + package: implement install and verify actions + iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb + iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk + package.mk: add *.pkg :INDEX: +00-03-07 package: add admin action +00-03-06 makefile: install optional make probe override script C+make+probe.lcl +00-02-14 --- release 1.0 --- + ratz: treat "foo/" as a dir, not a regular file + package: clarify source and binary installation instructions + package: fix so binary packages can install without cc + package: "ratz" now a non-archive package (the only one) for bootstrap + package: handle VPATH=a:b arg + package.mk: "ratz" package adjustments + Makefile: use :PACKAGE_INIT: to support binary INIT packages + WWW.mk: add :WWWALL: + C.probe: fix .so check that let .dll slip through + iffe: fix config sh var assignment for HAVE_member_IN_struct + iffe: fix config sh var assignment for symbol_DECLARED + package: delay PATH export until dll hack exports complete + package: don't forget binary package $(INSTALLROOT)/lib(32|64) + package: add delta change log for source packages +00-02-10 mamprobe: add mam_cc_DLLBIG + package: fix spelling typos + package: add html help output + package.mk: beef up source and binary help => html +00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug +00-01-28 package,release: add -rcount to release + package: fix linux "host cpu" and "host rating" + package: copy *.lic to $PACKAGEBIN for "make" and "write binary" + package: fix 'release change log' case match +00-01-24 package: add copyright action + mamprobe: add -D_BLD_DLL to mam_cc_DLL +00-01-11 package: tsort for package write + package: early verification that $CC works + package: add non-interactive command arg for use action + proto: fix -C intermediate mkdir() + mamprobe: unixware.i386 ksh workaround + C.probe: move hosttype to C.probe (with unixware.i386 workaround) + WWW.mk: fix mm2html option quoting + WWW.mk: add .SCAN.mm + WWW.mk: don't force static=1; grab dll's instead + *.sh: fix getopts test to handle botched implementations like osf.alpha + iffe.sh: fix read -r test +99-12-25 iffe: tweak verbose messages + iffe: hand code non-optget getopts parse + iffe: fix bash quoting bug again + iffe: do test -w . after option parse + package: fix PACKAGEROOT search +99-11-19 --- release 0.2 --- +99-11-19 first working package & friends +99-10-31 change from lib0ast to INIT; add MAM and package bootstrap + hostinfo: gobbled by package +99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround +99-09-27 iffe: add --all --verbose, --* set options +99-09-22 regress: -v disables long line truncation +99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME) +99-08-11 hostinfo: fix type sgi.mips4 +99-06-24 WWW.mk: add +99-06-08 hostinfo.sh: ${TMPDIR:-/tmp} +99-06-07 TEST.mk: add +99-06-01 iffe: add `siz type' for _siz_type == sizeof(type) +99-05-11 hostinfo,iffe,regress,use: long options +99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine +99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks + iffe: check that . is writable +99-03-17 hostinfo: fix for cc not found + dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE + C.probe: extra check for include dirs pulled in by +99-03-03 regress: add `UNIT - ...' for extra args + Makefile: add (_hosttype_) prereq for cc +99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there +99-01-11 C.probe: shlib before lib, /usr before / +98-12-25 iffe: work around win32.alpha intrinsic clash with -O +98-11-11 regress: fix UNIT PATH lookup +98-11-01 regress: add PROG +98-10-01 hostinfo: add unixware.* + use: export PACKAGE_* +98-08-11 C.probe: add /usr/include check (for sco CC) + hostinfo: handle uwin uname update +98-05-01 regress: fix bug sometimes didn't list last test +98-04-01 hostinfo: add cc path arg + hostinfo: now works with /bin/sh + Makefile: strengthed -lm probe +98-01-23 Makefile: check for -ldl -lm + C.probe: handle gcc -v -E phony include dirs + iffe: fix lcl by dropping sort -u -- we need the real first + iffe: `mem x' to test if x is a non-opaque struct +98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3 + $(INSTALLROOT)/lib64 for sgi.mips4 + add cc.hp.pa +98-01-01 cc.sgi.mips*: turn off ld library multiply defined +97-10-11 regress: add VIEW function for locating data +97-10-01 Makefile: -ldl test moved to libdll Makefile +97-08-11 regress: add MOVE + regress: add SAME + regress: use getopts + regress: `EXEC' repeats previous test +97-07-17 use: tweak PATH and LIBPATH bootstrap order + iffe: fix lcl bug that botched pathnames with embedded spaces +97-06-12 iffe: add npt `needs prototype' test +97-05-09 hostinfo: mvs.* => mvs.390 + Makefile: cc.$(_hosttype_) workaround installed here + iffe: fix nolink{ ... }end + iffe: add [no]static{ ... }end for static link test + C.probe: _probe_PATH => _probe_export which must be eval'd +97-04-01 use: _RLD_ROOT set too +97-03-17 mm2html: changed inner loop + mm2html: handle .if|.ie|.el, .so + mm2html: handle different man styles + mm2html: differentiate mm/man in some non-obvious cases + hostinfo: r5000 is not mips4 +97-02-14 hostinfo: validate type with cc +96-12-25 C.probe: uwin tweaks + iffe: use `...` instead of $(...) for alpha /bin/sh + iffe: fix `typ' divide by 0 + iffe: `lcl' now drops X: prefix + iffe: +l* -> -l* + iffe: eval around ${...#%...} for bsd /bin/sh + use: add sgi.mips LD_LIBRARY_PATH variants + use: add -e to list exports + iffe: lcl leaves leading [a-zA-Z]: for dos + iffe: fix no{link|output|execute} logic + C.probe: don't automatically add /usr/include for non-hosted compilers + C.probe: don't automatically place /usr/include last + C.probe: check gcc style -v -E for stdinclude usrinclude +96-11-28 iffe: check BASH_VERSION for IFS botch + iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx) + hostinfo: fix sgi.mips[234] tests + hostinfo: fix ncr.i386 tests +96-10-31 iffe: work around old bsh here doc bug by running separate sh +96-10-11 iffe: *.iffe and *.iff for iffe src files + hostinfo: tighten sgi.mips cpu type check +96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib +96-09-17 iffe: fix typ bug that failed for single id types! +96-08-31 hostinfo: handle recent sgi hinv cpu changes +96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx +96-05-09 C.probe: drop multiple / in stdinclude +96-02-29 use: package root must have bin and lib subdir + mm2html: add + C.probe: probe_members += -whole-archive for gcc + iffe: add + fix the blasted `...'...\\...'...` +96-01-31 use: add pkg dir + hostinfo: add tandem +96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32 +95-11-24 hostinfo: linux-aout.* for non-elf linux +95-11-11 use: add aix LIBPATH +95-10-11 hostinfo: no args prints type +95-08-11 use: add +95-05-09 save original PATH in _probe_PATH + beef up library dir probe +95-04-01 use c source suffix if it still preserves the dialect + add hostinfo + add lib/hostinfo/typemap user type map + add sol.sun4 cpu count + fix C.probe to properly handle C/C++ combined compiler drivers + add NeXT to hostinfo + bummer: mach has /usr/bin/hostinfo +95-03-19 fix dialect executable test +95-03-19 --- release 0.0 --- diff --git a/lib/package/INIT.html b/lib/package/INIT.html new file mode 100644 index 000000000..5a15f3b58 --- /dev/null +++ b/lib/package/INIT.html @@ -0,0 +1,1007 @@ + + + + + + + INIT package + + + + + +
+ +

+

INIT package

+The INIT package is required by all but the standalone +and self extracting archive packages. It contains +the package command, support scripts, and utilities. +The package command installs binary packages, makes +source packages, and generates new package tarballs. +Components in this package: +

+

+ + + +
+INIT
+

+The software is covered by this license: +

+Individual components may be covered by separate licenses; +refer to the component source and/or binaries for more information. +

+A recent +release change log +is also included. +

+


release change log

+
+
+All recorded changes follow.
+
+
+

+


INIT changes

+
+
+12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output
+12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo()
+12-06-20 package.sh: use $KSH for rt in "results test"
+12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
+12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
+12-06-13 package.sh: handle admin.db column output
+12-06-08 iffe.sh: fix 12-06-06 typo
+12-06-06 iffe.sh: check for -l* in reverse and accumulative order (e.g., for -last & -lm)
+12-06-04 package.sh: always check $INSTALLROOT/lib/package/profile
+12-05-31 Makefile: ID=ast; $(INSTALLROOT)/prototyped.h => $(INSTALLROOT)/$(ID)/prototyped.h
+12-05-28 iffe.sh: api foo YYYYMMDD => FOOAPI(rel) test macro
+12-05-24 package.sh: change admin.db comment => owner attributes
+12-04-25 ratz.c: add sear -k option to keep installation tmp dir on exit
+12-04-17 package.sh: skip sh version logic for ``use''
+12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features
+12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE
+12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness
+12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list
+12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH
+12-02-29 package.sh: fix ksh vs -lcmd compatibility checks
+12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics
+12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static
+12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE
+12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts
+12-02-07 package.sh: add { clean clobber } actions
+12-02-02 regress.sh: fix ulimit -c defaults for --nokeep
+12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison
+12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib
+12-01-21 Makefile: :PACKAGE: license=ast -- oops
+12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
+12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs
+11-12-13 iffe.sh: add /*<NOSTDIO>*/ test code comment to disable default #include <stdio.h>
+11-11-11 C+probe: test for .so before .sl
+11-10-26 package.sh: don't forget about *.pkg for admin update
+11-10-18 cc.*-icc: update and add more
+11-10-11 package.sh: handle package make|view when no source installed
+11-09-11 package.sh: count admin '*** termination code' errors
+11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps
+11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...''
+11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh
+11-08-11 iffe.sh: handle ancient sort that doesn't have -k
+11-06-01 make.probe: add more /lib64 logic
+11-05-01 package.sh: fix admin ditto to sync LICENSES too
+11-03-25 package.sh: initialize { $SED $TR } before first use!
+11-03-21 package.sh: fix vpath probes
+11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.*
+11-02-24 package.sh: change curl usage to "curl -L ..."
+11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archaic.*###
+11-02-02 Makefile: add :MAPLIB: check for ancient -lw
+11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64
+11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ]
+11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks
+11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream
+11-01-07 iffe.sh: check debug==3 for is_hdr() failure
+10-11-22 ditto.sh: fix timing problem between |& and exec &p
+10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path
+10-10-10 package.sh: list main env vars at start of make action
+10-10-10 ratz.c: tweak windows delays
+10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC
+10-09-01 package.sh: fix ratz from source logic
+10-08-25 package.mk: consolidate license file search in .package.licenses.
+10-08-22 ratz.c: run sear bootstrap command detached
+10-08-20 C+probe: version_stamp only if version_flags works
+10-08-17 package.sh: unset makerules *DIR variables in env
+10-08-15 package.sh: "make" action now lists some env values
+10-08-11 mktest.sh: add "DO command ..."
+10-07-27 rt.sh: handle "rt X=Y ..."
+10-06-29 ratz.c: non-option sear args passed to sear_exec()
+10-06-25 iffe.sh: "api" op changed to not do "map-libc" type mappings
+10-06-25 package.sh: "force admin ditto" => no ditto --update option
+10-06-22 C+probe: handle cc that require .[ci] input for version info
+10-06-21 ditto.sh: change default remote access to ssh (about time)
+10-06-12 regress.sh: DIAGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all
+10-06-09 package.sh: add AT&T to usable nmake check
+10-06-06 iffe.sh,iffe.tst: add { api ver } ops
+10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info
+10-04-15 iffe.sh: don't forget candidate headers for hdr|sys!
+10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1)
+10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH
+10-02-11 package.sh: fix package admin make report error count
+10-02-02 package.sh: fix write binary bug that did scp on local fs
+10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst
+10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check
+10-01-01 make.probe: handle ['"] in CC.VERSION.STRING
+09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS
+09-11-30 mktest.sh: change RESET to STATE.RESET to make it global
+09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs }
+09-11-11 package.sh: re-order and combine cc checks
+09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG
+09-10-21 iffe.sh,Makefile: test -e is not in ksh88!
+09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi)
+09-10-06 package.sh: stub in ar intercept checks -- not used yet
+09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!!
+09-09-24 regress.sh: fix UMASK logic to create test support files before umask
+09-08-28 release.c: change docs to mention stdin if no file operands
+09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space
+09-08-20 make.probe: add CC.SHARED.NAME
+09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO }
+09-08-11 package.sh: filter lines containing : for package results
+09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany)
+09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options
+09-06-24 package.sh: fix admin.db output formatting
+09-05-05 package.sh: export dll hackery environment vars
+09-05-05 package.sh: handle non-identifier hostnames
+09-05-05 mamake.c: pass undefined ${...} identifiers to the shell
+09-05-05 mamake.rt: add macro expansion regression tests
+09-05-01 iffe.sh: fix output initialization *again*
+09-04-28 package.sh: handle admin.db contact field $9
+09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops
+09-03-31 regress.sh: EXPORT before test => global ENVIRON[]
+09-03-26 package.sh: test fail pattern is 'fail[es]'
+09-03-26 UNIT - ... appends (options) to command line
+09-03-19 TEST.mk: x.tst => x only if x is command target
+09-03-15 regress.sh: add ${MAIN} for base name of main unit
+09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir
+09-03-03 regress.sh: allow command line unit to override UNIT
+09-03-03 mktest.sh: handle IO == $'
+09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs
+09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."!
+09-01-27 package.sh: add isascii() to use ratz instead of tar
+09-01-20 hurl.sh: add --size=bytes option
+09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding
+09-01-03 regress.sh: fix UNIT to allow command line override
+09-01-03 mktest.sh: handle TWD
+08-12-24 package.sh: fix cross-compile HOSTTYPE logic
+08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 }
+08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!!
+08-09-30 rt.sh: fix ksh93 regression test signal count
+08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
+08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
+08-09-20 make.probe: handle another /usr/bin/file shared lib description
+08-09-20 regress.sh: add --pipefail for SET pipe-input ...
+08-09-17 Makefile: add gdbm1.c for <gdbm-ndbm.h>
+08-09-10 make.probe: add CC.NOPROTECT
+08-08-08 mktest.sh: add --width=width
+08-08-05 dbm.req: favor sleepycat ndbm compatibility
+08-08-04 C+probe: fix stdlib initialization logic
+08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo
+08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh
+08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2
+08-06-11 regress.sh: fix bug that skipped the last test
+08-05-20 regress.sh: add --local to put *.tmp dir in local fs
+08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI
+08-05-01 package.sh: package test => ulimit -c 0
+08-04-28 regress.sh: fix EXPORT quoting
+08-04-28 regress.sh: fix UNIT set check args too
+08-04-24 rt.sh: exit code > 256 => signal termination
+08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround)
+08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST
+08-03-28 C+probe: add C++ #include <iostream> (no extension) dir probes
+08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally
+08-02-28 make.probe: fix probe_warn to include ld!
+08-02-02 make.probe: add CC.RUNPATH to match default -L order
+08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH
+08-01-31 iffe.sh: tweak ancient /bin/sh workarounds
+08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace
+08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es)
+08-01-23 package.sh: fix checksum doc typo
+08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list
+07-12-14 iffe.sh: add set nooptimize
+07-12-03 package.sh: add LC_ALL=C
+07-11-27 package.sh: fix overaggressive *.md5 cleanup
+07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal
+07-11-05 package.sh: fix write op error count pattern
+07-11-05 package.mk: fix $(~req) .ver binding
+07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
+07-08-01 package.sh: handle 'package read lcl|tgz'
+07-05-08 regress.sh: execute basename instead of absolute path for short $0
+07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer
+07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh
+07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...}
+07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG
+07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe
+07-03-28 package.sh: fix binary tgz architecture type duplication
+07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst
+07-03-28 iffe.sh: add -F header to mac test
+07-03-23 make.probe: handle file(1) that returns 'archive' for .so
+07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF
+07-03-11 package.sh: add nocopyright and tst => nocopyright
+07-03-11 package.mk: add copyright=0
+07-03-08 C+probe: restore IFS after probe.ini
+07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR}
+07-01-05 package.sh: fix "admin write binary" logic
+07-01-01 iffe.sh: add "cmd" --verbose trace
+07-01-01 iffe.sh: sort => LC_ALL=C sort
+07-01-01 C+probe: LC_ALL=C
+06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local!
+06-11-23 package.sh: *.md5 are not tarballs -- doh
+06-11-23 iffe.sh: add -F, --features=feature-test-header
+06-11-11 make.probe: favor lib64 over lib for hosttype==*64
+06-10-31 make.probe: add "-ignore-source-dir -iquote" test
+06-10-31 iffe.sh: add status{...} code block
+06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?)
+06-10-11 package.sh: handle already gunzip'd *.tgz
+06-10-06 iffe.sh: add reference for header content tests
+06-09-27 regress.sh: fix UMASK to do DO too (duh)
+06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics)
+06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together
+06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too
+06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io
+06-09-05 C+probe: add { probe_version version_stamp version_string }
+06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING]
+06-08-27 regress.sh,mktest.sh: add UMASK
+06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE
+06-08-25 mktest.sh: add IGNORESPACE
+06-08-24 mktest.sh: handle  00 in data
+06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR
+06-08-16 package.sh: fix 'install flat' logic
+06-08-11 rt.sh: handle style=shell %K date format
+06-07-17 ratz.c: fix __MVS__ FAR definition
+06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe
+06-07-17 package.sh: differentiate urls vs. assignments
+06-06-27 rt.sh: add --failed, --heading
+06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0'
+06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance
+06-06-25 mktest.sh: implement PROG
+06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk
+06-05-06 package.sh: add PACKAGE_admin_tail_timeout
+06-05-22 ratz.c: upgrade to zlib-1.2.3
+06-05-09 package.sh: fix admin.db docs
+06-03-11 package.sh: fix `package use - command ...'
+06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.`
+06-02-14 package.sh: "results failed test" == "results test failed"
+	 cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0
+	 cc.linux.ia64-icc: add for intel cc
+06-02-02 package.sh: freebsd stuck with os version for all arch
+06-02-01 package.mk: fix locale logic (tw -d requires dir arg)
+06-01-31 package.sh: require $CC only for make|test
+06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd
+	 package.sh: add more pdksh => /bin/sh checks
+06-01-26 package.sh: wget --http-pass => --http-password
+	 package.sh: fix wget error logic
+	 hurl.sh: wget --http-pass => --http-password
+06-01-11 package.mk: pass package.license.class to make --mam too
+	 package.mk: variants=pattern => --variants=pattern
+	 package.sh: darwin rel<=7 => darwin7.ppc
+	 package.sh: freebsd rel<=4 => freebsd4
+	 package.sh: freebsd rel<=5 => freebsd5
+05-12-07 iffe.sh: don't emit <stdio.h> if <sfio.h>|<ast.h> (XXX)
+05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0
+05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ]
+05-09-21 mktest.sh: fix --style=shell compare to ignore \r
+05-09-12 TEST.mk: all --force to force %.rt regeneration
+05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst
+05-08-25 mktest.sh: add
+	 TEST.mk: add %.rt=>%.tst for mktest
+05-08-18 package.sh: 'package host cpu' now checks $NPROC first
+05-07-17 iffe.sh: add { define extern include print } ops
+	 iffe.sh: accept output{...}end output on success only -- doh
+05-07-01 package.sh: add TARPROBE for tar B flag probe
+05-06-24 package.sh: fix binary read chmod via *.sum
+05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types
+05-06-01 make.probe: verify that cc_pic works for hosted cc
+	 cc.lynxos.ppc: make -mshared the default
+	 package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation
+05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT
+05-05-24 iffe.sh: really fix grouping logic -- with tests this time
+	 package.sh: pipe/socket configuration mismatches => use /bin/sh
+05-04-28 TEST.mk: add $(TESTS)
+05-04-19 package.sh: package results test uses rt if possible
+	 iffe.sh: fix 'op var - ... - ...' grouping logic
+05-04-15 rt.sh: handle autom4ate style
+05-04-11 regress.sh: fix unit name when command line unit also specified
+	 rt.sh: handle all ast package test output formats
+	 package.sh: fix make docs for options passed to underlying make
+05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime
+	 regress.sh: add "TITLE name" to change TEST output title
+05-04-01 rt.sh: add pretty make test + regress.sh wrapper
+05-03-29 package.sh: test -e path => test -f path -o -d path
+05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh
+05-03-19 mamake.c: command line name=var also defines name.FORCE=var
+05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd
+	 package.sh: old make.out saved in circular make.out.[1-9]
+	 mamake.c: sync with nmake :W=O:
+05-03-01 package.sh: fix flat hierarchy initialization
+	 package.sh: admin action now properly resets sibling remote logs
+	 package.mk: relax unknown/unwritten package messages to warnings
+	 package.sh: handle space in command line name=value
+	 make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe
+05-02-24 package.sh: hosttype *.powerpc => *.ppc
+	 cc.lynxos.ppc,ldd.lynxos.ppc: add
+05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug
+05-02-20 probe.win32: handle /platformsdk mount
+05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir
+05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 -
+05-02-14 package.sh: handle multiple architectures per host in admin.db
+	 Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides
+	 package.sh: normalize trailing [-_]bits in host type
+	 iffe.sh: some ksh-compatible shells don't do *(pattern)
+05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack
+	 cc.lynxos.i386: -dynamic instead of -static default
+05-02-10 package.sh: cyg usr/doc => usr/share/doc
+05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08
+	 iffe.sh: work around old bash 0<... redirection bug
+05-02-06 package.mk: source.tgz: update generated files only when they change
+05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow
+05-01-11 package.sh: update setup docs to include authorize+password
+	 package.mk: fix .source.cyg final directory edit
+	 package.mk: notice=1 for conspicuous empty NOTICE file
+	 WWW.mk: fix *-index.html installation
+	 filter.sh: retain input file suffix in tmp copy
+	 mamexec.c: fix non-contiguous "exec" bug that skipped lines
+	 iffe.sh: fix candidate lib test to try grouping subsequent libs
+	 iffe.sh: fix child process stdin hijack that skipped input lines
+	 iffe.sh: --shell=osh to force read -r compatibility command
+	 iffe.sh: chop iffe input leading space before # for KnR compatibility
+05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes
+	 mamake.c: fix makefile scan to ignore lib*.[hH]
+	 iffe.sh: immunize function/symbol tests from aggressive -O
+04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator
+04-12-21 ratz.c: make sure tmp dir is writable -- doh
+04-12-08 iffe.sh: fix dat test for aggressive -O
+04-12-01 iffe.sh: add `include file' to pull in #define's for `exp'
+04-11-11 package.sh: default MAKESKIP is "*[-.]*"
+04-10-22 ratz.c: change docs to note zlib license
+	 mamake.c: handle --debug-symbols and --strip-symbols
+	 package.sh: make (debug|strip)=1 => --(debug|strip)-symbols
+	 package.mk: add :LICENSE: => package.license.class
+	 mamake.c: fix recursive order logic
+04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs
+04-10-11 package.sh: add 'authorize name' and 'password password'
+04-10-01 iffe.sh: double check $static link with ! $static
+	 Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
+	 make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL}
+	 package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
+04-09-21 package.mk: $(init)$(name) is now an implicit prereq
+04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok
+04-09-01 package.mk,package.sh: rename *.txt => *.README
+	 package.mk: add the runtime package type (no *.[ah])
+	 iffe.sh: fix key test reports
+04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] }
+04-08-11 package.mk: handle HOSTTYPE for solaris > 9
+	 package.sh: add `checkaout proto' for { make view }
+	 package.sh: check for { md5sum md5 }
+	 iffe.sh: add {if|elif|else|endif} test ...
+	 iffe.sh: add 'exp - expression' and '( expression )'
+	 iffe.sh: add 'name = test ...' user defined macros
+	 iffe.sh: add '! test ...' negation
+	 TEST.mk: add implied { .c .sh } generated prereq
+	 cc.darwin.ppc: handle 10.3 -dylib mess
+04-08-01 package.mk: let include handle nested requirements -- duh
+04-07-31 package.sh: attempt a second ping before admin assumes host down
+04-07-26 package.sh: fix hp.ia64 HOSTTYPE
+04-07-23 probe.win32: generalize #include dir order search
+04-07-17 regress.sh: add INPUT -x for chmod +x
+04-07-01 regress.sh: TMP => TWD
+04-06-29 regress.sh: put COMMAND in $TWD too
+04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs
+	 TEST.mk: add :TEST: -- to disable .c .sh search
+04-06-18 TEST.mk: add .SCAN.tst
+04-06-17 regress.sh: TEST returns true if active, false otherwise
+	 regress.sh: add CD to change test pwd from $TWD
+04-06-16 regress.sh: add TWD for ./unit.tmp override
+	 regress.sh: DO now flushes previous test
+	 regress.sh: INPUT and OUTPUT handle -f for printf instead of print
+04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH
+	 package.sh: skip nmake if older than 2000-10-31
+04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate
+04-05-11 package.sh: package verbose update lists closure for package setup
+	 package.sh: add src/lib/libardir to nmake proto bootstrap
+	 regress.sh: probe for rm -u vs. chmod -R u+rwx
+04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH
+04-04-15 make.probe: check probe_libdir false positives
+	 package.sh: add lib/package/*.lic src package subdirs
+	 package.mk: add mamfile=0 to inhibit Mamfile generation
+	 iffe.sh: config name_DECLARED => HAVE_name_DECL
+	 iffe.sh: fix mac to handle default value
+04-04-11 iffe.sh: normalize sed [\\\\/] quoting
+04-04-04 package.mk: only checksum generated tarballs
+	 mamprobe.sh: add STDCHMOD
+04-04-01 C+probe: set export LANG=C for uniform error messages
+	 make.probe: another CC.STDLIB tweak
+	 package.sh: fix regress core dump pattern, expand [a-z] match ranges
+04-03-31 Makefile: add intl :MAPLIB: test
+	 make.probe: fix CC.STDLIB search; drop CC.* path duplicates
+04-03-28 iffe.sh: drop unused exec $stdin<&0 dup
+04-03-25 Makefile: add iconv :MAPLIB:
+	 package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override
+04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
+	 package.sh: update base change on md5 sum instead of size
+	 iffe.sh: adjust case label  and keyword quoting for ancient /bin/sh
+04-03-22 probe.win32: ncc => nld
+04-03-19 CONVERT.mk: change the instructions and old source dir default
+	 package.mk: fix recurse=list check
+	 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
+	 package.sh: fix update base/delta/sync existence check
+04-03-18 iffe.sh: -d2 does not remove core dumps on exit
+04-03-17 package.sh: fix make recurse arg/action order
+04-02-29 package.sh: add regress action to compare current and previous tests
+	 package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc
+	 package.sh: add `export variable ...'
+	 package.sh: admin action now handles host name with non-id chars
+	 package.sh: non-numeric M T W in admin.db disables that action
+	 package.sh: fix admin write binary local vs. shared clash
+	 cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable
+	 cc.hp.pa64: sync with cc.hp.pa
+	 cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib
+	 probe.win32: sync with make.probe
+	 make.probe: fix last chance dynamic test
+	 make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E
+	 make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall
+	 make.probe: move probe_dll_def to the end of probe_dll
+	 package.mk: capture subcomponent mamfile recursion
+04-02-24 make.probe: strip "..." from cc/ld traces
+	 iffe.sh: add ``set [no]define'' to disable macro #define/#undef
+04-02-23 make.probe: rework CC.LD search
+04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export
+	 make.probe: resurrect CC.PIC with separate semantics from CC.DLL
+	 make.probe: add CC.SHARED.LD for CC.SHARED linker
+	 C+probe: clear DISPLAY to stifle interactive windows
+04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end
+	 make.probe: add { CC.AR CC.SIZE }, fix cross command search
+	 cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug
+04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++
+04-02-04 package.sh: fix cross compilation bug that mixed binary formats
+04-02-02 package.sh: package admin now ditto's bin/package too
+04-01-30 cc.sgi.mips3: drop warning 3421
+04-01-11 regress.sh: output label#count for tests in loops
+04-01-05 regress.sh: fix bug that ignored the first SAME
+04-01-04 crossexec.sh: fix typo that did not recognize rcp
+03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse()
+03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency
+03-09-23 ratz.c: fix tar header number parse bug that skipped to next number
+	 regress.sh: rm cleanup now handles files matching -*
+03-09-11 iffe.sh: add unnamed { ... } blocks
+	 regress.sh: add COPY from to, like MOVE but comprison still done
+	 regress.sh: rm -rfu to handle test dirs w/o u+rwx
+03-08-14 Makefile: add hello.c to the manifest
+03-08-11 package.sh: fix `html binary' generation
+03-06-21 package.sh: fix INITROOT initialization bug
+	 package.sh: make sure admin logs exists before tail'ing
+03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make
+	 cc.mvs.390: return code 4 yields exit code 3 but it's *really* ok
+	 package.sh: fix onpath function global var conflict
+	 make.probe: add CC.DIALECT { GNU -dD }
+	 package.mk: add Mamfile to lcl manifest
+03-06-10 package.sh: fix setup action typo that only checked the INIT package
+	 package.sh: *.s390x => *.s390-64
+03-06-09 package.mk: add cyg :POSTINSTALL:
+03-06-08 make.probe: fix CC.STDLIB logic
+	 hurl.sh: add User-Agent identification
+	 package.sh: tweak source and binary installation instructions
+	 cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths
+	 ldd.hp.pa: add
+03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check
+	 make.probe: add CC.STDLIB verification
+03-06-04 make.probe: add +forceread +noforceread
+03-05-11 hurl.sh: handle http://host:port/path
+03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic
+03-05-05 package.mk: fix cygwin tarball names
+03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile
+03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => ""
+	 make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR)
+	 make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD }
+	 probe.win32: sync with latest CC.*
+03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh
+03-04-23 package.mk: fix dup "covered by" licenses
+03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's
+	 package.sh: fix admin write binary tarball snarf
+03-04-21 package.mk: package covered *.@(pkg|lic) too
+03-04-15 package.mk: don't generate incremental archives for lcl
+	 package.mk: add incremental=[source:1 binary:0] archive control
+	 package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc
+	 package.sh: admin must ditto lib/package/*.@(pkg|lic) too
+	 mamake.c: ignore time of ignore prereqs
+	 mamake.c: -D2 lists propagated times
+03-04-11 package.mk: tidy up cyg tarballs
+	 package.sh: fix old shell clash between get() and $get
+03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions
+	 package.sh: add pthread_num_processors_np() last resort for cpu count
+	 package.sh: use `make believe' to accept mamake generated files
+	 package.sh: handle `make [make-flags] [target ...]'
+	 mamake.c: ignore -e
+03-03-21 package.mk: fix cyg old make typo
+	 package.sh: switch to `package setup' instructions
+03-03-19 package.sh: add registry checks for `host cpu'
+	 package.sh: `results failed' now lists core dump messages
+03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die
+	 Makefile: install gcc wrapper if no cc
+	 package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops
+03-03-12 package.mk: add :DETAILS: for style-specific details
+03-03-11 package.sh: add beta setup/update support
+	 TEST.mk: add (TESTCC) prereq for .sh tests
+03-03-07 hurl.sh: add
+03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility
+	 iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro
+03-03-03 package.sh: check for curl or wget for update
+	 package.sh: add setup action == update read make
+	 package.sh: fix packageroot() typo that showed up in non ~user shells
+	 mamake.c: treat name+=value args like name=value
+	 mamake.c: add ${var?*|value?match?no-match?}
+	 mamake.c: fix archive vs. dynamic bind logic
+03-02-28 package.sh: add the "cyg" (cygwin) package type
+	 package.mk: add "cyg" stubs, :CATEGORY: for category name(s)
+03-02-25 mamake.c: add -D4 system(3) debug trace
+03-02-24 package.mk: change --mismatch to --corrupt=accept
+03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb"
+03-02-12 Makefile: handle getconf LIBPATH with host pattern
+03-01-31 package.mk: fix .lic search
+03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere
+	 package.sh: admin handles command outside of $PACKAGEROOT/bin
+	 Makefile: install $(INSTALLROOT)/lib/make/package.mk
+03-01-28 package.sh: admin remote commands on one line to please syslog
+03-01-23 probe.win32: borland and mingw32 tweaks
+03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh
+03-01-16 ditto.sh: tw --chop on by default
+03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/
+	 package.sh: admin now initiates remote exec and copy from local host
+03-01-12 package.sh: handle admin "xxx:" default root
+03-01-03 probe.win32: add /usr/include/borland path truncation workaround
+02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc
+02-12-06 probe.win32: fix inlcude => include typo, add lcc lib
+	 probe.win32: CC.MAKE.OPTIONS = nativepp=0
+02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined
+02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks
+02-11-26 package.sh: package release now checks for second level files
+02-11-22 package.sh: update action now uses HTTP/1.0
+02-11-21 probe.win32: update the vc include dir test
+02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var
+02-11-13 packahe.mk: fix list.install => list.installed typo
+02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search
+	 make.probe: add CC.LD.STRIP for link time a.out strip
+	 package.sh: fix package_use vs. PACKAGE_USE check
+02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post
+02-10-23 mamake.c: fix unuinitialized time in make()
+	 ratz.c: fix meter buffer overflow
+02-10-20 package.sh: fix lib/probe/C/make/probe update test
+02-10-18 probe.win32: update for mingw
+	 make.probe: add bash workaround to SHELLMAGIC test
+	 package.sh: work around yet another cygwin hassle
+02-10-17 iffe.sh: short circuit id check for *[-+/\\]*
+02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
+	 package.sh: unset FIGNORE to avoid rm . errors
+	 package.sh: $CC must at least compile and executable hello world
+02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz
+	 package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS)
+	 iffe.sh: add identifier checks for tests that (implicitly) require them
+	 iffe.sh: disambiguate a few --config macros
+02-10-02 iffe.sh: fix shell=bsh `hdr a/b'
+02-09-30 package.sh: handle chmod of -* files
+	 package.sh: verify that $SHELL is Bourne compatible
+	 package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation
+	 iffe.sh: fix bug that didn't define mac variable on success
+02-09-22 package.sh: handle admin_action=ditto
+	 iffe.sh: --config sizeof(foo) macro is SIZEOF_foo
+	 iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long"
+	 mamprobe.sh: convert $("foo") nmake string constants
+02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout
+02-09-11 make.probe: move from nmake src to be part of mamprobe.sh
+	 mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end
+	 mamake.c: pass cc absolute path to mamprobe
+	 package.sh: generate mamprobe -- yuk (at least it's confined to INIT)
+	 iffe.sh: lcl,nxt: drop default sys/ check
+	 ditto.sh: tw --logical by default; add --physical
+02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey
+02-09-09 ditto.sh: test that remote .profile exists before sourcing
+02-09-06 package.sh: don't ditto nfs junk
+	 ditto.sh: --show now lists directory ops instead of enumerating all
+02-09-05 ditto.sh: add --remote={rsh|ssh}
+	 package.sh: add admin [[{rsh|ssh|-}]:]directory
+02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility
+02-09-01 cc.unix.mc68k: add for ancient 3b1
+02-08-22 package.sh: fix component() to test for components -- duh
+	 Makefile: add LICENSE:.DONTCARE to workaround mam
+02-08-11 iffe.sh: provide defaults for LD_* additions
+02-08-07 ratz.c: change -m to use * instead of non-portable inverse video
+02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin
+	 package.sh: fix "type" to handle i1586 (P4)
+	 package.sh: add the view action
+02-06-28 package.sh: handle multiple packages for release action
+02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc
+02-06-14 package.sh: fix admin_action to not include qualifiers
+	 package.sh: fix help/html doc typo
+02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*'
+02-06-07 WWW.mk: change substitute $(") to
+02-06-06 package.sh: clarify output streams for help/html
+02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH)
+02-04-04 package.sh: fix update to differentiate *.sun4 and sun4
+02-03-27 package.sh: yacc/bison warning only if both missing
+02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems
+02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package
+	 package.sh: precheck $CC, not `cc'
+	 package.sh: fix install to use pax -ps to preserve set-uid/gid
+	 package.sh: fix install to use list.installed for existing files only
+02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read
+	 package.sh: fix update delta sync fetch
+02-02-14 iffe.sh: fix macro{ }end docs to include "
+	 iffe.sh: add dfn to extract #define from headers
+	 iffe.sh: handle nxt #include ok but no line sync
+	 iffe.sh: drop local header clash logic
+	 iffe.sh: add -X, --exclude=dir to exclude -I dirs
+	 iffe.sh: lcl,nxt now generate <...> headers instead of "..."
+	 package.sh: admin.db root dir matching -* disables host
+	 package.mk: fix package.src.pat typo -- too many )
+	 package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: }
+	 package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: }
+	 Makefile: move proto.c generation to the proto component dir
+02-02-02 execrate.sh: add for .exe challenged win32 systems/commands
+	 mamprobe.sh: add STD* commands/flags
+	 mamake.c: update mamprobe info when older than mamprobe executable
+	 package.sh: move ed/ex workaround to mamprobe.sh
+	 package.sh: fix `host type' bug that incorrectly assumed sun4 for sol
+	 package.sh: add execrate(1) hooks for challenged systems
+	 package.sh: add check for { cc ar nm yacc/bison } before make
+	 ratz.c: fix "rb" vs. "r" macro tests
+	 iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include
+	 iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh
+02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B*
+	 iffe.sh: handle 'mem struct.a.b'
+02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results
+	 package.sh: uts.370 => uts.390
+02-01-18 package.sh: fix uts hosttype
+02-01-17 package.sh: add 'results failed ...' to list failures only
+	 package.sh: change ARCH internal var to all_types to avoid env conflict
+	 iffe.sh: fix hdr/lib precheck that missed some -- ouch
+	 iffe.sh: fix noexecute test that forgot to check compile first!
+02-01-15 ratz.c: fix path[] type typo
+02-01-01 package.mk: tighten license search
+02-01-08 package.sh: `pwd` => ${PWD:-`pwd`}
+	 package.mk: expand license file pattern match
+02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value"
+	 iffe.sh: fix initial <sys/types.h> check to honor --config
+01-12-25 iffe.sh: fix bug where -o file restored old file
+01-12-23 package.mk: uniq the closure lists
+01-12-07 ratz.c: fix --meter to retain paths containing " -- "
+01-11-30 ratz.c: use sear_system() to execute; should work on all windows
+01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status
+01-11-26 ditto.sh: drop n+=v for ksh compatibility
+01-11-21 ditto.sh: add rsync script replacement [hey, it works!]
+	 package.sh: add [ditto]:directory notation to admin.db
+01-10-31 package.sh: handle *.sum paths with embedded space
+	 package.sh: change executable() to onpath()
+	 package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack)
+	 package.sh: add os2 fix to `host type'
+	 mamake.c: add .exe hack
+	 iffe.sh: fix intrinsic function lib test
+	 mamprobe.sh: update pic probe to match make.probe for linux.ia64
+01-10-30 package.sh: make action skeleton view now checks subdirs
+01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP
+	 package.mk: tarball package.notice replaces `license accepted' prompt
+	 package.sh: eliminate `license accepted' prompt
+	 package.sh: add update to download latest from a url
+	 package.sh: use builtin arithmetic when we know it's ksh
+	 iffe.sh: unkown -> unknown
+01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN
+	 package.mk: convert to YYYY-MM-DD delta releases instead of NNNN
+	 ratz.c: fix -m for paths containing <\>n\r\v
+01-10-16 ratz.c: _SEA_* => SEAR_*
+	 ratz.c: preserve stdin for sear_exec()
+	 ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup
+01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC
+	 package.sh: add nfs wakeup call to admin to avoid stale file handles
+01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh)
+01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH
+	 package read: save cpy of bin/package when reading the INIT package
+	 mamprobe.sh: allow cc path with optional arguments
+01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization
+01-09-19 package.mk: add recurse to list.package.*
+	 package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32
+01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives
+01-09-07 package.mk: fix output capture to not generate files names with spaces
+01-09-07 package.mk: fix delta release number search
+01-08-11 package.mk: handle single gz executable packages (e.g., for ksh)
+	 package.sh: fix package install to require nmake only if no *.sum
+	 iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash
+01-07-17 package: fix use cross compile test to generate files in /tmp
+01-06-27 ratz: handle hard and soft links if possible
+01-06-07 Makefile: fix :MAPLIB: for sco
+01-05-31 crossexec.sh: add
+	 iffe.sh: add -x crosstype to run crossexec
+	 iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end
+	 package.sh: add package host canon external-host-type-name
+	 package.sh: fix `use USER' lookup for shells that support ~USER
+	 cc.*: add -dumpmachine to dump target HOSTTYPE
+01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops
+01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command
+01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes
+	 iffe.sh: fix run *.sh for shells that don't $* across . command
+	 cc.mvs.390: recode for /bin/sh
+01-04-25 package.mk: include non cc-g variants by default
+	 package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh
+01-04-24 TEST.mk: no tests for VARIANT=="DLL"
+01-04-22 package.mk,package.sh: tarball text members are ascii encoded
+01-04-18 package.mk: allow package name to be the same as one of its components
+         cc.mvs.390: handle .C .cpp .cxx
+         cc.mvs.390: compensate for -o that does not overwrite
+01-04-01 regress: fix SAME that just skipped it -- we should regress regress!
+	 iffe: fix bug that didn't emit _hdr_foo for internal hdr tests
+	 iffe: fix lcl bug for cc -E that doesn't emit line syncs
+	 ratz: add ascii=>ebcdic conversion for text archive members
+	 mamake: fix buffer overlap bug that clobbered the probe file path
+01-03-17 iffe: handle : separator as first arg
+01-03-15 mamake.c,ratz.c,release.c: add <stdlib.h> and <string.h>
+01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op
+01-02-22 cc.ibm.risc: handle SF_CLOSE clash in <sfio.h>
+01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc
+	 C+probe: quote "$cc" when it's an argument!
+	 mamake: execute actions with $SHELL, ignored signals back to default
+	 package.sh: nmake check error output to /dev/null
+	 package.sh: fix INIT a.out updates for knr cc
+	 package.sh: package list now handles large tgz dirs
+	 package.sh: *-ok executables moved to ok/* for *.dll systems
+	 iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails!
+	 mamake: handle `bind -lx [dontcare]'
+01-02-12 ratz.c: fix _PACKAGE_ast includes
+	 package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/
+	 package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE
+	 iffe.sh: fix dat code that used previous $tmp.exe
+	 iffe.sh: fix dat code for _DLL imports
+01-02-09 iffe.sh: add copy() for shells with the disappearing here doc bug
+01-02-08 Makefile: guard against null $(CC.HOSTTYPE)
+01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged)
+01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE
+	 package.sh: create intermediate recursion makefiles when needed
+	 package.sh: add $SECONDS to the DEBUG trace prompt
+01-01-01 ratz.c: #ifdef for uwin ncc
+	 iffe.sh,package.sh: check PACKAGE_PATH for local installations
+	 package.sh: add psrinfo for osf.alpha host cpu
+	 package.sh: change pax --meter probe; some hang on /dev/tty
+	 package.sh: fix `install flat ARCH'
+	 mamake: eliminate loops from scan order
+	 C+probe: add probe_verbose -V for aix cc=xlc
+	 cc.ibm.risc,ldd.ibm.risc: add
+	 package.mk: list refs to top-level licenses only
+	 package.mk: add local link table to change log html
+00-12-25 package.sh: `no package archives' is a hard error, duh
+	 package.sh: reorder host type logic for lame shells
+	 mamake.c: getcwd => getwd for NeXT -- how about posix==default guys
+	 iffe.sh: really gross workaround for NeXT -lposix stdout null's
+	 iffe.sh: handle cc -E that insists on compiling
+00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0
+	 *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh
+	 package.sh: fix LD_LIBRARY*_PATH initialization
+	 cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms
+00-12-12 ratz: add --meter
+	 package.sh: a few VPATH fixes
+	 Makefile: don't override *.mips* cc if -version not accepted
+00-12-11 package.mk: *.inx now contains name=value
+00-12-07 package.sh: handle PC netscape . => _ pathname mangle
+	 WWW.mk: .tar.gz => .tgz
+00-11-27 package.sh: add checklicense() to do license checks at read time
+	 package.mk: change component list from preformat to table
+00-10-31 package.mk: *.pkg must assert closure
+	 package.mk: add cc- variants to list.package.binary
+	 package.sh: omit dups from package list
+	 package.sh: invalid arg gives one line Usage
+	 package.sh: relax checkaout checks for non-owners
+	 package.sh: package use sets NPROC if not already set or [01]
+	 proto.c: add $(INSTALLROOT)/include/ast hack
+00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE:
+00-10-25 package: fix install
+	 package.mk: add list.install
+00-10-22 regress: fix VIEW to skip empty dirs
+00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake
+	 iffe: validate #define identifiers
+00-10-18 C+probe: mac os10 additions
+	 package: add DYLD_LIBRARY_PATH initialization
+	 add ldd.$(CC.HOSTTYPE)
+00-10-01 iffe: handle -I* -L* options
+00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs
+00-09-19 C+probe: add probe_longlong
+00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake
+00-09-08 iffe: verify that $cc is a C compiler
+00-06-14 mamprobe: fix win32.* probe
+	 mamake: fix bug that used lower view path for generation
+	 package: don't clobber $PACKAGEROOT/bin/nmake
+00-06-01 C+probe: fix stdinclude *again*
+	 package: fix write delta source to use default pax format
+	 package: add disambiguating bias for sgi.mips3 over sgi.mips4
+	 package.mk: fix for directory content packages lib ast-locale
+00-05-01 iffe: fix invalid _LIB_ macro identifier
+00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude
+00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected
+00-03-17 package: all archives are .tgz for binary download
+	 package: $(PACKAGEROOT)/LICENSES/* in source and binary archives
+	 package: implement install and verify actions
+	 iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb
+	 iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk
+	 package.mk: add *.pkg :INDEX:
+00-03-07 package: add admin action
+00-03-06 makefile: install optional make probe override script C+make+probe.lcl
+00-02-14 --- release 1.0 ---
+	 ratz: treat "foo/" as a dir, not a regular file
+	 package: clarify source and binary installation instructions
+	 package: fix so binary packages can install without cc
+	 package: "ratz" now a non-archive package (the only one) for bootstrap
+	 package: handle VPATH=a:b arg
+	 package.mk: "ratz" package adjustments
+	 Makefile: use :PACKAGE_INIT: to support binary INIT packages
+	 WWW.mk: add :WWWALL:
+	 C.probe: fix .so check that let .dll slip through
+	 iffe: fix config sh var assignment for HAVE_member_IN_struct
+	 iffe: fix config sh var assignment for symbol_DECLARED
+	 package: delay PATH export until dll hack exports complete
+	 package: don't forget binary package $(INSTALLROOT)/lib(32|64)
+	 package: add delta change log for source packages
+00-02-10 mamprobe: add mam_cc_DLLBIG
+	 package: fix spelling typos
+	 package: add html help output
+	 package.mk: beef up source and binary help => html
+00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug
+00-01-28 package,release: add -rcount to release
+	 package: fix linux "host cpu" and "host rating"
+	 package: copy *.lic to $PACKAGEBIN for "make" and "write binary"
+	 package: fix 'release change log' case match
+00-01-24 package: add copyright action
+	 mamprobe: add -D_BLD_DLL to mam_cc_DLL
+00-01-11 package: tsort for package write
+	 package: early verification that $CC works
+	 package: add non-interactive command arg for use action
+	 proto: fix -C intermediate mkdir()
+	 mamprobe: unixware.i386 ksh workaround
+	 C.probe: move hosttype to C.probe (with unixware.i386 workaround)
+	 WWW.mk: fix mm2html option quoting
+	 WWW.mk: add .SCAN.mm
+	 WWW.mk: don't force static=1; grab dll's instead
+	 *.sh: fix getopts test to handle botched implementations like osf.alpha
+	 iffe.sh: fix read -r test
+99-12-25 iffe: tweak verbose messages
+	 iffe: hand code non-optget getopts parse
+	 iffe: fix bash quoting bug again
+	 iffe: do test -w . after option parse
+	 package: fix PACKAGEROOT search
+99-11-19 --- release 0.2 ---
+99-11-19 first working package & friends
+99-10-31 change from lib0ast to INIT; add MAM and package bootstrap
+	 hostinfo: gobbled by package
+99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround
+99-09-27 iffe: add --all --verbose, --* set options
+99-09-22 regress: -v disables long line truncation
+99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME)
+99-08-11 hostinfo: fix type sgi.mips4
+99-06-24 WWW.mk: add
+99-06-08 hostinfo.sh: ${TMPDIR:-/tmp}
+99-06-07 TEST.mk: add
+99-06-01 iffe: add `siz type' for _siz_type == sizeof(type)
+99-05-11 hostinfo,iffe,regress,use: long options
+99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine
+99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks
+	 iffe: check that . is writable
+99-03-17 hostinfo: fix for cc not found
+	 dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE
+	 C.probe: extra check for include dirs pulled in by <sys/types.h>
+99-03-03 regress: add `UNIT - ...' for extra args
+	 Makefile: add (_hosttype_) prereq for cc
+99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there
+99-01-11 C.probe: shlib before lib, /usr before /
+98-12-25 iffe: work around win32.alpha intrinsic clash with -O
+98-11-11 regress: fix UNIT PATH lookup
+98-11-01 regress: add PROG
+98-10-01 hostinfo: add unixware.*
+	 use: export PACKAGE_*
+98-08-11 C.probe: add /usr/include check (for sco CC)
+	 hostinfo: handle uwin uname update
+98-05-01 regress: fix bug sometimes didn't list last test
+98-04-01 hostinfo: add cc path arg
+	 hostinfo: now works with /bin/sh
+	 Makefile: strengthed -lm probe
+98-01-23 Makefile: check for -ldl -lm
+	 C.probe: handle gcc -v -E phony include dirs
+	 iffe: fix lcl by dropping sort -u -- we need the real first
+	 iffe: `mem x' to test if x is a non-opaque struct
+98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3
+	 $(INSTALLROOT)/lib64 for sgi.mips4
+	 add cc.hp.pa
+98-01-01 cc.sgi.mips*: turn off ld library multiply defined
+97-10-11 regress: add VIEW function for locating data
+97-10-01 Makefile: -ldl test moved to libdll Makefile
+97-08-11 regress: add MOVE
+	 regress: add SAME
+	 regress: use getopts
+	 regress: `EXEC' repeats previous test
+97-07-17 use: tweak PATH and LIBPATH bootstrap order
+	 iffe: fix lcl bug that botched pathnames with embedded spaces
+97-06-12 iffe: add npt `needs prototype' test
+97-05-09 hostinfo: mvs.* => mvs.390
+	 Makefile: cc.$(_hosttype_) workaround installed here
+	 iffe: fix nolink{ ... }end
+	 iffe: add [no]static{ ... }end for static link test
+	 C.probe: _probe_PATH => _probe_export which must be eval'd
+97-04-01 use: _RLD_ROOT set too
+97-03-17 mm2html: changed inner loop
+	 mm2html: handle .if|.ie|.el, .so
+	 mm2html: handle different man styles
+	 mm2html: differentiate mm/man in some non-obvious cases
+	 hostinfo: r5000 is not mips4
+97-02-14 hostinfo: validate type with cc
+96-12-25 C.probe: uwin tweaks
+	 iffe: use `...` instead of $(...) for alpha /bin/sh
+	 iffe: fix `typ' divide by 0
+	 iffe: `lcl' now drops X: prefix
+	 iffe: +l* -> -l*
+	 iffe: eval around ${...#%...} for bsd /bin/sh
+	 use: add sgi.mips LD_LIBRARY<abi>_PATH variants
+	 use: add -e to list exports
+	 iffe: lcl leaves leading [a-zA-Z]: for dos
+	 iffe: fix no{link|output|execute} logic
+	 C.probe: don't automatically add /usr/include for non-hosted compilers
+	 C.probe: don't automatically place /usr/include last
+	 C.probe: check gcc style -v -E for stdinclude usrinclude
+96-11-28 iffe: check BASH_VERSION for IFS botch
+	 iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx)
+	 hostinfo: fix sgi.mips[234] tests
+	 hostinfo: fix ncr.i386 tests
+96-10-31 iffe: work around old bsh here doc bug by running separate sh
+96-10-11 iffe: *.iffe and *.iff for iffe src files
+	 hostinfo: tighten sgi.mips cpu type check
+96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
+96-09-17 iffe: fix typ bug that failed for single id types!
+96-08-31 hostinfo: handle recent sgi hinv cpu changes
+96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
+96-05-09 C.probe: drop multiple / in stdinclude
+96-02-29 use: package root must have bin and lib subdir
+	 mm2html: add
+	 C.probe: probe_members += -whole-archive for gcc
+	 iffe: add + fix the blasted `...'...\...'...`
+96-01-31 use: add pkg dir
+	 hostinfo: add tandem
+96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32
+95-11-24 hostinfo: linux-aout.* for non-elf linux
+95-11-11 use: add aix LIBPATH
+95-10-11 hostinfo: no args prints type
+95-08-11 use: add
+95-05-09 save original PATH in _probe_PATH
+	 beef up library dir probe
+95-04-01 use c source suffix if it still preserves the dialect
+	 add hostinfo
+	 add lib/hostinfo/typemap user type map
+	 add sol.sun4 cpu count
+	 fix C.probe to properly handle C/C++ combined compiler drivers
+	 add NeXT to hostinfo
+	 bummer: mach has /usr/bin/hostinfo
+95-03-19 fix dialect executable test
+95-03-19 --- release 0.0 ---
+
+

+


+ + + + + + +
August 07, 2012
+

+ +

+ + + diff --git a/lib/package/INIT.pkg b/lib/package/INIT.pkg new file mode 100644 index 000000000..32f1456de --- /dev/null +++ b/lib/package/INIT.pkg @@ -0,0 +1,12 @@ +INIT :PACKAGE: + +:CATEGORY: admin utils + +:INDEX: the package command with support scripts and utilities + +:DESCRIPTION: + The INIT package is required by all but the standalone + and self extracting archive packages. It contains + the package command, support scripts, and utilities. + The package command installs binary packages, makes + source packages, and generates new package tarballs. diff --git a/lib/package/INIT.req b/lib/package/INIT.req new file mode 100644 index 000000000..e69de29bb diff --git a/lib/package/INIT.ver b/lib/package/INIT.ver new file mode 100644 index 000000000..8dc5177fc --- /dev/null +++ b/lib/package/INIT.ver @@ -0,0 +1 @@ +INIT 2012-08-01 2012-08-01 1 diff --git a/lib/package/ast-ast.pkg b/lib/package/ast-ast.pkg new file mode 100644 index 000000000..4d49fb4d6 --- /dev/null +++ b/lib/package/ast-ast.pkg @@ -0,0 +1,11 @@ +ast-ast :PACKAGE: libast + +:LICENSE: *.open + +:CATEGORY: devel libs + +:INDEX: the ast library, period + +:DESCRIPTION: + The AT&T Software Technology ast-ast package from AT&T Research + contains the ast library. diff --git a/lib/package/ast-base.pkg b/lib/package/ast-base.pkg new file mode 100644 index 000000000..505b1dfc4 --- /dev/null +++ b/lib/package/ast-base.pkg @@ -0,0 +1,22 @@ +ast-base :PACKAGE: \ + ksh93 pax html proto bzip tw builtin libast libardir libcmd \ + libdll libexpr libodelta librecsort libsum libuu libvdelta \ + libbz libz tests 3d coshell cpp cs mam msgcc nmake probe ss \ + libcoshell libcs libmam libpp libcodex paxlib codexlib \ + libdss libpz dsslib libtaso + +:COVERS: ast-make ast-ksh ast-ast + +:LICENSE: *.open + +:CATEGORY: devel libs shells + +:INDEX: ksh, ksh builtin commands, pax, nmake, tw, sfio, and ast libraries + +:DESCRIPTION: + The AT&T Software Technology ast-base package from AT&T Research + contains commands and libraries required by all other ast based + packages. Included are ksh93, ksh93 builtin commands, a pax that + generates compact delta archives, nmake, the 3d user level versioning + filesystem, coshell for network execution, a multi-dialect C preprocessor + and companion library, and libraries shared by the other ast packages. diff --git a/lib/package/ast-base.req b/lib/package/ast-base.req new file mode 100644 index 000000000..e69de29bb diff --git a/lib/package/ast-base.ver b/lib/package/ast-base.ver new file mode 100644 index 000000000..0b7d4a1f8 --- /dev/null +++ b/lib/package/ast-base.ver @@ -0,0 +1 @@ +ast-base 2012-08-01 2012-08-01 1 diff --git a/lib/package/ast-dss.pkg b/lib/package/ast-dss.pkg new file mode 100644 index 000000000..e090ae4a9 --- /dev/null +++ b/lib/package/ast-dss.pkg @@ -0,0 +1,13 @@ +ast-dss :PACKAGE: dss libdss libpz dsslib + +:REQUIRES: ast-base + +:LICENSE: *.(open|proprietary|special) + +:CATEGORY: algorithms database utils + +:INDEX: data stream scan command and support libraries + +:DESCRIPTION: + The AT&T Software Technology ast-dss package from AT&T Research + contains the dss command, plugins and support libraries. diff --git a/lib/package/ast-ksh.pkg b/lib/package/ast-ksh.pkg new file mode 100644 index 000000000..6f2fec866 --- /dev/null +++ b/lib/package/ast-ksh.pkg @@ -0,0 +1,89 @@ +ast-ksh :PACKAGE: ksh93 libast libcmd libcoshell libsum libdll + +:COVERS: ksh + +:LICENSE: *.open + +:CATEGORY: shells + +:INDEX: ksh and support libraries + +:DESCRIPTION: + The AT&T Software Technology ast-ksh package from AT&T Research + contains ksh and support libraries. This is the minimal set of + components needed to build ksh. + +:DETAILS: cyg + :README: + This package installs a standalone ksh93 executable ksh93.exe + and its man page ksh93.1. If /bin/ksh.exe does not exist then + these symlinks + /bin/ksh.exe => ksh93.exe + /usr/share/man/man1/ksh93.1 => ksh.1 + are created. This allows alternative ksh impelementations, + e.g., /bin/pdksh.exe, to be selected by changing the ksh.exe + and ksh.1 symbolic links. In addition, ksh and ksh93 paths are + added to /etc/shells if not already present. + $() + Each builtin or special command accepts the --man and --html + options to list the man page on the standard error. The --??? + option describes the self documenting options available to all + builtin and special commands. + $() + The stanadlone ksh is statically linked with the ast libcmd + library which provides several builtin versions of /bin + commands. "builtin | grep /opt/ast/bin" lists the libcmd + builtins on the standard output. /opt/ast/bin/FOO accesses + the FOO builtin, whether the /opt/ast/bin directory exists + or not. "builtin FOO" allows /opt/ast/bin/FOO to be accessed + as FOO, bypassing the $PATH setting. To enable all libcmd + builtins do one of the following: + (a) create the directory /opt/ast/bin and the file + /opt/ast/bin/.paths with this line + BUILTIN_LIB=. + and place /opt/ast/bin before /bin and /usr/bin in $PATH + (this will affect all ksh subshells and scripts) + (b) run "builtin $( builtin | sed -e '/\//!d' -e 's,.*/,,' )" + (this will affect only the current shell) + Some scripts may run significantly faster with libcmd builtins + enabled. + $() + The ast library checks the DOSPATHVARS environment variable + for variable path values to convert to and from native windows + format when cross-executing between cygwin and non-cygwin + programs. The value is a space separated list of environment + variables to convert. PATH is handled by cygwin so it is not + converted by the ast library. + $() + The astksh cygwin source package provides a bootstrap build + environment that is not suited for an edit/build/debug cycle. + If you want to explore and modify the source then you should + install the (non-cygwinized) ast-base package which includes + AT&T nmake. With ast-base you will also be able to regenerate + the astksh cygwin source and binary packages. + $() + For more information on ksh and other AT&T ast tools see + http://www.research.att.com/sw/download/ + :EXPORT: + SHOPT_CMDLIB_DIR=1 + bin/ksh93.exe :INSTALL: bin/ksh.exe + share/man/man1/ksh93.1 :INSTALL: man/man1/sh.1 + :POSTINSTALL: + if [ ! -e /bin/ksh.exe ] + then ln -fs ksh93.exe /bin/ksh.exe + ln -fs ksh93.1 /usr/share/man/man1/ksh.1 + else echo "/bin/ksh.exe already exists" + fi + if [ -f /etc/shells ] + then for i in /bin/ksh93 /bin/ksh /usr/bin/ksh93 /usr/bin/ksh + do if grep $i /etc/shells >/dev/null 2>&1 + then echo "$i already in /etc/shells" + else echo $i >> /etc/shells + echo "$i added to /etc/shells" + fi + done + else echo "no /etc/shells file" + fi + exit 0 + :TEST: bin/ksh + KSH=$<; cd src/cmd/ksh93/tests; CYGWIN="$$CYGWIN ntsec binmode" SHELL=$$KSH $$KSH shtests diff --git a/lib/package/ast-ksh.req b/lib/package/ast-ksh.req new file mode 100644 index 000000000..e69de29bb diff --git a/lib/package/ast-ksh.ver b/lib/package/ast-ksh.ver new file mode 100644 index 000000000..45271967b --- /dev/null +++ b/lib/package/ast-ksh.ver @@ -0,0 +1 @@ +ast-ksh 2012-08-01 2012-08-01 1 diff --git a/lib/package/ast-make.pkg b/lib/package/ast-make.pkg new file mode 100644 index 000000000..ec2c1bf8b --- /dev/null +++ b/lib/package/ast-make.pkg @@ -0,0 +1,19 @@ +ast-make :PACKAGE: \ + nmake cpp probe 3d ksh93 coshell cs ss pax paxlib tw \ + libast libardir libcmd libsum libdll libcoshell libpp + +:AUXILIARY: bin/proto bin/pax + +:LICENSE: *.open + +:COVERS: ast-ksh ast-ast + +:CATEGORY: devel libs shells + +:INDEX: ksh, pax, nmake + +:DESCRIPTION: + The AT&T Software Technology ast-make package from AT&T Research + contains an almost minimal set of commands and libraries required + to run ast nmake. ksh, coshell, pax, tw, and the 3d user-level + filesystem are also included. diff --git a/lib/package/ast-open.pkg b/lib/package/ast-open.pkg new file mode 100644 index 000000000..ada0d1474 --- /dev/null +++ b/lib/package/ast-open.pkg @@ -0,0 +1,20 @@ +ast-open :PACKAGE: \ + ksh93 kshlib pax html proto bzip libast libardir libcmd libdll \ + libexpr libodelta librecsort libsum libuu libvdelta libbz \ + libz tests 3d coshell cpp cs mam msgcc nmake probe ss \ + libcoshell libcs libmam libpp libcodex paxlib codexlib \ + at builtin codex dss dsslib ie mailx mam ncsl pack pzip \ + re sort sortlib std tksh tw warp libdss libpz \ + libtksh libtk vczip libvcodex libvgraph libtaso jcl libjcl + +:COVERS: ast-base ast-dss + +:LICENSE: *.open + +:CATEGORY: devel libs mail shells utils + +:INDEX: ksh, pax, nmake, sfio, and ast open source commands and libraries + +:DESCRIPTION: + The AT&T Software Technology ast-open package from AT&T Research + contains all of the ast open source commands and libraries. diff --git a/lib/package/ast-open.req b/lib/package/ast-open.req new file mode 100644 index 000000000..e69de29bb diff --git a/lib/package/ast-open.ver b/lib/package/ast-open.ver new file mode 100644 index 000000000..de483d215 --- /dev/null +++ b/lib/package/ast-open.ver @@ -0,0 +1 @@ +ast-open 2012-08-01 2012-08-01 1 diff --git a/lib/package/ast.def b/lib/package/ast.def new file mode 100644 index 000000000..c5b77229e --- /dev/null +++ b/lib/package/ast.def @@ -0,0 +1,49 @@ +# +# ast default license info +# + +message_set=3 + +contributor+=( + [gsf]="Glenn Fowler " + [dgk]="David Korn " + [kpv]="Phong Vo " + + [aedgar]="Adam Edgar " + [alb]="Adam Buchsbaum " + [ashaikh]="Aman Shaikh " + [bala]="Bala Krishnamurthy " + [brussell]="Brian Russell " + [chen]="Robin Chen " + [dfwc]="Don Caldwell " + [ek]="Lefty Koutsofios " + [gruber]="Bob Gruber " + [jiawang]="Jia Wang " + [jkf]="Jeff Fellin " + [jlk]="Jeff Korn <@google.com>" + [kfisher]="Kathleen Fisher " + [kwc]="Ken Church <@microsoft.com>" + + [bwk]="Brian Kernigham " + [dmr]="Dennis Ritchie " + [doug]="Doug McIlroy " + [ekrell]="Eduardo Krell " + [jjs]="John Snyder " + [rao]="Herman Rao " + + [ast-users]="AST users mailgroup " + [ast-developers]="AST developers mailgroup " +) + +license+=( + organization="Information and Software Systems Research" + domain=research.att.com + parent="AT&T" + corporation="Intellectual Property" + company="Research" + location="Florham Park NJ" + + package=ast + since=1986 + author=gsf+dgk+kpv +) diff --git a/lib/package/ast.lic b/lib/package/ast.lic new file mode 100644 index 000000000..225faa6ff --- /dev/null +++ b/lib/package/ast.lic @@ -0,0 +1,5 @@ +. ast.def +. epl.def +license+=( + start=2011 +) diff --git a/lib/package/bsd.def b/lib/package/bsd.def new file mode 100644 index 000000000..21a6e33a1 --- /dev/null +++ b/lib/package/bsd.def @@ -0,0 +1,45 @@ +message_set=18 + +contributor+=( + [bj]="Bill Joy" +) + +license+=( + company="The Regents of the University of California" + + package=BSD + since=1979 + + type=bsd + name="${license.package} Open Source" + url=http://www.opensource.org/licenses/bsd-license + urlmd5=5bfd485a7ffdb6249d1097da94ae75fc + + notice=' +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +3. Neither the name of the University nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +' +) diff --git a/lib/package/bsd.lic b/lib/package/bsd.lic new file mode 100644 index 000000000..874a89d82 --- /dev/null +++ b/lib/package/bsd.lic @@ -0,0 +1 @@ +. bsd.def diff --git a/lib/package/epl.def b/lib/package/epl.def new file mode 100644 index 000000000..60eea6b85 --- /dev/null +++ b/lib/package/epl.def @@ -0,0 +1,8 @@ +license+=( + type=epl + id=eclipse + name="Eclipse Public License" + version=1.0 + url=http://www.eclipse.org/org/documents/${license.type}-v${license.version//./}.html + urlmd5=b35adb5213ca9657e911e9befb180842 +) diff --git a/lib/package/ksh.pkg b/lib/package/ksh.pkg new file mode 100644 index 000000000..4783527e4 --- /dev/null +++ b/lib/package/ksh.pkg @@ -0,0 +1,14 @@ +ksh :PACKAGE: + +:LICENSE: *.open + +:CATEGORY: shells + +:INDEX: standalone AT&T ksh executable + +:DESCRIPTION: + The AT&T Software Technology ksh package from AT&T Research + contains the AT&T ksh executable implemented by David Korn. + The download file is a gzipped ksh executable. If you want + to build ksh from the source then download one of the ast-ksh, + ast-base or ast-open packages. diff --git a/lib/package/package.mk b/lib/package/package.mk new file mode 100644 index 000000000..1a945d9fe --- /dev/null +++ b/lib/package/package.mk @@ -0,0 +1,1537 @@ +/* + * source and binary package support + * + * @(#)package.mk (AT&T Research) 2012-02-14 + * + * usage: + * + * cd $INSTALLROOT/lib/package + * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type + * + * where: + * + * name package description file or component + * + * type source build source archive, generates + * $(PACKAGEDIR)/name.version.release.suffix + * binary build binary archive, generates + * $(PACKAGEDIR)/name.version.hosttype.release.suffix + * runtime build binary archive, generates + * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix + * + * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views + * + * generated archive member files are $(PACKAGEROOT) relative + * + * main assertions: + * + * NAME [ name=value ] :PACKAGE: component ... + * :OMIT: component ... + * :LICENSE: license-class-pattern + * :CATEGORY: category-id ... + * :COVERS: package ... + * :REQUIRES: package ... + * :INDEX: index description line + * :DESCRIPTION: + * [ verbose description ] + * :DETAILS: style + * :README: + * readme lines + * :EXPORT: + * name=value + * target :INSTALL: [ source ] + * + * option variables, shown with default values + * + * format=tgz + * archive format + * + * version=YYYY-MM-DD + * package base version (overrides current date) + * + * release=YYYY-MM-DD + * package delta release (overrides current date) + * + * license=type.class + * :LICENSE: type.class pattern override + * + * notice=1 + * include the conspicuous empty notice file + * + * copyright=0 + * do not prepend source file copyright notice + * + * strip=0 + * don't strip non-lcl binary package members + * + * variants=pattern + * include variants matching pattern in binary packages + * + * incremental=[source:1 binary:0] + * if a base archive is generated then also generate an + * incremental delta archive from the previous base + * + * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when + * a target is specified + */ + +/* these are ast centric -- we'll parameterize another day */ + +org = ast +url = http://www.research.att.com/sw/download + +/* generic defaults */ + +base = +category = utils +checksum = md5 +closure = +copyright = 1 +delta = +format = tgz +incremental = +index = +init = INIT +license = +licenses = $(org) +mamfile = 1 +opt = +name = +notice = +release = +strip = 0 +style = tgz +suffix = tgz +type = +variants = !(cc-g) +vendor = +version = $("":T=R%Y-%m-%d) + +SUM = sum + +package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------ + +package.readme = $(@.package.readme.) + +.package.readme. : + This is a package root directory $PACKAGEROOT. Source and binary + packages in this directory tree are controlled by the command + $() + bin/package + $() + Binary files may be in this directory or in the install root directory + $() + INSTALLROOT=$PACKAGEROOT/arch/`bin/package` + $() + For more information run + $() + bin/package help + $() + Many of the packaged commands self-document via the --man and --html + options; those that do have no separate man page. + $() + Each package is covered by one of the license files + $() + $(PACKAGELIB)/LICENSES/ + $() + where is the license type for the package. At the top + of each license file is a URL; the license covers all software that + refers to this URL. For details run + $() + bin/package license [] + $() + Any archives, distributions or packages made from source or + binaries covered by license(s) must contain the corresponding + license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?) + +.package.licenses. : .FUNCTION + local I F L R T all save text + L := $(%) + while L == "--*" + I := $(L:O=1) + if I == "--all" + all = 1 + elif I == "--save" + save = 1 + elif I == "--text" + text = 1 + end + L := $(L:O>1) + end + if "$(L)" == "*-*" + L += $(L:/[^-]*-//) $(L:/-.*//) + end + L += $(licenses) + for I $(L:U) + if I == "gpl" + I = gnu + all = + end + if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)" + R += $(F) + if save || text + T := $(.FIND. lib/package .lic $(F):P=W,query=type) + R += $(T:D=$(PACKAGESRC)/LICENSES:B) + end + if save + R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F) + elif ! all + break + end + end + end + return $(R) + +/* + * glob(3) doesn't handle / in alternation -- should it? + */ + +.package.glob. : .FUNCTION + local A D I P S + for I $(%) + if I == "*/*" + D := $(I:C,/.*,,) + if ! "$(A:N=$(D))" + local S.$(D) + A += $(D) + end + S.$(D) += $(I:C,[^/]*/,,) + else + P := $(P)$(S)$(I) + end + S = | + end + if P == "*\|*" + P := ($(P)) + end + for I $(A) + P += $(I)/$(.package.glob. $(S.$(I))) + end + return $(P) + + +.MAKEINIT : .package.init + +.package.init : .MAKE .VIRTUAL .FORCE + local V + V := $(VROOT:T=F:P=L*) + if ! PACKAGEROOT + PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1) + end + if V == "$(PACKAGEROOT)" + V := + end + V += $(INSTALLROOT) $(PACKAGEROOT) + PACKAGEVIEW := $(V:H=RU) + INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + if license + license := $(license)|none.none + end + +PACKAGELIB = lib/package +PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB) +PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB) +PACKAGEDIR = $(PACKAGESRC)/$(style) +INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + +package.omit = -|*/$(init) +package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G)) +package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??) +package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.closure = $(closure:?$$(package.all)?$$(package.pkg)?) + +package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B) +package.ini = ignore mamprobe manmake package silent +package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg)) +package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name)) +package.bin = $(PACKAGEBIN)/$(name).ini + +package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test + +op = current +stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] +source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix) +binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix) +old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) +old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) + +source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R) +binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R) +runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>) + +source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F) +binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F) + +$(init) : .VIRTUAL $(init) + +package.requires = 0 + +":package:" : .MAKE .OPERATOR + local P I R V + P := $(<:O=1) + $(P) : $(>:V) + if ! package.requires + if ! name + name := $(P) + .PACKAGE. := $(P) + if name == "$(init)" + package.omit = - + package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk + else + $(P) : $(package.init) + end + for I $(<:O>1) + if I == "*=*" + eval + $(I) + end + else + version := $(I) + end + end + LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G) + export LICENSEFILEDEFAULT + end + if "$(>)" + for I $(>:V) + $(I) : .VIRTUAL + if I == "/*" + package.dir += $(I:V) + end + end + end + if "$(@)" + $(P).README := $(@) + else + $(P).README := This is the $(P) package. + end + end + +":AUXILIARY:" : .MAKE .OPERATOR + package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F) + +":CATEGORY:" : .MAKE .OPERATOR + if ! package.requires + category := $(>) + end + +.covers. : .FUNCTION + local I C D F K=0 L + for I $(%) + if ! "$(~covers:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if D = "$(F:T=I)" + covers : $(I:B) + for L $(D) + if L == ":COVERS:" + K = 1 + elif L == ":*:" + if K + break + end + elif K + : $(.covers. $(L)) + end + end + end + else + error $(--exec:?3?1?) $(I): unknown package $(I) + end + end + end + +":COVERS:" : .MAKE .OPERATOR + if ! package.requires + : $(.covers. $(>)) + end + +":DESCRIPTION:" : .MAKE .OPERATOR + if ! package.requires + $(name).README := $(@:V) + end + +":DETAILS:" : .MAKE .OPERATOR + if ! package.requires + details.$(>:O=1) := $(@:V) + end + +":EXPORT:" : .MAKE .OPERATOR + if ! package.requires + export.$(style) := $(@:/$$("\n")/ /G) + end + +":INDEX:" : .MAKE .OPERATOR + if ! package.requires + index := $(>) + end + +":INSTALL:" : .MAKE .OPERATOR + if ! package.requires + local T S F X + S := $(>) + T := $(<) + if "$(exe.$(style))" && "$(T)" == "bin/*([!./])" + T := $(T).exe + end + if ! "$(S)" + S := $(T) + elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])" + S := $(S).exe + end + install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@ + if strip && "$(T:N=*.exe)" + install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null + end + X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S) + if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)" + F := filter $(STRIP) $(STRIPFLAGS) $(X) + end + if "$(filter.$(style):V)" + filter.$(style) := $(filter.$(style):V)$$("\n") + end + filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T) + end + +":LICENSE:" : .MAKE .OPERATOR + if ! package.requires && ! license + license := $(>) + end + +":OMIT:" : .MAKE .OPERATOR + if ! package.requires + package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G) + end + +":POSTINSTALL:" : .MAKE .OPERATOR + if ! package.requires + postinstall.$(style) := $(@:V) + end + +":README:" : .MAKE .OPERATOR + if ! package.requires + readme.$(style) := $(@:V) + end + +.requires. : .FUNCTION + local I C D F K=0 L V T M=0 + for I $(%) + if ! "$(~requires:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if I == "$(init)" + package.omit = - + else + requires : $(I:B) + end + if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)" + req : $(I:B) + else + error 1 $(I): package should be written before $(P) + end + let package.requires = package.requires + 1 + include "$(F)" + let package.requires = package.requires - 1 + else + error 1 $(I): package not found + end + end + end + +":REQUIRES:" : .MAKE .OPERATOR + : $(.requires. $(>)) + +":TEST:" : .MAKE .OPERATOR + if ! package.requires + local T + T := $(>) + if "$(T)" == "bin/*([!./])" + if "$(exe.$(style))" + T := $(T).exe + end + T := $$(PWD)/$$(ARCH)/$(T) + end + test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@) + end + +base delta : .MAKE .VIRTUAL .FORCE + op := $(<) + +closure : .MAKE .VIRTUAL .FORCE + $(<) := 1 + +cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE + style := $(<) + +source : .source.init .source.gen .source.$$(style) + +.source.init : .MAKE + local A B D P V I + type := source + if ! "$(incremental)" + incremental = 1 + end + if "$(source.$(name))" + suffix = c + end + : $(.init.$(style)) + : $(details.$(style):V:R) : + A := $(source.list) + B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + deltaversion := $(B:B:/$(name).//) + let deltasince = $(deltaversion:/.*-//) + 1 + deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + source := $(B:D:B:S=.$(release).$(suffix)) + version := $(source:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "$(stamp)" && V != "$(version)" + old.version := $(V) + old.source := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + source := $(B) + end + if B == "$(source)" + if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html + +BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1) + +$$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE + [[ -d $(<) ]] || mkdir $(<) + +$$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE) + $(*) html source > $(<) + +$$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE) + $(*) html binary > $(<) + +$$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE) + $(*) html intro > $(<) + +.source.exp .source.pkg .source.rpm : .MAKE + error 3 $(style): source package style not supported yet + +exe.cyg = .exe +vendor.cyg = gnu + +.name.cyg : .FUNCTION + local N + N := $(%) + if N == "*-*" + vendor := $(N:/-.*//) + if vendor == "$(vendor.cyg)" + vendor := + N := $(N:/[^-]*-//) + end + N := $(N:/-//G) + end + return $(N) + +.init.cyg : .FUNCTION + local N O + closure = 1 + init = . + strip = 1 + suffix = tar.bz2 + format = tbz + vendor := $(licenses:N!=$(vendor.cyg):O=1) + package.ini := $(package.ini) + package.src.pat := $(package.src.pat) + package.src := $(package.src) + package.bin := $(package.bin) + .source.gen : .CLEAR $(*.source.gen:V:N!=*.html) + name.original := $(name) + name := $(.name.cyg $(name)) + if name != "$(name.original)" + $(name) : $(~$(name.original)) + O := $(~covers) + covers : .CLEAR + for N $(O) + covers : $(.name.cyg $(N)) + end + end + stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9] + version.original := $(version) + version := $(version:/-//G)-1 + if opt + opt := $(opt)/$(vendor)/ + else + opt := $(name)-$(version)/ + end + if type == "source" + version := $(version)-src + source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + else + binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + end + +.source.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + cat > $tmp/configure <<'!' + echo "you didn't have to do that" + ! + chmod +x $tmp/configure + echo ";;;$tmp/configure;configure" + cat > $tmp/Makefile0 <<'!' + HOSTTYPE := $$(shell bin/package) + ROOT = ../.. + ARCH = arch/$$(HOSTTYPE) + all : + PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style)) + install : all + $(install.$(style):V) + $(test.$(style):V) + ! + echo ";;;$tmp/Makefile0;Makefile" + cat > $tmp/CYGWIN-README <<'!' + $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run: + $() + make + $() + $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run: + $() + make install + $() + The bin/package command provides a command line interface for all package + operations. The $(opt:/.$//) source and binary packages were generated by: + $() + package write cyg base source version=$(version.original) $(name.original) + package write cyg base binary version=$(version.original) $(name.original) + $() + using the $(org)-base package. To download and install the latest + $(org)-base source package in /opt/$(org) run: + $() + PATH=/opt/$(org)/bin:$PATH + cd /opt/$(org) + package authorize "NAME" password "PASSWORD" setup flat source $("\\") + $(url) $("\\") + $(org)-base + package make + $() + and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your + agreement to the software license(s). All users get the same NAME and PASSWORD. + See $(url) for details. If multiple architectures may be built under + /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH + to use. To update previously downloaded packages from the same url simply run: + $() + cd /opt/$(org) + package setup + package make + $() + To download and install the latest $(org)-base binary package in + /opt/$(org) change "source" to "binary" and omit "package make". + ! + echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README" + cat > $(source:/-src.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint" + echo ";;;$(BINPACKAGE);bin/package" + cat > $tmp/Makefile <<'!' + :MAKE: + ! + echo ";;;$tmp/Makefile;src/Makefile" + echo ";;;$tmp/Makefile;src/cmd/Makefile" + echo ";;;$tmp/Makefile;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + echo ";;;$tmp/Mamfile2;src/lib/Mamfile" + fi + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + echo ";;;$(PACKAGEGEN)/$(name.original).req" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(source) $(base) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \ + $(vendor:?-s",^[^/],$(opt)&,"??) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.source.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + sort -t';' -k5,5 -u | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + rm -rf $tmp + fi + +.source.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + if [[ '$(init)' == '$(name)' ]] + then cat > $tmp/Makefile <<'!' + :MAKE: + ! + $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile + echo ";;;$tmp/Makefile;src/Makefile" + cp $tmp/Makefile $tmp/Makefile1 + $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1 + echo ";;;$tmp/Makefile1;src/cmd/Makefile" + cp $tmp/Makefile $tmp/Makefile2 + $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2 + echo ";;;$tmp/Makefile2;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1 + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2 + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + cp $tmp/Mamfile2 $tmp/Mamfile3 + $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3 + echo ";;;$tmp/Mamfile3;src/lib/Mamfile" + fi + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lib pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help source + package release $(name) + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1 "$(name) package"' + echo '$($(name).README)' + set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B) + hot= + for i + do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/" + done + set -- $(package.closure:B) + if (( $# )) + then echo 'Components in this package:' + echo '.P' + echo '.TS' + echo 'center expand;' + echo 'l l l l l l.' + if [[ $hot ]] + then hot="sed $hot" + else hot=cat + fi + for i + do echo $i + done | + pr -6 -t -s' ' | + $hot + echo '.TE' + fi + echo '.P' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + set -- $(.package.licenses. --all $(name)) + case $# in + 0) ;; + *) case $# in + 1) echo 'The software is covered by this license:' ;; + *) echo 'The software is covered by these licenses:' ;; + esac + echo .BL + for j + do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' ) + echo .LI + echo ".xx link=\"$i\"" + done + echo .LE + echo 'Individual components may be covered by separate licenses;' + echo 'refer to the component source and/or binaries for more information.' + echo .P + ;; + esac + echo 'A recent' + echo '.xx link="release change log"' + echo 'is also included.' + cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null + echo '.H 1 "release change log"' + echo '.xx index' + echo '.nf' + package release $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(STDED) $(STDEDFLAGS) $tmp/t <<'!' + /^$/,/^$/s/ changes$/,/^$/m// + w + q + ! + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html + echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html" + if [[ '$(deltasince)' ]] + then { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package $(version) delta $(release)"' + echo '.xx meta.keywords="software, package, delta"' + echo '.MT 4' + echo '.TL' + echo '$(name) package $(deltaversion) delta $(release)' + echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"' + echo '.nf' + package release $(deltasince) $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html + echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html" + fi + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + echo local > $(source:D:B=$(name):S=.tim) + if [[ '$(incremental)' == 1 && '$(old.source)' ]] + then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source) + $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum)) + fi + rm -rf $tmp + else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1' + echo '$($(name).README)' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html + if [[ '$(source.$(name))' ]] + then { + echo '$($(name).README)' + package help source + } > $(PACKAGEGEN)/$(name).README + cp $(source.$(name)) $(source) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + fi + echo local > $(source:D:B=$(name):S=.tim) + fi + fi + +binary : .binary.init .binary.gen .binary.$$(style) + +.binary.init : .MAKE + local A B D I P V + type := binary + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(binary.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(binary:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.binary := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + binary := $(B) + end + if B == "$(binary)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(binary:B:/$(name).//:/\..*//) + end + PACKAGEGEN := $(PACKAGEBIN)/gen + +.binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.binary.exp .binary.pkg .binary.rpm : .MAKE + error 3 $(style): binary package style not supported yet + +.binary.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $(readme.$(style):@?$$("\n")$$(readme.$$(style))??) + ! + } > $tmp/README1 + echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README" + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $() + The remainder of this file is the README from the source package + that was used to generate this binary package. It describes + the source build hierarchy, not the current directory. + $() + $(package.readme) + ! + } > $tmp/README2 + echo ";;;$tmp/README2;usr/share/doc/$(opt)README" + package release $(name.original) > $tmp/RELEASE + echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE" + cat > $(binary:/.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + set -- $(.package.licenses. --text $(name.original):N!=*.lic) + for i + do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}" + done + cat <<'!' + $(filter.$(style)) + ! + if [[ '$(postinstall.$(style):V:O=1:?1??)' ]] + then cat >$tmp/postinstall <<'!' + $("#")!/bin/sh + $(postinstall.$(style)) + ! + echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh" + fi + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(binary) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.binary.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + rm -rf $tmp + fi + +.binary.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help binary + package release $(name) + } > $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.binary)' ]] + then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary) + echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum)) + echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + else if [[ '$(binary.$(name))' ]] + then exe=$(binary.$(name)) + else exe=$(INSTALLROOT)/bin/$(name) + fi + if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '$($(name).README)' + package help binary + } > $(PACKAGEGEN)/$(name).README + case "$(binary)" in + *.gz) gzip < $exe > $(binary) ;; + *) cp $exe $(binary) ;; + esac + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + fi + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + +runtime : .runtime.init .runtime.gen .runtime.$$(style) + +.runtime.init : .MAKE + local A B D I P V + type := runtime + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(runtime.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(runtime:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.runtime := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + runtime := $(B) + end + if B == "$(runtime)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(runtime:B:/$(name)-run.//:/\..*//) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE + error 3 $(style): runtime package style not supported yet + +.runtime.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo + echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo + echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + echo + echo "To install this $(type) package read the tarball into a directory" + echo "suitable for containing bin and lib subdirectories, and run the" + echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions." + echo + echo "To use the package export the bin directory in PATH. The commands and" + echo "libraries use \$PATH to locate dynamic libraries and related data files." + echo + } | fmt + } > $(PACKAGEGEN)/$(name)-run.README + echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \ + --install=$(PACKAGEGEN)/$(name)-run.ins \ + -wvf $(runtime) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum)) + echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.runtime)' ]] + then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime) + echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum)) + echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + fi + +list.installed list.manifest : + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + ignore $(MAKE) --noexec $(-) $(=) $(<) + done diff --git a/lib/package/zlib.def b/lib/package/zlib.def new file mode 100644 index 000000000..f82f1be53 --- /dev/null +++ b/lib/package/zlib.def @@ -0,0 +1,39 @@ +message_set=20 + +contributor+=( + [jlg]="Jean-loup Gailly" + [ma]="Mark Adler" +) + +license+=( + company="Jean-loup Gailly and Mark Adler" + + package=zlib + since=1995 + + type=zlib + name="${license.package} Open Source" + url=http://www.opensource.org/licenses/Zlib + urlmd5=4cfd2c17b0340c2f3c80b577a8e45bee + + notice=' +This software is provided "as-is", without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. +' +) diff --git a/lib/package/zlib.lic b/lib/package/zlib.lic new file mode 100644 index 000000000..7b7c52066 --- /dev/null +++ b/lib/package/zlib.lic @@ -0,0 +1 @@ +. zlib.def diff --git a/src/Mamfile b/src/Mamfile new file mode 100644 index 000000000..fdf8ec6f0 --- /dev/null +++ b/src/Mamfile @@ -0,0 +1,16 @@ +info mam static +note * +note * This build file is in the Make Abstract Machine (MAM) language. It was +note * first generated by nmake, but in the ksh 93u+m distribution we maintain +note * it manually because nmake had too many problems to keep using. The +note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added +note * support for indentation to improve readability. The language is +note * documented in Glenn Fowler's paper "A Make Abstract Machine": +note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html +note * +note source level :MAKE: equivalent +make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual +done install virtual diff --git a/src/cmd/INIT/C+probe b/src/cmd/INIT/C+probe new file mode 100644 index 000000000..f42774233 --- /dev/null +++ b/src/cmd/INIT/C+probe @@ -0,0 +1,870 @@ +: +### this script contains archaic constructs that work with all sh variants ### +# Glenn Fowler +# AT&T Research +# +# @(#)C probe (AT&T Research) 2012-02-29 +# +# probe [ -d ] c-compiler-path [ attributes ] +# +# common C probe preamble for the tool specific probes +# +# NOTE: some cc -E's do syntax analysis! + +# +# probe_* are first eval'd and then attempted from left to right +# + +probe_binding="-dy -dn -Bdynamic -Bstatic '-Wl,-ashared -Wl,+s' -Wl,-aarchive -call_shared -non_shared -dynamic -static -bshared -bstatic '' -static" +probe_env="CC_OPTIONS CCOPTS LD_OPTIONS LDOPTS LIBPATH LPATH" +probe_include="stdio.h iostream.h complex.h ctype.h plot.h stdarg.h varargs.h ranlib.h hash.h sys/types.h stab.h cmath cstdio iostream string" +probe_longlong="long 'long long'" +probe_longlong_t="__int64_t _int64_t __int64 _int64 int64" +probe_l="l yyreject m sin mopt sin" +probe_lxx="C exit ++ exit g++ exit" +probe_ppprefix="a n" +probe_size="size" +probe_src="cxx C cc c" +probe_sa=".sa" +probe_sd=".dll .lib .dll .x" +probe_sdb=".pdb" +probe_so=".dylib .so .sl" +probe_symprefix="_" +probe_verbose="'-v -v' '-# -#' '-d -d' -dryrun '-V -V'" +probe_version="--version -V -version -v" + +# +# the following are set by the preamble for the tool specific probe +# + +cc=cc +debug= +dir=. +dll=.dll +dynamic= +exe=exe +executable="test -x" +hosted= +ifs=${IFS-' + '} +obj=o +ppenv= +ppopt= +predef= +prepred= +sa= +sd= +sdb= +so= +sov= +static= +stdlib= +stdpp= +suffix_command= +if test "" != "$TMPDIR" -a -d "$TMPDIR" +then tmpdir=$TMPDIR +else tmpdir=/tmp +fi +tmpdir=$tmpdir/probe$$ +undef="define defined elif else endif error if ifdef ifndef include line pragma undef __STDC__ __STDPP__ __ARGC__ __BASE__ __BASE_FILE__ __DATE__ __FILE__ __FUNCTION__ __INCLUDE_LEVEL__ __LINE__ __PATH__ __TIME__ __TIMESTAMP__ __VERSION__" +version_flags= +version_stamp= +version_string= + +# +# constrain the environment +# + +DISPLAY= +LC_ALL=C +export DISPLAY LC_ALL + +# +# now the common probes +# + +while : +do case $1 in + -d) debug=1 ;; + -*) set ''; break ;; + *) break ;; + esac + shift +done + +cc=$1 +case $cc in +[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*) + ;; +*) echo "Usage: $0 [ -d ] c-compiler-path [ attributes ]" >&2 + exit 1 + ;; +esac +ATTRIBUTES= +eval $2 +_probe_PATH=$PATH +PATH=/usr/bin:/bin:$PATH + +case $0 in +*[\\/]*) dir=`echo $0 | sed -e 's,[\\/][\\/]*[^\\/]*\$,,'` ;; +esac + +$executable . 2>/dev/null || executable='test -r' + +case $SHELL in +[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*) + sh=$SHELL + ;; +*) sh=/bin/sh + ;; +esac + +trap 'code=$?; cd ..; rm -rf $tmpdir; exit $code' 0 1 2 3 +mkdir $tmpdir +cd $tmpdir + +exec 3>&1 4>&2 /dev/null 2>&1 + (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0 + ;; +*) PS4='+$LINENO+ ' + set -x + ;; +esac + +if (xxx=xxx; unset xxx) +then UNSET=1 +else UNSET= +fi +eval set x $probe_env +while : +do shift + case $# in + 0) break ;; + esac + eval x='$'$1 + case $x in + '') continue ;; + esac + case $1 in + *PATH) _probe_export="$_probe_export $1='$x'" ;; + esac + case $UNSET in + '') eval $1= + export $1 + ;; + *) unset $1 + ;; + esac +done + +if test -f "$dir/probe.ini" +then . "$dir/probe.ini" + IFS=$ifs +fi + +mkdir suffix +cd suffix +for src in $probe_src +do echo "int main(){return 0;}" > ../test.$src + rm -f test* + if $cc -c ../test.$src + then set test.* + if test -f "$1" + then o="$*" + mv $* .. + for i in $o + do if $cc -o test.exe ../$i + then obj=`echo "$i" | sed -e 's,test.,,'` + $executable test.exe || executable="test -r" + set test* + rm * + if $cc -o test ../$i + then rm $* + set test.* + if $executable "$1" + then exe=`echo "$1" | sed -e 's,test.,,'` + suffix_command=.$exe + fi + fi + break 2 + fi + done + fi + fi +done +cd .. + +case $src in +c) ;; +*) echo '// ( +int +main() +{ + class { public: int i; } j; + j.i = 0; + int k = j.i + 1; + return k; +}' > dialect.$src + if $cc -c dialect.$src && $cc -o dialect.$exe dialect.$obj && $executable dialect.$exe + then mv dialect.$src dialect.c + rm -f dialect.$obj dialect.$exe + if $cc -c dialect.c && $cc -o dialect.$exe dialect.$obj && $executable dialect.$exe + then src=c + else set x $cc + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + *=*) continue ;; + esac + case `echo $1 | sed -e 's,.*/,,'` in + *CC*|*++*|*[xX][xX]*|*[pP][lL][uU][sS]*) ;; + *) src=c ;; + esac + break + done + fi + else src=c + fi + ;; +esac + +set x x '(' 1 'int x;' 0 +while : +do shift + shift + case $# in + [01]) break ;; + esac + rm -f test.$obj + echo "$1" > test.$src + $cc -c test.$src + r=$? + case $r in + 0) test -f test.$obj || r=1 ;; + *) r=1 ;; + esac + case $2:$r in + 0:0) ;; + 0:1) echo "$cc: not a C compiler: failed to compile \`\`$1''" >&4 + exit 1 + ;; + 1:0) echo "$cc: not a C compiler: successfully compiled \`\`$1''" >&4 + exit 1 + ;; + esac +done + +hosttype=`package CC="$cc" || $SHELL -c "package CC='$cc'"` +case $hosttype in +*[Uu][Ss][Aa][Gg][Ee]:*) + hosttype=`PATH=$_probe_PATH; export PATH; package CC="$cc" || $SHELL -c "package CC='$cc'"` + ;; +esac + +echo '#include +int main(){printf("hello");return 0;}' > dynamic.$src +echo 'extern int sfclose() { return 0; }' > fun.$src +if $cc -c dynamic.$src && $cc -c fun.$src +then eval set x $probe_so + while : + do shift + case $# in + 0) break ;; + esac + for i in foo junk + do rm -f dynamic.$exe + if $cc -L. -o dynamic.$exe dynamic.$obj -l$i + then : "there's really a -l$i"? + else rm -f dynamic.$exe + cat fun.$obj > lib$i$1 + $cc -L. -o dynamic.$exe dynamic.$obj -l$i && $executable dynamic.$exe + x=$? + rm lib$i$1 + case $x in + 0) so=$1 + rm -f dynamic.$exe > lib$i$1.1 + $cc -L. -o dynamic.$exe dynamic.$obj -l$i && $executable dynamic.$exe + x=$? + rm lib$i$1.1 + case $x in + 0) sov=1 ;; + esac + break 2 + ;; + *) break + ;; + esac + fi + done + k= + for i in "" .1 .2 .3 .4 .5 .6 .7 .8 .9 + do rm -f dynamic.$exe > libc$1$i + $cc -L. -o dynamic.$exe dynamic.$obj && $executable dynamic.$exe + x=$? + (cd ..; rm $tmpdir/libc$1$i) + case $x in + 0) ;; + *) k=X$k + case $k in + XXX) break ;; + esac + ;; + esac + done + case $k in + XXX) so=$1 + sov=1 + break + ;; + ?*) so=$1 + break + ;; + esac + done + rm -f dynamic.$exe + if $cc -o dynamic.$exe dynamic.$obj 2>e && $executable dynamic.$exe + then e=`wc -l e` + maybe= + eval set x x $probe_binding + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f dynamic.$exe + $cc -o dynamic.$exe $1 dynamic.$obj 2>e && $executable dynamic.$exe || continue + case $1 in + ?*) case $maybe in + "") maybe=$1 ;; + *) maybe=-- ;; + esac + ;; + esac + case `wc -l e` in + $e) ;; + *) continue ;; + esac + d=`ls -s dynamic.$exe` + rm -f dynamic.$exe + $cc -o dynamic.$exe $2 dynamic.$obj 2>e && $executable dynamic.$exe || continue + case `wc -l e` in + $e) ;; + *) continue ;; + esac + case `ls -s dynamic.$exe` in + $d) ;; + *) dynamic=$1 + static=$2 + maybe= + break + ;; + esac + done + case $maybe in + ""|--) ;; + *) rm -f dynamic.$exe + if $cc -o dynamic.$exe $maybe dynamic.$obj 2>e && $executable dynamic.$exe + then e=`wc -l e` + if $cc -o dynamic.$exe $maybe-bogus-bogus-bogus dynamic.$obj 2>e && $executable dynamic.$exe + then case `wc -l e` in + $e) ;; + *) dynamic=$maybe ;; + esac + else dynamic=$maybe + fi + fi + ;; + esac + fi +fi + +eval set x $probe_version +shift +for o in "$@" +do if $cc $o > version.out 2>&1 + then version_string=`sed -e '/ is /d' -e 's/;/ /g' version.out | sed -e 1q` + case $version_string in + ''|*[Ee][Rr][Rr][Oo][Rr]*|*[Ff][Aa][Tt][Aa][Ll]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + ;; + *) version_flags=$o + version_stamp=";VERSION;$o;$version_string;PATH;$cc" + break + ;; + esac + fi +done +case $version_stamp in +'') eval set x $probe_version + shift + echo 'int main() { return 0; }' > version.i + for o in "$@" + do if $cc -c $o version.i > version.out 2>&1 + then version_string=`sed -e '/ is /d' -e 's/;/ /g' version.out | sed -e 1q` + case $version_string in + ''|*[Ee][Rr][Rr][Oo][Rr]*|*[Ff][Aa][Tt][Aa][Ll]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + ;; + *) version_flags=$o + break + ;; + esac + fi + done + ;; +esac + +echo 'int main(){return 0;}' > hosted.$src +$cc -o hosted.$exe hosted.$src && ./hosted.$exe && hosted=1 + +echo '#!'$sh' +echo "" $@' > cpp +chmod +x cpp +case `./cpp -Dprobe` in +*-Dprobe*) + ;; +*) cp /bin/echo cpp + chmod u+w cpp + ;; +esac +for prefix in $probe_ppprefix `echo $cc | sed -e '/cc\$/!d' -e 's,cc\$,,' -e 's,.*/,,'` +do cp cpp ${prefix}cpp +done + +echo "" > flags.$src +echo '#pragma pp:version' > libpp.$src + +if test `realcppC=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='realcppC=${ppcmd}' +elif test `cppC=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='cppC=${ppcmd}' +elif test `_CPPNAME=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='_CPPNAME=${ppcmd}' +elif test `_CPP=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='_CPP=${ppcmd}' +elif test `$cc -Dprobe -E -%p+. flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 && test `$cc -Dprobe -E -%p+. flags.$src | wc -l` -eq 1 +then ppopt='-%p+${ppdir}' +elif test `$cc -Dprobe -E -Yp,. flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-Yp,${ppdir}' +elif test `$cc -Dprobe -E -Qpath $tmpdir flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-Qpath ${ppdir}' +elif test `$cc -Dprobe -E -tp -B./ flags.$src 2>err.out | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 -a ! -s err.out +then ppopt='-tp -B${ppdir}/' +elif test `$cc -Dprobe -E -B./ flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-B${ppdir}/' +elif test `$cc -Dprobe -E -tp -h./ -B flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-tp -h${ppdir}/ -B' +elif test `$cc -Dprobe -E -t p,./cpp flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-t p,${ppcmd}' +else { + eval set x $probe_verbose + shift + for o in "$@" + do $cc -E $o flags.$src + done + } 2>&1 | sed -e "s/['\"]//g" > cpp.out +fi + +set x `sed -e 's,[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\\\,/,g' -e 's,\\\\,/,g' cpp.out` +def= +definclude="-I+C -I-H" +stdinclude=$definclude +case $hosted in +"") usrinclude= ;; +esac +cmdinclude= +while : +do case $# in + 0|1) break ;; + esac + shift + case $1 in + -A) case $2 in + *\(*\)) shift + prepred="$prepred `echo $1 | sed 's/\(.*\)(\(.*\))/\1 \2/'`" + ;; + esac + ;; + -A\(*\)) + prepred="$prepred `echo $1 | sed 's/-A\(.*\)(\(.*\))/\1 \2/'`" + ;; + -[DI][-+][ABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + stdpp=1 + case $1 in + -I?[CH]) case $def in + ?*) definclude="$definclude $1" ;; + *) stdinclude="$stdinclude $1" ;; + esac + ;; + -I-S*|-YI,*) usrinclude="`echo $1 | sed 's/....//'`" ;; + -Y?,*) ;; + -Y*) usrinclude="`echo $1 | sed 's/..//'`" ;; + esac + ;; + -D) shift + case $1 in + [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*=*) + predef="$predef +`echo $1 | sed -e 's/=.*//'`" + ;; + [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*) + predef="$predef +$1" + ;; + esac + ;; + -Dprobe);; + -D*) case $1 in + -D[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*=*) + predef="$predef +`echo $1 | sed -e 's/^-D//' -e 's/=.*//'`" + ;; + -D[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*) + predef="$predef +`echo $1 | sed -e 's/^-D//'`" + ;; + esac + ;; + -I) shift + case $1 in + /*) case $def in + ?*) definclude="$definclude $1" ;; + *) stdinclude="$stdinclude $1" ;; + esac + cmdinclude="$cmdinclude $1" + ;; + esac + ;; + -I/*) f=`echo X$1 | sed 's/X-I//'` + case $def in + ?*) definclude="$definclude $f" ;; + *) stdinclude="$stdinclude $f" ;; + esac + cmdinclude="$cmdinclude $f" + ;; + -U) shift + undef="$undef $1" + ;; + -U*) undef="$undef `echo $1 | sed 's/^-U//'`" + ;; + flags.$src)def= + ;; + esac +done +stdinclude="$stdinclude $definclude" +case " $stdinclude " in +*\ $usrinclude\ *) + case $usrinclude in + /usr/include) + usrinclude= + ;; + *) case " $stdinclude " in + *\ /usr/include\ *) + usrinclude= + ;; + *) usrinclude=/usr/include + ;; + esac + ;; + esac + ;; +esac + +tstinclude=`$cc -v -E flags.$src 2>&1 | sed -e '1,/[iI][nN][cC][lL][uU][dD][eE][ ]*<[.][.][.]>/d' -e '/^[eE][nN][dD] [oO][fF] [sS][eE][aA][rR][cC][hH]/,\$d'` +j=$tstinclude +case $j in +*/*) ;; +*) j=$cmdinclude ;; +esac +tstinclude= +good= +nogood= +c_hdr="stdio.h ctype.h" +C_hdr="libc.h" +for i in $j +do if test -d "$i" + then tstinclude="$tstinclude $i" + h= + for f in $c_hdr + do if test -f "$i/$f" + then case $i in + */CC) nogood=1 ;; + *) good=1 ;; + esac + else h="$h $f" + fi + done + c_hdr=$h + h= + for f in $C_hdr + do if test -f "$i/$f" + then case $i in + */CC) nogood=1 ;; + *) good=1 ;; + esac + else h="$h $f" + fi + done + C_hdr=$h + fi +done +case $nogood in +1) good=0 ;; +esac +case $good in +1) case $c_hdr in + ?*) bad=1 + usrinclude=/usr/include + set '' $tstinclude /usr/include + ;; + *) set '' $tstinclude + ;; + esac + shift + stdinclude=$* + echo "#include " > include.$src + $cc -E include.$src | sed -e '/# 1 "[\\/]/!d' -e 's,[^"]*",,' -e 's,[\\/][^\\/]*".*,,' -e 's,[\\/]sys,,' > include.out + for f in `cat include.out` + do if test -d "$f" + then g=`echo $f | sed -e 's,[\\/][\\/]*[^\\/]*$,,'` + case " $stdinclude " in + *\ $f\ *|*\ $g\ *) + ;; + *) stdinclude="$stdinclude $f" + case $f in + /usr/include) usrinclude=$f ;; + esac + bad=1 + ;; + esac + fi + done + ;; +*) case $ppopt$ppenv in + ?*) echo '#!'$sh' + echo $VIRTUAL_ROOT | sed "s/:.*//"' > cpp + chmod +x cpp + ppcmd=cpp + ppdir=. + eval x='`'$ppenv '$'cc -E $ppopt flags.$src'`' + case $x in + ?*) tstinclude=$x/usr/include + ;; + esac + cp /bin/echo cpp + chmod u+w cpp + ;; + esac + + eval set x $probe_include + while : + do shift + case $# in + 0) break ;; + esac + echo "#include <$1>" > include.$src + $cc -E include.$src + done > include.out + + ccinclude= + x=$stdinclude + stdinclude= + subinclude= + for f in $x $tstinclude `sed -e 's,\\\\,/,g' -e 's,///*,/,g' -e 's,"[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/,"/,g' -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[\\/]/!d' -e 's/^#[line ]*[0123456789][0123456789]*[ ][ ]*"\(.*\)[\\/].*".*/\1/' include.out | sort -u` + do case $f in + -*) ;; + */) f=`echo $f | sed -e 's,//*\$,,'` ;; + */.) f=`echo $f | sed -e 's,//*.\$,,'` ;; + esac + case $f in + -I*) ;; + */cc) ccinclude=1 + ;; + */sys) continue + ;; + */include/*/*) + ;; + */include/*) + subinclude="$subinclude $f" + continue + ;; + esac + if test -d "$f" + then case " $stdinclude " in + *\ $f\ *) ;; + *) stdinclude="$stdinclude $f" ;; + esac + fi + done + rm include.out + case $ccinclude in + ?*) eval set x $probe_include + while : + do shift + case $# in + 0) break ;; + esac + echo "#include " > include.$src + if $cc -E include.$src > /dev/null + then break + fi + done + case $# in + 0) ;; + *) x=$stdinclude + stdinclude= + for f in $x + do case $f in + */cc) ;; + *) stdinclude="$stdinclude $f" ;; + esac + done + ;; + esac + ;; + esac + case $subinclude in + ?*) for i in $subinclude + do for j in $stdinclude + do case $i in + $j/*/*) ;; + $j/*) both= + eval set x $probe_include + while : + do shift + case $# in + 0) for k in $both + do echo "#include <$k>" > include.$src + $cc -E include.$src > include.out + I=`grep -c $i/$k < include.out` + J=`grep -c $j/$k < include.out` + case $I:$J in + 0:*) ;; + *:0) stdinclude="$i $stdinclude" + break + ;; + esac + done + continue 3 + ;; + esac + if test -f $i/$1 + then if test ! -f $j/$1 + then break 2 + fi + both="$both $1" + fi + done + ;; + $j) continue 2 + ;; + esac + done + stdinclude="$i $stdinclude" + done + ;; + esac + + { + + for i in $stdinclude + do + case $i in + $usrinclude) ;; + *) echo $i $i ;; + esac + done + + eval set x $probe_include + while : + do shift + case $# in + 0) break ;; + esac + echo "#include <$1>" > t.c + p= + for j in `$cc -E t.c | grep "$1" | sed -e 's,\\\\,/,g' -e 's,"[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/,"/,g' -e '/^#[line ]*1[ ][ ]*"[\\/]/!d' -e 's/^#[line ]*1[ ][ ]*"\(.*\)[\\/].*".*/\1/'` + do j=`echo $j | sed -e 's,///*,/,g' -e 's,/$,,'` + case $p in + ?*) echo $p $j ;; + esac + p=$j + done + done + + case $usrinclude in + ?*) echo $usrinclude $usrinclude ;; + esac + + } | tsort > tmp.tmp + tstinclude=`cat tmp.tmp` + bad= + for i in $stdinclude + do case " +$tstinclude +" in + *" +$i +"*) ;; + *) bad=1 + break + ;; + esac + done + ;; +esac + +case $bad in +"") x=$stdinclude + stdinclude= + z= + for i in $tstinclude + do case " $x " in + *" $i "*) + stdinclude="$stdinclude $i" + z=$i + ;; + esac + done + case $usrinclude in + '') usrinclude=$z ;; + esac + ;; +esac +case $hosted in +"") case $usrinclude in + /usr/include) usrinclude= ;; + esac + ;; +esac + +case $usrinclude in +?*) case " $stdinclude " in + *\ $usrinclude\ *) + x=$stdinclude + stdinclude= + for f in $x + do case $f in + $usrinclude) ;; + *) stdinclude="$stdinclude $f" ;; + esac + done + ;; + esac + ;; +esac + +# drop dups -- they creep in somehow + +x=$stdinclude +stdinclude= +for f in $x +do case " $stdinclude $usrinclude " in + *" $f "*) ;; + *) stdinclude="$stdinclude $f" ;; + esac +done diff --git a/src/cmd/INIT/CONVERT.mk b/src/cmd/INIT/CONVERT.mk new file mode 100644 index 000000000..63a60ef5f --- /dev/null +++ b/src/cmd/INIT/CONVERT.mk @@ -0,0 +1,260 @@ +/* + * {automake|configure} => {nmake|iffe} conversion support + * + * The first command line target overrides the default original source + * directory name $(MAKEFILE:D). The hard work is in the makefile using + * these assertions, since it must (manually) provide the nmake makefiles + * and config equivalent iffe scripts. The conversion makefile is typically + * named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory, + * and the conversion is run from the $PACKAGEROOT directory, e.g.: + * + * nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt + * + * The conversion requires the ast nmake, pax and tw commands. + * + * After the conversion you will be liberated from ./configure, *.in, + * *.am, automake, autom4te, libtool, make depend, and makefile + * recursion ordering. You can build from $PACKAGEROOT using the ast + * package(1) (which sets up the { HOSTTYPE PATH VPATH } environment): + * + * package make + * + * or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion + * of the hierarchy with the ast nmake(1) (after setting PATH and VPATH): + * + * nmake + * + * The conversion assertions are: + * + * package :CONVERT: file ... + * + * files in the original source directory are copied + * and converted into the ./src and ./lib subdirectories + * the default original source directory is ./original + * + * package package name + * file original source file that must exist + * + * :OMIT: pattern + * + * files matching pattern are not copied into the converted + * directory + * + * pattern ksh pattern of files to omit + * + * :COPY: from to [ file ... ] + * + * files in the from directory are copied to the to directory + * the action may contain :MOVE: exceptions to the copy + * + * from original directory subdirectory + * . names the original directory + * .. names the + * to converted subdirectory + * libNAME => src/lib/libNAME + * NAME => src/cmd/NAME + * file files or files in subdirectories to be copied; + * explicit files are copied to the to directory; + * if no files are specified then the from hierarchy + * is recursively copied to the converted directory + * + * :MOVE: to file ... + * + * :COPY: assertion exceptions placed in the assertion's action + * + * to files or subdirectory files are copied to this directory + * file file or files in subdirectories to be copied + * + * :FILE: to file <FD)" + original := $(D) + .ARGS : .CLEAR $(~.ARGS:O>1) + end + end + +.cvt.filter = +.cvt.package = + +.cvt.atom : .FUNCTION + local N V + V := $(%:O=1) + let .cvt.$(V) = .cvt.$(V) + 1 + return .cvt.$(V).$(.cvt.$(V)) + +.cvt.omit : .FUNCTION + return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)' + +.cvt.to : .FUNCTION + if "$(%)" == "." + return src + end + if "$(%)" == "*/*" + return src/$(%) + end + if "$(%)" == "lib*" + return src/lib/$(%) + end + return src/cmd/$(%) + +":CONVERT:" : .MAKE .OPERATOR + local I + package := $(<) + I := $(hierarchy:C,$,/Makefile) + init : .cvt.verify $(I) + $(I) : .ACCEPT + test -d $(<:D) || $(MKDIR) -p $(<:D) + echo :MAKE: > $(<) + .cvt.verify : .MAKE .FORCE .REPEAT + local I + if I = "$(.cvt.package:T!=F)" + error 3 $(original): not a $(package) source directory: missing $(I) + end + .cvt.package := $(>:C,^,$$(original)/,) + +":COPY:" : .MAKE .OPERATOR + local F T I A + F := $(>:O=1) + T := $(.cvt.to $(>:O=2)) + A := $(.cvt.atom copy) + copy : $(A) + $(A) : .VIRTUAL + if F == "." + $(A) : $(T) + $(T) : + test -d $(<) || $(MKDIR) -p $(<) + for I $(>:O>2) + eval + $$(A) : $(I:D=$(T):B:S) + $(I:D=$(T):B:S) : $$(original)/$(I) + $$(CP) $$(CPFLAGS) $$(*) $$(<) + end + end + elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))" + eval + $$(A) : $$(F) + test -d $(T) || $$(MKDIR) -p $(T) + cd $(T) + $$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter) + end + else + F := $$(original)/$(F) + if ! "$(@:V)" + eval + $$(A) : .FORCE + test -d $(T) || $$(MKDIR) -p $(T) + cd $(F:V) + $$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A) + end + else + .cvt.move = + : $(@:V:@R) + eval + $$(A) : .FORCE + test -d $(T) || $$(MKDIR) -p $(T) + cd $(F:V) + $$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A) + end + end + end + +":EDIT:" : .MAKE .OPERATOR + local A D F + D := $(>:O=1) + if D == "-" + A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G) + .cvt.filter += --action=$(A:@Q) + else + D := $(.cvt.to $(D)) + F := $(>:O>1:C,^,$(D)/,) + edit : $(F) + eval + $$(F) : + $$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)' + $(@:V) + w + q + $(here) + end + end + +":FILE:" : .MAKE .OPERATOR + local ( D F ) $(>) + local A + A := $(.cvt.atom file) + $(A) := $(@:V) + D := $(.cvt.to $(D)) + file : $(D)/$(F) + eval + $$(D)/$$(F) : + test -d $$(<:D) || $$(MKDIR) -p $$(<:D) + cat > $$(<) <<'$(here)' + $$($(A):V) + $(here) + end + +":MOVE:" : .MAKE .OPERATOR + local T I + T := ../../../$(.cvt.to $(>:O=1)) + for I $(>:O>1) + if I == "*/" + .cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)' + .cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)' + else + .cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)' + end + end + +":OMIT:" : .MAKE .OPERATOR + local P + for P $(>) + omit := $(omit)|$(P) + end diff --git a/src/cmd/INIT/MAPLIB.mk b/src/cmd/INIT/MAPLIB.mk new file mode 100644 index 000000000..55d653416 --- /dev/null +++ b/src/cmd/INIT/MAPLIB.mk @@ -0,0 +1,45 @@ +/* + * normalize local -l* library conventions + * + * L [ [ G11 ... G1n ] ... [ Gg1 ... Ggn ] ] :MAPLIB: T1.c ... Tn.c + * + * if Giji not specified then G11 == L + * the first Ti.c that compiles/links with group -lGi1 ... -lGin + * but does not compile/link with no libraries maps + * -lL to require -lGi1 ... -lGin + * otherwise -lL is not required and maps to "no library required" + */ + +":MAPLIB:" : .MAKE .OPERATOR + local L P + L := $(<:B:O=1) + if ! ( P = "$(<:B:O>1)" ) + P := $(L) + end + $(LIBDIR)/lib/$(L) :INSTALL: $(L).req + eval + $(L).req : (CC) $$(>) + set - + r='-' + for i in $$(*) + do if $$(CC) -c $i > /dev/null + then g= + for p in $(P) - + do case $p in + -) if $$(CC) -o $$(<:B:S=.exe) $i $g > /dev/null 2>&1 + then $$(CC) -o $$(<:B:S=.exe) $i > /dev/null 2>&1 || { + r="$g" + break 2 + } + fi + g= + ;; + *) g="$g -l$p" + ;; + esac + done + fi + done 2>/dev/null + echo " $r" > $$(<) + rm -f $$(<:B:S=.exe) $$(*:B:S=$$(CC.SUFFIX.OBJECT)) + end diff --git a/src/cmd/INIT/MSGFUN.mk b/src/cmd/INIT/MSGFUN.mk new file mode 100644 index 000000000..0888d0049 --- /dev/null +++ b/src/cmd/INIT/MSGFUN.mk @@ -0,0 +1,2 @@ +/* stub for pre-2000-05-01 nmake */ +":MSGFUN:" : .MAKE .OPERATOR diff --git a/src/cmd/INIT/MSGKEY.mk b/src/cmd/INIT/MSGKEY.mk new file mode 100644 index 000000000..db1855964 --- /dev/null +++ b/src/cmd/INIT/MSGKEY.mk @@ -0,0 +1,2 @@ +/* stub for pre-2000-05-01 nmake */ +":MSGKEY:" : .MAKE .OPERATOR diff --git a/src/cmd/INIT/Mamfile b/src/cmd/INIT/Mamfile new file mode 100644 index 000000000..4dfe4c746 --- /dev/null +++ b/src/cmd/INIT/Mamfile @@ -0,0 +1,1393 @@ +info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20 +note * +note * This build file is in the Make Abstract Machine (MAM) language. It was +note * first generated by nmake, but in the ksh 93u+m distribution we maintain +note * it manually because nmake had too many problems to keep using. The +note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added +note * support for indentation to improve readability. The language is +note * documented in Glenn Fowler's paper "A Make Abstract Machine": +note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html +note * +setv INSTALLROOT ../../.. +setv PACKAGEROOT ../../../../.. +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv ARFLAGS rc +setv AS as +setv ASFLAGS +setv CC cc +setv mam_cc_FLAGS +setv KSH_RELFLAGS +setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} +setv COTEMP $$ +setv CPIO cpio +setv CPIOFLAGS +setv CPP "${CC} -E" +setv F77 f77 +setv HOSTCC ${CC} +setv IGNORE +setv LD ld +setv LDFLAGS +setv LEX lex +setv LEXFLAGS +setv LPR lpr +setv LPRFLAGS +setv M4FLAGS +setv NMAKE nmake +setv NMAKEFLAGS +setv PR pr +setv PRFLAGS +setv SHELL /bin/sh +setv SILENT +setv TAR tar +setv YACC yacc +setv YACCFLAGS -d +make ${PACKAGEROOT}/lib/package/ast.lic +done ${PACKAGEROOT}/lib/package/ast.lic +make install + make hurl + make hurl.sh + done hurl.sh + meta hurl %.sh>% hurl.sh hurl + prev hurl.sh + setv LICENSE -DLICENSE="since=2003,author=gsf" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : hurl contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n hurl.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp hurl.sh hurl + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < hurl.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - hurl.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > hurl + exec - ;; + exec - esac + exec - ;; + exec - *) cat - hurl.sh > hurl <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w hurl -a -x hurl || chmod u+w,+x hurl + done hurl generated + make iffe + make iffe.sh + done iffe.sh + meta iffe %.sh>% iffe.sh iffe + prev iffe.sh + setv LICENSE -DLICENSE="since=1994,author=gsf+kpv" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : iffe contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n iffe.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 225 in + exec - 0) cp iffe.sh iffe + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < iffe.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - iffe.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Phong Vo ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > iffe + exec - ;; + exec - esac + exec - ;; + exec - *) cat - iffe.sh > iffe <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Phong Vo ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w iffe -a -x iffe || chmod u+w,+x iffe + done iffe generated + make mktest + make mktest.sh + done mktest.sh + meta mktest %.sh>% mktest.sh mktest + prev mktest.sh + setv LICENSE -DLICENSE="since=2005,author=gsf" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : mktest contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n mktest.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp mktest.sh mktest + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < mktest.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - mktest.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > mktest + exec - ;; + exec - esac + exec - ;; + exec - *) cat - mktest.sh > mktest <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w mktest -a -x mktest || chmod u+w,+x mktest + done mktest generated + make package + make package.sh + done package.sh + meta package %.sh>% package.sh package + prev package.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : package contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n package.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp package.sh package + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < package.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - package.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > package + exec - ;; + exec - esac + exec - ;; + exec - *) cat - package.sh > package <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w package -a -x package || chmod u+w,+x package + done package generated + make regress + make regress.sh + done regress.sh + meta regress %.sh>% regress.sh regress + prev regress.sh + setv LICENSE -DLICENSE="since=1995,author=gsf" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : regress contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n regress.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp regress.sh regress + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < regress.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - regress.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > regress + exec - ;; + exec - esac + exec - ;; + exec - *) cat - regress.sh > regress <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w regress -a -x regress || chmod u+w,+x regress + done regress generated + make rt + make rt.sh + done rt.sh + meta rt %.sh>% rt.sh rt + prev rt.sh + setv LICENSE -DLICENSE="since=2005,author=gsf" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : rt contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n rt.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp rt.sh rt + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < rt.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - rt.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > rt + exec - ;; + exec - esac + exec - ;; + exec - *) cat - rt.sh > rt <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w rt -a -x rt || chmod u+w,+x rt + done rt generated + make crossexec + make crossexec.sh + done crossexec.sh + meta crossexec %.sh>% crossexec.sh crossexec + prev crossexec.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : crossexec contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n crossexec.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp crossexec.sh crossexec + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < crossexec.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - crossexec.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > crossexec + exec - ;; + exec - esac + exec - ;; + exec - *) cat - crossexec.sh > crossexec <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w crossexec -a -x crossexec || chmod u+w,+x crossexec + done crossexec generated + make ditto + make ditto.sh + done ditto.sh + meta ditto %.sh>% ditto.sh ditto + prev ditto.sh + setv LICENSE -DLICENSE="since=2001,author=gsf+ek" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : ditto contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n ditto.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 232 in + exec - 0) cp ditto.sh ditto + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < ditto.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - ditto.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Lefty Koutsofios ][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > ditto + exec - ;; + exec - esac + exec - ;; + exec - *) cat - ditto.sh > ditto <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Lefty Koutsofios ][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w ditto -a -x ditto || chmod u+w,+x ditto + done ditto generated + make execrate + make execrate.sh + done execrate.sh + meta execrate %.sh>% execrate.sh execrate + prev execrate.sh + setv LICENSE -DLICENSE="since=2002,author=gsf" + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : execrate contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n execrate.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp execrate.sh execrate + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < execrate.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - execrate.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > execrate + exec - ;; + exec - esac + exec - ;; + exec - *) cat - execrate.sh > execrate <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w execrate -a -x execrate || chmod u+w,+x execrate + done execrate generated + make filter + make filter.sh + done filter.sh + meta filter %.sh>% filter.sh filter + prev filter.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : filter contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n filter.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 184 in + exec - 0) cp filter.sh filter + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < filter.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - filter.sh <<'!' + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - } > filter + exec - ;; + exec - esac + exec - ;; + exec - *) cat - filter.sh > filter <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" + exec - ! + exec - ;; + exec - esac + exec - test -w filter -a -x filter || chmod u+w,+x filter + done filter generated + make ignore + make ignore.sh + done ignore.sh + meta ignore %.sh>% ignore.sh ignore + prev ignore.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : ignore contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n ignore.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 0 in + exec - 0) cp ignore.sh ignore + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < ignore.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - ignore.sh <<'!' + exec - + exec - ! + exec - } > ignore + exec - ;; + exec - esac + exec - ;; + exec - *) cat - ignore.sh > ignore <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - + exec - ! + exec - ;; + exec - esac + exec - test -w ignore -a -x ignore || chmod u+w,+x ignore + done ignore generated + make silent + make silent.sh + done silent.sh + meta silent %.sh>% silent.sh silent + prev silent.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : silent contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n silent.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 0 in + exec - 0) cp silent.sh silent + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < silent.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - silent.sh <<'!' + exec - + exec - ! + exec - } > silent + exec - ;; + exec - esac + exec - ;; + exec - *) cat - silent.sh > silent <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - + exec - ! + exec - ;; + exec - esac + exec - test -w silent -a -x silent || chmod u+w,+x silent + done silent generated + make mamake + make mamake.o + make mamake.c + make shlib-compat.h implicit + done shlib-compat.h dontcare virtual + make ast.h implicit + done ast.h dontcare virtual + done mamake.c + meta mamake.o %.c>%.o mamake.c mamake + prev mamake.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"\" -c mamake.c + done mamake.o generated + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o + done mamake generated + make proto + make proto.o + make proto.c + done proto.c + meta proto.o %.c>%.o proto.c proto + prev proto.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c proto.c + done proto.o generated + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o proto proto.o + done proto generated + make ratz + make ratz.o + make ratz.c + make unix.h implicit + done unix.h dontcare virtual + make alloc.h implicit + done alloc.h dontcare virtual + make unixio.h implicit + done unixio.h dontcare virtual + make ast_std.h implicit + done ast_std.h dontcare virtual + make windows.h implicit + done windows.h dontcare virtual + make io.h implicit + done io.h dontcare virtual + make direct.h implicit + done direct.h dontcare virtual + prev ast.h implicit + done ratz.c + meta ratz.o %.c>%.o ratz.c ratz + prev ratz.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c ratz.c + done ratz.o generated + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o ratz ratz.o + done ratz generated + make release + make release.o + make release.c + prev ast.h implicit + done release.c + meta release.o %.c>%.o release.c release + prev release.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"\" -c release.c + done release.o generated + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o release release.o + done release generated + make mprobe + make mprobe.sh + done mprobe.sh + meta mprobe %.sh>% mprobe.sh mprobe + prev mprobe.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : mprobe contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n mprobe.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 0 in + exec - 0) cp mprobe.sh mprobe + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < mprobe.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - mprobe.sh <<'!' + exec - + exec - ! + exec - } > mprobe + exec - ;; + exec - esac + exec - ;; + exec - *) cat - mprobe.sh > mprobe <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - + exec - ! + exec - ;; + exec - esac + exec - test -w mprobe -a -x mprobe || chmod u+w,+x mprobe + done mprobe generated + make probe + make probe.sh + make C+probe + done C+probe + make make.probe + done make.probe + exec - cat C+probe make.probe > probe.sh + done probe.sh generated + meta probe %.sh>% probe.sh probe + prev probe.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : probe contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n probe.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 0 in + exec - 0) cp probe.sh probe + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < probe.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - probe.sh <<'!' + exec - + exec - ! + exec - } > probe + exec - ;; + exec - esac + exec - ;; + exec - *) cat - probe.sh > probe <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - + exec - ! + exec - ;; + exec - esac + exec - test -w probe -a -x probe || chmod u+w,+x probe + done probe generated + make ${INSTALLROOT}/bin + exec - if test ! -d ${INSTALLROOT}/bin + exec - then mkdir -p ${INSTALLROOT}/bin + exec - fi + done ${INSTALLROOT}/bin generated + make ${INSTALLROOT}/bin/hurl + prev ${INSTALLROOT}/bin + prev hurl + exec - test '' = 'hurl' || ${STDCMP} 2>/dev/null -s hurl ${INSTALLROOT}/bin/hurl || { ${STDMV} ${INSTALLROOT}/bin/hurl ${INSTALLROOT}/bin/hurl.old 2>/dev/null || true; ${STDCP} hurl ${INSTALLROOT}/bin/hurl ;} + done ${INSTALLROOT}/bin/hurl generated + make ${INSTALLROOT}/bin/iffe + prev iffe + exec - test '' = 'iffe' || ${STDCMP} 2>/dev/null -s iffe ${INSTALLROOT}/bin/iffe || { ${STDMV} ${INSTALLROOT}/bin/iffe ${INSTALLROOT}/bin/iffe.old 2>/dev/null || true; ${STDCP} iffe ${INSTALLROOT}/bin/iffe ;} + done ${INSTALLROOT}/bin/iffe generated + make ${INSTALLROOT}/bin/mktest + prev mktest + exec - test '' = 'mktest' || ${STDCMP} 2>/dev/null -s mktest ${INSTALLROOT}/bin/mktest || { ${STDMV} ${INSTALLROOT}/bin/mktest ${INSTALLROOT}/bin/mktest.old 2>/dev/null || true; ${STDCP} mktest ${INSTALLROOT}/bin/mktest ;} + done ${INSTALLROOT}/bin/mktest generated + make ${INSTALLROOT}/bin/package + prev package + exec - test '' = 'package' || ${STDCMP} 2>/dev/null -s package ${INSTALLROOT}/bin/package || { ${STDMV} ${INSTALLROOT}/bin/package ${INSTALLROOT}/bin/package.old 2>/dev/null || true; ${STDCP} package ${INSTALLROOT}/bin/package ;} + done ${INSTALLROOT}/bin/package generated + make ${INSTALLROOT}/bin/regress + prev regress + exec - test '' = 'regress' || ${STDCMP} 2>/dev/null -s regress ${INSTALLROOT}/bin/regress || { ${STDMV} ${INSTALLROOT}/bin/regress ${INSTALLROOT}/bin/regress.old 2>/dev/null || true; ${STDCP} regress ${INSTALLROOT}/bin/regress ;} + done ${INSTALLROOT}/bin/regress generated + make ${INSTALLROOT}/bin/rt + prev rt + exec - test '' = 'rt' || ${STDCMP} 2>/dev/null -s rt ${INSTALLROOT}/bin/rt || { ${STDMV} ${INSTALLROOT}/bin/rt ${INSTALLROOT}/bin/rt.old 2>/dev/null || true; ${STDCP} rt ${INSTALLROOT}/bin/rt ;} + done ${INSTALLROOT}/bin/rt generated + make ${PACKAGEROOT}/bin + exec - if test ! -d ${PACKAGEROOT}/bin + exec - then mkdir -p ${PACKAGEROOT}/bin + exec - fi + done ${PACKAGEROOT}/bin generated + make ${PACKAGEROOT}/bin/execrate + prev ${PACKAGEROOT}/bin + prev execrate + exec - test '' = 'execrate' || ${STDCMP} 2>/dev/null -s execrate ${PACKAGEROOT}/bin/execrate || { ${STDMV} ${PACKAGEROOT}/bin/execrate ${PACKAGEROOT}/bin/execrate.old 2>/dev/null || true; ${STDCP} execrate ${PACKAGEROOT}/bin/execrate ;} + done ${PACKAGEROOT}/bin/execrate generated + make ${PACKAGEROOT}/bin/ignore + prev ignore + exec - test '' = 'ignore' || ${STDCMP} 2>/dev/null -s ignore ${PACKAGEROOT}/bin/ignore || { ${STDMV} ${PACKAGEROOT}/bin/ignore ${PACKAGEROOT}/bin/ignore.old 2>/dev/null || true; ${STDCP} ignore ${PACKAGEROOT}/bin/ignore ;} + done ${PACKAGEROOT}/bin/ignore generated + make ${PACKAGEROOT}/bin/mamprobe + make mamprobe + meta mamprobe %.sh>% mamprobe.sh mamprobe + make mamprobe.sh + done mamprobe.sh + exec - case static,port:$OPTIND:$RANDOM in + exec - ?*:*:*|*::*|*:*:$RANDOM) + exec - ;; + exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null + exec - then if grep '### .*archaic.* ###' >/dev/null + exec - then : mamprobe contains archaic constructs : + exec - else ENV= LC_ALL=C $SHELL -n mamprobe.sh + exec - fi + exec - fi + exec - ;; + exec - esac + exec - case '${mam_cc_SHELLMAGIC}' in + exec - "") case 0 in + exec - 0) cp mamprobe.sh mamprobe + exec - ;; + exec - *) { + exec - i=`(read x; echo $x) < mamprobe.sh` + exec - case $i in + exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; + exec - esac + exec - cat - mamprobe.sh <<'!' + exec - + exec - ! + exec - } > mamprobe + exec - ;; + exec - esac + exec - ;; + exec - *) cat - mamprobe.sh > mamprobe <<'!' + exec - ${mam_cc_SHELLMAGIC} + exec - + exec - ! + exec - ;; + exec - esac + exec - test -w mamprobe -a -x mamprobe || chmod u+w,+x mamprobe + done mamprobe generated + exec - test '' = 'mamprobe' || ${STDCMP} 2>/dev/null -s mamprobe ${PACKAGEROOT}/bin/mamprobe || { ${STDMV} ${PACKAGEROOT}/bin/mamprobe ${PACKAGEROOT}/bin/mamprobe.old 2>/dev/null || true; ${STDCP} mamprobe ${PACKAGEROOT}/bin/mamprobe ;} + done ${PACKAGEROOT}/bin/mamprobe generated + make ${PACKAGEROOT}/bin/package + prev package + exec - test '' = 'package' || ${STDCMP} 2>/dev/null -s package ${PACKAGEROOT}/bin/package || { ${STDMV} ${PACKAGEROOT}/bin/package ${PACKAGEROOT}/bin/package.old 2>/dev/null || true; ${STDCP} package ${PACKAGEROOT}/bin/package ;} + done ${PACKAGEROOT}/bin/package generated + make ${PACKAGEROOT}/bin/silent + prev silent + exec - test '' = 'silent' || ${STDCMP} 2>/dev/null -s silent ${PACKAGEROOT}/bin/silent || { ${STDMV} ${PACKAGEROOT}/bin/silent ${PACKAGEROOT}/bin/silent.old 2>/dev/null || true; ${STDCP} silent ${PACKAGEROOT}/bin/silent ;} + done ${PACKAGEROOT}/bin/silent generated + make ${INSTALLROOT}/bin/crossexec + prev crossexec + exec - test '' = 'crossexec' || ${STDCMP} 2>/dev/null -s crossexec ${INSTALLROOT}/bin/crossexec || { ${STDMV} ${INSTALLROOT}/bin/crossexec ${INSTALLROOT}/bin/crossexec.old 2>/dev/null || true; ${STDCP} crossexec ${INSTALLROOT}/bin/crossexec ;} + done ${INSTALLROOT}/bin/crossexec generated + make ${INSTALLROOT}/bin/ditto + prev ditto + exec - test '' = 'ditto' || ${STDCMP} 2>/dev/null -s ditto ${INSTALLROOT}/bin/ditto || { ${STDMV} ${INSTALLROOT}/bin/ditto ${INSTALLROOT}/bin/ditto.old 2>/dev/null || true; ${STDCP} ditto ${INSTALLROOT}/bin/ditto ;} + done ${INSTALLROOT}/bin/ditto generated + make ${INSTALLROOT}/bin/filter + prev filter + exec - test '' = 'filter' || ${STDCMP} 2>/dev/null -s filter ${INSTALLROOT}/bin/filter || { ${STDMV} ${INSTALLROOT}/bin/filter ${INSTALLROOT}/bin/filter.old 2>/dev/null || true; ${STDCP} filter ${INSTALLROOT}/bin/filter ;} + done ${INSTALLROOT}/bin/filter generated + make ${PACKAGEROOT}/lib/package + exec - if test ! -d ${PACKAGEROOT}/lib/package + exec - then mkdir -p ${PACKAGEROOT}/lib/package + exec - fi + done ${PACKAGEROOT}/lib/package generated + make ${PACKAGEROOT}/lib/package/package.mk + prev ${PACKAGEROOT}/lib/package + make package.mk + done package.mk + exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${PACKAGEROOT}/lib/package/package.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/package.mk ${PACKAGEROOT}/lib/package/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${PACKAGEROOT}/lib/package/package.mk ;} + done ${PACKAGEROOT}/lib/package/package.mk generated + make ${PACKAGEROOT}/lib/package/CONVERT.mk + make CONVERT.mk + done CONVERT.mk + exec - test '' = 'CONVERT.mk' || ${STDCMP} 2>/dev/null -s CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk.old 2>/dev/null || true; ${STDCP} CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk ;} + done ${PACKAGEROOT}/lib/package/CONVERT.mk generated + make ${INSTALLROOT}/lib/make + exec - if test ! -d ${INSTALLROOT}/lib/make + exec - then mkdir -p ${INSTALLROOT}/lib/make + exec - fi + done ${INSTALLROOT}/lib/make generated + make ${INSTALLROOT}/lib/make/package.mk + prev ${INSTALLROOT}/lib/make + prev package.mk + exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${INSTALLROOT}/lib/make/package.mk || { ${STDMV} ${INSTALLROOT}/lib/make/package.mk ${INSTALLROOT}/lib/make/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${INSTALLROOT}/lib/make/package.mk ;} + done ${INSTALLROOT}/lib/make/package.mk generated + make ${INSTALLROOT}/lib/make/PROBE.mk + make PROBE.mk + done PROBE.mk + exec - test '' = 'PROBE.mk' || ${STDCMP} 2>/dev/null -s PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk || { ${STDMV} ${INSTALLROOT}/lib/make/PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk.old 2>/dev/null || true; ${STDCP} PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk ;} + done ${INSTALLROOT}/lib/make/PROBE.mk generated + make ${INSTALLROOT}/lib/make/TEST.mk + make TEST.mk + done TEST.mk + exec - test '' = 'TEST.mk' || ${STDCMP} 2>/dev/null -s TEST.mk ${INSTALLROOT}/lib/make/TEST.mk || { ${STDMV} ${INSTALLROOT}/lib/make/TEST.mk ${INSTALLROOT}/lib/make/TEST.mk.old 2>/dev/null || true; ${STDCP} TEST.mk ${INSTALLROOT}/lib/make/TEST.mk ;} + done ${INSTALLROOT}/lib/make/TEST.mk generated + make ${INSTALLROOT}/lib/make/WWW.mk + make WWW.mk + done WWW.mk + exec - test '' = 'WWW.mk' || ${STDCMP} 2>/dev/null -s WWW.mk ${INSTALLROOT}/lib/make/WWW.mk || { ${STDMV} ${INSTALLROOT}/lib/make/WWW.mk ${INSTALLROOT}/lib/make/WWW.mk.old 2>/dev/null || true; ${STDCP} WWW.mk ${INSTALLROOT}/lib/make/WWW.mk ;} + done ${INSTALLROOT}/lib/make/WWW.mk generated + make ${INSTALLROOT}/lib/make/MSGFUN.mk + make MSGFUN.mk + done MSGFUN.mk + exec - test '' = 'MSGFUN.mk' || ${STDCMP} 2>/dev/null -s MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk.old 2>/dev/null || true; ${STDCP} MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk ;} + done ${INSTALLROOT}/lib/make/MSGFUN.mk generated + make ${INSTALLROOT}/lib/make/MSGKEY.mk + make MSGKEY.mk + done MSGKEY.mk + exec - test '' = 'MSGKEY.mk' || ${STDCMP} 2>/dev/null -s MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk.old 2>/dev/null || true; ${STDCP} MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk ;} + done ${INSTALLROOT}/lib/make/MSGKEY.mk generated + make ${INSTALLROOT}/lib/make/MAPLIB.mk + make MAPLIB.mk + done MAPLIB.mk + exec - test '' = 'MAPLIB.mk' || ${STDCMP} 2>/dev/null -s MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk.old 2>/dev/null || true; ${STDCP} MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk ;} + done ${INSTALLROOT}/lib/make/MAPLIB.mk generated + make ${INSTALLROOT}/bin/mamake + prev mamake + exec - test '' = 'mamake' || ${STDCMP} 2>/dev/null -s mamake ${INSTALLROOT}/bin/mamake || { ${STDMV} ${INSTALLROOT}/bin/mamake ${INSTALLROOT}/bin/mamake.old 2>/dev/null || true; ${STDCP} mamake ${INSTALLROOT}/bin/mamake ;} + done ${INSTALLROOT}/bin/mamake generated + make ${INSTALLROOT}/bin/proto + prev proto + exec - test '' = 'proto' || ${STDCMP} 2>/dev/null -s proto ${INSTALLROOT}/bin/proto || { ${STDMV} ${INSTALLROOT}/bin/proto ${INSTALLROOT}/bin/proto.old 2>/dev/null || true; ${STDCP} proto ${INSTALLROOT}/bin/proto ;} + done ${INSTALLROOT}/bin/proto generated + make ${INSTALLROOT}/bin/ratz + prev ratz + exec - test '' = 'ratz' || ${STDCMP} 2>/dev/null -s ratz ${INSTALLROOT}/bin/ratz || { ${STDMV} ${INSTALLROOT}/bin/ratz ${INSTALLROOT}/bin/ratz.old 2>/dev/null || true; ${STDCP} ratz ${INSTALLROOT}/bin/ratz ;} + done ${INSTALLROOT}/bin/ratz generated + make ${INSTALLROOT}/bin/release + prev release + exec - test '' = 'release' || ${STDCMP} 2>/dev/null -s release ${INSTALLROOT}/bin/release || { ${STDMV} ${INSTALLROOT}/bin/release ${INSTALLROOT}/bin/release.old 2>/dev/null || true; ${STDCP} release ${INSTALLROOT}/bin/release ;} + done ${INSTALLROOT}/bin/release generated + make ${INSTALLROOT}/bin/mkdir + make mkdir.sh + done mkdir.sh + exec - if test ! -x ${INSTALLROOT}/bin/mkdir -a -x /bin/mkdir + exec - then mkdir -p 2>/dev/null || : + exec - if test -d ./-p + exec - then rmdir ./-p + exec - cp mkdir.sh ${INSTALLROOT}/bin/mkdir + exec - chmod +x ${INSTALLROOT}/bin/mkdir + exec - fi + exec - fi + done ${INSTALLROOT}/bin/mkdir generated + make ${INSTALLROOT}/bin/.paths + exec - if test ! -f ${INSTALLROOT}/bin/.paths -o -w ${INSTALLROOT}/bin/.paths + exec - then N=' + exec - ' + exec - H=${mam_cc_HOSTTYPE} + exec - P="" + exec - b= f= h= l= n= p= u= B= L= + exec - set : $P + exec - while : + exec - do while : + exec - do case $1 in + exec - '') break 2 ;; + exec - :) shift; break ;; + exec - esac + exec - shift + exec - done + exec - case $# in + exec - 0|1) break ;; + exec - esac + exec - case $L in + exec - ?*) L="$L|" ;; + exec - esac + exec - L="$L$2=*" + exec - B=$1 + exec - done + exec - if test -f ${INSTALLROOT}/bin/.paths + exec - then while read x + exec - do case $x in + exec - *\$\(\"*) break + exec - ;; + exec - '#'?*) case $h in + exec - '') h=$x ;; + exec - esac + exec - ;; + exec - $L) l=$x + exec - ;; + exec - *BUILTIN_LIB=*) b=$x + exec - ;; + exec - *FPATH=*) f=$x + exec - ;; + exec - *PLUGIN_LIB=*) p=$x + exec - ;; + exec - *) case $u in + exec - ?*) u=$u$N ;; + exec - esac + exec - u=$u$x + exec - ;; + exec - esac + exec - done < ${INSTALLROOT}/bin/.paths + exec - fi + exec - ifs=$IFS + exec - m= + exec - case $p in + exec - ?*) b= + exec - ;; + exec - esac + exec - case $b in + exec - ?*) IFS='=' + exec - set $b + exec - IFS=$ifs + exec - shift + exec - p="PLUGIN_LIB=$*" + exec - case $b in + exec - [Nn][Oo]*) p=no$p ;; + exec - esac + exec - m=1 + exec - ;; + exec - esac + exec - case $f in + exec - '') f="FPATH=../fun" + exec - m=1 + exec - ;; + exec - esac + exec - case $h in + exec - '') h='# use { no NO } prefix to permanently disable #' ;; + exec - esac + exec - case $l in + exec - '') set x x : $P + exec - l= + exec - while : + exec - do while : + exec - do case $# in + exec - 0) break ;; + exec - esac + exec - x=$1 + exec - shift + exec - case $x in + exec - :) break ;; + exec - esac + exec - done + exec - case $# in + exec - 0|1) break + exec - ;; + exec - 2) l=$2 + exec - ;; + exec - *) case "$H" in + exec - $3) l=$2; break ;; + exec - esac + exec - ;; + exec - esac + exec - done + exec - case $l in + exec - '') if test -x /lib/dld.sl + exec - then l=SHLIB_PATH + exec - elif test -x /usr/lib/dyld + exec - then l=DYLD_LIBRARY_PATH + exec - else case "$H" in + exec - ibm.*|mvs.*) + exec - l=LIBPATH + exec - ;; + exec - sgi.mips3) + exec - l=LD_LIBRARYN32_PATH + exec - ;; + exec - sgi.mips4) + exec - l=LD_LIBRARYN64_PATH + exec - ;; + exec - *) l=LD_LIBRARY_PATH + exec - ;; + exec - esac + exec - fi + exec - ;; + exec - esac + exec - case $l in + exec - ?*) case $B in + exec - '') B=lib ;; + exec - esac + exec - l="$l=../$B" + exec - m=1 + exec - ;; + exec - esac + exec - ;; + exec - esac + exec - case $p in + exec - '') p="PLUGIN_LIB=cmd" + exec - case '' in + exec - '') p=no$p ;; + exec - esac + exec - m=1 + exec - ;; + exec - esac + exec - case $m in + exec - 1) case $u in + exec - ?*) u=$N$u ;; + exec - esac + exec - echo "$h$N$p$N$f$N$l$u" > ${INSTALLROOT}/bin/.paths + exec - ;; + exec - esac + exec - fi + done ${INSTALLROOT}/bin/.paths generated + make ${INSTALLROOT}/lib/probe/C + exec - if test ! -d ${INSTALLROOT}/lib/probe/C + exec - then mkdir -p ${INSTALLROOT}/lib/probe/C + exec - fi + done ${INSTALLROOT}/lib/probe/C generated + make ${INSTALLROOT}/lib/probe/C/probe + prev ${INSTALLROOT}/lib/probe/C + prev C+probe + exec - test '' = 'C+probe' || ${STDCMP} 2>/dev/null -s C+probe ${INSTALLROOT}/lib/probe/C/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/probe ${INSTALLROOT}/lib/probe/C/probe.old 2>/dev/null || true; ${STDCP} C+probe ${INSTALLROOT}/lib/probe/C/probe ;} + done ${INSTALLROOT}/lib/probe/C/probe generated + make ${INSTALLROOT}/lib/probe/C/make + exec - if test ! -d ${INSTALLROOT}/lib/probe/C/make + exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/make + exec - fi + done ${INSTALLROOT}/lib/probe/C/make generated + prev ${INSTALLROOT}/lib/probe/C/make + make ${INSTALLROOT}/lib/probe/C/pp + exec - if test ! -d ${INSTALLROOT}/lib/probe/C/pp + exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/pp + exec - fi + done ${INSTALLROOT}/lib/probe/C/pp generated + prev ${INSTALLROOT}/lib/probe/C/pp + make ${INSTALLROOT}/lib/probe/C/mam + exec - if test ! -d ${INSTALLROOT}/lib/probe/C/mam + exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/mam + exec - fi + done ${INSTALLROOT}/lib/probe/C/mam generated + make ${INSTALLROOT}/lib/probe/C/mam/probe + prev ${INSTALLROOT}/lib/probe/C/mam + prev mprobe + exec - test '' = 'mprobe' || ${STDCMP} 2>/dev/null -s mprobe ${INSTALLROOT}/lib/probe/C/mam/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/mam/probe ${INSTALLROOT}/lib/probe/C/mam/probe.old 2>/dev/null || true; ${STDCP} mprobe ${INSTALLROOT}/lib/probe/C/mam/probe ;} + done ${INSTALLROOT}/lib/probe/C/mam/probe generated + make ${INSTALLROOT}/lib/probe/C/mam/mprobe + prev mprobe + exec - test '' = 'mprobe' || ${STDCMP} 2>/dev/null -s mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/mam/mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe.old 2>/dev/null || true; ${STDCP} mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe ;} + done ${INSTALLROOT}/lib/probe/C/mam/mprobe generated + make ${INSTALLROOT}/lib/probe/C/make/probe + prev probe + exec - test '' = 'probe' || ${STDCMP} 2>/dev/null -s probe ${INSTALLROOT}/lib/probe/C/make/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/make/probe ${INSTALLROOT}/lib/probe/C/make/probe.old 2>/dev/null || true; ${STDCP} probe ${INSTALLROOT}/lib/probe/C/make/probe ;} + done ${INSTALLROOT}/lib/probe/C/make/probe generated + make ${INSTALLROOT}/lib/probe/C/make/probe.ini + make probe.ini + make probe.win32 + done probe.win32 + exec - t=${mam_cc_HOSTTYPE} + exec - ifs=$IFS + exec - IFS=. + exec - set x $t + exec - IFS=$ifs + exec - t=$2 + exec - set x probe.win32 + exec - while : + exec - do shift + exec - case $# in + exec - 0) break ;; + exec - esac + exec - case $1 in + exec - *probe.$t) + exec - break + exec - esac + exec - done + exec - case $1 in + exec - ?*) cmp -s $1 probe.ini || cp $1 probe.ini ;; + exec - *) : > probe.ini + exec - esac + done probe.ini generated + exec - test '' = 'probe.ini' || ${STDCMP} 2>/dev/null -s probe.ini ${INSTALLROOT}/lib/probe/C/make/probe.ini || { ${STDMV} ${INSTALLROOT}/lib/probe/C/make/probe.ini ${INSTALLROOT}/lib/probe/C/make/probe.ini.old 2>/dev/null || true; ${STDCP} probe.ini ${INSTALLROOT}/lib/probe/C/make/probe.ini ;} + done ${INSTALLROOT}/lib/probe/C/make/probe.ini generated + make ${INSTALLROOT}/include/ast + exec - if test ! -d ${INSTALLROOT}/include/ast + exec - then mkdir -p ${INSTALLROOT}/include/ast + exec - fi + done ${INSTALLROOT}/include/ast generated + make ${INSTALLROOT}/include/ast/prototyped.h + prev ${INSTALLROOT}/include/ast + make prototyped.h + prev ${INSTALLROOT}/bin/proto + exec - proto -f /dev/null > h.${COTEMP}.h + exec - if cmp 2>/dev/null -s h.${COTEMP}.h prototyped.h + exec - then rm -f h.${COTEMP}.h + exec - else mv h.${COTEMP}.h prototyped.h + exec - fi + done prototyped.h generated + exec - test '' = 'prototyped.h' || ${STDCMP} 2>/dev/null -s prototyped.h ${INSTALLROOT}/include/ast/prototyped.h || { ${STDMV} ${INSTALLROOT}/include/ast/prototyped.h ${INSTALLROOT}/include/ast/prototyped.h.old 2>/dev/null || true; ${STDCP} prototyped.h ${INSTALLROOT}/include/ast/prototyped.h ;} + done ${INSTALLROOT}/include/ast/prototyped.h generated + make ${INSTALLROOT}/lib/lib + exec - if test ! -d ${INSTALLROOT}/lib/lib + exec - then mkdir -p ${INSTALLROOT}/lib/lib + exec - fi + done ${INSTALLROOT}/lib/lib generated + make ${INSTALLROOT}/lib/lib/dl + prev ${INSTALLROOT}/lib/lib + make dl.req + make dl.c + done dl.c + exec - set - + exec - r='-' + exec - for i in dl.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in dl - + exec - do case $p in + exec - -) if ${CC} -o dl.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o dl.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > dl.req + exec - rm -f dl.exe dl + done dl.req generated + exec - test '' = 'dl.req' || ${STDCMP} 2>/dev/null -s dl.req ${INSTALLROOT}/lib/lib/dl || { ${STDMV} ${INSTALLROOT}/lib/lib/dl ${INSTALLROOT}/lib/lib/dl.old 2>/dev/null || true; ${STDCP} dl.req ${INSTALLROOT}/lib/lib/dl ;} + done ${INSTALLROOT}/lib/lib/dl generated + make ${INSTALLROOT}/lib/lib/iconv + make iconv.req + make iconv.c + done iconv.c + exec - set - + exec - r='-' + exec - for i in iconv.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in iconv - + exec - do case $p in + exec - -) if ${CC} -o iconv.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o iconv.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > iconv.req + exec - rm -f iconv.exe iconv + done iconv.req generated + exec - test '' = 'iconv.req' || ${STDCMP} 2>/dev/null -s iconv.req ${INSTALLROOT}/lib/lib/iconv || { ${STDMV} ${INSTALLROOT}/lib/lib/iconv ${INSTALLROOT}/lib/lib/iconv.old 2>/dev/null || true; ${STDCP} iconv.req ${INSTALLROOT}/lib/lib/iconv ;} + done ${INSTALLROOT}/lib/lib/iconv generated + make ${INSTALLROOT}/lib/lib/w + make w.req + make w.c + done w.c + make w2.c + done w2.c + exec - set - + exec - r='-' + exec - for i in w.c w2.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in w - + exec - do case $p in + exec - -) if ${CC} -o w.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o w.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > w.req + exec - rm -f w.exe w w2 + done w.req generated + exec - test '' = 'w.req' || ${STDCMP} 2>/dev/null -s w.req ${INSTALLROOT}/lib/lib/w || { ${STDMV} ${INSTALLROOT}/lib/lib/w ${INSTALLROOT}/lib/lib/w.old 2>/dev/null || true; ${STDCP} w.req ${INSTALLROOT}/lib/lib/w ;} + done ${INSTALLROOT}/lib/lib/w generated + make ${INSTALLROOT}/lib/lib/intl + make intl.req + make intl.c + done intl.c + exec - set - + exec - r='-' + exec - for i in intl.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in intl - + exec - do case $p in + exec - -) if ${CC} -o intl.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o intl.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > intl.req + exec - rm -f intl.exe intl + done intl.req generated + exec - test '' = 'intl.req' || ${STDCMP} 2>/dev/null -s intl.req ${INSTALLROOT}/lib/lib/intl || { ${STDMV} ${INSTALLROOT}/lib/lib/intl ${INSTALLROOT}/lib/lib/intl.old 2>/dev/null || true; ${STDCP} intl.req ${INSTALLROOT}/lib/lib/intl ;} + done ${INSTALLROOT}/lib/lib/intl generated + make ${INSTALLROOT}/lib/lib/m + make m.req + make m.c + done m.c + make m2.c + done m2.c + make m3.c + done m3.c + make m4.c + done m4.c + make m5.c + done m5.c + make m6.c + done m6.c + exec - set - + exec - r='-' + exec - for i in m.c m2.c m3.c m4.c m5.c m6.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in m - + exec - do case $p in + exec - -) if ${CC} -o m.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o m.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > m.req + exec - rm -f m.exe m m2 m3 m4 m5 m6 + done m.req generated + exec - test '' = 'm.req' || ${STDCMP} 2>/dev/null -s m.req ${INSTALLROOT}/lib/lib/m || { ${STDMV} ${INSTALLROOT}/lib/lib/m ${INSTALLROOT}/lib/lib/m.old 2>/dev/null || true; ${STDCP} m.req ${INSTALLROOT}/lib/lib/m ;} + done ${INSTALLROOT}/lib/lib/m generated + make ${INSTALLROOT}/lib/lib/nsl + make nsl.req + make nsl.c + done nsl.c + exec - set - + exec - r='-' + exec - for i in nsl.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in nsl - + exec - do case $p in + exec - -) if ${CC} -o nsl.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o nsl.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > nsl.req + exec - rm -f nsl.exe nsl + done nsl.req generated + exec - test '' = 'nsl.req' || ${STDCMP} 2>/dev/null -s nsl.req ${INSTALLROOT}/lib/lib/nsl || { ${STDMV} ${INSTALLROOT}/lib/lib/nsl ${INSTALLROOT}/lib/lib/nsl.old 2>/dev/null || true; ${STDCP} nsl.req ${INSTALLROOT}/lib/lib/nsl ;} + done ${INSTALLROOT}/lib/lib/nsl generated + make ${INSTALLROOT}/lib/lib/socket + make socket.req + make socket.c + done socket.c + prev nsl.c + exec - set - + exec - r='-' + exec - for i in socket.c nsl.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in socket - + exec - do case $p in + exec - -) if ${CC} -o socket.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o socket.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > socket.req + exec - rm -f socket.exe socket nsl + done socket.req generated + exec - test '' = 'socket.req' || ${STDCMP} 2>/dev/null -s socket.req ${INSTALLROOT}/lib/lib/socket || { ${STDMV} ${INSTALLROOT}/lib/lib/socket ${INSTALLROOT}/lib/lib/socket.old 2>/dev/null || true; ${STDCP} socket.req ${INSTALLROOT}/lib/lib/socket ;} + done ${INSTALLROOT}/lib/lib/socket generated + make ${INSTALLROOT}/lib/lib/dbm + make dbm.req + make db.c + done db.c + make gdbm.c + done gdbm.c + make gdbm1.c + make gdbm-ndbm.h implicit + done gdbm-ndbm.h dontcare virtual + done gdbm1.c + make gdbm2.c + make ndbm.h implicit + done ndbm.h dontcare virtual + done gdbm2.c + exec - set - + exec - r='-' + exec - for i in db.c gdbm.c gdbm1.c gdbm2.c + exec - do if ${CC} -c $i > /dev/null + exec - then g= + exec - for p in db - gdbm_compat - gdbm - ndbm - dbm - + exec - do case $p in + exec - -) if ${CC} -o dbm.exe $i $g > /dev/null 2>&1 + exec - then ${CC} -o dbm.exe $i > /dev/null 2>&1 || { + exec - r="$g" + exec - break 2 + exec - } + exec - fi + exec - g= + exec - ;; + exec - *) g="$g -l$p" + exec - ;; + exec - esac + exec - done + exec - fi + exec - done 2>/dev/null + exec - echo " $r" > dbm.req + exec - rm -f dbm.exe db gdbm gdbm1 gdbm2 + done dbm.req generated + exec - test '' = 'dbm.req' || ${STDCMP} 2>/dev/null -s dbm.req ${INSTALLROOT}/lib/lib/dbm || { ${STDMV} ${INSTALLROOT}/lib/lib/dbm ${INSTALLROOT}/lib/lib/dbm.old 2>/dev/null || true; ${STDCP} dbm.req ${INSTALLROOT}/lib/lib/dbm ;} + done ${INSTALLROOT}/lib/lib/dbm generated +done install virtual +make test + make test.iffe + prev iffe + make iffe.tst + done iffe.tst + exec - regress iffe.tst iffe + done test.iffe virtual + make test.mamake + prev mamake + make mamake.tst + meta mamake.tst %.rt>%.tst mamake.rt mamake + make mamake.rt + done mamake.rt + exec - if [[ "1" || "mamake.rt" -nt "mamake.tst" ]] + exec - then mktest --style=regress mamake.rt > mamake.tst + exec - fi + done mamake.tst generated + exec - regress mamake.tst mamake + done test.mamake virtual +done test dontcare virtual diff --git a/src/cmd/INIT/PROBE.mk b/src/cmd/INIT/PROBE.mk new file mode 100644 index 000000000..9a8553f2d --- /dev/null +++ b/src/cmd/INIT/PROBE.mk @@ -0,0 +1,13 @@ +/* + * @(#)probe (AT&T Bell Laboratories) 11/11/91 + * + * :PROBE: *.probe *.sh * + * + * common probe script installation + * generates probe.sh and probe in . + */ + +":PROBE:" : .MAKE .OPERATOR + probe.sh : $(LIBDIR)/probe/$(<:O=1)/probe $(>:N=*.(probe|sh)) + cat $(*) > $(<) + $(LIBDIR)/probe/$(<:O=1)/$(<:O=2) :INSTALLDIR: probe $(>:N!=*.(probe|sh)) diff --git a/src/cmd/INIT/RELEASE b/src/cmd/INIT/RELEASE new file mode 100644 index 000000000..f877be003 --- /dev/null +++ b/src/cmd/INIT/RELEASE @@ -0,0 +1,934 @@ +12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output +12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo() +12-06-20 package.sh: use $KSH for rt in "results test" +12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB +12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB +12-06-13 package.sh: handle admin.db column output +12-06-08 iffe.sh: fix 12-06-06 typo +12-06-06 iffe.sh: check for -l* in reverse and accumulative order (e.g., for -last & -lm) +12-06-04 package.sh: always check $INSTALLROOT/lib/package/profile +12-05-31 Makefile: ID=ast; $(INSTALLROOT)/prototyped.h => $(INSTALLROOT)/$(ID)/prototyped.h +12-05-28 iffe.sh: api foo YYYYMMDD => FOOAPI(rel) test macro +12-05-24 package.sh: change admin.db comment => owner attributes +12-04-25 ratz.c: add sear -k option to keep installation tmp dir on exit +12-04-17 package.sh: skip sh version logic for ``use'' +12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features +12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE +12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness +12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list +12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH +12-02-29 package.sh: fix ksh vs -lcmd compatibility checks +12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics +12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static +12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE +12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts +12-02-07 package.sh: add { clean clobber } actions +12-02-02 regress.sh: fix ulimit -c defaults for --nokeep +12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison +12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib +12-01-21 Makefile: :PACKAGE: license=ast -- oops +12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err +12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs +11-12-13 iffe.sh: add /**/ test code comment to disable default #include +11-11-11 C+probe: test for .so before .sl +11-10-26 package.sh: don't forget about *.pkg for admin update +11-10-18 cc.*-icc: update and add more +11-10-11 package.sh: handle package make|view when no source installed +11-09-11 package.sh: count admin '*** termination code' errors +11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps +11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...'' +11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh +11-08-11 iffe.sh: handle ancient sort that doesn't have -k +11-06-01 make.probe: add more /lib64 logic +11-05-01 package.sh: fix admin ditto to sync LICENSES too +11-03-25 package.sh: initialize { $SED $TR } before first use! +11-03-21 package.sh: fix vpath probes +11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.* +11-02-24 package.sh: change curl usage to "curl -L ..." +11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archaic.*### +11-02-02 Makefile: add :MAPLIB: check for ancient -lw +11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64 +11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ] +11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks +11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream +11-01-07 iffe.sh: check debug==3 for is_hdr() failure +10-11-22 ditto.sh: fix timing problem between |& and exec &p +10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path +10-10-10 package.sh: list main env vars at start of make action +10-10-10 ratz.c: tweak windows delays +10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC +10-09-01 package.sh: fix ratz from source logic +10-08-25 package.mk: consolidate license file search in .package.licenses. +10-08-22 ratz.c: run sear bootstrap command detached +10-08-20 C+probe: version_stamp only if version_flags works +10-08-17 package.sh: unset makerules *DIR variables in env +10-08-15 package.sh: "make" action now lists some env values +10-08-11 mktest.sh: add "DO command ..." +10-07-27 rt.sh: handle "rt X=Y ..." +10-06-29 ratz.c: non-option sear args passed to sear_exec() +10-06-25 iffe.sh: "api" op changed to not do "map-libc" type mappings +10-06-25 package.sh: "force admin ditto" => no ditto --update option +10-06-22 C+probe: handle cc that require .[ci] input for version info +10-06-21 ditto.sh: change default remote access to ssh (about time) +10-06-12 regress.sh: DIAGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all +10-06-09 package.sh: add AT&T to usable nmake check +10-06-06 iffe.sh,iffe.tst: add { api ver } ops +10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info +10-04-15 iffe.sh: don't forget candidate headers for hdr|sys! +10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1) +10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH +10-02-11 package.sh: fix package admin make report error count +10-02-02 package.sh: fix write binary bug that did scp on local fs +10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst +10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check +10-01-01 make.probe: handle ['"] in CC.VERSION.STRING +09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS +09-11-30 mktest.sh: change RESET to STATE.RESET to make it global +09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs } +09-11-11 package.sh: re-order and combine cc checks +09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG +09-10-21 iffe.sh,Makefile: test -e is not in ksh88! +09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi) +09-10-06 package.sh: stub in ar intercept checks -- not used yet +09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!! +09-09-24 regress.sh: fix UMASK logic to create test support files before umask +09-08-28 release.c: change docs to mention stdin if no file operands +09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space +09-08-20 make.probe: add CC.SHARED.NAME +09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO } +09-08-11 package.sh: filter lines containing : for package results +09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany) +09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options +09-06-24 package.sh: fix admin.db output formatting +09-05-05 package.sh: export dll hackery environment vars +09-05-05 package.sh: handle non-identifier hostnames +09-05-05 mamake.c: pass undefined ${...} identifiers to the shell +09-05-05 mamake.rt: add macro expansion regression tests +09-05-01 iffe.sh: fix output initialization *again* +09-04-28 package.sh: handle admin.db contact field $9 +09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops +09-03-31 regress.sh: EXPORT before test => global ENVIRON[] +09-03-26 package.sh: test fail pattern is 'fail[es]' +09-03-26 UNIT - ... appends (options) to command line +09-03-19 TEST.mk: x.tst => x only if x is command target +09-03-15 regress.sh: add ${MAIN} for base name of main unit +09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir +09-03-03 regress.sh: allow command line unit to override UNIT +09-03-03 mktest.sh: handle IO == $'\n' +09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs +09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."! +09-01-27 package.sh: add isascii() to use ratz instead of tar +09-01-20 hurl.sh: add --size=bytes option +09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding +09-01-03 regress.sh: fix UNIT to allow command line override +09-01-03 mktest.sh: handle TWD +08-12-24 package.sh: fix cross-compile HOSTTYPE logic +08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 } +08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!! +08-09-30 rt.sh: fix ksh93 regression test signal count +08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input +08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo +08-09-20 make.probe: handle another /usr/bin/file shared lib description +08-09-20 regress.sh: add --pipefail for SET pipe-input ... +08-09-17 Makefile: add gdbm1.c for +08-09-10 make.probe: add CC.NOPROTECT +08-08-08 mktest.sh: add --width=width +08-08-05 dbm.req: favor sleepycat ndbm compatibility +08-08-04 C+probe: fix stdlib initialization logic +08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo +08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh +08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2 +08-06-11 regress.sh: fix bug that skipped the last test +08-05-20 regress.sh: add --local to put *.tmp dir in local fs +08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI +08-05-01 package.sh: package test => ulimit -c 0 +08-04-28 regress.sh: fix EXPORT quoting +08-04-28 regress.sh: fix UNIT set check args too +08-04-24 rt.sh: exit code > 256 => signal termination +08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround) +08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST +08-03-28 C+probe: add C++ #include (no extension) dir probes +08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally +08-02-28 make.probe: fix probe_warn to include ld! +08-02-02 make.probe: add CC.RUNPATH to match default -L order +08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH +08-01-31 iffe.sh: tweak ancient /bin/sh workarounds +08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace +08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es) +08-01-23 package.sh: fix checksum doc typo +08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list +07-12-14 iffe.sh: add set nooptimize +07-12-03 package.sh: add LC_ALL=C +07-11-27 package.sh: fix overaggressive *.md5 cleanup +07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal +07-11-05 package.sh: fix write op error count pattern +07-11-05 package.mk: fix $(~req) .ver binding +07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] +07-08-01 package.sh: handle 'package read lcl|tgz' +07-05-08 regress.sh: execute basename instead of absolute path for short $0 +07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer +07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh +07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...} +07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG +07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe +07-03-28 package.sh: fix binary tgz architecture type duplication +07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst +07-03-28 iffe.sh: add -F header to mac test +07-03-23 make.probe: handle file(1) that returns 'archive' for .so +07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF +07-03-11 package.sh: add nocopyright and tst => nocopyright +07-03-11 package.mk: add copyright=0 +07-03-08 C+probe: restore IFS after probe.ini +07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR} +07-01-05 package.sh: fix "admin write binary" logic +07-01-01 iffe.sh: add "cmd" --verbose trace +07-01-01 iffe.sh: sort => LC_ALL=C sort +07-01-01 C+probe: LC_ALL=C +06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local! +06-11-23 package.sh: *.md5 are not tarballs -- doh +06-11-23 iffe.sh: add -F, --features=feature-test-header +06-11-11 make.probe: favor lib64 over lib for hosttype==*64 +06-10-31 make.probe: add "-ignore-source-dir -iquote" test +06-10-31 iffe.sh: add status{...} code block +06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?) +06-10-11 package.sh: handle already gunzip'd *.tgz +06-10-06 iffe.sh: add reference for header content tests +06-09-27 regress.sh: fix UMASK to do DO too (duh) +06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics) +06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together +06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too +06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io +06-09-05 C+probe: add { probe_version version_stamp version_string } +06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING] +06-08-27 regress.sh,mktest.sh: add UMASK +06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE +06-08-25 mktest.sh: add IGNORESPACE +06-08-24 mktest.sh: handle \000 in data +06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR +06-08-16 package.sh: fix 'install flat' logic +06-08-11 rt.sh: handle style=shell %K date format +06-07-17 ratz.c: fix __MVS__ FAR definition +06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe +06-07-17 package.sh: differentiate urls vs. assignments +06-06-27 rt.sh: add --failed, --heading +06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0' +06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance +06-06-25 mktest.sh: implement PROG +06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk +06-05-06 package.sh: add PACKAGE_admin_tail_timeout +06-05-22 ratz.c: upgrade to zlib-1.2.3 +06-05-09 package.sh: fix admin.db docs +06-03-11 package.sh: fix `package use - command ...' +06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.` +06-02-14 package.sh: "results failed test" == "results test failed" + cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0 + cc.linux.ia64-icc: add for intel cc +06-02-02 package.sh: freebsd stuck with os version for all arch +06-02-01 package.mk: fix locale logic (tw -d requires dir arg) +06-01-31 package.sh: require $CC only for make|test +06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd + package.sh: add more pdksh => /bin/sh checks +06-01-26 package.sh: wget --http-pass => --http-password + package.sh: fix wget error logic + hurl.sh: wget --http-pass => --http-password +06-01-11 package.mk: pass package.license.class to make --mam too + package.mk: variants=pattern => --variants=pattern + package.sh: darwin rel<=7 => darwin7.ppc + package.sh: freebsd rel<=4 => freebsd4 + package.sh: freebsd rel<=5 => freebsd5 +05-12-07 iffe.sh: don't emit if | (XXX) +05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0 +05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ] +05-09-21 mktest.sh: fix --style=shell compare to ignore \r +05-09-12 TEST.mk: all --force to force %.rt regeneration +05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst +05-08-25 mktest.sh: add + TEST.mk: add %.rt=>%.tst for mktest +05-08-18 package.sh: 'package host cpu' now checks $NPROC first +05-07-17 iffe.sh: add { define extern include print } ops + iffe.sh: accept output{...}end output on success only -- doh +05-07-01 package.sh: add TARPROBE for tar B flag probe +05-06-24 package.sh: fix binary read chmod via *.sum +05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types +05-06-01 make.probe: verify that cc_pic works for hosted cc + cc.lynxos.ppc: make -mshared the default + package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation +05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT +05-05-24 iffe.sh: really fix grouping logic -- with tests this time + package.sh: pipe/socket configuration mismatches => use /bin/sh +05-04-28 TEST.mk: add $(TESTS) +05-04-19 package.sh: package results test uses rt if possible + iffe.sh: fix 'op var - ... - ...' grouping logic +05-04-15 rt.sh: handle autom4ate style +05-04-11 regress.sh: fix unit name when command line unit also specified + rt.sh: handle all ast package test output formats + package.sh: fix make docs for options passed to underlying make +05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime + regress.sh: add "TITLE name" to change TEST output title +05-04-01 rt.sh: add pretty make test + regress.sh wrapper +05-03-29 package.sh: test -e path => test -f path -o -d path +05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh +05-03-19 mamake.c: command line name=var also defines name.FORCE=var +05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd + package.sh: old make.out saved in circular make.out.[1-9] + mamake.c: sync with nmake :W=O: +05-03-01 package.sh: fix flat hierarchy initialization + package.sh: admin action now properly resets sibling remote logs + package.mk: relax unknown/unwritten package messages to warnings + package.sh: handle space in command line name=value + make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe +05-02-24 package.sh: hosttype *.powerpc => *.ppc + cc.lynxos.ppc,ldd.lynxos.ppc: add +05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug +05-02-20 probe.win32: handle /platformsdk mount +05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir +05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 - +05-02-14 package.sh: handle multiple architectures per host in admin.db + Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides + package.sh: normalize trailing [-_]bits in host type + iffe.sh: some ksh-compatible shells don't do *(pattern) +05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack + cc.lynxos.i386: -dynamic instead of -static default +05-02-10 package.sh: cyg usr/doc => usr/share/doc +05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08 + iffe.sh: work around old bash 0<... redirection bug +05-02-06 package.mk: source.tgz: update generated files only when they change +05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow +05-01-11 package.sh: update setup docs to include authorize+password + package.mk: fix .source.cyg final directory edit + package.mk: notice=1 for conspicuous empty NOTICE file + WWW.mk: fix *-index.html installation + filter.sh: retain input file suffix in tmp copy + mamexec.c: fix non-contiguous "exec" bug that skipped lines + iffe.sh: fix candidate lib test to try grouping subsequent libs + iffe.sh: fix child process stdin hijack that skipped input lines + iffe.sh: --shell=osh to force read -r compatibility command + iffe.sh: chop iffe input leading space before # for KnR compatibility +05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes + mamake.c: fix makefile scan to ignore lib*.[hH] + iffe.sh: immunize function/symbol tests from aggressive -O +04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator +04-12-21 ratz.c: make sure tmp dir is writable -- doh +04-12-08 iffe.sh: fix dat test for aggressive -O +04-12-01 iffe.sh: add `include file' to pull in #define's for `exp' +04-11-11 package.sh: default MAKESKIP is "*[-.]*" +04-10-22 ratz.c: change docs to note zlib license + mamake.c: handle --debug-symbols and --strip-symbols + package.sh: make (debug|strip)=1 => --(debug|strip)-symbols + package.mk: add :LICENSE: => package.license.class + mamake.c: fix recursive order logic +04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs +04-10-11 package.sh: add 'authorize name' and 'password password' +04-10-01 iffe.sh: double check $static link with ! $static + Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths + make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL} + package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths +04-09-21 package.mk: $(init)$(name) is now an implicit prereq +04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok +04-09-01 package.mk,package.sh: rename *.txt => *.README + package.mk: add the runtime package type (no *.[ah]) + iffe.sh: fix key test reports +04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] } +04-08-11 package.mk: handle HOSTTYPE for solaris > 9 + package.sh: add `checkaout proto' for { make view } + package.sh: check for { md5sum md5 } + iffe.sh: add {if|elif|else|endif} test ... + iffe.sh: add 'exp - expression' and '( expression )' + iffe.sh: add 'name = test ...' user defined macros + iffe.sh: add '! test ...' negation + TEST.mk: add implied { .c .sh } generated prereq + cc.darwin.ppc: handle 10.3 -dylib mess +04-08-01 package.mk: let include handle nested requirements -- duh +04-07-31 package.sh: attempt a second ping before admin assumes host down +04-07-26 package.sh: fix hp.ia64 HOSTTYPE +04-07-23 probe.win32: generalize #include dir order search +04-07-17 regress.sh: add INPUT -x for chmod +x +04-07-01 regress.sh: TMP => TWD +04-06-29 regress.sh: put COMMAND in $TWD too +04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs + TEST.mk: add :TEST: -- to disable .c .sh search +04-06-18 TEST.mk: add .SCAN.tst +04-06-17 regress.sh: TEST returns true if active, false otherwise + regress.sh: add CD to change test pwd from $TWD +04-06-16 regress.sh: add TWD for ./unit.tmp override + regress.sh: DO now flushes previous test + regress.sh: INPUT and OUTPUT handle -f for printf instead of print +04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH + package.sh: skip nmake if older than 2000-10-31 +04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate +04-05-11 package.sh: package verbose update lists closure for package setup + package.sh: add src/lib/libardir to nmake proto bootstrap + regress.sh: probe for rm -u vs. chmod -R u+rwx +04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH +04-04-15 make.probe: check probe_libdir false positives + package.sh: add lib/package/*.lic src package subdirs + package.mk: add mamfile=0 to inhibit Mamfile generation + iffe.sh: config name_DECLARED => HAVE_name_DECL + iffe.sh: fix mac to handle default value +04-04-11 iffe.sh: normalize sed [\\\\/] quoting +04-04-04 package.mk: only checksum generated tarballs + mamprobe.sh: add STDCHMOD +04-04-01 C+probe: set export LANG=C for uniform error messages + make.probe: another CC.STDLIB tweak + package.sh: fix regress core dump pattern, expand [a-z] match ranges +04-03-31 Makefile: add intl :MAPLIB: test + make.probe: fix CC.STDLIB search; drop CC.* path duplicates +04-03-28 iffe.sh: drop unused exec $stdin<&0 dup +04-03-25 Makefile: add iconv :MAPLIB: + package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override +04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: update base change on md5 sum instead of size + iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh +04-03-22 probe.win32: ncc => nld +04-03-19 CONVERT.mk: change the instructions and old source dir default + package.mk: fix recurse=list check + package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: fix update base/delta/sync existence check +04-03-18 iffe.sh: -d2 does not remove core dumps on exit +04-03-17 package.sh: fix make recurse arg/action order +04-02-29 package.sh: add regress action to compare current and previous tests + package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc + package.sh: add `export variable ...' + package.sh: admin action now handles host name with non-id chars + package.sh: non-numeric M T W in admin.db disables that action + package.sh: fix admin write binary local vs. shared clash + cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable + cc.hp.pa64: sync with cc.hp.pa + cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib + probe.win32: sync with make.probe + make.probe: fix last chance dynamic test + make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E + make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall + make.probe: move probe_dll_def to the end of probe_dll + package.mk: capture subcomponent mamfile recursion +04-02-24 make.probe: strip "..." from cc/ld traces + iffe.sh: add ``set [no]define'' to disable macro #define/#undef +04-02-23 make.probe: rework CC.LD search +04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export + make.probe: resurrect CC.PIC with separate semantics from CC.DLL + make.probe: add CC.SHARED.LD for CC.SHARED linker + C+probe: clear DISPLAY to stifle interactive windows +04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end + make.probe: add { CC.AR CC.SIZE }, fix cross command search + cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug +04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++ +04-02-04 package.sh: fix cross compilation bug that mixed binary formats +04-02-02 package.sh: package admin now ditto's bin/package too +04-01-30 cc.sgi.mips3: drop warning 3421 +04-01-11 regress.sh: output label#count for tests in loops +04-01-05 regress.sh: fix bug that ignored the first SAME +04-01-04 crossexec.sh: fix typo that did not recognize rcp +03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse() +03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency +03-09-23 ratz.c: fix tar header number parse bug that skipped to next number + regress.sh: rm cleanup now handles files matching -* +03-09-11 iffe.sh: add unnamed { ... } blocks + regress.sh: add COPY from to, like MOVE but comprison still done + regress.sh: rm -rfu to handle test dirs w/o u+rwx +03-08-14 Makefile: add hello.c to the manifest +03-08-11 package.sh: fix `html binary' generation +03-06-21 package.sh: fix INITROOT initialization bug + package.sh: make sure admin logs exists before tail'ing +03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make + cc.mvs.390: return code 4 yields exit code 3 but it's *really* ok + package.sh: fix onpath function global var conflict + make.probe: add CC.DIALECT { GNU -dD } + package.mk: add Mamfile to lcl manifest +03-06-10 package.sh: fix setup action typo that only checked the INIT package + package.sh: *.s390x => *.s390-64 +03-06-09 package.mk: add cyg :POSTINSTALL: +03-06-08 make.probe: fix CC.STDLIB logic + hurl.sh: add User-Agent identification + package.sh: tweak source and binary installation instructions + cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths + ldd.hp.pa: add +03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check + make.probe: add CC.STDLIB verification +03-06-04 make.probe: add +forceread +noforceread +03-05-11 hurl.sh: handle http://host:port/path +03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic +03-05-05 package.mk: fix cygwin tarball names +03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile +03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => "" + make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR) + make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD } + probe.win32: sync with latest CC.* +03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh +03-04-23 package.mk: fix dup "covered by" licenses +03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's + package.sh: fix admin write binary tarball snarf +03-04-21 package.mk: package covered *.@(pkg|lic) too +03-04-15 package.mk: don't generate incremental archives for lcl + package.mk: add incremental=[source:1 binary:0] archive control + package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc + package.sh: admin must ditto lib/package/*.@(pkg|lic) too + mamake.c: ignore time of ignore prereqs + mamake.c: -D2 lists propagated times +03-04-11 package.mk: tidy up cyg tarballs + package.sh: fix old shell clash between get() and $get +03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions + package.sh: add pthread_num_processors_np() last resort for cpu count + package.sh: use `make believe' to accept mamake generated files + package.sh: handle `make [make-flags] [target ...]' + mamake.c: ignore -e +03-03-21 package.mk: fix cyg old make typo + package.sh: switch to `package setup' instructions +03-03-19 package.sh: add registry checks for `host cpu' + package.sh: `results failed' now lists core dump messages +03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die + Makefile: install gcc wrapper if no cc + package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops +03-03-12 package.mk: add :DETAILS: for style-specific details +03-03-11 package.sh: add beta setup/update support + TEST.mk: add (TESTCC) prereq for .sh tests +03-03-07 hurl.sh: add +03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility + iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro +03-03-03 package.sh: check for curl or wget for update + package.sh: add setup action == update read make + package.sh: fix packageroot() typo that showed up in non ~user shells + mamake.c: treat name+=value args like name=value + mamake.c: add ${var?*|value?match?no-match?} + mamake.c: fix archive vs. dynamic bind logic +03-02-28 package.sh: add the "cyg" (cygwin) package type + package.mk: add "cyg" stubs, :CATEGORY: for category name(s) +03-02-25 mamake.c: add -D4 system(3) debug trace +03-02-24 package.mk: change --mismatch to --corrupt=accept +03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb" +03-02-12 Makefile: handle getconf LIBPATH with host pattern +03-01-31 package.mk: fix .lic search +03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere + package.sh: admin handles command outside of $PACKAGEROOT/bin + Makefile: install $(INSTALLROOT)/lib/make/package.mk +03-01-28 package.sh: admin remote commands on one line to please syslog +03-01-23 probe.win32: borland and mingw32 tweaks +03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh +03-01-16 ditto.sh: tw --chop on by default +03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/ + package.sh: admin now initiates remote exec and copy from local host +03-01-12 package.sh: handle admin "xxx:" default root +03-01-03 probe.win32: add /usr/include/borland path truncation workaround +02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc +02-12-06 probe.win32: fix inlcude => include typo, add lcc lib + probe.win32: CC.MAKE.OPTIONS = nativepp=0 +02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined +02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks +02-11-26 package.sh: package release now checks for second level files +02-11-22 package.sh: update action now uses HTTP/1.0 +02-11-21 probe.win32: update the vc include dir test +02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var +02-11-13 packahe.mk: fix list.install => list.installed typo +02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search + make.probe: add CC.LD.STRIP for link time a.out strip + package.sh: fix package_use vs. PACKAGE_USE check +02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post +02-10-23 mamake.c: fix unuinitialized time in make() + ratz.c: fix meter buffer overflow +02-10-20 package.sh: fix lib/probe/C/make/probe update test +02-10-18 probe.win32: update for mingw + make.probe: add bash workaround to SHELLMAGIC test + package.sh: work around yet another cygwin hassle +02-10-17 iffe.sh: short circuit id check for *[-+/\\]* +02-10-08 regress.sh: unset FIGNORE to avoid rm . errors + package.sh: unset FIGNORE to avoid rm . errors + package.sh: $CC must at least compile and executable hello world +02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz + package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS) + iffe.sh: add identifier checks for tests that (implicitly) require them + iffe.sh: disambiguate a few --config macros +02-10-02 iffe.sh: fix shell=bsh `hdr a/b' +02-09-30 package.sh: handle chmod of -* files + package.sh: verify that $SHELL is Bourne compatible + package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation + iffe.sh: fix bug that didn't define mac variable on success +02-09-22 package.sh: handle admin_action=ditto + iffe.sh: --config sizeof(foo) macro is SIZEOF_foo + iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long" + mamprobe.sh: convert $("foo") nmake string constants +02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout +02-09-11 make.probe: move from nmake src to be part of mamprobe.sh + mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end + mamake.c: pass cc absolute path to mamprobe + package.sh: generate mamprobe -- yuk (at least it's confined to INIT) + iffe.sh: lcl,nxt: drop default sys/ check + ditto.sh: tw --logical by default; add --physical +02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey +02-09-09 ditto.sh: test that remote .profile exists before sourcing +02-09-06 package.sh: don't ditto nfs junk + ditto.sh: --show now lists directory ops instead of enumerating all +02-09-05 ditto.sh: add --remote={rsh|ssh} + package.sh: add admin [[{rsh|ssh|-}]:]directory +02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility +02-09-01 cc.unix.mc68k: add for ancient 3b1 +02-08-22 package.sh: fix component() to test for components -- duh + Makefile: add LICENSE:.DONTCARE to workaround mam +02-08-11 iffe.sh: provide defaults for LD_* additions +02-08-07 ratz.c: change -m to use * instead of non-portable inverse video +02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin + package.sh: fix "type" to handle i1586 (P4) + package.sh: add the view action +02-06-28 package.sh: handle multiple packages for release action +02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc +02-06-14 package.sh: fix admin_action to not include qualifiers + package.sh: fix help/html doc typo +02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*' +02-06-07 WWW.mk: change substitute $("\n") to \n +02-06-06 package.sh: clarify output streams for help/html +02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH) +02-04-04 package.sh: fix update to differentiate *.sun4 and sun4 +02-03-27 package.sh: yacc/bison warning only if both missing +02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems +02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package + package.sh: precheck $CC, not `cc' + package.sh: fix install to use pax -ps to preserve set-uid/gid + package.sh: fix install to use list.installed for existing files only +02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read + package.sh: fix update delta sync fetch +02-02-14 iffe.sh: fix macro{ }end docs to include " + iffe.sh: add dfn to extract #define from headers + iffe.sh: handle nxt #include ok but no line sync + iffe.sh: drop local header clash logic + iffe.sh: add -X, --exclude=dir to exclude -I dirs + iffe.sh: lcl,nxt now generate <...> headers instead of "..." + package.sh: admin.db root dir matching -* disables host + package.mk: fix package.src.pat typo -- too many ) + package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: } + package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: } + Makefile: move proto.c generation to the proto component dir +02-02-02 execrate.sh: add for .exe challenged win32 systems/commands + mamprobe.sh: add STD* commands/flags + mamake.c: update mamprobe info when older than mamprobe executable + package.sh: move ed/ex workaround to mamprobe.sh + package.sh: fix `host type' bug that incorrectly assumed sun4 for sol + package.sh: add execrate(1) hooks for challenged systems + package.sh: add check for { cc ar nm yacc/bison } before make + ratz.c: fix "rb" vs. "r" macro tests + iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include + iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh +02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B* + iffe.sh: handle 'mem struct.a.b' +02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results + package.sh: uts.370 => uts.390 +02-01-18 package.sh: fix uts hosttype +02-01-17 package.sh: add 'results failed ...' to list failures only + package.sh: change ARCH internal var to all_types to avoid env conflict + iffe.sh: fix hdr/lib precheck that missed some -- ouch + iffe.sh: fix noexecute test that forgot to check compile first! +02-01-15 ratz.c: fix path[] type typo +02-01-01 package.mk: tighten license search +02-01-08 package.sh: `pwd` => ${PWD:-`pwd`} + package.mk: expand license file pattern match +02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value" + iffe.sh: fix initial check to honor --config +01-12-25 iffe.sh: fix bug where -o file restored old file +01-12-23 package.mk: uniq the closure lists +01-12-07 ratz.c: fix --meter to retain paths containing " -- " +01-11-30 ratz.c: use sear_system() to execute; should work on all windows +01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status +01-11-26 ditto.sh: drop n+=v for ksh compatibility +01-11-21 ditto.sh: add rsync script replacement [hey, it works!] + package.sh: add [ditto]:directory notation to admin.db +01-10-31 package.sh: handle *.sum paths with embedded space + package.sh: change executable() to onpath() + package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack) + package.sh: add os2 fix to `host type' + mamake.c: add .exe hack + iffe.sh: fix intrinsic function lib test + mamprobe.sh: update pic probe to match make.probe for linux.ia64 +01-10-30 package.sh: make action skeleton view now checks subdirs +01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP + package.mk: tarball package.notice replaces `license accepted' prompt + package.sh: eliminate `license accepted' prompt + package.sh: add update to download latest from a url + package.sh: use builtin arithmetic when we know it's ksh + iffe.sh: unkown -> unknown +01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN + package.mk: convert to YYYY-MM-DD delta releases instead of NNNN + ratz.c: fix -m for paths containing \f\n\r\v +01-10-16 ratz.c: _SEA_* => SEAR_* + ratz.c: preserve stdin for sear_exec() + ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup +01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC + package.sh: add nfs wakeup call to admin to avoid stale file handles +01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh) +01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH + package read: save cpy of bin/package when reading the INIT package + mamprobe.sh: allow cc path with optional arguments +01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization +01-09-19 package.mk: add recurse to list.package.* + package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32 +01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives +01-09-07 package.mk: fix output capture to not generate files names with spaces +01-09-07 package.mk: fix delta release number search +01-08-11 package.mk: handle single gz executable packages (e.g., for ksh) + package.sh: fix package install to require nmake only if no *.sum + iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash +01-07-17 package: fix use cross compile test to generate files in /tmp +01-06-27 ratz: handle hard and soft links if possible +01-06-07 Makefile: fix :MAPLIB: for sco +01-05-31 crossexec.sh: add + iffe.sh: add -x crosstype to run crossexec + iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end + package.sh: add package host canon external-host-type-name + package.sh: fix `use USER' lookup for shells that support ~USER + cc.*: add -dumpmachine to dump target HOSTTYPE +01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops +01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command +01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes + iffe.sh: fix run *.sh for shells that don't $* across . command + cc.mvs.390: recode for /bin/sh +01-04-25 package.mk: include non cc-g variants by default + package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh +01-04-24 TEST.mk: no tests for VARIANT=="DLL" +01-04-22 package.mk,package.sh: tarball text members are ascii encoded +01-04-18 package.mk: allow package name to be the same as one of its components + cc.mvs.390: handle .C .cpp .cxx + cc.mvs.390: compensate for -o that does not overwrite +01-04-01 regress: fix SAME that just skipped it -- we should regress regress! + iffe: fix bug that didn't emit _hdr_foo for internal hdr tests + iffe: fix lcl bug for cc -E that doesn't emit line syncs + ratz: add ascii=>ebcdic conversion for text archive members + mamake: fix buffer overlap bug that clobbered the probe file path +01-03-17 iffe: handle : separator as first arg +01-03-15 mamake.c,ratz.c,release.c: add and +01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op +01-02-22 cc.ibm.risc: handle SF_CLOSE clash in +01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc + C+probe: quote "$cc" when it's an argument! + mamake: execute actions with $SHELL, ignored signals back to default + package.sh: nmake check error output to /dev/null + package.sh: fix INIT a.out updates for knr cc + package.sh: package list now handles large tgz dirs + package.sh: *-ok executables moved to ok/* for *.dll systems + iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails! + mamake: handle `bind -lx [dontcare]' +01-02-12 ratz.c: fix _PACKAGE_ast includes + package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/ + package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE + iffe.sh: fix dat code that used previous $tmp.exe + iffe.sh: fix dat code for _DLL imports +01-02-09 iffe.sh: add copy() for shells with the disappearing here doc bug +01-02-08 Makefile: guard against null $(CC.HOSTTYPE) +01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged) +01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE + package.sh: create intermediate recursion makefiles when needed + package.sh: add $SECONDS to the DEBUG trace prompt +01-01-01 ratz.c: #ifdef for uwin ncc + iffe.sh,package.sh: check PACKAGE_PATH for local installations + package.sh: add psrinfo for osf.alpha host cpu + package.sh: change pax --meter probe; some hang on /dev/tty + package.sh: fix `install flat ARCH' + mamake: eliminate loops from scan order + C+probe: add probe_verbose -V for aix cc=xlc + cc.ibm.risc,ldd.ibm.risc: add + package.mk: list refs to top-level licenses only + package.mk: add local link table to change log html +00-12-25 package.sh: `no package archives' is a hard error, duh + package.sh: reorder host type logic for lame shells + mamake.c: getcwd => getwd for NeXT -- how about posix==default guys + iffe.sh: really gross workaround for NeXT -lposix stdout null's + iffe.sh: handle cc -E that insists on compiling +00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0 + *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh + package.sh: fix LD_LIBRARY*_PATH initialization + cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms +00-12-12 ratz: add --meter + package.sh: a few VPATH fixes + Makefile: don't override *.mips* cc if -version not accepted +00-12-11 package.mk: *.inx now contains name=value +00-12-07 package.sh: handle PC netscape . => _ pathname mangle + WWW.mk: .tar.gz => .tgz +00-11-27 package.sh: add checklicense() to do license checks at read time + package.mk: change component list from preformat to table +00-10-31 package.mk: *.pkg must assert closure + package.mk: add cc- variants to list.package.binary + package.sh: omit dups from package list + package.sh: invalid arg gives one line Usage + package.sh: relax checkaout checks for non-owners + package.sh: package use sets NPROC if not already set or [01] + proto.c: add $(INSTALLROOT)/include/ast hack +00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE: +00-10-25 package: fix install + package.mk: add list.install +00-10-22 regress: fix VIEW to skip empty dirs +00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake + iffe: validate #define identifiers +00-10-18 C+probe: mac os10 additions + package: add DYLD_LIBRARY_PATH initialization + add ldd.$(CC.HOSTTYPE) +00-10-01 iffe: handle -I* -L* options +00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs +00-09-19 C+probe: add probe_longlong +00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake +00-09-08 iffe: verify that $cc is a C compiler +00-06-14 mamprobe: fix win32.* probe + mamake: fix bug that used lower view path for generation + package: don't clobber $PACKAGEROOT/bin/nmake +00-06-01 C+probe: fix stdinclude *again* + package: fix write delta source to use default pax format + package: add disambiguating bias for sgi.mips3 over sgi.mips4 + package.mk: fix for directory content packages lib ast-locale +00-05-01 iffe: fix invalid _LIB_ macro identifier +00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude +00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected +00-03-17 package: all archives are .tgz for binary download + package: $(PACKAGEROOT)/LICENSES/* in source and binary archives + package: implement install and verify actions + iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb + iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk + package.mk: add *.pkg :INDEX: +00-03-07 package: add admin action +00-03-06 makefile: install optional make probe override script C+make+probe.lcl +00-02-14 --- release 1.0 --- + ratz: treat "foo/" as a dir, not a regular file + package: clarify source and binary installation instructions + package: fix so binary packages can install without cc + package: "ratz" now a non-archive package (the only one) for bootstrap + package: handle VPATH=a:b arg + package.mk: "ratz" package adjustments + Makefile: use :PACKAGE_INIT: to support binary INIT packages + WWW.mk: add :WWWALL: + C.probe: fix .so check that let .dll slip through + iffe: fix config sh var assignment for HAVE_member_IN_struct + iffe: fix config sh var assignment for symbol_DECLARED + package: delay PATH export until dll hack exports complete + package: don't forget binary package $(INSTALLROOT)/lib(32|64) + package: add delta change log for source packages +00-02-10 mamprobe: add mam_cc_DLLBIG + package: fix spelling typos + package: add html help output + package.mk: beef up source and binary help => html +00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug +00-01-28 package,release: add -rcount to release + package: fix linux "host cpu" and "host rating" + package: copy *.lic to $PACKAGEBIN for "make" and "write binary" + package: fix 'release change log' case match +00-01-24 package: add copyright action + mamprobe: add -D_BLD_DLL to mam_cc_DLL +00-01-11 package: tsort for package write + package: early verification that $CC works + package: add non-interactive command arg for use action + proto: fix -C intermediate mkdir() + mamprobe: unixware.i386 ksh workaround + C.probe: move hosttype to C.probe (with unixware.i386 workaround) + WWW.mk: fix mm2html option quoting + WWW.mk: add .SCAN.mm + WWW.mk: don't force static=1; grab dll's instead + *.sh: fix getopts test to handle botched implementations like osf.alpha + iffe.sh: fix read -r test +99-12-25 iffe: tweak verbose messages + iffe: hand code non-optget getopts parse + iffe: fix bash quoting bug again + iffe: do test -w . after option parse + package: fix PACKAGEROOT search +99-11-19 --- release 0.2 --- +99-11-19 first working package & friends +99-10-31 change from lib0ast to INIT; add MAM and package bootstrap + hostinfo: gobbled by package +99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround +99-09-27 iffe: add --all --verbose, --* set options +99-09-22 regress: -v disables long line truncation +99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME) +99-08-11 hostinfo: fix type sgi.mips4 +99-06-24 WWW.mk: add +99-06-08 hostinfo.sh: ${TMPDIR:-/tmp} +99-06-07 TEST.mk: add +99-06-01 iffe: add `siz type' for _siz_type == sizeof(type) +99-05-11 hostinfo,iffe,regress,use: long options +99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine +99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks + iffe: check that . is writable +99-03-17 hostinfo: fix for cc not found + dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE + C.probe: extra check for include dirs pulled in by +99-03-03 regress: add `UNIT - ...' for extra args + Makefile: add (_hosttype_) prereq for cc +99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there +99-01-11 C.probe: shlib before lib, /usr before / +98-12-25 iffe: work around win32.alpha intrinsic clash with -O +98-11-11 regress: fix UNIT PATH lookup +98-11-01 regress: add PROG +98-10-01 hostinfo: add unixware.* + use: export PACKAGE_* +98-08-11 C.probe: add /usr/include check (for sco CC) + hostinfo: handle uwin uname update +98-05-01 regress: fix bug sometimes didn't list last test +98-04-01 hostinfo: add cc path arg + hostinfo: now works with /bin/sh + Makefile: strengthed -lm probe +98-01-23 Makefile: check for -ldl -lm + C.probe: handle gcc -v -E phony include dirs + iffe: fix lcl by dropping sort -u -- we need the real first + iffe: `mem x' to test if x is a non-opaque struct +98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3 + $(INSTALLROOT)/lib64 for sgi.mips4 + add cc.hp.pa +98-01-01 cc.sgi.mips*: turn off ld library multiply defined +97-10-11 regress: add VIEW function for locating data +97-10-01 Makefile: -ldl test moved to libdll Makefile +97-08-11 regress: add MOVE + regress: add SAME + regress: use getopts + regress: `EXEC' repeats previous test +97-07-17 use: tweak PATH and LIBPATH bootstrap order + iffe: fix lcl bug that botched pathnames with embedded spaces +97-06-12 iffe: add npt `needs prototype' test +97-05-09 hostinfo: mvs.* => mvs.390 + Makefile: cc.$(_hosttype_) workaround installed here + iffe: fix nolink{ ... }end + iffe: add [no]static{ ... }end for static link test + C.probe: _probe_PATH => _probe_export which must be eval'd +97-04-01 use: _RLD_ROOT set too +97-03-17 mm2html: changed inner loop + mm2html: handle .if|.ie|.el, .so + mm2html: handle different man styles + mm2html: differentiate mm/man in some non-obvious cases + hostinfo: r5000 is not mips4 +97-02-14 hostinfo: validate type with cc +96-12-25 C.probe: uwin tweaks + iffe: use `...` instead of $(...) for alpha /bin/sh + iffe: fix `typ' divide by 0 + iffe: `lcl' now drops X: prefix + iffe: +l* -> -l* + iffe: eval around ${...#%...} for bsd /bin/sh + use: add sgi.mips LD_LIBRARY_PATH variants + use: add -e to list exports + iffe: lcl leaves leading [a-zA-Z]: for dos + iffe: fix no{link|output|execute} logic + C.probe: don't automatically add /usr/include for non-hosted compilers + C.probe: don't automatically place /usr/include last + C.probe: check gcc style -v -E for stdinclude usrinclude +96-11-28 iffe: check BASH_VERSION for IFS botch + iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx) + hostinfo: fix sgi.mips[234] tests + hostinfo: fix ncr.i386 tests +96-10-31 iffe: work around old bsh here doc bug by running separate sh +96-10-11 iffe: *.iffe and *.iff for iffe src files + hostinfo: tighten sgi.mips cpu type check +96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib +96-09-17 iffe: fix typ bug that failed for single id types! +96-08-31 hostinfo: handle recent sgi hinv cpu changes +96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx +96-05-09 C.probe: drop multiple / in stdinclude +96-02-29 use: package root must have bin and lib subdir + mm2html: add + C.probe: probe_members += -whole-archive for gcc + iffe: add + fix the blasted `...'...\\...'...` +96-01-31 use: add pkg dir + hostinfo: add tandem +96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32 +95-11-24 hostinfo: linux-aout.* for non-elf linux +95-11-11 use: add aix LIBPATH +95-10-11 hostinfo: no args prints type +95-08-11 use: add +95-05-09 save original PATH in _probe_PATH + beef up library dir probe +95-04-01 use c source suffix if it still preserves the dialect + add hostinfo + add lib/hostinfo/typemap user type map + add sol.sun4 cpu count + fix C.probe to properly handle C/C++ combined compiler drivers + add NeXT to hostinfo + bummer: mach has /usr/bin/hostinfo +95-03-19 fix dialect executable test +95-03-19 --- release 0.0 --- diff --git a/src/cmd/INIT/TEST.mk b/src/cmd/INIT/TEST.mk new file mode 100644 index 000000000..adc43908c --- /dev/null +++ b/src/cmd/INIT/TEST.mk @@ -0,0 +1,197 @@ +/* + * regression test support + * + * @(#)TEST.mk (AT&T Research) 2010-05-19 + * + * test management is still in the design phase + */ + +/* + * three forms for :TEST: + * + * :TEST: xxx yyy ... + * + * $(REGRESS) $(REGRESSFLAGS) xxx.tst + * $(REGRESS) $(REGRESSFLAGS) yyy.tst + * + * :TEST: xxx.tst yyy ... + * + * $(REGRESS) $(REGRESSFLAGS) xxx.tst yyy ... + * + * :TEST: xxx.c [ :: test-prereq ... :: ] [ args [ : args ... ] ] + * + * :TEST: xxx.sh [ :: test-prereq ... :: ] [ args [ : args ... ] ] + * + * xxx :TEST: prereq ... + * [ action ] + * + * $(*) if no action + */ + +":TEST:" : .MAKE .OPERATOR + local B G P S T + test : .INSERT .TESTINIT + if "$("tests":T=FD)" + .SOURCE : tests + end + P := $(>:O=1) + if "$(P:N=*.tst)" && ! "$(@:V)" + B := $(P:B) + if ! ( T = "$(<:V)" ) + T := $(B) + end + test : - test.$(T) + eval + test.$$(T) : $$(B).tst + $$(REGRESS) $$(REGRESSFLAGS) $$(*) $(>:V:O>1) + :SAVE: $$(B).tst + end + elif "$(P:N=*@(.sh|$(.SUFFIX.c:/ /|/G)|$(.SUFFIX.C:/ /|/G)))" + B := $(P:B) + if ! ( T = "$(<:V)" ) + T := $(B) + end + :INSTALLDIR: $(B) + $(B) :: $(P) $(*:-l*|*$(CC.SUFFIX.ARCHIVE)) + if "$(P:N=*.sh)" + TESTCC == $(CC) + $(B) : (TESTCC) + end + test : - test.$(T) + if "$(@:V)" + eval + test.$$(T) : $$(B) $(>:V:O>1) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(@:V) + end + elif "$(>:V:O>1)" + local I A V X S R=0 + for A $(>:V:O>1) + if A == "::" + let R = !R + elif A == ":" + let I = I + 1 + test.$(T).$(I) := $(V:V) + V = + X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*) + S = $("\n") + elif A != "-l*|*$(CC.SUFFIX.ARCHIVE)" + if R + test.$(A) : .VIRTUAL .FORCE + test.$(T) : test.$(A) + else + V += $(A:V) + end + end + end + if V + let I = I + 1 + test.$(T).$(I) := $(V:V) + X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*) + end + eval + test.$$(T) : $$(B) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(X:V) + end + else + eval + test.$$(T) : $$(B) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $$(*) + end + end + elif ! "$(<:V)" + G = 1 + for B $(>) + if B == "-|--" + let G = !G + else + if ! G + T = + elif ! ( T = "$(B:A=.COMMAND)" ) && ! "$(B:A=.TARGET)" + for S .c .sh + if "$(B:B:S=$(S):T=F)" + :INSTALLDIR: $(B) + $(B) :: $(B:B:S=$(S)) + T := $(B) + break + end + end + end + test : - test.$(B) + test.$(B) : $(T) - $(B).tst + $(REGRESS) $(REGRESSFLAGS) $(*:N=*.tst) $(*:N!=*.tst) + :SAVE: $(B).tst + end + end + else + if "$(>:V)" || "$(@:V)" + P := $(>) + T := $(P:O=1) + B := $(T:B) + if "$(T)" != "$(B)" && "$(T:G=$(B))" + :INSTALLDIR: $(B) + $(B) :: $(T) $(P:O>1:N=-*) + T := $(B) + P := $(B) $(P:O>1:N!=-*) + end + if "$(<:V)" + T := $(<:V) + end + test : - test.$(T) + if "$(@:V)" + eval + test.$$(T) : $$(P) $(>:V:O>1) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(@:V) + end + else + test.$(T) : $(P) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(*) + end + else + test : - test.$(<) + test.$(<) : $(<).tst $(<:A=.COMMAND) + $(REGRESS) $(REGRESSFLAGS) $(*) + end + end + +.TESTINIT : .MAKE .VIRTUAL .FORCE .REPEAT + if VARIANT == "DLL" + error 1 :DLL: tests skipped + exit 0 + end + set keepgoing + REGRESSFLAGS &= $(TESTS:@/ /|/G:/.*/--test=&/:@Q) + +.SCAN.tst : .SCAN + $(@.SCAN.sh) + I| INCLUDE@ % | + +.ATTRIBUTE.%.tst : .SCAN.tst + +MKTEST = mktest +MKTESTFLAGS = --style=regress + +/* + * test scripts are only regenerated from *.rt when --force + * is specified or the .rt file is newer than the script + * otherwise the script is accepted if it exists + * + * this avoids the case where a fresh build with no state + * would regenerate the test script and capture current + * behavior instead of expected behavior + */ + +%.tst : %.rt + if [[ "$(-force)" || "$(>)" -nt "$(^|<)" ]] + then $(MKTEST) $(MKTESTFLAGS) $(>) > $(<) + fi + +test%.sh test%.out : %.rt + if [[ "$(-force)" || "$(>)" -nt "$(^|<:O=1)" ]] + then $(MKTEST) --style=shell $(>) > $(<:N=*.sh) + $(SHELL) $(<:N=*.sh) --accept > $(<:N=*.out) + fi diff --git a/src/cmd/INIT/WWW.mk b/src/cmd/INIT/WWW.mk new file mode 100644 index 000000000..4542daeea --- /dev/null +++ b/src/cmd/INIT/WWW.mk @@ -0,0 +1,450 @@ +/* + * post stuff to WWWDIR for web access + * index generated from *.mm + */ + +WWWDIR = wwwfiles public_html +WWWSAVE = +WWWSTYLE = +WWWTYPES = + +.WWW.semaphore : .SEMAPHORE + +.EXPORT : WWWSTYLE WWWTYPES + +/* + * item :WWW: [style=frame] [save=pattern] file ... + * + * `item'.mm generates index.html + * other files copied to $(WWWDIR)/`item' + * sets up www.bin + */ + +":WWW:" : .MAKE .OPERATOR + local A B D I J L X E P R M + .WWW.LOCAL .WWW.REMOTE : .DO.NOTHING + WWWDIR := $(HOME:X=$(WWWDIR):T=F:O=1) + B := $(*:N=*.mm::O=1:B) + D := $(WWWDIR)/$(B) + M := $(WWWDIR)/man/man1 + R := $(>:N!=*=*) + for I $(>:N=*=*) + A := WWW$(I:/=.*//:F=%(upper)s) + $(A) := $(I:/.*=//) + end + (html_info) : $$(MM2HTMLINFO) $$(MM2HTMLINIT) + if WWWSTYLE == "frame" + %.html %-index.html : %.mm (html_info) + $(MM2HTML) $(MM2HTMLFLAGS) $(%:N=faq.*:?> $(<:O=1)?-f $(%) -x?) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(WWWSOURCE.$(%)) $(>) + else + %.html : %.mm (html_info) + $(MM2HTML) $(MM2HTMLFLAGS) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(>) $(WWWSOURCE.$(%)) > $(<) + end + %.html : %.1 (html_info) + $(MM2HTML) $(MM2HTMLFLAGS) $(>) $(WWWSOURCE.$(%)) > $(<) + %-man.html : $(BINDIR)/% (html_info) + ignore $(>) --html 2> $(<) + .DO.WWW.MAN : .USE + if { test '' = '$(*)' || { strings $(*) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' ;} ;} && [[ "$( $(<:B) '--???html' -- 2>&1 )" == version=[1-9]* ]] + then ( $(<:B) '--??html' -- 2>$(<) ) || true + fi + if 0 + $(M)/%.html : .DONTCARE $(INSTALLROOT)/bin/% + $(@.DO.WWW.MAN) + end + if "$(<)" + D := $(<) + elif ! "$(R)" + return + end + .WWW .WWW.BIN : $(D) $(M) - + $(D) $(M) : + $(SILENT) test -d $(<) || mkdir $(<) + if ( J = "$(R:N=*.mm)" ) + for I $(J:G=%.html) + if I == "*-index.html" + O := $(D)/index.html + else + O := $(I:D=$(D):B:S) + end + .WWW : $(O) + $(O) :COPY: $(I) + end + end + .WWW.req : .FUNCTION + return $(*$(%:T=SR):N=-l*:T=F:P=B:N!=-l*|/*) + A = 0 + for I $(R:N!=*.mm) + if I == "-" + let A = ! A + elif I == "-l*" + L := $(I:/-l//) + if J = "$(.DLL.NAME. $(L) $($(L).VERSION):T=F)" + X += $(J) + end + elif A || "$(I:A=.COMMAND|.ARCHIVE)" || "$(I:D:D:N=$(INSTALLROOT))" || "$(I:N=*-www)" + X += $(I) + if "$(I:A=.COMMAND)" + X += $$(.WWW.req $(I)) + J := $(I:/-www$//) + eval + .WWW : $(J:D=$(M):B:S=.html) + $(J:D=$(M):B:S=.html) : $(I) $(I:B:S=.1:T=F:?$(I:B:S=.1)??) + if strings $$(*:O=1) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' + then $$(IGNORE) $$(*:O=1) '--??html' -- 2>&1 + elif test '' != '$$(*:N=*.1)' + then $$(MM2HTML) $$(*:N=*.1) + fi > $$(<) + end + end + else + if I == "*.html" + $(I) : .TERMINAL + end + .WWW : $(D)/$(I) + $(D)/$(I) :COPY: $(I) + end + end + if "$(X:V)" + .WWW.EDIT. : .FUNCTION + local E I J + for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*) + for J $(%) + if "$(I:B:S)" == "$(J:B:S)" + E += -s ',^$(J)$,$(I),' + end + end + end + return $(E) + .WWW.LIST. : .FUNCTION + local E I J + for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*) + for J $(%) + if "$(I:B:S)" == "$(J:B:S)" + E += $(I) + end + end + end + return $(E) + .WWW .WWW.BIN : $(D)/$(B)-$(CC.HOSTTYPE).tgz + $(D)/$(B)-$(CC.HOSTTYPE).tgz : $(X:V) + cat > X.$(tmp).X <) + TYPE := $(HOST:/.*://) + HOST := $(HOST:/:.*//) + WWWTYPES += $(TYPE) + ARCH := $(PWD:D:C,/$(CC.HOSTTYPE)/,/$(TYPE)/) + BINS := + DIRS := + for ITEM $(<) + if TYPE == "$(CC.HOSTTYPE)" + G := $("index.mm":G=%.html:D=$(WWWDIR)/$(ITEM):B:S) + .WWW.LOCAL : $(G) + eval + $(G) : .JOINT $(ARCH)/$(ITEM)/$(ITEM).mm (html_info) .WWW.semaphore .FORCE + cd $$(*:D) + $$(MAKE) $$(-) $$(=) www + end + else + BINS += $(WWWDIR)/$(ITEM)/$(ITEM)-$(TYPE).tgz + DIRS += $(ARCH)/$(ITEM) + end + end + .WWW.REMOTE : $(BINS) + ARCH := $(ARCH:C,/src/.*,,) + eval + $(BINS) :JOINT: .FORCE .WWW.semaphore + rsh $(HOST) " + eval \"\`bin/package debug use\`\" + PATH=\$PATH:$(PATH):/usr/ccs/bin + umask 022 + for dir in $(DIRS) + do cd \$dir + $(MAKE) $(-) $(=) --errorid=\$dir www.bin + done + " + end + end + +/* + * :WWWPOST: [ host [ dir [ tmp ] ] ] + * + * post local $(WWWDIR) to host:dir putting archives in host:tmp/www-*.pax + * defaults: host=www dir=$(WWWDIR) tmp=tmp + */ + +":WWWPOST:" : .MAKE .OPERATOR + local ( host dir tmp ignore ... ) $(>) www $(WWWDIR:B:S) tmp ignore + :ALL: delta.pax + .WWW.ALL : .WWW.REMOTE - .WWW.LOCAL + eval + .POST : .VIRTUAL base.pax delta.pax + case "$$(>)" in + '') ;; + *) $$(>:C,.*,rcp & $(host):$(tmp)/$(dir)-&;,) + rsh $(host) ' + umask 022 + PATH=$HOME/bin:$PATH + cd $(dir) + pax -rvf $HOME/$(tmp)/$(dir)-delta.pax -z $HOME/$(tmp)/$(dir)-base.pax + ' + ;; + esac + end + base.pax : + cd $(WWWDIR) + pax -wvf $(<:P=A) . + .base.list. : .FUNCTION + local X + X := $(sh pax -f $(%:N=*.pax):C,\n, ,G:C,^,$$(WWWDIR)/,) + $(X) : .DONTCARE + return $(X) + delta.pax : .WWW.ALL base.pax $$(.base.list. $$(*)) + cd $(WWWDIR) + pax -wvf $(<:P=A) -z $(*:N=*.pax:P=A) . + +.WWW.FAQ : .USE + { + set -o noglob + print .xx title=\"$(<:B:/\..*//) FAQ index\" + print .MT 4 + print .TL + print + print .H 1 \"$(<:B:/\..*//) FAQ index\" + print .BL + for i in $(*) + do exec < $i || exit 1 + e=0 l=0 x=y + while read -r op a1 a2 + do case $op in + .H) case $e in + 0) e=1 ;; + 1) print .LE ;; + esac + print .sp + print .LI + a2=${a2//\"/} + a2=${a2%\ [Ff][Aa][Qq]} + f=${i%.*}.html + f=${f#*/} + print .xx link=\"$f' '$a2\" + print .sp + print .NL + ;; + .AL|.BL|.NL) + case $x in + y) x=x ;; + *) x=xx$x ;; + esac + ;; + .LE) x=${x%xx} + ;; + .LI) case $x in + x) x= + print .LI + ;; + esac + ;; + .sp) case $x in + '') x=x ;; + esac + ;; + *) case $x in + '') print -r -- $op $a1 $a2 ;; + esac + ;; + esac + done + case $e in + 1) print .LE ;; + esac + done + print .LE + } > $(<) + +/* + * [ dir ] :WWWPAGE: [ source ... ] file.mm file + * + * *.mm generates *.html + * faq.*.mm generates faq.mm + * other files copied to $(WWWDIR)[/dir] + * files after - (toggle) are just asserted on :: + */ + +":WWWPAGE:" : .MAKE .OPERATOR + local B D I J O P Q S X G A + A = 0 + D := $(<:O=1) + P := $(>:N!=*=*) + S := $(>:N=*=*) + if X = "$(P:B:S:N=faq.*.mm)" + Q := $(D:+$(D).)faq.mm + $(Q) : .WWW.FAQ $(X) + P += $(Q) + end + if D + B := $(D:B) + if D != "/*" + D := $(WWWDIR)/$(D) + $(D) :INSTALLDIR: + .WWW.LOCAL : $(D) + end + for I $(<:B) + .WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html + $(WWWDIR)/man/man1/$(I).html : .DONTCARE + end + for I $(P) + if I == "-" + let A = !A + continue + end + if A || I == "$(WWWSAVE)" + :: $(I) + continue + end + if "$(I:T=FD)" + .SOURCE : $(I) + if "$(<)" + WWWSOURCE.$(<:O=1) += $(I:T=F:P=L=*) + end + continue + end + if I == "*.html" + $(I) : .TERMINAL + O := $(I) + X := $(I) + elif ( G = "$(I:G=%.html)" ) + $(G) : .IMPLICIT $(S) $(I) + if $(G:O) > 1 + for J $(G) + if J == "*-index.html" + if J == "faq.*.*" + continue + end + O := index.html + else + O := $(J) + end + .WWW.LOCAL : $(D)/$(O) + $(D)/$(O) :INSTALL: $(J) + end + continue + end + if X + X := $(I) + else + X := index + end + I := $(I:B:S=.html) + O := $(X:B:S=.html) + else + O := $(I) + end + $(D)/$(O) :INSTALL: $(I) + .WWW.LOCAL : $(D)/$(O) + end + else + for I $(P) + if I == "-" + let A = !A + continue + end + if A || I == "$(WWWSAVE)" + :: $(I) + continue + end + if "$(I:T=FD)" + .SOURCE : $(I) + continue + end + if I == "*.html" + $(I) : .TERMINAL + O := $(I) + elif ( O = "$(I:G=%.html)" ) + $(O) : $(S) .IMPLICIT $(I) + end + for J $(O) + if J == "*-index.html" + X := index.html + else + X := $(J) + end + X := $(WWWDIR)/$(X) + .WWW.LOCAL : $(X) + $(X) :COPY: $(J) + end + end + end + +/* + * rhs done by default + */ + +":WWWALL:" : .MAKE .OPERATOR + .WWW.ALL : $(>) + +":WWWMAN:" : .MAKE .OPERATOR + .INIT : .WWW.MAN + .WWW.MAN. := $(>) + .WWW.MAN : .MAKE .FORCE + local H I + for I $(.WWW.MAN.) + .WWW.LOCAL : $(WWWDIR)/man/man1/$(I:B).html + $(WWWDIR)/man/man1/$(I:B).html : .DO.WWW.MAN $(I) + end + for I $(sh builtin:B) + .WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html + $(WWWDIR)/man/man1/$(I).html : .DO.WWW.MAN - + end + for I $("$(BINDIR)/*([!-.])":P=G:B) + if I != "*_*" + H := $(WWWDIR)/man/man1/$(I).html + if ! "$(*$(H))" && I != "$(.WWW.NOMAN.:/ /|/G)" + .WWW.LOCAL : $(H) + end + elif "$(PATH:/:/ /G:X=$(I:/.*_//):T=F:O=1)" + H := $(WWWDIR)/man/man1/$(I:/.*_//).html + .WWW.LOCAL : $(H) + $(H) : .DO.WWW.MAN $(BINDIR)/$(I) + end + end + +.WWW.SED. : .FUNCTION + local E T + E = s/^\(\.xx.link=.*\)%HOSTTYPE%\(.*\)%HOSTTYPE%\(.*\)/ + for T $(%) + E := $(E:V)\$$("\n").LI\$$("\n")\1$(T)\2$(T)\3 + end + return $(E:V)/ + +/* + * mm scan support + */ + +.SCAN.mm : .SCAN + O|S| + I|.sn %|A.DONTCARE|M$$(%)| + I|.so %|A.DONTCARE|M$$(%)| + +.ATTRIBUTE.%.mm : .SCAN.mm diff --git a/src/cmd/INIT/ar.freebsd12.amd64 b/src/cmd/INIT/ar.freebsd12.amd64 new file mode 100755 index 000000000..dc34f235e --- /dev/null +++ b/src/cmd/INIT/ar.freebsd12.amd64 @@ -0,0 +1,6 @@ +: linux.i386-64 ar wrapper + +case $1 in +*x*) /usr/bin/ar "$@" ;; +*) /usr/bin/ar U"$@" ;; +esac diff --git a/src/cmd/INIT/ar.ibm.risc b/src/cmd/INIT/ar.ibm.risc new file mode 100755 index 000000000..0247643e7 --- /dev/null +++ b/src/cmd/INIT/ar.ibm.risc @@ -0,0 +1,9 @@ +: stupid stupid stupid to require a non-standard option for ar to work : 2009-10-06 : + +op=$1 +shift +case $op in +-*) ;; +*) op=-$op ;; +esac +/usr/bin/ar -Xany "$op" "$@" diff --git a/src/cmd/INIT/ar.linux.i386-64 b/src/cmd/INIT/ar.linux.i386-64 new file mode 100755 index 000000000..dc34f235e --- /dev/null +++ b/src/cmd/INIT/ar.linux.i386-64 @@ -0,0 +1,6 @@ +: linux.i386-64 ar wrapper + +case $1 in +*x*) /usr/bin/ar "$@" ;; +*) /usr/bin/ar U"$@" ;; +esac diff --git a/src/cmd/INIT/cc.darwin b/src/cmd/INIT/cc.darwin new file mode 100755 index 000000000..e9e188c6b --- /dev/null +++ b/src/cmd/INIT/cc.darwin @@ -0,0 +1,52 @@ +: unix wrapper for macOS cc : 2020-07-17 : + +HOSTTYPE=darwin.generic + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +CC=/usr/bin/cc +op=init +for arg +do case $op in + init) op=ld + set '' + ;; + esac + case $arg in + -c) op=cc + ;; + -E) op=cpp + continue + ;; + -G) op=dll + continue + ;; + -lc) continue + ;; + -lm) continue + ;; + esac + set "$@" "$arg" +done +case $# in +0) ;; +*) shift ;; +esac +case $* in +-v) $CC "$@"; exit ;; +esac +case $op in +init) echo "cc: arguments expected" >&2 + exit 1 + ;; +cpp) $CC -E "$@" + ;; +cc) $CC -D_ast_int8_t=int64_t -D_lib_memccpy "$@" + ;; +dll) $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" + ;; +ld) $CC -Wl,-search_paths_first "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.darwin07 b/src/cmd/INIT/cc.darwin07 new file mode 100755 index 000000000..a29930caf --- /dev/null +++ b/src/cmd/INIT/cc.darwin07 @@ -0,0 +1,71 @@ +: unix wrapper for Mac OS X 10.3-10.6 (Darwin 7-10) cc : 2020-07-17 : + +HOSTTYPE=darwin07.generic + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +CC=/usr/bin/cc +op=init +for arg +do case $op in + init) op=ld + set '' + ;; + esac + case $arg in + -c) op=cc + ;; + -E) op=cpp + continue + ;; + -G) op=dll + continue + ;; + -lc) continue + ;; + -lm) continue + ;; + esac + set "$@" "$arg" +done +case $# in +0) ;; +*) shift ;; +esac +case $* in +-v) $CC "$@"; exit ;; +esac +case $op in +init) echo "cc: arguments expected" >&2 + exit 1 + ;; +cpp) $CC -E "$@" + ;; +cc) $CC -DCLK_TCK=100 "$@" + ;; +dll) # what a compatibility mess -- surely they can get the apis to play nice + tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + case `MACOSX_DEPLOYMENT_TARGET=10.3 ld -undefined dynamic_lookup 2>&1` in + *undefined*dynamic_lookup*) + ld -m -flat_namespace -undefined suppress -dylib -dynamic \ + -ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1 + status=$? + ;; + *) MACOSX_DEPLOYMENT_TARGET=10.3 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1 + status=$? + ;; + esac + egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2 + exit $status + ;; +ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + $CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1 + status=$? + egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2 + exit $status + ;; +esac diff --git a/src/cmd/INIT/cc.darwin11 b/src/cmd/INIT/cc.darwin11 new file mode 100755 index 000000000..23766681e --- /dev/null +++ b/src/cmd/INIT/cc.darwin11 @@ -0,0 +1,71 @@ +: unix wrapper for Mac OS X 10.7 (Darwin 11) cc : 2020-07-17 : + +HOSTTYPE=darwin11.generic + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +CC=/usr/bin/cc +op=init +for arg +do case $op in + init) op=ld + set '' + ;; + esac + case $arg in + -c) op=cc + ;; + -E) op=cpp + continue + ;; + -G) op=dll + continue + ;; + -lc) continue + ;; + -lm) continue + ;; + esac + set "$@" "$arg" +done +case $# in +0) ;; +*) shift ;; +esac +case $* in +-v) $CC "$@"; exit ;; +esac +case $op in +init) echo "cc: arguments expected" >&2 + exit 1 + ;; +cpp) $CC -E "$@" + ;; +cc) $CC -DCLK_TCK=100 "$@" + ;; +dll) # what a compatibility mess -- surely they can get the apis to play nice + tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + case `MACOSX_DEPLOYMENT_TARGET=10.7 ld -undefined dynamic_lookup 2>&1` in + *undefined*dynamic_lookup*) + ld -m -flat_namespace -undefined suppress -dylib -dynamic \ + -ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1 + status=$? + ;; + *) MACOSX_DEPLOYMENT_TARGET=10.7 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1 + status=$? + ;; + esac + egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2 + exit $status + ;; +ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + $CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1 + status=$? + egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2 + exit $status + ;; +esac diff --git a/src/cmd/INIT/cc.freebsd b/src/cmd/INIT/cc.freebsd new file mode 100755 index 000000000..af3576cef --- /dev/null +++ b/src/cmd/INIT/cc.freebsd @@ -0,0 +1,9 @@ +: FreeBSD cc wrapper + +HOSTTYPE=freebsd.generic + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +exec /usr/bin/cc -P "$@" diff --git a/src/cmd/INIT/cc.hp.ia64 b/src/cmd/INIT/cc.hp.ia64 new file mode 100755 index 000000000..204bd0e1f --- /dev/null +++ b/src/cmd/INIT/cc.hp.ia64 @@ -0,0 +1,13 @@ +: hp.ia64 cc wrapper for reasonable ansi C defaults : 2011-01-25 : + +[ /usr/bin/cc -ef /usr/ccs/bin/cc ] || exit 1 + +: bundled cc -- really, in the face of gcc you ship a sub-par /usr/bin/cc? : + +HOSTTYPE=hp.ia64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/usr/bin/cc -D_HPUX_SOURCE -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE_XOPEN_SOURCE_500 "$@" diff --git a/src/cmd/INIT/cc.hp.pa b/src/cmd/INIT/cc.hp.pa new file mode 100755 index 000000000..cd5f57624 --- /dev/null +++ b/src/cmd/INIT/cc.hp.pa @@ -0,0 +1,13 @@ +: hp.pa cc wrapper for reasonable ansi C defaults : 2004-02-29 : + +HOSTTYPE=hp.pa + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +_AST_CC_hp_pa_DEFAULT=${_AST_CC_hp_pa_DEFAULT-"+DAportable"} + +/opt/ansic/bin/cc -Ae +e -Wl,+s $_AST_CC_hp_pa_DEFAULT \ + ${INSTALLROOT:+-Wl,+cdp,${INSTALLROOT}/lib/:} \ + -Wl,+vnocompatwarnings "$@" diff --git a/src/cmd/INIT/cc.hp.pa64 b/src/cmd/INIT/cc.hp.pa64 new file mode 100755 index 000000000..49f239597 --- /dev/null +++ b/src/cmd/INIT/cc.hp.pa64 @@ -0,0 +1,11 @@ +: hp.pa64 cc wrapper for reasonable ansi C defaults : 2001-02-11 : + +HOSTTYPE=hp.pa64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/opt/ansic/bin/cc +D2.0W -Ae +e -Wl,+s \ + ${INSTALLROOT:+-Wl,+cdp,${INSTALLROOT}/lib/:} \ + -Wl,+vnocompatwarnings "$@" diff --git a/src/cmd/INIT/cc.ibm.risc b/src/cmd/INIT/cc.ibm.risc new file mode 100755 index 000000000..f67c5f400 --- /dev/null +++ b/src/cmd/INIT/cc.ibm.risc @@ -0,0 +1,63 @@ +: cc wrapper for aix risc xlc : 2012-04-17 : + +hosttype=ibm.risc + +case $HOSTTYPE in +$hosttype-64) + case " $* " in + *" -q64 "*) ;; + *) set -- -q64 "$@" ;; + esac + ;; +*) case " $* " in + *" -q64 "*) HOSTTYPE=$hosttype-64 ;; + *) HOSTTYPE=$hosttype ;; + esac + ;; +esac + +case " $* " in +*" -dumpmachine "*) + echo $HOSTTYPE + exit + ;; +esac + +bin=/usr/vac/bin +cc=$bin/xlc + +ccflags="-brtl -qhalt=e -qsuppress=1506-224:1506-507" +case " $@ " in +*" -G "*) + ccflags="$ccflags -berok" + ;; +esac +if test -x $bin/c99 +then # the xlc optimizer vintage that supports c99 is flawed and causes the ast build to fail # + case " $* " in + *" -O "*) + set '' "$@" '' + shift + while : + do a=$1 + shift + case $a in + '') break ;; + -O) ;; + *) set '' "$@" $a ;; + esac + shift + done + ;; + esac + $cc $ccflags "$@" + code=$? +else export PATH=/bin:$PATH LIBPATH=/usr/lib:/lib + ccflags="$ccflags -blibpath:$LIBPATH" +fi +$cc $ccflags "$@" +code=$? +case $code in +127|255) code=1 ;; +esac +exit $code diff --git a/src/cmd/INIT/cc.ibm.risc.gcc b/src/cmd/INIT/cc.ibm.risc.gcc new file mode 100755 index 000000000..ac8473f55 --- /dev/null +++ b/src/cmd/INIT/cc.ibm.risc.gcc @@ -0,0 +1,36 @@ +: cc wrapper for aix risc gcc : 2012-04-17 : + +hosttype=ibm.risc + +case $HOSTTYPE in +$hosttype-64) + case " $* " in + *" -maix64 "*) ;; + *) set -- -maix64 "$@" ;; + esac + ;; +*) case " $* " in + *" -maix64 "*) HOSTTYPE=$hosttype-64 ;; + *) HOSTTYPE=$hosttype ;; + esac + ;; +esac + +case " $* " in +*" -dumpmachine "*) + echo $HOSTTYPE + exit + ;; +esac + +cc=gcc +ccflags= + +case " $@ " in +*" -shared "*) + ccflags="$ccflags -shared -Wl,-G -Wl,-berok" + ;; +*) ccflags="-Wl,-brtl" + ;; +esac +$cc $ccflags "$@" diff --git a/src/cmd/INIT/cc.linux.aarch64 b/src/cmd/INIT/cc.linux.aarch64 new file mode 100755 index 000000000..c4e558e46 --- /dev/null +++ b/src/cmd/INIT/cc.linux.aarch64 @@ -0,0 +1,9 @@ +: linux.aarch64 cc wrapper : 2006-02-14 : + +HOSTTYPE=linux.aarch64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/usr/bin/cc -P "$@" diff --git a/src/cmd/INIT/cc.linux.i386-64 b/src/cmd/INIT/cc.linux.i386-64 new file mode 100755 index 000000000..d7f3d7001 --- /dev/null +++ b/src/cmd/INIT/cc.linux.i386-64 @@ -0,0 +1,9 @@ +: linux.i386-64 cc wrapper : 2006-02-14 : + +HOSTTYPE=linux.i386-64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/usr/bin/cc -P "$@" diff --git a/src/cmd/INIT/cc.linux.i386-64-icc b/src/cmd/INIT/cc.linux.i386-64-icc new file mode 100755 index 000000000..4d945bf5c --- /dev/null +++ b/src/cmd/INIT/cc.linux.i386-64-icc @@ -0,0 +1,22 @@ +: linux.i386-64 icc wrapper : 2011-10-18 : + +HOSTTYPE=linux.i386-64-icc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +icc=$(which icc 2>/dev/null) +case $icc in +"") if test -f /etc/profile.d/icc.sh + then . /etc/profile.d/icc.sh + fi + icc=$(which icc 2>/dev/null) + case $icc in + "") echo icc: not found >&2 + exit 127 + ;; + esac + ;; +esac +$icc "$@" diff --git a/src/cmd/INIT/cc.linux.i386-icc b/src/cmd/INIT/cc.linux.i386-icc new file mode 100755 index 000000000..09dc25c08 --- /dev/null +++ b/src/cmd/INIT/cc.linux.i386-icc @@ -0,0 +1,22 @@ +: linux.ia64 icc wrapper : 2011-10-18 : + +HOSTTYPE=linux.ia64-icc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +icc=$(which icc 2>/dev/null) +case $icc in +"") if test -f /etc/profile.d/icc.sh + then . /etc/profile.d/icc.sh + fi + icc=$(which icc 2>/dev/null) + case $icc in + "") echo icc: not found >&2 + exit 127 + ;; + esac + ;; +esac +$icc "$@" diff --git a/src/cmd/INIT/cc.linux.ia64-icc b/src/cmd/INIT/cc.linux.ia64-icc new file mode 100755 index 000000000..09dc25c08 --- /dev/null +++ b/src/cmd/INIT/cc.linux.ia64-icc @@ -0,0 +1,22 @@ +: linux.ia64 icc wrapper : 2011-10-18 : + +HOSTTYPE=linux.ia64-icc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +icc=$(which icc 2>/dev/null) +case $icc in +"") if test -f /etc/profile.d/icc.sh + then . /etc/profile.d/icc.sh + fi + icc=$(which icc 2>/dev/null) + case $icc in + "") echo icc: not found >&2 + exit 127 + ;; + esac + ;; +esac +$icc "$@" diff --git a/src/cmd/INIT/cc.lynxos.i386 b/src/cmd/INIT/cc.lynxos.i386 new file mode 100755 index 000000000..acd0d02d6 --- /dev/null +++ b/src/cmd/INIT/cc.lynxos.i386 @@ -0,0 +1,81 @@ +: lynxos.i386 cc wrapper with -dynamic default : 2005-02-14 : + +HOSTTYPE=lynxos.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=gcc + +link=1 +static=0 +set . "$@" /../ +while : +do shift + case $1 in + /../) break ;; + esac + case $1 in + *.[cChHiI]|*.[cChHiI][pPxX][pPxX]) + set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/x86 "$@" + shift + break + ;; + -o) case $2 in + /../) ;; + *) x=$1 + shift + set . "$@" "$x" + shift + ;; + esac + ;; + -static)static=1 + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" +done +while : +do case $1 in + /../) shift + break + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" + shift +done +case $link:$static in +1:0) static=n ;; +esac +case $static in +n) specs=/tmp/cc$$.specs + trap 'status=$?; rm -f $specs; exit $status' 0 1 2 + echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs + $cc -specs=$specs "$@" + ;; +*) $cc "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.lynxos.ppc b/src/cmd/INIT/cc.lynxos.ppc new file mode 100755 index 000000000..32738f289 --- /dev/null +++ b/src/cmd/INIT/cc.lynxos.ppc @@ -0,0 +1,85 @@ +: lynxos.ppc cc wrapper with -mshared default : 2005-06-01 : + +HOSTTYPE=lynxos.ppc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=gcc + +link=1 +static=0 +set . "$@" /../ +while : +do shift + case $1 in + /../) break ;; + esac + case $1 in + *.[cChHiI]|*.[cChHiI][pPxX][pPxX]) + set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/ppc "$@" + shift + break + ;; + -o) case $2 in + /../) ;; + *) x=$1 + shift + set . "$@" "$x" + shift + ;; + esac + ;; + -static)static=1 + ;; + -mshared) + static=n + continue + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" +done +while : +do case $1 in + /../) shift + break + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" + shift +done +case $link:$static in +1:0) static=n ;; +esac +case $static in +n) specs=/tmp/cc$$.specs + trap 'status=$?; rm -f $specs; exit $status' 0 1 2 + echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs + $cc -specs=$specs -mshared "$@" + ;; +*) $cc "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.mvs.390 b/src/cmd/INIT/cc.mvs.390 new file mode 100755 index 000000000..50bc7d576 --- /dev/null +++ b/src/cmd/INIT/cc.mvs.390 @@ -0,0 +1,279 @@ +: mvs.390 cc wrapper for unix message and exit code semantics : 2012-01-20 : + +HOSTTYPE=mvs.390 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +ar=ar +cc=/bin/c89 +CC=/bin/c++ +ccflags="-D_ALL_SOURCE -Wc,dll" +objmax=60 +tmpfiles= +unbotch= + +# -n as *first* arg shows but does not do +# -Wc,exportall => -Wl,dll +# -Bdynamic => .c,.o dynamic +# -Bstatic => .c,.o static +# *.C => cc=$CC +# *.cpp => cc=$CC +# *.cxx => cc=$CC +# no optimization until the optimizer is fixed: +# -O dropped (no optimization) +# -0 dropped (no optimization) +# -1 -O (default level 1 optimization) +# -2 -2 (maximal level 2 optimization) + +let argc=0 cmp=0 dll=0 libc=0 dynamic=1 dynamic_objc=0 static_objc=0 relc=0 botched=0 +case $1 in +-n) exec=print + shift + ;; +*) exec= + ;; +esac +export _CC_ACCEPTABLE_RC=1 +export _C89_ACCEPTABLE_RC=$_CC_ACCEPTABLE_RC +export _CXX_ACCEPTABLE_RC=$_CC_ACCEPTABLE_RC +case " $* " in +*.C" "*)let dll=2 + cc=$CC + export _CXXSUFFIX=C + ;; +*.cpp" "*)let dll=2 + cc=$CC + export _CXXSUFFIX=cpp + ;; +*.cxx" "*)let dll=2 + cc=$CC + export _CXXSUFFIX=cxx + ;; +esac +exe= +xxx= +while : +do case $# in + 0) break ;; + esac + arg=$1 + case $arg in + -1) arg=-O + ;; + -Bdynamic) + let dynamic=1 + ;; + -Bstatic) + let dynamic=0 + ;; + -c) let cmp=1 + ;; + -D_ALL_SOURCE|-D_ALL_SOURCE=*) + arg= + ;; + -D*[\ \(\)]*) + arg=${arg#-D} + botch_macro[botched]=${arg%%=*} + botch_value[botched]=${arg#*=} + let botched=botched+1 + arg= + ;; + -o) argv[argc]=$arg + let argc=argc+1 + shift + arg=$1 + exe=$arg + rm -f "$exe" + ;; + -[O0]) arg= + ;; + -Wc,dll)arg= + ;; + -Wc,exportall) + let dll=1 + ;; + -Wl,dll)arg= + let dll=1 + ;; + *.c) if [[ $botched != 0 ]] + then src=$arg + arg=${arg##*/} + unbotch="$unbotch ${arg%.c}.o" + arg=__$arg + tmpfiles="$tmpfiles $arg" + { + while [[ $botched != 0 ]] + do let botched=botched-1 + print -r -- "#define ${botch_macro[botched]} ${botch_value[botched]}" + done + cat $src + } > $arg + fi + ;; + *.o) if test 0 != $dynamic + then let dynamic_objc=dynamic_objc+1 + else let static_objc=static_objc+1 + fi + ;; + *.x) a=${arg%.x}.a + if test -f $a + then argv[argc]=$a + let argc=argc+1 + xxx=-Wl,dll + case $a in + ast.a|*/ast.a) + cc="$CC -u_ast_init" + ;; + esac + fi + ;; + esac + case $arg in + ?*) argv[argc]=$arg + let argc=argc+1 + ;; + esac + shift +done + +tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err +tmpfiles="$tmp $tmpfiles" + +# if any dll .o's are in .a then a .x gets generated +# but the native cc doesn't jcl for the .x +# -Wl,dll does that, so we nuke the .x and keep the exe + +test 0 != $dll && xxx= +case $xxx in +?*) case $exe in + ?*) a=${exe##*/} + a=${a%.*} + case $exe in + */*) tmpfiles="$tmpfiles ${exe%/*}/${a}.x" ;; + *) tmpfiles="$tmpfiles ${a}.x" ;; + esac + ;; + esac + ;; +esac +if test 0 != $dll +then if test 0 != $cmp + then xxx="-D_SHARE_EXT_VARS $xxx" + else xxx="-Wl,dll $xxx" + fi +fi +set -- $xxx "${argv[@]}" + +# can't handle more than objmax .o's +# -r into intermediates doesn't work, but the cat trick does +# also, the runtime dll file must be executable but cc -Wl,dll forgets + +if test 0 != $dll -a \( $dynamic_objc -ge $objmax -o 0 != $static_objc \) +then unset argv + argc=0 libc=0 dynamic=1 dynamic_objc=0 static_objc=0 endc=0 + while : + do case $# in + 0) break ;; + esac + case $1 in + -Bdynamic) + let dynamic=1 + ;; + -Bstatic) + let dynamic=0 + ;; + *.o) if test 0 != $dynamic + then dynamic_objv[dynamic_objc]=$1 + let dynamic_objc=dynamic_objc+1 + else static_objv[static_objc]=$1 + let static_objc=static_objc+1 + fi + ;; + -l*) libv[libc]=$1 + let libc=libc+1 + ;; + -o) argv[argc]=$1 + let argc=argc+1 + shift + argv[argc]=$1 + let argc=argc+1 + exe=$1 + ;; + *) argv[argc]=$1 + let argc=argc+1 + ;; + esac + shift + done + if test 0 != $static_objc + then case $exe in + ?*) $exec $ar cr ${exe%.*}.a "${static_objv[@]}" ;; + esac + fi + if test 0 != $dynamic_objc + then cat=0.0.o + tmpfiles="$tmpfiles $cat" + cat "${dynamic_objv[@]}" > $cat || exit + else cat= + fi + set -- "${argv[@]}" $cat "${libv[@]}" +fi + +# grep through the warning/error messages to get the true exit code +# some annoying messages are dropped while we're at it + +trap 'rm -f $tmpfiles' 0 1 2 15 +$exec $cc $ccflags "$@" 2> $tmp +code=$? +for i in $unbotch +do test -f __$i && mv __$i $i +done +typeset -l lc +while : +do if read line + then lc=$line + case $lc in + *'#include file'*'not found'*) + code=1 + ;; + *'#pragma ignored'*) + continue + ;; + *'definition side file is not defined'*) + continue + ;; + *'step ended with return code 4'*) + code=0 + continue + ;; + *'step ended with return code'*) + code=1 + continue + ;; + *'try again'*) + code=1 + continue + ;; + *'unknown preprocessing directive'*) + code=1 + case $lc in + 'warning '*) + set -- $line + shift + line=$* + ;; + esac + ;; + *'unresolved writable static references are detected'*) + test 0 != $dll && continue + ;; + esac + else case $code:$exe in + 0:?*) $exec chmod +x $exe ;; + esac + exit $code + fi + echo "$line" >&2 +done < $tmp diff --git a/src/cmd/INIT/cc.next.i386 b/src/cmd/INIT/cc.next.i386 new file mode 100755 index 000000000..16df7093a --- /dev/null +++ b/src/cmd/INIT/cc.next.i386 @@ -0,0 +1,158 @@ +: next.i386 cc wrapper for unix message and exit code semantics : 1995-05-09 : + +HOSTTYPE=next.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# 1995-05-09 -lposix termios.o waitpid.o setpgid.o *do* work +# 1994-11-04 -posix has old redirection hole bug +# -D_POSIX_SOURCE requires manual fixes +# libexpr/exeval.c bombs -O, no -O ok + +command=cc +cc="/bin/cc -D_POSIX_SOURCE" +nooptimize="exeval" + +# first check $INSTALLROOT/botch + +case $INSTALLROOT in +"") echo "$command: INSTALLROOT: must be defined and exported" >&2; exit 1 ;; +esac +if test ! -d $INSTALLROOT/botch -a -dryrun != "$1" +then if mkdir $INSTALLROOT/botch + then : ok to initialize + else echo "$command: $INSTALLROOT/botch must be initialized by the owner of $INSTALLROOT" 2>&1 + exit 1 + fi + ( + cd $INSTALLROOT/botch + dir=. + for i in lib . include sys + do case $i in + .) dir=. + ;; + *) case $i in + /*) dir=$i ;; + *) dir=$dir/$i ;; + esac + test -d $dir || mkdir $dir + ;; + esac + done + if test ! -f include/sys/dirent.h + then echo "#include " > tmp.c + header=`$cc -E tmp.c | sed -e '/^#[ ]*1[ ].*\/sys\/dirent\.h"/!d' -e 's/.*"\(.*\)".*/\1/'` + sed -e 's/[ ]off_t[ ][ ]*d_off[ ]*;//' $header > include/sys/dirent.h + fi + if test ! -f lib/libbotch.a + then lipo /usr/lib/libposix.a -thin i386 -output tmp.a + ar x tmp.a termios.o waitpid.o setpgid.o + ar cr lib/libbotch.a *.o + ranlib lib/libbotch.a + fi + rm -f *.[aco] + ) +fi + +# now slip in our args + +case $nooptimize in +"") nooptimize=. + ;; +*) optimize= + for arg in $nooptimize + do case $optimize in + ?*) optimize="$optimize|" ;; + esac + optimize="$optimize$arg.[ci]|*/$arg.[ci]" + done + nooptimize=$optimize + ;; +esac +set . "$@" . +noexec= +library= +local= +optimize= +verbose= +while : +do shift + arg=$1 + shift + case $arg in + .) break + ;; + -[cES]) library=1 + ;; + -O) optimize=1 + ;; + -v) verbose=1 + ;; + -dryrun)noexec=1 + verbose=1 + ;; + -I-) case $local in + "") local=1 + set . "$@" -I$INSTALLROOT/botch/include -I- -I$INSTALLROOT/botch/include + ;; + *) set . "$@" -I- -I$INSTALLROOT/botch/include + ;; + esac + continue + ;; + -I*|*.[cChHiI]|*.[cChHiI][pPxX][pPxX]) + case $optimize in + 1) eval " + case \$arg in + $nooptimize) + optimize=0 + ;; + esac + " + ;; + esac + case $local in + "") local=1 + set . "$@" -I$INSTALLROOT/botch/include "$arg" + continue + ;; + esac + ;; + -last|*/libast.a) + case $library in + "") library=1 + set . "$@" $INSTALLROOT/botch/lib/libbotch.a "$arg" $INSTALLROOT/botch/lib/libbotch.a + continue + ;; + esac + ;; + esac + set . "$@" "$arg" +done +case $library in +"") set . "$@" $INSTALLROOT/botch/lib/libbotch.a + shift + ;; +esac +case $optimize in +0) set . "$@" . + while : + do shift + arg=$1 + shift + case $arg in + .) break ;; + -O) set . "$@" ;; + *) set . "$@" "$arg" ;; + esac + done + ;; +esac +case $verbose in +?*) echo $cc "$@" ;; +esac +case $noexec in +"") $cc "$@" ;; +esac diff --git a/src/cmd/INIT/cc.next.m68k b/src/cmd/INIT/cc.next.m68k new file mode 100755 index 000000000..1c2f8b5ca --- /dev/null +++ b/src/cmd/INIT/cc.next.m68k @@ -0,0 +1,9 @@ +: next.m68k cc wrapper that enables posix : 2000-12-15 : + +HOSTTYPE=next.m68k + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/bin/cc -posix -Xlinker -m "$@" diff --git a/src/cmd/INIT/cc.openbsd b/src/cmd/INIT/cc.openbsd new file mode 100755 index 000000000..fb8916729 --- /dev/null +++ b/src/cmd/INIT/cc.openbsd @@ -0,0 +1,9 @@ +: OpenBSD cc wrapper + +HOSTTYPE=openbsd.generic + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +exec /usr/bin/cc -P "$@" diff --git a/src/cmd/INIT/cc.osf.alpha b/src/cmd/INIT/cc.osf.alpha new file mode 100755 index 000000000..fe19bb4fc --- /dev/null +++ b/src/cmd/INIT/cc.osf.alpha @@ -0,0 +1,9 @@ +: osf.alpha cc wrapper with reasonable namespace defaults : 1998-02-04 : + +HOSTTYPE=osf.alpha + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/usr/bin/cc -std -Dnoshare=_noshare_ -Dreadonly=_readonly_ "$@" diff --git a/src/cmd/INIT/cc.pentium4 b/src/cmd/INIT/cc.pentium4 new file mode 100755 index 000000000..8794cda1c --- /dev/null +++ b/src/cmd/INIT/cc.pentium4 @@ -0,0 +1,26 @@ +: linux.pentium4 gcc wrapper : 2005-10-24 : + +HOSTTYPE=linux.pentium4 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +case " $* " in +*" -O "*) + set -A argv -- "$@" + set -A nargv + integer i j + for ((i = j = 0; i < ${#argv[@]}; i++)) + do if [[ ${argv[i]} == -O ]] + then nargv[j++]=-O3 + nargv[j++]=-march=pentium4 + else nargv[j++]=${argv[i]} + fi + done + gcc "${nargv[@]}" + exit + ;; +esac + +gcc "$@" diff --git a/src/cmd/INIT/cc.sco.i386 b/src/cmd/INIT/cc.sco.i386 new file mode 100755 index 000000000..d0cba572d --- /dev/null +++ b/src/cmd/INIT/cc.sco.i386 @@ -0,0 +1,9 @@ +: sco.i386 cc wrapper with reasonable binary and namespace : 1998-02-04 : + +HOSTTYPE=sco.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/bin/cc -b elf -D_SVID3 "$@" diff --git a/src/cmd/INIT/cc.sgi.mips2 b/src/cmd/INIT/cc.sgi.mips2 new file mode 100755 index 000000000..a0e5d33f9 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips2 @@ -0,0 +1,68 @@ +: sgi.mips2 cc wrapper that generates mips2 binaries : 2006-02-14 : + +HOSTTYPE=sgi.mips2 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags=-OPT:Olimit=0 +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +if test -d /usr/lib32 +then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@" +else $cc -mips2 $flags $ignore "$@" +fi diff --git a/src/cmd/INIT/cc.sgi.mips3 b/src/cmd/INIT/cc.sgi.mips3 new file mode 100755 index 000000000..426317ac0 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips3 @@ -0,0 +1,110 @@ +: sgi.mips3 cc wrapper that generates mips3 binaries : 2007-04-27 : + +HOSTTYPE=sgi.mips3 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# ld: +# 15 +# 84 +# 85 +# 134 +# cc: +# 1685 (first!!) Invalid error number: X. +# 1035 cpp #error -- 0 exit status by default - botch botch botch +# 1048 +# 1155 +# 1171 The indicated expression has no effect. +# 1184 "=" is used where where "==" may have been intended. +# 1209 The controlling expression is constant. +# 1343 +# 3169 X not marked as intrinsic because it is not yet declared +# 3170 X not marked as intrinsic because it is not yet declared +# 3421 expecting function name #pragma intrinsic (X) +# 3433 X not marked as intrinsic because it is not yet declared +# 3434 X not marked as intrinsic because it is not yet declared + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags=-OPT:Olimit=0 +fatal=1035 +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3421,3433,3434 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $fatal in +?*) fatal="-diag_error $fatal" ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +case $1 in +-mips2) if test -d /usr/lib32 + then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@" + else $cc -mips2 $flags $ignore "$@" + fi + ;; +-mips4) case " $* " in + *" -ldl "*) + integer n=0 + for i + do case $i in + -ldl) ;; + *) a[n++]=$i ;; + esac + done + set -- ${a[@]} + esac + $cc -64 -mips4 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +*) $cc -n32 -mips3 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.sgi.mips3-o32 b/src/cmd/INIT/cc.sgi.mips3-o32 new file mode 100755 index 000000000..a9c6c9cb9 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips3-o32 @@ -0,0 +1,65 @@ +: sgi.mips3-o32 cc wrapper that generates mips3 o32 binaries : 2006-02-14 : + +HOSTTYPE=sgi.mips3-o32 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags= +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +$cc -o32 -mips3 $flags $dynamic $ldignore $ignore "$@" diff --git a/src/cmd/INIT/cc.sgi.mips4 b/src/cmd/INIT/cc.sgi.mips4 new file mode 100755 index 000000000..1300cd2af --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips4 @@ -0,0 +1,90 @@ +: sgi.mips4 cc wrapper that generates mips4 binaries : 2007-04-27 : + +HOSTTYPE=sgi.mips4 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags=-OPT:Olimit=0 +fatal=1035 +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $fatal in +?*) fatal="-diag_error $fatal" ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +case $1 in +-mips2) if test -d /usr/lib32 + then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@" + else $cc -mips2 $flags $ignore "$@" + fi + ;; +-mips3) $cc -n32 -mips3 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +*) case " $* " in + *" -ldl "*) + integer n=0 + for i + do case $i in + -ldl) ;; + *) a[n++]=$i ;; + esac + done + set -- ${a[@]} + esac + $cc -64 -mips4 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.sgi.mips4-n32 b/src/cmd/INIT/cc.sgi.mips4-n32 new file mode 100755 index 000000000..0e1b562b1 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips4-n32 @@ -0,0 +1,65 @@ +: sgi.mips4-n32 cc wrapper that generates mips4 n32 binaries : 2006-02-14 : + +HOSTTYPE=sgi.mips4-n32 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags= +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +$cc -n32 -mips4 $flags $dynamic $ldignore $ignore "$@" diff --git a/src/cmd/INIT/cc.sol11.i386 b/src/cmd/INIT/cc.sol11.i386 new file mode 100755 index 000000000..9f2a9dad6 --- /dev/null +++ b/src/cmd/INIT/cc.sol11.i386 @@ -0,0 +1,18 @@ +: solaris.i386 cc wrapper for reasonable ansi C defaults and 32 bit : 2021-01-17 : + +HOSTTYPE=sol11.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# Solaris build scripts set $CC_EXPLICIT. If not set, function without it. +case ${CC_EXPLICIT:=$CC} in +'' | cc) + PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc' + CC_EXPLICIT=cc +esac + +# Note: the _XPG6 macro is now defined in src/lib/libast/features/common + +$CC_EXPLICIT -m32 -xc99 "$@" diff --git a/src/cmd/INIT/cc.sol11.i386-64 b/src/cmd/INIT/cc.sol11.i386-64 new file mode 100755 index 000000000..116d0881c --- /dev/null +++ b/src/cmd/INIT/cc.sol11.i386-64 @@ -0,0 +1,18 @@ +: solaris.i386-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2021-01-17 : + +HOSTTYPE=sol11.i386-64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# Solaris build scripts set $CC_EXPLICIT. If not set, function without it. +case ${CC_EXPLICIT:=$CC} in +'' | cc) + PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc' + CC_EXPLICIT=cc +esac + +# Note: the _XPG6 macro is now defined in src/lib/libast/features/common + +$CC_EXPLICIT -m64 -xc99 "$@" diff --git a/src/cmd/INIT/cc.sol11.sparc b/src/cmd/INIT/cc.sol11.sparc new file mode 100755 index 000000000..d9f238166 --- /dev/null +++ b/src/cmd/INIT/cc.sol11.sparc @@ -0,0 +1,18 @@ +: solaris.sparc cc wrapper for reasonable ansi C defaults and 32 bit : 2021-01-17 : + +HOSTTYPE=sol11.sparc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# Solaris build scripts set $CC_EXPLICIT. If not set, function without it. +case ${CC_EXPLICIT:=$CC} in +'' | cc) + PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc' + CC_EXPLICIT=cc +esac + +# Note: the _XPG6 macro is now defined in src/lib/libast/features/common + +$CC_EXPLICIT -m32 -xc99 "$@" diff --git a/src/cmd/INIT/cc.sol11.sparc-64 b/src/cmd/INIT/cc.sol11.sparc-64 new file mode 100755 index 000000000..c29afed49 --- /dev/null +++ b/src/cmd/INIT/cc.sol11.sparc-64 @@ -0,0 +1,18 @@ +: solaris.sparc-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2021-01-17 : + +HOSTTYPE=sol11.sparc-64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# Solaris build scripts set $CC_EXPLICIT. If not set, function without it. +case ${CC_EXPLICIT:=$CC} in +'' | cc) + PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc' + CC_EXPLICIT=cc +esac + +# Note: the _XPG6 macro is now defined in src/lib/libast/features/common + +$CC_EXPLICIT -m64 -xc99 "$@" diff --git a/src/cmd/INIT/cc.specialize b/src/cmd/INIT/cc.specialize new file mode 100755 index 000000000..87077b5a9 --- /dev/null +++ b/src/cmd/INIT/cc.specialize @@ -0,0 +1,35 @@ +: -O* specialization cc wrapper : 2011-11-11 : + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=cc + +CCREPLACE='' # these (possibly empty) options replace -O* +CCALWAYS='' # these (possibly empty) options always set + +case $CCREPLACE in +'') ;; +*) case " $* " in + *" -O"*) + set '' "$@" '' + shift + while : + do a=$1 + shift + case $a in + '') break + ;; + -O*) set '' "$@" $CCREPLACE + ;; + *) set '' "$@" "$a" + ;; + esac + shift + done + ;; + esac + ;; +esac +$cc $CCALWAYS "$@" diff --git a/src/cmd/INIT/cc.unix.mc68k b/src/cmd/INIT/cc.unix.mc68k new file mode 100755 index 000000000..ebdfa0d1c --- /dev/null +++ b/src/cmd/INIT/cc.unix.mc68k @@ -0,0 +1,76 @@ +: 3B1/PC7300 unix.mc68k cc wrapper for ANSI C : 2002-09-01 : + +HOSTTYPE=unix.mc68k + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# /bin/cc predates ANSI C; use gcc +# some headers depend on SYSTEM5 or mc68k being defined +# headers for Ethernet software are under /usr/ethernet/include +# both /usr/lib/libnet.a and /usr/lib/libcurses.a define select() +# -lcurses uses a version of select for napms(), but that +# implementation always returns an error if given file +# descriptors to watch +# the one in -lnet must be used if fds (instead of or in addition to +# a timeout) are of interest therefore, -lnet should be +# specified before -lcurses +# rename(old, new) in /usr/lib/libnet.a fails if new exists +# (permitted by ANSI/ISO C-1990 7.9.4.2) +# gcc -fpic doesn't work as there's no _GLOBAL_OFFSET_TABLE symbol + +cc="gcc" + +exec= +show=: +inc=0 +lib=0 +set '' -DSYSTEM5 -Dmc68k "$@" '' +shift +while : +do a=$1 + shift + case $a in + '') break + ;; + -lcurses|libcurses.a|*/libcurses.a) + lib=1 + set '' "$@" -lnet + shift + ;; + -lnet|libnet.a|*/libnet.a) + lib=1 + ;; + -o) a=$1 + shift + set '' "$@" -o + shift + ;; + -fpic) continue + ;; + -n) exec=: + continue + ;; + -v) show=echo + continue + ;; + -*) ;; + *) case $inc in + 0) inc=1 + set '' "$@" -I/usr/ethernet/include + shift + ;; + esac + ;; + esac + set '' "$@" "$a" + shift +done +case $lib in +0) set '' "$@" -lnet + shift + ;; +esac +$show $cc "$@" +$exec $cc "$@" diff --git a/src/cmd/INIT/cc.unixware.i386 b/src/cmd/INIT/cc.unixware.i386 new file mode 100755 index 000000000..b1b1a2cb7 --- /dev/null +++ b/src/cmd/INIT/cc.unixware.i386 @@ -0,0 +1,9 @@ +: unixware.i386 cc wrapper + +HOSTTYPE=unixware.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/bin/cc -D_XOPEN_UNIX -D_XOPEN_SOURCE_EXTENDED "$@" diff --git a/src/cmd/INIT/crossexec.sh b/src/cmd/INIT/crossexec.sh new file mode 100644 index 000000000..cedbccf8c --- /dev/null +++ b/src/cmd/INIT/crossexec.sh @@ -0,0 +1,141 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: cross compiler a.out execution + +(command set -o posix) 2>/dev/null && set -o posix + +command=crossexec + +tmp=/tmp/cross$$ + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: crossexec (AT&T Labs Research) 2004-01-04 $ +] +'$USAGE_LICENSE$' +[+NAME?crossexec - cross compiler a.out execution] +[+DESCRIPTION?\bcrossexec\b runs a cross-compiled \acommand\a in an environment + that supports a cross-compilation architecture different from the + current host. The cross environment is determined by \acrosstype\a, + usually a host type name produced by \bpackage\b(1). \acrosstype\a + is used to find an entry in \b$HOME/.crossexec\b that specifies + the cross compiler host and access details.] +[+?The exit status of \bcrossexec\b is the exit status of \acommand\a.] +[+CROSS ENVIRONMENT FILE?\b$HOME/.crossexec\b contains one line for each + supported \acrosstype\a. Each line contains 5 tab separated fields. + Field default values are specified as \b-\b. The fields are:]{ + [+crosstype?The host type produced by \bpackage\b(1).] + [+host?The host name.] + [+user?The user name on \ahost\a. The default is the current user.] + [+dir?The directory to copy \acommand\a and execute it. The default + is the \auser\a \b$HOME\b on \ahost\a.] + [+shell?The command used to get shell access to \ahost\a. Currently + only \brsh\b and \bssh\b are supported.] + [+copy?The command used to copy \acommand\a to \ahost\a. Currently + only \brcp\b and \bscp\b are supported.] +} +[n:show?Show the underlying commands but do not execute.] + +crosstype command [ option ... ] [ file ... ] + +[+SEE ALSO?\brcp\b(1), \brsh\b(1), \bscp\b(1), \bssh\b(1)] +' + ;; +*) ARGV0="" + USAGE="crosstype command [ option ... ] [ file ... ]" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +exec= + +# get the options and operands + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + n) exec=echo ;; + *) usage ;; + esac +done +shift $OPTIND-1 +case $# in +[01]) usage ;; +esac + +type=$1 +shift +cmd=$1 +shift + +# get the host info + +info=$HOME/.$command +if test ! -r $info +then echo "$command: $info: not found" >&2 + exit 1 +fi +ifs=${IFS-' + '} +while : +do IFS=' ' + read hosttype hostname usr dir sh cp + code=$? + IFS=$ifs + case $code in + 0) ;; + *) echo "$command: $type: unknown cross compiler host type" >&2 + exit 1 + ;; + esac + case $hosttype in + $type) break ;; + esac +done < $info + +# fill in the defaults + +case $usr in +-) cpu= shu= ;; +*) cpu=${usr}@ shu="-l $usr" ;; +esac +case $dir in +-) dir= ;; +esac +case $sh in +''|-) sh=ssh ;; +esac +case $cp in +''|-) cp=scp ;; +scp) cp="$cp -q" ;; +esac + +trap "rm -f $tmp" 0 1 2 3 15 +$exec $cp $cmd $cpu$hostname:$dir /dev/null; code=\$?; rm -f $cmd; echo $command: exit \$code >&2" $tmp +exit `sed -e '/^'$command': exit [0-9][0-9]*$/!d' -e 's/.* //' $tmp` diff --git a/src/cmd/INIT/db.c b/src/cmd/INIT/db.c new file mode 100644 index 000000000..5a3a7c1ae --- /dev/null +++ b/src/cmd/INIT/db.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for sleepycat dbm compatibility + */ + +#define DB_DBM_HSEARCH 1 + +#if DB_DBM_HSEARCH +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/ditto.sh b/src/cmd/INIT/ditto.sh new file mode 100644 index 000000000..312f7022a --- /dev/null +++ b/src/cmd/INIT/ditto.sh @@ -0,0 +1,460 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: replicate directory hierarchies + +COMMAND=ditto +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $COMMAND" + USAGE=$' +[-? +@(#)$Id: ditto (AT&T Labs Research) 2010-11-22 $ +] +'$USAGE_LICENSE$' +[+NAME?ditto - replicate directory hierarchies] +[+DESCRIPTION?\bditto\b replicates the \asource\a directory hierarchy + to the \adestination\a directory hierarchy. Both \asource\a and + \adestination\a may be of the form + [\auser\a@]][\ahost\a:]][\adirectory\a]]. At least one of + \ahost\a: or \adirectory\a must be specified. The current user is used + if \auser@\a is omitted, the local host is used if \ahost\a: is + omitted, and the user home directory is used if \adirectory\a is + omitted.] +[+?Remote hosts and files are accessed via \bssh\b(1) or \brsh\b(1). \bksh\b(1), + \bpax\b(1), and \btw\b(1) must be installed on the local and remote hosts.] +[+?For each source file \bditto\b does one of these actions:]{ + [+chmod|chown?change the mode and/or ownership of the destination + file to match the source] + [+copy?copy the source file to the destination] + [+delete?delete the destination file] + [+skip?the destination file is not changed] +} +[+?The source and destination hierarchies are generated by \btw\b(1) with + the \b--logical\b option. An \b--expr\b option may + be specified to prune the search. The \btw\b searches are relative to + the \asource\a and \adestination\a directories.] +[c:checksum?Copy if the \btw\b(1) 32x4 checksum mismatches.] +[d:delete?Delete \adestination\a files that are not in the \asource\a.] +[e:expr?\btw\b(1) select expression.]:[tw-expression] +[m!:mode?Preserve file mode.] +[n:show?Show the operations but do not execute.] +[o:owner?Preserve file user and group ownership.] +[p:physical?Generate source and destination hierarchies by \btw\b(1) with + the \b--physical\b option.] +[r:remote?The remote access protocol; either \bssh\b or + \brsh\b.]:[protocol:=ssh] +[u:update?Copy only if the \asource\a file is newer than the + \adestination\a file.] +[v:verbose?Trace the operations as they are executed.] +[D:debug?Enable the debug trace.] + +source destination + +[+SEE ALSO?\brdist\b(1), \brsync\b(1), \brsh\b(1), \bssh\b(1), \btw\b(1)] +' + ;; +*) ARGV0="" + USAGE="de:[tw-expression]mnouvD source destination" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +parse() # id user@host:dir +{ + typeset id dir user host + id=$1 + dir=$2 + (( debug || ! exec )) && print -r $id $dir + if [[ $dir == *@* ]] + then + user=${dir%%@*} + dir=${dir#${user}@} + else + user= + fi + if [[ $dir == *:* ]] + then + host=${dir%%:*} + dir=${dir#${host}:} + else + host= + fi + if [[ $user ]] + then + user="-l $user" + if [[ ! $host ]] + then + host=$(hostname) + fi + fi + eval ${id}_user='$user' + eval ${id}_host='$host' + eval ${id}_dir='$dir' +} + +# initialize + +typeset -A chown chmod +typeset tw cp rm link +integer ntw=0 ncp=0 nrm=0 nlink=0 n + +typeset src_user src_host src_path src_type src_uid src_gid src_perm src_sum +typeset dst_user dst_host dst_path dst_type dst_uid dst_gid dst_perm dst_sum +integer src_size src_mtime src_eof +integer dst_size dst_mtime dst_eof + +integer debug=0 delete=0 exec=1 mode=1 owner=0 update=0 verbose=0 logical + +typeset remote=ssh trace +typeset checksum='"-"' pax="pax" +typeset paxreadflags="" paxwriteflags="--write --format=tgz --nosummary" + +tw[ntw++]=tw +(( logical=ntw )) +tw[ntw++]=--logical +tw[ntw++]=--chop +tw[ntw++]=--ignore-errors +tw[ntw++]=--expr=sort:name + +# grab the options + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + c) checksum=checksum ;; + d) delete=1 ;; + e) tw[ntw++]=--expr=\"$OPTARG\" ;; + m) mode=0 ;; + n) exec=0 verbose=1 ;; + o) owner=1 ;; + p) tw[logical]=--physical ;; + r) remote=$OPTARG ;; + u) update=1 ;; + v) verbose=1 ;; + D) debug=1 ;; + *) usage ;; + esac +done +shift $OPTIND-1 +if (( $# != 2 )) +then usage +fi +tw[ntw++]=--expr=\''action:printf("%d\t%d\t%s\t%s\t%s\t%-.1s\t%o\t%s\t%s\n", size, mtime, '$checksum', uid, gid, mode, perm, path, symlink);'\' +if (( exec )) +then + paxreadflags="$paxreadflags --read" +fi +if (( verbose )) +then + paxreadflags="$paxreadflags --verbose" +fi + +# start the source and destination path list generators + +parse src "$1" +parse dst "$2" + +# the |& command may exit before the exec &p +# the print sync + read delays the |& until the exec &p finishes + +if [[ $src_host ]] +then ($remote $src_user $src_host "{ test ! -f .profile || . ./.profile ;} && cd $src_dir && read && ${tw[*]}") 2>&1 |& +else (cd $src_dir && read && eval "${tw[@]}") 2>&1 |& +fi +exec 5<&p 7>&p +print -u7 sync +exec 7>&- + +if [[ $dst_host ]] +then ($remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && cd $dst_dir && read && ${tw[*]}") 2>&1 |& +else (cd $dst_dir && read && eval "${tw[@]}") 2>&1 |& +fi +exec 6<&p 7>&p +print -u7 sync +exec 7>&- + +# scan through the sorted path lists + +if (( exec )) +then + src_skip=* + dst_skip=* +else + src_skip= + dst_skip= +fi +src_path='' src_eof=0 +dst_path='' dst_eof=0 +ifs=${IFS-$' \t\n'} +IFS=$'\t' +while : +do + # get the next source path + + if [[ ! $src_path ]] && (( ! src_eof )) + then + if read -r -u5 text src_mtime src_sum src_uid src_gid src_type src_perm src_path src_link + then + if [[ $text != +([[:digit:]]) ]] + then + print -u2 $COMMAND: source: "'$text'" + src_path= + continue + fi + src_size=$text + elif (( dst_eof )) + then + break + elif (( src_size==0 )) + then + exit 1 + else + src_path= + src_eof=1 + fi + fi + + # get the next destination path + + if [[ ! $dst_path ]] && (( ! dst_eof )) + then + if read -r -u6 text dst_mtime dst_sum dst_uid dst_gid dst_type dst_perm dst_path dst_link + then + if [[ $text != +([[:digit:]]) ]] + then + print -u2 $COMMAND: destination: $text + dst_path= + continue + fi + dst_size=$text + elif (( src_eof )) + then + break + elif (( dst_size==0 )) + then + exit 1 + else + dst_path= + dst_eof=1 + fi + fi + + # determine the { cp rm chmod chown } ops + + if (( debug )) + then + [[ $src_path ]] && print -r -u2 -f $': src %8s %10s %s %s %s %s %3s %s\n' $src_size $src_mtime $src_sum $src_uid $src_gid $src_type $src_perm "$src_path" + [[ $dst_path ]] && print -r -u2 -f $': dst %8s %10s %s %s %s %s %3s %s\n' $dst_size $dst_mtime $dst_sum $dst_uid $dst_gid $dst_type $dst_perm "$dst_path" + fi + if [[ $src_path == $dst_path ]] + then + if [[ $src_type != $dst_type ]] + then + rm[nrm++]=$dst_path + if [[ $dst_path != $dst_skip ]] + then + if [[ $dst_type == d ]] + then + dst_skip="$dst_path/*" + print -r rm -r "'$dst_path'" + else + dst_skip= + print -r rm "'$dst_path'" + fi + fi + fi + if [[ $src_type == l ]] + then if [[ $src_link != $dst_link ]] + then + cp[ncp++]=$src_path + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r cp "'$src_path'" + fi + fi + elif [[ $src_type != d ]] && { (( update && src_mtime > dst_mtime )) || (( ! update )) && { (( src_size != dst_size )) || [[ $src_sum != $dst_sum ]] ;} ;} + then + if [[ $src_path != . ]] + then + cp[ncp++]=$src_path + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r cp "'$src_path'" + fi + fi + else + if (( owner )) && [[ $src_uid != $dst_uid || $src_gid != $dst_gid ]] + then + chown[$src_uid.$src_gid]="${chown[$src_uid.$src_gid]} '$src_path'" + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r chown $src_uid.$src_gid "'$src_path'" + fi + if (( (src_perm & 07000) || mode && src_perm != dst_perm )) + then + chmod[$src_perm]="${chmod[$src_perm]} '$src_path'" + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r chmod $src_perm "'$src_path'" + fi + fi + elif (( mode && src_perm != dst_perm )) + then + chmod[$src_perm]="${chmod[$src_perm]} '$src_path'" + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r chmod $src_perm "'$src_path'" + fi + fi + fi + src_path= + dst_path= + elif [[ ! $dst_path || $src_path && $src_path < $dst_path ]] + then + if [[ $src_path != . ]] + then + cp[ncp++]=$src_path + if [[ $src_path != $src_skip ]] + then + if [[ $src_type == d ]] + then + src_skip="$src_path/*" + print -r cp -r "'$src_path'" + else + src_skip= + print -r cp "'$src_path'" + fi + fi + fi + src_path= + elif [[ $dst_path ]] + then + if (( delete )) + then + rm[nrm++]=$dst_path + if [[ $dst_path != $dst_skip ]] + then + if [[ $dst_type == d ]] + then + dst_skip="$dst_path/*" + print -r rm -r "'$dst_path'" + else + dst_skip= + print -r rm "'$dst_path'" + fi + fi + fi + dst_path= + fi +done +IFS=$ifs + +(( exec )) || exit 0 + +# generate, transfer and execute the { rm chown chmod } script + +if (( ${#rm[@]} || ${#chmod[@]} || ${#chown[@]} )) +then + { + if (( verbose )) + then + print -r -- set -x + fi + print -nr -- cd "'$dst_dir'" + n=0 + for i in ${rm[@]} + do + if (( --n <= 0 )) + then + n=32 + print + print -nr -- rm -rf + fi + print -nr -- " '$i'" + done + for i in ${!chown[@]} + do + n=0 + for j in ${chown[$i]} + do + if (( --n <= 0 )) + then + n=32 + print + print -nr -- chown $i + fi + print -nr -- " $j" + done + done + for i in ${!chmod[@]} + do + n=0 + for j in ${chmod[$i]} + do + if (( --n <= 0 )) + then + n=32 + print + print -nr -- chmod $i + fi + print -nr -- " $j" + done + done + print + } | { + if (( ! exec )) + then + cat + elif [[ $dst_host ]] + then + $remote $dst_user $dst_host sh + else + $SHELL + fi + } +fi + +# generate, transfer and read back the { cp } tarball + +if (( ${#cp[@]} )) +then + { + cd $src_dir && + print -r -f $'%s\n' "${cp[@]}" | + $pax $paxwriteflags + } | { + if [[ $dst_host ]] + then + $remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && { test -d \"$dst_dir\" || mkdir -p \"$dst_dir\" ;} && cd \"$dst_dir\" && gunzip | $pax $paxreadflags" + else + ( { test -d "$dst_dir" || mkdir -p "$dst_dir" ;} && cd "$dst_dir" && gunzip | $pax $paxreadflags ) + fi + } + wait +fi diff --git a/src/cmd/INIT/dl.c b/src/cmd/INIT/dl.c new file mode 100644 index 000000000..c710ad6a5 --- /dev/null +++ b/src/cmd/INIT/dl.c @@ -0,0 +1,33 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -ldl + */ + +#ifndef dlopen +#include +#endif + +int +main() +{ + dlopen("libdl.so",0); + return 0; +} diff --git a/src/cmd/INIT/execrate.sh b/src/cmd/INIT/execrate.sh new file mode 100644 index 000000000..50735dcc9 --- /dev/null +++ b/src/cmd/INIT/execrate.sh @@ -0,0 +1,187 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: wrapper for .exe challenged win32 systems/commands + +(command set -o posix) 2>/dev/null && set -o posix + +command=execrate + +bins=` + ( + userPATH=$PATH + PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH + getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH" + ) | sed 's/:/ /g' +` || exit + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: execrate (AT&T Labs Research) 2002-02-02 $ +] +'$USAGE_LICENSE$' +[+NAME?execrate - wrapper for .exe challenged commands] +[+DESCRIPTION?\bexecrate\b runs \acommand\a after checking the \afile\a + operands for standard semantics with respect to \bwin32\b \b.exe\b + suffix conventions. This command is only needed on \bwin32\b + systems that inconsistently handle \b.exe\b across library and + command interfaces. \acommand\a may be one of \bcat\b(1), \bchmod\b(1), + \bcmp\b(1), \bcp\b(1), \bln\b(1), \bmv\b(1), or \brm\b(1). + Only the 2 argument forms of \bcp\b, \bln\b and \bmv\b are handled. + Unsupported commands and commands requiring no change are + silently executed.] +[+?With no arguments \bexecrate\b exits with status 0 if the current system + is \b.exe\b challenged, 1 if the current system is normal.] +[n:show?Show the underlying commands but do not execute.] + +command [ option ... ] file ... + +[+SEE ALSO?\bwebster\b(1)] +' + usage() + { + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 + } + exec=1 + while getopts $ARGV0 "$USAGE" OPT + do case $OPT in + n) exec=0 ;; + *) usage ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) usage() + { + echo "Usage: execrate [ -n ] [ command [ option ... ] file ... ]" >&2 + exit 2 + } + exec=1 + while : + do case $1 in + -n) exec=0 ;; + -*) usage ;; + *) break ;; + esac + shift + done + ;; +esac +case $# in +0) if test ! -x /bin/cat.exe + then exit 1 # normal + fi + if /bin/cat /bin/cat >/dev/null 2>&1 + then exit 1 # normal + fi + exit 0 # challenged + ;; +1) usage + ;; +esac +case $1 in +*cat|*rm) + NUM=0 + ;; +*chgrp|*chmod) + NUM=1 + ;; +*cmp|*cp|*ln|*mv) + NUM=2 + ;; +*) case $exec in + 0) echo "$@" ;; + *) "$@" ;; + esac + exit + ;; +esac +CMD=$1 +shift +case $CMD in +*/*) ;; +*) for d in $bins + do if test -x $d/$1 -o -x $d/$1.exe + then CMD=$d/$1 + break + fi + done + ;; +esac +while : +do case $1 in + -*) CMD="$CMD $1" ;; + *) break ;; + esac + shift +done +case $exec in +0) CMD="echo $CMD" ;; +esac +case $NUM:$# in +*:0) ;; +1:*) CMD="$CMD $1" + NUM=0 + shift + ;; +esac +case $NUM:$# in +0:*) status=0 + for f + do if test "$f" -ef "$f".exe + then f=$f.exe + fi + $CMD "$f" + case $? in + 0) ;; + *) status=$? ;; + esac + done + exit $status + ;; +2:2) f=$1 + case $f in + *.exe) ;; + *) if test "$f" -ef "$f".exe + then f=$f.exe + fi + ;; + esac + case $f in + *.exe) if test -d "$2" + then t=$2/$f + else t=$2 + fi + case $t in + */*) b=`basename "$t"` ;; + *) b=$t ;; + esac + case $b in + *.*) $CMD "$f" "$t"; exit ;; + *) $CMD "$f" "$t".exe; exit ;; + esac + ;; + esac + ;; +esac +$CMD "$@" diff --git a/src/cmd/INIT/filter.sh b/src/cmd/INIT/filter.sh new file mode 100644 index 000000000..f1c70448e --- /dev/null +++ b/src/cmd/INIT/filter.sh @@ -0,0 +1,102 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: convert command that operates on file args to pipeline filter + +(command set -o posix) 2>/dev/null && set -o posix + +command=filter + +TMPDIR=${TMPDIR:-/tmp} +export TMPDIR +tmp=$TMPDIR/$command$$ +suf= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: filter (AT&T Labs Research) 2001-05-31 $ +] +'$USAGE_LICENSE$' +[+NAME?filter - run a command in stdin/stdout mode] +[+DESCRIPTION?\bfilter\b runs \acommand\a in a mode that takes input from + the \afile\a operands, or from the standard input if no \afile\a + operands are specified, and writes the results to the standard output. + It can be used to run commands like \bsplit\b(1), that normally modify + \afile\a operands in-place, in pipelines. The \afile\a operands are + not modified; \acommand\a is run on copies in \b/tmp\b.] + +command [ option ... ] [ file ... ] + +[+SEE ALSO?\bstrip\b(1)] +' + ;; +*) ARGV0="" + USAGE="command [ option ... ] [ file ... ]" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + *) usage ;; + esac +done +shift `expr $OPTIND - 1` +case $# in +0) usage ;; +esac + +cmd=$1 +while : +do shift + case $# in + 0) break ;; + esac + case $1 in + -*) cmd="$cmd $1" ;; + *) break ;; + esac +done +trap 'rm -f $tmp$suf' 0 1 2 3 15 +case $# in +0) cat > $tmp + $cmd $tmp + ;; +*) for file + do suf=${file##*/} + case $suf in + *.*) suf=.${suf#*.} ;; + *) suf= ;; + esac + cp $file $tmp$suf || exit 1 + chmod u+rwx $tmp$suf || exit 1 + $cmd $tmp$suf || exit 1 + cat $tmp$suf + rm -f $tmp$suf + done + ;; +esac diff --git a/src/cmd/INIT/gdbm.c b/src/cmd/INIT/gdbm.c new file mode 100644 index 000000000..cc0a9f617 --- /dev/null +++ b/src/cmd/INIT/gdbm.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lgdbm + */ + +#define _hdr_gdbm_ndbm 1 + +#if _hdr_gdbm_ndbm +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/gdbm1.c b/src/cmd/INIT/gdbm1.c new file mode 100644 index 000000000..6ad207140 --- /dev/null +++ b/src/cmd/INIT/gdbm1.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lgdbm + */ + +#define _hdr_gdbm_ndbm 1 + +#if _hdr_gdbm_ndbm +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/gdbm2.c b/src/cmd/INIT/gdbm2.c new file mode 100644 index 000000000..1b9a48f59 --- /dev/null +++ b/src/cmd/INIT/gdbm2.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lgdbm + */ + +#define _hdr_ndbm 1 + +#if _hdr_ndbm +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/hello.c b/src/cmd/INIT/hello.c new file mode 100644 index 000000000..2a8e2d17a --- /dev/null +++ b/src/cmd/INIT/hello.c @@ -0,0 +1,23 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef printf +#include +#endif +int main() { int new = 0; printf("hello world\n"); return new;} diff --git a/src/cmd/INIT/hosttype.tst b/src/cmd/INIT/hosttype.tst new file mode 100644 index 000000000..7a6458848 --- /dev/null +++ b/src/cmd/INIT/hosttype.tst @@ -0,0 +1,6 @@ +hp.pa hostname 9000/730 hp9000s700 HP-UX hostname A.09.01 A +linux-aout.i386 hostname i586 i386 linux hostname 1.1.59 #1 +sgi.mips2 hostname.domain IP22 mips IRIX hostname 5.2 02282016 +osf.alpha hostname.domain alpha alpha OSF1 hostname.domain V3.2 62 +sun4 hostname.domain sun4 sparc SunOS hostname.domain 4.1.1 1 sun4c +sol.sun4 hostname.domain sun4 sparc SunOS hostname.domain 5.4 Generic_101945-13 diff --git a/src/cmd/INIT/hurl.sh b/src/cmd/INIT/hurl.sh new file mode 100644 index 000000000..a1da1eac0 --- /dev/null +++ b/src/cmd/INIT/hurl.sh @@ -0,0 +1,209 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: copy http url data + +(command set -o posix) 2>/dev/null && set -o posix + +command=hurl +agent="$command/2009-01-20 (AT&T Research)" +authorize= +verbose=0 + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: hurl (AT&T Research) 2009-01-20 $ +] +'$USAGE_LICENSE$' +[+NAME?hurl - copy http url data] +[+DESCRIPTION?\bhurl\b copies the data for the \bhttp\b \aurl\a operand + to the standard output. The \aurl\a must be of the form + \b[http://]]\b\ahost\a[\b:\b\aport\a]]\b/\b\apath\a. The default + \aport\a is \b80\b.] +[+?\bhurl\b is a shell script that attempts to access the \aurl\a by + these methods:]{ + [+/dev/tcp/\ahost\a\b/80\b?Supported by \bksh\b(1) and recent + \bbash\b(1).] + [+wget -nv -O - \aurl\a?] + [+lynx -source \aurl\a?] + [+curl -s -L -o - \aurl\a?] +} +[a:authorize?The url authorization user name and password, separated + by \b:\b (one colon character.)]:[user::password] +[s:size?Terminate the data transmission after \abytes\a have been + transferred.]:[bytes] +[v:verbose?Verbose trace.] + +url + +[+SEE ALSO?\bcurl\b(1), \blynx\b(1), \bwget\b(1)] +' + ;; +*) ARGV0="" + USAGE="a:v" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +integer limit=0 total=0 block=8*1024 + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + a) authorize=$OPTARG ;; + s) limit=$OPTARG ;; + v) verbose=1 ;; + esac +done +shift `expr $OPTIND - 1` + +url=$1 +AUTHORIZE= + +exec 9<&0 + +while : +do test 0 != $verbose && echo "$command: url=$url" >&2 + case $url in + *://*/*)prot=${url%%:*} + url=${url#*://} + ;; + *) prot=http + ;; + esac + host=$url + path=/${host#*/} + host=${host%%/*} + case $host in + *:+([0-9])) + port=${host##*:} + host=${host%:*} + ;; + *) port=80 + ;; + esac + test 0 != $verbose && echo "$command: prot=$prot host=$host port=$port path=$path" >&2 + case $prot in + http) if (eval "exec >" || exit 0) 2>/dev/null && + eval "exec 8<> /dev/tcp/\$host/$port" 2>/dev/null + then test 0 != $verbose && echo "$command: using /dev/tcp/$host/$port" >&2 + if ! echo "GET $path HTTP/1.0 +Host: $host +User-Agent: $agent ${AUTHORIZE} + " >&8 + then echo "$command: $host: write error" + exit 1 + fi + { + if ! read prot code text + then echo "$command: $host: read error" >&2 + exit 1 + fi + code=${code%:*} + type=Basic + realm=access + test 0 != $verbose && echo "$command: prot=$prot code=$code $text" >&2 + while : + do if ! read head data + then echo "$command: $host: read error" >&2 + exit 1 + fi + test 0 != $verbose && echo "$command: head=$head $data" >&2 + case $head in + Location:) + case $code in + 30[123])url=$data + continue 2 + ;; + esac + ;; + WWW-Authenticate:) + set -- $data + type=$1 + shift + eval "$@" + realm=${realm%$'\r'} + ;; + ''|?) break + ;; + esac + done + case $code in + 200) if (( limit )) + then (( limit = (limit + block - 1) / block)) + dd bs=$block count=$limit silent=1 + else cat + fi + exit + ;; + 401) { + if [[ $AUTHORIZE || $type != Basic ]] + then print authorization failed + exit 1 + fi + if [[ ! $authorize ]] + then if [[ ! -t 0 ]] + then print authorization failed + exit 1 + fi + print -n "Enter user name for $realm: " + read -u9 user + print -n "Password: " + trap 'stty echo <&9' 0 1 2 3 15 + stty -echo + read password + stty echo + print + trap - 0 1 2 3 15 + authorize=$user:$password + fi + AUTHORIZE=$'\nAuthorization: '$type' '$(print -n -r -- "$authorize" | uuencode -h -x base64)$'\r' + } <&9 >&2 + continue 2 + ;; + *) echo "$0: $url: $code: $text" >&2 + exit 1 + ;; + esac + } <&8 + elif wget ${authorize:+--http-user="${authorize%:*}"} ${password:+--http-passwd="${password##*:}"} -nv -O - $url 2>/dev/null + then test 0 != $verbose && echo "$command: using wget" >&2 + exit + elif lynx ${authorize:+-auth "$authorize"} -source $url 2>/dev/null + then test 0 != $verbose && echo "$command: using wget" >&2 + exit + elif curl ${authorize:+-u "$authorize"} -s -L -o - $url 2>/dev/null + then test 0 != $verbose && echo "$command: using curl" >&2 + exit + else echo "$command: $url: { /dev/tcp/$host/$port wget curl } failed" >&2 + exit 1 + fi + ;; + *) echo "$command: $prot: protocol not supported" >&2 + exit 1 + ;; + esac +done diff --git a/src/cmd/INIT/iconv.c b/src/cmd/INIT/iconv.c new file mode 100644 index 000000000..64f2797d5 --- /dev/null +++ b/src/cmd/INIT/iconv.c @@ -0,0 +1,29 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef iconv +#include +#endif + +int +main() +{ + iconv(0, 0, 0, 0, 0); + return 0; +} diff --git a/src/cmd/INIT/iffe.sh b/src/cmd/INIT/iffe.sh new file mode 100644 index 000000000..6eaaacc2e --- /dev/null +++ b/src/cmd/INIT/iffe.sh @@ -0,0 +1,4674 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# Glenn Fowler & Phong Vo +# AT&T Research +# +# test if feature exists +# this script is written to make it through all sh variants +# +# NOTE: .exe a.out suffix and [\\/] in path patterns for dos/nt + +(command set -o posix) 2>/dev/null && set -o posix +case `uname -s` in +AIX) unset LIBPATH ;; +esac + +command=iffe +version=2012-07-17 # update in USAGE too # + +compile() # $cc ... +{ + "$@" 2>$tmp.err + _compile_status=$? + if test -s $tmp.err + then cat $tmp.err >&2 + case $_compile_status in + [1-9]|[1-9][0-9]|1[01][0-9]|12[0-7]) + if egrep -i -c 'terminated with signal|core dump|segmentation fault' $tmp.err >&$nullout + then _compile_status=139 + fi + ;; + esac + fi + case $_compile_status in + ?|??|1[01]?|12[0-8]|25?) + ;; + *) echo "$command: $@" >&$stderr + cat $tmp.err >&$stderr + echo "$command: $1: core dump or fatal interruption -- results inconclusive" >&$stderr + exit $_compile_status + ;; + esac + return $_compile_status +} + +is_hdr() # [ - ] [ file.c ] hdr +{ + case $1 in + -) _is_hdr_flag=-; shift ;; + *) _is_hdr_flag= ;; + esac + case $1 in + *.c) _is_hdr_file=$1; shift ;; + *) _is_hdr_file=$tmp.c ;; + esac + is hdr $1 + compile $cc -c $_is_hdr_file <&$nullin >&$nullout 2>$tmp.e + _is_hdr_status=$? + case $_is_hdr_status in + 0) if test -s $tmp.e + then case `grep '#.*error' $tmp.e` in + ?*) _is_hdr_status=1 ;; + esac + fi + ;; + esac + case $_is_hdr_status in + 0) success $_is_hdr_flag + ;; + *) case $debug in + 3) cat $tmp.e >&$stderr ;; + esac + failure $_is_hdr_flag + ;; + esac + return $_is_hdr_status +} + +pkg() # package +{ + case $1 in + '') pth=`getconf PATH 2>/dev/null` + case $pth in + '') pth="/bin /usr/bin" ;; + *:*) pth=`echo "$pth" | sed 's/:/ /g'` ;; + esac + return + ;; + '<') shift + ;; + *) return + ;; + esac + case $1 in + X|X11*) i="openwin" + case $1 in + X) set X11 ;; + esac + case $1 in + X11) case $# in + 1) set $1 6 5 4 ;; + esac + ;; + esac + ;; + *) i= + ;; + esac + pth="{ usr . - . contrib local $i - . share - . lib - $1" + i=$1 + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + '>') shift; break ;; + esac + pth="$pth ${i}R$1 ${i}.$1" + done + pth="$pth . } $*" +} + +is() # op name +{ + case $verbose in + 1) case $complete in + 1) failure ;; + esac + oo=$1 + shift + case $1 in + ?*) yy=is + ii=$1 + complete=1 + case $oo in + cmd) mm="a command" ;; + dat) mm="a library data symbol" ;; + dfn) mm="a macro with extractable value" ;; + exp) mm="true" ;; + hdr) mm="a header" ;; + id) mm="an identifier" ;; + lcl) mm="a native header" ;; + key) mm="a reserved keyword" ;; + lib) mm="a library function" ;; + LIB) case $2 in + "") mm="a library" ;; + *) ii=$*; mm="a library group" ;; + esac + ;; + mac) mm="a macro" ;; + mem) mm="a member of $2" ;; + mth) mm="a math library symbol" ;; + nos) mm="a non-opaque struct" ;; + npt) mm="a symbol that needs a prototype" ;; + num) mm="a numeric constant or enum" ;; + nxt) mm="an include path for the native header" ;; + opt) mm="set in \$PACKAGE_OPTIONS" ;; + pth) mm="a file" ;; + run) yy="capture output of" mm= ;; + siz) mm="a type with known size" ;; + sym) mm="a typed variable" ;; + sys) mm="a system header" ;; + typ) mm="a type or typedef" ;; + val) yy="determine" mm="value" ;; + *) yy= mm= ;; + esac + case $ii in + [abcdefghijklmnopqrstuvwxyz]*[abcdefghijklmnopqrstuvwxyz]'{') ii="$ii ... }end" ;; + esac + $show "$command: test:" $yy $ii $mm "...$SHOW" >&$stderr + complete=1 + ;; + esac + ;; + esac +} + +success() +{ + case $1 in + -) shift + ;; + *) case $result in + UNKNOWN) result=SUCCESS ;; + esac + case $1 in + +) return ;; + esac + ;; + esac + case $complete:$verbose in + 1:1) case $suspended in + 1) suspended=0 + $show "$command: test:" $yy $ii $mm "...$SHOW" >&$stderr + ;; + esac + complete=0 + case $# in + 0) mm="yes" ;; + *) mm="'$*'" ;; + esac + case $debug in + 0) echo " $mm" >&$stderr ;; + *) echo "$command: ... $mm" >&$stderr ;; + esac + ;; + esac +} + +failure() +{ + case $1 in + -) shift ;; + *) result=FAILURE + case $1 in + +) return ;; + esac + ;; + esac + case $complete:$verbose in + 1:1) case $suspended in + 1) suspended=0 + $show "$command: test:" $yy $ii $mm "...$SHOW" >&$stderr + ;; + esac + complete=0 + case $group in + '') case $# in + 0) mm="no" ;; + *) mm=$* ;; + esac + ;; + *) mm= + ;; + esac + case $debug in + 0) echo " $mm" >&$stderr ;; + *) echo "$command: ... $mm" >&$stderr ;; + esac + ;; + esac +} + +# report +# +# - ignore global status +# -0 normal sense +# -1 inverted sense if ! def +# status test status 0:success *:failure +# success success comment +# failure failure comment +# default default setting comment +# +# globals +# +# $not invert test sense +# $M test variable +# $m test macro +# $v default macro + +report() # [-] [-0] [-1] status value success failure default +{ + case $1 in + -) _report_ignore=$1 + shift + ;; + *) _report_ignore= + ;; + esac + _report_not=$not + case $1 in + -0) shift + ;; + -1) shift + case $def in + ''|-) case $_report_not in + 1) _report_not= ;; + *) _report_not=1 ;; + esac + ;; + esac + ;; + esac + _report_status=$1 + case $_report_ignore:$_report_status in + -:*) ;; + *:0) success $_report_ignore + ;; + *) failure $_report_ignore + case $group in + ?*) return ;; + esac + ;; + esac + _report_value=$2 + case $_report_not in + 1) case $_report_status in + 0) _report_status=1 ;; + *) _report_status=0 ;; + esac + _report_success=$4 + _report_failure=$3 + ;; + *) _report_success=$3 + _report_failure=$4 + ;; + esac + _report_default=$5 + case $_report_status in + 0) case $M in + *-*) ;; + *) usr="$usr$nl#define $m $_report_value" + case $_report_success in + ''|-) ;; + *) case $define in + 1) echo "#define $m $_report_value /* $_report_success */" ;; + n) echo "$m=$_report_value" + esac + ;; + esac + eval $m=\'$_report_value\' + ;; + esac + ;; + *) case $M in + *-*) ;; + *) case $_report_failure in + ''|-) ;; + *) case $define$all$config$undef in + 1?1?|1??1)echo "#undef $m /* $_report_failure */" ;; + 11??) echo "#define $m 0 /* $_report_failure */" ;; + n1?1) echo "$m=" ;; + n1??) echo "$m=0" ;; + esac + ;; + esac + case $_report_default in + ''|-) ;; + *) case $define$set in + 1?*) echo "#define $v $set /* $_report_default */" ;; + n?*) echo "$v=$set" ;; + esac + ;; + esac + eval $m=0 + ;; + esac + ;; + esac +} + +noisy() +{ + case $complete:$verbose in + 1:1) suspended=1 + echo >&$stderr + ;; + esac +} + +here_broken=0 + +literal() # line that echo might process +{ + if cat <&$stderr + ;; + esac + sh -c "cat <&$stderr + ;; + esac + sh -c "cat < "$1" + ;; + *) if cat > "$1" <&$stderr + ;; + esac + sh -c "cat > \"$1\" < $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then echo "(;" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then cctest="should not compile '(;'" + fi + else cctest="should compile 'int i = 1;'" + fi + case $cctest in + "") cctest=0 + ;; + *) echo "$command: $cc: not a C compiler: $cctest" >&$stderr + exit 1 + ;; + esac +} + +checkread() +{ + case $cctest in + "") checkcc ;; + esac + case $posix_read in + -no) ;; + *) posix_read=`(read -r _checkread_line; echo $_checkread_line) 2>/dev/null <= 0) + { + if (c == ' ' || c == '\\t') + { + if (k < sizeof(s)) + s[k++] = c; + continue; + } + if (k > 1 && c != '#' && c != '\\n' && c != '\\r') + write(1, s + 1, k - 1); + k = -1; + } + if (c == '\\r') + { + r = c; + if (read(0, &c, 1) == 1 && c != '\\n') + write(1, &r, 1); + } + write(1, &c, 1); + if (c == '\\n') + return 0; + } + return 1; + }" + if compile $cc -o ${tmp}r.exe ${tmp}r.c >&$nullout + then posix_read=${tmp}r.exe + else echo "$command: cannot compile read -r workaround" >&$stderr + exit 1 + fi + ;; + esac +} + +execute() +{ + case $verbose in + 0) noteout=$nullout ;; + *) noteout=$stderr ;; + esac + if test "" != "$cross" + then crossexec $cross "$@" 9>&$noteout + _execute_=$? + elif test -d /NextDeveloper + then "$@" <&$nullin >&$nullout 9>&$noteout + _execute_=$? + "$@" <&$nullin | cat + else "$@" 9>&$noteout + _execute_=$? + fi + return $_execute_ +} + +exclude() +{ + case $excludes in + '') return 0 ;; + esac + for _exclude_var + do eval _exclude_old=\$$_exclude_var + case $_exclude_old in + *" -I"*);; + *) continue ;; + esac + _exclude_new= + _exclude_sep= + for _exclude_arg in $_exclude_old + do _exclude_skip= + for _exclude_dir in $excludes + do case $_exclude_arg in + -I$_exclude_dir|-I*/$_exclude_dir) + _exclude_skip=1 + break; + ;; + esac + done + case $_exclude_skip in + '') _exclude_new="$_exclude_new$_exclude_sep$_exclude_arg" + _exclude_sep=" " + ;; + esac + done + eval $_exclude_var=\$_exclude_new + case $debug in + 0) ;; + *) echo $command: exclude $_exclude_var: "$_exclude_old => $_exclude_new" >&$stderr + ;; + esac + done +} + +all=0 +apis= +binding="-dy -dn -Bdynamic -Bstatic -Wl,-ashared -Wl,-aarchive -call_shared -non_shared '' -static" +complete=0 +config=0 +defhdr= +define=1 +explicit=0 +iff= +usr= +cross= +debug=0 +deflib= +dir=FEATURE +excludes= +executable="test -x" +exists="test -e" +gothdr= +gotlib= +idno= +idyes= +ifs=${IFS-' + '} +in= +includes= +intrinsic= +libpaths="LD_LIBRARY_PATH LD_LIBRARYN32_PATH LD_LIBRARY64_PATH LIBPATH SHLIB_PATH" + LD_LIBRARY_PATH_default=:/lib:/usr/lib + LD_LIBRARYN32_PATH_default=:/lib32:/usr/lib32 + LD_LIBRARY64_PATH_default=:/lib64:/usr/lib64 + LIBPATH_default=:/lib:/usr/lib + SHLIB_PATH_default=:/shlib:/usr/shlib:/lib:/usr/lib +nl=" +" +optimize=1 +occ=cc +one= +out= +posix_read=-check +case `(set -f && set x * && echo $# && set +f) 2>/dev/null` in +2) posix_noglob="set -f" posix_glob="set +f" ;; +*) case `(set -F && set x * && echo $# && set +F) 2>/dev/null` in + 2) posix_noglob="set -F" posix_glob="set +F" ;; + *) posix_noglob=":" posix_glob=":" ;; + esac + ;; +esac +protoflags= +puthdr= +putlib= +pragma= +case `eval 'v=NOposixNO; w=$(export "w=$v"; echo "${w%%NO}"); echo "${w##NO}"' 2>/dev/null` in +posix) shell=posix # or at least POSIX-ish + case $BASH_VERSION in + [1-9]*) shell=bash ;; + esac + case `eval 'PATH=/dev/null && let i=93-5 && typeset -u v=ksh$i && print -r - "$v"' 2>/dev/null` in + KSH88) shell=ksh ;; # also pdksh, mksh, zsh + esac + ;; +*) shell=bsh # ancient pre-POSIX Bourne shell + ($executable .) 2>/dev/null || executable='test -r' + ($exists .) 2>/dev/null || exists='test -r' + ;; +esac +reallystatic= +reallystatictest= +regress= +static=. +statictest= +case $COTEMP in +"") case $HOSTNAME in + ""|?|??|???|????|????) + tmp=${HOSTNAME} + ;; + *) case $shell in + bsh) eval `echo $HOSTNAME | sed 's/\\(....\\).*/tmp=\\1/'` ;; + *) eval 'tmp=${HOSTNAME%${HOSTNAME#????}}' ;; + esac + ;; + esac + tmp=${tmp}$$ + ;; +*) tmp=x${COTEMP} + ;; +esac +COTEMP=${tmp} +export COTEMP +case $tmp in +./*) ;; +??????????*) + case $shell in + bsh) eval `echo $tmp | sed 's/\\(.........\\).*/tmp=\\1/'` ;; + *) eval 'tmp=${tmp%${tmp#?????????}}' ;; + esac + ;; +?????????) + ;; +????????) + tmp=F$tmp + ;; +esac +case $tmp in +./*) ;; +*) tmp=./$tmp ;; +esac +undef=0 +verbose=0 +vers= + +# options -- `-' for output to stdout otherwise usage + +case $1 in +-) out=-; shift ;; +esac +set= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: iffe (AT&T Research) 2012-07-17 $ +] +'$USAGE_LICENSE$' +[+NAME?iffe - C compilation environment feature probe] +[+DESCRIPTION?\biffe\b is a command interpreter that probes the C + compilation environment for features. A feature is any file, option + or symbol that controls or is controlled by the C compiler. \biffe\b + tests features by generating and compiling C programs and observing + the behavior of the C compiler and generated programs.] +[+?\biffe\b statements are line oriented. Statements may appear in the + operand list with the \b:\b operand or \bnewline\b as the line + delimiter. The standard input is read if there are no command + line statements or if \afile\a\b.iffe\b is omitted.] +[+?Though similar in concept to \bautoconf\b(1) and \bconfig\b(1), there + are fundamental differences. The latter tend to generate global + headers accessed by all components in a package, whereas \biffe\b is + aimed at localized, self contained feature testing.] +[+?Output is generated in \bFEATURE/\b\atest\a by default, where \atest\a is + the base name of \afile\a\b.iffe\b or the \biffe\b \brun\b + file operand. Output is first generated in a temporary file; the + output file is updated if it does not exist or if the temporary file + is different. If the first operand is \b-\b then the output is written + to the standard output and no update checks are done.] +[+?Files with suffixes \b.iffe\b and \b.iff\b are assumed to contain + \biffe\b statements.] +[a:all?Define failed test macros \b0\b. By default only successful test macros + are defined \b1\b.] +[c:cc?Sets the C compiler name and flags to be used in the feature + tests.]:[C-compiler-name [C-compiler-flags ...]]] +[C:config?Generate \bconfig\b(1) style \aHAVE_\a* macro names. This implies + \b--undef\b. Since \bconfig\b(1) has inconsistent naming conventions, + the \bexp\b op may be needed to translate from the (consistent) + \biffe\b names. Unless otherwise noted a \bconfig\b macro name + is the \biffe\b macro name prefixed with \bHAVE\b and converted to + upper case. \b--config\b is set by default if the command arguments + contain a \brun\b op on an input file with the base name \bconfig\b.] +[d:debug?Sets the debug level. Level 0 inhibits most + error messages, level 1 shows compiler messages, and + level 2 traces internal \biffe\b \bsh\b(1) actions and does + not remove core dumps on exit.]#[level] +[D:define?Successful test macro definitions are emitted. This is the default.] +[E:explicit?Disable implicit test output.] +[F:features?Sets the feature test header to \ahdr\a. This header typically + defines *_SOURCE feature test macros.]:[hdr:=NONE] +[i:input?Sets the input file name to \afile\a, which + must contain \biffe\b statements.]:[file] +[I:include?Adds \b-I\b\adir\a to the C compiler flags.]:[dir] +[L:library?Adds \b-L\b\adir\a to the C compiler flags.]:[dir] +[n:name-value?Output \aname\a=\avalue\a assignments only.] +[N!:optimize?\b--nooptimize\b disables compiler optimization options.] +[o:output?Sets the output file name to \afile\a.]:[file] +[O:stdio?Sets the standard io header to \ahdr\a.]:[hdr:=stdio.h] +[e:package?Sets the \bproto\b(1) package name to \aname\a.]:[name] +[p:prototyped?Emits \b#pragma prototyped\b at the top of the + output file. See \bproto\b(1).] +[P:pragma?Emits \b#pragma\b \atext\a at the top of the output file.]:[text] +[r:regress?Massage output for regression testing.] +[s:shell?Sets the internal shell name to \aname\a. Used for debugging + Bourne shell compatibility (otherwise \biffe\b uses \aksh\a constructs + if available). The supported names are \bksh\b, \bbsh\b, \bbash\b, and + \bosh\b. \bosh\b forces the \bread -r\b compatibility read command to + be compiled and used instead of \bread -r\b. The default is determined + by probing the shell at startup.]:[name] +[S:static?Sets the C compiler flags that force static linking. If not set + then \biffe\b probes the compiler to determine the flags. \biffe\b + must use static linking (no dlls) because on some systems missing + library symbols are only detected when referenced at runtime from + dynamically linked executables.]:[flags] +[u:undef?\b#undef\b failed test macros. By default only successful test macros + are defined \b1\b.] +[v:verbose?Produce a message line on the standard error for each test as + it is performed.] +[x:cross?Some tests compile an executable (\ba.out\b) and then run it. + If the C compiler is a cross compiler and the executable format is + incompatible with the execution environment then the generated + executables must be run in a different environment, possibly on + another host. \acrosstype\a is the HOSTTYPE for generated executables + (the \bpackage\b(1) command generates a consistent HOSTTYPE namespace). + Generated executables are run via \bcrossexec\b(1) with \acrosstype\a + as the first argument. \bcrossexec\b supports remote execution for + cross-compiled executables. See \bcrossexec\b(1) for + details.]:[crosstype] +[X:exclude?Removes \b-I\b\adir\a and \b-I\b*/\adir\a C compiler flags.]:[dir] + +[ - ] [ file.iffe | statement [ : statement ... ] ] + +[+SYNTAX?\biffe\b input consists of a sequence of statement lines. Statements + that span more than one line contain \abegin\a\b{\b as the last + operand (where \abegin\a is command specific) and zero + or more data lines terminated by a line containing + \b}end\b as the first operand. The statement syntax is: + [\aname\a \b=\b]] [\b!\b]] \atest\a[,\atest\a...]] [\b-\b]] + [\aarg\a[,\aarg\a...]]]] [\aprereq\a ...]] + [\abegin\a{ ... |\bend\b ...]] [= [\adefault\a]]]]. + \atest\as and \aarg\as may be combined, separated by commas, to perform + a set of tests on a set of arguments. \aname\a \b=\b before \atest\a + overrides the default test variable and macro name, and \b-\b after + \atest\a performs the test but does not define the test variable and + macro values. \b!\b before \atest\a inverts the test sense for \bif\b, + \belif\b, and \byes{\b and \bno{\b blocks.] +[+?\aprereq\as are used when applying the features tests and may be + combinations of:]{ + [+compiler options?\b-D\b*, \b-L\b*, etc.] + [+library references?\b-l\b*, *\b.a\b, etc. \b_LIB_\b\aname\a + is defined to be 1 if \b-l\b\aname\a is a library.] + [+header references?*\b.h\b. \a_dir_name\a is defined to be 1 + if \adir/name\a\b.h\b is a header, or if \adir\a is + omitted, \b_hdr_\b\aname\a is defined to be 1 if + \aname\a\b.h\b is a header.] + [+-?Prereq grouping mark; prereqs before the first \b-\b are + passed to all feature tests. Subsequent groups + are attempted in left-to-right order until the first + successful group is found.] + } +[+?\abegin\a\b{\b ... \b}end\b delimit multiline code blocks that override + or augment the default code provided by \biffe\b. User supplied code + blocks should be compatible with the K&R, ANSI, and C++ C language + dialects for maximal portability. Test code may call the function + \bNOTE("...")\b to emit short text in \b--verbose\b output; only one + \bNOTE()\b should be called per test for readability. In addition to + all macro definitions generated by previous tests, all generated + code contains the following at the top to hide dialect differences:]{ + [+ ?#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)] + [+ ?#define _STD_ 1] + [+ ?#define _ARG_(x) x] + [+ ?#define _VOID_ void] + [+ ?#else] + [+ ?#define _STD_ 0] + [+ ?#define _ARG_(x) ()] + [+ ?#define _VOID_ char] + [+ ?#endif] + [+ ?#if defined(__cplusplus)] + [+ ?#define _BEGIN_EXTERNS_ extern "C" {] + [+ ?#define _END_EXTERNS_ }] + [+ ?#else] + [+ ?#define _BEGIN_EXTERNS_] + [+ ?#define _END_EXTERNS_] + [+ ?#endif] + [+ ?#define _NIL_(x) ((x)0)] + [+ ?#include ] + } +[+?= \adefault\a may be specified for the \bkey\b, \blib\b, \bmac\b, \bmth\b + and \btyp\b tests. If the test fails for \aarg\a then + \b#define\b \aarg\a \adefault\a is emitted. \bkey\b accepts multiple + \b= \b\adefault\a values; the first valid one is used.] +[+?Each test statement generates a portion of a C language header that contains + macro definitions, comments, and other text corresponding to the feature + tests. \b#ifndef _def_\b\aname\a\b_\b\adirectory\a ... + \b#endif\b guards the generated header from multiple \b#include\bs, + where \aname\a is determined by either the \brun\b statement input file + name if any, or the first \atest\a in the first statement, and \adirectory\a + is the basename component of either the \brun\b statement file, if any, + or the current working directory. The output file name is determined + in this order:]{ + [+-?If the first command line operand is \b-\b then the output + is written to the standard output.] + [+--output=\afile\a?Output is \afile\a.] + [+set out \afile\a?Output is \afile\a.] + [+[run]] [\adirectory\a/]]\abase\a[\a.suffix\a]]?Output is + \bFEATURE/\b\abase\a.] + } +[+?Generated \biffe\b headers are often referenced in C source as: + \b#include "FEATURE/\b\afile\a". The \bnmake\b(1) base rules contain + metarules for generating \bFEATURE/\b\afile\a from + \bfeatures/\b\afile\a[\asuffix\a]], where \asuffix\a may be omitted, + \b.c\b, or \b.sh\b (see the \brun\b test below). Because + \b#include\b prerequisites are automatically detected, \bnmake\b(1) + ensures that all prerequisite \biffe\b headers are generated before + compilation. Note that the directories are deliberately named + \bFEATURE\b and \bfeatures\b to keep case-ignorant file systems + happy.] +[+?The feature tests are:]{ + [+# \acomment\a?Comment line - ignored.] + [+api \aname\a \aYYYYMMDD\a \asymbol ...\a?Emit api compatibility tests + for \aname\a and \b#define\b \asymbol\a \asymbol\a_\aYYYYMMDD\a + when \aNAME\a_API is >= \aYYYYMMDD\a (\aNAME\a is \aname\a + converted to upper case). If \aNAME\a_API is not defined + then \asymbol\a maps to the newest \aYYYYMMDD\a for \aname\a.] + [+define \aname\a [ (\aarg,...\a) ]] [ \avalue\a ]]?Emit a macro + \b#define\b for \aname\a if it is not already defined. The + definition is passed to subsequent tests.] + [+extern \aname\a \atype\a [ (\aarg,...\a) | [\adimension\a]] ]]?Emit + an \bextern\b prototype for \aname\a if one is not already + defined. The prototype is passed to subsequent tests.] + [+header \aheader\a?Emit \b#include <\b\aheader\a\b>\b if \aheader\a + exists. The \b#include\b is passed to subsequent tests.] + [+print \atext\a?Copy \atext\a to the output file. \atext\a is passed + to subsequent tests.] + [+reference \aheader\a?If \aheader\a exists then add \b#include\b + \aheader\a to subsequent tests.] + [+ver \aname\a \aYYYYMMDD\a?\b#define\b \aNAME\a_VERSION \aYYYYMMDD\a + (\aNAME\a is \aname\a converted to upper case).] + [+cmd \aname\a?Defines \b_cmd_\b\aname\a if \aname\a is an executable + in one of the standard system directories (\b/bin, /etc, + /usr/bin, /usr/etc, /usr/ucb\b). + \b_\b\adirectory\a\b_\b\aname\a is defined for \adirectory\a + in which \aname\a is found (with \b/\b translated to \b_\b).] + [+dat \aname\a?Defines \b_dat_\b\aname\a if \aname\a is a data symbol + in the default libraries.] + [+def \aname\a?Equivalent to \bcmd,dat,hdr,key,lib,mth,sys,typ\b + \aname\a.] + [+dfn \aname\a?If \aname\a is a macro in the candidate headers then + a \b#define\b \aname\a \avalue\a statement is output for the + \avalue\a defined in the headers. The definition is \b#ifndef\b + guarded.] + [+exp \aname\a \aexpression\a?If \aexpression\a is a \"...\" string + then \aname\a is defined to be the string, else if the + \bexpr\b(1) evaluation of \aexpression\a is not 0 then \aname\a + is defined to be 1, otherwise \aname\a is defined to be 0. + Identifiers in \aexpression\a may be previously defined names + from other \biffe\b tests; undefined names evaluate to 0. + If \aname\a was defined in a previous successful test then + the current and subsequent \bexp\b test on \aname\a are + skipped. If \aname\a is \b-\b then the \aexpression\a is + simply evaluated.] + [+hdr \aname\a?Defines \b_hdr_\b\aname\a if the header + \b<\b\aname\a\b.h>\b exists. The \b--config\b macro name is + \bHAVE_\b\aNAME\a\b_H\b.] + [+if \astatement\a ... | \belif\b \astatement\a ... | \belse\b | \bendif\b? + Nested if-else test control.] + [+iff \aname\a?The generated header \b#ifndef-#endif\b macro guard is + \b_\b\aname\a\b_H\b.] + [+inc \afile\a [ re ]]?Read #define macro names from \afile\a + and arrange for those names to evaluate to 1 in \bexp\b + expressions. If \are\a is specified then macros not matching + \are\a are ignored.] + [+key \aname\a?Defines \b_key_\b\aname\a if \aname\a is a reserved + word (keyword).] + [+lcl \aname\a?Generates a \b#include\b statement for the native version + of the header \b<\b\aname\a\b.h>\b if it exists. Defines + \b_lcl_\b\aname\a on success. The \b--config\b macro name is + \bHAVE_\b\aNAME\a\b_H\b. The default \are\a is \b^HAVE_\b + for \b--config\b and \b^_\b otherwise.] + [+lib \aname\a?Defines \b_lib_\b\aname\a if \aname\a is an external + symbol in the default libraries.] + [+mac \aname\a?Defines \b_mac_\b\aname\a if \aname\a is a macro.] + [+mem \astruct.member\a?Defines \b_mem_\b\amember\a\b_\b\astruct\a + if \amember\a is a member of the structure \astruct\a.] + [+mth \aname\a?Defines \b_mth_\b\aname\a if \aname\a is an external + symbol in the math library.] + [+nop \aname\a?If this is the first test then \aname\a may be used + to name the output file and/or the output header guard macro. + Otherwise this test is ignored.] + [+npt \aname\a?Defines \b_npt_\b\aname\a if the \aname\a symbol + requires a prototype. The \b--config\b macro name is + \bHAVE_\aNAME\a\b_DECL\b with the opposite sense.] + [+num \aname\a?Defines \b_num_\b\aname\a if \aname\a is a numeric + constant \aenum\a or \amacro\a.] + [+nxt \aname\a?Defines a string macro \b_nxt_\b\aname\a suitable for + a \b#include\b statement to include the next (on the include + path) or native version of the header \b<\b\aname\a\b.h>\b + if it exists. Also defines the \"...\" form + \b_nxt_\b\aname\a\b_str\b. The \b--config\b macro name is + \bHAVE_\b\aNAME\a\b_NEXT\b.] + [+one \aheader\a ...?Generates a \b#include\b statement for the first + header found in the \aheader\a list.] + [+opt \aname\a?Defines \b_opt_\b\aname\a if \aname\a is a space-separated + token in the global environment variable \bPACKAGE_OPTIONS\b.] + [+pth \afile\a [ \adir\a ... | { \ag1\a - ... - \agn\a } | < \apkg\a [\aver\a ...]] > ]]?Defines + \b_pth_\b\afile\a, with embedded \b/\b chars translated to + \b_\b, to the path of the first instance of \afile\a in the + \adir\a directories. \b{\b ... \b}\b forms a directory list + from the cross-product of \b-\b separated directory groups + \ag1\a ... \agn\a. < ... > forms a directory list for the + package \apkg\a with optional versions. If no operands are + specified then the default PATH directories are used. The + \b--config\b macro name is \aNAME\a\b_PATH\b.] + [+run \afile\a?Runs the tests in \afile\a based on the \afile\a + suffix:]{ + [+.c?\afile\a is compiled and executed and the output is copied + to the \biffe\b output file. Macros and headers supplied + to \bbegin{\b ... \b}end\b are also supplied to + \afile\a.] + [+.sh?\afile\a is executed as a shell script and the output is + copied to the \biffe\b output file.] + [+.iffe \bor no suffix?\afile\a contains \biffe\b + statements.] + } + [+set \aoption value\a?Sets option values. The options are described + above.] + [+siz \aname\a?Defines \b_siz_\b\aname\a to be \bsizeof\b(\aname\a) if + \aname\a is a type in any of \b, , + , \b. Any \b.\b characters in \aname\a are + translated to space before testing and are translated to \b_\b + in the output macro name.] + [+sym \aname\a?Defines \b_ary_\b\aname\a if \aname\a is an array, + \b_fun_\b\aname\a if \aname\a is a function pointer, + \b_ptr_\b\aname\a if \aname\a is a pointer, or + \b_reg_\b\aname\a if \aname\a is a scalar. In most cases + \aname\a is part of a macro expansion.] + [+sys \aname\a?Defines \b_sys_\b\aname\a if the header + \b\b exists. The \b--config\b macro name is + \bHAVE_SYS_\b\aNAME\a\b_H\b.] + [+tst \aname\a?A user defined test on name. A source block must be + supplied. Defines \b_\b\aname\a on success. \btst - ...\b is + treated as \btst - - ...\b.] + [+typ \aname\a?Defines \b_typ_\b\aname\a if \aname\a is a type in any + of \b, , , \b. Any + \b.\b characters in \aname\a are translated to space before + testing and are translated to \b_\b in the output macro name.] + [+val \aname\a?The output of \becho\b \aname\a is written to the + output file.] + [+var \aname\a?A user defined test on name. A source block must be + supplied. Sets the \bexp\b variable \b_\b\aname\a on success + but does not define a macro.] + [+(\aexpression\a)?Equivalent to \bexp -\b \aexpression\a.] +} +[+?Code block names may be prefixed by \bno\b to invert the test sense. The + block names are:]{ + [+cat?The block is copied to the output file.] + [+compile?The block is compiled (\bcc -c\b).] + [+cross?The block is executed as a shell script using \bcrossexec\b(1) + if \b--cross\b is on, or on the local host otherwise, and the + output is copied to the output file. Test macros are not + exported to the script.] + [+execute?The block is compiled, linked, and executed. \b0\b exit + status means success.] + [+fail?If the test fails then the block text is evaluated by + \bsh\b(1).] + [+link?The block is compiled and linked (\bcc -o\b).] + [+macro?The block is preprocessed (\bcc -E\b) and lines containing + text bracketed by \b<<"\b ... \b">>\b (\aless-than less-than + double-quote ... double-quote greater-than greater-than\a) + are copied to the output file with the brackets omitted.] + [+no?If the test fails then the block text is copied to the + output file. Deprecated: use { \bif\b \belif\b \belse\b + \bendif\b } with unnamed \b{\b ... \b}\b blocks.] + [+note?If the test succeeds then the block is copied to the output + as a \b/*\b ... \b*/\b comment.] + [+output?The block is compiled, linked, and executed, and the output + is copied to the output file.] + [+pass?If the test succeeds then the block text is evaluated by + \bsh\b(1).] + [+preprocess?The block is preprocessed (\bcc -E\b).] + [+run?The block is executed as a shell script and the output is + copied to the output file. Successful test macros are also + defined as shell variables with value \b1\b and are available + within the block. Likewise, failed test macros are defined + as shell variables with value \b0\b.] + [+status?The block is compiled, linked, and executed, and the exit + status is the test outcome, 0 for \afailure\a, the value + otherwise.] + [+yes?If the test succeeds then the block text is copied to the output + file. \byes{\b ... \b}end\b is equivalent to the unnamed block + \b{\b ... \b}\b. Deprecated: use { \bif\b \belif\b \belse\b + \bendif\b } with unnamed \b{\b ... \b}\b blocks.] +} +[+SEE ALSO?\bautoconf\b(1), \bconfig\b(1), \bgetconf\b(1), \bcrossexec\b(1), + \bnmake\b(1), \bpackage\b(1), \bproto\b(1), \bsh\b(1)] +' + while getopts -a "$command" "$USAGE" OPT + do case $OPT in + a) set="$set set all :" ;; + c) set="$set set cc $OPTARG :" ;; + C) set="$set set config :" ;; + d) set="$set set debug $OPTARG :" ;; + D) set="$set set define :" ;; + E) set="$set set explicit :" ;; + F) set="$set set features $OPTARG :" ;; + i) set="$set set input $OPTARG :" ;; + I) set="$set set include $OPTARG :" ;; + L) set="$set set library $OPTARG :" ;; + n) set="$set set namval $OPTARG :" ;; + N) set="$set set nooptimize $OPTARG :" ;; + o) set="$set set output $OPTARG :" ;; + e) set="$set set package $OPTARG :" ;; + p) set="$set set prototyped :" ;; + P) set="$set set pragma $OPTARG :" ;; + r) set="$set set regress :" ;; + s) set="$set set shell $OPTARG :" ;; + S) set="$set set static $OPTARG :" ;; + O) set="$set set stdio $OPTARG :" ;; + u) set="$set set undef :" ;; + v) set="$set set verbose :" ;; + x) set="$set set cross $OPTARG :" ;; + X) set="$set set exclude $OPTARG :" ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) while : + do case $# in + 0) break ;; + esac + case $1 in + -) break + ;; + --) shift + break + ;; + --a|--al|--all) + REM=a + ;; + --cc=*) REM=c`echo X$1 | sed 's,[^=]*=,,'` + ;; + --co|--con|--conf|--confi|--config) + REM=C + ;; + --cr=*|--cro=*|--cros=*|--cross=*) + REM=x`echo X$1 | sed -e 's,[^=]*=,,'` + ;; + --d=*|--de=*|--deb=*|--debu=*|--debug=*) + REM=d`echo X$1 | sed 's,[^=]*=,,'` + ;; + --def|--defi|--defin|--define) + REM=D + ;; + --e=*|--ex=*|--exc=*|--excl=*|--exclu=*|--exclud=*|--exclude=*) + REM=X`echo X$1 | sed 's,[^=]*=,,'` + ;; + --e|--ex|--exp|--expl|--expli|--explic|--explici|--explicit) + REM=E + ;; + --f=*|--fe=*|--fea=*|--feat=*|--featu=*|--featur=*|--feature=*|--features=*) + REM=F`echo X$1 | sed 's,[^=]*=,,'` + ;; + --inp=*|--inpu=*|--input=*) + REM=i`echo X$1 | sed 's,[^=]*=,,'` + ;; + --inc=*|--incl=*|--inclu=*|--includ=*|--include=*) + REM=I`echo X$1 | sed 's,[^=]*=,,'` + ;; + --l=*|--li=*|--lib=*|--libr=*|--libra=*|--librar=*|--library=*) + REM=L`echo X$1 | sed 's,[^=]*=,,'` + ;; + --n|--na|--nam|--name|--name-v|--name-va|--name-val|--name-valu|--name-value) + REM=n + ;; + --o=*|--ou=*|--out=*|--outp=*|--outpu=*|--output=*) + REM=o`echo X$1 | sed 's,[^=]*=,,'` + ;; + --pa=*|--pac=*|--pack=*|--packa=*|--packag=*|--package=*) + REM=e`echo X$1 | sed 's,[^=]*=,,'` + ;; + --pro|--prot|--proto|--protot|--prototy|--prototyp|--prototype|--prototyped) + REM=p + ;; + --pra=*|--prag=*|--pragma=*) + REM=P`echo X$1 | sed 's,[^=]*=,,'` + ;; + --r|--re|--reg|--regre|--regres|--regress) + REM=r + ;; + --sh=*|--she=*|--shel=*|--shell=*) + REM=s`echo X$1 | sed 's,[^=]*=,,'` + ;; + --sta=*|--stat=*|--stati=*|--static=*) + REM=S`echo X$1 | sed 's,[^=]*=,,'` + ;; + --std=*|--stdi=*|--stdio=*) + REM=O`echo X$1 | sed 's,[^=]*=,,'` + ;; + --u|--un|--und|--unde|--undef) + REM=u + ;; + --v|--ve|--ver|--verb|--verbo|--verbos|--verbose) + REM=v + ;; + --*) echo $command: $1: unknown option >&2 + exit 2 + ;; + -*) REM=`echo X$1 | sed 's,X-,,'` + ;; + *) break + ;; + esac + shift + while : + do case $REM in + '') break ;; + esac + eval `echo $REM | sed "s,\(.\)\(.*\),OPT='\1' REM='\2',"` + case $OPT in + [cdFiILoOePsSxX]) + case $REM in + '') case $# in + 0) echo $command: -$OPT: option argument expected >&2 + exit 1 + ;; + esac + OPTARG=$1 + shift + ;; + *) OPTARG=$REM + REM='' + ;; + esac + esac + case $OPT in + a) set="$set set all :" ;; + c) set="$set set cc $OPTARG :" ;; + C) set="$set set config :" ;; + d) set="$set set debug $OPTARG :" ;; + D) set="$set set define :" ;; + E) set="$set set explicit :" ;; + F) set="$set set features $OPTARG :" ;; + i) set="$set set input $OPTARG :" ;; + I) set="$set set include $OPTARG :" ;; + L) set="$set set library $OPTARG :" ;; + n) set="$set set namval $OPTARG :" ;; + N) set="$set set nooptimize $OPTARG :" ;; + o) set="$set set output $OPTARG :" ;; + e) set="$set set package $OPTARG :" ;; + p) set="$set set prototyped :" ;; + P) set="$set set pragma $OPTARG :" ;; + r) set="$set set regress :" ;; + s) set="$set set shell $OPTARG :" ;; + S) set="$set set static $OPTARG :" ;; + O) set="$set set stdio $OPTARG :" ;; + u) set="$set set undef :" ;; + v) set="$set set verbose :" ;; + x) set="$set set cross $OPTARG :" ;; + X) set="$set set exclude $OPTARG :" ;; + *) echo "Usage: $command [-aCDEnpruv] [-c C-compiler-name [C-compiler-flags ...]] [-d level] + [-F features-header] [-i file] [-o file] [-O stdio-header] [-e name] [-P text] + [-s shell-path] [-S[flags]] [-x cross-exec-prefix] [-I dir] [-L dir] [-X dir] [ - ] + [ file.iffe | statement [ : statement ... ] ]" >&2 + exit 2 + ;; + esac + done + done + ;; +esac +case $1 in +-) out=-; shift ;; +esac +case $# in +0) in=- ;; +esac +set -- $set "$@" +case " $* " in +*' set config '*|*' run config.'*|*' run '*' config.'*|*' run '*'/config.'*) + config=1 + ;; +esac + +# standard error to /dev/null unless debugging +# standard output to the current output file +# +# stdout original standard output +# stderr original standard error +# nullin /dev/null input +# nullout /dev/null output + +stdout=5 stderr=6 nullin=7 nullout=8 +eval "exec $nullin/dev/null $stdout>&1 $stderr>&2" +case " $* " in +*" set debug "[3456789]*) + ;; +*) eval "exec 2>&$nullout" + ;; +esac + +# prompt complications + +case `print -n aha /dev/null` in +aha) show='print -n' SHOW='' ;; +*) case `echo -n aha 2>/dev/null` in + -n*) show=echo SHOW='\c' ;; + *) show='echo -n' SHOW='' ;; + esac + ;; +esac + +# tmp files cleaned up on exit +# status: 0:success 1:failure 2:interrupt + +status=1 +case $debug in +2) core= + ;; +*) if (ulimit -c 0) >/dev/null 2>&1 + then ulimit -c 0 + core= + else core="core core.??*" + fi + ;; +esac +trap "rm -f $core $tmp*" 0 +if (:>$tmp.c) 2>/dev/null +then rm -f $tmp.c +else echo "$command: cannot create tmp files in current dir" >&2 + exit 1 +fi +status=2 + +# standard header for c source + +std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) +#define _STD_ 1 +#define _ARG_(x) x +#define _VOID_ void +#else +#define _STD_ 0 +#define _ARG_(x) () +#define _VOID_ char +#endif +#if defined(__cplusplus) +#define _BEGIN_EXTERNS_ extern "C" { +#define _END_EXTERNS_ } +#else +#define _BEGIN_EXTERNS_ +#define _END_EXTERNS_ +#endif +#define _NIL_(x) ((x)0)' +tst= +ext="#include " + +# loop on op [ arg [ ... ] ] [ : op [ arg [ ... ] ] ] + +argx=0 +cur=. +can= +cansep= +cctest= +file= +hdrtest= +ifelse=NONE +ifstack= +ini= +init=1 +line=0 +nan= +prototyped= +while : +do case $in in + "") case $argx:$* in + 1:$argv);; + 1:*) argx=0 + set x $argv + shift + ;; + esac + ;; + *) case $ini in + '') if read lin + then case $shell in + ksh) let line=line+1 ;; + *) line=`expr $line + 1` ;; + esac + $posix_noglob + set x $lin + $posix_glob + case $# in + 1) continue ;; + esac + else set x + fi + ;; + *) $posix_noglob + set x $ini + $posix_glob + ini= + ;; + esac + shift + case $init in + 1) case $1 in + iff) init=0 + ;; + print|ref|set) + ;; + *) init=0 + ini=$* + set ini + ;; + esac + esac + ;; + esac + case $# in + 0) case $ifstack in + ?*) echo "$command: $file$line: missing endif" >&$stderr + exit 1 + ;; + esac + set set out + + ;; + esac + + # if nesting + + while : + do case $1 in + "if") ifstack="$ifelse:$ifstack" + case $ifelse in + KEEP|NONE) + ifelse=TEST + ;; + TEST) ;; + *) ifelse=DONE + ;; + esac + shift + case $explicit in + 1) set '' - "$@"; shift ;; + esac + ;; + "elif") case $ifelse in + SKIP) ifelse=TEST + ;; + TEST) ;; + *) ifelse=DONE + ;; + NONE) echo "$command: $file$line: $1: no matching if" >&$stderr + exit 1 + ;; + esac + shift + case $explicit in + 1) set '' - "$@"; shift ;; + esac + ;; + "else") case $ifelse in + KEEP) ifelse=DONE + ;; + SKIP|TEST) + ifelse=KEEP + ;; + NONE) echo "$command: $file$line: $1: no matching if" >&$stderr + exit 1 + ;; + esac + shift + ;; + "endif")case $ifelse in + NONE) echo "$command: $file$line: $1: no matching if" >&$stderr + exit 1 + ;; + esac + case $shell in + ksh) ifelse=${ifstack%%:*} + ifstack=${ifstack#*:} + ;; + *) eval `echo $ifstack | sed 's,\([^:]*\):\(.*\),ifelse=\1 ifstack=\2,'` + ;; + esac + shift + ;; + *) break + ;; + esac + done + + # check if "run xxx" is equivalent to "set in xxx" + + case $1 in + "("*) set exp - "$@" ;; + *.iffe|*.iff) set run "$@" ;; + esac + case $1 in + :) shift + continue + ;; + run) case $shell in + bsh) case $2 in + */*) x=`echo $2 | sed 's,.*[\\\\/],,'` ;; + *) x=$2 ;; + esac + ;; + *) eval 'x=${2##*[\\/]}' + ;; + esac + case $x in + *.iffe|*.iff) + set set in $2 ;; + *.*) ;; + *) set set in $2 ;; + esac + ;; + esac + + # { inc set } drop out early + + case $1 in + ""|"#"*)continue + ;; + inc) case $ifelse in + DONE|SKIP) set ''; shift; continue ;; + esac + shift + case $# in + 0) echo "$command: $file$line: path expected" >&$stderr + exit 1 + ;; + esac + p=$1 + shift + if test ! -f $p + then echo "$command: $file$line: $p: file not found" >&$stderr + exit 1 + fi + case $# in + 0) case $config in + 1) e="^HAVE_" ;; + *) e="^_" ;; + esac + ;; + 1) e=$1 + ;; + *) shift + echo "$command: $file$line: warning: $*: operands ignored" >&$stderr + ;; + esac + eval `sed -e '/^#define[ ]/!d' -e 's/#define[ ]//' -e 's/[ (].*//' ${e:+"-e/$e/!d"} -e 's/.*/&=1/' $p | LC_ALL=C sort -u` + continue + ;; + set) case $ifelse in + DONE|SKIP) set ''; shift; continue ;; + esac + shift + case $1 in + ""|"#"*)op= + ;; + *) arg= + op=$1 + case $op in + --*) case $shell in + bsh) op=`echo X$op | sed 's/X--//'` ;; + *) op=${op#--} ;; + esac + ;; + -*) case $op in + -??*) case $shell in + bsh) arg=`echo X$op | sed 's/X-.//'` + op=`echo X$op | sed 's/X\\(-.\\).*/\\1/'` + ;; + *) arg=${op#-?} + op=${op%$arg} + ;; + esac + ;; + esac + case $op in + a) op=all ;; + c) op=cc ;; + C) op=config ;; + d) op=debug ;; + D) op=define ;; + E) op=explicit ;; + F) op=features ;; + i) op=input ;; + I) op=include ;; + L) op=library ;; + n) op=namval ;; + N) op=nooptimize ;; + o) op=output ;; + e) op=package ;; + p) op=prototyped ;; + P) op=pragma ;; + r) op=regress ;; + s) op=shell ;; + S) op=static ;; + O) op=stdio ;; + u) op=undef ;; + v) op=verbose ;; + x) op=cross ;; + X) op=exclude ;; + esac + ;; + esac + shift + while : + do case $# in + 0) break ;; + esac + case $1 in + *" "*) shift + continue + ;; + ""|"#"*)break + ;; + :) shift + break + ;; + esac + case $arg in + "") arg=$1 ;; + *) arg="$arg $1" ;; + esac + shift + done + ;; + esac + case $op in + all) all=1 + continue + ;; + cc) occ= + for x in $arg + do case $occ in + "") case $x in + *=*) case $shell in + bsh) eval $x + export `echo $x | sed 's/=.*//'` + ;; + *) export $x + ;; + esac + ;; + -O*) case $optimize in + 1) occ=$x ;; + esac + ;; + *) occ=$x + ;; + esac + ;; + *) occ="$occ $x" + ;; + esac + done + exclude occ + continue + ;; + config) config=1 + continue + ;; + cross) case $arg in + ""|-) cross= ;; + *) cross="$arg" libpaths= ;; + esac + continue + ;; + debug) debug=$arg + case $arg in + 0) exec 2>&$nullout + set - + show=echo + SHOW= + ;; + ""|1) exec 2>&$stderr + set - + show=echo + SHOW= + ;; + 2|3) exec 2>&$stderr + case $shell in + ksh) eval 'PS4="${PS4%+*([ ])}+\$LINENO+ "' + esac + show=echo + SHOW= + set -x + ;; + *) echo "$command: $arg: debug levels are 0, 1, 2, 3" >&$stderr + ;; + esac + continue + ;; + define) define=1 + continue + ;; + exclude)case $arg in + ""|-) excludes= ;; + *) excludes="$excludes $arg" ;; + esac + exclude includes occ + continue + ;; + explicit) + explicit=1 + continue + ;; + features)case $arg in + '') tst= ;; + *) tst="#include \"$arg\"" ;; + esac + continue + ;; + "in"|input) + case $arg in + "") in=- + ;; + *) in=$arg + if test ! -r $in + then echo "$command: $in: not found" >&$stderr + exit 1 + fi + exec < $in + file=$in: + case $out in + "") case $in in + *[.\\/]*) + case $shell in + bsh) eval `echo $in | sed -e 's,.*[\\\\/],,' -e 's/\\.[^.]*//' -e 's/^/out=/'` + ;; + *) eval 'out=${in##*[\\/]}' + eval 'out=${out%.*}' + ;; + esac + ;; + *) out=$in + ;; + esac + ;; + esac + ;; + esac + continue + ;; + include)case $arg in + ""|-) includes= ;; + *) includes="$includes -I$arg" ;; + esac + exclude includes + continue + ;; + library)for y in $libpaths + do eval $y=\"\$$y:\$arg\$${y}_default\" + eval export $y + done + continue + ;; + namval) define=n + continue + ;; + nodebug)exec 2>&$nullout + set - + continue + ;; + nodefine) + define=0 + continue + ;; + nooptimize) + optimize=0 + case $occ in + *" -O"*)occ=`echo $occ | sed 's/ -O[^ ]*//g'` + cc=$occ + ;; + esac + ;; + optimize) + optimize=1 + ;; + out|output) + out=$arg + defhdr= + usr= + deflib= + one= + puthdr= + putlib= + case $op in + output) continue ;; + esac + def= + test= + ;; + package)protoflags="$protoflags -e $arg" + continue + ;; + prototyped|noprototyped) + pragma="$pragma $op" + case $op in + prototyped) prototyped=1 ;; + *) prototyped= ;; + esac + continue + ;; + pragma) pragma="$pragma $arg" + continue + ;; + regress)regress=1 + version=1995-03-19 + continue + ;; + shell) case $arg in + osh) posix_read=-no + shell=bsh + ;; + esac + shell=$arg + continue + ;; + static) static=$arg + continue + ;; + stdio) case $arg in + '') ext= + ;; + *) ext= + sep= + for i in $arg + do case $i in + -) case $ext in + '') continue ;; + *) break ;; + esac + ;; + esac + echo "#include \"$i\"" > t.c + if $cc -E t.c > /dev/null 2>&1 + then ext="$ext$sep#include \"$arg\"" + sep=$nl + fi + done + ;; + esac + continue + ;; + undef) undef=1 + continue + ;; + verbose)verbose=1 + continue + ;; + *) echo "$command: $op: unknown option" >&$stderr + exit 1 + ;; + esac + ;; + api|define|extern|header|include|print|reference|ver) + op=$1 + shift + arg= + ;; + *) case $2 in + '=') def=$1 + shift + shift + ;; + *) case $1 in + '-'|'?')def=- + shift + ;; + *) def= + ;; + esac + ;; + esac + case $1 in + '!') not=1 + shift + ;; + *) not= + ;; + esac + case $1 in + *'{') op=- + ;; + '('*|'"'*'"'|'<'*'>') + op=exp + case $def in + '') def=- ;; + esac + ;; + *) op=$1 + shift + ;; + esac + arg= + cc="$occ $includes" + group= + groups= + fail= + hdr= + lib= + mac= + no= + note= + opt= + pass= + pth= + run= + set= + src= + test= + yes= + case $# in + 0) ;; + *) case $1 in + "#"*) set x + shift + ;; + *) case $op in + ref) ;; + *) case $1 in + '-') case $op:$2 in + tst:*) arg=$1 + case $2 in + -) shift ;; + esac + ;; + *:-*) arg=$1 + shift + ;; + *) def=- + shift + case $1 in + '('*|*'{'|'"'*'"'|'<'*'>') + arg=- + ;; + *) arg=$1 + case $# in + 0) ;; + *) shift ;; + esac + ;; + esac + ;; + esac + ;; + -*|+*|'('*|*'{'|'"'*'"'|'<'*'>') + arg=- + ;; + *) arg=$1 + shift + ;; + esac + ;; + esac + ;; + esac + case $1 in + '('*|'"'*'"'|'<'*'>') + while : + do case $# in + 0) break ;; + esac + case $1 in + *[.{}]*)break ;; + esac + case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + shift + done + case $arg in + '') arg=- ;; + esac + case $op in + exp) case $def in + ''|'-') ;; + *) arg=$def ;; + esac + ;; + esac + ;; + esac + sline=$line + while : + do case $# in + 0) break ;; + esac + case $1 in + "") ;; + "#"*) set x + ;; + "=") shift + set=$* + case $set in + "") set=" " ;; + esac + while : + do case $# in + 0) break ;; + esac + shift + done + break + ;; + [abcdefghijklmnopqrstuvwxyz]*'{'|'{') + v=$1 + shift + x= + case $v in + "note{") + sep=" " ;; + *) sep=$nl ;; + esac + case $v in + '{') e='}' ;; + *) e='}end' ;; + esac + n=1 + SEP= + while : + do case $# in + 0) case $posix_read in + -*) checkread ;; + esac + case $in in + "") echo "$command: $file$line: missing }end" >&$stderr + exit 1 + ;; + esac + while : + do case $posix_read in + 1) case $shell in + ksh) IFS= read -r lin + eof=$? + while : + do lin="${lin#[' ']}" + case $lin in + [' ']*'#'*);; + *) break ;; + esac + done + ;; + *) IFS= + read -r lin + eof=$? + IFS=$ifs + case $lin in + [' ']*) lin=`sed -e 's,^[ ],,' -e 's,^[ ]*#,#,' <&$stderr + exit 1 + ;; + esac + done + ;; + esac + case $1 in + $v) case $shell in + ksh) let n=n+1 ;; + *) n=`expr $n + 1` ;; + esac + ;; + $e|$e';') + case $n in + 1) break ;; + esac + case $shell in + ksh) let n=n-1 ;; + *) n=`expr $n - 1` ;; + esac + ;; + esac + x="$x$SEP$1" + SEP=$sep + shift + done + case $v in + 'note{');; + *) x="$x$nl" # \r\n bash needs this barf # ;; + esac + case $v in + 'fail{') fail=$x ;; + 'nofail{') pass=$x v='pass{' ;; + 'nopass{') fail=$x v='fail{' ;; + 'no{') no=$x ;; + 'note{') note=$x ;; + 'pass{') pass=$x ;; + 'test{') test=$x ;; + 'yes{'|'{') yes=$x ;; + *) src=$x run=$v ;; + esac + ;; + :) shift + break + ;; + *[\"\'\(\)\{\}\ \ ]*) + case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + -) group=$group$1 + case $group in + -) com_hdr=$hdr + com_lib=$lib + com_mac=$mac + com_opt=$opt + com_pth=$pth + com_test=$test + ;; + *) groups="$groups $1" + ;; + esac + ;; + -l*) case $group in + --*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + +l*) case $shell in + bsh) x=`echo X$1 | sed 's/X+/-/'` ;; + *) eval 'x=-${1#+}' ;; + esac + case $group in + --*) groups="$groups $x" ;; + *) lib="$lib $x" ;; + esac + ;; + -*|+*) case $op in + ref) cc="$cc $1" + occ="$occ $1" + case $1 in + -L*) case $shell in + ksh) x=${1#-L} ;; + *) x=`echo x$1 | sed 's,^x-L,,'` ;; + esac + for y in $libpaths + do eval $y=\"\$$y:\$x\$${y}_default\" + eval export $y + done + ;; + esac + ;; + *) case $group in + --*) groups="$groups $1" + ;; + *) case $op in + run) opt="$opt $1" + ;; + *) case $1 in + -D*) mac="$mac $1" ;; + *) cc="$cc $1" ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + *.[aAxX]|*.[dD][lL][lL]|*.[lL][iI][bB]) + case $group in + --*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + *[.\\/]*) + case $group in + --*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" ;; + *) hdr="$hdr $1" ;; + esac + ;; + esac + ;; + *) case $group in + --*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + esac + ;; + esac + shift + done + case $group in + -) group= ;; + esac + ;; + esac + ;; + esac + case $ifelse in + DONE|SKIP) continue ;; + esac + + # make sure $cc compiles C + + case $cc in + "") cc="$occ $includes" ;; + esac + case $cctest in + "") checkcc ;; + esac + + # some ops allow no args + + case $arg in + '') case $op in + api) arg=- + case $1:$2 in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*:[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) + a=$1 + shift + case " $apis " in + *" $a "*) + ;; + *) apis="$apis $a" + eval api_sym_${a}= api_ver_${a}= + ;; + esac + rel= + while : + do case $# in + 0) break ;; + esac + case $1 in + [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) + rel="$rel $1" + ;; + *) break + ;; + esac + shift + done + while : + do case $# in + 0) break ;; + esac + case $1 in + :) break ;; + esac + eval syms='$'api_sym_${a} + case $syms in + '') sep='' ;; + *) sep=$nl ;; + esac + for r in $rel + do syms=$syms$sep${1}:${r} + sep=$nl + done + eval api_sym_${a}='$'syms + shift + done + ;; + *) echo "$command: $op: expected: name YYYYMMDD symbol ..." >&$stderr + ;; + esac + while : + do case $# in + 0) break ;; + esac + case $1 in + :) break ;; + esac + shift + done + ;; + iff|ini)arg=- + ;; + comment)copy - "/* $* */" + continue + ;; + define) x=$1 + shift + case $1 in + '('*')') + arg=$1 + shift + ;; + esac + case $in in + "") v= + while : + do case $# in + 0) break ;; + esac + t=$1 + shift + case $t in + ":") break ;; + esac + v="$v $t" + done + ;; + *) v=$* + ;; + esac + is mac $x + copy $tmp.c "$std +$usr +#ifndef $x +( +#endif +int x; +" + if compile $cc -c $tmp.c <&$nullin >&$nullout + then success - + else failure - + copy - "#define $x$arg $v" + usr="$usr${nl}#define $x$arg $v" + fi + continue + ;; + extern) x=$1 + shift + t=$1 + shift + is npt $x + copy $tmp.c " +$std +#include +$usr +_BEGIN_EXTERNS_ +struct _iffe_struct { int _iffe_member; }; +extern struct _iffe_struct* $x _ARG_((struct _iffe_struct*)); +_END_EXTERNS_ +" + # some compilers with -O only warn for invalid intrinsic prototypes + case " $cc " in + *" -O "*) xx=`echo $cc | sed 's/ -O / /g'` ;; + *) xx=$cc ;; + esac + if compile $xx -c $tmp.c <&$nullin >&$nullout + then success - + while : + do case $1 in + ''|'('*|'['*) + break + ;; + esac + t="$t $1" + shift + done + case $in in + "") v= + while : + do case $# in + 0) break ;; + esac + t=$1 + shift + case $t in + ":") break ;; + esac + v="$v $t" + done + ;; + *) v=$* + ;; + esac + copy - "extern $t $x$v;" + # NOTE: technically if prototyped is on all tests should + # be run through proto(1), but we'd like iffe to + # work sans proto -- so we drop the extern's in + # the test headers + case $prototyped in + '') usr="$usr${nl}extern $t $x$v;" ;; + esac + else failure - + case $in in + "") while : + do case $# in + 0) break ;; + esac + case $1 in + ":") break ;; + esac + done + ;; + esac + fi + continue + ;; + header|include|reference) + while : + do case $# in + 0) break ;; + esac + x=$1 + shift + case $x in + ":") break ;; + esac + case " $gothdr " in + *" - $x "*) + ;; + *" + $x "*) + case $usr in + *"# include <"$x">"*) + ;; + *) case $op in + reference) + ;; + *) copy - "#include <$x>" + ;; + esac + usr="$usr${nl}#include <$x>" + ;; + esac + ;; + *) copy $tmp.c "$std +$usr +#include <$x> +int x; +" + if is_hdr - $x + then gothdr="$gothdr + $x" + case $op in + reference) + ;; + *) copy - "#include <$x>" + ;; + esac + usr="$usr${nl}#include <$x>" + else gothdr="$gothdr - $x" + fi + ;; + esac + done + continue + ;; + print) case $in in + "") v= + while : + do case $# in + 0) break ;; + esac + t=$1 + shift + case $t in + ":") break ;; + esac + v="$v $t" + done + ;; + *) v=$* + ;; + esac + copy - "$*" + usr="$usr${nl}$v" + continue + ;; + ver) arg=- + case $1:$2 in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*:[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) + vers="$vers$nl$1" + eval ver_$1=$2 + ;; + *) echo "$command: $op: expected: name YYYYMMDD" >&$stderr + ;; + esac + while : + do case $# in + 0) break ;; + esac + case $1 in + :) break ;; + esac + shift + done + ;; + esac + ;; + esac + + # NOTE() support + + case $ext in + *""*) + case $ext in + *"#define NOTE("*) + ;; + *) ext="$ext +#define NOTE(s) do{write(9,\" \",1);write(9,s,strlen(s));write(9,\" ...\",4);}while(0)" + ;; + esac + ;; + esac + + # save $* for ancient shells + + argx=1 + argv=$* + + # loop on all candidate groups + + while : + do + # check the candidate macros + + cc="$cc $mac" + + # check for global default headers (some cc -E insist on compiling) + + case $hdrtest in + '') hdrtest=1 + allinc= + for x in types + do case $config in + 0) c=_sys_${x} + ;; + 1) case $shell in + ksh) typeset -u u=$x ;; + *) u=`echo $x | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_SYS_${u}_H + ;; + esac + x=sys/$x.h + echo "${allinc}#include <$x>" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + case $explicit in + 0) can="$can$cansep#define $c 1 /* #include <$x> ok */" + nan="$nan$cansep$c=1" + cansep=$nl + ;; + esac + eval $c=1 + allinc="${allinc}#include <$x>$nl" + else gothdr="$gothdr - $x" + case $explicit$all$config$undef in + 0?1?|0??1) + can="$can$cansep#undef $c /* #include <$x> not ok */" + nan="$nan$cansep$c=" + cansep=$nl + ;; + 01??) can="$can$cansep#define $c 0 /* #include <$x> not ok */" + nan="$nan$cansep$c=0" + cansep=$nl + ;; + esac + fi + done + ;; + esac + + # add implicit headers/libraries before the checks + + case $op in + npt) hdr="sys/types.h stdlib.h unistd.h $hdr" + ;; + siz|typ)hdr="sys/types.h time.h sys/time.h sys/times.h stddef.h stdlib.h $hdr" + ;; + esac + + # check the candidate headers + + case $hdr in + ?*) z=$hdr + hdr= + dis=0 + for x in $z + do case $x in + *.h) case " $gothdr " in + *" - $x "*) + continue + ;; + *" + $x "*) + ;; + *) case $shell in + bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` + ;; + *) eval 'c=${x##*[\\/]}' + eval 'c=${c%%.*}' + case $x in + */*) eval 'c=${x%%[\\/]*}_${c}' ;; + esac + ;; + esac + case $explicit in + 0) dis=0 + ;; + *) case $x in + */*) dis=$c ;; + *) dis=hdr ;; + esac + case ${dis}_ in + ${op}_*)dis=0 ;; + *) dis=1 ;; + esac + ;; + esac + case $config in + 0) case $x in + */*) c=_${c} ;; + *) c=_hdr_${c} ;; + esac + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_${u}_H + ;; + esac + echo "${allinc}#include <$x>" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + case $dis in + 0) can="$can$cansep#define $c 1 /* #include <$x> ok */" + nan="$nan$cansep$c=1" + cansep=$nl + ;; + esac + eval $c=1 + else gothdr="$gothdr - $x" + case $dis$all$config$undef in + 0?1?|0??1) + can="$can$cansep#undef $c /* #include <$x> not ok */" + nan="$nan$cansep$c=" + cansep=$nl + ;; + 01??) can="$can$cansep#define $c 0 /* #include <$x> not ok */" + nan="$nan$cansep$c=0" + cansep=$nl + ;; + esac + continue + fi + ;; + esac + ;; + *) test -r $x || continue + ;; + esac + hdr="$hdr $x" + done + ;; + esac + + # check the candidate libraries + + case $lib in + ?*) z= + for p in $lib + do z="$p $z" + done + lib= + p= + hit=0 + echo "int main(){return(0);}" > $tmp.c + for x in $z + do p=$x + case " $gotlib " in + *"- $p "*) + failure + + p= + ;; + *"+ $p "*) + success + + lib="$p $lib" + ;; + *) rm -f $tmp.exe + is LIB $p + if compile $cc -o $tmp.exe $tmp.c $p $lib <&$nullin >&$nullout + then success + gotlib="$gotlib + $p" + lib="$p $lib" + e=0 + else a= + e=1 + for l in $z + do case $l in + -) a= + continue + ;; + $p) a=$p + continue + ;; + *) case $gotlib in + *" $l "*) continue ;; + esac + ;; + esac + case $a in + $p) a="$a $l" + if compile $cc -o $tmp.exe $tmp.c $a <&$nullin >&$nullout + then success + gotlib="$gotlib + $p" + lib="$p $lib" + e=0 + break + fi + ;; + esac + done + case $e in + 1) failure + gotlib="$gotlib - $p" + ;; + esac + fi + y= + for x in $p + do case $shell in + bsh) c=`echo X$x | sed 's,X-l,,'` ;; + *) eval 'c=${x#-l}' ;; + esac + case $c in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` + ;; + esac + case $config in + 0) case $e$p in + 0*' '*) case " $gotlib " in + *[-+]" $x "*) + ;; + *) can="$can$cansep#define _LIB_$c 1 /* $x is a library */" + nan="$nan${cansep}_LIB_$c=1" + cansep=$nl + eval _LIB_$c=1 + ;; + esac + ;; + esac + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=$u + case $e in + 0*' '*) case " $gotlib " in + *[-+]" $x "*) + ;; + *) can="$can$cansep#define HAVE_${c}_LIB 1 /* $x is a library */" + nan="$nan${cansep}HAVE_${c}_LIB=1" + cansep=$nl + eval HAVE_${c}_LIB=1 + ;; + esac + ;; + esac + ;; + esac + y=${y}_$c + done + case $config in + 0) c=_LIB${y} ;; + 1) c=HAVE${y}_LIB ;; + esac + case $p in + *' '*) q="a library group" ;; + *) q="a library" ;; + esac + case $e in + 0) can="$can$cansep#define $c 1 /* $p is $q */" + nan="$nan$cansep$c=1" + cansep=$nl + eval $c=1 + case $hit in + 1) break ;; + esac + ;; + 1) case $all$config$undef in + ?1?|??1)can="$can$cansep#undef $c /* $p is not $q */" + nan="$nan$cansep$c=" + cansep=$nl + ;; + 1??) can="$can$cansep#define $c 0 /* $p is not $q */" + nan="$nan$cansep$c=0" + cansep=$nl + ;; + esac + eval $c=0 + ;; + esac + p= + ;; + esac + done + ;; + esac + + # last op precheck + + case $op in + ref) deflib="$deflib $lib" + defhdr="$defhdr $hdr" + break + ;; + esac + IFS=" ," + case $shell in + bash) op=`echo $op` + arg=`echo $arg` + ;; + *) eval op=\"$op\" + eval arg=\"$arg\" + ;; + esac + IFS=$ifs + + # check for op aliases + + x= + for o in $op + do case $o in + def|default) x="$x cmd dat hdr key lib mth sys typ" ;; + *) x="$x $o" ;; + esac + done + + # loop on the ops o and args a + + result=UNKNOWN + for o in $x + do for a in $arg + do c= + case $a in + *[.\\/]*) + case $o in + hdr|lcl|nxt|pth|sys) + x=$a + case $x in + *.lcl|*.nxt) + case $o in + sys) x=sys/$x ;; + esac + case $shell in + bsh) eval `echo $x | sed 's,\\(.*\\)\.\\([^.]*\\),x=\\1 o=\\2,'` + ;; + *) o=${x##*.} + x=${x%.${o}} + ;; + esac + v=$x + ;; + esac + case $x in + *[\\/]*)case $shell in + bsh) eval `echo $x | sed 's,\\(.*\\)[\\\\//]\\(.*\\),p=\\1 v=\\2,'` + ;; + *) eval 'p=${x%/*}' + eval 'v=${x##*/}' + ;; + esac + ;; + *.*) case $shell in + bsh) eval `echo $x | sed 's,\\(.*\\)\\.\\(.*\\),p=\\1 v=\\2,'` + ;; + *) eval 'p=${x%.*}' + eval 'v=${x##*.}' + ;; + esac + ;; + *) p= + ;; + esac + case $o in + lcl|nxt) c=$v.$o ;; + *) c=$v ;; + esac + ;; + *) case $shell in + bsh) eval `echo $a | sed -e 's,.*[\\\\/],,' -e 's/\\(.*\\)\\.\\(.*\\)/p=\\1 v=\\2/'` + ;; + *) eval 'p=${a%.*}' + eval 'p=${p##*[\\/]}' + eval 'v=${a##*.}' + eval 'v=${v##*[\\/]}' + ;; + esac + ;; + esac + case $p in + '') f=${v} ;; + *) f=${p}/${v} ;; + esac + case $o in + run) v=$p + p= + m=_${v} + ;; + mem) case $p in + *.*) case $shell in + bsh) eval `echo $p | sed 's/\\([^.]*\\)\\.\\(.*\\)/p=\\1 m=\\2/'` + ;; + *) eval 'm=${p#*.}' + eval 'p=${p%%.*}' + ;; + esac + v=${m}.${v} + esac + case $config in + 0) m=_${v}_${p} ;; + 1) m=_${v}_in_${p} ;; + esac + ;; + *) case $p in + '') m=_${v} ;; + *) m=_${p}_${v} ;; + esac + ;; + esac + ;; + *) p= + v=$a + f=$a + m=_${v} + ;; + esac + case $c in + '') c=$v ;; + esac + M=$m + case $o in + out) case $a in + -) a=- + ;; + ?*) test="$a $test" + a= + ;; + esac + ;; + *) case " $idyes " in + *" $m "*) + i=1 + ;; + *) case " $idno " in + *" $m "*) + i=0 + ;; + *) case $m in + *'*') m=`echo "$m" | sed 's,\*,_ptr,g'` ;; + esac + case $m in + *[-+/\\]*) + i=0 + ;; + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + is id $m + copy $tmp.c "int $m = 0;" + if compile $cc -c $tmp.c + then success - + idyes="$idyes $m" + i=1 + else failure - + idno="$idno $m" + i=0 + fi + ;; + *) i=1 + ;; + esac + ;; + esac + case $i in + 0) case $o in + dat|dfn|key|lib|mac|mth|nos|npt|siz|sym|typ|val) + continue + ;; + esac + ;; + esac + ;; + esac + ;; + esac + case $m in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + m=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + ;; + esac + + # check output redirection + + case $out in + $cur) ;; + *) case $cur in + $a|$c) ;; + *) case $cur in + .) ;; + *) case $vers in + ?*) echo + for api in $vers + do API=`echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + eval ver='${'ver_${api}'}' + echo "#define ${API}_VERSION ${ver}" + done + esac + case $apis in + ?*) for api in $apis + do API=`echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + echo "#define ${API}API(rel) ( _BLD_${api} || !_API_${api} || _API_${api} >= rel )" + map= + sep= + eval syms='"${'api_sym_${api}'}"' + # old solaris requires -k # + set x x `echo "$syms" | sort -t: -u -k 1,1 -k 2,2nr 2>/dev/null | sed 's/:/ /'` + case $# in + 2) # ancient sort doesn't have -k # + set x x `echo "$syms" | sort -t: -u +0 -1 +1 -2nr 2>/dev/null | sed 's/:/ /'` + ;; + esac + sym= + while : + do shift 2 + case $# in + [01]) break ;; + esac + prv=$sym + sym=$1 + rel=$2 + case $prv in + $sym) echo "#elif _API_${api} >= $rel" + ;; + *) case $prv in + '') echo + echo "#if !defined(_API_${api}) && defined(_API_DEFAULT)" + echo "#define _API_${api} _API_DEFAULT" + echo "#endif" + ;; + *) echo "#endif" + ;; + esac + echo + echo "#if ${API}API($rel)" + ;; + esac + echo "#undef ${sym}" + echo "#define ${sym} ${sym}_${rel}" + map=$map$sep${sym}_${rel} + sep=' ' + done + echo "#endif" + echo + echo "#define _API_${api}_MAP \"$map\"" + done + echo + ;; + esac + case $iff in + ?*) echo "#endif" ;; + esac + case $cur in + -) ;; + *) exec >/dev/null + case $cur in + *[\\/]*|*.h) x=$cur ;; + *) x=$dir/$cur ;; + esac + case $define in + n) sed '/^#/d' $tmp.h > $tmp.c + sed '/^#/d' $x > $tmp.t + ;; + *) (proto -r $protoflags $tmp.h) >/dev/null 2>&1 + sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c + sed 's,/\*[^/]*\*/, ,g' $x > $tmp.t + ;; + esac + if cmp -s $tmp.c $tmp.t + then rm -f $tmp.h + case $verbose in + 1) echo "$command: $x: unchanged" >&$stderr ;; + esac + touch "$x" # avoid rerunning test on subsequent runs + else case $x in + ${dir}[\\/]$cur) test -d $dir || mkdir $dir || exit 1 ;; + esac + mv $tmp.h $x + fi + ;; + esac + ;; + esac + case $out in + +) case $status in + 1) ;; + *) status=0 ;; + esac + exit $status + ;; + -) eval "exec >&$stdout" + ;; + *) exec >$tmp.h + ;; + esac + case $out in + "") case $a in + *[\\/]*|???????????????*) cur=$c ;; + *) cur=$a ;; + esac + ;; + *) cur=$out + ;; + esac + case $in in + ""|-|+) case $o in + run) x=" from $a" ;; + *) x= ;; + esac + ;; + *) x=" from $in" + ;; + esac + + # output header comments + + case $define in + n) ;; + ?) echo "/* : : generated$x by $command version $version : : */" + for x in $pragma + do echo "#pragma $x" + done + case $out in + ""|-|+) x=$m + ;; + *.*) case $shell in + bsh) eval `echo $in | sed -e 's,\\.,_,g' -e 's/^/x=/'` + ;; + *) i=$out + x=_ + while : + do case $i in + *.*) eval 'x=$x${i%%.*}_' + eval 'i=${i#*.}' + ;; + *) x=$x$i + break + ;; + esac + done + ;; + esac + ;; + *) x=_$out + ;; + esac + case $o in + iff) case $M in + ""|*-*) ;; + *) iff=${m}_H ;; + esac + ;; + *) case $regress in + '') case $x in + *-*) ;; + *) x=`pwd | sed -e 's,.*[\\\\/],,' -e 's,\\..*,,' -e 's,^lib,,' -e 's,^,'${x}_',' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + # ksh n+ bug workaround + case $x in + *[!_]*) ;; + *) x=_$$ ;; + esac + iff=_def${x} + ;; + esac + ;; + *) case $x in + *-*) ;; + *) iff=_REGRESS + ;; + esac + ;; + esac + ;; + esac + case $iff in + ?*) echo "#ifndef $iff" + echo "#define $iff 1" + ;; + esac + ;; + esac + ;; + esac + ;; + esac + case $can in + ?*) case $define in + 1) echo "$can" ;; + n) echo "$nan" ;; + esac + can= + nan= + cansep= + ;; + esac + + # set up the candidate include list + + pre= + inc= + for x in $defhdr - $hdr + do case $x in + -) case $pre in + ?*) continue ;; + esac + case $v in + *.*) for x in `echo $v | sed 's,\\., ,g'` + do pre="$pre +#undef $x" + done + ;; + *) case $o in + siz|typ)case $v in + char|short|int|long) + ;; + *) pre="#undef $v" + ;; + esac + ;; + *) pre="#undef $v" + ;; + esac + ;; + esac + ;; + *.h) case $shell in + bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` + ;; + *) eval 'c=${x##*[\\/]}' + eval 'c=${c%%.*}' + case $x in + */*) eval 'c=${x%%[\\/]*}_${c}' ;; + esac + ;; + esac + case $config in + 0) case $x in + */*) c=_${c} ;; + *) c=_hdr_${c} ;; + esac + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_${u}_H + ;; + esac + case " $puthdr " in + *" $c "*) + ;; + *) puthdr="$puthdr $c" + usr="$usr$nl#define $c 1" + ;; + esac + inc="$inc +#include <$x>" + ;; + esac + done + + # set up the candidate lib list + + for x in $lib $deflib + do case $shell in + ksh) eval 'c=${x#-l}' ;; + *) c=`echo X$x | sed 's,X-l,,'` ;; + esac + case $c in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` + ;; + esac + case $config in + 0) c=_LIB_${c} + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_${u}_LIB + ;; + esac + case " $putlib " in + *" $c "*) + ;; + *) putlib="$putlib $c" + usr="$usr$nl#define $c 1" + ;; + esac + done + + # src overrides builtin test + + case $config:$def in + 0:) case $o in + tst|var);; + *) m=_${o}${m} ;; + esac + ;; + 1:) case $o in + tst|var)m=${v} ;; + esac + case $shell in + ksh) typeset -u u=$m ;; + *) u=`echo $m | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + case $o in + tst|var)case $m in + $u) ;; + *) case $m in + hdr_*|lib_*|sys_*) + case $shell in + ksh) u=${u#????} ;; + *) u=`echo $u | sed 's/....//'` ;; + esac + ;; + esac + m=HAVE_${u} + ;; + esac + ;; + dat) m=HAVE${u}_DATA ;; + hdr|lcl)m=HAVE${u}_H ;; + key) m=HAVE${u}_RESERVED ;; + mth) m=HAVE${u}_MATH ;; + npt) m=HAVE${u}_DECL ;; + pth) m=${u}_PATH + case $shell in + ksh) m=${m#_} ;; + *) m=`echo $m | sed 's,^_,,'` ;; + esac + ;; + nxt) m=HAVE${u}_NEXT ;; + siz) m=SIZEOF${u} ;; + sys) m=HAVE_SYS${u}_H ;; + *) m=HAVE${u} ;; + esac + ;; + *) m=$def + M=$m + ;; + esac + case $src in + ?*) case $src in + *[\<\"][Ss][Tt][Dd][Ii][Oo].[Hh][\"\>]* | *\* | *\* | */[*]\[*]/*) + EXT= + ;; + *) EXT="$tst +$ext" + ;; + esac + copy $tmp.c "$std +$EXT +$usr +$inc +$src +" + V=1 + e=0 + is tst "${note:-$run}" + case $run in + cat*|nocat*) + copy - "$src" + ;; + cross*|nocross*) + copy $tmp.sh "$src" + chmod +x $tmp.sh + execute $tmp.sh <&$nullin || e=1 + ;; + run*|norun*) + (eval "$src") <&$nullin || e=1 + ;; + mac*|nomac*) + if compile $cc -E -P $tmp.c <&$nullin >$tmp.i + then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i + else e=1 + fi + ;; + p*|nop*)compile $cc -DTEST=$p -DID=$v -E $tmp.c <&$nullin >&$nullout || e=1 + ;; + c*|noc*)compile $cc -DTEST=$p -DID=$v -c $tmp.c <&$nullin >&$nullout || e=1 + ;; + *) case $run in + status*)ccflags= + ;; + s*|nos*)case $reallystatictest in + '') #UNDENT... + + reallystatictest=. + echo "$tst +$ext +int main(){printf("hello");return(0);}" > ${tmp}s.c + rm -f ${tmp}s.exe + if compile $cc -c ${tmp}s.c <&$nullin >&$nullout && + compile $cc -o ${tmp}s.exe ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && + $executable ${tmp}s.exe + then e=`wc -l ${tmp}s.e` + eval set x x $binding + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f ${tmp}s.exe + compile $cc -o ${tmp}s.exe $1 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue + case `wc -l ${tmp}s.e` in + $e) ;; + *) continue ;; + esac + d=`ls -s ${tmp}s.exe` + rm -f ${tmp}s.exe + compile $cc -o ${tmp}s.exe $2 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue + case `wc -l ${tmp}s.e` in + $e) ;; + *) continue ;; + esac + case `ls -s ${tmp}s.exe` in + $d) ;; + *) reallystatic=$2 + set x + shift + break + ;; + esac + done + fi + rm -f ${tmp}s.* + #...INDENT + ;; + esac + ccflags=$reallystatic + ;; + *) ccflags= + ;; + esac + set x $mac + e=1 + while : + do o= + shift + while : + do case $# in + 0) break ;; + esac + case $1 in + -) break ;; + esac + o="$o $1" + shift + done + rm -f $tmp.exe + if compile $cc $ccflags $o -DTEST=$p -DID=$v -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe + then case $run in + + status*)execute $tmp.exe <&$nullin >&$nullout + V=$? + case $V in + 0) e=1 ;; + *) e=0 ;; + esac + break + ;; + no[ls]*);; + [ls]*) e=0 && break ;; + noo*) execute $tmp.exe <&$nullin >$tmp.out || break ;; + o*) execute $tmp.exe <&$nullin >$tmp.out && e=0 && break ;; + no*) execute $tmp.exe <&$nullin >&$nullout || break ;; + *) execute $tmp.exe <&$nullin >&$nullout && e=0 && break ;; + + esac + else case $run in + no[els]*)e=1 && break ;; + esac + fi + case $# in + 0) case $run in + no*) e=0 ;; + esac + break + ;; + esac + done + ;; + esac + o=1 + case $run in + no*) case $e in + 0) e=1 ;; + *) e=0 ;; + esac + ;; + esac + case $run in + o*|noo*)case $e in + 0) cat $tmp.out ;; + esac + rm -f $tmp.out + ;; + esac + report $e $V "${note:-$run\ passed}" "${note:-$run} failed" + continue + ;; + esac + + # initialize common builtin state + + case $o in + dat|lib|mth|run) + case $statictest in + "") statictest=FoobaR + copy $tmp.c " +$tst +$ext +$std +$usr +_BEGIN_EXTERNS_ +extern int $statictest; +_END_EXTERNS_ +int main(){char* i = (char*)&$statictest; return ((unsigned int)i)^0xaaaa;} +" + rm -f $tmp.exe + if compile $cc -o $tmp.exe $tmp.c <&$nullin >&$nullout && $executable $tmp.exe + then case $static in + .) static= + copy $tmp.c " +$tst +$ext +int main(){printf("hello");return(0);} +" + rm -f $tmp.exe + if compile $cc -c $tmp.c <&$nullin >&$nullout && + compile $cc -o $tmp.exe $tmp.o <&$nullin >&$nullout && + $executable $tmp.exe + then e=`wc -l $tmp.e` + eval set x x $binding + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f $tmp.exe + compile $cc -o $tmp.exe $1 $tmp.o <&$nullin >&$nullout && $executable $tmp.exe || continue + case `wc -l $tmp.e` in + $e) ;; + *) continue ;; + esac + d=`ls -s $tmp.exe` + rm -f $tmp.exe + compile $cc -o $tmp.exe $2 $tmp.o <&$nullin >&$nullout && $executable $tmp.exe || continue + case `wc -l $tmp.e` in + $e) ;; + *) continue ;; + esac + case `ls -s $tmp.exe` in + $d) ;; + *) static=$2 + set x + shift + break + ;; + esac + done + fi + ;; + esac + else static= + fi + ;; + esac + ;; + esac + + # builtin tests + + case $o in + api) ;; + cmd) case $p in + ?*) continue ;; + esac + is $o $a + k=1 + for j in "" usr + do case $j in + "") d= s= ;; + *) d=/$j s=_$j ;; + esac + for i in bin etc ucb + do if test -f $d/$i/$a + then case $k in + 1) k=0 + case $M in + *-*) ;; + *) usr="$usr$nl#define $m 1" + case $define in + 1) echo "#define $m 1 /* $a in ?(/usr)/(bin|etc|ucb) */" ;; + n) echo "$m=1" ;; + esac + ;; + esac + ;; + esac + c=${s}_${i}_${v} + usr="$usr$nl#define $c 1" + case $define in + 1) echo "#define $c 1 /* $d/$i/$a found */" ;; + n) echo "$c=1" ;; + esac + fi + done + done + case $k in + 0) success ;; + 1) failure ;; + esac + ;; + dat) case $p in + ?*) continue ;; + esac + { + copy - " +$tst +$ext +$std +$usr +$pre +" + case $inc in + ?*) echo "$inc" + ;; + *) echo "_BEGIN_EXTERNS_ +extern int $v; +_END_EXTERNS_" + ;; + esac + echo " +#ifdef _DLL +#define _REF_ +#else +#define _REF_ & +#endif +int main(){char* i = (char*) _REF_ $v; return ((unsigned int)i)^0xaaaa;}" + } > $tmp.c + is $o $v + rm -f $tmp.exe + compile $cc -c $tmp.c <&$nullin >&$nullout && + compile $cc $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe + report $? 1 "$v in default lib(s)" "$v not in default lib(s)" + ;; + dfn) case $p in + ?*) continue ;; + esac + is dfn $v + echo "$pre +$tst +$ext +$inc +#ifdef $v +<<\"#ifndef $v\">> +<<\"#define $v\">> $v <<\"/* native $v */\">> +<<\"#endif\">> +#endif" > $tmp.c + if compile $cc -E -P $tmp.c <&$nullin >$tmp.i + then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i > $tmp.t + if test -s $tmp.t + then success + cat $tmp.t + else failure + fi + else failure + fi + ;; + exp) case $test in + '') echo "$command: $file$sline: test expression expected for $o" >&$stderr + exit 1 + ;; + esac + case $a in + -|'') ;; + *) eval x='$'$a + case $x in + 1) result=FAILURE + continue + ;; + esac + ;; + esac + case $test in + [01]|'"'*'"'|'<'*'>') + case $a in + -|'') ;; + *) case $define$note in + 1) echo "#define $a $test" ;; + 1*) echo "#define $a $test /* $note */" ;; + n) echo "$a=$test" ;; + esac + eval $a='$test' + ;; + esac + ;; + *) case $note in + '') note=$test ;; + esac + case $test in + '') c=1 + ;; + *) is exp "$note" + x= + for i in `echo '' $test | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_], & ,g'` + do case $i in + [\ \ ]) + ;; + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]*) + eval i='${'$i'}' + case $i in + '') i=0 + ;; + '"'*'"');; + *[!-+0123456789]*) + case $i in + *'"'*) i=1 ;; + *) i='"'$i'"' ;; + esac + ;; + esac + x="$x $i" + ;; + '!') x="$x 0 =" + ;; + '&'|'|')case $x in + *"$i") ;; + *) x="$x \\$i" ;; + esac + ;; + *) x="$x \\$i" + ;; + esac + done + c=`eval expr $x 2>&$stderr` + ;; + esac + case $c in + 0) c=1 ;; + *) c=0 ;; + esac + M=$a + m=$a + report $c 1 "$note is true" "$note is false" + ;; + esac + ;; + hdr|lcl|nxt|sys) + case $o in + lcl|nxt)case $M in + *-*) continue ;; + esac + eval x='$'_$m + case $x in + ?*) continue ;; + esac + eval _$m=1 + is $o $f + echo "$pre +$tst +$ext +$inc +#include <$f.h>" > $tmp.c + case $f in + sys/*) e= ;; + *) e='-e /[\\\\\/]sys[\\\\\/]'$f'\\.h"/d' ;; + esac + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then i=`sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q` + case $i in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*) + ;; + */*/*) k=`echo "$i" | sed 's,.*/\([^/]*/[^/]*\)$,../\1,'` + echo "$pre +$tst +$ext +$inc +#include <$k>" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then j=`sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q` + wi=`wc < "$i"` + wj=`wc < "$j"` + case $wi in + $wj) i=$k ;; + esac + fi + ;; + *) echo "$pre +$tst +$ext +$inc +#include <../include/$f.h>" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >&$nullout + then i=../include/$f.h + fi + ;; + esac + else i= + fi + case $i in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*|[\\/]*) + success + case $o in + lcl) echo "#if defined(__STDPP__directive)" + echo "__STDPP__directive pragma pp:hosted" + echo "#endif" + echo "#include <$i> /* the native <$f.h> */" + echo "#undef $m" + usr="$usr$nl#define $m 1" + echo "#define $m 1" + ;; + nxt) echo "#define $m <$i> /* include path for the native <$f.h> */" + echo "#define ${m}_str \"$i\" /* include string for the native <$f.h> */" + usr="$usr$nl#define $m <$i>$nl#define ${m}_str \"$i\"" + eval $m=\\\<$i\\\> + ;; + esac + break + ;; + ../*/*) success + case $o in + lcl) echo "#include <$i> /* the native <$f.h> */" + echo "#undef $m" + usr="$usr$nl#define $m 1" + echo "#define $m 1" + eval $m=1 + ;; + nxt) echo "#define $m <$i> /* include path for the native <$f.h> */" + echo "#define ${m}_str \"$i\" /* include string for the native <$f.h> */" + usr="$usr$nl#define $m <$i>$nl#define ${m}_str \"$i\"" + eval $m=\\\<$i\\\> + ;; + esac + break + ;; + *) failure + case $o in + lcl) case $all$config$undef in + ?1?|??1)echo "#undef $m /* no native <$f.h> */" ;; + 1??) echo "#define $m 0 /* no native <$f.h> */" ;; + esac + eval $m=0 + ;; + nxt) case $all$config$undef in + ?1?|??1)echo "#undef $m /* no include path for the native <$f.h> */" ;; + esac + ;; + esac + ;; + esac + ;; + *) case $o in + hdr) x=$f.h ;; + sys) x=sys/$f.h ;; + esac + case " $gothdr " in + *" - $x "*) + failure + + ;; + *" + $x "*) + success + + ;; + *) echo " +$tst +$ext +$allinc +$inc +#include <$x>" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + case $M in + *-*) ;; + *) case " $puthdr " in + *" $m "*) + ;; + *) puthdr="$puthdr $m" + usr="$usr$nl#define $m 1" + ;; + esac + case $define in + 1) echo "#define $m 1 /* #include <$x> ok */" ;; + n) echo "$m=1" ;; + esac + eval $m=1 + ;; + esac + else gothdr="$gothdr - $x" + case $M in + *-*) ;; + *) case $define$all$config$undef in + 1?1?|1??1)echo "#undef $m /* #include <$x> not ok */" ;; + 11??) echo "#define $m 0 /* #include <$x> not ok */" ;; + n1?1) echo "$m=" ;; + n1??) echo "$m=0" ;; + esac + eval $m=0 + ;; + esac + fi + ;; + esac + continue + ;; + esac + ;; + iff) ;; + ini) ;; + key) case $p in + ?*) continue ;; + esac + w=$v + while : + do is $o $w + echo "$pre +$tst +$ext +int f(){int $w = 1;return($w);}" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then failure + case $set in + *" ="|*" = "*) + set x $set + shift + w= + while : + do case $# in + 0) break ;; + esac + case $1 in + =) break ;; + esac + case $w in + '') w=$1 ;; + *) w="$w $1" ;; + esac + shift + done + case $1 in + =) shift + case $# in + 0) set=" " ;; + *) set=$* ;; + esac + ;; + *) set= + ;; + esac + case $shell in + ksh) typeset -u u=$w ;; + *) u=`echo $w | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + u=_$u + M=$w + case $M in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + M=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + ;; + esac + case $config in + 1) m=HAVE${u}_RESERVED ;; + *) m=_key_${w} ;; + esac + continue + ;; + esac + report - 1 - - "$w is not a reserved keyword" "default for reserved keyword $v" + else report 0 1 "$w is a reserved keyword" - + case $M in + *-*) ;; + *) case $define$w in + 1$v) ;; + 1*) echo "#define $v $w /* alternate for reserved keyword $v */" ;; + n*) echo "$v=$w" ;; + esac + ;; + esac + fi + break + done + ;; + lib|mth)case $p in + ?*) continue ;; + esac + case $v in + -) continue ;; + esac + is $o $v + copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +typedef int (*_IFFE_fun)(); +#ifdef _IFFE_extern +_BEGIN_EXTERNS_ +extern int $v(); +_END_EXTERNS_ +#endif +static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;} +" + d=-D_IFFE_extern + if compile $cc -c $tmp.c <&$nullin >&$nullout + then d= + elif compile $cc $d -c $tmp.c <&$nullin >&$nullout + then : + else d=error + fi + if test error != "$d" + then rm -f $tmp.exe + if compile $cc $d $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe + then case $o in + lib) c=0 ;; + *) c=1 ;; + esac + report $c 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" + else case $o in + mth) rm -f $tmp.exe + compile $cc $d $static -o $tmp.exe $tmp.o -lm <&$nullin >&$nullout && + $executable $tmp.exe + report $? 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" + ;; + *) report 1 1 - "$v() not in default lib(s)" "default for function $v()" + ;; + esac + fi + else case $intrinsic in + '') copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +_BEGIN_EXTERNS_ +extern int foo(); +_END_EXTERNS_ +static int ((*i)())=foo;int main(){return(i==0);} +" + compile $cc -c $tmp.c <&$nullin >&$nullout + intrinsic=$? + ;; + esac + case $o in + mth) report $intrinsic 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" ;; + *) report $intrinsic 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" ;; + esac + fi + ;; + mac) case $p in + ?*) continue ;; + esac + is mac $v + echo " +$tst +$ext +$pre +$inc +#ifdef $v +'$m:$v' +#endif" > $tmp.c + compile $cc -E $tmp.c <&$nullin | grep -c "'$m:$v'" >&$nullout + report $? 1 "$v is a macro" "$v is not a macro" "default for macro $v" + ;; + mem) case $p in + ?*) eval i='$'_iffe_typedef_$p + case $i in + 0|1) ;; + *) echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i);" > $tmp.c + is typ $p + if compile $cc -c $tmp.c <&$nullin >&$nullout + then success - + eval _iffe_typedef_$p=1 + i=1 + else failure - + eval _iffe_typedef_$p=0 + i=0 + fi + ;; + esac + case $i in + 0) i="$v is not a member of $p" p="struct $p" ;; + *) i=- ;; + esac + is mem $v "$p" + echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i.$v);" > $tmp.c + compile $cc -c $tmp.c <&$nullin >&$nullout + report $? 1 "$v is a member of $p" "$i" + ;; + *) p=$v + eval i='$'_iffe_typedef_$p + case $i in + 0|1) ;; + *) echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i);" > $tmp.c + is typ $p + if compile $cc -c $tmp.c <&$nullin >&$nullout + then success - + eval _iffe_typedef_$p=1 + i=1 + else failure - + eval _iffe_typedef_$p=0 + i=0 + fi + ;; + esac + case $i in + 0) i="$p is not a non-opaque struct" p="struct $p" ;; + *) i=- ;; + esac + is nos "$p" + echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i);" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then echo "$pre +$tst +$ext +$inc +static $p i; +unsigned long f() { return (unsigned long)i; }" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then c=1 + else c=0 + fi + else c=1 + fi + report $c 1 "$p is a non-opaque struct" "$i" + esac + ;; + nop) ;; + npt) is npt $v + copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +_BEGIN_EXTERNS_ +struct _iffe_struct { int _iffe_member; }; +#if _STD_ +extern struct _iffe_struct* $v(struct _iffe_struct*); +#else +extern struct _iffe_struct* $v(); +#endif +_END_EXTERNS_ +" + # some compilers with -O only warn for invalid intrinsic prototypes + case " $cc " in + *" -O "*) xx=`echo $cc | sed 's/ -O / /g'` ;; + *) xx=$cc ;; + esac + compile $xx -c $tmp.c <&$nullin >&$nullout + report -$config $? 1 "$v() needs a prototype" "$v() does not need a prototype" + ;; + num) is num $v + copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +_BEGIN_EXTERNS_ +int _iffe_int = $v / 2; +_END_EXTERNS_ +" + compile $cc -c $tmp.c <&$nullin >&$nullout + report $? 1 "$v is a numeric constant" "$v is not a numeric constant" + ;; + one) for i in $a $hdr + do x="#include <$i>" + case " $gothdr " in + *" - $i "*) + continue + ;; + *" + $i "*) + ;; + *) echo "$x" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + else gothdr="$gothdr - $x" + continue + fi + ;; + esac + case $one in + "") one=$x + ;; + *"$x"*) break + ;; + *) echo "$one" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then c=$i + case $c in + *[\\/]*) c=`echo $c | sed 's,[\\\\/],[\\\\/],g'` ;; + esac + case `sed -e '/^#[line ]*1[ ][ ]*"[\\\\\/].*[\\\\\/]'$c'"/!d' $tmp.i` in + ?*) break ;; + esac + fi + one="$one$nl$x" + ;; + esac + echo "$x" + break + done + ;; + opt) M=$m + is opt $a + case " $PACKAGE_OPTIONS " in + *" $a "*) c=0 ;; + *) c=1 ;; + esac + report $c 1 "$a is set in \$PACKAGE_OPTIONS" "$a is not set in \$PACKAGE_OPTIONS" + ;; + out|output) + ;; + pth) is pth $a + pkg $pth + tab=" " + e= + f= + for i in $pth + do case $i in + '{') e="${nl}}" + l= + x=i + v="\$${x}" + t=${nl}${tab} + b="fnd()${nl}{${t}for ${x} in" + ;; + '}') b="${b}${t}do${tab}if $exists ${v}/\${1}${t}${tab}${tab}then${tab}f=${v}/\${1}${t}${tab}${tab}${tab}return${t}${tab}${tab}fi" + e="${t}done${e}" + eval "${b}${e}" + fnd $a + case $f in + ?*) break ;; + esac + ;; + -) b="${b}${t}do${tab}test \"${v}\" = '' -o -d \"${v}\" &&${t}${tab}${tab}" + x=${x}i + v="${v}\$${x}" + b="${b}for ${x} in" + e="${t}done${e}" + t="${t}${tab}${tab}" + ;; + *) case $e in + '') if $exists ${i}/${a} + then f=${i}/${a} + break + fi + ;; + *) case $i in + /|.) b="${b} ''" ;; + *) b="${b} /${i}" ;; + esac + ;; + esac + ;; + esac + done + case $f in + '') case $set in + ' ') f=$a ;; + ?*) f=$set ;; + esac + ;; + esac + case $f in + '') c=1 + ;; + *) c=0 + f="\"$f\"" + ;; + esac + report $c "$f" "${note:-$a path}" "$a path not found" + ;; + run) is run $a + if test ! -r $a + then failure not found + case $verbose in + 0) echo "$command: $file$line: $a: not found" >&$stderr ;; + esac + exit 1 + fi + noisy + case $a in + *.c) rm -f $tmp.exe + { + echo "$tst +$ext +$std +$usr +$inc" + cat $a + } > $tmp.c + compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$stderr 2>&$stderr && + $executable $tmp.exe && + execute $tmp.exe $opt <&$nullin + ;; + *.sh) { + copy - ": +set \"cc='$cc' executable='$executable' id='$m' static='$static' tmp='$tmp'\" $opt $hdr $test" + cat $a + } > $tmp.sh + chmod +x $tmp.sh + ( . $tmp.sh ) <&$nullin + ;; + *) false + ;; + esac + case $? in + 0) success + ;; + *) failure cannot run + case $verbose in + 0) echo "$command: $file$line: $a: cannot run" >&$stderr ;; + esac + exit 1 + ;; + esac + ;; + siz) case $p in + "") x= ;; + *) x="$p " ;; + esac + is siz "$x$v" + { + case $p:$v in + long:*|*:*[_0123456789]int[_0123456789]*) + echo "$pre +$tst +$ext +$inc +static $x$v i; +$x$v f() { +$x$v v; i = 1; v = i;" + echo "i = v * i; i = i / v; v = v + i; i = i - v;" + case $v in + float|double) ;; + *) echo "v <<= 4; i = v >> 2; i = 10; i = v % i; i |= v; v ^= i; i = 123; v &= i;" ;; + esac + echo "return v; }" + ;; + *) echo "$pre +$inc +struct xxx { $x$v mem; }; +static struct xxx v; +struct xxx* f() { return &v; }" + ;; + esac + case $x in + ""|"struct "|"union ") + echo "int g() { return 0; }" + ;; + *) echo "int g() { return sizeof($x$v)<=sizeof($v); }" ;; + esac + copy - " +int main() { + f(); + g(); + printf(\"%u\\n\", sizeof($x$v)); + return 0; +}" + } > $tmp.c + rm -f $tmp.exe $tmp.dat + if compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe && + execute $tmp.exe > $tmp.dat + then z=`cat $tmp.dat` + c=0 + else z=0 + c=1 + fi + report $c "$z" "sizeof($x$v)" "$x$v not a type with known size" + ;; + sym) case $test in + "") x=$v ;; + *) x=$test ;; + esac + echo "$pre +$tst +$ext +$inc +'=' $x '='" > $tmp.c + compile $cc -E $tmp.c <&$nullin \ + | sed \ + -e "/'='/!d" \ + -e "s/'='//g" \ + -e 's/[ ]//g' \ + -e 's/((([^()]*)))->/->/g' \ + -e 's/(([^()]*))->/->/g' \ + -e 's/([^()]*)->/->/g' \ + -e 's/\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*\)\[/\ +ary \1[/g' \ + -e 's/\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*\)(/\ +fun \1[/g' \ + -e 's/\*->\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]\)/->\ +ptr \1/g' \ + -e 's/->\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]\)/->\ +reg \1/g' \ + -e "/^$v\$/d" \ + -e 's/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*$/\ +nam &/g' \ + | sed \ + -e '/^... /!d' \ + | LC_ALL=C sort \ + -u \ + | sed \ + -e 's/\(...\) \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*\).*/#ifndef _\1_'$v'\ +#define _\1_'$v' \2\ +#define _\1_'$v'_str "\2"\ +#endif/' + ;; + typ) case $p in + "") x= ;; + *) x="$p " ;; + esac + is typ "$x$v" + { + case $p:$v in + long:*|*:*[_0123456789]int[_0123456789]*) + echo "$pre +$tst +$ext +$inc +static $x$v i; +$x$v f() { +$x$v v; i = 1; v = i;" + echo "i = v * i; i = i / v; v = v + i; i = i - v;" + case $v in + float|double) ;; + *) echo "v <<= 4; i = v >> 2; i = 10; i = v % i; i |= v; v ^= i; i = 123; v &= i;" ;; + esac + echo "return v; }" + ;; + *) echo "$pre +$tst +$ext +$inc +struct xxx { $x$v mem; }; +static struct xxx v; +struct xxx* f() { return &v; }" + ;; + esac + case $x in + ""|"struct "|"union ") + echo "int main() { f(); return 0; }" ;; + *) echo "int main() { f(); return sizeof($x$v)<=sizeof($v); }" ;; + esac + } > $tmp.c + rm -f $tmp.exe + compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe && + execute $tmp.exe + report $? 1 "$x$v is a type" "$x$v is not a type" "default for type $x$v" + ;; + val) case $arg in + '"'*'"')echo $arg=\'$val\' ;; + *) echo $arg=\"$val\" ;; + esac + ;; + ver) ;; + 0) result=FAILURE + ;; + 1) result=SUCCESS + ;; + :) ;; + -) ;; + *) echo "$command: $file$line: $o: unknown feature test" >&$stderr + status=1 + ;; + esac + done + done + case $not in + 1) case $result in + FAILURE) result=SUCCESS ;; + *) result=FAILURE ;; + esac + ;; + esac + case $result in + FAILURE) user_pf=$fail user_yn=$no ;; + *) user_pf=$pass user_yn=$yes ;; + esac + case $user_pf in + ?*) eval "$user_pf" <&$nullin ;; + esac + case $user_yn in + ?*) case $def in + -) ;; + *) case $note in + ?*) case $user_yn in + *$nl*) user_yn="/* $note */$nl$user_yn" ;; + *) user_yn="$user_yn /* $note */" ;; + esac + ;; + esac + ;; + esac + copy - "$user_yn" + ;; + esac + case $ifelse:$result in + TEST:SUCCESS) ifelse=KEEP ;; + TEST:*) ifelse=SKIP ;; + esac + case $group:$result in + :*|*:SUCCESS) break ;; + esac + set '' $groups '' "$@" + shift + case $1 in + '') shift; break ;; + esac + shift + + # set up and try the next group + + hdr=$com_hdr + lib=$com_lib + mac=$com_mac + opt=$com_opt + pth=$com_pth + test=$com_test + cc="$occ $includes" + group= + groups= + while : + do case $1 in + '') shift; break ;; + esac + case $1 in + *[\"\'\(\)\{\}\ \ ]*) + case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + -) group=$group$1 + groups="$groups $1" + ;; + -l*) case $group in + -*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + +l*) case $shell in + bsh) x=`echo X$1 | sed 's/X+/-/'` ;; + *) eval 'x=-${1#+}' ;; + esac + case $group in + -*) groups="$groups $x" ;; + *) lib="$lib $x" ;; + esac + ;; + -*|+*) case $group in + -*) groups="$groups $1" + ;; + *) case $op in + run) opt="$opt $1" + ;; + *) case $1 in + -D*) mac="$mac $1" ;; + *) cc="$cc $1" ;; + esac + ;; + esac + ;; + esac + ;; + *.[aAxX]|*.[dD][lL][lL]|*.[lL][iI][bB]) + case $group in + -*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + *[.\\/]*) + case $group in + -*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" ;; + *) hdr="$hdr $1" ;; + esac + ;; + esac + ;; + *) case $group in + -*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + esac + ;; + esac + shift + done + done +done diff --git a/src/cmd/INIT/iffe.tst b/src/cmd/INIT/iffe.tst new file mode 100644 index 000000000..75a916674 --- /dev/null +++ b/src/cmd/INIT/iffe.tst @@ -0,0 +1,1945 @@ +# regression tests for the iffe command + +TEST 01 'command line basics' + + EXEC -r -v - hdr stdio + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - hdr stdio + + EXEC -r -v - hdr stdio,limits + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _hdr_limits 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is limits.h a header ... yes' + + EXEC -r -v -s bsh - hdr stdio,limits + + EXEC -r -v - hdr,lib no_foo_bar,no_bar_foo stdio.h + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is no_foo_bar.h a header ... no +iffe: test: is no_bar_foo.h a header ... no +iffe: test: is no_foo_bar a library function ... no +iffe: test: is no_bar_foo a library function ... no' + + EXEC -r -v -s bsh - hdr,lib no_foo_bar,no_bar_foo stdio.h + + EXEC -r -v - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h + + EXEC -r -v -s bsh - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h + +TEST 02 'file input basics' + + EXEC -r -v - t1.iffe + INPUT t1.iffe $'hdr stdio' + OUTPUT - $'/* : : generated from t1.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - t1.iffe + + EXEC -r -v - t2.iffe + INPUT t2.iffe $'hdr stdio,limits' + OUTPUT - $'/* : : generated from t2.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _hdr_limits 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is limits.h a header ... yes' + + EXEC -r -v -s bsh - t2.iffe + + EXEC -r -v - t3.iffe + INPUT t3.iffe $'hdr,lib no_foo_bar,no_bar_foo stdio.h' + OUTPUT - $'/* : : generated from t3.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is no_foo_bar.h a header ... no +iffe: test: is no_bar_foo.h a header ... no +iffe: test: is no_foo_bar a library function ... no +iffe: test: is no_bar_foo a library function ... no' + + EXEC -r -v -s bsh - t3.iffe + + EXEC -r -v - t3.iffe + INPUT t3.iffe $'hdr no_foo_bar,no_bar_foo stdio.h +lib no_foo_bar,no_bar_foo stdio.h' + + EXEC -r -v -s bsh - t3.iffe + +TEST 03 'nested if' + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr stdio + if lib open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _lib_open 1 /* open() in default lib(s) */ + HIT 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is open a library function ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr _XXX_stdio + if lib open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_limits 1 /* #include ok */ +HIT 4 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is _XXX_stdio.h a header ... no +iffe: test: is limits.h a header ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr _XXX_stdio + if lib open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr _XXX_limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +HIT 5 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is _XXX_stdio.h a header ... no +iffe: test: is _XXX_limits.h a header ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr stdio + if lib _XXX_open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _lib_close 1 /* close() in default lib(s) */ + HIT 2 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is _XXX_open a library function ... no +iffe: test: is close a library function ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr stdio + if lib _XXX_open { + HIT 1 + } + elif lib _XXX_close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ + HIT 3 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is _XXX_open a library function ... no +iffe: test: is _XXX_close a library function ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define _mem_st_atime_stat 1 /* st_atime is a member of struct stat */ +#define ATIME 1 + +#define YESTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is stat a type or typedef ... no +iffe: test: is st_atime a member of struct stat ... yes +iffe: test: is ( !no_stat_time ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem foo_stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define _mem_st_ctime_stat 1 /* st_ctime is a member of struct stat */ +#define CTIME 1 + +#define YESTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is foo_stat a type or typedef ... no +iffe: test: is st_atime a member of struct foo_stat ... no +iffe: test: is stat a type or typedef ... no +iffe: test: is st_ctime a member of struct stat ... yes +iffe: test: is ( !no_stat_time ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem foo_stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem foo_stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define _mem_st_mtime_stat 1 /* st_mtime is a member of struct stat */ +#define MTIME 1 + +#define YESTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is foo_stat a type or typedef ... no +iffe: test: is st_atime a member of struct foo_stat ... no +iffe: test: is st_ctime a member of struct foo_stat ... no +iffe: test: is stat a type or typedef ... no +iffe: test: is st_mtime a member of struct stat ... yes +iffe: test: is ( !no_stat_time ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem foo_stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem foo_stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem foo_stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define NOTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is foo_stat a type or typedef ... no +iffe: test: is st_atime a member of struct foo_stat ... no +iffe: test: is st_ctime a member of struct foo_stat ... no +iffe: test: is st_mtime a member of struct foo_stat ... no +iffe: test: is ( !no_stat_time ) true ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'set explicit +iff previous +hdr stdio +if hdr stdio { + OK +} +else { + OK +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _previous_H +#define _previous_H 1 +#define _hdr_stdio 1 /* #include ok */ +OK + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - t.iffe + +TEST 04 'test variable/macro override' + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +HAVE_STDIO = hdr stdio' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if hdr - stdio { + #define HIT 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HIT 1 + +#endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if - hdr stdio { + #define HIT 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if ? hdr stdio { + #define HIT 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if hdr - stdio { + #define HIT 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if HAVE_STDIO = hdr stdio { + #define HIT 1 +} +endif +if ( HAVE_STDIO ) { + #define TOO ALSO +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#define HIT 1 + +#define TOO ALSO + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is ( HAVE_STDIO ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if HAVE_STDIO = hdr stdio { + #define HIT 1 +} +endif +exp ALSO HAVE_STDIO' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#define HIT 1 + +#define ALSO 1 /* HAVE_STDIO is true */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is HAVE_STDIO true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if HAVE_STDIO = hdr stdio { + #define HIT 1 +} +endif +ALSO = ( HAVE_STDIO )' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#define HIT 1 + +#define ALSO 1 /* ( HAVE_STDIO ) is true */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is ( HAVE_STDIO ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + +TEST 05 'test code option sequence' + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 1 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define _seq 1 /* long int type */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 2 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 1 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +/* long int type */ +#define seq 1 + +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 2 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +/* long int type */ +#define seq 1 + +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 2 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 3 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... +iffe: test: long int type ... no' + + EXEC -r -v -s bsh - t.iffe + +TEST 06 'block side effects' + + EXEC -r - t.iffe + INPUT t.iffe $'iff - +tst output{ + int + main() + { + printf("HIT\\n"); + return 0; + } +}end' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#define _sys_types 1 /* #include ok */ +HIT' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'iff +tst - output{ + int + main() + { + printf("HIT\\n"); + return 0; + } +}end' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'iff +tst - output{ + int + main() + { + printf("HIT\\n"); + return 1; + } +}end' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#define _sys_types 1 /* #include ok */' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'iff +tst - nooutput{ + int + main() + { + printf("HIT\\n"); + return 1; + } +}end' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#define _sys_types 1 /* #include ok */ +HIT' + + EXEC -r -s bsh - t.iffe + +TEST 07 'diagnostics' + + EXEC -r - t.iffe + INPUT t.iffe $'tst foo' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - $'iffe: t.iffe:1: tst: unknown feature test' + EXIT 1 + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'if (1)' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */' + ERROR - $'iffe: t.iffe:1: missing endif' + EXIT 1 + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'if' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */' + ERROR - $'iffe: t.iffe:1: missing endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'endif' + ERROR - $'iffe: t.iffe:1: endif: no matching if' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'if { +}end' + ERROR - $'iffe: t.iffe:2: missing }' + + EXEC -r -s bsh - t.iffe + +TEST 08 'negation consternation' + + EXEC -r - t.iffe + INPUT t.iffe $'npt fopen,fooon stdio.h' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _npt_fooon 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -u - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#undef _npt_fopen /* fopen() does not need a prototype */ +#define _npt_fooon 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -a - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _npt_fopen 0 /* fopen() does not need a prototype */ +#define _npt_fooon 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -C - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define HAVE_SYS_TYPES_H 1 /* #include ok */ +#define HAVE_STDLIB_H 1 /* #include ok */ +#define HAVE_UNISTD_H 1 /* #include ok */ +#define HAVE_STDIO_H 1 /* #include ok */ +#define HAVE_FOPEN_DECL 1 /* fopen() does not need a prototype */ +#undef HAVE_FOOON_DECL /* fooon() needs a prototype */ +#endif' + + EXEC -r - t.iffe + INPUT t.iffe $'NEED_FOPEN = npt fopen stdio.h +HAVE_FOPEN = ! npt fopen stdio.h +NEED_FOOON = npt fooon stdio.h +HAVE_FOOON = ! npt fooon stdio.h' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define HAVE_FOPEN 1 /* fopen() does not need a prototype */ +#define NEED_FOOON 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -u - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#undef NEED_FOPEN /* fopen() does not need a prototype */ +#define HAVE_FOPEN 1 /* fopen() does not need a prototype */ +#define NEED_FOOON 1 /* fooon() needs a prototype */ +#undef HAVE_FOOON /* fooon() needs a prototype */ +#endif' + + EXEC -r -C - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define HAVE_SYS_TYPES_H 1 /* #include ok */ +#define HAVE_STDLIB_H 1 /* #include ok */ +#define HAVE_UNISTD_H 1 /* #include ok */ +#define HAVE_STDIO_H 1 /* #include ok */ +#undef NEED_FOPEN /* fopen() does not need a prototype */ +#define HAVE_FOPEN 1 /* fopen() does not need a prototype */ +#define NEED_FOOON 1 /* fooon() needs a prototype */ +#undef HAVE_FOOON /* fooon() needs a prototype */ +#endif' + +TEST 09 'exp vs. if' + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_false { + ONE +} +exp _tst_hit !_tst_hit&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_false is true */ +/* !_tst_false */ +ONE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&_tst_true is true */ +TWO 0 1 +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&_tst_true is true */ +/* !_tst_hit&_tst_true */ +THREE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_false { + ONE +} +exp _tst_hit !_tst_hit&&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_false is true */ +/* !_tst_false */ +ONE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&&_tst_true is true */ +TWO 0 1 +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&&_tst_true is true */ +/* !_tst_hit&&_tst_true */ +THREE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_false ) { + ONE +} +elif ( _tst_true ) pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +ONE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + ONE +} +elif ( _tst_true ) pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +TWO +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + ONE +} +elif ( _tst_false ) pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +THREE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) yes{ + typedef struct + { + int dd_fd; /* file descriptor */ + } DIR; +}end +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + typedef struct + { + int dd_fd; /* file descriptor */ + } DIR; +} +else { + OK +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _tst_true 1 /* ( 1 ) is true */ +OK + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + typedef struct + { + int dd_fd; /* file descriptor */ + }; +} +else { + OK +} +endif' + + EXEC -r -s bsh - t.iffe + +TEST 10 'exp details' + + EXEC -r -v - t.iffe + INPUT t.iffe $'_str = "string" +_hdr =
+_aaa = ( 0 ) +_zzz = ( 1 ) +( _str ) +( ! _str ) +( _hdr ) +( ! _hdr ) +( _aaa ) +( ! _aaa ) +( _zzz ) +( ! _zzz )' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _str "string" +#define _hdr
+#define _zzz 1 /* ( 1 ) is true */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( 0 ) true ... no +iffe: test: is ( 1 ) true ... yes +iffe: test: is ( _str ) true ... yes +iffe: test: is ( ! _str ) true ... no +iffe: test: is ( _hdr ) true ... yes +iffe: test: is ( ! _hdr ) true ... no +iffe: test: is ( _aaa ) true ... no +iffe: test: is ( ! _aaa ) true ... yes +iffe: test: is ( _zzz ) true ... yes +iffe: test: is ( ! _zzz ) true ... no' + + EXEC -r -v -s bsh - t.iffe + +TEST 11 'set [no]define' + + EXEC -r -v - t.iffe + INPUT t.iffe $'set nodefine +mem stat.st_mtime sys/types.h sys/stat.h +set define +mem stat.st_mode sys/types.h sys/stat.h +if ( _mem_st_mtime_stat ) { + 1 +} +endif +if ( _mem_st_mode_stat ) { + 2 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _mem_st_mode_stat 1 /* st_mode is a member of struct stat */ +1 + +2 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is stat a type or typedef ... no +iffe: test: is st_mtime a member of struct stat ... yes +iffe: test: is st_mode a member of struct stat ... yes +iffe: test: is ( _mem_st_mtime_stat ) true ... yes +iffe: test: is ( _mem_st_mode_stat ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + +TEST 12 'non-opaque mem' + + EXEC -r -v - mem OPAQUE -I. t.h + INPUT t.h $'typedef struct opaque OPAQUE;' + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_t 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is t.h a header ... yes +iffe: test: is OPAQUE a type or typedef ... no +iffe: test: is struct OPAQUE a non-opaque struct ... no' + + EXEC -r -v - mem NONOPAQUE -I. t.h + INPUT t.h $'struct nonopaque { int pad; }; +typedef struct nonopaque NONOPAQUE;' + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_t 1 /* #include ok */ +#define _mem_NONOPAQUE 1 /* NONOPAQUE is a non-opaque struct */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is t.h a header ... yes +iffe: test: is NONOPAQUE a type or typedef ... yes +iffe: test: is NONOPAQUE a non-opaque struct ... yes' + +TEST 13 'key states' + + EXEC -r -v - t.iffe + INPUT t.iffe $'key int +key const = +key foo +key bar = +key aha = huh = int +key chr = char = int' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _key_int 1 /* int is a reserved keyword */ +#define _key_const 1 /* const is a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#define aha int /* default for reserved keyword aha */ +#define _key_char 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is int a reserved keyword ... yes +iffe: test: is const a reserved keyword ... yes +iffe: test: is foo a reserved keyword ... no +iffe: test: is bar a reserved keyword ... no +iffe: test: is aha a reserved keyword ... no +iffe: test: is huh a reserved keyword ... no +iffe: test: is chr a reserved keyword ... no +iffe: test: is char a reserved keyword ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -u -r -v - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _key_int 1 /* int is a reserved keyword */ +#define _key_const 1 /* const is a reserved keyword */ +#undef _key_foo /* foo is not a reserved keyword */ +#undef _key_bar /* bar is not a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#undef _key_huh /* huh is not a reserved keyword */ +#define aha int /* default for reserved keyword aha */ +#define _key_char 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + + EXEC -u -r -v -s bsh - t.iffe + + EXEC -a -r -v - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _key_int 1 /* int is a reserved keyword */ +#define _key_const 1 /* const is a reserved keyword */ +#define _key_foo 0 /* foo is not a reserved keyword */ +#define _key_bar 0 /* bar is not a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#define _key_huh 0 /* huh is not a reserved keyword */ +#define aha int /* default for reserved keyword aha */ +#define _key_char 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + + EXEC -a -r -v -s bsh - t.iffe + + EXEC -C -r -v - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define HAVE_SYS_TYPES_H 1 /* #include ok */ +#define HAVE_INT_RESERVED 1 /* int is a reserved keyword */ +#define HAVE_CONST_RESERVED 1 /* const is a reserved keyword */ +#undef HAVE_FOO_RESERVED /* foo is not a reserved keyword */ +#undef HAVE_BAR_RESERVED /* bar is not a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#undef HAVE_HUH_RESERVED /* huh is not a reserved keyword */ +#define aha int /* default for reserved keyword aha */ +#define HAVE_CHAR_RESERVED 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + + EXEC -C -r -v -s bsh - t.iffe + +TEST 14 'inc file' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc t_lib.h +if ( bar_foo ) { + #define all 1 +} +elif ( _foo_bar ) { + #define some 1 +} +endif' + INPUT t_lib.h '#define bar_foo ALL +#define _foo_bar SOME' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define some 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( bar_foo ) true ... no +iffe: test: is ( _foo_bar ) true ... yes' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc t_lib.h . +if ( bar_foo ) { + #define all 1 +} +elif ( _foo_bar ) { + #define ok 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define all 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( bar_foo ) true ... yes' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc t_lib.h . ? +if ( bar_foo ) { + #define all 1 +} +elif ( _foo_bar ) { + #define ok 1 +} +endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: t.iffe:1: warning: ?: operands ignored +iffe: test: is ( bar_foo ) true ... yes' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc foo_lib.h' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: t.iffe:1: foo_lib.h: file not found' + EXIT 1 + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: t.iffe:1: path expected' + +TEST 15 'KnR compatibility' + + EXEC -r -v - t.iffe + INPUT t.iffe $' +if ( 1 ) { + #define all 1 +} +endif +if ( 2 ) { + #define some 1 +} +endif +cat{ +#define a 1 + #define b 2 + #define c 3 + #define d 4 +}end' +#define _foo_bar SOME' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define some 1 + +#endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define all 1 + +#define some 1 + +#define a 1 +#define b 2 +#define c 3 +#define d 4 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( 1 ) true ... yes +iffe: test: is ( 2 ) true ... yes +iffe: test: cat{ ... }end ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v -s osh - t.iffe + +TEST 16 '{ define extern include print }' + + EXEC -r -v - t.iffe + INPUT t.iffe $' +print /* test header */ +header stdio.h +define EOF -1 +define FoobaR (a,b) ((a)+(b)) +define FoomaC -1 +extern fopen FILE* (char*, char*) +extern BarfoO struct barfoo* (int) +extern Tab_lE struct barfoo* [10]' + OUTPUT - $'/* test header */ +/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#include +#define FoobaR(a,b) ((a)+(b)) +#define FoomaC -1 +extern struct barfoo* BarfoO(int); +extern struct barfoo* Tab_lE[10]; +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is EOF a macro ... yes +iffe: test: is FoobaR a macro ... no +iffe: test: is FoomaC a macro ... no +iffe: test: is fopen a symbol that needs a prototype ... no +iffe: test: is BarfoO a symbol that needs a prototype ... yes +iffe: test: is Tab_lE a symbol that needs a prototype ... yes' + +TEST 17 'features/* => FEATURE/*' + + EXEC -r -v run features/stdio + INPUT features/stdio $'set prototyped +header stdio.h' + OUTPUT FEATURE/stdio $' +/* : : generated by proto : : */ +/* : : generated from features/stdio by iffe version 1995-03-19 : : */ + +#ifndef _REGRESS +#if !defined(__PROTO__) +# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) +# if defined(__cplusplus) +# define __LINKAGE__ "C" +# else +# define __LINKAGE__ +# endif +# define __STDARG__ +# define __PROTO__(x) x +# define __OTORP__(x) +# define __PARAM__(n,o) n +# if !defined(__STDC__) && !defined(__cplusplus) +# if !defined(c_plusplus) +# define const +# endif +# define signed +# define void int +# define volatile +# define __V_ char +# else +# define __V_ void +# endif +# else +# define __PROTO__(x) () +# define __OTORP__(x) x +# define __PARAM__(n,o) o +# define __LINKAGE__ +# define __V_ char +# define const +# define signed +# define void int +# define volatile +# endif +# define __MANGLE__ __LINKAGE__ +# if defined(__cplusplus) || defined(c_plusplus) +# define __VARARG__ ... +# else +# define __VARARG__ +# endif +# if defined(__STDARG__) +# define __VA_START__(p,a) va_start(p,a) +# else +# define __VA_START__(p,a) va_start(p) +# endif +# if !defined(__INLINE__) +# if defined(__cplusplus) +# define __INLINE__ extern __MANGLE__ inline +# else +# if defined(_WIN32) && !defined(__GNUC__) +# define __INLINE__ __inline +# endif +# endif +# endif +#endif +#if !defined(__LINKAGE__) +#define __LINKAGE__ /* 2004-08-11 transition */ +#endif + +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#include +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + +TEST 18 'api + ver' + EXEC -r -v - t.iffe + INPUT t.iffe $'iff api +ver foo 20100606 +ver bar 19840919 + +api foo 19991231 dis dat tother +api foo 20100601 dat +api foo 20100606 dis +api bar 19991231 moe larry shemp +api bar 20020202 curly +api bar 20030303 shemp +api bar 20040404 joe_b +api bar 20050505 joe_d +' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _api_H +#define _api_H 1 +#define _sys_types 1 /* #include ok */ + +#define FOO_VERSION 20100606 +#define BAR_VERSION 19840919 +#define FOOAPI(rel) ( _BLD_foo || !_API_foo || _API_foo >= rel ) + +#if !defined(_API_foo) && defined(_API_DEFAULT) +#define _API_foo _API_DEFAULT +#endif + +#if FOOAPI(20100601) +#undef dat +#define dat dat_20100601 +#elif _API_foo >= 19991231 +#undef dat +#define dat dat_19991231 +#endif + +#if FOOAPI(20100606) +#undef dis +#define dis dis_20100606 +#elif _API_foo >= 19991231 +#undef dis +#define dis dis_19991231 +#endif + +#if FOOAPI(19991231) +#undef tother +#define tother tother_19991231 +#endif + +#define _API_foo_MAP "dat_20100601 dat_19991231 dis_20100606 dis_19991231 tother_19991231" +#define BARAPI(rel) ( _BLD_bar || !_API_bar || _API_bar >= rel ) + +#if !defined(_API_bar) && defined(_API_DEFAULT) +#define _API_bar _API_DEFAULT +#endif + +#if BARAPI(20020202) +#undef curly +#define curly curly_20020202 +#endif + +#if BARAPI(20040404) +#undef joe_b +#define joe_b joe_b_20040404 +#endif + +#if BARAPI(20050505) +#undef joe_d +#define joe_d joe_d_20050505 +#endif + +#if BARAPI(19991231) +#undef larry +#define larry larry_19991231 +#endif + +#if BARAPI(19991231) +#undef moe +#define moe moe_19991231 +#endif + +#if BARAPI(20030303) +#undef shemp +#define shemp shemp_20030303 +#elif _API_bar >= 19991231 +#undef shemp +#define shemp shemp_19991231 +#endif + +#define _API_bar_MAP "curly_20020202 joe_b_20040404 joe_d_20050505 larry_19991231 moe_19991231 shemp_20030303 shemp_19991231" + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes' diff --git a/src/cmd/INIT/ignore.sh b/src/cmd/INIT/ignore.sh new file mode 100644 index 000000000..09611b70b --- /dev/null +++ b/src/cmd/INIT/ignore.sh @@ -0,0 +1,42 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# non-ksh script for the nmake ignore prefix +# @(#)ignore (AT&T Research) 1992-08-11 + +(command set -o posix) 2>/dev/null && set -o posix +modern_export=`v=; export v=ok 2>/dev/null; echo "$v"` + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $modern_export in + ok) export "$1" ;; + *) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" +exit 0 diff --git a/src/cmd/INIT/intl.c b/src/cmd/INIT/intl.c new file mode 100644 index 000000000..1623dd651 --- /dev/null +++ b/src/cmd/INIT/intl.c @@ -0,0 +1,29 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef gettext +#include +#endif + +int +main() +{ + gettext(0); + return 0; +} diff --git a/src/cmd/INIT/ld.hp.pa b/src/cmd/INIT/ld.hp.pa new file mode 100755 index 000000000..99d39f0dc --- /dev/null +++ b/src/cmd/INIT/ld.hp.pa @@ -0,0 +1,5 @@ +: hp.pa ld wrapper for reasonable warning defaults + +# @(#)ld.hp.pa (AT&T Labs Research) 1998-01-23 + +/bin/ld +s +vnocompatwarnings "$@" diff --git a/src/cmd/INIT/ldd.cygwin.i386 b/src/cmd/INIT/ldd.cygwin.i386 new file mode 100755 index 000000000..5976b1fe8 --- /dev/null +++ b/src/cmd/INIT/ldd.cygwin.i386 @@ -0,0 +1,22 @@ +#!/bin/env sh +: cygwin.i386 ldd -- how many ways does this confirm the windows bias? +for f +do case $f in + *.exe) ;; + *) f=$f.exe ;; + esac + p=$(type $f) + case $p in + *" not found"*) + ;; + *) p=${p##* } + case $p in + ?*) f=$p ;; + esac + ;; + esac + cygcheck $(cygpath -aw $f) | + for w in $(sed -e 's/^[[:space:]]*//' -e '/^$/d' -e '/^Use /d') + do cygpath -u "$w" + done +done diff --git a/src/cmd/INIT/ldd.darwin b/src/cmd/INIT/ldd.darwin new file mode 100755 index 000000000..ec75f7b27 --- /dev/null +++ b/src/cmd/INIT/ldd.darwin @@ -0,0 +1,2 @@ +: mac os10 ldd +otool -L "$@" diff --git a/src/cmd/INIT/ldd.hp.pa b/src/cmd/INIT/ldd.hp.pa new file mode 100755 index 000000000..34874b413 --- /dev/null +++ b/src/cmd/INIT/ldd.hp.pa @@ -0,0 +1,21 @@ +: hp.pa ldd +while : +do case $# in + 0) break ;; + esac + case $1 in + -*|+*) ;; + *) break ;; + esac + shift +done +trap ':' 15 +for cmd +do case $# in + 1) ;; + *) echo $cmd: ;; + esac + _HP_DLDOPTS=-ldd "$cmd" < /dev/null 2> /dev/null | sort -u + # chatr "$cmd" | + # sed -e '/^[ ]*dynamic[ ][ ]*/!d' -e 's// /' +done diff --git a/src/cmd/INIT/ldd.ibm.risc b/src/cmd/INIT/ldd.ibm.risc new file mode 100755 index 000000000..984ef6da7 --- /dev/null +++ b/src/cmd/INIT/ldd.ibm.risc @@ -0,0 +1,16 @@ +: ibm.risc ldd +case $# in +1) header=0 ;; +*) header=1 ;; +esac +for file +do case $header in + 1) echo "$file:" + header=2 + ;; + 2) echo + echo "$file:" + ;; + esac + dump -H "$file" | sed '1,/\*\*\*Import/d' +done diff --git a/src/cmd/INIT/ldd.lynxos b/src/cmd/INIT/ldd.lynxos new file mode 100755 index 000000000..43904a831 --- /dev/null +++ b/src/cmd/INIT/ldd.lynxos @@ -0,0 +1 @@ +elflook -L "$@" | sed -e '/^NEEDED:/!d' -e 's/.*: *//' diff --git a/src/cmd/INIT/ldd.mvs.390 b/src/cmd/INIT/ldd.mvs.390 new file mode 100755 index 000000000..341c4cc65 --- /dev/null +++ b/src/cmd/INIT/ldd.mvs.390 @@ -0,0 +1,18 @@ +: mvs.390 ldd +case $# in +1) header=0 ;; +*) header=1 ;; +esac +for file +do case $header in + 1) echo "$file:" + header=2 + ;; + 2) echo + echo "$file:" + ;; + esac + strings $file | + sed -e '/\<[[:lower:]][[:alnum:]]*\.dll\>/!d' -e 's/^/ /' | + sort -u +done diff --git a/src/cmd/INIT/ldd.sgi b/src/cmd/INIT/ldd.sgi new file mode 100755 index 000000000..d3c534734 --- /dev/null +++ b/src/cmd/INIT/ldd.sgi @@ -0,0 +1,2 @@ +: sgi.mips ldd +odump -Dl "$@" diff --git a/src/cmd/INIT/m.c b/src/cmd/INIT/m.c new file mode 100644 index 000000000..b56b99b7c --- /dev/null +++ b/src/cmd/INIT/m.c @@ -0,0 +1,34 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #1 + */ + +#ifndef sin +#include +#endif + +int +main() +{ + sin(0.0); + fmod(100.234, 11.0); + return 0; +} diff --git a/src/cmd/INIT/m2.c b/src/cmd/INIT/m2.c new file mode 100644 index 000000000..cad12b11f --- /dev/null +++ b/src/cmd/INIT/m2.c @@ -0,0 +1,36 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #2 + */ + +#include + +int +main() +{ + double value = 0; + int exp = 0; + int r = 0; + + r |= ldexp(value, exp) != 0; + r |= frexp(value, &exp) != 0; + return r; +} diff --git a/src/cmd/INIT/m3.c b/src/cmd/INIT/m3.c new file mode 100644 index 000000000..5d8999102 --- /dev/null +++ b/src/cmd/INIT/m3.c @@ -0,0 +1,36 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #3 + */ + +#include + +int +main() +{ + long double value = 0; + int exp = 0; + int r = 0; + + r |= ldexpl(value, exp) != 0; + r |= frexpl(value, &exp) != 0; + return r; +} diff --git a/src/cmd/INIT/m4.c b/src/cmd/INIT/m4.c new file mode 100644 index 000000000..79b87f040 --- /dev/null +++ b/src/cmd/INIT/m4.c @@ -0,0 +1,32 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #4 + */ + +#include + +int +main() +{ + double value = 0; + + return isnan(value); +} diff --git a/src/cmd/INIT/m5.c b/src/cmd/INIT/m5.c new file mode 100644 index 000000000..f85392169 --- /dev/null +++ b/src/cmd/INIT/m5.c @@ -0,0 +1,32 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #5 + */ + +#include + +int +main() +{ + long double value = 0; + + return isnanl(value); +} diff --git a/src/cmd/INIT/m6.c b/src/cmd/INIT/m6.c new file mode 100644 index 000000000..4387ea044 --- /dev/null +++ b/src/cmd/INIT/m6.c @@ -0,0 +1,34 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #6 + */ + +#define _ISOC99_SOURCE 1 + +#include + +int +main() +{ + double value = -0.0; + + return !signbit(value); +} diff --git a/src/cmd/INIT/make.probe b/src/cmd/INIT/make.probe new file mode 100644 index 000000000..c1b931748 --- /dev/null +++ b/src/cmd/INIT/make.probe @@ -0,0 +1,2241 @@ +: +### this script contains archaic constructs that work with all sh variants ### +# Glenn Fowler +# AT&T Research +# +# @(#)make.probe (AT&T Research) 2011-06-01 +# +# C probe for make +# +# NOTE: C.probe must be included or .'d here +# + +cc_dll_def=-D_BLD_DLL + +probe_ar_arflags="-Xany" +probe_arflags="-xar" +probe_ccs="strip size nm ld ar" # longest to shortest +probe_debug="-g" +probe_dll="'-G 0' -Wc,dll,exportall,longname,rent -Wc,exportall -dynamic $cc_dll_def" +probe_export_dynamic="-rdynamic -export-dynamic -Wl,-export-dynamic -Wl,-E -bexpall -force_flat_namespace" +probe_gcc_optimize="-Os" +probe_gcc_version="*[Gg][Cc][Cc]*" +probe_include_local="'-ignore-source-dir -iquote' -iquote -I-" +probe_ldlazy='-zlazyload -znolazyload -Wl,-zlazyload -Wl,-znolazyload' +probe_ldlib="LD_LIBRARY_PATH LIBPATH LPATH" +probe_ldmap="'-Wl,-M' '-Qoption ld -M' '-Wl,-m' '-m'" +probe_ldorigin="-Wl,-z,origin" +probe_ldrecord='-zrecord -zignore -Wl,-zrecord -Wl,-zignore' +probe_ldrunpath="-Wl,-R, -R -Wl,-rpath, -L" +probe_ldstrip="'-s -mr' -Wl,-s" +probe_lib="a lib" +probe_lib_append="/usr/lib/pa1.1" +probe_lib_all_undef="-all -notall -all -none -Bwhole-archive -Bno-whole-archive -whole-archive -no-whole-archive -Wl,-whole-archive -Wl,-no-whole-archive -all_load '' -Wl,-zallextract -Wl,-zdefaultextract +forceload +noforceload" +probe_lib_multiple="-Wl,-zmuldefs" +probe_libdir="shlib lib" +probe_nmflags="'' -p -B" +probe_optimize="-Os -O" +probe_pic="-Kpic -KPIC -fpic -fPIC -pic -PIC +z +Z" +probe_no_protect="'-fno-stack-protector -fno-stack-protector-all' -GS-" +probe_readonly="-R -Krodata -xMerge -Wa,-r" +probe_shared="'' -G -b -c -shared -Wl,dll" +probe_shared_name="-Wl,-soname= -h" +probe_shared_nostart="-nostartfiles" +case `gcc -v 2>&1 | egrep gcc.version` in +*version' '[0123456].*) ;; +*) probe_shared_nostart= ;; # gcc 7+ +esac +probe_shared_registry='"-update_registry $probe_shared_registry_file"' +probe_shared_registry_file='registry.ld' +probe_shared_registry_path="\$(LIBDIR)/$probe_shared_registry_file" +probe_strict="'-ansi -pedantic' '-ansi -strict' -strict -ansi" +probe_stripflags="'-f -s' -f -s" +probe_unresolved="'-expect_unresolved \"*\"'" +probe_warn="-Wall -fullwarn -w3 '-A -A' +w1" + +echo '#pragma pp:version' > libpp.$src +echo '#define dDflag on' > dDflag.$src +echo 'int main(){return 0;}' > doti.$src +echo 'int code(){return 0;} int main(){return code();}' > export.$src +echo '#include ' > imstd.$src +echo '#include "_i_.h"' > imusr.$src +echo 'int x;' > _i_.h +mkdir im +echo '(' > im/stdio.h +echo '#include "implc_x.h" +int main(){f(1);return 0;}' > implc.$src +echo 'template void f(T){}' > implc_x.$src +echo 'template void f(T);' > implc_x.h +echo 'extern int NotalL(){return(0);}' > notall.$src +echo '#include +extern int i; +int i = 1; +extern int f(){return(!i);} +int main(){FILE* fp=stdin;return(f());}' > pic.$src +echo 'class x {int n;} m;' > plusplus.$src +echo 'int prefix(){return 0;}' > prefix.$src +echo 'template int gt(T a, T b); +template int gt(T a, T b) { return a > b; } +int main () { return gt(2,1); }' > ptr.$src +echo 'int main(){return 0;}' > require.$src +echo '#if mips && !sgi || __CYGWIN__ +( /* some systems choke on this probe */ +#else +#if test_const +#define CONST const +#else +#define CONST +#endif +CONST char x[]={1,2,3,4,5,6,7,8,9,0}; +int main(){*(char*)x=0; return x[0];} +#endif' > readonly.$src +# NOTE: sfclose() defined on uwin, not defined on all other systems +echo 'extern int sfclose(); extern int ShareD(){return(sfclose());}' > shared.$src +echo '#define g(a,b) a ## b +volatile int a; +const int g(x,y)=1; +extern int c(int);' > stdc.$src +echo 'extern int f(); int main() { return f(); }' > sovmain.$src +echo 'int f() { return 0; }' > sovlib.$src +echo '#include +int i; +int main(){int j;j = i * 10;return j;}' > strip.$src +echo 'template void f(T){} +int main(){f(1);return 0;}' > toucho.$src +echo '#if defined(__STDC__) || defined(__cplusplus) +extern type call(int); +#endif +int main() {call(0);return(0);}' > tstlib.$src +echo 'int main(){return 0;}' > warn.$src +echo 'int f(){return 0;}' > warn1.$src +echo 'int f(){}' > warn2.$src +echo 'int f(){int i; return 0;}' > warn3.$src +echo 'int f(){int i; return i;}' > warn4.$src +echo 'int f(){return g();}' > warn5.$src +warn_enum="1 2 3 4 5" + +chmod -w *.$src + +ar_arflags= +arflags= +cc_dll= +cc_pic= +cc_PIC= +dDflag= +debug= +dialect= +dll_dir='$(LIBDIR)' +dll_libraries= +dll_variants= +doti= +exectype= +export_dynamic= +gnu= +implicitc= +include_local= +lddynamic= +ldlazy= +ldnolazy= +ldnorecord= +ldorigin= +ldrecord= +ldrunpath= +ldscript= +ldstatic= +ldstrip= +Lflag= +lib_dll= +lib_all= +lib_undef= +libpath= +libpp= +makeoptions= +nmedit= +nmflags= +no_protect= +optimize= +plusplus= +prefix_archive=lib +prefix_dynamic= +prefix_shared=lib +ptrcopy= +ptrimplicit= +ptrmkdir= +readonly= +repository= +require= +runpath= +shared= +shared_name= +shared_registry= +shellmagic= +soversion= +stdc= +strict= +stripflags= +symprefix= +toucho= +warn= + +set $probe_lib +lib=$1 + +d= +for f in $stdinclude $usrinclude +do case $f in + -I*) ;; + *) d="$d $f" ;; + esac +done +stdinclude=$d + +set x $cc +cc_dir=`echo $2 | sed -e 's,/*[^/]*$,,'` +for c in $probe_ccs +do if $executable $cc_dir/$c + then x=$cc_dir/$c + else x=$c + fi + eval $c='$x' +done +ld_dir= +rm -f doti.$obj +if $cc -c doti.$src +then eval set x $probe_verbose + shift + for o + do $cc $o doti.$obj + $cc $o doti.$obj -lF0oB@r + done 2>&1 | sed -e 's/^[+ ]*//' -e 's/[ ].*//' -e '/^\//!d' -e 's/:$//' -e '/ld[a-zA-Z0-9.]*$/!d' -e 's,///*,/,g' > t + for i in `cat t` + do rm -f t.$obj + if test -x $i && $i -r -o t.$obj doti.$obj && test -f t.$obj + then case $ld in + ld) ld=$i ;; + esac + ld_dir=`echo $i | sed 's,/[^/]*$,,'` + break + fi + done +fi +IFS=: +set x $PATH +IFS=$ifs +path=$* +m= +for c in $probe_ccs +do eval o='$'$c + case $o in + $c) ;; + *) continue ;; + esac + C='${c}' + for x in $cc_dir $ld_dir + do cd $x + for p in "${C}" "${C}[!a-zA-Z]*" "*[!a-zA-Z]${C}" "*[!a-zA-Z]${C}[!a-zA-Z]*" + do eval set x $p + case $# in + 2) if $executable $2 + then case $2 in + *$c*$c*);; + *) m=$p + break 3 + ;; + esac + fi + ;; + esac + done + done +done +cd $tmpdir +for c in $probe_ccs +do eval o='$'$c + case $o in + $c) ;; + *) continue ;; + esac + for x in $cc_dir $ld_dir + do if $executable $x/$c + then eval $c='$x/$c' + continue 2 + fi + case $m in + ?*) eval set x $x/$m + case $# in + 2) if $executable $2 + then eval $c='$2' + continue 2 + fi + ;; + esac + ;; + esac + done + for x in $path + do if $executable $x/$c + then eval $c='$x/$c' + break + fi + done +done +dld=$cc + +rm -f dynamic.$exe +if $cc -o dynamic.$exe dynamic.$obj && $executable dynamic.$exe +then mkdir mylib + echo > mylib/libc.$lib + eval set x $probe_ldlib + while : + do shift + case $# in + 0) break ;; + esac + rm -f dynamic.$exe + if eval $1=./mylib '$'cc -o dynamic.$exe dynamic.$obj + then : + else libpath=$1 + break + fi + done +fi +test `$cc -E libpp.$src | grep -c '^#pragma pp:version "libpp '` -eq 1 && libpp=1 +$cc -E doti.$src > doti.i && $cc -c doti.i && test -s doti.$obj && doti=1 +if $cc -c imusr.$src +then eval set x $probe_include_local + while : + do shift + case $# in + 0) break ;; + esac + if $cc -c $1 imusr.$src + then : "$1 should skip \"_i_.h\" in ." + elif $cc -c imstd.$src + then if $cc -c -Iim imstd.$src + then : '-Idir should find in dir' + elif $cc -c $1 -Iim imstd.$src + then : "$1 -Idir should find in dir" + elif $cc -c -Iim $1 imstd.$src + then include_local=$1 + break + else : "-Idir $1 should skip in dir" + fi + else : should find stdio.h + fi + done +else : 'should find "_i_.h" in .' +fi + +if $cc -c pic.$src 2>e +then e=`wc -l e` + s=`$size pic.$obj; wc pic.$obj` + eval set x $probe_pic + shift + while : + do case $# in + 0|1) break ;; + esac + pic=$1 + shift + PIC=$1 + shift + rm -f pic.$obj + $cc $pic -c pic.$src 2>e && test -f pic.$obj || continue + $cc $pic -o pic.$exe pic.$obj && test -f pic.$exe || { + rm -f pic.$exe + $cc -o pic.$exe pic.$obj && test -f pic.$exe && continue + } + case `wc -l e` in + $e) ;; + *) continue ;; + esac + case $pic in + ???*) m=`echo " $pic" | sed -e 's/^ [-+]//g' -e 's/./-& /g' -e 's/[-+] //g'` + rm -f pic.$obj pic1.$exe + if $cc $m -c pic.$src 2>e && test -f pic.$obj && + $cc -o pic1.$exe pic.$obj && test -f pic1.$exe + then case `wc -l e` in + $e) cc_pic=$m + break + ;; + esac + fi + cc_pic=$pic + break + ;; + *) case `$size pic.$obj; wc pic.$obj` in + $s) ;; + *) cc_pic=$pic + break + ;; + esac + ;; + esac + done + # this works around gcc 2.95 sun4 -fpic a.out core dump after exit + case $hosted:$cc_pic in + 1:?*) if ./pic.$exe + then # this catches lynxos.ppc gcc that dumps -fpic and not -mshared + echo 'static int* f() { static int v; return &v; } +int main() { f(); return 0; }' > picok.$src + $cc $cc_pic -o picok.$exe picok.$src && ./picok.$exe || cc_pic= + else cc_pic= + fi + ;; + esac + case $cc_pic in + ?*) rm -f pic.$obj + if $cc $PIC -c pic.$src 2>e && test -f pic.$obj + then cc_PIC=$PIC + else cc_PIC=$cc_pic + fi + ;; + *) eval set x $probe_dll + while : + do shift + case $# in + 0) break ;; + esac + rm -f pic.$obj pic.$exe + $cc $1 -c pic.$src 2>e && test -f pic.$obj || continue + $cc $1 -o pic.$exe pic.$obj && test -f pic.$exe || { + rm -f pic.$exe + $cc -o pic.$exe pic.$obj && test -f pic.$exe && continue + } + case $1 in + -Wc,*exportall*) + # get specific since sgi gets this far too + rm -f pic.$exe pic.x + $cc -Wl,dll -o pic.$exe pic.$obj || continue + test -f pic.$exe || continue + test -f pic.x || continue + cc_dll="-D_SHARE_EXT_VARS $1" + so=.x + sd=.dll + dld=$cc + shared=-Wl,dll + prefix_shared= + probe_sd= + probe_shared= + #unused# lddynamic=-Bdynamic + #unused# ldstatic=-Bstatic + lib_dll=SYMBOL + break + ;; + esac + case `wc -l e` in + $e) cc_dll=$1 + break + ;; + esac + done + ;; + esac +fi + +$cc -c plusplus.$src && plusplus=1 +$cc -E -dD dDflag.$src > t +case `grep '#define[ ][ ]*dDflag[ ][ ]*on' t` in +?*) dDflag=1 ;; +esac +case `grep '#define.*_GNUC_' t` in +?*) gnu=1 ;; +esac +case $plusplus in +"") $cc -c stdc.$src && stdc=1 ;; +*) mkdir ptr + cd ptr + $cc -c ../ptr.$src & + NFS_locks_are_botched=$! + cd .. + if $cc -c require.$src && $cc require.$obj + then set x `$cc require.$obj 2>&1` + d= + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + -l*) d="$d $1" ;; + esac + done + for f in ++ + do if $cc require.$obj -l$f + then set x `$cc require.$obj -l$f 2>&1` + r= + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + -l*) case " $d $r " in + *" "$1" "*) ;; + *) r="$r $1" ;; + esac + esac + done + case $r in + ?*) require="$require $f" + echo '' $r > req.$f + ;; + esac + fi + done + fi + cd ptr + for i in * + do if test -d $i + then repository=$i + break + fi + done + cd .. + kill -9 $NFS_locks_are_botched + rm -rf ptr + case $repository in + *?) mkdir ptr + cd ptr + i=PTR + case $repository in + $i) i=$i$i ;; + esac + $cc -ptr$i -c ../ptr.$src & + NFS_locks_are_botched=$! + cd .. + sleep 5 + if test -d ptr/$i/$repository + then ptrimplicit=1 + fi + kill -9 $NFS_locks_are_botched + rm -rf ptr + ;; + esac + $cc -o implc implc.$src && $executable implc && implicitc=1 + if $cc -c toucho.$src && test -f toucho.$obj + then o=`ls -l toucho.$obj` + if $cc -o toucho toucho.$obj && $executable toucho + then n=`ls -l touch.$obj` + case $n in + "$o") ;; + *) toucho=1 ;; + esac + fi + fi + ;; +esac + +if $cc -c pic.$src +then eval set x $probe_nmflags + while : + do shift + case $# in + 0) break ;; + esac + case `$nm $1 pic.$obj | grep -c '[0123456789][ ][ ]*T[ ][ ]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]'` in + 0) ;; + *) nmflags=$1 + break + ;; + esac + done + case $# in + 0) case `$nm -gh pic.$obj | grep -c '|\.*[TtDdBbC][EeAaSsOo][XxTtSsMm]'` in + 0) ;; + *) nmflags=-gh + nmedit="-e '/\.*[TtDdBbC][EeAaSsOo][XxTtSsMm]/!d' -e 's/[| ].*//'" + ;; + esac + ;; + *) nmedit="-e '/[ ]T[ ][ ]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]/!d' -e 's/.*[ ]T[ ][ ]*//'" + ;; + esac +fi + +if $cc -c doti.$src +then eval set x $probe_stripflags + while : + do shift + case $# in + 0) break ;; + esac + if $strip $1 doti.$obj + then stripflags=$1 + break + fi + done +fi + +rm -f export.$obj export.exe +if $cc -c export.$src +then lm= + if $cc -o export.exe export.$obj -lm 2>e && lm=-lm || + $cc -o export.exe export.$obj 2>e + then z=`wc -c < export.exe; $size export.exe 2>/dev/null` + eval set x $probe_export_dynamic + while : + do shift + case $# in + 0) break ;; + esac + rm -f export.exe + if $cc -o export.exe $1 export.$obj $lm 2>f && $executable export.exe + then y=`wc -c < export.exe; $size export.exe 2>/dev/null` + case $y in + $z) ;; + *) if cmp -s e f + then export_dynamic=$1 + break + fi + ;; + esac + fi + done + fi +fi +rm -f export.$obj export.exe + +rm -f strip.exe +if $cc -o strip.exe strip.$src +then z=`wc -c < strip.exe` + eval set x $probe_ldstrip + while : + do shift + case $# in + 0) break ;; + esac + rm -f strip.exe + if $cc -o strip.exe $1 strip.$src + then case `wc -c < strip.exe` in + $z) ;; + *) ldstrip=$1 + break + ;; + esac + fi + done +fi + +rm -f strip.exe strip.$obj +if $cc -c strip.$src && $cc -o strip.exe strip.$obj 2>e +then eval set x x $probe_ldlazy + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f strip.$exe + $cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue + cmp -s e f || continue + ldlazy=$1 + ldnolazy=$2 + break + done + eval set x x $probe_ldrecord + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f strip.$exe + $cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue + cmp -s e f || continue + ldrecord=$1 + ldnorecord=$2 + break + done +fi + +case $cc_dll:$cc_pic:$so:$dynamic:$static in +::::|$cc_dll_def::::) + : last chance dynamic checks + while : + do + echo '__declspec(dllexport) int fun() { return 0; }' > exp.$src + if $cc -c $cc_dll_def exp.$src + then rm -f xxx.dll xxx.lib + if $cc -shared -Wl,--enable-auto-image-base -Wl,--out-implib=xxx.lib -o xxx.dll exp.$obj && + test -f xxx.lib -a -f xxx.dll + then + : cygwin + cc_dll=$cc_dll_def + dll_dir='$(BINDIR)' + sd=.dll + so=.dll.a + ldscript=".def .exp .ign .res" + lib_dll=option + lib_all=-Wl,-whole-archive + lib_undef=-Wl,-no-whole-archive + dld=$cc + shared='-shared -Wl,--enable-auto-image-base -Wl,--out-implib=$(<:N=*'$so')' + prefix_dynamic=cyg + prefix_shared=lib + break + fi + fi + break + done + ;; +*) if $cc -c $cc_dll $cc_pic shared.$src && $cc -c $cc_dll $cc_pic notall.$src + then for xx in "$cc" "$ld" + do eval set x $probe_shared + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + # UNDENT ... + + if $xx $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then if test -s e && egrep -i 'unknown|invalid|option' e > /dev/null + then continue + fi + case `PATH=/bin:/usr/bin:$PATH file xxx$dll` in + *lib*|*obj*|*shared*) + ;; + "") $executable xxx$dll || continue + ;; + *ELF*|*elf*) + $executable xxx$dll || continue + case `strings xxx$dll | sed -e 's,.*[ |],,' | sort -u | egrep -i '^([._](dynamic|dynstr|dynsym))$'` in + [012]) continue ;; + esac + ;; + *archive*not*stripped*|*data*dynamic*not*stripped*) + $executable xxx$dll || continue + ;; + *) continue + ;; + esac + dld=$xx + shared=$1 + # does -nostartfiles make sense for C? + case $plusplus in + '') z=`wc -c < xxx$dll` + eval set x $probe_shared_nostart + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then case `wc -c < xxx$dll` in + $z) ;; + *) if test -s e + then case `cat e` in + *[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + continue + ;; + esac + fi + case $shared in + '') shared=$1 ;; + *) shared="$shared $1" ;; + esac + break + ;; + esac + fi + done + ;; + esac + case $cc_dll in + "") cc_dll=$cc_dll_def ;; + esac + eval set x x $probe_sd + while : + do shift + shift + case $# in + [01]) break ;; + esac + rm -f xxx xxx$1 xxx$2 + if $dld $shared -o xxx shared.$obj 2>e + then if test -f xxx$1 -a \( -f xxx$2 -o "$cc_dll" = "$cc_dll_def" \) + then sd=$1 + so=$2 + lddynamic=-Bdynamic + ldstatic=-Bstatic + break 2 + elif test -f xxx -a -f xxx$2 + then sd=$1 + so=$2 + break 2 + else case $so in + '') so=$1 ;; + esac + break + fi + fi + done + rm -f libxxx.$lib + $ar cr libxxx.$lib shared.$obj + ranlib libxxx.$lib + eval set x x $probe_lib_all_undef + rm -f xxx$dll + if $dld $shared -o xxx$dll libxxx.$lib && test -r xxx$dll + then if $nm $nmflags xxx$dll | grep ShareD + then lib_dll=OPTION + set x x + fi + fi + while : + do shift + shift + case $# in + 0|1) break ;; + esac + rm -f xxx$dll + if $dld $shared -o xxx$dll $1 libxxx.$lib $2 && test -r xxx$dll + then if $nm $nmflags xxx$dll | grep ShareD + then lib_dll=option + lib_all=$1 + lib_undef=$2 + break + fi + fi + case $2 in + ?*) if $dld $shared -o xxx$dll $1 libxxx.$lib && test -r xxx$dll + then if $nm $nmflags xxx$dll | grep ShareD + then lib_dll=option + lib_all=$1 + break + fi + fi + ;; + esac + done + case $lib_dll in + OPTION) lib_dll=option + ;; + option) case $lib_undef in + "") rm -f libyyy.$lib + $ar cr libyyy.$lib notall.$obj + ranlib libyyy.$lib + $cc -c prefix.$src + eval set x x $probe_lib_all_undef + while : + do shift + shift + case $# in + 0|1) break ;; + esac + rm -f xxx$dll + if $dld $shared -o xxx$dll prefix.$obj $lib_all libxxx.$lib $2 libyyy.$lib && test -r xxx$dll + then rm -f t + $nm $nmflags xxx$dll > t + case `grep -c ShareD t`:`grep -c NotalL t` in + 0:*) ;; + *:0) lib_undef=$2 + break + ;; + esac + fi + done + ;; + esac + case $lib_undef in + "") eval set x $probe_lib_multiple + rm -f libyyy.$lib + cp libxxx.$lib libyyy.$lib + rm -f xxx$dll + if $dld $shared -o xxx$dll prefix.$obj $lib_all libxxx.$lib libyyy.$lib && test -r xxx$dll + then : + else while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared -o xxx$dll prefix.$obj $lib_all $1 libxxx.$lib libyyy.$lib && test -r xxx$dll + then rm -f t + $nm $nmflags xxx$dll > t + case `grep -c ShareD t` in + 0) ;; + *) lib_all="$lib_all $1" + break + ;; + esac + fi + done + fi + lib_dll=symbol + ;; + esac + ;; + *) lib_dll=symbol + ;; + esac + case `cat e` in + ?*) eval set x $probe_unresolved + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if eval '$dld $shared' $1 '-o xxx$dll shared.$obj 2>e && test -r xxx$dll' + then case `cat e` in + "") shared="$shared $1"; break ;; + esac + fi + done + ;; + esac + r= + eval set x $probe_shared_registry + while : + do shift + r=x$r + case $# in + 0) break ;; + esac + rm -f xxx$dll + if eval \$dld \$shared -o xxx\$dll $1 shared.\$obj && + test -r xxx$dll -a -r $probe_shared_registry_file + then probe_shared_registry_file='$(CC.SHARED.REGISTRY.PATH)' + eval set x $probe_shared_registry + i= + while : + do shift + i=x$i + case $i in + $r) break ;; + esac + done + shared_registry=$1 + fi + done + break 2 + fi + + # ... INDENT + done + done + fi + case $so in + ?*) rm -f xxx* + if $dld $shared -g -o xxx shared.$obj 2>e + then set x $probe_sdb + while : + do shift + case $1 in + 0) break ;; + esac + if test -f xxx$1 + then sdb=$1 + break + fi + done + fi + if $cc -c require.$src + then p=' +/usr/proberun/lib:/local/runprobe/lib +' + eval set x $probe_ldrunpath + while : + do shift + case $# in + 0) break ;; + esac + rm -f require.exe + if $cc -o require.exe $1"$p" require.$obj && + grep -c /proberun/ require.exe >/dev/null && + grep -c /runprobe/ require.exe > /dev/null + then ldrunpath=$1 + eval set x $probe_ldorigin + while : + do shift + case $# in + 0) break ;; + esac + rm -f origin.exe + if $cc -o origin.exe $1 $ldrunpath'$ORIGIN' require.$obj + then if ./origin.exe > /dev/null 2>&1 + then ldorigin="$1 $ldrunpath"'\$ORIGIN/$(BINDIR:P=R=$(DLLDIR))' + fi + break + fi + done + break + fi + done + fi + rm -f libxxx$so + if $cc -c sovmain.$src && + $cc -c $cc_dll $cc_pic sovlib.c && + $dld $shared -o libxxx$so sovlib.$obj && + $cc -o sovmain.$exe -L. sovmain.$obj -lxxx + then rm -f sovmain.$exe + mv libxxx$so libxxx$so.5.6 + if $cc -o sovmain.$exe -L. sovmain.$obj -lxxx + then soversion=1 + fi + fi + rm -f doti.$obj + std64=/lib64 + lcl64=/usr/local/lib64 + if test -d $std64 -a -d $lcl64 && $cc -c doti.$src + then for i in `cd $lcl64; ls *$so 2>/dev/null | sed 's/lib\([^.]*\).*/\1/'` + do if $cc -o runpath.$exe doti.$obj -l$i >/dev/null 2>&1 + then LD_LIBRARY_PATH= ./runpath.$exe >/dev/null 2>&1 && continue + if LD_LIBRARY_PATH=$lcl64 ./runpath.$exe >/dev/null 2>&1 + then runpath=$lcl64 + break + elif LD_LIBRARY_PATH=$std64 ./runpath.$exe >/dev/null 2>&1 + then runpath=$std64 + break + elif LD_LIBRARY_PATH=$lcl64:$std64 ./runpath.$exe >/dev/null 2>&1 + then runpath=$lcl64:$std64 + break + fi + fi + done + fi + ;; + esac + ;; +esac + +rm -f shared.$obj +if $cc -c shared.$src +then eval set x $probe_ar_arflags + while : + do shift + case $# in + 0) break ;; + esac + rm -f libxxx.$lib + if $ar $1 r libxxx.$lib shared.$obj && $ar $1 t libxxx.$lib 2>&1 | grep shared.$obj >/dev/null + then ar_arflags=$1 + break + fi + done + eval set x $probe_arflags + while : + do shift + case $# in + 0) break ;; + esac + rm -f libxxx.$lib + if $cc $1 -o libxxx.$lib shared.$obj && $ar t libxxx.$lib 2>&1 | grep shared.$obj >/dev/null + then arflags=$1 + break + fi + done +fi + +case $shared in +-G) case $cc_dll in + "") cc_dll=$cc_dll_def ;; + esac + ;; +*) case $lib_dll in + symbol) echo 'extern int f(); + int main() { f(); return 0; }' > main.$src + echo '#include + int f() { printf("hello world"); return 0; }' > member.$src + if $cc -c main.$src && $cc -c member.$src + then echo f > lib.exp + rm -f lib.$obj main.exe + if $ld -o lib.$obj -L: -bexport:lib.exp -berok -bmodtype:SRE -T512 -H512 -lm -lc member.$obj && $cc -o main.exe main.$obj lib.$obj + then dld=$ld + shared='-T512 -H512 -L$(LIBDIR): -berok -bmodtype:SRE' + lib_dll=export + dll_libraries='-lm -lc' + ldscript=.exp + case $cc_dll in + "") cc_dll=$cc_dll_def ;; + esac + case $so in + "") so=.$obj ;; + esac + fi + fi + ;; + esac + ;; +esac +case $shared in +?*) if $cc -c $cc_dll $cc_pic shared.$src + then eval set x $probe_shared_name + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared ${1}libfoo.1.2 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then shared_name=$1 + break + fi + done + fi + ;; +esac +case " $cc_dll " in +*" $cc_dll_def "*) + ;; +" ") ;; +*) cc_dll="$cc_dll_def $cc_dll" + ;; +esac + +case $hosttype in +win32.*|cygwin.*|os2.*) + Lflag=1 + ;; +*) if $cc -c doti.$src + then if $cc -L. doti.$obj -lc >/dev/null + then case $cc_dll in + '') ;; + *) Lflag=1 ;; + esac + fi + fi + ;; +esac + +case $lib_dll in +option) case $hosttype in + linux.*) dll_libraries=-lc ;; + esac + ;; +SYMBOL) lib_dll=symbol + ;; +symbol) echo "#include +extern int fun() +{ + puts(\"fun\"); + return 0; +}" > dllib.$src + echo "extern int fun(); +int +main() +{ + return fun(); +}" > dlmain.$src + pwd=`pwd` + while : + do + if $cc -c $cc_dll $cc_pic dlmain.$src && + $cc -c $cc_dll $cc_pic dllib.$src + then rm -f libxxx$so + if $dld $shared -o libxxx$so dllib.$obj && + chmod 555 libxxx$so + then rm -f dlmain.$exe + if $cc -o dlmain.$exe dlmain.$obj $pwd/libxxx$so && + (./dlmain.$exe) >/dev/null 2>&1 + then break + fi + fi + rm -f libxxx$so dlmain.$exe + if $dld $shared -o libxxx$so dllib.$obj -lm -lc && + chmod 555 libxxx$so && + $cc -o dlmain.$exe dlmain.$obj $pwd/libxxx$so && + (./dlmain.$exe) >/dev/null 2>&1 + then dll_libraries='-lm -lc' + fi + fi + break + done + # the dll_libraries probe is still lame + case $dll_libraries in + '') case $hosttype in + sco.*|sol*.*|sun*) ;; + *) dll_libraries='-lm -lc' ;; + esac + ;; + esac + ;; +esac + +stdlib= +a=`$cc -print-multi-directory 2>/dev/null` +case $a in +.) ;; +*) for d in `$cc -print-search-dirs 2>/dev/null | sed -e '/^libraries:/!d' -e 's/.*=//' | tr : '\n' | grep /lib/` + do if [ -d ${d}${a} ] + then stdlib="$stdlib ${d}${a}" + else case $d in + */lib/) d=`echo '' $d | sed -e 's,/$,,'` + if [ -d ${d}${a} ] + then stdlib="$stdlib ${d}${a}" + fi + ;; + esac + fi + done + ;; +esac +case $stdlib in +'') stdlib=`$cc -v doti.$src 2>&1 | + sed 's/ */\n/g' | + sed -e '/^-L/!d' -e 's/^-L//' | + while read dir + do if test -d "$dir" + then (cd "$dir"; pwd) + fi + done` + ;; +*) eval set x $probe_verbose + shift + for o in "$@" + do stdlib="$stdlib "`$cc $o doti.$src 2>&1 | + sed 's/ */\n/g' | + sed -e '/^-L/!d' -e '/\/lib64$/!d' -e 's/^-L//'` + done + ;; +esac +case $stdlib in +?*) keepstdlib=1 + o=$stdlib + stdlib= + for dir in $o + do case " $stdlib " in + *" $o "*) continue ;; + esac + case $dir in + /usr/lib64) + i=/usr/local/lib64 + a=/lib64 + ;; + /lib64) i=/usr/local/lib64 + a=/usr/lib64 + ;; + /usr/lib) + i=/usr/local/lib + a=/lib + ;; + lib) i=/usr/local/lib + a=/usr/lib + ;; + *) i= + a= + ;; + esac + if test "" != "$i" -a -d "$i" + then case " $o " in + *" $i "*) + ;; + *) stdlib="$stdlib $i" + ;; + esac + fi + stdlib="$stdlib $dir" + if test "" != "$a" -a -d "$a" + then case " $o " in + *" $a "*) + ;; + *) stdlib="$stdlib $a" + ;; + esac + fi + done + case $hosted in + 1) case " $stdlib " in + *" /usr/lib "*) + ;; + *) case " $stdlib " in + *" /usr/local/lib "*) + ;; + *) stdlib="$stdlib /usr/local/lib" + ;; + esac + stdlib="$stdlib /usr/lib" + ;; + esac + case " $stdlib " in + *" /lib "*) + ;; + *) stdlib="$stdlib /lib" + ;; + esac + esac + ;; +*) keepstdlib=0 + case $dir in + */arch/$hosttype/lib/*) + notlib=`echo $dir | sed "s,/arch/$hosttype/lib/.*,/arch/$hosttype/lib,"` + ;; + *) notlib=//// + ;; + esac + tstlib= + implib= + if $cc -c hosted.$src + then for f in `( + eval set x $probe_verbose + while : + do shift + case $# in + 0) break ;; + esac + $cc $1 hosted.$obj + done + ) 2>&1 | sed -e 's/[ :]/\\ + /g' -e 's/-L//g' -e 's/^P,//' -e "s/[\"']//g" -e 's,^[\\\\/]*[\\\\/],/,' | sed -e '/^\$/d' -e '/^[-+]/d' -e '/^[^\\\\\\/]/d' -e '/[\\\\\\/]tmp[\\\\\\/]/d' -e 's/:\$//' -e 's,//*$,,'` + do case " $tstlib $implib " in + *" $f "*) continue ;; + esac + case $f in + $notlib) continue ;; + esac + if test -d $f + then tstlib="$tstlib $f" + elif test -f $f + then d=`echo $f | sed -e 's,[\\\\/]*[^\\\\/]*\$,,'` + case " $tstlib $implib " in + *" $d "*) continue ;; + esac + case $d in + *[\\/]usr[\\/]lib) + x=$d + d="`echo $d | sed -e 's,[\\\\/][\\\\/]*usr[\\\\/]lib\$,/lib,'`" + case " $tstlib $implib " in + *" $d "*) ;; + *) implib="$implib $d" ;; + esac + implib="$implib $x" + ;; + *[\\/]lib) + implib="$implib $d" + d="`echo $d | sed -e 's,[\\\\/][\\\\/]*lib\$,/usr/lib,'`" + case " $tstlib $implib " in + *" $d "*) ;; + *) implib="$implib $d" ;; + esac + ;; + *) implib="$implib $d" + ;; + esac + fi + done + fi + tstlib="$tstlib $implib" + if $cc -Dtype=void -Dcall=exit -c tstlib.$src && mv tstlib.$obj tst.$obj + then case $plusplus in + '') probe_lxx= ;; + esac + l= + for sym in $probe_l $probe_lxx + do case $l in + "") l=$sym; continue ;; + esac + rm -f tstlib.$exe + if $cc -o tstlib.$exe tst.$obj -l$l + then eval set x $probe_ldmap + while : + do shift + case $# in + 0) break ;; + esac + d=`$cc -Dtype=int -Dcall=$sym $static $1 tstlib.$src -l$l 2>&1 | sed -e '/[\\\\\\/].*[\\\\\\/]lib[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+]*\.[^\\\\\\/]*\$/!d' -e 's,^[^\\\\\/]*,,' -e 's,[\\\\\\/]lib[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+]*\.[^\\\\\\/]*\$,,' -e '/^[\\\\\\/]/!d' | sort -u` + case $d in + ?*) tstlib="$tstlib $d" ;; + esac + done + fi + l= + done + fi + libstd= + libset= + stdlibroot="/ /usr/" + for d in $tstlib + do case $d in + [\\/]lib|[\\/]usr[\\/]lib) + ;; + *) case " $stdlib " in + *\ $d\ *) + ;; + *) if ls $d ${PREROOT+$PREROOT/../$d} > tmp.tmp && test -s tmp.tmp + then for i in $probe_lib $obj + do if grep -i "\\.$i\$" tmp.tmp >/dev/null + then case " $probe_lib_append " in + *\ $d\ *) + libstd="$libstd $d" + ;; + *) stdlib="$stdlib $d" + case $d in + /usr/lib|/usr/lib/*) + ;; + /usr/lib?*) + e=`echo $d | sed -e 's,/usr,,'` + g=`echo $d/libc.* $e/libc.*` + case "$e $g " in + *".* "*);; + *) stdlib="$stdlib $e" + stdlibroot= + ;; + esac + ;; + esac + ;; + esac + case $libset in + "") case $i in + $obj) ;; + *) libset=1 + lib=$i + ;; + esac + ;; + esac + break + fi + done + fi + ;; + esac + ;; + esac + done + for d in `$ld --verbose 2>&1 | sed -e '/SEARCH_DIR/!d' -e 's/[ ][ ][ ]*/ /g' -e 's/SEARCH_DIR(\([^ ]*\));/\1/g' -e 's, //[^ ]*,,' -e 's,",,g'` + do if test -d $d + then case " $stdlib $libstd " in + *\ ${d}\ *) + ;; + *) libstd="$libstd $d" + ;; + esac + fi + done + case $hosted in + "") tstlib= ;; + *) tstlib="$stdlibroot /usr/ccs/ /usr/local/" ;; + esac + case $stdlibroot in + ?*) d= + for f in $stdinclude + do f=`echo $f | sed -e 's,[^\\\\/]*\$,,'` + d="$d $f" + done + tstlib="$d $tstlib" + ;; + esac + $cc -c doti.$src > all.tmp + for f in $probe_libdir + do for d in $stdlib $libstd $tstlib + do if test -d ${d}${f} + then ls ${d}${f} ${PREROOT:+$PREROOT/../${d}${f}} | + while read i + do for j in ${d}${f}/${i} ${PREROOT:+$PREROOT/../${d}${f}/${i}} + do if test -f $j -a -r $j -a -s $j + then echo $i + break + fi + done + done > tmp.tmp + if test -s tmp.tmp + then if egrep -i "^${prefix_archive}[abcdefghijklmnopqrstuvwxyz0123456789_][abcdefghijklmnopqrstuvwxyz0123456789_]*\\.$lib\$" tmp.tmp >lib.tmp || + egrep -i "\\.$obj\$" tmp.tmp >/dev/null || + egrep -i "^${prefix_shared}[abcdefghijklmnopqrstuvwxyz0123456789_][abcdefghijklmnopqrstuvwxyz0123456789_]*\\$so(.[0-9]+)*\$" tmp.tmp >>lib.tmp + then if test -s lib.tmp + then sed -e "s,.*/,," -e 's,^'${prefix_archive}'\(.*\)\.'$lib'$,\1,g' -e 's,^'${prefix_shared}'\(.*\)\'$so'[.0-9]*,\1,g' lib.tmp | sort -u > tmp.tmp + xs=`sort all.tmp all.tmp tmp.tmp | uniq -u` + case $xs in + '') continue ;; + esac + ok=0 + for x in $xs + do case $x in + *_p) continue ;; # linux gcc known to hang for -lc_p + esac + if $cc -o doti.$exe doti.$obj -l$x 2>e + then ok=1 + else if test -s e && egrep -i ":.*[ ](find|found|locate|search|-l$x)[ ]" e > /dev/null + then if egrep -i ":.*[ ](access|permission)[ ]" e + then : maybe + else ok=0 + break + fi + fi + case $Lflag in + 1) if $cc -L${d}${f} -o doti.$exe doti.$obj -l$x + then ok=0 + break + fi + ;; + esac + fi + done + case $ok in + 0) continue ;; + esac + sort -u all.tmp tmp.tmp > lib.tmp + mv lib.tmp all.tmp + fi + case " $stdlib $libstd " in + *" ${d}${f} "*) + ;; + *) if test -d ${d}${f}/fsoft + then stdlib="$stdlib ${d}${f}/"'$(FLOAT_OPTION)' + fi + stdlib="$stdlib ${d}${f}" + ;; + esac + fi + fi + fi + done + done + stdlib="$stdlib $libstd" + case $stdlib in + */shlib*) + dy= + st= + for i in $stdlib $libstd + do case $i in + */shlib) dy="$dy $i" ;; + *) st="$st $i" ;; + esac + done + for i in /var + do if test -d $i/shlib + then dy="$dy $i/shlib" + fi + done + stdlib="$dy $st" + ;; + esac + ;; +esac + +if $cc -c prefix.$src +then eval set x $probe_symprefix + while : + do shift + case $# in + 0) break ;; + esac + if $nm $nmflags prefix.$obj | grep -c ${1}prefix >/dev/null + then symprefix=$1 + break + fi + done +fi + +if $cc -c warn.$src 2>e && test -f warn.$obj +then e=`wc -c < e` + + eval set x $probe_debug + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + case `wc -c < e` in + $e) debug=$1; break ;; + esac + done + + eval set x $probe_no_protect + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + case `wc -c < e` in + $e) no_protect=$1; break ;; + esac + done + + case $version_string in + $probe_gcc_version) probe_optimize="$probe_gcc_optimize $probe_optimize" ;; + esac + for i in $probe_optimize + do rm -f warn.$obj + $cc $i -c warn.$src 2>e && test -f warn.$obj || continue + case `wc -c < e` in + $e) optimize=$i; break ;; + esac + done + + eval set x $probe_strict + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + n=`wc -c < e` + if test $n -ge $e + then strict=$1 + break + fi + done + + $cc -c warn1.$src 2>e + o=`wc -c < e` + eval set x $probe_warn + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj warn.$exe + $cc -o warn.$exe $1 warn.$src 2>e && test -f warn.$exe || continue + n=`wc -c < e` + for i in $warn_enum + do rm -f warn$i.$obj + $cc -c $1 warn$i.$src 2>e && test -f warn$i.$obj || continue + n=`wc -c < e` + if test $n -gt $o + then warn=$1 + break 2 + fi + done + done + +fi + +while : +do case $hosted in + 1) rm -f readonly.$exe + eval set x '""' $probe_readonly + while : + do shift + case $# in + 0) break ;; + esac + for co in '' -Dtest_const + do rm -f readonly.$exe + if $cc -o readonly.$exe $co $1 readonly.$src && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly=$1 + break 3 + fi + fi + done + done + rm -f readonly.$exe readonly.s + if $cc -S readonly.$src && test -f readonly.s + then if sed -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)data/\1text/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)zero[ ][ ]*/\1set .,.+/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*1/\1byte 0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*2/\1byte 0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*3/\1byte 0,0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*4/\1byte 0,0,0,0/' \ + readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly='-S.data' + break + fi + fi + rm -f readonly.$exe + if sed -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)idat/\1code/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)zero[ ][ ]*/\1set .,.+/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*1/\1byte 0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*2/\1byte 0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*3/\1byte 0,0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*4/\1byte 0,0,0,0/' \ + readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly='-S.idat' + break + fi + fi + if sed -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)data/\1rdata/' \ + readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly='-S.rdata' + break + fi + fi + fi + ;; + esac + break +done + +case $stdc in +?*) dialect="$dialect ANSI" ;; +esac +case $plusplus in +?*) dialect="$dialect C++" ;; +esac +case $hosted in +"") dialect="$dialect CROSS" ;; +esac +case $doti in +?*) dialect="$dialect DOTI" ;; +esac +case $gnu in +?*) dialect="$dialect GNU" ;; +esac +case $so:$dynamic:$static in +::) ;; +*) dialect="$dialect DYNAMIC" + case $soversion in + ?*) dialect="$dialect VERSION" ;; + esac + ;; +esac +case $implicitc in +?*) dialect="$dialect IMPLICITC" ;; +esac +case $ptrcopy in +?*) dialect="$dialect PTRCOPY" ;; +esac +case $ptrimplicit in +?*) dialect="$dialect PTRIMPLICIT" ;; +esac +case $ptrmkdir in +?*) dialect="$dialect PTRMKDIR" ;; +esac +case $libpp in +?*) dialect="$dialect LIBPP" ;; +esac +case $toucho in +?*) dialect="$dialect TOUCHO" ;; +esac +case $dDflag in +?*) dialect="$dialect -dD" ;; +esac +# 2005-05-25 use $(CC.INCLUDE.LOCAL) instead +case $include_local in +?*) dialect="$dialect -I-" ;; +esac +case $Lflag in +?*) dialect="$dialect -L" ;; +esac + +ppcmd='$(CPP)' +ppdir='$(CPP:D)' +eval ppopt='"'$ppopt'"' +eval ppenv='"'$ppenv'"' + +set x "" .$exe +shift +exe= +for i +do rm -f require$i +done +if $cc -o require require.$src +then for i + do if $executable require$i + then exe=$i + break + fi + done +fi +case $sa:$sd:$so in +::?*) eval set x $probe_sa + while : + do shift + case $# in + 0) break ;; + esac + for i in $stdlib + do eval j="'" $i/lib*$1 "'" + case $j in + " $i/lib*$1 ") + eval j="'" $i/lib*$1.[0123456789]* "'" + case $j in + " $i/lib*$1.[0123456789]* ") + continue + ;; + esac + ;; + esac + sa=$1 + lddynamic=-Bdynamic + ldstatic=-Bstatic + break 2 + done + done + ;; +esac +case $ldscript in +"") case $so in + .lib) ldscript=".def .exp" ;; + *) ldscript=".ld" ;; + esac + ;; +esac +case $hosttype in +'') hosttype=unknown ;; +sgi.mips3) dll_variants='sgi.mips2:o32:-mips2 sgi.mips4:64:-mips4' ;; +sgi.mips4) dll_variants='sgi.mips2:o32:-mips2 sgi.mips3:n32:-mips3' ;; +esac + +case $hosted in +"") ccnative=`echo $cc | sed -e 's,.*/,,'` + ccs=$ccnative + for c in cc gcc + do case " $ccs " in + *" $c "*) ;; + *) ccs="$ccs $c" ;; + esac + done + for p in $path + do for c in $ccs + do if $executable $p/$c + then rm -f native.$exe + if $p/$c -o native.$exe doti.$src && ./native.$exe + then ccnative=$p/$c + exectype=`package CC="$ccnative" || $SHELL -c "package CC='$ccnative'"` + case $exectype in + *[Uu][Ss][Aa][Gg][Ee]:*) + exectype=`PATH=$_probe_PATH; export PATH; package CC="$ccnative" || $SHELL -c "package CC='$ccnative'"` + ;; + esac + break 2 + fi + fi + done + done + ;; +*) ccnative=$cc + exectype=$hosttype + ;; +esac + +# runtime shared lib exported symbol resolution + +case $cc_dll:$shared in +:|:*|*:);; +*) cat > cmd.c <<'!' +#include +#include +typedef int (*Lib_f)(int**, int**, int**); +int gbl_def = 1; +int gbl_ref = 1; +int gbl_ext; +int main(int argc, char** argv) +{ + void* dll; + Lib_f lib; + int* def; + int* ref; + int* ext; + + if (!(dll = dlopen(*++argv, RTLD_LAZY))) + fprintf(stderr, "library not found\n"); + else if (!((lib = (Lib_f)dlsym(dll, "lib"))) && !(lib = (Lib_f)dlsym(dll, "_lib"))) + fprintf(stderr, "symbol not found\n"); + else if ((*lib)(&def, &ref, &ext)) + fprintf(stderr, "function failed\n"); + else if (def == &gbl_def && ref == &gbl_ref && ext == &gbl_ext) + printf("ALL\n"); + else if (ref == &gbl_ref && ext == &gbl_ext) + printf("REF\n"); + else if (ext == &gbl_ext) + printf("EXT\n"); + return 0; +} +! + cat > lib.c <<'!' +int gbl_def = 1; +int gbl_ref; +int gbl_ext; +int lib(int** def, int** ref, int** ext) +{ + *def = &gbl_def; + *ref = &gbl_ref; + *ext = &gbl_ext; + return 0; +} +! + if $cc -c $cc_dll $cc_pic cmd.c && + $cc -c $cc_dll $cc_pic lib.c && { + $cc $cc_dll $export_dynamic -o cmd.exe cmd.o || + $cc $cc_dll $export_dynamic -o cmd.exe cmd.o -ldl + } && + $dld $shared -o libgbl.dll lib.o + then x=`./cmd.exe ./libgbl.dll` + case $x in + ?*) dialect="$dialect EXPORT=$x" ;; + esac + else case $sd:$hosttype in + .dll:*win*) dialect="$dialect EXPORT=DLL" ;; + esac + fi + ;; +esac + +# shellmagic defined if installed shell scripts need magic + +echo ': got magic : +echo ok' > ok +chmod +x ok +case `(eval ./ok | /bin/sh) 2>/dev/null` in +ok) ;; +*) echo '#!/bin/env sh +: got magic : +echo ok' > ok + chmod +x ok + case `(eval ./ok | /bin/sh) 2>/dev/null` in + ok) shellmagic='$("#")!/bin/env sh' + ;; + *) for i in /emx/bin/bash.exe /emx/bin/sh.exe + do if test -x $i + then shellmagic='$("#")!'$i + break + fi + done + ;; + esac + ;; +esac + +# +# path cleanup +# + +for i in ar ccnative dld ld nm size stdinclude stdlib strip +do eval o='$'$i + v=$o + case $v in + *//*) v=`echo $v | sed 's,///*,/,g'` ;; + esac + if (test . -ef "`pwd`") + then k= + for x in $v + do case $x in + */../*|*/..) + case $x in + /*) a=/ ;; + *) a= ;; + esac + IFS=/ + set '' $x + IFS=$ifs + r= + for d + do r="$d $r" + done + p= + g= + for d in $r + do case $d in + ..) g="$g $d" ;; + *) case $g in + '') case $p in + '') p=$d ;; + *) p=$d/$p ;; + esac + ;; + *) set $g + shift + g=$* + ;; + esac + ;; + esac + done + case $a in + '') for d in $g + do p=$d/$p + done + ;; + *) p=$a$p + ;; + esac + case $p in + /) continue ;; + esac + test $x -ef $p && x=$p + ;; + esac + k="$k $x" + done + set '' $k + shift + v=$1 + case $# in + 0) ;; + *) shift + while : + do case $# in + 0) break ;; + esac + k= + for d + do for j in $v + do test $d -ef $j && continue 2 + done + k="$k $d" + done + set '' $k + case $# in + 1) break ;; + esac + shift + v="$v $1" + shift + done + ;; + esac + fi + case $v in + $o) ;; + *) eval $i='$'v ;; + esac +done + +case $keepstdlib in +1) ;; +*) # + # favor lib64 over lib + # + case $hosttype in + *64|*[!0-9]64[!a-zA-Z0-9]*) + o=$stdlib + stdlib= + for i in $o + do case " $stdlib " in + *" $i "*) + continue + ;; + esac + case $i in + *64) stdlib="$stdlib $i" + continue + ;; + esac + case " $o " in + *" ${i}64 "*) + case " $stdlib " in + *" ${i}64 "*) + ;; + *) stdlib="$stdlib ${i}64" + ;; + esac + ;; + esac + stdlib="$stdlib $i" + done + ;; + esac + ;; +esac + +# +# set up for local override +# + +CC_VERSION_STAMP=$version_stamp +CC_VERSION_STRING=$version_string +CC_CC=$cc +CC_NATIVE=$ccnative +CC_EXECTYPE=$exectype +CC_HOSTTYPE=$hosttype +CC_ALTPP_FLAGS=$ppopt +CC_ALTPP_ENV=$ppenv +CC_AR=$ar +CC_AR_ARFLAGS=$ar_arflags +CC_ARFLAGS=$arflags +CC_DEBUG=$debug +CC_DIALECT=$dialect +CC_PICBIG=$cc_PIC +CC_PICSMALL=$cc_pic +CC_PIC=$CC_PICBIG +CC_DLL_ONLY=$cc_dll +case $CC_DLL_ONLY in +'') CC_DLLBIG= + CC_DLLSMALL= + CC_DLL= + ;; +*) CC_DLLBIG="$CC_DLL_ONLY $CC_PICBIG" + CC_DLLSMALL="$CC_DLL_ONLY $CC_PICSMALL" + CC_DLL="$CC_DLL_ONLY $CC_PICBIG" + ;; +esac +CC_DLL_DIR=$dll_dir +CC_DLL_LIBRARIES=$dll_libraries +CC_DLL_VARIANTS=$dll_variants +CC_DYNAMIC=$dynamic +CC_EXPORT_DYNAMIC=$export_dynamic +CC_INCLUDE_LOCAL=$include_local +CC_LD=$ld +CC_LD_DYNAMIC=$lddynamic +CC_LD_LAZY=$ldlazy +CC_LD_NOLAZY=$ldnolazy +CC_LD_ORIGIN=$ldorigin +CC_LD_RECORD=$ldrecord +CC_LD_NORECORD=$ldnorecord +CC_LD_RUNPATH=$ldrunpath +CC_LD_STATIC=$ldstatic +CC_LD_STRIP=$ldstrip +CC_LIB_DLL=$lib_dll +CC_LIB_ALL=$lib_all +CC_LIB_UNDEF=$lib_undef +CC_MAKE_OPTIONS=$makeoptions +CC_NM=$nm +CC_NMEDIT=$nmedit +CC_NMFLAGS=$nmflags +CC_NOPROTECT=$no_protect +CC_OPTIMIZE=$optimize +CC_READONLY=$readonly +CC_REPOSITORY=$repository +CC_REQUIRE=$require +CC_RUNPATH=$runpath +CC_SHARED=$shared +CC_SHARED_LD=$dld +CC_SHARED_NAME=$shared_name +CC_SHARED_REGISTRY=$shared_registry +CC_SHARED_REGISTRY_PATH=$probe_shared_registry_path +CC_SHELLMAGIC=$shellmagic +CC_SIZE=$size +CC_STATIC=$static +CC_STDINCLUDE=$stdinclude +CC_STDLIB=$stdlib +CC_STRICT=$strict +CC_STRIP=$strip +CC_STRIP_FLAGS=$stripflags +CC_PREFIX_ARCHIVE=$prefix_archive +CC_PREFIX_DYNAMIC=$prefix_dynamic +CC_PREFIX_SHARED=$prefix_shared +CC_PREFIX_SYMBOL=$symprefix +CC_SUFFIX_ARCHIVE=.$lib +CC_SUFFIX_COMMAND=$suffix_command +CC_SUFFIX_DEBUG=$sdb +CC_SUFFIX_DYNAMIC=$sd +CC_SUFFIX_LD=$ldscript +CC_SUFFIX_OBJECT=.$obj +CC_SUFFIX_SHARED=$so +CC_SUFFIX_SOURCE=.$src +CC_SUFFIX_STATIC=$sa +CC_VERSION=$version_flags +CC_WARN=$warn +CC_ATTRIBUTES=$ATTRIBUTES + +exec >&3 + +# +# check for local override +# all CC_* but { CC_CC CC_VERSION_STAMP CC_VERSION_STRING } may be modified +# additional CC.* may be printed on stdout +# + +if test -f "$dir/probe.lcl" +then . "$dir/probe.lcl" +fi + +# +# the payoff +# + +case $version_stamp in +?*) echo "# $version_stamp" ;; +esac +echo CC.CC = $cc +echo CC.NATIVE = $CC_NATIVE +echo CC.EXECTYPE = $CC_EXECTYPE +echo CC.HOSTTYPE = $CC_HOSTTYPE +echo CC.ALTPP.FLAGS = $CC_ALTPP_FLAGS +echo CC.ALTPP.ENV = $CC_ALTPP_ENV +echo CC.AR = $CC_AR +echo CC.AR.ARFLAGS = $CC_AR_ARFLAGS +echo CC.ARFLAGS = $CC_ARFLAGS +echo CC.DEBUG = $CC_DEBUG +echo CC.DIALECT = $CC_DIALECT +echo CC.DLLBIG = $CC_DLLBIG +echo CC.DLLSMALL = $CC_DLLSMALL +echo CC.DLL = $CC_DLL +echo CC.DLL.DEF = $cc_dll_def +echo CC.DLL.DIR = $CC_DLL_DIR +echo CC.DLL.LIBRARIES = $CC_DLL_LIBRARIES +echo CC.DLL.VARIANTS = $CC_DLL_VARIANTS +echo CC.DYNAMIC = $CC_DYNAMIC +echo CC.EXPORT.DYNAMIC = $CC_EXPORT_DYNAMIC +echo CC.INCLUDE.LOCAL = $CC_INCLUDE_LOCAL +# +# 2004-02-14 release workaround +# +case $CC_SHARED_LD in +$CC_CC) echo if LDSHARED + echo CC.LD = $CC_LD + echo else + echo CC.LD = $CC_CC + echo end + ;; +*) echo CC.LD = $CC_LD + ;; +esac +echo CC.LD.DYNAMIC = $CC_LD_DYNAMIC +echo CC.LD.LAZY = $CC_LD_LAZY +echo CC.LD.NOLAZY = $CC_LD_NOLAZY +echo CC.LD.ORIGIN = $CC_LD_ORIGIN +echo CC.LD.RECORD = $CC_LD_RECORD +echo CC.LD.NORECORD = $CC_LD_NORECORD +echo CC.LD.RUNPATH = $CC_LD_RUNPATH +echo CC.LD.STATIC = $CC_LD_STATIC +echo CC.LD.STRIP = $CC_LD_STRIP +echo CC.LIB.DLL = $CC_LIB_DLL +echo CC.LIB.ALL = $CC_LIB_ALL +echo CC.LIB.UNDEF = $CC_LIB_UNDEF +echo CC.MAKE.OPTIONS = $CC_MAKE_OPTIONS +echo CC.NM = $CC_NM +case $CC_NMEDIT in +?*) CC_NMEDIT=" $CC_NMEDIT" ;; +esac +echo CC.NMEDIT ="$CC_NMEDIT" +echo CC.NMFLAGS = $CC_NMFLAGS +echo CC.NOPROTECT = $CC_NOPROTECT +echo CC.OPTIMIZE = $CC_OPTIMIZE +echo CC.PICBIG = $CC_PICBIG +echo CC.PICSMALL = $CC_PICSMALL +echo CC.PIC = $CC_PIC +echo CC.READONLY = $CC_READONLY +echo CC.REPOSITORY = $CC_REPOSITORY +for f in $CC_REQUIRE +do echo CC.REQUIRE.$f =`cat req.$f` +done +echo CC.RUNPATH = $CC_RUNPATH +echo CC.SHARED = $CC_SHARED +echo CC.SHARED.LD = $CC_SHARED_LD +echo CC.SHARED.NAME = $CC_SHARED_NAME +echo CC.SHARED.REGISTRY = $CC_SHARED_REGISTRY +echo CC.SHARED.REGISTRY.PATH = $CC_SHARED_REGISTRY_PATH +echo CC.SHELLMAGIC = $CC_SHELLMAGIC +echo CC.SIZE = $CC_SIZE +echo CC.STATIC = $CC_STATIC +echo CC.STDINCLUDE = $CC_STDINCLUDE +echo CC.STDLIB = $CC_STDLIB +echo CC.STRICT = $CC_STRICT +echo CC.STRIP = $CC_STRIP +echo CC.STRIP.FLAGS = $CC_STRIP_FLAGS +echo CC.PREFIX.ARCHIVE = $CC_PREFIX_ARCHIVE +echo CC.PREFIX.DYNAMIC = $CC_PREFIX_DYNAMIC +echo CC.PREFIX.SHARED = $CC_PREFIX_SHARED +echo CC.PREFIX.SYMBOL = $CC_PREFIX_SYMBOL +echo CC.SUFFIX.ARCHIVE = $CC_SUFFIX_ARCHIVE +echo CC.SUFFIX.COMMAND = $CC_SUFFIX_COMMAND +echo CC.SUFFIX.DEBUG = $CC_SUFFIX_DEBUG +echo CC.SUFFIX.DYNAMIC = $CC_SUFFIX_DYNAMIC +echo CC.SUFFIX.LD = $CC_SUFFIX_LD +echo CC.SUFFIX.OBJECT = $CC_SUFFIX_OBJECT +echo CC.SUFFIX.SHARED = $CC_SUFFIX_SHARED +echo CC.SUFFIX.SOURCE = $CC_SUFFIX_SOURCE +echo CC.SUFFIX.STATIC = $CC_SUFFIX_STATIC +echo CC.VERSION = $CC_VERSION +case $CC_VERSION_STRING in +*\"*) i=`echo " $CC_VERSION_STRING" | sed -e 's,",\\\\",g' -e 's,^ ,,' -e 's,.*,"&",'` ;; +*\'*) i=\"$CC_VERSION_STRING\" ;; +*) i=$CC_VERSION_STRING ;; +esac +cat < * +* * +***********************************************************************/ +#pragma prototyped +#pragma clang diagnostic ignored "-Wparentheses" + +/* + * mamake -- MAM make + * + * coded for portability + */ + +#define RELEASE_DATE "2021-01-21" +static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0\n"; + +#if _PACKAGE_ast + +#include +#include + +static const char usage[] = +"[-?\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\n]" +USAGE_LICENSE +"[+NAME?mamake - make abstract machine make]" +"[+DESCRIPTION?\bmamake\b reads \amake abstract machine\a target and" +" prerequisite file descriptions from a mamfile (see \b-f\b) and executes" +" actions to update targets that are older than their prerequisites." +" Mamfiles are portable to environments that only have" +" \bsh\b(1) and \bcc\b(1).]" +"[+?Mamfiles are used rather than" +" old-\bmake\b makefiles because some features are not reliably supported" +" across all \bmake\b variants:]{" +" [+action execution?Multi-line actions are executed as a" +" unit by \b$SHELL\b. There are some shell constructs" +" that cannot be expressed in an old-\bmake\b makefile.]" +" [+viewpathing?\bVPATH\b is properly interpreted. This allows" +" source to be separate from generated files.]" +" [+recursion?Ordered subdirectory recursion over unrelated" +" makefiles.]" +" }" +"[+?\bmamprobe\b(1) is called to probe and generate system specific variable" +" definitions. The probe information is regenerated when it is older" +" than the \bmamprobe\b command.]" +"[+?For compatibility with \bnmake\b(1) the \b-K\b option and the" +" \brecurse\b and \bcc-*\b command line targets are ignored.]" +"[e:?Explain reason for triggering action. Ignored if -F is on.]" +"[f:?Read \afile\a instead of the default.]:[file:=Mamfile]" +"[i:?Ignore action errors.]" +"[k:?Continue after error with sibling prerequisites.]" +"[n:?Print actions but do not execute. Recursion actions (see \b-r\b) are still" +" executed. Use \b-N\b to disable recursion actions too.]" +"[r:?Recursively make leaf directories matching \apattern\a. Only leaf" +" directories containing a makefile named \bNmakefile\b, \bnmakefile\b," +" \bMakefile\b or \bmakefile\b are considered. The first makefile" +" found in each leaf directory is scanned for leaf directory" +" prerequisites; the recursion order is determined by a topological sort" +" of these prerequisites.]:[pattern]" +"[C:?Do all work in \adirectory\a. All messages will mention" +" \adirectory\a.]:[directory]" +"[D:?Set the debug trace level to \alevel\a. Higher levels produce more" +" output.]#[level]" +"[F:?Force all targets to be out of date.]" +"[K:?Ignored.]" +"[N:?Like \b-n\b but recursion actions (see \b-r\b) are also disabled.]" +"[V:?Print the program version and exit.]" +"[G:debug-symbols?Compile and link with debugging symbol options enabled.]" +"[S:strip-symbols?Strip link-time static symbols from executables.]" + +"\n" +"\n[ target ... ] [ name=value ... ]\n" +"\n" + +"[+SEE ALSO?\bgmake\b(1), \bmake\b(1), \bmamprobe\b(1)," +" \bnmake\b(1), \bsh\b(1)]" +; + +#else + +#define elementsof(x) (sizeof(x)/sizeof(x[0])) +#define newof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)calloc(1,sizeof(t)*(n)+(x))) + +#define NiL ((char*)0) + +#endif + +#include +#include +#include +#include +#include +#include + +#if !_PACKAGE_ast && defined(__STDC__) +#include +#include +#endif + +#define delimiter(c) ((c)==' '||(c)=='\t'||(c)=='\n'||(c)==';'||(c)=='('||(c)==')'||(c)=='`'||(c)=='|'||(c)=='&'||(c)=='=') + +#define add(b,c) (((b)->nxt >= (b)->end) ? append(b, "") : NiL, *(b)->nxt++ = (c)) +#define get(b) ((b)->nxt-(b)->buf) +#define set(b,o) ((b)->nxt=(b)->buf+(o)) +#define use(b) (*(b)->nxt=0,(b)->nxt=(b)->buf) + +#define CHUNK 4096 +#define KEY(a,b,c,d) ((((unsigned long)(a))<<15)|(((unsigned long)(b))<<10)|(((unsigned long)(c))<<5)|(((unsigned long)(d)))) +#define NOW ((unsigned long)time((time_t*)0)) +#define ROTATE(p,l,r,t) ((t)=(p)->l,(p)->l=(t)->r,(t)->r=(p),(p)=(t)) + +#define RULE_active 0x0001 /* active target */ +#define RULE_dontcare 0x0002 /* ok if not found */ +#define RULE_error 0x0004 /* not found or not generated */ +#define RULE_exists 0x0008 /* target file exists */ +#define RULE_generated 0x0010 /* generated target */ +#define RULE_ignore 0x0020 /* ignore time */ +#define RULE_implicit 0x0040 /* implicit prerequisite */ +#define RULE_made 0x0080 /* already made */ +#define RULE_virtual 0x0100 /* not a file */ + +#define STREAM_KEEP 0x0001 /* don't fclose() on pop() */ +#define STREAM_MUST 0x0002 /* push() file must exist */ +#define STREAM_PIPE 0x0004 /* pclose() on pop() */ + +#ifndef S_IXUSR +#define S_IXUSR 0100 /* owner execute permission */ +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 /* group execute permission */ +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 /* other execute permission */ +#endif + +struct Rule_s; + +typedef struct stat Stat_t; +typedef FILE Stdio_t; + +typedef struct Buf_s /* buffer stream */ +{ + struct Buf_s* old; /* next dropped buffer */ + char* end; /* 1 past end of buffer */ + char* nxt; /* next char to add */ + char* buf; /* buffer space */ +} Buf_t; + +typedef struct Dict_item_s /* dictionary item */ +{ + struct Dict_item_s* left; /* left child */ + struct Dict_item_s* right; /* right child */ + void* value; /* user defined value */ + char name[1];/* 0 terminated name */ +} Dict_item_t; + +typedef struct Dict_s /* dictionary handle */ +{ + Dict_item_t* root; /* root item */ +} Dict_t; + +typedef struct List_s /* Rule_t list */ +{ + struct List_s* next; /* next in list */ + struct Rule_s* rule; /* list item */ +} List_t; + +typedef struct Rule_s /* rule item */ +{ + char* name; /* unbound name */ + char* path; /* bound path */ + List_t* prereqs; /* prerequisites */ + struct Rule_s* leaf; /* recursion leaf alias */ + int flags; /* RULE_* flags */ + int making; /* currently make()ing */ + unsigned long time; /* modification time */ +} Rule_t; + +typedef struct Stream_s /* input file stream stack */ +{ + Stdio_t* fp; /* read stream */ + char* file; /* stream path */ + unsigned long line; /* stream line */ + int flags; /* stream flags */ +} Stream_t; + +typedef struct View_s /* viewpath level */ +{ + struct View_s* next; /* next level in viewpath */ + int node; /* viewpath node path length */ + char dir[1]; /* viewpath level dir prefix */ +} View_t; + +static struct /* program state */ +{ + Buf_t* buf; /* work buffer */ + Buf_t* old; /* dropped buffers */ + Buf_t* opt; /* option buffer */ + + Dict_t* leaf; /* recursion leaf dictionary */ + Dict_t* libs; /* library dictionary */ + Dict_t* rules; /* rule dictionary */ + Dict_t* vars; /* variable dictionary */ + + View_t* view; /* viewpath levels */ + + char* directory; /* work in this directory */ + char* id; /* command name */ + char* file; /* first input file */ + char* pwd; /* current directory */ + char* recurse; /* recursion pattern */ + char* shell; /* ${SHELL} */ + + int active; /* targets currently active */ + int debug; /* negative of debug level */ + int errors; /* some error(s) occurred */ + int exec; /* execute actions */ + int explain; /* explain actions */ + int force; /* all targets out of date */ + int ignore; /* ignore command errors */ + int indent; /* debug indent */ + int keepgoing; /* do siblings on error */ + int never; /* never execute */ + int peek; /* next line already in input */ + int probed; /* probe already done */ + int verified; /* don't bother with verify() */ + + Stream_t streams[4]; /* input file stream stack */ + Stream_t* sp; /* input stream stack pointer */ + + char input[8*CHUNK]; /* input buffer */ +} state; + +static unsigned long make(Rule_t*); + +static char mamfile[] = "Mamfile"; +static char sh[] = "/bin/sh"; + +extern char** environ; + +#if !_PACKAGE_ast + +#if defined(NeXT) || defined(__NeXT) +#define getcwd(a,b) getwd(a) +#endif + +/* + * emit usage message and exit + */ + +static void +usage() +{ + fprintf(stderr, "Usage: %s [-iknFKNV] [-f mamfile] [-r pattern] [-C directory] [-D level] [target ...] [name=value ...]\n", state.id); + exit(2); +} + +#endif + +/* + * output error message identification + */ + +static void +identify(Stdio_t* sp) +{ + if (state.directory) + fprintf(sp, "%s [%s]: ", state.id, state.directory); + else + fprintf(sp, "%s: ", state.id); +} + +/* + * emit error message + * level: + * <0 debug + * 0 info + * 1 warning + * 2 error + * >2 exit(level-2) + */ + +static void +report(int level, char* text, char* item, unsigned long stamp) +{ + int i; + + if (level >= state.debug) + { + if (level) + identify(stderr); + if (level < 0) + { + fprintf(stderr, "debug%d: ", level); + for (i = 1; i < state.indent; i++) + fprintf(stderr, " "); + } + else + { + if (state.sp && state.sp->line) + { + if (state.sp->file) + fprintf(stderr, "%s: ", state.sp->file); + fprintf(stderr, "%ld: ", state.sp->line); + } + if (level == 1) + fprintf(stderr, "warning: "); + else if (level > 1) + state.errors = 1; + } + if (item) + fprintf(stderr, "%s: ", item); + fprintf(stderr, "%s", text); + if (stamp && state.debug <= -2) + fprintf(stderr, " %10lu", stamp); + fprintf(stderr, "\n"); + if (level > 2) + exit(level - 2); + } +} + +/* + * don't know how to make or exit code making + */ + +static void +dont(Rule_t* r, int code, int keepgoing) +{ + identify(stderr); + if (!code) + fprintf(stderr, "don't know how to make %s\n", r->name); + else + { + fprintf(stderr, "*** exit code %d making %s%s\n", code, r->name, state.ignore ? " ignored" : ""); + unlink(r->name); + if (state.ignore) + return; + } + if (!keepgoing) + exit(1); + state.errors++; + r->flags |= RULE_error; +} + +/* + * local strrchr() + */ + +static char* +last(register char* s, register int c) +{ + register char* r = 0; + + for (r = 0; *s; s++) + if (*s == c) + r = s; + return r; +} + +/* + * open a buffer stream + */ + +static Buf_t* +buffer(void) +{ + register Buf_t* buf; + + if (buf = state.old) + state.old = state.old->old; + else if (!(buf = newof(0, Buf_t, 1, 0)) || !(buf->buf = newof(0, char, CHUNK, 0))) + report(3, "out of space [buffer]", NiL, (unsigned long)0); + buf->end = buf->buf + CHUNK; + buf->nxt = buf->buf; + return buf; +} + +/* + * close a buffer stream + */ + +static void +drop(Buf_t* buf) +{ + buf->old = state.old; + state.old = buf; +} + +/* + * append str length n to buffer and return the buffer base + */ + +static char* +appendn(Buf_t* buf, char* str, int n) +{ + int m; + int i; + + if ((n + 1) >= (buf->end - buf->nxt)) + { + i = buf->nxt - buf->buf; + m = (((buf->end - buf->buf) + n + CHUNK + 1) / CHUNK) * CHUNK; + if (!(buf->buf = newof(buf->buf, char, m, 0))) + report(3, "out of space [buffer resize]", NiL, (unsigned long)0); + buf->end = buf->buf + m; + buf->nxt = buf->buf + i; + } + memcpy(buf->nxt, str, n + 1); + buf->nxt += n; + return buf->buf; +} + +/* + * append str to buffer and return the buffer base + * if str==0 then next pointer reset to base + */ + +static char* +append(Buf_t* buf, char* str) +{ + if (str) + return appendn(buf, str, strlen(str)); + buf->nxt = buf->buf; + return buf->buf; +} + +/* + * allocate space for s and return the copy + */ + +static char* +duplicate(char* s) +{ + char* t; + int n; + + n = strlen(s); + if (!(t = newof(0, char, n, 1))) + report(3, "out of space [duplicate]", s, (unsigned long)0); + strcpy(t, s); + return t; +} + +/* + * open a new dictionary + */ + +static Dict_t* +dictionary(void) +{ + Dict_t* dict; + + if (!(dict = newof(0, Dict_t, 1, 0))) + report(3, "out of space [dictionary]", NiL, (unsigned long)0); + return dict; +} + +/* + * return the value for item name in dictionary dict + * if value!=0 then name entry value is created if necessary and set + * uses top-down splaying (ala Tarjan and Sleator) + */ + +static void* +search(register Dict_t* dict, char* name, void* value) +{ + register int cmp; + register Dict_item_t* root; + register Dict_item_t* t; + register Dict_item_t* left; + register Dict_item_t* right; + register Dict_item_t* lroot; + register Dict_item_t* rroot; + + root = dict->root; + left = right = lroot = rroot = 0; + while (root) + { + if (!(cmp = strcmp(name, root->name))) + break; + else if (cmp < 0) + { + if (root->left && (cmp = strcmp(name, root->left->name)) <= 0) + { + ROTATE(root, left, right, t); + if (!cmp) + break; + } + if (right) + right->left = root; + else + rroot = root; + right = root; + root = root->left; + right->left = 0; + } + else + { + if (root->right && (cmp = strcmp(name, root->right->name)) >= 0) + { + ROTATE(root, right, left, t); + if (!cmp) + break; + } + if (left) + left->right = root; + else + lroot = root; + left = root; + root = root->right; + left->right = 0; + } + } + if (root) + { + if (right) + right->left = root->right; + else + rroot = root->right; + if (left) + left->right = root->left; + else + lroot = root->left; + } + else if (value) + { + if (!(root = newof(0, Dict_item_t, 1, strlen(name)))) + report(3, "out of space [dictionary]", name, (unsigned long)0); + strcpy(root->name, name); + } + if (root) + { + if (value) + root->value = value; + root->left = lroot; + root->right = rroot; + dict->root = root; + return value ? (void*)root->name : root->value; + } + if (left) + { + left->right = rroot; + dict->root = lroot; + } + else if (right) + { + right->left = lroot; + dict->root = rroot; + } + return 0; +} + +/* + * low level for walk() + */ + +static int +apply(Dict_t* dict, Dict_item_t* item, int (*func)(Dict_item_t*, void*), void* handle) +{ + register Dict_item_t* right; + + do + { + right = item->right; + if (item->left && apply(dict, item->left, func, handle)) + return -1; + if ((*func)(item, handle)) + return -1; + } while (item = right); + return 0; +} + +/* + * apply func to each dictionary item + */ + +static int +walk(Dict_t* dict, int (*func)(Dict_item_t*, void*), void* handle) +{ + return dict->root ? apply(dict, dict->root, func, handle) : 0; +} + +/* + * return a rule pointer for name + */ + +static Rule_t* +rule(char* name) +{ + Rule_t* r; + + if (!(r = (Rule_t*)search(state.rules, name, NiL))) + { + if (!(r = newof(0, Rule_t, 1, 0))) + report(3, "out of space [rule]", name, (unsigned long)0); + r->name = (char*)search(state.rules, name, (void*)r); + } + return r; +} + +/* + * prepend p onto rule r prereqs + */ + +static void +cons(Rule_t* r, Rule_t* p) +{ + register List_t* x; + + for (x = r->prereqs; x && x->rule != p; x = x->next); + if (!x) + { + if (!(x = newof(0, List_t, 1, 0))) + report(3, "out of space [list]", r->name, (unsigned long)0); + x->rule = p; + x->next = r->prereqs; + r->prereqs = x; + } +} + +/* + * initialize the viewpath + */ + +static void +view(void) +{ + register char* s; + register char* t; + register char* p; + register View_t* vp; + + View_t* zp; + int c; + int n; + + Stat_t st; + Stat_t ts; + + char buf[CHUNK]; + + if (stat(".", &st)) + report(3, "cannot stat", ".", (unsigned long)0); + if ((s = (char*)search(state.vars, "PWD", NiL)) && !stat(s, &ts) && + ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) + state.pwd = s; + if (!state.pwd) + { + if (!getcwd(buf, sizeof(buf) - 1)) + report(3, "cannot determine PWD", NiL, (unsigned long)0); + state.pwd = duplicate(buf); + search(state.vars, "PWD", state.pwd); + } + if ((s = (char*)search(state.vars, "VPATH", NiL)) && *s) + { + zp = 0; + for (;;) + { + for (t = s; *t && *t != ':'; t++); + if (c = *t) + *t = 0; + if (!state.view) + { + /* + * determine the viewpath offset + */ + + if (stat(s, &st)) + report(3, "cannot stat top view", s, (unsigned long)0); + if (stat(state.pwd, &ts)) + report(3, "cannot stat", state.pwd, (unsigned long)0); + if (ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) + p = "."; + else + { + p = state.pwd + strlen(state.pwd); + while (p > state.pwd) + if (*--p == '/') + { + if (p == state.pwd) + report(3, ". not under VPATH", s, (unsigned long)0); + *p = 0; + if (stat(state.pwd, &ts)) + report(3, "cannot stat", state.pwd, (unsigned long)0); + *p = '/'; + if (ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) + { + p++; + break; + } + } + if (p <= state.pwd) + report(3, "cannot determine viewpath offset", s, (unsigned long)0); + } + } + n = strlen(s); + if (!(vp = newof(0, View_t, 1, strlen(p) + n + 1))) + report(3, "out of space [view]", s, (unsigned long)0); + vp->node = n + 1; + strcpy(vp->dir, s); + *(vp->dir + n) = '/'; + strcpy(vp->dir + n + 1, p); + report(-4, vp->dir, "view", (unsigned long)0); + if (!state.view) + state.view = zp = vp; + else + zp = zp->next = vp; + if (!c) + break; + *t++ = c; + s = t; + } + } +} + +/* + * return next '?' or '}' in nested '}' + */ + +static char* +cond(register char* s) +{ + register int n; + + if (*s == '?') + s++; + n = 0; + for (;;) + { + switch (*s++) + { + case 0: + break; + case '{': + n++; + continue; + case '}': + if (!n--) + break; + continue; + case '?': + if (!n) + break; + continue; + default: + continue; + } + break; + } + return s - 1; +} + +/* + * expand var refs from s into buf + */ + +static void +substitute(Buf_t* buf, register char* s) +{ + register char* t; + register char* v; + register char* q; + register char* b; + register int c; + register int n; + int a = 0; + int i; + + while (c = *s++) + { + if (c == '$' && *s == '{') + { + b = s - 1; + i = 1; + for (n = *(t = ++s) == '-' ? 0 : '-'; (c = *s) && c != '?' && c != '+' && c != n && c != ':' && c != '=' && c != '[' && c != '}'; s++) + if (!isalnum(c) && c != '_') + i = 0; + *s = 0; + if (c == '[') + { + append(buf, b); + *s = c; + continue; + } + v = (char*)search(state.vars, t, NiL); + if ((c == ':' || c == '=') && (!v || c == ':' && !*v)) + { + append(buf, b); + *s = c; + continue; + } + if (t[0] == 'A' && t[1] == 'R' && t[2] == 0) + a = 1; + *s = c; + if (c && c != '}') + { + n = 1; + for (t = ++s; *s; s++) + if (*s == '{') + n++; + else if (*s == '}' && !--n) + break; + } + switch (c) + { + case '?': + q = cond(t - 1); + if (v) + { + if (((q - t) != 1 || *t != '*') && strncmp(v, t, q - t)) + v = 0; + } + else if (q == t) + v = s; + t = cond(q); + if (v) + { + if (t > q) + { + c = *t; + *t = 0; + substitute(buf, q + 1); + *t = c; + } + } + else + { + q = cond(t); + if (q > t) + { + c = *q; + *q = 0; + substitute(buf, t + 1); + *q = c; + } + } + break; + case '+': + case '-': + if ((v == 0 || *v == 0) == (c == '-')) + { + c = *s; + *s = 0; + substitute(buf, t); + *s = c; + break; + } + if (c != '-') + break; + /*FALLTHROUGH*/ + case 0: + case '=': + case '}': + if (v) + { + if (a && t[0] == 'm' && t[1] == 'a' && t[2] == 'm' && t[3] == '_' && t[4] == 'l' && t[5] == 'i' && t[6] == 'b') + { + for (t = v; *t == ' '; t++); + for (; *t && *t != ' '; t++); + if (*t) + *t = 0; + else + t = 0; + substitute(buf, v); + if (t) + *t = ' '; + } + else + substitute(buf, v); + } + else if (i) + { + c = *s; + *s = 0; + append(buf, b); + *s = c; + continue; + } + break; + } + if (*s) + s++; + } + else + add(buf, c); + } +} + +/* + * expand var refs from s into buf and return buf base + */ + +static char* +expand(Buf_t* buf, char* s) +{ + substitute(buf, s); + return use(buf); +} + +/* + * stat() with .exe check + */ + +static char* +status(Buf_t* buf, int off, char* path, struct stat* st) +{ + int r; + char* s; + Buf_t* tmp; + + if (!stat(path, st)) + return path; + if (!(tmp = buf)) + { + tmp = buffer(); + off = 0; + } + if (off) + set(tmp, off); + else + append(tmp, path); + append(tmp, ".exe"); + s = use(tmp); + r = stat(s, st); + if (!buf) + { + drop(tmp); + s = path; + } + if (r) + { + if (off) + s[off] = 0; + s = 0; + } + return s; +} + +/* + * return path to file + */ + +static char* +find(Buf_t* buf, char* file, struct stat* st) +{ + char* s; + View_t* vp; + int node; + int c; + int o; + + if (s = status(buf, 0, file, st)) + { + report(-3, s, "find", (unsigned long)0); + return s; + } + if (vp = state.view) + { + node = 0; + if (*file == '/') + { + do + { + if (!strncmp(file, vp->dir, vp->node)) + { + file += vp->node; + node = 2; + break; + } + } while (vp = vp->next); + } + else + vp = vp->next; + if (vp) + do + { + if (node) + { + c = vp->dir[vp->node]; + vp->dir[vp->node] = 0; + append(buf, vp->dir); + vp->dir[vp->node] = c; + } + else + { + append(buf, vp->dir); + append(buf, "/"); + } + append(buf, file); + o = get(buf); + s = use(buf); + if (s = status(buf, o, s, st)) + { + report(-3, s, "find", (unsigned long)0); + return s; + } + } while (vp = vp->next); + } + return 0; +} + +/* + * bind r to a file and return the modify time + */ + +static unsigned long +bind(Rule_t* r) +{ + char* s; + Buf_t* buf; + struct stat st; + + buf = buffer(); + if (s = find(buf, r->name, &st)) + { + if (s != r->name) + r->path = duplicate(s); + r->time = st.st_mtime; + r->flags |= RULE_exists; + } + drop(buf); + return r->time; +} + +/* + * pop the current input file + */ + +static int +pop(void) +{ + int r; + + if (!state.sp) + report(3, "input stack underflow", NiL, (unsigned long)0); + if (!state.sp->fp || (state.sp->flags & STREAM_KEEP)) + r = 0; + else if (state.sp->flags & STREAM_PIPE) + r = pclose(state.sp->fp); + else + r = fclose(state.sp->fp); + if (state.sp == state.streams) + state.sp = 0; + else + state.sp--; + return r; +} + +/* + * push file onto the input stack + */ + +static int +push(char* file, Stdio_t* fp, int flags) +{ + char* path; + Buf_t* buf; + struct stat st; + + if (!state.sp) + state.sp = state.streams; + else if (++state.sp >= &state.streams[elementsof(state.streams)]) + report(3, "input stream stack overflow", NiL, (unsigned long)0); + if (state.sp->fp = fp) + state.sp->file = "pipeline"; + else if (flags & STREAM_PIPE) + report(3, "pipe error", file, (unsigned long)0); + else if (!file || !strcmp(file, "-") || !strcmp(file, "/dev/stdin")) + { + flags |= STREAM_KEEP; + state.sp->file = "/dev/stdin"; + state.sp->fp = stdin; + } + else + { + buf = buffer(); + if (path = find(buf, file, &st)) + { + if (!(state.sp->fp = fopen(path, "r"))) + report(3, "cannot read", path, (unsigned long)0); + state.sp->file = duplicate(path); + drop(buf); + } + else + { + drop(buf); + pop(); + if (flags & STREAM_MUST) + report(3, "not found", file, (unsigned long)0); + return 0; + } + } + state.sp->flags = flags; + state.sp->line = 0; + return 1; +} + +/* + * return the next input line + */ + +static char* +input(void) +{ + char* e; + + if (!state.sp) + report(3, "no input file stream", NiL, (unsigned long)0); + if (state.peek) + state.peek = 0; + else if (!fgets(state.input, sizeof(state.input), state.sp->fp)) + return 0; + else if (*state.input && *(e = state.input + strlen(state.input) - 1) == '\n') + *e = 0; + state.sp->line++; + e = state.input; + while (isspace(*e)) + e++; /* allow indentation */ + return e; +} + +/* + * pass shell action s to ${SHELL:-/bin/sh} + * the -c wrapper ensures that scripts are run in the selected shell + * even on systems that otherwise demand #! magic (can you say cygwin) + */ + +static int +execute(register char* s) +{ + register int c; + Buf_t* buf; + + if (!state.shell && (!(state.shell = (char*)search(state.vars, "SHELL", NiL)) || !strcmp(state.shell, sh))) + state.shell = sh; + buf = buffer(); + append(buf, state.shell); + append(buf, " -c '"); + while (c = *s++) + { + if (c == '\'') + { + add(buf, c); + for (s--; *s == c; s++) + { + add(buf, '\\'); + add(buf, c); + } + } + add(buf, c); + } + add(buf, '\''); + s = use(buf); + report(-5, s, "exec", (unsigned long)0); + if ((c = system(s)) > 255) + c >>= 8; + drop(buf); + return c; +} + +/* + * run action s to update r + */ + +static unsigned long +run(Rule_t* r, register char* s) +{ + register Rule_t* q; + register char* t; + register int c; + register View_t* v; + int i; + int j; + int x; + Stat_t st; + Buf_t* buf; + + if (r->flags & RULE_error) + return r->time; + buf = buffer(); + if (!strncmp(s, "mamake -r ", 10)) + { + state.verified = 1; + x = !state.never; + } + else + x = state.exec; + if (x) + append(buf, "trap - 1 2 3 15\nPATH=.:$PATH\nset -x\n"); + if (state.view) + { + do + { + for (; delimiter(*s); s++) + add(buf, *s); + for (t = s; *s && !delimiter(*s); s++); + c = *s; + *s = 0; + if (c == '=') + { + append(buf, t); + continue; + } + if ((q = (Rule_t*)search(state.rules, t, NiL)) && q->path && !(q->flags & RULE_generated)) + append(buf, q->path); + else + { + append(buf, t); + if (*t == '-' && *(t + 1) == 'I' && (*(t + 2) || c)) + { + if (*(t + 2)) + i = 2; + else + { + for (i = 3; *(t + i) == ' ' || *(t + i) == '\t'; i++); + *s = c; + for (s = t + i; *s && *s != ' ' && *s != '\t' && *s != '\n'; s++); + c = *s; + *s = 0; + append(buf, t + 2); + } + if (*(t + i) && *(t + i) != '/') + { + v = state.view; + while (v = v->next) + { + add(buf, ' '); + for (j = 0; j < i; j++) + add(buf, *(t + j)); + append(buf, v->dir); + if (*(t + i) != '.' || *(t + i + 1)) + { + add(buf, '/'); + append(buf, t + i); + } + } + } + } + } + } while (*s = c); + s = use(buf); + } + else if (x) + { + append(buf, s); + s = use(buf); + } + if (x) + { + if (c = execute(s)) + dont(r, c, state.keepgoing); + if (status((Buf_t*)0, 0, r->name, &st)) + { + r->time = st.st_mtime; + r->flags |= RULE_exists; + } + else + r->time = NOW; + } + else + { + fprintf(stdout, "%s\n", s); + if (state.debug) + fflush(stdout); + r->time = NOW; + r->flags |= RULE_exists; + } + drop(buf); + return r->time; +} + +/* + * return the full path for s using buf workspace + */ + +static char* +path(Buf_t* buf, char* s, int must) +{ + register char* p; + register char* d; + register char* x; + char* e; + register int c; + int t; + int o; + Stat_t st; + + for (e = s; *e && *e != ' ' && *e != '\t'; e++); + t = *e; + if ((x = status(buf, 0, s, &st)) && (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) + return x; + if (!(p = (char*)search(state.vars, "PATH", NiL))) + report(3, "variable not defined", "PATH", (unsigned long)0); + do + { + for (d = p; *p && *p != ':'; p++); + c = *p; + *p = 0; + if (*d && (*d != '.' || *(d + 1))) + { + append(buf, d); + add(buf, '/'); + } + *p = c; + if (t) + *e = 0; + append(buf, s); + if (t) + *e = t; + o = get(buf); + x = use(buf); + if ((x = status(buf, o, x, &st)) && (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) + return x; + } while (*p++); + if (must) + report(3, "command not found", s, (unsigned long)0); + return 0; +} + +/* + * generate (if necessary) and read the MAM probe information + * done on the first `setv CC ...' + */ + +static void +probe(void) +{ + register char* cc; + register char* s; + unsigned long h; + unsigned long q; + Buf_t* buf; + Buf_t* pro; + Buf_t* tmp; + struct stat st; + + static char let[] = "ABCDEFGHIJKLMNOP"; + static char cmd[] = "mamprobe"; + + if (!(cc = (char*)search(state.vars, "CC", NiL))) + cc = "cc"; + buf = buffer(); + s = path(buf, cmd, 1); + q = stat(s, &st) ? (unsigned long)0 : (unsigned long)st.st_mtime; + pro = buffer(); + s = cc = path(pro, cc, 1); + for (h = 0; *s; s++) + h = h * 0x63c63cd9L + *s + 0x9c39c33dL; + if (!(s = (char*)search(state.vars, "INSTALLROOT", NiL))) + report(3, "variable must be defined", "INSTALLROOT", (unsigned long)0); + append(buf, s); + append(buf, "/lib/probe/C/mam/"); + for (h &= 0xffffffffL; h; h >>= 4) + add(buf, let[h & 0xf]); + s = use(buf); + h = stat(s, &st) ? (unsigned long)0 : (unsigned long)st.st_mtime; + if (h < q || !push(s, (Stdio_t*)0, 0)) + { + tmp = buffer(); + append(tmp, cmd); + add(tmp, ' '); + append(tmp, s); + add(tmp, ' '); + append(tmp, cc); + if (execute(use(tmp))) + report(3, "cannot generate probe info", s, (unsigned long)0); + drop(tmp); + if (!push(s, (Stdio_t*)0, 0)) + report(3, "cannot read probe info", s, (unsigned long)0); + } + drop(pro); + drop(buf); + make(rule("")); + pop(); +} + +/* + * add attributes in s to r + */ + +static void +attributes(register Rule_t* r, register char* s) +{ + register char* t; + register int n; + + for (;;) + { + for (; *s == ' '; s++); + for (t = s; *s && *s != ' '; s++); + if (!(n = s - t)) + break; + switch (*t) + { + case 'd': + if (n == 8 && !strncmp(t, "dontcare", n)) + r->flags |= RULE_dontcare; + break; + case 'g': + if (n == 9 && !strncmp(t, "generated", n)) + r->flags |= RULE_generated; + break; + case 'i': + if (n == 6 && !strncmp(t, "ignore", n)) + r->flags |= RULE_ignore; + else if (n == 8 && !strncmp(t, "implicit", n)) + r->flags |= RULE_implicit; + break; + case 'v': + if (n == 7 && !strncmp(t, "virtual", n)) + r->flags |= RULE_virtual; + break; + } + } +} + +/* + * define ${mam_libX} for library reference lib + */ + +static char* +require(char* lib, int dontcare) +{ + register int c; + char* s; + char* r; + FILE* f; + Buf_t* buf; + Buf_t* tmp; + struct stat st; + + static int dynamic = -1; + + if (dynamic < 0) + dynamic = (s = search(state.vars, "mam_cc_L", NiL)) ? atoi(s) : 0; + if (!(r = search(state.vars, lib, NiL))) + { + buf = buffer(); + tmp = buffer(); + s = 0; + for (;;) + { + if (s) + append(buf, s); + if (r = search(state.vars, "mam_cc_PREFIX_ARCHIVE", NiL)) + append(buf, r); + append(buf, lib + 2); + if (r = search(state.vars, "mam_cc_SUFFIX_ARCHIVE", NiL)) + append(buf, r); + r = expand(tmp, use(buf)); + if (!stat(r, &st)) + break; + if (s) + { + r = lib; + break; + } + s = "${INSTALLROOT}/lib/"; + if (dynamic) + { + append(buf, s); + if (r = search(state.vars, "mam_cc_PREFIX_SHARED", NiL)) + append(buf, r); + append(buf, lib + 2); + if (r = search(state.vars, "mam_cc_SUFFIX_SHARED", NiL)) + append(buf, r); + r = expand(tmp, use(buf)); + if (!stat(r, &st)) + { + r = lib; + break; + } + } + } + if (r != lib) + r = duplicate(r); + search(state.vars, lib, r); + append(tmp, lib + 2); + append(tmp, ".req"); + if (!(f = fopen(use(tmp), "r"))) + { + append(tmp, "${INSTALLROOT}/lib/lib/"); + append(tmp, lib + 2); + f = fopen(expand(buf, use(tmp)), "r"); + } + if (f) + { + for (;;) + { + while ((c = fgetc(f)) == ' ' || c == '\t' || c == '\n'); + if (c == EOF) + break; + do + { + add(tmp, c); + } while ((c = fgetc(f)) != EOF && c != ' ' && c != '\t' && c != '\n'); + s = use(tmp); + if (s[0] && (s[0] != '-' || s[1])) + { + add(buf, ' '); + append(buf, require(s, 0)); + } + } + fclose(f); + r = use(buf); + } + else if (dontcare) + { + append(tmp, "set -\n"); + append(tmp, "cd \"${TMPDIR:-/tmp}\"\n"); + append(tmp, "echo 'int main(){return 0;}' > x.${!-$$}.c\n"); + append(tmp, "${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c "); + append(tmp, r); + append(tmp, " >/dev/null 2>&1\n"); + append(tmp, "c=$?\n"); + append(tmp, "rm -f x.${!-$$}.[cox]\n"); + append(tmp, "exit $c\n"); + if (execute(expand(buf, use(tmp)))) + r = ""; + } + r = duplicate(r); + search(state.vars, lib, r); + append(tmp, "mam_lib"); + append(tmp, lib + 2); + search(state.vars, use(tmp), r); + drop(tmp); + drop(buf); + } + return r; +} + +/* + * input() until `done r' + */ + +static unsigned long +make(Rule_t* r) +{ + register char* s; + register char* t; + register char* u; + register char* v; + register Rule_t* q; + unsigned long z; + unsigned long x; + Buf_t* buf; + Buf_t* cmd; + + r->making++; + if (r->flags & RULE_active) + state.active++; + if (*r->name) + { + z = bind(r); + state.indent++; + report(-1, r->name, "make", r->time); + } + else + z = 0; + buf = buffer(); + cmd = 0; + while (s = input()) + { + for (; *s == ' '; s++); + for (; isdigit(*s); s++); + for (; *s == ' '; s++); + for (u = s; *s && *s != ' '; s++); + if (*s) + { + for (*s++ = 0; *s == ' '; s++); + for (t = s; *s && *s != ' '; s++); + if (*s) + for (*s++ = 0; *s == ' '; s++); + v = s; + } + else + t = v = s; + switch (KEY(u[0], u[1], u[2], u[3])) + { + case KEY('b','i','n','d'): + if ((t[0] == '-' || t[0] == '+') && t[1] == 'l' && (s = require(t, !strcmp(v, "dontcare"))) && strncmp(r->name, "FEATURE/", 8) && strcmp(r->name, "configure.h")) + for (;;) + { + for (t = s; *s && *s != ' '; s++); + if (*s) + *s = 0; + else + s = 0; + if (*t) + { + q = rule(expand(buf, t)); + attributes(q, v); + x = bind(q); + if (z < x) + z = x; + if (q->flags & RULE_error) + r->flags |= RULE_error; + } + if (!s) + break; + for (*s++ = ' '; *s == ' '; s++); + } + continue; + case KEY('d','o','n','e'): + q = rule(expand(buf, t)); + if (q != r) + report(2, "improper done statement", t, (unsigned long)0); + attributes(r, v); + if (cmd && state.active && (state.force || r->time < z || !r->time && !z)) + { + if (state.explain && !state.force) + { + if (!r->time) + fprintf(stderr, "%s [not found]\n", r->name); + else + fprintf(stderr, "%s [%lu] older than prerequisites [%lu]\n", r->name, r->time, z); + } + substitute(buf, use(cmd)); + x = run(r, use(buf)); + if (z < x) + z = x; + } + r->flags |= RULE_made; + if (!(r->flags & (RULE_dontcare|RULE_error|RULE_exists|RULE_generated|RULE_implicit|RULE_virtual))) + dont(r, 0, state.keepgoing); + break; + case KEY('e','x','e','c'): + r->flags |= RULE_generated; + if (r->path) + { + free(r->path); + r->path = 0; + r->time = 0; + } + if (state.active) + { + if (cmd) + add(cmd, '\n'); + else + cmd = buffer(); + append(cmd, v); + } + continue; + case KEY('m','a','k','e'): + q = rule(expand(buf, t)); + if (!q->making) + { + attributes(q, v); + x = make(q); + if (!(q->flags & RULE_ignore) && z < x) + z = x; + if (q->flags & RULE_error) + r->flags |= RULE_error; + } + continue; + case KEY('p','r','e','v'): + q = rule(expand(buf, t)); + if (!q->making) + { + if (!(q->flags & RULE_ignore) && z < q->time) + z = q->time; + if (q->flags & RULE_error) + r->flags |= RULE_error; + state.indent++; + report(-2, q->name, "prev", q->time); + state.indent--; + } + continue; + case KEY('s','e','t','v'): + if (!search(state.vars, t, NiL)) + { + if (*v == '"') + { + s = v + strlen(v) - 1; + if (*s == '"') + { + *s = 0; + v++; + } + } + search(state.vars, t, duplicate(expand(buf, v))); + } + if (!state.probed && t[0] == 'C' && t[1] == 'C' && !t[2]) + { + state.probed = 1; + probe(); + } + continue; + default: + continue; + } + break; + } + drop(buf); + if (cmd) + drop(cmd); + if (*r->name) + { + report(-1, r->name, "done", z); + state.indent--; + } + if (r->flags & RULE_active) + state.active--; + r->making--; + return r->time = z; +} + +/* + * verify that active targets were made + */ + +static int +verify(Dict_item_t* item, void* handle) +{ + Rule_t* r = (Rule_t*)item->value; + + if ((r->flags & (RULE_active|RULE_error|RULE_made)) == RULE_active) + dont(r, 0, 1); + return 0; +} + +/* + * return 1 if name is an initializer + */ + +static int +initializer(char* name) +{ + register char* s; + + if (s = last(name, '/')) + s++; + else + s = name; + return s[0] == 'I' && s[1] == 'N' && s[2] == 'I' && s[3] == 'T'; +} + +/* + * update recursion leaf r and its prerequisites + */ + +static int +update(register Rule_t* r) +{ + register List_t* x; + Buf_t* buf; + + static char cmd[] = "${MAMAKE} -C "; + static char arg[] = " ${MAMAKEARGS}"; + + r->flags |= RULE_made; + if (r->leaf) + r->leaf->flags |= RULE_made; + for (x = r->prereqs; x; x = x->next) + if (x->rule->leaf && !(x->rule->flags & RULE_made)) + update(x->rule); + buf = buffer(); + substitute(buf, cmd); + append(buf, r->name); + substitute(buf, arg); + run(r, use(buf)); + drop(buf); + return 0; +} + +/* + * scan makefile prereqs + */ + +static int +scan(Dict_item_t* item, void* handle) +{ + register Rule_t* r = (Rule_t*)item->value; + register char* s; + register char* t; + register char* u; + register char* w; + Rule_t* q; + int i; + int j; + int k; + int p; + Buf_t* buf; + + static char* files[] = + { + "Mamfile" + /* ksh 93u+m no longer uses these: + * "Nmakefile", + * "nmakefile", + * "Makefile", + * "makefile" + */ + }; + + /* + * drop non-leaf rules + */ + + if (!r->leaf) + return 0; + + /* + * always make initializers + */ + + if (initializer(r->name)) + { + if (!(r->flags & RULE_made)) + update(r); + return 0; + } + buf = buffer(); + for (i = 0; i < elementsof(files); i++) + { + append(buf, r->name); + add(buf, '/'); + append(buf, files[i]); + if (push(use(buf), (Stdio_t*)0, 0)) + { + while (s = input()) + { + j = p = 0; + while (*s) + { + for (k = 1; (i = *s) == ' ' || i == '\t' || i == '"' || i == '\''; s++); + for (t = s; (i = *s) && i != ' ' && i != '\t' && i != '"' && i != '\'' && i != '\\' && i != ':'; s++) + if (i == '/') + t = s + 1; + else if (i == '.' && *(s + 1) != 'c' && *(s + 1) != 'C' && *(s + 1) != 'h' && *(s + 1) != 'H' && t[0] == 'l' && t[1] == 'i' && t[2] == 'b') + *s = 0; + if (*s) + *s++ = 0; + if (!t[0]) + k = 0; + else if ((t[0] == '-' || t[0] == '+') && t[1] == 'l' && t[2]) + { + append(buf, "lib"); + append(buf, t + 2); + t = use(buf); + } + else if (p) + { + if (t[0] == '+' && !t[1]) + p = 2; + else if (p == 1) + { + if (i != ':' || strncmp(s, "command", 7)) + { + append(buf, "lib"); + append(buf, t); + t = use(buf); + } + if (i == ':') + while (*s && (*s == ' ' || *s == '\t')) + s++; + } + } + else if (i == ':') + { + if (j != ':' || !isupper(*t)) + k = 0; + else if (!strcmp(t, "PACKAGE")) + { + p = 1; + k = 0; + } + else + for (u = t; *u; u++) + if (isupper(*u)) + *u = tolower(*u); + else if (!isalnum(*u)) + { + k = 0; + break; + } + } + else if (t[0] != 'l' || t[1] != 'i' || t[2] != 'b') + k = 0; + else + for (u = t + 3; *u; u++) + if (!isalnum(*u)) + { + k = 0; + break; + } + if (k && ((q = (Rule_t*)search(state.leaf, t, NiL)) && q != r || *t++ == 'l' && *t++ == 'i' && *t++ == 'b' && *t && (q = (Rule_t*)search(state.leaf, t, NiL)) && q != r)) + { + for (t = w = r->name; *w; w++) + if (*w == '/') + t = w + 1; + if (t[0] == 'l' && t[1] == 'i' && t[2] == 'b') + t += 3; + for (u = w = q->name; *w; w++) + if (*w == '/') + u = w + 1; + if (strcmp(t, u)) + cons(r, q); + } + j = i; + } + } + pop(); + for (s = 0, w = r->name; *w; w++) + if (*w == '/') + s = w; + if (s) + { + if ((s - r->name) > 3 && *(s - 1) == 'b' && *(s - 2) == 'i' && *(s - 3) == 'l' && *(s - 4) != '/') + { + /* + * foolib : foo : libfoo + */ + + *(s - 3) = 0; + q = (Rule_t*)search(state.leaf, r->name, NiL); + if (q && q != r) + cons(r, q); + for (t = w = r->name; *w; w++) + if (*w == '/') + t = w + 1; + append(buf, "lib"); + append(buf, t); + q = (Rule_t*)search(state.leaf, use(buf), NiL); + if (q && q != r) + cons(r, q); + *(s - 3) = 'l'; + } + else if (((s - r->name) != 3 || *(s - 1) != 'b' || *(s - 2) != 'i' || *(s - 3) != 'l') && (*(s + 1) != 'l' || *(s + 2) != 'i' || *(s + 3) != 'b')) + { + /* + * huh/foobar : lib/libfoo + */ + + s++; + t = s + strlen(s); + while (--t > s) + { + append(buf, "lib/lib"); + appendn(buf, s, t - s); + q = (Rule_t*)search(state.leaf, use(buf), NiL); + if (q && q != r) + cons(r, q); + } + } + } + break; + } + } + drop(buf); + return 0; +} + +/* + * descend into op and its prereqs + */ + +static int +descend(Dict_item_t* item, void* handle) +{ + Rule_t* r = (Rule_t*)item->value; + + if (!state.active && (!(r->flags & RULE_active) || !(r = (Rule_t*)search(state.leaf, r->name, NiL)))) + return 0; + return r->leaf && !(r->flags & RULE_made) ? update(r) : 0; +} + +/* + * append the non-leaf active targets to state.opt + */ + +static int +active(Dict_item_t* item, void* handle) +{ + Rule_t* r = (Rule_t*)item->value; + + if (r->flags & RULE_active) + { + if (r->leaf || search(state.leaf, r->name, NiL)) + state.active = 0; + else + { + add(state.opt, ' '); + append(state.opt, r->name); + } + } + return 0; +} + +/* + * recurse on mamfiles in subdirs matching pattern + */ + +static int +recurse(char* pattern) +{ + register char* s; + register char* t; + Rule_t* r; + Buf_t* buf; + Buf_t* tmp; + struct stat st; + + /* + * first determine the MAM subdirs + */ + + tmp = buffer(); + buf = buffer(); + state.exec = !state.never; + state.leaf = dictionary(); + append(buf, "ls -d "); + append(buf, pattern); + s = use(buf); + push("recurse", popen(s, "r"), STREAM_PIPE); + while (s = input()) + { + append(buf, s); + add(buf, '/'); + append(buf, mamfile); + if (find(tmp, use(buf), &st)) + { + r = rule(s); + if (t = last(r->name, '/')) + t++; + else + t = r->name; + r->leaf = rule(t); + search(state.leaf, t, r); + } + } + pop(); + drop(buf); + drop(tmp); + + /* + * grab the non-leaf active targets + */ + + if (!state.active) + { + state.active = 1; + walk(state.rules, active, NiL); + } + search(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); + + /* + * scan the makefile and descend + */ + + walk(state.rules, scan, NiL); + state.view = 0; + walk(state.rules, descend, NiL); + return 0; +} + +int +main(int argc, char** argv) +{ + register char** e; + register char* s; + register char* t; + register char* v; + Buf_t* tmp; + int c; + + /* + * initialize the state + */ + + state.id = "mamake"; + state.active = 1; + state.exec = 1; + state.file = mamfile; + state.opt = buffer(); + state.rules = dictionary(); + state.vars = dictionary(); + search(state.vars, "MAMAKE", *argv); + + /* + * parse the options + */ + +#if _PACKAGE_ast + error_info.id = state.id; + for (;;) + { + switch (optget(argv, usage)) + { + case 'e': + append(state.opt, " -e"); + state.explain = 1; + continue; + case 'i': + append(state.opt, " -i"); + state.ignore = 1; + continue; + case 'k': + append(state.opt, " -k"); + state.keepgoing = 1; + continue; + case 'N': + state.never = 1; + /*FALLTHROUGH*/ + case 'n': + append(state.opt, " -n"); + state.exec = 0; + continue; + case 'F': + append(state.opt, " -F"); + state.force = 1; + continue; + case 'K': + continue; + case 'V': + fprintf(stdout, "%s\n", id + 10); + exit(0); + case 'f': + append(state.opt, " -f "); + append(state.opt, opt_info.arg); + state.file = opt_info.arg; + continue; + case 'r': + state.recurse = opt_info.arg; + continue; + case 'C': + state.directory = opt_info.arg; + continue; + case 'D': + append(state.opt, " -D"); + append(state.opt, opt_info.arg); + state.debug = -opt_info.num; + continue; + case 'G': + append(state.opt, " -G"); + search(state.vars, "-debug-symbols", "1"); + continue; + case 'S': + append(state.opt, " -S"); + search(state.vars, "-strip-symbols", "1"); + continue; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + continue; + case ':': + error(2, "%s", opt_info.arg); + continue; + } + break; + } + if (error_info.errors) + error(ERROR_USAGE|4, "%s", optusage(NiL)); + argv += opt_info.index; +#else + while ((s = *++argv) && *s == '-') + { + if (*(s + 1) == '-') + { + if (!*(s + 2)) + { + append(state.opt, " --"); + argv++; + break; + } + for (t = s += 2; *t && *t != '='; t++); + if (!strncmp(s, "debug-symbols", t - s) && append(state.opt, " -G") || !strncmp(s, "strip-symbols", t - s) && append(state.opt, " -S")) + { + if (*t) + { + v = t + 1; + if (t > s && *(t - 1) == '+') + t--; + c = *t; + *t = 0; + } + else + { + c = 0; + v = "1"; + } + search(state.vars, s - 1, v); + if (c) + *t = c; + continue; + } + usage(); + break; + } + for (;;) + { + switch (*++s) + { + case 0: + break; + case 'e': + append(state.opt, " -e"); + state.explain = 1; + continue; + case 'i': + append(state.opt, " -i"); + state.ignore = 1; + continue; + case 'k': + append(state.opt, " -k"); + state.keepgoing = 1; + continue; + case 'N': + state.never = 1; + /*FALLTHROUGH*/ + case 'n': + append(state.opt, " -n"); + state.exec = 0; + continue; + case 'F': + append(state.opt, " -F"); + state.force = 1; + continue; + case 'G': + append(state.opt, " -G"); + search(state.vars, "-debug-symbols", "1"); + continue; + case 'K': + continue; + case 'S': + append(state.opt, " -S"); + search(state.vars, "-strip-symbols", "1"); + continue; + case 'V': + fprintf(stdout, "%s\n", id + 10); + exit(0); + case 'f': + case 'r': + case 'C': + case 'D': + t = s; + if (!*++s && !(s = *++argv)) + { + report(2, "option value expected", t, (unsigned long)0); + usage(); + } + else + switch (*t) + { + case 'f': + append(state.opt, " -f "); + append(state.opt, s); + state.file = s; + break; + case 'r': + state.recurse = s; + break; + case 'C': + state.directory = s; + break; + case 'D': + append(state.opt, " -D"); + append(state.opt, s); + state.debug = -atoi(s); + break; + } + break; + default: + report(2, "unknown option", s, (unsigned long)0); + case '?': + usage(); + break; + } + break; + } + } +#endif + + /* + * load the environment + */ + + for (e = environ; s = *e; e++) + for (t = s; *t; t++) + if (*t == '=') + { + *t = 0; + search(state.vars, s, t + 1); + *t = '='; + break; + } + + /* + * grab the command line targets and variable definitions + */ + + while (s = *argv++) + { + for (t = s; *t; t++) + if (*t == '=') + { + v = t + 1; + if (t > s && *(t - 1) == '+') + t--; + c = *t; + *t = 0; + search(state.vars, s, v); + tmp = buffer(); + append(tmp, s); + append(tmp, ".FORCE"); + search(state.vars, use(tmp), v); + drop(tmp); + *t = c; + break; + } + if (!*t) + { + /* + * handle a few targets for nmake compatibility + */ + + if (*s == 'e' && !strncmp(s, "error 0 $(MAKEVERSION:", 22)) + exit(1); + if (*s == 'r' && !strcmp(s, "recurse") || *s == 'c' && !strncmp(s, "cc-", 3)) + continue; + rule(s)->flags |= RULE_active; + state.active = 0; + if (state.recurse) + continue; + } + add(state.opt, ' '); + add(state.opt, '\''); + append(state.opt, s); + add(state.opt, '\''); + } + + /* + * initialize the views + */ + + if (state.directory && chdir(state.directory)) + report(3, "cannot change working directory", NiL, (unsigned long)0); + view(); + + /* + * recursion drops out here + */ + + if (state.recurse) + return recurse(state.recurse); + + /* + * read the mamfile(s) and bring the targets up to date + */ + + search(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); + push(state.file, (Stdio_t*)0, STREAM_MUST); + make(rule("")); + pop(); + + /* + * verify that active targets were made + */ + + if (!state.active && !state.verified) + walk(state.rules, verify, NiL); + + /* + * done + */ + + return state.errors != 0; +} diff --git a/src/cmd/INIT/mamake.rt b/src/cmd/INIT/mamake.rt new file mode 100644 index 000000000..5f7603d54 --- /dev/null +++ b/src/cmd/INIT/mamake.rt @@ -0,0 +1,40 @@ +NOTE regression tests for the mamake command + +UNIT mamake + +TEST macros + +DATA Mamfile <<'!' +info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 +setv DEFINED defined +setv EMPTY +make all + +exec - echo DEFINED ${DEFINED} +exec - echo DEFINED:VALUE ${DEFINED:VALUE} +exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} +exec - echo DEFINED=VALUE ${DEFINED=VALUE} +exec - echo DEFINED[VALUE] ${DEFINED[VALUE]} +exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]} + +exec - echo EMPTY ${EMPTY} +exec - echo EMPTY:VALUE ${EMPTY:VALUE} +exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} +exec - echo EMPTY=VALUE ${EMPTY=VALUE} +exec - echo EMPTY[VALUE] ${EMPTY[VALUE]} +exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]} + +exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]} +exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VALUE]} + +done all generated virtual +! + +EXEC -n diff --git a/src/cmd/INIT/mamake.tst b/src/cmd/INIT/mamake.tst new file mode 100644 index 000000000..3c7f94d64 --- /dev/null +++ b/src/cmd/INIT/mamake.tst @@ -0,0 +1,63 @@ +# : : generated from mamake.rt by mktest : : # + +# regression tests for the mamake command + +UNIT mamake + +TEST 01 macros + + EXEC -n + INPUT -n - + INPUT Mamfile $'info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 +setv DEFINED defined +setv EMPTY +make all + +exec - echo DEFINED ${DEFINED} +exec - echo DEFINED:VALUE ${DEFINED:VALUE} +exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} +exec - echo DEFINED=VALUE ${DEFINED=VALUE} +exec - echo DEFINED[VALUE] ${DEFINED[VALUE]} +exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]} + +exec - echo EMPTY ${EMPTY} +exec - echo EMPTY:VALUE ${EMPTY:VALUE} +exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} +exec - echo EMPTY=VALUE ${EMPTY=VALUE} +exec - echo EMPTY[VALUE] ${EMPTY[VALUE]} +exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]} + +exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]} +exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VAL'\ +$'UE]} + +done all generated virtual' + OUTPUT - $'echo DEFINED defined +echo DEFINED:VALUE +echo DEFINED:-VALUE +echo DEFINED=VALUE defined +echo DEFINED[VALUE] ${DEFINED[VALUE]} +echo DEFINED.COMPONENT +echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]} +echo EMPTY +echo EMPTY:VALUE ${EMPTY:VALUE} +echo EMPTY:-VALUE ${EMPTY:-VALUE} +echo EMPTY=VALUE +echo EMPTY[VALUE] ${EMPTY[VALUE]} +echo EMPTY.COMPONENT +echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]} +echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]} +echo __NoT_DeFiNeD__.COMPONENT +echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VALUE]}' + ERROR -n - diff --git a/src/cmd/INIT/mamprobe.sh b/src/cmd/INIT/mamprobe.sh new file mode 100644 index 000000000..d3f513fc9 --- /dev/null +++ b/src/cmd/INIT/mamprobe.sh @@ -0,0 +1,273 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +### this script contains archaic constructs that work with all sh variants ### +# mamprobe - generate MAM cc probe info +# Glenn Fowler + +(command set -o posix) 2>/dev/null && set -o posix + +command=mamprobe + +bins=` + ( + userPATH=$PATH + PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH + getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH" + ) | sed 's/:/ /g' +` || exit + +# check the options + +opt= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: mamprobe (AT&T Labs Research) 2011-02-11 $ +] +[+NAME?mamprobe - generate MAM cc probe info] +[+DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1) + probe information for use by \bmamake\b(1). \acc-path\a is the + absolute path of the probed compiler and \ainfo-file\a is where + the information is placed. \ainfo-file\a is usually + \b$INSTALLROOT/lib/probe/C/mam/\b\ahash\a, where \ahash\a is a hash + of \acc-path\a. Any \ainfo-file\a directories are created if needed. + If \ainfo-file\a is \b-\b then the probe information is written to + the standard output.] +[+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of + \bpackage\b(1) installation before \bnmake\b(1) is built. The + probed variable names are the \bnmake\b(1) names with a \bmam_\b + prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b. + Additional variables are:]{ + [+_hosttype_?the \bpackage\b(1) host type] + [+mam_cc_L?\b-L\b\adir\a supported] + [+STDCAT?command to execute for \bcat\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCHMOD?command to execute for \bchmod\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCMP?command to execute for \bcmp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCP?command to execute for \bcp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDED?command to execute for \bed\b(1) or \bex\b(1)] + [+STDEDFLAGS?flags for \bSTDED\b] + [+STDLN?command to execute for \bln\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDMV?command to execute for \bmv\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDRM?command to execute for \brm\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] +} +[d:debug?Enable probe script debug trace.] + +info-file cc-path + +[+SEE ALSO?\bexecrate\b(1), \bpackage\b(1), \bmamake\b(1), \bnmake\b(1), + \bprobe\b(1)] +' + while getopts -a "$command" "$USAGE" OPT + do case $OPT in + d) opt=-d ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + -) break + ;; + -d) opt=-d + ;; + -*) echo $command: $1: unknown option >&2 + ;; + *) break + ;; + esac + set '' + break + done + ;; +esac + +# check the args + +case $1 in +-) ;; +/*) ;; +*) set '' ;; +esac +case $2 in +/*) ;; +*) set '' ;; +esac +case $# in +0|1) echo "Usage: $command info-file cc-path" >&2; exit 2 ;; +esac +info=$1 +shift +cc=$* + +# find the make probe script + +ifs=${IFS-' + '} +IFS=: +set $PATH +IFS=$ifs +script=lib/probe/C/make/probe +while : +do case $# in + 0) echo "$0: ../$script: probe script not found on PATH" >&2 + exit 1 + ;; + esac + case $1 in + '') continue ;; + esac + makeprobe=`echo $1 | sed 's,[^/]*$,'$script,` + if test -x $makeprobe + then break + fi + shift +done + +# create the info dir if necessary + +case $info in +/*) i=X$info + ifs=${IFS-' + '} + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $info in + //*) path=/ ;; + *) path= ;; + esac + while : + do case $# in + 0|1) break ;; + esac + comp=$1 + shift + case $comp in + '') continue ;; + esac + path=$path/$comp + if test ! -d $path + then mkdir $path || exit + fi + done + ;; +esac + +# generate info in a tmp file and rename when finished + +case $info in +-) ;; +*) tmp=${TMPDIR:-/tmp}/mam$$ + trap "exec >/dev/null; rm -f $tmp" 0 1 2 3 15 + exec > $tmp + echo "probing C language processor $cc for mam information" >&2 + ;; +esac + +echo "note generated by $0 for $cc" + +( + set '' $opt $cc + shift + . $makeprobe "$@" + + case " $CC_DIALECT " in + *" -L "*) echo "CC.L = 1" ;; + esac + +) | sed \ + -e '/^CC\./!d' \ + -e 's/^CC./setv mam_cc_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/ =//' \ + -e 's/\$("\([^"]*\)")/\1/g' \ + -e 's/\$(\([^)]*\))/${\1}/g' \ + -e 's/\${CC\./${mam_cc_}/g' + +echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}' + +# STD* are standard commands/flags with possible execrate(1) + +if ( +ed < /dev/null 2>&1 +then STDED=ed +else STDED=ex +fi +STDEDFLAGS=- +set STDCAT cat STDCHMOD chmod STDCMP cmp STDCP cp STDLN ln STDMV mv STDRM rm +while : +do case $# in + 0|1) break ;; + esac + p=$2 + for d in $bins + do if test -x $d/$p + then p=$d/$p + break + fi + done + eval $1=\$p + shift + shift +done +if execrate +then for n in STDCAT STDCHMOD STDCMP STDCP STDLN STDMV STDRM + do eval $n=\"execrate \$$n\" + done +fi +for n in STDCAT STDCHMOD STDCMP STDCP STDED STDEDFLAGS STDLN STDMV STDRM +do eval echo setv \$n \$$n +done + +# all done + +case $info in +-) ;; +*) exec >/dev/null + test -f "$info" && rm -f "$info" + cp "$tmp" "$info" + chmod -w "$info" + ;; +esac diff --git a/src/cmd/INIT/mkdir.sh b/src/cmd/INIT/mkdir.sh new file mode 100644 index 000000000..78830f1e9 --- /dev/null +++ b/src/cmd/INIT/mkdir.sh @@ -0,0 +1,83 @@ +#!/bin/sh +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: mkdir for systems that do not support -p : 2002-09-01 : + +(command set -o posix) 2>/dev/null && set -o posix + +MKDIR=mkdir +CHMOD=chmod +mode= +parents= +while : +do case $1 in + -m) case $# in + 1) echo "mkdir: -m: mode argument expected" >&2 + exit 1 + ;; + esac + shift + mode=$1 + ;; + -m*) mode=`echo X$1 | sed 's/X-m//'` + ;; + -p) parents=1 + ;; + *) break + ;; + esac + shift +done +if test "" != "$parents" +then for d + do if test ! -d $d + then ifs=${IFS-' + '} + IFS=/ + set '' $d + IFS=$ifs + shift + dir=$1 + shift + if test -n "$dir" -a ! -d "$dir" + then $MKDIR "$dir" || exit 1 + if test "" != "$mode" + then $CHMOD "$mode" "$dir" || exit 1 + fi + fi + for d + do dir=$dir/$d + if test ! -d "$dir" + then $MKDIR "$dir" || exit 1 + if test "" != "$mode" + then $CHMOD "$mode" "$dir" || exit 1 + fi + fi + done + fi + done +else $MKDIR "$@" || exit 1 + if test "" != "$mode" + then for d + do $CHMOD "$mode" "$d" || exit 1 + done + fi +fi +exit 0 diff --git a/src/cmd/INIT/mktest.sh b/src/cmd/INIT/mktest.sh new file mode 100755 index 000000000..f24183eed --- /dev/null +++ b/src/cmd/INIT/mktest.sh @@ -0,0 +1,641 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: mktest - generate regress or shell regression test scripts + +command=mktest +stdin=8 +stdout=9 +PREFIX=test +STYLE=regress +WIDTH=80 + +eval "exec $stdout>&1" + +case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: mktest (AT&T Labs Research) 2010-08-11 $ +] +'$USAGE_LICENSE$' +[+NAME?mktest - generate a regression test scripts] +[+DESCRIPTION?\bmktest\b generates regression test scripts from test + template commands in the \aunit\a.\brt\b file. The generated test + script writes temporary output to '$PREFIX$'\aunit\a.tmp and compares + it to the expected output in '$PREFIX$'\aunit\a.out. Run the test + script with the \b--accept\b option to (re)generate the + '$PREFIX$'\aunit\a.out.] +[s:style?The script style:]:[style:='$STYLE$'] + { + [+regress?\bregress\b(1) command input.] + [+shell?Standalone test shell script.] + } +[w:width?Set the output format width to approximately + \awidth\a.]:[width:='$WIDTH$'] + +unit.rt [ unit [ arg ... ] ] + +[+INPUT FILES?The regression test command file \aunit\a\b.rt\b is a + \bksh\b(1) script that makes calls to the following functions:] + { + [+DATA \afile\a [ - | [ options ]] data]]?Create input data + \afile\a that is empty (-) or contains \adata\a subject to + \bprint\b(1) \aoptions\a or that is a copy of the DATA command + standard input. Set \afile\a to \b-\b to name the standard + input.] + [+DIAGNOSTICS?Diagnostic messages of unspecified format are + expected.] + [+DO \acommand\a [ \aarg\a ... ]]?Execute \acommand\a if the + current test is active.] + [+EXEC [ \aarg\a ... ]]?Run the command under test with + optional arguments. If the standard input is not specified then + the standard input of the previous EXEC is used. The standard + input of the first EXEC in a TEST group is an empty regular + file.] + [+EXPORT \aname\a=\avalue\a ...?Export list for subsequent + commands in the TEST group or for all TEST groups if before + the first TEST group.] + [+IGNORESPACE [ 0 | 1 ] + ?Ignore space differences when comparing expected output.] + [+KEEP \apattern\a ...?File match patterns of files to retain + between TEST groups.] + [+NOTE \acomment\a?\acomment\a is added to the current test + script.] + [+PROG \acommand\a [ \aarg\a ... ]]?Run \acommand\a with + optional arguments.] + [+TEST [ \anumber\a ]] [ \adescription\a ... ]]?Define a new + test group with optional \anumber\a and \adescripion\a.] + [+TWD [ \adir\a ... ]]?Set the temporary test dir to \adir\a. + The default is \aunit\a\b.tmp\b, where \aunit\a is the test + input file sans directory and suffix. If \adir\a matches \b/*\b + then it is the directory name; if \adir\a is non-null then the + prefix \b${TMPDIR:-/tmp}\b is added; otherwise if \adir\a is + omitted then + \b${TMPDIR:-/tmp}/tst-\b\aunit\a-$$-$RANDOM.\b\aunit\a is + used.] + [+UMASK [ \amask\a ]]?Run subsequent tests with \bumask\b(1) + \amask\a. If \amask\a is omitted then the original \bumask\b is + used.] + [+UNIT \acommand\a [ \aarg\a ... ]]?Define the command and + optional default arguments to be tested. \bUNIT\b explicitly + overrides the default command name derived from the test script + file name.] + [+WIDTH \awidth\a?Set the output format width to approximately + \awidth\a.] + } +[+SEE ALSO?\bregress\b(1), \bksh\b(1)] +' + ;; +*) ARGV0="" + USAGE='s: unit.rt [ arg ... ]' + ;; +esac + +typeset ARG SCRIPT UNIT TEMP=${TMPDIR:-/tmp}/$command.$$.tmp WORK +typeset IO INPUT INPUT_N OUTPUT OUTPUT_N ERROR ERROR_N KEEP +typeset -C STATE +typeset -A DATA STATE.RESET REMOVE FORMAT +integer KEEP_UNIT=0 SCRIPT_UNIT=0 TEST=0 CODE=0 EXIT=0 ACCEPT=0 DIAGNOSTICS=0 code + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + s) case $OPTARG in + regress|shell) + STYLE=$OPTARG + ;; + *) print -u2 -r -- $command: --style=$OPTARG: regress or shell expected + exit 1 + ;; + esac + ;; + w) WIDTH=$OPTARG + ;; + *) OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 + ;; + esac +done +shift $OPTIND-1 + +typeset SINGLE= quote='%${SINGLE}..${WIDTH}q' + +if [[ $1 == - ]] +then shift +fi +if (( ! $# )) +then + print -u2 -r -- $command: test command script path expected + exit 1 +fi +SCRIPT=$1 +shift +if [[ ! -r $SCRIPT ]] +then print -u2 -r -- $command: $SCRIPT: cannot read + exit 1 +fi +(ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0 +if (( $# )) +then set -A UNIT -- "$@" + KEEP_UNIT=1 +else ARG=${SCRIPT##*/} + set -A UNIT -- "${ARG%.*}" +fi +WORK=${UNIT[0]}.tmp +rm -rf $WORK +mkdir $WORK || exit +export PATH=$PWD:$PATH + +function LINE +{ + if [[ $STYLE == regress ]] + then print -u$stdout + fi +} + +function NOTE +{ + case $STYLE in + regress)LINE + print -u$stdout -r -- '#' "$@" + ;; + shell) print -u$stdout -r -f ": $QUOTE"$'\n' -- "$*" + ;; + esac +} + +function UNIT +{ + (( KEEP_UNIT )) || set -A UNIT -- "$@" + case $STYLE in + regress)LINE + print -u$stdout -r -f $'UNIT' + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + print -u$stdout + ;; + shell) print -u$stdout -r -f $'set x' + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + print -u$stdout + print -u$stdout shift + ;; + esac +} + +function TEST +{ + typeset i + typeset -A REM + if (( ${#STATE.RESET[@]} )) + then unset ${!STATE.RESET[@]} + case $STYLE in + shell) print -u$stdout -r -- unset ${!STATE.RESET[@]} ;; + esac + unset STATE.RESET + typeset -A STATE.RESET + fi + if (( ${#REMOVE[@]} )) + then rm -f -- "${!REMOVE[@]}" + case $STYLE in + shell) print -u$stdout -r -f $'rm -f' + for i in ${!REMOVE[@]} + do print -u$stdout -r -f " $QUOTE" "$i" + done + print -u$stdout + ;; + esac + for i in ${!REMOVE[@]} + do unset REMOVE[$i] + done + fi + rm -rf $WORK/* + if [[ $1 == +([0-9]) ]] + then TEST=${1##0} + shift + else ((TEST++)) + fi + LINE + case $STYLE in + regress)print -u$stdout -r -f "TEST %02d $QUOTE"$'\n' -- $TEST "$*" + ;; + shell) print -u$stdout -r -f ": TEST %02d $QUOTE"$'\n' -- $TEST "$*" + ;; + esac + : > $TEMP.INPUT > $TEMP.in + INPUT= + INPUT_N= + OUTPUT= + OUTPUT_N= + ERROR= + ERROR_N= + UMASK=$UMASK_ORIG + UMASK_DONE=$UMASK + CODE=0 +} + +function TWD +{ + case $STYLE in + regress)LINE + print -u$stdout -r -f $'TWD' + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + print -u$stdout + ;; + esac +} + +function RUN +{ + typeset i n p op unit sep output=1 error=1 exitcode=1 + op=$1 + shift + while : + do case $1 in + ++NOOUTPUT) output= ;; + ++NOERROR) error= ;; + ++NOEXIT) exitcode= ;; + ++*) print -u2 -r -- $command: $0: $1: unknown option; exit 1 ;; + *) break ;; + esac + shift + done + if [[ $op == PROG ]] + then unit=$1 + shift + elif (( ! ${#UNIT[@]} )) + then print -u2 -r -- $command: $SCRIPT: UNIT statement or operand expected + exit 1 + fi + LINE + case $STYLE in + regress)if [[ $op == PROG ]] + then print -u$stdout -r -f $'\t'"$op"$'\t'"$unit" + sep=$' ' + else print -u$stdout -r -f $'\t'"$op" + sep=$'\t' + fi + for ARG in "$@" + do LC_CTYPE=C print -u$stdout -r -f "$sep$QUOTE" -- "$ARG" + sep=$' ' + done + print -u$stdout + [[ ${DATA[-]} || /dev/fd/0 -ef /dev/fd/$stdin ]] || cat > $TEMP.in + IO=$(cat $TEMP.in; print :) + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + { + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK + cd $WORK + if [[ $op == PROG ]] + then "$unit" "$@" + code=$? + else "${UNIT[@]}" "$@" + code=$? + fi + cd .. + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG + } < $TEMP.in > $TEMP.out 2> $TEMP.err + if [[ $IO != "$INPUT" || $n != "$INPUT_N" ]] + then INPUT=$IO + INPUT_N=$n + if [[ ${FORMAT[-]} ]] + then print -u$stdout -n -r -- $'\t\tINPUT' + print -u$stdout -r -f " $QUOTE" -- "${FORMAT[-]}" + print -u$stdout -r -f " $QUOTE" -- - + unset FORMAT[-] + else print -u$stdout -n -r -- $'\t\tINPUT' $n - + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + fi + print -u$stdout + unset DATA[-] + fi + for i in ${!DATA[@]} + do if [[ ${FORMAT[$i]} ]] + then print -u$stdout -n -r -- $'\t\tINPUT' + print -u$stdout -r -f " $QUOTE" -- "${FORMAT[$i]}" + print -u$stdout -r -f " $QUOTE" -- "$i" + unset FORMAT[$i] + else case $i in + -) p=$TEMP.in ;; + *) p=$WORK/$i ;; + esac + IO=$(cat $p; print :) + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + print -u$stdout -n -r -- $'\t\tINPUT' $n + print -u$stdout -r -f " $QUOTE" -- "$i" + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + fi + print -u$stdout + unset DATA[$i] + done + IO=$(cat $TEMP.out; print :) + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + if [[ $IO != "$OUTPUT" || $n != "$OUTPUT_N" ]] + then OUTPUT=$IO + OUTPUT_N=$n + if [[ $output ]] + then if [[ ! -s $TEMP.out ]] + then print -u$stdout -n -r -- $'\t\tOUTPUT' - + elif cmp -s $TEMP.in $TEMP.out + then OUTPUT=not-$OUTPUT + print -u$stdout -n -r -- $'\t\tSAME OUTPUT INPUT' + else print -u$stdout -n -r -- $'\t\tOUTPUT' $n - + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + fi + print -u$stdout + fi + fi + IO=$(cat $TEMP.err; print :) + IO=${IO//$command\[*([0-9])\]:\ .\[*([0-9])\]:\ @(EXEC|PROG)\[*([0-9])\]:\ /} + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + if [[ $IO != "$ERROR" || $n != "$ERROR_N" ]] + then ERROR=$IO + ERROR_N=$n + if [[ $error ]] + then print -u$stdout -n -r -- $'\t\tERROR' $n - + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + print -u$stdout + fi + fi + case $output:$error in + :) OUTPUT= + OUTPUT_N= + ERROR= + ERROR_N= + print -u$stdout -r -- $'\t\tIGNORE OUTPUT ERROR' + ;; + :1) OUTPUT= + OUTPUT_N= + print -u$stdout -r -- $'\t\tIGNORE OUTPUT' + ;; + 1:) ERROR= + ERROR_N= + print -u$stdout -r -- $'\t\tIGNORE ERROR' + ;; + esac + if [[ $UMASK_DONE != $UMASK ]] + then UMASK_DONE=$UMASK + print -u$stdout -r -f $'\t\tUMASK %s\n' $UMASK + fi + if (( code != CODE )) + then (( CODE=code )) + if [[ $exitcode ]] + then print -u$stdout -r -f $'\t\tEXIT %d\n' $CODE + fi + fi + ;; + shell) [[ $UMASK != $UMASK_ORIG ]] && print -u$stdout -r -f "{ umask $UMASK; " + if [[ $op == PROG ]] + then print -u$stdout -r -f $'"'"$unit"$'"' + else print -u$stdout -r -f $'"$@"' + fi + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + [[ $UMASK != $UMASK_ORIG ]] && print -u$stdout -r -f "umask $UMASK_ORIG; } " + if [[ ! $output ]] + then print -u$stdout -r -f " >/dev/null" + fi + if [[ ! $error ]] + then if [[ ! $output ]] + then print -u$stdout -r -f " 2>&1" + else print -u$stdout -r -f " 2>/dev/null" + fi + fi + IO=$(cat) + if [[ $IO ]] + then print -u$stdout -r -- "<<'!TEST-INPUT!'" + print -u$stdout -r -- "$IO" + print -u$stdout -r -- !TEST-INPUT! + else print -u$stdout + fi + if [[ $exitcode ]] + then print -u$stdout -r -- $'CODE=$?\ncase $CODE in\n0) ;;\n*) echo exit status $CODE ;;\nesac' + fi + ;; + esac +} + +function DO +{ + LINE + print -r $'\t'DO "$@" +} + +function EXEC +{ + RUN EXEC "$@" +} + +function DATA +{ + typeset f p o + f=$1 + shift + case $f in + -) p=$TEMP.in ;; + *) p=$WORK/$f ;; + esac + case $1 in + '') cat ;; + -) ;; + *) print -r "$@" ;; + esac > $p + DATA[$f]=1 + if (( $# == 1 )) && [[ $1 == -?* ]] + then FORMAT[$f]=$1 + else FORMAT[$f]= + fi + if [[ $f != $KEEP ]] + then REMOVE[$f]=1 + fi + if [[ $STYLE == shell ]] + then { + print -r -f "cat > $QUOTE <<'!TEST-INPUT!'"$'\n' -- "$f" + cat "$p" + print -r -- !TEST-INPUT! + } >&$stdout + fi +} + +function KEEP +{ + typeset p + for p + do if [[ $KEEP ]] + then KEEP=$KEEP'|' + fi + KEEP=$KEEP$p + done +} + +function DIAGNOSTICS +{ + LINE + case $STYLE in + regress) print -u$stdout -r $'DIAGNOSTICS' ;; + shell) DIAGNOSTICS=1 ;; + esac +} + +function EXPORT +{ + typeset x n v + LINE + case $STYLE in + regress) print -u$stdout -r -f $'EXPORT' ;; + shell) print -u$stdout -r -f $'export' ;; + esac + for x + do n=${x%%=*} + v=${x#*=} + export "$x" + print -u$stdout -r -f " %s=$QUOTE" "$n" "$v" + (( TEST )) && STATE.RESET["$n"]=1 + done + print -u$stdout +} + +function PROG +{ + RUN PROG "$@" +} + +function WIDTH +{ + WIDTH=${1:-80} + eval QUOTE='"'$quote'"' +} + +function IGNORESPACE +{ + IGNORESPACE=-b + LINE + print -u$stdout -r IGNORESPACE +} + +function UMASK # [ mask ] +{ + [[ $UMASK_ORIG ]] || UMASK_ORIG=$(umask) + UMASK=$1 + [[ $UMASK ]] || UMASK=$UMASK_ORIG +} + +trap 'CODE=$?; rm -rf $TEMP.* $WORK; exit $CODE' 0 1 2 3 15 + +typeset IGNORESPACE UMASK UMASK_ORIG UMASK_DONE +UMASK_ORIG=$(umask) +IFS=$IFS$'\n' + +print -u$stdout -r "# : : generated from $SCRIPT by $command : : #" +case $STYLE in +shell) cat <&2 <&2 + exit 1 + ;; + *) break + ;; + esac + shift +done +export COLUMNS=80 +{ +! + ;; +esac + +export COLUMNS=80 + +case $STYLE in +shell) SINGLE='#' + eval QUOTE='"'$quote'"' + . $SCRIPT < /dev/null | sed -e $'s,\\\\n,\n,g' -e $'s,\\\\t,\t,g' -e $'s,\\$\',\',g' + ;; +*) eval QUOTE='"'$quote'"' + : > $TEMP.INPUT > $TEMP.in + eval "exec $stdin<$TEMP.INPUT" + . $SCRIPT <&$stdin + ;; +esac + +case $STYLE in +shell) cat < $PREFIX${UNIT[0]}.tmp 2>&1 < /dev/null +case \$ACCEPT in +0) if grep ' $' $PREFIX${UNIT[0]}.tmp >/dev/null + then mv $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.junk + sed 's/ $//' < $PREFIX${UNIT[0]}.junk > $PREFIX${UNIT[0]}.tmp + rm -f $PREFIX${UNIT[0]}.junk + fi + if cmp -s $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.out + then echo ${UNIT[0]} tests PASSED + rm -f $PREFIX${UNIT[0]}.tmp + else echo ${UNIT[0]} tests FAILED + diff $IGNORESPACE $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.out + fi + ;; + +*) mv $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.out + ;; +esac +! + ;; +esac diff --git a/src/cmd/INIT/mprobe.sh b/src/cmd/INIT/mprobe.sh new file mode 100644 index 000000000..975ebb1c2 --- /dev/null +++ b/src/cmd/INIT/mprobe.sh @@ -0,0 +1,30 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: mam probe script +opt= +while : +do case $1 in + -d) opt=-d ;; + -*) ;; + *) break ;; + esac + shift +done +mamprobe $opt - "$1" diff --git a/src/cmd/INIT/nsl.c b/src/cmd/INIT/nsl.c new file mode 100644 index 000000000..e961e0108 --- /dev/null +++ b/src/cmd/INIT/nsl.c @@ -0,0 +1,31 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lnsl + */ + + +extern void* gethostbyname(); + +int +main() +{ + return gethostbyname(0) == 0; +} diff --git a/src/cmd/INIT/p.c b/src/cmd/INIT/p.c new file mode 100644 index 000000000..387c4bbf4 --- /dev/null +++ b/src/cmd/INIT/p.c @@ -0,0 +1,24 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for prototyping cc + */ + +int main(int argc, char** argv) { return argc || argv; } diff --git a/src/cmd/INIT/package.mk b/src/cmd/INIT/package.mk new file mode 100644 index 000000000..1a945d9fe --- /dev/null +++ b/src/cmd/INIT/package.mk @@ -0,0 +1,1537 @@ +/* + * source and binary package support + * + * @(#)package.mk (AT&T Research) 2012-02-14 + * + * usage: + * + * cd $INSTALLROOT/lib/package + * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type + * + * where: + * + * name package description file or component + * + * type source build source archive, generates + * $(PACKAGEDIR)/name.version.release.suffix + * binary build binary archive, generates + * $(PACKAGEDIR)/name.version.hosttype.release.suffix + * runtime build binary archive, generates + * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix + * + * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views + * + * generated archive member files are $(PACKAGEROOT) relative + * + * main assertions: + * + * NAME [ name=value ] :PACKAGE: component ... + * :OMIT: component ... + * :LICENSE: license-class-pattern + * :CATEGORY: category-id ... + * :COVERS: package ... + * :REQUIRES: package ... + * :INDEX: index description line + * :DESCRIPTION: + * [ verbose description ] + * :DETAILS: style + * :README: + * readme lines + * :EXPORT: + * name=value + * target :INSTALL: [ source ] + * + * option variables, shown with default values + * + * format=tgz + * archive format + * + * version=YYYY-MM-DD + * package base version (overrides current date) + * + * release=YYYY-MM-DD + * package delta release (overrides current date) + * + * license=type.class + * :LICENSE: type.class pattern override + * + * notice=1 + * include the conspicuous empty notice file + * + * copyright=0 + * do not prepend source file copyright notice + * + * strip=0 + * don't strip non-lcl binary package members + * + * variants=pattern + * include variants matching pattern in binary packages + * + * incremental=[source:1 binary:0] + * if a base archive is generated then also generate an + * incremental delta archive from the previous base + * + * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when + * a target is specified + */ + +/* these are ast centric -- we'll parameterize another day */ + +org = ast +url = http://www.research.att.com/sw/download + +/* generic defaults */ + +base = +category = utils +checksum = md5 +closure = +copyright = 1 +delta = +format = tgz +incremental = +index = +init = INIT +license = +licenses = $(org) +mamfile = 1 +opt = +name = +notice = +release = +strip = 0 +style = tgz +suffix = tgz +type = +variants = !(cc-g) +vendor = +version = $("":T=R%Y-%m-%d) + +SUM = sum + +package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------ + +package.readme = $(@.package.readme.) + +.package.readme. : + This is a package root directory $PACKAGEROOT. Source and binary + packages in this directory tree are controlled by the command + $() + bin/package + $() + Binary files may be in this directory or in the install root directory + $() + INSTALLROOT=$PACKAGEROOT/arch/`bin/package` + $() + For more information run + $() + bin/package help + $() + Many of the packaged commands self-document via the --man and --html + options; those that do have no separate man page. + $() + Each package is covered by one of the license files + $() + $(PACKAGELIB)/LICENSES/ + $() + where is the license type for the package. At the top + of each license file is a URL; the license covers all software that + refers to this URL. For details run + $() + bin/package license [] + $() + Any archives, distributions or packages made from source or + binaries covered by license(s) must contain the corresponding + license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?) + +.package.licenses. : .FUNCTION + local I F L R T all save text + L := $(%) + while L == "--*" + I := $(L:O=1) + if I == "--all" + all = 1 + elif I == "--save" + save = 1 + elif I == "--text" + text = 1 + end + L := $(L:O>1) + end + if "$(L)" == "*-*" + L += $(L:/[^-]*-//) $(L:/-.*//) + end + L += $(licenses) + for I $(L:U) + if I == "gpl" + I = gnu + all = + end + if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)" + R += $(F) + if save || text + T := $(.FIND. lib/package .lic $(F):P=W,query=type) + R += $(T:D=$(PACKAGESRC)/LICENSES:B) + end + if save + R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F) + elif ! all + break + end + end + end + return $(R) + +/* + * glob(3) doesn't handle / in alternation -- should it? + */ + +.package.glob. : .FUNCTION + local A D I P S + for I $(%) + if I == "*/*" + D := $(I:C,/.*,,) + if ! "$(A:N=$(D))" + local S.$(D) + A += $(D) + end + S.$(D) += $(I:C,[^/]*/,,) + else + P := $(P)$(S)$(I) + end + S = | + end + if P == "*\|*" + P := ($(P)) + end + for I $(A) + P += $(I)/$(.package.glob. $(S.$(I))) + end + return $(P) + + +.MAKEINIT : .package.init + +.package.init : .MAKE .VIRTUAL .FORCE + local V + V := $(VROOT:T=F:P=L*) + if ! PACKAGEROOT + PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1) + end + if V == "$(PACKAGEROOT)" + V := + end + V += $(INSTALLROOT) $(PACKAGEROOT) + PACKAGEVIEW := $(V:H=RU) + INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + if license + license := $(license)|none.none + end + +PACKAGELIB = lib/package +PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB) +PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB) +PACKAGEDIR = $(PACKAGESRC)/$(style) +INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + +package.omit = -|*/$(init) +package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G)) +package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??) +package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.closure = $(closure:?$$(package.all)?$$(package.pkg)?) + +package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B) +package.ini = ignore mamprobe manmake package silent +package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg)) +package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name)) +package.bin = $(PACKAGEBIN)/$(name).ini + +package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test + +op = current +stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] +source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix) +binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix) +old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) +old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) + +source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R) +binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R) +runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>) + +source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F) +binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F) + +$(init) : .VIRTUAL $(init) + +package.requires = 0 + +":package:" : .MAKE .OPERATOR + local P I R V + P := $(<:O=1) + $(P) : $(>:V) + if ! package.requires + if ! name + name := $(P) + .PACKAGE. := $(P) + if name == "$(init)" + package.omit = - + package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk + else + $(P) : $(package.init) + end + for I $(<:O>1) + if I == "*=*" + eval + $(I) + end + else + version := $(I) + end + end + LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G) + export LICENSEFILEDEFAULT + end + if "$(>)" + for I $(>:V) + $(I) : .VIRTUAL + if I == "/*" + package.dir += $(I:V) + end + end + end + if "$(@)" + $(P).README := $(@) + else + $(P).README := This is the $(P) package. + end + end + +":AUXILIARY:" : .MAKE .OPERATOR + package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F) + +":CATEGORY:" : .MAKE .OPERATOR + if ! package.requires + category := $(>) + end + +.covers. : .FUNCTION + local I C D F K=0 L + for I $(%) + if ! "$(~covers:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if D = "$(F:T=I)" + covers : $(I:B) + for L $(D) + if L == ":COVERS:" + K = 1 + elif L == ":*:" + if K + break + end + elif K + : $(.covers. $(L)) + end + end + end + else + error $(--exec:?3?1?) $(I): unknown package $(I) + end + end + end + +":COVERS:" : .MAKE .OPERATOR + if ! package.requires + : $(.covers. $(>)) + end + +":DESCRIPTION:" : .MAKE .OPERATOR + if ! package.requires + $(name).README := $(@:V) + end + +":DETAILS:" : .MAKE .OPERATOR + if ! package.requires + details.$(>:O=1) := $(@:V) + end + +":EXPORT:" : .MAKE .OPERATOR + if ! package.requires + export.$(style) := $(@:/$$("\n")/ /G) + end + +":INDEX:" : .MAKE .OPERATOR + if ! package.requires + index := $(>) + end + +":INSTALL:" : .MAKE .OPERATOR + if ! package.requires + local T S F X + S := $(>) + T := $(<) + if "$(exe.$(style))" && "$(T)" == "bin/*([!./])" + T := $(T).exe + end + if ! "$(S)" + S := $(T) + elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])" + S := $(S).exe + end + install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@ + if strip && "$(T:N=*.exe)" + install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null + end + X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S) + if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)" + F := filter $(STRIP) $(STRIPFLAGS) $(X) + end + if "$(filter.$(style):V)" + filter.$(style) := $(filter.$(style):V)$$("\n") + end + filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T) + end + +":LICENSE:" : .MAKE .OPERATOR + if ! package.requires && ! license + license := $(>) + end + +":OMIT:" : .MAKE .OPERATOR + if ! package.requires + package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G) + end + +":POSTINSTALL:" : .MAKE .OPERATOR + if ! package.requires + postinstall.$(style) := $(@:V) + end + +":README:" : .MAKE .OPERATOR + if ! package.requires + readme.$(style) := $(@:V) + end + +.requires. : .FUNCTION + local I C D F K=0 L V T M=0 + for I $(%) + if ! "$(~requires:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if I == "$(init)" + package.omit = - + else + requires : $(I:B) + end + if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)" + req : $(I:B) + else + error 1 $(I): package should be written before $(P) + end + let package.requires = package.requires + 1 + include "$(F)" + let package.requires = package.requires - 1 + else + error 1 $(I): package not found + end + end + end + +":REQUIRES:" : .MAKE .OPERATOR + : $(.requires. $(>)) + +":TEST:" : .MAKE .OPERATOR + if ! package.requires + local T + T := $(>) + if "$(T)" == "bin/*([!./])" + if "$(exe.$(style))" + T := $(T).exe + end + T := $$(PWD)/$$(ARCH)/$(T) + end + test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@) + end + +base delta : .MAKE .VIRTUAL .FORCE + op := $(<) + +closure : .MAKE .VIRTUAL .FORCE + $(<) := 1 + +cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE + style := $(<) + +source : .source.init .source.gen .source.$$(style) + +.source.init : .MAKE + local A B D P V I + type := source + if ! "$(incremental)" + incremental = 1 + end + if "$(source.$(name))" + suffix = c + end + : $(.init.$(style)) + : $(details.$(style):V:R) : + A := $(source.list) + B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + deltaversion := $(B:B:/$(name).//) + let deltasince = $(deltaversion:/.*-//) + 1 + deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + source := $(B:D:B:S=.$(release).$(suffix)) + version := $(source:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "$(stamp)" && V != "$(version)" + old.version := $(V) + old.source := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + source := $(B) + end + if B == "$(source)" + if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html + +BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1) + +$$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE + [[ -d $(<) ]] || mkdir $(<) + +$$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE) + $(*) html source > $(<) + +$$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE) + $(*) html binary > $(<) + +$$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE) + $(*) html intro > $(<) + +.source.exp .source.pkg .source.rpm : .MAKE + error 3 $(style): source package style not supported yet + +exe.cyg = .exe +vendor.cyg = gnu + +.name.cyg : .FUNCTION + local N + N := $(%) + if N == "*-*" + vendor := $(N:/-.*//) + if vendor == "$(vendor.cyg)" + vendor := + N := $(N:/[^-]*-//) + end + N := $(N:/-//G) + end + return $(N) + +.init.cyg : .FUNCTION + local N O + closure = 1 + init = . + strip = 1 + suffix = tar.bz2 + format = tbz + vendor := $(licenses:N!=$(vendor.cyg):O=1) + package.ini := $(package.ini) + package.src.pat := $(package.src.pat) + package.src := $(package.src) + package.bin := $(package.bin) + .source.gen : .CLEAR $(*.source.gen:V:N!=*.html) + name.original := $(name) + name := $(.name.cyg $(name)) + if name != "$(name.original)" + $(name) : $(~$(name.original)) + O := $(~covers) + covers : .CLEAR + for N $(O) + covers : $(.name.cyg $(N)) + end + end + stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9] + version.original := $(version) + version := $(version:/-//G)-1 + if opt + opt := $(opt)/$(vendor)/ + else + opt := $(name)-$(version)/ + end + if type == "source" + version := $(version)-src + source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + else + binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + end + +.source.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + cat > $tmp/configure <<'!' + echo "you didn't have to do that" + ! + chmod +x $tmp/configure + echo ";;;$tmp/configure;configure" + cat > $tmp/Makefile0 <<'!' + HOSTTYPE := $$(shell bin/package) + ROOT = ../.. + ARCH = arch/$$(HOSTTYPE) + all : + PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style)) + install : all + $(install.$(style):V) + $(test.$(style):V) + ! + echo ";;;$tmp/Makefile0;Makefile" + cat > $tmp/CYGWIN-README <<'!' + $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run: + $() + make + $() + $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run: + $() + make install + $() + The bin/package command provides a command line interface for all package + operations. The $(opt:/.$//) source and binary packages were generated by: + $() + package write cyg base source version=$(version.original) $(name.original) + package write cyg base binary version=$(version.original) $(name.original) + $() + using the $(org)-base package. To download and install the latest + $(org)-base source package in /opt/$(org) run: + $() + PATH=/opt/$(org)/bin:$PATH + cd /opt/$(org) + package authorize "NAME" password "PASSWORD" setup flat source $("\\") + $(url) $("\\") + $(org)-base + package make + $() + and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your + agreement to the software license(s). All users get the same NAME and PASSWORD. + See $(url) for details. If multiple architectures may be built under + /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH + to use. To update previously downloaded packages from the same url simply run: + $() + cd /opt/$(org) + package setup + package make + $() + To download and install the latest $(org)-base binary package in + /opt/$(org) change "source" to "binary" and omit "package make". + ! + echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README" + cat > $(source:/-src.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint" + echo ";;;$(BINPACKAGE);bin/package" + cat > $tmp/Makefile <<'!' + :MAKE: + ! + echo ";;;$tmp/Makefile;src/Makefile" + echo ";;;$tmp/Makefile;src/cmd/Makefile" + echo ";;;$tmp/Makefile;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + echo ";;;$tmp/Mamfile2;src/lib/Mamfile" + fi + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + echo ";;;$(PACKAGEGEN)/$(name.original).req" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(source) $(base) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \ + $(vendor:?-s",^[^/],$(opt)&,"??) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.source.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + sort -t';' -k5,5 -u | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + rm -rf $tmp + fi + +.source.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + if [[ '$(init)' == '$(name)' ]] + then cat > $tmp/Makefile <<'!' + :MAKE: + ! + $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile + echo ";;;$tmp/Makefile;src/Makefile" + cp $tmp/Makefile $tmp/Makefile1 + $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1 + echo ";;;$tmp/Makefile1;src/cmd/Makefile" + cp $tmp/Makefile $tmp/Makefile2 + $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2 + echo ";;;$tmp/Makefile2;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1 + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2 + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + cp $tmp/Mamfile2 $tmp/Mamfile3 + $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3 + echo ";;;$tmp/Mamfile3;src/lib/Mamfile" + fi + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lib pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help source + package release $(name) + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1 "$(name) package"' + echo '$($(name).README)' + set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B) + hot= + for i + do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/" + done + set -- $(package.closure:B) + if (( $# )) + then echo 'Components in this package:' + echo '.P' + echo '.TS' + echo 'center expand;' + echo 'l l l l l l.' + if [[ $hot ]] + then hot="sed $hot" + else hot=cat + fi + for i + do echo $i + done | + pr -6 -t -s' ' | + $hot + echo '.TE' + fi + echo '.P' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + set -- $(.package.licenses. --all $(name)) + case $# in + 0) ;; + *) case $# in + 1) echo 'The software is covered by this license:' ;; + *) echo 'The software is covered by these licenses:' ;; + esac + echo .BL + for j + do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' ) + echo .LI + echo ".xx link=\"$i\"" + done + echo .LE + echo 'Individual components may be covered by separate licenses;' + echo 'refer to the component source and/or binaries for more information.' + echo .P + ;; + esac + echo 'A recent' + echo '.xx link="release change log"' + echo 'is also included.' + cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null + echo '.H 1 "release change log"' + echo '.xx index' + echo '.nf' + package release $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(STDED) $(STDEDFLAGS) $tmp/t <<'!' + /^$/,/^$/s/ changes$/,/^$/m// + w + q + ! + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html + echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html" + if [[ '$(deltasince)' ]] + then { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package $(version) delta $(release)"' + echo '.xx meta.keywords="software, package, delta"' + echo '.MT 4' + echo '.TL' + echo '$(name) package $(deltaversion) delta $(release)' + echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"' + echo '.nf' + package release $(deltasince) $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html + echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html" + fi + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + echo local > $(source:D:B=$(name):S=.tim) + if [[ '$(incremental)' == 1 && '$(old.source)' ]] + then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source) + $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum)) + fi + rm -rf $tmp + else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1' + echo '$($(name).README)' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html + if [[ '$(source.$(name))' ]] + then { + echo '$($(name).README)' + package help source + } > $(PACKAGEGEN)/$(name).README + cp $(source.$(name)) $(source) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + fi + echo local > $(source:D:B=$(name):S=.tim) + fi + fi + +binary : .binary.init .binary.gen .binary.$$(style) + +.binary.init : .MAKE + local A B D I P V + type := binary + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(binary.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(binary:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.binary := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + binary := $(B) + end + if B == "$(binary)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(binary:B:/$(name).//:/\..*//) + end + PACKAGEGEN := $(PACKAGEBIN)/gen + +.binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.binary.exp .binary.pkg .binary.rpm : .MAKE + error 3 $(style): binary package style not supported yet + +.binary.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $(readme.$(style):@?$$("\n")$$(readme.$$(style))??) + ! + } > $tmp/README1 + echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README" + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $() + The remainder of this file is the README from the source package + that was used to generate this binary package. It describes + the source build hierarchy, not the current directory. + $() + $(package.readme) + ! + } > $tmp/README2 + echo ";;;$tmp/README2;usr/share/doc/$(opt)README" + package release $(name.original) > $tmp/RELEASE + echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE" + cat > $(binary:/.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + set -- $(.package.licenses. --text $(name.original):N!=*.lic) + for i + do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}" + done + cat <<'!' + $(filter.$(style)) + ! + if [[ '$(postinstall.$(style):V:O=1:?1??)' ]] + then cat >$tmp/postinstall <<'!' + $("#")!/bin/sh + $(postinstall.$(style)) + ! + echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh" + fi + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(binary) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.binary.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + rm -rf $tmp + fi + +.binary.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help binary + package release $(name) + } > $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.binary)' ]] + then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary) + echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum)) + echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + else if [[ '$(binary.$(name))' ]] + then exe=$(binary.$(name)) + else exe=$(INSTALLROOT)/bin/$(name) + fi + if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '$($(name).README)' + package help binary + } > $(PACKAGEGEN)/$(name).README + case "$(binary)" in + *.gz) gzip < $exe > $(binary) ;; + *) cp $exe $(binary) ;; + esac + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + fi + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + +runtime : .runtime.init .runtime.gen .runtime.$$(style) + +.runtime.init : .MAKE + local A B D I P V + type := runtime + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(runtime.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(runtime:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.runtime := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + runtime := $(B) + end + if B == "$(runtime)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(runtime:B:/$(name)-run.//:/\..*//) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE + error 3 $(style): runtime package style not supported yet + +.runtime.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo + echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo + echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + echo + echo "To install this $(type) package read the tarball into a directory" + echo "suitable for containing bin and lib subdirectories, and run the" + echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions." + echo + echo "To use the package export the bin directory in PATH. The commands and" + echo "libraries use \$PATH to locate dynamic libraries and related data files." + echo + } | fmt + } > $(PACKAGEGEN)/$(name)-run.README + echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \ + --install=$(PACKAGEGEN)/$(name)-run.ins \ + -wvf $(runtime) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum)) + echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.runtime)' ]] + then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime) + echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum)) + echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + fi + +list.installed list.manifest : + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + ignore $(MAKE) --noexec $(-) $(=) $(<) + done diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh new file mode 100644 index 000000000..dfbedb435 --- /dev/null +++ b/src/cmd/INIT/package.sh @@ -0,0 +1,7428 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +### this script contains archaic constructs that work with all sh variants ### +# package - source and binary package control +# Glenn Fowler + +command=package + +(command set -o posix) 2>/dev/null && set -o posix +path=Bad +case $PATH in +Bad*) echo "Cannot be run by zsh in native mode; use a sh symlink to zsh" >&2 + exit 1 ;; +esac + +unset CDPATH +case $0 in +-*) + echo "dodgy \$0: $0" >&2 + exit 1 ;; +*/package) + mydir=`echo "$0" | sed 's,/package$,,'` + cd "$mydir" || exit + case $PWD in + */bin) ;; + *) echo "this script must live in bin/" >&2 + exit 1 ;; + esac + cd .. || exit + unset mydir ;; +package) + echo "this script must be invoked with a direct path, e.g. bin/package" >&2 + exit 1 ;; +*) + echo "this script must be named 'package'" >&2 + exit 1 ;; +esac + +# shell checks +checksh() +{ + "$1" -ec ' + # reject csh + case 1 in + 1) ;; + esac + # reject special use of $path (to use zsh, use a "sh -> zsh" symlink, which disables this) + path=Bad + case $PATH in + Bad*) exit 1 ;; + esac + # catch (our own) pipe/socket configuration mismatches + date | "$1" -c "read x" || exit 1 + # check Bourne/POSIX compatible trap exit status (should exit with status 0) + trap "exit 0" 0 + exit 1 + ' x "$1" 2>/dev/null || return 1 +} + +LC_ALL=C +export LC_ALL + +TMPDIR=${TMPDIR:-/tmp} +export TMPDIR + +src="cmd contrib etc lib" +use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" +usr="/home" +lib="" # nee /usr/local/lib /usr/local/shlib +ccs="/usr/kvm /usr/ccs/bin" +org="gnu GNU" +makefiles="Mamfile" # ksh 93u+m no longer uses these: Nmakefile nmakefile Makefile makefile +env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH" +checksum=md5sum +checksum_commands="$checksum md5" +checksum_empty="d41d8cd98f00b204e9800998ecf8427e" + +package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' + +PACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"} + +CROSS=0 + +admin_db=admin.db +admin_env=admin.env +admin_ditto="ditto --checksum --delete --verbose" +admin_ditto_update=--update +admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*" +admin_list='PACKAGE.$type.lst' +admin_ping="ping -c 1 -w 5" + +default_url=default.url +MAKESKIP=${MAKESKIP:-"*[-.]*"} +RATZ=ratz +SED= +TAR=tar +TARFLAGS=xv +TARPROBE=B +TR= + +all_types='*.*|sun4' # all but sun4 match *.* + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: package (AT&T Research) 2012-06-28 $ +]'$USAGE_LICENSE$' +[+NAME?package - source and binary package control] +[+DESCRIPTION?The \bpackage\b command controls source and binary + packages. It is a \bsh\b(1) script coded for maximal portability. All + package files are in the \b$PACKAGEROOT\b directory tree. + \b$PACKAGEROOT\b must at minimum contain a \bbin/package\b command or a + \blib/package\b directory. Binary package files are in the + \b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where + \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b + require the current directory to be under \b$PACKAGEROOT\b. See + \bDETAILS\b for more information.] +[+?Note that no environment variables need be set by the user; + \bpackage\b determines the environment based on the current working + directory. The \buse\b action starts a \bsh\b(1) with the environment + initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set + by explicit command argument assignments to override the defaults.] +[+?Packages are composed of components. Each component is built and + installed by an \bast\b \bnmake\b(1) makefile. Each package is also + described by an \bnmake\b makefile that lists its components and + provides a content description. The package makefile and component + makefiles provide all the information required to read, write, build + and install packages.] +[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and + install source packages, and \bsh\b to install binary packages. + \bnmake\b and \bksh93\b are required to write new packages. An + \b$INSTALLROOT/bin/cc\b script may be supplied for some architectures. + This script supplies a reasonable set of default options for compilers + that accept multiple dialects or generate multiple object/executable + formats.] +[+?The command arguments are composed of a sequence of words: zero or + more \aqualifiers\a, one \aaction\a, and zero or more action-specific + \aarguments\a, and zero or more \aname=value\a definitions. \apackage\a + names a particular package. The naming scheme is a \b-\b separated + hierarchy; the leftmost parts describe ownership, e.g., + \bgnu-fileutils\b, \bast-base\b. If no packages are specified then all + packages are operated on. \boptget\b(3) documentation options are also + supported. The default with no arguments is \bhost type\b.] +[+?The qualifiers are:] + { + [+authorize \aname\a?Remote authorization user name or license + acceptance phrase.] + [+debug|environment?Show environment and actions but do not + execute.] + [+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto + \b$PACKAGEROOT\b.] + [+force?Force the action to override saved state.] + [+never?Run make -N and show other actions.] + [+only?Only operate on the specified packages.] + [+password \apassword\a?Remote authorization or license + acceptance password.] + [+quiet?Do not list captured action output.] + [+show?Run make -n and show other actions.] + [+verbose?Provide detailed action output.] + [+DEBUG?Trace the package script actions in detail.] + } +[+?The actions are:] + { + [+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply + \aaction\a ... to the hosts listed in \afile\a. If \afile\a is + omitted then \badmin.db\b is assumed. The caller must have + \brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access + to the hosts. Output for \aaction\a is saved per-host in the + file \aaction\a\b.log/\b\ahost\a. Logs can be viewed by + \bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]]. + By default only local PACKAGEROOT hosts are selected from + \afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects + only hosts matching the \b|\b separated \apattern\a. \afile\a + contains four types of lines. Blank lines and lines beginning + with \b#\b are ignored. Lines starting with \aid\a=\avalue\a + are variable assignments. Set admin_ping to local conventions + if \"'$admin_ping$'\" fails. If a package list is not specified + on the command line the \aaction\a applies to all packages; a + variable assignment \bpackage\b=\"\alist\a\" applies \aaction\a + to the packages in \alist\a for subsequent hosts in \afile\a. + The remaining line type is a host description consisting of 6 + tab separated fields. The first 3 are mandatory; the remaining + 3 are updated by the \badmin\b action. \afile\a is saved in + \afile\a\b.old\b before update. The fields are:] + { + [+hosttype?The host type as reported by + \"\bpackage\b\".] + [+[user@]]host?The host name and optionally user name + for \brcp\b(1) and \brsh\b(1) access.] + [+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package + root directory and optionally the remote protocol (rsh + or ssh) if the directory is on a different server than + the master package root directory. If + \blib/package/admin/'$admin_env$'\b exists under this + directory then it is sourced by \bsh\b(1) before + \aaction\a is done. If this field begins with \b-\b + then the host is ignored. If this field contains \b:\b + then \bditto\b(1) is used to sync the remote \bsrc\b + directory hierarchy to the local one. If [\amaster\a]]: + is specified then the sync is deferred to the \amaster\a + host. If \amaster\a is omitted (two :) then the sync is + disabled. These directories must exist on the remote side: + \blib/package\b, \bsrc/cmd\b, \bsrc/lib\b.] + [+date?\aYYMMDD\a of the last action.] + [+time?Elapsed wall time for the last action.] + [+M T W?The \badmin\b action \bmake\b, \btest\b and + \bwrite\b action error counts. A non-numeric value in + any of these fields disables the corresponding action.] + [+owner?The owner contact information.] + [+attributes?\aname=value\a attributes. Should at least contain + \bcc\b=\acompiler-version\a.] + } + [+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this + deletes all generated files and directories for \aHOSTTYPE\a. + The hierarchy can be rebuilt by \bpackage make\b.] + [+contents\b [ \apackage\a ... ]]?List description and + components for \apackage\a on the standard output.] + [+copyright\b [ \apackage\a ... ]]?List the general copyright + notice(s) for \apackage\a on the standard output. Note that + individual components in \apackage\a may contain additional or + replacement notices.] + [+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for + \avariable\a, one per line. If the \bonly\b attribute is + specified then only the variable values are listed. If no + variables are specified then \b'$env$'\b are assumed.] + [+help\b [ \aaction\a ]]?Display help text on the standard + error (standard output for \aaction\a).] + [+host\b [ \aattribute\a ... ]]?List + architecture/implementation dependent host information on the + standard output. \btype\b is listed if no attributes are + specified. Information is listed on a single line in + \aattribute\a order. The attributes are:] + { + [+canon \aname\a?An external host type name to be + converted to \bpackage\b syntax.] + [+cpu?The number of cpus; 1 if the host is not a + multiprocessor.] + [+name?The host name.] + [+rating?The cpu rating in pseudo mips; the value is + useful useful only in comparisons with rating values of + other hosts. Other than a vax rating (mercifully) fixed + at 1, ratings can vary wildly but consistently from + vendor mips ratings. \bcc\b(1) may be required to + determine the rating.] + [+type?The host type, usually in the form + \avendor\a.\aarchitecture\a, with an optional trailing + -\aversion\a. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. OS point release information is + avoided as much as possible, but vendor resistance to + release incompatibilities has for the most part been + futile.] + } + [+html\b [ \aaction\a ]]?Display html help text on the standard + error (standard output for \aaction\a).] + [+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy + the package binary hierarchy to \adirectory\a. If + \aarchitecture\a is omitted then all architectures are + installed. If \bflat\b is specified then exactly one + \aarchitecture\a must be specified; this architecture will be + installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a + directory prefixes. Otherwise each architecture will be + installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of + \adirectory\a. The \aarchitecture\a \b-\b names the current + architecture. \adirectory\a must be an existing directory. If + \apackage\a is omitted then all binary packages are installed. + This action requires \bnmake\b.] + [+license\b [ \apackage\a ... ]]?List the source license(s) for + \apackage\a on the standard output. Note that individual + components in \apackage\a may contain additional or replacement + licenses.] + [+list\b [ \apackage\a ... ]]?List the name, version and + prerequisites for \apackage\a on the standard output.] + [+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build + and install. The default \atarget\a is \binstall\b, which makes + and installs \apackage\a. If the standard output is a terminal + then the output is also captured in + \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in + the \b$INSTALLROOT\b directory tree viewpathed on top of the + \b$PACKAGEROOT\b directory tree. If \bflat\b is specified then + the \b$INSTALLROOT\b { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be \bflat\b. Leaf directory names matching the + \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The + \bview\b action is done before making. \aoption\a operands are + passed to the underlying make command.] + [+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named + package or archive(s). Must be run from the package root + directory. Archives are searched for in \b.\b and + \blib/package/tgz\b. Each package archive is read only once. + The file \blib/package/tgz/\b\apackage\a[.\atype\a]]\b.tim\b + tracks the read time. See the \bwrite\b action for archive + naming conventions. Text file archive member are assumed to be + ASCII or UTF-8 encoded.] + [+regress?\bdiff\b(1) the current and previous \bpackage test\b + results.] + [+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display + recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to + [\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.) + If no dates are specified then changes for the last 4 months + are listed. \apackage\a may be a package or component name.] + [+remove\b [ \apackage\a ]]?Remove files installed for + \apackage\a.] + [+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List + results and interesting messages captured by the most recent + \bmake\b (default), \btest\b or \bwrite\b action. \bold\b + specifies the previous results, if any (current and previous + results are retained.) \b$HOME/.pkgresults\b, if it exists, + must contain an \begrep\b(1) expression of result lines to be + ignored. \bfailed\b lists failures only and \bpath\b lists the + results file path name only.] + [+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This + action initializes the current directory as a package root, runs the + \bupdate\b action to download new or out of date packages, and runs the + \bread\b action on those packages. If \bflat\b is specified then the + \b$INSTALLROOT\b { bin fun include lib } directories are linked to the + same directories in the package root. Only one architecture may be + \bflat\b. See the \bupdate\b and \bread\b action descriptions for + argument details.] + [+test\b [ \apackage\a ]]?Run the regression tests for + \apackage\a. If the standard output is a terminal then the + output is also captured in + \b$INSTALLROOT/lib/package/gen/test.out\b. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If \bonly\b is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested.] + [+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download + the latest release of the selected and required packages from \aurl\a + (e.g., \bhttp://www.research.att.com/sw/download\b) into the directory + \b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b accesses beta packages; + download these at your own risk. If \aarchitecture\a is omitted then + only architectures already present in the \btgz\b directory will be + downloaded. If \aarchitecture\a is \b-\b then all posted architectures + will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted + as a file containing shell variable assignments for \burl\b, + \bauthorize\b and \bpassword\b. If \aurl\a is omitted then the + definitions for \burl\b, \bauthorize\b and \bpassword\b in + \b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used. + If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it + is initialized with the current \burl\b, \bauthorize\b and \bpassword\b + values and read permission for the current user only. If \apackage\a is + omitted then only packages already present in the tgz directory will be + downloaded. If \apackage\a is \b-\b then all posted packages will be + downloaded. If \bsource\b and \bbinary\b are omitted then both source + and binary packages will be downloaded. If \bonly\b is specified then + only the named packages are updated; otherwise the closure of required + packages is updated. This action requires \bwget\b(1), \blynx\b(1), + \bcurl\b(1) or a shell that supports io to + \b/dev/tcp/\b\ahost\a/\aport\a.] + [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run + \acommand\a, or an interactive shell if \acommand\a is omitted, + with the environment initialized for using the package (can you + say \ashared\a \alibrary\a or \adll\a without cussing?) If + \auid\a or \apackage\a or \a.\a is specified then it is used + to determine a \b$PACKAGEROOT\b, possibly different from + the current directory. For example, to try out bozo`s package: + \bpackage use bozo\b. The \buse\b action may be run from any + directory. If the file \b$INSTALLROOT/lib/package/profile\b is + readable then it is sourced to initialize the environment. 32 or 64 + implies \b$PACKAGEROOT\b of . and specifies the target architecture + word size (which may be silently ignored.)] + [+verify\b [ \apackage\a ]]?Verify installed binary files + against the checksum files in + \b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum + files contain mode, user and group information. If the checksum + matches for a given file then the mode, user and group are + changed as necessary to match the checksum entry. A warning is + printed on the standard error for each mismatch. Requires the + \bast\b package \bcksum\b(1) command.] + [+view\b?Initialize the architecture specific viewpath + hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b { + bin fun include lib } directories are linked to the same + directories in the package root. Only one architecture may be + \bflat\b. The \bmake\b action implicitly calls this action.] + [+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write + a package archive for \apackage\a. All work is done in the + \b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific + files are placed in the \aformat\a subdirectory. A + \apackage\a[.\atype\a]]\b.tim\b file in this directory tracks + the write time and prevents a package from being read in the + same root it was written. If more than one file is generated + for a particular \aformat\a then those files are placed in the + \aformat\a/\apackage\a subdirectory. File names in the + \aformat\a subdirectory will contain the package name, a + \ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If + \apackage\a is omitted then an ordered list of previously + written packages is generated. If \bonly\b is specified then + only the named packages will be written; otherwise prerequisite + packages are written first. Package components must be listed + in \apackage\a\b.pkg\b. \aformat\a may be one of:] + { + [+cyg?Generate a \bcygwin\b package.] + [+exp?Generate an \bexptools\b maintainer source + archive and \aNPD\a file, suitable for \bexpmake\b(1)] + [+lcl?Generate a package archive suitable for + restoration into the local source tree (i.e., the + source is not annotated for licencing.)] + [+pkg?Generate a \bpkgmk\b(1) package suitable for + \bpkgadd\b(1).] + [+rpm?Generate an \brpm\b(1) package.] + [+tgz?Generate a \bgzip\b(1) \btar\b(1) package + archive. This is the default.] + [+tst?Generate a \btgz\b format package archive in the + \btst\b subdirectory. Version state files are not updated.] + } + [+?\btype\b specifies the package type which must be one of + \bsource\b, \bbinary\b or \bruntime\b. A source package + contains the source needed to build the corresponding binary + package. A binary package includes the libraries and headers + needed for compiling and linking against the public interfaces. + A runtime package contains the commands and required dynamic + libraries.] + [+?A package may be either a \bbase\b or \bdelta\b. A base + package contains a complete copy of all components. A delta + package contains only changes from a previous base package. + Delta recipients must have the \bast\b \bpax\b(1) command (in + the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is + specified, then the current base is overwritten if there are no + deltas referring to the current base. Only the \btgz\b and + \blcl\b formats support \bdelta\b. If \bbase\b is specified + then a new base and two delta archives are generated: one delta + to generate the new base from the old, and one delta to + generate the old base from the new; the old base is then + removed. If \bdelta\b is specified then a new delta referring + to the current base is written.] + [+?\apackage\a\b.pkg\b may reference other packages. By default + a pointer to those packages is written. The recipient \bpackage + read\b will then check that all required packages have been + downloaded. If \bclosure\b is specified then the components for + all package references are included in the generated package. + This may be useful for \blcl\b and versioning.] + [+?All formats but \blcl\b annotate each \bsource\b file (not + already annotated) with a license comment as it is written to + the package archive using \bproto\b(1).] + } +[+DETAILS?The package directory hierarchy is rooted at + \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two + level viewpath is used to separate source and binaries. The top view is + architecture specific, the bottom view is shared source. All building + is done in the architecture specific view; no source view files are + intentionally changed. This means that many different binary + architectures can be made from a single copy of the source.] +[+?Independent \b$PACKAGEROOT\b hierarchies can be combined by + appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The + \bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b + must have a \b$PACKAGEROOT/lib/package\b directory.] +[+?Each package contains one or more components. Component source for + the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source + for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This + naming is for convenience only; the underlying makefiles handle + inter-component build order. The \bINIT\b component, which contains + generic package support files, is always made first, then the + components named \bINIT\b*, then the component order determined by the + closure of component makefile dependencies.] +[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The + package naming convention is \agroup\a[-\apart\a]]; e.g., \bast-base\b, + \bgnu-fileutils\b. The *\b.pkg\b files are ast \bnmake\b(1) makefiles + that contain the package name, package components, references to other + packages, and a short package description. *\b.pkg\b files are used by + \bpackage write\b to generate new source and binary packages.] +[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license + information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1) + commands to generate source and binary license strings. \agroup\a is + determined by the first \b:PACKAGE:\b operator name listed in the + component \bnmake\b makefile. \agroup\a\b.lic\b files are part of the + licensing documentation. Each component may have its own \bLICENSE\b file + that overrides the \agroup\a\b.lic\b file. The full text of the licenses + are in the \b$PACKAGEROOT/lib/package/LICENSES\b and + \b$INSTALLROOT/lib/package/LICENSES\b directories.] +[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and + \b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line + consisting of \apackage version release\a \b1\b for the most recent + instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a + is the package name, \aversion\a is the \aYYYY-MM-DD\a base version, + and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a + for delta releases. \apackage\a\b.req\b contains *\b.ver\b entries for + the packages required by \apackage\a, except that the fourth field is + \b0\b instead of \b1\b. All packages except \bINIT\b require the + \bINIT\b package. A simple sort of \apackage\a\b.pkg\b and *\b.ver\b + determines if the required package have been read in. Finally, + \apackage\a\b.README\b and \apackage\a\a.html\b contain the README text + for \apackage\a and all its components. Included are all changes added + to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated + since the two most recent base releases. Component \bRELEASE\b files + contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or + \bdate\b(1) format dates) followed by README text, in reverse + chronological order (newer entries at the top of the file.) \bpackage + release\b lists this information, and \bpackage contents ...\b lists + the descriptions and components.] +[+?\b$HOSTYPE\b names the current binary architecture and is determined + by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming + scheme is used to separate incompatible executable and object formats. + All architecture specific binaries are placed under \b$INSTALLROOT\b + (\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match + against \b$HOSTTYPE\b when making binaries; these are limited to + makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b + then turn off the optimizer for these objects. All other architecture + dependent logic is handled either by the \bast\b \biffe\b(1) command or + by component specific configure scripts. Explicit \b$HOSTYPE\b + values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and + \bCCFLAGS\b. This is handy for build farms that support different + compilers on the same architecture.] +[+?Each component contains an \bast\b \bnmake\b(1) makefile (either + \bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine) + file (\bMamfile\b.) A Mamfile contains a portable makefile description + that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is + no support for old-make/gnu-make makefiles; if the binaries are just + being built then \bmamake\b will suffice; if source or makefile + modifications are anticipated then \bnmake\b (in the \bast-base\b + package) should be used. Mamfiles are automatically generated by + \bpackage write\b.] +[+?Most component C source is prototyped. If \b$CC\b (default value + \bcc\b) is not a prototyping C compiler then \bpackage make\b runs + \bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places + the converted output files in the \b$PACKAGEROOT/proto/src\b tree. + Converted files are then viewpathed over the original source. + \bproto\b(1) converts an ANSI C subset to code that is compatible with + K&R, ANSI, and C++ dialects.] +[+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b + relative pathnames (via the \bast\b \bpathpath\b(3) function); there + are no embedded absolute pathnames. This means that binaries generated + under \b$PACKAGEROOT\b may be copied to a different root; users need + only change their \b$PATH\b variable to reference the new installation + root \bbin\b directory. \bpackage install\b installs binary packages in + a new \b$INSTALLROOT\b.] + +[ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + +[+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1), + \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1), + \bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1), + \bsh\b(1), \btar\b(1), \boptget\b(3)] +' + case $* in + help) set -- --man ;; + esac + while getopts -a $command "$USAGE" OPT + do : + done + shift $OPTIND-1 + ;; +esac + +# check the args + +case $AR in +'') AR=ar ;; +esac +case $CC in +'') CC=cc ;; +esac +case $LD in +'') LD=ld ;; +esac +case $NM in +'') NM=nm ;; +esac + +action= +admin_all=1 +admin_on= +authorize= +bit= +exec= +flat=0 +force=0 +global= +hi= +html=0 +ifs=${IFS-' + '} +lo= +make= +makeflags='-K' +nmakeflags= +nmakesep= +nl=" +" +noexec= +only=0 +output= +package_src= +password= +quiet=0 +show=: +tab=" " +verbose=0 +AUTHORIZE= +DEBUG= +HURL= +PROTOROOT=- +SHELLMAGIC=- + +unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true + +while : +do case $# in + 0) set host type ;; + esac + case $1 in + admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST) + action=$1 + shift + break + ;; + authorize) + case $# in + 1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;; + esac + shift + authorize=$1 + shift + continue + ;; + debug|environment) + exec=echo make=echo show=echo + ;; + flat) flat=1 + ;; + force) force=1 + ;; + never) exec=echo noexec=-N + ;; + only) only=1 + ;; + password) + case $# in + 1) echo $command: $1: authorization password argument expected >&2; exit 1 ;; + esac + shift + password=$1 + shift + continue + ;; + quiet) quiet=1 + ;; + show) exec=echo noexec=-n + ;; + verbose)verbose=1 + ;; + DEBUG) DEBUG=1 + PS4='+$LINENO:$SECONDS+ ' + set -x + ;; + help|HELP|html|man|--[?m]*) + case $1 in + help) code=0 + case $2 in + '') exec 1>&2 ;; + esac + ;; + html) code=0 html=1 + ;; + *) code=2 + exec 1>&2 + ;; + esac + case $html in + 1) bO=" + +$2 package installation instructions + +" + eO=' +' + bH="

" + eH='

' + bP='

' + bL='

' + bL2='

' + eL='

' + bT='' + bD='' eD='' + bB='' eB='' + bI='' eI='' + bX='

'			eX='
' + bF='' eF='' + Camp='&' + Mcurl='
curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + *) bO='' eO='' + bH='' eH=':' + bP='' + bL='' eL='' + bL2='' + bT=' ' + bD=' ' eD='' + bB='' eB='' + bI='' eI='' + bX='' eX='' + bF='"' eF='"' + Camp='&' + Mcurl='curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + esac + case $2 in + binary) echo "${bO} +${bH}Binary Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages.${eD} +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup binary \$URL ${bI}PACKAGE${eI} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + binary package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup binary${eX}${eD} +${bT}(6)${bD}The packaged binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(7)${bD}You can run the binaries directly from the package root, or you can + install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest + binary release is:${bX} + bin/package setup binary${eX}${eD}${eL} + +${bH}Binary Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + binary package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz | + ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + binary package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD.HOSTTYPE${eI}.exe bin/ratz + chmod +x bin/ratz + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD/HOSTTYPE${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + intro) echo "${bO} +${bH}Package Hierarchy Details${eH} +${bP} +The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and +binaries reside under this tree. A two level viewpath is used to separate +source and binaries. The top view is architecture specific, the bottom view +is shared source. All building is done in the architecture specific view; +no source view files are intentionally changed. This means that many +different binary architectures can be made from a single copy of the source. +${bP} +Each package contains one or more components. Component source for the ${bI}FOO${eI} +command is in ${bB}\$PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is +in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the +underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component, +which contains generic package support files, is always made first, then the +components named ${bB}INIT${eB}*, then the order determined by the closure of component +makefile dependencies. +${bP} +${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming +convention is ${bI}GROUP${eI}[${bI}-PART${eI}]; e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files +are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components, +references to other packages, and a short package description. *${bB}.pkg${eB} files +are used by ${bF}package write${eF} to generate new source and binary packages. +${bP} +${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that +is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and +binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator +name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the +licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that +overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the +${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB} +directories. +${bP} +A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and +${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX} + ${bI}PACKAGE VERSION RELEASE${eI} 1${eX} +for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where +${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version, +and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases. +${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by +${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages +except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB} +and *${bB}.ver${eB} determines if the required package have been read in. Finally, +${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its +components. Included are all changes added to the component ${bB}RELEASE${eB}, +${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base +releases. Component ${bB}RELEASE${eB} files contain tag lines of the form +[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README +text, in reverse chronological order (newer entries at the top of the +file.) ${bF}package release${eF} generates this information, and +${bF}package contents ...${eF} lists the descriptions and components. +${bP} +${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the +output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used +to separate incompatible executable and object formats. All architecture +specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$PACKAGEROOT/arch/\$HOSTTYPE${eB}.) +There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these +are limited to makefile compiler workarounds, e.g., if ${bB}\$HOSTTYPE${eB} matches +'hp.*' then turn off the optimizer for these objects. All other architecture +dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component +specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...] +optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build +farms that support different compilers on the same architecture. +${bP} +Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB}) +and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable +makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate +${bB}nmake${eB}. Currently there is no support for old-make/gnu-make makefiles; if +the binaries are just being built then ${bB}mamake${eB} will suffice; if source or +makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or +${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by +${bF}package write${eF}. +${bP} +Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a +prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the +${bB}\$PACKAGEROOT/src${eB} tree and places the converted output files in the +${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over the +original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code +that is compatible with K&R, ANSI, and C++ dialects. +${bP} +All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames; +there are no embedded absolute pathnames. This means that binaries generated +under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change +their ${bB}\$PATH${eB} variable to reference the new installation root bin directory. +${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}. +${eO}" + ;; + source) echo "${bO} +${bH}Source Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages. +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup source \$URL ${bB}PACKAGE${eB} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup source \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup source${eX}${eD} +${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI} + (${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}bin/package${eB} (with no + arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX} + bin/package make${eX}${eD} +${bT}(7)${bD}List make results and interesting errors:${bX} + bin/package results${eX} + Run the regression tests:${bX} + bin/package test${eX} + List test results and errors:${bX} + bin/package results test${eX}${eD} +${bT}(8)${bD}The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(9)${bD}You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle + for the latest source release is:${bX} + bin/package setup source + bin/package make + bin/package test${eX}${eD}${eL} + +${bH}Source Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + source package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz | ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + source package, compile it, and manually read the ${bB}INIT${eB} + source package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD${eI}.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + *) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + + The $command command controls source and binary packages. It must be run + within the package root directory tree. See \"$command help intro\" for + details. In the following, PACKAGE names either a package or a component + within a package; if omitted, all packages are operated on. The default + action is \"host type\". + + qualifier: + authorize NAME Remote authorization name or license acceptance phrase. + debug|environment Show environment and actions; do not execute. + flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT. + force Force the action to override saved state. + never Run make -N; otherwise show other actions. + only Only operate on the specified packages. + password PASSWORD Remote authorization or license acceptance password. + quiet Do not list captured make and test action output. + show Run make -n; otherwise show other actions. + DEBUG Trace the package script actions in detail for debugging. + action: + admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ] + Apply ACTION ... to the hosts listed in FILE. If FILE is + omitted then "admin.db" is assumed. The caller must have rcp(1) + and rsh(1) or scp(1) and ssh(1) access to the hosts. Output + for the action is saved per-host in ACTION.log/HOST. Logs + can be viewed by \"package admin [on HOST] results [ACTION]\". + By default only local PACKAGEROOT hosts are selected from FILE; + \"all\" selects all hosts. \"on PATTERN\" selects only + hosts matching the | separated PATTERN. FILE contains four + types of lines. Blank lines and lines beginning with # are + ignored. Lines starting with id=value are variable assignments. + Set admin_ping to local conventions if \"$admin_ping\" fails. + If a package list is not specified on the command line the + action applies to all packages; a variable assignment + package=list applies action to the packages in list for + subsequent hosts in FILE. The remaining line type is a host + description consisting of 6 tab separated fields. The first 3 + are mandatory; the remaining 3 are updated by the admin action: + hosttype + The host type as reported by package. + [user@]host + The host name and optionally user name for rcp(1) + and rsh(1) access. + [remote:[[master]:]]PACKAGEROOT + The absolute remote package root directory and + optionally the remote prorocol (rsh or ssh) if + the directory is on a different server than the + master package root directory. If + lib/package/admin/$admin_env exists under + this directory then it is sourced by sh(1) + before ACTION is done. If this field begins with - + then the host is ignored. If this field contains + : then ditto(1) is used to sync the remote src + directory hierarchy to the local one. If [master]: + is specified then the sync is deferred to the + master host. If master is omitted (two :) then + the sync is disabled. These directories must exist + on the remote side: lib/package, src/cmd, src/lib. + date YYMMDD of the last action. + date Elapsed wall time of the last action. + M T W The admin action make, test and write action error + counts. A non-numeric value in any of these fields + disables the corresponding action. + owner The owner contact information. + attributes + NAME=VALUE attributes. Should at least contain + cc=compiler-version. + clean | clobber + Delete the arch/HOSTTYPE hierarchy; this deletes all generated + files and directories for HOSTTYPE. The hierarchy can be rebuilt + by package make.] + contents [ package ... ] + List description and components for PACKAGE on the standard + output. + copyright [ package ... ] + List the general copyright notice(s) for PACKAGE on the + standard output. Note that individual components in PACKAGE + may contain additional or replacement notices. + export [ VARIABLE ... ] + List NAME=VALUE for each VARIABLE, one per line. If the + \"only\" attribute is specified then only the variable + values are listed. If no variables are specified then + $env are assumed. + help [ ACTION ] + Display help text on the standard error [ standard output + for ACTION ]. + host [ canon cpu name rating type ... ] + List architecture/implementation dependent host information + on the standard output. type is listed if no attributes are + specified. Information is listed on a single line in attributes + order. The attributes are: + canon The next argument is a host type name to be + converted to package syntax. + cpu The number of cpus; 1 if the host is not a + multiprocessor. + name The host name. + rating The cpu rating in pseudo mips; the value is useful + useful only in comparisons with rating values of + other hosts. Other than a vax rating fixed at 1, + ratings can vary wildly but consistently from + vendor mips ratings. cc(1) may be required to + determine the rating. + type The host type, usually of the form + vendor.architecture, with an optional trailing + -version. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. Os point release information is + avoided as much as possible, but vendor resistance + to release incompatibilities has for the most part + been futile. + html [ ACTION ] + Display html help text on the standard error [ standard output + for ACTION ]. + install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ] + Copy the package binary hierarchy to DIR. If ARCHITECTURE is + omitted then all architectures are installed. If the \"flat\" + attribute is specified then exactly one ARCHITECTURE must be + specified; this architecture will be installed in DIR without + the \"arch/HOSTTYPE\" directory prefixes. Otherwise each + architecture will be installed in a separate \"arch/HOSTTYPE\" + subdirectory of DIR. The ARCHITECTURE - names the current + architecture. DIR must be an existing directory. If PACKAGE + is omitted then all binary packages are installed. This action + requires nmake. + license [ package ... ] + List the source license(s) for PACKAGE on the standard output. + Note that individual components in PACKAGE may contain + additional or replacement licenses. + list [ PACKAGE ... ] + List the name, version and prerequisites for PACKAGE on the + standard output. + make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ] + Build and install. The default TARGET is install, which + makes and installs all packages. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/make.out. The build is done + in the \$INSTALLROOT directory tree viewpathed on top of + the \$PACKAGEROOT directory tree. If \"flat\" is specified then + the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only + one architecture may be flat. Leaf directory names matching + the |-separated shell pattern \$MAKESKIP are ignored. The + view action is done before making. OPTION operands are + passed to the underlying make command. + read [ package ... | archive ... ] + Read the named package archive(s). Must be run from the + package root directory. Archives are searched for in . + and lib/package/tgz. Each package is read only once. The + file lib/package/tgz/package[.type].tim tracks the read time. + See the write action for archive naming conventions. Text + file archive member are assumed to be ASCII or UTF-8 encoded. + regress diff(1) the current and previous package test results. + release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ] + Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd), + where - means lowest (or highest.) If no dates are specified + then changes for the last 4 months are listed. PACKAGE may + be a package or component name. + remove PACKAGE + Remove files installed for PACKAGE. + results [ path ] [ old ] [ make | test ] + List results and interesting messages captured by the most + recent make (default), test or write action. old specifies the + previous results, if any (current and previous results are + retained.) $HOME/.pkgresults, if it exists, must contain an + egrep(1) expression of result lines to be ignored. failed lists + failures only and path lists the results file path only. + setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + The action initializes the current directory as a package root, + runs the update action to download new or out of date packages, + and runs the read action on those packages. If \"flat\" is + specified then the \$INSTALLROOT { bin fun include lib } + directories are linked to the same directories in the package + root. Only one architecture may be flat. See the update and + read actions for argument details. + test [ PACKAGE ] + Run the regression tests for PACKAGE. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/test.out. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If only is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested. + update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + Download the latest release of the selected and required + packages from URL (e.g., + http://www.research.att.com/sw/download) into the directory + \$PACKAGEROOT/lib/package/tgz. beta accesses beta packages; + download these at your own risk. If ARCHITECTURE is omitted + then only architectures already present in the tgz directory + will be downloaded. If ARCHITECTURE is - then all posted + architectures will be downloaded. If URL matches *.url then + it is interpreted as a file containing shell variable + assignments for url, authorize and password. If URL is + omitted then the definitions for url, authorize and password + in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists, + are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does + not exist then it is initialized with the current url, + authorize and password values and read permission for the + current user only. If PACKAGE is omitted then only + packages already present in the tgz directory will be + downloaded. If PACKAGE is - then all posted packages will be + downloaded. If source and binary are omitted then both source + and binary packages will be downloaded. If \bonly\b is + specified then only the named packages are updated; otherwise + the closure of required packages is updated. This action + requires wget(1), lynx(1), curl(1) or a shell that supports + io to /dev/tcp/HOST/PORT. + use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ] + Run COMMAND or an interactive shell if COMMAND is omitted, with + the environment initialized for using the package (can you say + shared library without cussing?) If uid or PACKAGE or . is + specified then it is used to determine a \$PACKAGEROOT, + possibly different from the current directory. For example, to + try out bozo's package: \"package use bozo\". In this case the + command may be run from any directory. If the file + \$INSTALLROOT/lib/package/profile is readable then it is + sourced to initialize the environment. 32 or 64 implies + \$PACKAGEROOT of . and specifies the target architecture word + size (which may be silently ignored.) + verify [ PACKAGE ] + Verify installed binary files against the checksum files in + \$INSTALLROOT/lib/package/gen/*.sum. The checksum files contain + mode, user and group information. If the checksum matches + for a given file then the mode, user and group are changed + as necessary to match the checksum entry. A warning is printed + on the standard error for each mismatch. Requires the ast + package cksum(1) command. + view + Initialize the architecture specific viewpath hierarchy. The + make action implicitly calls this action. If \"flat\" is specified + then the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be flat. + write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta] + [binary|runtime|source] PACKAGE + Write a package archive for PACKAGE. All work is done in the + \$PACKAGEROOT/lib/package directory. FORMAT-specific files + are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim + file in this directory tracksthe write time and prevents a + package from being read in the same root it was written. If + more than one file is generated for a particular FORMAT then + those files are placed in the FORMAT/PACKAGE subdirectory. + File names in the FORMAT subdirectory will contain the package + name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE. + If PACKAGE is omitted then an ordered list of previously + written packages is generated. If \"only\" is specified then + only the named packages will be written; otherwise + prerequisite packages are written first. Package components + must be listed in PACKAGE.pkg. FORMAT may be one of: + cyg generate a cygwin package + exp generate an exptools(1) maintainer source archive + and NPD file in the exp subdirectory, suitable for + expmake(1); support files are placed in the + exp/PACKAGE subdirectory + lcl generate a package archive or delta in the lcl + subdirectory, suitable for restoration into the + primary source tree (no source licence annotation) + pkg generate a pkgmk(1) package, suitable for pkgadd(1) + rpm generate an rpm(1) package + tgz generate a gzip(1) tar(1) package archive; this is + the default + tst generate tgz FORMAT package archive in the tst + subdirectory; version state files are not updated + The package type must be one of source, binary or runtime. + A source package contains the source needed to build the + corresponding binary package. A binary package includes the + libraries and headers needed for compiling and linking + against the public interfaces. A runtime package contains + the commands and required dynamic libraries. A package may + be either a base or delta. A base package contains a + complete copy of all components. A delta package contains + only changes from a previous base package. Delta recipients + must have the ast pax(1) command (in the ast-base package.) + If neither base nor delta is specified, then the current + base is overwritten if there are no deltas referring to the + current base. Only the tgz and lcl formats support delta. + If base is specified then a new base and two delta archives + are generated: one delta to generate the new base from the + old, and one delta to generate the old base from the new; + the old base is then removed. If delta is specified then a + new delta referring to the current base is written. + package.pkg may reference other packages. By default a + pointer to those packages is written. The recipient package + read will then check that all required packages have been + downloaded. If closure is specified then the components for + all package references are included in the generated + package. This may be useful for lcl and versioning. All + formats but lcl annotate each source file (not already + annotated) with a license comment as it is written to the + package archive using proto(1). + name=value: + variable definition: typically CC=cc or CCFLAGS=-g." + ;; + esac + exit $code + ;; + *=*) set DEFAULT host type "$@" + ;; + *) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + exit 2 + ;; + esac + global="$global $1" + shift +done + +# gather HOSTTYPE *,* options +# ,*cc*,-*,... set CC and CCFLAGS + +hostopts() +{ + _ifs_=$IFS + IFS=, + set '' $HOSTTYPE + IFS=$_ifs_ + shift + while : + do case $# in + 0|1) break ;; + esac + shift + case $1 in + *cc*) CC=$1 + while : + do case $# in + 0|1) break ;; + esac + case $2 in + -*) case $assign_CCFLAGS in + ?*) assign_CCFLAGS="$assign_CCFLAGS " ;; + esac + assign_CCFLAGS="$assign_CCFLAGS$2" + shift + ;; + *) break + ;; + esac + done + ;; + esac + done +} + +# collect command line targets and definitions + +case $_PACKAGE_HOSTTYPE_ in +?*) HOSTTYPE=$_PACKAGE_HOSTTYPE_ + KEEP_HOSTTYPE=1 + ;; +*) KEEP_HOSTTYPE=0 + ;; +esac +KEEP_PACKAGEROOT=0 +KEEP_SHELL=0 +USER_VPATH= +args= +assign= +assign_CCFLAGS= +for i +do case $i in + *:*=*) args="$args $i" + continue + ;; + *=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','` + ;; + esac + case $i in + AR=*|LD=*|NM=*) + assign="$assign $n='$v'" + eval $n='$'v + ;; + CC=*) eval $n='$'v + ;; + CCFLAGS=*) + eval $n='$'v + assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\"" + ;; + HOSTTYPE=*) + eval $n='$'v + case $HOSTTYPE in + ?*) KEEP_HOSTTYPE=1 ;; + esac + ;; + HURL=*) eval $n='$'v + ;; + PACKAGEROOT=*) + eval $n='$'v + case $PACKAGEROOT in + ?*) KEEP_PACKAGEROOT=1 ;; + esac + ;; + SHELL=*)eval $n='$'v + case $SHELL in + ?*) KEEP_SHELL=1 ;; + esac + ;; + TAR=*) eval $n='$'v + ;; + TARFLAGS=*) + eval $n='$'v + ;; + VPATH=*)eval USER_$n='$'v + ;; + 'debug=1') + makeflags="$makeflags --debug-symbols" + ;; + 'strip=1') + makeflags="$makeflags --strip-symbols" + ;; + *=*) assign="$assign $n='$v'" + ;; + *) args="$args $i" + ;; + esac +done +case $HOSTTYPE in +*,*) hostopts $HOSTTYPE ;; +esac +case $assign_CCFLAGS in +?*) assign="$assign $assign_CCFLAGS" +esac +case $CC in +''|cc) ;; +*) export CC ;; +esac + +# Add build type flags via KSH_RELFLAGS, which is used in src/cmd/ksh93/Mamfile. +# (Avoid using CCFLAGS; setting it would overwrite autodetected optimization flags.) +ksh_relflags= +case `git branch 2>/dev/null` in +'' | *\*\ [0-9]*.[0-9]*) + # If we're not on a git branch (tarball) or on a branch that starts + # with a number (release branch), then compile as a release version + ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_ksh_release" ;; +*) # Otherwise, add 8-character git commit hash if available, and if the working dir is clean + git_commit=`git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD` + case $git_commit in + ????????) + ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_git_commit=\\\"$git_commit\\\"" ;; + esac + unset git_commit ;; +esac +case $ksh_relflags in +?*) # add the extra flags as an argument to mamake + assign="${assign:+$assign }KSH_RELFLAGS=\"\$ksh_relflags\"" ;; +esac + +# Add ksh compile-options via KSH_SHOPTFLAGS. +SHOPT() +{ + case $1 in + *=?*) ksh_shoptflags="${ksh_shoptflags:+$ksh_shoptflags }-DSHOPT_$1" ;; + esac +} +ksh_shoptflags= +shopt_sh='src/cmd/ksh93/SHOPT.sh' # this script calls SHOPT() to set options +if test -f "$shopt_sh" +then . "$shopt_sh" +else echo "WARNING: $shopt_sh is missing" >&2 +fi +case $ksh_shoptflags in +?*) # add the extra flags as an argument to mamake + assign="${assign:+$assign }KSH_SHOPTFLAGS=\"\$ksh_shoptflags\"" ;; +esac + +# grab action specific args + +case $action in +admin) while : + do case $# in + 0) set list + break + ;; + esac + case $1 in + all) admin_all=1 + ;; + db) case $# in + 1) echo $command: $action: $1: db file argument expected >&2 + exit 1 + ;; + esac + shift + admin_db=$1 + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + admin_on=$1 + ;; + *) break + ;; + esac + shift + done + admin_action=$1 + admin_args=$* + for i + do case $i in + debug|environment|force|never|only|quiet|show|DEBUG) + ;; + *) admin_action=$i + break + ;; + esac + done + ;; +setup) PACKAGEROOT=${PWD:-`pwd`} + export PACKAGEROOT + KEEP_PACKAGEROOT=1 + ;; +use) case $1 in + .|32|64)case $1 in + 32|64) bit=$1 ;; + esac + shift + + # HOSTTYPE specific setup + + case $HOSTTYPE in + win32.*)sys=uwin + wow=`uname -i` + case $bit in + 32) case $HOSTTYPE in + *-64) HOSTTYPE=${HOSTTYPE%-64} ;; + esac + ;; + 64) case $HOSTTYPE in + *-64) ;; + *) HOSTTYPE=$HOSTTYPE-64 ;; + esac + case $wow in + */32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;; + esac + ;; + esac + case $bit in + '') PS1="($sys) " ;; + *) PS1="($sys-$bit) " ;; + esac + + $exec umask 002 + $exec unset MAKESKIP + + $exec export P=$PWD + $exec export A=$P/arch/$HOSTTYPE + + $exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package + $exec export INSTALLROOT=$A + $exec export PACKAGEROOT=$P + $exec export PATH=$A/bin:$P/bin:$PATH + $exec export PS1="$PS1" + $exec export VPATH=$A:$P + $exec export nativepp=/usr/lib + + if test '' != "$INSTALLROOT" -a -d $INSTALLROOT/include/ast + then $exec export PACKAGE_ast=$INSTALLROOT + elif test -d ${PWD%/*}/ast/arch/$HOSTTYPE + then $exec export PACKAGE_ast=${PWD%/*}/ast/arch/$HOSTTYPE + fi + + # run the command + + case $# in + 0) case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$@" + ;; + esac + exit + ;; + esac + PACKAGEROOT=${PWD:-`pwd`} + $show export PACKAGEROOT + esac + ;; +esac + +# true if arg is a valid PACKAGEROOT + +packageroot() # dir +{ + test -d $1/lib/$command -o -x $1/bin/$command +} + +# true if arg is executable + +executable() # [!] command +{ + case $1 in + '!') test ! -x "$2" -a ! -x "$2.exe"; return ;; + *) test -x "$1" -o -x "$1.exe"; return ;; + esac +} + +# initialize SHELLMAGIC +# tangible proof of cygwin's disdain for unix (well, this and execrate) + +shellmagic() +{ + case $SHELLMAGIC in + '') ;; + -) if test -f /emx/bin/sh.exe + then SHELLMAGIC='#!/emx/bin/sh.exe'$nl + elif test -f /bin/env.exe + then SHELLMAGIC='#!/bin/env sh'$nl + else SHELLMAGIC= + fi + ;; + esac +} + +# true if arg is executable command on $PATH + +onpath() # command +{ + _onpath_b=$1 + case $_onpath_b in + /*) if executable $_onpath_b + then _onpath_=$_onpath_b + return 0 + fi + return 1 + ;; + esac + IFS=':' + set '' $PATH + IFS=$ifs + shift + for _onpath_d + do case $_onpath_d in + '') _onpath_d=. ;; + esac + if executable "$_onpath_d/$_onpath_b" + then _onpath_=$_onpath_d/$_onpath_b + return 0 + fi + done + return 1 +} + +# true if no nmake or nmake not from AT&T or nmake too old + +nonmake() # nmake +{ + _nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) /dev/null || echo 19840919` + if test $_nonmake_version -lt 20001031 + then return 0 + fi + return 1 +} + +# determine local host attributes + +hostinfo() # attribute ... +{ + case $DEBUG in + 1) set -x ;; + esac + map= + something= + path=$PATH + for i in $ccs + do PATH=$PATH:$i + done + for i in $use + do for j in $org + do PATH=$PATH:$i/$j/bin + done + PATH=$PATH:$i/bin + done + # LD_LIBRARY_PATH may be out of sync with PATH here + case $SED in + '') SED=sed + $SED 1d < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$SED + then SED=$dir/$SED + break + fi + done + TR=tr + $TR < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$TR + then TR=$dir/$TR + break + fi + done + ;; + esac + case $PACKAGE_PATH in + ?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'` + do PATH=$PATH:$i/bin + done + ;; + esac + + # validate the args + + canon= + cc=$CC + for info + do case $canon in + -) canon=$info + ;; + *) case $info in + */*|*[cC][cC]) + cc=$info + ;; + canon) canon=- + something=1 + ;; + cpu|name|rating|type) + something=1 + ;; + *) echo "$command: $action: $info: unknown attribute" >&2 + exit 1 + ;; + esac + ;; + esac + done + case $canon in + -) echo "$command: $action: canon: host type name expected" >&2 + exit 1 + ;; + esac + case $something in + "") set "$@" type ;; + esac + case $DEBUG in + '') exec 9>&2 + exec 2>/dev/null + ;; + esac + + # compute the info + + _hostinfo_= + for info + do + case $info in + cpu) case $NPROC in + [123456789]*) + _hostinfo_="$_hostinfo_ $NPROC" + continue + ;; + esac + cpu=`sysctl -n hw.ncpu` + case $cpu in + [123456789]*) + _hostinfo_="$_hostinfo_ $cpu" + continue + ;; + esac + cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo` + case $cpu in + [123456789]*) + _hostinfo_="$_hostinfo_ $cpu" + continue + ;; + esac + cpu=1 + # exact match + set \ + hinv '^Processor [0123456789]' \ + psrinfo 'on-line' \ + 'cat /reg/LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + 'cat /proc/registry/HKEY_LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | grep -c "$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + case $cpu in + 0|1) set \ + /bin/mpstat + + while : + do case $# in + 0) break ;; + esac + if executable $1 + then case `$1 | grep -ic '^cpu '` in + 1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '` + break + ;; + esac + fi + shift + done + ;; + esac + case $cpu in + 0|1) # token match + set \ + /usr/kvm/mpstat 'cpu[0123456789]' \ + /usr/etc/cpustatus 'enable' \ + /usr/alliant/showsched 'CE' \ + 'ls /config/hw/system/cpu' 'cpu' \ + prtconf 'cpu-unit' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $TR ' ' ' + +' | grep -c "^$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + ;; + esac + case $cpu in + 0|1) # special match + set \ + \ + hinv \ + '/^[0123456789][0123456789]* .* Processors*$/' \ + '/[ ].*//' \ + \ + /usr/bin/hostinfo \ + '/^[0123456789][0123456789]* .* physically available\.*$/' \ + '/[ ].*//' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $SED -e "${2}!d" -e "s${3}"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift;shift + done + ;; + esac + case $cpu in + 0|1) cpu=`( + cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +int main() +{ + printf("%d\n", pthread_num_processors_np()); + return 0; +} +! + for o in -lpthread '' + do if $CC $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 + then ./$tmp.exe + break + fi + done + )` + case $cpu in + [0123456789]*) ;; + *) cpu=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $cpu" + ;; + name) _name_=`hostname || uname -n || cat /etc/whoami || echo local` + _hostinfo_="$_hostinfo_ $_name_" + ;; + rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'` + do case $rating in + [0123456789]*) break ;; + esac + done + case $rating in + [0123456789]*) ;; + *) cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +#if TD || TZ +#include +#else +extern time_t time(); +#endif +int main() +{ + register unsigned long i; + register unsigned long j; + register unsigned long k; + unsigned long l; + unsigned long m; + unsigned long t; + int x; +#if TD || TZ + struct timeval b; + struct timeval e; +#if TZ + struct timezone z; +#endif +#endif + l = 500; + m = 890; + x = 0; + for (;;) + { +#if TD || TZ +#if TZ + gettimeofday(&b, &z); +#else + gettimeofday(&b); +#endif +#else + t = (unsigned long)time((time_t*)0); +#endif + k = 0; + for (i = 0; i < l; i++) + for (j = 0; j < 50000; j++) + k += j; +#if TD || TZ +#if TZ + gettimeofday(&e, &z); +#else + gettimeofday(&e); +#endif + t = (e.tv_sec - b.tv_sec) * 1000 + (e.tv_usec - b.tv_usec) / 1000; + if (!x++ && t < 1000) + { + t = 10000 / t; + l = (l * t) / 10; + continue; + } +#else + t = ((unsigned long)time((time_t*)0) - t) * 1000; + if (!x++ && t < 20000) + { + t = 200000l / t; + l = (l * t) / 10; + continue; + } +#endif +#if PR + printf("[ k=%lu l=%lu m=%lu t=%lu ] ", k, l, m, t); +#endif + if (t == 0) + t = 1; + break; + } + printf("%lu\n", ((l * m) / 10) / t); + return k == 0; +} +! + rating= + for o in -DTZ -DTD '' + do if $CC $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 + then rating=`./$tmp.exe` + break + fi + done + case $rating in + [0123456789]*) ;; + *) rating=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $rating" + ;; + type|canon) + case $CROSS:$canon in + 0:) case $cc in + cc) case $KEEP_HOSTTYPE:$HOSTTYPE in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE + then KEEP_HOSTTYPE=1 + fi + ;; + esac + ;; + esac + case $KEEP_HOSTTYPE in + 1) _hostinfo_="$_hostinfo_ $HOSTTYPE" + continue + ;; + esac + ;; + esac + case $cc in + /*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *.*-*) _hostinfo_="$_hostinfo_ $a" + continue + ;; + *-*-*) case $canon in + '') canon=$a ;; + esac + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue + ;; + esac + ;; + esac + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + f=../lib/hostinfo/typemap + for i + do case $i in + "") i=. ;; + esac + case $canon in + '') case $cc in + /*|cc) ;; + *) if executable $i/$cc + then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *-*) canon=$a + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue 2 + ;; + esac + fi + ;; + esac + ;; + esac + if test -f "$i/$f" + then map="`grep -v '^#' $i/$f` $map" + fi + done + + # inconsistent -dumpmachine filtered here + + case -${canon}- in + --|*-powerpc-*) + h=`hostname || uname -n || cat /etc/whoami` + case $h in + '') h=local ;; + esac + a=`arch || uname -m || att uname -m || uname -s || att uname -s` + case $a in + *[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;; + esac + case $a in + '') a=unknown ;; + esac + m=`mach || machine || uname -p || att uname -p` + case $m in + *[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;; + esac + case $m in + '') m=unknown ;; + esac + x=`uname -a || att uname -a` + case $x in + '') x="unknown $host unknown unknown unknown unknown unknown" ;; + esac + set "" $h $a $m $x + expected=$1 host=$2 arch=$3 mach=$4 os=$5 sys=$6 rel=$7 ver=$8 + ;; + *) case $canon in + *-*) IFS=- + set "" $canon + shift + IFS=$ifs + case $# in + 2) host= mach= arch=$1 os=$2 sys= rel= ;; + *) host= mach=$2 arch=$1 os=$3 sys= rel= ;; + esac + case $os in + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'` + ;; + esac + ;; + *) arch=$canon mach= os= sys= rel= + ;; + esac + ;; + esac + type=unknown + case $host in + *.*) host=`echo $host | $SED -e 's/\..*//'` ;; + esac + case $mach in + unknown) + mach= + ;; + [Rr][0123][0123456789][0123456789][0123456789]) + mach=mips1 + ;; + [Rr][4][0123456789][0123456789][0123456789]) + mach=mips2 + ;; + [Rr][56789][0123456789][0123456789][0123456789]|[Rr][123456789][0123456789][0123456789][0123456789][0123456789]) + mach=mips4 + ;; + pc) arch=i386 + mach= + ;; + [Pp][Oo][Ww][Ee][Rr][Pp][Cc]) + arch=ppc + mach= + ;; + *) case $arch in + 34[0123456789][0123456789]) + os=ncr + arch=i386 + ;; + esac + ;; + esac + case $canon in + '') set \ + \ + /NextDeveloper -d next - \ + /config/hw/system/cpu -d tandem mach \ + + while : + do case $# in + 0) break ;; + esac + if test $2 $1 + then os=$3 + case $4 in + arch) mach=$arch ;; + mach) arch=$mach ;; + esac + break + fi + shift;shift;shift;shift + done + ;; + esac + case $os in + AIX*|aix*) + type=ibm.risc + ;; + HP-UX) case $arch in + 9000/[78]*) + type=hp.pa + ;; + */*) type=hp.`echo $arch | $SED 's,/,_,g'` + ;; + *) type=hp.$arch + ;; + esac + ;; + [Ii][Rr][Ii][Xx]*) + set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + shift + type=$1 + n= + case $2 in + r[0123][0123456789][0123456789][0123456789]) + n=1 + ;; + r[4][0123][0123456789][0123456789]) + n=2 + ;; + r[4][456789][0123456789][0123456789]|r[5][0123456789][0123456789][0123456789]) + n=3 + ;; + r[6789][0123456789][0123456789][0123456789]|r[123456789][0123456789][0123456789][0123456789][0123456789]) + n=4 + ;; + esac + case $rel in + [01234].*|5.[012]|5.[012].*) + case $n in + 1) ;; + *) n=2 ;; + esac + ;; + 5.*) case $n in + 2) n=3 ;; + esac + ;; + esac + if executable $cc + then a=$cc + else IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for i + do a=$i/$cc + if executable $a + then break + fi + done + fi + split=' +' + a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q` + case $a in + [0123456789]) n=$a ;; + esac + case $n in + 4) a=`$cc -${type}3 2>&1` + case $a in + *unknown*|*install*|*conflict*) + ;; + *) n=3 + ;; + esac + ;; + esac + a=`$cc -show F0oB@r.c 2>&1` + case $n:$a in + [!2]:*mips2*) n=2 ;; + [!23]:*mips3*) n=3 ;; + [!234]:*mips4*) n=4 ;; + esac + case $n:$a in + [!2]:*[Oo]32*) abi=-o32 ;; + [!3]:*[Nn]32*) abi=-n32 ;; + esac + mach=${type}$n + type=sgi.$mach + ;; + OSx*|SMP*|pyramid) + type=pyr + ;; + OS/390) type=mvs.390 + ;; + [Ss][Cc][Oo]*) + type=sco + ;; + [Ss]ol*) + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + case $arch in + '') case $mach in + '') arch=sun4 ;; + *) arch=$mach ;; + esac + ;; + esac + case $arch in + sparc) arch=sun4 ;; + esac + type=sol$v.$arch + ;; + [Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'` + case $type in + sparc) type=sun4 ;; + esac + case $rel in + [01234]*) + ;; + '') case $os in + *[Oo][Ss]) + ;; + *) type=sol.$type + ;; + esac + ;; + *) case $type in + '') case $mach in + sparc*) type=sun4 ;; + *) type=$mach ;; + esac + ;; + esac + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + type=sol$v.$type + ;; + esac + case $type in + sun*|*.*) + ;; + *) type=sun.$type + ;; + esac + ;; + [Uu][Nn][Ii][Xx]_[Ss][Vv]) + type=unixware + ;; + UTS*|uts*) + if test -x /bin/u370 -o -x /bin/u390 + then type=uts.390 + else case $arch in + '') arch=$mach ;; + esac + type=uts.$arch + fi + ;; + $host) type=$arch + case $type in + *.*|*[0123456789]*86|*68*) + ;; + *) case $mach in + *[0123456789]*86|*68*|mips) + type=$type.$mach + ;; + esac + ;; + esac + ;; + unknown) + case $arch in + ?*) case $arch in + sun*) mach= ;; + esac + type=$arch + case $mach in + ?*) type=$type.$mach ;; + esac + ;; + esac + ;; + *) case $ver in + FTX*|ftx*) + case $mach in + *[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'` + ;; + esac + type=stratus.$mach + ;; + *) case $arch in + [Oo][Ss][-/.]2) + type=os2 + arch=$rel + ;; + *) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'` + ;; + esac + case $type in + [Cc][Yy][Gg][Ww][Ii][Nn]_*) + type=cygwin + ;; + [Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt]) + type=win32 + arch=`echo $arch | $SED -e 's/_[^_]*$//'` + ;; + esac + case $arch in + '') case $mach in + ?*) type=$type.$mach ;; + esac + ;; + *) type=$type.$arch ;; + esac + ;; + esac + esac + case $type in + [0123456789]*) + case $mach in + ?*) type=$mach ;; + esac + case $type in + */MC) type=ncr.$type ;; + esac + ;; + *.*) ;; + *[0123456789]*86|*68*) + case $rel in + [34].[0123456789]*) + type=att.$type + ;; + esac + ;; + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + ;; + [abcdefghijklmnopqrstuvwxyz]*) case $mach in + $type) case $ver in + Fault*|fault*|FAULT*) + type=ft.$type + ;; + esac + ;; + ?*) case $arch in + '') type=$type.$mach ;; + *) type=$type.$arch ;; + esac + ;; + esac + ;; + esac + case $type in + *[-_]32|*[-_]64|*[-_]128) + bits=`echo $type | $SED 's,.*[-_],,'` + type=`echo $type | $SED 's,[-_][0-9]*$,,'` + ;; + *) bits= + ;; + esac + type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + case $type in + *.*) lhs=`echo $type | $SED -e 's/\..*//'` + rhs=`echo $type | $SED -e 's/.*\.//'` + case $rhs in + [x0123456789]*86) rhs=i$rhs ;; + 68*) rhs=m$rhs ;; + esac + case $rhs in + i[x23456789]86|i?[x23456789]86|*86pc) + rhs=i386 ;; + powerpc) rhs=ppc ;; + s[0123456789]*[0123456789]x) + rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;; + esac + case $rhs in + arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*) + rhs=arm ;; + hppa) rhs=pa ;; + esac + case $lhs in + ?*coff|?*dwarf|?*elf) + case $lhs in + ?*coff) x=coff ;; + ?*dwarf)x=coff ;; + ?*elf) x=elf ;; + esac + lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"` + ;; + esac + case $lhs in + bsdi) lhs=bsd ;; + darwin) case `/usr/bin/cc --version` in + *'(GCC)'*) case $rel in + [0-9].*|10.*) lhs=darwin07 ;; + *) lhs=darwin11 ;; + esac ;; + esac + ;; + freebsd) case $rel in + [01234].*) lhs=${lhs}4 ;; + [123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;; + esac + ;; + hpux) lhs=hp ;; + mvs) rhs=390 ;; + esac + case $lhs in + '') type=$rhs ;; + $rhs) type=$lhs ;; + *) type=$lhs.$rhs ;; + esac + ;; + esac + case $type in + sgi.mips*) + case $mach in + mips2) type=sgi.$mach + abi=-o32 + ;; + mips3) type=sgi.$mach + abi=-n32 + ;; + mips[456789]) + type=sgi.$mach + case $abi in + *-n32) ;; + *) abi=-64 ;; + esac + ;; + *) pwd=`pwd` + cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.a.c < $tmp.b.c </dev/null 2>&1 + rm -f $tmp.* + trap - 0 1 2 + cd $pwd + ;; + esac + case $type$abi in + sgi.mips2-o32) + ;; + sgi.mips3) + type=$type-o32 + ;; + sgi.mips3-n32) + ;; + sgi.mips4) + type=$type-o32 + ;; + sgi.mips[456789]-64) + ;; + *) type=$type$abi + ;; + esac + ;; + *) case $bits in + '') bits=` cd "$TMPDIR" + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + echo 'int main() { return 0; }' > $tmp.a.c + $cc $CCFLAGS -o $tmp.a.exe $tmp.a.c /dev/null 2>&1 + file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ` + case $bits in + *64*) bits=64 ;; + *) bits= ;; + esac + ;; + esac + ;; + esac + case $bits in + 32) case $type in + *.i386) bits= ;; + esac + ;; + esac + case $bits in + ?*) type=$type-$bits ;; + esac + + # last chance mapping + + set "" "" $map + while : + do case $# in + [012]) break ;; + esac + shift;shift + eval " case \$type in + $1) type=\$2; break ;; + esac" + done + _hostinfo_="$_hostinfo_ $type" + ;; + esac + done + set '' $_hostinfo_ + shift + _hostinfo_=$* + + # restore the global state + + PATH=$path + case $DEBUG in + '') exec 2>&9 + exec 9>&- + ;; + esac +} + +# info message + +note() # message ... +{ + echo $command: "$@" >&2 +} + +# cc checks +# +# CC: compiler base name name +# cc: full path, empty if not found + +checkcc() +{ + cc= + if onpath $CC + then cc=$_onpath_ + else case $CC in + cc) if onpath gcc + then CC=gcc + cc=$_onpath_ + fi + ;; + esac + fi + case $cc in + '') case $action in + make|test) note "$CC: not found"; exit 1 ;; + *) note "warning: $CC: not found" ;; + esac + ;; + esac +} + +# some actions have their own PACKAGEROOT or kick out early + +case $action in +host) eval u=$package_use + case $u in + $PACKAGE_USE) + ;; + *) if onpath $0 + then case $_onpath_ in + */arch/$HOSTTYPE/bin/package) + KEEP_HOSTTYPE=1 + ;; + *) KEEP_HOSTTYPE=0 + ;; + esac + else KEEP_HOSTTYPE=0 + fi + ;; + esac + hostinfo $args + echo $_hostinfo_ + exit 0 + ;; +export|setup|use) + x= + ;; +*) x= + eval u=$package_use + case $u in + $PACKAGE_USE) + case :$PATH: in + *:$INSTALLROOT/bin:*) + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + x=1 + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; +esac +run=- +case $x in +1) : accept the current package use environment + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + INITROOT=$PACKAGEROOT/src/cmd/INIT + checkcc + ;; +*) hosttype= + case $KEEP_PACKAGEROOT in + 0) case $action in + use) PACKAGEROOT= + case $show in + echo) exec=echo make=echo show=echo ;; + esac + set '' $args + shift + case $# in + 0) ;; + *) case $1 in + -|.) ;; + /*) PACKAGEROOT=$1 + ;; + *) i=`echo ~$1` + if packageroot $i + then PACKAGEROOT=$i + else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use + do if packageroot $i/$1 + then PACKAGEROOT=$i/$1 + break + fi + done + case $PACKAGEROOT in + '') hosttype=$1 ;; + esac + fi + ;; + esac + shift + ;; + esac + run="$@" + ;; + esac + case $PACKAGEROOT in + '') PACKAGEROOT=${PWD:-`pwd`} ;; + esac + + # . must be within the PACKAGEROOT tree + + i=X$PACKAGEROOT + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $PACKAGEROOT in + //*) d=/ ;; + *) d= ;; + esac + case $1 in + home) k=1 ;; + *) k=0 ;; + esac + for i + do case $i in + '') continue ;; + esac + d=$d/$i + case $k in + 2) k=1 + ;; + 1) k=0 + ;; + 0) case $i in + arch) k=2 + ;; + *) if packageroot $d + then PACKAGEROOT=$d + fi + ;; + esac + ;; + esac + done + ;; + esac + INITROOT=$PACKAGEROOT/src/cmd/INIT + $show PACKAGEROOT=$PACKAGEROOT + $show export PACKAGEROOT + export PACKAGEROOT + + # initialize the architecture environment + + case $KEEP_HOSTTYPE in + 0) hostinfo type + HOSTTYPE=$_hostinfo_ + ;; + 1) _PACKAGE_HOSTTYPE_=$HOSTTYPE + export _PACKAGE_HOSTTYPE_ + ;; + esac + $show HOSTTYPE=$HOSTTYPE + $show export HOSTTYPE + export HOSTTYPE + INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE + case $action in + admin|install|make|read|remove|test|verify|view|write) + ;; + *) if test ! -d $INSTALLROOT + then INSTALLROOT=$PACKAGEROOT + fi + ;; + esac + $show INSTALLROOT=$INSTALLROOT + $show export INSTALLROOT + export INSTALLROOT + + # check the basic package hierarchy + + case $action in + export|use) + packageroot $PACKAGEROOT || { + echo "$command: $PACKAGEROOT: invalid package root directory" >&2 + exit 1 + } + case $KEEP_HOSTTYPE:$hosttype in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype + then KEEP_HOSTTYPE=1 + HOSTTYPE=$hosttype + else echo "$command: $hosttype: package root not found" >&2 + exit 1 + fi + ;; + esac + ;; + *) packageroot $PACKAGEROOT || { + case $KEEP_PACKAGEROOT in + 1) ;; + *) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2 + exit 1 + ;; + esac + } + + case $action in + admin) ;; + *) for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in lib + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update the basic package commands + + for i in execrate ignore mamprobe silent + do test -h $PACKAGEROOT/bin/$i 2>/dev/null || + case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.sh"*) + note update $PACKAGEROOT/bin/$i + shellmagic + case $SHELLMAGIC in + '') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit + ;; + *) case $exec in + '') { + echo "$SHELLMAGIC" + cat $INITROOT/$i.sh + } > $PACKAGEROOT/bin/$i || exit + ;; + *) echo "{ +echo \"$SHELLMAGIC\" +cat $INITROOT/$i.sh +} > $PACKAGEROOT/bin/$i" + ;; + esac + ;; + esac + $exec chmod +x $PACKAGEROOT/bin/$i || exit + ;; + esac + done + fi + ;; + esac + path=$PATH + PATH=$INSTALLROOT/bin:$PACKAGEROOT/bin:$PATH + checkcc + PATH=$path + case $cc in + ?*) if test -f $INITROOT/hello.c + then + # check if $CC (full path $cc) is a cross compiler + + ( + cd "$TMPDIR" || exit 3 + cp $INITROOT/hello.c pkg$$.c || exit 3 + $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { + if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 + then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2 + else cat pkg$$.e + echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2 + fi + exit 2 + } + if ./pkg$$.exe >/dev/null 2>&1 + then code=0 + else code=1 + fi + rm -f pkg$$.* + exit $code + ) + code=$? + case $code in + 1) CROSS=1 ;; + esac + fi + ;; + esac + EXECTYPE=$HOSTTYPE + EXECROOT=$INSTALLROOT + case $CROSS in + 0) # dll hackery -- why is this so complicated? + + abi= + case $HOSTTYPE in + sgi.mips[0123456789]*) + x=rld + if executable /lib32/$x || executable /lib64/$x + then case $INSTALLROOT in + */sgi.mips[0123456789]*) + u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'` + ;; + *) u= + ;; + esac + for a in "n=2 v= l=" "n=3 v=N32 l=lib32" "n=4-n32 v=N32 l=lib32" "n=4 v=64 l=lib64" + do eval $a + case $v in + N32) case $n:$HOSTTYPE in + *-n32:*-n32) ;; + *-n32:*) continue ;; + *:*-n32) continue ;; + esac + ;; + esac + case $l in + ?*) if executable ! /$l/$x + then continue + fi + ;; + esac + case $u in + '') case $HOSTTYPE in + sgi.mips$n|sgi.mips$n-*) + abi="$abi 'd=$INSTALLROOT v=$v'" + ;; + *) continue + ;; + esac + ;; + *) if test -d $u$n + then abi="$abi 'd=$u$n v=$v'" + fi + ;; + esac + done + fi + ;; + esac + case $abi in + '') abi="'d=$INSTALLROOT v='" ;; + esac + p=0 + eval " + for a in $abi + do eval \$a + eval \" + case \\\$LD_LIBRARY\${v}_PATH: in + \\\$d/lib:*) + ;; + *) x=\\\$LD_LIBRARY\${v}_PATH + case \\\$x in + ''|:*) ;; + *) x=:\\\$x ;; + esac + LD_LIBRARY\${v}_PATH=\$d/lib\\\$x + export LD_LIBRARY\${v}_PATH + p=1 + ;; + esac + \" + done + " + case $LD_LIBRARY_PATH in + '') ;; + *) for d in $lib + do case $HOSTTYPE in + *64) if test -d ${d}64 + then d=${d}64 + fi + ;; + esac + case :$LD_LIBRARY_PATH: in + *:$d:*) ;; + *) if test -d $d + then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d + p=1 + fi + ;; + esac + done + ;; + esac + case $p in + 1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH + $show export LD_LIBRARY_PATH + export LD_LIBRARY_PATH + ;; + esac + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + ;; + *) case $LIBPATH in + '') LIBPATH=/usr/lib:/lib ;; + esac + LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH + $show LIBPATH=$LIBPATH + $show export LIBPATH + export LIBPATH + ;; + esac + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + ;; + *) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH} + $show SHLIB_PATH=$SHLIB_PATH + $show export SHLIB_PATH + export SHLIB_PATH + ;; + esac + case $DYLD_LIBRARY_PATH: in + $INSTALLROOT/lib:*) + ;; + *) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} + $show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + $show export DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + ;; + esac + case $_RLD_ROOT in + $INSTALLROOT/arch*) ;; + ':') _RLD_ROOT=$INSTALLROOT/arch:/ ;; + /|*:/) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT ;; + *) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT:/ ;; + esac + $show _RLD_ROOT=$_RLD_ROOT + $show export _RLD_ROOT + export _RLD_ROOT + + # now set up PATH + # + # NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations + + case $PATH: in + $PACKAGEROOT/bin:*) + ;; + *) PATH=$PACKAGEROOT/bin:$PATH + ;; + esac + case $PATH: in + $INSTALLROOT/bin:*) + ;; + *) PATH=$INSTALLROOT/bin:$PATH + ;; + esac + $show PATH=$PATH + $show export PATH + export PATH + ;; + *) for i in package proto nmake + do if onpath $i + then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'` + EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'` + break + fi + done + case $HOSTTYPE in + $EXECTYPE) + OCC=$CC + CC=cc + hostinfo type + EXECTYPE=$_hostinfo_ + case $HOSTTYPE in + $EXECTYPE) + echo "$command: $CC: seems to be a cross-compiler" >&2 + echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2 + echo "$command: If not, your $TMPDIR directory may be mounted without execute permission." >&2 + echo "$command: Try exporting TMPDIR as a directory where you can execute binary files." >&2 + exit 1 + ;; + esac + ;; + esac + $show EXECTYPE=$EXECTYPE + $show export EXECTYPE + export EXECTYPE + ;; + esac + $show EXECROOT=$EXECROOT + $show export EXECROOT + export EXECROOT + + # use these if possible + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + + # grab a decent default shell + + checksh "$SHELL" || KEEP_SHELL=0 + case $KEEP_SHELL in + 0) save_PATH=$PATH + if PATH=`getconf PATH 2>/dev/null` + then PATH=$PATH:$path + else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path + fi + for i in ksh ksh93 mksh yash bash sh + do if onpath "$i" && checksh "$_onpath_" + then SHELL=$_onpath_ + KEEP_SHELL=1 + break + fi + done + PATH=$save_PATH + unset save_PATH + case $KEEP_SHELL in + 0) echo "Cannot find good default shell, please supply SHELL=/path/to/shell" >&2 + exit 1 ;; + esac + ;; + esac + export SHELL + $show SHELL=$SHELL + $show export SHELL + + # tame the environment + + case $action in + use) ;; + *) ENV= + ERROR_OPTIONS= + export ENV ERROR_OPTIONS + ;; + esac + + # finalize the views + + case $USER_VPATH in + '') case $VPATH in + ?*) IFS=':' + set '' $VPATH + shift + IFS=$ifs + USER_VPATH= + for i + do case $i in + */arch/$HOSTTYPE) ;; + */arch/*/*) ;; + */arch/*) continue ;; + esac + if packageroot $i + then case $USER_VPATH in + '') USER_VPATH=$i ;; + ?*) USER_VPATH=$USER_VPATH:$i ;; + esac + fi + done + esac + ;; + esac + case $USER_VPATH in + ?*) IFS=':' + set '' $USER_VPATH + shift + IFS=$ifs + USER_VPATH= + USER_VPATH_CHAIN= + p=$PACKAGEROOT + for i + do case $i in + ''|$PACKAGEROOT|$INSTALLROOT) + ;; + ?*) USER_VPATH=$USER_VPATH:$i + USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" + p=$i + case $PROTOROOT in + -) executable $i/bin/mamake && PROTOROOT= ;; + esac + ;; + esac + done + ;; + esac + ;; +esac + +PACKAGESRC=$PACKAGEROOT/lib/package +PACKAGEBIN=$INSTALLROOT/lib/package +case $action:$run in +use:-) set '' $args + shift + case $# in + 0) ;; + *) shift ;; + esac + run="$@" + ;; +esac + +# HOSTTYPE specific package profile + +if test -r $INSTALLROOT/lib/package/profile +then . $INSTALLROOT/lib/package/profile +fi + +# more cygwin hassles + +case $HOSTTYPE in +cygwin.*) + lose= + case $CYGWIN in + *nontsec*) + lose=ntsec + ;; + *ntsec*);; + *) exe=$TMPDIR/pkg$$.exe + rm -f "$exe" + : > "$exe" + if test -x "$exe" + then lose=ntsec + fi + ;; + esac + case $CYGWIN in + *nobinmode*) + case $lose in + '') lose=binmode ;; + *) lose="$lose binmode" ;; + esac + ;; + esac + case $lose in + ?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2 + exit 1 + ;; + esac + ;; +esac + +# set up the view state + +VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT" +VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH +$show VPATH=$VPATH +$show export VPATH +export VPATH +IFS=':' +set '' $VPATH +shift +IFS=$ifs +for i +do case $i in + */arch/*/*) + VIEW_src="$VIEW_src $i" + ;; + */arch/*) + VIEW_bin="$VIEW_bin $i" + ;; + *) + VIEW_src="$VIEW_src $i" + ;; + esac + VIEW_all="$VIEW_all $i" +done + +# return 0 if arg in src|bin|all view + +view() # [test] [-|type] [src|bin|all] file +{ + case $1 in + -[dfsx])_view_T_=$1; shift ;; + *) _view_T_=-f ;; + esac + case $1 in + -) _view_t_= ;; + *) _view_t_=$1 ;; + esac + shift + case $1 in + all) shift; _view_v_=$VIEW_all ;; + bin) shift; _view_v_=$VIEW_bin ;; + src) shift; _view_v_=$VIEW_src ;; + *) _view_v_=$VIEW_all ;; + esac + case $1 in + /*) if test $_view_T_ $1 + then _view_=$1 + return 0 + fi + ;; + *) for _view_d_ in $_view_v_ + do if test $_view_T_ $_view_d_/$1 + then _view_=$_view_d_/$1 + return 0 + fi + done + ;; + esac + _view_= + case $_view_t_ in + ?*) echo $command: $1: $_view_t_ not found >&2 ;; + esac + return 1 +} + +# determine the package and targets + +case $action in +admin) case $admin_action in + results)action=$admin_action + set '' $admin_args + shift;shift + admin_args="admin $*" + case $admin_on in + '') target=$admin_args ;; + *) target="on $admin_on $admin_args" ;; + esac + ;; + esac + ;; +release)set '' $args + target= + while : + do shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + target="$target $1" + ;; + *) break + ;; + esac + done + package=$* + ;; +setup) # { update read } with optional (bin|fun|include|lib) symlinks + # flat option sets up { bin fun include lib } symlinks from + # $INSTALLROOT to $PACKAGEROOT + + # . is the package root + + set '' $args + shift + types= + url= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + flat) flat=1 # backwards compatibility -- documentation dropped + ;; + *://*|*.url) + url=$1 + shift + break + ;; + *) types="$types $1" + ;; + esac + shift + done + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + fi + case " $types " in + *" source "*) + case " $* " in + ' ') ;; + *" INIT "*) + ;; + *) view - all src/cmd/INIT || + set INIT "$@" + ;; + esac + ;; + esac + packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT` + case $packages in + ?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT + esac + exit + ;; +*) package= + target= + set '' $args + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + ''|-) target="$target $package" + package= + ;; + *) if view - src "lib/package/$1.pkg" + then package="$package $1" + else target="$target $package $1" + package= + fi + ;; + esac + done + ;; +esac + +# flatten -- assumes symlink support + +case $flat in +1) case $action in + make|read|setup|update|use|view) + if test ! -d $INSTALLROOT + then $exec mkdir -p $INSTALLROOT || exit + fi + for i in bin include lib fun man share + do if test ! -d $INSTALLROOT/../../$i + then $exec mkdir $INSTALLROOT/../../$i + fi + if test ! -d $INSTALLROOT/$i + then if test ! -h $INSTALLROOT/$i + then $exec ln -s ../../$i $INSTALLROOT/$i + fi + elif test ! -h $INSTALLROOT/$i + then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/* + do if test -f $x -o -d $x + then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x + then $exec mv $x $INSTALLROOT/../../$i + fi + fi + done + $exec rm -rf $INSTALLROOT/$i + $exec ln -s ../../$i $INSTALLROOT/$i + fi + done + ;; + esac + ;; +esac + +# check that cmd args are up to date a.out's + +checkaout() # cmd ... +{ + case $PROTOROOT in + -) PROTOROOT= + case $* in + ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT + then test -f $INITROOT/hello.c || { + cat > $INITROOT/hello.c <<'!' +#ifndef printf +#include +#endif +int main() { int new = 0; printf("hello world\n"); return new;} +! + } + test -f $INITROOT/p.c || { + cat > $INITROOT/p.c <<'!' +/* + * small test for prototyping cc + */ + +int main(int argc, char** argv) { return argc || argv; } +! + } + fi + ;; + esac + test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || { + for i + do onpath $i || { + echo "$command: $i: command not found" >&2 + return 1 + } + done + return 0 + } + case $cc in + '') _PACKAGE_cc=0 + ;; + *) _PACKAGE_cc=1 + test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { + echo "$command: $INITROOT: INIT package source not found" >&2 + return 1 + } + executable $INSTALLROOT/bin/nmake || { + # check for prototyping cc + # NOTE: proto.c must be K&R compatible + + $CC -c $INITROOT/p.c >/dev/null 2>&1 + c=$? + rm -f p.* + test 0 != "$c" && { + checkaout proto || return + PROTOROOT=$PACKAGEROOT/proto + $show PROTOROOT=$PACKAGEROOT/proto + export PROTOROOT + INITPROTO=$PROTOROOT/src/cmd/INIT + note proto convert $PACKAGEROOT/src into $PROTOROOT/src + if test -d $PACKAGEROOT/src/cmd/nmake + then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" + else dirs="src" + fi + ( + if test -f $PROTOROOT/UPDATE + then newer="-newer $PROTOROOT/UPDATE" + else newer="" + fi + case $exec in + '') cd $PACKAGEROOT + find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto + ;; + *) $exec cd $PACKAGEROOT + $exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto" + ;; + esac + $exec touch $PROTOROOT/UPDATE + ) + VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + } + } + for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return + done + ;; + esac + ;; + esac + case $_PACKAGE_cc in + '') case $cc in + '') _PACKAGE_cc=0 ;; + *) _PACKAGE_cc=1 ;; + esac + ;; + esac + for i + do eval j=\$_PACKAGE_AOUT_$i + case $j in + '') eval _PACKAGE_AOUT_$i=1 ;; + *) continue ;; + esac + k=$_PACKAGE_cc + if test -f $INITROOT/$i.c + then k=${k}1 + else k=${k}0 + fi + if executable $EXECROOT/bin/$i + then k=${k}1 + else k=${k}0 + fi + : $k : compiler : source : binary : + case $k in + *00) view - bin/$i && continue ;; + esac + case $k in + 000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 110) case $CROSS in + 1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2 + return 1 + ;; + esac + ;; + ?01) : accept binary + continue + ;; + 011) : accept binary + continue + ;; + ??1) case $CROSS in + 1) continue ;; + esac + ;; + esac + case `ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.c"*) + note update $INSTALLROOT/bin/$i + if test proto != "$i" && executable $INSTALLROOT/bin/proto + then case $exec in + '') $INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c || return ;; + *) $exec "$INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c" ;; + esac + $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $i.c || return + $exec rm -f $i.c + else if test ! -d $INSTALLROOT/bin + then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return + done + fi + if test '' != "$PROTOROOT" -a -f $INITPROTO/$i.c + then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return + else $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return + fi + case $i:$exec in + proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include + $INSTALLROOT/bin/proto -f /dev/null > $i.c + cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h + rm $i.c + ;; + esac + fi + test -f $i.o && $exec rm -f $i.o + i=$PATH + PATH=/bin + PATH=$i + ;; + esac + done + return 0 +} + +# check package requirements against received packages + +requirements() # source|binary [ package ] +{ + case $1 in + binary) r=$VIEW_BIN ;; + source) r=$VIEW_SRC ;; + *) r=$VIEW_ALL ;; + esac + shift + case $1 in + '') x= ;; + *) x=$* ;; + esac + set '' + for d in $r + do set "$@" $d/gen/*.ver + case $x in + '') set "$@" $d/gen/*.req + ;; + *) for p in $x + do set "$@" $d/gen/$p.req + done + ;; + esac + done + shift + e=0 + x=$* + y= + n= + set '' + for i in $x + do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'` + if test -f $i + then set "$@" $i + y="$y $p" + else case $p in + '*') ;; + *) n="$n $p" ;; + esac + fi + done + for i in $n + do case " $y " in + *" $i "*) + ;; + *) echo "$command: $i: must read or write package" >&2 + e=1 + ;; + esac + done + case $e in + 1) exit 1 ;; + esac + shift + test 0 != "$#" && release=`sort -r "$@" | { + q= + e=0 + o= + while read p v r s + do q="$q +$v $r" + case $p in + $o) continue ;; + esac + case $s in + 0) e=1 + case $r in + base) echo "$command: base package $p.$v or newer required" >&2 ;; + *) echo "$command: delta package $p.$v.$r or newer required" >&2 ;; + esac + ;; + esac + o=$p + done + case $e in + 0) echo "$q" | sort | { read v r; read v r; echo $v; } ;; + 1) echo ERROR ;; + esac + }` + case $release in + ERROR) case $force in + 0) exit 1 ;; + esac + ;; + ?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'` + # slide back 4 months + case $mm in + 01) mm=09 dd=1 ;; + 02) mm=10 dd=1 ;; + 03) mm=11 dd=1 ;; + 04) mm=12 dd=1 ;; + 05) mm=01 dd=0 ;; + 06) mm=02 dd=0 ;; + 07) mm=03 dd=0 ;; + 08) mm=04 dd=0 ;; + 09) mm=05 dd=0 ;; + 10) mm=06 dd=0 ;; + 11) mm=07 dd=0 ;; + 12) mm=08 dd=0 ;; + esac + case $dd in + 1) yy=`expr $yy - 1` ;; + esac + release=$yy-$mm-01 + count=1 + lo=$release + release="-f $release -r $count" + ;; + esac +} + +# write ordered package prerequisite list to the standard output + +order() # [ package ] +{ + _order_t_=lib/package/tgz + case $action in + binary) _order_a_=.$HOSTTYPE ;; + *) _order_a_= ;; + esac + _order_n_=$# + case $_order_n_ in + 0) _order_p_= + for _order_v_ in $VIEW_all + do for _order_f_ in $_order_v_/lib/package/*.pkg + do if test -f $_order_f_ + then _order_p_="$_order_p_ $_order_f_" + fi + done + done + set '' $_order_p_ + shift + esac + { + if test ratz != "$*" + then for _order_f_ in ratz INIT + do if view -s - src $_order_t_/$_order_f_$_order_a_.tim + then echo $_order_f_ $_order_f_ + fi + done + fi + for _order_f_ + do while : + do view - src $_order_f_ && break + case $_order_f_ in + *.pkg) ;; + *) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;; + esac + case $_order_f_ in + */*) ;; + *) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;; + esac + echo "$command: $_order_f_: not a package" >&2 + continue 2 + done + _order_f_=$_view_ + _order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'` + case $_order_n_ in + 0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;; + esac + echo $_order_p_ $_order_p_ + case $_order_p_ in + INIT|ratz) + ;; + *) echo INIT $_order_p_ + ;; + esac + { + req= req_sep= + op=:: + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + for _order_i_ in $req + do if view - src lib/package/$_order_i_.pkg + then case $_order_u_ in + 0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;; + esac + echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_ + fi + done + } < $_order_f_ + done + } | tsort +} + +# generate the package component list in _components_ + +components() # [ package ] +{ + _components_= + for p + do case $p in + '') ;; + INIT) case " $_components_ " in + *" $p "*) ;; + *) _components_="$_components_ $p" ;; + esac + ;; + *) if view - src lib/package/$p.pkg + then p=$_view_ + op=:: + exec < $p + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :PACKAGE:) + case " $_components_ " in + *" $1 "*) ;; + *) _components_="$_components_ $1" ;; + esac + ;; + esac + ;; + esac + done + done + exec < /dev/null + elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p + then _components_="$_components_ $p" + else echo "$command: $p: package or component not found" >&2 + exit 1 + fi + ;; + esac + done +} + +# list main environment values + +showenv() +{ + case $1 in + ''|make)for __i__ in CC SHELL $env + do eval echo $__i__='$'$__i__ + done + ;; + esac +} + +# capture command output + +capture() # file command ... +{ + case $make:$noexec in + :) case $action in + install|make|view) + o=$action + ;; + *) case $package in + ''|*' '*) + o=$action + ;; + *) o=$package + ;; + esac + ;; + esac + case $action in + write) d=$PACKAGESRC/gen ;; + *) d=$PACKAGEBIN/gen ;; + esac + test -d $d || $exec mkdir $d + o=$d/$o + case $o in + $output)o=$o.out + s= + ;; + *) output=$o + if test -f $o.old + then mv $o.old $o.out.1 + if test -f $o.out + then mv $o.out $o.out.2 + fi + elif test -f $o.out + then for i in `ls -t $o.out.? 2>/dev/null` + do break + done + case $i in + *.1) i=2 ;; + *.2) i=3 ;; + *.3) i=4 ;; + *.4) i=5 ;; + *.5) i=6 ;; + *.6) i=7 ;; + *.7) i=8 ;; + *.8) i=9 ;; + *) i=1 ;; + esac + mv $o.out $o.out.$i + fi + o=$o.out + : > $o + note $action output captured in $o + s="$command: $action start at `date` in $INSTALLROOT" + case $quiet in + 0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;; + *) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;; + esac + ;; + esac + case $quiet in + 0) if executable ! $TEE + then TEE=tee + fi + # Connect 'tee' to a FIFO instead of a pipe, so that the build is invoked from + # the main shell environment and its exit status can be used for $error_status + rm -f $o.fifo + mkfifo -m 600 $o.fifo || exit + ( + sleep 1 + # unlink early + exec rm $o.fifo + ) & + $TEE -a $o < $o.fifo & + { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o.fifo 2>&1 + ;; + *) { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o 2>&1 + ;; + esac + ;; + *) $make "$@" + ;; + esac + exit_status=$? + if test "$exit_status" -gt "$error_status" + then error_status=$exit_status + fi +} + +package_install() # dest sum +{ + dest=$1 sum=$2 + ot= + code=0 + sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum | + while read mode user group arch dir file + do case $flat:$arch in + 1:*|?:.)t=$dest/$dir ;; + *) t=$dest/$arch/$dir ;; + esac + case $t in + $ot) ;; + *) if test ! -d "$t" + then $exec mkdir -p "$t" || exit + fi + ot=$t + ;; + esac + case $file in + ?*) case $arch in + .) f=$dir/$file ;; + *) f=$arch/$dir/$file ;; + esac + if test -f "$f" + then t=$t/$file + case $quiet in + 0) echo "$t" ;; + esac + $exec cp -f "$f" "$t" || code=1 + $exec chmod $mode "$t" || code=1 + fi + ;; + esac + done + return $code +} + +package_verify() # sum +{ + $exec $SUM -cp $1 +} + +make_recurse() # dir +{ + for _make_recurse_j in $makefiles + do if view - $1/$_make_recurse_j + then return + fi + done +} + +get() # host path [ file size ] +{ + case $HURL in + '') HURL=. + for i in wget lynx curl + do if onpath $i + then HURL=$i + break; + fi + done + AUTHORIZE="User-Agent: package AT&T Research\\r\\n" + case $HURL:$authorize in + .:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;; + esac + ;; + esac + getfd=8 + case $3 in + '') case $HURL in + .) host=$1 + path=$2 + while : + do eval "exec $getfd<> /dev/tcp/$host/80" || exit + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + cat <&8 > get.tmp + got=`sed -e 1q get.tmp` + case $got in + *" "200" "*) + got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d' get.tmp` + : > get.err + code=0 + break + ;; + *" "30[123]" "*) + got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp` + case $got in + '') rm get.tmp + echo "$command: $action: $url: redirect error" >&2 + exit 1 + ;; + esac + eval $got + ;; + *) rm get.tmp + echo "$command: $action: $url: $got" >&2 + echo '' "$got" > get.err + code=1 + break + ;; + esac + done + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err + code=$? + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp 2>/dev/null` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm -f get.tmp get.err + echo $command: $action: $2: download failed >&2 + exit 1 + fi + rm -f get.tmp get.err + ;; + *) case $exec in + '') echo "$3 ($4 bytes):" >&2 + case $HURL in + .) eval "exec $getfd<> /dev/tcp/$1/80" || exit + path=$2/$3 + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + read got <&$getfd + case $got in + *" 200 "*) + code=0 + : > get.err + ;; + *) echo '' "$got" > get.err + code=1 + ;; + esac + while read got <&$getfd + do case $got in + ''|?) break ;; + esac + done + cat <&$getfd > get.tmp + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$? + esac + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err + code=$? + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm get.tmp get.err + echo $command: $action: $3: download failed >&2 + exit 1 + fi + rm get.err + case $checksum:$5 in + :*|*:-) z=`wc -c < get.tmp` + case " $z " in + *" $4 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download error: expected $4 bytes, got $z >&2 + exit 1 + ;; + esac + ;; + *) z=`$checksum < get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + case " $z " in + *" $5 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download $checksum error: expected $5, got $z >&2 + exit 1 + ;; + esac + ;; + esac + mv get.tmp $3 || exit + ;; + *) echo "$3 ($4 bytes)" >&2 + ;; + esac + esac +} + +# generate copyright notice + +copyright() +{ + if test -f $1.lic + then echo $1 package general copyright notice + echo + proto -c'#' -p -s -l $1.lic -o type=verbose,author='*' /dev/null + return 0 + fi + case $1 in + *-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'` + if copyright $__i__ || copyright $__j__ + then return 0 + fi + ;; + esac + return 1 +} + +# run remote make on host + +remote() # host no-exec-background +{ + host=$1 + background=$2 + eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log + case $keep in + 1*) ;; + *) return ;; + esac + case $host in + $main) ;; + *) case $exec in + '') exec > $admin_log/$log 2>&1 ;; + *) echo "exec > $admin_log/$log 2>&1" ;; + esac + ;; + esac + if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1 + then cmd=". ./.profile" + case $root in + .) root= + ;; + *) cmd="$cmd && cd $root" + root=$root/ + ;; + esac + cmd="$cmd && { test -f lib/package/admin/$admin_env && . ./lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='" + case $admin_binary in + '') snarf= ;; + esac + case $snarf in + '') $exec $rsh $user$name "$cmd" $background + ;; + *?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp + case $background in + ?*) $exec "{" ;; + esac + $exec $rsh $user$name "$cmd" + eval lst=$admin_list + case $admin_pkgs in + '') filter=cat ;; + *) filter="egrep lib/package/tgz/($admin_pkgs)\\." ;; + esac + if $exec $rcp $user$name:${root}lib/package/tgz/$lst $PACKAGESRC/tgz + then $exec $rcp `$filter $PACKAGESRC/tgz/$lst | sed "s,^,$user$name:,"` $PACKAGESRC/tgz + else echo "$command: $user$name:${root}lib/package/tgz/$lst: not found" >&2 + fi + case $background in + ?*) $exec "} $background" ;; + esac + ;; + esac + else echo "$command: $name: down" >&2 + fi +} + +# update package_src + +checksrc() +{ + case $package_src in + '') package_src=$src + for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>/dev/null | sed 's/[-.].*//'` + do case " $package_src " in + *" $_i_ "*) + ;; + *) package_src="$package_src $_i_" + ;; + esac + done + ;; + esac +} + +# check for native ascii 0:yes 1:no + +__isascii__= + +isascii() +{ + case $__isascii__ in + '') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in + 005101|040412) __isascii__=0 ;; + *) __isascii__=1 ;; + esac + esac + return $__isascii__ +} + +error_status=0 + +case $action in + +admin) while test ! -f $admin_db + do case $admin_db in + /*) echo $command: $action: $admin_db: data file not found >&2 + exit 1 + ;; + esac + view file src lib/package/admin/$admin_db || exit 1 + admin_db=$_view_ + done + admin_components= + case $admin_action in + list) cat $admin_db + exit + ;; + test) set $admin_args + while : + do case $# in + 1) break ;; + esac + shift + case $1 in + *=*) ;; + *) admin_components=-$1 + break + ;; + esac + done + ;; + esac + : all work done in $PACKAGESRC/admin + cd $PACKAGESRC/admin || exit + checksrc + packages= + admin_log=${admin_action}${admin_components}.log + exec < $admin_db || exit + test -d $admin_log || $exec mkdir $admin_log || exit + case $admin_on in + '') admin_on="*" ;; + esac + hostname= + hosts= + logs= + local_hosts= + local_types= + pids= + remote_hosts= + sync_hosts= + admin_host=_admin_host_ + admin_out= + case " $admin_args " in + *" write binary "*|*" write "*" binary "*) + admin_binary=1 + ;; + *) admin_binary= + ;; + esac + case $only in + 1) admin_args="only $admin_args" ;; + esac + trap 'kill $pids >/dev/null 2>&1' 1 2 3 15 + index=0 + while read type host root date time make test write owner attributes + do case $type in + ''|'#'*);; + *=*) eval "$type $host $root $date $time $make $test $write $owner $attributes" + ;; + *) case $admin_action in + make|test|write) + eval f='$'$admin_action + case $f in + *[!0123456789]*) continue ;; + esac + ;; + esac + rsh=rsh + case $host in + *@*) IFS=@ + set '' $host + IFS=$ifs + user=${2}@ + host=$3 + ;; + *) user= + ;; + esac + : type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write : + name=$host + host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'` + eval x='$'${host}_index + eval ${host}_index=1 + case $x in + 1) i=0 + while : + do case $i in + $index) h='' + break + ;; + esac + i=`expr $i + 1` + eval h='$'${admin_host}${i}_name + case $h in + $host) host=${admin_host}${i} + eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root + break + ;; + esac + done + ;; + esac + case $root in + *:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;; + esac + case $root in + *:*:*) index=`expr $index + 1` + host=${admin_host}$index + ;; + *:*) case " $sync_hosts " in + *" $name ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $name) host=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + sync_hosts="$sync_hosts $name $host" + ;; + esac + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + ;; + esac + case $root in + -*) continue + ;; + *:*) case $admin_all in + 0) continue ;; + esac + case $root in + *:) root=${root}. ;; + esac + IFS=: + set '' $root + IFS=$ifs + sync=$host + case $hostname in + '') hostinfo name + hostname=$_hostinfo_ + ;; + esac + shift + case $# in + 0) ;; + 1) root=$1 + ;; + 2) rsh=$1 root=$2 + ;; + *) rsh=$1 sync=$2 root=$3 + case $sync in + ${admin_host}*) + ;; + ?*) case " $sync_hosts " in + *" $sync ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $sync) sync=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + x=${admin_host}$index + sync_hosts="$sync_hosts $sync $x" + sync=$x + ;; + esac + ;; + esac + ;; + esac + ;; + *) sync= + ;; + esac + case $name in + $admin_on) + keep=1 + ;; + *) case " $admin_on " in + *" $name "*) keep=1 ;; + *) keep=0 ;; + esac + ;; + esac + case " $admin_out " in + *" $name "*) + log=$name.$type + ;; + *) admin_out="$admin_out $name" + log=$name + ;; + esac + case $sync in + '') local_types="$local_types $type" ;; + esac + case $sync in + $host) remote_hosts="$remote_hosts $host" + ;; + ?*) eval ${sync}_share=\"\$${sync}_share $host\" + ;; + '') local_hosts="$local_hosts $host" + ;; + esac + eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log + ;; + esac + done + p= + for i in $admin_args + do p="$i $p" + done + admin_pkgs= + for i in $p + do if view - src "lib/package/$i.pkg" + then case $admin_pkgs in + '') admin_pkgs="$i" ;; + *) admin_pkgs="$admin_pkgs|$i" ;; + esac + fi + done + : "admin_binary :" $admin_binary + : "admin_args :" $admin_args + : "admin_pkgs :" $admin_pkgs + : "admin_on :" "$admin_on" + : "local_hosts :" $local_hosts + : "local_types :" $local_types + : "remote_hosts :" $remote_hosts + : "sync_hosts :" $sync_hosts + : "sync_share :" $sync_share + case $admin_binary in + 1) admin_bin_types= + admin_bin_main= + for main in $local_hosts $remote_hosts + do eval share=\$${main}_share keep=\$${main}_keep + case $keep in + 0*) continue ;; + esac + for host in $main $share + do case " $admin_bin_hosts " in + *" $host "*) + continue + ;; + esac + eval type=\$${host}_type + case " $admin_bin_types " in + *" $type "*) + continue + ;; + esac + case " $types " in + " ") ;; + *" $type "*) + ;; + *) continue + ;; + esac + admin_bin_hosts="$admin_bin_hosts $host" + admin_bin_types="$admin_bin_types $type" + case " $admin_bin_hosts " in + *" $main "*) + ;; + *) case " $admin_bin_main " in + *" $main "*) + ;; + *) admin_bin_main="$admin_bin_main $main" + ;; + esac + ;; + esac + done + done + local= + remote= + for host in $admin_bin_main $admin_bin_hosts + do case " $local_hosts " in + *" $host "*) + local="$local $host" + ;; + *) case " $remote_hosts " in + *" $host "*) + remote="$remote $host" + ;; + esac + ;; + esac + done + local_hosts=$local + remote_hosts=$remote + ;; + esac + for host in $remote_hosts $local_hosts + do eval share=\$${host}_share + case $share in + ?*) while : + do oshare=$share + for s in $share + do eval r='$'${s}_share + case $r in + ?*) case " $share " in + *" $r "*) ;; + *) share="$share $r" ;; + esac + ;; + esac + done + case $share in + $oshare) eval ${host}_share="'$share'" + break + ;; + esac + done + ;; + esac + done + for host in $remote_hosts + do eval type=\$${host}_type + case " $local_types " in + *" $type "*) + eval ${host}_snarf= + ;; + esac + eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share + for share in $share + do eval type=\$${share}_type keep=\$keep\$${share}_keep + case " $local_types " in + *" $type "*) + eval ${share}_snarf= + ;; + esac + done + case $keep in + 0*1*) keep=2$keep ;; + *1*) ;; + *) keep=0 ;; + esac + eval ${host}_keep=$keep + done + for host in $remote_hosts $local_hosts + do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep + case $keep in + 0*) continue ;; + esac + case $sync in + '') case $admin_action in + ditto) continue ;; + esac + case $admin_binary in + 1) case $keep in + 1*|?*1*);; + *) continue ;; + esac + ;; + esac + ;; + esac + eval main_log='$'${host}_log + main= + share_keep= + for i in $host $share + do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep + case $main:$k in + :*) ;; + *:0) continue ;; + esac + case $admin_binary in + 1) case $s:$q in + :?*) continue ;; + esac + case " $admin_bin_hosts " in + *" $i "*) + ;; + *) continue + ;; + esac + ;; + esac + case $main in + '') main=$i ;; + *) share_keep="$share_keep $i" ;; + esac + echo package "$admin_args" "[ $n $t ]" + case $exec in + '') : > $admin_log/$l ;; + *) $exec ": > $admin_log/$l" ;; + esac + done + host=$main + share=$share_keep + case $force in + 0) admin_ditto_update=--update ;; + *) admin_ditto_update= ;; + esac + case $exec in + '') { + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin + test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 & + pids="$pids $!" + ;; + esac + done + case $pids in + ?*) wait $pids ;; + esac + ;; + esac + } < /dev/null > $admin_log/$main_log 2>&1 & + pids="$pids $!" + ;; + *) echo "{" + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 "&" + pids=1 + ;; + esac + done + case $pids in + 1) echo wait ;; + esac + ;; + esac + echo "} < /dev/null > $admin_log/$main_log 2>&1 &" + ;; + esac + eval name='$'${main}_name + hosts="$hosts $name" + logs="$logs $main_log" + for share in $share + do eval keep=\$${share}_keep + case $keep in + 1) eval name='$'${share}_name log='$'${share}_log + hosts="$hosts $name" + logs="$logs $log" + ;; + esac + done + done + case $exec in + '') # track the progress + case $quiet in + 0) cd $admin_log + tail -t $PACKAGE_admin_tail_timeout -f $logs + cd .. + ;; + esac + # wait for the remote actions to complete + wait + trap - 1 2 3 15 + # update the db + exec < $admin_db || exit + exec 9>&1 + D=`date +%y%m%d` + while read line + do set -- $line + case $1 in + ''|'#'*|*=*) + ;; + *) case " $hosts " in + *" $2 "*) + : ast date command assumed : + E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\`` + M=$6 T=$7 W=$8 + case $admin_action in + make|view) + M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;; + test) T=`grep -ci 'fail[es]' $admin_log/$2` ;; + *) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;; + esac + case $1 in + ?|??|???|????|?????|??????|???????) + t1=' ' + ;; + ????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????) + t1=' ' + ;; + *) t1='' + ;; + esac + case $2 in + ?|??|???|????|?????|??????|???????) + t2=' ' + ;; + *) t2='' + ;; + esac + case $3 in + ?|??|???|????|?????|??????|???????) + t3=' ' + ;; + *) t3='' + ;; + esac + case $E in + ?????) E=" $E" ;; + ????) E=" $E" ;; + ???) E=" $E" ;; + ??) E=" $E" ;; + ?) E=" $E" ;; + esac + case $M in + ???) M="$M" ;; + ??) M=" $M" ;; + ?) M=" $M" ;; + '') M=" 0" ;; + esac + case $T in + ???) T="$T" ;; + ??) T=" $T" ;; + ?) T=" $T" ;; + '') T=" 0" ;; + esac + case $W in + ???) W="$W" ;; + ??) W=" $W" ;; + ?) W=" $W" ;; + '') W=" 0" ;; + esac + A=$1$t1 + H=$2$t2 + R=$3$t3 + case $# in + [0-8]) O= + K= + ;; + *) shift 8 + O=$1 + K=$2 + case $O in + ''|?|??|???) K=" $K" ;; + esac + case $# in + [0-2]) ;; + *) K="$K $*" ;; + esac + ;; + esac + echo "$A $H $R $D $E $M $T $W $O $K" + echo "$A $H $R $D $E $M $T $W $O $K" >&9 + continue + ;; + esac + ;; + esac + echo "$line" + done > $admin_db.new + mv $admin_db $admin_db.old + mv $admin_db.new $admin_db + ;; + esac + ;; + +clean|clobber) + cd $PACKAGEROOT + $exec rm -rf arch/$HOSTTYPE + if test "$flat" = 1 + then $exec rm -rf \ + bin/.paths \ + bin/ar \ + bin/cc \ + bin/crossexec \ + bin/ditto \ + bin/filter \ + bin/hurl \ + bin/iffe \ + bin/ksh \ + bin/mamake \ + bin/mktest \ + bin/ok/ \ + bin/proto \ + bin/pty \ + bin/ratz \ + bin/regress \ + bin/release \ + bin/rt \ + bin/shcomp \ + bin/suid_exec \ + bin/*.old \ + fun/ \ + include/ \ + lib/file/ \ + lib/lib/ \ + lib/libast.a \ + lib/libcmd.a \ + lib/libdll.a \ + lib/libshell.a \ + lib/libsum.a \ + lib/*.old \ + lib/make/ \ + lib/package/gen/ \ + lib/probe/ \ + man/ + fi + exit + ;; + +contents|list) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' *.pkg + case $2 in + '*.pkg') + echo $command: $action: no packages >&2 + exit 1 + ;; + esac + set '' `echo $* | sed 's,\.pkg,,g'` + shift + ;; + esac + sep="$nl " + echo packages in $PACKAGEROOT + case $action in + list) echo + echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t + ;; + esac + { + omit=: + for pkg + do if test ! -f $pkg.pkg + then echo $command: $action: $pkg: not a package >&2 + else if test -f gen/$pkg.ver + then set '' `cat gen/$pkg.ver` + case $3 in + $2) ver=base ;; + *) ver=$3 ;; + esac + if test -s tgz/$pkg.tim + then sts=local + else sts= + fi + else ver= + sts=unwritten + fi + typ= + txt= + cmp= cmp_sep= + req= req_sep= + op=:: + exec < $pkg.pkg + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :DESCRIPTION:) + txt="$txt$sep$line" + break + ;; + :PACKAGE:) + cmp="$cmp$cmp_sep$1" + cmp_sep=$nl + ;; + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + exec < /dev/null + case $txt in + ?*) txt="$nl$txt" ;; + esac + case :$ver: in + *::*) ;; + *) case $action in + list) case $sts in + '') case `ls -t "tgz/$pkg.$ver.base" "tgz/$pkg.tim" 2>/dev/null` in + "tgz/$pkg.tim"*) + sts=read + ;; + *) sts=unread + ;; + esac + ;; + esac + echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req" + case $typ in + '') omit=$omit$pkg.$ver.base: ;; + esac + ;; + *) case $req in + ?*) req=": $req" ;; + esac + echo + echo $pkg $ver $req "$txt" + case $cmp in + ?*) echo "${sep}Components in this package:$nl" + echo "$cmp" | pr -4 -o4 -t ;; + esac + ;; + esac + ;; + esac + fi + done + case $argc:$action in + 0:list) if test -d tgz + then cd tgz + # f:file p:package v:version r:release t:type u:update + for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r` + do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $t in + '') case $omit in + *:$p.$v.$r:*) continue ;; + esac + u=$p.tim + ;; + *) u=$p.$t.tim + ;; + esac + if test -s "$u" + then s=local + elif test -f "$u" + then case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) s=read ;; + *) s=unread ;; + esac + else s=unread + fi + echo "$p$nl$v$nl$r$nl$t$nl$s$nl" + done + fi + ;; + esac + } | + case $action in + list) pr -6 -a -o4 -t | sort -u ;; + *) cat ;; + esac + case $argc in + 0) if test -d $PACKAGEROOT/arch + then echo + echo architectures in $PACKAGEROOT + echo + for i in `ls $PACKAGEROOT/arch` + do if test -f $PACKAGEROOT/arch/$i/lib/package/gen/host + then h=`cat $PACKAGEROOT/arch/$i/lib/package/gen/host` + else h= + fi + echo $i + echo $h + echo + echo + done | pr -4 -a -o4 -t + fi + ;; + esac + ;; + +copyright) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' `echo *.lic | sed 's,\.lic,,g'` + shift + case $1 in + '*') echo $command: $action: no packages >&2 + exit 1 + ;; + esac + ;; + esac + checkaout proto || exit + for i + do copyright $i + done + ;; + +export) case $INSTALLROOT in + $PACKAGEROOT) + INSTALLROOT=$INSTALLROOT/arch/$HOSTTYPE + ;; + esac + case $only in + 0) v='$i=' ;; + *) v= ;; + esac + set '' $target $package + case $# in + 1) set '' $env ;; + esac + while : + do case $# in + 1) break ;; + esac + shift + i=$1 + eval echo ${v}'$'${i} + done + ;; + +install)cd $PACKAGEROOT + set '' $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + package=$* + requirements - $package + set '' $target + shift + case $1 in + flat) flat=1 # backwards compatibility -- documentation dropped + shift + ;; + esac + case $# in + 0) echo "$command: $action: target directory argument expected" >&2 + exit 1 + ;; + esac + target= + while : + do case $# in + 1) directory=$1 + break + ;; + esac + target="$target $1" + shift + done + if test ! -d $directory + then echo "$command: $action: $directory: target directory not found" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + makecheck=1 + for a in $target + do case $a in + -) a=$HOSTTYPE ;; + esac + case $flat:$a in + 1:*|?:.)dest=$directory + ;; + *) dest=$directory/arch/$a + if test "" = "$exec" -a ! -d $dest + then mkdir -p $dest || { + echo "$command: $dest: destination directory must exist" >&2 + exit 1 + } + fi + ;; + esac + for i in $package + do if test "ratz" = "$i" + then : skip + elif test -f arch/$a/lib/package/gen/$i.sum + then package_install $directory arch/$a/lib/package/gen/$i.sum || code=1 + elif test ! -d arch/$a/bin + then echo "$command: $a: invalid architecture" >&2 + elif test ! -d $dest + then echo "$command: $dest: destination directory must exist" >&2 + else if test "" != "$makecheck" + then if onpath $MAKE + then MAKE=$_onpath_ + else echo "$command: $MAKE: not found" >&2 + exit 1 + fi + makecheck= + fi + if test "" != "$exec" + then ( + trap - 0 1 2 15 + echo "=== $i installation manifest ===" + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u + ) + else ( + set - + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + echo lib/$command + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u | pax -drw -ps $dest + ) + fi + fi + done + done + exit $code + ;; + +license)# all work in $PACKAGESRC/LICENSES + + cd $PACKAGESRC/LICENSES || exit + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' * + shift + case $1 in + '*') echo $command: $action: no licenses >&2 + exit 1 + ;; + esac + ;; + *) checkaout proto || exit + a= + for i + do while : + do if test -f ../$i.lic + then j=`proto -df -l ../$i.lic -o query=type /dev/null 2>/dev/null` + case $j in + ?*) if test -f $j + then case " $a " in + *" $j "*) ;; + *) a="$a $j" ;; + esac + fi + break + ;; + esac + fi + case $i in + *-*) i=`echo $i | sed 's/-[^-]*$//'` + ;; + *) echo "$command: $i: package license not found" >&2 + break + ;; + esac + done + done + set '' $a + shift + ;; + esac + for i + do case $exec in + '') echo + echo " --- $i source license ---" + echo + cat $i + ;; + *) echo $PACKAGESRC/LICENSES/$i + ;; + esac + done + ;; + +make|view) + cd $PACKAGEROOT + case $package in + '') lic="lib/package/*.lic" + ;; + *) for i in $package + do lic="$lic lib/package/$i.lic" + case $i in + *-*) lic="$lic lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;; + esac + done + ;; + esac + checksrc + requirements source $package + components $package + package=$_components_ + + # check for some required commands + + must="$AR" + warn="$NM yacc bison" + test="$must $warn" + have= + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for t in $test + do if executable $t + then have="$have $t" + fi + done + for d + do for t in $test + do case " $have " in + *" $t "*) + ;; + *) if executable $d/$t + then have="$have $t" + fi + ;; + esac + done + done + case " $have " in + *" bison "*) ;; + *" yacc "*) have="$have bison" ;; + esac + case " $have " in + *" yacc "*) ;; + *" bison "*) have="$have yacc" ;; + esac + for t in $test + do case " $have " in + *" $t "*) + ;; + *) case " $must " in + *" $t "*) + echo "$command: $t: not found -- must be on PATH to $action" >&2 + exit 1 + ;; + *) echo "$command: warning: $t: not found -- some $action actions may fail" >&2 + ;; + esac + ;; + esac + done + + # verify the top view + + if test ! -d $PACKAGEROOT/src + then note no source packages to make + exit 0 + elif test ! -d $INSTALLROOT/src + then note initialize the $INSTALLROOT view + fi + for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in bin bin/$OK bin/$OK/lib fun include lib lib/package lib/package/gen src man man/man1 man/man3 man/man8 + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + make_recurse src + o= k= + for i in $makefiles + do case $o in + ?*) o="$o -o" k="$k|" ;; + esac + o="$o -name $i" + k="$k$i" + done + o="( $o ) -print" + for d in $package_src + do i=src/$d + if test -d $i + then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + make_recurse $i + for j in `cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u` + do case $j in + $k|$MAKESKIP) continue ;; + esac + test -d $INSTALLROOT/$i/$j || + $exec mkdir -p $INSTALLROOT/$i/$j || exit + done + fi + done + def= + for i in $lic + do test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + for j in `grep '^. .*\.def$' $i` + do case $j in + .) ;; + *) case " $def " in + *" $i "*) ;; + *) def="$def $i" ;; + esac + ;; + esac + done + done + for i in $def + do i=lib/package/$i + test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + done + + # check $CC and { ar cc ld ldd } intercepts + + h="${HOSTTYPE} ${HOSTTYPE}.*" + case $HOSTTYPE in + *.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'` + h="$h $t" + ;; + *) t=$HOSTTYPE + ;; + esac + case $t in + *[0123456789]) + t=`echo $t | sed 's/[0123456789]*$//'` + h="$h $t" + ;; + esac + case $CC in + cc) c=cc + b=$INSTALLROOT/bin/$c + t=$INSTALLROOT/lib/package/gen/$c.tim + intercept=0 + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + if cmp -s "$s" "$b" >/dev/null 2>&1 + then intercept=1 + break 2 + fi + case `ls -t "$t" "$b" "$s" 2>/dev/null` in + $t*) ;; + $b*) cc=$b + ;; + $s*) cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + eval '$'exec echo "'int main(){return 0;}' > $tmp.c" + if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && + test -x $tmp.exe + then case $HOSTTYPE in + *.mips*)$s -version >/dev/null 2>&1 || s= ;; + esac + case $s in + ?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit + $exec chmod +x "$b" || exit + cc=$b + intercept=1 + note update $b + ;; + esac + fi + $exec rm -f $tmp.* + $exec touch "$t" + cd $PACKAGEROOT + ;; + esac + break 2 + done + done + case $intercept in + 1) c=ld + b=$INSTALLROOT/bin/$c + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done + done + ;; + esac + ;; + esac + c=ldd + b=$INSTALLROOT/bin/$c + for t in $h + do s=$INITROOT/$c.$t + test -x "$s" || continue + onpath $c || + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done + c=ar + b=$INSTALLROOT/bin/$c + for t in $h + do s=$INITROOT/$c.$t + test -x "$s" || continue + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done +# following code stubbed out just in case ar.ibm.risc is needed +# c=ar +# b=$INSTALLROOT/bin/$c +# for t in $h +# do s=$INITROOT/$c.$t +# test -x "$s" || continue +# onpath $c || +# case `ls -t "$b" "$s" 2>/dev/null` in +# $b*) ;; +# $s*) x=`$s -tv /foo/bar.a 2>&1 | egrep -i 'option|usage'` +# case $x in +# '') $exec cp "$s" "$b" +# note update $b +# ;; +# esac +# ;; +# esac +# done + case $cc in + /*) ;; + *) echo "$command: $CC: not found -- set CC=C-compiler" >&2 + exit 1 + ;; + esac + case $exec in + '') cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + echo 'int main(){return 0;}' > $tmp.c + if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && + test -x $tmp.exe + then : ok + else echo "$command: $CC: failed to compile this program:" >&2 + cat $tmp.c >&2 + if test -s $tmp.err + then cat $tmp.err >&2 + else echo "$command: $CC: not a C compiler" >&2 + fi + rm -f $tmp.* + exit 1 + fi + rm -f $tmp.* + cd $PACKAGEROOT + ;; + esac + + # remember the default $CC + + case $CC in + cc) ;; + *) if test -x $INSTALLROOT/bin/cc + then case `sed 1q $INSTALLROOT/bin/cc` in + ": $CC :") + CC=cc + export CC + ;; + *) assign="$assign CC=\"\$CC\"" + ;; + esac + else case $CROSS in + 1) assign="$assign CC=\"\$CC\"" + ;; + *) case $exec in + '') { + echo ": $CC :" + echo "$CC \"\$@\"" + } > $INSTALLROOT/bin/cc + chmod +x $INSTALLROOT/bin/cc + ;; + *) note generate a $INSTALLROOT/bin/cc wrapper for $CC + ;; + esac + CC=cc + export CC + ;; + esac + fi + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update probe scripts + + for i in lib/probe lib/probe/C lib/probe/C/make + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + i=$INSTALLROOT/lib/probe/C/make/probe + j=$INITROOT/C+probe + k=$INITROOT/make.probe + case `ls -t $i $j $k 2>/dev/null` in + $i*) ;; + *) if test -f $j -a -f $k + then note update $i + shellmagic + case $exec in + '') { + case $SHELLMAGIC in + ?*) echo "$SHELLMAGIC" ;; + esac + cat $j $k + } > $i || exit + ;; + *) echo "{ +echo $SHELLMAGIC +cat $j $k +} > $i" + ;; + esac + $exec chmod +x $i || exit + fi + ;; + esac + fi + + # initialize a few mamake related commands + + checkaout mamake proto ratz release || exit + + # execrate if necessary + + if (execrate) >/dev/null 2>&1 + then execrate=execrate + $make cd $INSTALLROOT/bin + for i in chmod chgrp cmp cp ln mv rm + do if test ! -x $OK/$i -a -x /bin/$i.exe + then shellmagic + case $exec in + '') echo "$SHELLMAGIC"'execrate /bin/'$i' "$@"' > $OK/$i + chmod +x $OK/$i + ;; + *) $exec echo \'"$SHELLMAGIC"'execrate /bin/'$i' "$@"'\'' >' $OK/$i + $exec chmod +x $OK/$i + ;; + esac + fi + done + PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + else execrate= + fi + case $action in + view) exit 0 ;; + esac + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # record the build host name + + case $noexec in + '') hostinfo name + echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host + ;; + esac + + # make in parallel if possible + + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + + # separate flags from target list + + case $target in + *-*) a= + for t in $target + do case $t in + -[eiknFKNV]*|--*-symbols) + makeflags="$makeflags $t" + ;; + -*) nmakeflags="$nmakeflags $t" + ;; + *) a="$a $t" + ;; + esac + done + target=$a + ;; + esac + + # generate nmake first if possible + + if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake + then if nonmake $MAKE + then note make $NMAKE with mamake + c=$CC + a=$assign + case $HOSTTYPE in + win32*|cygwin*) + CC="$CC -D_BLD_STATIC" + accept="libast" + case $assign in + *' CC='*) ;; + *) assign="$assign CC=\"\$CC\"" ;; + esac + ;; + *) accept=nmake + ;; + esac + eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign + assign=$a + CC=$c + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + if test '' != "$PROTOROOT" + then VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + fi + note believe generated files for $accept + eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign + $exec touch $INSTALLROOT/bin/.paths + note make the remaining targets with $NMAKE + else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + fi + + # generate ksh next if possible + + if nonmake $MAKE + then : no need to generate ksh next -- it could be the only package + elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH + then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign + case $make$noexec in + '') if executable ! $KSH + then echo "$command: $action: errors making $KSH" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + + # mamprobe data should have been generated by this point + + case $exec in + '') if test ! -f $INSTALLROOT/bin/.paths -o -w $INSTALLROOT/bin/.paths + then N=' +' + b= f= h= n= p= u= B= L= + if test -f $INSTALLROOT/bin/.paths + then exec < $INSTALLROOT/bin/.paths + while read x + do case $x in + '#'?*) case $h in + '') h=$x ;; + esac + ;; + *BUILTIN_LIB=*) b=$x + ;; + *FPATH=*) f=$x + ;; + *PLUGIN_LIB=*) p=$x + ;; + *) case $u in + ?*) u=$u$N ;; + esac + u=$u$x + ;; + esac + done + fi + ifs=$IFS + m= + case $p in + ?*) b= + ;; + esac + case $b in + ?*) IFS='=' + set $b + IFS=$ifs + shift + p="PLUGIN_LIB=$*" + case $b in + [Nn][Oo]*) p=no$p ;; + esac + m=1 + ;; + esac + case $f in + '') f="FPATH=../fun" + m=1 + ;; + esac + case $h in + '') h='# use { no NO } prefix to permanently disable #' ;; + esac + case $p in + '') p="PLUGIN_LIB=cmd" + if grep '^setv mam_cc_DIALECT .* EXPORT=[AD]LL' $INSTALLROOT/lib/probe/C/mam/* >/dev/null 2>&1 + then p=no$p + fi + m=1 + ;; + esac + case $m in + 1) case $u in + ?*) u=$N$u ;; + esac + echo "$h$N$p$N$f$N$u" > $INSTALLROOT/bin/.paths + ;; + esac + fi + ;; + esac + + # run from separate copies since nmake and ksh may be rebuilt + + case $EXECROOT in + $INSTALLROOT) + $make cd $INSTALLROOT/bin + if executable /bin/cp + then cp=/bin/cp + else cp=cp + fi + if executable /bin/mv + then mv=/bin/mv + else mv=mv + fi + if executable /bin/rm + then rm=/bin/rm + else rm=rm + fi + for i in \ + ksh nmake tee cp ln mv rm \ + *ast*.dll *cmd*.dll *dll*.dll *shell*.dll + do executable $i && { + cmp -s $i $OK/$i 2>/dev/null || { + test -f $OK/$i && + $exec $execrate $rm $OK/$i &2 + exit 1 + ;; + esac + $exec $execrate $cp $i $OK/$i + } + } + done + if test -f ../lib/make/makerules.mo + then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo + fi + if executable $OK/nmake + then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib" + fi + if executable $OK/tee + then TEE=$INSTALLROOT/bin/$OK/tee + fi + if test "$KEEP_SHELL" != 1 && executable $OK/ksh + then SHELL=$INSTALLROOT/bin/$OK/ksh + export SHELL + fi + case :$PATH: in + *:$INSTALLROOT/bin/$OK:*) + ;; + *) PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + ;; + esac + $make cd $INSTALLROOT/src + ;; + esac + + # fall back to mamake if nmake not found or too old + + if nonmake $MAKE + then note make with mamake + case $target in + '') target="install" ;; + esac + eval capture mamake \$makeflags \$noexec \$target $assign + else case $target in + '') target="install cc-" ;; + esac + eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign + fi + ;; + +read) case ${PWD:-`pwd`} in + $PACKAGEROOT) + ;; + *) echo "$command: must be in package root directory" >&2 + exit 1 + ;; + esac + PAX= + if onpath pax + then case `$_onpath_ -rw --?meter 2>&1` in + *--meter*) PAX=pax ;; + esac + fi + code=0 + i= + x= + remove= + touch= + set '' $target + case $2 in + lcl|tgz)tgz=$2 + shift 2 + target=$* + ;; + *) tgz=tgz + ;; + esac + set '' $package $target + case $# in + 1) verbose=: + set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + ;; + *) verbose= + ;; + esac + shift + files= + for f + do if test -f "$f" + then : ok + elif test -f "lib/package/$tgz/$f" + then f=lib/package/$tgz/$f + else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else set '' `ls -r lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else echo "$command: $f: package archive not found" >&2 + continue + fi + fi + fi + files="$files $f" + done + case $files in + '') echo "$command: lib/package/$tgz: no package archives" >&2 + exit 1 + ;; + esac + set '' `ls -r $files 2>/dev/null` + shift + f1= f2= f3= f4= + for f + do case $f in + ratz.*|*/ratz.*) + f1="$f1 $f" + ;; + INIT.*|*/INIT.*) + f2="$f2 $f" + ;; + INIT*|*/INIT*) + f3="$f3 $f" + ;; + *) f4="$f4 $f" + ;; + esac + done + gen= + set '' $f1 $f2 $f3 $f4 + while : + do shift + case $# in + 0) break ;; + esac + f=$1 + case $f in + *.gz) : standalone packages unbundled manually + continue + ;; + *.md5) : tarball checksum + continue + ;; + *?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*) + ;; + *) echo "$command: $f: not a package archive" >&2 + code=1 + continue + ;; + esac + case $f in + */*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;; + *) d= a=$f ;; + esac + # f:file d:dir a:base p:package v:version r:release t:type + eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $r in + base) y=$p.base ;; + *) y=$p.delta ;; + esac + case " $x " in + *" $y "*) + continue + ;; + esac + case $t in + '') w=$PACKAGESRC + q= + Q= + m= + ;; + *) w=$PACKAGEROOT/arch/$t/lib/package + q=".$t" + Q="_$t" + m="[_.]$t" + ;; + esac + u=$d$p$q.tim + if test -s "$u" + then continue + else case $force in + 0) case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) case $verbose in + 1) note $p already read ;; + esac + continue + ;; + esac + ;; + esac + fi + case $p in + INIT) if test -f $PACKAGEROOT/bin/package + then $exec mv $PACKAGEROOT/bin/package $PACKAGEROOT/bin/package.old + fi + ;; + esac + z= + case $r in + base) # base archive + if test ratz = "$p" + then # ratz packages are not archives + case $t in + '') for i in src src/cmd src/cmd/INIT + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/src/cmd/INIT/$p.c + ;; + *) for i in arch arch/$t arch/$t/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/arch/$t/bin/$p && + $exec chmod +x $PACKAGEROOT/arch/$t/bin/$p + ;; + esac + elif test "" != "$PAX" + then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || { + code=1 + continue + } + else if onpath gunzip && onpath $TAR && isascii + then case $TARPROBE in + ?*) for i in $TARPROBE + do if $TAR ${i}f - /dev/null > /dev/null 2>&1 + then TARFLAGS=$TARFLAGS$i + fi + done + TARPROBE= + ;; + esac + if gunzip -l < "$f" > /dev/null 2>&1 + then case $exec in + '') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;; + *) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;; + esac || { + code=1 + continue + } + else $exec $TAR ${TARFLAGS}f "$f" || { + code=1 + continue + } + fi + else checkaout ratz && onpath ratz || { + code=1 + continue + } + RATZ=$_onpath_ + case $exec in + '') echo $f: + $exec $RATZ -lm < "$f" + ;; + *) $exec "$RATZ -lm < $f" + ;; + esac || { + code=1 + continue + } + fi + if test -f $PACKAGEBIN/gen/$p.sum + then while read md5 mode usr grp file + do case $file in + -*) file=./$file ;; + esac + case $mode in + [01234567][01234567][01234567][01234567]) + case $grp in + -) ;; + *) $exec chgrp $grp "$file" ;; + esac + case $usr in + -) ;; + *) $exec chown $usr "$file" ;; + esac + $exec chmod $mode "$file" + ;; + esac + done < $PACKAGEBIN/gen/$p.sum + fi + fi + ;; + *) # delta archive + test "" != "$PAX" || { + echo "$command: $f: pax required to read delta archive" >&2 + code=1 + continue + } + case `echo "$v: +$r:" | sort` in + $r:*) y=$p.base + b=${d}${p}_${r}${Q}.tgz + test -f "$b" || b=${d}${p}.${r}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + note $f: generate new base $d$p.$v$q.tgz + $exec pax -rf "$f" -z "$b" -wf $d$p.$v$q.tgz -x tgz || { + code=1 + continue + } + case $exec in + '') echo $p $v $v 1 > $w/gen/$p.ver + ;; + *) z=$d${p}[_.]$v$q.tgz + $exec "echo $p $v $v 1 > $w/gen/$p.ver" + gen="$gen $d$p.$v$q.tgz" + ;; + esac + case " $remove " in + *" $f "*) ;; + *) remove="$remove $f" ;; + esac + ;; + *) b=${d}${p}_${v}${Q}.tgz + test -f "$b" || b=${d}${p}.${v}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + ;; + esac + ;; + *) echo "$command: $f: unknown archive type" >&2 + code=1 + continue + ;; + esac + + # check for ini files + + if executable $w/$p.ini + then $exec $w/$p.ini read || { + code=1 + continue + } + fi + + # add to the obsolete list + + k= + for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null` + do case $i in + *.md5) continue + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + continue + ;; + esac + case $k in + ?*) case " $remove " in + *" $k "*) ;; + *) remove="$remove $k" ;; + esac + ;; + esac + k=$i + done + x="$x $y" + case " $touch " in + *" $u "*) ;; + *) touch="$touch $u" ;; + esac + done + if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old + then $exec cp $PACKAGEROOT/bin/package.old $PACKAGEROOT/bin/package + fi + + # drop obsolete archives + + case $remove in + ?*) $exec rm -f $remove ;; + esac + + # mark the updated archives + + case $touch in + ?*) sleep 1; $exec touch $touch ;; + esac + + # check the requirements + + case $code$exec in + 0) requirements - $x ;; + esac + exit $code + ;; + +regress)if test ! -d $PACKAGEBIN/gen + then echo "$command: 'package make' and 'package test' required for regression" >&2 + exit 1 + fi + dir=$PACKAGEBIN/gen + cd $dir + for s in out old + do case `ls -t regress.$s test.$s 2>/dev/null` in + regress*) + ;; + test*) if test -f regress.$s + then $exec mv regress.$s regress.old + fi + case $exec in + '') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s | + sed -e '/\*\*\* [0123456789]/d' \ + -e '/^TEST.\//s,/[^ ]*/,,' \ + -e 's,[ ][ ]*$,,' \ + -e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \ + -e 's/\.sh failed at .* with /.sh failed /' \ + > regress.$s + ;; + *) $exec filter test failures from $dir/test.$s to $dir/regress.$s + ;; + esac + ;; + esac + done + if test -f regress.out -a -f regress.old + then $exec diff -b regress.out regress.old + else echo "$command: at least 2 test runs required for regression" >&2 + exit 1 + fi + ;; + +release)count= lo= hi= + checksrc + checkaout release || exit + requirements source $package + components $package + package=$_components_ + set '' $target + shift + case $# in + 0) ;; + *) case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) lo= release= ;; + *) lo=$1 release="-f $1" ;; + esac + shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) hi= ;; + *) hi=$1 release="$release -t $1" ;; + esac + shift + ;; + esac + ;; + [0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*) + count=$1 + release="-r $count" + shift + ;; + esac + ;; + esac + case $# in + 0) case $package in + '') package=* ;; + esac + ;; + *) case $package in + '') package=$* + ;; + *) echo $command: $*: lo-date hi-date arguments expected >&2 + exit 1 + ;; + esac + ;; + esac + echo + case $count:$lo:$hi in + ::) echo "All recorded changes follow." ;; + 1::) echo "Changes since the last release follow." ;; + ?*::) echo "Changes since the last $count releases follow." ;; + 1:?*:) echo "Changes since $lo or the last release follow." ;; + *:?*:*) echo "Changes since $lo follow." ;; + *::?*) echo "Changes before $hi follow." ;; + *) echo "Changes between $lo and $hi follow." ;; + esac + x= + for r in $INSTALLROOT $PACKAGEROOT + do for s in $package_src + do d=$r/src/$s + if test -d $d + then cd $d + for i in $package + do if test -h $i 2>/dev/null + then continue + fi + case " $x " in + *" $i "*) continue ;; + esac + for f in RELEASE CHANGES ChangeLog + do if test -f $i/$f + then $exec release $release $i/$f + x="$x $i" + for f in $i/*/$f + do if test -f $f + then $exec release $release $f + fi + done + break + fi + done + done + fi + done + done + ;; + +remove) echo "$command: $action: not implemented yet" >&2 + exit 1 + ;; + +results)set '' $target + shift + def=make + dir=$PACKAGEBIN/gen + case $verbose in + 0) filter=yes ;; + *) filter=cat ;; + esac + path=0 + suf=out + on= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + admin) dir=$PACKAGESRC/admin + ;; + error*|fail*) + filter=errors + ;; + make|test|view|write) + def=$1 + case $filter:$1:$SHELL in + errors:*:*) ;; + *:test:*/ksh*) filter=rt ;; + esac + ;; + old) suf=old + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + case $on in + ?*) on="$on|" ;; + esac + on="$on$1" + ;; + path) path=1 + ;; + test) def=test + filter=rt + ;; + *) break + ;; + esac + shift + done + case $dir in + */admin)case $on in + '') on="*" ;; + *) on="@($on)" ;; + esac + def=$def.log/$on + ;; + esac + case $# in + 0) set "$def" ;; + esac + m= + t= + for i + do k=0 + eval set '""' $i - $i.$suf - $dir/$i - $dir/$i.$suf - + shift + for j + do case $j in + -) case $k in + 1) continue 2 ;; + esac + ;; + *) if test -f $j + then k=1 + case /$j in + */test.*) t="$t $j" ;; + *) m="$m $j" ;; + esac + fi + ;; + esac + done + echo "$command: $i action output not found" >&2 + exit 1 + done + sep= + case $t in + ?*) case $path in + 0) for j in $t + do echo "$sep==> $j <==" + sep=$nl + case $filter in + cat) $exec cat $j + ;; + errors) $exec egrep -i '\*\*\*|FAIL[ES]|^TEST.* [123456789][0123456789]* error|core.*dump' $j | sed -e '/^TEST.\//s,/[^ ]*/,,' + ;; + rt) $exec $KSH rt - $j + ;; + *) $exec egrep -i '^TEST|FAIL' $j + ;; + esac + done + ;; + 1) echo $t + ;; + esac + ;; + esac + case $m in + ?*) case $path in + 0) case $filter in + cat) cat $m + ;; + *) if test -f $HOME/.pkgresults + then i="`cat $HOME/.pkgresults`" + case $i in + '|'*) ;; + *) i="|$i" ;; + esac + else i= + fi + for j in $m + do echo "$sep==> $j <==" + sep=$nl + case $filter in + errors) $exeg egrep '^pax:|\*\*\*' $j + ;; + *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + $exec grep : + ;; + esac + done + ;; + esac + ;; + 1) echo $m + ;; + esac + esac + ;; + +test) requirements source $package + components $package + package=$_components_ + case $only in + 0) only= ;; + 1) only=--recurse=only ;; + esac + + # must have nmake + + if nonmake $MAKE + then echo $command: $action: must have $MAKE to test >&2 + exit 1 + fi + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # disable core dumps (could be disastrous over nfs) + + (ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0 + + # do the tests + + eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign + ;; + +update) # download the latest release.version for selected packages + + # all work in $PACKAGEROOT/lib/package/tgz + + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + $exec cd $PACKAGEROOT/lib/package/tgz + else cd $PACKAGEROOT/lib/package/tgz + fi + + # get the architectures, update query url, and packages + + set '' $args + op=update + tgz=tgz + source= + binary= + setup= + types= + url= + urlfile=$default_url + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + beta) op=beta + tgz=beta + ;; + binary) binary=1 + ;; + setup) setup=1 + ;; + source) source=1 + ;; + *://*) url=$1 + shift + break + ;; + *.url) urlfile=$1 + if test ! -s $urlfile + then echo $command: $urlfile: not found >&2; exit 1 + fi + break + ;; + $all_types) + binary=1 + types="$types $1" + ;; + *) break + ;; + esac + done + case $source:$binary in + :) source=1 binary=1 + ;; + :1) case $types in + '') types=$HOSTTYPE ;; + esac + ;; + esac + case $url in + '') case $urlfile in + $default_url) + if test ! -s $urlfile + then echo $command: url argument expected >&2; exit 1 + fi + ;; + *) default_url= + ;; + esac + url= + if grep '^url=' $urlfile >/dev/null + then a=$authorize + p=$password + case $urlfile in + */*) ;; + *) urlfile=./$urlfile ;; + esac + . $urlfile + case $a:$p in + $authorize:$password) + default_url= + ;; + *) case $a in + ?*) authorize=$a ;; + esac + case $p in + ?*) password=$p ;; + esac + ;; + esac + else url=`cat $urlfile` + fi + ;; + esac + case $exec in + ?*) default_url= ;; + esac + + # get the update list + + eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'` + get $host $dir/$op.html + + # get/check the package names + + case " $* " in + *" - "*)case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit=$* + ;; + " ") nl=" +" + case $source in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + ;; + *.????-??-??.????-??-??.*) + p=$p$nl$f + ;; + *.????-??-??.*.*) + ;; + *.????-??-??.*) + p=$p$nl$f + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + source_packages=$* + ;; + *) source_packages= + ;; + esac + case $binary in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.????-??-??.*) + ;; + *.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.*) + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + binary_packages=$* + ;; + *) binary_packages= + ;; + esac + package_hit="$source_packages $binary_packages" + ;; + *) case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit= + ;; + esac + + # get the latest updates + + types_test= + types_local= + dir=$dir/$tgz + case $default_url in + ?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url + case $authorize in + ?*) chmod go-rwx $default_url ;; + esac + ;; + esac + echo "$got" > got.tmp + case $only in + 0) exec < got.tmp + covered= + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $requires in + ''|-*) continue ;; + esac + IFS=: + set '' $requires + IFS=$ifs + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + for name + do case " $source_packages " in + *" $name "*) + ;; + *) source_packages="$source_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + for name + do case " $binary_packages " in + *" $name "*) + ;; + *) binary_packages="$binary_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + esac + done + case $covered in + ?*) x=$source_packages + source_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) source_packages="$source_packages $name" ;; + esac + done + x=$binary_packages + binary_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) binary_packages="$binary_packages $name" ;; + esac + done + ;; + esac + ;; + esac + checksum= + for i in $checksum_commands + do case `( $i ) < /dev/null 2> /dev/null` in + ${checksum_empty}|${checksum_empty}[\ \ ]*) + checksum=$i + break + ;; + esac + done + case $checksum in + '') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;; + esac + exec < got.tmp + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $verbose in + 1) case $type in + -) i= ;; + *) i=.$type ;; + esac + j="$name.$base$i.$suffix" + case $delta in + -) j="$j -" ;; + *) j="$j $name.$base.$delta$i.$suffix" ;; + esac + case $sync in + -) j="$j -" ;; + *) j="$j $name.$base.$sync$i.$suffix" ;; + esac + echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2 + esac + case " $package_hit " in + *" $name "*|*" - "*) + ;; + *) package_hit="$package_hit $name" + ;; + esac + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + if test -s $name.tim + then continue + fi + lcl=$name.$base.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$suffix + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + if test -s $name.$type.tim + then continue + fi + case " $types " in + *" - "*);; + " ") case " $types_test " in + *" $type "*) + ;; + *) types_test="$types_test $type" + for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.* + do if test -f $i + then types_local="$types_local $type" + fi + break + done + ;; + esac + case " $types_local " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + *) case " $types " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + esac + lcl=$name.$base.$type.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$type.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$type.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$type.$suffix + if test -f $lcl + then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + else sum=X + fi + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + esac + done + closure= + for name in $source_packages $binary_packages + do case $name in + -) ;; + *) case " $package_hit " in + *" $name "*) + case $setup in + 1) case " $closure " in + *" $name "*) + ;; + *) closure="$closure $name" + ;; + esac + ;; + esac + ;; + *) echo $command: $name: unknown package >&2 + ;; + esac + ;; + esac + done + exec <&- + rm -f got.tmp + case $closure in + ?*) echo $closure ;; + esac + ;; + +use) # finalize the environment + + x=:.. + for d in `( cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )` + do x=$x:$INSTALLROOT/$d + done + x=$x:$INSTALLROOT + case $CDPATH: in + $x:*) ;; + *) CDPATH=$x:$CDPATH + $show CDPATH=$CDPATH + $show export CDPATH + export CDPATH + ;; + esac + P=$PACKAGEROOT + $show P=$P + $show export P + export P + A=$INSTALLROOT + $show A=$A + $show export A + export A + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + eval PACKAGE_USE=$package_use + export PACKAGE_USE + + # run the command + + case $run in + '') case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$run" + ;; + esac + ;; + +verify) cd $PACKAGEROOT + requirements binary $package + if executable ! $SUM + then echo "$command: $action: $SUM command required" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + for a in $target + do case $package in + '') set '' arch/$a/lib/package/gen/*.sum + shift + if test -f $1 + then for i + do package_verify $i || code=1 + done + else echo "$command: warning: $a: no binary packages" >&2 + fi + ;; + *) for i in $package + do if test -f arch/$a/lib/package/gen/$i.sum + then package_verify arch/$a/lib/package/gen/$i.sum || code=1 + else echo "$command: warning: $a: no binary package for $i" >&2 + fi + done + ;; + esac + done + exit $code + ;; + +write) set '' $target + shift + action= + list= + qualifier= + while : + do case $1 in + base|closure|delta|exp|lcl|pkg|rpm|tgz) + qualifier="$qualifier $1" + ;; + binary) action=$1 + type=$HOSTTYPE + eval list=$PACKAGESRC/tgz/$admin_list + ;; + cyg) qualifier="$qualifier $1" + assign="$assign closure=1" + only=1 + ;; + runtime|source) + action=$1 + ;; + tst) qualifier="$qualifier tgz" + assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'" + ;; + nocopyright) + assign="$assign copyright=0" + ;; + *) break + ;; + esac + shift + done + case $action in + '') echo "$command: binary or source operand expected" >&2 + exit 1 + ;; + esac + set '' "$@" $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + if nonmake $MAKE + then echo "$command: must have $MAKE to generate archives" >&2 + exit 1 + fi + + # all work under $PACKAGEBIN + + $make cd $PACKAGEBIN + case $list in + ?*) $exec rm -f $list ;; + esac + + # go for it + + for package + do if view - all $package.pkg || view - all lib/package/$package.pkg + then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign + else echo "$command: $package: not a package" >&2 + fi + done + ;; + +TEST) set '' $target $package + shift + case $1 in + binary|source) + action=$1 + shift + ;; + esac + order "$@" + ;; + +*) echo "$command: $action: internal error" >&2 + exit 1 + ;; + +esac + +exit "$error_status" diff --git a/src/cmd/INIT/probe.win32 b/src/cmd/INIT/probe.win32 new file mode 100644 index 000000000..7939fccad --- /dev/null +++ b/src/cmd/INIT/probe.win32 @@ -0,0 +1,283 @@ +: +# @(#)probe.win32 (AT&T Research) 2010-01-01 +# +# win32 specific make C probe initialization +# wrapped cc's are easy on uwin +# +# 2> easy.err to avoid mysterious hang with bcc + +# begin preamble shared with the pp probe.ini + +IFS=$'\n' + +chmod 777 . # cl.exe setuid workaround + +typeset -A header version + +# we are probing on behalf of libpp and nmake +# so the native preprocessor must be forced in +# order to bootstrap libpp and nmake + +nativepp=-1 +export nativepp + +probe_header=" +stddef.h +" +for inc in syslimits.h winerror.h ostream bits/ctype_base.h stream.h +do echo "#include <$inc>" > easy.c + if $cc -E easy.c > /dev/null 2> easy.err + then probe_header="$probe_header +$inc +" + fi +done + +{ +for i in $probe_header +do echo "#include <$i>" +done +echo '#ifdef __cplusplus' +echo "int _Pr0b3_cplus=__cplusplus;" +echo '#endif' +echo '#ifdef _UWIN' +echo "int _Pr0b3_uwin=_UWIN;" +echo '#endif' +echo '#ifdef __BORLANDC__' +echo "int _Pr0b3_version_BORLAND=__BORLANDC__;" +echo '#endif' +echo '#ifdef __DMC__' +echo "int _Pr0b3_version_DM=__DMC__;" +echo '#endif' +echo '#ifdef _MSC_VER' +echo "int _Pr0b3_version_MS=_MSC_VER;" +echo '#endif' +echo '#ifdef __ICL' +echo "int _Pr0b3_version_ICL=__ICL;" +echo '#endif' +echo '#ifdef __LCC__' +echo "int _Pr0b3_version_LCC=0+__LCC__;" +echo '#endif' +echo '#ifdef __MINGW32__' +echo "int _Pr0b3_version_MINGW=__MINGW32__;" +echo '#endif' +echo '#ifdef __INTERIX' +echo "int _Pr0b3_version_INTERIX=__INTERIX;" +echo '#endif' +echo '#ifdef __WATCOMC__' +echo "int _Pr0b3_version_WATCOM=__WATCOMC__;" +echo '#endif' +} > easy.c + +include= +uwin= +cplus= + +$cc -E easy.c 2>&1 | +egrep -i '^(#(line)? 1 .*\.[hH]| *int +_Pr0b3_[a-zA-Z_]* *= *[0-9])' | +sed -e 's,_Pr0b3_,,' \ + -e 's/.*"\(.*\)".*/\1/' \ + -e 's,^ *,,' \ + -e 's, *$,,' \ + -e 's, *= *,=,' \ + -e 's,^\(.\):[\\/]*,/\1/,' \ + -e 's,[\\/][\\/]*,/,g' \ + -e 's,^\(/.*\)/\(.*\)$,header[\2]="\1",' \ + -e 's, *int *\(.*\);.*,\1,' \ + -e 's,^version_\(.*\)=,version[\1]=,' \ + > easy.sh +. ./easy.sh + +include= +for i in $probe_header +do d=${header[$i]} + if [[ $d ]] + then include="$include +$d" + elif [[ $i == */* ]] + then d=${header[${i##*/}]} + if [[ $d == */${i%/*} ]] + then include="$include +${d%/${i%/*}}" + fi + fi +done + +i=$($cc -V 2> easy.err) +if test "" != "$i" -a -d "$i/include" +then include="$i/include +$include" +fi + +stdinclude= +for inc in $include +do if [[ ${inc%/*} -ef /msdev/platformsdk ]] + then inc=/msdev/platformsdk/${inc##*/} + elif [[ ${inc%/*} -ef /platformsdk ]] + then inc=/platformsdk/${inc##*/} + fi + for dup in $stdinclude + do [[ $inc -ef $dup ]] && continue 2 + done + stdinclude="$stdinclude +$inc" +done + +# end preamble shared with the pp probe.ini + +if [[ ${version[@]} == [0-9]* && $stdinclude ]] +then : the payoff + set -- $cc + cmd=$1 + shift + set -- $(whence $cmd) "$@" + typ=$(package) + dialect="ANSI CLOSURE DYNAMIC EXPORT=DLL LIBPP -I-" + case ${cc##*/} in + *CC*) dialect="$dialect C++" + cplus=1 + ;; + esac + ld=${cc%cc}ld + if [[ ! -x $ld ]] + then ld=${cc%/*}/ld + if [[ ! -x $ld ]] + then case $cc in + */ncc) ld=/usr/bin/nld ;; + *) ld=/usr/bin/ld ;; + esac + fi + fi + { + if $cc -v >/dev/null 2>&1 + then v=$($cc -v 2>/dev/null) + if [[ $v ]] + then print "# ;VERSION;-v;$v;PATH;$cc" + fi + else v= + fi + cat <&3 + exit 0 +fi diff --git a/src/cmd/INIT/proto.c b/src/cmd/INIT/proto.c new file mode 100644 index 000000000..cc3b067df --- /dev/null +++ b/src/cmd/INIT/proto.c @@ -0,0 +1,5289 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1990-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#pragma clang diagnostic ignored "-Wparentheses" +#pragma clang diagnostic ignored "-Wunused-value" +#pragma clang diagnostic ignored "-Wstring-plus-int" + +/* : : generated by proto : : */ + +#if !defined(__PROTO__) +# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) +# if defined(__cplusplus) +# define __LINKAGE__ "C" +# else +# define __LINKAGE__ +# endif +# define __STDARG__ +# define __PROTO__(x) x +# define __OTORP__(x) +# define __PARAM__(n,o) n +# if !defined(__STDC__) && !defined(__cplusplus) +# if !defined(c_plusplus) +# define const +# endif +# define signed +# define void int +# define volatile +# define __V_ char +# else +# define __V_ void +# endif +# else +# define __PROTO__(x) () +# define __OTORP__(x) x +# define __PARAM__(n,o) o +# define __LINKAGE__ +# define __V_ char +# define const +# define signed +# define void int +# define volatile +# endif +# define __MANGLE__ __LINKAGE__ +# if defined(__cplusplus) || defined(c_plusplus) +# define __VARARG__ ... +# else +# define __VARARG__ +# endif +# if defined(__STDARG__) +# define __VA_START__(p,a) va_start(p,a) +# else +# define __VA_START__(p,a) va_start(p) +# endif +# if !defined(__INLINE__) +# if defined(__cplusplus) +# define __INLINE__ extern __MANGLE__ inline +# else +# if defined(_WIN32) && !defined(__GNUC__) +# define __INLINE__ __inline +# endif +# endif +# endif +#endif +#if !defined(__LINKAGE__) +#define __LINKAGE__ /* 2004-08-11 transition */ +#endif +#line 1 "proto.c" + + +#line 151 +# ifndef __STDC__ +# ifndef creat +# define creat _huh_creat +# endif +# if 1 +# ifndef access +# define access _huh_access +# endif +# ifndef ctime +# define ctime _huh_ctime +# endif +# ifndef mkdir +# define mkdir _huh_mkdir +# endif +# endif +# endif + +# include +# include +# include +# if 1 +# include +# else +# include +# endif + +# ifndef __STDC__ +# undef access +# undef ctime +# undef creat +# undef mkdir +# endif + +# ifndef O_RDONLY +# define O_RDONLY 0 +# endif + +# ifndef S_IRUSR +# define S_IRUSR 0400 +# endif +# ifndef S_IWUSR +# define S_IWUSR 0200 +# endif +# ifndef S_IXUSR +# define S_IXUSR 0100 +# endif +# ifndef S_IRGRP +# define S_IRGRP 0040 +# endif +# ifndef S_IWGRP +# define S_IWGRP 0020 +# endif +# ifndef S_IXGRP +# define S_IXGRP 0010 +# endif +# ifndef S_IROTH +# define S_IROTH 0004 +# endif +# ifndef S_IWOTH +# define S_IWOTH 0002 +# endif +# ifndef S_IXOTH +# define S_IXOTH 0001 +# endif + +# ifndef __STDC__ +# if !_WIN32 && !_WINIX +# define remove(x) unlink(x) +# define rename(x,y) ((link(x,y)||remove(x))?-1:0) +# endif + +# if 1 +extern __MANGLE__ int access __PROTO__((const char*, int)); +extern __MANGLE__ int mkdir __PROTO__((const char*, int)); +# endif + +# endif + +# if 1 +extern __MANGLE__ int utime __PROTO__((const char*, time_t*)); +# endif + + + + + + +int +replace __PARAM__((const char* newfile, const char* oldfile, int preserve), (newfile, oldfile, preserve)) __OTORP__(const char* newfile; const char* oldfile; int preserve;){ + struct stat st; + time_t ut[2]; + + if (stat(oldfile, &st)) + { + if (preserve) + return -1; + st.st_mode = 0; + } + if (remove(oldfile) || rename(newfile, oldfile)) + return -1; + if (st.st_mode &= (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)) + chmod(oldfile, st.st_mode); + if (preserve) + { + ut[0] = st.st_atime; + ut[1] = st.st_mtime; + preserve = utime(oldfile, ut); + } + return preserve; +} + +# undef utime +# define utime ______utime + +#line 1 "../../lib/libpp/ppproto.c" + +#line 13 +static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2012-04-14 $\000\n"; + +#line 1 "../../lib/libpp/ppfsm.c" + +#line 1 "../../lib/libpp/pplib.h" + +#line 108 +struct ppsymbol; +struct ppindex; + +typedef char* (*PPBUILTIN) __PROTO__((char*, const char*, const char*)); +typedef void (*PPCOMMENT) __PROTO__((const char*, const char*, const char*, int)); +typedef void (*PPINCREF) __PROTO__((const char*, const char*, int, int)); +typedef void (*PPLINESYNC) __PROTO__((int, const char*)); +typedef void (*PPMACREF) __PROTO__((struct ppsymbol*, const char*, int, int, unsigned long)); +typedef int (*PPOPTARG) __PROTO__((int, int, const char*)); +typedef void (*PPPRAGMA) __PROTO__((const char*, const char*, const char*, const char*, int)); + +struct ppinstk +{ + char* nextchr; + struct ppinstk* next; + struct ppinstk* prev; + long* control; + char* buffer; + char* file; + char* prefix; + struct ppsymbol* symbol; + + struct ppindex* index; + int buflen; + + int line; + int vendor; + short fd; + short hide; + short flags; + char type; +}; + + + + + + + + + +struct pplist +{ + char* value; + struct pplist* next; +}; + +struct oplist +{ + int op; + char* value; + struct oplist* next; +}; + +struct pphide +{ + struct ppmacro* macro; + unsigned long flags; + int level; +}; + +struct ppmacstk +{ + struct ppmacstk* next; + struct ppmacstk* prev; + int line; + char* arg[1]; +}; + +struct ppmember +{ + struct ppdirs* archive; + unsigned long offset; + unsigned long size; +}; + +struct counter +{ + int candidate; + int function; + int macro; + int pplex; + int push; + int terminal; + int token; +}; + +struct pptuple +{ + struct pptuple* nomatch; + struct pptuple* match; + char token[1]; +}; + +struct ppfileid +{ + unsigned long st_dev; + unsigned long st_ino; +}; + +struct pathid +{ + char* path; + struct ppfileid id; +}; + +#line 1 "../../lib/libpp/pp.h" + +#line 206 + +#line 217 + +#line 329 +struct ppdirs +{ + char* name; + struct ppdirs* next; + + + unsigned char c; unsigned char index; unsigned char type; union { char* buffer; char* sp; struct ppdirs* subdir; } info; struct ppfileid id; + + +}; + +struct ppkeyword +{ + char* name; + int value; +}; + +struct ppmacro +{ + int arity; + char* value; + + + struct pptuple* tuple; char* formals; int size; + + +}; + +struct ppsymbol +{ + int hash_header; + unsigned long flags; + struct ppmacro* macro; + __V_* value; + + + struct pphide* hidden; + + +}; + +#line 378 +struct ppglobals +{ + const char* version; + char* lineid; + char* outfile; + char* pass; + char* token; + struct ppsymbol* symbol; + + + + char* outb; + char* outbuf; + char* outp; + char* oute; + unsigned long offset; + + + struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; + + + + struct ppcontext* context; long state; long mode; long option; long test; struct { char* sp; long flags; } filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; long ro_op[2]; struct pathid cdir; struct pathid hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; + + + + char* checkpoint; int constack; struct ppinstk* in; char* addp; char* args; char* addbuf; char* catbuf; char* hdrbuf; char* hidebuf; char* path; char* tmpbuf; char* valbuf; char* optflags; int lastout; char* include; char* prefix; struct ppmember* member; int hidden; int hiding; int level; struct { int input; int output; } pool; struct { long ro_state; long ro_mode; long ro_option; long ro_op[2]; int on; char* symtab; } reset; int truncate; struct ppmacstk* macp; char* maxmac; char* mactop; char* toknxt; long* control; long* maxcon; struct oplist* chop; struct ppfile* insert; struct ppfile* original; struct ppdirs* found; int vendor; char* dirtab; char* strtab; PPBUILTIN builtin; PPCOMMENT comment; PPINCREF incref; PPLINESYNC linesync; PPLINESYNC olinesync; PPMACREF macref; PPOPTARG optarg; PPPRAGMA pragma; struct counter counter; char funbuf[256]; + + +}; + + + + + + + +extern __MANGLE__ struct ppglobals pp; +extern __MANGLE__ char _pp_ctype[]; + +extern __MANGLE__ int ppargs __PROTO__((char**, int)); +extern __MANGLE__ void ppcpp __PROTO__((void)); +extern __MANGLE__ void ppcomment __PROTO__((char*, char*, char*, int)); +extern __MANGLE__ __V_* ppcontext __PROTO__((__V_*, int)); +extern __MANGLE__ void pperror __PROTO__((int, ...)); +extern __MANGLE__ void ppincref __PROTO__((char*, char*, int, int)); +extern __MANGLE__ void ppinput __PROTO__((char*, char*, int)); +extern __MANGLE__ int pplex __PROTO__((void)); +extern __MANGLE__ void ppline __PROTO__((int, char*)); +extern __MANGLE__ void ppmacref __PROTO__((struct ppsymbol*, char*, int, int, unsigned long)); +extern __MANGLE__ void ppop __PROTO__((int, ...)); +extern __MANGLE__ void pppragma __PROTO__((char*, char*, char*, char*, int)); +extern __MANGLE__ int ppprintf __PROTO__((char*, ...)); +extern __MANGLE__ int ppsync __PROTO__((void)); + +#line 368 "../../lib/libpp/pplib.h" + +#line 1 "../../lib/libpp/ppdef.h" + +#line 369 "../../lib/libpp/pplib.h" + +#line 1 "../../lib/libpp/ppkey.h" + +#line 16 + +#line 125 +extern __MANGLE__ struct ppkeyword ppkey[]; + +#line 370 "../../lib/libpp/pplib.h" + +#line 683 +struct ppcontext +{ + struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; + struct ppcontext* context; long state; long mode; long option; long test; struct { char* sp; long flags; } filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; long ro_op[2]; struct pathid cdir; struct pathid hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; +}; + +struct ppfile +{ + int hash_header; + struct ppsymbol* guard; + struct ppfile* bound[4]; + int flags; +}; + + + +struct ppindex +{ + struct ppindex* next; + struct ppfile* file; + unsigned long begin; + unsigned long end; +}; + + + +struct ppsymkey +{ + struct ppsymbol sym; + int lex; +}; + +#line 729 +# ifdef __STDC__ + +# include +# include +# include +# include + +# else + +# define size_t int + +extern __MANGLE__ __V_* realloc __PROTO__((__V_*, size_t)); +extern __MANGLE__ __V_* calloc __PROTO__((size_t, size_t)); +extern __MANGLE__ char* ctime __PROTO__((time_t*)); +extern __MANGLE__ void free __PROTO__((__V_*)); + +# ifndef O_RDONLY + +extern __MANGLE__ int access __PROTO__((const char*, int)); +extern __MANGLE__ int close __PROTO__((int)); +extern __MANGLE__ int creat __PROTO__((const char*, int)); +extern __MANGLE__ void exit __PROTO__((int)); +extern __MANGLE__ int link __PROTO__((const char*, const char*)); +extern __MANGLE__ int open __PROTO__((const char*, int, ...)); +extern __MANGLE__ int read __PROTO__((int, __V_*, int)); +extern __MANGLE__ time_t time __PROTO__((time_t*)); +extern __MANGLE__ int unlink __PROTO__((const char*)); +extern __MANGLE__ int write __PROTO__((int, const __V_*, int)); + +# endif + +# endif + +#line 802 +extern __MANGLE__ void ppassert __PROTO__((int, char*, char*)); +extern __MANGLE__ void ppbuiltin __PROTO__((void)); +extern __MANGLE__ int ppcall __PROTO__((struct ppsymbol*, int)); +extern __MANGLE__ int ppcontrol __PROTO__((void)); +extern __MANGLE__ void ppdump __PROTO__((void)); +extern __MANGLE__ char* ppexpand __PROTO__((char*)); +extern __MANGLE__ long ppexpr __PROTO__((int*)); +extern __MANGLE__ void ppfsm __PROTO__((int, char*)); +extern __MANGLE__ char* ppinstr __PROTO__((struct ppinstk*)); +extern __MANGLE__ char* ppkeyname __PROTO__((int, int)); +extern __MANGLE__ char* pplexstr __PROTO__((int)); +extern __MANGLE__ void ppload __PROTO__((char*)); +extern __MANGLE__ void ppmapinclude __PROTO__((char*, char*)); +extern __MANGLE__ char* ppmodestr __PROTO__((long)); +extern __MANGLE__ int ppmultiple __PROTO__((struct ppfile*, struct ppsymbol*)); +extern __MANGLE__ void ppnest __PROTO__((void)); +extern __MANGLE__ int ppoption __PROTO__((char*)); +extern __MANGLE__ char* ppoptionstr __PROTO__((long)); +extern __MANGLE__ void pppclose __PROTO__((char*)); +extern __MANGLE__ int pppdrop __PROTO__((char*)); +extern __MANGLE__ char* pppopen __PROTO__((char*, int, char*, char*, char*, char*, int)); +extern __MANGLE__ int pppread __PROTO__((char*)); +extern __MANGLE__ int pppredargs __PROTO__((void)); +extern __MANGLE__ void pppush __PROTO__((int, char*, char*, int)); +extern __MANGLE__ struct ppsymbol* pprefmac __PROTO__((char*, int)); +extern __MANGLE__ int ppsearch __PROTO__((char*, int, int)); +extern __MANGLE__ int ppset __PROTO__((long*, long, int)); +extern __MANGLE__ char* ppstatestr __PROTO__((long)); +extern __MANGLE__ char* pptokstr __PROTO__((char*, int)); +extern __MANGLE__ void pptrace __PROTO__((int)); + +#line 11 "../../lib/libpp/ppfsm.c" + +#line 1 "../../lib/libpp/ppfsm.h" + +#line 185 + +#line 249 +extern __MANGLE__ short _pp_fsmtab[(0+28)+1][255+1]; + + + + + +extern __MANGLE__ char _pp_trigraph[255+1]; + +extern __MANGLE__ void _pp_refill __PROTO__((int)); + +#line 12 "../../lib/libpp/ppfsm.c" + + +#line 67 +struct fsminit +{ + int state; + unsigned char ch[4]; + int nextstate; +}; + +static struct fsminit fsminit[] = +{ + + { 0, { 023 }, ((0+28)+11), }, + { 0, { 002 }, (0), }, + { 0, { 001 }, (0+23), }, + { 0, { '.' }, (0+25), }, + { 0, { 021 }, (0+19), }, + { 0, { 'L' }, (0+20), }, + { 0, { 'd', 'e', 'f', 'i' }, (0+1), }, + { 0, { 'r', 's', 't', 'v' }, (0+1), }, + { 0, { 'w', 'N' }, (0+1), }, + { 0, { '"', '\'' }, ((0+28)+3), }, + { 0, { '/' }, (0+12), }, + { 0, { '\n' }, ((0+28)+7), }, + { 0, { ' ','\t','\f','\013' }, (0+27), }, + + + { (0+1), { 023 }, ((0+28)+6), }, + { (0+1), { 021, 001 }, (0+19), }, + { (0+1), { 'a' }, (0+2), }, + { (0+1), { 'e' }, (0+3), }, + { (0+1), { 'f' }, (0+4), }, + { (0+1), { 'h' }, (0+5), }, + { (0+1), { 'l' }, (0+6), }, + { (0+1), { 'n' }, (0+7), }, + { (0+1), { 'o' }, (0+8), }, + { (0+1), { 't' }, (0+9), }, + { (0+1), { 'x' }, (0+10), }, + { (0+1), { 'y' }, (0+11), }, + + + { (0+2), { 023 }, (((0+28)+12)), }, + { (0+2), { 021, 001 }, (0+19), }, + { (0+2), { '_','s','t','a' }, (0+2), }, + { (0+2), { 'r' }, (0+2), }, + + + { (0+3), { 023 }, (((0+28)+12)), }, + { (0+3), { 021, 001 }, (0+19), }, + { (0+3), { 't','u','r','n' }, (0+3), }, + + + { (0+4), { 023 }, (((0+28)+12)), }, + { (0+4), { 021, 001 }, (0+19), }, + + + { (0+5), { 023 }, (((0+28)+12)), }, + { (0+5), { 021, 001 }, (0+19), }, + { (0+5), { 'i','l','e' }, (0+5), }, + + + { (0+6), { 023 }, (((0+28)+12)), }, + { (0+6), { 021, 001 }, (0+19), }, + { (0+6), { 's','e' }, (0+6), }, + + + { (0+7), { 023 }, (((0+28)+12)), }, + { (0+7), { 021, 001 }, (0+19), }, + { (0+7), { 'l','i','n','e' }, (0+7), }, + + + { (0+8), { 023 }, (((0+28)+12)), }, + { (0+8), { 021, 001 }, (0+19), }, + { (0+8), { 'r','i','d','N' }, (0+8), }, + + + { (0+9), { 023 }, (((0+28)+12)), }, + { (0+9), { 021, 001 }, (0+19), }, + { (0+9), { 'a','t','i','c' }, (0+9), }, + + + { (0+10), { 023 }, (((0+28)+12)), }, + { (0+10), { 021, 001 }, (0+19), }, + { (0+10), { 't','e','r','n' }, (0+10), }, + + + { (0+11), { 023 }, (((0+28)+12)), }, + { (0+11), { 021, 001 }, (0+19), }, + { (0+11), { 'p','e','d','f' }, (0+11), }, + + + { (0+12), { 023 }, ((0+28)+0), }, + { (0+12), { '*' }, (0+13), }, + + { (0+12), { '/' }, (0+16), }, + + + + { (0+13), { 023 }, (0+13), }, + { (0+13), { '\n', 002 }, ((0+28)+1), }, + { (0+13), { '/' }, (0+15), }, + { (0+13), { '*' }, (0+14), }, + { (0+13), { '#', ';', ')' }, ((( (0+13))<<(7+1))|(((0+28)+8))), }, + + + { (0+14), { 023 }, (0+13), }, + { (0+14), { '\n', 002 }, ((0+28)+1), }, + { (0+14), { '#', ';', ')' }, ((( (0+13))<<(7+1))|(((0+28)+8))), }, + { (0+14), { '*' }, (0+14), }, + { (0+14), { '/' }, ((0+28)+1), }, + + + { (0+15), { 023 }, (0+13), }, + { (0+15), { '*', '\n', 002 }, ((0+28)+1), }, + { (0+15), { '/' }, (0+15), }, + + + { (0+16), { 023 }, (0+16), }, + { (0+16), { '\n', 002 }, ((0+28)+1), }, + { (0+16), { '/' }, (0+17), }, + { (0+16), { '*' }, (0+18), }, + + + { (0+17), { 023 }, (0+16), }, + { (0+17), { '*', '\n', 002 }, ((0+28)+1), }, + { (0+17), { '/' }, (0+17), }, + + + { (0+18), { 023 }, (0+16), }, + { (0+18), { '\n', 002 }, ((0+28)+1), }, + { (0+18), { '*' }, (0+18), }, + { (0+18), { '/' }, ((0+28)+1), }, + + + { (0+19), { 023 }, ((0+28)+6), }, + { (0+19), { 021, 001 }, (0+19), }, + + + { (0+25), { 023 }, ((0+28)+0), }, + { (0+25), { '.' }, (0+26), }, + { (0+25), { 001 }, (0+23), }, + + + { (0+26), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, + { (0+26), { '.' }, (((( (0401+29))-0401)<<(7+1))|( ((0+28)+13))), }, + + + { (0+20), { 023 }, ((0+28)+6), }, + { (0+20), { 021, 001 }, (0+19), }, + { (0+20), { '"', '\'' }, ((( (0+21))<<(7+1))|(((0+28)+8))), }, + + + { (0+21), { 023 }, (0+21), }, + { (0+21), { '"', '\'' }, ((0+28)+4), }, + { (0+21), { '\n', 002 }, ((0+28)+4), }, + { (0+21), { '\\' }, (0+22), }, + + + { (0+22), { 023 }, ((0+28)+5), }, + { (0+22), { '\n', 002 }, ((0+28)+4), }, + + + { (0+23), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, + { (0+23), { 021, 001, '.' }, (0+23), }, + { (0+23), { 'e', 'E' }, (0+24), }, + + + { (0+24), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, + { (0+24), { 021, 001, '.' }, (0+23), }, + { (0+24), { '+', '-' }, (0+23), }, + + + { (0+27), { 023 }, ((0+28)+15), }, + { (0+27), { ' ', '\t' }, (0+27), }, + { (0+27), { '\f', '\013' }, ((0+28)+10), }, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#line 528 + { (-1), { 0 }, 0, } +}; + +short _pp_fsmtab[(0+28)+1][255+1]; + +char _pp_trigraph[255+1]; + + +static char spl[] = { '\\', '\r', 0 }; +static char aln[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$@"; + + + + +static char* let = &aln[10]; +static char hex[] = "fedcbaFEDCBA9876543210"; +static char* dec = &hex[12]; +static char* oct = &hex[14]; + + + + + + +void +ppfsm __PARAM__((int op, register char* s), (op, s)) __OTORP__(int op; register char* s;){ + register int c; + register int n; + register int i; + register short* rp; + register struct fsminit* fp; + + + + + + switch (op) + { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + case 4: + for (fp = fsminit;; fp++) + { + if ((n = fp->nextstate) >= (0+28)) n = ~n; + if (fp->state == (-1)) + { + + + + + + + + + + + + + + break; + } + rp = _pp_fsmtab[fp->state]; + for (i = 0; i < sizeof(fp->ch) && (c = fp->ch[i]); i++) + { + switch (c) + { + case 023: + for (c = 0; c <= 255; c++) + rp[c] = n; + + + case 002: + _pp_fsmtab[(0+28)][fp->state+1] = n < 0 ? ~n : n; + continue; + + case 021: + s = let; + break; + + case 003: + s = hex; + break; + + case 001: + s = dec; + break; + + case 022: + s = oct; + break; + + default: + rp[c] = n; + continue; + } + while (c = *s++) + rp[c] = n; + } + } + + + + + + + for (i = 0; i < (0+28); i++) + { + rp = _pp_fsmtab[i]; + s = spl; + while (c = *s++) + if (c != '@' || !(( rp)>=_pp_fsmtab[(0+13)]&&( rp)<=_pp_fsmtab[(0+18)])) + { + if (rp[c] >= 0) rp[c] = ~rp[c]; + rp[c] &= ~(1<<7); + } + rp[0] = ~((0+28)+2); + for (c = 0; c <= 255; c++) + if (rp[c] == i) + rp[c] = 0; + } + _pp_fsmtab[(0+28)][0] = ~((0+28)+2); + + + + + + + + + + + + + + + + + + +#line 707 + break; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#line 860 + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#line 18 "../../lib/libpp/ppproto.c" + +#line 1 "../../../include/ast/hashkey.h" + +#line 24 + + +#line 68 +extern __MANGLE__ long strkey __PROTO__((const char*)); + +#line 20 "../../lib/libpp/ppproto.c" + +#line 41 +typedef struct Key_s +{ + const char* name; + size_t size; + int hit; + int val; +} Key_t; + +typedef struct Proto_s +{ + int brace; + int call; + int fd; + char* file; + long flags; + long options; + char* package; + int line; + int test; + + char* tp; + + int iz; + char* ib; + char* ip; + + int oz; + char* ob; + char* op; + char* ox; + + char cc[3]; + char pushback[4]; + + char variadic[256]; + + + + +} Proto_t; + + +#line 171 +static const Key_t pragmas[] = +{ + { "prototyped",sizeof( "prototyped")-1, 0x01, 1}, + { "noprototyped",sizeof( "noprototyped")-1, 0x01, 0}, + { "noticed",sizeof( "noticed")-1, 0x02, 1}, + { "nonoticed",sizeof( "nonoticed")-1, 0x02, 0}, +}; + +static const Key_t notices[] = +{ + { "Copyright",sizeof( "Copyright")-1, 0x02, 1}, + { "COPYRIGHT",sizeof( "COPYRIGHT")-1, 0x02, 1}, + { "copyright",sizeof( "copyright")-1, 0x02, 1}, + { "Public Domain",sizeof( "Public Domain")-1, 0x02, 0}, + { "PUBLIC DOMAIN",sizeof( "PUBLIC DOMAIN")-1, 0x02, 0}, +}; + + + + + + +static char* +number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register char* p; register long n;){ + register long d; + + for (d = 1000000; d > 1; d /= 10) + if (n >= d) *p++ = '0' + (n / d) % 10; + *p++ = '0' + n % 10; + return p; +} + + + +static int errors; + + +#line 224 + + + + +static int +sstrlen __PARAM__((register const char* s), (s)) __OTORP__(register const char* s;){ + register const char* b; + + for (b = s; *s; s++); + return s - b; +} + + + + + +static int +sstrncmp __PARAM__((register const char* s, register const char* t, register int n), (s, t, n)) __OTORP__(register const char* s; register const char* t; register int n;){ + register const char* e = s + n; + + while (s < e) + { + if (*s != *t || !*s) + return *s - *t; + s++; + t++; + } + return 0; +} + + + + + +static char* +strcopy __PARAM__((register char* s, register const char* t), (s, t)) __OTORP__(register char* s; register const char* t;){ + while (*s++ = *t++); + return s - 1; +} + + + +static void +proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level, msg, arg)) __OTORP__(char* iob; int level; char* msg; char* arg;){ + register char* p; + char buf[1024]; + + p = strcopy(buf, "proto: "); + if (iob) + { + register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); + + if (proto->line) + { + if (proto->file) + { + *p++ = '"'; + p = strcopy(p, proto->file); + *p++ = '"'; + *p++ = ','; + *p++ = ' '; + } + p = strcopy(p, "line "); + p = number(p, proto->line); + } + else if (proto->file) + p = strcopy(p, proto->file); + } + else + { + p = strcopy(p, msg); + msg = arg; + arg = 0; + } + if (*(p - 1) != ' ') + { + *p++ = ':'; + *p++ = ' '; + } + if (level == 1) + p = strcopy(p, "warning: "); + p = strcopy(p, msg); + if (arg) + { + *p++ = ' '; + p = strcopy(p, arg); + } + *p++ = '\n'; + write(2, buf, p - buf); + if (level >= 3) + exit(level - 2); + if (level >= 2) + errors++; +} + + + + + +static char* +memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTORP__(register char* s; register char* t; int n;){ + register char* e = t + n; + + while (t < e) *s++ = *t++; + return s; +} + +#line 1 "../../lib/libast/port/astlicense.c" + + + +#line 92 +typedef struct Buffer_s +{ + char* buf; + char* nxt; + char* end; + int siz; +} Buffer_t; + +typedef struct Item_s +{ + char* data; + int size; + int quote; +} Item_t; + +typedef struct Id_s +{ + Item_t name; + Item_t value; +} Id_t; + + + + + + + +static const Item_t key[] = +{ + { "author",sizeof( "author")-1,0}, + { "class",sizeof( "class")-1,0}, + { "company",sizeof( "company")-1,0}, + { "component",sizeof( "component")-1,0}, + { "contributor",sizeof( "contributor")-1,0}, + { "corporation",sizeof( "corporation")-1,0}, + { "domain",sizeof( "domain")-1,0}, + { "id",sizeof( "id")-1,0}, + { "incorporation",sizeof( "incorporation")-1,0}, + { "license",sizeof( "license")-1,0}, + { "location",sizeof( "location")-1,0}, + { "name",sizeof( "name")-1,0}, + { "notice",sizeof( "notice")-1,0}, + { "organization",sizeof( "organization")-1,0}, + { "package",sizeof( "package")-1,0}, + { "parent",sizeof( "parent")-1,0}, + { "query",sizeof( "query")-1,0}, + { "since",sizeof( "since")-1,0}, + { "source",sizeof( "source")-1,0}, + { "start",sizeof( "start")-1,0}, + { "type",sizeof( "type")-1,0}, + { "url",sizeof( "url")-1,0}, + { "urlmd5",sizeof( "urlmd5")-1,0}, + { "version",sizeof( "version")-1,0}, + {0} +}; + + + + + +static const Item_t lic[] = +{ + { "none",sizeof( "none")-1, 0}, + { "inline",sizeof( "inline")-1, 12}, + { "test",sizeof( "test")-1, 2}, + { "verbose",sizeof( "verbose")-1, 3}, + { "usage",sizeof( "usage")-1, 4}, + { "open",sizeof( "open")-1, 5}, + { "cpl",sizeof( "cpl")-1, 5}, + { "epl",sizeof( "epl")-1, 5}, + { "bsd",sizeof( "bsd")-1, 5}, + { "zlib",sizeof( "zlib")-1, 5}, + { "mit",sizeof( "mit")-1, 5}, + { "gpl",sizeof( "gpl")-1, 11}, + { "special",sizeof( "special")-1, 12}, + { "nonexclusive",sizeof( "nonexclusive")-1, 12}, + { "noncommercial",sizeof( "noncommercial")-1, 12}, + { "proprietary",sizeof( "proprietary")-1, 15}, + {0} +}; + +typedef struct Notice_s +{ + int test; + int type; + int verbose; + int ids; + Item_t item[(sizeof(key)/sizeof(key[0])-1)]; + Id_t id[64]; + char cc[3]; +} Notice_t; + + + + + +static int +lookup __PARAM__((register const Item_t* item, const char* name, int size), (item, name, size)) __OTORP__(register const Item_t* item; const char* name; int size;){ + register int c; + register int i; + + c = name[0]; + for (i = 0; item[i].data; i++) + if (c == item[i].data[0] && size == item[i].size && !sstrncmp( name, item[i].data, size)) + return i; + return -1; +} + + + + + + +static void +copy __PARAM__((register Buffer_t* b, register char* s, int n), (b, s, n)) __OTORP__(register Buffer_t* b; register char* s; int n;){ + if (n < 0) + n = sstrlen( s); + while (n--) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( *s++)):(( *s++),(-1))); +} + + +#line 225 +static void +comment __PARAM__((Notice_t* notice, register Buffer_t* b, register char* s, register int n, int u), (notice, b, s, n, u)) __OTORP__(Notice_t* notice; register Buffer_t* b; register char* s; register int n; int u;){ + register int i; + register int m; + register int x; + int cc; + + cc = notice->cc[1]; + if (!s) + { + if (n) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( notice->cc[n > 0 ? 0 : 1])):(( notice->cc[n > 0 ? 0 : 1]),(-1))); + for (i = 0; i < 70; i++) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( notice->cc[n > 0 ? 1 : 2])):(( notice->cc[n > 0 ? 1 : 2]),(-1))); + } + else + s = ""; + } + if (s) + { + if (n > 70) + n = 70; + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); + m = (u < 0) ? 1 : (70 - n) / 2; + if ((x = 70 - m - n) < 0) + n--; + while (m-- > 0) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + while (n-- > 0) + { + i = *s++; + if (u > 0 && i >= 'a' && i <= 'z') + i = i - 'a' + 'A'; + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( i)):(( i),(-1))); + } + while (x-- > 0) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); + } + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( '\n')):(( '\n'),(-1))); +} + + + + + +static void +expand __PARAM__((Notice_t* notice, register Buffer_t* b, const Item_t* item), (notice, b, item)) __OTORP__(Notice_t* notice; register Buffer_t* b; const Item_t* item;){ + register char* t; + register char* e; + register int q; + register char* x; + register char* z; + register int c; + int m; + int i; + int k; + + if (t = item->data) + { + q = item->quote; + e = t + item->size; + i = 0; + while (t < e) + { + if (*t == '$' && t < (e + 2) && *(t + 1) == '{') + { + k = m = 0; + x = t += 2; + while (t < e && (c = *t++) != '}') + if (c == '.') + x = t; + else if (c == '-') + { + k = 1; + break; + } + else if (c == '/') + { + m = 1; + break; + } + if ((c = lookup(key, x, t - x - 1)) >= 0 && (x = notice->item[c].data)) + { + z = x + notice->item[c].size; + while (x < z) + { + c = *x++; + if (!m || c >= '0' && c <= '9') + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( c)):(( c),(-1))); + } + } + else if (k) + { + k = 0; + i++; + } + if (k || m) + { + k = 1; + while (t < e) + if ((c = *t++) == '{') + k++; + else if (c == '}' && !--k) + break; + } + } + else if (q > 0 && *t == '\\' && (*(t + 1) == q || *(t + 1) == '\\')) + t++; + else if (*t == '}' && i) + { + t++; + i--; + } + else + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( *t++)):(( *t++),(-1))); + } + } +} + + + + + +static void +copyright __PARAM__((Notice_t* notice, register Buffer_t* b), (notice, b)) __OTORP__(Notice_t* notice; register Buffer_t* b;){ + register char* x; + register char* t; + time_t clock; + + copy(b, "Copyright (c) ", -1); + if (notice->test) + { + clock = (time_t)1000212300; + t = ctime(&clock) + 20; + } + else if (!(t = notice->item[18].data)) + { + time(&clock); + t = ctime(&clock) + 20; + } + if ((x = notice->item[19].data) && sstrncmp( t, x, 4) < 0) + t = x; + if ((x = notice->item[17].data) && sstrncmp( x, t, 4) < 0) + { + expand(notice, b, ¬ice->item[17]); + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( '-')):(( '-'),(-1))); + } + copy(b, t, 4); + if (notice->item[15].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[15]); + } + if (notice->item[5].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[5]); + if (notice->item[8].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[8]); + } + } + else if (notice->item[2].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[2]); + } +} + +typedef struct Stack_s +{ + char* info; + char* file; + int line; + int size; +} Stack_t; + +static int +push __PARAM__((Stack_t* sp, char* file, char* parent, char* info, int size, Buffer_t* buf), (sp, file, parent, info, size, buf)) __OTORP__(Stack_t* sp; char* file; char* parent; char* info; int size; Buffer_t* buf;){ + char* s; + char* t; + int i; + int n; + char path[1024]; + + if (size <= 8) + { + copy(buf, file, -1); + copy(buf, ": no space", -1); + ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + if (*file != '/' && parent && (s = strrchr(parent, '/'))) + { + n = s - parent + 1; + if ((sstrlen( file) + n + 1) <= sizeof(path)) + { + memcopy( path, parent, n); + strcopy( path + n, file); + file = path; + } + } + if ((i = open(file, O_RDONLY|0)) < 0) + { + + if (file == path) + for (s = path; *s; s++) + if (s[0] == '/' && s[1] == 'a' && s[2] == 'r' && s[3] == 'c' && s[4] == 'h' && s[5] == '/') + { + t = s; + for (s += 6; *s && *s != '/'; s++); + while (*t++ = *s++); + i = open(file, O_RDONLY|0); + } + if (i < 0) + { + copy(buf, file, -1); + copy(buf, ": cannot open", -1); + ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + } + n = read(i, info, size - 1); + close(i); + if (n < 0) + { + copy(buf, file, -1); + copy(buf, ": cannot read", -1); + ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + info[n++] = 0; + sp->file = file; + sp->info = info; + sp->line = 0; + sp->size = n; + return 0; +} + + + + + + + +int +astlicense __PARAM__((char* p, int size, char* file, char* options, int cc1, int cc2, int cc3), (p, size, file, options, cc1, cc2, cc3)) __OTORP__(char* p; int size; char* file; char* options; int cc1; int cc2; int cc3;){ + register char* s; + register char* v; + register char* x; + register int c; + int i; + int h; + int k; + int n; + int q; + int contributor; + int first; + int level; + int quote; + char* data; + char tmpbuf[(70+4)]; + char info[8 * 1024]; + Stack_t input[4]; + Notice_t notice; + Item_t item; + Buffer_t buf; + Buffer_t tmp; + + buf.end = (buf.buf = buf.nxt = p) + size; + tmp.end = (tmp.buf = tmp.nxt = tmpbuf) + sizeof(tmpbuf); + level = 0; + data = info; + level = -1; + if (options) + { + level++; + input[level].file = ""; + input[level].info = options; + input[level].line = 0; + } + if (file && *file) + { + if (push(&input[++level], file, 0, data, &info[sizeof(info)] - data, &buf)) + return -1; + data += input[level].size; + } + if (level < 0) + return 0; + s = input[level].info; + notice.test = 0; + notice.type = 0; + notice.verbose = 0; + notice.ids = 0; + notice.cc[0] = cc1; + notice.cc[1] = cc2; + notice.cc[2] = cc3; + for (i = 0; i < (sizeof(key)/sizeof(key[0])-1); i++) + notice.item[i].data = 0; + notice.item[20] = notice.item[1] = lic[notice.type]; + notice.item[20].quote = notice.item[1].quote = 0; + contributor = i = k = 0; + for (;;) + { + first = 1; + while (c = *s) + { + while (c == ' ' || c == '\t' || c == '\n' && ++input[level].line || c == '\r' || c == ',' || c == ';' || c == ')') + c = *++s; + if (!c) + break; + if (c == '#') + { + while (*++s && *s != '\n'); + if (*s) + s++; + input[level].line++; + continue; + } + if (c == '.') + { + while ((c = *++s) && (c == ' ' || c == '\t')); + file = s; + while (c && c != ' ' && c != '\t' && c != '\r' && c != '\n') + c = *++s; + *s = 0; + while (c && c != '\n') + c = *++s; + if (*file) + { + input[level].info = s + (c != 0); + if (++level >= (sizeof(input) / sizeof(input[0])) || push(&input[level], file, input[level-1].file, data, &info[sizeof(info)] - data, &buf)) + return -1; + data += input[level].size; + s = input[level].info; + } + continue; + } + if (c == '\n') + { + s++; + input[level].line++; + continue; + } + if (c == '[') + c = *++s; + x = s; + n = 0; + while (c && c != '+' && c != '=' && c != ']' && c != ')' && c != ',' && c != ' ' && c != '\t' && c != '\n' && c != '\r') + c = *++s; + n = s - x; + h = lookup(key, x, n); + if (c == '+' || c == ']') + c = *++s; + quote = 0; + if (c == '=' || first) + { + if (c == '=') + { + q = ((c = *++s) == '"' || c == '\'') ? *s++ : 0; + if (c == '(') + { + s++; + if (h == 9) + contributor = 0; + else if (h == 4) + contributor = 1; + else + { + q = 1; + i = 0; + for (;;) + { + switch (*s++) + { + case 0: + s--; + break; + case '(': + if (!i) + q++; + continue; + case ')': + if (!i && !--q) + break; + continue; + case '"': + case '\'': + if (!i) + i = *(s - 1); + else if (i == *(s - 1)) + i = 0; + continue; + case '\\': + if (*s == i && i == '"') + i++; + continue; + case '\n': + input[level].line++; + continue; + default: + continue; + } + break; + } + } + continue; + } + v = s; + while ((c = *s) && (q == '"' && (c == '\\' && (*(s + 1) == '"' || *(s + 1) == '\\') && s++ && (quote = q)) || q && c != q || !q && c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != ',' && c != ';')) + { + if (c == '\n') + input[level].line++; + s++; + } + } + else + { + h = 20; + v = x; + } + if (c == '\n') + input[level].line++; + if (contributor) + { + for (i = 0; i < notice.ids; i++) + if (n == notice.id[i].name.size && !sstrncmp( x, notice.id[i].name.data, n)) + break; + if (i < 64) + { + notice.id[i].name.data = x; + notice.id[i].name.size = n; + notice.id[i].name.quote = 0; + notice.id[i].value.data = v; + notice.id[i].value.size = s - v; + notice.id[i].value.quote = quote; + if (notice.ids <= i) + notice.ids = i + 1; + } + } + else if (h == 16) + { + if ((s - v) == 3 && v[0] == 'a' && v[1] == 'l' && v[2] == 'l') + { + for (i = 0; i < (sizeof(key)/sizeof(key[0])-1); i++) + if (notice.item[i].size) + { + expand(¬ice, &buf, &key[i]); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '=')):(( '='),(-1))); + for (h = 0;; h++) + if (h >= notice.item[i].size) + { + h = 0; + break; + } + else if (notice.item[i].data[h] == ' ' || notice.item[i].data[h] == '\t') + break; + if (h) + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\'')):(( '\''),(-1))); + expand(¬ice, &buf, ¬ice.item[i]); + if (h) + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\'')):(( '\''),(-1))); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); + } + } + else + { + if ((h = lookup(key, v, s - v)) < 0) + { + item.data = v; + item.size = s - v; + item.quote = 0; + expand(¬ice, &buf, &item); + } + else + expand(¬ice, &buf, ¬ice.item[h]); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); + } + return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf); + } + else + { + if (h == 20) + switch (c = lookup(lic, v, s - v)) + { + case 0: + return 0; + case 2: + notice.test = 1; + h = -1; + break; + case 3: + notice.verbose = 1; + h = -1; + break; + case 4: + notice.type = c; + h = -1; + break; + case -1: + c = 12; + + default: + notice.type = c; + notice.item[1].data = lic[lic[c].quote].data; + notice.item[1].size = lic[lic[c].quote].size; + if (notice.item[20].data != lic[0].data) + h = -1; + break; + } + if (h >= 0) + { + notice.item[h].data = (notice.item[h].size = s - v) ? v : (char*)0; + notice.item[h].quote = quote; + k = 1; + } + } + } + else + { + if (input[level].file) + { + copy(&buf, "\"", -1); + copy(&buf, input[level].file, -1); + copy(&buf, "\", line ", -1); + x = &tmpbuf[sizeof(tmpbuf)]; + *--x = 0; + n = ++input[level].line; + do *--x = ("0123456789")[n % 10]; while (n /= 10); + copy(&buf, x, -1); + copy(&buf, ": ", -1); + } + copy(&buf, "option error: assignment expected", -1); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + if (*s) + s++; + first = 0; + } + if (!level--) + break; + s = input[level].info; + } + if (!k) + return 0; + if (notice.type == 1 && (!notice.verbose || !notice.item[12].data)) + return 0; + if (notice.type != 4) + { + if (!notice.type) + notice.type = 12; + comment(¬ice, &buf, ((char*)0), 1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + if (notice.item[14].data) + { + copy(&tmp, "This software is part of the ", -1); + expand(¬ice, &tmp, ¬ice.item[14]); + copy(&tmp, " package", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + if (notice.type >= 5) + { + copyright(¬ice, &tmp); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.type >= 12) + comment( ¬ice, &buf, "All Rights Reserved",sizeof( "All Rights Reserved")-1, 0); + } + if (notice.type == 6 || notice.type == 7) + { + copy(&tmp, notice.item[14].data ? "and": "This software", -1); + copy(&tmp, " is licensed under the", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.type == 7) + copy(&tmp, "Eclipse Public License", -1); + else + copy(&tmp, "Common Public License", -1); + if (notice.item[23].data) + { + copy(&tmp, ", Version ", -1); + expand(¬ice, &tmp, ¬ice.item[23]); + } + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[5].data || notice.item[2].data) + { + copy(&tmp, "by ", -1); + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[15]); + copy(&tmp, " ", -1); + } + if (notice.item[5].data) + { + expand(¬ice, &tmp, ¬ice.item[5]); + if (notice.item[8].data) + { + copy(&tmp, " ", -1); + expand(¬ice, &tmp, ¬ice.item[8]); + } + } + else if (notice.item[2].data) + expand(¬ice, &tmp, ¬ice.item[2]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "A copy of the License is available at",sizeof( "A copy of the License is available at")-1, 0); + if (notice.item[21].data) + { + expand(¬ice, &tmp, ¬ice.item[21]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[22].data) + { + copy(&tmp, "(with md5 checksum ", -1); + expand(¬ice, &tmp, ¬ice.item[22]); + copy(&tmp, ")", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + } + else if (notice.type == 7) + comment( ¬ice, &buf, "http://www.eclipse.org/org/documents/epl-v10.html",sizeof( "http://www.eclipse.org/org/documents/epl-v10.html")-1, 0); + else + comment( ¬ice, &buf, "http://www.opensource.org/licenses/cpl",sizeof( "http://www.opensource.org/licenses/cpl")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 5) + { + copy(&tmp, notice.item[14].data ? "and it": "This software", -1); + copy(&tmp, " may only be used by you under license from", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[i = 5].data) + { + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[i = 15]); + copy(&tmp, " ", -1); + } + expand(¬ice, &tmp, ¬ice.item[5]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + else if (notice.item[i = 2].data) + { + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[i = 15]); + copy(&tmp, " ", -1); + } + expand(¬ice, &tmp, ¬ice.item[2]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + else + i = -1; + if (notice.item[21].data) + { + comment( ¬ice, &buf, "A copy of the Source Code Agreement is available",sizeof( "A copy of the Source Code Agreement is available")-1, 0); + copy(&tmp, "at the ", -1); + if (i >= 0) + expand(¬ice, &tmp, ¬ice.item[i]); + copy(&tmp, " Internet web site URL", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + expand(¬ice, &tmp, ¬ice.item[21]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[22].data) + { + copy(&tmp, "(with an md5 checksum of ", -1); + expand(¬ice, &tmp, ¬ice.item[22]); + copy(&tmp, ")", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + comment( ¬ice, &buf, "If you have copied or used this software without agreeing",sizeof( "If you have copied or used this software without agreeing")-1, 0); + comment( ¬ice, &buf, "to the terms of the license you are infringing on",sizeof( "to the terms of the license you are infringing on")-1, 0); + comment( ¬ice, &buf, "the license and copyright and are violating",sizeof( "the license and copyright and are violating")-1, 0); + if (i >= 0) + expand(¬ice, &tmp, ¬ice.item[i]); + copy(&tmp, "'s", -1); + if (n >= (70-32)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + else + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + copy(&tmp, "intellectual property rights.", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 11) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "This is free software; you can redistribute it and/or",sizeof( "This is free software; you can redistribute it and/or")-1, 0); + comment( ¬ice, &buf, "modify it under the terms of the GNU General Public License",sizeof( "modify it under the terms of the GNU General Public License")-1, 0); + comment( ¬ice, &buf, "as published by the Free Software Foundation;",sizeof( "as published by the Free Software Foundation;")-1, 0); + comment( ¬ice, &buf, "either version 2, or (at your option) any later version.",sizeof( "either version 2, or (at your option) any later version.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "This software is distributed in the hope that it",sizeof( "This software is distributed in the hope that it")-1, 0); + comment( ¬ice, &buf, "will be useful, but WITHOUT ANY WARRANTY;",sizeof( "will be useful, but WITHOUT ANY WARRANTY;")-1, 0); + comment( ¬ice, &buf, "without even the implied warranty of MERCHANTABILITY",sizeof( "without even the implied warranty of MERCHANTABILITY")-1, 0); + comment( ¬ice, &buf, "or FITNESS FOR A PARTICULAR PURPOSE.",sizeof( "or FITNESS FOR A PARTICULAR PURPOSE.")-1, 0); + comment( ¬ice, &buf, "See the GNU General Public License for more details.",sizeof( "See the GNU General Public License for more details.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "You should have received a copy of the",sizeof( "You should have received a copy of the")-1, 0); + comment( ¬ice, &buf, "GNU General Public License",sizeof( "GNU General Public License")-1, 0); + comment( ¬ice, &buf, "along with this software (see the file COPYING.)",sizeof( "along with this software (see the file COPYING.)")-1, 0); + comment( ¬ice, &buf, "If not, a copy is available at",sizeof( "If not, a copy is available at")-1, 0); + comment( ¬ice, &buf, "http://www.gnu.org/copyleft/gpl.html",sizeof( "http://www.gnu.org/copyleft/gpl.html")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 8) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "Redistribution and use in source and binary forms, with or",sizeof( "Redistribution and use in source and binary forms, with or")-1, -1); + comment( ¬ice, &buf, "without modification, are permitted provided that the following",sizeof( "without modification, are permitted provided that the following")-1, -1); + comment( ¬ice, &buf, "conditions are met:",sizeof( "conditions are met:")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 1. Redistributions of source code must retain the above",sizeof( " 1. Redistributions of source code must retain the above")-1, -1); + comment( ¬ice, &buf, " copyright notice, this list of conditions and the",sizeof( " copyright notice, this list of conditions and the")-1, -1); + comment( ¬ice, &buf, " following disclaimer.",sizeof( " following disclaimer.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 2. Redistributions in binary form must reproduce the above",sizeof( " 2. Redistributions in binary form must reproduce the above")-1, -1); + comment( ¬ice, &buf, " copyright notice, this list of conditions and the",sizeof( " copyright notice, this list of conditions and the")-1, -1); + comment( ¬ice, &buf, " following disclaimer in the documentation and/or other",sizeof( " following disclaimer in the documentation and/or other")-1, -1); + comment( ¬ice, &buf, " materials provided with the distribution.",sizeof( " materials provided with the distribution.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + copy(&tmp, " 3. Neither the name of ", -1); + if (notice.item[i = 15].data || notice.item[i = 5].data || notice.item[i = 2].data) + expand(¬ice, &tmp, ¬ice.item[i]); + else + copy(&tmp, "the copyright holder", -1); + copy(&tmp, " nor the", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), -1); + comment( ¬ice, &buf, " names of its contributors may be used to endorse or",sizeof( " names of its contributors may be used to endorse or")-1, -1); + comment( ¬ice, &buf, " promote products derived from this software without",sizeof( " promote products derived from this software without")-1, -1); + comment( ¬ice, &buf, " specific prior written permission.",sizeof( " specific prior written permission.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND",sizeof( "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND")-1, -1); + comment( ¬ice, &buf, "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,",sizeof( "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,")-1, -1); + comment( ¬ice, &buf, "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF",sizeof( "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF")-1, -1); + comment( ¬ice, &buf, "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",sizeof( "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE")-1, -1); + comment( ¬ice, &buf, "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS",sizeof( "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS")-1, -1); + comment( ¬ice, &buf, "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,",sizeof( "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")-1, -1); + comment( ¬ice, &buf, "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED",sizeof( "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED")-1, -1); + comment( ¬ice, &buf, "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",sizeof( "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,")-1, -1); + comment( ¬ice, &buf, "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON",sizeof( "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON")-1, -1); + comment( ¬ice, &buf, "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,",sizeof( "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,")-1, -1); + comment( ¬ice, &buf, "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",sizeof( "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY")-1, -1); + comment( ¬ice, &buf, "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE",sizeof( "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE")-1, -1); + comment( ¬ice, &buf, "POSSIBILITY OF SUCH DAMAGE.",sizeof( "POSSIBILITY OF SUCH DAMAGE.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 9) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "This software is provided 'as-is', without any express or implied",sizeof( "This software is provided 'as-is', without any express or implied")-1, -1); + comment( ¬ice, &buf, "warranty. In no event will the authors be held liable for any",sizeof( "warranty. In no event will the authors be held liable for any")-1, -1); + comment( ¬ice, &buf, "damages arising from the use of this software.",sizeof( "damages arising from the use of this software.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "Permission is granted to anyone to use this software for any",sizeof( "Permission is granted to anyone to use this software for any")-1, -1); + comment( ¬ice, &buf, "purpose, including commercial applications, and to alter it and",sizeof( "purpose, including commercial applications, and to alter it and")-1, -1); + comment( ¬ice, &buf, "redistribute it freely, subject to the following restrictions:",sizeof( "redistribute it freely, subject to the following restrictions:")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 1. The origin of this software must not be misrepresented;",sizeof( " 1. The origin of this software must not be misrepresented;")-1, -1); + comment( ¬ice, &buf, " you must not claim that you wrote the original software. If",sizeof( " you must not claim that you wrote the original software. If")-1, -1); + comment( ¬ice, &buf, " you use this software in a product, an acknowledgment in the",sizeof( " you use this software in a product, an acknowledgment in the")-1, -1); + comment( ¬ice, &buf, " product documentation would be appreciated but is not",sizeof( " product documentation would be appreciated but is not")-1, -1); + comment( ¬ice, &buf, " required.",sizeof( " required.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 2. Altered source versions must be plainly marked as such,",sizeof( " 2. Altered source versions must be plainly marked as such,")-1, -1); + comment( ¬ice, &buf, " and must not be misrepresented as being the original",sizeof( " and must not be misrepresented as being the original")-1, -1); + comment( ¬ice, &buf, " software.",sizeof( " software.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 3. This notice may not be removed or altered from any source",sizeof( " 3. This notice may not be removed or altered from any source")-1, -1); + comment( ¬ice, &buf, " distribution.",sizeof( " distribution.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 10) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "Permission is hereby granted, free of charge, to any person",sizeof( "Permission is hereby granted, free of charge, to any person")-1, 0); + comment( ¬ice, &buf, "obtaining a copy of this software and associated",sizeof( "obtaining a copy of this software and associated")-1, 0); + comment( ¬ice, &buf, "documentation files (the \"Software\"), to deal in the",sizeof( "documentation files (the \"Software\"), to deal in the")-1, 0); + comment( ¬ice, &buf, "Software without restriction, including without limitation",sizeof( "Software without restriction, including without limitation")-1, 0); + comment( ¬ice, &buf, "the rights to use, copy, modify, merge, publish, distribute,",sizeof( "the rights to use, copy, modify, merge, publish, distribute,")-1, 0); + comment( ¬ice, &buf, "sublicense, and/or sell copies of the Software, and to",sizeof( "sublicense, and/or sell copies of the Software, and to")-1, 0); + comment( ¬ice, &buf, "permit persons to whom the Software is furnished to do so,",sizeof( "permit persons to whom the Software is furnished to do so,")-1, 0); + comment( ¬ice, &buf, "subject to the following conditions:",sizeof( "subject to the following conditions:")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "The above copyright notice and this permission notice shall",sizeof( "The above copyright notice and this permission notice shall")-1, 0); + comment( ¬ice, &buf, "be included in all copies or substantial portions of the",sizeof( "be included in all copies or substantial portions of the")-1, 0); + comment( ¬ice, &buf, "Software.",sizeof( "Software.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY",sizeof( "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY")-1, 0); + comment( ¬ice, &buf, "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE",sizeof( "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE")-1, 0); + comment( ¬ice, &buf, "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR",sizeof( "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR")-1, 0); + comment( ¬ice, &buf, "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS",sizeof( "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS")-1, 0); + comment( ¬ice, &buf, "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR",sizeof( "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR")-1, 0); + comment( ¬ice, &buf, "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR",sizeof( "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR")-1, 0); + comment( ¬ice, &buf, "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE",sizeof( "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE")-1, 0); + comment( ¬ice, &buf, "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",sizeof( "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else + { + if (notice.type == 15) + { + if (notice.item[i = 15].data || notice.item[i = 5].data || notice.item[i = 2].data) + { + expand(¬ice, &tmp, ¬ice.item[i]); + copy(&tmp, " - ", -1); + } + else + i = -1; + copy(&tmp, "Proprietary", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + comment(¬ice, &buf, ((char*)0), 0, 0); + if (notice.item[21].data) + { + copy(&tmp, "This is proprietary source code", -1); + if (i >= 0) + copy(&tmp, " licensed by", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[15]); + copy(&tmp, " ", -1); + } + if (notice.item[5].data) + { + expand(¬ice, &tmp, ¬ice.item[5]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + } + else if (notice.item[2].data) + { + expand(¬ice, &tmp, ¬ice.item[2]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + } + } + else + { + copy(&tmp, "This is unpublished proprietary source code", -1); + if (i >= 0) + copy(&tmp, " of", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + if (notice.item[i = 15].data || notice.item[i = 5].data) + expand(¬ice, &tmp, ¬ice.item[i]); + if (notice.item[2].data) + { + if ((( &tmp)->nxt-( &tmp)->buf)) + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + expand(¬ice, &tmp, ¬ice.item[2]); + } + if ((( &tmp)->nxt-( &tmp)->buf)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + comment( ¬ice, &buf, "and is not to be disclosed or used except in",sizeof( "and is not to be disclosed or used except in")-1, 1); + comment( ¬ice, &buf, "accordance with applicable agreements",sizeof( "accordance with applicable agreements")-1, 1); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 13) + { + comment( ¬ice, &buf, "For nonexclusive individual use",sizeof( "For nonexclusive individual use")-1, 1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 14) + { + comment( ¬ice, &buf, "For noncommercial use",sizeof( "For noncommercial use")-1, 1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.type >= 15 && !notice.item[21].data) + { + comment( ¬ice, &buf, "Unpublished & Not for Publication",sizeof( "Unpublished & Not for Publication")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.item[21].data) + { + copy(&tmp, "This software is licensed", -1); + if (notice.item[5].data || notice.item[2].data) + { + copy(&tmp, " by", -1); + if ((notice.item[15].size + (notice.item[5].data ? (notice.item[5].size + notice.item[8].size) : notice.item[2].size)) >= ((70-32) - 6)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + else + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[15]); + copy(&tmp, " ", -1); + } + if (notice.item[5].data) + { + expand(¬ice, &tmp, ¬ice.item[5]); + if (notice.item[8].data) + { + copy(&tmp, " ", -1); + expand(¬ice, &tmp, ¬ice.item[8]); + } + } + else if (notice.item[2].data) + expand(¬ice, &tmp, ¬ice.item[2]); + } + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + comment( ¬ice, &buf, "under the terms and conditions of the license in",sizeof( "under the terms and conditions of the license in")-1, 0); + expand(¬ice, &tmp, ¬ice.item[21]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[22].data) + { + copy(&tmp, "(with an md5 checksum of ", -1); + expand(¬ice, &tmp, ¬ice.item[22]); + copy(&tmp, ")", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 15) + { + comment( ¬ice, &buf, "The copyright notice above does not evidence any",sizeof( "The copyright notice above does not evidence any")-1, 0); + comment( ¬ice, &buf, "actual or intended publication of such source code",sizeof( "actual or intended publication of such source code")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + } + if (v = notice.item[12].data) + { + x = v + notice.item[12].size; + if (*v == '\n') + v++; + item.quote = notice.item[12].quote; + do + { + for (item.data = v; v < x && *v != '\n'; v++); + if ((item.size = v - item.data) && *item.data == '\t') + { + item.data++; + item.size--; + h = 0; + } + else + h = -1; + expand(¬ice, &tmp, &item); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), h); + } while (v++ < x); + if (item.size) + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.item[13].data) + { + expand(¬ice, &tmp, ¬ice.item[13]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[i = 15].data || notice.item[i = 5].data) + expand(¬ice, &tmp, ¬ice.item[i]); + if (notice.item[2].data) + { + if ((( &tmp)->nxt-( &tmp)->buf)) + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + expand(¬ice, &tmp, ¬ice.item[2]); + } + if ((( &tmp)->nxt-( &tmp)->buf)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[10].data) + { + expand(¬ice, &tmp, ¬ice.item[10]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + } + if (v = notice.item[0].data) + { + x = v + notice.item[0].size; + q = (x - v) == 1 && (*v == '*' || *v == '-'); + k = q && notice.type != 4 ? -1 : 0; + for (;;) + { + if (!q) + { + while (v < x && (*v == ' ' || *v == '\t' || *v == '\r' || *v == '\n' || *v == ',' || *v == '+')) + v++; + if (v >= x) + break; + item.data = v; + while (v < x && *v != ',' && *v != '+' && *v++ != '>'); + item.size = v - item.data; + item.quote = notice.item[0].quote; + } + h = 0; + for (i = 0; i < notice.ids; i++) + if (q || item.size == notice.id[i].name.size && !sstrncmp( item.data, notice.id[i].name.data, item.size)) + { + h = 1; + if (notice.type == 4) + { + copy(&buf, "[-author?", -1); + expand(¬ice, &buf, ¬ice.id[i].value); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + } + else + { + if (k < 0) + { + comment( ¬ice, &buf, "CONTRIBUTORS",sizeof( "CONTRIBUTORS")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + k = 1; + expand(¬ice, &tmp, ¬ice.id[i].value); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + if (!q) + break; + } + if (q) + break; + if (!h) + { + if (notice.type == 4) + { + copy(&buf, "[-author?", -1); + expand(¬ice, &buf, &item); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + } + else + { + if (k < 0) + { + comment( ¬ice, &buf, "CONTRIBUTORS",sizeof( "CONTRIBUTORS")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + k = 1; + expand(¬ice, &tmp, &item); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + } + } + if (k > 0) + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.type == 4) + { + copy(&buf, "[-copyright?", -1); + copyright(¬ice, &buf); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + if (notice.item[21].data) + { + copy(&buf, "[-license?", -1); + expand(¬ice, &buf, ¬ice.item[21]); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + } + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); + } + else + comment(¬ice, &buf, ((char*)0), -1, 0); + return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf); +} +#line 336 "../../lib/libpp/ppproto.c" + +#line 348 +static char* +linesync __PARAM__((register Proto_t* proto, register char* p, register long n), (proto, p, n)) __OTORP__(register Proto_t* proto; register char* p; register long n;){ + + if (proto->flags & (1L<<13)) + + { + + p = strcopy(p, "\n#line "); + + + + p = number(p, n); + *p++ = '\n'; + } + return p; +} + + + + + + +static char* +init __PARAM__((Proto_t* proto, char* op, int flags), (proto, op, flags)) __OTORP__(Proto_t* proto; char* op; int flags;){ + register char* s; + + if (flags & (1L<<10)) + { + op = strcopy(op, "\ +\n\ +#if !defined(__PROTO__)\n\ +# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)\n\ +# if defined(__cplusplus)\n\ +# define __LINKAGE__ \"C\"\n\ +# else\n\ +# define __LINKAGE__\n\ +# endif\n\ +# define __STDARG__\n\ +# define __PROTO__(x) x\n\ +# define __OTORP__(x)\n\ +# define __PARAM__(n,o) n\n\ +# if !defined(__STDC__) && !defined(__cplusplus)\n\ +# if !defined(c_plusplus)\n\ +# define const\n\ +# endif\n\ +# define signed\n\ +# define void int\n\ +# define volatile\n\ +# define __V_ char\n\ +# else\n\ +# define __V_ void\n\ +# endif\n\ +# else\n\ +# define __PROTO__(x) ()\n\ +# define __OTORP__(x) x\n\ +# define __PARAM__(n,o) o\n\ +# define __LINKAGE__\n\ +# define __V_ char\n\ +# define const\n\ +# define signed\n\ +# define void int\n\ +# define volatile\n\ +# endif\n\ +# define __MANGLE__ __LINKAGE__\n\ +# if defined(__cplusplus) || defined(c_plusplus)\n\ +# define __VARARG__ ...\n\ +# else\n\ +# define __VARARG__\n\ +# endif\n\ +# if defined(__STDARG__)\n\ +# define __VA_START__(p,a) va_start(p,a)\n\ +# else\n\ +# define __VA_START__(p,a) va_start(p)\n\ +# endif\n\ +# if !defined(__INLINE__)\n\ +# if defined(__cplusplus)\n\ +# define __INLINE__ extern __MANGLE__ inline\n\ +# else\n\ +# if defined(_WIN32) && !defined(__GNUC__)\n\ +# define __INLINE__ __inline\n\ +# endif\n\ +# endif\n\ +# endif\n\ +#endif\n\ +#if !defined(__LINKAGE__)\n\ +#define __LINKAGE__ /* 2004-08-11 transition */\n\ +#endif\n\ +"); + } + else + op = strcopy(op, "\ +\n\ +#if !defined(__PROTO__)\n\ +#include \n\ +#endif\n\ +#if !defined(__LINKAGE__)\n\ +#define __LINKAGE__ /* 2004-08-11 transition */\n\ +#endif\n\ +"); + if (proto->package) + { + s = "\ +#ifndef __MANGLE_%_DATA__\n\ +# ifdef _BLD_%\n\ +# ifdef __EXPORT__\n\ +# define __MANGLE_%_DATA__ __MANGLE__ __EXPORT__\n\ +# else\n\ +# define __MANGLE_%_DATA__ __MANGLE__\n\ +# endif\n\ +# define __MANGLE_%_FUNC__ __MANGLE__\n\ +# else\n\ +# ifdef __IMPORT__\n\ +# define __MANGLE_%_DATA__ __MANGLE__ __IMPORT__\n\ +# else\n\ +# define __MANGLE_%_DATA__ __MANGLE__\n\ +# endif\n\ +# define __MANGLE_%_FUNC__ __MANGLE__\n\ +# endif\n\ +#endif\n\ +"; + for (;;) + { + switch (*op++ = *s++) + { + case 0: + op--; + break; + case '%': + op = strcopy(op - 1, proto->package); + continue; + default: + continue; + } + break; + } + } + return op; +} + + +#line 422 +static char* +nns __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ + while (*s == ' ' || *s == '\t' || *s == '\n') + s++; + return s; +} + + +#line 439 +static int +directive __PARAM__((register char* s, int dir), (s, dir)) __OTORP__(register char* s; int dir;){ + switch (*(s = nns(s))) + { + case 'e': + case 'i': + dir <<= 2; + switch (*++s) + { + case 'f': + dir |= 01; + break; + case 'l': + dir |= 02; + break; + case 'n': + dir |= 03; + break; + } + break; + } + return dir; +} + + + + + + + +static int +lex __PARAM__((register Proto_t* proto, register long flags), (proto, flags)) __OTORP__(register Proto_t* proto; register long flags;){ + register char* ip; + register char* op; + register int c; + register int state; + register short* rp; + char* m; + char* e; + char* t; + char* bp; + char* v; + char* im; + char* ko; + char* aom; + int n; + int line; + int quot; + int brack; + int sub; + int x; + int vc; + + char* ie = 0; + char* om = 0; + char* aim = 0; + char* aie = 0; + char* func = 0; + int call = 0; + int dir = 0; + int group = 0; + int last = 0; + int paren = 0; + + char* qe = 0; + int qn = 0; + int args = 0; + + + do{(ip=proto->ip);(op=proto->op);call=proto->call;}while(0); + + if (flags & (1L<<5)) (ko=op); + + fsm_start: + proto->tp = ip; + state = 0; + bp = ip; + do + { + rp = _pp_fsmtab[state]; + fsm_get: + while (!(state = rp[c = (*(unsigned char*)ip++)])); + fsm_next: + ; + } while (state > 0); + if ((n = ip - bp - 1) > 0) + { + ip = bp; + do switch( n) { default : memcopy( op, ip, n); op += n; ip += n; break; case 7 : * op++ = * ip++; case 6 : * op++ = * ip++; case 5 : * op++ = * ip++; case 4 : * op++ = * ip++; case 3 : * op++ = * ip++; case 2 : * op++ = * ip++; case 1 : * op++ = * ip++; case 0 : break; } while (0); + ip++; + } + state = ~state; + fsm_terminal: + switch ((( state)&((1<<(7+1))-1))) + { + case ((0+28)+11): + if (op > proto->ob && *(op - 1) == '=' && (op == proto->ob + 1 || *(op - 2) != '=')) switch (c) + { + case '+': + case '-': + case '*': + case '&': + (*op++=( ' ')); + break; + } + (*op++=( c)); + break; + + case ((0+28)+0): + (ip--); + c = (*(op-1)); + break; + + case ((0+28)+1): + switch (c) + { + case '\n': + if ((( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)])) goto fsm_newline; + (*op++=( c)); + proto->line++; + rp = _pp_fsmtab[(0+13)]; + break; + case '/': + + if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) (op=ko); + else + + (*op++=( c)); + if ((( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)])) + { + rp = _pp_fsmtab[(0+16)]; + break; + } + goto fsm_start; + case (255+1): + break; + default: + + if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) (op=ko); + else + + (*op++=( c)); + rp = _pp_fsmtab[(( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)]) ? (0+16) : (0+14)]; + break; + } + bp = ip; + goto fsm_get; + + case ((0+28)+2): + if (c) + { + if (state = _pp_fsmtab[(0+28)][((( rp)-_pp_fsmtab[0])/(255+1))+1]) + goto fsm_terminal; + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + (ip--); + fsm_eob: + if ((flags & ((1L<<1)|((1L<<16))|(1L<<21))) == ((1L<<16)) && (proto->flags & (1L<<16))) + { + + if (!(flags & (1L<<5))) + + flags |= (1L<<24); + c = ip - proto->ib; + if (!(flags & (1L<<15))) + im = proto->tp; + if (ip > proto->ib) + { + n = ip - im; + if (ip - n < proto->ib) + proto->flags |= (1L<<4); + memcopy(proto->ib - n, ip - n, n); + ip = proto->ib; + } + proto->tp -= c; + if (flags & (1L<<15)) + { + im -= c; + ie -= c; + } + if (aim) + aim -= c; + if (aie) + aie -= c; + if ((n = read(proto->fd, ip, proto->iz)) > 0) + { + if ((proto->options & (1L<<0)) && n < proto->iz) + { + proto->flags &= ~(1L<<16); + close(proto->fd); + } + *(ip + n) = 0; + if (state & (1<<7)) + goto fsm_splice; + bp = ip; + goto fsm_get; + } + *ip = 0; + proto->flags &= ~(1L<<16); + close(proto->fd); + } + if (state & (1<<7)) + goto fsm_splice; + + if (!(flags & (1L<<21)) && (state = rp[c = (255+1)])) + { + bp = ip; + goto fsm_next; + } + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + + case ((0+28)+3): + quot = c; + + if (c == '"' && qe) + { + for (n = 0, t = qe + 1; t < op && (*t == ' ' || *t == '\t' || *t == '\n' && ++n || *t >= 'A' && *t <= 'Z' || *t == '_'); t++); + if (t == op) + { + op = qe; + qe = 0; + qn = n; + } + else (*op++=( c)); + } + else + + (*op++=( c)); + rp = _pp_fsmtab[(0+21)]; + bp = ip; + goto fsm_get; + + case ((0+28)+4): + if (c == quot) + { + + if (!(flags & (1L<<3))) + qe = (c == '"') ? op : (char*)0; + + (*op++=( c)); + + while (qn > 0) + { + qn--; + (*op++=( '\n')); + } + + } + else if (c != '\n' && c != (255+1)) + { + (*op++=( c)); + bp = ip; + goto fsm_get; + } + else + { + + while (qn > 0) + { + qn--; + (*op++=( '\n')); + } + + (ip--); + } + c = (0401+1); + break; + + case ((0+28)+5): + + if (flags & (1L<<0)) (*op++=( c)); + else + + switch (c) + { + case 'a': + n = (('A'==0301)?0057:0007); + goto fsm_oct; + case 'E': + n = (('A'==0301)?0047:0033); + goto fsm_oct; + case 'v': + n = 0013; + goto fsm_oct; + case 'x': + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + lex(proto, (flags & ((1L<<16))) | (1L<<21)); + for (n = x = 0; (c = (*(unsigned char*)ip++)), x < 3; x++) switch (c) + { + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + n = (n << 4) + c - '0'; + break; + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': + n = (n << 4) + c - 'a' + 10; + break; + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': + n = (n << 4) + c - 'A' + 10; + break; + default: + goto fsm_hex; + } + fsm_hex: + (ip--); + fsm_oct: + (*op++=( ((n >> 6) & 07) + '0')); + (*op++=( ((n >> 3) & 07) + '0')); + (*op++=( (n & 07) + '0')); + break; + default: + (*op++=( c)); + break; + } + rp = _pp_fsmtab[(0+21)]; + bp = ip; + goto fsm_get; + + case ((0+28)+6): + (ip--); + + if ((flags & (1L<<5)) && *proto->tp == 's' && !sstrncmp( proto->tp, "static", 6)) + { + c = ((0500+4)+9); + break; + } + + if (*proto->tp == '_' && !sstrncmp( proto->tp, "__STDPP__directive", 6)) c = '#'; + else c = (0401+0); + + break; + + case ((0+28)+7): + fsm_newline: + proto->line++; + + if (flags & (1L<<5)) + { + if (op != proto->ob && (*(op-1)) != ' ' && (*(op-1)) != '\n') + (*op++=( ' ')); + } + else + + (*op++=( c)); + if (flags & (1L<<3)) + { + + if (flags & (1L<<0)) + { + if (flags & (1L<<5)) (op=ko); + if (flags & (1L<<12)) + { + *(ip - 1) = 0; + op = strcopy(om, "/* "); + op = strcopy(op, im); + op = strcopy(op, " */\n"); + } + flags &= ~((1L<<2)|(1L<<3)|(1L<<7)|(1L<<8)|(1L<<12)|(1L<<15)|(1L<<22)|(1L<<26)); + } + else + + { + if ((flags & ((1L<<2)|(1L<<22))) == ((1L<<2)|(1L<<22))) + { + *(ip - 1) = 0; + op = strcopy(om, "#if defined(__STDC__) || defined(__STDPP__)\n"); + op = strcopy(op, im); + op = strcopy(op, "\n#else\n"); + bp = ip; + ip = im; + *op++ = *ip++; + while (*op = *ip++) + if (*op++ == '#' && *ip != '(') + { + op--; + while (*--op == ' ' || *op == '\t'); + if (*ip == '#') + { + op = strcopy(op + 1, "/**/"); + while (*++ip == ' ' || *ip == '\t'); + } + else + { + if (*op != '"') *++op = '"'; + op++; + while (*ip == ' ' || *ip == '\t') ip++; + while ((c = *ip) >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '_') *op++ = *ip++; + while (*ip == ' ' || *ip == '\t') ip++; + if (*ip == '"') ip++; + else *op++ = '"'; + } + } + ip = bp; + op = strcopy(op, "\n#endif\n"); + op = linesync(proto, op, proto->line); + } + flags &= ~((1L<<2)|(1L<<3)|(1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<22)|(1L<<23)|(1L<<25)|(1L<<26)); + } + call = 0; + group = 0; + paren = 0; + last = '\n'; + } + if (paren == 0 && (flags & ((1L<<15)|(1L<<21)|(1L<<23)|(1L<<24))) == (1L<<24)) + { + + if (flags & (1L<<5)) (op=ko); + + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + goto fsm_start; + + case ((0+28)+8): + (*op++=( c)); + rp = _pp_fsmtab[((( state)>>(7+1))&((1<<7)-1))]; + bp = ip; + goto fsm_get; + + case ((0+28)+13): + (*op++=( c)); + c = (((( state)>>(7+1))&((1<<7)-1))+0401); + break; + + case ((0+28)+14): + (ip--); + c = (((( state)>>(7+1))&((1<<7)-1))+0401); + break; + + case (((0+28)+12)): + (ip--); + c = (0401+0); + if (!(flags & (1L<<1))) switch (((((long)( *proto->tp))<<16)|(((long)( *(ip - 1)))<<8)|((long)( ip - proto->tp)))) + { + case ((((long)( 'N'))<<16)|(((long)( 'N'))<<8)|((long)( 3))): + if (proto->tp[1] == 'o') + c = ((0500+4)+6); + break; + case ((((long)( 'd'))<<16)|(((long)( 'o'))<<8)|((long)( 2))): + c = ((0500+4)+6); + break; + case ((((long)( 'e'))<<16)|(((long)( 'e'))<<8)|((long)( 4))): + if (!(flags & (1L<<21)) && (flags & ((1L<<3)|(1L<<25))) != (1L<<3) && !sstrncmp( proto->tp, "else", 4)) + { + c = ((0500+4)+8); + goto fsm_id; + } + break; + case ((((long)( 'e'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): + if (!sstrncmp( proto->tp, "extern", 6)) + c = ((0500+4)+9); + break; + case ((((long)( 'f'))<<16)|(((long)( 'r'))<<8)|((long)( 3))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "for", 3)) + { + c = ((0500+4)+11); + goto fsm_id; + } + break; + case ((((long)( 'i'))<<16)|(((long)( 'f'))<<8)|((long)( 2))): + c = ((0500+4)+13); + break; + case ((((long)( 'i'))<<16)|(((long)( 'e'))<<8)|((long)( 6))): + if (!sstrncmp( proto->tp, "inline", 6) && !(flags & ((1L<<15)|(1L<<23)|(1L<<25)|(1L<<26))) && proto->brace == 0 && paren == 0 && group == 0 && (last == ';' || last == '}' || last == '\n' || last == 0)) + { + flags |= (1L<<23); + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + line = proto->line; + op = strcopy(op - 6, "__INLINE__"); + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + } + break; + case ((((long)( 'r'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "return", 6)) + { + c = ((0500+4)+17); + goto fsm_id; + } + break; + case ((((long)( 's'))<<16)|(((long)( 'c'))<<8)|((long)( 6))): + if ((proto->options & (1L<<6)) && !sstrncmp( proto->tp, "static", 6)) + { + proto->ox = op - 6; + flags |= (1L<<6); + } + break; + case ((((long)( 't'))<<16)|(((long)( 'f'))<<8)|((long)( 7))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "typedef", 7)) + { + flags |= (1L<<26); + c = ((0500+4)+9); + } + break; + case ((((long)( 'v'))<<16)|(((long)( 't'))<<8)|((long)( 8))): + if (*ip == '(' && !sstrncmp( proto->tp, "va_start", 8)) c = (0500+1); + break; + case ((((long)( 'v'))<<16)|(((long)( 'd'))<<8)|((long)( 4))): + if (!sstrncmp( proto->tp, "void", 4)) + { + if (flags & ((1L<<0)|(1L<<19)|(1L<<10)|(1L<<11))) c = ((0500+4)+30); + else + { + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + line = proto->line; + if (lex(proto, (flags & ((1L<<16))) | (1L<<21)) == '*') + { + memcopy(op - 4, "__V_", 4); + memcopy(ip - 4, "__V_", 4); + } + else c = ((0500+4)+30); + proto->line = line; + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + bp = ip; + } + } + break; + case ((((long)( 'w'))<<16)|(((long)( 'e'))<<8)|((long)( 5))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "while", 5)) + { + c = ((0500+4)+26); + goto fsm_id; + } + break; + } + + if ((flags & (1L<<0)) && c != ((0500+4)+9)) + c = (0401+0); + + break; + + case ((0+28)+10): + goto fsm_start; + + case ((0+28)+15): + (ip--); + + if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) + { + while (op > proto->ob && (*(op - 1) == ' ' || *(op - 1) == '\t')) + op--; + if (op > proto->ob && *(op - 1) != '\n') *op++ = ' '; + } + + goto fsm_start; + + default: + if (state & (1<<7)) + { + if (c == '\\') + { + if (!(n = (*(unsigned char*)ip++))) + { + goto fsm_eob; + fsm_splice: + c = '\\'; + n = (*(unsigned char*)ip++); + } + if (n == '\n') + { + proto->line++; + (*op++=( '\\')); + (*op++=( '\n')); + bp = ip; + goto fsm_get; + } + (ip--); + } + state &= ~(1<<7); + if (state >= (0+28)) + goto fsm_terminal; + rp = _pp_fsmtab[state]; + } + (*op++=( c)); + bp = ip; + goto fsm_get; + } + if (!(flags & ((1L<<10)|(1L<<11)|(1L<<21)))) + { + if (!(flags & (1L<<3))) switch (c) + { + case '(': + + if (!(flags & (1L<<0)) || proto->brace == 0) + + { + if (paren++ == 0) + { + + if (!(flags & (1L<<0)) || group <= 1) + + { + + args = 0; + + if (group++ == 0) group++; + else if (flags & (1L<<8)) call++; + flags |= (1L<<15); + im = ip - 1; + om = op - 1; + } + sub = 0; + } + else if (paren == 2 && !aim) + { + sub++; + if (last == '(') + { + flags &= ~(1L<<15); + om = 0; + } + else if (flags & (1L<<8)) + { + aim = ip - 1; + aom = op - 1; + } + else if ((flags & ((1L<<15)|(1L<<25))) == (1L<<15)) + { + for (m = ip - 2; m > im && (*m == ' ' || *m == '\t'); m--); + if (m != im && sub == 1) + { + m = im + (*nns(ip) == '*'); + } + if (m == im) + { + flags &= ~(1L<<15); + om = 0; + } + } + else if ((flags & (1L<<15)) && sub == 1 && *nns(ip) != '*') + { + flags &= ~(1L<<15); + om = 0; + } + } + flags &= ~(1L<<25); + } + break; + case ')': + + if (!(flags & (1L<<0)) || proto->brace == 0) + + if (--paren == 0) + { + + if (flags & (1L<<0)) + { + if (group != 2) + { + c = (0401+0); + break; + } + group++; + } + + ie = ip; + } + else if (paren == 1 && (flags & (1L<<8)) && !aie) + aie = ip; + break; + case '*': + if (last == '(' && group == 2) + { + group--; + if (paren == 1) + { + flags |= (1L<<8); + aim = aie = 0; + } + } + break; + case '#': + dir = directive(ip, dir); + if (proto->brace == 0 && paren == 0 && last != '=' && (flags & ((1L<<0)|(1L<<1)|(1L<<3)|(1L<<15)|(1L<<19)|(1L<<23)|(1L<<25))) == ((1L<<15)|(1L<<25)) && ((dir & 03) != 03 || ((dir>>2) & 03) != 01)) + flags |= (1L<<3); + else if (!(flags & ((1L<<1)|(1L<<3)))) + { + flags |= (1L<<3); + if (!(flags & (1L<<19))) + { + bp = ip; + while (*ip == ' ' || *ip == '\t') ip++; + if (*ip == 'l' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e') + { + if (*++ip == ' ' || *ip == '\t') + { + proto->line = 0; + while (*++ip >= '0' && *ip <= '9') + proto->line = proto->line * 10 + *ip - '0'; + proto->line--; + } + } + + else if ((flags & ((1L<<0)|(1L<<5))) == (1L<<0)) + { + n = 0; + t = ip + 6; + while (ip < t && *ip >= 'a' && *ip <= 'z') + n = ((( n)<<5)+(( *ip++)-('a'-1))); + switch (n) + { + case ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'l')-('a'-1))))<<5)+(( 's')-('a'-1))))<<5)+(( 'e')-('a'-1))): + case ((( ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'f')-('a'-1))): + while (*ip == ' ' || *ip == '\t') ip++; + if (*ip != '\n' && *ip != '/' && *(ip + 1) != '*') + { + flags |= (1L<<12)|(1L<<15); + im = ip; + om = op + (ip - bp); + } + break; + case ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'l')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'r')-('a'-1))))<<5)+(( 'r')-('a'-1))))<<5)+(( 'o')-('a'-1))))<<5)+(( 'r')-('a'-1))): + case ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( (( 'u')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): + break; + case ((( ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'c')-('a'-1))))<<5)+(( 'l')-('a'-1))))<<5)+(( 'u')-('a'-1))))<<5)+(( 'd')-('a'-1))): + if (*ip == 'e') ip++; + + case ((( ((( ((( ((( ((( (( 'd')-('a'-1)))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'n')-('a'-1))))<<5)+(( 'e')-('a'-1))): + case ((( ((( ((( ((( ((( (( 'p')-('a'-1)))<<5)+(( 'r')-('a'-1))))<<5)+(( 'a')-('a'-1))))<<5)+(( 'g')-('a'-1))))<<5)+(( 'm')-('a'-1))))<<5)+(( 'a')-('a'-1))): + if (*ip < 'a' || *ip > 'z') break; + + default: + flags |= (1L<<12)|(1L<<15); + im = bp - 1; + om = op - 1; + break; + } + } + else + + { + if (*ip == 'i' && *++ip == 'n' && *++ip == 'c' && *++ip == 'l' && *++ip == 'u' && *++ip == 'd' && *++ip == 'e') + { + while (*++ip == ' ' || *ip == '\t'); + if (*ip++ == '<' && *ip++ == 's' && *ip++ == 't' && *ip++ == 'd' && *ip++ == 'a' && *ip++ == 'r' && *ip++ == 'g' && *ip++ == '.' && *ip++ == 'h' && *ip++ == '>') + { + op = strcopy(op, "\ +if !defined(va_start)\n\ +#if defined(__STDARG__)\n\ +#include \n\ +#else\n\ +#include \n\ +#endif\n\ +#endif\n\ +"); + op = linesync(proto, op, proto->line); + break; + } + } + else if (*ip == 'd' && *++ip == 'e' && *++ ip == 'f' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e' && (*++ip == ' ' || *ip == '\t')) + { + while (*++ip == ' ' || *ip == '\t'); + if (*ip == 'e' && *++ip == 'x' && *++ ip == 't' && *++ip == 'e' && *++ip == 'r' && *++ip == 'n' && (*++ip == ' ' || *ip == '\t')) + { + t = ip; + while (*++t == ' ' || *t == '\t'); + if (*t == 'e' && *++t == 'x' && *++ t == 't' && *++t == 'e' && *++t == 'r' && *++t == 'n' && (*++t == ' ' || *t == '\t' || *t == '\n' || *t == '\r')) + ip = t; + t = ip; + while (*++t == ' ' || *t == '\t'); + if (*t == '_' && *(t + 1) == '_') + { + op = strcopy(op, "undef __MANGLE__\n"); + op = linesync(proto, op, proto->line); + op = strcopy(op, "#define __MANGLE__ __LINKAGE__"); + break; + } + } + flags |= (1L<<2)|(1L<<15); + im = bp - 1; + om = op - 1; + } + else if (*ip == 'u' && *++ip == 'n' && *++ ip == 'd' && *++ip == 'e' && *++ip == 'f' && (*++ip == ' ' || *ip == '\t')) + { + while (*++ip == ' ' || *ip == '\t'); + if (*ip == 'e' && *++ip == 'x' && *++ ip == 't' && *++ip == 'e' && *++ip == 'r' && *++ip == 'n' && (*++ip == ' ' || *ip == '\t' || *ip == '\n' || *ip == '\r')) + { + op = strcopy(op, "undef __MANGLE__\n"); + op = linesync(proto, op, proto->line); + op = strcopy(op, "#define __MANGLE__ __LINKAGE__"); + break; + } + flags |= (1L<<2)|(1L<<15); + im = bp - 1; + om = op - 1; + } + } + ip = bp; + } + break; + } + else + break; + + case '{': + if (proto->brace++ == 0 && paren == 0) + { + if (last == '=') flags |= (1L<<9); + + else if (flags & (1L<<0)) + { + if ((flags & ((1L<<15)|(1L<<17)|(1L<<23))) == (1L<<15)) + { + if (args) + { + v = number(op, args < 0 ? -args : args); + v = strcopy(v, " argument actual/formal mismatch"); + *v++ = ' '; + v = memcopy(v, im, ie - im); + *v = 0; + proto_error((char*)proto + sizeof(Proto_t), 2, op, ((char*)0)); + } + ip--; + + v = ie; + while (ie < ip) + if (*ie++ == '/' && *ie == '*') + { + e = ie - 1; + while (++ie < ip) + { + if (*ie == '*') + { + while (ie < ip && *ie == '*') ie++; + if (ie < ip && *ie == '/') + { + while (++ie < ip && (*ie == ' ' || *ie == '\t')); + while (e > v && (*(e - 1) == ' ' || *(e - 1) == '\t')) e--; + if (e > v && *e != '\n') *e++ = ' '; + t = ie; + while (--e >= v) + *--t = *e; + v = t; + break; + } + } + } + } + ie = v; + + op = om++; + if (flags & (1L<<5)) + { + v = op; + while (v > ko && *--v != ' '); + if (*v != ' ') + { + om = (v = (op += 4)) + 1; + while (v >= ko + 4) + { + *v = *(v - 4); + v--; + } + memcopy(ko, "int ", 4); + } + if (*v == ' ') + { + while (*(v + 1) == '*') + *v++ = '*'; + *v = '\t'; + if ((v - ko) <= 8) + { + om = (e = ++op) + 1; + while (e > v) + { + *e = *(e - 1); + e--; + } + } + } + om = (v = (op += 7)) + 1; + while (v >= ko + 7) + { + *v = *(v - 7); + v--; + } + memcopy(ko, "extern ", 7); + } + (*op++=( '(')); + t = op; + e = 0; + + while (ie < ip) + { + if ((c = *ie) == ' ' || c == '\t' || c == '\n') + { + while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); + if (ie >= ip) break; + if (c != '*' && op > om) (*op++=( ' ')); + } + if ((n = ((c = *ie) == ',')) || c == ';') + { + if (flags & (1L<<5)) + { + m = op; + while (op > om && ((c = *(op - 1)) == '(' || c == ')' || c == '[' || c == ']')) + op--; + v = op; + while (op > om && (c = *(op - 1)) != ' ' && c != '*') + op--; + while (*(op - 1) == ' ') + op--; + if (!e) + { + e = op; + while (e > om && *(e - 1) == '*') + e--; + } + + + + + if (op <= om) + op = strcopy(op, "int"); + else if (*(op - 1) == ',') + op = strcopy(op, " int"); + + while (v < m) + (*op++=( *v++)); + } + (*op++=( ',')); + if (n) + { + if (x = !e) e = op - 1; + (*op++=( ' ')); + m = t; + while (m < e) + (*op++=( *m++)); + if (x) + { + m = e; + while (*--e != ' '); + while (*(e - 1) == '*') e--; + op -= m - e; + } + } + while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); + if (ie >= ip) (op--); + else (*op++=( ' ')); + if (!n) + { + t = op; + e = 0; + } + } + else if (*ie == '*') + { + if (op > om && (c = *(op - 1)) == ' ') op--; + while (*ie == '*') (*op++=( *ie++)); + while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; + if (c != '(') (*op++=( ' ')); + } + else if (*ie == '(') + { + if (op > om && *(op - 1) == ' ') op--; + (*op++=( *ie++)); + while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; + } + else if (*ie == ')') + { + if (op > om && *(op - 1) == '(') + proto_error((char*)proto + sizeof(Proto_t), 1, "function pointer argument prototype omitted", ((char*)0)); + (*op++=( *ie++)); + while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; + } + else if ((flags & (1L<<5)) && (op == om || *(op - 1) == ' ') && *ie == 'r' && !sstrncmp( ie, "register", 8) && (*(ie + 8) == ' ' || *(ie + 8) == '\t' || *(ie + 8) == '\n')) + { + ie += 8; + if (op > om) (op--); + } + else (*op++=( *ie++)); + } + + if (op <= om) op = strcopy(op, "void"); + (*op++=( ')')); + if (flags & (1L<<5)) + { + (*op++=( ';')); + (*op++=( '\n')); + (proto->op=op); + (ko=op); + } + else + { + (*op++=( '\n')); + (*op++=( *ip)); + } + ip++; + flags &= ~((1L<<15)|(1L<<23)); + } + } + + else if ((flags & ((1L<<15)|(1L<<19)|(1L<<23)|(1L<<25))) == ((1L<<15)|(1L<<25))) + { + line = proto->line; + op = strcopy(om, " __PARAM__("); + op = memcopy(op, im, ie - im); + (*op++=( ',')); + (*op++=( ' ')); + (*op++=( '(')); + flags &= ~((1L<<15)|(1L<<23)); + if (flags & (1L<<27)) + { + if ((vc = ie - im + 1) > sizeof(proto->variadic)) vc = sizeof(proto->variadic); + memcopy(proto->variadic, im, vc); + op = strcopy(op, "va_alist)) __OTORP__(va_dcl)\n{"); + } + else + { + flags |= (1L<<23); + proto->ip = im; + proto->op = op; + group = 0; + brack = 0; + for (;;) + { + switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) + { + case '[': + brack++; + continue; + case ']': + brack--; + continue; + case '(': + if (paren++) group++; + continue; + case ')': + if (--paren == 0) + { + group = 0; + if (flags & (1L<<15)) + { + flags &= ~((1L<<15)|(1L<<23)); + op = memcopy(op, m, e - m); + } + break; + } + continue; + case ',': + if (paren == 1) + { + group = 0; + if (flags & (1L<<15)) + { + flags &= ~((1L<<15)|(1L<<23)); + op = memcopy(op, m, e - m); + } + (*op++=( ',')); + (*op++=( ' ')); + proto->op = op; + } + continue; + case (0401+0): + if (group <= 1 && !brack) + { + flags |= (1L<<15); + m = proto->tp; + e = proto->ip; + } + continue; + default: + continue; + } + break; + } + (*op++=( ')')); + (*op++=( ')')); + } + if (!(flags & (1L<<23))) + { + flags |= (1L<<23); + proto->op = strcopy(op, " __OTORP__("); + proto->ip = im + 1; + n = *(ie - 1); + *(ie - 1) = ';'; + c = *ie; + *ie = 0; + lex(proto, (flags & ((1L<<16))) | (1L<<1)); + *(ie - 1) = n; + *ie = c; + proto->ip = ie; + op = proto->op; + (*op++=( ')')); + } + if (flags & (1L<<6)) memcopy( proto->ox, "extern", 6); + op = linesync(proto, op, proto->line = line); + if (flags & (1L<<3)) + { + proto->brace = 0; + (*op++=( '\n')); + (*op++=( '#')); + } + else if (!(flags & (1L<<27))) (*op++=( '{')); + } + } + flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)); + call = 0; + group = 0; + break; + case '}': + flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)|(1L<<25)); + if (--proto->brace == 0) + { + flags &= ~((1L<<9)|(1L<<27)|(1L<<28)); + + if (flags & (1L<<5)) (op=ko); + + } + call = 0; + group = 0; + paren = 0; + break; + case '=': + if (last == '?') flags |= (1L<<3); + else if (paren == 0 && (flags & ((1L<<9)|(1L<<15)|(1L<<23))) == (1L<<15)) + { + if (last == ')' && proto->brace && (group != 2 || call != 2)) flags |= (1L<<23); + else goto fsm_statement; + } + goto fsm_other; + case ',': + + if (flags & (1L<<0)) + { + if (paren == 1) args++; + else + { + args--; + flags &= ~(1L<<15); + } + break; + } + + if (paren == 0 && (flags & (1L<<1))) *(op - 1) = c = ';'; + + case ';': + fsm_statement: + if (flags & (1L<<9)) ; + + else if (flags & (1L<<0)) + { + if (paren == 0) + { + if ((flags & (1L<<15)) && last == ')') + flags &= ~(1L<<15); + if (!(flags & (1L<<15))) + { + call = 0; + group = 0; + flags &= ~(1L<<23); + if (flags & (1L<<5)) (op=ko); + if (flags & (1L<<24)) + { + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + } + else + { + args--; + if ((flags & ((1L<<5)|(1L<<23))) == ((1L<<5)|(1L<<23))) + (op=ko); + } + } + } + + else if (paren == 0) + { + if ((flags & ((1L<<15)|(1L<<17)|(1L<<23))) == (1L<<15) && call > 1) + { + if ((flags & (1L<<14)) && func) + { + func[0] = 'F'; + func[1] = 'U'; + func[2] = 'N'; + func[3] = 'C'; + func = 0; + } + if ((flags & ((1L<<1)|(1L<<8))) == (1L<<8) && aim && aie < im) + { + while (aie < ip && (*aie == ' ' || *aie == '\t' || *aie == '\n')) aie++; + v = aim; + while (v < aie) + if (*v++ == ')') break; + while (v < aie && (*v == ' ' || *v == '\t' || *v == '\n')) v++; + if (v == aie || !(flags & (1L<<20))) + { + if (flags & (1L<<20)) n = 3; + else if (v == aie && *v == '(') n = 10; + else n = 11; + ko = op; + om += n; + v = op += n; + while (v >= ko + n) + { + *v = *(v - n); + v--; + } + if (flags & (1L<<20)) memcopy(aom, "(...))", 6); + else if (n == 10) memcopy(aom, "(__VARARG__))", 13); + else + { + ko = strcopy(aom, " __PROTO__("); + ko = memcopy(ko, aim, aie - aim); + *ko = ')'; + if (++ko >= om) + { + *ko++ = ')'; + om = ko; + } + } + } + } + else if (flags & (1L<<26)) + { + op = om; + while (*--op == ' ' || *op == '\t' || *op == '\n'); + if (*op != ')') + { + op = om += 14; + *--op = ')'; + while ((x = *(op - 14)) >= 'A' && x <= 'Z' || x >= 'a' && x <= 'z' || x >= '0' && x <= '9' || x == '_') + *--op = x; + memcopy(op - 13, "(__OTORP__(*)", 13); + } + } + if (flags & (1L<<17)) + ; + else if (flags & (1L<<20)) + { + op = om; + if (!(flags & (1L<<25))) op = strcopy(op, "(...)"); + else op = memcopy(op, im, ie - im); + (*op++=( c)); + } + else + { + if (flags & (1L<<1)) op = strcopy(om, "()"); + else if (!(flags & (1L<<25))) op = strcopy(om, "(__VARARG__)"); + else + { + op = strcopy(om, " __PROTO__("); + op = memcopy(op, im, ie - im); + (*op++=( ')')); + } + if (flags & (1L<<6)) memcopy( proto->ox, "extern", 6); + (*op++=( c)); + } + flags &= ~((1L<<15)|(1L<<27)|(1L<<28)); + if (c == ',' && !(flags & (1L<<8))) + { + call = 1; + group = 0; + break; + } + } + else if (flags & ((1L<<17)|(1L<<23))) call = 0; + if (c == ';') + { + flags &= ~((1L<<6)|(1L<<14)|(1L<<25)|(1L<<26)); + call = 0; + if (flags & (1L<<24)) + { + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + } + else call = call > 1 && c == ','; + group = 0; + flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)); + } + else if (paren == 1 && group == 1 && !(flags & ((1L<<7)|(1L<<14)))) flags |= (1L<<25)|(1L<<17); + break; + case ((0500+4)+6): + case ((0500+4)+13): + flags |= (1L<<25)|(1L<<23); + break; + case ((0500+4)+9): + + if (flags & (1L<<0)) + { + if (proto->brace == 0) + flags |= (1L<<23); + } + else + + if (paren == 0 && !(flags & (1L<<26))) + { + flags |= (1L<<14); + if (!(flags & (1L<<19)) || proto->package) + { + op = strcopy(op, " __MANGLE__"); + if (proto->package) + { + op = strcopy(op - 1, proto->package); + func = op + 1; + op = strcopy(op, "_DATA__"); + } + } + else + func = 0; + } + break; + case (0401+29): + if (paren == 0 && (flags & ((1L<<1)|(1L<<27))) == (1L<<1)) + { + op -= 3; + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return c; + } + if (paren == 1 && !(flags & (1L<<23))) + flags |= (1L<<27); + flags |= (1L<<25); + break; + case ((0500+4)+30): + goto fsm_id; + case (0500+1): + if ((flags & ((1L<<19)|(1L<<27))) == (1L<<27)) + { + flags &= ~(1L<<15); + line = proto->line; + op = strcopy(op - 8, "__VA_START__"); + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + for (;;) + { + switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) + { + case 0: + case ';': + break; + case (0401+0): + if (!(flags & (1L<<15))) + { + flags |= (1L<<15); + m = proto->tp; + e = proto->ip; + } + continue; + default: + continue; + } + break; + } + do{(ip=proto->ip);(op=proto->op);call=proto->call;}while(0); + if (flags & (1L<<15)) + { + v = m; + n = e - m; + } + else + { + v = "ap"; + n = 2; + } + op = strcopy(op, " __OTORP__("); + proto->ip = proto->variadic; + proto->op = op; + flags &= ~(1L<<15); + group = 0; + bp = proto->ip + 1; + if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; + for (;;) + { + switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) + { + case '(': + if (paren++) group++; + continue; + case ')': + if (--paren == 0) + { + if (flags & (1L<<15)) + { + flags &= ~(1L<<15); + if (!(flags & (1L<<28))) + { + op = memcopy(op, m, e - m); + op = strcopy(op, " = "); + } + op = strcopy(op, "va_arg("); + op = memcopy(op, v, n); + (*op++=( ',')); + (*op++=( ' ')); + if (m > bp) op = memcopy(op, bp, m - bp); + else op = strcopy(op, "int "); + if (group > 1) op = strcopy(op, ")()"); + else op = memcopy(op, e, proto->ip - e - 1); + (*op++=( ')')); + (*op++=( ';')); + } + group = 0; + break; + } + continue; + case ',': + if (paren == 1) + { + if (flags & (1L<<15)) + { + flags &= ~(1L<<15); + if (!(flags & (1L<<28))) + { + op = memcopy(op, m, e - m); + op = strcopy(op, " = "); + } + op = strcopy(op, "va_arg("); + op = memcopy(op, v, n); + (*op++=( ',')); + (*op++=( ' ')); + if (m > bp) op = memcopy(op, bp, m - bp); + else op = strcopy(op, "int "); + if (group > 1) op = strcopy(op, ")()"); + else op = memcopy(op, e, proto->ip - e - 1); + (*op++=( ')')); + (*op++=( ';')); + bp = proto->ip + 1; + if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; + } + group = 0; + proto->op = op; + } + continue; + case (0401+0): + if (group <= 1) + { + flags |= (1L<<15); + m = proto->tp; + e = proto->ip; + } + continue; + default: + continue; + } + break; + } + op = strcopy(op, ")"); + flags |= (1L<<28); + proto->line = line; + call = 0; + break; + } + + case (0401+0): + fsm_id: + + if (flags & (1L<<0)) + { + if (!args && paren == 1) args++; + break; + } + + if (paren == 0) + { + if (last == ')') + { + if (proto->brace == 0 && !(flags & (1L<<1))) flags |= (1L<<23); + call = !call; + } + else if ((flags & (1L<<23)) || c == (0401+0) || c == ((0500+4)+30)) call++; + else flags |= (1L<<23); + if (last == (0401+0)) flags |= (1L<<7); + } + c = (0401+0); + flags |= (1L<<25); + break; + case (0401+1): + if (*proto->tp >= '0' && *proto->tp <= '9') + { + n = 0; + for (;; op--) + { + switch (*(op - 1)) + { + case 'f': + case 'F': + t = op; + while ((c = *--t) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'); + if (*t == '.') + op--; + n = 0; + break; + case 'l': + case 'L': + if (!(n & 01)) + { + n |= 01; + t = op; + while ((c = *--t) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'); + if (*t == '.') + { + n = 0; + op--; + break; + } + } + continue; + case 'u': + case 'U': + n |= 02; + continue; + } + break; + } + if (n & 01) + *op++ = 'L'; + if (n & 02) + { + m = op; + t = op = m + 10; + while ((c = *--m) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') + *--t = c; + c = *t; + strcopy(m + 1, "(unsigned)"); + *t = c; + break; + } + } + goto fsm_other; + + case '[': + if ((flags & (1L<<0)) && paren == 0 && group <= 2) flags |= (1L<<23); + + + default: + fsm_other: + + if (flags & (1L<<0)) break; + + flags |= (1L<<25); + if (paren == 0) flags |= (1L<<17); + break; + } + else if (c == '#' && *ip != '(') flags |= (1L<<22); + last = c; + + if ((flags & ((1L<<5)|(1L<<15))) == ((1L<<5)|(1L<<15)) && ((flags & ((1L<<3)|(1L<<23))) || proto->brace || c != '(' && c != ')' && c != '*' && c != (0401+0))) + (op=proto->op); + else + + (proto->op=op); + goto fsm_start; + } + else if (flags & ((1L<<10)|(1L<<11))) + { + + if ((flags & (1L<<29)) && c == '%' && *ip == '{') + t = 0; + else + + { + if (c == '#') + { + for (t = ip; *t == ' ' || *t == '\t'; t++); + if (*t++ == 'i' && *t++ == 'f' && *t++ == 'n' && *t++ == 'd' && *t++ == 'e' && *t++ == 'f') + { + + + + + t = 0; + } + } + else + t = ""; + } + if (t) + { + + n = ip - proto->tp; + ip -= n; + op -= n; + + + + + } + else + while (*ip != '\n') + *op++ = *ip++; + op = init(proto, op, flags); + op = linesync(proto, op, proto->line); + flags &= ~((1L<<10)|(1L<<11)); + proto->flags &= ~((1L<<10)|(1L<<11)); + goto fsm_start; + } + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return c; +} + + + + + +void +pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ + register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); + + if (proto->flags & (1L<<16)) close(proto->fd); + free((char*)proto); +} + + +#line 2055 +char* +pppopen __PARAM__((char* file, int fd, char* notice, char* options, char* package, char* comment, int flags), (file, fd, notice, options, package, comment, flags)) __OTORP__(char* file; int fd; char* notice; char* options; char* package; char* comment; int flags;){ + register Proto_t* proto; + register char* iob; + register long n; + register char* s; + char* t; + int pragma; + int clr; + int hit; + int i; + int z; + char* b; + + int comlen; + char com[80]; + + int m = 0; + + static int retain; + + + + + + + if (flags & (1<<0)) flags &= ~(1<<5); + + if (flags & (1<<11)) flags &= ~retain; + else retain &= (1<<6); + if (file && (fd = open(file, O_RDONLY)) < 0) return 0; + + + + + + + + + + + + + + + + + + + + + + + { + + + + + n = (16*1024); + if (!(proto = (( 0)?( Proto_t*)realloc((char*)( 0),sizeof( Proto_t)*( 1)+( 5 * n + 2)):( Proto_t*)calloc(1,sizeof( Proto_t)*( 1)+( 5 * n + 2))))) + return 0; + proto->iz = n; + proto->oz = 3 * n; + proto->flags |= (1L<<16); + } + proto->fd = fd; + proto->package = package; + iob = (char*)proto + sizeof(Proto_t); + proto->op = proto->ob = iob; + proto->ip = proto->ib = iob + proto->oz + n; + if (m) proto->options |= (1L<<0); + if (!comment) + comment = "/*"; + if (!(proto->cc[0] = comment[0])) + notice = options = 0; + else if (comment[1]) + { + proto->cc[1] = comment[1]; + proto->cc[2] = comment[2] ? comment[2] : comment[0]; + } + else + proto->cc[1] = proto->cc[2] = comment[0]; + + + + + + n = read(fd, proto->ip, proto->iz); + if (!(proto->flags & (1L<<16))) + close(fd); + if (n < 0) + { + pppclose(iob); + return 0; + } + *(proto->ip + n) = 0; + + +#line 2165 + if (!notice && !options || (comlen = astlicense(com, sizeof(com), ((char*)0), "type=check", proto->cc[0], proto->cc[1], proto->cc[2])) <= 0) + *com = 0; + + hit = (notice || options) ? 0 : 0x02; + pragma = -1; + s = proto->ip; + m = 80; + while (m-- > 0 && *s && hit != (0x01|0x02)) + { + while (*s == ' ' || *s == '\t') + s++; + if (*s == '#') + { + b = s++; + while (*s == ' ' || *s == '\t') + s++; + if (*s == *"pragma"&& !sstrncmp( s, "pragma", sizeof("pragma") - 1) && (*(s += sizeof("pragma") - 1) == ' ' || *s == '\t')) + { + clr = 0; + while (*s && *s != '\r' && *s != '\n') + { + for (; *s == ' ' || *s == '\t'; s++); + for (t = s; *s && *s != ' ' && *s != '\t' && *s != '\r' && *s != '\n'; s++); + z = s - t; + for (i = 0; i < (sizeof( pragmas)/sizeof( pragmas[0])); i++) + if (pragmas[i].size == z && !sstrncmp( t, pragmas[i].name, z)) + { + clr = 1; + hit |= pragmas[i].hit; + switch (pragmas[i].hit) + { + case 0x02: + notice = options = 0; + break; + case 0x01: + pragma = pragmas[i].val; + break; + } + } + } + if (clr) + { + + if (!(flags & (1<<1)) || (flags & (1<<8))) + + for (; b < s; *b++ = ' '); + } + } + } + else if (*s == *"/* : : generated by proto : : */\n"&& !sstrncmp( s, "/* : : generated by proto : : */\n", sizeof("/* : : generated by proto : : */\n") - 1)) + { + pragma = 0; + break; + } + + else if (*s == '%' && *(s + 1) == '{') + proto->flags |= (1L<<29); + else if (!(hit & 0x02)) + { + if (*s == *com && !sstrncmp( s, com, comlen)) + { + hit |= 0x02; + notice = options = 0; + } + else + for (; *s && *s != '\n' && !(hit & 0x02); s++) + for (i = 0; i < (sizeof( notices)/sizeof( notices[0])); i++) + if (*s == notices[i].name[0] && !sstrncmp( s, notices[i].name, notices[i].size)) + { + s += notices[i].size; + if (notices[i].val) + { + while (*s == ' ' || *s == '\t') + s++; + if (*s == '(' && (*(s + 1) == 'c' || *(s + 1) == 'C') && *(s + 2) == ')' || *s >= '0' && *s <= '9' && *(s + 1) >= '0' && *(s + 1) <= '9') + { + hit |= notices[i].hit; + notice = options = 0; + } + } + else + { + hit |= notices[i].hit; + notice = options = 0; + } + break; + } + } + + while (*s && *s++ != '\n'); + } + if (flags & (1<<10)) proto->flags |= (1L<<20); + if (flags & (1<<12)) proto->test = 1; + if (flags & (1<<2)) proto->options |= (1L<<6); + + if (flags & (1<<0)) pragma = -pragma; + if (flags & (1<<1)) pragma = 0; + if (flags & (1<<7)) proto->flags |= (1L<<13); + if (!(proto->flags & (1L<<29)) && file && (m = sstrlen( file)) > 2 && file[--m] == 'y' && file[--m] == '.') + proto->flags |= (1L<<29); + + if (pragma <= 0) + { + if (flags & (1<<10)) + { + flags &= ~((1<<4)|(1<<5)); + proto->flags |= (1L<<19); + } + else if (!(flags & ((1<<3)|(1<<9)))) + { + pppclose(iob); + return 0; + } + else if ((flags & ((1<<3)|(1<<9))) == (1<<9) || !pragma) + { + proto->flags |= (1L<<18); + if (proto->flags & (1L<<16)) + proto->oz += proto->iz; + proto->iz = n; + if (notice || options) + { + if (proto->cc[0] == '#' && proto->ip[0] == '#' && proto->ip[1] == '!') + { + s = proto->ip; + while (*s && *s++ != '\n'); + m = s - proto->ip; + proto->op = memcopy(proto->op, proto->ip, m); + proto->ip = s; + proto->iz = n -= m; + } + + if (proto->cc[0]) + { + if ((comlen = astlicense(proto->op, proto->oz, notice, options, proto->cc[0], proto->cc[1], proto->cc[2])) < 0) + proto_error((char*)proto + sizeof(Proto_t), 1, proto->op, ((char*)0)); + else + proto->op += comlen; + } + if (!(flags & (1<<0)) && !(proto->flags & (1L<<29))) + + proto->op = linesync(proto, proto->op, 1); + proto->iz += proto->op - proto->ob; + } + memcopy(proto->op, proto->ip, n); + return iob; + } + } + + if (!(retain & (1<<6))) + { + retain |= (1<<6); + ppfsm(4, ((char*)0)); + } + + proto->line = 1; + + if (notice || options || (flags & ((1<<4)|(1<<5)))) + { + + if (notice || options) + { + if ((comlen = astlicense(proto->op, proto->oz, notice, options, proto->cc[0], proto->cc[1], proto->cc[2])) < 0) + proto_error((char*)proto + sizeof(Proto_t), 1, proto->op, ((char*)0)); + else + proto->op += comlen; + } + + if (flags & (1<<5)) + { + proto->flags |= (1L<<11); + if (flags & (1<<11)) + retain |= (1<<5); + } + else if (flags & (1<<4)) + { + if (flags & (1<<11)) retain |= (1<<4); + + if (flags & (1<<0)) + { + *proto->op++ = '#'; + proto->op = strcopy(proto->op, "pragma"); + *proto->op++ = ' '; + proto->op = strcopy(proto->op, pragmas[0].name); + *proto->op++ = '\n'; + } + else + + proto->flags |= (1L<<10); + } + + if (!(flags & (1<<0))) + { + if (proto->flags & (1L<<29)) + { + proto->op = strcopy(proto->op, "\n%{\n"+ !notice); + proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); + proto->op = strcopy(proto->op, "%}\n"); + } + else + { + if (n || notice || options) + *proto->op++ = '\n'; + proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); + if (n) + proto->op = linesync(proto, proto->op, proto->line); + else if (proto->flags & ((1L<<10)|(1L<<11))) + proto->op = init(proto, proto->op, proto->flags); + } + } + + } + + + proto->file = file; + if (flags & (1<<0)) + { + proto->flags |= (1L<<0); + if (!(flags & (1<<4))) proto->flags |= (1L<<5); + } + + return iob; +} + + + + + + +int +pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ + register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); + register int n; + + if (proto->flags & (1L<<18)) + { + if (proto->iz) + { + n = proto->iz; + proto->iz = 0; + } + else if (!(proto->flags & (1L<<16))) n = 0; + else if ((n = read(proto->fd, proto->ob, proto->oz)) <= 0 || (proto->options & (1L<<0)) && n < proto->oz) + { + proto->flags &= ~(1L<<16); + close(proto->fd); + } + } + else + { + if (proto->op == proto->ob) + { + if (proto->flags & (1L<<4)) return -1; + + if (proto->flags & (1L<<29)) + { + register char* ip = proto->ip; + register char* op = proto->ob; + register char* ep = proto->ob + proto->oz - 2; + + if (!*ip) + { + ip = proto->ip = proto->ib; + if (!(proto->flags & (1L<<16))) n = 0; + else if ((n = read(proto->fd, ip, proto->iz)) <= 0 || (proto->options & (1L<<0)) && n < proto->iz) + { + if (n < 0) n = 0; + proto->flags &= ~(1L<<16); + close(proto->fd); + } + ip[n] = 0; + } + if (proto->flags & (1L<<30)) + { + proto->flags &= ~(1L<<30); + if (*ip == '%') + { + *op++ = *ip++; + if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); + else proto->flags |= (1L<<31); + } + } + if (proto->flags & (1L<<29)) + while (op < ep && (n = *op++ = *ip)) + { + ip++; + if (n == '%') + { + if (*ip == '%' && (ip == proto->ip + 1 || *(ip - 2) == '\n')) + { + *op++ = *ip++; + if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); + else proto->flags |= (1L<<31); + break; + } + if (!*ip) + { + *op++ = '%'; + proto->flags |= (1L<<30); + break; + } + } + else if (n == '\n') proto->line++; + } + proto->op = memcopy(proto->ob, proto->ip, ip - proto->ip); + proto->ip = ip; + } + else + + lex(proto, proto->flags); + if ((proto->flags & ((1L<<4)|(1L<<16))) == (1L<<4)) + proto->op = strcopy(proto->op, "/* NOTE: some constructs may not have been converted */\n"); + } + n = proto->op - proto->ob; + proto->op = proto->ob; + } + return n; +} + + + + + + + + + + + + +#line 269 "proto.c" + + + + + +static int +proto __PARAM__((char* file, char* license, char* options, char* package, char* copy, char* comment, int flags), (file, license, options, package, copy, comment, flags)) __OTORP__(char* file; char* license; char* options; char* package; char* copy; char* comment; int flags;){ + char* b; + char* e; + char* p; + int n; + int m; + int x; + int fd; + char buf[1024]; + + if (file && access(file, 4)) + proto_error(((char*)0), 2, file, "not found"); + else if (b = pppopen(file, 0, license, options, package, comment, flags)) + { + if (!file) + fd = 1; + else if (flags & ((1<<13)<<1)) + { + e = file + sstrlen( file) - 1; + x = *e; + *e = '_'; + if ((fd = creat(file, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) + { + proto_error(b, 2, file, "cannot create temporary file"); + pppclose(b); + return flags | ((1<<13)<<0); + } + *e = x; + } + else if (copy) + { + if (((n = sstrlen( copy)) + sstrlen( file) + 2) > sizeof(buf)) + { + proto_error(b, 2, copy, "copy path too long"); + pppclose(b); + return flags | ((1<<13)<<0); + } + strcopy( buf, copy); + e = buf + n; + if (*file != '/') + *e++ = '/'; + strcopy( e, file); + if ((fd = creat(buf, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) + { + for (e = buf; *e == '/'; e++); + do + { + if (*e == '/') + { + *e = 0; + if (access(buf, 0) && mkdir(buf, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) + { + proto_error(b, 2, buf, "cannot create copy directory"); + pppclose(b); + return flags | ((1<<13)<<0); + } + *e = '/'; + } + } while (*e++); + if ((fd = creat(buf, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) + { + proto_error(b, 2, buf, "cannot create copy file"); + pppclose(b); + return flags | ((1<<13)<<0); + } + } + file = buf; + } + else + fd = 1; + if (file && (flags & ((1<<13)<<2))) + proto_error(b, 0, "convert to", file); + while ((n = pppread(b)) > 0) + { + p = b; + for (;;) + { + if ((m = write(fd, p, n)) <= 0) + { + proto_error(b, 2, "write error", ((char*)0)); + flags |= ((1<<13)<<0); + break; + } + if ((n -= m) <= 0) + break; + p += m; + } + if (m < 0) + break; + } + if (fd > 1) + close(fd); + if (file && (flags & ((1<<13)<<1))) + { + *e = '_'; + strcopy( b, file); + *e = x; + if (replace(b, file, !(flags & (1<<0)))) + proto_error(b, 2, "cannot rename to", file); + } + pppclose(b); + } + return flags; +} + + + + + +typedef struct Sufcom_s +{ + char suffix[4]; + char comment[4]; +} Sufcom_t; + +static const Sufcom_t sufcom[] = +{ + "c", "/*", + "cpp", "/*", + "cxx", "/*", + "c++", "/*", + "C", "/*", + "CPP", "/*", + "CXX", "/*", + "C++", "/*", + "f", "C", + "F", "C", + "h", "/*", + "hpp", "/*", + "hxx", "/*", + "H", "/*", + "HPP", "/*", + "HXX", "/*", + "ksh", "#", + "KSH", "#", + "l", "/*", + "L", "/*", + "p", "(*)", + "pas", "(*)", + "P", "(*)", + "PAS", "(*)", + "pl", "#", + "PL", "#", + "pl1", "/*", + "pli", "/*", + "PL1", "/*", + "PLI", "/*", + "sh", "#", + "SH", "#", + "sml", "(*)", + "SML", "(*)", + "y", "/*", + "Y", "/*", +}; + + + + + +static char* +type __PARAM__((register char* file, char* comment), (file, comment)) __OTORP__(register char* file; char* comment;){ + register char* suffix; + register int i; + + if (file && (!comment || !*comment)) + { + suffix = 0; + while (*file) + if (*file++ == '.') + suffix = file; + if (suffix && sstrlen( suffix) <= 3) + for (i = 0; i < sizeof(sufcom) / sizeof(sufcom[0]); i++) + if (!strcmp(suffix, sufcom[i].suffix)) + return (char*)sufcom[i].comment; + } + return comment; +} + +int +main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ + char* b; + char* file; + int fd; + int n; + char* op; + char* oe; + char* comment = 0; + char* copy = 0; + char* list = 0; + char* license = 0; + char* options = 0; + char* package = 0; + int flags = (1<<4); + char buf[1024]; + char opt[4 * 1024]; + + ; + + while ((file = *++argv) && *file == '-' && *(file + 1)) + { + for (;;) + { + switch (*++file) + { + case 0: + break; + case 'c': + if (!*(comment = ++file)) + comment = *++argv; + break; + case 'd': + flags |= (1<<1); + continue; + case 'e': + if (!*(package = ++file) && !(package = *++argv)) + { + file = "??"; + continue; + } + break; + case 'f': + flags |= (1<<3); + continue; + case 'h': + flags &= ~(1<<4); + continue; + case 'i': + flags |= (1<<0); + continue; + case 'l': + if (!*(license = ++file) && !(license = *++argv)) + { + file = "??"; + continue; + } + break; + case 'n': + flags |= (1<<7); + continue; + case 'o': + if (!*(b = ++file) && !(b = *++argv)) + { + file = "??"; + continue; + } + if (!options) + { + options = op = opt; + oe = op + sizeof(opt) - 1; + } + n = sstrlen( b); + if ((n + 1) >= (oe - op)) + proto_error(((char*)0), 3, b, "too many options"); + else + { + *op++ = '\n'; + memcopy( op, b, n + 1); + op += n; + } + break; + case 'p': + flags |= (1<<9); + continue; + case 'r': + flags |= ((1<<13)<<1); + continue; + case 's': + flags |= (1<<5); + continue; + case 't': + flags |= (1<<12); + continue; + case 'v': + flags |= ((1<<13)<<2); + continue; + case 'x': + flags |= (1<<2); + continue; + case 'z': + flags |= (1<<1)|(1<<8); + continue; + case 'C': + if (!*(copy = ++file) && !(copy = *++argv)) + { + file = "??"; + continue; + } + break; + case 'L': + if (!*(list = ++file) && !(list = *++argv)) + { + file = "??"; + continue; + } + break; + case 'P': + case '+': + flags |= (1<<10); + continue; + case 'S': + comment = "#"; + continue; + default: + proto_error(((char*)0), 2, file, "unknown option"); + + case '?': + b = "Usage: proto [-dfhinprstvzP+S] [-C directory] [-e package] [-l file]\n [-o \"name='value' ...\"] [-L file] file ...\n"; + write(2, b, sstrlen( b)); + return 2; + } + break; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (list) + { + if (*list == '-' && !*(list + 1)) + fd = 0; + else if ((fd = open(list, O_RDONLY)) < 0) + proto_error(((char*)0), 3, list, "not found"); + do + { + for (b = buf; (n = read(fd, b, 1)) > 0 && *b != '\n' && b < &buf[sizeof(buf) - 1]; b++); + if (b > buf) + { + *b = 0; + flags = proto(buf, license, options, package, copy, type(buf, comment), flags); + } + } while (n > 0); + if (fd > 0) + close(fd); + } + if (file) + do flags = proto(file, license, options, package, copy, type(file, comment), flags); while (file = *++argv); + else if (!list) + flags = proto(file, license, options, package, copy, type(file, comment), flags); + return errors ? 1 : (flags & ((1<<13)<<0)) ? 2 : 0; +} diff --git a/src/cmd/INIT/ratz.c b/src/cmd/INIT/ratz.c new file mode 100644 index 000000000..944a92f6e --- /dev/null +++ b/src/cmd/INIT/ratz.c @@ -0,0 +1,5312 @@ +/* + * ratz -- read a tar gzip archive from the standard input + * + * coded for portability + * _SEAR_* macros for win32 self extracting archives -- see sear(1). + */ +#pragma clang diagnostic ignored "-Wparentheses" + +static char id[] = "\n@(#)$Id: ratz (Jean-loup Gailly, Mark Adler, Glenn Fowler) 1.2.3 2010-10-10 $\0\n"; + +#if _PACKAGE_ast + +#include +#include + +static const char usage[] = +"[-?\n@(#)$Id: ratz (Jean-loup Gailly, Mark Adler, Glenn Fowler) 1.2.3 2010-10-10 $\n]" +"[-author?Jean-loup Gailly]" +"[-author?Mark Adler]" +"[-author?Glenn Fowler ]" +"[-copyright?Copyright (c) 1995-2005 Jean-loup Gailly and Mark Adler]" +"[-license?http://www.opensource.org/licenses/zlib-license]" +"[+NAME?ratz - read a tar gzip archive]" +"[+DESCRIPTION?\bratz\b extracts files and directories from a tar gzip" +" archive on the standard input. It is a standalone program for systems" +" that do not have \bpax\b(1), \btar\b(1) or \bgunzip\b(1). Only regular" +" files and directories are extracted; all other file types are ignored.]" +"[+?\b.exe\b files generated by \bsear\b(1) are fully functional \bratz\b" +" executables, so any \bratz\b option may be used on a \bsear\b file." +" This allows \bsear\b file contents to be examined and extracted without" +" executing any embedded installation scripts.]" +"[c:cat|uncompress?Uncompress the standard input and copy it to the standard" +" output.]" +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) +"[i!:install?Execute the sear installation script.]" +"[k:keep?Keep the installation temporary directory.]" +#endif +"[l:local?Reject files that traverse outside the current directory.]" +"[m:meter?Display a one line text meter showing archive read progress.]" +"[n!:convert?In ebcdic environments convert text archive members from ascii" +" to the native ebcdic.]" +"[t:list?List each file path on the standard output but do not extract.]" +"[v:verbose?List each file path on the standard output as it is extracted.]" +"[V?Print the program version and exit.]" +"[+SEE ALSO?\bgunzip\b(1), \bpackage\b(1), \bpax\b(1), \bsear\b(1), \btar\b(1)]" +; + +#else + +#define NiL ((char*)0) + +#endif + +#define METER_width 80 +#define METER_parts 20 + +#ifndef _GUNZIP_H +#define _GUNZIP_H 1 + +/* + * stripped down zlib containing public gzfopen()+gzread() in one file + * USE THE REAL ZLIB AFTER BOOTSTRAP + */ + +#define ZLIB_INTERNAL 1 +#define NO_GZCOMPRESS 1 + +#define gz_headerp voidp + +#include +#include + +#if _PACKAGE_ast || defined(__STDC__) || defined(_SEAR_EXEC) || defined(_WIN32) + +#define FOPEN_READ "rb" +#define FOPEN_WRITE "wb" + +#else + +#define FOPEN_READ "r" +#define FOPEN_WRITE "w" + +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#if _PACKAGE_ast + +#ifndef setmode +#define setmode(d,m) +#endif + +#else + +#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__) +#define _WINIX 1 +#endif + +#if _WIN32 && !_WINIX + +#include +#include +#include +#include + +#define access _access +#define chmod _chmod +#define close _close +#define dup _dup +#define lseek _lseek +#define open _open +#define read _read +#define setmode _setmode +#define unlink _unlink + +#define mkdir(a,b) _mkdir(a) + +#else + +#define HAVE_UNISTD_H 1 + +#include +#include + +#ifndef setmode +#define setmode(d,m) +#endif + +#endif + +#if defined(__STDC__) + +#include +#include + +#endif + +#endif + +#ifndef _ZLIB_H +#define _ZLIB_H 1 + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.3, July 18th, 2005 + + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZCONF_H +#define _ZCONF_H 1 + +#if _PACKAGE_ast +#include /* for { _WINIX __IMPORT__ __EXPORT__ } */ +#define z_off_t int32_t +#if _typ_int64_t +#define z_off64_t int64_t +#endif +#else +#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__) +#define _WINIX 1 +#endif +#endif + +#if _BLD_z && defined(__EXPORT__) +#define ZEXTERN __EXPORT__ +#define ZEXPORT +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# ifdef VMS +# include /* for off_t */ +# endif +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +#if defined(__OS400__) +# define NO_vsnprintf +#endif + +#if defined(__MVS__) +# define NO_vsnprintf +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(deflateBound,"DEBND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(compressBound,"CMBND") +# pragma map(inflate_table,"INTABL") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* _ZCONF_H */ + +#define ZLIB_VERSION "1.2.3" +#define ZLIB_VERNUM 0x1230 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip streams in memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field (though see inflate()) */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + +#endif /* _ZLIB_H */ + +#ifndef _ZUTIL_H +#define _ZUTIL_H 1 + +#if !_PACKAGE_ast && !defined(STDC) +#if defined(__STDC__) +# include +#endif +# include +# include +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +# ifdef M_I86 + #include +# endif +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#ifdef WIN32 +# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ +# define OS_CODE 0x0b +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0f +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# if defined(_WIN32_WCE) +# define fdopen(fd,mode) NULL /* No fdopen() */ +# ifndef _PTRDIFF_T_DEFINED + typedef int ptrdiff_t; +# define _PTRDIFF_T_DEFINED +# endif +# else +# define fdopen(fd,type) _fdopen(fd,type) +# endif +#endif + + /* common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif +#if defined(__CYGWIN__) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif +#ifndef HAVE_VSNPRINTF +# ifdef MSDOS + /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), + but for now we just assume it doesn't. */ +# define NO_vsnprintf +# endif +# ifdef __TURBOC__ +# define NO_vsnprintf +# endif +# ifdef WIN32 + /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ +# if !defined(vsnprintf) && !defined(NO_vsnprintf) +# define vsnprintf _vsnprintf +# endif +# endif +# ifdef __SASC +# define NO_vsnprintf +# endif +#endif +#ifdef VMS +# define NO_vsnprintf +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef Z_DEBUG +# include + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} +#endif /* _ZUTIL_H */ + +#ifndef _ZUTIL_C +#define _ZUTIL_C + +#if 0 && !_PACKAGE_ast && !defined(STDC) +extern void exit OF((int)); +#endif + +#ifndef HAVE_MEMCPY + +void zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + + +#ifdef SYS16BIT + +#ifdef __TURBOC__ +/* Turbo C in 16-bit mode */ + +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} + +#endif /* __TURBOC__ */ + + +#ifdef M_I86 +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* M_I86 */ + +#endif /* SYS16BIT */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#if 0 && !_PACKAGE_ast +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif +#endif + +voidpf zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : + (voidpf)calloc(items, size); +} + +void zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ + +#endif /* _ZUTIL_C */ + +#ifndef _CRC32_H +#define _CRC32_H 1 + +/* crc32.h -- tables for rapid CRC calculation + * Generated automatically by crc32.c + */ + +#ifndef TBLS +#define TBLS 1 +#endif + +local const unsigned long FAR crc_table[TBLS][256] = +{ + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + }, +}; + +#endif /* _CRC32_H */ + +#ifndef _CRC32_C +#define _CRC32_C 1 + +/* ========================================================================= */ +#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) +#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 + +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + if (buf == Z_NULL) return 0; + +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + +#ifdef BYFOUR + if (sizeof(void *) == sizeof(ptrdiff_t)) { + u4 endian; + + endian = 1; + if (*((unsigned char *)(&endian))) + return crc32_little(crc, buf, len); + else + return crc32_big(crc, buf, len); + } +#endif /* BYFOUR */ + crc = crc ^ 0xffffffff; + while (len >= 8) { + DO8; + len -= 8; + } + if (len) do { + DO1; + } while (--len); + return crc ^ 0xffffffff; +} + +#undef DO1 +#undef DO8 + +#endif /* _CRC32_C */ + +#ifndef _ADLER32_C +#define _ADLER32_C 1 + +#define BASE 65521 /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* use NO_DIVIDE if your processor does not do division in hardware */ +#ifdef NO_DIVIDE +# define MOD(a) \ + do { \ + if (a >= (BASE << 16)) a -= (BASE << 16); \ + if (a >= (BASE << 15)) a -= (BASE << 15); \ + if (a >= (BASE << 14)) a -= (BASE << 14); \ + if (a >= (BASE << 13)) a -= (BASE << 13); \ + if (a >= (BASE << 12)) a -= (BASE << 12); \ + if (a >= (BASE << 11)) a -= (BASE << 11); \ + if (a >= (BASE << 10)) a -= (BASE << 10); \ + if (a >= (BASE << 9)) a -= (BASE << 9); \ + if (a >= (BASE << 8)) a -= (BASE << 8); \ + if (a >= (BASE << 7)) a -= (BASE << 7); \ + if (a >= (BASE << 6)) a -= (BASE << 6); \ + if (a >= (BASE << 5)) a -= (BASE << 5); \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) +# define MOD4(a) \ + do { \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) +#else +# define MOD(a) a %= BASE +# define MOD4(a) a %= BASE +#endif + +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + unsigned long sum2; + unsigned n; + + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; + + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD4(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; + DO16(buf); + buf += 16; + } + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); + } + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +#endif /* _ADLER32_C */ + +#ifndef _DEFLATE_H +#define _DEFLATE_H 1 + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define INIT_STATE 42 +#define EXTRA_STATE 69 +#define NAME_STATE 73 +#define COMMENT_STATE 91 +#define HCRC_STATE 103 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + uInt pending; /* nb of bytes in the pending buffer */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ + Byte method; /* STORED (for zip only) or DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to suppress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + int last_eob_len; /* bit length of EOB code for last block */ + +#ifdef Z_DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + + /* in trees.c */ +void _tr_init OF((deflate_state *s)); +int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); +void _tr_align OF((deflate_state *s)); +void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef Z_DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch _length_code[]; + extern uch _dist_code[]; +#else + extern const uch _length_code[]; + extern const uch _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif /* _DEFLATE_H */ + +#ifndef _INFTREES_H +#define _INFTREES_H 1 + +typedef struct { + unsigned char op; /* operation, extra bits, table bits */ + unsigned char bits; /* bits in this part of the code */ + unsigned short val; /* offset in table or code value */ +} code; + +/* op values as set by inflate_table(): + 00000000 - literal + 0000tttt - table link, tttt != 0 is the number of table index bits + 0001eeee - length or distance, eeee is the number of extra bits + 01100000 - end of block + 01000000 - invalid code + */ + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an + exhaustive search). The true maximum is not known, but the value + below is more than safe. */ +#define ENOUGH 2048 +#define MAXD 592 + +/* Type of code to build for inftable() */ +typedef enum { + CODES, + LENS, + DISTS +} codetype; + +#endif /* _INFTREES_H */ + +#ifndef _INFLATE_H +#define _INFLATE_H 1 + +/* Possible inflate modes between inflate() calls */ +typedef enum { + HEAD, /* i: waiting for magic header */ + FLAGS, /* i: waiting for method and flags (gzip) */ + TIME, /* i: waiting for modification time (gzip) */ + OS, /* i: waiting for extra flags and operating system (gzip) */ + EXLEN, /* i: waiting for extra length (gzip) */ + EXTRA, /* i: waiting for extra bytes (gzip) */ + NAME, /* i: waiting for end of file name (gzip) */ + COMMENT, /* i: waiting for end of comment (gzip) */ + HCRC, /* i: waiting for header crc (gzip) */ + DICTID, /* i: waiting for dictionary check value */ + DICT, /* waiting for inflateSetDictionary() call */ + TYPE, /* i: waiting for type bits, including last-flag bit */ + TYPEDO, /* i: same, but skip check to exit inflate on new block */ + STORED, /* i: waiting for stored size (length and complement) */ + COPY, /* i/o: waiting for input or output to copy stored block */ + TABLE, /* i: waiting for dynamic block table lengths */ + LENLENS, /* i: waiting for code length code lengths */ + CODELENS, /* i: waiting for length/lit and distance code lengths */ + LEN, /* i: waiting for length/lit code */ + LENEXT, /* i: waiting for length extra bits */ + DIST, /* i: waiting for distance code */ + DISTEXT, /* i: waiting for distance extra bits */ + MATCH, /* o: waiting for output space to copy string */ + LIT, /* o: waiting for output space to write literal */ + CHECK, /* i: waiting for 32-bit check value */ + LENGTH, /* i: waiting for 32-bit length (gzip) */ + DONE, /* finished check, done -- remain here until reset */ + BAD, /* got a data error -- remain here until reset */ + MEM, /* got an inflate() memory error -- remain here until reset */ + SYNC /* looking for synchronization bytes to restart inflate() */ +} inflate_mode; + +/* + State transitions between above modes - + + (most modes can go to the BAD or MEM mode -- not shown for clarity) + + Process header: + HEAD -> (gzip) or (zlib) + (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME + NAME -> COMMENT -> HCRC -> TYPE + (zlib) -> DICTID or TYPE + DICTID -> DICT -> TYPE + Read deflate blocks: + TYPE -> STORED or TABLE or LEN or CHECK + STORED -> COPY -> TYPE + TABLE -> LENLENS -> CODELENS -> LEN + Read deflate codes: + LEN -> LENEXT or LIT or TYPE + LENEXT -> DIST -> DISTEXT -> MATCH -> LEN + LIT -> LEN + Process trailer: + CHECK -> LENGTH -> DONE + */ + +/* state maintained between inflate() calls. Approximately 7K bytes. */ +struct inflate_state { + inflate_mode mode; /* current inflate mode */ + int last; /* true if processing last block */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int havedict; /* true if dictionary provided */ + int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ + unsigned long check; /* protected copy of check value */ + unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ + /* sliding window */ + unsigned wbits; /* log base 2 of requested window size */ + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + /* bit accumulator */ + unsigned long hold; /* input bit accumulator */ + unsigned bits; /* number of bits in "in" */ + /* for string and stored block copying */ + unsigned length; /* literal or length of data to copy */ + unsigned offset; /* distance back to copy string from */ + /* for table and code decoding */ + unsigned extra; /* extra bits needed */ + /* fixed and dynamic code tables */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + /* dynamic table building */ + unsigned ncode; /* number of code length code lengths */ + unsigned nlen; /* number of length code lengths */ + unsigned ndist; /* number of distance code lengths */ + unsigned have; /* number of code lengths in lens[] */ + code FAR *next; /* next available space in codes[] */ + unsigned short lens[320]; /* temporary storage for code lengths */ + unsigned short work[288]; /* work area for code table building */ + code codes[ENOUGH]; /* space for code tables */ +}; +#endif /* _INFLATE_H */ + +#ifndef _INFTREES_C +#define _INFTREES_C 1 + +#define MAXBITS 15 + +const char inflate_copyright[] = + " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* + Build a set of tables to decode the provided canonical Huffman code. + The code lengths are lens[0..codes-1]. The result starts at *table, + whose indices are 0..2^bits-1. work is a writable array of at least + lens shorts, which is used as a work area. type is the type of code + to be generated, CODES, LENS, or DISTS. On return, zero is success, + -1 is an invalid code, and +1 means that ENOUGH isn't enough. table + on return points to the next available entry's address. bits is the + requested root table index bits, and on return it is the actual root + table index bits. It will differ if the request is greater than the + longest code or if it is less than the shortest code. + */ +int inflate_table(type, lens, codes, table, bits, work) +codetype type; +unsigned short FAR *lens; +unsigned codes; +code FAR * FAR *table; +unsigned FAR *bits; +unsigned short FAR *work; +{ + unsigned len; /* a code's length in bits */ + unsigned sym; /* index of code symbols */ + unsigned min, max; /* minimum and maximum code lengths */ + unsigned root; /* number of index bits for root table */ + unsigned curr; /* number of index bits for current table */ + unsigned drop; /* code bits to drop for sub-table */ + int left; /* number of prefix codes available */ + unsigned used; /* code entries in table used */ + unsigned huff; /* Huffman code */ + unsigned incr; /* for incrementing code, index */ + unsigned fill; /* index for replicating entries */ + unsigned low; /* low bits for current root entry */ + unsigned mask; /* mask for low root bits */ + code this; /* table entry for duplication */ + code FAR *next; /* next available space in table */ + const unsigned short FAR *base; /* base value table to use */ + const unsigned short FAR *extra; /* extra bits table to use */ + int end; /* use base and extra for symbol > end */ + unsigned short count[MAXBITS+1]; /* number of codes of each length */ + unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ + static const unsigned short lbase[31] = { /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + static const unsigned short lext[31] = { /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; + static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0}; + static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64}; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) + count[len] = 0; + for (sym = 0; sym < codes; sym++) + count[lens[sym]]++; + + /* bound code lengths, force root to be within code lengths */ + root = *bits; + for (max = MAXBITS; max >= 1; max--) + if (count[max] != 0) break; + if (root > max) root = max; + if (max == 0) { /* no symbols to code at all */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)1; + this.val = (unsigned short)0; + *(*table)++ = this; /* make a table to force an error */ + *(*table)++ = this; + *bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min <= MAXBITS; min++) + if (count[min] != 0) break; + if (root < min) root = min; + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) return -1; /* over-subscribed */ + } + if (left > 0 && (type == CODES || max != 1)) + return -1; /* incomplete set */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + count[len]; + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) + if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked when a LENS table is being made + against the space in *table, ENOUGH, minus the maximum space needed by + the worst case distance code, MAXD. This should never happen, but the + sufficiency of ENOUGH has not been proven exhaustively, hence the check. + This assumes that when type == LENS, bits == 9. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + switch (type) { + case CODES: + base = extra = work; /* dummy value--not used */ + end = 19; + break; + case LENS: + base = lbase; + base -= 257; + extra = lext; + extra -= 257; + end = 256; + break; + default: /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize state for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = *table; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = (unsigned)(-1); /* trigger new sub-table when len > root */ + used = ((unsigned int)1) << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if (type == LENS && used >= ENOUGH - MAXD) + return 1; + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + this.bits = (unsigned char)(len - drop); + if ((int)(work[sym]) < end) { + this.op = (unsigned char)0; + this.val = work[sym]; + } + else if ((int)(work[sym]) > end) { + this.op = (unsigned char)(extra[work[sym]]); + this.val = base[work[sym]]; + } + else { + this.op = (unsigned char)(32 + 64); /* end of block */ + this.val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = ((unsigned int)1) << (len - drop); + fill = ((unsigned int)1) << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + next[(huff >> drop) + fill] = this; + } while (fill != 0); + + /* backwards increment the len-bit code huff */ + incr = ((unsigned int)1) << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + + /* go to next symbol, update count, len */ + sym++; + if (--(count[len]) == 0) { + if (len == max) break; + len = lens[work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) != low) { + /* if first time, transition to sub-tables */ + if (drop == 0) + drop = root; + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = (int)(1 << curr); + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) break; + curr++; + left <<= 1; + } + + /* check for enough space */ + used += ((unsigned int)1) << curr; + if (type == LENS && used >= ENOUGH - MAXD) + return 1; + + /* point entry in root table to sub-table */ + low = huff & mask; + (*table)[low].op = (unsigned char)curr; + (*table)[low].bits = (unsigned char)root; + (*table)[low].val = (unsigned short)(next - *table); + } + } + + /* + Fill in rest of table for incomplete codes. This loop is similar to the + loop above in incrementing huff for table indices. It is assumed that + len is equal to curr + drop, so there is no loop needed to increment + through high index bits. When the current sub-table is filled, the loop + drops back to the root table to fill in any remaining entries there. + */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)(len - drop); + this.val = (unsigned short)0; + while (huff != 0) { + /* when done with sub-table, drop back to root table */ + if (drop != 0 && (huff & mask) != low) { + drop = 0; + len = root; + next = *table; + this.bits = (unsigned char)len; + } + + /* put invalid code marker in table */ + next[huff >> drop] = this; + + /* backwards increment the len-bit code huff */ + incr = ((unsigned int)1) << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + } + + /* set return parameters */ + *table += used; + *bits = root; + return 0; +} + +#endif /* _INFTREES_C */ + +#ifndef _INFFAST_C +#define _INFFAST_C 1 + +/* Allow machine dependent optimization for post-increment or pre-increment. + Based on testing to date, + Pre-increment preferred for: + - PowerPC G3 (Adler) + - MIPS R5000 (Randers-Pehrson) + Post-increment preferred for: + - none + No measurable difference: + - Pentium III (Anderson) + - M68060 (Nikl) + */ +#undef OFF /* (ancient) sunos */ +#ifdef POSTINC +# define OFF 0 +# define PUP(a) *(a)++ +#else +# define OFF 1 +# define PUP(a) *++(a) +#endif + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state->mode == LEN + strm->avail_in >= 6 + strm->avail_out >= 258 + start >= strm->avail_out + state->bits < 8 + + On return, state->mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm->avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm->avail_out >= 258 for each loop to avoid checking for + output space. + */ +void inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ +{ + struct inflate_state FAR *state; + unsigned char FAR *in; /* local strm->next_in */ + unsigned char FAR *last; /* while in < last, enough input available */ + unsigned char FAR *out; /* local strm->next_out */ + unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ + unsigned char FAR *end; /* while out < end, enough space available */ +#ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ +#endif + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ + unsigned long hold; /* local strm->hold */ + unsigned bits; /* local strm->bits */ + code const FAR *lcode; /* local strm->lencode */ + code const FAR *dcode; /* local strm->distcode */ + unsigned lmask; /* mask for first level of length codes */ + unsigned dmask; /* mask for first level of distance codes */ + code this; /* retrieved table entry */ + unsigned op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + unsigned len; /* match length, unused bytes */ + unsigned dist; /* match distance */ + unsigned char FAR *from; /* where to copy match from */ + + /* copy state to local variables */ + state = (struct inflate_state FAR *)strm->state; + in = strm->next_in - OFF; + last = in + (strm->avail_in - 5); + out = strm->next_out - OFF; + beg = out - (start - strm->avail_out); + end = out + (strm->avail_out - 257); +#ifdef INFLATE_STRICT + dmax = state->dmax; +#endif + wsize = state->wsize; + whave = state->whave; + write = state->write; + window = state->window; + hold = state->hold; + bits = state->bits; + lcode = state->lencode; + dcode = state->distcode; + lmask = (((unsigned int)1) << state->lenbits) - 1; + dmask = (((unsigned int)1) << state->distbits) - 1; + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + do { + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + this = lcode[hold & lmask]; + dolen: + op = (unsigned)(this.bits); + hold >>= op; + bits -= op; + op = (unsigned)(this.op); + if (op == 0) { /* literal */ + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + PUP(out) = (unsigned char)(this.val); + } + else if (op & 16) { /* length base */ + len = (unsigned)(this.val); + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + len += (unsigned)hold & ((((unsigned int)1) << op) - 1); + hold >>= op; + bits -= op; + } + Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + this = dcode[hold & dmask]; + dodist: + op = (unsigned)(this.bits); + hold >>= op; + bits -= op; + op = (unsigned)(this.op); + if (op & 16) { /* distance base */ + dist = (unsigned)(this.val); + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + } + dist += (unsigned)hold & ((((unsigned int)1) << op) - 1); +#ifdef INFLATE_STRICT + if (dist > dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + hold >>= op; + bits -= op; + Tracevv((stderr, "inflate: distance %u\n", dist)); + op = (unsigned)(out - beg); /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + from = window - OFF; + if (write == 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + else if (write < op) { /* wrap around window */ + from += wsize + write - op; + op -= write; + if (op < len) { /* some from end of window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = window - OFF; + if (write < len) { /* some from start of window */ + op = write; + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + } + else { /* contiguous in window */ + from += write - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + while (len > 2) { + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + else { + from = out - dist; /* copy direct from output */ + do { /* minimum length is three */ + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } while (len > 2); + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + } + else if ((op & 64) == 0) { /* 2nd level distance code */ + this = dcode[this.val + (hold & ((((unsigned int)1) << op) - 1))]; + goto dodist; + } + else { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + } + else if ((op & 64) == 0) { /* 2nd level length code */ + this = lcode[this.val + (hold & ((((unsigned int)1) << op) - 1))]; + goto dolen; + } + else if (op & 32) { /* end-of-block */ + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + else { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + } while (in < last && out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + in -= len; + bits -= len << 3; + hold &= (((unsigned int)1) << bits) - 1; + + /* update state and return */ + strm->next_in = in + OFF; + strm->next_out = out + OFF; + strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); + strm->avail_out = (unsigned)(out < end ? + 257 + (end - out) : 257 - (out - end)); + state->hold = hold; + state->bits = bits; + return; +} + +/* + inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): + - Using bit fields for code structure + - Different op definition to avoid & for extra bits (do & for table bits) + - Three separate decoding do-loops for direct, window, and write == 0 + - Special case for distance > 1 copies to do overlapped load and store copy + - Explicit branch predictions (based on measured branch probabilities) + - Deferring match copy and interspersed it with decoding subsequent codes + - Swapping literal/length else + - Swapping window/direct else + - Larger unrolled copy loops (three is about right) + - Moving len -= 3 statement into middle of loop + */ + +#endif /* _INFFAST_C */ + +#ifndef _INFLATE_C +#define _INFLATE_C 1 + +/* function prototypes */ +local void fixedtables OF((struct inflate_state FAR *state)); +local int updatewindow OF((z_streamp strm, unsigned out)); +#ifdef BUILDFIXED + void makefixed OF((void)); +#endif +local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, + unsigned len)); + +int ZEXPORT inflateReset(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + strm->total_in = strm->total_out = state->total = 0; + strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ + state->mode = HEAD; + state->last = 0; + state->havedict = 0; + state->dmax = 32768; + state->head = Z_NULL; + state->wsize = 0; + state->whave = 0; + state->write = 0; + state->hold = 0; + state->bits = 0; + state->lencode = state->distcode = state->next = state->codes; + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +int ZEXPORT inflatePrime(strm, bits, value) +z_streamp strm; +int bits; +int value; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + value &= (1L << bits) - 1; + state->hold += value << state->bits; + state->bits += bits; + return Z_OK; +} + +int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) +z_streamp strm; +int windowBits; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL) return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + state = (struct inflate_state FAR *) + ZALLOC(strm, 1, sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (struct internal_state FAR *)state; + if (windowBits < 0) { + state->wrap = 0; + windowBits = -windowBits; + } + else { + state->wrap = (windowBits >> 4) + 1; +#ifdef GUNZIP + if (windowBits < 48) windowBits &= 15; +#endif + } + if (windowBits < 8 || windowBits > 15) { + ZFREE(strm, state); + strm->state = Z_NULL; + return Z_STREAM_ERROR; + } + state->wbits = (unsigned)windowBits; + state->window = Z_NULL; + return inflateReset(strm); +} + +int ZEXPORT inflateInit_(strm, version, stream_size) +z_streamp strm; +const char *version; +int stream_size; +{ + return inflateInit2_(strm, DEF_WBITS, version, stream_size); +} + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +local void fixedtables(state) +struct inflate_state FAR *state; +{ +#ifndef _INFFIXED_H +#define _INFFIXED_H 1 + static const code lenfix[512] = { + {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, + {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, + {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, + {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, + {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, + {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, + {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, + {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, + {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, + {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, + {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, + {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, + {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, + {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, + {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, + {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, + {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, + {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, + {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, + {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, + {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, + {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, + {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, + {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, + {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, + {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, + {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, + {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, + {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, + {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, + {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, + {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, + {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, + {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, + {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, + {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, + {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, + {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, + {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, + {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, + {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, + {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, + {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, + {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, + {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, + {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, + {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, + {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, + {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, + {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, + {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, + {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, + {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, + {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, + {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, + {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, + {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, + {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, + {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, + {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, + {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, + {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, + {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, + {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, + {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, + {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, + {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, + {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, + {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, + {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, + {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, + {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, + {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, + {0,9,255} + }; + + static const code distfix[32] = { + {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, + {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, + {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, + {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, + {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, + {22,5,193},{64,5,0} + }; +#endif /* _INFFIXED_H */ + state->lencode = lenfix; + state->lenbits = 9; + state->distcode = distfix; + state->distbits = 5; +} + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +local int updatewindow(strm, out) +z_streamp strm; +unsigned out; +{ + struct inflate_state FAR *state; + unsigned copy, dist; + + state = (struct inflate_state FAR *)strm->state; + + /* if it hasn't been done already, allocate space for the window */ + if (state->window == Z_NULL) { + state->window = (unsigned char FAR *) + ZALLOC(strm, ((unsigned int)1) << state->wbits, + sizeof(unsigned char)); + if (state->window == Z_NULL) return 1; + } + + /* if window not in use yet, initialize */ + if (state->wsize == 0) { + state->wsize = ((unsigned int)1) << state->wbits; + state->write = 0; + state->whave = 0; + } + + /* copy state->wsize or less output bytes into the circular window */ + copy = out - strm->avail_out; + if (copy >= state->wsize) { + zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); + state->write = 0; + state->whave = state->wsize; + } + else { + dist = state->wsize - state->write; + if (dist > copy) dist = copy; + zmemcpy(state->window + state->write, strm->next_out - copy, dist); + copy -= dist; + if (copy) { + zmemcpy(state->window, strm->next_out - copy, copy); + state->write = copy; + state->whave = state->wsize; + } + else { + state->write += dist; + if (state->write == state->wsize) state->write = 0; + if (state->whave < state->wsize) state->whave += dist; + } + } + return 0; +} + +/* Macros for inflate(): */ + +/* check function to use adler32() for zlib or crc32() for gzip */ +#ifdef GUNZIP +# define UPDATE(check, buf, len) \ + (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) +#else +# define UPDATE(check, buf, len) adler32(check, buf, len) +#endif + +/* check macros for header crc */ +#ifdef GUNZIP +# define CRC2(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + check = crc32(check, hbuf, 2); \ + } while (0) + +# define CRC4(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + hbuf[2] = (unsigned char)((word) >> 16); \ + hbuf[3] = (unsigned char)((word) >> 24); \ + check = crc32(check, hbuf, 4); \ + } while (0) +#endif + +/* Load registers with state in inflate() for speed */ +#define LOAD() \ + do { \ + put = strm->next_out; \ + left = strm->avail_out; \ + next = strm->next_in; \ + have = strm->avail_in; \ + hold = state->hold; \ + bits = state->bits; \ + } while (0) + +/* Restore state from registers in inflate() */ +#define RESTORE() \ + do { \ + strm->next_out = put; \ + strm->avail_out = left; \ + strm->next_in = next; \ + strm->avail_in = have; \ + state->hold = hold; \ + state->bits = bits; \ + } while (0) + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflate() + if there is no input available. */ +#define PULLBYTE() \ + do { \ + if (have == 0) goto inf_leave; \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflate(). */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n < 16) */ +#define BITS(n) \ + ((unsigned)hold & ((((unsigned int)1) << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Reverse the bytes in a 32-bit value */ +#define REVERSE(q) \ + ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ + (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) + +/* + inflate() uses a state machine to process as much input data and generate as + much output data as possible before returning. The state machine is + structured roughly as follows: + + for (;;) switch (state) { + ... + case STATEn: + if (not enough input data or output space to make progress) + return; + ... make progress ... + state = STATEm; + break; + ... + } + + so when inflate() is called again, the same case is attempted again, and + if the appropriate resources are provided, the machine proceeds to the + next state. The NEEDBITS() macro is usually the way the state evaluates + whether it can proceed or should return. NEEDBITS() does the return if + the requested bits are not available. The typical use of the BITS macros + is: + + NEEDBITS(n); + ... do something with BITS(n) ... + DROPBITS(n); + + where NEEDBITS(n) either returns from inflate() if there isn't enough + input left to load n bits into the accumulator, or it continues. BITS(n) + gives the low n bits in the accumulator. When done, DROPBITS(n) drops + the low n bits off the accumulator. INITBITS() clears the accumulator + and sets the number of available bits to zero. BYTEBITS() discards just + enough bits to put the accumulator on a byte boundary. After BYTEBITS() + and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. + + NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return + if there is no input available. The decoding of variable length codes uses + PULLBYTE() directly in order to pull just enough bytes to decode the next + code, and no more. + + Some states loop until they get enough input, making sure that enough + state information is maintained to continue the loop where it left off + if NEEDBITS() returns in the loop. For example, want, need, and keep + would all have to actually be part of the saved state in case NEEDBITS() + returns: + + case STATEw: + while (want < need) { + NEEDBITS(n); + keep[want++] = BITS(n); + DROPBITS(n); + } + state = STATEx; + case STATEx: + + As shown above, if the next state is also the next case, then the break + is omitted. + + A state may also return if there is not enough output space available to + complete that state. Those states are copying stored data, writing a + literal byte, and copying a matching string. + + When returning, a "goto inf_leave" is used to update the total counters, + update the check value, and determine whether any progress has been made + during that inflate() call in order to return the proper return code. + Progress is defined as a change in either strm->avail_in or strm->avail_out. + When there is a window, goto inf_leave will update the window with the last + output written. If a goto inf_leave occurs in the middle of decompression + and there is no window currently, goto inf_leave will create one and copy + output to the window for the next call of inflate(). + + In this implementation, the flush parameter of inflate() only affects the + return code (per zlib.h). inflate() always writes as much as possible to + strm->next_out, given the space available and the provided input--the effect + documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers + the allocation of and copying into a sliding window until necessary, which + provides the effect documented in zlib.h for Z_FINISH when the entire input + stream available. So the only thing the flush parameter actually does is: + when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it + will return Z_BUF_ERROR if it has not reached the end of the stream. + */ + +int ZEXPORT inflate(strm, flush) +z_streamp strm; +int flush; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have, left; /* available input and output */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned in, out; /* save starting available input and output */ + unsigned copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code this; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ +#ifdef GUNZIP + unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ +#endif + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0)) + return Z_STREAM_ERROR; + + state = (struct inflate_state FAR *)strm->state; + if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ + LOAD(); + in = have; + out = left; + ret = Z_OK; + for (;;) + switch (state->mode) { + case HEAD: + if (state->wrap == 0) { + state->mode = TYPEDO; + break; + } + NEEDBITS(16); +#ifdef GUNZIP + if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ + state->check = crc32(0L, Z_NULL, 0); + CRC2(state->check, hold); + INITBITS(); + state->mode = FLAGS; + break; + } + state->flags = 0; /* expect zlib header */ + if (state->head != Z_NULL) + state->head->done = -1; + if (!(state->wrap & 1) || /* check if zlib header allowed */ +#else + if ( +#endif + ((BITS(8) << 8) + (hold >> 8)) % 31) { + strm->msg = (char *)"incorrect header check"; + state->mode = BAD; + break; + } + if (BITS(4) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + DROPBITS(4); + len = BITS(4) + 8; + if (len > state->wbits) { + strm->msg = (char *)"invalid window size"; + state->mode = BAD; + break; + } + state->dmax = ((unsigned int)1) << len; + Tracev((stderr, "inflate: zlib header ok\n")); + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = hold & 0x200 ? DICTID : TYPE; + INITBITS(); + break; +#ifdef GUNZIP + case FLAGS: + NEEDBITS(16); + state->flags = (int)(hold); + if ((state->flags & 0xff) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + if (state->flags & 0xe000) { + strm->msg = (char *)"unknown header flags set"; + state->mode = BAD; + break; + } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = TIME; + case TIME: + NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; + if (state->flags & 0x0200) CRC4(state->check, hold); + INITBITS(); + state->mode = OS; + case OS: + NEEDBITS(16); + if (state->head != Z_NULL) { + state->head->xflags = (int)(hold & 0xff); + state->head->os = (int)(hold >> 8); + } + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = EXLEN; + case EXLEN: + if (state->flags & 0x0400) { + NEEDBITS(16); + state->length = (unsigned)(hold); + if (state->head != Z_NULL) + state->head->extra_len = (unsigned)hold; + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + } + else if (state->head != Z_NULL) + state->head->extra = Z_NULL; + state->mode = EXTRA; + case EXTRA: + if (state->flags & 0x0400) { + copy = state->length; + if (copy > have) copy = have; + if (copy) { + if (state->head != Z_NULL && + state->head->extra != Z_NULL) { + len = state->head->extra_len - state->length; + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); + } + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + state->length -= copy; + } + if (state->length) goto inf_leave; + } + state->length = 0; + state->mode = NAME; + case NAME: + if (state->flags & 0x0800) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->name != Z_NULL && + state->length < state->head->name_max) + state->head->name[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->name = Z_NULL; + state->length = 0; + state->mode = COMMENT; + case COMMENT: + if (state->flags & 0x1000) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->comment != Z_NULL && + state->length < state->head->comm_max) + state->head->comment[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; + state->mode = HCRC; + case HCRC: + if (state->flags & 0x0200) { + NEEDBITS(16); + if (hold != (state->check & 0xffff)) { + strm->msg = (char *)"header crc mismatch"; + state->mode = BAD; + break; + } + INITBITS(); + } + if (state->head != Z_NULL) { + state->head->hcrc = (int)((state->flags >> 9) & 1); + state->head->done = 1; + } + strm->adler = state->check = crc32(0L, Z_NULL, 0); + state->mode = TYPE; + break; +#endif + case DICTID: + NEEDBITS(32); + strm->adler = state->check = REVERSE(hold); + INITBITS(); + state->mode = DICT; + case DICT: + if (state->havedict == 0) { + RESTORE(); + return Z_NEED_DICT; + } + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = TYPE; + case TYPE: + if (flush == Z_BLOCK) goto inf_leave; + case TYPEDO: + if (state->last) { + BYTEBITS(); + state->mode = CHECK; + break; + } + NEEDBITS(3); + state->last = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + state->last ? " (last)" : "")); + state->mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + Tracev((stderr, "inflate: fixed codes block%s\n", + state->last ? " (last)" : "")); + state->mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + state->last ? " (last)" : "")); + state->mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + state->mode = BAD; + } + DROPBITS(2); + break; + case STORED: + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + state->mode = BAD; + break; + } + state->length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %u\n", + state->length)); + INITBITS(); + state->mode = COPY; + case COPY: + copy = state->length; + if (copy) { + if (copy > have) copy = have; + if (copy > left) copy = left; + if (copy == 0) goto inf_leave; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + state->length -= copy; + break; + } + Tracev((stderr, "inflate: stored end\n")); + state->mode = TYPE; + break; + case TABLE: + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); +#ifndef PKZIP_BUG_WORKAROUND + if (state->nlen > 286 || state->ndist > 30) { + strm->msg = (char *)"too many length or distance symbols"; + state->mode = BAD; + break; + } +#endif + Tracev((stderr, "inflate: table sizes ok\n")); + state->have = 0; + state->mode = LENLENS; + case LENLENS: + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 7; + ret = inflate_table(CODES, state->lens, 19, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + state->have = 0; + state->mode = CODELENS; + case CODELENS: + while (state->have < state->nlen + state->ndist) { + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.val < 16) { + NEEDBITS(this.bits); + DROPBITS(this.bits); + state->lens[state->have++] = this.val; + } + else { + if (this.val == 16) { + NEEDBITS(this.bits + 2); + DROPBITS(this.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + len = state->lens[state->have - 1]; + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (this.val == 17) { + NEEDBITS(this.bits + 3); + DROPBITS(this.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(this.bits + 7); + DROPBITS(this.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (state->mode == BAD) break; + + /* build code tables */ + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 9; + ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + state->mode = BAD; + break; + } + state->distcode = (code const FAR *)(state->next); + state->distbits = 6; + ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, + &(state->next), &(state->distbits), state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + state->mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + RESTORE(); + inflate_fast(strm, out); + LOAD(); + break; + } + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.op && (this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + state->length = (unsigned)this.val; + if ((int)(this.op) == 0) { + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + state->mode = LIT; + break; + } + if (this.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + if (this.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + state->extra = (unsigned)(this.op) & 15; + state->mode = LENEXT; + case LENEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->length += BITS(state->extra); + DROPBITS(state->extra); + } + Tracevv((stderr, "inflate: length %u\n", state->length)); + state->mode = DIST; + case DIST: + for (;;) { + this = state->distcode[BITS(state->distbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if ((this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + if (this.op & 64) { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + state->offset = (unsigned)this.val; + state->extra = (unsigned)(this.op) & 15; + state->mode = DISTEXT; + case DISTEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->offset += BITS(state->extra); + DROPBITS(state->extra); + } +#ifdef INFLATE_STRICT + if (state->offset > state->dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + if (state->offset > state->whave + out - left) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %u\n", state->offset)); + state->mode = MATCH; + case MATCH: + if (left == 0) goto inf_leave; + copy = out - left; + if (state->offset > copy) { /* copy from window */ + copy = state->offset - copy; + if (copy > state->write) { + copy -= state->write; + from = state->window + (state->wsize - copy); + } + else + from = state->window + (state->write - copy); + if (copy > state->length) copy = state->length; + } + else { /* copy from output */ + from = put - state->offset; + copy = state->length; + } + if (copy > left) copy = left; + left -= copy; + state->length -= copy; + do { + *put++ = *from++; + } while (--copy); + if (state->length == 0) state->mode = LEN; + break; + case LIT: + if (left == 0) goto inf_leave; + *put++ = (unsigned char)(state->length); + left--; + state->mode = LEN; + break; + case CHECK: + if (state->wrap) { + NEEDBITS(32); + out -= left; + strm->total_out += out; + state->total += out; + if (out) + strm->adler = state->check = + UPDATE(state->check, put - out, out); + out = left; + if (( +#ifdef GUNZIP + state->flags ? hold : +#endif + REVERSE(hold)) != state->check) { + strm->msg = (char *)"incorrect data check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: check matches trailer\n")); + } +#ifdef GUNZIP + state->mode = LENGTH; + case LENGTH: + if (state->wrap && state->flags) { + NEEDBITS(32); + if (hold != (state->total & 0xffffffff)) { + strm->msg = (char *)"incorrect length check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: length matches trailer\n")); + } +#endif + state->mode = DONE; + case DONE: + ret = Z_STREAM_END; + goto inf_leave; + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + default: + return Z_STREAM_ERROR; + } + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + inf_leave: + RESTORE(); + if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) + if (updatewindow(strm, out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + in -= strm->avail_in; + out -= strm->avail_out; + strm->total_in += in; + strm->total_out += out; + state->total += out; + if (state->wrap && out) + strm->adler = state->check = + UPDATE(state->check, strm->next_out - out, out); + strm->data_type = state->bits + (state->last ? 64 : 0) + + (state->mode == TYPE ? 128 : 0); + if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) + ret = Z_BUF_ERROR; + return ret; +} + +int ZEXPORT inflateEnd(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->window != Z_NULL) ZFREE(strm, state->window); + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + +int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) +z_streamp strm; +const Bytef *dictionary; +uInt dictLength; +{ + struct inflate_state FAR *state; + unsigned long id; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->wrap != 0 && state->mode != DICT) + return Z_STREAM_ERROR; + + /* check for correct dictionary id */ + if (state->mode == DICT) { + id = adler32(0L, Z_NULL, 0); + id = adler32(id, dictionary, dictLength); + if (id != state->check) + return Z_DATA_ERROR; + } + + /* copy dictionary to window */ + if (updatewindow(strm, strm->avail_out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + if (dictLength > state->wsize) { + zmemcpy(state->window, dictionary + dictLength - state->wsize, + state->wsize); + state->whave = state->wsize; + } + else { + zmemcpy(state->window + state->wsize - dictLength, dictionary, + dictLength); + state->whave = dictLength; + } + state->havedict = 1; + Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +int ZEXPORT inflateGetHeader(strm, head) +z_streamp strm; +gz_headerp head; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; + + /* save header structure */ + state->head = head; +#ifdef GUNZIP + head->done = 0; +#endif + return Z_OK; +} + +/* + Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found + or when out of input. When called, *have is the number of pattern bytes + found in order so far, in 0..3. On return *have is updated to the new + state. If on return *have equals four, then the pattern was found and the + return value is how many bytes were read including the last byte of the + pattern. If *have is less than four, then the pattern has not been found + yet and the return value is len. In the latter case, syncsearch() can be + called again with more data and the *have state. *have is initialized to + zero for the first call. + */ +local unsigned syncsearch(have, buf, len) +unsigned FAR *have; +unsigned char FAR *buf; +unsigned len; +{ + unsigned got; + unsigned next; + + got = *have; + next = 0; + while (next < len && got < 4) { + if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) + got++; + else if (buf[next]) + got = 0; + else + got = 4 - got; + next++; + } + *have = got; + return next; +} + +int ZEXPORT inflateSync(strm) +z_streamp strm; +{ + unsigned len; /* number of bytes to look at or looked at */ + unsigned long in, out; /* temporary to save total_in and total_out */ + unsigned char buf[4]; /* to restore bit buffer to byte string */ + struct inflate_state FAR *state; + + /* check parameters */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; + + /* if first time, start search in bit buffer */ + if (state->mode != SYNC) { + state->mode = SYNC; + state->hold <<= state->bits & 7; + state->bits -= state->bits & 7; + len = 0; + while (state->bits >= 8) { + buf[len++] = (unsigned char)(state->hold); + state->hold >>= 8; + state->bits -= 8; + } + state->have = 0; + syncsearch(&(state->have), buf, len); + } + + /* search available input */ + len = syncsearch(&(state->have), strm->next_in, strm->avail_in); + strm->avail_in -= len; + strm->next_in += len; + strm->total_in += len; + + /* return no joy or set up to restart inflate() on a new block */ + if (state->have != 4) return Z_DATA_ERROR; + in = strm->total_in; out = strm->total_out; + inflateReset(strm); + strm->total_in = in; strm->total_out = out; + state->mode = TYPE; + return Z_OK; +} + +/* + Returns true if inflate is currently at the end of a block generated by + Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + implementation to provide an additional safety check. PPP uses + Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored + block. When decompressing, PPP checks that at the end of input packet, + inflate is waiting for these length bytes. + */ +int ZEXPORT inflateSyncPoint(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + return state->mode == STORED && state->bits == 0; +} + +int ZEXPORT inflateCopy(dest, source) +z_streamp dest; +z_streamp source; +{ + struct inflate_state FAR *state; + struct inflate_state FAR *copy; + unsigned char FAR *window; + unsigned wsize; + + /* check input */ + if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || + source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)source->state; + + /* allocate space */ + copy = (struct inflate_state FAR *) + ZALLOC(source, 1, sizeof(struct inflate_state)); + if (copy == Z_NULL) return Z_MEM_ERROR; + window = Z_NULL; + if (state->window != Z_NULL) { + window = (unsigned char FAR *) + ZALLOC(source, ((unsigned int)1) << state->wbits, sizeof(unsigned char)); + if (window == Z_NULL) { + ZFREE(source, copy); + return Z_MEM_ERROR; + } + } + + /* copy state */ + zmemcpy(dest, source, sizeof(z_stream)); + zmemcpy(copy, state, sizeof(struct inflate_state)); + if (state->lencode >= state->codes && + state->lencode <= state->codes + ENOUGH - 1) { + copy->lencode = copy->codes + (state->lencode - state->codes); + copy->distcode = copy->codes + (state->distcode - state->codes); + } + copy->next = copy->codes + (state->next - state->codes); + if (window != Z_NULL) { + wsize = ((unsigned int)1) << state->wbits; + zmemcpy(window, state->window, wsize); + } + copy->window = window; + dest->state = (struct internal_state FAR *)copy; + return Z_OK; +} + +#endif /* _INFLATE_C */ + +#ifndef _GZIO_C +#define _GZIO_C 1 + +typedef voidp gzFile; + +#ifndef Z_BUFSIZE +# ifdef MAXSEG_64K +# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ +# else +# define Z_BUFSIZE 16384 +# endif +#endif +#ifndef Z_PRINTF_BUFSIZE +# define Z_PRINTF_BUFSIZE 4096 +#endif + +#ifdef __MVS__ +# pragma map (fdopen , "\174\174FDOPEN") + FILE *fdopen(int, const char *); +#endif + +#if 0 && !_PACKAGE_ast +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern void free OF((voidpf ptr)); +#endif +#endif + +#define ALLOC(size) malloc(size) +#define TRYFREE(p) {if (p) free(p);} + +static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ + +/* gzip flag byte */ +#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ +#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define COMMENT 0x10 /* bit 4 set: file comment present */ +#define RESERVED 0xE0 /* bits 5..7: reserved */ + +typedef struct gz_stream { + z_stream stream; + int z_err; /* error code for last stream operation */ + int z_eof; /* set if end of input file */ + FILE *file; /* .gz file */ + Byte *inbuf; /* input buffer */ + Byte *outbuf; /* output buffer */ + uLong crc; /* crc32 of uncompressed data */ + char *msg; /* error message */ + char *path; /* path name for debugging only */ + int transparent; /* 1 if input file is not a .gz file */ +#if _PACKAGE_ast + int fatal; /* fatal stream error => all other ops fail */ + int nocrc; /* 1 to skip 'r' crc checks */ + int noclose; /* 1 to skip destroy fclose */ + int verified;/* 2-byte magic read and verified ('v') */ +#endif + char mode; /* 'w' or 'r' */ + z_off_t start; /* start of compressed data in file (header skipped) */ + z_off_t in; /* bytes into deflate or inflate */ + z_off_t out; /* bytes out of deflate or inflate */ + int back; /* one character push-back */ + int last; /* true if push-back is last character */ +} gz_stream; + + +local gzFile gz_open OF((const char *path, const char *mode, FILE* fp)); +local int get_byte OF((gz_stream *s)); +local void check_header OF((gz_stream *s)); +local int destroy OF((gz_stream *s)); +local uLong getLong OF((gz_stream *s)); + +/* =========================================================================== + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb"). The file is given either by FILE pointer + or path name (if fp == 0). + gz_open returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). +*/ +local gzFile gz_open (path, mode, fp) + const char *path; + const char *mode; + FILE *fp; +{ + int err; + int level = Z_DEFAULT_COMPRESSION; /* compression level */ + int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ + char *p = (char*)mode; + gz_stream *s; + char fmode[80]; /* copy of mode, without the compression level */ + char *m = fmode; + + if (!path || !mode) return Z_NULL; + + s = (gz_stream *)ALLOC(sizeof(gz_stream)); + if (!s) return Z_NULL; + + s->stream.zalloc = (alloc_func)0; + s->stream.zfree = (free_func)0; + s->stream.opaque = (voidpf)0; + s->stream.next_in = s->inbuf = Z_NULL; + s->stream.next_out = s->outbuf = Z_NULL; + s->stream.avail_in = s->stream.avail_out = 0; + s->file = NULL; + s->z_err = Z_OK; + s->z_eof = 0; + s->in = 0; + s->out = 0; + s->back = EOF; + s->crc = crc32(0L, Z_NULL, 0); +#if _PACKAGE_ast + s->fatal = 0; + s->nocrc = 0; + s->verified = 0; +#endif + s->msg = NULL; + s->transparent = 0; + + s->path = (char*)ALLOC(strlen(path)+1); + if (s->path == NULL) { + return destroy(s), (gzFile)Z_NULL; + } + strcpy(s->path, path); /* do this early for debugging */ + + s->mode = '\0'; + do { + if (*p == 'r') s->mode = 'r'; + if (*p == 'w' || *p == 'a') s->mode = 'w'; + if (*p >= '0' && *p <= '9') { + level = *p - '0'; + } else if (*p == 'f') { + strategy = Z_FILTERED; + } else if (*p == 'h') { + strategy = Z_HUFFMAN_ONLY; + } else if (*p == 'R') { + strategy = Z_RLE; +#if _PACKAGE_ast + } else if (*p == 'n') { + s->nocrc = 1; + } else if (*p == 'o') { + s->noclose = 1; + } else if (*p == 'v') { + s->verified = 1; +#endif + } else { + *m++ = *p; /* copy the mode */ + } + } while (*p++ && m != fmode + sizeof(fmode)); + if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; + + if (s->mode == 'w') { +#ifdef NO_GZCOMPRESS + err = Z_STREAM_ERROR; +#else +#if _PACKAGE_ast + s->nocrc = 0; +#endif + err = deflateInit2(&(s->stream), level, + Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); + /* windowBits is passed < 0 to suppress zlib header */ + + s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); +#endif + if (err != Z_OK || s->outbuf == Z_NULL) { + return destroy(s), (gzFile)Z_NULL; + } + } else { + s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); + + err = inflateInit2(&(s->stream), -MAX_WBITS); + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are + * present after the compressed stream. + */ + if (err != Z_OK || s->inbuf == Z_NULL) { + return destroy(s), (gzFile)Z_NULL; + } + } + s->stream.avail_out = Z_BUFSIZE; + + errno = 0; + + if (!(s->file = fp) && !(s->file = F_OPEN(path, fmode))) { + return destroy(s), (gzFile)Z_NULL; + } + if (s->mode == 'w') { + /* Write a very simple .gz header: + */ + fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], + Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); + s->start = 10L; + /* We use 10L instead of ftell(s->file) to because ftell causes an + * fflush on some systems. This version of the library doesn't use + * start anyway in write mode, so this initialization is not + * necessary. + */ + } else { +#if _PACKAGE_ast + sfsetbuf(s->file, (void*)s->file, SF_UNBOUND); +#endif + check_header(s); /* skip the .gz header */ + s->start = (z_off_t)(ftell(s->file) - s->stream.avail_in); + } + + return (gzFile)s; +} + +/* =========================================================================== + Associate a gzFile with the stdio stream fp. +*/ +gzFile ZEXPORT gzfopen (fp, mode) + FILE* fp; + const char *mode; +{ + FILE* sp = (FILE*)fp; + char name[20]; + + if (!sp) + return (gzFile)Z_NULL; + sprintf(name, "", fileno(sp)); /* for debugging */ + + return gz_open (name, mode, sp); +} + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been successfully opened for reading. +*/ +local int get_byte(s) + gz_stream *s; +{ + if (s->z_eof) return EOF; + if (s->stream.avail_in == 0) { + errno = 0; + s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); + if (s->stream.avail_in == 0) { + s->z_eof = 1; + if (ferror(s->file)) s->z_err = Z_ERRNO; + return EOF; + } + s->stream.next_in = s->inbuf; + } + s->stream.avail_in--; + return *(s->stream.next_in)++; +} + +/* =========================================================================== + Check the gzip header of a gz_stream opened for reading. Set the stream + mode to transparent if the gzip magic header is not present; set s->err + to Z_DATA_ERROR if the magic header is present but the rest of the header + is incorrect. + IN assertion: the stream s has already been created successfully; + s->stream.avail_in is zero for the first time, but may be non-zero + for concatenated .gz files. +*/ +local void check_header(s) + gz_stream *s; +{ + int method; /* method byte */ + int flags; /* flags byte */ + uInt len; + int c; + +#if _PACKAGE_ast + if (!s->verified) + for (len = 0; len < 2; len++) { + c = get_byte(s); + if (c != gz_magic[len]) { + if (len != 0) s->stream.avail_in++, s->stream.next_in--; + if (c != EOF) { + s->stream.avail_in++, s->stream.next_in--; + s->transparent = 1; + } + s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END; + return; + } + } +#else + /* Assure two bytes in the buffer so we can peek ahead -- handle case + where first byte of header is at the end of the buffer after the last + gzip segment */ + len = s->stream.avail_in; + if (len < 2) { + if (len) s->inbuf[0] = s->stream.next_in[0]; + errno = 0; + len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); + if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; + s->stream.avail_in += len; + s->stream.next_in = s->inbuf; + if (s->stream.avail_in < 2) { + s->transparent = s->stream.avail_in; + return; + } + } + + /* Peek ahead to check the gzip magic header */ + if (s->stream.next_in[0] != gz_magic[0] || + s->stream.next_in[1] != gz_magic[1]) { + s->transparent = 1; + return; + } + s->stream.avail_in -= 2; + s->stream.next_in += 2; +#endif + + /* Check the rest of the gzip header */ + method = get_byte(s); + flags = get_byte(s); + if (method != Z_DEFLATED || (flags & RESERVED) != 0) { + s->z_err = Z_DATA_ERROR; + return; + } + + /* Discard time, xflags and OS code: */ + for (len = 0; len < 6; len++) (void)get_byte(s); + + if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ + len = (uInt)get_byte(s); + len += ((uInt)get_byte(s))<<8; + /* len is garbage if EOF but the loop below will quit anyway */ + while (len-- != 0 && get_byte(s) != EOF) ; + } + if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ + while ((c = get_byte(s)) != 0 && c != EOF) ; + } + if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ + while ((c = get_byte(s)) != 0 && c != EOF) ; + } + if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ + for (len = 0; len < 2; len++) (void)get_byte(s); + } + s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; +} + + /* =========================================================================== + * Cleanup then free the given gz_stream. Return a zlib error code. + Try freeing in the reverse order of allocations. + */ +local int destroy (s) + gz_stream *s; +{ + int err = Z_OK; + + if (!s) return Z_STREAM_ERROR; + + TRYFREE(s->msg); + + if (s->stream.state != NULL) { + if (s->mode == 'w') { +#ifdef NO_GZCOMPRESS + err = Z_STREAM_ERROR; +#else + err = deflateEnd(&(s->stream)); +#endif + } else if (s->mode == 'r') { + err = inflateEnd(&(s->stream)); + } + } +#if _PACKAGE_ast + if (s->file != NULL && (s->noclose ? (s->mode == 'r' ? 0 : fflush(s->file)) : fclose(s->file))) { +#else + if (s->file != NULL && fclose(s->file)) { +#endif +#ifdef ESPIPE + if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ +#endif + err = Z_ERRNO; + } + if (s->z_err < 0) err = s->z_err; + + TRYFREE(s->inbuf); + TRYFREE(s->outbuf); + TRYFREE(s->path); + TRYFREE(s); + return err; +} + +/* =========================================================================== + Reads the given number of uncompressed bytes from the compressed file. + gzread returns the number of bytes actually read (0 for end of file). +*/ +int ZEXPORT gzread (file, buf, len) + gzFile file; + voidp buf; + unsigned len; +{ + gz_stream *s = (gz_stream*)file; + Bytef *start = (Bytef*)buf; /* starting point for crc computation */ + Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ + + if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; + + if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; + if (s->z_err == Z_STREAM_END) return 0; /* EOF */ + + next_out = (Byte*)buf; + s->stream.next_out = (Bytef*)buf; + s->stream.avail_out = len; + + if (s->stream.avail_out && s->back != EOF) { + *next_out++ = s->back; + s->stream.next_out++; + s->stream.avail_out--; + s->back = EOF; + s->out++; + start++; + if (s->last) { + s->z_err = Z_STREAM_END; + return 1; + } + } + + while (s->stream.avail_out != 0) { + + if (s->transparent) { + /* Copy first the lookahead bytes: */ + uInt n = s->stream.avail_in; + if (n > s->stream.avail_out) n = s->stream.avail_out; + if (n > 0) { + zmemcpy(s->stream.next_out, s->stream.next_in, n); + next_out += n; + s->stream.next_out = next_out; + s->stream.next_in += n; + s->stream.avail_out -= n; + s->stream.avail_in -= n; + } + if (s->stream.avail_out > 0) { + s->stream.avail_out -= + (uInt)fread(next_out, 1, s->stream.avail_out, s->file); + } + len -= s->stream.avail_out; + s->in += len; + s->out += len; + if (len == 0) s->z_eof = 1; + return (int)len; + } + if (s->stream.avail_in == 0 && !s->z_eof) { + + errno = 0; + s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); + if (s->stream.avail_in == 0) { + s->z_eof = 1; + if (ferror(s->file)) { + s->z_err = Z_ERRNO; + break; + } + } + s->stream.next_in = s->inbuf; + } + s->in += s->stream.avail_in; + s->out += s->stream.avail_out; + s->z_err = inflate(&(s->stream), Z_NO_FLUSH); + s->in -= s->stream.avail_in; + s->out -= s->stream.avail_out; + + if (s->z_err == Z_STREAM_END) { + /* Check CRC and original size */ +#if _PACKAGE_ast + if (!s->nocrc) +#endif + s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + start = s->stream.next_out; + +#if _PACKAGE_ast + if (getLong(s) != s->crc && !s->nocrc) { +#else + if (getLong(s) != s->crc) { +#endif + s->z_err = Z_DATA_ERROR; + } else { + (void)getLong(s); + /* The uncompressed length returned by above getlong() may be + * different from s->out in case of concatenated .gz files. + * Check for such files: + */ + check_header(s); + if (s->z_err == Z_OK) { + inflateReset(&(s->stream)); +#if _PACKAGE_ast + if (!s->nocrc) +#endif + s->crc = crc32(0L, Z_NULL, 0); +#if _PACKAGE_ast + else + s->z_err = Z_STREAM_END; +#endif + } + } + } + if (s->z_err != Z_OK || s->z_eof) break; + } +#if _PACKAGE_ast + if (!s->nocrc) +#endif + s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + + if (len == s->stream.avail_out && + (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) + return -1; + return (int)(len - s->stream.avail_out); +} + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets z_err in case + of error. +*/ +local uLong getLong (s) + gz_stream *s; +{ + uLong x = (uLong)get_byte(s); + int c; + + x += ((uLong)get_byte(s))<<8; + x += ((uLong)get_byte(s))<<16; + c = get_byte(s); + if (c == EOF) s->z_err = Z_DATA_ERROR; + x += ((uLong)c)<<24; + return x; +} + +#endif /* _GZIO_C */ + +#endif /* _GUNZIP_H */ + +#undef local + +#ifndef _RATZ_C +#define _RATZ_C 1 + +#include + +#ifndef S_IRUSR +#define S_IRUSR 0400 +#endif +#ifndef S_IWUSR +#define S_IWUSR 0200 +#endif +#ifndef S_IXUSR +#define S_IXUSR 0100 +#endif +#ifndef S_IRGRP +#define S_IRGRP 0040 +#endif +#ifndef S_IWGRP +#define S_IWGRP 0020 +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 +#endif +#ifndef S_IROTH +#define S_IROTH 0004 +#endif +#ifndef S_IWOTH +#define S_IWOTH 0002 +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 +#endif + +/* + * Standard Archive Format + * USTAR - Uniform Standard Tape ARchive + */ + +#define TBLOCK 512 +#define NAMSIZ 100 +#define PFXSIZ 155 + +#define TMODLEN 8 +#define TUIDLEN 8 +#define TGIDLEN 8 +#define TSIZLEN 12 +#define TMTMLEN 12 +#define TCKSLEN 8 + +#define TMAGIC "ustar" /* ustar and a null */ +#define TMAGLEN 6 +#define TVERSION "00" /* 00 and no null */ +#define TVERSLEN 2 +#define TUNMLEN 32 +#define TGNMLEN 32 +#define TDEVLEN 8 +#define TPADLEN 12 + +/* + * values used in typeflag field + */ + +#define REGTYPE '0' /* regular file */ +#define AREGTYPE 0 /* alternate REGTYPE */ +#define LNKTYPE '1' /* hard link */ +#define SYMTYPE '2' /* soft link */ +#define CHRTYPE '3' /* character special */ +#define BLKTYPE '4' /* block special */ +#define DIRTYPE '5' /* directory */ +#define FIFOTYPE '6' /* FIFO special */ +#define CONTTYPE '7' /* reserved */ +#define SOKTYPE '8' /* socket -- reserved */ +#define VERTYPE 'V' /* version -- reserved */ +#define EXTTYPE 'x' /* extended header -- reserved */ + +/* + * bits used in mode field + */ + +#define TSUID 04000 /* set uid on exec */ +#define TSGID 02000 /* set gid on exec */ +#define TSVTX 01000 /* sticky bit -- reserved */ + +/* + * file permissions + */ + +#define TUREAD 00400 /* read by owner */ +#define TUWRITE 00200 /* write by owner */ +#define TUEXEC 00100 /* execute by owner */ +#define TGREAD 00040 /* read by group */ +#define TGWRITE 00020 /* execute by group */ +#define TGEXEC 00010 /* write by group */ +#define TOREAD 00004 /* read by other */ +#define TOWRITE 00002 /* write by other */ +#define TOEXEC 00001 /* execute by other */ + +#define TAR_SUMASK ((1L<<(TCKSLEN-1)*3)-1) + +typedef struct +{ + char name[NAMSIZ]; + char mode[TMODLEN]; + char uid[TUIDLEN]; + char gid[TGIDLEN]; + char size[TSIZLEN]; + char mtime[TMTMLEN]; + char chksum[TCKSLEN]; + char typeflag; + char linkname[NAMSIZ]; + char magic[TMAGLEN]; + char version[TVERSLEN]; + char uname[TUNMLEN]; + char gname[TGNMLEN]; + char devmajor[TDEVLEN]; + char devminor[TDEVLEN]; + char prefix[PFXSIZ]; + char pad[TPADLEN]; +} Header_t; + +static struct +{ + char* id; + unsigned long blocks; + unsigned long files; +} state; + +#if !_PACKAGE_ast + +static void +usage() +{ +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + fprintf(stderr, "Usage: %s [-ciklmntvV] [ [no]name[=value] ... ]\n", state.id); +#else + fprintf(stderr, "Usage: %s [-clmntvV] < input.tgz\n", state.id); +#endif + exit(2); +} + +#endif + +/* + * the X/Open dd EBCDIC table + */ + +static const unsigned char a2e[] = +{ + 0000,0001,0002,0003,0067,0055,0056,0057, + 0026,0005,0045,0013,0014,0015,0016,0017, + 0020,0021,0022,0023,0074,0075,0062,0046, + 0030,0031,0077,0047,0034,0035,0036,0037, + 0100,0132,0177,0173,0133,0154,0120,0175, + 0115,0135,0134,0116,0153,0140,0113,0141, + 0360,0361,0362,0363,0364,0365,0366,0367, + 0370,0371,0172,0136,0114,0176,0156,0157, + 0174,0301,0302,0303,0304,0305,0306,0307, + 0310,0311,0321,0322,0323,0324,0325,0326, + 0327,0330,0331,0342,0343,0344,0345,0346, + 0347,0350,0351,0255,0340,0275,0232,0155, + 0171,0201,0202,0203,0204,0205,0206,0207, + 0210,0211,0221,0222,0223,0224,0225,0226, + 0227,0230,0231,0242,0243,0244,0245,0246, + 0247,0250,0251,0300,0117,0320,0137,0007, + 0040,0041,0042,0043,0044,0025,0006,0027, + 0050,0051,0052,0053,0054,0011,0012,0033, + 0060,0061,0032,0063,0064,0065,0066,0010, + 0070,0071,0072,0073,0004,0024,0076,0341, + 0101,0102,0103,0104,0105,0106,0107,0110, + 0111,0121,0122,0123,0124,0125,0126,0127, + 0130,0131,0142,0143,0144,0145,0146,0147, + 0150,0151,0160,0161,0162,0163,0164,0165, + 0166,0167,0170,0200,0212,0213,0214,0215, + 0216,0217,0220,0152,0233,0234,0235,0236, + 0237,0240,0252,0253,0254,0112,0256,0257, + 0260,0261,0262,0263,0264,0265,0266,0267, + 0270,0271,0272,0273,0274,0241,0276,0277, + 0312,0313,0314,0315,0316,0317,0332,0333, + 0334,0335,0336,0337,0352,0353,0354,0355, + 0356,0357,0372,0373,0374,0375,0376,0377, +}; + +/* + * the X/Open dd IBM table + */ + +static const unsigned char a2i[] = +{ + 0000,0001,0002,0003,0067,0055,0056,0057, + 0026,0005,0045,0013,0014,0015,0016,0017, + 0020,0021,0022,0023,0074,0075,0062,0046, + 0030,0031,0077,0047,0034,0035,0036,0037, + 0100,0132,0177,0173,0133,0154,0120,0175, + 0115,0135,0134,0116,0153,0140,0113,0141, + 0360,0361,0362,0363,0364,0365,0366,0367, + 0370,0371,0172,0136,0114,0176,0156,0157, + 0174,0301,0302,0303,0304,0305,0306,0307, + 0310,0311,0321,0322,0323,0324,0325,0326, + 0327,0330,0331,0342,0343,0344,0345,0346, + 0347,0350,0351,0255,0340,0275,0137,0155, + 0171,0201,0202,0203,0204,0205,0206,0207, + 0210,0211,0221,0222,0223,0224,0225,0226, + 0227,0230,0231,0242,0243,0244,0245,0246, + 0247,0250,0251,0300,0117,0320,0241,0007, + 0040,0041,0042,0043,0044,0025,0006,0027, + 0050,0051,0052,0053,0054,0011,0012,0033, + 0060,0061,0032,0063,0064,0065,0066,0010, + 0070,0071,0072,0073,0004,0024,0076,0341, + 0101,0102,0103,0104,0105,0106,0107,0110, + 0111,0121,0122,0123,0124,0125,0126,0127, + 0130,0131,0142,0143,0144,0145,0146,0147, + 0150,0151,0160,0161,0162,0163,0164,0165, + 0166,0167,0170,0200,0212,0213,0214,0215, + 0216,0217,0220,0232,0233,0234,0235,0236, + 0237,0240,0252,0253,0254,0255,0256,0257, + 0260,0261,0262,0263,0264,0265,0266,0267, + 0270,0271,0272,0273,0274,0275,0276,0277, + 0312,0313,0314,0315,0316,0317,0332,0333, + 0334,0335,0336,0337,0352,0353,0354,0355, + 0356,0357,0372,0373,0374,0375,0376,0377, +}; + +/* + * the mvs OpenEdition EBCDIC table + */ + +static const unsigned char a2o[] = +{ + 0000,0001,0002,0003,0067,0055,0056,0057, + 0026,0005,0025,0013,0014,0015,0016,0017, + 0020,0021,0022,0023,0074,0075,0062,0046, + 0030,0031,0077,0047,0034,0035,0036,0037, + 0100,0132,0177,0173,0133,0154,0120,0175, + 0115,0135,0134,0116,0153,0140,0113,0141, + 0360,0361,0362,0363,0364,0365,0366,0367, + 0370,0371,0172,0136,0114,0176,0156,0157, + 0174,0301,0302,0303,0304,0305,0306,0307, + 0310,0311,0321,0322,0323,0324,0325,0326, + 0327,0330,0331,0342,0343,0344,0345,0346, + 0347,0350,0351,0255,0340,0275,0137,0155, + 0171,0201,0202,0203,0204,0205,0206,0207, + 0210,0211,0221,0222,0223,0224,0225,0226, + 0227,0230,0231,0242,0243,0244,0245,0246, + 0247,0250,0251,0300,0117,0320,0241,0007, + 0040,0041,0042,0043,0044,0045,0006,0027, + 0050,0051,0052,0053,0054,0011,0012,0033, + 0060,0061,0032,0063,0064,0065,0066,0010, + 0070,0071,0072,0073,0004,0024,0076,0377, + 0101,0252,0112,0261,0237,0262,0152,0265, + 0273,0264,0232,0212,0260,0312,0257,0274, + 0220,0217,0352,0372,0276,0240,0266,0263, + 0235,0332,0233,0213,0267,0270,0271,0253, + 0144,0145,0142,0146,0143,0147,0236,0150, + 0164,0161,0162,0163,0170,0165,0166,0167, + 0254,0151,0355,0356,0353,0357,0354,0277, + 0200,0375,0376,0373,0374,0272,0256,0131, + 0104,0105,0102,0106,0103,0107,0234,0110, + 0124,0121,0122,0123,0130,0125,0126,0127, + 0214,0111,0315,0316,0313,0317,0314,0341, + 0160,0335,0336,0333,0334,0215,0216,0337, +}; + +/* + * ascii text vs. control + */ + +static const unsigned char ascii_text[] = +{ + 0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +static int +block(fp, gz, buf) +FILE* fp; +gzFile gz; +char* buf; +{ + int r; + + if (gz) + r = gzread(gz, buf, sizeof(Header_t)) == sizeof(Header_t); + else + r = fread(buf, sizeof(Header_t), 1, fp) == 1; + if (r) + state.blocks++; + return r; +} + +static int +skip(fp, gz, buf, n) +FILE* fp; +gzFile gz; +char* buf; +unsigned long n; +{ + while (n > 0) + { + if (!block(fp, gz, buf)) + { + fprintf(stderr, "%s: unexpected EOF\n", state.id); + return 1; + } + if (n <= sizeof(Header_t)) + break; + n -= sizeof(Header_t); + } + return 0; +} + +static unsigned long +number(s) +register char* s; +{ + unsigned long n = 0; + + while (*s == ' ') + s++; + while (*s >= '0' && *s <= '7') + n = (n << 3) + (*s++ - '0'); + return n; +} + +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + +#ifndef PATH_MAX +#define PATH_MAX 256 +#endif + +#define EXIT(n) return(sear_exec((char*)0,(char**)0,(char*)0,(n))) + +static int sear_stdin; +static char* sear_tmp; +static char sear_buf[PATH_MAX]; + +static int +sear_seek(off_t offset, int tmp) +{ + int n; + char cmd[PATH_MAX]; + + GetModuleFileName(NULL, cmd, sizeof(cmd)); + sear_stdin = dup(0); + close(0); + if (open(cmd, O_BINARY|O_RDONLY) || lseek(0, offset, 0) != offset) + { + fprintf(stderr, "%s: %s: cannot seek to data offset\n", state.id, cmd); + return -1; + } + if (tmp) + { + if ((n = GetTempPath(sizeof(cmd), cmd)) <= 0 || n > sizeof(cmd)) + { + fprintf(stderr, "%s: cannot determine temporary directory path\n", state.id); + return -1; + } + if (!GetTempFileName(cmd, "SEA", 0, sear_buf)) + { + fprintf(stderr, "%s: cannot determine temporary file path\n", state.id); + return -1; + } + sear_tmp = sear_buf; + if (!DeleteFile(sear_tmp)) + { + fprintf(stderr, "%s: %s: cannot initialize temporary directory\n", state.id, sear_tmp); + return -1; + } + if (!CreateDirectory(sear_tmp, NULL)) + { + fprintf(stderr, "%s: %s: cannot create temporary directory\n", state.id, sear_tmp); + return -1; + } + if (!SetCurrentDirectory(sear_tmp)) + { + fprintf(stderr, "%s: %s: cannot cd to temporary directory\n", state.id, sear_tmp); + return -1; + } + } + return 0; +} + +/* + * remove dir and its subdirs + */ + +static void +sear_rm_r(char* dir) +{ + WIN32_FIND_DATA info; + HANDLE hp; + + if (!SetCurrentDirectory(dir)) + return; + if ((hp = FindFirstFile("*.*", &info)) != INVALID_HANDLE_VALUE) + { + do + { + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + SetFileAttributes(info.cFileName, info.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY); + DeleteFile(info.cFileName); + } + else if (info.cFileName[0] != '.' || info.cFileName[1] != 0 && (info.cFileName[1] != '.' || info.cFileName[2] != 0)) + sear_rm_r(info.cFileName); + } while(FindNextFile(hp, &info)); + FindClose(hp); + } + if (SetCurrentDirectory("..")) + RemoveDirectory(dir); +} + +/* + * system(3) without PATH search that should work on all windows variants + */ + +static int +sear_system(const char* command, int nowindow) +{ + PROCESS_INFORMATION pinfo; + STARTUPINFO sinfo; + char* cp; + char path[PATH_MAX]; + int n = *command == '"'; + DWORD flags = NORMAL_PRIORITY_CLASS; + + strncpy(path, &command[n], PATH_MAX - 4); + n = n ? '"' : ' '; + for (cp = path; *cp; *cp++) + if (*cp == n) + break; + *cp = 0; + if (GetFileAttributes(path) == 0xffffffff && GetLastError() == ERROR_FILE_NOT_FOUND) + strcpy(cp, ".exe"); + ZeroMemory(&sinfo, sizeof(sinfo)); + if (nowindow) + flags |= CREATE_NO_WINDOW; + if (!CreateProcess(path, (char*)command, 0, 0, TRUE, flags, NULL, NULL, &sinfo, &pinfo)) + n = GetLastError() == ERROR_FILE_NOT_FOUND ? 127 : 126; + else + { + CloseHandle(pinfo.hThread); + WaitForSingleObject(pinfo.hProcess, INFINITE); + if (!GetExitCodeProcess(pinfo.hProcess, &n)) + n = 1; + CloseHandle(pinfo.hProcess); + Sleep(2 * 1000); + } + return n; +} + +/* + * copy t to f but no farther than e + * next t returned + */ + +static char* +copy(char* t, const char* f, char* e) +{ + while (t < e && *f) + *t++ = *f++; + return t; +} + +/* + * execute cmd, chdir .., and remove sear_tmp + */ + +static int +sear_exec(const char* cmd, char* const* arg, char* operands, int code) +{ + const char* a; + char* b; + char* e; + int r; + int sh; + int nowindow; + char buf[1024]; + + fflush(stdout); + fflush(stderr); + if (sear_tmp) + { + close(0); + dup(sear_stdin); + close(sear_stdin); + nowindow = 0; + if (cmd) + { + if (arg) + for (r = 0; arg[r]; r++) + if (!strcmp(arg[r], "remote")) + { + nowindow = 1; + break; + } + sh = 0; + for (a = cmd; *a && *a != ' '; a++) + if (a[0] == '.' && a[1] == 's' && a[2] == 'h' && (!a[3] || a[3] == ' ')) + { + sh = 1; + break; + } + b = buf; + e = buf + sizeof(buf) - 1; + if (sh || arg) + { + if (sh) + { + b = copy(b, "ksh.exe ", e); + if (*cmd && *cmd != '/') + b = copy(b, "./", e); + } + b = copy(b, cmd, e); + while (a = *arg++) + { + if ((e - b) < 3) + break; + b = copy(b, " \"", e); + b = copy(b, a, e); + b = copy(b, "\"", e); + } + } + if (operands) + { + if (b == buf) + b = copy(b, cmd, e); + b = copy(b, " -- ", e); + b = copy(b, operands, e); + } + if (b > buf) + { + *b = 0; + cmd = (const char*)buf; + } + r = sear_system(cmd, nowindow); + } + else + r = code; + if (code >= 0) + sear_rm_r(sear_tmp); + } + else + r = cmd ? 0 : code; + return r; +} + +#else + +#define EXIT(n) return(n) + +#endif + +int +main(argc, argv) +int argc; +char** argv; +{ + register int c; + register char* s; + register char* t; + register char* e; + unsigned long n; + unsigned long m; + const unsigned char* a2x; + int clear; + int list; + int local; + int meter; + int unzip; + int verbose; + unsigned int mode; + unsigned long total; + off_t pos; + gzFile gz; + FILE* fp; + Header_t header; + unsigned char num[4]; + char path[sizeof(header.prefix) + sizeof(header.name) + 4]; + char buf[sizeof(header)]; +#if defined(_SEAR_OPTS) + char* opts[4]; +#endif + +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + int install = 1; +#endif + + setmode(0, O_BINARY); + setmode(1, O_BINARY); + clear = 0; + list = 0; + local = 0; + meter = 0; + unzip = 0; + verbose = 0; + if (s = *argv) + { + t = s; + while (*s) + if (*s++ == '/') + t = s; + if (!strcmp(t, "gunzip")) + unzip = 1; + state.id = t; + } + else + state.id = "ratz"; + switch ((unsigned char)'~') + { + case 0241: + switch ('\n') + { + case 0025: + a2x = a2o; + break; + default: + a2x = a2e; + break; + } + break; + case 0137: + a2x = a2i; + break; + default: + a2x = 0; + break; + } +#if defined(_SEAR_OPTS) + opts[0] = argv[0]; + opts[1] = _SEAR_OPTS; + opts[2] = argv[1]; + opts[3] = 0; + argv = opts; +#endif +#if _PACKAGE_ast + error_info.id = state.id; + for (;;) + { + switch (optget(argv, usage)) + { + case 'c': + unzip = 1; + continue; +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + case 'i': + install = 0; + continue; + case 'k': + install = -1; + continue; +#endif + case 'l': + local = 1; + continue; + case 'm': + meter = 1; + continue; + case 'n': + a2x = 0; + continue; + case 't': + list = 1; + continue; + case 'v': + verbose = 1; + continue; + case 'V': + sfprintf(sfstdout, "%s\n", id + 10); + return 0; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + continue; + case ':': + error(2, "%s", opt_info.arg); + continue; + } + break; + } + if (error_info.errors) + error(ERROR_USAGE|4, "%s", optusage(NiL)); + argv += opt_info.index; +#else + while ((s = *++argv) && *s == '-' && *(s + 1)) + { + if (*(s + 1) == '-') + { + if (!*(s + 2)) + { + argv++; + break; + } + usage(); + break; + } + for (;;) + { + switch (c = *++s) + { + case 0: + break; + case 'c': + unzip = 1; + continue; +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + case 'i': + install = 0; + continue; + case 'k': + install = -1; + continue; +#endif + case 'l': + local = 1; + continue; + case 'm': + meter = 1; + continue; + case 'n': + a2x = 0; + continue; + case 't': + list = 1; + continue; + case 'v': + verbose = 1; + continue; + case 'V': + fprintf(stdout, "%s\n", id + 10); + return 0; + default: + fprintf(stderr, "%s: -%c: unknown option\n", state.id, c); + /*FALLTHROUGH*/ + case '?': + usage(); + break; + } + break; + } + } +#endif + +#if defined(_SEAR_SEEK) + if (sear_seek((off_t)_SEAR_SEEK, install && !list)) + { + Sleep(2 * 1000); + return 1; + } +#endif + + /* + * commit on the first gzip magic char + */ + + if ((c = getchar()) == EOF) + EXIT(0); + ungetc(c, stdin); + if (c != gz_magic[0]) + gz = 0; + else if (!(gz = gzfopen(stdin, FOPEN_READ))) + { + fprintf(stderr, "%s: gunzip open error\n", state.id); + EXIT(1); + } + if (unzip) + { + if (!gz) + { + fprintf(stderr, "%s: not a gzip file\n", state.id); + EXIT(1); + } + while ((c = gzread(gz, buf, sizeof(buf))) > 0) + if (fwrite(buf, c, 1, stdout) != 1) + { + fprintf(stderr, "%s: write error\n", state.id); + EXIT(1); + } + if (c < 0) + { + fprintf(stderr, "%s: read error\n", state.id); + EXIT(1); + } + if (fflush(stdout)) + { + fprintf(stderr, "%s: flush error\n", state.id); + EXIT(1); + } + EXIT(0); + } + if (meter) + { + if ((pos = lseek(0, (off_t)0, SEEK_CUR)) < 0) + meter = 0; + else + { + if (lseek(0, (off_t)(-4), SEEK_END) < 0 || read(0, num, 4) != 4) + meter = 0; + else if (!(total = ((num[0]|(num[1]<<8)|(num[2]<<16)|(num[3]<<24)) + sizeof(Header_t) - 1) / sizeof(Header_t))) + total = 1; + lseek(0, pos, SEEK_SET); + } + } + + /* + * loop on all the header blocks + */ + + while (block(stdin, gz, (char*)&header)) + { + /* + * last 2 blocks are NUL + */ + + if (!*header.name) + break; + + /* + * verify the checksum + */ + + s = header.chksum; + e = header.chksum + sizeof(header.chksum); + if (a2x) + { + for (; s < e; s++) + *s = a2x[*(unsigned char*)s]; + s = header.chksum; + } + n = number(s) & TAR_SUMASK; + while (s < e) + *s++ = 040; + m = 0; + s = (char*)&header; + e = (char*)&header + sizeof(header); + while (s < e) + m += *(unsigned char*)s++; + m &= TAR_SUMASK; + if (m != n) + { + if (state.files) + fprintf(stderr, "%s: archive corrupted\n", state.id); + else + fprintf(stderr, "%s: not a tar archive\n", state.id); + fprintf(stderr, "check sum %lu != %lu\n", m, n); + EXIT(1); + } + + /* + * convert to the native charset + */ + + if (a2x) + for (e = (s = (char*)&header) + sizeof(header); s < e; s++) + *s = a2x[*(unsigned char*)s]; + + /* + * get the pathname, type and size + */ + + state.files++; + t = path; + if (!strncmp(header.magic, TMAGIC, sizeof(header.magic)) && *header.prefix) + { + s = header.prefix; + e = header.prefix + sizeof(header.prefix); + while (s < e && (c = *s++)) + *t++ = c; + *t++ = '/'; + } + s = header.name; + e = header.name + sizeof(header.name); + while (s < e && (c = *s++)) + *t++ = c; + *t = 0; + + /* + * verify the dir prefix + */ + + t = 0; + s = path; + while (*s) + if (*s++ == '/') + t = s; + if (t) + { + *--t = 0; + if (!list && access(path, 0)) + { + s = path; + do + { + if (!(c = *s) || c == '/') + { + *s = 0; + if (access(path, 0) && mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) + { + fprintf(stderr, "%s: %s: cannot create directory\n", state.id, path); + EXIT(1); + } + *s = c; + } + } while (*s++); + } + if (*(t + 1)) + *t = '/'; + else + header.typeflag = DIRTYPE; + } + + /* + * check for non-local paths + */ + + if (local && (path[0] == '/' || path[0] == '.' && path[1] == '.' && (!path[2] || path[2] == '/'))) + { + fprintf(stderr, "%s: %s: non-local path rejected", state.id, path); + if ((header.typeflag == REGTYPE || header.typeflag == AREGTYPE) && (n = number(header.size))) + while (n > 0) + { + if (!block(stdin, gz, buf)) + { + fprintf(stderr, "%s: unexpected EOF\n", state.id); + EXIT(1); + } + if (n <= sizeof(header)) + break; + n -= sizeof(header); + } + continue; + } + + /* + * create and grab the data + */ + + n = number(header.mode); + mode = 0; + if (n & TUREAD) + mode |= S_IRUSR; + if (n & TUWRITE) + mode |= S_IWUSR; + if (n & TUEXEC) + mode |= S_IXUSR; + if (n & TGREAD) + mode |= S_IRGRP; + if (n & TGWRITE) + mode |= S_IWGRP; + if (n & TGEXEC) + mode |= S_IXGRP; + if (n & TOREAD) + mode |= S_IROTH; + if (n & TOWRITE) + mode |= S_IWOTH; + if (n & TOEXEC) + mode |= S_IXOTH; + if (list || meter) + { + if (meter) + { + int i; + int j; + int k; + int n; + int p; + char bar[METER_parts + 1]; + + for (s = path; *s; s++) + if (s[0] == ' ' && s[1] == '-' && s[2] == '-' && s[3] == ' ') + break; + if (*s) + { + if (clear) + { + fprintf(stderr, "%*s", clear, "\r"); + clear = 0; + } + fprintf(stderr, "\n%s\n\n", path); + } + else + { + n = (int)strlen(s = path); + p = (state.blocks * 100) / total; + if (n > (METER_width - METER_parts - 1)) + { + s += n - (METER_width - METER_parts - 1); + n = METER_width - METER_parts - 1; + } + j = n + METER_parts + 2; + if (!clear) + clear = j + 5; + if ((k = clear - j - 5) < 0) + k = 0; + if ((i = (p / (100 / METER_parts))) >= sizeof(bar)) + i = sizeof(bar) - 1; + n = 0; + while (n < i) + bar[n++] = '*'; + while (n < sizeof(bar) - 1) + bar[n++] = ' '; + bar[n] = 0; + clear = fprintf(stderr, "%02d%% |%s| %s%*s", p, bar, s, k, "\r"); + } + } + else + { + if (verbose) + { + switch (header.typeflag) + { + case REGTYPE: + case AREGTYPE: + c = '-'; + break; + case DIRTYPE: + c = 'd'; + break; + case LNKTYPE: + c = 'h'; + break; + case SYMTYPE: + c = 'l'; + break; + default: + c = '?'; + break; + } + printf("%c", c); + m = 0400; + while (m) + { + printf("%c", (n & m) ? 'r' : '-'); + m >>= 1; + printf("%c", (n & m) ? 'w' : '-'); + m >>= 1; + printf("%c", (n & m) ? 'x' : '-'); + m >>= 1; + } + printf(" %10lu ", number(header.size)); + } + switch (header.typeflag) + { + case LNKTYPE: + printf("%s == %s\n", path, header.linkname); + break; + case SYMTYPE: + printf("%s => %s\n", path, header.linkname); + break; + default: + printf("%s\n", path); + break; + } + } + if (list) + { + if (skip(stdin, gz, buf, number(header.size))) + EXIT(1); + continue; + } + } + else if (verbose) + printf("%s\n", path); + switch (header.typeflag) + { + case REGTYPE: + case AREGTYPE: + while (!(fp = fopen(path, FOPEN_WRITE))) + if (unlink(path)) + { + fprintf(stderr, "%s: warning: %s: cannot create file\n", state.id, path); + break; + } + n = number(header.size); + c = a2x ? 0 : -1; + while (n > 0) + { + if (!block(stdin, gz, buf)) + { + fprintf(stderr, "%s: unexpected EOF\n", state.id); + EXIT(1); + } + switch (c) + { + case 0: + if ((m = n) < 4) + { + for (e = (s = buf) + m; s < e; s++) + if (a2x[*(unsigned char*)s] != '\n') + break; + } + else + { + if (m > 256) + m = 256; + for (e = (s = buf) + m; s < e; s++) + if (!ascii_text[*(unsigned char*)s]) + break; + } + if (s < e) + { + c = -1; + break; + } + c = 1; + /*FALLTHROUGH*/ + case 1: + for (e = (s = buf) + sizeof(header); s < e; s++) + *s = a2x[*(unsigned char*)s]; + break; + } + if (fp && fwrite(buf, n > sizeof(header) ? sizeof(header) : n, 1, fp) != 1) + { + fprintf(stderr, "%s: %s: write error\n", state.id, path); + EXIT(1); + } + if (n <= sizeof(header)) + break; + n -= sizeof(header); + } + if (fp && fclose(fp)) + { + fprintf(stderr, "%s: %s: write error\n", state.id, path); + EXIT(1); + } + break; + case DIRTYPE: + if (access(path, 0) && mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) + { + fprintf(stderr, "%s: %s: cannot create directory\n", state.id, path); + EXIT(1); + } + break; + case SYMTYPE: +#if defined(S_IFLNK) || defined(S_ISLNK) + while (symlink(header.linkname, path)) + if (unlink(path)) + { + fprintf(stderr, "%s: %s: cannot symlink to %s\n", state.id, path, header.linkname); + EXIT(1); + } + continue; +#endif +#if !_WIN32 || _WINIX + case LNKTYPE: + while (link(header.linkname, path)) + if (unlink(path)) + { + fprintf(stderr, "%s: %s: cannot link to %s\n", state.id, path, header.linkname); + EXIT(1); + } + continue; +#endif + default: + fprintf(stderr, "%s: %s: file type %c ignored\n", state.id, path, header.typeflag); + if (skip(stdin, gz, buf, number(header.size))) + EXIT(1); + continue; + } + if (chmod(path, mode)) + fprintf(stderr, "%s: %s: cannot change mode to %03o\n", state.id, path, mode); + } + if (clear) + fprintf(stderr, "%*s", clear, "\r"); + if (!state.files) + fprintf(stderr, "%s: warning: empty archive\n", state.id); + else if (verbose) + fprintf(stderr, "%lu file%s, %lu block%s\n", state.files, state.files == 1 ? "" : "s", state.blocks, state.blocks == 1 ? "" : "s"); +#if defined(_SEAR_EXEC) +#if !defined(_SEAR_ARGS) +#define _SEAR_ARGS 0 +#endif + if (install && sear_exec(_SEAR_EXEC, argv, _SEAR_ARGS, install)) + { + Sleep(2 * 1000); + return 1; + } +#endif + return 0; +} + +#endif /* _RATZ_C */ diff --git a/src/cmd/INIT/regress.sh b/src/cmd/INIT/regress.sh new file mode 100644 index 000000000..8b3106523 --- /dev/null +++ b/src/cmd/INIT/regress.sh @@ -0,0 +1,1463 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: regress - run regression tests in command.tst + +command=regress +case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in +0123) USAGE=$' +[-? +@(#)$Id: regress (AT&T Research) 2012-02-02 $ +] +'$USAGE_LICENSE$' +[+NAME?regress - run regression tests] +[+DESCRIPTION?\bregress\b runs the tests in \aunit\a, or + \aunit\a\b.tst\b if \aunit\a does not exist. If \acommand\a is omitted + then it is assumed to be the base name of \aunit\a. All testing is done + in the temporary directory \aunit\a\b.tmp\b.] +[+?Default test output lists the \anumber\a and \adescription\a for + each active \bTEST\b group and the \anumber\a:\aline\a for each + individual \bEXEC\b test. Each test that fails results in a diagnostic + that contains the word \bFAILED\b; no other diagnostics contain this + word.] +[b:ignore-space?Ignore space differences when comparing expected + output.] +[i:pipe-input?Repeat each test with the standard input redirected through a + pipe.] +[k:keep?Enable \bcore\b dumps, exit after the first test that fails, + and do not remove the temporary directory \aunit\a\b.tmp\b.] +[l:local-fs?Force \aunit\a\b.tmp\b to be in a local filesystem.] +[o:pipe-output?Repeat each test with the standard output redirected through + a pipe.] +[p:pipe-io?Repeat each test with the standard input and standard output + redirected through pipes.] +[q:quiet?Output information on \bFAILED\b tests only.] +[r!:regular?Run each test with the standard input and standard output + redirected through regular files.] +[t:test?Run only tests matching \apattern\a. Tests are numbered and + consist of at least two digits (0 filled if necessary.) Tests matching + \b+(0)\b are always run.]:[pattern] +[x:trace?Enable debug tracing.] +[v:verbose?List differences between actual (<) and expected (>) output, + errors and exit codes. Also disable long output line truncation.] + +unit [ command [ arg ... ] ] + +[+INPUT FILES?The regression test file \aunit\a\b.tst\b is a \bksh\b(1) + script that is executed in an environment with the following functions + defined:] + { + [+BODY \b{ ... }?Defines the test body; used for complex tests.] + [+CD \b\adirectory\a?Create and change to working directory for + one test.] + [+CLEANUP \b\astatus\a?Called at exit time to remove the + temporary directory \aunit\a\b.tmp\b, list the tests totals via + \bTALLY\b, and exit with status \astatus\a.] + [+COMMAND \b\aarg\a ...?Runs the current command under test with + \aarg\a ... appended to the default args.] + [+CONTINUE?The background job must be running.] + [+COPY \b\afrom to\a?Copy file \afrom\a to \ato\a. \afrom\a may + be a regular file or \bINPUT\b, \bOUTPUT\b or \bERROR\b. Post + test comparisons are still done for \afrom\a.] + [+DIAGNOSTICS \b[ \b1\b | \b0\b | \apattern\a ]]?No argument or an + argument of \b1\b declares that diagnostics are to expected for + the remainder of the current \bTEST\b; \b0\b reverts to the default + state that diagnostics are not expected; otherwise the argument + is a \bksh\b(1) pattern that must match the non-empty contents + of the standard error.] + [+DO \b\astatement\a?Defines additional statements to be executed + for the current test. \astatement\a may be a { ... } group.] + [+EMPTY \bINPUT|OUTPUT|ERROR|SAME?The corresponding file is + expected to be empty.] + [+ERROR \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The + standard error is expected to match either the contents + of \afile\a or the line \adata\a. \bERROR -n\b does not + append a newline to \adata\a. \afilter\a is a shell command + or pipeline that reads standard input and writes standard + output that is applied to ERROR before comparison with the + expected contents.] + [+EXEC \b[ \aarg\a ... ]]?Runs the command under test with + optional arguments. \bINPUT\b, \bOUTPUT\b, \bERROR\b, \bEXIT\b + and \bSAME\b calls following this \bEXEC\b up until the next + \bEXEC\b or the end of the script provide details for the + expected results. If no arguments are specified then the + arguments from the previous \bEXEC\b in the current \bTEST\b + group are used, or no arguments if this is the first \bEXEC\b + in the group.] + [+EXIT \b\astatus\a?The command exit status is expected to match + the pattern \astatus\a.] + [+EXITED?The background job must have exited.] + [+EXPORT \b[-]] \aname\a=\avalue\a ...?Export environment + variables for one test.] + [+FATAL \b\amessage\a ...?\amessage\a is printed on the standard + error and \bregress\b exits with status \b1\b.] + [+FIFO \bINPUT|OUTPUT|ERROR\b [ \b-n\b ]] \afile\a | - \adata\a ...?The + \bIO\B file is a fifo.] + [+IF \b\acommand\a [\anote\a]]?If the \bsh\b(1) \acommand\a exits + 0 then tests until the next \bELIF\b, \bELSE\b or \bFI\b are + enabled. Otherwise those tests are skipped. \bIF\b ... \bFI\b + may be nested, but must not cross \bTEST\b boundaries. \anote\a + is listed on the standard error if the corresponding test block + is enabled; \bIF\b, \bELIF\b, \bELSE\b may nave a \anote\a + operand.] + [+IGNORE \b\afile\a ...?\afile\a is ignored for subsequent result + comparisons. \afile\a may be \bOUTPUT\b or \bERROR\b.] + [+IGNORESPACE?Ignore space differences when comparing expected + output.] + [+INCLUDE \b\afile\a ...?One or more \afile\a operands are read + via the \bksh\b(1) \b.\b(1) command. \bVIEW\b is used to locate + the files.] + [+INFO \b\adescription\a?\adescription\a is printed on the + standard error.] + [+INITIALIZE?Called by \bregress\b to initialize a each + \bTEST\b group.] + [+INPUT \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The + standard input is set to either the contents of \afile\a + or the line \adata\a. \bINPUT -n\b does not append a newline + to \adata\a. \afilter\a is a shell command or pipeline that + reads standard input and writes standard output that is + applied to OUTPUT before comparison with the expected contents.] + [+INTRO?Called by \bregress\b to introduce all \bTEST\b + groups.] + [+IO \b[ \bFIFO\b | \bPIPE\b ]] \bINPUT|OUTPUT|ERROR\b [ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?Internal + support for the \bINPUT\b, \bOUTPUT\b and \bERROR\b functions.] + [+JOB \b\aop\a [ ... ]]?Like \bEXEC\b except the command is run + as a background job for the duration of the group or until it + is killed via \bKILL\b.] + [+KEEP \b\apattern\a ...?The temporary directory is cleared for + each test. Files matching \apattern\a are retained between + tests.] + [+KILL \b[ \asignal\a ]]?Kill the background job with \asignal\a + [ \bSIGKILL\b ]].] + [+MOVE \b\afrom to\a?Rename file \afrom\a to \ato\a. \afrom\a may + be a regular file or \bINPUT\b, \bOUTPUT\b or \bERROR\b. Post + test comparisons are ignored for \afrom\a.] + [+NOTE \b\acomment\a?\acomment\a is added to the current test + trace output.] + [+OUTPUT \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The + standard output is expected to match either the contents + of \afile\a or the line \adata\a. \bOUTPUT -n\b does not + append a newline to \adata\a. \afilter\a is a shell command + or pipeline that reads standard input and writes standard + output that is applied to ERROR before comparison with the + expected contents.] + [+PIPE \bINPUT|OUTPUT|ERROR\b [ \b-n\b ]] \afile\a | - \adata\a ...?The + \bIO\B file is a pipe.] + [+PROG \b\acommand\a [ \aarg\a ... ]]?\acommand\a is run with + optional arguments.] + [+REMOVE \b\afile\a ...?\afile\a ... are removed after the + current test is done.] + [+RUN?Called by \bregress\b to run the current test.] + [+SAME \b\anew old\a?\anew\a is expected to be the same as + \aold\a after the current test completes.] + [+SET \b[\bno\b]]\aname\a[=\avalue\a]]?Set the command line + option --\aname\a. The setting is in effect for all tests until + the next explicit \bSET\b.] + [+TALLY?Called by \bregress\b display the \bTEST\b results.] + [+TEST \b\anumber\a [ \adescription\a ... ]]?Define a new test + group labelled \anumber\a with optional \adescripion\a.] + [+TITLE \b[+]] \atext\a?Set the \bTEST\b output title to + \atext\a. If \b+\b is specified then \atext\a is appended to + the default title. The default title is the test file base + name, and, if different from the test file base name, the test + unit base name.] + [+TWD \b[ \adir\a ... ]]?Set the temporary test dir to \adir\a. + The default is \aunit\a\b.tmp\b, where \aunit\a is the test + input file sans directory and suffix. If \adir\a matches \b/*\b + then it is the directory name; if \adir\a is non-null then the + prefix \b${TMPDIR:-/tmp}\b is added; otherwise if \adir\a is + omitted then + \b${TMPDIR:-/tmp}/tst-\b\aunit\a-$$-$RANDOM.\b\aunit\a is + used.] + [+UMASK \b[ \amask\a ]]?Run subsequent tests with \bumask\b(1) + \amask\a. If \amask\a is omitted then the original \bumask\b is + used.] + [+UNIT \b\acommand\a [ \aarg\a ... ]]?Define the command and + optional default arguments to be tested. \bUNIT\b explicitly + overrides the default command name derived from the test script + file name. A \acommand\a operand with optional arguments + overrides the \bUNIT\b \acommand\a and arguments, with the + exception that if the \bUNIT\b \acommand\a is \b-\b or \b+\b + the \bUNIT\b arguments are appended to the operand or default + unit command and arguments.] + [+VIEW \b\avar\a [ \afile\a ]]?\avar\a is set to the full + pathname of \avar\a [ \afile\a ]] in the current \b$VPATH\b + view if defined.] + } +[+SEE ALSO?\bnmake\b(1), \bksh\b(1)] +' + ;; +*) USAGE='ko:[[no]name[=value]]t:[test]v unit [path [arg ...]]' + ;; +esac + +function FATAL # message +{ + print -r -u2 "$command: $*" + GROUP=FINI + exit 1 +} + +function EMPTY +{ + typeset i + typeset -n ARRAY=$1 + for i in ${!ARRAY[@]} + do unset ARRAY[$i] + done +} + +function INITIALIZE # void +{ + typeset i j + cd "$TWD" + case $KEEP in + "") RM * + ;; + *) for i in * + do case $i in + !($KEEP)) j="$j $i" ;; + esac + done + case $j in + ?*) RM $j ;; + esac + ;; + esac + : >INPUT >OUTPUT.ex >ERROR.ex + BODY="" + COPY="" + DIAGNOSTICS="" + DONE="" + ERROR="" + EXIT=0 + IGNORE="" + INIT="" + INPUT="" + MOVE="" + OUTPUT="" + EMPTY FILE + EMPTY FILTER + EMPTY SAME + EMPTY TYPE +} + +function INTRO +{ + typeset base command + + if [[ ! $TEST_quiet ]] + then base=${REGRESS##*/} + base=${base%.tst} + command=${COMMAND##*/} + command=${command%' '*} + set -- $TITLE + TITLE= + case $1 in + ''|+) if [[ $command == $base ]] + then TITLE=$COMMAND + else TITLE="$COMMAND, $base" + fi + if (( $# )) + then shift + fi + ;; + esac + while (( $# )) + do if [[ $TITLE ]] + then TITLE="$TITLE, $1" + else TITLE="$1" + fi + shift + done + print -u2 "TEST $TITLE" + fi +} + +function TALLY # extra message text +{ + typeset msg + case $GROUP in + INIT) ;; + *) msg="TEST $TITLE, $TESTS test" + case $TESTS in + 1) ;; + *) msg=${msg}s ;; + esac + msg="$msg, $ERRORS error" + case $ERRORS in + 1) ;; + *) msg=${msg}s ;; + esac + if (( $# )) + then msg="$msg, $*" + fi + print -u2 "$msg" + GROUP=INIT + TESTS=0 + ERRORS=0 + ;; + esac +} + +function TITLE # text +{ + TITLE=$@ +} + +function UNWIND +{ + while (( COND > 1 )) + do print -r -u2 "$command: line $LINE: no matching FI for IF on line ${COND_LINE[COND]}" + (( COND-- )) + done + if (( COND > 0 )) + then (( COND = 0 )) + FATAL "line $LINE: no matching FI for IF on line ${COND_LINE[COND+1]}" + fi + if [[ $JOBPID ]] + then if [[ $JOBPID != 0 ]] + then kill -KILL $JOBPID 2>/dev/null + wait + fi + JOBPID= + fi + JOBSTATUS= + JOBOP= + wait +} + +function CLEANUP # status +{ + typeset note + + if [[ $GROUP != INIT ]] + then if [[ ! $TEST_keep ]] + then cd $SOURCE + if [[ $TEST_local ]] + then RM ${TEST_local} + fi + RM "$TWD" + fi + if (( $1 )) && [[ $GROUP != FINI ]] + then note=terminated + fi + fi + TALLY $note + [[ $TEST_keep ]] || UNWIND + exit $1 +} + +function RUN # [ op ] +{ + typeset i r=1 + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG +#print -u2 AHA#$LINENO $0 GROUP=$GROUP ITEM=$ITEM FLUSHED=$FLUSHED JOBOP=$JOBOP + case $GROUP in + INIT) RM "$TWD" + if [[ $TEST_local ]] + then TEST_local=${TMPDIR:-/tmp}/rt-$$/${TWD##*/} + mkdir -p "$TEST_local" && ln -s "$TEST_local" "$TWD" || FATAL "$TWD": cannot create directory + TEST_local=${TEST_local%/*} + else mkdir "$TWD" || FATAL "$TWD": cannot create directory + fi + cd "$TWD" + TWD=$PWD + : > rmu + if rm -u rmu >/dev/null 2>&1 + then TEST_rmu=-u + else rm rmu + fi + if [[ $UNIT ]] + then set -- "${ARGV[@]}" + case $1 in + ""|[-+]*) + UNIT $UNIT "${ARGV[@]}" + ;; + *) UNIT "${ARGV[@]}" + ;; + esac + fi + INTRO + ;; + FINI) ;; + $TEST_select) + if [[ $ITEM == $FLUSHED ]] + then return 0 + fi + FLUSHED=$ITEM + if (( COND_SKIP[COND] )) + then return 1 + fi + ((COUNT++)) + if (( $ITEM <= $LASTITEM )) + then LABEL=$TEST#$COUNT + else LASTITEM=$ITEM + LABEL=$TEST:$ITEM + fi + TEST_file="" + exec >/dev/null + for i in $INPUT + do case " $OUTPUT " in + *" $i "*) + if [[ -f $i.sav ]] + then cp $i.sav $i + COMPARE="$COMPARE $i" + elif [[ -f $i ]] + then cp $i $i.sav + COMPARE="$COMPARE $i" + fi + ;; + esac + done + for i in $OUTPUT + do case " $COMPARE " in + *" $i "*) + ;; + *) COMPARE="$COMPARE $i" + ;; + esac + done + for i in $INIT + do $i $TEST INIT + done +#print -u2 AHA#$LINENO $0 GROUP=$GROUP ITEM=$ITEM JOBOP=$JOBOP JOBPID=$JOBPID JOBSTATUS=$JOBSTATUS + if [[ $JOBPID != 0 && ( $JOBPID || $JOBSTATUS ) ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + RESULTS + elif [[ $BODY ]] + then SHOW=$NOTE + if [[ ! $TEST_quiet ]] + then print -r -u2 " $SHOW" + fi + for i in $BODY + do $i $TEST BODY + done + else SHOW= + if [[ ${TYPE[INPUT]} == PIPE ]] + then if [[ ${TYPE[OUTPUT]} == PIPE ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + cat <$TWD/INPUT | COMMAND "${ARGS[@]}" | cat >$TWD/OUTPUT + RESULTS 'pipe input' + else if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + cat <$TWD/INPUT | COMMAND "${ARGS[@]}" >$TWD/OUTPUT + RESULTS 'pipe io' + fi + elif [[ ${TYPE[OUTPUT]} == PIPE ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + COMMAND "${ARGS[@]}" <$TWD/INPUT | cat >$TWD/OUTPUT + RESULTS 'pipe output' + else if [[ $TEST_regular ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + if [[ ${TYPE[INPUT]} == FIFO ]] + then COMMAND "${ARGS[@]}" >$TWD/OUTPUT + else COMMAND "${ARGS[@]}" <$TWD/INPUT >$TWD/OUTPUT + fi + RESULTS + fi + if [[ $TEST_pipe_input ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + (trap '' PIPE; cat <$TWD/INPUT 2>/dev/null; exit 0) | COMMAND "${ARGS[@]}" >$TWD/OUTPUT + STATUS=$? + RESULTS 'pipe input' + fi + if [[ $TEST_pipe_output ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + COMMAND "${ARGS[@]}" <$TWD/INPUT | cat >$TWD/OUTPUT + STATUS=$? + RESULTS 'pipe output' + fi + if [[ $TEST_pipe_io ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + (trap '' PIPE; cat <$TWD/INPUT 2>/dev/null; exit 0) | COMMAND "${ARGS[@]}" | cat >$TWD/OUTPUT + STATUS=$? + RESULTS 'pipe io' + fi + fi + set -- $COPY + COPY="" + while : + do case $# in + 0|1) break ;; + *) cp $1 $2 ;; + esac + shift 2 + done + set -- $MOVE + MOVE="" + while (( $# > 1 )) + do mv $1 $2 + shift 2 + done + fi + for i in $DONE + do $i $TEST DONE $STATUS + done + COMPARE="" + r=0 + ;; + esac + if [[ $COMMAND_ORIG ]] + then COMMAND=$COMMAND_ORIG + COMMAND_ORIG= + ARGS=(${ARGS_ORIG[@]}) + fi + return $r +} + +function DO # cmd ... +{ + [[ $GROUP == $TEST_select ]] || return 1 + (( COND_SKIP[COND] )) && return 1 + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK + return 0 +} + +function UNIT # cmd arg ... +{ + typeset cmd=$1 + case $cmd in + [-+]) shift + if (( UNIT_READONLY )) + then COMMAND="$COMMAND $*" + else #BUG# ARGV=("${ARGV[@]}" "$@") + set -- "${ARGV[@]}" "$@" + ARGV=("$@") + fi + return + ;; + esac + (( UNIT_READONLY )) && return + if [[ $UNIT ]] && (( $# <= 1 )) + then set -- "${ARGV[@]}" + case $1 in + "") set -- "$cmd" ;; + [-+]*) set -- "$cmd" "${ARGV[@]}" ;; + *) cmd=$1 ;; + esac + fi + UNIT= + COMMAND=$cmd + shift + typeset cmd=$(whence $COMMAND) + if [[ ! $cmd ]] + then FATAL $COMMAND: not found + elif [[ ! $cmd ]] + then FATAL $cmd: not found + fi + case $# in + 0) ;; + *) COMMAND="$COMMAND $*" ;; + esac +} + +function TWD # [ dir ] +{ + case $1 in + '') TWD=${TWD##*/}; TWD=${TMPDIR:-/tmp}/tst-${TWD%.*}-$$-$RANDOM ;; + /*) TWD=$1 ;; + *) TWD=${TMPDIR:-/tmp}/$1 ;; + esac +} + +function TEST # number description arg ... +{ + RUN + LINE=$TESTLINE + UNWIND + COUNT=0 + LASTITEM=0 + case $1 in + -) ((LAST++)); TEST=$LAST ;; + +([0123456789])) LAST=$1 TEST=$1 ;; + *) LAST=0${1/[!0123456789]/} TEST=$1 ;; + esac + NOTE= + if [[ ! $TEST_quiet && $TEST == $TEST_select ]] && (( ! COND_SKIP[COND] )) + then print -r -u2 "$TEST $2" + fi + unset ARGS + unset EXPORT + EXPORTS=0 + TEST_file="" + if [[ $TEST != ${GROUP}* ]] + then GROUP=${TEST%%+([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ])} + if [[ $GROUP == $TEST_select ]] && (( ! COND_SKIP[COND] )) + then INITIALIZE + fi + fi + ((SUBTESTS=0)) + [[ $TEST == $TEST_select ]] && (( ! COND_SKIP[COND] )) +} + +function EXEC # arg ... +{ + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + if ((SUBTESTS++)) + then RUN + fi + case $# in + 0) set -- "${ARGS[@]}" ;; + esac + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $COMMAND_ORIG "$@")${JOBPID:+&}" + ARGS=("$@") +} + +function JOB # arg ... +{ + JOBPID=0 + EXEC "$@" +} + +function CONTINUE +{ + RUN || return + JOBOP=CONTINUE + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $JOBOP)" +#print -u2 AHA#$LINENO JOBOP=$JOBOP ITEM=$ITEM NOTE=$NOTE +} + +function EXITED +{ + RUN || return + JOBOP=EXITED + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $JOBOP)" +#print -u2 AHA#$LINENO JOBOP=$JOBOP ITEM=$ITEM NOTE=$NOTE +} + +function KILL # [ signal ] +{ + RUN || return + JOBOP=$2 + [[ $JOBOP ]] || JOBOP=KILL + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $JOBOP)" +} + +function CD +{ + RUN + if [[ $GROUP == $TEST_select ]] && (( ! COND_SKIP[COND] )) + then mkdir -p "$@" && cd "$@" || FATAL cannot initialize working directory "$@" + fi +} + +function EXPORT +{ + typeset x n v + if [[ $GROUP == INIT ]] + then for x + do n=${x%%=*} + v=${x#*=} + ENVIRON[ENVIRONS++]=$n="'$v'" + done + else RUN + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + for x + do n=${x%%=*} + v=${x#*=} + EXPORT[EXPORTS++]=$n="'$v'" + done + fi +} + +function FLUSH +{ + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + if ((SUBTESTS++)) + then RUN + fi +} + +function PROG # cmd arg ... +{ + typeset command args + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- "$@")" + COMMAND_ORIG=$COMMAND + COMMAND=$1 + shift + ARGS_ORIG=(${ARGS[@]}) + ARGS=("$@") +} + +function NOTE # description +{ + NOTE=$* +} + +function IO # [ PIPE ] INPUT|OUTPUT|ERROR [-f*|-n] file|- data ... +{ + typeset op i v f file type x + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG + while : + do case $1 in + FIFO|PIPE) type=$1; shift ;; + *) break ;; + esac + done + op=$1 + shift + [[ $type ]] && TYPE[$op]=$type + FILTER[$op]= + file=$TWD/$op + while : + do case $1 in + -x) x=1 + shift + ;; + -e) (( $# > 1 )) && shift + FILTER[$op]=$1 + shift + ;; + -e*) FILTER[$op]=${1#-e} + shift + ;; + -f*|-n) f=$1 + shift + ;; + *) break + ;; + esac + done + case $# in + 0) ;; + *) case $1 in + -) ;; + *) file=$1 + eval i='$'$op + case " $i " in + *" $file "*) + ;; + *) eval $op='"$'$op' $file"' + ;; + esac + ;; + esac + shift + ;; + esac + case " $IGNORE " in + *" $file "*) + for i in $IGNORE + do case $i in + $file) ;; + *) v="$v $i" ;; + esac + done + IGNORE=$v + ;; + esac + FILE[$op]=$file + case $op in + OUTPUT|ERROR) + file=$file.ex + if [[ $file != /* ]] + then file=$TWD/$file + fi + ;; + esac + #unset SAME[$op] + SAME[$op]= + if [[ $file == /* ]] + then RM $file.sav + else RM $TWD/$file.sav + fi + if [[ $file == */* ]] + then mkdir -p ${file%/*} + fi + if [[ $file != */ ]] + then if [[ $type == FIFO ]] + then rm -f $file + mkfifo $file + fi + if [[ ${TYPE[$op]} != FIFO ]] + then if [[ $JOBOP ]] + then case $#:$f in + 0:) ;; + *:-f) printf -- "$@" ;; + *:-f*) printf -- "${f#-f}""$@" ;; + *) print $f -r -- "$@" ;; + esac >> $file + else case $#:$f in + 0:) ;; + *:-f) printf -- "$@" ;; + *:-f*) printf -- "${f#-f}""$@" ;; + *) print $f -r -- "$@" ;; + esac > $file + fi + elif [[ $#:$f != 0: ]] + then case $#:$f in + *:-f) printf -- "$@" ;; + *:-f*) printf -- "${f#-f}""$@" ;; + *) print $f -r -- "$@" ;; + esac >> $file & + fi + if [[ $x ]] + then chmod +x $file + fi + fi +} + +function INPUT # file|- data ... +{ + IO $0 "$@" +} + +function COPY # from to +{ + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + COPY="$COPY $@" +} + +function MOVE # from to +{ + typeset f + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + for f + do case $f in + INPUT|OUTPUT|ERROR) + f=$TWD/$f + ;; + /*) ;; + *) f=$PWD/$f + ;; + esac + MOVE="$MOVE $f" + done +} + +function SAME # new old +{ + typeset i file v + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + case $# in + 2) case $1 in + INPUT) cat $2 > $1; return ;; + esac + SAME[$1]=$2 + file=$1 + COMPARE="$COMPARE $1" + ;; + 3) SAME[$2]=$3 + file=$2 + eval i='$'$1 + case " $i " in + *" $2 "*) + ;; + *) eval $1='"$'$1' $2"' + ;; + esac + COMPARE="$COMPARE $2" + ;; + esac + case " $IGNORE " in + *" $file "*) + for i in $IGNORE + do case $i in + $file) ;; + *) v="$v $i" ;; + esac + done + IGNORE=$v + ;; + esac +} + +function OUTPUT # file|- data ... +{ + IO $0 "$@" +} + +function ERROR # file|- data ... +{ + IO $0 "$@" +} + +function RM # rm(1) args +{ + if [[ ! $TEST_rmu ]] + then chmod -R u+rwx "$@" >/dev/null 2>&1 + fi + rm $TEST_rmu $TEST_rmflags "$@" +} + +function REMOVE # file ... +{ + typeset i + for i + do RM $i $i.sav + done +} + +function IGNORE # file ... +{ + typeset i + for i + do case $i in + INPUT|OUTPUT|ERROR) + i=$TWD/$i + ;; + esac + case " $IGNORE " in + *" $i "*) + ;; + *) IGNORE="$IGNORE $i" + ;; + esac + done +} + +function KEEP # pattern ... +{ + typeset i + for i + do case $KEEP in + "") KEEP="$i" ;; + *) KEEP="$KEEP|$i" ;; + esac + done +} + +function DIAGNOSTICS # [ 1 | 0 ] +{ + case $#:$1 in + 0:|1:1) DIAGNOSTICS=1 + EXIT='*' + ;; + 1:|1:0) DIAGNOSTICS="" + EXIT=0 + ;; + *) DIAGNOSTICS=$1 + EXIT='*' + ;; + esac +} + +function IGNORESPACE +{ + : ${IGNORESPACE=-b} +} + +function EXIT # status +{ + EXIT=$1 +} + +function INFO # info description +{ + typeset -R15 info=$1 + if [[ ! $1 ]] + then info=no + fi + shift + if [[ ! $TEST_quiet ]] + then print -r -u2 "$info " "$@" + fi +} + +function COMMAND # arg ... +{ + typeset input + ((TESTS++)) + case " ${ENVIRON[*]} ${EXPORT[*]}" in + *' 'LC_ALL=*) + ;; + *' 'LC_+([A-Z])=*) + EXPORT[EXPORTS++]="LC_ALL=" + ;; + esac + if [[ $TEST_keep ]] + then ( + PS4='' + set -x + print -r -- "${ENVIRON[@]}" "${EXPORT[@]}" "PATH=$PATH" $COMMAND "$@" + ) 2>&1 >/dev/null | + sed -e 's,^print -r -- ,,' -e 's,$, "$@",' >$TWD/COMMAND + chmod +x $TWD/COMMAND + fi + if [[ $UMASK != $UMASK_ORIG ]] + then : >$TWD/ERROR + umask $UMASK + fi + if [[ ${TYPE[INPUT]} == FIFO && ${FILE[INPUT]} == */INPUT ]] + then input="< ${FILE[INPUT]}" + fi + if [[ $TEST_trace ]] + then set +x + eval print -u2 "$PS4" "${ENVIRON[@]}" "${EXPORT[@]}" PATH='$PATH' '$'COMMAND '"$@"' '$input' '"2>$TWD/ERROR"' '"${JOBPID:+&}"' + fi + eval "${ENVIRON[@]}" "${EXPORT[@]}" PATH='$PATH' '$'COMMAND '"$@"' $input "2>$TWD/ERROR" "${JOBPID:+&}" + STATUS=$? + [[ $TEST_trace ]] && set -x + if [[ $JOBPID ]] + then JOBPID=$! + fi + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG + return $STATUS +} + +function RESULTS # pipe* +{ + typeset i j k s failed ignore io op + if [[ $1 ]] + then io="$1 " + fi + [[ $JOBOP || $JOBPID || $JOBSTATUS ]] && sleep 1 + for i in $COMPARE $TWD/OUTPUT $TWD/ERROR + do case " $IGNORE $ignore $MOVE " in + *" $i "*) continue ;; + esac + ignore="$ignore $i" + op=${i##*/} + if [[ ${FILTER[$op]} ]] + then eval "{ ${FILTER[$op]} ;} < $i > $i.fi" + mv $i.fi $i + fi + j=${SAME[$op]} + if [[ ! $j ]] + then if [[ $i == /* ]] + then k=$i + else k=$TWD/$i + fi + for s in ex sav err + do [[ -f $k.$s ]] && break + done + j=$k.$s + fi + if [[ "$DIAGNOSTICS" && $i == */ERROR ]] + then if [[ $STATUS == 0 && ! -s $TWD/ERROR || $DIAGNOSTICS != 1 && $(<$i) != $DIAGNOSTICS ]] + then failed=$failed${failed:+,}DIAGNOSTICS + if [[ $TEST_verbose && $DIAGNOSTICS != 1 ]] + then print -u2 " ===" "diagnostic pattern '$DIAGNOSTICS' did not match" ${i#$TWD/} "===" + cat $i >&2 + fi + fi + continue + fi + diff $IGNORESPACE $i $j >$i.diff 2>&1 + if [[ -s $i.diff ]] + then failed=$failed${failed:+,}${i#$TWD/} + if [[ $TEST_verbose ]] + then print -u2 " ===" diff $IGNORESPACE ${i#$TWD/} "expected ===" + cat $i.diff >&2 + fi + fi + done + if [[ $JOBOP ]] + then if [[ $JOBPID ]] && ! kill -0 $JOBPID 2>/dev/null + then wait $JOBPID + JOBSTATUS=$? + JOBPID= + fi +#print -u2 AHA#$LINENO JOBOP=$JOBOP JOBPID=$JOBPID JOBSTATUS=$JOBSTATUS + case $JOBOP in + CONTINUE) + if [[ ! $JOBPID ]] + then failed=$failed${failed:+,}EXITED + fi + ;; + EXITED) if [[ $JOBPID ]] + then failed=$failed${failed:+,}RUNNING + fi + ;; + *) if [[ ! $JOBPID ]] + then failed=$failed${failed:+,}EXITED + fi + if ! kill -$JOBOP $JOBPID 2>/dev/null + then failed=$failed${failed:+,}KILL-$JOBOP + fi + ;; + esac + JOBOP= + fi + if [[ ! $failed && $STATUS != $EXIT ]] + then failed="exit code $EXIT expected -- got $STATUS" + fi + if [[ $failed ]] + then ((ERRORS++)) + if [[ ! $TEST_quiet ]] + then SHOW="FAILED ${io}[ $failed ] $NOTE" + print -r -u2 " $SHOW" + fi + if [[ $TEST_keep ]] + then GROUP=FINI + exit + fi + elif [[ ! $TEST_quiet ]] + then SHOW=$NOTE + print -r -u2 " $SHOW" + fi +} + +function SET # [no]name[=value] +{ + typeset i r + if [[ $TEST ]] + then RUN + fi + for i + do if [[ $i == - ]] + then r=1 + elif [[ $i == + ]] + then r= + else if [[ $i == no?* ]] + then i=${i#no} + v= + elif [[ $i == *=* ]] + then v=${i#*=} + if [[ $v == 0 ]] + then v= + fi + i=${i%%=*} + else v=1 + fi + i=${i//-/_} + if [[ $r ]] + then READONLY[$i]=1 + elif [[ ${READONLY[$i]} ]] + then continue + fi + eval TEST_$i=$v + fi + done +} + +function VIEW # var [ file ] +{ + nameref var=$1 + typeset i bwd file pwd view root offset + if [[ $var ]] + then return 0 + fi + case $# in + 1) file=$1 ;; + *) file=$2 ;; + esac + pwd=${TWD%/*} + bwd=${PMP%/*} + if [[ -r $file ]] + then if [[ ! -d $file ]] + then var=$PWD/$file + return 0 + fi + for i in $file/* + do if [[ -r $i ]] + then var=$PWD/$file + return 0 + fi + break + done + fi + for view in ${VIEWS[@]} + do case $view in + /*) ;; + *) view=$pwd/$view ;; + esac + case $offset in + '') case $pwd in + $view/*) offset=${pwd#$view} ;; + *) offset=${bwd#$view} ;; + esac + ;; + esac + if [[ -r $view$offset/$file ]] + then if [[ ! -d $view$offset/$file ]] + then var=$view$offset/$file + return 0 + fi + for i in $view$offset/$file/* + do if [[ -f $i ]] + then var=$view$offset/$file + return 0 + fi + break + done + fi + done + var= + return 1 +} + +function INCLUDE # file ... +{ + typeset f v x + for f + do if VIEW v $f || [[ $PREFIX && $f != /* ]] && VIEW v $PREFIX$f + then x=$x$'\n'". $v" + else FATAL $f: not found + fi + done + [[ $x ]] && trap "$x" 0 +} + +function UMASK # [ mask ] +{ + if (( $# )) + then UMASK=$1 + else UMASK=$UMASK_ORIG + fi +} + +function PIPE # INPUT|OUTPUT|ERROR file|- data ... +{ + IO $0 "$@" +} + +function FIFO # INPUT|OUTPUT|ERROR file|- data ... +{ + IO $0 "$@" +} + +function IF # command(s) [note] +{ + [[ $GROUP == $TEST_select ]] || return + RUN + (( COND++ )) + COND_LINE[COND]=$LINE + if (( COND > 1 && COND_SKIP[COND-1] )) + then (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 1 )) + elif eval "{ $1 ;} >/dev/null 2>&1" + then (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 0 )) + [[ $2 && ! $TEST_quiet ]] && print -u2 "NOTE $2" + else (( COND_KEPT[COND] = 0 )) + (( COND_SKIP[COND] = 1 )) + fi +} + +function ELIF # command(s) [note] +{ + [[ $GROUP == $TEST_select ]] || return + RUN + if (( COND <= 0 )) + then FATAL line $LINE: no matching IF for ELIF + fi + if (( COND_KEPT[COND] )) + then (( COND_SKIP[COND] = 0 )) + elif eval "$* > /dev/null 2>&1" + then (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 0 )) + [[ $2 && ! $TEST_quiet ]] && print -u2 "NOTE $2" + else (( COND_SKIP[COND] = 1 )) + fi +} + +function ELSE # [note] +{ + [[ $GROUP == $TEST_select ]] || return + RUN + if (( COND <= 0 )) + then FATAL line $LINE: no matching IF for ELSE + fi + if (( COND_KEPT[COND] )) + then (( COND_SKIP[COND] = 1 )) + else (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 0 )) + [[ $1 && ! $TEST_quiet ]] && print -u2 "NOTE $1" + fi +} + +function FI +{ + [[ $GROUP == $TEST_select ]] || return + RUN + if (( COND <= 0 )) + then FATAL line $LINE: no matching IF for FI on line $LINE + fi + (( ! COND_KEPT[COND] )) && [[ $1 && ! $TEST_quiet ]] && print -u2 "NOTE $1" + (( COND-- )) +} + +# main + +integer ERRORS=0 ENVIRONS=0 EXPORTS=0 TESTS=0 SUBTESTS=0 LINE=0 TESTLINE=0 +integer ITEM=0 LASTITEM=0 COND=0 UNIT_READONLY=0 COUNT +typeset ARGS COMMAND COPY DIAGNOSTICS ERROR EXEC FLUSHED=0 GROUP=INIT +typeset IGNORE INPUT KEEP OUTPUT TEST SOURCE MOVE NOTE UMASK UMASK_ORIG +typeset ARGS_ORIG COMMAND_ORIG TITLE UNIT ARGV PREFIX OFFSET IGNORESPACE +typeset COMPARE MAIN JOBPID='' JOBSTATUS='' +typeset TEST_file TEST_keep TEST_pipe_input TEST_pipe_io TEST_pipe_output TEST_local +typeset TEST_quiet TEST_regular=1 TEST_rmflags='-rf --' TEST_rmu TEST_select + +typeset -A SAME VIEWS FILE TYPE READONLY FILTER +typeset -a COND_LINE COND_SKIP COND_KEPT ENVIRON EXPORT +typeset -Z LAST=00 + +unset FIGNORE + +while getopts -a $command "$USAGE" OPT +do case $OPT in + b) (( $OPTARG )) && IGNORESPACE=-b + ;; + i) SET - pipe-input=$OPTARG + ;; + k) SET - keep=$OPTARG + ;; + l) SET - local + ;; + o) SET - pipe-output=$OPTARG + ;; + p) SET - pipe-io=$OPTARG + ;; + q) SET - quiet=$OPTARG + ;; + r) SET - regular=$OPTARG + ;; + t) if [[ $TEST_select ]] + then TEST_select="$TEST_select|${OPTARG//,/\|}" + else TEST_select="${OPTARG//,/\|}" + fi + ;; + x) SET - trace=$OPTARG + ;; + v) SET - verbose=$OPTARG + ;; + *) GROUP=FINI + exit 2 + ;; + esac +done +shift $OPTIND-1 +case $# in +0) FATAL test unit name omitted ;; +esac +export COLUMNS=80 +SOURCE=$PWD +PATH=$SOURCE:${PATH#?(.):} +PATH=${PATH%%:?(.)}:/bin:/usr/bin +UNIT=$1 +shift +if [[ -f $UNIT && ! -x $UNIT ]] +then REGRESS=$UNIT +else REGRESS=${UNIT%.tst} + REGRESS=$REGRESS.tst + [[ -f $REGRESS ]] || FATAL $REGRESS: regression tests not found +fi +UNIT=${UNIT##*/} +UNIT=${UNIT%.tst} +MAIN=$UNIT +if [[ $VPATH ]] +then set -A VIEWS ${VPATH//:/' '} + OFFSET=${SOURCE#${VIEWS[0]}} + if [[ $OFFSET ]] + then OFFSET=${OFFSET#/}/ + fi +fi +if [[ $REGRESS == */* ]] +then PREFIX=${REGRESS%/*} + if [[ ${#VIEWS[@]} ]] + then for i in ${VIEWS[@]} + do PREFIX=${PREFIX#$i/} + done + fi + PREFIX=${PREFIX#$OFFSET} + if [[ $PREFIX ]] + then PREFIX=$PREFIX/ + fi +fi +TWD=$PWD/$UNIT.tmp +PMP=$(pwd -P)/$UNIT.tmp +UMASK_ORIG=$(umask) +UMASK=$UMASK_ORIG +ARGV=("$@") +if [[ ${ARGV[0]} && ${ARGV[0]} != [-+]* ]] +then UNIT "${ARGV[@]}" + UNIT_READONLY=1 +fi +trap 'code=$?; CLEANUP $code' EXIT +if [[ ! $TEST_select ]] +then TEST_select="[0123456789]*" +fi +TEST_select="@($TEST_select|+(0))" +if [[ $TEST_trace ]] +then export PS4=':$LINENO: ' + typeset -ft $(typeset +f) + set -x +fi +if [[ $TEST_verbose ]] +then typeset SHOW +else typeset -L70 SHOW +fi +if [[ ! $TEST_keep ]] && (ulimit -c 0) >/dev/null 2>&1 +then ulimit -c 0 +fi +set --pipefail + +# some last minute shenanigans + +alias BODY='BODY=BODY; function BODY' +alias CONTINUE='LINE=$LINENO; CONTINUE' +alias DO='(( $ITEM != $FLUSHED )) && RUN DO; DO &&' +alias DONE='DONE=DONE; function DONE' +alias EXEC='LINE=$LINENO; EXEC' +alias EXITED='LINE=$LINENO; EXITED' +alias INIT='INIT=INIT; function INIT' +alias JOB='LINE=$LINENO; JOB' +alias KILL='LINE=$LINENO; KILL' +alias PROG='LINE=$LINENO; FLUSH; PROG' +alias TEST='TESTLINE=$LINENO; TEST' +alias IF='LINE=$LINENO; FLUSH; IF' +alias ELIF='LINE=$LINENO; FLUSH; ELIF' +alias ELSE='LINE=$LINENO; FLUSH; ELSE' +alias FI='LINE=$LINENO; FLUSH; FI' + +# do the tests + +. $REGRESS +RUN +GROUP=FINI diff --git a/src/cmd/INIT/release.c b/src/cmd/INIT/release.c new file mode 100644 index 000000000..cf519e401 --- /dev/null +++ b/src/cmd/INIT/release.c @@ -0,0 +1,367 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1990-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#pragma prototyped +#pragma clang diagnostic ignored "-Wparentheses" + +/* + * release -- list recent release changes + * + * coded for portability + */ + +static char id[] = "\n@(#)$Id: release (AT&T Research) 2000-01-28 $\0\n"; + +#if _PACKAGE_ast + +#include +#include + +static const char usage[] = +"[-?\n@(#)$Id: release (AT&T Research) 2000-01-28 $\n]" +USAGE_LICENSE +"[+NAME?release - list recent changes]" +"[+DESCRIPTION?\brelease\b lists the changes within the date range specified" +" by the \b--from\b and \b--to\b options. The input files are assumed to" +" contain date tag lines of the form [\acc\a]]\ayy-mm-dd\a [ \atext\a ]]" +" (or \bdate\b(1) default format), where \acc\a is determined by a Y2K" +" window year of 69 (we can produce an example coding dated 1991 - this" +" can be patented?, how about 1+1=2?.) The date tag lines are followed by" +" \areadme\a text in reverse chronological order (newer entries at the" +" top of the file.) If no selection options are specified then all" +" changes are listed. If no \afile\a operands are specified then the" +" standard input is read.]" +"[+?The entries for each \afile\a are annotated with the file directory name.]" +"[f:from?Entries older than \adate\a are omitted.]:[date]" +"[r:release?List all changes that include the first \acount\a release marks." +" A release mark has a date tag followed by optional space and at least" +" three \b-\b characters. Changes from release mark \acount\a+1 are not" +" listed. If there are no release marks then the date range is used;" +" if there is at least one release mark then the date range is ignored" +" and at most \acount\a release marks will be listed.]#[count]" +"[t:to?Entries newer than \adate\a are omitted.]:[date]" +"[V?Print the program version and exit.]" + +"\n" +"\n[ file ... ]\n" +"\n" + +"[+SEE ALSO?\bpackage\b(1)]" +; + +#else + +#define elementsof(x) ((int)(sizeof(x)/sizeof(x[0]))) + +#define NiL ((char*)0) + +#endif + +#include +#include +#include +#include + +#if !_PACKAGE_ast && defined(__STDC__) +#include +#include +#endif + +static char mon[] = "janfebmaraprmayjunjulaugsepoctnovdec"; +static char day[] = "sunmontuewedthufrisat"; + +#if !_PACKAGE_ast + +static void +usage() +{ + fprintf(stderr, "Usage: release [-V] [-h hi-date] [-l lo-date] [-r count] [ file ...]\n"); + exit(2); +} + +#endif + +static unsigned long +number(register char* s, char** e) +{ + unsigned long q = 0; + + while (isspace(*s)) + s++; + while (isdigit(*s)) + q = q * 10 + *s++ - '0'; + if (e) + *e = s; + return q; +} + +unsigned long +string(register char* s, char* tab, int num, int siz, char** e) +{ + register int i; + register int j; + char buf[16]; + + while (isspace(*s)) + s++; + for (i = 0; i < siz; i++) + buf[i] = isupper(s[i]) ? tolower(s[i]) : s[i]; + for (i = 0; i < num; i += siz) + for (j = 0; j < siz && buf[j] == tab[j+i]; j++) + if (j == (siz - 1)) + { + *e = s + siz; + return i / siz + 1; + } + return 0; +} + +static unsigned long +date(char* s, char** e) +{ + char* t; + unsigned long y; + unsigned long m; + unsigned long d; + + if (isdigit(*s)) + { + y = number(s, &t); + if (*t != '-') + return 0; + switch (t - s) + { + case 2: + y += 1900; + if (y <= 1969) + y += 100; + break; + case 4: + if (y < 1969) + return 0; + break; + } + if (!(m = number(++t, &s))) + return 0; + if ((s - t) != 2 || *s != '-' || m < 1 || m > 12) + return 0; + if (!(d = number(++s, &t))) + return 0; + if ((t - s) != 2 || d < 1 || d > 31) + return 0; + } + else + { + if (string(s, day, elementsof(day), 3, &t)) + s = t; + if (!(m = string(s, mon, elementsof(mon), 3, &t))) + return 0; + if (!(d = number(t, &s))) + return 0; + for (y = 1969; *s; s++) + if ((y = number(s, &t)) && (t - s) == 4) + { + if (y < 1969) + return 0; + break; + } + } + if (e) + { + while (isspace(*t)) + t++; + *e = t; + } + return ((y - 1969) * 13 + m) * 32 + d; +} + +int +main(int argc, char** argv) +{ + register char* s; + register char* u; + register char* v; + char* p; + char* e; + int i; + unsigned long t; + unsigned long lo; + unsigned long hi; + int mk; + FILE* f; + char buf[1024]; + + mk = 0; + lo = hi = 0; +#if _PACKAGE_ast + error_info.id = "release"; + for (;;) + { + switch (optget(argv, usage)) + { + case 'f': + if (!(lo = date(opt_info.arg, &e)) || *e) + { + error(2, "%s: invalid from date [%s]", opt_info.arg, e); + return 1; + } + continue; + case 'r': + mk = opt_info.num + 1; + continue; + case 't': + if (!(hi = date(opt_info.arg, &e)) || *e) + { + error(2, "%s: invalid to date [%s]", opt_info.arg, e); + return 1; + } + continue; + case 'V': + sfprintf(sfstdout, "%s\n", id + 10); + return 0; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + continue; + case ':': + error(2, "%s", opt_info.arg); + continue; + } + break; + } + if (error_info.errors) + error(ERROR_USAGE|4, "%s", optusage(NiL)); + argv += opt_info.index; +#else + while ((s = *++argv) && *s == '-' && *(s + 1)) + { + if (*(s + 1) == '-') + { + if (!*(s + 2)) + { + argv++; + break; + } + usage(); + break; + } + for (;;) + { + switch (i = *++s) + { + case 0: + break; + case 'f': + case 't': + if (!*(v = ++s) && !(v = *++argv)) + { + s = "??"; + continue; + } + if (!(t = date(v, &e)) || *e) + { + fprintf(stderr, "release: -%c%s: invalid date [%s]\n", i, s, e); + return 1; + } + switch (i) + { + case 'f': + lo = t; + break; + case 't': + hi = t; + break; + } + break; + case 'r': + if (!*(v = ++s) && !(v = *++argv)) + { + s = "??"; + continue; + } + mk = number(v, &e) + 1; + if (*e) + { + fprintf(stderr, "release: -%c%s: invalid count\n", i, s); + return 1; + } + break; + case 'V': + fprintf(stdout, "%s\n", id + 10); + return 0; + default: + fprintf(stderr, "release: -%c: unknown option\n", i); + /*FALLTHROUGH*/ + case '?': + usage(); + break; + } + break; + } + } +#endif + do + { + if (!(p = *argv++) || !*p || *p == '-' && !*(p + 1)) + { + argv--; + p = ""; + f = stdin; + } + else if (!(f = fopen(p, "r"))) + { + fprintf(stderr, "release: %s: cannot read", p); + return 1; + } + while (s = fgets(buf, sizeof(buf), f)) + { + if (t = date(s, &e)) + { + if (mk && e[0] == '-' && e[1] == '-' && e[2] == '-' && !--mk) + break; + if (t < lo) + break; + if (hi && t > hi) + continue; + if (p) + { + if (*p) + { + for (u = v = p; *p; p++) + if (*p == '/') + { + v = u; + u = p + 1; + } + printf("\n:::::::: "); + while ((i = *v++) && i != '/') + fputc(i, stdout); + printf(" ::::::::\n\n"); + } + p = 0; + } + } + if (!p) + fputs(s, stdout); + } + if (f == stdin) + break; + fclose(f); + } while (*argv); + return 0; +} diff --git a/src/cmd/INIT/rt.sh b/src/cmd/INIT/rt.sh new file mode 100644 index 000000000..2b8b8408b --- /dev/null +++ b/src/cmd/INIT/rt.sh @@ -0,0 +1,479 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: rt - nmake test output filter + +command=rt +flags='--silent --keepgoing' +failed=0 +heading=1 +verbose=0 + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: rt (AT&T Research) 2010-07-27 $ +] +'$USAGE_LICENSE$' +[+NAME?rt - run "nmake test" and filter output] +[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression + test output to contain only test summary lines. If no \atest\a + operands are specified then \btest\b is assumed. If \b-\b is + specified then the \afile\a operands, or the standard input + if no \afile\a operands are specified, are filtered instead + of the output from \bnmake\b.] +[f:failed?Only list failed test results.] +[h!:heading?Enable per-file heading when more than one \afile\a operand + follows \b-\b.] +[v:verbose?Run with \vREGRESSFLAGS=-v\v.] + +[ test ... | - [ file ... ] ] + +[+SEE ALSO?\bnmake\b(1), \bregress\b(1)] +[+CAVEATS?\brt\b guesses the regression test output style. Garbled + output indicates a bad guess.] +' + ;; +*) ARGV0="" + USAGE="fhv" + ;; +esac + +function usage +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + f) failed=1 ;; + h) heading=0 ;; + v) (( verbose=$OPTARG )) && flags="$flags REGRESSFLAGS=-v" ;; + esac +done +shift `expr $OPTIND - 1` + +ifs=${IFS:-$' \t\n'} +set -o noglob +component= +dots='............................................' +bad=' ***' +style=unknown +integer tests errors signals lineno=0 skip=0 +typeset -l lower + +function results # tests errors signals +{ + integer t=$1 e=$2 s=$3 + typeset label note + if [[ $style != unknown ]] && (( errors >= 0 )) + then style=unknown + if (( !failed || errors )) + then if (( failed )) + then print -r -n -- "$unit" + fi + if (( t >= 0 )) + then if (( t == 1)) + then label="test " + else label=tests + fi + printf $'%s%5d %s' "$prefix" "$t" "$label" + prefix= + else prefix="$prefix..........." + fi + if (( s )) + then label=signal + (( e=s )) + else label=error + fi + if (( e != 1)) + then label=${label}s + fi + if (( e == 1 )) + then note=" $bad" + elif (( e > 1 )) + then note=$bad + fi + printf $'%s%5d %s%s\n' "$prefix" "$e" "$label" "$note" + fi + fi +} + +function unit +{ + typeset x + if [[ $component ]] + then x=${component##*/} + if [[ " $x " != *' '$unit' '* && " $unit " != *' '$x' '* ]] + then if [[ $component == cmd/?*lib/* ]] + then unit="$unit $x" + else unit="$x $unit" + fi + fi + fi + unit="$unit ${dots:1:${#dots}-${#unit}}" + if [[ $1 ]] + then unit="$unit..........." + fi + if (( ! failed )) + then print -r -n -- "$unit" + fi +} + +if [[ $1 == - ]] +then shift + if (( $# <= 1 )) + then heading=0 + fi + if (( heading )) + then for i + do print test heading $i + cat -- "$i" + done + else cat "$@" + fi +else if [[ $1 == *=* ]] + then set test "$@" + elif (( ! $# )) + then set test + fi + nmake "$@" $flags 2>&1 +fi | +while read -r line +do set '' $line + shift + case $line in + TEST[' ']*', '*' error'*) + IFS=${IFS}"," + set '' $line + IFS=$ifs + set '' $* + while : + do case $2 in + '') break + ;; + error|errors) + errors=$1 + break + ;; + test|tests) + tests=$1 + ;; + esac + shift + done + results $tests $errors + continue + ;; + TEST[' ']*) + results $tests $errors + IFS=${IFS}"," + set '' $line + IFS=$ifs + set '' $* + unit=${3##*/} + case $4 in + [a-zA-Z]*) unit="$unit $4" ;; + esac + unit + prefix= + errors=0 + signals=0 + style=regress + continue + ;; + 'pathname and options of item under test') + read -r line || break + results $tests $errors $signals + set '' $line + unit=${2##*/} + unit + tests=0 + errors=0 + signals=0 + style=script + continue + ;; + 'test heading '*) + if (( heading )) + then if (( heading > 1 )) + then print + else heading=2 + fi + set '' $line + shift 3 + print -r -- "==> $* <==" + fi + continue + ;; + 'test '*' begins at '????-??-??+??:??:??|'test '*' begins at '*' '*' '*' '*' '*) + results $tests $errors $signals + unit=${2##*/} + unit=${unit%.sh} + unit + prefix= + tests=-1 + errors=0 + signals=0 + style=shell + continue + ;; + 'test '*' at '????-??-??+??:??:??' [ '*' ]'|'test '*' at '*' '*' '*' '*' '*) + case $line in + *' [ '*test*error*' ]') + while : + do case $1 in + '[') tests=$2 + errors=$4 + if (( errors > 256 )) + then (( signals++ )) + fi + break + ;; + esac + shift + done + ;; + *' [ '*test*signal*' ]') + while : + do case $1 in + '[') tests=$2 + signals=$4 + if (( signals )) + then (( errors++ )) + fi + break + ;; + esac + shift + done + ;; + *) if [[ $3 != passed ]] + then (( errors )) || (( errors++ )) + fi + ;; + esac + results $tests $errors $signals + continue + ;; + '## ---'*(-)'--- ##') + (( ++lineno > skip )) || continue + read -r line || break + lower=$line + set '' $lower + case $lower in + '##'*'test suite:'*'##') + results $tests $errors $signals + set -- ${lower//*suite:} + set -- ${*//[.#]/} + unit=$* + if [[ $unit == *' tests' ]] + then unit=${unit/' tests'/} + fi + main=$unit + prefix= + tests=0 + errors=0 + signals=0 + category= + style=autotest + (( skip = lineno + 1 )) + unit + continue + ;; + esac + ;; + +(-)) case $style in + regress) continue ;; + esac + (( ++lineno > skip )) || continue + read -r line || break + set '' $line + case $line in + 'Running tests for '*) + results $tests $errors $signals + shift 4 + unit= + while (( $# )) + do if [[ $1 == on ]] + then break + fi + if [[ $unit ]] + then unit="$unit " + fi + unit=$unit${1##*/} + shift + done + main=$unit + prefix= + tests=-1 + errors=-1 + category= + style=perl + (( skip = lineno + 1 )) + continue + ;; + *' : '*)results $tests $errors $signals + unit=${2##*/} + unit=${unit%.sh} + unit + prefix= + tests=0 + errors=0 + signals=0 + style=timing + (( skip = lineno + 1 )) + continue + ;; + esac + ;; + +([0-9])*([a-zA-Z0-9])' '*) + case $style in + script) case $line in + *FAILED*|*failed*) + (( errors++ )) + ;; + *) (( tests++ )) + ;; + esac + ;; + esac + ;; + make:*|'make ['*']:'*) + case $line in + *': warning:'*|*'making test'*|*'action'?(s)' failed'*|*': *** '*) + ;; + *) results $tests $errors $signals + print -r -u2 -- "$line" + ;; + esac + continue + ;; + +([/a-zA-Z_0-9]):) + component=${line%:} + ;; + '') continue + ;; + esac + case $style in + autotest) + case $line in + +([0-9]):*ok) + (( tests++ )) + ;; + +([0-9]):*FAILED*) + (( tests++ )) + (( errors++ )) + if (( $verbose )) + then if [[ ! $prefix ]] + then prefix=$unit + print + fi + print -r -- " ${line//*'FAILED '/}" + fi + ;; + esac + continue + ;; + perl) case $line in + *'........ '*) + if [[ $1 == */* ]] + then cat=${1%%/*} + if [[ $cat != $category ]] + then results $tests $errors $signals + category=$cat + unit="$main $category" + unit + prefix= + tests=0 + errors=0 + signals=0 + fi + (( tests++ )) + case $line in + *' ok') ;; + *) (( errors++ )) + if (( $verbose )) + then if [[ ! $prefix ]] + then prefix=$unit + print + fi + print -r -- "$line" + fi + ;; + esac + else results $tests $errors $signals + case $line in + *' ok') errors=0 ;; + *) errors=1 ;; + esac + unit="$main $1" + unit + if (( $verbose && errors )) + then prefix=$unit + print + shift 2 + print -r -- "$@" + else prefix= + fi + results $tests $errors $signals + tests=-1 + errors=-1 + category= + fi + style=perl + ;; + esac + continue + ;; + esac + case $line in + *FAILED*|*failed*) + (( errors++ )) + ;; + *) case $style in + regress)case $line in + ['<>']*);; + *) continue ;; + esac + ;; + script) continue + ;; + shell) ((errors++ )) + ;; + timing) (( tests++ )) + continue + ;; + unknown)continue + ;; + esac + ;; + esac + if (( $verbose )) + then if [[ ! $prefix ]] + then prefix=$unit + print + fi + print -r -- "$line" + fi +done +results $tests $errors $signals diff --git a/src/cmd/INIT/silent.sh b/src/cmd/INIT/silent.sh new file mode 100644 index 000000000..77e85333b --- /dev/null +++ b/src/cmd/INIT/silent.sh @@ -0,0 +1,41 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# non-ksh stub for the nmake silent prefix +# @(#)silent (AT&T Research) 1992-08-11 + +(command set -o posix) 2>/dev/null && set -o posix +modern_export=`v=; export v=ok 2>/dev/null; echo "$v"` + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $modern_export in + ok) export "$1" ;; + *) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" diff --git a/src/cmd/INIT/socket.c b/src/cmd/INIT/socket.c new file mode 100644 index 000000000..51d74eb7a --- /dev/null +++ b/src/cmd/INIT/socket.c @@ -0,0 +1,33 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lnsl + */ + +#ifndef socket +#include +#include +#endif + +int +main() +{ + return socket(0, 0, 0) < 0; +} diff --git a/src/cmd/INIT/w.c b/src/cmd/INIT/w.c new file mode 100644 index 000000000..0f6bc7d3d --- /dev/null +++ b/src/cmd/INIT/w.c @@ -0,0 +1,30 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef DONTCARE +#include +#include +#endif + +int +main() +{ + wchar_t w = ' '; + return iswspace(w) == 0; +} diff --git a/src/cmd/INIT/w2.c b/src/cmd/INIT/w2.c new file mode 100644 index 000000000..00efd257c --- /dev/null +++ b/src/cmd/INIT/w2.c @@ -0,0 +1,27 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#include + +int +main() +{ + wchar_t w = ' '; + return iswspace(w) == 0; +} diff --git a/src/cmd/Mamfile b/src/cmd/Mamfile new file mode 100644 index 000000000..3d2449604 --- /dev/null +++ b/src/cmd/Mamfile @@ -0,0 +1,16 @@ +info mam static +note * +note * This build file is in the Make Abstract Machine (MAM) language. It was +note * first generated by nmake, but in the ksh 93u+m distribution we maintain +note * it manually because nmake had too many problems to keep using. The +note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added +note * support for indentation to improve readability. The language is +note * documented in Glenn Fowler's paper "A Make Abstract Machine": +note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html +note * +note component level :MAKE: equivalent +make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual +done install virtual diff --git a/src/cmd/builtin/Mamfile b/src/cmd/builtin/Mamfile new file mode 100644 index 000000000..164b1d215 --- /dev/null +++ b/src/cmd/builtin/Mamfile @@ -0,0 +1,106 @@ +info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20 +note * +note * This build file is in the Make Abstract Machine (MAM) language. It was +note * first generated by nmake, but in the ksh 93u+m distribution we maintain +note * it manually because nmake had too many problems to keep using. The +note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added +note * support for indentation to improve readability. The language is +note * documented in Glenn Fowler's paper "A Make Abstract Machine": +note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html +note * +setv INSTALLROOT ../../.. +setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast +setv PACKAGE_ast_LIB ${INSTALLROOT}/lib +setv PACKAGE_cmd ${INSTALLROOT} +setv PACKAGE_cmd_INCLUDE ${PACKAGE_cmd}/include +setv PACKAGE_cmd_LIB ${PACKAGE_cmd}/lib +setv PACKAGEROOT ../../../../.. +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv ARFLAGS rc +setv AS as +setv ASFLAGS +setv CC cc +setv mam_cc_FLAGS +setv KSH_RELFLAGS +setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} +setv COTEMP $$ +setv CPIO cpio +setv CPIOFLAGS +setv CPP "${CC} -E" +setv F77 f77 +setv HOSTCC ${CC} +setv IFFEFLAGS +setv IGNORE +setv LD ld +setv LDFLAGS +setv LEX lex +setv LEXFLAGS +setv LPR lpr +setv LPRFLAGS +setv M4FLAGS +setv NMAKE nmake +setv NMAKEFLAGS +setv PR pr +setv PRFLAGS +setv SHELL /bin/sh +setv SILENT +setv TAR tar +setv YACC yacc +setv YACCFLAGS -d +make ${PACKAGEROOT}/lib/package/ast.lic +done ${PACKAGEROOT}/lib/package/ast.lic +make .INIT + make ${PACKAGE_ast_INCLUDE}/cmdlist.h + make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare + done ${PACKAGE_ast_INCLUDE}/cmdlist.h + exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${PACKAGE_ast_INCLUDE}/cmdlist.h + bind -lcmd +done .INIT dontcare virtual +make install + make pty + make pty.o + make pty.c + make FEATURE/pty implicit + meta FEATURE/pty features/%>FEATURE/% features/pty pty + make features/pty + done features/pty + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -lm' ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty + done FEATURE/pty generated + make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_time.h + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev ${PACKAGE_ast_INCLUDE}/regex.h implicit + make ${PACKAGE_ast_INCLUDE}/proc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/proc.h + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit + done pty.c + meta pty.o %.c>%.o pty.c pty + prev pty.c + setv CMD_STANDALONE -DCMD_STANDALONE="b_pty" + setv LICENSE -DLICENSE="since=2001,author=gsf+dgk" + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?builtin]"\" -c pty.c + done pty.o generated + bind -lutil dontcare + setv CMD_STANDALONE -DCMD_STANDALONE="b_pty" + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd} + done pty generated + make ${INSTALLROOT}/bin + exec - if silent test ! -d ${INSTALLROOT}/bin + exec - then mkdir -p ${INSTALLROOT}/bin + exec - fi + done ${INSTALLROOT}/bin generated + make ${INSTALLROOT}/bin/pty + prev pty + exec - test '' = 'pty' || ${STDCMP} 2>/dev/null -s pty ${INSTALLROOT}/bin/pty || { ${STDMV} ${INSTALLROOT}/bin/pty ${INSTALLROOT}/bin/pty.old 2>/dev/null || true; ${STDCP} pty ${INSTALLROOT}/bin/pty ;} + done ${INSTALLROOT}/bin/pty generated + make ${INSTALLROOT}/bin + exec - if silent test ! -d ${INSTALLROOT}/bin + exec - then mkdir -p ${INSTALLROOT}/bin + exec - fi + done ${INSTALLROOT}/bin virtual +done install virtual diff --git a/src/cmd/builtin/RELEASE b/src/cmd/builtin/RELEASE new file mode 100644 index 000000000..86d2d313e --- /dev/null +++ b/src/cmd/builtin/RELEASE @@ -0,0 +1,10 @@ +12-02-28 pty.c: change --verbose[=level] to --debug=level +12-01-26 pty.c: fix --man docs +10-06-21 pty.c: add 4 sec timeout for initial handshake -- fix me!! +10-04-12 pty: fix sfpoll() result read/write bug +10-04-01 pty: add --tty='stty-settings' +10-03-19 pty: add --dialogue +10-03-15 pty: fix select() fd management +09-03-31 features/pty,Makefile: add pty.h and -lutil refs for linux -- great, another util library +09-01-30 pty.c: add (for fd_set!! on mvs.390) +06-07-20 pty.c: add diff --git a/src/cmd/builtin/features/pty b/src/cmd/builtin/features/pty new file mode 100755 index 000000000..612609b36 --- /dev/null +++ b/src/cmd/builtin/features/pty @@ -0,0 +1,60 @@ +set prototyped + +header sys/types.h +header pty.h +header libutil.h +header sys/pty.h +header sys/ptyio.h +header sys/vty.h +header sys/ioctl.h +header stropts.h + +lib openpty,_getpty,ptsname -lutil +lib grantpt,unlockpt,posix_openpt stdlib.h +lib cfmakeraw termios.h + +tst - output{ + #include + #if _lib_ptsname + #include + #endif + #include + #include + #include + #include + int main() + { + int i; + struct stat statb; + static char* pty[] = { "/dev/ptyp0000", "/dev/ptym/ptyp0", "/dev/ptyp0" }; + #if _lib_ptsname + int fd; + static char* ptc[] = { "/dev/ptmx", "/dev/ptc", "/dev/ptmx_bsd" }; + + for (i = 0; i < sizeof(ptc) / sizeof(ptc[0]); i++) + if((fd = open(ptc[i], 2))>=0) + { + if (ptsname(fd)) + { + sfprintf(sfstdout, "#define _pty_clone\t\"%s\"\n", ptc[i]); + close(fd); + break; + } + close(fd); + } + #endif + for (i = 0;; i++) + if(i >= (sizeof(pty) / sizeof(pty[0]) - 1) || stat(pty[i], &statb)>=0) + { + sfprintf(sfstdout, "#define _pty_first\t\"%s\"\n", pty[i]); + break; + } + return 0; + } +}end fail{ + echo '#error The output block in src/cmd/builtin/features/pty failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.' +}end + +extern _getpty char* (int*, int, mode_t, int) +extern openpty int (int*, int*, char*, struct termios*, struct winsize*) +extern ptsname char* (int) diff --git a/src/cmd/builtin/pty.c b/src/cmd/builtin/pty.c new file mode 100644 index 000000000..b3f31ade0 --- /dev/null +++ b/src/cmd/builtin/pty.c @@ -0,0 +1,1124 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1992-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped + +static const char usage[] = +"[-?\n@(#)pty (AT&T Research) 2012-06-11\n]" +USAGE_LICENSE +"[+NAME?pty - create pseudo terminal and run command]" +"[+DESCRIPTION?\bpty\b creates a pseudo pty and then runs \bcommand\b " + "with arguments given by \aarg\a and the standard input, standard " + "output, and standard error connected to the pseudo terminal. By " + "default, the \bpty\b creates a new session.]" +"[+?If \bcommand\b does not contain a \b/\b, the \bPATH\b variable will " + "be used to locate the \bcommand\b.]" +"[+?Input to \bpty\b will be written to the standard input of this " + "command. The standard output and standard error from the command will " + "be written to the standard output of \bpty\b.]" +"[+?The \bpty\b command terminates when the command completes.]" +"[d:dialogue?Execute the dialogue on the standard input. A dialogue is a " + "sequence of commands, one command per line. All \are\a patterns are " + "extended regular expressions. The \are\a \b?1\b will print the subject " + "string on the standard error and match the string; the \are\a \b?0\b " + "will print the subject string on the standard error and not match the " + "string. The \are\a \b?.\b matches EOF. The commands are:]" + "{" + "[\b#\b \acomment\a?comment line]" + "[c \atext\a?write \atext\a to the master; C style escapes " + "in text are converted, including \\E for ESC and \\cX for " + "control-X]" + "[d \amilliseconds\a?set the delay before each master write to " + "\amilliseconds\a; the default is no delay]" + "[i \are\a?read a line from the master; if it matches \are\a " + "then execute lines until matching \be\b or \bf\b]" + "[e [re]]?else [if match re]] then execute lines until matching " + "\be\b or \bf\b]" + "[f?end of \bi\b/\be\b block]" + "[m \atext\a?write \atext\a to the standard error]" + "[p \atext\a?peek input until \atext\a is found at the beginning " + "of a line; input is not consumed]" + "[r [\are\a]]?read a line from the master [and it should match " + "re]]]" + "[s \amilliseconds\a?sleep for \amilliseconds\a]" + "[t \amilliseconds\a?set the master read timeout to " + "\amilliseconds\a; the default is \b1000\b]" + "[u \are\a?read lines from the master until one matches \are\a]" + "[v \alevel\a?set the verbose trace \alevel\a, more output for " + "higher levels, disabled for level 0]" + "[w \atext\a?write \atext\a\\r\\n to the master; C style escapes " + "in text are converted, including \\E for ESC and \\cX for " + "control-X]" + "[x [\acode\a]]" + "?exit \bpty\b with exit code \b0\b [\acode\a]]]" + "[I \are\a?ignore master lines matching \are\a]" + "[L \alabel\a?prefix all diagnostics with \alabel\a:]" + "[P \atext\a?delay each master write until the beginning of " + "an unread input line exactly matches \atext\a]" + "}" +"[D:debug?Set the debug trace \alevel\a, higher levels produce more " + "output, disabled for level 0.]#[level]" +"[l:log?Log the master stdout and stderr to \afile\a.]:[file]" +"[m:messages?Redirect diagnostic message output to \afile\a.]:[file]" +"[s!:session?Create a separate session for the process started by " + "\bpty\b.]" +"[t:timeout?Set the master read timeout to " + "\amilliseconds\a.]#[milliseconds:=1000]" +"[T:tty?Pass \astty\a to the \bstty\b(1) command to initialize the " + "pty.]:[stty]" +"[w:delay?Set the delay before each master write to " + "\amilliseconds\a.]#[milliseconds:=0]" + +"\n" +"\ncommand [arg ...]\n" +"\n" + +"[+EXIT STATUS?If the command determined by \bcommand\b is run the exit " + "status of \bpty\b is that of this command. Otherwise, the exit status " + "is one of the following:]" + "{" + "[+127?The command is found but cannot be executed.]" + "[+128?The command could not be found.]" + "}" +"[+SEE ALSO?\bcommand\b(1), \bexec\b(1)]" +; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "FEATURE/pty" + +#define MODE_666 (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) +#define MAXNAME 64 + +#ifndef CMIN +#define CMIN 1 +#endif + +#if !_lib_openpty && !_lib__getpty && !defined(_pty_clone) +# if !_lib_grantpt || !_lib_unlock +# if !_lib_ptsname + static char *minionname(const char *name) + { + static char sname[MAXNAME]; + char *last; + strncpy(sname,name,sizeof(sname)); + last = strrchr(sname,'/'); + last[1] = 't'; + return(sname); + } +# endif + + static char *master_name(char *name) + { + static char sname[MAXNAME]; + int n; + if(!name) + { + strcpy(sname,_pty_first); + return(sname); + } + n = strlen(_pty_first); + if(name[n-1]=='9') + name[n-1]='a'; + else if(name[n-1]=='f') + { + if(_pty_first[n-2]=='0' && name[n-2]=='9') + { + name[n-2]='0'; + if(name[n-3]=='9' || name[n-3]=='z') + return(NULL); + name[n-3]++; + } + if(_pty_first[n-2]=='p' && (name[n-2]=='z' || name[n-2]=='Z')) + { + if(name[n-2]=='z') + name[n-2]=='P'; + else + return(0); + } + else + name[n-2]++; + name[n-1]='0'; + } + else + name[n-1]++; + return(name); + } +#endif + +#if !_lib_openpty + static char *ptymopen(int *master) + { + char *minion=0; +# if _lib__getpty + return(_getpty(master,O_RDWR,MODE_666,0)); +# else +# if defined(_pty_clone) + *master = open(_pty_clone,O_RDWR|O_CREAT,MODE_666); + if(*master>=0) + minion = ptsname(*master); +# else + int fdm; + char *name=0; + while(name=master_name(name)) + { + fdm = open(name,O_RDWR|O_CREAT,MODE_666); + if(fdm >= 0) + { + *master = fdm; +# if _lib_ptsname + minion = ptsname(fdm); +# else + minion = minionname(name); +# endif + break; + } + } +# endif +# endif + return(minion); + } +# endif +#endif + +static int +mkpty(int* master, int* minion) +{ + struct termios tty; + struct termios tst; + struct termios* ttyp; +#ifdef TIOCGWINSZ + struct winsize win; + struct winsize* winp; +#endif +#if !_lib_openpty + char* sname; +#endif +#ifdef SIGTTOU + sigset_t blckttou, oldset; + (void)sigemptyset(&blckttou); + (void)sigaddset(&blckttou, SIGTTOU); + sigprocmask(SIG_BLOCK, &blckttou, &oldset); +#endif + alarm(6); + if (tcgetattr(sffileno(sfstderr), &tty) < 0) + { + if (errno != ENOTTY) + error(-1, "unable to get standard error terminal attributes"); +#if _lib_cfmakeraw + cfmakeraw(&tty); +#else + tty.c_iflag |= IGNPAR; + tty.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); + tty.c_oflag &= ~OPOST; + tty.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); +#endif /* _lib_cfmakeraw */ + ttyp = 0; + } + tty.c_lflag |= ICANON | IEXTEN | ISIG | ECHO | ECHOE | ECHOK; +#ifdef ECHOKE + tty.c_lflag |= ECHOKE; +#endif + tty.c_oflag |= (ONLCR | OPOST); + tty.c_oflag &= ~(OCRNL | ONLRET); + tty.c_iflag |= BRKINT; + tty.c_iflag &= ~IGNBRK; + tty.c_cc[VTIME] = 0; + tty.c_cc[VMIN] = CMIN; +#ifdef B115200 + cfsetispeed(&tty, B115200); + cfsetospeed(&tty, B115200); +#elif defined(B57600) + cfsetispeed(&tty, B57600); + cfsetospeed(&tty, B57600); +#elif defined(B38400) + cfsetispeed(&tty, B38400); + cfsetospeed(&tty, B38400); +#endif + ttyp = &tty; +#ifdef TIOCGWINSZ + if (ioctl(sffileno(sfstderr), TIOCGWINSZ, &win) < 0) + { + if (errno != ENOTTY) + error(-1, "unable to get standard error window size"); + win.ws_row = 0; + win.ws_col = 0; + winp = 0; + } + if (win.ws_row < 24) + win.ws_row = 24; + if (win.ws_col < 80) + win.ws_col = 80; + winp = &win; +#endif +#ifdef __linux__ +# if !_lib_openpty +# undef _lib_openpty +# define _lib_openpty 1 +# endif +#endif +#if _lib_openpty + if (openpty(master, minion, NULL, ttyp, winp) < 0) + return -1; +#else +#if _lib_grantpt && _lib_unlockpt +#if !_lib_posix_openpt +#ifndef _pty_clone +#define _pty_clone "/dev/ptmx" +#endif +#define posix_openpt(m) open(_pty_clone,m) +#endif + if ((*master = posix_openpt(O_RDWR)) < 0) + return -1; + if (grantpt(*master) || unlockpt(*master) || !(sname = ptsname(*master)) || (*minion = open(sname, O_RDWR|O_cloexec)) < 0) + { + close(*master); + return -1; + } +#else + if (!(sname = ptymopen(master)) || (*minion = open(sname, O_RDWR|O_cloexec)) < 0) + return -1; +#endif +#ifdef I_PUSH + if (tcgetattr(*minion, &tst) < 0 && (ioctl(*minion, I_PUSH, "ptem") < 0 || ioctl(*minion, I_PUSH, "ldterm") < 0)) + { + close(*minion); + close(*master); + return -1; + } +#endif +#endif + if (ttyp && tcsetattr(*minion, TCSANOW, ttyp) < 0) + error(ERROR_warn(0), "unable to set pty terminal attributes"); +#ifdef TIOCSWINSZ + if (winp && ioctl(*minion, TIOCSWINSZ, winp) < 0) + error(ERROR_warn(0), "unable to set pty window size"); +#endif + fcntl(*master, F_SETFD, FD_CLOEXEC); +#if !O_cloexec + fcntl(*minion, F_SETFD, FD_CLOEXEC); +#endif +#ifdef SIGTTOU + sigprocmask(SIG_SETMASK, &oldset, NULL); +#endif + alarm(0); + return 0; +} + +static Proc_t* +runcmd(char** argv, int minion, int session) +{ + long ops[4]; + + if (session) + { + ops[0] = PROC_FD_CTTY(minion); + ops[1] = 0; + } + else + { + ops[0] = PROC_FD_DUP(minion, 0, PROC_FD_CHILD); + ops[1] = PROC_FD_DUP(minion, 1, PROC_FD_CHILD); + ops[2] = PROC_FD_DUP(minion, 2, PROC_FD_CHILD); + ops[3] = 0; + } + return procopen(argv[0], argv, NiL, ops, 0); +} + +/* + * default master dance + */ + +static int +process(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) +{ + int i; + int n; + int t; + ssize_t r; + char* s; + Sfio_t* ip; + Sfio_t* sps[2]; + struct stat dst; + struct stat fst; + + ip = sfstdin; + if (!fstat(sffileno(ip), &dst) && !stat("/dev/null", &fst) && dst.st_dev == fst.st_dev && dst.st_ino == fst.st_ino) + ip = 0; + do + { + i = 0; + t = timeout; + if (mp) + sps[i++] = mp; + if (ip) + { + sps[i++] = ip; + t = -1; + } + if (!i) + break; + if ((n = sfpoll(sps, i, t)) <= 0) + { + if (n < 0) + error(ERROR_SYSTEM|2, "poll failed"); + break; + } + for (i = t = 0; i < n; i++) + { + if (!(sfvalue(sps[i]) & SF_READ)) + /*skip*/; + else if (sps[i] == mp) + { + t++; + if (!(s = (char*)sfreserve(mp, SF_UNBOUND, -1))) + { + sfclose(mp); + mp = 0; + } + else if ((r = sfvalue(mp)) > 0 && (sfwrite(sfstdout, s, r) != r || sfsync(sfstdout))) + { + error(ERROR_SYSTEM|2, "output write failed"); + goto done; + } + } + else + { + t++; + if (!(s = sfgetr(ip, '\n', 1))) + ip = 0; + else if (sfputr(mp, s, '\r') < 0 || sfsync(mp)) + { + error(ERROR_SYSTEM|2, "write failed"); + goto done; + } + } + } + } while (t); + done: + if (mp) + sfclose(mp); + return error_info.errors != 0; +} + +/* + * return 1 is extended re pattern matches text + */ + +static int +match(char* pattern, char* text, int must) +{ + regex_t* re; + int code; + char buf[64]; + + if (!pattern[0]) + return 1; + if (pattern[0] == '?' && pattern[1] && !pattern[2]) + { + switch (pattern[1]) + { + case '0': + case '1': + if (text) + error(2, "got \"%s\"", fmtesq(text, "\"")); + else + error(2, "got EOF"); + return pattern[1] == '1'; + case '.': + if (!text) + return 1; + if (must) + error(2, "expected EOF, got \"%s\"", fmtesq(text, "\"")); + return 0; + } + } + if (!text) + { + if (must) + error(2, "expected \"%s\", got EOF", pattern); + return 0; + } + if (!(re = regcache(pattern, REG_EXTENDED, &code))) + { + regerror(code, re, buf, sizeof(buf)); + error(2, "%s: %s", pattern, buf); + return 0; + } + if (regexec(re, text, 0, NiL, 0)) + { + if (must) + error(2, "expected \"%s\", got \"%s\"", pattern, fmtesq(text, "\"")); + return 0; + } + return 1; +} + +typedef struct Master_s +{ + Vmalloc_t* vm; /* allocation region */ + char* ignore; /* ignore master lines matching this re */ + char* peek; /* peek buffer pointer */ + char* cur; /* current line */ + char* nxt; /* next line */ + char* end; /* end of lines */ + char* max; /* end of buf */ + char* buf; /* current buffer */ + char* prompt; /* peek prompt */ + int cursor; /* cursor in buf, 0 if fresh line */ + int line; /* prompt line number */ + int restore; /* previous line save char */ +} Master_t; + +/* + * read one line from the master + */ + +#define MASTER_EOF (-1) +#define MASTER_TIMEOUT (-2) + +static char* +masterline(Sfio_t* mp, Sfio_t* lp, char* prompt, int must, int timeout, Master_t* bp) +{ + char* r; + char* s; + char* t; + ssize_t n; + ssize_t a; + size_t promptlen = 0; + ptrdiff_t d; + char promptbuf[64]; + + if (prompt) + promptlen = sfsprintf(promptbuf, sizeof(promptbuf), prompt, ++bp->line); + again: + if (prompt) + { + if (bp->cur < bp->end && bp->restore >= 0) + *bp->cur = bp->restore; + if (strneq(bp->cur, promptbuf, promptlen)) + r = bp->cur; + else + r = 0; + if (bp->cur < bp->end && bp->restore >= 0) + *bp->cur = 0; + if (r) + { + error(-1, "p \"%s\"", fmtnesq(promptbuf, "\"", promptlen)); + return r; + } + if (r = bp->nxt) + { + if (strneq(r, promptbuf, promptlen)) + { + error(-1, "p \"%s\"", fmtnesq(promptbuf, "\"", promptlen)); + return r; + } + while (r = memchr(r, '\n', bp->end - r)) + { + if (strneq(r, promptbuf, promptlen)) + { + error(-1, "p \"%s\"", fmtnesq(promptbuf, "\"", promptlen)); + return r; + } + r++; + } + } + *bp->cur = 0; + } + else if (bp->nxt) + { + if (bp->restore >= 0) + *bp->cur = bp->restore; + r = bp->cur; + bp->restore = *bp->nxt; + *bp->nxt = 0; + if (bp->nxt >= bp->end) + { + bp->cur = bp->end = bp->buf; + bp->nxt = 0; + } + else + { + bp->cur = bp->nxt; + if (bp->nxt = memchr(bp->nxt + 1, '\n', bp->end - bp->nxt - 1)) + bp->nxt++; + } + goto done; + } + if ((n = sfpoll(&mp, 1, timeout)) <= 0 || !((int)sfvalue(mp) & SF_READ)) + { + if (n < 0) + { + if (must) + error(ERROR_SYSTEM|2, "poll failed"); + else + error(-1, "r poll failed"); + } + else if (bp->cur < bp->end) + { + if (bp->restore >= 0) + { + *bp->cur = bp->restore; + bp->restore = -1; + } + r = bp->cur; + *bp->end = 0; + bp->nxt = 0; + if (prompt && strneq(r, promptbuf, promptlen)) + { + error(-1, "p \"%s\"", fmtnesq(promptbuf, "\"", promptlen)); + return r; + } + bp->cur = bp->end = bp->buf; + goto done; + } + else if (must >= 0) + error(2, "read timeout"); + else + { + errno = 0; + error(-1, "r EOF"); + } + return 0; + } + if (!(s = sfreserve(mp, SF_UNBOUND, -1))) + { + if (!prompt) + { + if (bp->cur < bp->end) + { + if (bp->restore >= 0) + { + *bp->cur = bp->restore; + bp->restore = -1; + } + r = bp->cur; + *bp->end = 0; + bp->cur = bp->end = bp->buf; + bp->nxt = 0; + goto done; + } + else + { + errno = 0; + error(-1, "r EOF"); + } + } + return 0; + } + n = sfvalue(mp); + error(-2, "b \"%s\"", fmtnesq(s, "\"", n)); + if ((bp->max - bp->end) < n) + { + a = roundof(bp->max - bp->buf + n, SF_BUFSIZE); + r = bp->buf; + if (!(bp->buf = vmnewof(bp->vm, bp->buf, char, a, 0))) + { + error(ERROR_SYSTEM|2, "out of space"); + return 0; + } + bp->max = bp->buf + a; + if (bp->buf != r) + { + d = bp->buf - r; + bp->cur += d; + bp->end += d; + } + } + memcpy(bp->end, s, n); + bp->end += n; + if ((r = bp->cur) > bp->buf && bp->restore >= 0) + *r = bp->restore; + if (bp->cur = memchr(bp->cur, '\n', bp->end - bp->cur)) + { + bp->restore = *++bp->cur; + *bp->cur = 0; + if (bp->cur >= bp->end) + { + bp->cur = bp->end = bp->buf; + bp->nxt = 0; + } + else if (bp->nxt = memchr(bp->cur + 1, '\n', bp->end - bp->cur - 1)) + bp->nxt++; + if (prompt) + goto again; + } + else + { + bp->restore = -1; + bp->cur = r; + bp->nxt = 0; + must = 0; + goto again; + } + done: + error(-3, "Q \"%s\"", fmtesq(r, "\"")); + s = r; + if (bp->cursor) + { + r -= bp->cursor; + bp->cursor = 0; + } + for (t = 0, n = 0; *s; s++) + if (*s == '\n') + { + if (t) + { + *t++ = '\n'; + *t = 0; + t = 0; + n = 0; + } + } + else if (*s == '\r' && *(s + 1) != '\n') + { + if (t = strchr(s + 1, '\r')) + n += t - s; + else + n += strlen(s); + t = r; + } + else if (*s == '\a') + { + if (!t) + t = s; + *t = ' '; + n++; + } + else if (*s == '\b') + { + if (!t) + t = s; + if (t > r) + t--; + else + n++; + } + else if (t) + *t++ = *s; + if (t) + error(-3, "R \"%s\"", fmtesq(r, "\"")); + if (n) + *(r + strlen(r) - n) = 0; + error(-1, "r \"%s\"", fmtesq(r, "\"")); + if (lp) + sfputr(lp, fmtesq(r, "\""), '\n'); + if (t) + bp->cursor = t - r; + if (bp->ignore && match(bp->ignore, r, 0)) + goto again; + return r; +} + +/* + * execute dialogue script on stdin + */ + +#define NESTING 64 + +#define ELSE 0x01 +#define IF 0x02 +#define KEPT 0x04 +#define SKIP 0x08 + +struct Cond_s; +typedef struct Cond_s Cond_t; + +struct Cond_s +{ + Cond_t* next; + Cond_t* prev; + char* text; + int flags; +}; + +static int +dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) +{ + int op; + int line; + int n; + char* s; + char* m; + char* e; + char* id; + Vmalloc_t* vm; + Cond_t* cond; + Master_t* master; + + int status = 0; + + if (!(vm = vmopen(Vmdcheap, Vmbest, 0)) || + !(cond = vmnewof(vm, 0, Cond_t, 1, 0)) || + !(master = vmnewof(vm, 0, Master_t, 1, 0)) || + !(master->buf = vmnewof(vm, 0, char, 2 * SF_BUFSIZE, 0))) + { + error(ERROR_SYSTEM|2, "out of space"); + id = 0; + line = 0; + goto done; + } + master->vm = vm; + master->cur = master->end = master->buf; + master->max = master->buf + 2 * SF_BUFSIZE - 1; + master->restore = -1; + errno = 0; + id = error_info.id; + error_info.id = 0; + line = error_info.line; + error_info.line = 0; + while (s = sfgetr(sfstdin, '\n', 1)) + { + error_info.line++; + while (isspace(*s)) + s++; + if ((op = *s++) && isspace(*s)) + s++; + switch (op) + { + case 0: + case '#': + break; + case 'c': + case 'w': + if (cond->flags & SKIP) + continue; + if (master->prompt && !masterline(mp, lp, master->prompt, 0, timeout, master)) + goto done; + if (delay) + usleep((unsigned long)delay * 1000); + if (op == 'w') + error(-1, "w \"%s\\r\"", s); + else + error(-1, "w \"%s\"", s); + if ((n = stresc(s)) >= 0) + s[n] = 0; + if (sfputr(mp, s, op == 'w' ? '\n' : -1) < 0 || sfsync(mp)) + { + error(ERROR_SYSTEM|2, "write failed"); + goto done; + } + if (delay) + usleep((unsigned long)delay * 1000); + break; + case 'd': + delay = (int)strtol(s, &e, 0); + if (*e) + error(2, "%s: invalid delay -- milliseconds expected", s); + break; + case 'i': + if (!cond->next && !(cond->next = vmnewof(vm, 0, Cond_t, 1, 0))) + { + error(ERROR_SYSTEM|2, "out of space"); + goto done; + } + cond = cond->next; + cond->flags = IF; + if ((cond->prev->flags & SKIP) && !(cond->text = 0) || !(cond->text = masterline(mp, lp, 0, 0, timeout, master))) + cond->flags |= KEPT|SKIP; + else if (match(s, cond->text, 0)) + cond->flags |= KEPT; + else + cond->flags |= SKIP; + break; + case 'e': + if (!(cond->flags & IF)) + { + error(2, "no matching i for e"); + goto done; + } + if (!*s) + { + if (cond->flags & ELSE) + { + error(2, "i block already has a default e"); + goto done; + } + cond->flags |= ELSE; + if (cond->flags & KEPT) + cond->flags |= SKIP; + else + { + cond->flags |= KEPT; + cond->flags &= ~SKIP; + } + } + else if ((cond->flags & KEPT) || !match(s, cond->text, 0)) + cond->flags |= SKIP; + else + cond->flags |= KEPT; + break; + case 'f': + if (!(cond->flags & IF)) + { + error(2, "no matching i for f"); + goto done; + } + cond = cond->prev; + break; + case 'm': + if (cond->flags & SKIP) + continue; + if (sfputr(sfstderr, s, '\n') < 0 || sfsync(sfstderr)) + { + error(ERROR_SYSTEM|2, "standard error write failed"); + goto done; + } + break; + case 'p': + if (cond->flags & SKIP) + continue; + if (!(m = masterline(mp, lp, s, 1, timeout, master))) + goto done; + break; + case 'r': + if (cond->flags & SKIP) + continue; + if (!(m = masterline(mp, lp, 0, s[0] == '?' && s[1] == '.' ? -1 : 1, timeout, master))) + goto done; + match(s, m, 1); + break; + case 's': + n = (int)strtol(s, &e, 0); + if (*e) + error(2, "%s: invalid delay -- milliseconds expected", s); + if (n) + usleep((unsigned long)n * 1000); + break; + case 't': + timeout = (int)strtol(s, &e, 0); + if (*e) + error(2, "%s: invalid timeout -- milliseconds expected", s); + break; + case 'u': + if (cond->flags & SKIP) + continue; + do + { + if (!(m = masterline(mp, lp, 0, -1, timeout, master))) + { + match(s, m, 1); + goto done; + } + } while (!match(s, m, 0)); + break; + case 'v': + error_info.trace = -(int)strtol(s, &e, 0); + if (*e) + error(2, "%s: invalid verbose level -- number expected", s); + break; + case 'x': + status = (int)strtol(s, &e, 0); + if (*e) + error(2, "%s: invalid exit code", s); + break; + case 'I': + if (master->ignore) + { + vmfree(vm, master->ignore); + master->ignore = 0; + } + if (*s && !(master->ignore = vmstrdup(vm, s))) + { + error(ERROR_SYSTEM|2, "out of space"); + goto done; + } + break; + case 'L': + if (error_info.id) + { + vmfree(vm, error_info.id); + error_info.id = 0; + } + if (*s && !(error_info.id = vmstrdup(vm, s))) + { + error(ERROR_SYSTEM|2, "out of space"); + goto done; + } + break; + case 'P': + if (master->prompt) + { + vmfree(vm, master->prompt); + master->prompt = 0; + } + if (*s && !(master->prompt = vmstrdup(vm, s))) + { + error(ERROR_SYSTEM|2, "out of space"); + goto done; + } + break; + default: + if (cond->flags & SKIP) + continue; + error(2, "'%c': unknown op", op); + goto done; + } + } + if (cond->prev) + error(2, "missing 1 or more f statements"); + done: + if (mp) + sfclose(mp); + error_info.id = id; + error_info.line = line; + if (vm) + vmclose(vm); + return status ? status : error_info.errors != 0; +} + +typedef struct Argv_s +{ + char** argv; + char* args; + int argc; +} Argv_t; + +int +b_pty(int argc, char** argv, Shbltin_t* context) +{ + int master; + int minion; + int fd; + int drop; + int n; + char* s; + Proc_t* proc; + Sfio_t* mp; + Sfio_t* lp; + Argv_t* ap; + char buf[64]; + + int delay = 0; + char* log = 0; + char* messages = 0; + char* stty = 0; + int session = 1; + int timeout = 1000; + int (*fun)(Sfio_t*,Sfio_t*,int,int) = process; + + cmdinit(argc, argv, context, ERROR_CATALOG, 0); + for (;;) + { + switch (optget(argv, usage)) + { + case 'd': + if (opt_info.num) + fun = dialogue; + continue; + case 'D': + error_info.trace = -(int)opt_info.num; + continue; + case 'l': + log = opt_info.arg; + case 'm': + messages = opt_info.arg; + continue; + case 's': + session = !!opt_info.num; + continue; + case 't': + timeout = (int)opt_info.num; + continue; + case 'T': + stty = opt_info.arg; + continue; + case 'w': + delay = (int)opt_info.num; + continue; + case ':': + break; + case '?': + error(ERROR_usage(2), "%s", opt_info.arg); + break; + } + break; + } + argv += opt_info.index; + if (!argv[0]) + error(ERROR_exit(1), "command must be specified"); + if (mkpty(&master, &minion) < 0) + error(ERROR_system(1), "unable to create pty"); + if (!(mp = sfnew(NiL, 0, SF_UNBOUND, master, SF_READ|SF_WRITE))) + error(ERROR_system(1), "cannot open master stream"); + if (stty) + { + n = 2; + for (s = stty; *s; s++) + if (isspace(*s)) + n++; + if (!(ap = newof(0, Argv_t, 1, (n + 2) * sizeof(char*) + (s - stty + 1)))) + error(ERROR_system(1), "out of space"); + ap->argc = n + 1; + ap->argv = (char**)(ap + 1); + ap->args = (char*)(ap->argv + n + 2); + strcpy(ap->args, stty); + ap->argv[0] = "stty"; + sfsprintf(ap->argv[1] = buf, sizeof(buf), "--fd=%d", minion); + ap->argv[2] = s = ap->args; + for (n = 2; *s; s++) + if (isspace(*s)) + { + *s = 0; + ap->argv[++n] = s + 1; + } + ap->argv[n + 1] = 0; + b_stty(ap->argc, ap->argv, 0); + } + if (!log) + lp = 0; + else if (!(lp = sfopen(NiL, log, "w"))) + error(ERROR_system(1), "%s: cannot write", log); + if (!(proc = runcmd(argv, minion, session))) + error(ERROR_system(1), "unable run %s", argv[0]); + close(minion); + if (messages) + { + drop = 1; + if (strneq(messages, "/dev/fd/", 8)) + fd = atoi(messages + 8); + else if (streq(messages, "/dev/stdout")) + fd = 1; + else if ((fd = open(messages, O_CREAT|O_WRONLY, MODE_666)) >= 0) + drop = 0; + else + error(ERROR_system(1), "%s: cannot redirect messages", messages); + close(2); + dup(fd); + if (drop) + close(fd); + } + minion = (*fun)(mp, lp, delay, timeout); + master = procclose(proc); + if (lp && sfclose(lp)) + error(ERROR_system(1), "%s: write error", log); + return minion ? minion : master; +} diff --git a/src/cmd/ksh93/COMPATIBILITY b/src/cmd/ksh93/COMPATIBILITY new file mode 100644 index 000000000..d62fdc545 --- /dev/null +++ b/src/cmd/ksh93/COMPATIBILITY @@ -0,0 +1,224 @@ + ksh 93u+m vs. ksh 93u+ + +The following is a list of changes between ksh 93u+ 2012-08-01 and the new +ksh 93u+m reboot that could cause incompatibilities in rare corner cases. +Fixes of clear bugs in ksh 93u+ are not included here, even though any bugfix +could potentially cause an incompatibility in a script that relies on the bug. +For more details, see the NEWS file and for complete details, see the git log. + +0. A new '-o posix' shell option has been added to ksh 93u+m that makes + the ksh language more compatible with other shells by following the + POSIX standard more closely. See the manual page for details. It is + enabled by default if ksh is invoked as sh. + +1. Bytecode compiled by shcomp 93u+m will not run on older ksh versions. + (However, bytecode compiled by older shcomp will run on ksh 93u+m.) + +2. File name generation (a.k.a. pathname expansion, a.k.a. globbing) now + never matches the special navigational names '.' (current directory) + and '..' (parent directory). This change makes a pattern like .* + useful; it now matches all hidden 'dotfiles' in the current directory. + +3. The bash-style &>foo redirection operator (shorthand for >foo 2>&1) can + now always be used if -o posix is off, and not only in profile scripts. + +4. Most predefined aliases have been converted to regular built-in + commands that work the same way. 'unalias' no longer removes these. + To remove a built-in command, use 'builtin -d'. The 'history' and 'r' + predefined aliases remain, but are now only set on interactive shells. + There are some minor changes in behavior in some former aliases: + - 'redirect' now checks if all arguments are valid redirections + before performing them. If an error occurs, it issues an error + message instead of terminating the shell. + - 'suspend' now refuses to suspend a login shell, as there is probably + no parent shell to return to and the login session would freeze. + - 'times' now gives high precision output in a POSIX compliant format. + +5. 'command' no longer expands aliases in its first argument, as this is + no longer required after change 3 above. In the unlikely event that you + still need this behavior, you can set: + alias command='command ' + +6. The undocumented 'login' and 'newgrp' builtin commands have been + removed. These replaced your shell session with the external commands + by the same name, as in 'exec'. If an error occurred (e.g. due to a + typo), you would end up immediately logged out. If you do want this + behavior, you can restore it by setting: + alias login='exec login' + alias newgrp='exec newgrp' + +7. 'case' no longer retries to match patterns as literal strings if they + fail to match as patterns. This undocumented behaviour broke validation + use cases that are expected to work. For example: + n='[0-9]' + case $n in + [0-9]) echo "$n is a number" ;; + esac + would output "[0-9] is a number". In the unlikely event that a script + does rely on this behavior, it can be fixed like this: + case $n in + [0-9] | "[0-9]") + echo "$n is a number or the number pattern" ;; + esac + +8. If 'set -u'/'set -o nounset' is active, then the shell now errors out + if a nonexistent positional parameter such as $1, $2, ... is accessed. + (This does *not* apply to "$@" and "$*".) + +9. If 'set -u'/'set -o nounset' is active, then the shell now errors out + if $! is accessed before the shell has launched any background process. + +10. The 'print', 'printf' and 'echo' builtin commands now return a nonzero + exit status if an input/output error occurs. + +11. Four obsolete date format specifiers for 'printf %(format)T' were + changed to make them compatible with modern date(1) commands: + - %k and %l now return a blank-padded hour (24-hour and 12-hour clock). + - %f now returns a date with the format '%Y.%m.%d-%H:%M:%S'. + - %q now returns the quarter of the current year. + +12. The 'typeset' builtin now properly detects and reports options that + cannot be used together if they are given as part of the same command. + +13. The DEBUG trap has reverted to pre-93t behavior. It is now once again + reset like other traps upon entering a subshell or ksh-style function, + as documented, and it is no longer prone to crash or get corrupted. + +14. 'command -x' now always runs an external command, bypassing built-ins. + +____________________________________________________________________________ + + KSH-93 VS. KSH-88 + +The following is a list of known incompatibilities between ksh-93 and ksh-88. +I have not included cases that are clearly bugs in ksh-88. I also have +omitted features that are completely upward compatible. + +1. Functions, defined with name() with ksh-93 are compatible with + the POSIX standard, not with ksh-88. No local variables are + permitted, and there is no separate scope. Functions defined + with the function name syntax, maintain compatibility. + This also affects function traces. + +2. ! is now a reserved word. As a result, any command by that + name will no longer work with ksh-93. + +3. The -x attribute of alias and typeset -f is no longer + effective and the ENV file is only read for interactive + shells. You need to use FPATH to make function definitions + visible to scripts. + +4. A built-in command named command has been added which is + always found before the PATH search. Any script which uses + this name as the name of a command (or function) will not + be compatible. + +5. The output format for some built-ins has changed. In particular + the output format for set, typeset and alias now have single + quotes around values that have special characters. The output + for trap without arguments has a format that can be used as input. + +6. With ksh-88, a dollar sign ($') followed by a single quote was + interpreted literally. Now it is an ANSI-C string. You + must quote the dollar sign to get the previous behavior. + Also, a $ in front of a " indicates that the string needs + to be translated for locales other than C or POSIX. The $ + is ignored in the C and POSIX locale. + +7. With ksh-88, tilde expansion did not take place inside ${...}. + with ksh-93, ${foo-~} will cause tilde expansion if foo is + not set. You need to escape the ~ for the previous behavior. + +8. Some changes in the tokenizing rules where made that might + cause some scripts with previously ambiguous use of quoting + to produce syntax errors. + +9. Programs that rely on specific exit values for the shell, + (rather than 0 or non-zero) may not be compatible. The + exit status for many shell failures has been changed. + +10. Built-ins in ksh-88 were always executed before looking for + the command in the PATH variable. This is no longer true. + Thus, with ksh-93, if you have the current directory first + in your PATH, and you have a program named test in your + directory, it will be executed when you type test; the + built-in version will be run at the point /bin is found + in your PATH. + +11. Some undocumented combinations of argument passing to ksh + builtins no longer works since ksh-93 is getopts conforming + with respect to its built-ins. For example, typeset -8i + previously would work as a synonym for typeset -i8. + +12. Command substitution and arithmetic expansion are now performed + on PS1, PS3, and ENV when they are expanded. Thus, ` and $( + as part of the value of these variables must be preceded by a \ + to preserve their previous behavior. + +13. The ERRNO variable has been dropped. + +14. If the file name following a redirection symbol contain pattern + characters they will only be expanded for interactive shells. + +15. The arguments to a dot script will be restored when it completes. + +16. The list of tracked aliases is not displayed with alias unless + the -t option is specified. + +17. The POSIX standard requires that test "$arg" have exit status + of 0, if and only if $arg is null. However, since this breaks + programs that use test -t, ksh-93 treats an explicit test -t + as if the user had entered test -t 1. + +18. The ^T directive of emacs mode has been changed to work the + way it does in gnu-emacs. + +19. ksh-88 allowed unbalanced parentheses within ${name op val} whereas + ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(} + which works with both versions. + +20. kill -l in ksh-93 lists only the signal names, not their numerical + values. + +21. Local variables defined by typeset are statically scoped in + ksh-93. In ksh-88 they were dynamically scoped although this + behavior was never documented. + +22. The value of the variable given to getopts is set to ? when + the end-of-options is reached to conform to the POSIX standard. + +23. Since the POSIX standard requires that octal constants be + recognized, doing arithmetic on typeset -Z variables can + yield different results that with ksh-88. Most of these + differences were eliminated in ksh-93o. Starting in ksh-93u+, the + let command no longer recognizes octal constants starting with 0 + for compatibility with ksh-88 unless the option letoctal is on. + +24. Starting after ksh-93l, If you run ksh name, where name does + not contain a /, the current directory will be searched + before doing a path search on name as required by the POSIX + shell standard. + +25. In ksh-93, cd - will output the directory that it changes + to on standard output as required by X/Open. With ksh-88, + this only happened for interactive shells. + +26. As an undocumented feature of ksh-88, a leading 0 to an + assignment of an integer variable caused that variable + to be treated as unsigned. This behavior was removed + starting in ksh-93p. + +27. The getopts builtin in ksh-93 requires that optstring contain + a leading + to allow options to begin with a +. + +28. In emacs/gmacs mode, control-v will not display the version when + the stty lnext character is set to control-v or is unset. + The sequence escape control-v will display the shell version. + +29. In ksh-88, DEBUG traps were executed. after each command. In ksh-93 + DEBUG traps are executed before each command. + +30. In ksh-88, a redirection to a file name given by an empty string was + ignored. In ksh-93, this is an error. +I am interested in expanding this list so please let me know if you +uncover any others. diff --git a/src/cmd/ksh93/DESIGN b/src/cmd/ksh93/DESIGN new file mode 100644 index 000000000..f8587b6aa --- /dev/null +++ b/src/cmd/ksh93/DESIGN @@ -0,0 +1,171 @@ +Here is an overview of the source code organization for ksh93. + +Directory layout: + + The directory include contains header files for ksh93. + The files nval.h and shell.h are intended to be public + headers and can be used to add runtime builtin command. + The remainder are private. + + The directory data contains readonly data files for ksh93. + The man pages for built-ins are in builtins.c rather + than included as statics with the implementations in the + bltins directory because some systems don't make static const + data readonly and we want these to be shared by all running + shells. + + The directory edit contains the code for command line + editing and history. + + The fun directory contains some shell function such as + pushd, popd, and dirs. + + The directory features contains files that are used to generate + header files in the FEATURE directory. Most of these files + are in a format that is processed by iffe. + + The directory bltins contains code for most of the built-in + commands. Additional built-in commands are part of libcmd. + + The directory sh contains most of the code for ksh93. + + The directory tests contains a number of regression tests. + In most cases, when a bug gets fixed, a test is added to + one of these files. The regression tests can be run by + going to this directory and running + SHELL=shell_path shell_path shtests + where shell_path is an absolute pathname for the shell to + be tested. + + The top level directory contains the nmake Makefile, the + RELEASE file, the ksh93 man file (sh.1) and nval.3 and shell.3 + documentation files. The RELEASE file contains the list of bug + fixes and new features since the original ksh93 release. The file + COMPATIBILITY is a list of all known incompatibilities with ksh88. + +Include directory: + 1. argnod.h contains the type definitions for command + nodes, io nodes, argument nodes, and for positional + parameters.a It defines the prototypes for + all the positional parameters functions. + 2. builtins.h contains prototypes for builtins as well + as symbolic constants that refer to the name-pairs + that are associated with some of the built-ins. + It also contains prototypes for many of the strings. + 3. defs.h is the catch all for all definitions that + don't fit elsewhere and it includes several other + headers. It defines a structure that contains ksh + global data, sh, and a structure that contains per + function data, sh.st. + 4. edit.h contains definitions that are common to both + vi and emacs edit modes. + 5. fault.h contains prototypes for signal related + functions and trap and fault handling. + 6. fcin.h contains macro and function definitions for + reading from a file or string. + 7. history.h contains macros and functions definitions + related to history file processing. + 8. jobs.h contains the definitions relating to job + processing and control. + 9. lexstates.h contains the states associated with + lexical processing. + 10. name.h contains the internal definitions related + to name-value pair processing. + 11. national.h contains a few I18N definitions, mostly + obsolete. + 12. nval.h is the public interface to the name-value + pair library that is documented with nval.3. + 13. path.h contains the interface for pathname processing + and pathname searching. + 14. shell.h is the public interface for shell functions + that are documented int shell.3. + 15. shlex.h contains the lexical token definitions and + interfaces for lexical analysis. + 16. shnodes.h contains the definition of the structures + for each of the parse nodes and flags for the attributes. + 17. shtable.h contains some interfaces and functions for + table lookup. + 18. streval.h contains the interface to the arithmetic + functions. + 19. terminal.h is a header file that includes the appropriate + terminal include. + 20. test.h contains the definitions for the test and [[...]] + commands. + 21. timeout.h contains the define constant for the maximum + shell timeout. + 22. ulimit.h includes the appropriate resource header. + 23. variables.h contains symbolic constants for the built-in + shell variables. + 24. version.h contains the version string for this release. + +sh directory: + 1. args.c contains functions for parsing shell options + and for processing positional parameters. + 2. arith.c contains callback functions for the streval.c + library and the interface to shell arithmetic. + 3. array.c contains the code for indexed and associative + arrays. + 4. defs.c contains the data definitions for global symbols. + 5. deparse.c contains code to generate shell script from + a parse tree. + 6. expand.c contains code for file name expansion and + file name generation. + 7. fault.c contains code for signal processing, trap + handling and termination. + 8. fcin.c contains code for reading and writing a character + at a time from a file or string. + 9. init.c contains initialization code and callbacks + for get and set functions for built-in variables. + 10. io.o contains code for redirections and managing file + descriptors and file streams. + 11. jobs.c contains the code for job management. + 12. lex.c contains the code for the lexical analyzer. + 13. macro.c contains code for the $ macro expansions, including + here-documents. + 14. main.c contains the calls to initialization, profile + processing and the main evaluation loop as well as + mail processing. + 15. name.c contains the name-value pair routines that are + built on the hash library in libast. + 16. nvdisc.c contains code related to name-value pair disciplines. + 17. nvtree.c contains code for compound variables and for + walking the namespace. + 18. nvtype.c contains most of the code related to types that + are created with typeset -T. + 19. parse.c contains the code for the shell parser. + 20. path.c contains the code for pathname lookup and + some path functions. It also contains the code + that executes commands and scripts. + 21. pmain.c is just a calls sh_main() so that all of the + rest of the shell can be in a shared library. + 22. shcomp.c contains the main program to the shell + compiler. This program parses a script and creates + a file that the shell can read containing the parse tree. + 23. streval.c is an C arithmetic evaluator. + 24. string.c contains some string related functions. + 25. subshell.c contains the code to save and restore + environments so that subshells can run without creating + a new process. + 26. suid_exec.c contains the program from running execute + only and/or setuid/setgid scripts. + 27. tdump.c contains the code to dump a parse tree into + a file. + 28. timers.c contains code for multiple event timeouts. + 29. trestore contains the code for restoring the parse + tree from the file created by tdump. + 30. userinit.c contains a dummy userinit() function. + This is now obsolete with the new version of sh_main(). + 31. waitevent.c contains the sh_waitnotify function so + that builtins can handle processing events when the + shell is waiting for input or for process completion. + 32. xec.c is the main shell execution loop. + +edit directory: + 1. completion.c contains code for command and file generation and + completion. + 2. edit.c contains common editing and terminal code for vi and + emacs. + 3. emacs.c contains code for the emacs editor. + 4. hexpand.c contains code for C-shell style history expansions. + 5. history.c contains code for creating managing the history file. + 6. vi.c contains the code for the vi editor. diff --git a/src/cmd/ksh93/Mamfile b/src/cmd/ksh93/Mamfile new file mode 100644 index 000000000..490d55d7e --- /dev/null +++ b/src/cmd/ksh93/Mamfile @@ -0,0 +1,1589 @@ +info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20 +note * +note * This build file is in the Make Abstract Machine (MAM) language. It was +note * first generated by nmake, but in the ksh 93u+m distribution we maintain +note * it manually because nmake had too many problems to keep using. The +note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added +note * support for indentation to improve readability. The language is +note * documented in Glenn Fowler's paper "A Make Abstract Machine": +note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html +note * +setv INSTALLROOT ../../.. +setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast +setv PACKAGE_ast_LIB ${INSTALLROOT}/lib +setv PACKAGEROOT ../../../../.. +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv ARFLAGS rc +setv AS as +setv ASFLAGS +setv CC cc +setv mam_cc_FLAGS +setv KSH_RELFLAGS +setv KSH_SHOPTFLAGS +setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} +setv COTEMP $$ +setv CPIO cpio +setv CPIOFLAGS +setv CPP "${CC} -E" +setv F77 f77 +setv HOSTCC ${CC} +setv IFFEFLAGS +setv IGNORE +setv LD ld +setv LDFLAGS +setv LEX lex +setv LEXFLAGS +setv LPR lpr +setv LPRFLAGS +setv M4FLAGS +setv NMAKE nmake +setv NMAKEFLAGS +setv PR pr +setv PRFLAGS +setv SHELL /bin/sh +setv SILENT +setv TAR tar +setv YACC yacc +setv YACCFLAGS -d +make ${PACKAGEROOT}/lib/package/ast.lic +done ${PACKAGEROOT}/lib/package/ast.lic +make install + make ksh + make SHOPT.sh implicit + done SHOPT.sh generated + make pmain.o + make sh/pmain.c + make FEATURE/externs implicit + meta FEATURE/externs features/%>FEATURE/% features/externs externs + make features/externs + done features/externs + exec - set - + exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -c 1.${COTEMP}.c && + exec - x=`${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` && + exec - { + exec - case "" in + exec - *?) echo " " ;; + exec - esac + exec - for i in shell dll cmd ast m jobs i socket nsl secdb + exec - do case $i in + exec - "shell"|shell) + exec - ;; + exec - *) if test -f ${INSTALLROOT}/lib/lib/$i + exec - then y=`cat ${INSTALLROOT}/lib/lib/$i` + exec - case $y in + exec - *-?*) echo "" $y ;; + exec - esac + exec - continue + exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a + exec - then case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in + exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in + exec - *$x*) continue ;; + exec - esac + exec - ;; + exec - esac + exec - fi + exec - ;; + exec - esac + exec - echo " -l$i" + exec - done + exec - } > shell.req + exec - rm -f 1.${COTEMP}.* + bind -ldll + bind -lcmd + bind -last + bind -lm dontcare + bind -lnsl dontcare + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs + done FEATURE/externs generated + make include/shell.h implicit + make ${PACKAGE_ast_INCLUDE}/cmd.h implicit + make ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit + done ${PACKAGE_ast_INCLUDE}/dlldefs.h dontcare + make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit + make ${PACKAGE_ast_INCLUDE}/shcmd.h implicit + make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare + done ${PACKAGE_ast_INCLUDE}/shcmd.h dontcare + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/cmdext.h dontcare + prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit + make ${PACKAGE_ast_INCLUDE}/stak.h implicit + make ${PACKAGE_ast_INCLUDE}/stk.h implicit + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + make ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + done ${PACKAGE_ast_INCLUDE}/sfio_s.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_map.h dontcare + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/bytesex.h dontcare + done ${PACKAGE_ast_INCLUDE}/endian.h dontcare + done ${PACKAGE_ast_INCLUDE}/ast_common.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_api.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare + done ${PACKAGE_ast_INCLUDE}/ast_wctype.h dontcare + done ${PACKAGE_ast_INCLUDE}/wctype.h dontcare + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_stdio.h dontcare + done ${PACKAGE_ast_INCLUDE}/stdio.h dontcare + prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/regex.h dontcare + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_botch.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_limits.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_fs.h dontcare + done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_sys.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare + done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/stk.h dontcare + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/stak.h dontcare + make ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/option.h implicit + make ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + done ${PACKAGE_ast_INCLUDE}/vmalloc.h dontcare + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/ast.h dontcare + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/option.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/error.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/cmd.h dontcare + prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit + make include/nval.h implicit + prev ${PACKAGE_ast_INCLUDE}/option.h implicit + make ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + done ${PACKAGE_ast_INCLUDE}/cdt.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/nval.h dontcare + make include/name.h implicit + prev include/nval.h implicit + prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/name.h dontcare + prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/shell.h + done sh/pmain.c + meta pmain.o %.c>%.o sh/pmain.c pmain + prev sh/pmain.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/pmain.c + done pmain.o generated + make libshell.a archive + prev shell.req + make alarm.o + make bltins/alarm.c + make FEATURE/time implicit + meta FEATURE/time features/%>FEATURE/% features/time time + make features/time + done features/time + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time + make ${PACKAGE_ast_INCLUDE}/times.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_time.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/times.h dontcare + done FEATURE/time generated + make include/builtins.h implicit + make include/shtable.h implicit + done include/shtable.h dontcare + make FEATURE/dynamic implicit + meta FEATURE/dynamic features/%>FEATURE/% features/dynamic dynamic + make features/dynamic + done features/dynamic + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic + prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit + done FEATURE/dynamic dontcare generated + make FEATURE/options implicit + meta FEATURE/options features/%>FEATURE/% features/options options + make features/options + done features/options + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options + done FEATURE/options dontcare generated + prev ${PACKAGE_ast_INCLUDE}/option.h implicit + done include/builtins.h + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + make include/defs.h implicit + make include/regress.h implicit + done include/regress.h dontcare + prev include/shtable.h implicit + prev include/shell.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + prev include/name.h implicit + make include/argnod.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + done include/argnod.h dontcare + make include/fault.h implicit + make FEATURE/sigfeatures implicit + meta FEATURE/sigfeatures features/%>FEATURE/% features/sigfeatures sigfeatures + make features/sigfeatures + done features/sigfeatures + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures + done FEATURE/sigfeatures dontcare generated + make FEATURE/setjmp implicit + meta FEATURE/setjmp features/%>FEATURE/% features/setjmp setjmp + make features/setjmp + done features/setjmp + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/setjmp + done FEATURE/setjmp dontcare generated + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/sig.h implicit + done ${PACKAGE_ast_INCLUDE}/sig.h dontcare + done include/fault.h dontcare + make include/history.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/history.h dontcare + prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev FEATURE/options implicit + prev FEATURE/externs implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/defs.h + done bltins/alarm.c + meta alarm.o %.c>%.o bltins/alarm.c alarm + prev bltins/alarm.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/alarm.c + done alarm.o generated + make cd_pwd.o + make bltins/cd_pwd.c + make ${PACKAGE_ast_INCLUDE}/ls.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_mode.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/ls.h + prev include/builtins.h implicit + prev include/name.h implicit + make include/path.h implicit + make FEATURE/acct implicit + meta FEATURE/acct >FEATURE/% acct + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct + done FEATURE/acct dontcare generated + prev include/defs.h implicit + prev include/nval.h implicit + prev FEATURE/options implicit + done include/path.h + make include/variables.h implicit + prev FEATURE/dynamic implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/option.h implicit + done include/variables.h + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev include/defs.h implicit + done bltins/cd_pwd.c + meta cd_pwd.o %.c>%.o bltins/cd_pwd.c cd_pwd + prev bltins/cd_pwd.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/cd_pwd.c + done cd_pwd.o generated + make cflow.o + make bltins/cflow.c + prev include/builtins.h implicit + make include/shnodes.h implicit + prev include/argnod.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/shnodes.h + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev include/defs.h implicit + done bltins/cflow.c + meta cflow.o %.c>%.o bltins/cflow.c cflow + prev bltins/cflow.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/cflow.c + done cflow.o generated + make deparse.o + make sh/deparse.c + make include/test.h implicit + prev include/shtable.h implicit + prev include/defs.h implicit + prev FEATURE/options implicit + done include/test.h + prev include/shnodes.h implicit + prev include/defs.h implicit + done sh/deparse.c + meta deparse.o %.c>%.o sh/deparse.c deparse + prev sh/deparse.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/deparse.c + done deparse.o generated + make enum.o + make bltins/enum.c + prev include/shell.h implicit + done bltins/enum.c + meta enum.o %.c>%.o bltins/enum.c enum + prev bltins/enum.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libshell"\" -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/enum.c + prev SHOPT.sh + done enum.o generated + make getopts.o + make bltins/getopts.c + prev include/builtins.h implicit + prev include/nval.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + done bltins/getopts.c + meta getopts.o %.c>%.o bltins/getopts.c getopts + prev bltins/getopts.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/getopts.c + done getopts.o generated + make hist.o + make bltins/hist.c + make include/edit.h implicit + make include/national.h implicit + done include/national.h dontcare + make include/terminal.h implicit + make FEATURE/ttys implicit + meta FEATURE/ttys features/%>FEATURE/% features/ttys ttys + make features/ttys + done features/ttys + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys + done FEATURE/ttys dontcare generated + done include/terminal.h dontcare + prev FEATURE/setjmp implicit + prev ${PACKAGE_ast_INCLUDE}/sig.h implicit + make FEATURE/locale implicit + meta FEATURE/locale features/%>FEATURE/% features/locale locale + make features/locale + done features/locale + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale + done FEATURE/locale dontcare generated + prev FEATURE/options implicit + done include/edit.h dontcare + prev include/builtins.h implicit + prev include/history.h implicit + prev include/name.h implicit + make include/io.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/io.h + prev include/variables.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev include/defs.h implicit + done bltins/hist.c + meta hist.o %.c>%.o bltins/hist.c hist + prev bltins/hist.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/hist.c + done hist.o generated + make misc.o + make bltins/misc.c + make include/jobs.h implicit + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev include/terminal.h implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/jobs.h + prev include/builtins.h implicit + prev include/history.h implicit + prev include/name.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/shnodes.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + done bltins/misc.c + meta misc.o %.c>%.o bltins/misc.c misc + prev bltins/misc.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c + done misc.o generated + make print.o + make bltins/print.c + make ${PACKAGE_ast_INCLUDE}/ccode.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_ccode.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/ccode.h + make ${PACKAGE_ast_INCLUDE}/tmx.h implicit + make ${PACKAGE_ast_INCLUDE}/tv.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done ${PACKAGE_ast_INCLUDE}/tv.h dontcare + make ${PACKAGE_ast_INCLUDE}/tm.h implicit + prev ${PACKAGE_ast_INCLUDE}/times.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/tm.h dontcare + done ${PACKAGE_ast_INCLUDE}/tmx.h + make include/streval.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_float.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_float.h dontcare + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/streval.h + prev include/builtins.h implicit + prev include/history.h implicit + prev include/name.h implicit + prev include/io.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/defs.h implicit + done bltins/print.c + meta print.o %.c>%.o bltins/print.c print + prev bltins/print.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c bltins/print.c + done print.o generated + make read.o + make bltins/read.c + prev include/edit.h implicit + prev include/terminal.h implicit + prev include/history.h implicit + prev include/builtins.h implicit + prev include/name.h implicit + prev include/io.h implicit + make include/lexstates.h implicit + prev ${PACKAGE_ast_INCLUDE}/wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/wchar.h implicit + prev FEATURE/locale implicit + done include/lexstates.h + prev include/variables.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done bltins/read.c + meta read.o %.c>%.o bltins/read.c read + prev bltins/read.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c + done read.o generated + make sleep.o + make bltins/sleep.c + make FEATURE/poll implicit + meta FEATURE/poll features/%>FEATURE/% features/poll poll + make features/poll + done features/poll + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll + done FEATURE/poll generated + prev FEATURE/time implicit + prev include/builtins.h implicit + prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/defs.h implicit + done bltins/sleep.c + meta sleep.o %.c>%.o bltins/sleep.c sleep + prev bltins/sleep.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/sleep.c + done sleep.o generated + make trap.o + make bltins/trap.c + prev include/builtins.h implicit + prev include/jobs.h implicit + prev include/defs.h implicit + done bltins/trap.c + meta trap.o %.c>%.o bltins/trap.c trap + prev bltins/trap.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/trap.c + done trap.o generated + make test.o + make bltins/test.c + prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit + prev FEATURE/poll implicit + prev FEATURE/externs implicit + prev include/builtins.h implicit + prev include/test.h implicit + prev include/terminal.h implicit + prev include/io.h implicit + prev ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/defs.h implicit + done bltins/test.c + meta test.o %.c>%.o bltins/test.c test + prev bltins/test.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c bltins/test.c + done test.o generated + make typeset.o + make bltins/typeset.c + prev FEATURE/dynamic implicit + prev include/variables.h implicit + prev include/builtins.h implicit + prev include/history.h implicit + prev include/name.h implicit + prev include/path.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/defs.h implicit + done bltins/typeset.c + meta typeset.o %.c>%.o bltins/typeset.c typeset + prev bltins/typeset.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c + done typeset.o generated + make ulimit.o + make bltins/ulimit.c + make include/ulimit.h implicit + make FEATURE/rlimits implicit + meta FEATURE/rlimits features/%>FEATURE/% features/rlimits rlimits + make features/rlimits + done features/rlimits + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits + done FEATURE/rlimits dontcare generated + prev FEATURE/time implicit + done include/ulimit.h + prev include/name.h implicit + prev include/builtins.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done bltins/ulimit.c + meta ulimit.o %.c>%.o bltins/ulimit.c ulimit + prev bltins/ulimit.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/ulimit.c + done ulimit.o generated + make umask.o + make bltins/umask.c + prev include/builtins.h implicit + prev include/shell.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done bltins/umask.c + meta umask.o %.c>%.o bltins/umask.c umask + prev bltins/umask.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/umask.c + done umask.o generated + make whence.o + make bltins/whence.c + prev include/builtins.h implicit + make include/shlex.h implicit + prev include/lexstates.h implicit + prev include/shtable.h implicit + prev include/shnodes.h implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit + done include/shlex.h + prev include/path.h implicit + prev include/name.h implicit + prev include/shtable.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/defs.h implicit + done bltins/whence.c + meta whence.o %.c>%.o bltins/whence.c whence + prev bltins/whence.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/whence.c + done whence.o generated + make main.o + make sh/main.c + make execargs.h implicit + done execargs.h dontcare virtual + make nc.h implicit + done nc.h dontcare virtual + prev FEATURE/externs implicit + make FEATURE/execargs implicit + meta FEATURE/execargs >FEATURE/% execargs + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs + done FEATURE/execargs generated + make FEATURE/pstat implicit + meta FEATURE/pstat >FEATURE/% pstat + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat + done FEATURE/pstat generated + make FEATURE/setproctitle implicit + meta FEATURE/setproctitle >FEATURE/% setproctitle + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def setproctitle + done FEATURE/setproctitle generated + prev FEATURE/time implicit + make include/timeout.h implicit + done include/timeout.h + prev include/history.h implicit + prev include/shnodes.h implicit + prev include/shlex.h implicit + prev include/jobs.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + make include/fcin.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + done include/fcin.h + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done sh/main.c + meta main.o %.c>%.o sh/main.c main + prev sh/main.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_TIMEOUT+-DSHOPT_TIMEOUT=${SHOPT_TIMEOUT}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_REMOTE+-DSHOPT_REMOTE=${SHOPT_REMOTE}} ${SHOPT_OLDTERMIO+-DSHOPT_OLDTERMIO=${SHOPT_OLDTERMIO}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}}${SH_DICT+-DSH_DICT=${SH_DICT}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/main.c + done main.o generated + make nvdisc.o + make sh/nvdisc.c + prev include/path.h implicit + prev include/builtins.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + done sh/nvdisc.c + meta nvdisc.o %.c>%.o sh/nvdisc.c nvdisc + prev sh/nvdisc.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/nvdisc.c + done nvdisc.o generated + make nvtype.o + make sh/nvtype.c + prev include/variables.h implicit + prev include/io.h implicit + prev include/defs.h implicit + done sh/nvtype.c + meta nvtype.o %.c>%.o sh/nvtype.c nvtype + prev sh/nvtype.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/nvtype.c + done nvtype.o generated + make arith.o + make sh/arith.c + prev include/builtins.h implicit + prev include/variables.h implicit + prev include/streval.h implicit + prev include/name.h implicit + prev include/lexstates.h implicit + prev include/defs.h implicit + done sh/arith.c + meta arith.o %.c>%.o sh/arith.c arith + prev sh/arith.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/arith.c + done arith.o generated + make args.o + make sh/args.c + prev include/io.h implicit + prev include/shlex.h implicit + prev FEATURE/poll implicit + prev include/edit.h implicit + prev include/terminal.h implicit + prev include/builtins.h implicit + prev include/path.h implicit + prev include/defs.h implicit + done sh/args.c + meta args.o %.c>%.o sh/args.c args + prev sh/args.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/args.c + done args.o generated + make array.o + make sh/array.c + prev include/name.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev include/defs.h implicit + done sh/array.c + meta array.o %.c>%.o sh/array.c array + prev sh/array.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/array.c + done array.o generated + make completion.o + make edit/completion.c + prev include/history.h implicit + prev include/edit.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/lexstates.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + prev include/defs.h implicit + done edit/completion.c + meta completion.o %.c>%.o edit/completion.c completion + prev edit/completion.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DKSHELL -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/completion.c + done completion.o generated + make defs.o + make sh/defs.c + prev include/timeout.h implicit + prev include/edit.h implicit + prev include/shlex.h implicit + prev include/jobs.h implicit + prev include/defs.h implicit + done sh/defs.c + meta defs.o %.c>%.o sh/defs.c defs + prev sh/defs.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/defs.c + done defs.o generated + make edit.o + make edit/edit.c + prev include/edit.h implicit + prev include/history.h implicit + prev include/terminal.h implicit + prev include/io.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + make FEATURE/cmds implicit + meta FEATURE/cmds features/%>FEATURE/% features/cmds cmds + make features/cmds + done features/cmds + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds + done FEATURE/cmds generated + prev FEATURE/time implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done edit/edit.c + meta edit.o %.c>%.o edit/edit.c edit + prev edit/edit.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/edit.c + done edit.o generated + make expand.o + make sh/expand.c + prev include/path.h implicit + prev include/io.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_dir.h implicit + make ${PACKAGE_ast_INCLUDE}/dirent.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_dirent.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_dirent.h dontcare + done ${PACKAGE_ast_INCLUDE}/dirent.h dontcare + make dirlib.h implicit + done dirlib.h dontcare virtual + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_dir.h + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + make ${PACKAGE_ast_INCLUDE}/glob.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/glob.h + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev include/test.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + done sh/expand.c + meta expand.o %.c>%.o sh/expand.c expand + prev sh/expand.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/expand.c + done expand.o generated + make regress.o + make bltins/regress.c + prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit + prev include/builtins.h implicit + prev include/io.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/defs.h implicit + done bltins/regress.c + meta regress.o %.c>%.o bltins/regress.c regress + prev bltins/regress.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c bltins/regress.c + done regress.o generated + make fault.o + make sh/fault.c + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev include/ulimit.h implicit + prev include/builtins.h implicit + prev include/path.h implicit + prev include/jobs.h implicit + prev include/variables.h implicit + prev include/shlex.h implicit + prev include/history.h implicit + prev include/io.h implicit + prev include/fcin.h implicit + prev include/defs.h implicit + done sh/fault.c + meta fault.o %.c>%.o sh/fault.c fault + prev sh/fault.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/fault.c + done fault.o generated + make fcin.o + make sh/fcin.c + prev include/fcin.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done sh/fcin.c + meta fcin.o %.c>%.o sh/fcin.c fcin + prev sh/fcin.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/fcin.c + done fcin.o generated + make history.o + make edit/history.c + prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit + prev include/history.h implicit + prev include/io.h implicit + prev include/builtins.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev FEATURE/time implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done edit/history.c + meta history.o %.c>%.o edit/history.c history + prev edit/history.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c edit/history.c + done history.o generated + make init.o + make sh/init.c + prev ${PACKAGE_ast_INCLUDE}/wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make include/version.h implicit + done include/version.h + prev include/lexstates.h implicit + prev FEATURE/externs implicit + prev FEATURE/dynamic implicit + prev FEATURE/time implicit + prev include/builtins.h implicit + prev include/shlex.h implicit + prev include/io.h implicit + prev include/jobs.h implicit + prev include/edit.h implicit + prev include/name.h implicit + prev include/fault.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit + prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev include/defs.h implicit + done sh/init.c + meta init.o %.c>%.o sh/init.c init + prev sh/init.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/init.c + done init.o generated + make io.o + make sh/io.c + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + prev FEATURE/poll implicit + prev FEATURE/dynamic implicit + prev FEATURE/externs implicit + prev include/timeout.h implicit + prev include/edit.h implicit + prev include/history.h implicit + prev include/shnodes.h implicit + prev include/jobs.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev include/fcin.h implicit + prev include/defs.h implicit + done sh/io.c + meta io.o %.c>%.o sh/io.c io + prev sh/io.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/io.c + done io.o generated + make jobs.o + make sh/jobs.c + prev include/history.h implicit + prev include/jobs.h implicit + prev include/io.h implicit + make ${PACKAGE_ast_INCLUDE}/wait.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_wait.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + done ${PACKAGE_ast_INCLUDE}/wait.h + prev include/defs.h implicit + done sh/jobs.c + meta jobs.o %.c>%.o sh/jobs.c jobs + prev sh/jobs.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/jobs.c + done jobs.o generated + make lex.o + make sh/lex.c + prev include/shlex.h implicit + prev include/io.h implicit + prev include/lexstates.h implicit + prev include/test.h implicit + prev include/argnod.h implicit + prev include/shell.h implicit + prev include/defs.h implicit + prev FEATURE/options implicit + prev include/nval.h implicit + prev include/fcin.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done sh/lex.c + meta lex.o %.c>%.o sh/lex.c lex + prev sh/lex.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/lex.c + done lex.o generated + make macro.o + make sh/macro.c + prev include/streval.h implicit + prev include/national.h implicit + prev include/path.h implicit + prev include/shnodes.h implicit + prev include/jobs.h implicit + prev include/io.h implicit + prev include/shlex.h implicit + prev include/variables.h implicit + prev include/name.h implicit + prev ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev include/fcin.h implicit + prev include/defs.h implicit + done sh/macro.c + meta macro.o %.c>%.o sh/macro.c macro + prev sh/macro.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/macro.c + done macro.o generated + make name.o + make sh/name.c + prev include/builtins.h implicit + prev include/shnodes.h implicit + prev include/streval.h implicit + prev FEATURE/externs implicit + prev include/timeout.h implicit + prev include/lexstates.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + done sh/name.c + meta name.o %.c>%.o sh/name.c name + prev sh/name.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/name.c + done name.o generated + make nvtree.o + make sh/nvtree.c + prev include/lexstates.h implicit + prev include/argnod.h implicit + prev include/name.h implicit + prev include/defs.h implicit + done sh/nvtree.c + meta nvtree.o %.c>%.o sh/nvtree.c nvtree + prev sh/nvtree.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/nvtree.c + done nvtree.o generated + make parse.o + make sh/parse.c + prev include/path.h implicit + prev include/test.h implicit + prev include/builtins.h implicit + prev include/history.h implicit + prev include/shlex.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/fcin.h implicit + prev include/shell.h implicit + prev include/defs.h implicit + prev include/version.h implicit + done sh/parse.c + meta parse.o %.c>%.o sh/parse.c parse + prev sh/parse.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/parse.c + done parse.o generated + make path.o + make sh/path.c + prev FEATURE/time implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_vfork.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_vfork.h dontcare + make exec_attr.h implicit + done exec_attr.h dontcare virtual + prev FEATURE/externs implicit + prev FEATURE/dynamic implicit + prev include/test.h implicit + prev include/history.h implicit + prev include/jobs.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev include/nval.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev include/fcin.h implicit + prev include/defs.h implicit + done sh/path.c + meta path.o %.c>%.o sh/path.c path + prev sh/path.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/path.c + done path.o generated + make string.o + make sh/string.c + prev ${PACKAGE_ast_INCLUDE}/wctype.h implicit + prev include/national.h implicit + prev include/lexstates.h implicit + prev include/shtable.h implicit + prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done sh/string.c + meta string.o %.c>%.o sh/string.c string + prev sh/string.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/string.c + done string.o generated + make streval.o + make sh/streval.c + prev include/defs.h implicit + prev FEATURE/externs implicit + prev ${PACKAGE_ast_INCLUDE}/stak.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/streval.h implicit + done sh/streval.c + meta streval.o %.c>%.o sh/streval.c streval + prev sh/streval.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/streval.c + done streval.o generated + make subshell.o + make sh/subshell.c + prev include/path.h implicit + prev include/variables.h implicit + prev include/jobs.h implicit + prev include/shlex.h implicit + prev include/shnodes.h implicit + prev include/fault.h implicit + prev include/io.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev include/defs.h implicit + done sh/subshell.c + meta subshell.o %.c>%.o sh/subshell.c subshell + prev sh/subshell.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/subshell.c + done subshell.o generated + make tdump.o + make sh/tdump.c + prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/shnodes.h implicit + prev include/defs.h implicit + done sh/tdump.c + meta tdump.o %.c>%.o sh/tdump.c tdump + prev sh/tdump.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/tdump.c + done tdump.o generated + make timers.o + make sh/timers.c + prev FEATURE/time implicit + prev FEATURE/sigfeatures implicit + prev include/defs.h implicit + prev include/fault.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/sig.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done sh/timers.c + meta timers.o %.c>%.o sh/timers.c timers + prev sh/timers.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/timers.c + done timers.o generated + make trestore.o + make sh/trestore.c + prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/shnodes.h implicit + prev include/defs.h implicit + done sh/trestore.c + meta trestore.o %.c>%.o sh/trestore.c trestore + prev sh/trestore.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/trestore.c + done trestore.o generated + make waitevent.o + make sh/waitevent.c + prev include/defs.h implicit + done sh/waitevent.c + meta waitevent.o %.c>%.o sh/waitevent.c waitevent + prev sh/waitevent.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/waitevent.c + done waitevent.o generated + make xec.o + make sh/xec.c + prev ${PACKAGE_ast_INCLUDE}/ast_vfork.h implicit + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev include/streval.h implicit + prev FEATURE/locale implicit + prev FEATURE/externs implicit + prev FEATURE/time implicit + prev include/builtins.h implicit + prev include/test.h implicit + prev include/jobs.h implicit + prev include/shnodes.h implicit + prev include/io.h implicit + prev include/name.h implicit + prev include/path.h implicit + prev include/variables.h implicit + prev include/fcin.h implicit + prev include/defs.h implicit + done sh/xec.c + meta xec.o %.c>%.o sh/xec.c xec + prev sh/xec.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/xec.c + done xec.o generated + make limits.o + make data/limits.c + prev include/ulimit.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done data/limits.c + meta limits.o %.c>%.o data/limits.c limits + prev data/limits.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -c data/limits.c + done limits.o generated + make msg.o + make data/msg.c + prev FEATURE/cmds implicit + prev include/edit.h implicit + prev include/jobs.h implicit + prev include/builtins.h implicit + prev include/history.h implicit + prev include/timeout.h implicit + prev include/shlex.h implicit + prev include/io.h implicit + prev include/path.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done data/msg.c + meta msg.o %.c>%.o data/msg.c msg + prev data/msg.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c data/msg.c + done msg.o generated + make strdata.o + make data/strdata.c + make FEATURE/math implicit + meta FEATURE/math features/%.sh>FEATURE/% features/math.sh math + make features/math.sh + make data/math.tab implicit + done data/math.tab + done features/math.sh dontcare + exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab + make ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_standards.h dontcare + done FEATURE/math generated + prev include/streval.h implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit + done data/strdata.c + meta strdata.o %.c>%.o data/strdata.c strdata + prev data/strdata.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/strdata.c + done strdata.o generated + make testops.o + make data/testops.c + prev include/test.h implicit + prev include/defs.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done data/testops.c + meta testops.o %.c>%.o data/testops.c testops + prev data/testops.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/testops.c + done testops.o generated + make keywords.o + make data/keywords.c + prev FEATURE/options implicit + prev include/shlex.h implicit + prev include/shell.h implicit + done data/keywords.c + meta keywords.o %.c>%.o data/keywords.c keywords + prev data/keywords.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c data/keywords.c + done keywords.o generated + make options.o + make data/options.c + prev include/shtable.h implicit + prev include/name.h implicit + prev include/defs.h implicit + done data/options.c + meta options.o %.c>%.o data/options.c options + prev data/options.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/options.c + done options.o generated + make signals.o + make data/signals.c + prev include/defs.h implicit + done data/signals.c + meta signals.o %.c>%.o data/signals.c signals + prev data/signals.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/signals.c + done signals.o generated + make aliases.o + make data/aliases.c + prev FEATURE/dynamic implicit + prev FEATURE/options implicit + prev include/defs.h implicit + done data/aliases.c + meta aliases.o %.c>%.o data/aliases.c aliases + prev data/aliases.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/aliases.c + done aliases.o generated + make builtins.o + make data/builtins.c + prev FEATURE/cmds implicit + prev include/jobs.h implicit + prev include/builtins.h implicit + prev include/version.h implicit + prev include/name.h implicit + prev include/ulimit.h implicit + prev include/shtable.h implicit + prev include/defs.h implicit + done data/builtins.c + meta builtins.o %.c>%.o data/builtins.c builtins + prev data/builtins.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c data/builtins.c + done builtins.o generated + make variables.o + make data/variables.c + prev include/builtins.h implicit + prev include/variables.h implicit + prev include/defs.h implicit + prev include/name.h implicit + prev include/shtable.h implicit + prev include/shell.h implicit + prev FEATURE/dynamic implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done data/variables.c + meta variables.o %.c>%.o data/variables.c variables + prev data/variables.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/variables.c + done variables.o generated + make lexstates.o + make data/lexstates.c + prev include/lexstates.h implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done data/lexstates.c + meta lexstates.o %.c>%.o data/lexstates.c lexstates + prev data/lexstates.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -c data/lexstates.c + done lexstates.o generated + make emacs.o + make edit/emacs.c + prev include/terminal.h implicit + prev include/edit.h implicit + prev include/history.h implicit + prev include/io.h implicit + prev include/defs.h implicit + prev FEATURE/cmds implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done edit/emacs.c + meta emacs.o %.c>%.o edit/emacs.c emacs + prev edit/emacs.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/emacs.c + done emacs.o generated + make vi.o + make edit/vi.c + prev include/lexstates.h implicit + prev FEATURE/time implicit + prev include/terminal.h implicit + prev include/edit.h implicit + prev include/history.h implicit + prev include/io.h implicit + prev FEATURE/options implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev include/defs.h implicit + done edit/vi.c + meta vi.o %.c>%.o edit/vi.c vi + prev edit/vi.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DKSHELL -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/vi.c + done vi.o generated + make hexpand.o + make edit/hexpand.c + prev include/edit.h implicit + prev include/defs.h implicit + done edit/hexpand.c + meta hexpand.o %.c>%.o edit/hexpand.c hexpand + prev edit/hexpand.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/hexpand.c + done hexpand.o generated + exec - ${AR} rc libshell.a alarm.o cd_pwd.o cflow.o deparse.o enum.o getopts.o hist.o misc.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o main.o nvdisc.o nvtype.o arith.o args.o array.o completion.o defs.o edit.o expand.o regress.o fault.o fcin.o + exec - ${AR} rc libshell.a history.o init.o io.o jobs.o lex.o macro.o name.o nvtree.o parse.o path.o string.o streval.o subshell.o tdump.o timers.o trestore.o waitevent.o xec.o limits.o msg.o strdata.o testops.o keywords.o options.o signals.o aliases.o builtins.o variables.o lexstates.o emacs.o vi.o hexpand.o + exec - (ranlib libshell.a) >/dev/null 2>&1 || true + done libshell.a generated + bind -lshell + prev +ljobs + prev +li + prev ${mam_libsocket} + prev ${mam_libsecdb} + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libast} + done ksh generated + make shcomp + make shcomp.o + make sh/shcomp.c + prev include/shnodes.h implicit + prev include/defs.h implicit + prev include/shell.h implicit + prev include/version.h implicit + done sh/shcomp.c + meta shcomp.o %.c>%.o sh/shcomp.c shcomp + prev sh/shcomp.c + prev SHOPT.sh + setv CC.DLL -UCC.DLL + setv SH_DICT -DSH_DICT="\"libshell\"" + setv _BLD_shell -U_BLD_shell + setv _BLD_DLL -U_BLD_DLL + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSH_DICT=\""libshell"\" -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -c sh/shcomp.c + done shcomp.o generated + prev libshell.a archive + prev +ljobs + prev +li + prev ${mam_libsocket} + prev ${mam_libsecdb} + setv CC.DLL -UCC.DLL + setv SH_DICT -DSH_DICT="\"libshell\"" + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libast} + done shcomp generated + make suid_exec + make suid_exec.o + make sh/suid_exec.c + prev include/version.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev ${PACKAGE_ast_INCLUDE}/sig.h implicit + prev ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev FEATURE/externs implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done sh/suid_exec.c + meta suid_exec.o %.c>%.o sh/suid_exec.c suid_exec + prev sh/suid_exec.c + prev SHOPT.sh + setv CC.DLL -UCC.DLL + setv _BLD_shell -U_BLD_shell + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -D_PACKAGE_ast -c sh/suid_exec.c + done suid_exec.o generated + prev +ljobs + prev +li + prev ${mam_libsocket} + prev ${mam_libsecdb} + setv CC.DLL -UCC.DLL + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast} + done suid_exec generated + make shell + prev libshell.a archive + done shell virtual + prev libshell.a archive + make ${INSTALLROOT}/bin + exec - if silent test ! -d ${INSTALLROOT}/bin + exec - then mkdir -p ${INSTALLROOT}/bin + exec - fi + done ${INSTALLROOT}/bin generated + make ${INSTALLROOT}/bin/ksh + prev ${INSTALLROOT}/bin + prev ksh + exec - test '' = 'ksh' || ${STDCMP} 2>/dev/null -s ksh ${INSTALLROOT}/bin/ksh || { ${STDMV} ${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh.old 2>/dev/null || true; ${STDCP} ksh ${INSTALLROOT}/bin/ksh ;} + done ${INSTALLROOT}/bin/ksh generated + make ${INSTALLROOT}/man/man1 + exec - if silent test ! -d ${INSTALLROOT}/man/man1 + exec - then mkdir -p ${INSTALLROOT}/man/man1 + exec - fi + done ${INSTALLROOT}/man/man1 generated + make ${INSTALLROOT}/man/man1/sh.1 + prev ${INSTALLROOT}/man/man1 + make sh.1 + done sh.1 + exec - test '' = 'sh.1' || ${STDCMP} 2>/dev/null -s sh.1 ${INSTALLROOT}/man/man1/sh.1 || { ${STDMV} ${INSTALLROOT}/man/man1/sh.1 ${INSTALLROOT}/man/man1/sh.1.old 2>/dev/null || true; ${STDCP} sh.1 ${INSTALLROOT}/man/man1/sh.1 ;} + done ${INSTALLROOT}/man/man1/sh.1 generated + make ${INSTALLROOT}/lib + exec - if silent test ! -d ${INSTALLROOT}/lib + exec - then mkdir -p ${INSTALLROOT}/lib + exec - fi + done ${INSTALLROOT}/lib generated + make ${INSTALLROOT}/lib/libshell.a archive + prev ${INSTALLROOT}/lib + prev libshell.a archive + exec - test '' = 'libshell.a' || ${STDCMP} 2>/dev/null -s libshell.a ${INSTALLROOT}/lib/libshell.a || { ${STDMV} ${INSTALLROOT}/lib/libshell.a ${INSTALLROOT}/lib/libshell.a.old 2>/dev/null || true; ${STDCP} libshell.a ${INSTALLROOT}/lib/libshell.a ;} + exec - (ranlib ${INSTALLROOT}/lib/libshell.a) >/dev/null 2>&1 || true + done ${INSTALLROOT}/lib/libshell.a generated + make ${INSTALLROOT}/man/man3 + exec - if silent test ! -d ${INSTALLROOT}/man/man3 + exec - then mkdir -p ${INSTALLROOT}/man/man3 + exec - fi + done ${INSTALLROOT}/man/man3 generated + make ${INSTALLROOT}/man/man3/shell.3 + prev ${INSTALLROOT}/man/man3 + make shell.3 + done shell.3 + exec - test '' = 'shell.3' || ${STDCMP} 2>/dev/null -s shell.3 ${INSTALLROOT}/man/man3/shell.3 || { ${STDMV} ${INSTALLROOT}/man/man3/shell.3 ${INSTALLROOT}/man/man3/shell.3.old 2>/dev/null || true; ${STDCP} shell.3 ${INSTALLROOT}/man/man3/shell.3 ;} + done ${INSTALLROOT}/man/man3/shell.3 generated + make ${INSTALLROOT}/man/man3/nval.3 + make nval.3 + done nval.3 + exec - test '' = 'nval.3' || ${STDCMP} 2>/dev/null -s nval.3 ${INSTALLROOT}/man/man3/nval.3 || { ${STDMV} ${INSTALLROOT}/man/man3/nval.3 ${INSTALLROOT}/man/man3/nval.3.old 2>/dev/null || true; ${STDCP} nval.3 ${INSTALLROOT}/man/man3/nval.3 ;} + done ${INSTALLROOT}/man/man3/nval.3 generated + make ${INSTALLROOT}/lib/lib + exec - if silent test ! -d ${INSTALLROOT}/lib/lib + exec - then mkdir -p ${INSTALLROOT}/lib/lib + exec - fi + done ${INSTALLROOT}/lib/lib generated + make ${INSTALLROOT}/lib/lib/shell + prev ${INSTALLROOT}/lib/lib + prev shell.req + exec - test '' = 'shell.req' || ${STDCMP} 2>/dev/null -s shell.req ${INSTALLROOT}/lib/lib/shell || { ${STDMV} ${INSTALLROOT}/lib/lib/shell ${INSTALLROOT}/lib/lib/shell.old 2>/dev/null || true; ${STDCP} shell.req ${INSTALLROOT}/lib/lib/shell ;} + done ${INSTALLROOT}/lib/lib/shell generated + make ${PACKAGE_ast_INCLUDE} + exec - if silent test ! -d ${PACKAGE_ast_INCLUDE} + exec - then mkdir -p ${PACKAGE_ast_INCLUDE} + exec - fi + done ${PACKAGE_ast_INCLUDE} generated + make ${PACKAGE_ast_INCLUDE}/nval.h + prev ${PACKAGE_ast_INCLUDE} + prev include/nval.h + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/nval.h > 1.${COTEMP}.x + exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/nval.h 1.${COTEMP}.x + exec - then rm -f 1.${COTEMP}.x + exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/nval.h + exec - fi + done ${PACKAGE_ast_INCLUDE}/nval.h generated + make ${PACKAGE_ast_INCLUDE}/shell.h + prev include/shell.h + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/shell.h > 1.${COTEMP}.x + exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/shell.h 1.${COTEMP}.x + exec - then rm -f 1.${COTEMP}.x + exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/shell.h + exec - fi + done ${PACKAGE_ast_INCLUDE}/shell.h generated + make ${PACKAGE_ast_INCLUDE}/history.h + prev include/history.h + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/history.h > 1.${COTEMP}.x + exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/history.h 1.${COTEMP}.x + exec - then rm -f 1.${COTEMP}.x + exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/history.h + exec - fi + done ${PACKAGE_ast_INCLUDE}/history.h generated + make ${INSTALLROOT}/bin/suid_exec + prev suid_exec + exec - test '' = 'suid_exec' || ${STDCMP} 2>/dev/null -s suid_exec ${INSTALLROOT}/bin/suid_exec || { ${STDMV} ${INSTALLROOT}/bin/suid_exec ${INSTALLROOT}/bin/suid_exec.old 2>/dev/null || true; ${STDCP} suid_exec ${INSTALLROOT}/bin/suid_exec ;} + done ${INSTALLROOT}/bin/suid_exec generated + make ${INSTALLROOT}/bin/shcomp + prev shcomp + exec - test '' = 'shcomp' || ${STDCMP} 2>/dev/null -s shcomp ${INSTALLROOT}/bin/shcomp || { ${STDMV} ${INSTALLROOT}/bin/shcomp ${INSTALLROOT}/bin/shcomp.old 2>/dev/null || true; ${STDCP} shcomp ${INSTALLROOT}/bin/shcomp ;} + done ${INSTALLROOT}/bin/shcomp generated + make ${INSTALLROOT}/fun + exec - if silent test ! -d ${INSTALLROOT}/fun + exec - then mkdir -p ${INSTALLROOT}/fun + exec - fi + done ${INSTALLROOT}/fun generated + make ${INSTALLROOT}/fun/dirs + prev ${INSTALLROOT}/fun + make fun/dirs + done fun/dirs + setv mode -Dmode="+x" + exec - test '' = 'fun/dirs' || ${STDCMP} 2>/dev/null -s fun/dirs ${INSTALLROOT}/fun/dirs || { ${STDMV} ${INSTALLROOT}/fun/dirs ${INSTALLROOT}/fun/dirs.old 2>/dev/null || true; ${STDCP} fun/dirs ${INSTALLROOT}/fun/dirs && chmod ugo+x ${INSTALLROOT}/fun/dirs ;} + done ${INSTALLROOT}/fun/dirs generated + make ${INSTALLROOT}/fun/popd + make fun/popd + done fun/popd + setv mode -Dmode="+x" + exec - test '' = 'fun/popd' || ${STDCMP} 2>/dev/null -s fun/popd ${INSTALLROOT}/fun/popd || { ${STDMV} ${INSTALLROOT}/fun/popd ${INSTALLROOT}/fun/popd.old 2>/dev/null || true; ${STDCP} fun/popd ${INSTALLROOT}/fun/popd && chmod ugo+x ${INSTALLROOT}/fun/popd ;} + done ${INSTALLROOT}/fun/popd generated + make ${INSTALLROOT}/fun/pushd + make fun/pushd + done fun/pushd + setv mode -Dmode="+x" + exec - test '' = 'fun/pushd' || ${STDCMP} 2>/dev/null -s fun/pushd ${INSTALLROOT}/fun/pushd || { ${STDMV} ${INSTALLROOT}/fun/pushd ${INSTALLROOT}/fun/pushd.old 2>/dev/null || true; ${STDCP} fun/pushd ${INSTALLROOT}/fun/pushd && chmod ugo+x ${INSTALLROOT}/fun/pushd ;} + done ${INSTALLROOT}/fun/pushd generated +done install virtual +make test + make test.ksh + prev ${INSTALLROOT}/bin/ksh + prev ksh + make tests/shtests + done tests/shtests + exec - silent cmp 2>/dev/null -s ${INSTALLROOT}/bin/ksh ksh 2>/dev/null || + exec - echo "make install to run the tests on the latest ksh" >&2 + exec - cd + exec - SHELL=${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh shtests + done test.ksh virtual +done test dontcare virtual diff --git a/src/cmd/ksh93/OBSOLETE b/src/cmd/ksh93/OBSOLETE new file mode 100644 index 000000000..793d23f59 --- /dev/null +++ b/src/cmd/ksh93/OBSOLETE @@ -0,0 +1,152 @@ +.sp 3 +.tl ''Ksh Features That Are Obsolete in Ksh93'' +.sp 2 +.AL 1 +.LI +Using a pair of grave accents \^\fB\(ga\fR ... \fB\(ga\fR\^ +for command substitution. Use \fB$(\fR ... \fB)\fR instead. +.LI +.B FCEDIT +is an obsolete name for +the default editor name for the +.B hist +command. +.B FCEDIT +is not used when +.B HISTEDIT +is set. Use +.B HISTEDIT +instead. +.LI +The newtest (\fB[[\fR ... \fB]]\fR) operator +\fB\-a\fP \fIfile\fP +is obsolete. Use +\fB\-e\fP instead. +.LI +The newtest (\fB[[\fR ... \fB]]\fR) operator +.BR = , +as used in +\fIstring\fP \fB=\fP \fIpattern\fP +is obsolete. Use +\fB==\fP instead. +.LI +The following obsolete arithmetic comparisons are also permitted: +.in +5 +.VL 20 +.LI "\fIexp1\fP \fB\-eq\fP \fIexp2\fP" +True, if +.I exp1 +is equal to +.IR exp2 . +.LI "\fIexp1\fP \fB\-ne\fP \fIexp2\fP" +True, if +.I exp1 +is not equal to +.IR exp2 . +.LI "\fIexp1\fP \fB\-lt\fP \fIexp2\fP" +True, if +.I exp1 +is less than +.IR exp2 . +.LI "\fIexp1\fP \fB\-gt\fP \fIexp2\fP" +True, if +.I exp1 +is greater than +.IR exp2 . +.LI "\fIexp1\fP \fB\-le\fP \fIexp2\fP" +True, if +.I exp1 +is less than or equal to +.IR exp2 . +.LI "\fIexp1\fP \fB\-ge\fP \fIexp2\fP" +True, if +.I exp1 +is greater than or equal to +.IR exp2 . +.LE \" End .VL +.in -5 +.LI +Using test -t or [ -t ] without specifying the file unit number. +.LI +The +.B \-k +option to the \fBset\fR builtin is obsolete. It causes +.I all\^ +variable assignment arguments are placed in the environment, +even if they occur after the command name. +The following +first prints +.B "a=b c" +and then +.BR c : +There is no alternative. +.LI +The obsolete +.B \-xf +option of the +.B typeset +command allows a function to be exported +to scripts that are executed without a separate +invocation of the shell. +Functions that need to be defined across separate +invocations of the shell should +be placed in a directory and the +.B FPATH +variable should contains the name of this directory. +They may also +be specified in the +.B ENV +file with the +.B \-xf +option of +.BR typeset . +.LI +The shell environment variable +.B FCEDIT +is obsolete. Use +.B HISTEDIT +instead. +.LI +In the +.B \-s +option +(to \fBfc\fR or \fBhist\fR command???) +( +and in obsolete versions, the editor name +.B \- +) +is used to skip the editing phase and +to re-execute the command. +.LI +The +.B \-t +option to \fBalias\fR builtin is is obsolete. It +is used to set and list tracked aliases. +There is no replacement. +.LI +The shell command line option +.B \-t +is obsolete. This option cause the shell to exit after reading +and executing one command. The is no replacement (although ending +\&"command" with the exit builtin should have the same effect). +.LI +As an obsolete feature of the "set" builtin, +if the first +.I arg\^ +is +.B \- +then the +.B \-x +and +.B \-v +options are turned off and the next +.I arg +is treated as the first argument. +Using +.B \+ +rather than +.B \- +causes these options to be turned off. +These options can also be used upon invocation of the shell. +.LE + diff --git a/src/cmd/ksh93/PROMO.mm b/src/cmd/ksh93/PROMO.mm new file mode 100644 index 000000000..def455224 --- /dev/null +++ b/src/cmd/ksh93/PROMO.mm @@ -0,0 +1,141 @@ +.H 1 ksh93 +KSH-93 is the most recent version of the KornShell Language +described in +"The KornShell Command and Programming Language," +by Morris Bolsky and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. +The KornShell is a shell programming language, +which is upward compatible with "sh" (the Bourne Shell), +and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and +Utilities standard. +KSH-93 provides an enhanced programming environment in +addition to the major command-entry features of the BSD +shell "csh". With KSH-93, medium-sized programming tasks can be +performed at shell-level without a significant loss in performance. +In addition, "sh" scripts can be run on KSH-93 without modification. +.P +The code should conform to the IEEE POSIX 1003.1 standard and to the +proposed ANSI-C standard so that it should be portable to all +such systems. Like the previous version, KSH-88, +it is designed to accept eight bit character sets +transparently, thereby making it internationally compatible. +It can support multi-byte characters sets with some characteristics +of the character set given at run time. +.P +KSH-93 provides the following features, many of which were also inherent +in KSH-88: +.BL +.LI +Enhanced Command Re-entry Capability: The KSH-93 history +function records commands entered at any shell level and stores +them, up to a user-specified limit, even after you log off. +This allows you to re-enter long commands with a few keystrokes +- even those commands you entered yesterday. +The history file allows for eight bit characters in +commands and supports essentially unlimited size histories. +.LI +In-line Editing: In "sh", the only way to fix mistyped +commands is to backspace or retype the line. KSH-93 allows you +to edit a command line using a choice of EMACS-TC or "vi" +functions. +You can use the in-line editors to complete filenames as +you type them. +You may also use this editing feature when entering +command lines from your history file. +A user can capture keystrokes and rebind keys to customize the +editing interface. +.LI +Extended I/O Capabilities: KSH-93 provides several I/O +capabilities not available in "sh", including the ability to: +.BL +.LI +specify a file descriptor for input and output +.LI +start up and run co-processes +.LI +produce a prompt at the terminal before a read +.LI +easily format and interpret responses to a menu +.LI +echo lines exactly as output without escape processing +.LI +format output using printf formats. +.LI +read and echo lines ending in "\e". +.LE +.LI +Improved performance: KSH-93 executes many scripts faster +than the System V Bourne shell. A major reason for this is +that many of the standard utilities are built-in. +To reduce the time to initiate a command, KSH-93 allows +commands to be added as built-ins at run time +on systems that support dynamic loading such as System V Release 4. +.LI +Arithmetic: KSH-93 allows you to do integer arithmetic in any +base from two to sixty-four. You can also do double +precision floating point arithmetic. +Almost the complete set of C language operators are available +with the same syntax and precedence. +Arithmetic expressions can be used to as an argument expansion +or as a separate command. +In addition there is an arithmetic for command that works +like the for statement in C. +.LI +Arrays: KSH-93 supports both indexed and associative arrays. +The subscript for an indexed array is an arithmetic expression, +whereas, the subscript for an associative array is a string. +.LI +Shell Functions and Aliases: Two mechanisms - functions and +aliases - can be used to assign a user-selected identifier to +an existing command or shell script. +Functions allow local variables and provide scoping +for exception handling. +Functions can be searched for and loaded on first reference the +way scripts are. +.LI +Substring Capabilities: KSH-93 allows you to create a +substring of any given string either by specifying the starting +offset and length, or by stripping off leading +or trailing substrings during parameter substitution. +You can also specify attributes, such as upper and lower case, +field width, and justification to shell variables. +.LI +More pattern matching capabilities: KSH-93 allows you to specify +extended regular expressions for file and string matches. +.LI +KSH-93 uses a hierarchal name space for variables. +Compound variables can be defined and variables can +be passed by reference. In addition, each variable +can have one or more disciplines associated with +it to intercept assignments and references. +.LI +Improved debugging: KSH-93 can generate line numbers on execution +traces. Also, I/O redirections are now traced. +There is a DEBUG trap that gets evaluated before each command +so that errors can be localized. +.LI +Job Control: On systems that support job control, including +System V Release 4, KSH-93 +provides a job-control mechanism almost identical to that of +the BSD "csh", version 4.1. +This feature allows you +to stop and restart programs, and to move programs between the +foreground and the background. +.LI +Added security: +KSH-93 can execute scripts which do not have read permission +and scripts which have the setuid and/or setgid set when +invoked by name, rather than as an argument to the shell. +It is possible to log or control the execution of setuid and/or +setgid scripts. +The noclobber option prevents you from accidentally erasing +a file by redirecting to an existing file. +.LI +KSH-93 can be extended by adding built-in commands at run time. +In addition, KSH-93 can be used as a library that can +be embedded into an application to allow scripting. +.LE +Documentation for KSH-93 consists of an "Introduction to KSH-93", +"Compatibility with the Bourne Shell" and a manual page and a +README file. In addition, the "New KornShell Command and Programming +Language," book is available from Prentice Hall. + diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README new file mode 100644 index 000000000..a6326cb50 --- /dev/null +++ b/src/cmd/ksh93/README @@ -0,0 +1,199 @@ +This directory, and its subdirectories contain the source code +for ksh-93; the language described in the second addition of +the book, "The KornShell Command and Programming Language," by +Morris Bolsky and David Korn which is published by Prentice Hall. +ksh-93 has been compiled and run on several machines with several +operating systems. The end of this file contains a partial list of +operating systems and machines that ksh-93 has been known to run on. + +Most of the source code for ksh is in the src/cmd/ksh93/sh +directory. For information on what's where, see the file DESIGN. + +A new '-o posix' shell option has been added to ksh 93u+m that makes the +ksh language more compatible with other shells by following the POSIX +standard more closely. See the manual page for details. It is enabled by +default if ksh is invoked as sh, otherwise it is disabled by default. + +The Makefile file contains several compilation options that can be set +before compiling ksh. Options are of the form SHOPT_option and become +#define inside the code. These options are set to their recommended +value and some of these may disappear as options in future releases. +A value of 0, or no value represents off, 1 represents on. +Note that == is needed, not =, because these are nmake state variables +and changing their value will cause all modules that could be affected +by this change to be recompiled. +The options have the following defaults and meanings: + ACCT off Shell accounting. + ACCTFILE off Enable per user accounting info. + AUDIT off For auditing specific users + AUDITFILE "/etc/ksh_audit" + APPEND on Allows var+=val string and array append. + BASH off Bash compatibility mode. It is not fully implemented + and is experimental. + BRACEPAT on C-shell type abc{d,e}f style file generation + CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The + SH_CMDLIB_DIR nmake state variable can be used to + specify a directory. + CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value + of "/opt/ast/bin" for SH_CMDLIB_DIR. + COMPOUND_ARRAY + on Allows all components of compound variables except the + first to be any string by enclosing in [...]. It also + allows components other than the last to be arrays. + This is experimental and only partially complete. + CRNL off treated as in shell grammar. + DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.) + ECHOPRINT off Make echo equivalent to print. + ESH on Compile with emacs command line editing. The original + emacs line editor code was provided by Mike Veach at IH. + FILESCAN on Experimental option that allows fast reading of files + using while < file;do ...; done and allowing fields in + each line to be accessed as positional parameters. + KIA off Allow generation of shell cross reference database with -I. + MULTIBYTE on Multibyte character handling. Requires mblen() and + mbctowc(). + NAMESPACE on Allows namespaces. This is experimental, incomplete + and undocumented. + OLDTERMIO off Use either termios or termio at runtime. + OO on Experimental object oriented extension. This option + should disappear soon. + OPTIMIZE on Optimize loop invariants for with for and while loops. + P_SUID off If set, all real uids, greater than or equal to this + value will require the -p flag to run suid/sgid scripts. + PFSH off Compile with support for profile shell. + RAWONLY off Turn on if the vi line mode doesn't work right unless + you do a set -o viraw. + SEVENBIT off Strip the eighth bit from characters. + SPAWN off Use spawn as combined fork/exec. May improve speed on + some systems. + STATS on Add .sh.stats compound variable. + SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script. + TIMEOUT off Set this to the number of seconds for timing out and + exiting the shell when you don't enter a command. If + non-zero, TMOUT can not be set larger than this value. + TYPEDEF on Enable typeset type definitions. + VSH on Compile with vi command line editing. The original vi + line editor code was provided by Pat Sullivan at CB. + +The following compile options are set automatically by the feature testing: + DEVFD Set when /dev/fd is a directory that names open files. + SHELLMAGIC + Set on systems that recognize script beginning with #! specially. + + +In most instances, you will generate ksh from a higher level directory +which also generates libcmd and libast libraries on which ksh depends. +However, it is possible to generate ksh, with by running make -f ksh.mk +in this directory. The ksh.mk file was generated from the nmake Makefile. +If you do not have make or nmake, but do have a Version 7 UNIX compatible +shell, then you can run the script mamexec < Mamfile to build ksh. +If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk. +In either case, ksh relies on libraries libast and libcmd which must be +built first. The binary for ksh becomes the file named ./ksh which can +be copied to where ever you install it. + +If you use old make or the Mamfile, and you system has dynamic shared +libraries, then you should define the variables mam_cc_static and +mam_cc_dynanamic as the compiler options that request static linking +and dynamic linking respectively. This will decrease the number of +shared libraries that ksh need and cut startup time substantially. + +The makefile should also generate shcomp, a program that will precompile +a script. ksh93 is able to recognize files in this format and process +them as scripts. You can use shcomp to send out scripts when you +don't want to give away the original script source. + +To be able to run setuid/setgid shell scripts, or scripts without read +permission, the SUID_EXEC compile option must be on, and ksh must be installed +in the /bin directory, the /usr/bin directory, the /usr/lbin directory, +or the /usr/local/bin directory and the name must end in sh. The program +suid_exec must be installed in the /etc directory, must be owned by root, +and must be a suid program. If you must install ksh in some other directory +and want to be able to run setuid/setgid and execute only scripts, then +you will have to change the source code file sh/suid_exec.c explicitly. +If you do not have ksh in one of these secure locations, /bin/sh will +be invoked with the -p options and will fail when you execute a setuid/setgid +and/or execute only script. Note, that ksh does not read the .profile +or $ENV file when it the real and effective user/group id's are not +equal. + +The tests sub-directory contains a number of regression tests for ksh. +To run all these tests with the shell you just built, run the command + bin/shtests +For help and more options, type + bin/shtests --man + +The file PROMO.mm is an advertisement that extolls the virtues of ksh. +The file sh.1 contains the troff (man) description of this Shell. +The file nval.3 contains the troff (man) description of the name-value +pair library that is needed for writing built-ins that need to +access shell variables. + +The file sh.memo contains a draft troff (mm) memo describing ksh. The +file RELEASE88 contains the changes made for ksh88. The file RELEASE93 +contains the changes made in this release since ksh-88. The file +RELEASE contains bug fixes made in this release since ksh-88. The file +COMPATIBILITY contains a list of incompatibilities with ksh-88. The +file bltins.mm is a draft troff (mm) memo describing how to write +built-in commands that can be loaded at run time. + +Most of the work for internationalization has been done with ksh93. +The file ksh.msg is a generated file that contains error messages +that need to be translated. In addition, the function translate() +in sh/init.c has to be completed to interface with the dictionary +lookup. The translate function takes two argument, the string +that is to be translated and a type which is + 0 when a library string needs translation. + 1 when one of the error messages in ksh.msg needs translation. + 2 when a string in a script needs translation. You use a $ in front + of a double quoted string in a script to indicate that it + needs translation. The -D option for ksh builds the dictionary. +The translate routine needs to return the translated message. +For dictionaries that need to use a numeric key, it should be +possible to use the strhash() function to generate numbers to +go along with each of the messages and to use this number both +when generating the dictionary and when converting strings. +If you encounter error messages of type 1 that are not be translated via +this translate() function send mail to the address below. + +Please report any problems or suggestions to: + +https://github.com/ksh93/ksh + + +ksh 93u+m 1.0.0 has been compiled and alpha tested on the following. +An asterisk signifies minor regression test failures (one or two minor +things amiss), two asterisks signify moderate regression test failures +(some functionality does not work), and three asterisks signify serious +failures (crashes, and/or essential functionality does not work). + +* AIX 7.1 on RISC (PowerPC) +* DragonFly BSD 5.8 on x86_64 + FreeBSD 12.2 on x86_64 + FreeBSD 12.2 on arm64 (thanks to hyenias for donating access to a Pi) + GNU/Linux: Alpine 3.12.3 (musl C library) on x86_64 + GNU/Linux: CentOS 8.2 on x86_64 + GNU/Linux: Debian 10.7 on x86_64 + GNU/Linux: Gentoo 2.7 on i386 + GNU/Linux: NixOS 19.09 on x86_64 + GNU/Linux: Slackware 14.2 on x86_64 + GNU/Linux: Ubuntu 16.04 on x86_64 +*** HP-UX B.11.11 on pa-risc +* illumos: OmniOS 2020-08-19 (gcc) on x86_64 + macOS 10.14.6 (Mojave) on x86_64 +*** NetBSD 8.1 and 9.0 on x86_64 +* OpenBSD 6.8 on x86_64 +* Solaris 11.4 (gcc) on x86_64 + Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64 +* UnixWare 7.1.4 on x86 +*** Windows 7 using Cygwin on x86 + +Good luck!! + +The ksh 93u+m contributors +https://github.com/ksh93/ksh + +Originally written by: +David Korn +dgk@research.att.com + diff --git a/src/cmd/ksh93/RELEASE b/src/cmd/ksh93/RELEASE new file mode 100644 index 000000000..8b06db054 --- /dev/null +++ b/src/cmd/ksh93/RELEASE @@ -0,0 +1,3110 @@ +12-08-01 --- Release ksh93u+ --- +12-08-01 A bug that ignored interrupts for some builtins (e.g. cmdtst::grep) + that read from stdin has been fixed. +12-08-01 A bug that interpreted "cd .foo" as "cd foo" has been fixed. +12-07-30 Added automatic restart for EINTR for ioctl, tcgetattr, and tcsetattr. +12-07-23 A scoping error with namrefs to compound associative arrays has + been fixed. +12-07-20 A bug where builtin -d /path/foo deleted foo has been fixed. +12-07-18 A bug in which /dev/stdout did not work in command substitution on + some systems has been fixed. +12-07-17 A bug in which the restricted option set in a subshell prevented + some variables from getting restored when the subshell completed + has been fixed. +12-07-09 A bug in which the directory is not restored after a subshell changes + the name of the directory for subshells executed in the same process + has been fixed. +12-07-09 A bug in which file descriptors created with {n}< file were not being + closed has been fixed. +12-07-09 The 12-04-04 fix for cd .. was not correct causing cd /etc;cd .. to + remain in /etc. This has been fixed. +12-07-02 A bug in which builtin name did now work for builtins found in a + library added by builtin -f lib has been fixed. +12-07-02 A bug in the edit modes which after a directory did not refresh + the input line has been fixed. +12-07-02 A bug in which an exit status > 256 corresponding to a signal was + not returned by a function to indicate a signal exit has been fixed. +12-06-28 Fix ulimit -a to list (Kibytes) instead of (kbytes). +12-06-27 Fix uninitialized data reference for as first char in --vi mode. +12-06-26 The formatting of printf "%q" for multibyte locales has changed to + output using \u[xxx] format for valid wide characters. +12-06-25 The size limit for read -N and read -n has been raised to INT_MAX. +12-06-22 A bug in which an exit trap set in a subshell might not be triggered + when the last command was a simple executable has been fixed. +12-06-22 A bug which could cause the shell to hang when a coprocess exits + while a command inside a command substitution is reading from it has + been fixed. +12-06-21 +ksh new accepts for commands of the form for i; do;...;done +12-06-19 Tab completion after a / when there is only one match not completes + with that match rather than generating a menu of matches. +12-06-19 A bug in which patterns containing {...} where not processed + correctly inside ${var/pattern/string} has been fixed. +12-06-18 Code modified to eliminate fts_notify variable. +12-06-15 Change the .paths plugin/builtin library variable name from + BUILTIN_LIB to PLUGIN_LIB to prevent new plugin_version() aware + -lcmd from causing older non-plugin_version() aware ksh to dump core. +12-06-14 builtin without argument no longer lists .sh.tilde as a built-in. +12-06-12 For assignments if the form x=(foo bar), foo is only check for an + alias if it is float, integer, compound, or nameref. +12-06-12 +The shell supports 64 bit i-nodes even for 32 bit binaries. +12-06-11 A bug with >; redirection systems for which vfork() was the same a + fork() has been fixed. +12-06-11 A bug in path lookup that ignored buffer boundaries has been fixed. +12-06-08 typeset -a var and typeset -A var, first unset var when var is + a compound variable. +12-06-08 A bug in which running shcomp on a program containing namespace + could core dump has been fixed. +12-06-06 A bug in which unset of an associative array of compound variables + did not completely unset the variable has been fixed. +12-06-06 A bug in which exporting left or right justified fields could loose + the field width has been fixed. +12-06-06 A bug on Solaris11 in which >; did not work for /dev/null was fixed. +12-06-05 A race condition which occurred when stopping a builtin command + invoked from a subshell has been fixed. +12-06-05 A bug with appending elements to an empty indexed array has been + fixed. +12-06-04 A bug in which continuing a stopped builtin could cause it to + terminate has been fixed. +12-06-04 By default, builtins added at runtime will restore the current + directory if they are killed or stopped. +12-06-04 A bug in handling \\ in read has been fixed. +12-05-31 Use getrlimit64/setrlimit64 on systems that support it. +12-05-31 Fix 64 bit big-endian arithmetic bug that mishandled nan and inf. +12-05-31 Handle ECONNRESET like EPIPE. +12-05-31 Change .paths parse to use only the last BUILTIN_LIB from the top + and treat BUILTIN_LIB value as a ':' separated list of lib names. +12-05-29 Fix BUILTIN_LIB binding bug that ignored subsequent lookups. +12-05-29 shtests: --nocompile omits the compile test and --compile does only + the compile test. +12-05-25 A command substitution containing a here-document that itself contains + a here-document no longer hangs. +12-05-24 When the redirection operatory >; is directed to a symlink, it now + overwrites the file named by the link rather than the link. +12-05-21 +Added printf formats %(type)q where type can be html, url, pattern, + ere, or csv. +12-05-18 A bug with appending elements to an indexed array has been fixed. +12-05-18 The exit status from getopts --man interactively was 0 instead of 2 + and has been fixed. +12-05-18 Another bug with SHOPT_EDPREDICT which could cause a core dump has + been fixed. +12-05-17 A bug with fixed size arrays which could cause a core dump has been + fixed. +12-05-17 A bug in which the here-document <<< $(^V, the terminal was not + restored to insert mode after a character is entered has been fixed. +12-04-27 A bug in which old attributes were not cleared when assigning a + value using typeset has been fixed. +12-04-26 +Enabled multiline editing by default. set +o multiline can disable. +12-04-25 The 12-04-17 PATH fix created a new bug which was fixed. +12-04-25 Fixed a big memory leak problem in which unsetting compound variables + did not free all the space. +12-04-25 A bug in which test ! ! ! was treated as an error has been fixed. +12-04-24 A bug with print -v for a compound variable that contained fixed + arrays which prevented the output from being used again as input + has been fixed. +12-04-23 +kill provides the STKFLT signal on systems that support it. +12-04-23 +The -L option was added to kill. The -L option is the same as -l + except that without arguments the output format is in the form of + a select menu. +12-04-23 A bug in which the exit status for an interactive shell was always + 0 has been fixed. +12-04-20 Entering blank lines interactively no longer resets the exit status. +12-04-18 A bug in file completion in which the second tab completion on a file + would list the completion rather than inserting the completion has + been fixed. +12-04-18 A bug in which "${arr[@]:i:j}" and "${@:i:j}" generated the empty + string when i was a valid subscript and j was <=0 rather than + generating nothing has been fixed. +12-04-17 A bug in which read -d delim from a terminal did not respond to + interrupt and did not termrinate when the delimiter was entered + has been fixed. +12-04-17 A bug in which a directory in PATH containing a .paths file that + contains a line with FPATH=dir, where dir does not exist could + cause the path search to fail has been fixed. +12-04-16 A bug in which $(trap -p) did not display traps such as ERR and + DEBUG that are not associated with signals has been fixed. +12-04-11 A bug in which unsetting a variable did not unset attributes when + the variable did not have a value has been fixed. +12-04-11 A bug in which read -A for an array whose index is an enumeration + type, lost the enumeration type has been fixed. +12-04-10 Shared libraries loaded from a library named by a BUILTIN_LIB= found + in a .paths file found in a directory on PATH now add builtins that + are associated with the directory in PATH containing the .paths file. +12-04-09 Increased I/O buffer sizes for better performance. +12-04-09 A bug in which the leading 0 was stripped from $x, when $x contained + a heximadecimal constant inside an arithmetic expression inside + a for or while loop. +12-04-06 Modified namespaces to hand variables FPATH, PATH, and OPTIND that + are defined in name spaces appropriately. This also fixed OPTIND + and OPTARG processing for functions. +12-04-04 A bug in which cd .. fails when the current directory has been + renamed has been fixed. +12-04-02 Made some namespace changes and added a regression test. +12-03-30 A bug with namespaces in which PATH and FPATH set in a namespace was + not restored when leaving the namespace has been fixed. +12-03-29 A bug in which appending an index array onto an array without elements + caused the first element to be 1 rather than 0 has been fixed. +12-03-29 A bug which could cause a core dump when copying a large index array + has been fixed. +12-03-28 The shell now generates an error message when the sizes with L, Z, and + R are > 32767 on 32 bit binaries instead of generating a core dump. +12-03-28 A bug in left and right justification in which the width of invalid + characters was not taken as zero has been fixed. +12-03-26 A bug in which typeset -p ref, when ref is a reference to an index + array element did not display the subscript has been fixed. +12-03-23 A bug in lowercase and uppercase fields when expanding ${name:=val} + when name is the empty string has been fixed. +12-03-22 A namespace bug in which a type t defined in namespace foo could not + be referenced outside the namespace as .foo.t has been fixed. +12-03-22 A bug in name reference scoping in which a name function called from + another function is pass a name reference to a compound variable + instance to be created and the compound variable is in the global + scope. +12-03-22 A bug in which ${ref[@}} did not behave like ${arr[i][@]} when + ref is a name reference to arr[i] has been fixed. +12-03-21 A bug in which assigning a compound variable into arr[i], where + arr[i] is an array variable did not work correctly has been fixed. +12-03-21 A bug with multi-dimenstional index arrays in which ${arr[i][j]} + could generate a bogus error message when i was > 9 has been fixed. +12-03-21 A bug in which typeset v=foo, typeset -p v[0] generated a core dump + has been fixed. +12-03-20 A bug in vi edit mode in which the sequence bar0il left the + cursor on the b rather than the a has been fixed. +12-03-20 A bug which caused a core dump when defining a type with a field + as ' integer -a data=([0]=0)' has been fixed. +12-03-19 Using typeset -a array when array is an associative array not + generated an error message. +12-03-19 typeset +a, typeset +A, and typeset +C not displays the variables + with the attributes a, A, and C respectively instead of an error. +12-03-19 A bug in which typeset -pC, typeset -pa, and typeset -pA output all + variables rather than those of type C, a, or A only has been fixed. +12-03-18 A bug in which unset foo where foo is a name reference to a compound + variable defined inside a function is not unset has been fixed. +12-03-18 A bug with SHOPT_EDPREDICT which could cause a core dump when the + list of matches became empty has been fixed. +12-03-15 The assignment, typeset -C foo=(a b c) now generates a syntax + error since a is not an assignment command. +12-03-16 A bug in which an unset discipline from a variable defined in a + subshell is not invoked in the subshell has been fixed. +12-03-08 The assignment typeset -a (x=1 y=2) now creates an index array + of two elements rather than an array of one element which is + a compound variable. +12-03-02 +The vi and emacs edit modes now list all the entries in a directory + when entering a for completion after a /. +12-03-02 A bug in which a program that exits with value 12 when called + from a command substitution in which standard output has been + redirected caused the shell to hang has been fixed. +12-03-01 A bug in which the shell could not parse [[ ']' == ~(E)[]] ]] + has been fixed. + +12-02-29 --- Release ksh93u+ --- +12-02-29 A bug in which ~user expanded first in a subshell prevented it + from expanding later in a program has been fixed. +12-02-29 A bug which could lead to a core dump when more that four shared + libraries were added with the builtin command has been fixed. +12-02-29 Fixed a few bugs which caused SIGCHLD to be blocked preventing + background jobs from being reaped until a foreground job was run. +12-02-27 A bug in which sh -c for a simple command caused a fork() has been + fixed. +12-02-27 A timing bug on systems such as AIX that doesn't support vfork() + that could cause the exist status to get lost has been fixed. +12-02-22 A private file descriptor that was not close-on-exec for a command + substitution and has been fixed. +12-02-14 A bug in which ^Z did not stop a pipeline when the last component + was a shell built-in has been fixed. +12-02-14 getconf("PATH") used to initialize ed(1) path. +12-02-13 +In earlier version read from standard input would fail when called + from the KEYBD trap. Now read options -N, -n, and -t should work + when called from a KEYBD trap. +12-02-13 If FCEDIT is not set and fc is invoked without the -e option, + ed will be invoked if found instead of /bin/ed. +12-02-10 Another bug in the saving and restoring of IFS in a subshell + that caused a core dump has been fixed. +12-02-08 A bug in which .sh.fun disciplines could be cleared after a + function completes has been fixed. +12-02-08 A bug in job control in which the foregroup process group was not + set correctly after restarting a stopped pipeline has been fixed. +12-02-07 A bug in which numbers with leading zeros could be treated as + octal constants outside of ((...)) has been fixed. +12-02-06 A bug in arithmetic with compound variables containing multiple + array elements has been fixed. +12-02-02 A bug in the ulimit option table was fixed. +12-01-26 A bug in which a set command that did not change monitor could + effect the behavior of the monitor when monitor mode is on is fixed. +12-01-21 +You can now test whether the shell implements a math function using + typeset -f .sh.math.name, where name is the name of the function. +12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte + characters correctly has been fixed. +12-01-20 A bug that could cause the shell to hang waiting for an incorrect + job pid has been fixed. +12-01-19 A memory leak which occurred for a nested command subtiution has been + fixed. +12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute + for some other variables, for exampe, HISTFILE has been fixed. +12-01-16 A bug in which .sh.match was not correct after a substring match when + the replacement string contained a substring match has been fixed. +12-01-12 +Files that are sourced from profile files are now read and executed + one command at a time so that alias definitions take effect as they + do for profile files. +12-01-12 A bug in which whence -p would find a function if one existed and + there was no command of that name on PATH. +12-01-11 Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*). +12-01-05 A bug in which read was not terminating for a signal that had a trap + set has been fixed. +12-01-01 A timing problem with >; has been fixed. +12-01-01 A macro expansion memory leak has been fixed. +11-12-26 A bug in array assignments of the form arr=( $arr[i] ...) in which + arr was not unset before the assignment has been fixed. +11-12-20 A number of code changes were made based on the results of errors + indicated by static code analysis. +11-12-13 In vi edit mode a literal can now be entered by preceding it + with a backslash. +11-12-13 When tab is entered for completion after a ' or ", the ' and " + characters are no longer deleted. +11-12-07 A bug in which a program in the current directory with a . in the + name could fail to execute when both PATH and FPATH end with :. has + been fixed. +11-12-07 I fixed a bug in which a variable expansion in a large here-document + could be expanded to a null string. +11-12-06 An optimization to read was added in the case the the read command + was redirected from a file. +11-12-06 Changes were made to make the line limit for read unlimited by + default. +11-12-05 A bug in which unsetting an array variable did not completely clear + the variable in some cases has been fixed. +11-12-02 +The printf alternative character # when applied to the %q format will + quote argument in a form suitable for a field in a .csv format file. +11-12-02 +A -S option was added to read to be able to read .csv format files. +11-11-28 A bug in which redirection of standard error in a function called from + command substitution caused standard error to be lost has ben fixed. +11-11-21 [[ (-n foo) ]] no longer requires a space before (. +11-11-11 The readonly attribute for a variable now applies to compound + assignments to that variable. +11-11-07 Changes were made to reduce the stack size to allow deeper function + recursion. +11-10-10 +Added alternate flag to printf %H for encoding of URI's. +11-10-10 A bug which could lead to a core dump when the shell was invoked + with more than twenty five open files has been fixed. +11-10-06 A bug in the scoping of name references in functions called by other + functions has been fixed. +11-10-05 A bug in which wait on a pid may return the exit status of an + earlier background job with that pid instead has been fixed. +11-09-22 A bug in which a read timed out with TMOUT did not always restore + the terminal state has been fixed. +11-09-21 An optimization that allowed the last command in a script to use + the same process id as the script has been eliminated. +11-09-21 Added letoctal option that enables the let command to recognize + octal constants starting with 0. +11-09-20 A bug in which ${var.} could cause a core dump has been fixed. +11-09-20 A bug with SHOPT_EDPREDICT when neither vi or emacs was enabled for + lines beginning with # when in a multibyte locale has been fixed. +11-09-20 A bug in emacs edit mode with SHOPT_EDPREDICT that would cause + history searches matching comments lines to generate predictions + has been fixed. Only user typed comment lines generate predictions. +11-09-20 A bug in emacs edit mode with a search that matches a comment line + that could cause a core dump has been fixed. +11-09-16 A bug in which a command name ending in .. could cause the shell to + abort has been fixed. +11-09-16 The characters ! + - % and @ in file names are no longer escaped with + file name completion. +11-09-13 The let command no longer treats numbers starting with 0 as octal + constants. +11-09-08 A bug in which printf "%R" could cause a core dump for invalid shell + patterns has been fixed. +11-08-09 With set -u, ${var#pattern} reported that var was unset for special + variables. +11-08-03 A bug in which the shell did not preserve the exit status for a + coprocess has been fixed. +11-08-02 A bug in the saving and restoring of IFS in command substitution that + caused a core dump has been fixed. +11-07-21 Modified the 10-08-27 bug fix so that background jobs started in for + and while loops created interactively generate completion messages. +11-07-20 I fixed a bug in here documents in which multi-byte characters that + crossed buffer boundaries were not processed correctly. +11-06-22 The shell compiler now supports process substitution. +11-06-22 +Added code to support process substitution on systems that do + not supply the /dev/fd directory. +11-06-21 Fixed extraneous jobs Done messages when builtin is at the end of a + pipeline. +11-06-20 Fixed two regression tests. +11-06-20 Fixed a bug introduced on last update. +11-06-14 A bug with pipefail in which the shell would wait for background + jobs to complete has been fixed. +11-06-09 A bug which caused the options.sh regression test to fail on OS390 + Linux has been fixed. The bug could also have affected other systems. +11-06-07 +A number of changes to support the still undocuments namespace option + have been added. +11-06-06 A bug in which command substitution of eval would hang when it had + standard error redirected to standard output has been fixed. +11-06-01 A bug in case statement fall through (;&) ignoring set -e was fixed. +11-06-01 A bug in which creating a left or right justified upper or lowercase + variable with an empty string has been fixed. +11-06-01 A bug in which the .paths directory wasn't read when a subshell was + executed before any other command has been fixed. +11-05-31 The shell now gives an error when a type variable is assigned to + an array instance when the array has been declared a compound variable + array. +11-05-31 A bug in which typeset -m of an array instance did not remove the + original instance has been fixed. +11-05-28 A bug in which typeset -m dest=src fails when src and are passed as + name references was fixed. +11-05-28 A bug in which typeset -m "c.board[1][i]=el", where el is a compound + variable core dumps has been fixed. +11-05-28 Two bugs in the display of arrays of compound variables with print -v + have been fixed. +11-05-27 A bug with command substitution with the shift jis locale has been + fixed. +11-05-25 A bug in which unset -f foo, called within function foo could cause + the shell to core dump has been fixed. +11-05-24 A bug in unsetting arrays of compound variables that could lead to + a core dump has been fixed. +11-05-24 A scoping bug in with typeset -m for variables passed as references + has been fixed. +11-05-09 A bug in which 'typeset +p array[$i]' in a subshell could cause an + exception has been fixed. +11-05-03 Two more scoping bugs with name references and read -C were fixed. +11-05-03 A potential race condition which occurs when here-documents are + processed in asynchronous blocks has been eliminated. +11-05-02 Another scoping bug with name references defined in a function has + been fixed. +11-05-02 A bug in which the shell discards saved exit status of a job if it is + followed by a subshell execution has been fixed. +11-04-28 The shell now checks for numerical overflows with process ids. +11-04-28 Another scoping bug with compound variables defined by name references + inside a function has been fixed. +11-04-28 A bug which caused a core dump on 32 bit systems with the basic.sh + regression test has been fixed. +11-04-27 A scope binding error for name references has been fixed. +11-04-27 Assignment of compound variable to compound array element by name + is now working. +11-04-26 I fixed a bug with SHOPT_FIXEDARRAY compilation that could cause + an a core dump for not fixed arrays. +11-04-25 A bug in the references to two dimensional compound arrays has + been fixed. +11-04-20 A bug in which a name reference to a multidimentional index array + index, nameref x=foo[3][4], did not work correctly has been fixed. +11-04-18 Changes were added to allow fixed size arrays of variable sized + objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28. +11-04-18 A bug in which name references to array elements could fail has + been fixed. +11-04-15 +A compile option, SHOPT_2DMATCH, has been added which causes + .sh.match to be a two dimensional array after ${var//pat/str} + where the first dimension is the pattern number and the second is + the match instance. +11-04-11 A bug in which readonly var, where var is exported could cause var + to be unset has been fixed. +11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite + loop has been fixed. +11-04-05 A bug in which ${!x.} could cause a core dump has been fixed. +11-04-04 A bug in which cleaning out the history file could terminate before + keeping all the recent history events has been fixed. +11-03-29 A bug in which ${#array[@]} was 1 rather than 0 after issuing + typeset array[7] has been fixed. +11-03-29 The subscript out or range message for fixed arrays has been fixed. +11-03-29 A bug in which suspend could cause a core dump has been fixed. +11-03-24 For the showme option added 09-09-09, commands beginning with a ; + inside an arithmetic for loop, no longer produce syntax errors. +11-03-18 A bug in _WINIX ~domain/user expansion has been fixed. +11-03-16 A bug in the pipefail option which could cause a script to hang + has been fixed. +11-03-12 The shell no longer treats ${##pattern} as a syntax error. +11-03-11 A bug in typeset -u on systems that don't supply the towctrans() + function has been fixed. +11-03-11 A bug in which a compound assignment of the form var[sub]=(...) + would evaluate sub for each assignment has been fixed. +11-03-07 A bug in which reassigning a compound variable to an associative + array index could incorrectly increase the count of the number + of elements has been fixed. +11-03-04 +The tilde expansion on windows has been modified to handle user + names of the form domain/user so that ~domain/user now expands + to the home directory of that domain user. +11-03-03 A bug in which the width of the prompt was calculated incorrectly + which cause the wrong line length for edit commands has been fixed. +11-03-02 A bug in which a global variables set from within a function inside + a subshell can leave side effects in parent shell has been fixed. +11-03-01 A bug in which whence -a could dump core when the first match + was due to : in PATH and the program was in the current directory. +11-02-28 A bug in emacs mode with SHOPT_EDPREDICT (added on 10-05-20) which + disabled prediction on a line starting with # when the cursor was not + at the end of line has been fixed. +11-02-28 The output format for compound variables with set has been fixed. +11-02-25 A bug which could lead to a core dump occurred when a shell script + without #! is invoked by name from a parent shell that has name + references defined and the script creates name references of the + same name. +11-02-21 The shell now fails with a syntax error when a here-document in a + command substitution is not completed before the closing ), for + example, $( foobar <&- doesn't work has been fixed. +11-02-07 A bug on some systems for which a command substitution could hang + has been fixed. +11-01-28 A bug in file name completion for files containing both multibyte + characters shell special characters has been fixed. +11-01-18 The .sh.match variable now shows elements that do not match as + as not set rather than an empty string. +11-01-18 A bug with typeset -m of an array into an element of an indexed + array has been fixed. +11-01-13 A bug in handling of arrays of compound variables inside ((...)) which + reported a syntax error been fixed. +11-01-10 A bug in arithmetic assignment operators of the form op= for array + variables when the same array was referenced on the left and the + right hand side with different indices has been fixed. +11-01-10 A bug in which the output of time was lost when { time...;} 2>&1 + occurred inside command substitution has been fixed. +11-01-07 [[ -v sh.match[i] ]] was returning false when sh.match[i] was set. +11-01-05 Added and modified warning messages with sh -n. +11-01-02 Fixed bugs with typeset -l/-u/-M and arrays. +10-12-28 Fixed a bug with typeset -l/-u/-M values in arithmetic expressions. +10-12-26 Fixed a time parsing bug in sleep and localeconv() initialization. +10-12-23 Prevented the shell from generating a core dump when it sends itself + a termination signal because the last command terminated with that + signal. This prevents a core dump to be overwritten by the shell. +10-12-22 A bug in the expansion of ${A[@]} ${B[@]}, introduced in 10-12-01 + when A="" B=B has been fixed. +10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults. +10-12-17 A bug in the expansion of ${var:i:j} which caused a core dump when + i > ${#var} has been fixed. +10-12-16 +sleep now treats . as decimal point even in locales that use comma. +10-12-16 +typeset -M mapname was added to generalize on toupper and tolowwer + mapping as provided with wctrans(). +10-12-10 A bug in which typeset -l displayed namespaces as well as lower case + variables has been fixed. +10-12-06 A bug in which a pipeline could terminate prematurely for a pipeline + whose right hand side is a builtin, and whose left hand side ends in + a simple command that has standard output redirected has been fixed. +10-12-06 A bug in hexfloat assignments when the right hand side is a string + variable starting with 0x has been fixed. +10-12-01 A bug in the expansion of ${$1+"$@"} which causes the last positional + parameter to disappear when it is empty has been fixed. +10-12-01 A number of changes were made to reduce the startup time. +10-11-29 When wait is interrupted by a signal that is caught, it now exits + with a non-zero exit status. +10-11-29 When a variable is used directly in an arithmetic expression, + leading zeros no longer cause the value to be treated as an + octal constant. This was true in previous versions for justified + variables. +10-11-29 An incorrect warning message was eliminated with the -n option for + arithmetic expressions with associative arrays. +10-11-29 Some changes were made to slightly reduces startup time. +10-11-24 A bug in which a name reference is make to arr[0] when arr is not + an array has been fixed. +10-11-23 If a type definition is made without a compound variable assignment it + produces an error message and no longer shows up as a defined type. +10-11-22 The handling of \ inside [...] for for shell and ~(E) patterns has + been fixed. +10-11-22 A patch was made to pfsh to handle an error case. +10-11-22 +Modified types defined in namespace so that they do not clash with + types in other namespaces. Types can be referenced using + .namespace.typename. +10-11-22 A bug which caused functions addressed as .namespace.funct to not + work has been fixed. +10-11-22 A bug in which if nr was a name reference to an unset associative + array subscript, then ${!nr} did not output the subscript correctly + has been fixed. +10-11-18 A bug in which shcomp -n was not processing double quotes correctly + has been fixed. +10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a + core dump. +10-11-17 Fixed a bug in which the error message for set -u could come out + garbelled. +10-11-17 Modified the parser so that typeset -a var=(...) no longer checks + the first index for aliases and reserved words. +10-11-17 A bug in which a subshell command consisted of only a for or until + command has been fixed. +10-11-16 Fixed a bug in which typeset -u would display namespace variables + as well as upper case variables. +10-11-16 A bug which could cause a core dump when unsetting a type variable + when there are references to type elements has been fixed. +10-11-15 A bug which could cause a core dump when unsetting a compound + array variable when there are references to array subscripts has + been fixed. +10-11-15 A bug in which using typeset -m to move an indexed array instance + to another array could cause the array to display incorrectly has + been fixed. +10-11-12 A bug in which the unset discipline function for a type is called + when the type is initialized has been fixed. +10-11-12 The sequences \< and \> are now preserved after patterns containing + ~(E) in ${var/pattern/string} expansions. +10-11-11 A bug in typeset -m when the variables were compound array instances + has been fixed. +10-11-10 A bug in output of a compound variable with types containing types + has been fixed. +10-11-10 Fixed ``name=value export [-p]'' to list environment. +10-11-09 shtests resets SIGPIPE to SIG_DFL for all tests. +10-11-09 Fixed a bug in expansion of $"..." when used in assignments. +10-11-09 Fixed a getaddrinfo() memory leak that didn't call freeaddrinfo() + after an interrupt. +10-11-08 Modified the behavior of set -u so that the shell terminates with + error message when when var is unset with ${!var} and ${#var}. +10-11-02 Fix a bug in which a signal received while in a subshell could be + ignored. +10-10-26 Fix a bug where terminal interrupt was ignored while in vi/emacs + edit search mode. +10-10-26 Fix $'a\0b'c to expand to 'ac'. +10-10-26 Provide user defined round() if not in . +10-10-26 Fix bug where $((undefined_function(1))) dumped core. +10-10-22 Provide user defined iszero() if not in . +10-10-22 Fixed a bug with BGX compile option that could cause the shell to + hang. +10-10-22 Fixed a bug with user define math function on systems for which + char is unsigned. +10-10-21 A bug in which function autoloaded in a function leaves a file open + has been fixed. +10-10-20 Modified the behavior of set -u so that the shell terminates when + when var is unset with ${var op string} when op is #, % or /. +10-10-20 Fixed a bug with the AUDIT option in which the audit file was not + not close-on-exec. +10-10-20 +Made a number of changes and fixes for the NAMESPACE compile option + which as added on 10-06-09 but some problems still remain. +10-10-15 Fixed a bug in which arithmetic functions (added on 10-03-24) did + not work when the function definition was in the same compound + command in which the function was referenced. +10-10-13 A bug in which creating an associative array of compound variables + with no members as an element of a compound variable did not work + has been fixed. +10-10-08 A bug in which killing the last command in a function defined + with function name, terminated the calling script has been fixed. +10-10-08 A bug which could cause a core dump if IFS is unset inside a function + has been fixed. +10-10-07 +To reduce unwanted side effects, invoking typeset without the export + option and without an assignment now causes the variables to be unset + if the variable is inherited from the environment. +10-10-06 The closing brace for ${ command } is now a token no matter what + character follows it. +10-10-04 The change for $'...' expansion on 10-08-09 did not expand parameters + contained in the error message and this has been fixed. +10-10-04 A bug in which a declaration of indexed array (-a) in a type + definition would be displayed as a compound indexed array (-C -a) + has been fixed. +10-09-30 The C99 math function ldexp has been added. +10-09-30 A bug with two dimensional arrays with expansion of the form + ${ref[0..5]} where ref is a nameref to array[i] has been fixed. +10-09-29 A bug in which an eval with redirections invoked from a dot script + would not restore the file has been fixed. +10-09-29 A bug in which loading a function from FPATH could leave a file + descriptor open has been fixed. +10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being + evaluation. It allows fixed sized indexed arrays be to defined + using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays + are used the same way indexed arrays are. Currently, only fixed + arrays of fixed objects (float, int, and justifies objects) are + supported. +10-09-22 A bug which could cause an exception when a function with static + variables was redefined has been fixed. +10-09-21 A bug in the processing of (command&) which created a job in the + parent process has been fixed. +10-09-21 A for loop optimization bug with arithmetic expression evaluation + has been fixed. +10-09-21 A bug in which a recursive function containing a pipeline could + lead to an exception fixed after 8 levels of recursion has been + fixed. +10-09-18 A bug in which the count of elements in an array was wrong leading + to an exception has been fixed. +10-09-13 A bug which occurred when both xtrace and showme options where + specified in which the xtrace option disabled showme has been fixed. +10-09-13 A bug in which creating a reference to an array variable with any + elements could cause subsequent array elements to be treated as + compound variables has been fixed. +10-09-09 A bug which caused ((c.ar[x][y])) to be treated as a syntax error + has been fixed. +10-09-08 A bug in the processing of references to multidimensional arrays + in arithmetic expressions has been fixed. +10-09-08 A bug in the handling of multi-dimensional arrays which caused + the number of elements in each dimension to be incorrect has + been fixed. +10-09-07 The change for messages on 10-08-09 did not handle message in + assignments and this has been fixed. +10-09-07 A bug in the indentation of compound variables in arrays when + output with print -v has been fixed. +10-09-07 A rare bug with indexed arrays when assigned a null string that could + cause a core dump has been fixed. +10-09-03 A number of changes were made for jobs pools. +10-08-31 typeset -p was modified to output name references after other + variables so that the output could be used as input. +10-08-31 A bug with typeset -p in which variables with attributes but + without attributes were not displayed correctly has been fixed. +10-08-27 +When running a subshell, the current pool is unset. +10-08-27 A bug in which jobs started from within for or while lists in + interactive shells could generate completion messages has been fixed. +10-08-25 Fixed a couple of bugs related to job pools. +10-08-24 +[[ -e /dev/xxx/ ]] can be used to check whether special files of + those names are handled by the shell. +10-08-24 A bug in the running of a compiled dot script in which only the + first command was executed has been fixed. +10-08-23 A bug which sometimes caused a core dump with a configure script + has been fixed. +10-08-20 A bug in command substitution which caused a configure script to + hang has been fixed. +10-08-19 Eliminated unnecessary ; from output of compound variable with + typeset -p. +10-08-17 Fixed a bug in command substitution in which under certain + circumstances a file whose size is a power of 2 plus one, and the last + character was not a new-line, could cause memory corruption. +10-08-13 +Added static discipline functions to type similar to C++ static + class functions. +10-08-11 A bug in time when applied to a pipeline in which the shell did + not wait for all elements of the pipeline to complete has been fixed. +10-08-11 Restored sh_fmtq() quoting to not quote NAME= in NAME=VALUE. +10-08-09 +Modified the expansion of message strings, $"...", so that they + are expanded each time they are referenced rather than expanding + them when the script is compiled or read in. +10-08-06 +The process id for jobs in job pools is now of the form poolname.n + where n is the jobid in that pool. Commands that accept job names + or numbers now understand names in this format. +10-08-05 A bug in which an assignment from within an arithmetic expression + inside a function would create a local variable has been fixed. +10-08-04 A bug in the expanding of variables whose names contain multibyte + characters has been fixed. +10-08-04 A bug which caused an exception when processing scripts compiled + with shcomp -n has been fixed. +10-08-02 Tests using very small buffer sizes uncovered a number of bug most + connected with here documents which have been fixed. +10-07-27 The format modifier , used for digit grouping with d and f formats + has been documented. +10-07-26 cd '' now produces and error rather than changing to the current + directory. +10-07-26 A bug in multi-byte locales which the last character of a + multi-byte character is a \ or pattern character which could occur + when the character was the last character of a command substitution + has been fixed. +10-07-23 Another bug in the processing of ${var:offset;len} in multi-byte + locales when len is larger than the number of characters has been + fixed. +10-07-23 Many coding changes have been made to eliminate most of the uses + of global variables in the shell code. +10-07-22 Fixed a bug in which discipline functions were not being invoked + when it was invoked as ref.discipline where ref was a name reference + to an array instance. +10-07-22 Fixed a bug in which discipline functions were not being invoked it + was invoked on a two dimensional array, i.e., arr[5][9].discipline. +10-07-19 Fixed a buffering problem which occurred when running a script with + ssh and the parent ssh process is killed. +10-07-14 Modified the parser to treat ((...)) inside [[...]] as ( (...) ) to + that it is a nested (...). +10-07-09 A bug in the handling of process substitution inside command + substitution as part of a pipeline has been fixed. +10-07-07 A bug in the output for compound variables containing + multi-dimensional arrays has been fixed. +10-07-06 ksh now recovers from changes made by bash to the history file without + losing history commands. +10-06-25 A bug in which a large here document containing command substitutions + of a dynamically loaded function that contained a here document + could get truncated has been fixed. +10-06-24 If after executing a script found in FPATH, if a function, builtin, + or type name corresponding to that script is not defined, the shell + now outputs an error message and returns value 126. +10-06-23 Floating point functions that happened to return integer values + were being treated as if the function returned integers so that + integer division could be used instead of floating point division. +10-06-22 Fixed a bug in earlier ksh93u in which an arithmetic assignment to a + variable in the global scope would instead create a local variable if + the variable had an attribute but did not have a value. +10-06-18 Modified trap handling so that if the same signal is received when + executing the handler, it is deferred until the handler completes. +10-06-16 Fixed a bug in which ulimit -v was setting the the cpu limit + on Linux. +10-06-14 +The command 'typeset -T' now generates the list of type definitions + in a format that can be used as input to the shell. +10-06-09 Put in patch from Solaris for output quoting with %q. +10-06-09 +Made changes to the NAMESPACE compile option so that it now seems + to work. With this option, namespace { command;} will + run command in the namespace .name so that all variables and + functions created by command are accessible outside the name + space via .name.var and .name.fun. Variables and functions that + are not in the namespace are not modified when running command. +10-06-07 Change most internal interfaces to take Sh_t* argument. +10-06-03 +Types can be loaded on first reference by putting definitions in + PFPATH. +10-06-03 +The shell is now able to parse commands which use type statements + before the typeset -T command to define the type executes. +10-06-03 A bug in the quoting for name reference declarations which did + not properly handle [ and ] in subscripts for associative arrays. +10-06-02 A bug in which a discipline function defined by a type instance to + override the default was not being registered has been fixed. +10-06-02 A bug in which read -C of an associative array of compound variables + was not working has been fixed. +10-06-02 A bug in which the error message for an unset parameter with set -u + did not contain the name of the variable has been fixed. +10-06-01 A bug in typeset -m for moving an indexed array instance to a variable + has been fixed. +10-06-01 A bug in which caused memory to be freed twice when unset was called + for an indexed array that had get or set disciplines has been fixed. +10-06-01 A bug in which the %b format of printf was not preserving NUL bytes + with \0 has been fixed. +10-06-01 A bug in the handling of name references to array variables in + arithmetic expressions has been fixed. +10-05-28 Fixed bugs in changing attributes for two dimensional arrays. +10-05-28 Eliminated a few unreferenced variables and a reference to + uninitialized memory. +10-05-27 Rewrote the subshell code to avoid using pipes an many cases. +10-05-24 Fixed a bug which cause an exception when both -l and -s were + specified with typeset -i. +10-05-21 Inputting of three dimensional indexed arrays with ( ( (...)...)...) + was not working and has been fixed. +10-05-21 A bug in which adding the attributes -Ai to a variable via a name + reference could cause the value to display incorrectly has been fixed. +10-05-21 A bug in which using $var inside ((...)) did not work when var was + a hex float variable. +10-05-20 +The compile option SHOPT_EDPREDICT has been added. When this option + is on, as you type a line beginning with a # the following characters + are treated as a shell pattern and cause matching lines from the + history file to be displayed as a numbered list as you type. + You can scroll up and down this list or you can use nTAB + to make this the current line (n defaults to 1 of omitted) or + n to execute. +10-05-20 A bug which caused an exception when multiple levels of composite + functions in arithmetic expressions has been fixed. +10-05-19 <<< with an empty string no longer gives an error. +10-05-19 A bug in arithmetic evaluation when a name reference to an array + instance was used has been fixed. +10-05-14 A bug in which the shell treats a valid index array assignment, + typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. +10-05-13 A bug in creating name references to associative array variable + after a lookup of one of its elements has been fixed. +10-05-12 Two bugs in the handling of function static type variables in + subshells have been fixed. One could cause an exception and the + other would leave side effects in the parent shell. +10-05-10 A bug in which static variables in functions were not being saved and + restored properly when running subshells has been fixed. +10-05-05 A bug in which print -v did not work correctly when an operand was an + indexed array element referring to a compound variable has been fixed. +10-05-05 A change to improve performance by special casing empty string + assignments to avoid repeated malloc() and free(). +10-05-05 A bug in which creating a name reference to a non-existent associative + array element would create the array element has been fixed. +10-05-04 A bug in which name references to static variables in the static + scope were not found has been fixed. +10-04-30 Do not use socketpair() on systems that implement ioctl(I_PEEK) + on pipes. +10-04-29 +When the current job pool is set, coprocess are run in a job pool. +10-04-28 A type defined with a member foo that is an associative array without + elements followed by an expansion ${bar.foo[a]} and an assignment + bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members. +10-04-27 Another bug in which a nested command substitution could hang if it + generated too much data has been fixed. +10-04-26 A type defined with a member that is an indexed array without elements + would behave as if the 0th element of each instance was defined after + a non-zero element was specified and this has been fixed. +10-04-26 A bug in which types defined in a subshell were not undefined when + the subshell completed has been fixed. +10-04-23 For file completion in command line editing, file names starting + with # are now escaped so that they are not treated as comments. +10-04-23 A bug in which ${t.var:=value}, where t is an instance of a type + variable, could assign value to the type variable rather than to + the type instance has been fixed. +10-04-23 +Added &| which can be used in place of | to have portions of a + pipeline executed in the pool. +10-04-22 +The .sh.pool variable was added for use with job pools. +10-04-22 A bug in which a nested command substitution could hang if it + generated too much data has been fixed. +10-04-20 A bug which corrupted one byte of memory when read was called with + reads that did not use a delimiter has been fixed. +10-04-19 The display of a compound variable with an embedded array with + attributes was sometimes not working correctly and has been fixed. +10-04-16 A bug in which attributes were not be propagated to elements in + an associative array has been fixed. +10-04-15 A bug which caused scripts containing user defined math functions to + fail to compile with shcomp has been fixed. +10-04-15 +Job pools have been added with the SHOPT_COSHELL compilation option. + A job pool allows a collection of background jobs to run either locally + or remotely and to be managed as a unit. The command '& name ...' + creates or uses a named job pool for subsequent background jobs. + kill, wait, and jobs allow the pool name as operands. +10-04-14 A bug in which a coprocess connection could terminate prematurely + when running a nested subshell has been fixed. +10-04-12 +Enumeration constants can be used in arithmetic expressions with the + ==, != and = operators when the left hand side is an enum variable + and the right hand side is an enumeration constant. +10-04-07 A bug in which setting the trap on CHLD to ignore could cause + an incorrect exit status has been fixed. +10-04-06 A bug in which LINENO was not incremented for a here-document when + the here-document word was followed by a comment has been fixed. +10-04-06 The optimization that execs the last process of a script rather + than creating a new process has been removed when a trap on + interrupt has been set. +10-04-06 Unsetting the 'C', 'A' or 'a' typeset attribute now produces an + error message rather than generating an exception. +10-04-06 A bug in which .sh.name contained the subscript and .sh.subscript + was empty in some cases with discipline functions on array instances + has been fixed. +10-04-05 A bug in the edit modes where preceding the interrupt character with + the literal next character did not work has been fixed. +10-04-05 A bug in the creation of type instances of arrays which could cause + an exception has been fixed. +10-03-30 A bug in the display of a compound variable containing an indexed + array of compound variables has been fixed. +10-03-24 +Arithmetic functions can be defined using the shell function syntax, + 'function .sh.math.name x y z{...}' , where name is the function name + invoked within ((...)) and x y z are long double arguments passed + as name references. y and z are used for functions with two and + three arguments respectively. The value of the function is the value + of the long double .sh.value variable when the function returns. +10-03-24 A bug in which integer division was mistakenly used when the + numerator was a binary operator with the first operand floating + point and the second integer, e.g. (.1**3)/3, has been fixed. +10-03-24 The >; file operator was modified so that the temporary file is + created in the same physical directory as file. +10-03-23 A warning message was added to sh -n when $var was used inside + ((...)) instead of var. +10-03-19 fmin was added to the list of math function on the man page. +10-03-19 Fixed the return value for unalias when the alias did not + exist. +10-03-19 A bug in which the SHLVL variable exported the value it had on + input rather than the incremented value has been fixed. +10-03-19 A bug which causes whence -q to go into an infinite loop has been + fixed. +10-03-19 Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT). +10-03-17 Modified profile shell execution so that when builtins that + correspond to executable have extended attributes, they are + executed by pfksh instead of being treated as built-ins. +10-03-16 A bug in whence -a which produced duplicate lines of output has + been fixed. +10-03-16 A bug in the handling of process groups in monitor mode for + command substitutions has been fixed. +10-03-15 Fixed a bug in which read -u[fd] could cause the shell to core + dump when fd was greater than open_max. +10-03-15 +Modified the shell I/O so that the shell will not fail if the + ulimit for open_max is increased as part of the script. +10-03-12 A bug in which a here-document containing command substitutions + that contained here-documents did not process correctly has been + fixed. +10-03-12 A bug in which the terminal is not restored to canonical mode + after read times out when in a multibyte locale with no edit mode + enabled has been fixed. + +10-03-05 --- Release ksh93t+ --- +10-03-05 A variable unset memory leak has been fixed and tests/leaks.sh + has been added to verify the fix. +10-03-04 Documentation, comment, and diagnostic spelling typos corrected. +10-02-14 Fix sh_getenv() initialization to cooperate with the 3d fs. +10-02-12 A bug in which the get discipline function was not invoked for + associative array subscripts for unset array elements has been fixed. +10-02-12 A bug which could occur if the last line of a script was an eval + that executed multiple commands has been fixed. +10-02-02 A buffer overflow in read and another in binary type base64 + encoding were fixed. +10-01-20 A bug in the evaluation of arithmetic expression in which the + subscript was evaluated twice for $((foo[x++]++)) has been fixed. +10-01-19 A workaround for a double-free of a trap in both a subshell and its + parent has been added. +10-01-18 A bug in type handling of typeset -H has been fixed. +10-01-15 The "adding empty subscript" warning now only emitted with -x set. +10-01-01 A bug in the parser in which '$((case i in i):;esac);:))' was not + parsed correctly was fixed. +10-01-01 A bug in the parser in which '$(( 2 , 3.6 ))' dumped core for locales + with radix char , and thousands separator . has been fixed. +09-12-28 A bug in the handling of SIGCLD on systems that generated SIGCLD + while blocked waiting for process to complete has been fixed. +09-12-24 ast setlocale() reworked to differentiate env var changes from user + override. +09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals + < SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed. +09-12-18 A bug where [[ -v var ]] was incorrect for some variables (including + LC_* vars) has been fixed. +09-12-15 A bug that produced a syntax error when a multibyte character + straddled a buffer boundary has been fixed. +09-12-11 A bug where the subscript of an unset variable was not evaluated has + been fixed. +09-12-09 A bug where shcomp dumped core on certain syntax errors has been fixed. +09-12-07 A bug where a parent shell environment var reset in a subshell removed + the value in subsequent children of the parent shell has been fixed. +09-12-04 A bug in which in some cases a trap in a function executed in + a subshell could trigger twice has been fixed. +09-12-03 A bug in which SHLVL exported with some attributes could cause + the shell to abort at startup has been fixed. +09-12-02 A bug with pipefail in which the shell could hang waiting for the + writer to complete before the last reader command has been fixed. +09-11-30 A bug in which a trap could be inherited by the first element of + a pipeline when the command had more than 63 arguments that did + not contain any macro expansions has been fixed. +09-11-19 When read from a terminal was called from with a while or for loop, + and an edit mode was on, a backspace or erase no longer will + overwrite the prompt. +09-11-17 +Change .paths parse to handle BUILTIN_LIB=foo BUILTIN_LIB=foo-1.2. +09-11-17 Inside a function, typeset foo.bar will bind foo to global variable + foo if local variable foo does not exist, instead of creating a + local variable. +09-11-17 "read -n1" from the terminal has been fixed to read exactly one character. +09-11-11 Job control now works for subshell commands, (...). +09-11-11 If set -e is on for an interactive shell errors in special builtins + now cause the shell to exit. +09-11-11 A bug in which an interrupt handler processed during the read builtin + when IFS did not contain a new line has been fixed. +09-11-09 A bug in which a variable that has been unset in a subshell and then + exported from that subshell does not show up in the environment + has been fixed. +09-11-02 ``,2'' is now a valid numeric constant for locales with + decimal_point=','. +09-11-02 A bug where "return" in .profile did not restore the shell state + has been fixed. +09-10-31 A bug that corrupted saved exit status when pids wrapped around has + been fixed. +09-10-26 A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last. +09-10-16 A bug where notification to libast that the environment has changed + has been fixed. +09-10-12 A bug in which a function loaded in a subshell could leave side + effects in the parent shell has been fixed. +09-10-12 A bug in converting a printf %d operand to a number when the operand + contains multiple subscripts for the same variable has been fixed. +09-10-09 A bug in the handling of the escape character \ in directory prefixes + in command completion has been fixed. +09-10-09 $PATH processing has been changed to delay dir stat() and .paths + lookup until the directory is needed in the path search. +09-09-28 Call the ast setlocale() intercept on unset too. +09-09-24 A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert + LC_CTYPE etc. to the LANG value has been fixed. +09-09-17 A bug in which unsetting SVLVL could cause a script invoked by + name without #! to core dump has been fixed. +09-09-16 A bug in which a pipeline in a here-document could hang when the + pipefail option was on has been fixed. +09-09-09 A bug in the processing of line joining in here documents which + occurred when a buffer began with has been fixed. +09-09-09 +A leading ; with commands in a brace group or parenthesis group + no longer causes an error. It now is used for the "showme" option. +09-09-09 A bug in which a subshell containing a background process could + block until the background process completed has been fixed. +09-09-04 A bug in handling ${var[sub]}, where var is a nameref has been fixed. +09-09-03 A bug which caused an index array to have the wrong number of elements + when it was converted from a compound variable by adding an another + element has been fixed. +09-09-03 Specifying export for a compound variable now generates an error. +09-09-02 $"..." localizations strings are no longer recognized inside `...`. +09-09-01 A bug in the for loop optimizer in the handling of type static + variables has been fixed. +09-09-01 An error message is not displayed when * and @ are used as subscripts. +09-09-01 Several bugs in the processing for types that included an associative + array of another type has been fixed. +09-09-01 A bug in the tracing of [[ a < b ]] and [[ a > b ]] has been fixed. +09-08-26 The .sh.file variable was not being set for a script that was run + by name and didn't start with #! and this has been fixed. +09-08-25 A bug in which a function called to deeply from command substitution + did not display an error message has been fixed. +09-08-24 +When processing profiles, ksh93 now violates the POSIX standard and + treats &> as a redirection operator similar to bash. +09-08-23 A bug in the handling of the trap on SIGPIPE that could lead to a + memory fault has been fixed. +09-08-21 A bug in the handling of the comma operator in arithmetic expressions + that could cause a core dump on some systems has been fixed. +09-08-20 A bug in which a compound variable containing an array of a type + that doesn't have any elements now expands correctly. +09-08-19 A bug which disabled function tracing inside a function after + a call to another function has been fixed. +09-08-19 A bug in which initializing a compound variable instance to another + compound variable by name has been fixed. +09-08-18 A bug in which compound variable instances could be lost after + an instance that invoked a type method discipline has been fixed. +09-08-18 A bug in which a discipline function for a type applied to an + array instance when invoked in a function ignored the subscript + has been fixed. +09-08-18 A scoping error with variables in arithmetic expression with + type variables when reference with a name reference has been fixed. +09-08-10 Several memory leaks were fixed primarily related to subshells. +09-08-06 A bug in which setting the trap on CHLD to ignore could cause + a script to hang has been fixed. +09-07-08 A bug in the processing of name reference assignments when it + contained pattern expansions with quoting has been fixed. +09-06-22 +The default width for typeset -X has been changed so that there + should be no loss of precision when converting to a string. +09-06-19 A bug in the printing of array elements for binary variables with + printf %B has been fixed. +09-06-19 A bug which caused a core dump with trap DEBUG set with an array + assignment with no elements has been fixed. +09-06-19 A bug with read with typeset -b -Z has been fixed. +09-06-19 Two bugs related to read -b for array variables has been fixed. +09-06-19 A bug with typeset for compound variables containing arrays of + compound variables has been fixed. +09-06-18 A bug in appending a compound variable to a an indexed array of + compound variables has been fixed. +09-06-18 A bug which occurs when appending a compound variable to an indexed + array element has been fixed. +09-06-18 Setting VISUAL to a value other than one ending in vi or emacs will + no longer unset the edit mode. +09-06-17 A bug in typeset -m when moving a local compound variable to a + global compound variable via a name reference has been fixed. +09-06-17 A bug in appending to nodes of an array of compound variables when + addressing them via nameref has been fixed. +09-06-17 A bug in typeset -p var, when var is an array of compound variables + in which the output only contained on array element has been fixed. +09-06-17 The prefix expansion ${!y.@} now works when y is a name + reference to an element of an array. +09-06-16 Traps on signals that are ignored when the shell is invoked + no longer display. Previously they were ignored as required but + would be listed with trap -p. +09-06-12 A bug in vi edit mode in which hitting the up arrow key at the + end of a line longer than 40 characters which caused a core dump + has been fixed. +09-06-11 A bug in which "eval non-builtin &" would create two processes, + one for the & and another for non-builtin has been fixed. +09-06-08 When var is an identifier and is unset, ${var} no longer tries to + run command substitution on the command var. +09-06-08 +Process substitution arguments of the form <(command) can now be + used following the < redirection operator to redirect from command. +09-05-13 A bug in which redirections of the form 2>&1 1>&5 inside command + substitution could cause the command substitution to hang has been + fixed. +09-05-12 To conform with POSIX, the -u option only checks for unset variables + and subscript elements rather than checking for all parameters. +09-05-12 A bug which could cause a core dump when a variable whose name + begins with a . was referenced as part of a name reference inside + a function has been fixed. +09-05-01 A bug that caused a core dump when SIGWINCH was received and + both vi and emacs mode were off has been fixed. +09-04-22 +Default alias compound='typeset -C' added. +09-04-15 A bug that caused ${...;} to hang for large files has been fixed. +09-04-08 A change was made in the -n option which printed out an incorrect + warning with <>. +09-04-07 The emacs edit command M-_ and M_. and the vi command _ was fixed + to handle the case there there is no history file. +09-04-05 A bug in handling new-lines with read -n has been fixed. +09-04-05 The ENV variable defaults the the file named by $HOME/.kshrc rather + then to the string $HOME/.kshrc. +09-03-31 A bug in which a nested command substitution with redirections could + leave a file descriptor open has been fixed. +09-03-24 +ksh now only uses the value of the _ variable on startup if it can + verify that it was set by the invoking process rather than being + inherited by some other ancestor. +09-03-24 +When ksh is invoked without -p and ruid!=euid, and the shell is + compiled without SHOPT_P_UID or ruid=SHOPT_P_UID then euid is set + to ruid. A bug that did the wrong test (ruid&1 inside a command substitution wasn't working + correctly has been fixed. +09-02-02 A bug in the call stack of arithmetic function with 2 args + returning int has been fixed. +09-01-30 A bug in which 'eval print \$0' inside a function was giving the + wrong value for $0 has been fixed. +09-01-28 A bug in which a command substitution could return an exit status + of 127 when the pipefail option is enabled has been fixed. +09-01-26 ksh93 now generates an error message if you attempt to create + a global name reference to a local variable. +09-01-26 +The [[ -v var ]] operator was modified to test for array elements. +09-01-23 +The redirection operator <>; was added. It is similar to <> + except that if the command it is applied to succeeds, the file + is truncated to the offset at the command completion. +09-01-23 The default file descriptor for <> was changed to 1. +09-01-20 A bug in which the exit status specified in an exit trap was + not used when a process terminated with a signal has been fixed. +09-01-19 A bug in which a signal whose default action is to terminate + a process could be ignored when the process is running a subshell + has been fixed. +09-01-19 A bug in which sending SIGWINCH to a process that reads from a pipe + could cause a memory fault has been fixed. +09-01-16 +The -R unary operator was added to [[...]] and test to check whether + a variable is a name reference. +09-01-16 +The -v unary operator was added to [[...]] and test to check whether + a variable is set. +09-01-14 The unset built-in was modified to return 0 exit status when + unsetting a variable that was unset to conform with the POSIX + standard. +09-01-14 The unset built-in was modified to continue to unset variables + after encountering a variable that it could not unset to + conform to the POSIX standard. +09-01-14 The parameter expansion ${x+value} no longer expands the value of + the variable x when determining whether x is set or not. +09-01-13 A bug in which background jobs and pipelines that were not waited + for could, in rare instances, cause the shell to go into an infinite + loop or fail has been fixed. +09-01-06 A bug in indexed arrays of compound variables in which referencing + non-existent sub-variable in an arithmetic expression could cause + the sub-variable to be created has been fixed. +09-01-05 A bug in which the \ character did not escape extended regular + expression pattern characters has been fixed. +08-12-24 A bug in which killing the last element of a pipe did not cause + a write to the pipe to generate a SIGPIPE has been fixed. +08-12-19 A bug which could cause command substitution to hang when the + last element of a pipeline in a command substitution was a built-in + and the output was more that PIPE_BUFF. +08-12-18 A bug which occurs when a here documented marker embedded in a + command substitution occurs on a buffer boundary has been fixed. +08-12-17 A bug in the output of typeset -p for variables that had attributes + but did not have a value has been fixed. +08-12-16 A bug in which a name reference to a name reference variable that + references an array element has been fixed. +08-12-16 A bug in which a variable given both the -A and -C attribute along + with an initial assignment didn't work correctly has been fixed. +08-12-10 The [[ -t fd ]] test was fixed to handle fd>9. +08-12-10 A bug where function stack misalignment could cause a bus error + has been fixed. +08-12-09 Command completion was changed to use \ to quote special characters + instead of quoting the argument in single quotes. +08-12-07 A bug in typeset -m which occurred when the target node was an + associative array element has been fixed. +08-12-07 A timing bug on some systems (for example darwin), that could + cause the last process of a pipeline entered interactively to fail + with an "Exec format error" has been fixed. +08-12-04 +SHOPT_BGX enables background job extensions. Noted by "J" in + the version string when enabled. (1) JOBMAX=n limits the number + of concurrent & jobs to n; the n+1 & job will block until a + running background job completes. (2) SIGCHLD traps are queued + so that each completing background job gets its own trap; $! is + set to the job pid and $? is set to the job exit status at the + beginning of the trap. (3) sleep -s added to sleep until the time + expires or until a signal is delivered. +08-12-04 The sign of floating point zero is preserved across arithmetic + function calls. +08-12-04 A bug that caused print(1) to produce garbled stdout/stderr + output has been fixed. +08-12-04 A bug in which printf "%d\n" "''" did not output the + numerical value of the EURO symbol, 8354, has been fixed. +08-11-24 + /dev/fd* and /dev/std* redirections are first attempted with + open() to preserve seek semantics; failing that the corresponding + file descriptors are dup()'d. +08-11-20 A bug which could cause a core dump if a function compiled with + shcomp was found has been fixed. +08-11-20 A bug in which jobs were not cleared from the jobs table for + interactive shells when the pipefail option is on has been fixed. +08-11-11 A bug in which a field that was unset in a type definition and later + set for an instance could appear twice when displaying the variable + has been fixed. +08-11-11 A bug in which running a simple command & inside a function would + not return the correct process id has been fixed. +08-11-10 A bug in which the exit status of a command could be lost if the pid + was that of the most recent command substitution that had completed + has been fixed. +08-11-10 The maximum depth for subshells has been increased from 256 to 65536. +08-11-06 A bug which could cause a core dump when the _ reference variable was + used as an embedded type with a compound assignment has been fixed. + +08-10-31 --- Release ksh93t --- +08-10-31 Variable scoping/initialization bugs that could dump core were fixed. +08-10-24 The lexer now accepts all RE characters for patterns prefixed + with a ksh ~(...) option expression. +08-10-24 +For ${var/pat/sub} \0 in sub expands to the text matched by pat. +08-10-18 A bug in array scoping that could dump core has been fixed. +08-10-10 read -n and -N fixed to count characters in multibyte locales. +08-10-10 A bug that mishandled _.array[] type references has been fixed. +08-10-09 +${.sh.version} now contains a concatenation of the following (after + 'Version') denoting compile time features: + A SHOPT_AUDIT + B SHOPT_BASH + L SHOPT_ACCT + M SHOPT_MULTIBYTE +08-10-09 A bug that caused subshell command substitution with redirection + to hang has been fixed. +08-10-08 Output errors, other than to stderr, now result in a diagnostic. +08-10-08 ksh93 now supports types that contain arrays of other types as + members. Earlier versions core dumped in this case. +08-10-05 A bug which caused the shell to emit a syntax error for an arithmetic + statement of the form (( var.name[sub] = value)) has been fixed. +08-10-01 A bug that caused subshell command substitution to hang has + been fixed. +08-09-29 When the -p export option of typeset is used with other options, + only those variables matching the specified options are displayed. +08-09-29 When the shell reads the environment and finds variables that are + not valid shell assignments, it now passes these on to subsequent + commands rather than deleting them. +08-09-29 A bug in the display of compound variables containing an indexed + array of compound variables has been fixed. +08-09-29 A bug in the display of compound variables containing an associative + array with a subscript containing a . in the name has been fixed. +08-09-26 A core dump in the subshell environment restore has been fixed. +08-09-24 $(...) has been fixed to properly set the exit status in $?. +08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last + of multiple trailing newlines. +08-09-23 The -p option to typeset when used with other attributes, restricts + the output to variables with the specified attributes. +08-09-22 A bug that sometimes lost the exit status of a job has been fixed. +08-09-21 A bug that retained trailing command substitution newlines in + cases where the command caused the shell to fork has been fixed. +08-09-19 type, whence -v, and command -v were fixed to comply with POSIX + by writing 'not found' diagnostics to the standard error. +08-09-18 test and [...] were fixed to comply with POSIX in the case + of test '(' binop ')' where binop is a valid binary test operator. +08-09-16 +If a method discipline named create is specified when defining a + type, this function will be called when an instance is created. +08-09-15 +The variable _ is now set as a reference to the compound variable + when defining a compound variable or a type. +08-09-10 The shell now prints an error message when the type name specified + for an indexed array subscript is not an enumeration type. +08-09-10 A bug in which a subshell that spawned a background process could + loose output that was produced after the foreground completed + has been fixed. +08-09-10 A timing bug on some systems that could cause coprocesses started by a + subshell to not clean up and prevent other coprocesses has been fixed. +08-09-09 The typeset -m option is now able to rename array elements from + the same array. +08-09-09 The exit status of 2 from the DEBUG trap causes the next command + to be skipped. An exit value of 255 from a DEBUG trap called from + a function causes the function to return. +08-09-08 A bug in which a coprocess created in a subshell that did not + complete when the subshell terminated could prevent a coprocess + from being created in the parent shell has been fixed. +08-09-05 An assignment of the form name1=name2 where name1 and name2 + are both compound variables causes name1 to get a copy of name2. + name1+=name2 causes name2 sub-variables to be appended to name1. +08-09-05 A bug in which unsetting a compound variable did not unset all + the sub-variables has been fixed. +08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has + been fixed. +06-08-26 +The SHLVL variable which is an environment variable used by bash + and zsh that gets incremented when the shell starts. +08-08-25 +For an indexed array, a negative subscript now refers to offsets + from the end so that -1 refers to the last element. +08-08-24 An alignment error for shorts on 64 bit architectures has been fixed. +08-08-22 If oldvar is a compound variable, typeset -C newvar=oldvar creates + newvar as a copy of oldvar. +08-08-19 +The ALRM signal no longer cause the sleep builtin to terminate. +08-08-13 When used in an arithmetic expression, the .sh.version variable + now produces a number that will be increasing for each release. +08-08-11 A bug in which type instantiation with a compound assignment in + a dot script in which the type is defined has been fixed. +08-08-07 +The -m option has been added to typeset to move or rename a + variable. Not documented yet. +08-08-06 A bug in read when used in a loop when a prompt was specified + when reading from a terminal has been fixed. +08-08-01 A bug with the pipefail option in which a nested pipeline could + cause an asynchronous command to block has been fixed. +08-08-01 A for loop optimizer bug that treats .sh.lineno as an invariant + has been fixed. +08-07-30 A bug in which expanding compound variable that had a get discipline + from with a here document could cause a syntax error has been fixed. +08-07-18 A bug in which a nameref caused a local variable to be created + rather than binding to an existing variable in the global scope + has been fixed. +08-07-17 A bug which occurred when a nameref was created from within a + function that was part of a pipeline has been fixed. +08-07-14 +The compile option SHOPT_STATS was added. With this option the + compound variable .sh.stats keeps usage statistics that could help + with performance tuning. +08-07-10 +The output of set now always uses a single line for each variable. + For array variables, the complete set of values is now displayed. +08-07-09 +The typeset -C option can be used with arrays to indicate that + each element should default to a compound variable. +08-07-08 +The %B format now outputs compound variables and arrays. The + alternate flag # can be used to cause output into a single line. +08-07-03 When the window change signal, WINCH, is received, the current + edit line is redrawn in place. +08-07-01 A bug in the handling of shared variables when inside an embedded + type has been fixed. +08-06-29 A bug in multiline edit mode which occurred when the prompt length + was three characters or less has been fixed. +08-06-23 A bug in which the SIGCLD was not be triggered when background + jobs completed has been fixed. +08-06-23 _KSH_VERSION added as a name reference to .sh.version. +08-06-20 type now outputs 'special builtin' for special builtins. +08-06-19 A couple of bugs in multi-dimensional arrays have been fixed. +08-06-19 A bug in which a syntax error in a dot script could generated + a syntax error in the next subsequent command has been fixed. +08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions + on some architectures. +08-06-16 A bug in which printf "%B" could generate an exception when the + specified variable was not set has been fixed. +08-06-16 +When typeset -p is followed by variable names, it now displays + the attributes names and values for the specific names. +08-06-14 A bug that could effect the drawing of the screen from multiline + emacs or gmacs mode when walking up the history file has been fixed. +08-06-13 A bug in which a compound variable defined in a subshell could + have side effects into the parent shell has been fixed. +08-06-13 A number of bugs related to using .sh.level to set the stack from + for DEBUG traps have been fixed. +08-06-13 +The .sh.lineno variable has been added. When .sh.level is changed + inside a DEBUG trap, the .sh.lineno contains the calling line number + for the specified stack frame. +08-06-13 The .sh.level variable has been documented and now works. +08-06-11 +The -C option has been added to read for reading compound command + definitions from a file. +08-06-11 +The . command is now permitted inside a compound command definition. + The dot script can contain declaration commands and dot commands. +08-06-09 +Add -C option to typeset so that typeset -C foo, is equivalent + to foo=(). +08-06-09 Added -n warning message for typeset option orderings that are valid + with ksh88 but not valid with ksh93, for example Lx5. +08-06-09 A bug in which the return value for an assignment command containing + a command substitution with that failed was zero when the assignment + contained redirections has been fixed. +08-06-09 A bug in the quoting of $ inside a ERE pattern ~(E)(pattern) + has been fixed. +08-06-06 A bug when processing `` command substitution with the character + sequence \$' has been fixed. +08-06-02 +When defining a type, the typeset -r attribute causes this field + to be required to be specified for each instance of the type and + does not allow a default value. +08-06-02 Several bugs in which compound variables were modified by + subshells have been fixed. +08-05-22 +The ceil function has been added to the math functions. +08-05-21 A bug in which a name reference defined in a function and passed + as an argument to another function could cause an incorrect binding. +08-05-21 A bug in freeing compound variables that are local to functions + has been fixed. +08-05-19 +The array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]} + to expand to the value (or subscripts) for array between sub1 and + sub2 inclusive. For associative arrays, the range is based on + location in the POSIX locale. The .. must be explicit and cannot + result from an expansion. +08-05-15 The trap on SIGCLD is no longer triggered by the completion of + the foreground job as with ksh88. +08-05-14 A bug in the implementation of the editing feature added on + 07-09-19 in emacs mode has been fixed. +08-05-12 A bug in processing the test built-in with parenthesis has been + fixed. +08-05-12 The unset built-in now returns non-zero when deleting an array + subscript that is not set. +08-05-08 +Changing the value of HISTFILE or HISTSIZE will cause the old + history file to be close and reopened with the new name or size. +08-05-08 When FPATH is changed functions that were found via a path search + will be searched for again. +08-05-08 A parser bug in which reserved words and labels were recognized + inside compound indexed array assignment after a new-line has + been fixed. +08-05-07 A bug in getopts when handling numerical option arguments has + been fixed. +08-05-07 +The typeset -S option was added for variables outside type + definitions to provide a storage class similar to C static + inside a function defined with function name. When outside + type definitions and outside a function, the -S option cause + the specified variable so be unset before the assignment and + before the remaining attributes are supplied. +08-05-07 A bug that affected the cursor movement in multiline mode when + a character was deleted from near the beginning of the any + line other than the first. +08-05-01 In multiline edit mode, the refresh operation will now clear + the remaining portion of the last line. +08-05-01 A bug in computing prompt widths for the edit modes for prompts + with multibyte characters has been fixed. +08-05-01 A bug in the multiline edit mode which could cause the current + line to be displayed incorrectly when moving backwards from third + or higher line to the previous line has been fixed. +08-05-01 A bug in which options set in functions declared with the function + name syntax were carried across into functions invoked by these + functions has been fixed. +08-04-30 A bug which could cause a coprocess to hang when the read end + is a builtin command has been fixed. +08-04-30 +The emacs and vi editors have been modified to handle window + change commands as soon as they happen rather than waiting for + the next command. +08-04-28 A bug in which ${!x} did not expand to x when x was unset has been + fixed. +08-04-27 A bug in which the assignment x=(typeset -a foo=([0]=abc)) created + x.foo as an associative array has been fixed. +08-04-25 A bug in which $# did not report correctly when there were more + than 32K positional parameters has been fixed. +08-04-04 Choose the name _ as the sub-variable that holds type or instance + specific data used by discipline functions. +08-03-27 A bug in which the terminal group was not given back to the parent + shell when the last part of a pipeline was handled by the parent shell + and the other parts of the pipeline complete has been fixed. + The symptom was that the pipeline became uninterruptible. +08-03-25 A bug in restricted mode introduced in ksh93s that caused scripts + that did not use #! to executed in restricted mode has been fixed. +08-03-25 A bug in which the pipefail option did not work for a pipeline + within a pipeline has been fixed. +08-03-24 A bug in which OPTIND was not set correctly in subshells has + been fixed. +08-03-24 A bug which could cause a memory exception when a compound variable + containing an indexed array with only element 0 defined was expanded. +08-03-20 A bug in which ${!var[sub].*} was treated as an error has been fixed. +08-03-20 Associative array assignments of the form ([name]=value ...) + now allow ; as well as space tab and new line to separate elements. +08-03-18 A buffering problem in which standard error was sometimes + not flushed before sleep has been fixed. +08-03-17 A bug in which a signal sent to $$ while in a subshell would be + sent to the subshell rather than the parent has been fixed. +08-03-17 + A --default option added to set(1) to handle set +o POSIX semantics. + set --state added as a long name alias for set +o. +08-03-14 A bug in which using monitor mode from within a script could + cause the terminal group to change has been fixed. +08-03-10 The new ${...} command substitution will treat the trailing } + as a reserved word even if it is not at the beginning of a command, + for example, ${ date }. +08-03-10 If the name of the ENV begins with /./ or ././ then the + /etc/ksh.kshrc file will not be executed on systems that support + this interactive initialization file. +08-03-07 A bug in which ksh -i did not run the ENV file has been fixed. +08-03-07 A bug in which ulimit did not always produce the same output as + ulimit -fS has been fixed. +08-03-04 A bug in multiline mode in emacs and vi mode which could cause the + cursor to be on the wrong line when interrupt was hit has been fixed. +08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became + optional for ${a[i]} inside [[...]] was restored in the case + where the argument can be a pattern. +08-03-03 A bug in which creating a name reference to an associative array + instance would fail when the subscript contained characters [ or + ] has been fixed. +08-02-29 +The redirection operator >; has been added which for non-special + files, generates the output in a temporary file and writes the + specified file only of the command has completed successfully. +08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*) + has bee fixed. +08-02-07 A bug in which test \( ! -e \) produced an error has been fixed. +08-02-14 +The typeset -a option can now optionally be followed by the name + of an enumeration type which allows subscripts to be enumerations. +08-02-14 +The enum builtin which creates enumeration types has been added. +08-02-12 The backoff logic when there are no more processes has been fixed. +08-02-07 The -X option has been added to typeset. The -X option creates + a double precision number that gets displayed using the C99 %a + format. It can be used along with -l for long double. +08-01-31 The -T option to typeset has been added for creating typed + variables. Also the -h and -S options have been added to + typeset that are only applicable when defining a type. +08-01-31 The prefix expansion operator @ has been added. ${@name} + expands to the type of name or yields the attributes. +07-11-15 A bug in the macro expander for multibyte characters in which + part of the character contains a file pattern byte has been fixed. +07-10-03 A bug in which : was not allowed as part of an alias name has been + fixed. +07-09-26 A bug in which appending a compound variable to a compound variable + or to an index array didn't work has been fixed. +07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually + cursor up, when the cursor is at the end of the line will fetch + the most recent line starting with the current line. +07-09-18 The value of ${!var} was correct when var was a reference to an + array instance. +07-09-18 The value of ${!var[sub]} was not expanding to var[sub] and this + was fixed. It also fixed ${name} where name is a name reference + to var[sub]. +07-09-18 +It is now legal to create a name reference without an initialization. + It will be bound to a variable on the first assignment. +07-08-30 +A discipline function can be invoked as ${x.foo} and is equivalent + to ${ x.foo;} and can be invoked as x.foo inside ((...)). +07-07-09 A bug in which typeset -a did not list indexed arrays has been + fixed. +07-07-03 +The command substitution ${ command;} has been added. It behaves + like $(command) except that command is executed in the current + shell environment. The ${ must be followed by a blank or an + operator. + +08-04-17 --- Release ksh93s+ --- +08-04-17 A bug in which umask was not being restored correctly after a + subshell has been fixed. +08-04-15 A bug in which sending a STOP signal to a job control shell started + from within a shell function caused cause the invoking shell to + terminate has been fixed. +08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop + has been fixed. +08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed. +08-03-06 A bug with ksh -P on systems that support the the profile shell, + in which it would exit after running a non-builtin has been fixed. +08-01-31 A bug in which command substitution inside ((...)) could cause + syntax errors or lead to core dumps has been fixed. +08-01-17 A bug in which discipline functions could be deleted when invoked + from a subshell has been fixed. +08-01-17 A bug in which a command substitution consisting only of + assignments was treated as a noop has been fixed. +08-01-17 A bug in which discipline functions invoked from within a + compound assignment could fail has been fixed. +08-01-16 Incomplete arithmetic assignments, for example ((x += )), now + generate an error message. +08-01-16 A bug in which a set discipline defined for a variable before + an array assignment could cause a core dump has been fixed. +08-01-03 A bug in on some systems in which exit status 0 is incorrectly + returned by a process that catches the SIGCONT signal is stopped + and then continued. +07-12-13 A race condition in which a program that has been stopped and then + continued could loose the exit status has been fixed. +07-12-12 Code to check for file system out of space write errors for all + writes has been added. +07-12-11 A bug in the macro expander for multibyte characters in which + part of the character contains a file pattern byte has been fixed. +07-12-06 A bug in the emacs edit mode when multiline was set that output + a backspace before the newline to the screen has been fixed. +07-12-04 A bug in which using TAB after a variable name listing expansion + in the edit modes would cause the $ to disappear has been fixed. +07-11-28 A bug in which setting IFS to readonly could cause a subsequent + command substitution to fail has been fixed. +07-11-27 A work around for a gcc 4.* C99 "feature" that could cause a job + control shell to go into an infinite loop by adding the volatile + attribute to some auto vars in functions that call setjmp(). +07-11-27 A bug in which the shell could read ahead on a pipe causing the + standard input to be incorrectly positioned has been fixed. +07-11-27 A bug in which compound variable UTF-8 multibyte values were not + expanded or traced properly has been fixed. +07-11-21 A bug where an unbalanced '[' in a command argument was not treated + properly has been fixed. +07-11-15 A bug in which compatibility mode (no long option names) getopts(1) + incorrectly set the value of OPTARG for flag options has been fixed. +07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand + has been fixed. +07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility. +07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands + has been fixed. +07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the + signs of { -NaN -Inf -0.0 } have been fixed. +07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range + of signals, determined at runtime, are now supported. +07-11-15 A bug in which creating an index array with only subscript 0 created + only a simple variable has been fixed. +07-11-14 A bug in which appending to an indexed array using the form + name+=([sub]=value) could cause the array to become an associative + array has been fixed. +07-11-14 A bug in which typeset without arguments could coredump if a + variable is declared as in indexed array and has no elements has + been fixed. +07-11-14 A bug in which creating a local SECONDS variable with typeset in + a function could corrupt memory has been fixed. +07-11-14 A bug which could cause a core dump when a script invoked by name + from a function used compound variables has been fixed. +07-11-05 A bug in which printf %d "'AB" did not diagnose unconverted characters + has been fixed. +07-11-05 printf %g "'A" support added for all floating point formats. +07-11-01 A bug in which typeset -f fun did not display the function definition + when invoked in a subshell has been fixed. +07-10-29 The sleep builtin was fixed so that all floating point constants + are valid operands. +07-10-10 A bug in which the locale was not being restored after + LANG=value command has been fixed. +07-09-20 A bug in which a nameref to a compound variable that was local + to the calling function would not expand correctly when displaying + is value has been fixed. +07-09-19 A bug which cause cause a core dump if .sh.edchar returned + 80 characters or more from a keyboard trap has been fixed. +07-09-14 A bug in which could cause a core dump when more than 8 file + descriptors were in use has been fixed. +07-09-10 A bug in which creating a name reference to an instance of + an array when the array name is itself a reference has been fixed. +07-09-10 The file completion code has been modified so that after an = in + any word, each : will be considered a path delimiter. +07-09-06 A bug in which subprocess cleanup could corrupt the malloc() heap + has been fixed. +07-08-26 A bug in which a name reference to an associative array instance + could cause the subscript to be evaluated as an arithmetic expression + has been fixed. +07-08-22 A bug in which the value of an array instance was of a compound + variable was not expanded correctly has been fixed. +07-08-14 A bug which could cause a core dump when a compound assignment was + made to a compound variable element with a typeset -a attribute + has been fixed. +07-08-08 A bug in which a trap ignored in a subshell caused it to be + ignored by the parent has been fixed. +07-08-07 A bug in which the set command would generated erroneous output + for a variable with the -RZ attribute if the variable name had been + passed to a function has been fixed. +07-08-02 A bug in which read x[1] could core dump has been fixed. +07-08-02 A second bug in which after read x[sub] into an associative array + of an element that hasn't been assigned could lead to a core dump + has been fixed. +07-07-31 A bug in which a pipeline that completed correctly could have + an exit status of 127 when pipefail was enabled has been fixed. +07-07-09 +The SHOPT_AUDIT compile option has been added for keyboard logging. +07-06-25 In vi insert mode, ksh no longer emits a backspace character + before the carriage return when the newline is entered. +07-06-25 A bug in which pipefail would cause a command to return 0 + when the pipeline was the last command and the failure happened + on a component other than the last has been fixed. +07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep + contained a left parenthesis in single quotes has been fixed. +07-06-18 The braces for a subscripted variable with ${var[sub]} are now + optional when inside [[...]], ((...)) or as a subscript. +07-05-28 A bug in brace expansion in which single and double quotes did + not treat the comma as a literal character has been fixed. +07-05-24 The -p option of whence now disables -v. +07-05-23 Several bug fixes in compound variables and arrays of arrays + have been made. +07-05-15 A bug in which the %B format of printf was affected by the + locale has been fixed. +07-05-14 A bug in which \ was not removed in the replacement pattern with + ${var/pattern/rep} when it was not followed by \ or a digit has + been fixed. +07-05-10 A bug in which ksh -R file core dumped if no script was specified + has been fixed. it not displays an error message. +07-05-07 Added additional Solaris signals to signal table. +07-04-30 A bug in which a pipeline with command substitution inside a + function could cause a pipeline that invokes this function to + hang when the pipefail option is on has been fixed. +07-04-30 +Added -q to whence. +07-04-18 A small memory leak with each redirection of a non-builtin has + been fixed. +07-03-08 A bug in which set +o output command line options has been fixed. +07-03-08 A bug in which an error in read (for example, an invalid variable + name), could leave the terminal in raw mode has been fixed. +07-03-06 A bug in which read could core dump when specified with an array + variable with a subscript that is an arithmetic expression has + been fixed. +07-03-06 Several serious bugs with the restricted shell were reported and + fixed. +07-03-02 If a job is stopped, and subsequently restarted with a CONT + signal and exits normally, ksh93 was incorrectly exiting with + the exit status of the stop signal number. +07-02-26 +M-^L added to emacs mode to clear the screen. +07-02-26 A bug in which setting a variable readonly in a subshell would + cause an unset error when the subshell completed has been fixed. +07-02-19 +The format with printf uses the new = flag to center the output. +07-02-19 A bug in which ksh93 did not allow multibyte characters in + identifier names has been fixed. +07-02-19 A bug introduced in ksh93 that causes global compound variable + definitions inside functions to exit with "no parent" has been fixed. +07-02-19 A bug in which using compound commands in process redirection + arguments would give syntax errors <(...) and >(...) has been fixed. +07-01-29 A bug which caused the shell to core dump which can occur when a + built-in exits without closing files that it opens has been fixed. +07-01-26 A bug in which ~(E) in patterns containing \ that are not inside () + has been fixed. + +06-12-29 --- Release ksh93s --- +06-12-29 A bug in which the value of IFS could be changed after a command + substitution has been fixed. +06-12-22 +/dev/(tcp|udp|sctp)/HOST/SEVRICE now handles IPv6 addresses on + systems that provide getaddrinfo(3). +06-12-19 +A -v option was added to read. With this option the value of + the first variable name argument will become the default value + when read from a terminal device. +06-11-20 A bug in which "${foo[@]:1}}" expands a null argument (instead of + no argument), when foo[0] is not empty has been fixed. +06-11-16 The discipline functions have been modified to allow each subscript + to act independently. Currently the discipline function will not + be called when called from a discipline function of the same variable. +06-11-14 A bug which could cause a core dump if a file descriptor for + an internal file was closed from with a subshell has been fixed. +06-10-30 +The redirections <# pattern, and <## pattern have been added. + Both seek forward to the beginning of the next line that contains + the pattern. The <## form copies the skipped portion to standard + output. +06-10-26 +On systems that support stream control transport, the virtual file + name /dev/sctp/host/port can now be used to establish connections. +06-10-26 +The printf modifier # when used with d produces units in thousands + with a single letter suffix added. The modifier # when used with + the i specification provides units of 1024 with a two letter suffix. +06-10-24 The value of $! is now set to the process id of a job put + into the background with the bg command as required by POSIX. +06-10-23 A bug in which the value of $! was affected by a background + job started from a subshell has been fixed. +06-10-23 A bug in ${var:offset:len} in multibyte locales has been fixed. +06-10-15 +The remaining math functions from C99 were added for any system + that supports them. +06-10-13 The klockwork.com software detected a few coding errors that + have been fixed. +06-10-12 A bug when skipping over `...` with ${x:=`...`} when x is set + has been fixed. +06-10-11 A bug in process floating constants produced by the %a format + of printf has been fixed. +06-10-06 A bug in which IFS was not being restored correctly in some + cases after a subshell has been fixed. +06-10-06 A bug in which pipefail was not detecting some failures in + pipelines with 3 or more states has been fixed. +06-10-03 A bug in the processing of >(...) with builtins which could + cause the builtin to hang has been fixed. +06-10-03 A bug in the for loop optimizer which causes >(...) process + substitution to be ignored has been fixed. +06-09-17 +The -a option was added to typeset for indexed arrays. This + is only needed when using the ([subscript]=value ...) form. +06-09-06 +The showme option was added. Each simple command not beginning + with a redirection and not occurring with in the while, until, if, + select condition can be preceded by a semi-colon which will + be ignored when showme is off. When showme is on, any command + preceded by a colon will be traced but not executed. +06-08-16 +As a new feature, a leading ~(N) on a pattern has no effect + except when used for file expansion. In this case if not + matches are found, the pattern is replaced by nothing rather + than itself. +06-08-11 A bug in the expansion of ${.sh.match[i]:${#.shmatch[i]}} has + been fixed. +06-08-10 +The read builtin options -n and -N have been modified to treat + the size as characters rather than bytes unless storing into a + binary (typeset -B) variable. +06-07-27 +When the here document operator << is followed directly by a # + rather than a -, the first line of the here-document determines + how much whitespace is removed for each line. +06-07-26 A bug in the C-shell history (enabled with set -H) in which the + history event !$ was not processed has been fixed. +06-07-21 A bug on some systems in which assigning PATH on a command line + would not take effect has been fixed. +06-07-20 Add ksh93 and rksh93 as allowable names for ksh binaries. +06-07-20 Removed the SHOPT_OO compilation option which was only partially + implemented. +06-07-20 The ability to use egrep, grep, and fgrep expressions within + shell patterns has been documented. +06-07-17 A bug with arithmetic command expressions for locales in which + the comma is a thousands separator has been fixed. +06-07-13 +The default HISTSIZE was increased from 128 to 512. +06-07-13 A multibyte problem with locales that use shift codes has been fixed. +06-06-23 A number of bug fixes for command, file, and variable completion + have been mode. +06-06-20 +Floating point division by zero now yields the constant Inf or -Inf + and floating functions with invalid arguments yield NaN. +06-06-20 +The floating point constants Inf and NaN can be used in arithmetic + expressions. +06-06-20 +The functions isinf(), isnan(), tanhl() have been added for + arithmetic expressions. +06-06-13 Internal change to use ordering for variables instead of hashing + to speed up prefix matching. +06-06-13 A window between fork/exec in which a signal could get lost + and cause a program to hang has been eliminated +06-06-13 A bug in edit completion with quoted strings has been fixed. +06-06-07 The restricted options can now be enabled by set as well as on + the command line. Once set, it can not be disabled. +06-06-04 Modified built-in binding so that for systems for which /bin + and /usr/bin are the same, a builtin bound to /bin will get + selected when either /bin or /usr/bin is scanned. +06-06-04 +Added literal-next character processing for emacs/gmacs mode. + This change is not compatible with earlier versions of ksh93 + and ksh88 when the stty lnext is control-v. The sequence + escape-control-v will display the shell version. +06-05-31 +Modified emacs and vi mode so that entering a TAB after a partial + TAB completion, generates a listing of possible completions. + After the second TAB, a number followed by a TAB will perform + the completion with the corresponding item. +06-05-19 +Modified arithmetic so that conversions to strings default to + the maximum number of precision digits. +06-05-16 Bug fixes for multibyte locales. +06-05-10 The =~ operator was added to [[...]] and [[ string ~= ERE ]] + is equivalent to [[ string == ~(E)ERE ]]. +06-04-25 A bug in the vi edit mode which could cause the shell to core dump + when switching from emacs mode. +06-04-17 A bug in which using LANG or LC_ in assignment lists with builtins + did not restore the locale correctly has been fixed. +06-04-04 A bug in which discipline functions could not be added to variables + whose names started with .sh has been fixed. +06-03-28 +The -s option to typeset was added to modify -i to indicate short + integers. +06-03-28 A bug in which variables assignment lists before functions + defined with function name were not passed on the functions + invoked by this function has been fixed. +06-03-28 A bug in which name references defined within a function defined + with function name could not be used with compound variables has + been fixed. +06-03-27 A bug in which read <&p (print >&p) would cause the coprocess input + (output) pipe to close before reading from (after writing to) + it has been fixed. +06-02-28 A bug in which stopping a job created with the hist builtin command + would create a job that could not be restarted has been fixed. + +06-01-24 --- Release ksh93r --- +06-01-24 A bug in which running commands with standard output closed would + not work as expected has been fixed. +06-01-23 A bug in which print -u could fail when file descriptor was + open for writing has been fixed. +06-01-19 The ?: arithmetic operator fixed to work when the operation after + the colon was an assignment. +05-12-24 A bug which could lead to a core dump when elements of a compound + variable were array elements, i.e. foo=(bar=(1 2)), has been fixed. +05-12-13 An arithmetic bug in which x+=y+=z was not working has been fixed. +05-12-13 An arithmetic bug in which x||y was returning x when x was non-zero + rather than 1 has been fixed. +05-12-07 +The aliases for integer and float have been changed to use attributes + -li and -lE to handle long long and long double types. +05-12-07 +The histexpand (-H) option has been added which allows C-shell + style history expansions using the history character !. +05-12-07 +The multiline option was added which changes that way the edit + modes handle lines longer than the window width. Instead of + horizontal scrolling, multiple lines on the screen are used. +05-12-05 The whence builtin now returns an absolute pathname when the + command is found in the current directory. +05-11-29 A bug which caused ksh -c '[[ ! ((' to core dump rather than + report a syntax error has been fixed. +05-11-29 A bug when reading fixed length records into typeset -b variables + which caused a zero byte to terminate the value has been fixed. +05-11-22 +The ability to seek to an offset within a file has been added + with the new I/O redirection operators, <# and >#. Currently, + these redirection operators must be followed by ((expr)) + but in a future release, it should be able to used to seek forward + to the specified shell pattern. In addition $(n<#) expands to the + current byte offset for file descriptor n. +05-11-22 +The .sh.match array variable is now set after each [[ ... ]] + pattern match. Previously it was only set for substring matches. +05-10-17 A bug in which the library path variable could be prefixed + with a directory when a .path file was not encountered in + the directory of the executable has been fixed. +05-09-15 A for/while loop optimizer bug in which $OPTIND was not + correctly expanded has been fixed. +05-09-05 A bug in which a history command that invoked a history + command could go into an infinite loop has been fixed. +05-08-31 +In the case that IFS contains to adjacent new-lines so that + new-line is not treated as a space delimiter, only a single + new-line is deleted at the end of a command substitution. +05-08-19 +When a tilde substitution expands to the / directory and is + followed by a /, it is replaced by the empty string. +05-08-16 A bug in which n<&m did not synchronize m has been fixed. +05-08-16 A bug in which process substitution ( <() and >() ) was not + working within for and while loops has been fixed. +05-07-24 A bug in which the pattern ~(E)(foo|bar) was treated as a syntax + error has been fixed. +05-07-24 A bug in completion with =, where n was the one of the + previous selection choices has been fixed. +05-07-21 A bug with multibyte input when no edit mode was specified which + caused the input line to shift left/right has been fixed. +05-06-24 A race condition which could cause the exit status to get lost + on some fast systems has been fixed. +05-06-21 A bug in which nested patterns of the form {m,n}(pat) would cause + syntax errors has been fixed. +05-06-21 A bug in the macro expander has been fixed which could cause a + syntax error for an expansion of the form ${x-$(...)} when + x is set and the command substitution contained certain strings. +05-06-08 +On systems for which echo does not do System V style \ expansions, + the -e option was added to enable these expansion. +05-06-08 A bug in which ${var op pattern} to not work when inside an + arithmetic expression has been fixed. +05-05-23 +An extension to shell patterns that allows matching of nested + groups while skipping over quoted strings has been added. +05-05-18 A bug in which the line number for errors was not correct for + functions loaded from FPATH has been fixed. +05-04-18 A bug in which the exit status $? is not set when a trap triggered + by the [[...]] command is executed has been fixed. +05-04-08 +Redirection operators can be directly preceded with {varname} + with no intervening space, where varname is a variable name which + allows the shell to select a file descriptor > 10 and store it + into varname. +05-04-08 +SHOPT_CMDLIB_BLTIN=1 now includes generated table. +05-04-07 +[[ -o ?option ]] is true if "option" is a supported option. +05-04-05 A bug in handling file completion with spaces in the names + has been fixed. +05-03-25 +The SIGWINCH signal is caught by default to keeps the LINES and + COLUMNS variables in sync with the actual window size. +05-03-25 +Building ksh with SHOPT_REMOTE=1 causes ksh to set --rc if stdin is + a socket (presumably part of a remote shell invocation.) +05-03-25 +Building ksh with SHOPT_SYSRC=1 causes interactive ksh to source + /etc/ksh.kshrc (if it exists) before sourcing the $ENV file. +05-03-25 +{first..last[..incr][%fmt]} sequences added to brace expansions + when braceexpand is enabled. +05-03-03 A bug where a SIGCHLD interrupt could cause a fifo open to fail has + been fixed. +05-02-25 A bug in which a builtin command run in the background could + keep a file descriptor open which could cause a foreground + process to hang has been fixed. +05-02-24 A bug where builtin library commands (e.g., date and TZ) failed to + detect environment variable changes has been fixed. +05-02-22 +The read builtin and word splitting are now consistent with respect + to IFS -- both treat IFS as field delimiters. +05-02-22 +The read builtin no longer strips off trailing delimiters that + are not space characters when there are fewer variables than fields. +05-02-17 A builtin bug on systems where dlsym(libcmd) returns link-time + bindings has been fixed. +05-02-12 A bug in which the lib_init() function for .paths BUILTIN_LIB + libraries was not called has been fixed. +05-02-06 A bug on some systems in which moving the write end of a co-process + to a numbered file descriptor could cause it to close has been fixed. +05-02-06 A bug in the vi-edit mode in which the character under the cursor + was not deleted in some cases with the d% directive has been fixed. +05-02-06 A bug where external builtin stdout/stderr redirection corrupted + stdout has been fixed. +05-02-04 A bug where times formatting assumed CLK_TCK==60 has been fixed. + +05-01-11 --- Release ksh93q --- +05-01-11 A bug in the integral divide by zero check has been fixed. +05-01-11 +The -l option has been added to read /etc/profile and + $HOME/.profile, if they exist, before the first command. +05-01-11 An argument parsing bug that caused `kill -s x -- n' to fail has + been fixed. +05-01-11 +The .paths file, introduced in ksh93m, which can appear in + any directory in PATH, now allows a line of the form 'BUILTIN_LIB=.' + When a command is searched for this directory, and the full path + matches the path of the built-in version of the command (listed + by the 'builtin' command) then the built-in version of the command + is used. When ksh is built with SHOPT_CMDLIB_DIR=1 then all libcmd + functions become builtins with the '/opt/ast/bin/' directory prefix. +05-01-10 A bug in which a nameref to a compound name caused a core dump has + been fixed. +05-01-09 A bug in which some SIGCHLD interrupts (from child processes exiting) + caused a fatal print/echo error diagnostic has been fixed. +04-12-24 A bug in which some SIGCHLD interrupts (from child processes exiting) + corrupted the internal process/job list, sometimes causing the shell + to hang, has been fixed. +04-12-01 A bug in which typeset -Fn truncated less than n digits for large + numbers has been fixed. +04-11-25 A bug in which standard error could be closed after a redirection + to /dev/stderr has been fixed. +04-11-17 A bug in which an expansion of the form ${array[@]:3} could expand + to ${array[0]} when ${array[3]} was not set has been fixed. +04-10-22 +The -E or -orc command line option reads ${ENV-$HOME/.kshrc} file. +04-10-22 +`-o foo' equivalent to `+o nofoo', `-o nobar' equivalent to `+o bar'. + `--foo' equivalent to `-o foo', `--nofoo' equivalent to `+o foo' +04-10-05 +The .paths file, introduced in ksh93m, which can appear in + any directory in PATH, now allows a line of the form + 'BUILTIN_LIB=libname'. When a command is searched for this directory, + the shared library named by libname will first be searched for a + built-in version of the command. +04-09-03 <<< here documents now handle quotes in the word token correctly. +04-08-08 +The maximum size for read -n and and read -N was increased from + 4095 to 32M. +04-08-04 +printf %q was modified so that if an no operand was supplied, no + no output would be generated rather than a quoted empty string. +04-08-01 +The -n and -N options of the read builtin has been modified + when reading variables with the binary attribute so that the + data is stored directly rather than through assignment. +04-08-01 +The shcomp command has been modified to process alias commands + under some conditions. +04-07-31 +The .sh.match variable added in ksh93l, now works like other + indexed arrays. +04-07-08 A loop optimizer bug which occurs when typeset is used in + a for or while loop inside a function has been fixed. +04-06-24 +The number of subexpressions in a pattern was increased to 64 + from the current number of 20. +04-06-17 +The -t option to read was modified to allow seconds to be + specified as any arithmetic expression rather than just + an integral number of seconds, for example even -t 'sin(.5)' + is now valid. +04-06-16 Two small memory leak problems were fixed. +04-06-15 A bug in ${var/pattern/"string"} which occurred when string + contained pattern matching characters has been fixed. +04-05-08 printf $'%d\n' produced an erroneous error message and has + been fixed. +04-05-24 A bug in which an associative array without any elements could + cause a core dump when a script with an associative array with + the same name was declared in a script invoked by name has + been fixed. +04-05-11 A bug in which an exec statement could close the script that + is being processed in a script that is run by name causing + a failure has been fixed. +04-04-28 +If the first character of assignment to an integer variable was 0, + the variable had been treated as unsigned. This behavior was + undocumented and has been removed. +04-04-05 A bug in which the positioning of standard input could be incorrect + after reading from standard input from a subshell has been fixed. +04-03-30 A bug in the for loop optimizer which in rare cases could cause + memory corruption has been fixed. +04-03-29 +The preset alias source='command .' has been added. +04-03-29 A bug introduced in ksh93p on some systems in which invoked by + name with #! on the first line would not get the signals handling + initialized correctly has been fixed. +04-03-29 A bug introduced in ksh93p in which a HUP signal received by + a shell that is a session group leader was not passed down to + its children has been fixed. + +04-02-28 --- Release ksh93p --- +04-02-28 +The ability to apply an append discipline to any variable has + been added. +04-02-14 A bug in which the exportall option (set -a) would cause incorrect + results for arrays has been fixed. +04-02-02 A bug in which an exported array would pass more than + the first element to a script invoked by name has been fixed. +04-02-02 A bug on some systems in which name=value pairs preceding a script + invoked by name was not getting passed to the script has been fixed. +04-01-20 A bug in which an unset discipline function could cause a core + dump on some systems has been fixed. +04-01-12 A bug in which a continue or break called outside a loop from + inside a function defined with name() syntax could affect + the invoking function has been fixed. +04-01-08 If a command name begins with ~, only filename completion will be + attempted rather than pathname completion using the builtin editors. +04-01-08 A bug in the vi edit mode in which the wrong repeat count on + multiple word replacements with the . directive has been fixed. +04-01-06 Backspace characters are now handled correctly in prompt strings. +04-01-06 +The getopts builtin has been modified to accept numerical + arguments of size long long on systems that support this. +04-01-06 A bug in which unsetting all elements of an associative array + would cause it to be treated as an indexed array has been fixed. +03-12-15 A bug in which a quoted string ending with an unescaped $ would + delete the ending $ in certain cases has been fixed. +03-12-05 A bug in which the shell could hang when set -x tracing a command + when an invalid multibyte character is encountered has been fixed. +03-12-05 On some systems, if the KEYBD trap is set, then commands that use + the meta key were not processed until return was hit. This + has been fixed. +03-12-05 A problem which occurred when the login shell was not a group + leader that could cause it to fail has been fixed. +03-12-05 A problem in which a shell could core dump after receiving a signal + that should cause it to terminate while it was in the process + of acquiring more space has been fixed. +03-12-05 +If ENV is not specified, the shell will default to $HOME/.kshrc + for interactive shells. +03-11-21 A bug introduced in ksh93o in which the DEBUG trap could get + disabled after it triggered has been fixed. +03-11-04 A bug in which using arithmetic prefix operators ++ or -- on a + non-lvalue could cause a core dump has been fixed. +03-11-04 A bug in which leading zeros were stripped from variable + expansions within arithmetic computation to avoid being treated + as octal constants when they should not have, has been fixed. +03-10-08 A bug introduced in ksh93o in which a large here document inside + a function definition could get corrupted has been fixed. +03-09-22 A bug in which the .get discipline function was not being + called when a string variable was implicitly referenced from + within a numerical expression has been fixed. +03-09-22 A bug in which a script without a leading #! could get executed + by /bin/sh rather than the current shell on some systems has + been fixed. +03-09-12 +To improve conformance with ksh88, leading zeros will be ignored + when getting the numerical value of a string variable so that + they will not be treated as octal constants. +03-09-03 +The builtin kill command now processes obsolete invocations + such as kill -1 -pid. +03-09-02 The restriction on modifying FPATH in a restricted shell (sh -r) + has been documented. +03-09-02 +The restricted shell (sh -r) has been modified to disallow + executing command -p. +03-08-07 A bug in which the KEYBD trap was not being invoked when + characters with the 8th bit set has been fixed. +03-08-02 A parser bug introduced in ksh93o which caused the character + after () in a Posix function definition to be skipped + when reading from standard input has been fixed. +03-08-01 A bug in which "${foo#pattern}(x)" treated (x) as if it were + part of the pattern has been fixed. +03-08-01 +The command -x option has been modified so that any trailing + arguments that do expand to a single word will be included + on each invocation, so that commands like command -x mv * dir + work as expected. + +03-07-20 --- Release ksh93o+ --- +03-07-20 A bug in which could cause memory corruption when a posix + function invoked another one has been fixed. +03-07-15 A bug in which a file descriptor>2 could be closed before + executing a script has been fixed. +03-07-15 A parsing error for <() and >() process substitutions inside + command substitution has been fixed. +03-07-15 A parsing error for patterns of the form {...}(...) when + used inside ${...} has been fixed. +03-07-15 An error in which expanding an indexed array inside a compound + variable could cause a core dump has been fixed. +03-07-15 A bug in which on rare occasions a job completion interrupt + could cause to core dump has been fixed. +03-06-26 A bug in which process substitution embedded within command + substitution would generate a syntax error has been fixed. +03-96-23 A bug in which ${@:offset:len} could core dump when there + were no arguments has been fixed. +03-96-23 A bug in which ${X[@]:offset:len} could core dump when X + was unset has been fixed. +03-06-22 +The -x option was added to the command builtin. If this + option is on, and the number of arguments would exceed ARG_MAX, + the command will be invoked multiple times with a subset of + the arguments. For example, with alias grep='command -x grep, + any number of arguments can be specified. +03-06-14 A bug in which could cause a core dump on some systems with + vi and emacs editors with the MULTIBYTE option has been fixed. +03-06-06 A bug in which the shell could core dump when a script was + run from its directory, and the script name a symlink to a file + beginning with .., has been fixed. +03-06-05 A bug in which the shell could core dump when a child process + that it is unaware of terminates while it is calling malloc() + has been fixed. +03-06-02 +An option named globstar (set -G) has been added. When enabled, + during pathname expansion, any component that consists only of ** is + matches all files and any number of directory levels. +03-05-30 A bug in which the PATH search could give incorrect results when + run from directory foo and PATH contained .:foo:xxx has been fixed. +03-05-29 +Some changes were made to the code that displays the prompt in edit + mode to better handle escape sequences in the prompt. +03-05-27 I added = to the list of characters that mark the beginning of + a word for edit completion so that filenames in assignments + can be completed. +03-05-20 A bug in which read -N could hang on some systems when reading + from a terminal or a pipe has been fixed. +03-05-19 A bug in which the output of uname from a command substitution + would go to the standard output of the invoking command when + uname was invoked with a non-standard option has been fixed. +03-05-19 A job control bug which would cause the shell to exit because + it hadn't take back the terminal has been fixed. The bug + could occur when running a function that contained a pipeline + whose last element was a function. +03-05-19 A job control timing bug introduced in ksh93o on some systems + which could cause a pipeline to hang if the first component + completed quickly has been fixed. +03-05-13 +The read builtin has been modified so that the builtin editors + will not overwrite output from a previous incomplete line. +03-05-13 A bug in which the name of an identifier could have the string + .sh. prefixed to it after expanding a variable whose name begins + with .sh. has been fixed. +03-05-13 A bug in the expansion of $var for compound variables in which + some elements would not be output when the name was a prefix + of another name in the compound variable has been fixed. +03-05-08 The last item in the ksh93o release on 03-01-02 has been + altered slightly to preserve the leading 0's when the + preceding character is a digit. Thus, with typeset -LZ3 x=10, + $(( 1$x)) will be 1010 whereas $(( $x) will be 10. +03-04-25 A bug in which if x is a name reference, then nameref y=x.foo + did not follow x has been fixed. + +03-03-18 --- Release ksh93o --- +03-03-18 +A -N unary operator was added to test and [[...]] which returns + true if the file exists and the file has been modified since it + was last read. +03-03-18 +The TIMEFORMAT variable was added to control the format for + the time compound command. The formatting description is + described in the man page. +03-03-06 +A -N n option was added to read which causes exactly n bytes + to be read unlike -n n which causes at most n bytes to be read. +03-03-03 +Three new shell variables were added. The variable .sh.file + stores the full pathname of the file that the current command + was found in. The variable .sh.fun names the current function + that is running. The variable .sh.subshell contains the depth + of the current subshell or command substitution. +03-03-03 +When the DEBUG trap is executed, the current command line after + expansions is placed in the variable .sh.command. The trap + is also now triggered before each iteration of a for, select, + and case command and before each assignment and redirection. +03-02-28 +Function definitions are no longer stored in the history file so + that set -o nolog no longer has any meaning. +03-02-28 +All function definitions can be displayed with typeset -f not + just those stored in the history file. In addition, typeset +f + displays the function name followed by a comment containing the + line number and the path name for the file that defined this function. +03-02-28 A bug in which the value of $LINENO was not correct when executing + command contained inside mult-line command substitutions has been + fixed. +03-02-19 +Since some existing ksh88 scripts use the undocumented and + unintended ability to insert a : in front of the % and # parameter + expansion operators, ksh93 was modified to accept :% as equivalent + to % and :# as equivalent to # with ${name op word}. +03-02-14 A bug which could cause a core dump when reading from standard + error when standard error was a pty has been fixed. +03-02-14 +The shell arithmetic was modified to use long double on systems + that provide this data type. +03-02-09 A bug in which a function located in the first directory in FPATH + would not be found when the last component of PATH was . and the + current directory was one of the directories in PATH has been fixed. +03-02-07 +The trap and kill builtin commands now accept a leading SIG prefix + on the signal names as documented. +03-02-05 A bug in the expansion of ${var/$pattern}, when pattern contained + \[ has been fixed. +03-02-05 A bug in which .sh.match[n], n>0, was not being set for substring + matches with % and %% has been fixed. +03-01-15 A bug in which getopts did not work for numerical arguments specified + as n#var in the getopts string has been fixed. +03-01-09 A bug in which using ${.sh.match} multiple times could lead to + a memory exception has been fixed. +03-01-06 A bug in the expansion of ${var/pattern/$string} in the case that + $string contains \digit has been fixed. +03-01-02 +A -P option was added for systems such as Solaris 8 that support + profile shell. +03-01-02 For backward compatibility with ksh88, arithmetic expansion + with ((...)) and let has been modified so that if x is a zero-filled + variable, $x will not be treated as an octal constant. + +02-12-05 --- Release ksh93n+ --- +02-11-30 A bug that can show up in evaluating arithmetic statements that + are in an autoloaded function when the function is autoload from + another function has been fixed. +02-11-30 An optimization bug in which an expansion of the form ${!name.@}, + which occurred inside a for or a while loop, when name is a name + reference, has been fixed. +02-11-18 A bug in which modifying array variables in a subshell could leave + side effects in the parent shell environment has been fixed. +02-11-18 A memory leak when unsetting an associative array has been fixed. +02-11-14 +The code to display compound objects was rewritten to make + it easier for runtime extensions to reuse this code. +02-11-14 +A change was made to allow runtime builtins to be notified when + a signal is received so that cleanup can be performed. +02-10-31 +User applications can now trap the ALRM signal. Previously, + the ALRM signal was used internally and could not be used + by applications. +02-10-31 A bug in which signals received while reading from a coprocess + for which traps were set was not handled correctly has been fixed. +02-10-31 A bug in which a file opened with exec inside a subshell could + be closed before the subshell completed has been fixed. +02-10-21 A bug in which setting PATH or FPATH inside a function might not + take effect has been fixed. +02-10-21 A bug which could cause a core dump when a local SECONDS variable + is defined in a function has been fixed. +02-10-15 A bug in which the associative array name operator ${!array[@]} + could return the same name multiple times has been fixed. +02-10-15 A bug in which the zero'th element of an associative array was + not getting set when an assignment was made without a subscript + specified has been fixed. + +02-09-30 --- Release ksh93n --- +02-09-30 +The maximum indexed array size was increased to 16Megs. +02-09-30 A bug which could cause a core dump when changing attributes + of associative array has been fixed. +02-09-30 A bug in which exporting an array variable would not export the + 0-th element has been fixed. +02-09-30 A bug in which an array assignment of the form a=($a ...) would unset + 'a' before the right hand side was evaluated has been fixed. +02-09-27 A bug in which the error message for ${var?message} when var was + null or unset did not contain the variable name var has been fixed. +02-09-27 A bug in which closing file descriptors 0 through 2 could + cause a subsequent here document to fail has been fixed. +02-09-14 A bug in whence which occurs when the specified name contained + a / has been fixed. +02-09-14 A bug in the parser for strings of the form name$((expr))=value + has been fixed. +02-09-14 A for loop optimization bug in which the number of elements in + an array was treated as an invariant has been fixed. +02-09-09 A bug in which redirection or closing of a file descriptor between + 3 and 9 could cause a subsequent here document to fail has been + fixed. +02-09-09 A bug in which a background job was not removed from the job list + when a subshell completed has been fixed, for example (prog&). +02-09-03 A bug in which an assignment of the form name=(integer x=3) + could be interpreted as an array assignment rather than a + compound variable assignment has been fixed. +02-08-19 A command completion bug which occurred on file systems that + are case insensitive has been fixed. +02-08-19 A bug which could lead to an exception on some systems (for + example FREEBSD) which occurred when setting PATH has been fixed. +02-08-11 A bug in arithmetic rounding in which a value input as a decimal + string would output as a rounded version of the string has + been fixed. +02-08-11 A bug in which the last character could be deleted from shell + traces and from whence when called from a multibyte locale + has been fixed. +02-08-01 A bug which could cause a core dump to occur when a shell script + is executed while a coprocess is running that has closed the + output pipe has been fixed. +02-08-01 A bug in which command completion in multibyte mode could + corrupt memory for long command lines has been fixed. + +02-06-17 --- Release ksh93n- --- +02-06-17 A bug in which user defined macros could cause a core dump in + with MULTIBYTE mode has been fixed. +02-06-17 A bug in which printf format specifiers of the form %2$s were causing + a core dump has been fixed. +02-06-17 A bug in which setting stty to noecho mode did not prevent the + echoing of characters by ksh when emacs or viraw mode + was enabled has been fixed. +02-06-17 A bug in which background job completion could cause the sleep + builtin to terminate prematurely has been fixed. +02-06-17 A bug in which the shell could core dump if getopts was called + when the OPTIND variable contained a negative value has been fixed. +02-06-10 +The edit mode prompt has been modified to handle escape sequences. +02-06-10 A bug which occurred for interactive shells in which the builtin + cat command was used in command substitution on a file whose + size was larger than PIPE_BUF has been fixed. +02-06-10 A bug in which the trap on ERR was not being processed when + set inside a function has been fixed. +02-06-07 A bug in which function definitions could cause the history count + to be decremented by one (and even become negative) has been fixed. +02-06-05 A bug in read in which share mode could be enabled has been fixed. +02-05-28 A bug which could occur when the last command of a script was + a case statement and the action selected ended in ;& instead of ;; + has been fixed. +02-05-23 A bug with unary + introduced in ksh93k has been fixed. +02-05-07 A bug in substitutions of the form ${var/pattern/string} in which + a backslash was inserted in the replacement string when it contained + a special pattern character has been fixed. +02-05-01 A bug in the emacs edit mode which occurred in versions compiled + for multibyte character sets which occurred when a repeated search + was requested after a long line had been returned for the previous + search has been fixed. +02-04-02 +vi and emacs edit modes were modified so that tab completion is + disabled when invoked from the read built-in. + +02-03-26 --- Release ksh93m+ --- +02-03-26 A bug in which \ was not handled correctly when used in file + expansion has been fixed. +02-02-18 A bug in which lines beginning with a # were deleted from here + documents when the here-document delimiter was followed by + a comment has been fixed. +02-12-06 An optimization bug in which ${!x[@]) was treated as invariant in + a for loop has been fixed. +02-02-06 A bug in which the ERR trap is not cleared for a script invoked + by name from within a function has been fixed. +02-01-08 A bug in which a shell script executed from within a subshell + could cause this script to have an invalid pointer leading + to a memory fault has been fixed. +02-01-07 +Added here documents of the form <<< word (as per zsh) which + is equivalent to << delim\nword\ndelim. +02-01-07 A bug in which the first word of a compound assignment, + x=(word ...), was treated as a reserved word has been fixed. +02-01-07 A bug in the handling of \ when noglob was enabled and a + substitution of the form ${word op pattern} occurred in the + same word has been fixed. +02-01-07 +A compilation option, CMDLIB_BLTIN in the file OPTION, has + been added. When this options is set, all commands implemented + in libcmd become shell builtin commands by default. +02-01-07 A bug in which builtin foo, where foo is already a builtin + would result in the builtin foo getting removed has been fixed. +02-01-07 A bug which the shell executed a command found in the current + directory when PATH have no valid directories has been fixed. +01-11-28 The value of $? was not being set when called with exit. +01-11-28 If the last command was of the form (...) and a trap on EXIT or + ERR was set, and the command inside () modified the trap, then + the original trap wasn't executed. +01-11-26 +The value for 0 is now preceded by the base number when + the base was not 10. +01-11-26 +The default has compilation mode has been changes so that + viraw mode will always be on. + +01-10-31 --- Release ksh93m --- +01-10-31 A for loop optimizer bug for subshells contained within for + loops has been fixed. +01-10-16 typeset without arguments no longer outputs variable names + that do not have any attributes that are set. +01-10-16 A bug introduced in ksh93l in which assignments specified with + the exec built-in were not being expanded properly has been + fixed. +01-10-11 An optimization bug in which ${!x) was treated as invariant in + a for loop has been fixed. +01-10-11 Unsigned integer variables in bases other than 10 are printed now + expand in that base with the base prefix. +01-10-10 A number of typos in the self generating man pages for shell + built-ins have been fixed. +01-10-04 The self generated man pages for hist and fc were not working + correctly and have been fixed. +01-10-03 Yet another optimizer bug in which shell patterns were + treated as invariants has been fixed. +01-09-27 Two bugs relating to multibyte history searches and to find + have been fixed. +01-09-27 A bug introduced in ksh93k in which the PATH searching was + not restored after running a command with an assignment list + has been fixed. +01-09-26 A bug in which a zero filled field was treated as octal when + converted to integer has been fixed. +01-09-26 Yet another bug in the optimization of for loops related to + recursive functions with break or continue statements has been fixed. +01-09-25 +The exponentiation operator ** was added to the shell arithmetic + evaluation. It has higher precedence than * and is left + associative. +01-09-25 The code was modified to use the ast multibyte macros + and functions for handling multibyte locales. +01-09-25 +The expansion ${parameter:offset:length} now handles negative + offsets which cause offsets to be measured from the end. +01-09-25 Some spelling errors in the documentation were corrected. +01-09-24 +The /dev/tcp/host/port and /dev/udp/host/port now allow + the ports to be specified by service name. +01-09-24 +The change staring with ksh93g in which the the appropriate + library path variable is prepended with a corresponding library + directory has been modified. With the new method, only the + library path defined in the file named .paths in the directory + where the executable is found will be modified. See the + man page for more details. +01-09-23 +The .fpath file (see ksh93h) is no longer looked for in each + directory on the path to locate function directories. The + file named .paths is used instead. +01-09-23 A bug in which IFS was not being restored after being changed in + a subshell has been fixed. +01-09-16 +With the vi and emacs edit modes, after a list of command + or functions is generated with = or M-= respectively, + any element from the list can be pasted on the command line + by preceding the = or M-= with a numeric parameter specifying + the position on the list. +01-09-16 A bug in ksh93l caused command completion not to find aliases + and functions. Command listing from the edit mode was presented + in reverse order. This has been fixed. +01-09-13 Another bug in the optimization of for loops related to subshells + when traps were set has been fixed. +01-09-07 A change in ksh93l caused brace expansion to stop working + and this has been fixed. +01-09-04 A bug introduced in ksh93k in which an arithmetic statement + within a function that used name references did not follow the + reference has been fixed. +01-09-04 A bug introduced in ksh93l in which export -p did not prefix + each export with the word export has been fixed. +01-08-29 A bug in multibyte input which occurred when a partial multibyte + character was received has been fixed. +01-08-29 A bug introduced in ksh93l which could cause a core dump + when an assignment list containing PATH is specified inside + command substitution has been fixed. +01-08-09 Another bug in the optimization of for loops in ksh93l caused + errors in recursive functions using local variables that + contained for loops has been fixed. +01-07-27 A bug in which IFS would be unset after a command substitution + inside a here document has been fixed. +01-07-26 To conform to the POSIX standard, if you invoked ksh name, + and name does not contain a /, it will first try to run + one in the current directory whether it is executable or not + before doing a path search for an executable script. Earlier + versions first checked for an executable script using the + PATH variable. +01-07-23 A bug in which unset -f invoked in a subshell could unset a + function defined in the parent has been fixed. +01-07-16 A bug in the optimization of for loops in ksh93l caused + name references to be treated as invariants has been fixed. +01-07-09 A bug in which a discipline function applied to a local variable + could cause a shell exception has been fixed. Discipline + functions can only be specified for global variables. + +01-06-18 --- Release ksh93l --- +01-06-18 A bug in assigning integers larger than can be represented as + long integers to floating point variables has been fixed. +01-06-18 A bug in the handling of unsigned integers (typeset -ui) has + been fixed. +01-06-04 The evaluation of the PS1 prompt no longer effects the value + of the $? variable. +01-06-01 A small memory leak from subshells has been fixed. +01-05-22 A bug in which attributes for variables that did not have + values would be lost after a subshell has been fixed. +01-05-22 +The %R format has been added to convert a shell pattern into + an extended regular expression. +01-05-22 +The escape sequences \e, \cX, \C[.collating-element.], and + \x{hex} have been added to ASCII-C strings and to printf format + strings. +01-05-20 +Patterns of the form {n}(pattern) and {m,n}(pattern) are now + recognized. The first form matches exactly n of pattern whereas, + the second form matches from m to n instances of pattern. +01-05-20 +The shell allows *-(pattern), +-(pattern), ?-(pattern), + {m,n}-(pattern}, and @-(pattern) to cause the minimal + match of pattern to be selected whenever possible rather + than the maximal (greedy) match. +01-05-20 +The character class [:word:] has been added to patterns. + The word class is the union of [:alnum:] and the character _. +01-05-20 +Inside (...) pattern groups, the \ character is now treated + specially even when in an enclosing character class. The + sequences, \w, \d, \s are equivalent to the character classes + word, digit, and space respectively. The sequences \W, \D, + and \S are their complement sets. +01-05-20 +The shell now recognizes pattern groups of the form + ~(options:pattern) where options or :pattern can be omitted. + Options use the letters + and - to enable and disable options + respectively. The option letters g (greedy), i (ignore case) + are used to cause maximal matching and to cause case + insensitive matching respectively. If :pattern is also + specified, these options are only in effect while this + pattern is being processed. Otherwise, these options remain + in effect until the end of the pattern group that they are contained + in or until another ~(...) is encountered. These pattern groups + are not counted with respect to group numbering. +01-05-14 When edit completion, expansion, or listing occurs in the + middle of a quoted string, the leading quote is ignored when + performing the completion, expansion, or listing. +01-05-14 A small memory leak from subshells has been fixed. +01-05-10 A bug in which open files were not restored after a subshell + that had used exec to replace a file has been fixed. +01-05-10 +Redirection to a null file name now generates an error message. +01-05-09 The shell now rejects some invalid parameter substitutions that + were previously processed in undefined ways. +01-05-09 A bug in which the output of select was not flushed before the + read when input did not come from the terminal has been fixed. +01-05-08 A bug in which job ids would not be freed for interactive shells + when subshells ran built-ins in the background has been fixed. +01-05-08 +The FPATH variable now requires an explicit . to cause the + current directory to be treated as a function directory. +01-05-08 A bug in read -n when echo mode was disabled has been fixed. +01-05-07 A bug in which function definitions could be listed as part + of the history has been fixed. +01-04-30 +This release uses a new and often much faster pattern matcher than + earlier releases. +01-04-30 +An optimizer now eliminates invariant parameter expansions from + for while and until loops. +01-04-30 +The variable .sh.match is set after each pattern match (# % or /) + in a variable substitution. The variable .sh.match is an + indexed array with element 0 being the complete match. + The array is only valid until the next subsequent pattern + match or until the value of the variable changes which ever + comes first. +01-04-30 +A self generating man page has been added to shcomp. Also, + shcomp now stops compiling when it finds an exit or exec + command and copies the remainder so that it can be used + for standard input. +01-04-30 +The shcomp command was modified so that it can work in an + EBCIDIC environment and that binary scripts are portable + across environments. +01-04-30 A bug in the handling of a trailing : in PATH has been fixed. +01-04-30 A bug in which the builtin version of a command would get invoked + even though the full pathname for the command was specified + has been fixed. +01-04-30 A bug in which read would loose the last character when + reading the last line of a file that did not contain a new-line + character has been fixed. +01-04-23 A bug on some systems in which in vi mode the end of file + character and end of line character could be swapped has + been fixed. +01-04-23 A bug on some systems in which invoking a shell script that + did not have execute permission could set the exit value to + 127 rather than 126 has been fixed. +01-04-20 A bug in which read -n from a pipe would block if fewer than + n characters was received has been fixed. +01-04-09 A bug in which invalid patterns, for example, ) by itself, + was not treated as a string has been fixed so that if i=')', + then [[ $i == $i ]] is true. +01-04-09 +The shell arithmetic now interprets C character constants. +01-04-09 A bug in which a non-zero return from a function defined + with the function reserved word did not trigger the ERR + trap or exit with set -e has been fixed. +01-04-02 A bug on some systems, in which characters above 127 were + not displayed correctly in vi or emacs edit mode has been fixed. +01-04-02 A bug on some systems, introduced in the 'k' point release, in + which the erase character in viraw mode was moving the cursor + to the left without erasing the character has been fixed. +01-04-02 On some systems the wcwith() function was returning a wrong + value for characters and caused characters to be displayed + incorrectly from the shell edit modes. A work around for + this problem has been added. +01-03-26 A bug in which valid scripts could produce syntax errors + when run with locales that considered characters such as "'" + to be space characters has been fixed. +01-03-20 A bug in which an syntax error in an arithmetic expression + entered interactively could cause the shell to go into + an infinite loop outputting the error message has been fixed. +01-03-10 +ksh93 accepts -l as a synonym for -L in test on systems for + which /bin/test -l tests for symbolic links. +01-03-10 A bug in parsing scripts in which { and } are used in place of + in and esac in case statements embedded in compound commands + has been fixed. Use of { and } for in and esac is obsolete. +01-03-06 A bug in which an argument of the form foo=bar was not + being passed correctly to a traced function whose name + was foo has been fixed. +01-03-02 Using $(trap -p name) did not print the name of the current + trap setting for trap name. +01-02-26 Exported floating point variables gave incorrect results + when passing them to ksh88. This has been fixed. +01-02-25 A race condition in which a coprocess which completed too quickly + would not allow subsequent coprocesses to start has been fixed. +01-02-25 The 'g' format specifier is now handled by printf. It had + inadvertently been omitted. +01-02-20 The + was not being displayed during an execution trace + with the += assignment operator. +01-02-19 The error message which occurs when the interpreter name + defined on the #! line does not exist is more informative. +01-02-19 A bug in which $0 would not be set correctly when a + script with #! was invoked by full pathname from the + directory of the script has been fixed. +01-02-19 A shell script did not always pick up tty mode changes + made by external commands such as stty which could + effect the behavior of read. +01-02-19 The -u, -g, and -k unary tests did not give the correct + results when used with negation and this has been fixed. + +01-02-05 --- Release ksh93k+ --- +01-02-05 The sequence \ inside $'...' was not incrementing + the line count and this has been fixed. +01-02-05 +Modified expansion of "${@-}" so that if no arguments are set + it results in null string rather than nothing. +01-02-02 memory leak problem with local variables in functions fixed. +01-01-25 +allow arithmetic expressions with float%int and treat them + as ((int)float)%int rather than as an error. +01-01-19 read -n1 was not working and has been fixed. +01-01-17 +ksh now handles the case in which a here document in command + substitution $() is terminated by the trailing ). Previously, + a new-line was needed at the end of the delimiter word. +01-01-02 A bug in which a KEYBD trap would cause a multi-line token + to be processed incorrectly has been fixed. +00-12-10 +Arithmetic integer constants can now have L and U suffices. +00-12-10 A bug in the processing of arithmetic expressions with compound + variables when the -n option is on has been fixed. +00-12-08 A bug in M-f and M-b from emacs mode has been fixed. This + bug only occurs when ksh93 is compiled without MULTIBYTE enabled. +00-11-29 A bug in which jobs -p would yield 0 for background + jobs run in a script has been fixed. +00-11-21 A bug in integer arrays in which the number of elements is + incorrect when the ++ operator is applied to a non-existing + element has been fixed. For example, integer x; ((x[3]++)). +00-11-20 A timing bug in which the shell could reset the terminal + group to the wrong value in the case that the a new process + changes the terminal group during startup has been fixed. + +00-10-27 --- Release ksh93k --- +00-10-27 Using tab for completion now works only when applied + after a non-blank character at the end of the current line. + In other case a tab is inserted. +00-10-27 A bug in the emacs edit mode for ^X^E has been fixed. + The ^X^E sequence is supposed to invoke the full editor + on the current command. +00-10-18 A bug in which expansions of the form ${var//pattern/string} + did not work correctly when pattern was '/' or "/" has + been fixed. +00-10-18 +The output format for indexed arrays in compound variables + has been modified so that it can be used as input. +00-10-18 Assignments with name references (typeset -n) will now + implicitly unreference an existing name reference. +00-10-17 A bug the += append operator when a single array element + is appended to a variable that is not an array has been fixed. +00-10-16 A bug in which the SIGCONT signal was being sent to + each process will kill -0 or kill -n 0 has been fixed. +00-10-12 +The arithmetic evaluation portion has been rewritten to + perform a number of optimizations. +00-10-10 A bug in which name prefix matching ${!name.*} was not + checking name to see if it was a name reference has been fixed. +00-09-26 A bug in the multibyte version in which the width of for + non-printing characters was not correct has been fixed. +00-09-12 +Made changes to get multibyte editing work on UWIN for windows +00-09-12 A bug in which multibyte characters would be displayed incorrectly + has been fixed. +00-08-08 Removed build dependency on iswprint() and iswalph(). +00-07-20 In some cases the read builtin would read more than a single + line from a pipe on standard input and therefore leave the seek + position in the wrong location. +00-07-05 +If the directory / is on the path, a / will not be inserted + between the directory and the file name during path searching + to avoid searching // for systems that treat this specially. +00-06-26 A bug in which on rare occasions wait could return before all + jobs have completed has been fixed. +00-06-21 A bug in which backspace did not work correctly during the + R replace directive in vi-mode has been fixed. +00-06-12 +Added variable name completion/expansion/listing to the set of + completions. Variable name completions begin with $ or "$ followed + by a letter. +00-05-09 --- Release ksh93j --- +00-05-09 Modified command substitution to avoid using /tmp files when + run on read-only file systems. +00-04-17 +Modified printf to handle '%..Xc' and '%..Xs' options where X + is not an alpha character. Previous versions core dumped with this. +00-04-10 +Changes to multibyte editing code were made to use standard + ISO C functions rather than methods devised before the standard. +00-04-09 Add %H options to printf to output strings with <"'&\t> properly + converted for use in HTML and XML documents. +00-04-07 +Modified getopts builtin to handle \f...\f in usage string + by invoking specified function. +00-04-04 Added self generating man pages for bg, fc, fg, disown, jobs, + hist, let, ., and ulimit. +00-03-30 +The append operator += has been added and can be used + for all assignments, strings, arrays, and compound variables. +00-03-30 +Code was modified in several places to support automatic + generation of C locale dictionaries. +00-03-28 A bug in which the set and trap commands invoked with --name + type arguments would terminate the invoking script has + been fixed. +00-03-27 A bug in which the library path variable was not updated + correctly on some systems as described in the 'g' point + release has been fixed. +00-03-07 printf now returns a non-zero exit status when one of + its arguments cannot be converted to the given type. +00-03-05 The return value and error message for a command that + was found on the path but was not executable was set + incorrectly. +00-03-05 A prototype for ioctl() was removed from the vi edit mode. + +00-01-28 --- Release ksh93i --- +00-01-28 +Most of the built-in commands and ksh itself are now + self documenting. Running command --man will produce + screen output. Running command --html produces the + man page in html format. +00-01-28 +The getopts builtin can process command description + strings to produce man pages. +00-01-28 A bug in which a script could terminate when getopts + encountered an error when invoked inside a function + has been fixed. +00-01-28 When a symbolic link was specified as the name of + the script to invoke by name, the value of $0 was + set to the real file name rather than the link name + in some cases and this has been fixed. +00-01-28 A bug in which the precision given as an argument + to printf was not working has been fixed. + +99-03-31 --- Release ksh93h --- +99-03-31 +The PATH search algorithm has been modified to look + for a file named .fpath in each bin directory and if + found, to search for functions in this directory if + it cannot find the command in that directory. +99-03-31 +When performing pathname expansion, the shell checks + to see whether each directory it reads is case sensitive + or not, and performs the matching accordingly. +99-03-31 +The %T format for printing formatted date/time. +99-03-31 +The emacs and vi modes now handle arrow keys when + they use standard ANSI escape sequences. +99-03-31 +The TAB key can be used for completion in emacs and viraw mode. +99-03-31 A bug in setting .sh.editchar during the KEYBD trap + for the MULTIBYTE option was fixed in release ksh93h. +99-03-31 A bug in shcomp for compilation of unary operators with [[...]] + has been fixed. +99-03-31 A bug in which the value of $? was changed when executing + a keyboard trap has been fixed. +99-03-31 The handling of SIGCHLD has been changed so that the + trap is not triggered while executing trap commands + to avoid recursive trap calls. +99-03-31 A bug in which a local variable in a function declared readonly + would generated an error when the function went out of + scope has been fixed. +99-03-31 A bug in which \ entered from the keyboard + with the KEYBD trap enabled has been fixed. +99-03-31 The error message for a misplaced ((, for example print ((3), + was often garbled and has been fixed. +99-03-31 A bug in the KEYBD trap in which escape sequences of the form + [#~ were not being handled as a unit has been fixed. +99-03-31 A bug in which ksh would consider expressions like [[ (a) ]] + as syntax errors has been fixed. +99-03-31 A function defined as foo() without a function body + was not reported as a syntax error. +99-03-31 A bug in which ksh could run out of file descriptors when + a stream was repeatedly opened with exec and read from + has been fixed. + +98-04-30 --- Release ksh93g --- +98-04-30 +The pipefail option has been added. With pipefail + enabled, a pipeline will not complete until all + commands are complete, and the return value will + be that of the last command to fail, or zero if + all complete successfully. +98-04-30 +The name-value pair library uses the cdt library rather + than the hash library. This change should be transparent + to applications. +98-04-30 +On the U/WIN version for Window 95 and Windows NT, + when a directory beginning with a letter followed by + a colon is given to cd, it is assumed to be an absolute + directory +98-04-30 +When an executable is found on a given path, + the appropriate library path variable is prepended + with a corresponding library directory. +98-04-30 A bug in which a name reference could be created to + itself and later cause the shell to get into an infinite + loop has been fixed. +98-04-30 A bug in shcomp relating to compound variables was fixed. +98-04-30 A bug introduced in ksh93e in which leading 0's in -Z + fields caused the value to be treated as octal for arithmetic + evaluation has been fixed. +98-04-30 A bug when a name reference with a shorter name than + the variable it references was the subject of a compound + assignment has been fixed. +98-04-30 A bug which in which assignment to array variables in + a subshell could effect the parent shell has been + fixed. +98-04-30 read name?prompt was putting a 0 byte at the end of the + prompt on standard error. +98-04-30 A bug in [[ string1 > string2 ]] when ksh was run with -x + has been fixed. +98-04-30 A bug in which the escape character was not processed + correctly inside {...} when brace expansion is enabled + has been fixed, for example {\$foo}. +98-04-30 A bug in line continuation in here-documents has been + fixed. +98-04-30 The default base when not specified with typeset -i is + 10 in accordance with the documentation. Previously, + the value was determined by the first assignment. +98-04-30 A parsing bug in which a # preceded alphanumeric + characters inside a command substitution caused + a syntax error to be reported has been fixed. +98-04-30 A bug in which a decimal constant represented as 10#ddd + where ddd was more than five digits generated a syntax + error has been fixed. +98-04-30 A bug in here document expansion in which ${...} expansions + were split across buffer boundaries has been fixed. +98-04-30 +The sh_fun() function now takes third argument which + is an argument list for the invoked discipline function + or built-in. +98-04-30 +A callback function can be installed which will give + notification of file duplications and file closes. +98-04-30 When ksh is compiled on systems that do not use fork() + current option settings where not propagated to subshells. + +97-06-30 --- Release ksh93f --- +97-06-30 +Hostnames in addition to host addresses can be given in + /dev/tcp/host/port virtual file names. +97-06-30 File name completion and expansion now quotes special + characters in file names from both emacs and vi edit modes. +97-06-30 An empty for list behave like a for list with null expansions. + It produces a warning message with sh -n. +97-06-30 +The code has been modified to work with EBCDIC as well as ASCII. +97-06-30 A bug which would cause the secondary prompt to be + displayed when a user entered a literal carriage + return has been fixed. +97-06-30 A bug which caused ksh read -s name to core dump was + fixed. +97-06-30 A bug with the expansion of \} and \] inside double + quoted strings that also contained variable expansions + has been fixed +97-06-30 Changes in the ksh93e point release caused autoload + functions invoked from within command substitution + to fail. This has been fixed. +97-06-30 A bug in the processing of here-documents that could + prevent variable substitution to occur after $(...) command + substitution for long here documents has been fixed. +97-06-30 A bug caused by a race condition that could cause SIGTERM + to be ignored by a child process has been fixed. +97-06-30 A bug which prevented the startup of a coprocess immediately + after killing a running coprocess has been fixed. +97-06-30 ulimit foobar, where foobar is not an arithmetic + expression, now gives an error message as it did with ksh88 + instead of setting the file size limit to 0. +97-06-30 A bug which could cause an interactive shell to terminate when + the last process of a pipeline was a POSIX function was fixed. +97-06-30 A bug which could cause command substitution of a shell script + to core dump has been fixed. +97-06-30 A security hole was fixed in suid_exec. +97-06-30 Arithmetic functions such as pow() that take more than + one argument, did not work if arguments other than the + first contained parenthesized sub-expression. +97-06-30 The error message from a script containing an incomplete + arithmetic expression has been corrected. +97-06-30 A bug which caused a core dump on some machines when + the value of a name reference contained a positional + parameter and the name reference was not defined inside + a function has been fixed. +97-06-30 Arithmetic expressions now correctly handle hexadecimal + constants. +97-06-30 A bug in which integer variables could be expanded + with a leading 10# when declared with typeset -i + multiple times has been corrected. +97-06-30 A bug in which IFS wasn't correctly restored when + set within command substitution has been fixed. +97-06-30 The _ character is now considered as part of a word + with the M-f and M-b emacs directives as it was in ksh88. +97-06-30 A bug in brace pattern expansions that caused expressions + such as {foo\,bar,bam} to expand incorrectly have been fixed. + + +96-07-31 --- Release ksh93e --- +96-07-31 +The math functions, atan2, hypot, fmod, and pow were added. +96-07-31 +When a shared library is loaded, if the function lib_init() + is defined in the library, it is invoked the first time that + the library is loaded with builtin -f library. +96-07-31 The k-shell information abstraction database option, KIA, + has been revamped. +96-07-31 Empty command substitutions of the form $() now work. + whence -v foo now gives the correct result after calling + builtin -d foo. +96-07-31 A bug in right to left arithmetic assignment for which + the arithmetic expression (( y = x = 1.5 )) did not + yield 1 for y when x was declared typeset -i was fixed. +96-07-31 printf has been fixed to handle format containing \0 + and/or \0145 correctly. In addition, characters following + %b in the format string are no longer displayed when + the operand contains \c. +96-07-31 A bug in printf that could cause the %E format to + produce unnormalized results has been fixed. +96-07-31 A bug which causes some arithmetic expressions to be + incorrectly evaluated as integer expressions rather + that floating point has been fixed. +96-07-31 Functions defined inside a subshell no longer remain + defined when the subshell completes. +96-07-31 The error message from sh -c ';echo foo' has been + corrected. +96-07-31 The format for umask -S has been changed to agree + with the specification in the POSIX standard. +96-07-31 A bug that caused side effects in subscript evaluation + when tracing was enabled for subscripts using ++ or -- + has been fixed. +96-07-31 To conform to the Posix standard getopts has been changed + so that the option char is set to ? when it returns with + a non-zero exit status. +96-07-31 The handling of \} inside ${name...} has been fixed so + that the \ quotes the }. +96-07-31 A bug that caused the read builtin to resume execution + after processing a trap has been fixed. +96-07-31 [[ -s file ]] has been fixed so that if file is open + by ksh, it is flushed first. +96-07-31 In some cases attributes and sizes for non exported + variables weren't being reset before running a script. +96-07-31 The value of TMOUT was affected by changes make to + it in a subshell. +96-07-31 The jobs command did not reflect changes make by + sending the CONT signal to a command. +96-07-31 The error message for ksh -o unknown was incorrect. +96-07-31 Functions invoked as name=value name, did not use + values from the calling scope when evaluating value. +96-07-31 A bug in which the shell would reexecute previously + executed code when a shell script or coprocess was + run in the background has been fixed. +96-07-31 A bug in which an empty here-document would leave + a file descriptor open has been fixed. +96-07-31 A bug in which $(set -A array ...) would leave a + side effect has been fixed. +96-07-31 A discipline function for a global variable defined + within a function defined with the function keyword, + incorrectly created a local variable of the same name + and applied the discipline to it. + +95-08-28 --- Release ksh93d --- +95-08-28 The \ character was not handled correctly in replacement + patterns with ${x/pattern/replace}. +95-08-28 A bug with read in which the line did not end with + a new-line has been fixed. +95-08-28 A bug in file name generation which sometimes + appended a . for filenames that ended in / has + been fixed. +95-08-28 +If a process is waited for after a status has + been returned by a previous wait, wait now + returns 127. +95-08-28 A bug with hist (fc) -e which prevented a command + to re-executed after it had been edited has been fixed. +95-08-28 A bug which prevented quoting from removing the meaning + of unary test operators has been fixed. +95-08-28 A bug with typeahead and KEYBOARD traps with the + MULTIBYTE option set has been fixed. +95-08-28 +Builtin functions can take a third argument which is + a void*. +95-08-28 The nv_scan() function can restrict the scope of a walk + to the top scope. + +95-04-31 --- Release ksh93c --- +95-04-31 The expansion of "$@" was incorrect when $1 was the null + string. +95-04-31 A bug which could incorrectly report a syntax error in + a backquoted expression when a $ was preceded by \\ + has been fixed. +95-04-31 A bug which prevented the shell from exiting after + reporting an error when failing to open a script + has been fixed. +95-04-31 A bug that could lead to memory corruption when a + large here document that required parameter or command + substitution was expanded has been fixed. +95-04-31 A bug that could cause a core dump on some systems + after ksh detected an error when reading a function + has been fixed. +95-04-31 A bug which could cause a coprocess to hang when + reading from a process that has terminated has been fixed. +95-04-31 A bug which caused a script to terminate when set -e + was on and the first command of and && or || list + failed has been fixed. +95-04-31 A bug with here documents inside $(...) when the delimiter + word is an identifier has been fixed. +95-04-31 A bug which caused $0 to display the wrong value when + a script was invoked as an argument to the . command + and the eval command has been fixed. +95-04-31 A bug that could cause the built-in sleep to hang + has been fixed. +95-04-31 A bug introduces in 12/28/93b which caused the backslash + to be removed when it was followed by digit inside double + quotes in some instances has been fixed. +95-04-31 A bug which could cause a core dump if ksh was invoked with + standard input closed has been fixed. +95-04-31 A bug which could cause a core dump if typeset -A was + specified for an existing variable has been fixed. +95-04-31 Variables that were unset but had attributes such as readonly + and export were not listed with readonly, export and typeset. +95-04-31 Several problems with signals have been fixed. +95-04-31 A bug which prevented ulimit -t from working has been fixed. + Also, a bug in which failed ulimits could cause a core dump + has also been fixed. +95-04-31 A bug in expansion of the form ${name/#pattern/string} and + ${name/%pattern/string} has been fixed. +95-04-31 A bug which caused read -r on a line that contained only + blanks to get a non-null value has been fixed. +95-04-31 A bug introduced in the 'a' point release in which + ${x='\\'} expanded to \ when x was unset has been fixed. +95-04-31 A bug which prevented a trap on EXIT from being executed + when the last command in a script was a function invocation + has been fixed. +95-04-31 A bug which caused an interactive shell ignore input when + standard error was redirected to a file with exec, + and then restored with exec 2>&1 has been fixed. +95-04-31 An interactive shell turns on monitor mode even when + standard error has been redirected to a file. +95-04-31 A bug which could cause standard input to be incorrectly + positioned for the last command of a script has been fixed. +95-04-31 A bug in the edit modes which allowed walking back in + the history file for more than HISTSIZE commands has + been fixed. +95-04-31 A bug which could cause a core dump if variable TMPDIR was + changed between two command substitutions has been fixed. +95-04-31. A bug which prevented a trap on EXIT from being cleared + has been fixed. +95-04-31 A bug fixed for the v directive in vi MULTIBYTE has been + fixed. +95-04-31 Code to for IFS handling of multibyte characters has + been added. +95-04-31 The displaying of multibyte strings in export, readonly, + typeset, and execution traces has been fixed. +95-04-31 Variables inside functions are now statically scoped. + The previous behavior was never documented. +95-04-31 Variables inside functions are now statically scoped. + The previous behavior was never documented. +95-04-31 A few changes have been made to the name-value library + that affect built-ins that use disciplines. The + changes allow disciplines to be shared by variables + and should make it possible to add new disciplines + without recompilation. +95-04-31 +The name-value library interface has undergone significant + change for this revision. See the new nval.3 man page. + +94-12-31 --- Release ksh93b --- +94-12-31 +Variables inside functions are now statically scoped. + The previous behavior was never documented. +94-12-31 +If IFS contains two consecutive identical characters belonging + to the [:space:] class, then this character is treated as + a non-space delimiter so that each instance will delimit + a field. For example, IFS=$'\t\t' will cause two consecutive + tabs to delimit a null field. +94-12-31 +The getopts command has a -a name option that specifies a + name that will be used for usage messages. +94-12-31 A bug which caused unset RANDOM to dump core has been + fixed. +94-12-31 A bug which prevented return for terminating a profile + or ENV file has been fixed. +94-12-31 A bug which prevented standard input from being + directed to /dev/null for background jobs when + monitor mode was turned off has been fixed. +94-12-31 Statements of the form typeset -options var[expr]=value + did not perform substitutions on expr as expected. +94-12-31 A bug which prevented the shell from sending a HUP + signal to some background jobs that were not disowned + has been fixed. +94-12-31 A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked by exec + has been fixed. +94-12-31 A bug which could cause a core dump when a discipline + function was unset within a discipline was fixed. +94-12-31 The typeset builtin now accepts a first argument of + + or - for compatibility with ksh88. +94-12-31 For compatibility with ksh88, the results of expansions + of command arguments will treat the extended character + match characters ()|& as ordinary characters. +94-12-31 A bug which caused read to fail on a file that was + open for read/write with <> when the first operation + was print or printf has been fixed. +94-12-31 When a job is suspended, it is put on the top of + the job list as required by the POSIX standard. +94-12-31 The value of OPTARG when an option that required + an argument but didn't have one was incorrect in the + case the the option string began with a :. +94-12-31 A bug which caused the terminal to get into a bad + state with some KEYBD traps in vi-mode has been fixed. +94-12-31 A bug which caused an invalid trap to cause a script + to terminate, rather than just return an error, has + been fixed. +94-12-31 Backreferencing sub-expressions in patterns and replacement + strings now works. +94-12-31 A bug in chmod which caused the -R option to fail has + been fixed. +94-12-31 +More signal names have been added for Solaris + +94-06-30 --- Release ksh93a --- +94-06-30 An expansion bug which causes portions of a word after + a $((...)) expansion that contains a nested $var expansion + to be lost has been fixed. +94-06-30 A bug that caused a core dump when a script that did not + have PWD set and did a cd inside command substitution + has been fixed. +94-06-30 A bug which caused a core dump on some machines when + the LANG variable was assigned to has been fixed. +94-06-30 A bug which incorrectly handled set disciplines that + performed arithmetic evaluation when the discipline + was called from the arithmetic evaluator has been fixed. +94-06-30 A bug caused by an EXIT trap inside a function that + was executed in a subshell was fixed. +94-06-30 If foo is a function, and not a program, then command foo + now reports that foo isn't found rather than invoking foo. +94-06-30 The previous version incorrectly listed -A as an + invocation option. The -A option is only for set. +94-06-30 A bug was fixed which caused ksh to loop when execution trace + was enabled and the PS4 prompt required command substitution. +94-06-30 A bug which could cause the job control switch character + to be disabled when a script that enabled monitor mode + terminated was fixed. +94-06-30 A bug in the macro expansion global replacement operator //, + when the pattern began with a [ or +( has been fixed. +94-06-30 A bug which prevented ~ expansion from occurring when + it was terminated with a colon inside an assignment + has been fixed. +94-06-30 A bug in the dot command which prevented autoload functions + from working has been fixed. +94-06-30 A bug which caused a variable to be unset if the + its value were expanded inside a set discipline has + been fixed. +94-06-30 Whence -a now longer reports that a defined function + is undefined. +94-06-30 A bug on some systems in which $0 would be incorrect + in scripts invoked by name has been fixed. +94-06-30 Here documents with an empty body now work. +94-06-30 A bug which disabled argument passing and resetting + of options for a script invoked by name inside a + function has been fixed. +94-06-30 A bug in which an EXIT trap set the caller of a function + would be executed if a command called inside a function + was not found has been fixed. +94-06-30 A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked has + been fixed. +94-06-30 A bug which caused 2<&1- when applied to a shell built-in + to leave standard input closed has been fixed. +94-06-30 A bug which caused the shell to incorrectly parse + $() command substitutions with nested case statements + has been fixed. + diff --git a/src/cmd/ksh93/RELEASE88 b/src/cmd/ksh93/RELEASE88 new file mode 100644 index 000000000..d2e8e88c6 --- /dev/null +++ b/src/cmd/ksh93/RELEASE88 @@ -0,0 +1,422 @@ +This is a list of changes that have been made since the 11/16/88 version +of ksh. + +1. New features in 12/28/93 + a. Associative arrays. The new version of ksh supports both + associative arrays and the older indexed arrays with the same + array syntax. A new -A option of typeset is used to declare + an array to be associative. As with indexed arrays, $name is + equivalent to ${name[0]}. The prefix operator ! was added + to the parameter expansion syntax to expand to the list of + indices. For example, ${!name[@]} expands to the list of array + indices for variable name. + + b. Several additions have been made to shell arithmetic: + 1. The shell now performs floating point arithmetic. The + typeset options -F and -E have been added for floating + point and scientific notation respectively. + 2. The prefix and postfix ++ and -- operators. + 3. The comma and ?: operators. + 4. The math library functions. + 5. An arithmetic for statement of the form + for ((expr1; expr2; expr3)) + do ... + done + 6. Integer arithmetic extended up to base 64. + + c. Some additions to the macro expansion syntax have been made + to specify substrings and sub-arrays: + 1. ${name:expr} expands to the substring of ${name} starting at + the character position defined by arithmetic expression expr. + 2. ${name:expr1:expr2} expands to the substring of ${name} starting + at expr1 and consisting of at most expr2 characters. + 3. ${name[@]:expr} expands to the values of ${name[@]} starting at + the element defined by arithmetic expression expr. + 4. ${name[@]:expr1:expr2} expands to at most expr2 values of + ${name} starting at expr1. + 5. ${@:expr} expands the positional parameters starting at expr. + 6. ${@:expr1:expr2} expands to at most expr2 positional parameters + starting at expr1. + 7. ${!name} expands to the name of the variable named by name. + It will expand to name unless name is reference variable. + 8. ${!name[sub]} expands to the name of the subscript of the + given variable. If sub is @ or * the list of subscripts + is generated. + 9. ${!prefix*} and ${!prefix@} expand to the list of variable + names beginning with prefix. + 10. The substring operators, # and % can be now be applied + with aggregates (@ or *) and are applied to each. + 11. ${name/pattern/string} expands to the value of name with + the first occurrence of pattern replaced by string. + With aggregates (@ or *) this operation is applied to each. + 12. ${name/#pattern/string} Same as above but the pattern + to be replaced must match at the beginning. + 13. ${name/%pattern/string} Same as above but the pattern + to be replaced must match at the end. + 14. ${name//pattern/string} expands to the value of name with + the each occurrence of pattern replaced by string. + With aggregates (@ or *) this operation is applied to each. + + d. The name space for variables has been extended. The character '.' + can be used at the beginning of a name, and to separate identifiers + within a name. However, to create a name of the form, foo.bar, + the variable foo must exist. The namespace starting with .sh + is reserved for shell implementation variables. Exported + variable cannot contain a '.'. + + e. Compound assignments. The assignment syntax, varname=value, + has been extended to allow assignments of the form + varname=(assignment_list). As elsewhere in the shell + spaces or tabs are optional around the parentheses, and + no space is permitted between the varname and the =. The + assignment_list can be one of the following: + 1. A list of words. In this case each word is expanded as + in a for list and the resulting items become elements + of the indexed array varname. + 2. A list of subscript assignments in the form + [subscript]=value. In this, these elements become + elements of the associative array varname. + 3. A list of assignments; simple or compound. In this + case, each assignment is made to varname.name, where + name is the name of the enclosed assignment. + 4. Assignments in the form of readonly or typeset + statements. In this case each assignment is made as + in 3 above, and the attributes are given to the + corresponding variable. + In case 3 and 4 above, the value of "$varname" after + the above assignment is (assignment_list), where the + assignment_list produced would reproduce all of the + variables under varname.*. + + f. Function names of the form variable.action (called discipline + functions) can be defined where variable is any valid variable + name and action is get, set, or unset. The function variable.get + is invoked each time the variable is referenced. The set + discipline is invoked each time the variable is assigned to. + The unset discipline is invoked when a variable is unset. + The new variables .sh.name, .sh.subscript, and .sh.value are + defined inside the function body. Other shell extensions + may have their own set of discipline functions. + + g. The compound command !, which negates the return value of the + following pipeline, has been added. + + h. On systems that support dynamic loading with dlopen(), it is + now possible to add built-in commands at runtime with the + a builtin command named builtin. + + i. The following builtins have been added: + 1. command name [ ... ] + 2. sleep [decimal-seconds] + 3. builtin [-ds] [-f file] [name...] + 4. getconf name [pathname] + 5. disown [job...] + + j. An addition format for literal strings, $'....' can + be used where ever literal strings are valid. The string + inside the single quotes will be converted using the ANSI-C + escape conventions. Additionally, the escape sequence \E + expands to the escape character (default \033) whenever ANSI-C + escape sequences are recognized. + + k. A typeset -n option has been added which causes the value of a + variable to be treated as a reference to another variable so that + variables can be indirectly named. For example, if $1 contains + the name of a variable, then typeset -n foo=$1 causes the variable + foo to be synonymous with the variable whose name is $1. A builtin + alias, nameref='typeset -n' has been added to aid mnemonics. + Reference names cannot contain a '.'. Whenever that portion of + a variable up to the first '.' matches a reference name, the + reference value is substituted. For example, with nameref foo=.top, + then ${foo.bar} is equivalent to ${.top.bar}. When used as the + index of a for or select loop, each assignment causes a + new name reference to occur. + + l. The KEYBD trap has been added which is triggered when a key + or escape sequence is typed while reading from the keyboard + in an edit mode. This, combined with some new variables + makes it possible to program your key bindings in ksh. + + m. New variables have been added: + 1. FIGNORE defines a set of file names to be ignored in each + directory when performing pathname expansion, replacing + the rule that requires that a leading . be matched explicitly. + 2. Variable sh.edchar contains the value of the keyboard character + that has been entered when processing a KEYBD trap. If the value + is changed as part of the trap action, then the new value replaces + the key or keys that caused the trap. + 3. Variable sh.edcol is set to the character position of the cursor + within the input buffer during a KEYBD trap. + 4. Variable sh.edmode is set to the escape character when in vi + insert mode. + 5. Variable sh.edtext is set to the contents of the input buffer + during a KEYBD trap. + 6. HISTEDIT is checked before FCEDIT. FCEDIT is obsolete. + 7. HISTCMD is the number of the current command in the history + file. + 8. Variable .sh.version is set to the version string for + this shell. + 9. Variable .sh.name is set to the name of the variable + that was referenced or assigned to when executing a get + or set discipline function. + 10. Variable .sh.subscript is set to the subscript for the variable + that was referenced or assign to when executing a get or + set discipline function. + 11. Variable .sh.value is set to the new value for the variable + that was assigned to when executing the set discipline function. + + n. New invocation and set -o options have been added: + 1. set -o notify (or set -b) causes background completion messages + to be displayed as soon as the job completes. + 2. There is a compile time option named KIA which enables + creation of a relational database for commands, variables + and functions defined and referenced by a script. The + option -I , causes the database to be generated + in . The database format can be queried via + the cql command. + o. ksh93 can read and evaluate pre-compiled scripts generated by + a separate program called shcomp. + p. More work on internationalization has been added: + 1. The decimal point character is processed per locale + 2. A $ can be placed in front of each string to indicate + that the string needs translation but is otherwise ignored. + This means that if a message catalog of all $"..." strings + is generated, then a program such as print $"hello world" + could display "bonjour monde" in the french locale. + q. Backreferences have been added to pattern matching. The sequence + \d, where d is a digit from 1-9, matches the same string as + the d-th previous parenthesis group. Backreferences + can be used within patterns, and within replacement strings + with any of the ${name/...} operators. + +2. Changes made in 12/28/93 + a. The output format of many commands has changed as follows: + 1. System error messages are displayed whenever a failure + is caused by a system call. + 2. The exit status has changed in many cases: + a. USAGE messages cause an exit status of 2. + b. Commands not found cause exit - 127. + c. Command found, but not executable - 126. + d. Terminated because of signal - 256+sig + 3. The output of values from built-ins that contain special + characters are quoted in a manner that then can be re-input. + 4. The trace output puts quotes around the output so that it + can be reused as input. + 5. The output for trap is in a format that can be reinput the + the shell to restore the traps. + 6. kill -l lists the signal names without numbers as + required by the POSIX standard. + + b. The following changes have been made to shell functions: + 1. The semantics of functions declared with name() has changed + to conform with the IEEE-POSIX 1003.2 standard. In particular, + these functions are executed in a dot script environment rather + than a separated function environment so that there are no + local variables and no scoping for traps. + 2. Functions declared as function name, preserve the old ksh + semantics can be also used as the first argument to the dot (.) + command to have them executed in a dot script environment. + + c. The command search rules have changed as follows: + 1. Special built-ins (those with a dagger in front of them) are + executed first. + 2. Functions are executed next. + 3. Other built-ins that do not require an executable version + (for example cd and read) come next. + 4. If the command name contains a slash, the pathname corresponding + to the command name is executed. + 5. If name corresponds to a previously encountered pathname + on the PATH variable, the corresponding command is executed. + 6. If the command name does not contain a slash, then the PATH + variable is used to find an executable by that name. If + the directory that the command is found is also contained in + the FPATH variable, then the command treated as a function. + If the shell has a built-in version of the command corresponding + to this command, then the built-in version of this command + is executed. Otherwise, the shell remembers that pathname + corresponding to this command name and executes this pathname. + 7. If the name is not found on PATH, then the directories in + FPATH are searched. If found, then the command is executed + as a function. + + d. Built-in commands options now conform to the IEEE-POSIX 1003.2 + conventions with some additions. In particular, + name -? + will now print a Usage line for name, except for true, false, + colon, login, newgrp, echo, [, and command. + + e. Tilde expansion is now performed as part of the word expansions. + The effect of this is that if word begins with ~ in ${name op word}, + it will be expanded unless escaped. + + f. Pathname expansion is no longer performed on redirection words + unless the shell is interactive. + + g. Changes to shell and options: + 1. The -n option has been enhanced to produce more warning and + portability messages. + 2. The -C option is equivalent to -o noclobber. Files are + created with O_EXCL when -C is on. + + h. The following changes have been made to [[...]]: + 1. A string by itself is equivalent to -n string. + 2. -e has been added as equivalent to -a. + 3. == has been added as equivalent =. + 4. -a and = are now considered obsolete. + 5. Arithmetic comparisons are now considered obsolete. + + i. kill has been changed as follows: + 1. Signal names can be upper case or lower case. + 2. Numerical arguments to kill -l cause the given signal names to + be displayed. + 3. String arguments to kill -l cause the given signal numbers to + be displayed. + 4. Synopsis changed for getopts conformance. + + j. print has a -f format option which is equivalent to + the IEEE POSIX printf. Both print -f format, and + printf have the following extensions from IEEE POSIX: + 1. Floating point formats are supported. + 2. Size and precision specifications can be *. + 3. The %d option can take an argument after precision to + specify the base that the number will be displayed. + 4. A %q format can be used to output a string quoted so + that it can be re-input to the shell. + 5. A %P format can be used to output the shell pattern which + corresponds to the give extended regular expression. + 6. For numerical fields, the arguments can be arithmetic + expressions which will be evaluated. + 7. The %n format works as described in ANSI-C. + + k. The following changes have been made to fc: + 1. It has been renamed hist. fc is now a predefined alias. + 2. hist uses ${HISTEDIT:-$FCEDIT}. FCEDIT is obsolete. + 3. A new -s option is equivalent to the obsolete -e -. + 4. If the first argument refers to a command earlier than the + first accessible command, it now implies the first accessible + command, so that hist -l 1 lists all accessible history commands. + + l. The dot command (.) has changed as follows: + 1. The argument can be the name of a function declared as + function name. The function will execute without creating a + new scope. + 2. If there are arguments to the given script or function, + the positional parameters are restored to their original + value when . completes. + + m. The read built-in has been changed as follows: + 1. A -A option to read has been added to allow the fields to be + read into an indexed array. + 2. A -t n option has been added which causes read to + timeout after n seconds when reading from a slow device. + 3. A -d char option has been added which causes the read + to terminate at char rather than at new-line. + + n. The trap command has been changed as follows: + 1. Trap names can be either upper case or lower case. + 2. Trap -p only causes the specified trap values to be displayed. + 3. The value of trap in a subshell will be the value in the parent + shell until a call to trap which changes the trap settings has + been made. Thus, savetraps=$(trap) works as required by the + POSIX standard. + + o. The exec command has been extended as follows: + 1. The -c option clears the environment first. + 2. The -a name option sets argv[0] to name for the program. + + p. true and false are built-ins, not aliases to built-ins. + + q. test has been modified to conform to the IEEE-POSIX 1003.2 + standard when there are three or less arguments. + + r. umask -S option displays the mask in a symbolic format. + + s. wait now returns the correct exit status of any previous + background job that has not been waited for, not just + the most recent one. + + t. The whence built-in has an option -a which causes all + uses for the given command name to be reported. + + u. unalias has -a option to clear all the aliases. + + v. The times built-in command has been removed. The time + reserved word, without a command, gives time cumulative + time for the shell and its children. A built-in alias + for times should enable scripts using times to continue + to run. + + w. Command substitution and arithmetic substitution will now be + performed for PS1, ENV, and PS4 evaluation in addition to + parameter expansion. + + x. The SECONDS variable now displays elapsed time in floating + point seconds with 3 places after the decimal point by + default. + + y. The getopts built-in now handles the complete libast optget + functionality. If any errors have occurred with getopts + when it has reached the end of arguments, then the Usage + message will be generated from the option string and the + exit status from getopts will be 2 rather than 1. The + usage message will be stored in the OPTARG variable if + the option string contains a leading colon; otherwise + it will be printed on standard error automatically. + + z. THE ENV file is only processed for interactive shell + invocations. In addition, the -x attributes for + aliases and functions is ignored. + + aa. The built-in edit modes have been changed as follows: + 1. The pathname completion and pathname listing options + now perform command completion and command listing + when applied to a word in the command position. + 2. In emacs mode ^N as the first related command after + the prompt will move to the next command relative to the + last known history position. + 3. In emacs mode, successive kill and delete commands will + accumulate their data in the kill buffer, by appending or + prepending as appropriate. This mode will be reset by any + command not adding something to the kill buffer. + 4. The control-T of emacs mode has been changed to behave like + control-T in gnu-emacs. + bb. The TMOUT variable also sets a limit for select timeouts + and default timeouts for read. + + +4. The source code has undergone significant modification. + a. Much of the code has been rewritten, In many cases this has + resulted in significant performance improvement. + + b. The code is organized differently. See the README files + for more details. + + c. Most configuration parameters now get generated using + the FEATURE mechanism of nmake. Other options are set + in the OPTIONS file. + + c. The are several new compile time options. See the README + file for details. Some of the old ones have been removed. + + d. The install script is a Mamfile that is generated by + nmake and processed by a script that comes with the + distribution. + + e. There are far fewer global names. This should make it + must easier to add built-in commands without worrying + about conflicts. + + f. The code uses the sfio library which makes it possible + to mix with stdio. + + g. The code is written in ANSI C with full prototypes. + The code is based on the IEEE POSIX 1003.1 standard. + The code can be compiled with K&R C and with C++ by + using the ANSI cpp that comes with nmake or running + the code through the proto filter before pre-processing. + This happens automatically with our shipping system. + + h. There is a programming interface for capturing references + and assignment to shell variables. It is also possible + to intercept variable creation and supply the array processing + function for that variable. See nval.3 for a description. diff --git a/src/cmd/ksh93/RELEASE93 b/src/cmd/ksh93/RELEASE93 new file mode 100644 index 000000000..2e282012e --- /dev/null +++ b/src/cmd/ksh93/RELEASE93 @@ -0,0 +1,455 @@ +This is a list of changes that have been made since the 12/28/93 version +of ksh. + +1. New features in 12/28/93b + a. If IFS contains two consecutive identical characters belonging + to the [:space:] class, then this character is treated as + a non-space delimiter so that each instance will delimit + a field. For example, IFS=$'\t\t' will cause two consecutive + tabs to delimit a null field. + b. The getopts command has a -a name option that specifies a + name that will be used for usage messages. + +2. New features in 12/28/93e + a. The math functions, atan2, hypot, fmod, and pow were added. + b. When a shared library is loaded, if the function lib_init() + is defined in the library, it is invoked the first time that + the library is loaded with builtin -f library. + +3. New features in 12/28/93f + a. Hostnames in addition to host addresses can be given in + /dev/tcp/host/port virtual file names. + b. File name completion and expansion now quotes special + characters in file names from both emacs and vi edit modes. + +4. New features in 12/28/93g + a. The pipefail option has been added. With pipefail + enabled, a pipeline will not complete until all + commands are complete, and the return value will + be that of the last command to fail, or zero if + all complete successfully. + b. When an executable is found on a given path, + the appropriate library path variable is prepended + with a corresponding library directory. +5. New features in 12/28/93h + a. The PATH search algorithm has been modified to look + for a file named .fpath in each bin directory and if + found, to search for functions in this directory if + it cannot find the command in that directory. + b. When performing pathname expansion, the shell checks + to see whether each directory it reads is case sensitive + or not, and performs the matching accordingly. + c. The %T format for printing formatted date/time. +6. New features in 12/28/93i + a. Most of the built-in commands and ksh itself are now + self documenting. Running command --man will produce + screen output. Running command --html produces the + man page in html format. + b. The getopts builtin can process command description + strings to produce man pages. + +7. Bugs fixed in 12/28/93a for default OPTIONS + a. An expansion bug which causes portions of a word after + a $((...)) expansion that contains a nested $var expansion + to be lost has been fixed. + b. A bug that caused a core dump when a script that did not + have PWD set and did a cd inside command substitution + has been fixed. + c. A bug which caused a core dump on some machines when + the LANG variable was assigned to has been fixed. + d. A bug which incorrectly handled set disciplines that + performed arithmetic evaluation when the discipline + was called from the arithmetic evaluator has been fixed. + e. A bug caused by an EXIT trap inside a function that + was executed in a subshell was fixed. + f. If foo is a function, and not a program, then command foo + now reports that foo isn't found rather than invoking foo. + g. The previous version incorrectly listed -A as an + invocation option. The -A option is only for set. + h. A bug was fixed which caused ksh to loop when execution trace + was enabled and the PS4 prompt required command substitution. + i. A bug which could cause the job control switch character + to be disabled when a script that enabled monitor mode + terminated was fixed. + j. A bug in the macro expansion global replacement operator //, + when the pattern began with a [ or +( has been fixed. + k. A bug which prevented ~ expansion from occurring when + it was terminated with a colon inside an assignment + has been fixed. + l. A bug in the dot command which prevented autoload functions + from working has been fixed. + m. A bug which caused a variable to be unset if the + its value were expanded inside a set discipline has + been fixed. + n. Whence -a now longer reports that a defined function + is undefined. + o. A bug on some systems in which $0 would be incorrect + in scripts invoked by name has been fixed. + p. Here documents with an empty body now work. + 1. A bug which disabled argument passing and resetting + of options for a script invoked by name inside a + function has been fixed. + r. A bug in which an EXIT trap set the caller of a function + would be executed if a command called inside a function + was not found has been fixed. + s. A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked has + been fixed. + t. A bug which caused 2<&1- when applied to a shell built-in + to leave standard input closed has been fixed. + u. A bug which caused the shell to incorrectly parse + $() command substitutions with nested case statements + has been fixed. + +8. Bugs fixed in 12/28/93b for default OPTIONS + a. A bug which caused unset RANDOM to dump core has been + fixed. + b. A bug which prevented return for terminating a profile + or ENV file has been fixed. + c. A bug which prevented standard input from being + directed to /dev/null for background jobs when + monitor mode was turned off has been fixed. + d. Statements of the form typeset -options var[expr]=value + did not perform substitutions on expr as expected. + e. A bug which prevented the shell from sending a HUP + signal to some background jobs that were not disowned + has been fixed. + f. A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked by exec + has been fixed. + g. A bug which could cause a core dump when a discipline + function was unset within a discipline was fixed. + h. The typeset builtin now accepts a first argument of + + or - for compatibility with ksh88. + i. For compatibility with ksh88, the results of expansions + of command arguments will treat the extended character + match characters ()|& as ordinary characters. + j. A bug which caused read to fail on a file that was + open for read/write with <> when the first operation + was print or printf has been fixed. + k. When a job is suspended, it is put on the top of + the job list as required by the POSIX standard. + l. The value of OPTARG when an option that required + an argument but didn't have one was incorrect in the + case the the option string began with a :. + m. A bug which caused the terminal to get into a bad + state with some KEYBD traps in vi-mode has been fixed. + n. A bug which caused an invalid trap to cause a script + to terminate, rather than just return an error, has + been fixed. + o. Backreferencing sub-expressions in patterns and replacement + strings now works. + p. A bug in chmod which caused the -R option to fail has + been fixed. + +9. Bugs fixed in 12/28/93c for default OPTIONS + a. The expansion of "$@" was incorrect when $1 was the null + string. + b. A bug which could incorrectly report a syntax error in + a backquoted expression when a $ was preceded by \\ + has been fixed. + c. A bug which prevented the shell from exiting after + reporting an error when failing to open a script + has been fixed. + d. A bug that could lead to memory corruption when a + large here document that required parameter or command + substitution was expanded has been fixed. + e. A bug that could cause a core dump on some systems + after ksh detected an error when reading a function + has been fixed. + f. A bug which could cause a coprocess to hang when + reading from a process that has terminated has been fixed. + g. A bug which caused a script to terminate when set -e + was on and the first command of and && or || list + failed has been fixed. + h. A bug with here documents inside $(...) when the delimiter + word is an identifier has been fixed. + i. A bug which caused $0 to display the wrong value when + a script was invoked as an argument to the . command + and the eval command has been fixed. + j. A bug that could cause the built-in sleep to hang + has been fixed. + k. A bug introduces in 12/28/93b which caused the backslash + to be removed when it was followed by digit inside double + quotes in some instances has been fixed. + l. A bug which could cause a core dump if ksh was invoked with + standard input closed has been fixed. + m. A bug which could cause a core dump if typeset -A was + specified for an existing variable has been fixed. + n. Variables that were unset but had attributes such as readonly + and export were not listed with readonly, export and typeset. + o. Several problems with signals have been fixed. + p. A bug which prevented ulimit -t from working has been fixed. + Also, a bug in which failed ulimits could cause a core dump + has also been fixed. + q. A bug in expansion of the form ${name/#pattern/string} and + ${name/%pattern/string} has been fixed. + r. A bug which caused read -r on a line that contained only + blanks to get a non-null value has been fixed. + s. A bug introduced in the 'a' point release in which + ${x='\\'} expanded to \ when x was unset has been fixed. + t. A bug which prevented a trap on EXIT from being executed + when the last command in a script was a function invocation + has been fixed. + u. A bug which caused an interactive shell ignore input when + standard error was redirected to a file with exec, + and then restored with exec 2>&1 has been fixed. + v. An interactive shell turns on monitor mode even when + standard error has been redirected to a file. + w. A bug which could cause standard input to be incorrectly + positioned for the last command of a script has been fixed. + y. A bug in the edit modes which allowed walking back in + the history file for more than HISTSIZE commands has + been fixed. + z. A bug which could cause a core dump if variable TMPDIR was + changed between two command substitutions has been fixed. + aa. A bug which prevented a trap on EXIT from being cleared + has been fixed. + +10. Bugs fixed in 12/28/93d for default OPTIONS + a. The \ character was not handled correctly in replacement + patterns with ${x/pattern/replace}. + b. A bug with read in which the line did not end with + a new-line has been fixed. + c. A bug in file name generation which sometimes + appended a . for filenames that ended in / has + been fixed. + d. If a process is waited for after a status has + been returned by a previous wait, wait now + returns 127. + e. A bug with hist (fc) -e which prevented a command + to re-executed after it had been edited has been fixed. + f. A bug which prevented quoting from removing the meaning + of unary test operators has been fixed. + +11. Bugs fixed in 12/28/93e for default OPTIONS + a. Empty command substitutions of the form $() now work. + b. whence -v foo now gives the correct result after calling + builtin -d foo. + c. A bug in right to left arithmetic assignment for which + the arithmetic expression (( y = x = 1.5 )) did not + yield 1 for y when x was declared typeset -i was fixed. + d. printf has been fixed to handle format containing \0 + and/or \0145 correctly. In addition, characters following + %b in the format string are no longer displayed when + the operand contains \c. + e. A bug in printf that could cause the %E format to + produce unnormalized results has been fixed. + f. A bug which causes some arithmetic expressions to be + incorrectly evaluated as integer expressions rather + that floating point has been fixed. + g. Functions defined inside a subshell no longer remain + defined when the subshell completes. + h. The error message from sh -c ';echo foo' has been + corrected. + i. The format for umask -S has been changed to agree + with the specification in the POSIX standard. + j. A bug that caused side effects in subscript evaluation + when tracing was enabled for subscripts using ++ or -- + has been fixed. + k. To conform to the POSIX standard getopts has been changed + so that the option char is set to ? when it returns with + a non-zero exit status. + l. The handling of \} inside ${name...} has been fixed so + that the \ quotes the }. + m. A bug that caused the read builtin to resume execution + after processing a trap has been fixed. + n. [[ -s file ]] has been fixed so that if file is open + by ksh, it is flushed first. + o. In some cases attributes and sizes for non exported + variables weren't being reset before running a script. + p. The value of TMOUT was affected by changes make to + it in a subshell. + q. The jobs command did not reflect changes make by + sending the CONT signal to a command. + r. The error message for ksh -o unknown was incorrect. + s. Functions invoked as name=value name, did not use + values from the calling scope when evaluating value. + t. A bug in which the shell would reexecute previously + executed code when a shell script or coprocess was + run in the background has been fixed. + u. A bug in which an empty here-document would leave + a file descriptor open has been fixed. + v. A bug in which $(set -A array ...) would leave a + side effect has been fixed. + w. A discipline function for a global variable defined + within a function defined with the function keyword, + incorrectly created a local variable of the same name + and applied the discipline to it. + +12. Bugs fixed in 12/28/93f for default OPTIONS + a. A bug which would cause the secondary prompt to be + displayed when a user entered a literal carriage + return has been fixed. + b. I bug which caused ksh read -s name to core dump was + fixed. + c. I bug with the expansion of \} and \] inside double + quoted strings that also contained variable expansions + has been fixed + d. Changes in the 'e' point release caused autoload + functions invoked from within command substitution + to fail. This has been fixed. + e. A bug in the processing of here-documents that could + prevent variable substitution to occur after $(...) command + substitution for long here documents has been fixed. + f. A bug caused by a race condition that could cause SIGTERM + to be ignored by a child process has been fixed. + g. A bug which prevented the startup of a coprocess immediately + after killing a running coprocess has been fixed. + h. ulimit foobar, where foobar is not an arithmetic + expression, now gives an error message as it did with ksh88 + instead of setting the file size limit to 0. + i. A bug which could cause an interactive shell to terminate when + the last process of a pipeline was a POSIX function was fixed. + j. A bug which could cause command substitution of a shell script + to core dump has been fixed. + k. A security hole was fixed in suid_exec. + l. Arithmetic functions such as pow() that take more than + one argument, did not work if arguments other than the + first contained parenthesized sub-expression. + m. The error message from a script containing an incomplete + arithmetic expression has been corrected. + n. A bug which caused a core dump on some machines when + the value of a name reference contained a positional + parameter and the name reference was not defined inside + a function has been fixed. + o. Arithmetic expressions now correctly handle hexadecimal + constants. + p. A bug in which integer variables could be expanded + with a leading 10# when declared with typeset -i + multiple times has been corrected. + q. A bug in which IFS wasn't correctly restored when + set within command substitution has been fixed. + r. The _ character is now considered as part of a word + with the M-f and M-b emacs directives as it was in ksh88. + +13. Bugs fixed in 12/28/93g for default OPTIONS + a. A bug in which a name reference could be created to + itself and later cause the shell to get into an infinite + loop has been fixed. + b. A bug in shcomp relating to compound variables was fixed. + c. A bug introduced in 'e' in which leading 0's in -Z + fields caused the value to be treated as octal for arithmetic + evaluation has been fixed. + d. A bug when a name reference with a shorter name than + the variable it references was the subject of a compound + assignment has been fixed. + e. A bug which in which assignment to array variables in + a subshell could effect the parent shell has been + fixed. + f. read name?prompt was putting a 0 byte at the end of the + prompt on standard error. + g. A bug in [[ string1 > string2 ]] when ksh was run with -x + has been fixed. + k. A bug in which the escape character was not processed + correctly inside {...} when brace expansion is enabled + has been fixed, for example {\$foo}. + l. A bug in line continuation in here-documents has been + fixed. + m. The default base when not specified with typeset -i is + 10 in accordance with the documentation. Previously, + the value was determined by the first assignment. + n. A parsing bug in which a # preceded alphanumeric + characters inside a command substitution caused + a syntax error to be reported has been fixed. + o. A bug in which a decimal constant represented as 10#ddd + where ddd was more than five digits generated a syntax + error has been fixed. + p. A bug in here document expansion in which ${...} expansions + were split across buffer boundaries has been fixed. + +14. Bugs fixed in 12/28/93h for default OPTIONS + a. I bug in shcomp for compilation of unary operators with [[...]] + has been fixed. + b. A bug in which the value of $? was changed when executing + a keyboard trap has been fixed. + c. The handling of SIGCHLD has been changed so that the + trap is not triggered while executing trap commands + to avoid recursive trap calls. + d. I bug in which a local variable in a function declared readonly + would generated an error when the function went out of + scope has been fixed. + e. I bug in which \ entered from the keyboard + with the KEYBD trap enabled has been fixed. + f. The error message for a misplaced ((, for example print ((3), + was often garbled and has been fixed. + g. I bug in the KEYBD trap in which escape sequences of the form + [#~ were not being handled as a unit has been fixed. + h. A bug in which ksh would consider expressions like [[ (a) ]] + as syntax errors has been fixed. + i. A function defined as foo() without a function body + was not reported as a syntax error. + j. A bug in which ksh could run out of file descriptors when + a stream was repeatedly opened with exec and read from + has been fixed. + k. A bug introduced when fixing item n from the 'g' point + release has been fixed. + +15. Bugs fixed in 12/28/93i for default OPTIONS + a. A bug in which a script could terminate when getopts + encountered an error when invoked inside a function + has been fixed. + b. When a symbolic link was specified as the name of + the script to invoke by name, the value of $0 was + set to the real file name rather than the link name + in some cases and this has been fixed. + +16. Bug fixes for specific non-default option combinations. + a. More signal names have been added for Solaris + b. A bug fixed for the v directive in vi MULTIBYTE has been + fixed. + c. Code to for IFS handling of multibyte characters has + been added. + d. The displaying of multibyte strings in export, readonly, + typeset, and execution traces has been fixed. + e. A bug with type ahead and KEYBOARD traps with the + MULTIBYTE option set has been fixed. + f. The k-shell information abstraction database option, KIA, + has been revamped for the 'e' point release. + g. A bug in brace pattern expansions that caused expressions + such as {foo\,bar,bam} to expand incorrectly have been fixed. + h. On the U/WIN version for Window 95 and Windows NT, + when a directory beginning with a letter followed by + a colon is given to cd, it is assumed to be an absolute + directory. + i. There was a bug in the compile option that does not + use fork() in which the current option settings where + not propagated to sub-shells. + j. A bug in setting .sh.editchar during the KEYBD trap + for the MULTIBYTE option was fixed in release 'h'. + k. A bug in which the precision given as an argument + to printf was not working has been fixed. + +17. Other changes to 12/28/93[abcdefghi] + a. A couple of minor changes to make adding built-ins easier. + b. Variables inside functions are now statically scoped. + The previous behavior was never documented. + c. A few changes have been made to the name-value library + that affect built-ins that use disciplines. The + changes allow disciplines to be shared by variables + and should make it possible to add new disciplines + without recompilation. + d. The name-value library interface has undergone significant + change for this revision. See the new nval.3 man page. + e. Builtin functions can take a third argument which is + a void*. + f. The nv_scan() function can restrict the scope of a walk + to the top scope. Starting in 'f', nv_scan() has an + additional pointer argument that is passed to each invoked + function. + g. Starting with release 'f', an empty for list behave like + a for list with null expansions. It produces a warning + message with sh -n. + h. Starting with release 'f' the code has been modified to + work with EBCDIC as well as ASCII. + i. Starting with the release 'g', the name-value pair library + uses the cdt library rather than the hash library. + j. The sh_fun() function now takes third argument which + is an argument list for the invoked discipline function + or built-in. + k. A callback function can be installed which will give + notification of file duplications and file closes. + +18. Incompatibilities with 12/28/93 version. + None intentional. + diff --git a/src/cmd/ksh93/SHOPT.sh b/src/cmd/ksh93/SHOPT.sh new file mode 100644 index 000000000..f03f8b762 --- /dev/null +++ b/src/cmd/ksh93/SHOPT.sh @@ -0,0 +1,40 @@ +# +# Compile-time SHOPT_* options for ksh93. +# 1 to enable, 0 to disable, empty value to probe. +# + +SHOPT 2DMATCH=1 # two dimensional ${.sh.match} for ${var//pat/str} +SHOPT ACCT= # accounting +SHOPT ACCTFILE= # per-user accounting info +SHOPT AUDIT=1 # enable auditing per SHOPT_AUDITFILE +SHOPT AUDITFILE='\"/etc/ksh_audit\"' # auditing file +SHOPT BGX=1 # one SIGCHLD trap per completed job +SHOPT BRACEPAT=1 # C-shell {...,...} expansions (, required) +SHOPT CMDLIB_HDR= # '' # custom -lcmd list for path-bound builtins +SHOPT CMDLIB_DIR= # '\"/opt/ast/bin\"' # virtual directory prefix for path-bound builtins +SHOPT CRNL= # accept MS Windows newlines () for +SHOPT DYNAMIC=1 # dynamic loading for builtins +SHOPT ECHOPRINT= # make echo equivalent to print +SHOPT EDPREDICT=1 # predictive editing +SHOPT ESH=1 # emacs/gmacs edit mode +SHOPT FILESCAN=1 # fast file scan +SHOPT FIXEDARRAY=1 # fixed dimension indexed array +SHOPT HISTEXPAND=1 # csh-style history file expansions +SHOPT KIA= # ksh -R