IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5900 for trunk/Ohana/src/opihi


Ignore:
Timestamp:
Jan 4, 2006, 10:00:28 PM (21 years ago)
Author:
eugene
Message:

fixes for skyregion, generate

Location:
trunk/Ohana/src/opihi
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/Makefile

    r5850 r5900  
    4545$(SDIR)/calextract.$(ARCH).o            \
    4646$(SDIR)/calmextract.$(ARCH).o           \
     47$(SDIR)/catdir.$(ARCH).o                \
    4748$(SDIR)/ccd.$(ARCH).o                   \
    4849$(SDIR)/cmatch.$(ARCH).o                \
  • trunk/Ohana/src/opihi/dvo/catdir.c

    r5451 r5900  
    33int catdir_define (int argc, char **argv) {
    44 
    5   int VERBOSE;
     5  int status, N, VERBOSE;
    66
    77  VERBOSE = FALSE;
  • trunk/Ohana/src/opihi/dvo/dvo.c

    r5451 r5900  
    88
    99/* program-dependent initialization */
    10 void initialize (int argc, char **argv) {
     10void program_init (int argc, char **argv) {
    1111 
    1212  auto_break = TRUE;
     
    1818  InitDVO ();
    1919
    20   if (SetCATDIR (NULL, TRUE)) {
     20  if (!SetCATDIR (NULL, TRUE)) {
    2121    fprintf (stderr, "CATDIR is not defined\n");
    2222  }
     
    2828  set_str_variable ("PROMPT", opihi_prompt);
    2929  set_str_variable ("RCFILE", opihi_rcfile);
     30
    3031# ifdef HELPDIR_DEFAULT
    3132  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
    3233# endif
    3334
    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     else
    40       fclose (f);
    41     stifle_history (200);
    42     read_history (opihi_history);
    43   }
    44 
    45   signal (SIGINT, SIG_IGN);
    4635  return;
    4736}
  • trunk/Ohana/src/opihi/dvo/init.c

    r5451 r5900  
    66int calmextract     PROTO((int, char **));
    77int catlog          PROTO((int, char **));
     8int catdir_define   PROTO((int, char **));
    89int ccd             PROTO((int, char **));
    910int cmatch          PROTO((int, char **));
     
    6162  {"calextract",  calextract,   "extract photometry calibration"},
    6263  {"calmextract", calmextract,  "extract photometry calibration"},
     64  {"catdir",      catdir_define,"re-define CATDIR"},
    6365  {"ccd",         ccd,          "plot color-color diagram"},
    6466  {"cmatch",      cmatch,       "match two catalogs"},
  • trunk/Ohana/src/opihi/dvo/region_list.c

    r5451 r5900  
    3030  if (VarConfig ("SKYFILE",  "%s", skyfile) == NULL) skyfile[0] = 0;
    3131  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  }
    3239
    3340  /* load the SkyTable at this point */
     
    8188  int Ngraph;
    8289  Graphdata graphsky;
    83   SkyTable *sky;
    8490  SkyList *skylist;
    8591  char filename[256];
  • trunk/Ohana/src/opihi/include/shell.h

    r4763 r5900  
    4444
    4545/*** basic opihi shell functions ***/
    46 void          initialize                PROTO((int argc, char **argv));
     46void          general_init              PROTO((int argc, char **argv));
     47void          program_init              PROTO((int argc, char **argv));
    4748void          startup                   PROTO((int argc, char **argv));
    4849int           multicommand              PROTO((char *line));
  • trunk/Ohana/src/opihi/lib.shell/opihi.c

    r4763 r5900  
    88  pid_t ppid;
    99
    10   initialize (argc, argv);
     10  general_init (argc, argv);
     11  program_init (argc, argv);
    1112  startup (argc, argv);
    1213  prompt = get_variable("PROMPT");
     
    4546  }
    4647}
     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  
    11# include "opihi.h"
    22
    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 */
    57
    6   long A, B;
    7    
    8   signal (SIGINT, SIG_IGN);
     8void general_init (int argc, char **argv) {
    99
    1010  /* init srand for rnd numbers elsewhere */
     11  long A, B;
    1112  A = time(NULL);
    1213  for (B = 0; A == time(NULL); B++);
    1314  srand48(B);
    1415 
    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");
    3522  }
    36  
    37   {
     23
     24  return;
     25}
     26
     27void startup (int argc, char **argv) {
    3828   
    3929    int i, N, status, ONLY_INPUT, LOAD_RC;
     
    5747  */
    5848
    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      }
    6185    }
    6286
Note: See TracChangeset for help on using the changeset viewer.