|
|
1.1 root 1: /* help.c - Display of assorted help texts */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/others/quipu/uips/sd/RCS/help.c,v 7.0 90/06/12 13:14:05 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/others/quipu/uips/sd/RCS/help.c,v 7.0 90/06/12 13:14:05 mrose Exp $
9: */
10:
11: /*
12: * $Log: help.c,v $
13: * Revision 7.0 90/06/12 13:14:05 mrose
14: * *** empty log message ***
15: *
16: * Revision 1.6 90/04/26 10:36:36 emsrdsm
17: * *** empty log message ***
18: *
19: * Revision 1.5 90/04/25 15:07:48 emsrdsm
20: * i) lint'ed
21: *
22: * Revision 1.4 90/04/20 17:57:51 emsrdsm
23: * i) no more freeing
24: *
25: * Revision 1.3 90/04/18 18:27:48 emsrdsm
26: * fixed i) does not move to leaves
27: * ii) added default mechanism described using "typeDefaults" file.
28: * iii) added 'sorting' to attribute display
29: *
30: * Revision 1.2 90/03/15 16:31:56 emsrdsm
31: * fixes i) Prints messages correctly on exit.
32: * ii) Added rfc822 to greybook mailbox conversion
33: * iii) Removed bug that caused crash if 'local_dit' undefined
34: *
35: * Revision 1.1 90/03/09 17:40:26 emsrdsm
36: * Initial revision
37: *
38: * Revision 1.1 90/03/09 13:36:33 emsrdsm
39: * Initial revision
40: *
41: */
42:
43: #include "sequence.h"
44: #include <stdio.h>
45: #include "quipu/util.h"
46: #include "tailor.h"
47:
48: #define BUFLEN 1024
49: #define TEXT 1
50:
51: #ifdef lint
52: #define ETCDIR "/etc"
53: #endif
54:
55: #define HELPDIR "sd/helpdir/"
56:
57: extern D_seq textseq;
58: extern D_seq dnseq;
59: extern int text_state;
60: extern int current_entry, entry_number, display_entry;
61:
62: help_cncs()
63: {
64: get_help("help", " Press <KEY> to get detailed help.\n");
65: }
66:
67: help_init()
68: {
69: get_help("help", " SD X.500 Directory Agent - Concise Help\n");
70: }
71:
72: help_up()
73: {
74: get_help("widen", " The \"Widen Area\" Function.\n");
75: }
76:
77: help_back()
78: {
79: get_help("look", " The \"Look Back\" Function.\n");
80: }
81:
82: help_number()
83: {
84: get_help("number", " The \"Go To Number\" Function.\n");
85: }
86:
87: help_srch()
88: {
89: get_help("search", " The \"Search\" Function");
90: }
91:
92: help_list()
93: {
94: get_help("list", " The \"List\" Function");
95: }
96:
97: get_help(filename, line)
98: char *filename, *line;
99: {
100: FILE * helpfp;
101: char helpbuf[BUFLEN];
102: char filebuf[BUFLEN];
103: char *str;
104:
105: text_state = TEXT;
106: entry_number = 0;
107: display_entry = current_entry = 1;
108: free_seq(dnseq);
109: free_seq(textseq);
110: dnseq = 0;
111: textseq = 0;
112:
113: (void) strcpy(filebuf, HELPDIR);
114: (void) strcat(filebuf, filename);
115: (void) strcpy(helpbuf, isodefile(filebuf, 0));
116:
117: if ((helpfp = fopen(helpbuf, "r")) == (FILE *)NULL ) {
118: tprint("Can't open help file '%s'.\n",helpbuf);
119: return;
120: }
121:
122: if (line) {
123: add_seq(&textseq, line);
124: entry_number++;
125: }
126:
127: while(fgets(filebuf, BUFLEN, helpfp) != (char *) NULL) {
128: str = filebuf;
129: while(*str != '\n' && *str != '\0') str++;
130: *str = '\0';
131: add_seq(&textseq, filebuf);
132: entry_number++;
133: }
134:
135: (void) fclose(helpfp);
136: scrollbar('\0');
137: }
138:
139:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.