comparison src/t-builtins.cc @ 482:680426c10c5e

[project @ 1994-06-30 15:23:09 by jwe]
author jwe
date Thu, 30 Jun 1994 15:23:09 +0000
parents 90964309100b
children 966db71124dc
comparison
equal deleted inserted replaced
481:376ac108f611 482:680426c10c5e
172 } 172 }
173 173
174 return os; 174 return os;
175 } 175 }
176 176
177 tree_constant 177 tree_constant *
178 builtin_casesen (int argc, char **argv) 178 builtin_casesen (int argc, char **argv, int nargout)
179 { 179 {
180 tree_constant retval; 180 tree_constant *retval = NULL_TREE_CONST;
181 181
182 if (argc == 1 || (argc > 1 && strcmp (argv[1], "off") == 0)) 182 if (argc == 1 || (argc > 1 && strcmp (argv[1], "off") == 0))
183 warning ("casesen: sorry, Octave is always case sensitive"); 183 warning ("casesen: sorry, Octave is always case sensitive");
184 else if (argc > 1 && strcmp (argv[1], "on") == 0) 184 else if (argc > 1 && strcmp (argv[1], "on") == 0)
185 ; // ok. 185 ; // ok.
190 } 190 }
191 191
192 /* 192 /*
193 * Change current working directory. 193 * Change current working directory.
194 */ 194 */
195 tree_constant 195 tree_constant *
196 builtin_cd (int argc, char **argv) 196 builtin_cd (int argc, char **argv, int nargout)
197 { 197 {
198 tree_constant retval; 198 tree_constant *retval = NULL_TREE_CONST;
199 199
200 if (argc > 1) 200 if (argc > 1)
201 { 201 {
202 static char *dirname = (char *) NULL; 202 static char *dirname = (char *) NULL;
203 203
249 249
250 /* 250 /*
251 * Wipe out user-defined variables and functions given a list of 251 * Wipe out user-defined variables and functions given a list of
252 * globbing patterns. 252 * globbing patterns.
253 */ 253 */
254 tree_constant 254 tree_constant *
255 builtin_clear (int argc, char **argv) 255 builtin_clear (int argc, char **argv, int nargout)
256 { 256 {
257 tree_constant retval; 257 tree_constant *retval = NULL_TREE_CONST;
258 258
259 // Always clear the local table, but don't clear currently compiled 259 // Always clear the local table, but don't clear currently compiled
260 // functions unless we are at the top level. (Allowing that to happen 260 // functions unless we are at the top level. (Allowing that to happen
261 // inside functions would result in pretty odd behavior...) 261 // inside functions would result in pretty odd behavior...)
262 262
326 } 326 }
327 327
328 /* 328 /*
329 * Associate a cryptic message with a variable name. 329 * Associate a cryptic message with a variable name.
330 */ 330 */
331 tree_constant 331 tree_constant *
332 builtin_document (int argc, char **argv) 332 builtin_document (int argc, char **argv, int nargout)
333 { 333 {
334 tree_constant retval; 334 tree_constant *retval = NULL_TREE_CONST;
335 if (argc == 3) 335 if (argc == 3)
336 document_symbol (argv[1], argv[2]); 336 document_symbol (argv[1], argv[2]);
337 else 337 else
338 print_usage ("document"); 338 print_usage ("document");
339 return retval; 339 return retval;
340 } 340 }
341 341
342 /* 342 /*
343 * Edit commands with your favorite editor. 343 * Edit commands with your favorite editor.
344 */ 344 */
345 tree_constant 345 tree_constant *
346 builtin_edit_history (int argc, char **argv) 346 builtin_edit_history (int argc, char **argv, int nargout)
347 { 347 {
348 tree_constant retval; 348 tree_constant *retval = NULL_TREE_CONST;
349 do_edit_history (argc, argv); 349 do_edit_history (argc, argv);
350 return retval; 350 return retval;
351 } 351 }
352 352
353 /* 353 /*
354 * Set output format state. 354 * Set output format state.
355 */ 355 */
356 tree_constant 356 tree_constant *
357 builtin_format (int argc, char **argv) 357 builtin_format (int argc, char **argv, int nargout)
358 { 358 {
359 tree_constant retval; 359 tree_constant *retval = NULL_TREE_CONST;
360 set_format_style (argc, argv); 360 set_format_style (argc, argv);
361 return retval; 361 return retval;
362 } 362 }
363 363
364 static void 364 static void
486 } 486 }
487 487
488 /* 488 /*
489 * Print cryptic yet witty messages. 489 * Print cryptic yet witty messages.
490 */ 490 */
491 tree_constant 491 tree_constant *
492 builtin_help (int argc, char **argv) 492 builtin_help (int argc, char **argv, int nargout)
493 { 493 {
494 tree_constant retval; 494 tree_constant *retval = NULL_TREE_CONST;
495 495
496 if (argc == 1) 496 if (argc == 1)
497 { 497 {
498 simple_help (); 498 simple_help ();
499 } 499 }
621 } 621 }
622 622
623 /* 623 /*
624 * Display, save, or load history. 624 * Display, save, or load history.
625 */ 625 */
626 tree_constant 626 tree_constant *
627 builtin_history (int argc, char **argv) 627 builtin_history (int argc, char **argv, int nargout)
628 { 628 {
629 tree_constant retval; 629 tree_constant *retval = NULL_TREE_CONST;
630 630
631 do_history (argc, argv); 631 do_history (argc, argv);
632 632
633 return retval; 633 return retval;
634 } 634 }
635 635
636 /* 636 /*
637 * Change state flag that determines whether lines are added to plots 637 * Change state flag that determines whether lines are added to plots
638 * or drawn on new plots. 638 * or drawn on new plots.
639 */ 639 */
640 tree_constant 640 tree_constant *
641 builtin_hold (int argc, char **argv) 641 builtin_hold (int argc, char **argv, int nargout)
642 { 642 {
643 tree_constant retval; 643 tree_constant *retval = NULL_TREE_CONST;
644 644
645 switch (argc) 645 switch (argc)
646 { 646 {
647 case 1: 647 case 1:
648 clear_before_plotting = ! clear_before_plotting; 648 clear_before_plotting = ! clear_before_plotting;
807 * 807 *
808 * BUGS: 808 * BUGS:
809 * 809 *
810 * -- This function is not terribly robust. 810 * -- This function is not terribly robust.
811 */ 811 */
812 tree_constant 812 tree_constant *
813 builtin_load (int argc, char **argv) 813 builtin_load (int argc, char **argv, int nargout)
814 { 814 {
815 tree_constant retval; 815 tree_constant *retval = NULL_TREE_CONST;
816 816
817 argc--; 817 argc--;
818 argv++; 818 argv++;
819 819
820 int force = 0; 820 int force = 0;
893 } 893 }
894 894
895 /* 895 /*
896 * Get a directory listing. 896 * Get a directory listing.
897 */ 897 */
898 tree_constant 898 tree_constant *
899 builtin_ls (int argc, char **argv) 899 builtin_ls (int argc, char **argv, int nargout)
900 { 900 {
901 tree_constant retval; 901 tree_constant *retval = NULL_TREE_CONST;
902 902
903 ostrstream ls_buf; 903 ostrstream ls_buf;
904 904
905 ls_buf << "ls -C "; 905 ls_buf << "ls -C ";
906 for (int i = 1; i < argc; i++) 906 for (int i = 1; i < argc; i++)
927 } 927 }
928 928
929 /* 929 /*
930 * Run previous commands from the history list. 930 * Run previous commands from the history list.
931 */ 931 */
932 tree_constant 932 tree_constant *
933 builtin_run_history (int argc, char **argv) 933 builtin_run_history (int argc, char **argv, int nargout)
934 { 934 {
935 tree_constant retval; 935 tree_constant *retval = NULL_TREE_CONST;
936 do_run_history (argc, argv); 936 do_run_history (argc, argv);
937 return retval; 937 return retval;
938 } 938 }
939 939
940 /* 940 /*
977 } 977 }
978 978
979 /* 979 /*
980 * Write variables to an output stream. 980 * Write variables to an output stream.
981 */ 981 */
982 tree_constant 982 tree_constant *
983 builtin_save (int argc, char **argv) 983 builtin_save (int argc, char **argv, int nargout)
984 { 984 {
985 tree_constant retval; 985 tree_constant *retval = NULL_TREE_CONST;
986 986
987 if (argc < 2) 987 if (argc < 2)
988 { 988 {
989 print_usage ("save"); 989 print_usage ("save");
990 return retval; 990 return retval;
1080 } 1080 }
1081 1081
1082 /* 1082 /*
1083 * Set plotting options. 1083 * Set plotting options.
1084 */ 1084 */
1085 tree_constant 1085 tree_constant *
1086 builtin_set (int argc, char **argv) 1086 builtin_set (int argc, char **argv, int nargout)
1087 { 1087 {
1088 tree_constant retval; 1088 tree_constant *retval = NULL_TREE_CONST;
1089 1089
1090 ostrstream plot_buf; 1090 ostrstream plot_buf;
1091 1091
1092 if (argc > 1) 1092 if (argc > 1)
1093 { 1093 {
1111 } 1111 }
1112 1112
1113 /* 1113 /*
1114 * Set plotting options. 1114 * Set plotting options.
1115 */ 1115 */
1116 tree_constant 1116 tree_constant *
1117 builtin_show (int argc, char **argv) 1117 builtin_show (int argc, char **argv, int nargout)
1118 { 1118 {
1119 tree_constant retval; 1119 tree_constant *retval = NULL_TREE_CONST;
1120 1120
1121 ostrstream plot_buf; 1121 ostrstream plot_buf;
1122 1122
1123 for (int i = 0; i < argc; i++) 1123 for (int i = 0; i < argc; i++)
1124 plot_buf << argv[i] << " "; 1124 plot_buf << argv[i] << " ";
1203 delete [] symbols; 1203 delete [] symbols;
1204 } 1204 }
1205 return status; 1205 return status;
1206 } 1206 }
1207 1207
1208 tree_constant 1208 tree_constant *
1209 builtin_who (int argc, char **argv) 1209 builtin_who (int argc, char **argv, int nargout)
1210 { 1210 {
1211 tree_constant retval; 1211 tree_constant *retval = NULL_TREE_CONST;
1212 1212
1213 int show_builtins = 0; 1213 int show_builtins = 0;
1214 int show_functions = (curr_sym_tab == top_level_sym_tab); 1214 int show_functions = (curr_sym_tab == top_level_sym_tab);
1215 int show_variables = 1; 1215 int show_variables = 1;
1216 int show_verbose = 0; 1216 int show_verbose = 0;