IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27255 for trunk


Ignore:
Timestamp:
Mar 11, 2010, 12:45:59 PM (16 years ago)
Author:
eugene
Message:

add shell-verbosity (echo commmand lines) and function to enable; add fflush calls to gprint

Location:
trunk/Ohana/src/opihi
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/Makefile

    r26891 r27255  
    4040$(SRC)/module.$(ARCH).o     \
    4141$(SRC)/nop.$(ARCH).o        \
     42$(SRC)/opihi.$(ARCH).o     \
    4243$(SRC)/output.$(ARCH).o     \
    4344$(SRC)/quit.$(ARCH).o        \
  • trunk/Ohana/src/opihi/cmd.basic/init.c

    r26891 r27255  
    2626int module          PROTO((int, char **));
    2727int nop             PROTO((int, char **));
     28int opihi_setmode   PROTO((int, char **));
    2829int output          PROTO((int, char **));
    2930int pwd             PROTO((int, char **));
     
    7475  {1, "module",        module,             "load script file from the modules directories"},
    7576  {1, "nop",           nop,                "a NOP function"},
     77  {1, "opihi",         opihi_setmode,      "get / set opihi behavior options"},
    7678  {1, "output",        output,             "redirect output to file"},
    7779  {1, "pwd",           pwd,                "print current working directory"},
  • trunk/Ohana/src/opihi/include/shell.h

    r23530 r27255  
    7070
    7171int           command                   PROTO((char *line, char **outline, int VERBOSE));
     72void          set_verbose_shell         PROTO((int mode));
     73int           get_verbose_shell         PROTO((void));
     74
    7275char         *expand_vars               PROTO((char *line));
    7376char         *expand_vectors            PROTO((char *line));
  • trunk/Ohana/src/opihi/lib.shell/command.c

    r25440 r27255  
    11# include "opihi.h"
    22# define DEBUG 0
     3
     4static int VERBOSE_SHELL = FALSE;
    35
    46int command (char *line, char **outline, int VERBOSE) {
     
    2931  *outline = line;
    3032 
    31   # if (DEBUG)
    32   fprintf (stderr, "line: %s\n", line);
    33   # endif
     33  if (VERBOSE_SHELL) gprint (GP_ERR, "opihi: %s\n", line);
    3434
    3535  argv = parse_commands (line, &argc);
     
    6060    msg = get_variable_ptr ("ERRORMSG");
    6161    if (msg != (char *) NULL) gprint (GP_ERR, "%s\n", msg);
    62     // gprint (GP_ERR, "error on line: %s\n", rawline);
     62    if (VERBOSE_SHELL) gprint (GP_ERR, "error on line: %s\n", rawline);
    6363  }
    6464
     
    7373}
    7474
     75void set_verbose_shell(int mode) {
     76    VERBOSE_SHELL = mode;
     77}
     78
     79int get_verbose_shell(void) {
     80    return VERBOSE_SHELL;
     81}
     82
     83   
     84
    7585/* parse the input line, search for the corresponding command, and execute it
    7686   if no match is found, return -1; this is used above to distinguish between
  • trunk/Ohana/src/opihi/lib.shell/gprint.c

    r24028 r27255  
    305305  if (stream[0].mode == GP_FILE) {
    306306    status = vfprintf (stream[0].file, format, argp);
     307    fflush (stream[0].file);
    307308    if (status < 0) {
    308309      return (FALSE);
     
    325326  if (stream[0].mode == GP_FILE) {
    326327    fwrite (buffer, size, N, stream[0].file);
     328    fflush (stream[0].file);
    327329  } else {
    328330    // XXX can we not use exising IOBuffer APIs here?
  • trunk/Ohana/src/opihi/pantasks/test/threadload.sh

    r23530 r27255  
    3131  # default exit status
    3232  task.exit    default
    33     echo       "basic: exit status: $EXIT"
     33    echo       "basic: exit status: $JOB_STATUS"
    3434  end
    3535
     
    6565  # default exit status
    6666  task.exit    default
    67     echo       "basic: exit status: $EXIT"
     67    echo       "basic: exit status: $JOB_STATUS"
    6868  end
    6969
     
    9999  # default exit status
    100100  task.exit    default
    101     echo       "basic: exit status: $EXIT"
     101    echo       "basic: exit status: $JOB_STATUS"
    102102  end
    103103
Note: See TracChangeset for help on using the changeset viewer.