Changeset 5900 for trunk/Ohana/src/opihi
- Timestamp:
- Jan 4, 2006, 10:00:28 PM (21 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 8 edited
-
dvo/Makefile (modified) (1 diff)
-
dvo/catdir.c (modified) (1 diff)
-
dvo/dvo.c (modified) (3 diffs)
-
dvo/init.c (modified) (2 diffs)
-
dvo/region_list.c (modified) (2 diffs)
-
include/shell.h (modified) (1 diff)
-
lib.shell/opihi.c (modified) (2 diffs)
-
lib.shell/startup.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/Makefile
r5850 r5900 45 45 $(SDIR)/calextract.$(ARCH).o \ 46 46 $(SDIR)/calmextract.$(ARCH).o \ 47 $(SDIR)/catdir.$(ARCH).o \ 47 48 $(SDIR)/ccd.$(ARCH).o \ 48 49 $(SDIR)/cmatch.$(ARCH).o \ -
trunk/Ohana/src/opihi/dvo/catdir.c
r5451 r5900 3 3 int catdir_define (int argc, char **argv) { 4 4 5 int VERBOSE;5 int status, N, VERBOSE; 6 6 7 7 VERBOSE = FALSE; -
trunk/Ohana/src/opihi/dvo/dvo.c
r5451 r5900 8 8 9 9 /* program-dependent initialization */ 10 void initialize(int argc, char **argv) {10 void program_init (int argc, char **argv) { 11 11 12 12 auto_break = TRUE; … … 18 18 InitDVO (); 19 19 20 if ( SetCATDIR (NULL, TRUE)) {20 if (!SetCATDIR (NULL, TRUE)) { 21 21 fprintf (stderr, "CATDIR is not defined\n"); 22 22 } … … 28 28 set_str_variable ("PROMPT", opihi_prompt); 29 29 set_str_variable ("RCFILE", opihi_rcfile); 30 30 31 # ifdef HELPDIR_DEFAULT 31 32 set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT)); 32 33 # endif 33 34 34 { /* check history file permission */35 FILE *f;36 f = fopen (opihi_history, "a");37 if (f == NULL) /* no current history file here */38 fprintf (stderr, "can't save history.\n");39 else40 fclose (f);41 stifle_history (200);42 read_history (opihi_history);43 }44 45 signal (SIGINT, SIG_IGN);46 35 return; 47 36 } -
trunk/Ohana/src/opihi/dvo/init.c
r5451 r5900 6 6 int calmextract PROTO((int, char **)); 7 7 int catlog PROTO((int, char **)); 8 int catdir_define PROTO((int, char **)); 8 9 int ccd PROTO((int, char **)); 9 10 int cmatch PROTO((int, char **)); … … 61 62 {"calextract", calextract, "extract photometry calibration"}, 62 63 {"calmextract", calmextract, "extract photometry calibration"}, 64 {"catdir", catdir_define,"re-define CATDIR"}, 63 65 {"ccd", ccd, "plot color-color diagram"}, 64 66 {"cmatch", cmatch, "match two catalogs"}, -
trunk/Ohana/src/opihi/dvo/region_list.c
r5451 r5900 30 30 if (VarConfig ("SKYFILE", "%s", skyfile) == NULL) skyfile[0] = 0; 31 31 if (VarConfig ("SKYDEPTH", "%d", &skydepth) == NULL) skydepth = 2; 32 33 if (verbose) { 34 fprintf (stderr, "CATDIR %s\n", catdir); 35 fprintf (stderr, "GSCFILE %s\n", gscfile); 36 fprintf (stderr, "SKYFILE %s\n", skyfile); 37 fprintf (stderr, "SKYDEPTH %d\n", skydepth); 38 } 32 39 33 40 /* load the SkyTable at this point */ … … 81 88 int Ngraph; 82 89 Graphdata graphsky; 83 SkyTable *sky;84 90 SkyList *skylist; 85 91 char filename[256]; -
trunk/Ohana/src/opihi/include/shell.h
r4763 r5900 44 44 45 45 /*** basic opihi shell functions ***/ 46 void initialize PROTO((int argc, char **argv)); 46 void general_init PROTO((int argc, char **argv)); 47 void program_init PROTO((int argc, char **argv)); 47 48 void startup PROTO((int argc, char **argv)); 48 49 int multicommand PROTO((char *line)); -
trunk/Ohana/src/opihi/lib.shell/opihi.c
r4763 r5900 8 8 pid_t ppid; 9 9 10 initialize (argc, argv); 10 general_init (argc, argv); 11 program_init (argc, argv); 11 12 startup (argc, argv); 12 13 prompt = get_variable("PROMPT"); … … 45 46 } 46 47 } 48 49 /* 50 startup sequence: 51 52 - general_init 53 - program_init 54 - startup (exit if non-interactive) 55 - welcome 56 57 */ -
trunk/Ohana/src/opihi/lib.shell/startup.c
r4689 r5900 1 1 # include "opihi.h" 2 2 3 /* program-independent initialization */ 4 void startup (int argc, char **argv) { 3 /* program-independent initialization 4 * these steps do not depend on the opihi implementation 5 * (ie, the supplied commands or data structures) 6 */ 5 7 6 long A, B; 7 8 signal (SIGINT, SIG_IGN); 8 void general_init (int argc, char **argv) { 9 9 10 10 /* init srand for rnd numbers elsewhere */ 11 long A, B; 11 12 A = time(NULL); 12 13 for (B = 0; A == time(NULL); B++); 13 14 srand48(B); 14 15 15 if (0) { 16 /* fix the history list to remove the timestamp */ 17 char *c; 18 int i; 19 HIST_ENTRY **entry; 20 21 entry = history_list (); 22 if (entry != (HIST_ENTRY **) NULL) { 23 for (i = 0; entry[i]; i++) { 24 if ((strlen (entry[i][0].line) > 19) && 25 (entry[i][0].line[2] == '/') && 26 (entry[i][0].line[5] == '/') && 27 (entry[i][0].line[11] == ':') && 28 (entry[i][0].line[14] == ':') && 29 (entry[i][0].line[17] == ':')) { 30 c = entry[i][0].line + 19; 31 memmove (entry[i][0].line, c, strlen(c) + 1); 32 } 33 } 34 } 16 /* set signals */ 17 signal (SIGINT, SIG_IGN); 18 19 /* load config data (.ptolemyrc) */ 20 if (!ConfigInit (&argc, argv)) { 21 fprintf (stderr, "can't find config file. some functions will be unavailable\n"); 35 22 } 36 37 { 23 24 return; 25 } 26 27 void startup (int argc, char **argv) { 38 28 39 29 int i, N, status, ONLY_INPUT, LOAD_RC; … … 57 47 */ 58 48 59 if (!ConfigInit (&argc, argv)) { 60 fprintf (stderr, "can't find config file. some functions will be unavailable\n"); 49 50 51 /* check history file permission */ 52 { 53 FILE *f; 54 char *opihi_history; 55 56 opihi_history = get_variable ("RCFILE"); 57 f = fopen (opihi_history, "a"); 58 if (f == NULL) /* no current history file here */ 59 fprintf (stderr, "can't save history.\n"); 60 else 61 fclose (f); 62 stifle_history (200); 63 read_history (opihi_history); 64 } 65 66 if (0) { 67 /* fix the history list to remove the timestamp */ 68 char *c; 69 int i; 70 HIST_ENTRY **entry; 71 72 entry = history_list (); 73 if (entry != (HIST_ENTRY **) NULL) { 74 for (i = 0; entry[i]; i++) { 75 if ((strlen (entry[i][0].line) > 19) && 76 (entry[i][0].line[2] == '/') && 77 (entry[i][0].line[5] == '/') && 78 (entry[i][0].line[11] == ':') && 79 (entry[i][0].line[14] == ':') && 80 (entry[i][0].line[17] == ':')) { 81 c = entry[i][0].line + 19; 82 memmove (entry[i][0].line, c, strlen(c) + 1); 83 } 84 } 61 85 } 62 86
Note:
See TracChangeset
for help on using the changeset viewer.
