# include "pcontrol.h"

int check       PROTO((int, char **));
int delete      PROTO((int, char **));
int host        PROTO((int, char **));
int hoststack   PROTO((int, char **));
int job	        PROTO((int, char **));
int jobstack    PROTO((int, char **));
int kill_pc     PROTO((int, char **));
int status      PROTO((int, char **));
int run         PROTO((int, char **));
int stderr_pc   PROTO((int, char **));
int stdout_pc   PROTO((int, char **));
int verbose     PROTO((int, char **));
int version     PROTO((int, char **));

// pulse is only available in the un-threaded version
int pulse       PROTO((int, char **));

static Command cmds[] = {  
  {"host",      host,      "add / delete / modify host"},
  {"hoststack", hoststack, "list hosts for a single stack"},
  {"status",    status,    "get system status"},
  {"stop",      run,       "stop controller processing"},
  {"run",       run,       "set controller runlevel"},
  {"verbose",   verbose,   "set the verbose mode for job"},
  {"version",   version,   "show version information"},
  {"job",       job,       "add job"},
  {"jobstack",  jobstack,  "list jobs for a single stack"},
  {"check",     check,     "get job or host status"},
  {"delete",    delete,    "delete job"},
  {"kill",      kill_pc,   "kill job"},
  {"stderr",    stderr_pc, "get stderr buffer for job"},
  {"stdout",    stdout_pc, "get stdout buffer for job"},
# ifndef THREADED
  {"pulse",     pulse,     "set system pulse"},
# endif
}; 

void InitPcontrol () {
  
  int i;

  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
    AddCommand (&cmds[i]);
  }
}
