comparison src/help.cc @ 242:742c4795aea9

[project @ 1993-11-30 21:26:43 by jwe]
author jwe
date Tue, 30 Nov 1993 21:26:43 +0000
parents a99f28f5e351
children d66cc97f77a9
comparison
equal deleted inserted replaced
241:62fec093c19e 242:742c4795aea9
26 #endif 26 #endif
27 27
28 #include <iostream.h> 28 #include <iostream.h>
29 29
30 #include "builtins.h" 30 #include "builtins.h"
31 #include "utils.h"
31 #include "help.h" 32 #include "help.h"
32 33
33 static help_list operators[] = 34 static help_list operators[] =
34 { 35 {
35 { "!", 36 { "!",
215 "Begin a while loop.\n", }, 216 "Begin a while loop.\n", },
216 217
217 { (char *) NULL, (char *) NULL, }, 218 { (char *) NULL, (char *) NULL, },
218 }; 219 };
219 220
221 /*
222 * Return a copy of the operator or keyword names.
223 */
220 char ** 224 char **
221 names (help_list *lst, int& count) 225 names (help_list *lst, int& count)
222 { 226 {
223 count = 0; 227 count = 0;
224 help_list *ptr = lst; 228 help_list *ptr = lst;
235 239
236 ptr = lst; 240 ptr = lst;
237 int i = 0; 241 int i = 0;
238 while (ptr->name != (char *) NULL) 242 while (ptr->name != (char *) NULL)
239 { 243 {
240 name_list[i++] = ptr->name; 244 name_list[i++] = strsave (ptr->name);
241 ptr++; 245 ptr++;
242 } 246 }
243 247
244 name_list[count] = (char *) NULL; 248 name_list[count] = (char *) NULL;
245 return name_list; 249 return name_list;