IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2005, 1:04:22 PM (21 years ago)
Author:
eugene
Message:

cleanups so -Wall -Werror succeed, some .h reorgs

Location:
trunk/Ohana/src/opihi/pantasks
Files:
1 added
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/CheckJobs.c

    r4684 r4689  
    44
    55  Job *job;
    6   Task *task;
    76  Macro *macro;
    8   int i, found, status;
    9   int Ntest;
     7  int i, status;
    108
    119  /** test all jobs: ready to test?  finished? **/
  • trunk/Ohana/src/opihi/pantasks/CheckSystem.c

    r4573 r4689  
    66  CheckJobs ();
    77  CheckControllerOutput ();
    8 
     8  return (TRUE);
    99}
  • trunk/Ohana/src/opihi/pantasks/CheckTasks.c

    r4684 r4689  
    55  Job *job;
    66  Task *task;
    7   Macro *macro;
    8   int i, found, status;
    9   int Ntest;
     7  int status;
    108
    119  /** test all tasks: ready to test? ready to run? **/
  • trunk/Ohana/src/opihi/pantasks/ControllerOps.c

    r4684 r4689  
    2020    GetJobOutput ("stderr", job[0].pid, &job[0].stderr, job[0].stderr_size);
    2121  } 
     22  return (TRUE);
    2223}
    2324
     
    157158  /* construct the controller command portion */
    158159  if (!strcmp (job[0].task[0].host, "NONE")) {
    159     sprintf (cmd, "job", cmd);
     160    sprintf (cmd, "job");
    160161  } else {
    161162    if (job[0].task[0].host_required) {
     
    391392  IOBuffer buffer;
    392393
     394  if (!CheckControllerStatus()) return (TRUE);
     395
    393396  sprintf (cmd, "kill %d", job[0].pid);
    394397  InitIOBuffer (&buffer, 0x100);
     
    400403}
    401404
     405int QuitController () {
     406
     407  int status;
     408  char cmd[128];
     409  IOBuffer buffer;
     410
     411  if (!CheckControllerStatus()) return (TRUE);
     412
     413  sprintf (cmd, "quit");
     414  InitIOBuffer (&buffer, 0x100);
     415  status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
     416  return (TRUE);
     417}
     418
    402419/* memstr returns a view, not an allocated string : don't free */
  • trunk/Ohana/src/opihi/pantasks/IOBufferOps.c

    r4450 r4689  
    5959    }
    6060  }
     61  return (Nread);
    6162}
    6263
  • trunk/Ohana/src/opihi/pantasks/JobIDOps.c

    r4684 r4689  
    3838
    3939  JobIDList[JobID] = FALSE;
     40  return (TRUE);
    4041}
  • trunk/Ohana/src/opihi/pantasks/JobOps.c

    r4684 r4689  
    5656
    5757  for (i = 0; i < Njobs; i++) {
    58     fprintf (stderr, "%d: %-15s %5d %20s (%x)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], jobs[i][0].argv);
     58    fprintf (stderr, "%d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv);
    5959  }
    6060  return;
  • trunk/Ohana/src/opihi/pantasks/LocalJob.c

    r4684 r4689  
    152152      }
    153153  }
    154   return;
     154  return (FALSE);
    155155}
    156156
  • trunk/Ohana/src/opihi/pantasks/Makefile

    r4686 r4689  
    77LIB     =       $(HOME)/lib
    88INC     =       $(HOME)/include
    9 HELP    =       $(HOME)/help
    109SDIR    =       $(HOME)/sched
    1110#
     
    3837$(SDIR)/JobIDOps.$(ARCH).o \
    3938$(SDIR)/TaskOps.$(ARCH).o \
    40 $(SDIR)/IOBufferOps.$(ARCH).o \
    41 $(SDIR)/memstr.$(ARCH).o
     39$(SDIR)/IOBufferOps.$(ARCH).o
    4240
    4341cmds = \
     
    5048$(SDIR)/controller.$(ARCH).o \
    5149$(SDIR)/controller_host.$(ARCH).o \
     50$(SDIR)/controller_exit.$(ARCH).o \
    5251$(SDIR)/controller_check.$(ARCH).o \
    5352$(SDIR)/controller_status.$(ARCH).o \
     
    107106        cp $^ $@
    108107
    109 %.help:
    110         @if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
    111         rm -f $(HOME)/$*/help/*~
    112         rm -f $(HOME)/$*/help/#*
    113         cp $(HOME)/$*/help/* $(DESTHLP)/
    114 
    115108clean:
    116109        rm -f $(BIN)/*.$(ARCH)
     
    136129        $(CC) $(CFLAGS) -c $*.c -o $@
    137130
    138 
    139 
    140 ## -*- makefile -*-
    141 # deprecated functions: verify & delete
    142 #$(SDIR)/abszero.$(ARCH).o \
    143 #$(SDIR)/cals.$(ARCH).o \
    144 #$(SDIR)/dumpmags.$(ARCH).o \
    145 #$(SDIR)/extract.$(ARCH).o \
    146 #$(SDIR)/gtypes.$(ARCH).o \
    147 #$(SDIR)/photresid.$(ARCH).o \
    148 #$(SDIR)/resid.$(ARCH).o \
    149 #$(SDIR)/zeropts.$(ARCH).o
    150 #$(SDIR)/objload.$(ARCH).o \ - make sure we have vect to tv
    151 #$(SDIR)/ccdextract.$(ARCH).o \
    152 #$(SDIR)/cmdextract.$(ARCH).o \
    153 #$(SDIR)/dmagextract.$(ARCH).o \
    154 #$(SDIR)/ddmagextract.$(ARCH).o \
    155 
    156 # future functions, not fully implemented
    157 #$(SDIR)/detrend.$(ARCH).o \
    158 #$(SDIR)/getxtra.$(ARCH).o \
    159 #$(SDIR)/addxtra.$(ARCH).o \
    160 
    161 # functions that need to be updated
    162 #$(SDIR)/gregions.$(ARCH).o \
    163 
     131%.help:
     132        @if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
     133        rm -f $(HOME)/$*/help/*~
     134        rm -f $(HOME)/$*/help/#*
     135        cp $(HOME)/$*/help/* $(DESTHLP)/
  • trunk/Ohana/src/opihi/pantasks/controller.c

    r4573 r4689  
    22
    33int controller_host    PROTO((int, char **));
     4int controller_exit    PROTO((int, char **));
    45int controller_status  PROTO((int, char **));
    56int controller_check   PROTO((int, char **));
     
    78
    89static Command controller_cmds[] = {
     10  {"exit",   controller_exit,   "shutdown controller"},
    911  {"host",   controller_host,   "define host for controller"},
    1012  {"check",  controller_check,  "check controller host/job"},
     
    1618
    1719  int status;
    18   Function *func;
     20  CommandF *func;
    1921
    2022  if (argc < 2) {
     
    3335}
    3436
    35 Function *FindControllerCommand (char *cmd) {
     37CommandF *FindControllerCommand (char *cmd) {
    3638
    3739  int i, N;
  • trunk/Ohana/src/opihi/pantasks/controller_output.c

    r4573 r4689  
    22
    33int controller_output (int argc, char **argv) {
    4 
    5   int status;
    6   char command[1024];
    7   IOBuffer buffer;
    84
    95  if (argc != 1) {
  • trunk/Ohana/src/opihi/pantasks/delete.c

    r4552 r4689  
    33int delete_job (int argc, char **argv) {
    44
    5   Job *job;
    6   int JobID, N;
     5  int JobID;
    76
    87  if (argc < 2) {
  • trunk/Ohana/src/opihi/pantasks/kill.c

    r4684 r4689  
    44
    55  Job *job;
    6   int JobID, N;
     6  int JobID;
    77
    88  if (argc < 2) {
  • trunk/Ohana/src/opihi/pantasks/scheduler.c

    r4686 r4689  
    77# define opihi_rcfile ".schedrc"
    88
    9 void InitBasic ();
    10 void InitData ();
    11 void InitSched ();
    12 
    13 void welcome () {
    14   fprintf (stderr, "\n");
    15   fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
    16 }
    17 
    189/* program-dependent initialization */
    1910void initialize (int argc, char **argv) {
    2011 
    21   FILE *f;
    22 
    2312  auto_break = TRUE;
    2413
     
    5544  set_str_variable ("PROMPT", opihi_prompt);
    5645  set_str_variable ("RCFILE", opihi_rcfile);
    57 # define xstr(s) str(s)
    58 # define str(s) #s
    5946# ifdef HELPDIR_DEFAULT
    60   set_str_variable ("HELPDIR", xstr(HELPDIR_DEFAULT));
     47  set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
    6148# endif
    6249
    63   /* here we open the history file for append.  it this fails, we
    64      won't be able to write to it, warn the user.  otherwise, this
    65      creates the file readline will write to, if it did not exist */ 
    66 
    67   /* check history file */
    68   /* rewrite with fstat or stat */
    69   f = fopen (opihi_history, "a");
    70   if (f == NULL) /* no current history file here */
    71     fprintf (stderr, "can't save history.\n");
    72   else
    73     fclose (f);
    74  
    75   stifle_history (200);
    76   read_history (opihi_history);
     50  { /* check history file permission */
     51    FILE *f;
     52    f = fopen (opihi_history, "a");
     53    if (f == NULL) /* no current history file here */
     54      fprintf (stderr, "can't save history.\n");
     55    else
     56      fclose (f);
     57    stifle_history (200);
     58    read_history (opihi_history);
     59  }
    7760
    7861  signal (SIGINT, SIG_IGN);
     
    8063}
    8164
     65/* standard welcome message */
     66void welcome () {
     67  fprintf (stderr, "\n");
     68  fprintf (stderr, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
     69}
     70
    8271/* add program-dependent exit functions here */
    8372void cleanup () {
    84   /* -libdisplay
    8573  QuitImage ();
    86   QuitGraph (); */
     74  QuitGraph ();
     75  QuitController ();
    8776  return;
    8877}
  • trunk/Ohana/src/opihi/pantasks/status.c

    r4684 r4689  
    1010  ListTasks (FALSE);
    1111  ListJobs ();
    12 
     12  return (TRUE);
    1313}
    1414
  • trunk/Ohana/src/opihi/pantasks/task.c

    r4684 r4689  
    99  int ThisList, status;
    1010  char *input, *outline;
    11   Macro *macro;
    1211  Task *task;
    1312
    14   if (N = get_argument (argc, argv, "-list")) {
     13  if ((N = get_argument (argc, argv, "-list"))) {
    1514    remove_argument (N, &argc, argv);
    1615    ListTasks (FALSE);
     
    1817  }
    1918
    20   if (N = get_argument (argc, argv, "-longlist")) {
     19  if ((N = get_argument (argc, argv, "-longlist"))) {
    2120    remove_argument (N, &argc, argv);
    2221    ListTasks (TRUE);
     
    2423  }
    2524
    26   if (N = get_argument (argc, argv, "-show")) {
     25  if ((N = get_argument (argc, argv, "-show"))) {
    2726    remove_argument (N, &argc, argv);
    2827    ShowTask (argv[N]);
  • trunk/Ohana/src/opihi/pantasks/task_host.c

    r4684 r4689  
    55  int N, RequiredHost;
    66  Task *task;
    7   char *taskname;
    87
    98  RequiredHost = FALSE;
    10   if (N = get_argument (argc, argv, "-required")) {
     9  if ((N = get_argument (argc, argv, "-required"))) {
    1110    remove_argument (N, &argc, argv);
    1211    RequiredHost = TRUE;
  • trunk/Ohana/src/opihi/pantasks/task_macros.c

    r4684 r4689  
    2727    return (FALSE);
    2828  }
     29
     30  macro = NULL;
    2931
    3032  /*** identify which Macro in Task this particular macro goes with ***/
  • trunk/Ohana/src/opihi/pantasks/task_periods.c

    r4684 r4689  
    77  Task *task;
    88
     9  PollValue = 0;
    910  Poll = FALSE;
    10   if (N = get_argument (argc, argv, "-poll")) {
     11  if ((N = get_argument (argc, argv, "-poll"))) {
    1112    Poll = TRUE;
    1213    remove_argument (N, &argc, argv);
     
    1516  }
    1617
     18  ExecValue = 0;
    1719  Exec = FALSE;
    18   if (N = get_argument (argc, argv, "-exec")) {
     20  if ((N = get_argument (argc, argv, "-exec"))) {
    1921    Exec = TRUE;
    2022    remove_argument (N, &argc, argv);
     
    2325  }
    2426
     27  TimeoutValue = 0;
    2528  Timeout = FALSE;
    26   if (N = get_argument (argc, argv, "-timeout")) {
     29  if ((N = get_argument (argc, argv, "-timeout"))) {
    2730    Timeout = TRUE;
    2831    remove_argument (N, &argc, argv);
     
    4952  return (TRUE);
    5053}
    51 
    52 
    53 /**
    54     careful with this: the command is supposed to be realized
    55     for the Job, not the Task (at execution)
    56     the code is right, but who calls it when needs to be clarified.
    57  **/
    58 
  • trunk/Ohana/src/opihi/pantasks/task_trange.c

    r4684 r4689  
    33int task_trange (int argc, char **argv) {
    44
    5   int N, RequiredHost;
     5  int N;
    66  Task *task;
    77  TimeRange range;
     
    1616     keep = false means the time range defines an invalid range */
    1717  range.keep = TRUE;
    18   if (N = get_argument (argc, argv, "-exclude")) {
     18  if ((N = get_argument (argc, argv, "-exclude"))) {
    1919    remove_argument (N, &argc, argv);
    2020    range.keep = FALSE;
Note: See TracChangeset for help on using the changeset viewer.