diff options
author | Egbert Eich <eich@suse.de> | 2004-04-23 19:54:58 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2004-04-23 19:54:58 +0000 |
commit | 313f95249e4621b9002bdd054106b8b743ff64ae (patch) | |
tree | fac4c67fece1e7cf8b798b6c4ec2357b1ea6fbd2 | |
parent | 0b24854cbc017733d4e782db65912a473ec053be (diff) |
Merging XORG-CURRENT into trunkXACE-SELINUX-MERGE
-rw-r--r-- | ScrollByL.c | 279 | ||||
-rw-r--r-- | ScrollByL.h | 1 | ||||
-rw-r--r-- | ScrollByLP.h | 5 | ||||
-rw-r--r-- | buttons.c | 135 | ||||
-rw-r--r-- | defs.h | 2 | ||||
-rw-r--r-- | globals.h | 2 | ||||
-rw-r--r-- | handler.c | 134 | ||||
-rw-r--r-- | help.c | 6 | ||||
-rw-r--r-- | main.c | 33 | ||||
-rw-r--r-- | man.c | 216 | ||||
-rw-r--r-- | man.h | 28 | ||||
-rw-r--r-- | misc.c | 40 | ||||
-rw-r--r-- | search.c | 59 | ||||
-rw-r--r-- | tkfuncs.c | 2 | ||||
-rw-r--r-- | vendor.c | 2 | ||||
-rw-r--r-- | vendor.h | 6 | ||||
-rw-r--r-- | xman.help | 14 | ||||
-rw-r--r-- | xman.man | 129 |
18 files changed, 477 insertions, 616 deletions
diff --git a/ScrollByL.c b/ScrollByL.c index 02deca0..9f8c359 100644 --- a/ScrollByL.c +++ b/ScrollByL.c @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/ScrollByL.c,v 1.8 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/ScrollByL.c,v 1.6tsi Exp $ */ #if !defined(lint) && !defined(SABER) && 0 static char rcs_version[] = "$Athena: ScrollByL.c,v 4.5 88/12/19 13:46:04 kit Exp $"; @@ -50,7 +50,7 @@ from the X Consortium. /* Default Translation Table */ -static char defaultTranslations[] = +static char defaultTranslations[] = "<Key>f: Page(Forward) \n\ <Key>b: Page(Back) \n\ <Key>1: Page(Line, 1) \n\ @@ -59,7 +59,7 @@ static char defaultTranslations[] = <Key>4: Page(Line, 4) \n\ <Key>\\ : Page(Forward)"; - + /**************************************************************** * * ScrollByLine Resources @@ -79,8 +79,6 @@ static XtResource resources[] = { Offset(foreground), XtRString, "XtDefaultForeground"}, {XtNforceVert, XtCBoolean, XtRBoolean, sizeof(Boolean), Offset(force_vert), XtRImmediate, (caddr_t) FALSE}, - {XtNhalfLines, XtCBoolean, XtRBoolean, sizeof(Boolean), - Offset(half_lines), XtRImmediate, (caddr_t) FALSE}, {XtNindent, XtCIndent, XtRDimension, sizeof(Dimension), Offset(indent), XtRImmediate, (caddr_t) 15}, {XtNuseRight, XtCBoolean, XtRBoolean, sizeof(Boolean), @@ -138,11 +136,11 @@ ScrollByLineClassRec scrollByLineClassRec = { /* superclass */ (WidgetClass) superclass, /* class_name */ "ScrollByLine", /* widget_size */ sizeof(ScrollByLineRec), - /* class_initialize */ (XtProc)0, - /* class_part_init */ (XtWidgetClassProc)0, + /* class_initialize */ NULL, + /* class_part_init */ NULL, /* class_inited */ FALSE, /* initialize */ Initialize, - /* initialize_hook */ (XtArgsProc)0, + /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ actions, /* num_actions */ XtNumber(actions), @@ -156,30 +154,24 @@ ScrollByLineClassRec scrollByLineClassRec = { /* destroy */ Destroy, /* resize */ Layout, /* expose */ Redisplay, - /* set_values */ (XtSetValuesFunc)0, + /* set_values */ NULL, /* set_values_hook */ SetValuesHook, /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ (XtArgsProc)0, - /* accept_focus */ (XtAcceptFocusProc)0, + /* get_values_hook */ NULL, + /* accept_focus */ NULL, /* version */ XtVersion, - /* callback_private */ (XtPointer)0, + /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator*/ XtInheritDisplayAccelerator, - /* extension */ (XtPointer)0, + /* extension */ NULL, }, { /* simple fields */ /* change_sensitive */ XtInheritChangeSensitive -#ifndef OLDXAW - , 0 -#endif - }, - { - 0 } }; -WidgetClass scrollByLineWidgetClass = +WidgetClass scrollByLineWidgetClass = (WidgetClass) &scrollByLineClassRec; @@ -199,13 +191,13 @@ WidgetClass scrollByLineWidgetClass = static void Layout(Widget w) -{ +{ ScrollByLineWidget sblw = (ScrollByLineWidget) w; Dimension width, height; Widget bar; Position bar_bw; -/* +/* * For now always show the bar. */ @@ -233,7 +225,7 @@ Layout(Widget w) } /* ARGSUSED */ -static void +static void GExpose(Widget w, XtPointer junk, XEvent *event, Boolean *cont) { @@ -256,9 +248,9 @@ Redisplay(Widget w, XEvent *event, Region region) { int top, height; /* the locations of the top and height of the region that needs to be repainted. */ - + /* - * This routine tells the client which sections of the window to + * This routine tells the client which sections of the window to * repaint in his callback function which does the actual repainting. */ @@ -270,7 +262,7 @@ Redisplay(Widget w, XEvent *event, Region region) top = event->xgraphicsexpose.y; height = event->xgraphicsexpose.height; } - + PaintText(w, top, height); } /* redisplay (expose) */ @@ -291,20 +283,20 @@ PaintText(Widget w, int y_loc, int height) if (start_line >= sblw->scroll.lines) return; - + num_lines = height / sblw->scroll.font_height + 1; /* - * Only integer arithmetic makes this possible. + * Only integer arithmetic makes this possible. */ location = y_loc / sblw->scroll.font_height * sblw->scroll.font_height; PrintText(w, start_line, num_lines, location); -} +} /* Function Name: Page - * Description: This function pages the widget, by the amount it receives + * Description: This function pages the widget, by the amount it recieves * from the translation Manager. * Arguments: w - the ScrollByLineWidget. * event - the event that caused this return. @@ -314,7 +306,7 @@ PaintText(Widget w, int y_loc, int height) */ /* ARGSUSED */ -static void +static void Page(Widget w, XEvent * event, String * params, Cardinal *num_params) { ScrollByLineWidget sblw = (ScrollByLineWidget) w; @@ -324,7 +316,7 @@ Page(Widget w, XEvent * event, String * params, Cardinal *num_params) return; /* * If no scroll bar is visible then do not page, as the entire window is shown, - * of scrolling has been turned off. + * of scrolling has been turned off. */ if (bar == (Widget) NULL) @@ -344,7 +336,7 @@ Page(Widget w, XEvent * event, String * params, Cardinal *num_params) case 'L': case 'l': /* move one line forward */ - VerticalScroll(bar, NULL, + VerticalScroll(bar, NULL, (XtPointer)((long) atoi(params[1]) * sblw->scroll.font_height)); break; default: @@ -353,7 +345,7 @@ Page(Widget w, XEvent * event, String * params, Cardinal *num_params) } /* Function Name: CreateScrollbar - * Description: creates the scrollbar for us. + * Description: createst the scrollbar for us. * Arguments: w - sblw widget. * Returns: none. */ @@ -365,22 +357,22 @@ CreateScrollbar(Widget w) Arg args[5]; Cardinal num_args = 0; - if (sblw->scroll.bar != NULL) + if (sblw->scroll.bar != NULL) return; XtSetArg(args[num_args], XtNorientation, XtorientVertical); num_args++; - - sblw->scroll.bar = XtCreateWidget("scrollbar", scrollbarWidgetClass, w, + + sblw->scroll.bar = XtCreateWidget("scrollbar", scrollbarWidgetClass, w, args, num_args); XtAddCallback(sblw->scroll.bar, XtNscrollProc, VerticalScroll, NULL); - XtAddCallback(sblw->scroll.bar, XtNjumpProc, VerticalJump, NULL); + XtAddCallback(sblw->scroll.bar, XtNjumpProc, VerticalJump, NULL); } /* Function Name: ScrollVerticalText * Description: This accomplished the actual movement of the text. * Arguments: w - the ScrollByLine Widget. * new_line - the new location for the line pointer - * force_redisplay - should we force this window to get + * force_redisplay - should we force this window to get * redisplayed? * Returns: True if the thumb needs to be moved. */ @@ -414,14 +406,14 @@ Boolean force_redisp) } } -/* +/* * If forced to redisplay then do a full redisplay and return. */ - old_line = sblw->scroll.line_pointer; + old_line = sblw->scroll.line_pointer; sblw->scroll.line_pointer = new_line; /* Set current top of page. */ - if (force_redisp) + if (force_redisp) MoveAndClearText(w, 0, /* cause a full redisplay */ 0, 0); if (new_line == old_line) @@ -436,7 +428,7 @@ Boolean force_redisp) MoveAndClearText(w, 0, num_lines - lines_to_scroll, lines_to_scroll); } -/* +/* * Scroll back. */ @@ -457,7 +449,7 @@ Boolean force_redisp) * new_y - new y position. * Returns: none */ - + static void MoveAndClearText(Widget w, int old_y, int height, int new_y) { @@ -478,8 +470,8 @@ MoveAndClearText(Widget w, int old_y, int height, int new_y) */ if (height <= sblw->scroll.font_height) { /* avoid rounding errors. */ - XClearArea( XtDisplay(w), XtWindow(w), from_left, 0, - (unsigned int) 0, (unsigned int) 0, FALSE); + XClearArea( XtDisplay(w), XtWindow(w), from_left, 0, + (unsigned int) 0, (unsigned int) 0, FALSE); PaintText(w, 0, (int) sblw->core.height); return; } @@ -488,14 +480,14 @@ MoveAndClearText(Widget w, int old_y, int height, int new_y) height = w->core.height - old_y; XCopyArea(XtDisplay(w), XtWindow(w), XtWindow(w), sblw->scroll.move_gc, - from_left, old_y, + from_left, old_y, (unsigned int) w->core.width - from_left, (unsigned int) height, from_left, new_y); if (old_y > new_y) height -= sblw->scroll.font_height/2; /* clear 1/2 font of extra space, to make sure we don't lose or - gain descenders. */ + gain decenders. */ else height -= sblw->scroll.font_height; /* clear 1 font of extra space, to make sure we don't overwrite @@ -505,7 +497,7 @@ MoveAndClearText(Widget w, int old_y, int height, int new_y) y_clear = height; else y_clear = 0; - + /* * We cannot use generate exposures, since that may allow another move and * clear before the area get repainted, this would be bad. @@ -532,7 +524,7 @@ SetThumbHeight(Widget w) if (sblw->scroll.bar == NULL) return; - if (sblw->scroll.lines == 0) + if (sblw->scroll.lines == 0) shown = 1.0; else shown = (float) w->core.height / (float) (sblw->scroll.lines * @@ -558,7 +550,7 @@ SetThumb(Widget w) if ( (sblw->scroll.lines == 0) || (sblw->scroll.bar == NULL) ) return; - location = (float) sblw->scroll.line_pointer / (float) sblw->scroll.lines; + location = (float) sblw->scroll.line_pointer / (float) sblw->scroll.lines; XawScrollbarSetThumb( sblw->scroll.bar, location , (float) -1 ); } @@ -609,7 +601,7 @@ VerticalScroll(Widget w, XtPointer client_data, XtPointer call_data) int h_width; /* main font width */ /* ARGSUSED */ -static void +static void Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args) { ScrollByLineWidget sblw = (ScrollByLineWidget) new; @@ -621,8 +613,8 @@ Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args) LoadFile(new); sblw->scroll.bar = (Widget) NULL; - sblw->scroll.font_height = (sblw->scroll.normal_font->max_bounds.ascent + - sblw->scroll.normal_font->max_bounds.descent); + sblw->scroll.font_height = (sblw->scroll.normal_font->max_bounds.ascent + + sblw->scroll.normal_font->max_bounds.descent); atomNum = XInternAtom(XtDisplay(req), "FIGURE_WIDTH", False); @@ -636,7 +628,7 @@ Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args) } /* Initialize. */ /* Function Name: CreateGCs - * Description: Creates the graphics contexts that we need. + * Description: Creates the graphics contexts that we need. * Arguments: w - the sblw. * Returns: none */ @@ -654,7 +646,7 @@ CreateGCs(Widget w) mask = GCForeground | GCFont; values.foreground = sblw->scroll.foreground; - + values.font = sblw->scroll.normal_font->fid; sblw->scroll.normal_gc = XtGetGC(w, mask, &values); @@ -725,11 +717,11 @@ Destroy(Widget w) */ /* ARGSUSED */ -static Boolean +static Boolean SetValuesHook(Widget w, ArgList args, Cardinal *num_args) { Boolean ret = TRUE; - Cardinal i; + int i; for (i = 0; i < *num_args; i++) { if (strcmp(XtNfile, args[i].name) == 0) { @@ -739,7 +731,7 @@ SetValuesHook(Widget w, ArgList args, Cardinal *num_args) } /* - * Changing anything else will have strange effects, I don't need it so + * Changing anthing else will have strange effects, I don't need it so * I didn't code it. */ @@ -747,27 +739,27 @@ SetValuesHook(Widget w, ArgList args, Cardinal *num_args) } /* Set Values */ -/* - * A little design philosophy is probably wise to include at this point. +/* + * A little design philosophy is probabally wise to include at this point. * - * One of the things that I had hoped to achieve with xman was to make the - * viewing of manpage not only easy for the naive user, but also fast for + * One of the things that I has hoped to achieve with xman is to make the + * viewing of manpage not only easy for the nieve user, but also fast for * the experienced user, I wanted to be able to use it too. To achieve this - * I ended up sacrificing a bit of startup time for the manual data structure. - * As well as, the overhead of reading the entire file before putting it up + * I end up sacrificing a bit of start up time for the manual data structure. + * As well as, the overhead of reading the entire file before putting it up * on the display. This is actually hardly even noticeable since most manual * pages are shots, one to two pages - the notable exception is of course csh, - * but then that should be broken up anyway. + * but then that should be broken up anyway. * * METHOD: * * I allocate a chunk of space that is the size of the file, plus a null for - * debugging. Then copies the file into this chunk of memory. I then allocate + * debugging. Then copiesthe file into this chunk of memory. I then allocate * an array of char*'s that are assigned to the beginning of each line. Yes, - * this means that I have to read the file twice, and could probably be more + * this means that I have to read the file twice, and could probabally be more * clever about it, but once it is in memory the second read is damn fast. - * There are a few obscurities here about guessing the number of lines and - * realloc'ing if I guess wrong, but other than that it is pretty straight + * There are a few obsucrities here about guessing the number of lines and + * reallocing if I guess wrong, but other than that it is pretty straight * forward. * * Chris Peterson @@ -790,9 +782,9 @@ LoadFile(Widget w) FILE * file = sblw->scroll.file; char *page; - char **line_pointer,**top_line; /* pointers to beginnings of the + char **line_pointer,**top_line; /* pointers to beginnings of the lines of the file. */ - unsigned nlines; /* the current number of allocated lines. */ + int nlines; /* the current number of allocated lines. */ struct stat fileinfo; /* file information from fstat. */ if ( sblw->scroll.top_line != NULL) { @@ -805,30 +797,30 @@ LoadFile(Widget w) return; /* - * Get file size and allocate a chunk of memory for the file to be + * Get file size and allocate a chunk of memory for the file to be * copied into. */ if (fstat(fileno(file), &fileinfo)) - XtAppError(XtWidgetToApplicationContext(w), + XtAppError(XtWidgetToApplicationContext(w), "SBLW LoadFile: Failure in fstat."); -/* +/* * Allocate a space for a list of pointer to the beginning of each line. */ if ( (nlines = fileinfo.st_size/CHAR_PER_LINE) == 0) return; - page = XtMalloc((unsigned)fileinfo.st_size + 1); /* leave space for the NULL */ + page = XtMalloc(fileinfo.st_size + 1); /* leave space for the NULL */ top_line = line_pointer = (char**) XtMalloc( nlines * sizeof(char *) ); /* - * Copy the file into memory. + * Copy the file into memory. */ if (fread(page, sizeof(char), fileinfo.st_size, file) == 0) - XtAppError(XtWidgetToApplicationContext(w), + XtAppError(XtWidgetToApplicationContext(w), "SBLW LoadFile: Failure in fread."); @@ -837,7 +829,7 @@ LoadFile(Widget w) *(page + fileinfo.st_size) = '\0'; /* - * Go through the file setting a line pointer to the character after each + * Go through the file setting a line pointer to the character after each * new line. If we run out of line pointer space then realloc that space * with space for more lines. */ @@ -857,7 +849,7 @@ LoadFile(Widget w) } page++; } - + /* * Realloc the line pointer space to take only the minimum amount of memory */ @@ -876,7 +868,7 @@ LoadFile(Widget w) } #define NLINES 66 /* This is the number of lines to wait until - we boldify the line again, this allows + we boldify the line again, this allows me to bold the first line of each page.*/ #define BACKSPACE 010 /* I doubt you would want to change this. */ @@ -890,8 +882,6 @@ LoadFile(Widget w) static int DumpText(Widget w, int x_loc, int y_loc, char * buf, int len, int format); static Boolean Boldify(char *); -static int nonBlankText (char *); -static int sameLine (char *, char *); /* Function Name: PrintText * Description: This function actually prints the text. @@ -913,10 +903,8 @@ PrintText(Widget w, int start_line, int num_lines, int location) int current_line; /* the number of the currrent line */ char buf[BUFSIZ]; /* Misc. characters */ Boolean italicflag = FALSE; /* Print text in italics?? */ - Boolean first; /* First line of a manual page??? */ + Boolean first = TRUE; /* First line of a manual page??? */ int x_loc, y_loc; /* x and y location of text. */ - int left_margin = sblw->scroll.offset + sblw->scroll.indent; - char *refline = NULL; /* * For table hack @@ -957,44 +945,27 @@ PrintText(Widget w, int start_line, int num_lines, int location) bufp = buf; - x_loc = left_margin; + x_loc = sblw->scroll.offset + sblw->scroll.indent; h_col = 0; - - if (sblw->scroll.half_lines) { - /* - * A better fix: determine the first nonblank line in the file, and use - * that as a reference for the header-line. Note that this assumes that - * page numbering is in the footer, and that there aren't coincidental - * matches against the header-line. - */ - for (h_fix = 0; (h_fix < NLINES) && (h_fix < sblw->scroll.lines); h_fix++) { - if (nonBlankText(sblw->scroll.top_line[h_fix])) { - refline = sblw->scroll.top_line[h_fix]; - break; - } + +/* + * A fix: + * Assume that we are always starting to print on or before the + * first line of a page, and then prove it if we aren't. + */ + for (h_fix = 1; h_fix <= (start_line % NLINES); h_fix++) + if (**(sblw->scroll.top_line + start_line - h_fix) != '\n') + { + first = FALSE; + break; } - first = sameLine(c, refline); - } else { - /* - * A fix: - * Assume that we are always starting to print on or before the - * first line of a page, and then prove it if we aren't. - */ - first = TRUE; - for (h_fix = 1; h_fix <= (start_line % NLINES); h_fix++) - if (**(sblw->scroll.top_line + start_line - h_fix) != '\n') { - first = FALSE; - break; - } - } while(TRUE) { - if (!sblw->scroll.half_lines - && current_line % NLINES == 0) + if (current_line % NLINES == 0) first = TRUE; -/* - * Let's make sure that we do not run out of space in our buffer. Making full +/* + * Lets make sure that we do not run out of space in our buffer, making full * use of it is not critical since no window will be wide enough to display * nearly BUFSIZ characters. */ @@ -1013,33 +984,32 @@ PrintText(Widget w, int start_line, int num_lines, int location) if (bufp != buf) { Boolean bold; *bufp = '\0'; /* for Boldify. */ - bold = ( (first) || ((x_loc == left_margin) && Boldify(buf)) ); + bold = ( (first) || ((x_loc == (sblw->scroll.offset + + sblw->scroll.indent)) && Boldify(buf)) ); (void) DumpText(w, x_loc, y_loc, buf, bufp - buf, WHICH(italicflag, bold)); - if (!sblw->scroll.half_lines && bold) + + if (bold) first = FALSE; } - if (sblw->scroll.half_lines) - first = sameLine(c+1, refline); - -/* +/* * If we have painted the required number of lines then we should now return. */ - if (++current_line == start_line + num_lines ) + if (++current_line == start_line + num_lines ) return; bufp = buf; italicflag = FALSE; - x_loc = left_margin; + x_loc = sblw->scroll.offset + sblw->scroll.indent; h_col = 0; y_loc += sblw->scroll.font_height; break; /* * This tab handling code is not very clever it moves the cursor over - * to the next boundary of eight (8) spaces, as calculated in width just + * to the next boundry of eight (8) spaces, as calculated in width just * before the printing loop started. */ @@ -1047,9 +1017,9 @@ PrintText(Widget w, int start_line, int num_lines, int location) x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, WHICH(italicflag, first)); h_col += bufp - buf; - bufp = buf; + bufp = buf; italicflag = FALSE; - x_loc = left_margin; + x_loc = sblw->scroll.offset + sblw->scroll.indent; h_col = h_col + 8 - (h_col%8); x_loc += h_width * h_col; break; @@ -1067,12 +1037,12 @@ PrintText(Widget w, int start_line, int num_lines, int location) x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, WHICH(italicflag, first)); h_col += bufp - buf; - bufp = buf; + bufp = buf; italicflag = FALSE; - x_loc = left_margin; + x_loc = sblw->scroll.offset + sblw->scroll.indent; h_col += (h_c - c); - x_loc += h_width * h_col; + x_loc += h_width * h_col; c = h_c - 1; break; @@ -1080,8 +1050,8 @@ PrintText(Widget w, int start_line, int num_lines, int location) c++; /* should always be esc-x */ break; -/* - * Overstrike code supplied by: cs.utexas.edu!ut-emx!clyde@rutgers.edu +/* + * Overstrike code supplied by: cs.utexas.edu!ut-emx!clyde@rutgers.edu * Since my manual pages do not have overstrike I couldn't test this. */ @@ -1136,7 +1106,7 @@ PrintText(Widget w, int start_line, int num_lines, int location) break; /* End of contributed overstrike code. */ - + case '_': /* look for underlining [italicize] */ if(*(c + 1) == BACKSPACE) { if(!italicflag) { /* font change? */ @@ -1208,7 +1178,7 @@ DumpText(Widget w, int x_loc, int y_loc, char * buf, int len, int format) gc = sblw->scroll.normal_gc; font = sblw->scroll.normal_font; break; - } + } XDrawString(XtDisplay(w), XtWindow(w), gc, x_loc, y_loc, buf, len); return(x_loc + XTextWidth(font, buf, len)); @@ -1226,50 +1196,17 @@ Boldify(register char *sp) register char *sp_pointer; int length,count; - if (isspace(*sp) || !*sp) /* ignore lines that are not left-margin'd */ - return(0); -/* +/* * If there are not lower case letters in the line the assume it is a * keyword and boldify it in PrintManpage. */ length = strlen(sp); - for (sp_pointer = sp, count = 0; count < length; sp_pointer++,count++) + for (sp_pointer = sp, count = 0; count < length; sp_pointer++,count++) if ( !isupper(*sp_pointer) && !isspace(*sp_pointer) ) return(0); return(1); } -/* - * Scans the line beginning at the given pointer, and returns its length if - * it contains nonblank characters. - */ -static int -nonBlankText(register char *sp) -{ - char *base = sp; - int any = FALSE; - - while (*sp != '\0' && *sp != '\n') { - if (!isspace(*sp)) - any = TRUE; - sp++; - } - return any ? (sp - base) : 0; -} - -static int -sameLine(char *cmp, char *ref) -{ - if (ref != NULL) { - while (*ref != '\0' && *ref != '\n') { - if (*cmp++ != *ref++) - return FALSE; - } - return TRUE; - } - return FALSE; -} - #undef superclass #undef SuperClass diff --git a/ScrollByL.h b/ScrollByL.h index dcbbd8e..cdf8e2e 100644 --- a/ScrollByL.h +++ b/ScrollByL.h @@ -56,7 +56,6 @@ from the X Consortium. #define XtNindent "indent" #define XtNforceVert "forceVert" -#define XtNhalfLines "halfLines" #define XtNmanualFontNormal "manualFontNormal" #define XtNmanualFontBold "manualFontBold" #define XtNmanualFontItalic "manualFontItalic" diff --git a/ScrollByLP.h b/ScrollByLP.h index 2d1c251..0947707 100644 --- a/ScrollByLP.h +++ b/ScrollByLP.h @@ -59,9 +59,8 @@ extern ScrollByLineClassRec scrollByLineClassRec; /* New fields for the ScrollByLine widget record */ typedef struct _ScrollByLinePart { - Pixel foreground; /* The color for the foreground of the text. */ - Boolean force_vert, /* Must have scrollbar visible */ - half_lines, /* adjust for half-line spacing */ + Pixel foreground; /* The color for the forground of the text. */ + Boolean force_vert, /* Must have scrollbar visable */ use_right; /* put scroll bar on right side of window. */ FILE * file; /* The file to display. */ Dimension indent; /* amount to indent the file. */ @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/buttons.c,v 1.5 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/buttons.c,v 1.3 2000/03/03 23:16:26 dawes Exp $ */ /* * xman - X window system manual page display program. @@ -75,12 +75,12 @@ MakeTopBox(void) static char * half_size[] = { HELP_BUTTON, QUIT_BUTTON, NULL }; - + /* create the top icon. */ num_args = 0; XtSetArg(arglist[num_args], XtNiconPixmap, - XCreateBitmapFromData( XtDisplay(initial_widget), + XCreateBitmapFromData( XtDisplay(initial_widget), XtScreen(initial_widget)->root, (char *)iconclosed_bits, iconclosed_width, iconclosed_height)); @@ -89,28 +89,28 @@ MakeTopBox(void) num_args++; XtSetArg(arglist[num_args], XtNiconic, resources.iconic); num_args++; - top = XtCreatePopupShell(TOPBOXNAME, topLevelShellWidgetClass, + top = XtCreatePopupShell(TOPBOXNAME, topLevelShellWidgetClass, initial_widget, arglist, num_args); - form = XtCreateManagedWidget("form", formWidgetClass, top, + form = XtCreateManagedWidget("form", formWidgetClass, top, NULL, (Cardinal) 0); - label = XtCreateManagedWidget("topLabel", labelWidgetClass, form, + label = XtCreateManagedWidget("topLabel", labelWidgetClass, form, NULL, (Cardinal) 0); num_args = 0; XtSetArg(arglist[num_args], XtNfromVert, label); num_args++; - command = XtCreateManagedWidget(HELP_BUTTON, commandWidgetClass, form, + command = XtCreateManagedWidget(HELP_BUTTON, commandWidgetClass, form, arglist, num_args); /* use same vertical as help widget. */ XtSetArg(arglist[num_args], XtNfromHoriz, command); num_args++; - command = XtCreateManagedWidget(QUIT_BUTTON, commandWidgetClass, form, + command = XtCreateManagedWidget(QUIT_BUTTON, commandWidgetClass, form, arglist, num_args); num_args = 0; XtSetArg(arglist[num_args], XtNfromVert, command); num_args++; - command = XtCreateManagedWidget(MANPAGE_BUTTON, commandWidgetClass, form, + command = XtCreateManagedWidget(MANPAGE_BUTTON, commandWidgetClass, form, arglist, num_args); help_widget = NULL; /* We have not seen the help yet. */ @@ -121,7 +121,13 @@ MakeTopBox(void) /* add WM_COMMAND property */ XSetCommand(XtDisplay(top), XtWindow(top), saved_argv, saved_argc); - man_globals = (ManpageGlobals*) XtCalloc(1, (Cardinal) sizeof(ManpageGlobals)); + man_globals = (ManpageGlobals*) XtMalloc( (Cardinal) sizeof(ManpageGlobals)); + man_globals->label = NULL; + man_globals->search_widget = NULL; + man_globals->manpagewidgets.directory = NULL; + man_globals->manpagewidgets.manpage = NULL; + man_globals->manpagewidgets.box = NULL; + man_globals->current_directory = 0; MakeSearchWidget(man_globals, top); MakeSaveWidgets(man_globals, top); @@ -136,7 +142,7 @@ MakeTopBox(void) (top, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()")); (void) XSetWMProtocols (XtDisplay(top), XtWindow(top), &wm_delete_window, 1); - + } @@ -149,11 +155,11 @@ MakeTopBox(void) Widget CreateManpage(FILE * file) { - ManpageGlobals * man_globals; /* The pseudo global structure. */ + ManpageGlobals * man_globals; /* The psuedo global structure. */ man_globals = InitPsuedoGlobals(); CreateManpageWidget(man_globals, MANNAME, TRUE); - + if (file == NULL) StartManpage( man_globals, OpenHelpfile(man_globals), FALSE ); else { @@ -164,34 +170,36 @@ CreateManpage(FILE * file) } /* Function Name: InitPsuedoGlobals - * Description: Initializes the pseudo global variables. + * Description: Initializes the psuedo global variables. * Arguments: none. * Returns: a pointer to a new pseudo globals structure. */ -ManpageGlobals * +ManpageGlobals * InitPsuedoGlobals(void) { ManpageGlobals * man_globals; /* - * Allocate necessary memory. + * Allocate necessary memory. */ - man_globals = (ManpageGlobals *) XtCalloc(1, sizeof(ManpageGlobals)); + man_globals = (ManpageGlobals *) + XtMalloc( (Cardinal) sizeof(ManpageGlobals)); - man_globals->section_name = (char **) XtCalloc(1, (Cardinal) (sections * + man_globals->search_widget = NULL; + man_globals->section_name = (char **) XtMalloc( (Cardinal) (sections * sizeof(char *))); man_globals->manpagewidgets.box = (Widget *) XtCalloc( (Cardinal) sections, (Cardinal) sizeof(Widget)); - + /* Initialize the number of screens that will be shown */ man_globals->both_shown = resources.both_shown_initial; - + return(man_globals); } - + /* Function Name: CreateManpageWidget * Description: Creates a new manual page widget. * Arguments: man_globals - a new man_globals structure. @@ -217,9 +225,9 @@ Boolean full_instance) num_args = (Cardinal) 0; XtSetArg(arglist[num_args], XtNwidth, default_width); - num_args++; + num_args++; XtSetArg(arglist[num_args], XtNheight, default_height); - num_args++; + num_args++; mytop = XtCreatePopupShell(name, topLevelShellWidgetClass, initial_widget, arglist, num_args); @@ -231,7 +239,7 @@ Boolean full_instance) XCreateBitmapFromData( XtDisplay(mytop), XtScreen(mytop)->root, (char *)icon_open_bits, icon_open_width, icon_open_height)); - else + else XtSetArg(arglist[num_args], XtNiconPixmap, XCreateBitmapFromData( XtDisplay(mytop), XtScreen(mytop)->root, (char *)icon_help_bits, icon_help_width, @@ -239,7 +247,7 @@ Boolean full_instance) num_args++; XtSetValues(mytop, arglist, num_args); - pane = XtCreateManagedWidget("Manpage_Vpane", panedWidgetClass, mytop, NULL, + pane = XtCreateManagedWidget("vertPane", panedWidgetClass, mytop, NULL, (Cardinal) 0); /* Create menu bar. */ @@ -266,7 +274,7 @@ Boolean full_instance) CreateSectionMenu(man_globals, mytop); MakeSaveWidgets(man_globals, mytop); } else { - XtSetSensitive(mysections, FALSE); + XtSetSensitive(mysections, FALSE); XtSetArg(arglist[0], XtNsensitive, FALSE); XtSetValues(man_globals->dir_entry, arglist, ONE); XtSetValues(man_globals->manpage_entry, arglist, ONE); @@ -284,13 +292,13 @@ Boolean full_instance) num_args = 0; XtSetArg(arglist[num_args], XtNallowVert, TRUE); num_args++; - + mpw->directory = XtCreateWidget(DIRECTORY_NAME, viewportWidgetClass, pane, arglist, num_args); - + man_globals->current_directory = INITIAL_DIR; MakeDirectoryBox(man_globals, mpw->directory, - mpw->box + man_globals->current_directory, + mpw->box + man_globals->current_directory, man_globals->current_directory ); XtManageChild(mpw->box[man_globals->current_directory]); } @@ -304,7 +312,7 @@ Boolean full_instance) /* Function Name: StartManpage * Description: Starts up a new manpage. - * Arguments: man_globals - the pseudo globals variable. + * Arguments: man_globals - the psuedo globals variable. * help - is this a help file? * page - Is there a page to display? * Returns: none. @@ -315,14 +323,15 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page) { Widget dir = man_globals->manpagewidgets.directory; Widget manpage = man_globals->manpagewidgets.manpage; + Widget label = man_globals->label; Arg arglist[1]; -/* +/* * If there is a helpfile then put up both screens if both_show is set. */ if (page || help) { - if (help) + if (help) strcpy(man_globals->manpage_title, "Xman Help"); if (man_globals->both_shown) { @@ -338,10 +347,11 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page) XtSetArg(arglist[0], XtNlabel, SHOW_ONE); XtSetValues(man_globals->both_screens_entry, arglist, ONE); - ShowDirTitle(man_globals,man_globals->current_directory); + ChangeLabel(label, + man_globals->section_name[man_globals->current_directory]); } else { - ShowManTitle(man_globals); + ChangeLabel(label,man_globals->manpage_title); } XtManageChild(manpage); man_globals->dir_shown = FALSE; @@ -350,7 +360,7 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page) * Since There is file to display, put up directory and do not allow change * to manpage, show both, or help. */ - else { + else { XtManageChild(dir); man_globals->dir_shown = TRUE; XtSetArg(arglist[0], XtNsensitive, FALSE); @@ -358,7 +368,8 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page) XtSetValues(man_globals->help_entry, arglist, ONE); XtSetValues(man_globals->both_screens_entry, arglist, ONE); man_globals->both_shown = FALSE; - ShowDirTitle(man_globals, man_globals->current_directory); + ChangeLabel(label, + man_globals->section_name[man_globals->current_directory]); } /* @@ -381,7 +392,7 @@ StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page) * Set up ICCCM delete window. */ XtOverrideTranslations - (man_globals->This_Manpage, + (man_globals->This_Manpage, XtParseTranslationTable ("<Message>WM_PROTOCOLS: RemoveThisManpage()")); (void) XSetWMProtocols (XtDisplay(man_globals->This_Manpage), XtWindow(man_globals->This_Manpage), @@ -421,7 +432,7 @@ CreateOptionMenu(ManpageGlobals * man_globals, Widget parent) MANPAGE, HELP, SEARCH, - BOTH_SCREENS, + BOTH_SCREENS, REMOVE_MANPAGE, OPEN_MANPAGE, SHOW_VERSION, @@ -431,7 +442,7 @@ CreateOptionMenu(ManpageGlobals * man_globals, Widget parent) menu = XtCreatePopupShell(OPTION_MENU, simpleMenuWidgetClass, parent, NULL, (Cardinal) 0); man_globals->option_menu = menu; - + for (i = 0 ; i < NUM_OPTIONS ; i++) { entry = XtCreateManagedWidget(option_names[i], smeBSBObjectClass, menu, NULL, ZERO); @@ -494,10 +505,10 @@ CreateSectionMenu(ManpageGlobals * man_globals, Widget parent) num_args = 0; XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++; sprintf(entry_name, "section%d", i); - + entry = XtCreateManagedWidget(entry_name, smeBSBObjectClass, menu, args, num_args); - menu_struct = (MenuStruct *) XtCalloc(1,sizeof(MenuStruct)); + menu_struct = (MenuStruct *) XtMalloc(sizeof(MenuStruct)); menu_struct->data = (caddr_t) man_globals; menu_struct->number = i; XtAddCallback(entry, XtNcallback, DirPopupCallback, (caddr_t) menu_struct); @@ -518,21 +529,21 @@ CreateList(int section) char ** ret_list, **current; int count; - ret_list = (char **) XtMalloc( (unsigned)(manual[section].nentries + 1) * + ret_list = (char **) XtMalloc( (manual[section].nentries + 1) * sizeof (char *)); for (current = ret_list, count = 0 ; count < manual[section].nentries ; count++, current++) *current = CreateManpageName(manual[section].entries[count], section, manual[section].flags); - + *current = NULL; /* NULL terminate the list. */ return(ret_list); } /* Function Name: MakeDirectoryBox * Description: make a directory box. - * Arguments: man_globals - the pseudo global structure for each manpage. + * Arguments: man_globals - the psuedo global structure for each manpage. * parent - this guys parent widget. * dir_disp - the directory display widget. * section - the section number. @@ -558,18 +569,18 @@ MakeDirectoryBox(ManpageGlobals *man_globals, Widget parent, Widget *dir_disp, i num_args++; XtSetArg(arglist[num_args], XtNfont, resources.fonts.directory); num_args++; - + *dir_disp = XtCreateWidget(DIRECTORY_NAME, listWidgetClass, parent, arglist, num_args); - + XtAddCallback(*dir_disp, XtNcallback, DirectoryHandler, (caddr_t) man_globals); } /* Function Name: MakeSaveWidgets. - * Description: This functions creates two popup widgets, the please + * Description: This functions creates two popup widgets, the please * standby widget and the would you like to save widget. - * Arguments: man_globals - the pseudo globals structure for each man page + * Arguments: man_globals - the psuedo globals structure for each man page * parent - the realized parent for both popups. * Returns: none. */ @@ -588,14 +599,14 @@ MakeSaveWidgets(ManpageGlobals *man_globals, Widget parent) shell = XtCreatePopupShell( "pleaseStandBy", transientShellWidgetClass, parent, warg, (Cardinal) n); - man_globals->standby = XtCreateManagedWidget("label", labelWidgetClass, + man_globals->standby = XtCreateManagedWidget("label", labelWidgetClass, shell, NULL, (Cardinal) 0); man_globals->save = XtCreatePopupShell("likeToSave", transientShellWidgetClass, parent, warg, n); - dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, + dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, man_globals->save, NULL, (Cardinal) 0); XawDialogAddButton(dialog, FILE_SAVE, NULL, NULL); @@ -624,10 +635,10 @@ FormUpWidgets(Widget parent, char ** full_size, char ** half_size) Dimension longest, length, b_width; int interior_dist; Arg arglist[2]; - + full_widgets = ConvertNamesToWidgets(parent, full_size); half_widgets = ConvertNamesToWidgets(parent, half_size); - + long_widget = NULL; longest = 0; XtSetArg(arglist[0], XtNwidth, &length); @@ -647,7 +658,7 @@ FormUpWidgets(Widget parent, char ** full_size, char ** half_size) } if (long_widget == (Widget) NULL) { /* Make sure we found one. */ - PopupWarning(GetGlobals(parent), + PopupWarning(GetGlobals(parent), "Could not find longest widget, aborting..."); XtFree((char *)full_widgets); XtFree((char *)half_widgets); @@ -664,7 +675,7 @@ FormUpWidgets(Widget parent, char ** full_size, char ** half_size) XtSetArg(arglist[0], XtNborderWidth, &border_width); XtGetValues(*temp, arglist, (Cardinal) 1); - + width = longest - 2 * border_width; XtSetArg(arglist[0], XtNwidth, width); XtSetValues(*temp, arglist, (Cardinal) 1); @@ -676,13 +687,13 @@ FormUpWidgets(Widget parent, char ** full_size, char ** half_size) XtSetArg(arglist[0], XtNdefaultDistance, &interior_dist); XtGetValues(parent, arglist, (Cardinal) 1); - + for ( temp = half_widgets ; *temp != (Widget) NULL ; temp++) { Dimension width, border_width; XtSetArg(arglist[0], XtNborderWidth, &border_width); XtGetValues(*temp, arglist, (Cardinal) 1); - + width = (int)(longest - interior_dist)/2 - 2 * border_width; XtSetArg(arglist[0], XtNwidth, width); XtSetValues(*temp, arglist, (Cardinal) 1); @@ -691,9 +702,9 @@ FormUpWidgets(Widget parent, char ** full_size, char ** half_size) XtFree((char *)full_widgets); XtFree((char *)half_widgets); } - + /* Function Name: ConvertNamesToWidgets - * Description: Converts a list of names into a list of widgets. + * Description: Convers a list of names into a list of widgets. * Arguments: parent - the common parent of these widgets. * names - an array of widget names. * Returns: an array of widget id's. @@ -704,25 +715,25 @@ ConvertNamesToWidgets(Widget parent, char ** names) { char ** temp; Widget * ids, * temp_ids; - unsigned count; + int count; for (count = 0, temp = names; *temp != NULL ; count++, temp++); ids = (Widget *) XtMalloc( (count + 1) * sizeof(Widget)); - + for ( temp_ids = ids; *names != NULL ; names++, temp_ids++) { *temp_ids = XtNameToWidget(parent, *names); if (*temp_ids == NULL) { char error_buf[BUFSIZ]; - + sprintf(error_buf, "Could not find widget named '%s'", *names); PrintError(error_buf); XtFree((char *)ids); return(NULL); } } - + *temp_ids = (Widget) NULL; return(ids); } @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/defs.h,v 1.3 2001/04/19 19:54:51 dawes Exp $ */ +/* $XFree86: xc/programs/xman/defs.h,v 1.2 2000/03/03 23:16:26 dawes Exp $ */ /* * xman - X window system manual page display program. @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/globals.h,v 1.3 2000/03/03 23:16:26 dawes Exp $ */ +/* $XFree86$ */ #include "man.h" @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/handler.c,v 1.8 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/handler.c,v 1.6 2003/01/19 04:44:45 paulo Exp $ */ /* * xman - X window system manual page display program. @@ -46,8 +46,8 @@ static void ToggleBothShownState(ManpageGlobals * man_globals); /* Function Name: OptionCallback * Description: This is the callback function for the callback menu. - * Arguments: w - the widget we are calling back from. - * globals_pointer - a pointer to the pseudo globals structure + * Arguments: w - the widget we are calling back from. + * globals_pointer - a pointer to the psuedo globals structure * for this manpage. * junk - (call data) not used. * Returns: none. @@ -112,7 +112,7 @@ ToggleBothShownState(ManpageGlobals * man_globals) else { Widget manpage = man_globals->manpagewidgets.manpage; Widget dir = man_globals->manpagewidgets.directory; - + label_str = SHOW_ONE; XtSetArg(arglist[0], XtNpreferredPaneSize, resources.directory_height); @@ -125,15 +125,16 @@ ToggleBothShownState(ManpageGlobals * man_globals) XtManageChild(manpage); } man_globals->both_shown = !man_globals->both_shown; - + if (man_globals->dir_shown) - ShowDirTitle(man_globals,man_globals->current_directory); + ChangeLabel(man_globals->label, + man_globals->section_name[man_globals->current_directory]); else - ShowManTitle(man_globals); - + ChangeLabel(man_globals->label, man_globals->manpage_title); + XtSetArg(arglist[0], XtNlabel, label_str); XtSetValues(man_globals->both_screens_entry, arglist, ONE); - + /* if both are shown there is no need to switch between the two. */ XtSetArg(arglist[0], XtNsensitive, !man_globals->both_shown); @@ -148,7 +149,7 @@ ToggleBothShownState(ManpageGlobals * man_globals) * Returns: none */ -/* How far off the top of the widget to have the initial cursor position. */ +/* How far off the top of the widget to have the initial cursor postion. */ #define OFF_OF_TOP 25 @@ -169,7 +170,7 @@ Popup(Widget w, XtGrabKind grab_kind) /* Function Name: PutUpManpage * Description: Puts the manpage on the display. - * Arguments: man_globals - a pointer to the pseudo globals structure + * Arguments: man_globals - a pointer to the psuedo globals structure * for this manpage. * file - the file to display. * Returns: none. @@ -180,7 +181,7 @@ PutUpManpage(ManpageGlobals * man_globals, FILE * file) { String params = "ManualPage"; Cardinal num_params = 1; - + if (file == NULL) return; @@ -197,8 +198,8 @@ PutUpManpage(ManpageGlobals * man_globals, FILE * file) /* Function Name: DirectoryHandler * Description: This is the callback function for the directory listings. - * Arguments: w - the widget we are calling back from. - * global_pointer - the pointer to the pseudo global structure + * Arguments: w - the widget we are calling back from. + * global_pointer - the pointer to the psuedo global structure * associated with this manpage. * ret_val - return value from the list widget. * Returns: none. @@ -219,8 +220,8 @@ DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val) /* Function Name: DirPopupCallback * Description: This is the callback function for the callback menu. - * Arguments: w - the widget we are calling back from. - * pointer - a pointer to the pseudo globals structure + * Arguments: w - the widget we are calling back from. + * pointer - a pointer to the psuedo globals structure * for this manpage. * junk - (call data) not used. * Returns: none. @@ -230,7 +231,7 @@ DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val) void DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk) { - ManpageGlobals * man_globals; + ManpageGlobals * man_globals; MenuStruct * menu_struct; Widget parent; int number; @@ -243,7 +244,7 @@ DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk) current_box = man_globals->current_directory; /* We have used this guy, pop down the menu. */ - + if (number != current_box) { /* This is the only one that we know has a parent. */ parent = XtParent(man_globals->manpagewidgets.box[INITIAL_DIR]); @@ -254,7 +255,7 @@ DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk) XtManageChild(man_globals->manpagewidgets.box[number]); XawListUnhighlight(man_globals->manpagewidgets.box[current_box]); - ShowDirTitle(man_globals, number); + ChangeLabel(man_globals->label, man_globals->section_name[number]); man_globals->current_directory = number; } @@ -264,7 +265,7 @@ DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk) XtManageChild(man_globals->manpagewidgets.directory); } } - + /************************************************************ * * Action Routines. @@ -275,7 +276,7 @@ DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk) * Description: This is the action routine may save the manpage. * Arguments: w - any widget in the widget tree. * event - NOT USED. - * params, num_params - the parameters passed to the action + * params, num_params - the parameters paseed to the action * routine, can be either Manpage or * Directory. * Returns: none. @@ -289,7 +290,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para char cmdbuf[BUFSIZ], error_buf[BUFSIZ]; if (*num_params != 1) { - XtAppWarning(XtWidgetToApplicationContext(w), + XtAppWarning(XtWidgetToApplicationContext(w), "Xman - SaveFormattedPage: This action routine requires one argument."); return; } @@ -310,7 +311,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para if (!man_globals->compress) #endif - sprintf(cmdbuf, "%s %s %s", COPY, man_globals->tempfile, + sprintf(cmdbuf, "%s %s %s", COPY, man_globals->tempfile, man_globals->save_file); #ifndef NO_COMPRESS @@ -319,7 +320,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para sprintf(cmdbuf, "%s < %s > %s", GZIP_COMPRESS, man_globals->tempfile, man_globals->save_file); else - sprintf(cmdbuf, "%s < %s > %s", COMPRESS, man_globals->tempfile, + sprintf(cmdbuf, "%s < %s > %s", COMPRESS, man_globals->tempfile, man_globals->save_file); #endif @@ -346,10 +347,10 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para PopupWarning(man_globals, error_buf); return; } - + /* * We do not need the filename anymore, and have the fd open. - * We will unlink it. + * We will unlink it. */ unlink(man_globals->tempfile); @@ -361,7 +362,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_para * or directory. * Arguments: w - any widget in the widget tree. * event - NOT USED. - * params, num_params - the parameters passed to the action + * params, num_params - the parameters paseed to the action * routine, can be either Manpage or * Directory. * Returns: none. @@ -377,7 +378,7 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params) Boolean sensitive; if (*num_params != 1) { - XtAppWarning(XtWidgetToApplicationContext(w), + XtAppWarning(XtWidgetToApplicationContext(w), "Xman - GotoPage: This action routine requires one argument."); return; } @@ -385,7 +386,8 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params) man_globals = GetGlobals(w); if (man_globals->both_shown) { - ShowDirTitle(man_globals, man_globals->current_directory); + ChangeLabel(man_globals->label, + man_globals->section_name[man_globals->current_directory]); return; } @@ -395,7 +397,7 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params) XtSetArg(arglist[0], XtNsensitive, &sensitive); XtGetValues(man_globals->manpage_entry, arglist, ONE); if (sensitive) { - ShowManTitle(man_globals); + ChangeLabel(man_globals->label,man_globals->manpage_title); XtUnmanageChild(man_globals->manpagewidgets.directory); XtManageChild(man_globals->manpagewidgets.manpage); man_globals->dir_shown = FALSE; @@ -403,25 +405,10 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params) break; case 'D': case 'd': - ShowDirTitle(man_globals, man_globals->current_directory); + ChangeLabel(man_globals->label, + man_globals->section_name[man_globals->current_directory]); XtUnmanageChild(man_globals->manpagewidgets.manpage); - - /* - * GoPage(Directory) when the directory is already shown causes the layout - * to be toggled (i.e., whether the names are shown left-to-right or - * top-to-bottom). - */ - if (man_globals->dir_shown) { - Boolean toggle; - Widget dir = man_globals->manpagewidgets.box[man_globals->current_directory]; - XtSetArg(arglist[0], XtNverticalList, &toggle); - XtGetValues(dir, arglist, 1); - toggle = !toggle; - XtSetArg(arglist[0], XtNverticalList, toggle); - XtSetValues(dir, arglist, 1); - } - - XtManageChild(man_globals->manpagewidgets.directory); + XtManageChild(man_globals->manpagewidgets.directory); man_globals->dir_shown = TRUE; break; default: @@ -441,7 +428,7 @@ GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params) */ /*ARGSUSED*/ -void +void Quit(Widget w, XEvent * event, String * params, Cardinal * num_params) { XCloseDisplay(XtDisplay(w)); @@ -457,7 +444,7 @@ Quit(Widget w, XEvent * event, String * params, Cardinal * num_params) */ /*ARGSUSED*/ -void +void PopupHelp(Widget w, XEvent * event, String * params, Cardinal * num_params) { if (MakeHelpWidget()) @@ -473,7 +460,7 @@ PopupHelp(Widget w, XEvent * event, String * params, Cardinal * num_params) */ /*ARGSUSED*/ -void +void PopupSearch(Widget w, XEvent * event, String * params, Cardinal * num_params) { ManpageGlobals * man_globals = GetGlobals(w); @@ -496,7 +483,7 @@ PopupSearch(Widget w, XEvent * event, String * params, Cardinal * num_params) */ /*ARGSUSED*/ -void +void CreateNewManpage(Widget w, XEvent * event, String * params, Cardinal * num_params) { (void) CreateManpage(NULL); @@ -512,11 +499,11 @@ CreateNewManpage(Widget w, XEvent * event, String * params, Cardinal * num_param */ /*ARGSUSED*/ -void +void RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params) { ManpageGlobals * man_globals = GetGlobals(w); - + if (man_globals->This_Manpage != help_widget) { RemoveGlobals(man_globals->This_Manpage); XtDestroyWidget(man_globals->This_Manpage); @@ -526,7 +513,7 @@ RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_para XtFree( (char *) man_globals); if ( (--man_pages_shown) == 0) - Quit(w, NULL, NULL, NULL); + Quit(w, NULL, NULL, NULL); } else XtPopdown(help_widget); @@ -541,7 +528,7 @@ RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_para */ /*ARGSUSED*/ -void +void Search(Widget w, XEvent * event, String * params, Cardinal * num_params) { ManpageGlobals * man_globals = GetGlobals(w); @@ -550,7 +537,7 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params) XtPopdown( XtParent(XtParent(w)) ); /* popdown the search widget */ if ( (*num_params < 1) || (*num_params > 2) ) { - XtAppWarning(XtWidgetToApplicationContext(w), + XtAppWarning(XtWidgetToApplicationContext(w), "Xman - Search: This action routine requires one or two arguments."); return; } @@ -569,33 +556,33 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params) file = NULL; break; default: - XtAppWarning(XtWidgetToApplicationContext(w), + XtAppWarning(XtWidgetToApplicationContext(w), "Xman - Search: First parameter unknown."); file = NULL; break; } - if ( *num_params == 2 ) + if ( *num_params == 2 ) switch (params[1][0]) { case 'O': case 'o': if (file != NULL) { - Widget w2; + Widget w; char * label; - w2 = CreateManpage(file); + w = CreateManpage(file); man_pages_shown++; /* Put title into new manual page. */ label = man_globals->manpage_title; - man_globals = GetGlobals(w2); + man_globals = GetGlobals(w); strcpy(man_globals->manpage_title, label); - ShowManTitle(man_globals); + ChangeLabel(man_globals->label, label); } break; default: - XtAppWarning(XtWidgetToApplicationContext(w), + XtAppWarning(XtWidgetToApplicationContext(w), "Xman - Search: Second parameter unknown."); break; } @@ -615,26 +602,9 @@ Search(Widget w, XEvent * event, String * params, Cardinal * num_params) */ /*ARGSUSED*/ -void +void ShowVersion(Widget w, XEvent * event, String * params, Cardinal * num_params) { ManpageGlobals * man_globals = GetGlobals(w); ChangeLabel(man_globals->label, XMAN_VERSION); } - -void -ShowManTitle(ManpageGlobals *man_globals) -{ - ChangeLabel(man_globals->label, - man_globals->manpage_show_file - ? man_globals->manpage_file - : man_globals->manpage_title); - man_globals->manpage_show_file = !man_globals->manpage_show_file; -} - -void -ShowDirTitle(ManpageGlobals *man_globals, int number) -{ - ChangeLabel(man_globals->label, man_globals->section_name[number]); - man_globals->manpage_show_file = FALSE; -} @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/help.c,v 1.4 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86$ */ /* * xman - X window system manual page display program. @@ -51,7 +51,7 @@ Boolean MakeHelpWidget(void) { - ManpageGlobals * man_globals; /* The pseudo global structure. */ + ManpageGlobals * man_globals; /* The psuedo global structure. */ if (help_widget != NULL) /* If we already have a help widget. then do not create one. */ @@ -90,7 +90,7 @@ MakeHelpWidget(void) /* Function Name: OpenHelpfile * Description: opens the helpfile. - * Arguments: man_globals - the pseudo globals structure. + * Arguments: man_globals - the psuedo globals structure. * Returns: False if no helpfile was found. */ @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/main.c,v 1.5 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/main.c,v 1.3 2000/03/03 23:16:27 dawes Exp $ */ /* * xman - X window system manual page display program. @@ -37,7 +37,6 @@ from the X Consortium. */ #include "globals.h" -#include "vendor.h" #ifndef ZERO #include <X11/Xaw/Cardinals.h> #endif /* ZERO */ @@ -57,8 +56,8 @@ static XtResource my_resources[] = { {"bothShown", XtCBoolean, XtRBoolean, sizeof(Boolean), Offset(both_shown_initial), XtRString, "False"}, {"directoryHeight", "DirectoryHeight", XtRInt, sizeof(int), - Offset(directory_height), XtRString, "150"}, - {"topCursor", XtCCursor, XtRCursor, sizeof(Cursor), + Offset(directory_height), XtRString, "150"}, + {"topCursor", XtCCursor, XtRCursor, sizeof(Cursor), Offset(cursors.top), XtRString, XMAN_CURSOR}, {"helpCursor", XtCCursor, XtRCursor, sizeof(Cursor), Offset(cursors.help), XtRString, HELP_CURSOR}, @@ -78,8 +77,6 @@ static XtResource my_resources[] = { Offset(top_box_active), XtRString, "True"}, {"clearSearchString", "ClearSearchString", XtRBoolean, sizeof(Boolean), Offset(clear_search_string), XtRImmediate, (caddr_t) TRUE}, - {"formatCommand", XtCString, XtRString, sizeof(char *), - Offset(format_cmd), XtRString, FORMAT}, {"title", XtCString, XtRString, sizeof(char *), Offset(title), XtRString, "xman"}, {"iconic", XtCBoolean, XtRBoolean, sizeof(Boolean), @@ -115,7 +112,7 @@ static XrmOptionDescRec xman_options[] = { {"-notopbox", "topBox", XrmoptionNoArg, (caddr_t) "False"}, {"-helpfile", "helpFile", XrmoptionSepArg, (caddr_t) NULL}, {"-bothshown","bothShown", XrmoptionNoArg, (caddr_t) "True"}, -{"-title", "title", XrmoptionSepArg, (caddr_t) "xman"}, +{"-title", "title", XrmoptionSepArg, (caddr_t) "xman"}, {"-iconic", "iconic", XrmoptionNoArg, (caddr_t) "True"}, }; @@ -150,7 +147,7 @@ int main(int argc, char ** argv) XtAppContext app_con; saved_argc = argc; - saved_argv = (char **)XtMalloc((unsigned)argc * sizeof(char *)); + saved_argv = (char **)XtMalloc(argc * sizeof(char *)); bcopy(argv, saved_argv, argc * sizeof(char *)); XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); @@ -165,7 +162,7 @@ int main(int argc, char ** argv) AdjustDefResources(); - XtGetApplicationResources( initial_widget, (caddr_t) &resources, + XtGetApplicationResources( initial_widget, (caddr_t) &resources, my_resources, XtNumber(my_resources), NULL, (Cardinal) 0); @@ -192,7 +189,7 @@ int main(int argc, char ** argv) */ default_width = DEFAULT_WIDTH; - default_height=DisplayHeight(XtDisplay(initial_widget), + default_height=DisplayHeight(XtDisplay(initial_widget), DefaultScreen(XtDisplay(initial_widget))); default_height *= 3; default_height /= 4; @@ -200,8 +197,8 @@ int main(int argc, char ** argv) if ( (sections = Man()) == 0 ) PrintError("There are no manual sections to display, check your MANPATH."); - if (resources.top_box_active) - MakeTopBox(); + if (resources.top_box_active) + MakeTopBox(); else (void) CreateManpage(NULL); @@ -214,7 +211,7 @@ int main(int argc, char ** argv) * no top box is present. */ - man_pages_shown = 1; + man_pages_shown = 1; XtAppMainLoop(app_con); @@ -227,7 +224,7 @@ int main(int argc, char ** argv) * Returns: none. */ -static void +static void ArgError(int argc, char ** argv) { int i; @@ -256,12 +253,12 @@ ArgError(int argc, char ** argv) "-xrm <resource>", "Specifies a resource on the command line.", NULL, NULL, }; - + syntax = syntax_def; - for (i = 1; i < argc ; i++) + for (i = 1; i < argc ; i++) (void) printf("This argument is unknown to Xman: %s\n", argv[i]); - + (void) printf("\nKnown arguments are:\n"); while ( *syntax != NULL ) { @@ -281,7 +278,7 @@ static void AdjustDefResources(void) { char *xwinhome = NULL; - Cardinal i; + int i; if (!(xwinhome = getenv("XWINHOME"))) return; @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/man.c,v 1.9 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/man.c,v 1.7 2002/08/05 01:47:34 torrey Exp $ */ #include "globals.h" @@ -59,7 +59,7 @@ static void AddToCurrentSection(Manual * local_manual, char * path); static void InitManual(Manual * l_manual, char * label); static void ReadCurrentSection(Manual * local_manual, char * path); static void ReadMandescFile(SectionList ** section_list, char * path); -static void SortAndRemove(Manual *man, Cardinal number); +static void SortAndRemove(Manual *man, int number); static void SortList(SectionList ** list); #define SECT_ERROR -1 @@ -67,18 +67,18 @@ static void SortList(SectionList ** list); #ifndef Byte #define Byte unsigned char #endif - + #ifndef reg #define reg register #endif - + static void sortstrs (Byte *data[], int size, Byte *otherdata[]); static void sortstrs_block (Byte **, Byte **, int, Byte, Byte **, Byte **); static void sortstrs_block_oo (Byte **, Byte **, int, Byte, int *, int *, Byte **, Byte **); - + /* Function Name: Man * Description: Builds a list of all manual directories and files. - * Arguments: none. + * Arguments: none. * Returns: the number of manual sections. */ @@ -87,10 +87,9 @@ Man(void) { SectionList *list = NULL; char *ptr, *lang = 0, manpath[BUFSIZ], buf[BUFSIZ], *path, *current_label; - Cardinal sect; - unsigned num_alloced; + int sect, num_alloced; -/* +/* * Get the environment variable MANPATH, and if it doesn't exist then use * SYSMANPATH and LOCALMANPATH. */ @@ -125,7 +124,7 @@ Man(void) * open to look for manual pages. The ``mandesc'' file is read here. */ - for ( path = manpath ; (ptr = index(path , ':')) != NULL ; path = ++ptr) { + for ( path = manpath ; (ptr = index(path , ':')) != NULL ; path = ++ptr) { *ptr = '\0'; if (lang != 0) { strcpy(buf, path); @@ -146,7 +145,7 @@ Man(void) ReadMandescFile(&list, path); SortList(&list); - + sect = 0; num_alloced = SECTALLOC; manual = (Manual *) XtMalloc( sizeof(Manual) * num_alloced ); @@ -170,7 +169,7 @@ Man(void) num_alloced += SECTALLOC; manual = (Manual *) XtRealloc ( (char *) manual, (sizeof(Manual) * num_alloced)); - if (manual == NULL) + if (manual == NULL) PrintError("Could not allocate memory for manual sections."); } InitManual( manual + sect, list->label ); @@ -179,20 +178,20 @@ Man(void) AddToCurrentSection( manual + sect, list->directory); } /* Save label to see if it matches next entry. */ - current_label = list->label; + current_label = list->label; old_list = list; list = list->next; XtFree((char *) old_list); /* free what you allocate. */ } if (manual[sect].nentries != 0) sect++; /* don't forget that last section. */ - + SortAndRemove(manual, sect); #ifdef notdef /* dump info. */ DumpManual(sect); #endif - + /* * realloc manual to be minimum space necessary. */ @@ -200,11 +199,11 @@ Man(void) if (sect == 0) PrintError("No manual pages found."); manual = (Manual *) XtRealloc( (char *) manual, (sizeof(Manual) * sect)); - if (manual == NULL) + if (manual == NULL) PrintError("Could not allocate memory for manual sections."); return(sect); /* return the number of man sections. */ -} +} /* Function Name: SortList * Description: Sorts the list of sections to search. @@ -221,13 +220,13 @@ SortList(SectionList ** list) { SectionList * local; SectionList *head, *last, *inner, *old; - + if (*list == NULL) PrintError("No manual sections to read, exiting."); -/* - * First step - * +/* + * First step + * * Look for standard list items, and more them to the top of the list. */ @@ -239,8 +238,8 @@ SortList(SectionList ** list) head = local; /* Find end of standard block */ - for (old = 0 ; (local->next != NULL) && (local->flags) - ; old = local, local = local->next); + for (old = 0 ; (local->next != NULL) && (local->flags) + ; old = local, local = local->next); if (old != 0) { last->next = old->next; /* Move the block. */ @@ -282,16 +281,16 @@ SortList(SectionList ** list) inner = inner->next; } } -} +} /* Function Name: ReadMandescFile - * Description: Reads the mandesc file, and adds more sections as + * Description: Reads the mandesc file, and adds more sections as * nescessary. * Arguments: path - path name if the current search directory. * section_list - pointer to the list of sections. * Returns: TRUE in we should use default sections */ - + static void ReadMandescFile(SectionList ** section_list, char * path) { @@ -358,7 +357,7 @@ ReadMandescFile(SectionList ** section_list, char * path) void AddNewSection( SectionList **list, -char * path, char * file, char * label, +char * path, char * file, char * label, int flags) { SectionList * local_list, * end; @@ -372,7 +371,7 @@ int flags) for ( end = *list ; end->next != NULL ; end = end->next ); end->next = local_list; } - else + else *list = local_list; local_list->next = NULL; @@ -380,7 +379,7 @@ int flags) sprintf(full_path, "%s/%s", path, file); local_list->directory = StrAlloc(full_path); local_list->flags = flags; -} +} /* Function Name: AddToCurrentSection * Description: This function gets the names of the manual page @@ -405,7 +404,7 @@ AddToCurrentSection(Manual * local_manual, char * path) } /* Function Name: ReadCurrentSection - * Description: Actually does the work of adding entries to the + * Description: Actually does the work of adding entries to the * new section * Arguments: local_manual - a pointer to a manual pages structure. * path - the path to this directory. @@ -420,8 +419,8 @@ ReadCurrentSection(Manual * local_manual, char * path) register struct dirent *dp; - register unsigned nentries; - register unsigned nalloc; + register int nentries; + register int nalloc; char full_name[BUFSIZ], *ptr; if((dir = opendir(path)) == NULL) { @@ -438,7 +437,7 @@ ReadCurrentSection(Manual * local_manual, char * path) if ( (ptr = rindex(path, '.')) != NULL) { #if !defined(SCO) && !defined(ISC) - if (streq(ptr + 1, COMPRESSION_EXTENSION)) + if (streq(ptr + 1, COMPRESSION_EXTENSION)) #else if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL) #endif @@ -448,7 +447,7 @@ ReadCurrentSection(Manual * local_manual, char * path) *ptr = '\0'; #endif } - + nentries = local_manual->nentries; nalloc = local_manual->nalloc; @@ -476,7 +475,7 @@ ReadCurrentSection(Manual * local_manual, char * path) if ( (ptr = rindex(full_name, '.')) != NULL) { #if !defined(SCO) && !defined(ISC) - if (streq(ptr + 1, COMPRESSION_EXTENSION)) + if (streq(ptr + 1, COMPRESSION_EXTENSION)) #else if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL) #endif @@ -487,13 +486,13 @@ ReadCurrentSection(Manual * local_manual, char * path) #endif } local_manual->entries[nentries] = StrAlloc(full_name); - local_manual->entries_less_paths[nentries] = + local_manual->entries_less_paths[nentries] = rindex(local_manual->entries[nentries], '/'); if ( local_manual->entries_less_paths[nentries] == NULL ) PrintError("Internal error while cataloging manual pages."); ++ nentries; } - + local_manual->nentries = nentries; local_manual->nalloc = nalloc; @@ -509,38 +508,38 @@ ReadCurrentSection(Manual * local_manual, char * path) */ static void -SortAndRemove(Manual *man, Cardinal number) +SortAndRemove(Manual *man, int number) { - Cardinal i; + int i; char *l1, *l2, **s1; - + for ( i = 0; i < number; man++, i++) { /* sort each section */ - register int i2 = 0; - + register int i2 = 0; + #ifdef DEBUG printf("sorting section %d - %s\n", i, man->blabel); #endif /* DEBUG */ s1 = (char **)malloc(man->nentries * sizeof(char *)); - + /* temporarily remove suffixes of entries, preventing them from */ - /* being used in alphabetic comparison ie sccs-delta.1 vs sccs.1 */ + /* being used in alpabetic comparison ie sccs-delta.1 vs sccs.1 */ for (i2=0; i2<man->nentries; i2++) if ((s1[i2] = rindex(man->entries_less_paths[i2], '.')) != NULL) - *s1[i2] = '\0'; + *s1[i2] = '\0'; sortstrs ( (Byte **)man->entries_less_paths, man->nentries, (Byte **)man->entries ); /* put back suffixes */ - for (i2=0; i2<man->nentries; i2++) - if (s1[i2] != NULL) *s1[i2] = '.'; - - free(s1); + for (i2=0; i2<man->nentries; i2++) + if (s1[i2] != NULL) *s1[i2] = '.'; + free(s1); + #ifdef DEBUG printf("removing from section %d.\n", i); #endif /* DEBUG */ - + { register int j, k, nent, nentm1; int j2; @@ -579,37 +578,37 @@ SortAndRemove(Manual *man, Cardinal number) /* ******* Replacement for qsort to keep ******* identical entries in order - + A somewhat ugly hack of something that was once simpler... */ /* Sort an array of pointers to strings, keeping it in ascending order by (1) string comparison and (2) original entry order in the pointer array. - + This is a modified radix exchange algorithm. - + In case there's insufficient memory for a temporary copy of the pointer array, the original order of identical strings isn't preserved. */ - -static void + +static void sortstrs (Byte *data[], int size, Byte *otherdata[]) { Byte **sp, **ep; Byte **othersp, **otherep; int *origorder; - + origorder = (int *) calloc (size, sizeof(int)); if ( origorder ) { reg int i; - + for ( i=0; i < size; ++i ) origorder[i] = i; } - + sp = data; ep = &data[size-1]; othersp = otherdata; @@ -623,22 +622,22 @@ sortstrs (Byte *data[], int size, Byte *otherdata[]) else sortstrs_block ( sp, ep, 0, 0x80, othersp, otherep ); } + - - + /*---------------------------------*/ /* Sort 1 block of data on 1 bit */ /*---------------------------------*/ - + static void -sortstrs_block ( +sortstrs_block ( Byte **start, Byte **end, int offset, Byte mask, Byte **otherstart, Byte **otherend) - + { reg Byte **sp, **ep; reg Byte m; @@ -647,8 +646,8 @@ sortstrs_block ( reg int curstrlen; int maxstrlen; Byte **othersp, **otherep; - - + + #define newstring(ptr) \ { \ t = *ptr; \ @@ -657,8 +656,8 @@ sortstrs_block ( if ( curstrlen > maxstrlen ) maxstrlen = curstrlen; \ t = *ptr; \ } - - + + maxstrlen = 0; sp = start; ep = end; @@ -666,7 +665,7 @@ sortstrs_block ( m = mask; othersp = otherstart; otherep = otherend; - + while (1) { newstring(sp) @@ -678,7 +677,7 @@ sortstrs_block ( } if ( sp == ep ) break; - + newstring(ep); while (((sp != ep) && (curstrlen >= off) && ((t[off] & m) != 0))) { @@ -688,16 +687,16 @@ sortstrs_block ( } if ( sp == ep ) break; - + t = *sp; *sp = *ep; *ep = t; - + t = *othersp; *othersp = *otherep; *otherep = t; } - + t = *sp; if ((curstrlen < off) || ((t[off] & m) == 0)) { @@ -715,7 +714,7 @@ sortstrs_block ( -- othersp; } } - + m >>= 1; if ( m == 0 ) { @@ -723,20 +722,20 @@ sortstrs_block ( if ( ++off >= maxstrlen ) return; } - - + + if ( sp != start ) sortstrs_block ( start, sp, off, m, otherstart, othersp ); if ( ep != end ) sortstrs_block ( ep, end, off, m, otherep, otherend ); } + - - + /*-----------------------------------------------------------------*/ /* Sort 1 block of data on 1 bit; check for out-of-order entries */ /*-----------------------------------------------------------------*/ - + static void sortstrs_block_oo ( Byte **start, @@ -747,7 +746,7 @@ static void int *oend, Byte **otherstart, Byte **otherend) - + { reg Byte **sp, **ep; reg int *osp, *oep; @@ -758,8 +757,8 @@ static void reg int curstrlen; int maxstrlen; Byte **othersp, **otherep; - - + + #define newstring(ptr) \ { \ t = *ptr; \ @@ -768,8 +767,8 @@ static void if ( curstrlen > maxstrlen ) maxstrlen = curstrlen; \ t = *ptr; \ } - - + + maxstrlen = 0; sp = start; ep = end; @@ -779,7 +778,7 @@ static void m = mask; othersp = otherstart; otherep = otherend; - + while (1) { newstring(sp) @@ -792,7 +791,7 @@ static void } if ( sp == ep ) break; - + newstring(ep); while (((sp != ep) && (curstrlen >= off) && ((t[off] & m) != 0))) { @@ -803,20 +802,20 @@ static void } if ( sp == ep ) break; - + t = *sp; *sp = *ep; *ep = t; - + t = *othersp; *othersp = *otherep; *otherep = t; - + u = *osp; *osp = *oep; *oep = u; } - + t = *sp; if ((curstrlen < off) || ((t[off] & m) == 0)) { @@ -836,18 +835,19 @@ static void -- othersp; } } - + m >>= 1; if ( m == 0 ) { m = 0x80; if ( ++off >= maxstrlen ) /* Finished sorting block of strings: */ - { /* Restore duplicates to original order */ + { /* Restore duplicates to +riginal order */ reg Byte **cp; reg int *ocp; Byte **othercp; - - + + if ( sp != start ) { cp = start; @@ -860,15 +860,15 @@ static void t = *(cp+1); *(cp+1) = *cp; *cp = t; - + t = *(othercp+1); *(othercp+1) = *othercp; *othercp = t; - + u = *(ocp+1); *(ocp+1) = *ocp; *ocp = u; - + if ( cp != start ) { -- cp; @@ -894,15 +894,15 @@ static void t = *(cp+1); *(cp+1) = *cp; *cp = t; - + t = *(othercp+1); *(othercp+1) = *othercp; *othercp = t; - + u = *(ocp+1); *(ocp+1) = *ocp; *ocp = u; - + if ( cp != ep ) { -- cp; @@ -919,8 +919,8 @@ static void return; } } - - + + if ( sp != start ) sortstrs_block_oo ( start, sp, off, m, ostart, osp, otherstart, othersp ); if ( ep != end ) @@ -941,7 +941,7 @@ InitManual(Manual * l_manual, char * label) bzero( l_manual, sizeof(Manual) ); /* clear it. */ l_manual->blabel = label; /* set label. */ } - + #if defined(DEBUG) /* Function Name: DumpManual @@ -955,10 +955,10 @@ void DumpManual(int number) { register int i,j; - + for ( i = 0; i < number; i++) { printf("label: %s\n", manual[i].blabel); - for (j = 0; j < manual[i].nentries; j++) + for (j = 0; j < manual[i].nentries; j++) printf("%s\n", manual[i].entries[j]); } } @@ -1061,7 +1061,7 @@ ReadManConfig(char manpath[]) * Argument: manpath - char array to return path in. * Returns: TRUE if read was successful. * - * This version expands the glob pattern that can be found + * This version expands the glob pattern that can be found * in man.conf */ #include <glob.h> @@ -1075,10 +1075,10 @@ ReadManConfig(char manpath[]) Bool firstpath = TRUE; glob_t gs; int i; - + if (!(fp = fopen(MANCONF, "r"))) return(FALSE); - + while (fgets(line, sizeof(line), fp)) { path = strtok(line, " \t\n"); if (!path || *path == '#') @@ -1095,7 +1095,7 @@ ReadManConfig(char manpath[]) } } /* while */ for (i = 0; i < gs.gl_pathc; i++) { - + if (firstpath) { strcpy(manpath, gs.gl_pathv[i]); firstpath = FALSE; @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/man.h,v 1.5 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/man.h,v 1.3 2000/03/03 23:16:27 dawes Exp $ */ /* X toolkit header files */ @@ -71,7 +71,7 @@ from the X Consortium. #include "version.h" #include "defs.h" -/* +/* * Assigning values here allows the user of Bitwise Or. */ @@ -114,14 +114,14 @@ typedef struct tManual { int nalloc; /* how much space allocated */ int flags; /* suffix, fold */ } Manual; - -/* pseudo Globals that are specific to each manpage created. */ + +/* psuedo Globals that are specific to each manpage created. */ typedef struct _ManpageGlobals{ - int current_directory; /* The directory currently being shown + int current_directory; /* The directory currently being shown on this manpage. */ Boolean dir_shown, /* True if the directory is then current - visible screen */ + visable screen */ both_shown; /* If true then both the manpage and the directory are to be shown.*/ Widget label, /* The label widget at the top of the page. */ @@ -139,10 +139,8 @@ typedef struct _ManpageGlobals{ version_entry, quit_entry; char manpage_title[80]; /* The label to use for the current manpage. */ - char *manpage_file; /* corresponding filename */ - Boolean manpage_show_file; /* true if we show filename */ - char save_file[80]; /* the name of the file to save formatted + char save_file[80]; /* the name of the file to save fomatted page into. */ char tempfile[80]; /* the name of the file to copy the formatted page from. */ @@ -152,7 +150,7 @@ typedef struct _ManpageGlobals{ ManPageWidgets manpagewidgets; /* The manpage widgets. */ - /* Things to remember when cleaning up when killing manpage. */ + /* Things to remember when cleaning up whne killing manpage. */ Widget This_Manpage; /* a pointer to the root of this manpage. */ @@ -172,18 +170,17 @@ typedef struct _Xman_Resources { Boolean top_box_active; /* Put up the Top Box. */ Boolean clear_search_string; /* clear the search string each time it is popped down? */ - int directory_height; /* The default height of directory in + int directory_height; /* The default height of directory in both_shown mode. */ char * help_file; /* The name of the help file. */ - char * format_cmd; /* command to use to format manpages */ char * title; /* The title for topBox */ Boolean iconic; /* Should topBox come up in an iconic state */ } Xman_Resources; /************************************************************ * - * Function Defintions - * + * Function Defintions + * ************************************************************/ /* @@ -211,8 +208,6 @@ void DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk); void DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val); void OptionCallback(Widget w, XtPointer pointer, XtPointer junk); void Popup(Widget w, XtGrabKind grab_kind); -void ShowManTitle(ManpageGlobals *man_globals); -void ShowDirTitle(ManpageGlobals *man_globals, int number); /* Action Routines. */ @@ -252,7 +247,6 @@ FILE * Format(ManpageGlobals * man_globals, char * entry); /* search */ void MakeSearchWidget(ManpageGlobals * man_globals, Widget parent); -FILE * DoSearch(ManpageGlobals * man_globals, int type); /* tkfunctions.c */ @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/misc.c,v 1.11 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/misc.c,v 1.9 2003/05/27 22:27:08 tsi Exp $ */ /* * xman - X window system manual page display program. @@ -71,7 +71,7 @@ static char *uncompress_formats[] = #endif /* Function Name: PopupWarning - * Description: This function pops up a warning message. + * Description: This function pops upa warning message. * Arguments: string - the specific warning string. * Returns: none */ @@ -88,7 +88,7 @@ PopdownWarning(Widget w, XtPointer client, XtPointer call) void PopupWarning(ManpageGlobals * man_globals, char * string) { - Cardinal n; + int n; Arg wargs[3]; Dimension topX, topY; char buffer[BUFSIZ]; @@ -141,7 +141,7 @@ PrintError(char * string) } /* Function Name: OpenFile - * Description: Assigns a file to the manpage. + * Description: Assignes a file to the manpage. * Arguments: man_globals - global structure. * file - the file pointer. * Returns: none @@ -189,11 +189,9 @@ FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num) int i; #endif - temp = CreateManpageName(entry, section_num, manual[section_num].flags); + temp = CreateManpageName(entry, 0, 0); sprintf(man_globals->manpage_title, "The current manual page is: %s.", temp); XtFree(temp); - man_globals->manpage_file = entry; - man_globals->manpage_show_file = FALSE; ParseEntry(entry, path, section, page); @@ -278,7 +276,7 @@ FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num) /* Function Namecompress * Description: This function will attempt to find a compressed man * page and uncompress it. - * Arguments: man_globals - the pseudo global info. + * Arguments: man_globals - the psuedo global info. * filename - name of file to uncompress. * Returns:; a pointer to the file or NULL. */ @@ -315,7 +313,7 @@ Uncompress(ManpageGlobals * man_globals, char * filename) /* Function Name: UncompressNamed * Description: This function will attempt to find a compressed man * page and uncompress it. - * Arguments: man_globals - the pseudo global info. + * Arguments: man_globals - the psuedo global info. * filename - name of file to uncompress. * RETURNED output - the file name output (must be an allocated string). * Returns:; TRUE if the file was found. @@ -346,7 +344,7 @@ UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output, } /* - * Using stdin is necessary to fool zcat since we cannot guarantee + * Using stdin is necessary to fool zcat since we cannot guarentee * the .Z extension. */ @@ -381,7 +379,7 @@ UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output, /* Function Name: Format * Description: This funtion formats the manual pages and interfaces * with the user. - * Arguments: man_globals - the pseudo globals + * Arguments: man_globals - the psuedo globals * file - the file pointer to use and return * entry - the current entry struct. * current_box - The current directory being displayed. @@ -469,10 +467,10 @@ Format(ManpageGlobals * man_globals, char * entry) #ifndef HANDLE_ROFFSEQ #ifndef HAS_MKSTEMP sprintf(cmdbuf,"cd %s ; %s %s %s > %s %s", path, TBL, - filename, resources.format_cmd, man_globals->tempfile, "2> /dev/null"); + filename, FORMAT, man_globals->tempfile, "2> /dev/null"); #else sprintf(cmdbuf,"cd %s ; %s %s %s >> %s %s", path, TBL, - filename, resources.format_cmd, man_globals->tempfile, "2> /dev/null"); + filename, FORMAT, man_globals->tempfile, "2> /dev/null"); #endif #else /* Handle more flexible way of specifying the formatting pipeline */ @@ -584,7 +582,7 @@ ConstructCommand(cmdbuf, path, filename, tempfile) * attempt to interpret things like L^HL as bold and so forth. This * is so obviously the Wrong Thing it's untrue. */ - char *c = cmdbuf; /* current position in buffer */ + char *c = cmdbuf; /* current posn in buffer */ int left = BUFSIZ; /* space left in buffer */ int used; char *fmt; @@ -603,7 +601,7 @@ ConstructCommand(cmdbuf, path, filename, tempfile) if (!fmt) { /* This is the tricky bit: extract a format string from the source file * Annoyingly, filename might be relative or absolute. We cheat and - * use system to get the thing to a known absolute filename. + * use system to get the thing to a known absoute filename. */ if (filename[0] == '/') { fname = filename; @@ -712,7 +710,7 @@ ConstructCommand(cmdbuf, path, filename, tempfile) /* Function Name: UncompressUnformatted * Description: Finds an uncompressed unformatted manual page. - * Arguments: man_globals - the pseudo global structure. + * Arguments: man_globals - the psuedo global structure. * entry - the manual page entry. * RETURNED filename - location to put the name of the file. * Returns: TRUE if the file was found. @@ -811,7 +809,7 @@ UncompressUnformatted(ManpageGlobals * man_globals, char * entry, if ( UncompressNamed(man_globals, input, filename) ) { #else if ( UncompressNamed(man_globals, input, filename, file) ) { -#endif +#endif man_globals->compress = TRUE; man_globals->gzip = TRUE; sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, @@ -992,10 +990,10 @@ ParseEntry(char *entry, char *path, char *sect, char *page) } /* Function Name: GetGlobals - * Description: Gets the pseudo globals associated with the + * Description: Gets the psuedo globals associated with the * manpage associated with this widget. * Arguments: w - a widget in the manpage. - * Returns: the pseudo globals. + * Returns: the psuedo globals. * Notes: initial_widget is a globals variable. * manglobals_context is a global variable. */ @@ -1022,7 +1020,7 @@ GetGlobals(Widget w) } /* Function Name: SaveGlobals - * Description: Saves the pseudo globals on the widget passed + * Description: Saves the psuedo globals on the widget passed * to this function, although GetGlobals assumes that * the data is associated with the popup child of topBox. * Arguments: w - the widget to associate the data with. @@ -1042,7 +1040,7 @@ SaveGlobals(Widget w, ManpageGlobals * globals) } /* Function Name: RemoveGlobals - * Description: Removes the pseudo globals from the widget passed + * Description: Removes the psuedo globals from the widget passed * to this function. * Arguments: w - the widget to remove the data from. * Returns: none. @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/search.c,v 1.7 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/search.c,v 1.5 2001/01/27 17:24:27 herrb Exp $ */ #include "globals.h" @@ -43,7 +43,7 @@ static int BEntrySearch(char * string, char ** first, int number); /* Function Name: MakeSearchWidget * Description: This Function Creates the Search Widget. - * Arguments: man_globals - the pseudo globals for this manpage. + * Arguments: man_globals - the pseudo globas for this manpage. * w - the widgets parent * Returns: the search widget. */ @@ -55,18 +55,18 @@ MakeSearchWidget(ManpageGlobals * man_globals, Widget parent) Arg arglist[2]; Cardinal num_args = 0; - XtSetArg(arglist[0], XtNtransientFor, parent); - man_globals->search_widget = XtCreatePopupShell(SEARCHNAME, - transientShellWidgetClass, + XtSetArg(arglist[0], XtNtransientFor, parent); + man_globals->search_widget = XtCreatePopupShell(SEARCHNAME, + transientShellWidgetClass, parent, arglist, 1); if (resources.clear_search_string) { - XtSetArg(arglist[0], XtNvalue, ""); num_args++; + XtSetArg(arglist[0], XtNvalue, ""); num_args++; } dialog = XtCreateManagedWidget(DIALOG, dialogWidgetClass, - man_globals->search_widget, + man_globals->search_widget, arglist, num_args); if ( (text = XtNameToWidget(dialog, "value")) == (Widget) NULL) @@ -79,7 +79,7 @@ MakeSearchWidget(ManpageGlobals * man_globals, Widget parent) XawDialogAddButton(dialog, CANCEL, NULL, NULL); /* - * This is a bit gross, but it get the cancel button underneath the + * This is a bit gross, but it get the cancel button underneath the * others, and forms them up to the right size.. */ @@ -117,26 +117,26 @@ ManpageGlobals * man_globals) Widget dialog; dialog = XtNameToWidget(man_globals->search_widget, DIALOG); - if (dialog != NULL) + if (dialog != NULL) return(XawDialogGetValueString(dialog)); PopupWarning(man_globals, - "Could not get the search string, no search will be performed."); + "Could not get the search string, no search will be preformed."); return(NULL); } - + /* Function Name: DoSearch * Description: This function performs a search for a man page or apropos * search upon search string. - * Arguments: man_globals - the pseudo globals for this manpage. + * Arguments: man_globals - the pseudo globas for this manpage. * type - the type of search. * Returns: none. */ #define LOOKLINES 6 -/* +/* * Manual searches look through the list of manual pages for the right one * with a binary search. * @@ -219,15 +219,15 @@ DoSearch(ManpageGlobals * man_globals, int type) } #ifdef HAS_MKSTEMP - if ((file = fdopen(fd, "r")) == NULL) + if ((file = fdopen(fd, "r")) == NULL) #else if((file = fopen(mantmp,"r")) == NULL) #endif PrintError("lost temp file? out of temp space?"); -/* +/* * Since we keep the FD open we can unlink the file safely, this - * will keep extra files out of /tmp. + * will keep extra files out of /tmp. */ unlink(mantmp); @@ -237,7 +237,7 @@ DoSearch(ManpageGlobals * man_globals, int type) /* * Check first LOOKLINES lines for "nothing appropriate". */ - + count = 0; flag = FALSE; while ( (fgets(cmp_str, BUFSIZ, file) != NULL) && (count < LOOKLINES) ) { @@ -253,7 +253,7 @@ DoSearch(ManpageGlobals * man_globals, int type) /* * If the file is less than this number of lines then assume that there is - * nothing appropriate found. This does not confuse the apropos filter. + * nothing apropriate found. This does not confuse the apropos filter. */ if (flag) { @@ -262,13 +262,12 @@ DoSearch(ManpageGlobals * man_globals, int type) ChangeLabel(man_globals->label,string_buf); return(NULL); } - + strcpy(man_globals->manpage_title,label); - man_globals->manpage_show_file = FALSE; - ShowManTitle(man_globals); + ChangeLabel(man_globals->label,label); fseek(file, 0L, 0); /* reset file to point at top. */ } - else { /* MANUAL SEARCH */ + else { /* MANUAL SEACH */ file = DoManualSearch(man_globals, search_string); if (file == NULL) { sprintf(string_buf,"No manual entry for %s.", search_string); @@ -284,7 +283,7 @@ DoSearch(ManpageGlobals * man_globals, int type) Widget dialog; dialog = XtNameToWidget(man_globals->search_widget, DIALOG); - if (dialog == NULL) + if (dialog == NULL) PopupWarning(man_globals, "Could not clear the search string."); XtSetArg(arglist[0], XtNvalue, ""); @@ -302,14 +301,14 @@ DoSearch(ManpageGlobals * man_globals, int type) #define NO_ENTRY -100 -static FILE * +static FILE * DoManualSearch(ManpageGlobals *man_globals, char * string) { int e_num = NO_ENTRY; int i; /* search current section first. */ - + i = man_globals->current_directory; e_num = BEntrySearch(string, manual[i].entries, manual[i].nentries); @@ -334,7 +333,7 @@ DoManualSearch(ManpageGlobals *man_globals, char * string) man_globals->manpagewidgets.box[man_globals->current_directory]); } else { - /* + /* * Highlight the element we are searching for if it is in the directory * listing currently being shown. */ @@ -360,7 +359,7 @@ int number) { int check, cmp, len_cmp, global_number; char *head, *tail; - + global_number = 0; while (TRUE) { @@ -371,12 +370,12 @@ int number) check = number/2; head = rindex(first[ global_number + check ], '/'); - if (head == NULL) + if (head == NULL) PrintError("index failure in BEntrySearch"); head++; tail = rindex(head, '.'); - if (tail == NULL) + if (tail == NULL) /* not an error, some systems (e.g. sgi) have only a .z suffix */ tail = head + strlen(head); @@ -386,7 +385,7 @@ int number) if ( cmp == 0 && len_cmp == 0) { return(global_number + check); } - else if ( cmp < 0 || ((cmp == 0) && (len_cmp < 0)) ) + else if ( cmp < 0 || ((cmp == 0) && (len_cmp < 0)) ) number = check; else /* cmp > 0 || ((cmp == 0) && (len_cmp > 0)) */ { global_number += (check + 1); @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/tkfuncs.c,v 1.3 2000/03/03 23:16:28 dawes Exp $ */ +/* $XFree86$ */ #include <X11/X.h> #include <X11/Xos.h> @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/vendor.c,v 1.3 2000/03/03 23:16:28 dawes Exp $ */ +/* $XFree86: xc/programs/xman/vendor.c,v 1.2 2000/03/03 20:02:25 dawes Exp $ */ /* Vendor-specific data structures and operations */ @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xman/vendor.h,v 1.14 2004/03/12 02:17:55 dickey Exp $ */ +/* $XFree86: xc/programs/xman/vendor.h,v 1.12 2003/03/26 20:43:59 tsi Exp $ */ /* Vendor-specific definitions */ @@ -166,7 +166,7 @@ from the X Consortium. # define FORMAT "| eqn | tbl | nroff -mandoc" # elif defined(BSD) && (BSD >= 199103) # define FORMAT "| eqn | tbl | nroff -man" -# elif defined(linux) || defined(__CYGWIN__) +# elif defined(linux) # define FORMAT "| eqn | tbl | GROFF_NO_SGR= groff -Tlatin1 -mandoc" # else # define FORMAT "| neqn | nroff -man" /* The format command. */ @@ -186,7 +186,7 @@ from the X Consortium. # define REFER "refer" # if defined(CSRG_BASED) # define FORMAT "nroff -mandoc" -# elif defined(linux) || defined(__CYGWIN__) +# elif defined(linux) # define FORMAT "GROFF_NO_SGR= groff -Tlatin1 -mandoc" # elif defined(__DARWIN__) # define FORMAT "nroff -man" @@ -69,7 +69,7 @@ There are two ways to activate the menus. The first is to click any pointer button in the menu button corresponding to the menu you want to activate. The second method is to hold down the "Control" key and click the left pointer button for the Options menu or the middle pointer -button for the Sections menu. Regardless of how the menu was +button for the Sections menu. Reguardless of how the menu was activated, selecting items is the same. Once a menu is activated, continue to hold down the pointer button and @@ -95,8 +95,8 @@ Search Pop up a dialogue box that allows the entire also available through this dialogue box. Show Both Screens Split the manual page display window to display - both the current manual page and the directory. -Show One Screen Return to a single screen display of either a + both the current manual page and the directory. +Show One Screen Return to a single screen display of either a manual page or directory listing. Remove This Man Page Remove this manual page, do not quit. @@ -106,7 +106,7 @@ Open New Man Page Pop up a new manual page browser window. Show Version Print the current version of xman to the information display window. Please include the version number when reporting bugs. - + Quit Close all xman windows and quit xman. @@ -164,7 +164,7 @@ KEYBOARD ACCELERATORS Xman contains a set of preinstalled keyboard accelerators. These are a set of key bindings that perform many of the same operations as the menu items. Since it is not necessary to pull down the menu, these actions -can be performed more quickly, hence the name accelerators. +can be performed more quickly, hence the name accelerators. The default key bindings for xman are: @@ -174,7 +174,7 @@ Anywhere: Control - h Create the help window Control - n Create a new man page Control - q Exit xman - Control - s Create a search popup + Control - s Create a search popup In a manual page, directory, or help window: @@ -184,9 +184,7 @@ In a manual page, directory, or help window: In a manual page or directory: Control - d Display Directory - Repeat to toggle the directory-layout. Control - m Display Man Page - Repeat to show the man page's filename. In a manual page only: @@ -1,6 +1,6 @@ .\" $XConsortium: xman.man,v 1.23 94/04/17 20:44:02 matt Exp $ .\" -.\" $XFree86: xc/programs/xman/xman.man,v 1.5 2004/03/12 02:17:55 dickey Exp $ +.\" $XFree86: xc/programs/xman/xman.man,v 1.3 2001/01/27 18:21:18 dawes Exp $ .\" .TH XMAN 1 __xorgversion__ .SH NAME @@ -59,9 +59,9 @@ setenv MANPATH /mit/kit/man:/usr/man .PP By default, .I xman -will search each of the following directories (in each of the directories +will search each of the following directories (in each of the directories specified in the users MANPATH) for manual pages. If manual pages exist -in that directory then they are added to list of manual pages for +in that directory then they are added to list of manual pages for the corresponding menu item. A menu item is only displayed for those sections that actually contain manual pages. @@ -75,14 +75,14 @@ man2 (2) System Calls man3 (3) Subroutines man4 (4) Devices man5 (5) File Formats -man6 (6) Games +man6 (6) Games man7 (7) Miscellaneous man8 (8) Sys. Administration manl (l) Local mann (n) New mano (o) Old -.fi +.fi For instance, a user has three directories in her manual path and each contain a directory called \fIman3\fP. All these manual pages will appear alphabetically sorted when the user selects the menu item called @@ -90,31 +90,31 @@ alphabetically sorted when the user selects the menu item called any of the directories in her MANPATH, or there are no manual pages in any of the directories called \fImano\fP then no menu item will be displayed for the section called \fI(o) Old\fP. -.SH "BSD AND LINUX SYSTEMS" +.SH "BSD AND LINUX SYSTEMS" .PP -In some BSD and Linux systems, \fIXman\fP will search for a file named +In newer BSD and Linux systems, \fIXman\fP will search for a file named \fI/etc/man.conf\fP which will contain the list of directories containing manual pages. See \fIman.conf\fP(5) for a complete description of the file format. -.SH "THE MANDESC FILE" +.SH "THE MANDESC FILE" .PP -By using the \fImandesc\fP file a user or system manager is able to +By using the \fImandesc\fP file a user or system manager is able to more closely control which manual pages will appear in each of the sections -represented by menu items in the \fISections\fP menu. This +represented by menu items in the \fISections\fP menu. This functionality is only available on a section by section basis, and individual manual pages may not be handled in this manner. -(Although generous use of +(Although generous use of symbolic links \(em see \fIln\fP(1) \(em will allow almost any configuration you can imagine.) .PP The format of the mandesc file is a character followed by a label. The character determines which of the sections will be added under this label. -For instance suppose that you would like to create an extra menu item that +For instance suppose that you would like to create an extra menu item that contains all programmer subroutines. This label should contain all manual pages in both sections two and three. The \fImandesc\fP file would look like this: -.nf - +.nf + 2Programmer Subroutines 3Programmer Subroutines @@ -156,7 +156,7 @@ o(o) Old .fi Xman will read any section that is of the from \fIman<character>\fP, where <character> is an upper or lower case letter (they are treated distinctly) or -a numeral (0-9). Be warned, however, that man(1) and catman(8) will +a numeral (0-9). Be warned, however, that man(1) and catman(8) will not search directories that are non-standard. .SH WIDGETS In order to specify resources, it is useful to know the hierarchy of @@ -189,10 +189,10 @@ Xman xman \fI(This widget is never used)\fP MenuButton sections Label manualBrowser Viewport directory - List directory - List directory + List directory + List directory . - . (one for each section, + . (one for each section, . created on the fly) . ScrollByLine manualPage @@ -245,104 +245,64 @@ Xman xman \fI(This widget is never used)\fP SmeBSB quit .fi -.\" **************************************************************** .SH "APPLICATION RESOURCES" \fIxman\fP has the following application-specific resources which allow customizations unique to \fIxman\fP. .PP .TP 18 -\fBbothShown\fP (Class \fBBoolean\fP) -Either `true' or `false,' specifies whether or not you want both the -directory and the manual page shown at start up. +\fBmanualFontNormal\fP (Class \fBFont\fP) +The font to use for normal text in the manual pages. .TP 18 -\fBclearSearchString\fP (Class \fBClearSearchString\fP) -Clear the value shown in the search widget, -rather than inheriting a value from other resource settings. -The default is ``true''. +\fBmanualFontBold\fP (Class \fBFont\fP) +The font to use for bold text in the manual pages. +.TP 18 +\fBmanualFontItalic\fP (Class \fBFont\fP) +The font to use for italic text in the manual pages. .TP 18 \fBdirectoryFontNormal\fP (Class \fBFont\fP) The font to use for the directory text. .TP 18 +\fBbothShown\fP (Class \fBBoolean\fP) +Either `true' or `false,' specifies whether or not you want both the +directory and the manual page shown at start up. +.TP 18 \fBdirectoryHeight\fP (Class \fBDirectoryHeight\fP) The height in pixels of the directory, when the directory and the manual page are shown simultaneously. .TP 18 -\fBformatCommand\fP (Class \fBString\fP) -The formatting command to use to generate man pages (e.g., "|nroff -man"). +\fBtopCursor\fP (Class \fBCursor\fP) +The cursor to use in the top box. .TP 18 \fBhelpCursor\fP (Class \fBCursor\fP) The cursor to use in the help window. .TP 18 -\fBhelpFile\fP (Class \fBFile\fP) -Use this rather than the system default help file. -.TP 18 \fBmanpageCursor\fP (Class \fBCursor\fP) The cursor to use in the manual page window. .TP 18 -\fBpointerColor\fP (Class \fBForeground\fP) -This is the foreground color of all the cursors (pointers) specified above. -The name was chosen to be compatible with xterm. -.TP 18 -\fBpointerColorBackground\fP (Class \fBBackground\fP) -This is the foreground color of all the cursors (pointers) specified above. -The name was chosen to be compatible with xterm. -.TP 18 \fBsearchEntryCursor\fP (Class \fBCursor\fP) The cursor to use in the search entry text widget. .TP 18 +\fBpointerColor\fP (Class \fBForeground\fP) +This is the color of all the cursors (pointers) specified above. The +name was chosen to be compatible with xterm. +.TP 18 +\fBhelpFile\fP (Class \fBFile\fP) +Use this rather than the system default helpfile. +.TP 18 \fBtopBox\fP (Class \fBBoolean\fP) Either `true' or `false,' determines whether the top box (containing the help, quit and manual page buttons) or a manual page is put on the screen at start-up. The default is true. .TP 18 -\fBtopCursor\fP (Class \fBCursor\fP) -The cursor to use in the top box. -.\" **************************************************************** -.PP -These resources apply to the \fBViewport\fP widget: -.TP 18 \fBverticalList\fP (Class \fBBoolean\fP) -Either `true' or `false,' determines whether the directory listing is +Either `true' or `false,' determines whether the directory listing is vertically or horizontally organized. The default is horizontal (false). -You can alter this at runtime by typing control-d while within the -directory listing. -.\" **************************************************************** -.PP -These resources apply to the \fBScrollByLine\fP widget: -.TP 18 -\fBhalfLines\fP (Class \fBBoolean\fP) -If true, assume that the manpage formatter may rely on half-line spacing. -In that case, some pages are not the same number of lines. -The default is ``false''. -.TP 18 -\fBindent\fP (Class \fBBoolean\fP) -Specify the size of the left margin, -i.e., the distance by which the text is shifted right when -displaying a manual page. -The default is 15. -.TP 18 -\fBmanualFontBold\fP (Class \fBFont\fP) -The font to use for bold text in the manual pages. -.TP 18 -\fBmanualFontItalic\fP (Class \fBFont\fP) -The font to use for italic text in the manual pages. -.TP 18 -\fBmanualFontNormal\fP (Class \fBFont\fP) -The font to use for normal text in the manual pages. -.TP 18 -\fBmanualFontSymbol\fP (Class \fBFont\fP) -The font to use for symbols in the manual pages, e.g., bullets. -.TP 18 -\fBuseRight\fP (Class \fBBoolean\fP) -Allows the scrollbar to be placed on the right. -The default is ``false''. -.\" **************************************************************** .SH "GLOBAL ACTIONS" \fIXman\fP defines all user interaction through global actions. This allows the user to modify the translation table of any widget, and bind any event to the new user action. The list of actions supported by \fIxman\fP are: .TP 1.5i -.B GotoPage(\fIpage\fB) +.B GotoPage(\fIpage\fB) When used in a manual page display window this will allow the user to move between a directory and manual page display. The \fIpage\fP argument can be either \fBDirectory\fP or \fBManualPage\fP. @@ -360,7 +320,7 @@ will open a new manual page to display the results of the search, otherwise xman will attempt to display the results in the parent of the search popup. .TP 1.5i .B PopupHelp() -This action may be used anywhere, and will pop up the help widget. +This action may be used anywhere, and will popup the help widget. .TP 1.5i .B PopupSearch() This action may be used anywhere except in a help window. It will cause @@ -378,7 +338,7 @@ associated with it. .TP 1.5i .B SaveFormattedPage(\fIaction\fP) This action can only be used in the \fBlikeToSave\fP popup widget, and -tells xman whether to \fBSave\fP or \fBCancel\fP a save of the +tells xman whether to \fBSave\fP or \fBCancel\fP a save of the manual page that has just been formatted. .TP 1.5i .B ShowVersion() @@ -403,7 +363,7 @@ searches. .I "Athena Widget Set" .SH ENVIRONMENT .TP 1.5i -.B DISPLAY +.B DISPLAY the default host and display to use. .TP 1.5i .B MANPATH @@ -424,5 +384,4 @@ See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions. .SH AUTHORS Chris Peterson, MIT X Consortium from the V10 version written by Barry Shein formerly of Boston University. -Bug fixes and Linux support by Carlos A M dos Santos, The XFree86 Project. -Other improvements by Thomas Dickey, The XFree86 Project. +Bug fixes and Linux support by Carlos A M dos Santos, for The XFree86 Project. |