IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2005, 9:53:49 AM (21 years ago)
Author:
eugene
Message:

fixed some memory leaks, pushed extra init functions into lib inits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo2/dvo2.c

    r2598 r4714  
    77# define opihi_rcfile ".dvorc"
    88
    9 void InitBasic ();
    10 void InitData ();
    11 void InitAstro ();
    12 void InitDVO2 ();
    13 
    14 void welcome () {
    15   fprintf (stderr, "\n");
    16   fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
    17 }
    18 
    199/* program-dependent initialization */
    2010void initialize (int argc, char **argv) {
    2111 
    22   FILE *f;
    23 
    2412  auto_break = TRUE;
    25 
    26   Nlists = 0;
    27   ALLOCATE (lists, List, 1);
    28 
    29   /* init functions required by libraries */
    30   /* -libopihi */
    31   InitCommands ();
    32   InitMacros ();
    33   InitBuffers ();
    34   InitVectors ();
    35   InitVariables ();
    36 
    37   /* -libdisplay */
    38   InitGraph ();
    39   InitImage ();
    4013
    4114  /* load the commands used by this implementation */
     
    4417  InitAstro ();
    4518  InitDVO2 ();
    46   InitOutfile ();
    4719
    4820  rl_readline_name = opihi_name;
     
    5224  set_str_variable ("PROMPT", opihi_prompt);
    5325  set_str_variable ("RCFILE", opihi_rcfile);
     26# ifdef HELPDIR_DEFAULT
     27  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
     28# endif
    5429
    55   /* here we open the history file for append.  it this fails, we
    56      won't be able to write to it, warn the user.  otherwise, this
    57      creates the file readline will write to, if it did not exist */ 
    58 
    59   /* check history file */
    60   /* rewrite with fstat or stat */
    61   f = fopen (opihi_history, "a");
    62   if (f == NULL) /* no current history file here */
    63     fprintf (stderr, "can't save history.\n");
    64   else
    65     fclose (f);
    66  
    67   stifle_history (200);
    68   read_history (opihi_history);
     30  { /* check history file permission */
     31    FILE *f;
     32    f = fopen (opihi_history, "a");
     33    if (f == NULL) /* no current history file here */
     34      fprintf (stderr, "can't save history.\n");
     35    else
     36      fclose (f);
     37    stifle_history (200);
     38    read_history (opihi_history);
     39  }
    6940
    7041  signal (SIGINT, SIG_IGN);
     
    7243}
    7344
     45/* standard welcome message */
     46void welcome () {
     47  fprintf (stderr, "\n");
     48  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
     49}
     50
    7451/* add program-dependent exit functions here */
    7552void cleanup () {
    76   /* -libdisplay
     53  /* -libdisplay */
    7754  QuitImage ();
    78   QuitGraph (); */
     55  QuitGraph ();
    7956  return;
    8057}
Note: See TracChangeset for help on using the changeset viewer.