6708109.patch revision 1179
1179N/A#
1179N/A# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
1179N/A#
1179N/A# Permission is hereby granted, free of charge, to any person obtaining a
1179N/A# copy of this software and associated documentation files (the "Software"),
1179N/A# to deal in the Software without restriction, including without limitation
1179N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
1179N/A# and/or sell copies of the Software, and to permit persons to whom the
1179N/A# Software is furnished to do so, subject to the following conditions:
1179N/A#
1179N/A# The above copyright notice and this permission notice (including the next
1179N/A# paragraph) shall be included in all copies or substantial portions of the
1179N/A# Software.
1179N/A#
1179N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1179N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1179N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1179N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1179N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1179N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1179N/A# DEALINGS IN THE SOFTWARE.
1179N/A#
1179N/A
1179N/AIncludes Solaris changes for:
1179N/A4213490 Add support for SGML format man pages
1179N/A4226089 xman utility needs to display new SunOS directories
1179N/A4365478 Internationalize xman
1179N/A
1179N/Adiff --git a/buttons.c b/buttons.c
1179N/Aindex 9233346..cd57352 100644
1179N/A--- a/buttons.c
1179N/A+++ b/buttons.c
1068N/A@@ -36,6 +36,8 @@ from the X Consortium.
1068N/A * Created: October 27, 1987
1068N/A */
1068N/A
1068N/A+#include <libintl.h>
1068N/A+#include <X11/Xlocale.h>
1068N/A #include "globals.h"
1068N/A #include "vendor.h"
1068N/A
1068N/A@@ -47,6 +49,7 @@ from the X Consortium.
1068N/A
1068N/A static void CreateOptionMenu(ManpageGlobals * man_globals, Widget parent);
1068N/A static void CreateSectionMenu(ManpageGlobals * man_globals, Widget parent);
1068N/A+static void CreateMoreMenu(ManpageGlobals * man_globals, Widget parent);
1068N/A static void StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page);
1068N/A static Widget * ConvertNamesToWidgets(Widget parent, char ** names);
1068N/A
1179N/A@@ -57,6 +60,7 @@ static Widget * ConvertNamesToWidgets(Widget parent, char ** names);
1068N/A */
1068N/A
1068N/A #define TOPARGS 5
1068N/A+#define MAX_MENU 30
1068N/A
1068N/A Widget top; /* needed in PopupWarning, misc.c */
1068N/A
1068N/A@@ -213,7 +217,7 @@ Boolean full_instance)
1068N/A {
1068N/A Arg arglist[MANPAGEARGS]; /* An argument list for widget creation */
1068N/A Cardinal num_args; /* The number of arguments in the list. */
1068N/A- Widget mytop, pane, hpane, mysections; /* Widgets */
1068N/A+ Widget mytop, pane, hpane, mysections, sect1; /* Widgets */
1068N/A ManPageWidgets * mpw = &(man_globals->manpagewidgets);
1068N/A
1068N/A num_args = (Cardinal) 0;
1068N/A@@ -240,8 +244,13 @@ Boolean full_instance)
1068N/A num_args++;
1068N/A XtSetValues(mytop, arglist, num_args);
1068N/A
1068N/A+#ifdef SUNSOFT
1068N/A+ pane = XtCreateManagedWidget("Manpage_Vpane", panedWidgetClass, mytop, NULL,
1068N/A+ (Cardinal) 0);
1068N/A+#else
1068N/A pane = XtCreateManagedWidget("vertPane", panedWidgetClass, mytop, NULL,
1068N/A (Cardinal) 0);
1068N/A+#endif
1068N/A
1068N/A /* Create menu bar. */
1068N/A
1068N/A@@ -259,15 +268,24 @@ Boolean full_instance)
1068N/A mysections = XtCreateManagedWidget("sections", menuButtonWidgetClass,
1068N/A hpane, arglist, num_args);
1068N/A
1068N/A+ if(sections > MAX_MENU){
1068N/A+ num_args = 0;
1068N/A+ XtSetArg(arglist[num_args], XtNmenuName, MORE_MENU); num_args++;
1068N/A+ sect1 = XtCreateManagedWidget("More...", menuButtonWidgetClass,
1068N/A+ hpane, arglist, num_args);
1068N/A+ }
1068N/A+
1068N/A XtSetArg(arglist[0], XtNlabel, SHOW_BOTH);
1068N/A XtSetValues(man_globals->both_screens_entry, arglist, (Cardinal) 1);
1068N/A
1068N/A if (full_instance) {
1068N/A MakeSearchWidget(man_globals, mytop);
1068N/A CreateSectionMenu(man_globals, mytop);
1068N/A+ if(sections > MAX_MENU) CreateMoreMenu(man_globals, mytop);
1068N/A MakeSaveWidgets(man_globals, mytop);
1068N/A } else {
1068N/A XtSetSensitive(mysections, FALSE);
1068N/A+ if(sections > MAX_MENU) XtSetSensitive(sect1, FALSE);
1068N/A XtSetArg(arglist[0], XtNsensitive, FALSE);
1068N/A XtSetValues(man_globals->dir_entry, arglist, ONE);
1068N/A XtSetValues(man_globals->manpage_entry, arglist, ONE);
1068N/A@@ -281,8 +299,13 @@ Boolean full_instance)
1068N/A XtSetValues(man_globals->print_entry, arglist, ONE);
1068N/A #endif /* INCLUDE_XPRINT_SUPPORT */
1068N/A
1068N/A+#ifdef SUNSOFT
1068N/A+ man_globals->label = XtCreateManagedWidget(MANNAME, labelWidgetClass,
1068N/A+ hpane, NULL, (Cardinal) 0);
1068N/A+#else
1068N/A man_globals->label = XtCreateManagedWidget("manualTitle", labelWidgetClass,
1068N/A hpane, NULL, (Cardinal) 0);
1068N/A+#endif
1068N/A
1068N/A /* Create Directory */
1068N/A
1179N/A@@ -330,7 +353,7 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page)
1068N/A
1068N/A if (page || help) {
1068N/A if (help)
1068N/A- strcpy(man_globals->manpage_title, "Xman Help");
1068N/A+ strcpy(man_globals->manpage_title, gettext("Xman Help"));
1068N/A
1068N/A if (man_globals->both_shown) {
1068N/A XtManageChild(dir);
1179N/A@@ -519,7 +542,7 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
1068N/A menu = XtCreatePopupShell(SECTION_MENU, simpleMenuWidgetClass, parent,
1068N/A NULL, (Cardinal) 0);
1068N/A
1068N/A- for (i = 0 ; i < sections ; i ++) {
1068N/A+ for (i = 0 ; i < ((sections <= MAX_MENU) ? sections:sections/2) ; i ++) {
1068N/A num_args = 0;
1068N/A XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++;
1179N/A snprintf(entry_name, sizeof(entry_name), "section%d", i);
1179N/A@@ -535,6 +558,37 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
1068N/A }
1068N/A }
1068N/A
1068N/A+static void
1068N/A+CreateMoreMenu(man_globals, parent)
1068N/A+ManpageGlobals * man_globals;
1068N/A+Widget parent;
1068N/A+{
1068N/A+ Widget menu, entry;
1068N/A+ int i;
1068N/A+ MenuStruct * menu_struct;
1068N/A+ Arg args[1];
1068N/A+ Cardinal num_args;
1068N/A+ char entry_name[BUFSIZ];
1068N/A+
1068N/A+ menu = XtCreatePopupShell(MORE_MENU, simpleMenuWidgetClass, parent,
1068N/A+ NULL, (Cardinal) 0);
1068N/A+
1068N/A+ for (i = sections/2-1 ; i < sections ; i ++) {
1068N/A+ num_args = 0;
1068N/A+ XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++;
1179N/A+ snprintf(entry_name, sizeof(entry_name), "section%d", i);
1068N/A+
1068N/A+ entry = XtCreateManagedWidget(entry_name, smeBSBObjectClass,
1068N/A+ menu, args, num_args);
1068N/A+ menu_struct = (MenuStruct *) XtMalloc(sizeof(MenuStruct));
1068N/A+ menu_struct->data = (caddr_t) man_globals;
1068N/A+ menu_struct->number = i;
1068N/A+ XtAddCallback(entry, XtNcallback, DirPopupCallback, (caddr_t) menu_struct);
1068N/A+ XtAddCallback(entry, XtNdestroyCallback,MenuDestroy, (caddr_t)menu_struct);
1068N/A+
1068N/A+ }
1068N/A+}
1068N/A+
1068N/A /* Function Name: CreateList
1068N/A * Description: this function prints a label in the directory list
1068N/A * Arguments: section - the manual section.
1179N/A@@ -579,7 +633,7 @@ MakeDirectoryBox(ManpageGlobals *man_globals, Widget parent, Widget *dir_disp, i
1068N/A return;
1068N/A
1068N/A name = manual[section].blabel; /* Set the section name */
1179N/A- snprintf(label_name, sizeof(label_name), "Directory of: %s", name);
1068N/A+ snprintf(label_name, sizeof(label_name), gettext("Directory of: %s"),name);
1068N/A man_globals->section_name[section] = StrAlloc(label_name);
1068N/A
1068N/A num_args = 0;
1179N/A@@ -677,7 +731,7 @@ FormUpWidgets(Widget parent, char ** full_size, char ** half_size)
1068N/A
1068N/A if (long_widget == (Widget) NULL) { /* Make sure we found one. */
1068N/A PopupWarning(GetGlobals(parent),
1068N/A- "Could not find longest widget, aborting...");
1068N/A+ gettext("Could not find longest widget, aborting..."));
1068N/A XtFree((char *)full_widgets);
1068N/A XtFree((char *)half_widgets);
1068N/A return;
1179N/A@@ -746,7 +800,7 @@ ConvertNamesToWidgets(Widget parent, char ** names)
1068N/A char error_buf[BUFSIZ];
1068N/A
1179N/A snprintf(error_buf, sizeof(error_buf),
1179N/A- "Could not find widget named '%s'", *names);
1179N/A+ gettext("Could not find widget named '%s'"), *names);
1068N/A PrintError(error_buf);
1068N/A XtFree((char *)ids);
1068N/A return(NULL);
1179N/Adiff --git a/defs.h b/defs.h
1179N/Aindex ec4d068..9326268 100644
1179N/A--- a/defs.h
1179N/A+++ b/defs.h
1068N/A@@ -51,6 +51,7 @@ from the X Consortium.
1068N/A
1068N/A #define OPTION_MENU "optionMenu" /* Name of the Option Menu. */
1068N/A #define SECTION_MENU "sectionMenu" /* Name of the Section Menu. */
1068N/A+#define MORE_MENU "moreMenu" /* Name of the More... Menu. */
1068N/A
1068N/A #define HELP_BUTTON "helpButton" /* Name of top help button */
1068N/A #define QUIT_BUTTON "quitButton" /* Name of top quit button */
1179N/Adiff --git a/handler.c b/handler.c
1179N/Aindex 4fe291f..32a3e7d 100644
1179N/A--- a/handler.c
1179N/A+++ b/handler.c
1068N/A@@ -43,6 +43,8 @@ from the X Consortium.
1068N/A #include <sys/stat.h>
1068N/A #include "globals.h"
1068N/A #include "vendor.h"
1068N/A+#include <libintl.h>
1068N/A+#include <X11/Xlocale.h>
1068N/A #ifdef INCLUDE_XPRINT_SUPPORT
1068N/A #include "printdialog.h"
1068N/A #include "print.h"
1179N/A@@ -309,8 +311,10 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para
1068N/A char cmdbuf[BUFSIZ], error_buf[BUFSIZ];
1068N/A
1068N/A if (*num_params != 1) {
1068N/A- XtAppWarning(XtWidgetToApplicationContext(w),
1068N/A- "Xman - SaveFormattedPage: This action routine requires one argument.");
1068N/A+ snprintf(error_buf, sizeof(error_buf),
1068N/A+ gettext("%s This action routine requires one argument."),
1068N/A+ "Xman - SaveFormattedPage:");
1068N/A+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
1068N/A return;
1068N/A }
1068N/A
1179N/A@@ -347,13 +351,13 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para
1068N/A /* make sure the formatted man page is fully accessible by the world */
1068N/A if (chmod(man_globals->save_file, CHMOD_MODE) != 0) {
1179N/A snprintf(error_buf, sizeof(error_buf),
1068N/A- "Couldn't set permissions on formatted man page '%s'.\n",
1068N/A+ gettext("Couldn't set permissions on formatted man page '%s'.\n"),
1068N/A man_globals->save_file);
1068N/A PopupWarning( man_globals, error_buf);
1068N/A }
1068N/A } else {
1179N/A snprintf(error_buf, sizeof(error_buf),
1179N/A- "Error while executing the command '%s'.\n", cmdbuf);
1179N/A+ gettext("Error while executing the command '%s'.\n"), cmdbuf);
1068N/A PopupWarning( man_globals, error_buf);
1068N/A }
1179N/A break;
1179N/A@@ -361,8 +365,9 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para
1179N/A case 'c':
1068N/A break;
1068N/A default:
1179N/A- PopupWarning(man_globals, "Xman - SaveFormattedPage: "
1179N/A- "Unknown argument must be either 'Save' or 'Cancel'.");
1179N/A+ snprintf(error_buf, sizeof(error_buf), "%s %s", "Xman - SaveFormattedPage:",
1068N/A+ gettext("Unknown argument must be either 'Save' or 'Cancel'."));
1179N/A+ PopupWarning(man_globals, error_buf);
1068N/A return;
1068N/A }
1179N/A
1179N/A@@ -393,10 +398,13 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
1179N/A ManpageGlobals * man_globals;
1179N/A Arg arglist[1];
1068N/A Boolean sensitive;
1179N/A+ char error_buf[BUFSIZ];
1068N/A
1068N/A if (*num_params != 1) {
1068N/A- XtAppWarning(XtWidgetToApplicationContext(w),
1068N/A- "Xman - GotoPage: This action routine requires one argument.");
1068N/A+ snprintf(error_buf, sizeof(error_buf),
1068N/A+ gettext("%s This action routine requires one argument."),
1068N/A+ gettext("Xman - GotoPage:"));
1068N/A+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
1068N/A return;
1068N/A }
1068N/A
1179N/A@@ -430,8 +438,8 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
1068N/A break;
1068N/A default:
1179N/A XtAppWarning(XtWidgetToApplicationContext(w),
1179N/A- "Xman - GotoPage: Unknown argument must be "
1179N/A- "either Manpage or Directory.");
1179N/A+ gettext("Xman - GotoPage: Unknown argument must be "
1179N/A+ "either Manpage or Directory."));
1068N/A return;
1068N/A }
1179N/A }
1179N/A@@ -548,13 +556,16 @@ void
1068N/A Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
1068N/A {
1068N/A ManpageGlobals * man_globals = GetGlobals(w);
1068N/A+ char error_buf[BUFSIZ];
1068N/A FILE * file = NULL;
1068N/A
1068N/A XtPopdown( XtParent(XtParent(w)) ); /* popdown the search widget */
1068N/A
1068N/A if ( (*num_params < 1) || (*num_params > 2) ) {
1068N/A- XtAppWarning(XtWidgetToApplicationContext(w),
1068N/A- "Xman - Search: This action routine requires one or two arguments.");
1068N/A+ snprintf(error_buf, sizeof(error_buf),
1068N/A+ gettext("%s This action routine requires one or two arguments."),
1068N/A+ gettext("Xman - Search:"));
1068N/A+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
1068N/A return;
1068N/A }
1068N/A
1179N/A@@ -572,8 +583,10 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
1068N/A file = NULL;
1068N/A break;
1068N/A default:
1068N/A- XtAppWarning(XtWidgetToApplicationContext(w),
1068N/A- "Xman - Search: First parameter unknown.");
1068N/A+ snprintf(error_buf, sizeof(error_buf),
1068N/A+ gettext("%s First parameter unknown."),
1068N/A+ gettext("Xman - Search:"));
1068N/A+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
1068N/A file = NULL;
1068N/A break;
1068N/A }
1179N/A@@ -598,8 +611,9 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
1068N/A }
1068N/A break;
1068N/A default:
1068N/A- XtAppWarning(XtWidgetToApplicationContext(w),
1068N/A- "Xman - Search: Second parameter unknown.");
1068N/A+ snprintf(error_buf, sizeof(error_buf),
1068N/A+ gettext("%s Second parameter unknown."), "Xman - Search:");
1068N/A+ XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
1068N/A break;
1068N/A }
1068N/A else {
1179N/Adiff --git a/help.c b/help.c
1179N/Aindex c9d9aa9..8b30d25 100644
1179N/A--- a/help.c
1179N/A+++ b/help.c
1068N/A@@ -36,6 +36,8 @@ from the X Consortium.
1068N/A * Created: January 19, 1988
1068N/A */
1068N/A
1068N/A+#include <libintl.h>
1068N/A+#include <X11/Xlocale.h>
1068N/A #include "globals.h"
1068N/A
1068N/A /* Function Name: MakeHelpWidget.
1068N/A@@ -66,7 +68,7 @@ MakeHelpWidget(void)
1068N/A return(FALSE);
1068N/A }
1068N/A
1068N/A- ChangeLabel(man_globals->label, "Xman Help");
1068N/A+ ChangeLabel(man_globals->label, gettext("Xman Help"));
1068N/A
1068N/A XtManageChild( man_globals->manpagewidgets.manpage );
1068N/A XtRealizeWidget( help_widget );
1179N/A@@ -99,7 +101,7 @@ OpenHelpfile(ManpageGlobals * man_globals)
1068N/A
1068N/A if( (help_file_ptr = fopen(resources.help_file, "r")) == NULL ) {
1068N/A PopupWarning(man_globals,
1068N/A- "Could not open help file, NO HELP WILL BE AVALIABLE.");
1068N/A+ gettext("Could not open help file, NO HELP WILL BE AVALIABLE."));
1068N/A return(FALSE);
1068N/A }
1068N/A
1179N/Adiff --git a/main.c b/main.c
1179N/Aindex 1b6f8e9..73f4fcc 100644
1179N/A--- a/main.c
1179N/A+++ b/main.c
1068N/A@@ -37,6 +37,8 @@ from the X Consortium.
424N/A * Created: October 22, 1987
424N/A */
424N/A
424N/A+#include <libintl.h>
424N/A+#include <X11/Xlocale.h>
424N/A #include "globals.h"
424N/A #ifndef ZERO
424N/A #include <X11/Xaw/Cardinals.h>
1068N/A@@ -146,6 +148,7 @@ int main(int argc, char ** argv)
424N/A {
424N/A XtAppContext app_con;
424N/A
424N/A+ char *domaindir;
424N/A saved_argc = argc;
424N/A saved_argv = (char **)XtMalloc(argc * sizeof(char *));
424N/A bcopy(argv, saved_argv, argc * sizeof(char *));
1068N/A@@ -158,6 +161,13 @@ int main(int argc, char ** argv)
424N/A wm_delete_window = XInternAtom(XtDisplay(initial_widget), "WM_DELETE_WINDOW",
424N/A False);
424N/A
424N/A+ textdomain("xman");
424N/A+
424N/A+ if((domaindir = getenv("TEXTDOMAINDIR")) == NULL) {
424N/A+ domaindir = "/usr/X11/share/locale";
424N/A+ }
424N/A+ bindtextdomain("xman", domaindir);
424N/A+
424N/A manglobals_context = XStringToContext(MANNAME);
424N/A
424N/A AdjustDefResources();
1068N/A@@ -174,10 +184,10 @@ int main(int argc, char ** argv)
424N/A XtAppAddActions(app_con, xman_actions, XtNumber(xman_actions));
424N/A
424N/A if (!resources.fonts.directory)
424N/A- PrintError("Failed to get the directory font.");
424N/A+ PrintError(gettext("Failed to get the directory font."));
424N/A
424N/A #ifdef DEBUG
424N/A- printf("debugging mode\n");
424N/A+ printf(gettext("debugging mode\n"));
424N/A #endif
424N/A
424N/A /*
1068N/A@@ -195,7 +205,7 @@ int main(int argc, char ** argv)
424N/A default_height /= 4;
424N/A
424N/A if ( (sections = Man()) == 0 )
424N/A- PrintError("There are no manual sections to display, check your MANPATH.");
424N/A+ PrintError(gettext("There are no manual sections to display, check your MANPATH."));
424N/A
424N/A if (resources.top_box_active)
424N/A MakeTopBox();
1068N/A@@ -219,7 +229,7 @@ int main(int argc, char ** argv)
424N/A }
424N/A
424N/A /* Function Name: ArgError
424N/A- * Description: Prints error message about unknow arguments.
424N/A+ * Description: Prints error message about unknown arguments.
424N/A * Arguments: argc, argv - args not understood.
424N/A * Returns: none.
424N/A */
1068N/A@@ -229,42 +239,53 @@ ArgError(int argc, char ** argv)
424N/A {
424N/A int i;
424N/A
424N/A- static char **syntax, *syntax_def[] = {
424N/A- "-help", "Print this message",
424N/A- "-helpfile <filename>", "Specifies the helpfile to use.",
424N/A- "-bothshown", "Show both the directory and manpage at once.",
424N/A- "-notopbox", "Starts with manpage rather than topbox.",
424N/A- "-geometry <geom>", "Specifies the geometry of the top box.",
424N/A- "=<geom>", "Specifies the geometry of the top box.",
424N/A- "-pagesize <geom>", "Specifies the geometry of the manual page.",
424N/A- "-bw <pixels>", "Width of all window borders.",
424N/A- "-borderwidth <pixels>", "Width of all window borders.",
424N/A- "-bd <color>", "Color of all window borders.",
424N/A- "-bordercolor <color>", "Color of all window borders.",
424N/A- "-fg <color>", "Foreground color for the application.",
424N/A- "-foreground <color>", "Foreground color for the application.",
424N/A- "-bg <color>", "Background color for the application.",
424N/A- "-background <color>", "Background color for the application.",
424N/A- "-display <display name>", "Specify a display that is not the default",
424N/A- "-fn <font>", "Font to be used for button and label text.",
424N/A- "-font <font>", "Font to be used for button and label text.",
424N/A- "-name <name>", "Change the name used for retrieving resources.",
424N/A- "-title <name>", "Change the name without affecting resources.",
424N/A- "-xrm <resource>", "Specifies a resource on the command line.",
424N/A- NULL, NULL,
424N/A- };
424N/A-
424N/A- syntax = syntax_def;
424N/A-
424N/A for (i = 1; i < argc ; i++)
424N/A- (void) printf("This argument is unknown to Xman: %s\n", argv[i]);
424N/A+ (void) printf(gettext("This argument is unknown to Xman: %s\n"), argv[i]);
424N/A
424N/A- (void) printf("\nKnown arguments are:\n");
1179N/A-
424N/A- while ( *syntax != NULL ) {
424N/A- printf("%-30s - %s\n", syntax[0], syntax[1]);
424N/A- syntax += 2;
424N/A- }
1179N/A+ (void) printf(gettext("\nKnown arguments are:\n"));
1179N/A+
424N/A+ printf("-help - %s\n",
424N/A+ gettext("Print this message"));
424N/A+ printf("-helpfile %s - %s\n", gettext("<filename> "),
424N/A+ gettext("Specifies the helpfile to use."));
424N/A+ printf("-bothshown - %s\n",
424N/A+ gettext("Show both the directory and manpage at once."));
424N/A+ printf("-notopbox - %s\n",
424N/A+ gettext("Starts with manpage rather than topbox."));
424N/A+ printf("-geometry %s - %s\n", gettext("<geom> "),
424N/A+ gettext("Specifies the geometry of the top box."));
424N/A+ printf("=%s - %s\n", gettext("<geom> "),
424N/A+ gettext("Specifies the geometry of the top box."));
424N/A+ printf("-pagesize %s - %s\n", gettext("<geom> "),
424N/A+ gettext("Specifies the geometry of the manual page."));
424N/A+ printf("-bw %s - %s\n", gettext("<pixels> "),
424N/A+ gettext("Width of all window borders."));
424N/A+ printf("-borderwidth %s - %s\n", gettext("<pixels> "),
424N/A+ gettext("Width of all window borders."));
424N/A+ printf("-bd %s - %s\n", gettext("<color> "),
424N/A+ gettext("Color of all window borders."));
424N/A+ printf("-bordercolor %s - %s\n", gettext("<color> "),
424N/A+ gettext("Color of all window borders."));
424N/A+ printf("-fg %s - %s\n", gettext("<color> "),
424N/A+ gettext("Foreground color for the application."));
424N/A+ printf("-foreground %s - %s\n", gettext("<color> "),
424N/A+ gettext("Foreground color for the application."));
424N/A+ printf("-bg %s - %s\n", gettext("<color> "),
424N/A+ gettext("Background color for the application."));
424N/A+ printf("-background %s - %s\n", gettext("<color> "),
424N/A+ gettext("Background color for the application."));
424N/A+ printf("-display %s - %s\n", gettext("<display name> "),
424N/A+ gettext("Specify a display that is not the default"));
424N/A+ printf("-fn %s - %s\n", gettext("<font> "),
424N/A+ gettext("Font to be used for button and label text."));
424N/A+ printf("-font %s - %s\n", gettext("<font> "),
424N/A+ gettext("Font to be used for button and label text."));
424N/A+ printf("-name %s - %s\n", gettext("<name> "),
424N/A+ gettext("Change the name used for retrieving resources."));
424N/A+ printf("-title %s - %s\n", gettext("<name> "),
424N/A+ gettext("Change the name without affecting resources."));
424N/A+ printf("-xrm %s - %s\n", gettext("<resource> "),
424N/A+ gettext("Specifies a resource on the command line."));
424N/A }
424N/A
424N/A /* Function Name: AdjustDefResources
1179N/Adiff --git a/man.c b/man.c
1179N/Aindex ad2b3f0..f3f1d99 100644
1179N/A--- a/man.c
1179N/A+++ b/man.c
1068N/A@@ -31,7 +31,8 @@ from the X Consortium.
424N/A */
424N/A /* $XFree86: xc/programs/xman/man.c,v 1.8 2003/04/09 20:31:31 herrb Exp $ */
424N/A
424N/A-
424N/A+#include <libintl.h>
424N/A+#include <X11/Xlocale.h>
424N/A #include "globals.h"
424N/A #include "vendor.h" /* vendor-specific defines and data */
424N/A
1068N/A@@ -171,7 +172,7 @@ Man(void)
424N/A manual = (Manual *) XtRealloc ( (char *) manual,
424N/A (sizeof(Manual) * num_alloced));
424N/A if (manual == NULL)
424N/A- PrintError("Could not allocate memory for manual sections.");
424N/A+ PrintError(gettext("Could not allocate memory for manual sections."));
424N/A }
424N/A InitManual( manual + sect, list->label );
424N/A manual[sect].flags = list->flags;
1068N/A@@ -198,10 +199,10 @@ Man(void)
424N/A */
424N/A
424N/A if (sect == 0)
424N/A- PrintError("No manual pages found.");
424N/A+ PrintError(gettext("No manual pages found."));
424N/A manual = (Manual *) XtRealloc( (char *) manual, (sizeof(Manual) * sect));
424N/A if (manual == NULL)
424N/A- PrintError("Could not allocate memory for manual sections.");
424N/A+ PrintError(gettext("Could not allocate memory for manual sections."));
424N/A
424N/A return(sect); /* return the number of man sections. */
424N/A }
1068N/A@@ -223,7 +224,7 @@ SortList(SectionList ** list)
424N/A SectionList *head, *last, *inner, *old;
424N/A
424N/A if (*list == NULL)
424N/A- PrintError("No manual sections to read, exiting.");
424N/A+ PrintError(gettext("No manual sections to read, exiting."));
424N/A
424N/A /*
424N/A * First step
1179N/A@@ -426,7 +427,7 @@ ReadCurrentSection(Manual * local_manual, char * path)
424N/A
424N/A if((dir = opendir(path)) == NULL) {
424N/A #ifdef DEBUG
424N/A- snprintf(error_buf, sizeof(error_buf), "Can't open directory %s", path);
424N/A+ snprintf(error_buf, sizeof(error_buf), gettext("Can't open directory %s"), path);
424N/A PopupWarning(NULL, error_buf);
424N/A #endif /* DEBUG */
424N/A return;
1179N/A@@ -512,7 +513,7 @@ ReadCurrentSection(Manual * local_manual, char * path)
424N/A local_manual->entries_less_paths[nentries] =
424N/A rindex(local_manual->entries[nentries], '/');
424N/A if ( local_manual->entries_less_paths[nentries] == NULL )
424N/A- PrintError("Internal error while cataloging manual pages.");
424N/A+ PrintError(gettext("Internal error while cataloging manual pages."));
424N/A ++ nentries;
424N/A }
424N/A
1068N/A@@ -540,7 +541,7 @@ SortAndRemove(Manual *man, int number)
424N/A register int i2 = 0;
424N/A
424N/A #ifdef DEBUG
424N/A- printf("sorting section %d - %s\n", i, man->blabel);
424N/A+ printf(gettext("sorting section %d - %s\n"), i, man->blabel);
424N/A #endif /* DEBUG */
424N/A
424N/A s1 = (char **)malloc(man->nentries * sizeof(char *));
1068N/A@@ -571,14 +572,14 @@ SortAndRemove(Manual *man, int number)
424N/A j = 0;
424N/A l2 = man->entries_less_paths[j++];
424N/A if ( l2 == NULL )
424N/A- PrintError("Internal error while removing duplicate manual pages.");
424N/A+ PrintError(gettext("Internal error while removing duplicate manual pages."));
424N/A while ( j < nentm1 )
424N/A {
424N/A l1 = l2;
424N/A l2 = man->entries_less_paths[j++];
424N/A if ( l2 == NULL )
424N/A- PrintError("Internal error while removing duplicate manual pages."
424N/A- );
424N/A+ PrintError(gettext("Internal error while removing duplicate manual pages."
424N/A+ ));
424N/A if ( streq(l1,l2) )
424N/A {
424N/A j2 = j-1;
1068N/A@@ -980,7 +981,7 @@ DumpManual(int number)
424N/A register int i,j;
424N/A
424N/A for ( i = 0; i < number; i++) {
424N/A- printf("label: %s\n", manual[i].blabel);
424N/A+ printf("gettext(label: %s\n"), manual[i].blabel);
424N/A for (j = 0; j < manual[i].nentries; j++)
424N/A printf("%s\n", manual[i].entries[j]);
424N/A }
1179N/Adiff --git a/misc.c b/misc.c
1179N/Aindex 8818aa8..fe476ec 100644
1179N/A--- a/misc.c
1179N/A+++ b/misc.c
1068N/A@@ -41,6 +41,8 @@ from the X Consortium.
424N/A # include "config.h"
424N/A #endif
424N/A
424N/A+#include <libintl.h>
424N/A+#include <X11/Xlocale.h>
424N/A #include "globals.h"
424N/A #include "vendor.h"
424N/A #include <X11/Xos.h> /* sys/types.h and unistd.h included in here */
1179N/A@@ -98,7 +100,7 @@ PopupWarning(ManpageGlobals * man_globals, const char * string)
424N/A char buffer[BUFSIZ];
424N/A Boolean hasPosition;
424N/A
424N/A- snprintf( buffer, sizeof(buffer), "Xman Warning: %s", string);
424N/A+ snprintf( buffer, sizeof(buffer), gettext("Xman Warning: %s"), string);
424N/A hasPosition = FALSE;
424N/A if (top)
424N/A {
1179N/A@@ -140,7 +142,7 @@ PopupWarning(ManpageGlobals * man_globals, const char * string)
424N/A void
424N/A PrintError(char * string)
424N/A {
424N/A- fprintf(stderr,"Xman Error: %s\n",string);
424N/A+ fprintf(stderr,gettext("Xman Error: %s\n"),string);
424N/A exit(EXIT_FAILURE);
424N/A }
424N/A
1179N/A@@ -202,7 +204,7 @@ FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num)
424N/A
424N/A temp = CreateManpageName(entry, 0, 0);
424N/A snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title),
424N/A- "The current manual page is: %s.", temp);
424N/A+ gettext("The current manual page is: %s."), temp);
424N/A XtFree(temp);
424N/A
424N/A ParseEntry(entry, path, section, page);
1179N/A@@ -328,13 +330,13 @@ Uncompress(ManpageGlobals * man_globals, char * filename)
424N/A return(NULL);
424N/A
424N/A else if ((file = fopen(tmp_file, "r")) == NULL) {
1179N/A- PopupWarning(man_globals, "Something went wrong in retrieving the "
1179N/A- "uncompressed manual page try cleaning up /tmp.");
1179N/A+ PopupWarning(man_globals, gettext("Something went wrong in retrieving "
1179N/A+ "the uncompressed manual page. Try cleaning up /tmp."));
424N/A }
424N/A #else
424N/A if (!UncompressNamed(man_globals, filename, tmp_file, &file)) {
1179N/A- PopupWarning(man_globals, "Something went wrong in retrieving the "
1179N/A- "uncompressed manual page try cleaning up /tmp.");
1179N/A+ PopupWarning(man_globals, gettext("Something went wrong in retrieving "
1179N/A+ "the uncompressed manual page. Try cleaning up /tmp."));
424N/A return(NULL);
424N/A }
1179N/A #endif
1179N/A@@ -371,7 +373,7 @@ UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output,
424N/A if (stat(filename, &junk) != 0) { /* Check for existance of the file. */
424N/A if (errno != ENOENT) {
424N/A snprintf(error_buf, sizeof(error_buf),
424N/A- "Error while stating file %s, errno = %d", filename, errno);
424N/A+ gettext("Error while stating file %s, errno = %d"), filename, errno);
424N/A PopupWarning(man_globals, error_buf);
424N/A }
424N/A return(FALSE);
1179N/A@@ -388,7 +390,7 @@ UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output,
424N/A #else
424N/A fd = mkstemp(tmp);
424N/A if (fd < 0) {
424N/A- PopupWarning(man_globals, "Error creating a temp file");
424N/A+ PopupWarning(man_globals, gettext("Error creating a temp file"));
424N/A return FALSE;
424N/A }
424N/A *output_fd = fdopen(fd, "r");
1179N/A@@ -418,7 +420,7 @@ UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output,
424N/A return(TRUE);
424N/A
424N/A snprintf(error_buf, sizeof(error_buf),
424N/A- "Error while uncompressing, command was: %s", cmdbuf);
424N/A+ gettext("Error while uncompressing, command was: %s"), cmdbuf);
424N/A PopupWarning(man_globals, error_buf);
424N/A return(FALSE);
424N/A }
1179N/A@@ -514,7 +516,7 @@ Format(ManpageGlobals * man_globals, char * entry)
424N/A #endif
424N/A /* We Really could not find it, this should never happen, yea right. */
424N/A snprintf(error_buf, sizeof(error_buf),
424N/A- "Could not open manual page, %s", entry);
424N/A+ gettext("Could not open manual page, %s"), entry);
424N/A PopupWarning(man_globals, error_buf);
424N/A XtPopdown( XtParent(man_globals->standby) );
424N/A return(NULL);
1179N/A@@ -571,6 +573,19 @@ Format(ManpageGlobals * man_globals, char * entry)
424N/A ParseEntry(entry, path, sect, NULL);
424N/A
424N/A #ifndef HANDLE_ROFFSEQ
424N/A+#ifdef SFORMAT /* Handle Solaris SGML pages */
424N/A+ if (sect[0] == 's') {
1068N/A+#ifndef HAS_MKSTEMP
424N/A+ snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s | %s %s > %s %s",
424N/A+ path, SFORMAT, filename, TBL, FORMAT, man_globals->tempfile,
424N/A+ "2> /dev/null");
424N/A+#else
424N/A+ snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s | %s %s >> %s %s",
424N/A+ path, SFORMAT, filename, TBL, FORMAT, man_globals->tempfile,
424N/A+ "2> /dev/null");
424N/A+#endif
424N/A+ } else {
424N/A+#endif /* SFORMAT */
1068N/A #ifndef HAS_MKSTEMP
424N/A snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s > %s %s", path, TBL,
424N/A filename, FORMAT, man_globals->tempfile, "2> /dev/null");
1179N/A@@ -578,10 +593,13 @@ Format(ManpageGlobals * man_globals, char * entry)
424N/A snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s >> %s %s", path, TBL,
424N/A filename, FORMAT, man_globals->tempfile, "2> /dev/null");
424N/A #endif
424N/A+#ifdef SFORMAT
424N/A+ }
424N/A+#endif
424N/A #else
424N/A /* Handle more flexible way of specifying the formatting pipeline */
424N/A if (! ConstructCommand(cmdbuf, path, filename, man_globals->tempfile)) {
1179N/A- PopupWarning(man_globals, "Constructed command was too long!");
1179N/A+ PopupWarning(man_globals, gettext("Constructed command was too long!"));
424N/A file = NULL;
424N/A }
1179N/A else
1179N/A@@ -589,15 +607,15 @@ Format(ManpageGlobals * man_globals, char * entry)
424N/A
424N/A if(system(cmdbuf) != 0) { /* execute search. */
424N/A snprintf(error_buf, sizeof(error_buf),
424N/A- "Something went wrong trying to run the command: %s", cmdbuf);
424N/A+ gettext("Something went wrong trying to run the command: %s"), cmdbuf);
424N/A PopupWarning(man_globals, error_buf);
424N/A file = NULL;
424N/A }
424N/A else {
424N/A #ifndef HAS_MKSTEMP
424N/A if ((file = fopen(man_globals->tempfile,"r")) == NULL) {
1179N/A- PopupWarning(man_globals, "Something went wrong in retrieving the "
1179N/A- "temp file, try cleaning up /tmp");
1179N/A+ PopupWarning(man_globals, gettext("Something went wrong in retrieving "
1179N/A+ "the temp file, try cleaning up /tmp"));
424N/A }
424N/A else {
1179N/A #endif
1179N/A@@ -1066,7 +1084,7 @@ AddCursor(Widget w, Cursor cursor)
424N/A Colormap c_map;
424N/A
424N/A if (!XtIsRealized(w)) {
424N/A- PopupWarning(NULL, "Widget is not realized, no cursor added.\n");
424N/A+ PopupWarning(NULL, gettext("Widget is not realized, no cursor added.\n"));
424N/A return;
424N/A }
424N/A
1179N/A@@ -1177,14 +1195,14 @@ ParseEntry(char *entry, char *path, char *sect, char *page)
424N/A
424N/A c = rindex(temp, '/');
424N/A if (c == NULL)
424N/A- PrintError("index failure in ParseEntry.");
424N/A+ PrintError(gettext("index failure in ParseEntry."));
424N/A *c++ = '\0';
424N/A if (page != NULL)
424N/A strcpy(page, c);
424N/A
424N/A c = rindex(temp, '/');
424N/A if (c == NULL)
424N/A- PrintError("index failure in ParseEntry.");
424N/A+ PrintError(gettext("index failure in ParseEntry."));
424N/A *c++ = '\0';
424N/A #if defined(SFORMAT) && defined(SMAN)
424N/A /* sgmltoroff sometimes puts an extra ./ in the path to .so entries */
1179N/A@@ -1231,12 +1249,12 @@ GetGlobals(Widget w)
424N/A
424N/A if (temp == NULL)
424N/A XtAppError(XtWidgetToApplicationContext(w),
424N/A- "Xman: Could not locate widget in tree, exiting");
424N/A+ gettext("Xman: Could not locate widget in tree, exiting"));
424N/A
424N/A if (XFindContext(XtDisplay(w), XtWindow(w),
424N/A manglobals_context, &data) != XCSUCCESS)
424N/A XtAppError(XtWidgetToApplicationContext(w),
424N/A- "Xman: Could not find global data, exiting");
424N/A+ gettext("Xman: Could not find global data, exiting"));
424N/A
424N/A return( (ManpageGlobals *) data);
424N/A }
1179N/A@@ -1258,7 +1276,7 @@ SaveGlobals(Widget w, ManpageGlobals * globals)
424N/A if (XSaveContext(XtDisplay(w), XtWindow(w), manglobals_context,
424N/A (caddr_t) globals) != XCSUCCESS)
424N/A XtAppError(XtWidgetToApplicationContext(w),
424N/A- "Xman: Could not save global data, are you out of memory?");
424N/A+ gettext("Xman: Could not save global data, are you out of memory?"));
424N/A }
424N/A
424N/A /* Function Name: RemoveGlobals
1179N/A@@ -1276,5 +1294,5 @@ RemoveGlobals(Widget w)
424N/A if (XDeleteContext(XtDisplay(w), XtWindow(w),
424N/A manglobals_context) != XCSUCCESS)
424N/A XtAppError(XtWidgetToApplicationContext(w),
424N/A- "Xman: Could not remove global data?");
424N/A+ gettext("Xman: Could not remove global data?"));
424N/A }
1179N/Adiff --git a/search.c b/search.c
1179N/Aindex 48c4efe..21d413d 100644
1179N/A--- a/search.c
1179N/A+++ b/search.c
1068N/A@@ -30,7 +30,8 @@ from the X Consortium.
424N/A */
424N/A /* $XFree86: xc/programs/xman/search.c,v 1.5 2001/01/27 17:24:27 herrb Exp $ */
424N/A
424N/A-
424N/A+#include <libintl.h>
424N/A+#include <X11/Xlocale.h>
424N/A #include "globals.h"
424N/A #include "vendor.h"
424N/A
1179N/A@@ -70,7 +71,7 @@ MakeSearchWidget(ManpageGlobals * man_globals, Widget parent)
424N/A arglist, num_args);
424N/A
424N/A if ( (text = XtNameToWidget(dialog, "value")) == (Widget) NULL)
424N/A- PopupWarning(NULL, "Could not find text widget in MakeSearchWidget.");
424N/A+ PopupWarning(NULL, gettext("Could not find text widget in MakeSearchWidget."));
424N/A else
424N/A XtSetKeyboardFocus(dialog, text);
424N/A
1179N/A@@ -86,7 +87,7 @@ MakeSearchWidget(ManpageGlobals * man_globals, Widget parent)
424N/A if ( ((command = XtNameToWidget(dialog, MANUALSEARCH)) == (Widget) NULL) ||
424N/A ((cancel = XtNameToWidget(dialog, CANCEL)) == (Widget) NULL) )
424N/A PopupWarning(NULL,
424N/A- "Could not find manual search widget in MakeSearchWidget.");
424N/A+ gettext("Could not find manual search widget in MakeSearchWidget."));
424N/A else {
424N/A static char * half_size[] = {
424N/A MANUALSEARCH, APROPOSSEARCH, NULL
1068N/A@@ -121,7 +122,7 @@ ManpageGlobals * man_globals)
424N/A return(XawDialogGetValueString(dialog));
424N/A
424N/A PopupWarning(man_globals,
424N/A- "Could not get the search string, no search will be preformed.");
424N/A+ gettext("Could not get the search string, no search will be preformed."));
424N/A return(NULL);
424N/A }
424N/A
1179N/A@@ -165,16 +166,16 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A /* If the string is empty or starts with a space then do not search */
424N/A
424N/A if ( streq(search_string,"") ) {
424N/A- PopupWarning(man_globals, "Search string is empty.");
424N/A+ PopupWarning(man_globals, gettext("Search string is empty."));
424N/A return(NULL);
424N/A }
424N/A
424N/A if (strlen(search_string) >= BUFSIZ) {
424N/A- PopupWarning(man_globals, "Search string too long.");
424N/A+ PopupWarning(man_globals, gettext("Search string too long."));
424N/A return(NULL);
424N/A }
424N/A if (search_string[0] == ' ') {
424N/A- PopupWarning(man_globals, "First character cannot be a space.");
424N/A+ PopupWarning(man_globals, gettext("First character cannot be a space."));
424N/A return(NULL);
424N/A }
424N/A
1179N/A@@ -210,7 +211,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A }
424N/A
424N/A snprintf(label, sizeof(label),
424N/A- "Results of apropos search on: %s", search_string);
424N/A+ gettext("Results of apropos search on: %s"), search_string);
424N/A
424N/A #ifdef NO_MANPATH_SUPPORT /* not quite correct, but the best I can do. */
424N/A snprintf(cmdbuf, sizeof(cmdbuf), APROPOS_FORMAT, search_string, mantmp);
1179N/A@@ -219,7 +220,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A #endif
424N/A
424N/A if(system(cmdbuf) != 0) { /* execute search. */
424N/A- snprintf(error_buf, sizeof(error_buf), "Something went wrong trying to run %s\n",cmdbuf);
424N/A+ snprintf(error_buf, sizeof(error_buf), gettext("Something went wrong trying to run %s\n"),cmdbuf);
424N/A PopupWarning(man_globals, error_buf);
424N/A }
424N/A
1179N/A@@ -228,7 +229,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A #else
424N/A if((file = fopen(mantmp,"r")) == NULL)
424N/A #endif
424N/A- PrintError("lost temp file? out of temp space?");
424N/A+ PrintError(gettext("lost temp file? out of temp space?"));
424N/A
424N/A /*
424N/A * Since we keep the FD open we can unlink the file safely, this
1179N/A@@ -237,7 +238,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A
424N/A unlink(mantmp);
424N/A
424N/A- snprintf(string_buf, sizeof(string_buf), "%s: nothing appropriate", search_string);
424N/A+ snprintf(string_buf, sizeof(string_buf), gettext("%s: nothing appropriate"), search_string);
424N/A
424N/A /*
424N/A * Check first LOOKLINES lines for "nothing appropriate".
1179N/A@@ -276,7 +277,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A else { /* MANUAL SEACH */
424N/A file = DoManualSearch(man_globals, search_string);
424N/A if (file == NULL) {
424N/A- snprintf(string_buf, sizeof(string_buf), "No manual entry for %s.", search_string);
424N/A+ snprintf(string_buf, sizeof(string_buf), gettext("No manual entry for %s."), search_string);
424N/A ChangeLabel(man_globals->label, string_buf);
424N/A if (man_globals->label == NULL)
424N/A PopupWarning(man_globals, string_buf);
1179N/A@@ -290,7 +291,7 @@ DoSearch(ManpageGlobals * man_globals, int type)
424N/A
424N/A dialog = XtNameToWidget(man_globals->search_widget, DIALOG);
424N/A if (dialog == NULL)
424N/A- PopupWarning(man_globals, "Could not clear the search string.");
424N/A+ PopupWarning(man_globals, gettext("Could not clear the search string."));
424N/A
424N/A XtSetArg(arglist[0], XtNvalue, "");
424N/A XtSetValues(dialog, arglist, (Cardinal) 1);
1068N/A@@ -377,7 +378,7 @@ int number)
424N/A
424N/A head = rindex(first[ global_number + check ], '/');
424N/A if (head == NULL)
424N/A- PrintError("index failure in BEntrySearch");
424N/A+ PrintError(gettext("index failure in BEntrySearch"));
424N/A head++;
424N/A
424N/A tail = rindex(head, '.');
1179N/Adiff --git a/vendor.c b/vendor.c
1179N/Aindex 79cc8bb..b3772dd 100644
1179N/A--- a/vendor.c
1179N/A+++ b/vendor.c
1068N/A@@ -34,6 +34,8 @@ from the X Consortium.
424N/A
424N/A #include "globals.h"
424N/A #include "vendor.h"
424N/A+#include <libintl.h>
424N/A+#include <X11/Xlocale.h>
424N/A
424N/A typedef struct sectionName {
424N/A char * name;
1068N/A@@ -100,21 +102,74 @@ static SectionNameRec SectionNames[] = {
424N/A {"(1m) Maintenance Commands", "1m"},
424N/A {"(1s) SunOS Specific Commands", "1s"},
424N/A {"(2) System Calls", "2"},
424N/A- {"(3) C Library Functions", "3"},
424N/A+ {"(3) Introduction to Library Functions", "3"},
424N/A+ {"(3adm) General Administrative Library Functions", "3adm"},
424N/A+ {"(3aio) Asynchronous I/O Library Functions", "3aio"},
424N/A {"(3b) SunOS/BSD Compatibility Functions", "3b"},
424N/A+ {"(3bsm) Security and Auditing Library Functions", "3bsm"},
424N/A {"(3c) C Library Functions", "3c"},
424N/A- {"(3e) ELF Library Functions", "3e"},
424N/A+ {"(3cfgadm) Configuration Administration Library Functions", "3cfgadm"},
424N/A+ {"(3crypt) Encryption and Decryption Library", "3crypt"},
424N/A+ {"(3curses) Curses Library Functions", "3curses"},
424N/A+ {"(3devid) Device ID Library Functions", "3devid"},
424N/A+ {"(3devinfo) Device Information Library Functions", "3devinfo"},
424N/A+ {"(3dl) Dynamic Linking Library Functions", "3dl"},
424N/A+ {"(3dmi) DMI Library Functions", "3dmi"},
424N/A+ {"(3door) Door Library Functions", "3door"},
424N/A+ {"(3e) C Library Functions", "3e"},
424N/A+ {"(3elf) ELF Library Functions", "3elf"},
424N/A+ {"(3ext) Extended Library Functions", "3ext"},
424N/A {"(3g) C Library Functions", "3g"},
424N/A- {"(3i) Wid Character Functions", "3i"},
424N/A+ {"(3gen) String Pattern-Matching Library Functions", "3gen"},
424N/A+ {"(3head) Headers", "3head"},
424N/A+ {"(3i) Wide Character Functions", "3i"},
424N/A {"(3k) Kernel VM Library Functions", "3k"},
424N/A- {"(3m) Mathematical Library", "3m"},
424N/A+ {"(3krb) Kerberos Library Functions", "3krb"},
424N/A+ {"(3kstat) Kernel Statistics Library Functions", "3kstat"},
424N/A+ {"(3kvm) Kernel VM Library Functions", "3kvm"},
424N/A+ {"(3layout) Layout Services Library Functions", "3layout"},
424N/A+ {"(3ldap) LDAP Library Functions", "3ldap"},
424N/A+ {"(3lib) Interface Libraries", "3lib"},
424N/A+ {"(3libucb) SunOS/BSD Compatibility Interface Libraries", "3libucb"},
424N/A+ {"(3m) Mathematical Library Functions", "3m"},
424N/A+ {"(3mail) User Mailbox Library Functions", "3mail"},
424N/A+ {"(3malloc) Memory Allocation Library Functions", "3malloc"},
424N/A+ {"(3mp) Integer Mathematical Library Functions", "3mp"},
424N/A {"(3n) Network Functions", "3n"},
424N/A- {"(3r) RPC Services Library", "3r"},
424N/A+ {"(3nsl) Networking Services Library Functions", "3nsl"},
424N/A+ {"(3pam) PAM Library Functions", "3pam"},
424N/A+ {"(3plot) Graphics Interface Library Functions", "3plot"},
424N/A+ {"(3proc) Process Control Library Functions", "3proc"},
424N/A+ {"(3r) Realtime Library", "3r"},
424N/A+ {"(3rac) Remote Asynchronous Calls Library Functions", "3rac"},
424N/A+ {"(3resolv) Resolver Library Functions", "3resolv"},
424N/A+ {"(3rpc) RPC Library Functions", "3rpc"},
424N/A+ {"(3rt) Realtime Library Functions", "3rt"},
424N/A {"(3s) Standard I/O Functions", "3s"},
424N/A+ {"(3sched) LWP Scheduling Library Functions", "3sched"},
424N/A+ {"(3sec) File Access Control Library Functions", "3sec"},
424N/A+ {"(3secdb) Security Attributes Database Library Functions", "3secdb"},
424N/A+ {"(3snmp) SNMP Library Functions", "3snmp"},
424N/A+ {"(3socket) Sockets Library Functions", "3socket"},
424N/A #if OSMINORVERSION == 5
424N/A- {"(3t) Threads Library", "3t"},
424N/A+ {"(3t) Threads Library Functions", "3t"},
424N/A #endif
424N/A+ {"(3thr) Threads Library Functions", "3thr"},
424N/A+ {"(3tnf) TNF Library Functions", "3tnf"},
424N/A+ {"(3ucb) SunOS/BSD Compatibility Library Functions", "3ucb"},
424N/A+ {"(3volmgt) Volume Management Library Functions", "3volmgt"},
424N/A {"(3x) Miscellaneous Library Functions", "3x"},
424N/A+ {"(3xc) X/Open Curses Library Functions", "3xc"},
424N/A+ {"(3xcurses) X/Open Curses Library Functions", "3xcurses"},
424N/A+ {"(3xfn) XFN Interface Library Functions", "3xfn"},
424N/A+ {"(3xn) X/Open Networking Services Library Functions", "3xn"},
424N/A+ {"(3xnet) X/Open Networking Services Library Functions", "3xnet"},
424N/A+ {"(3X11) X Window System: Xlib Functions", "3X11"},
424N/A+ {"(3Xext) X Window System: Protocol Extension Functions", "3Xext"},
424N/A+ {"(3Xi) X Window System: Input Extension Functions", "3Xi"},
424N/A+ {"(3Xmu) X Window System: Miscellaneous Utility Functions", "3Xmu"},
424N/A+ {"(3Xp) X Window System: Print Extension Functions", "3Xp"},
424N/A+ {"(3Xt) X Window System: Toolkit Intrinsics Functions", "3Xt"},
424N/A {"(4) File Formats", "4"},
424N/A {"(4b) Misc. Reference Manual Pages", "4b"},
424N/A {"(5) Environments, Tables, and TROFF Macros", "5"},
1068N/A@@ -133,6 +188,7 @@ static SectionNameRec SectionNames[] = {
424N/A {"(9s) DDI and DKI Data Structures", "9s"},
424N/A {"(l) Local", "l"},
424N/A {"(n) New", "n"},
424N/A+ {"(o) Old", "o"}
424N/A };
424N/A
424N/A #else
1068N/A@@ -188,10 +244,10 @@ char * path)
424N/A
424N/A for (i=0; i < numSections; i++) {
1179N/A snprintf(file, sizeof(file), "%s%s", SEARCHDIR, SectionNames[i].suffix);
424N/A- AddNewSection(list, path, file, SectionNames[i].name, TRUE);
424N/A+ AddNewSection(list, path, file, gettext(SectionNames[i].name), TRUE);
424N/A #ifdef SEARCHOTHER
1179N/A snprintf(file, sizeof(file), "%s%s", SEARCHOTHER, SectionNames[i].suffix);
424N/A- AddNewSection(list, path, file, SectionNames[i].name, TRUE);
424N/A+ AddNewSection(list, path, file, gettext(SectionNames[i].name), TRUE);
424N/A #endif
424N/A }
424N/A #endif
1068N/A@@ -252,7 +308,7 @@ char *path)
424N/A int flags = (int) *p++;
424N/A while (*p != NULL) {
1179N/A snprintf(file, sizeof(file), "%s%s", SEARCHDIR, *p++);
424N/A- AddNewSection(list, path, file, message, flags);
424N/A+ AddNewSection(list, path, file, gettext(message), flags);
424N/A }
424N/A p++;
424N/A }