# include "pantasks.h"

int controller      PROTO((int, char **));
int task	    PROTO((int, char **));
int task_host	    PROTO((int, char **));
int task_nmax	    PROTO((int, char **));
int task_trange	    PROTO((int, char **));
int task_macros	    PROTO((int, char **));
int task_command    PROTO((int, char **));
int task_options    PROTO((int, char **));
int task_periods    PROTO((int, char **));
int pulse           PROTO((int, char **));
int status_server   PROTO((int, char **));
int kill_job        PROTO((int, char **));
int delete_job      PROTO((int, char **));
int verbose         PROTO((int, char **));
int version         PROTO((int, char **));
int server          PROTO((int, char **));
int ipptool2book    PROTO((int, char **));

static Command cmds[] = {  
  {"controller", controller,   	"controller commands"},
  {"task",       task,         	"define a schedulable task"},
  {"host",       task_host,    	"define host machine for a task"},
  {"nmax",       task_nmax,    	"define maximum number of jobs for a task"},
  {"trange",     task_trange,  	"define valid/invalid time periods for a task"},
  {"task.exit",  task_macros,  	"define exit macros for a task"},
  {"task.exec",  task_macros,  	"define pre-exec macro for a task"},
  {"command",    task_command, 	"define executed command for a task"},
  {"options",    task_options, "define optional variables associated with the job task"},
  {"periods",    task_periods, 	"define time scales for a task"},
  {"pulse",      pulse,        	"set the scheduler update period"},
  {"server",     server,       	"server-specific commands"},
  {"status",     status_server, "get system status"},
  {"kill",       kill_job,     	"kill job"},
  {"delete",     delete_job,   	"delete job"},
  {"version",    version,      	"show version information"},
  {"verbose",    verbose,      	"set/toggle verbose mode"},
  {"ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
}; 

void InitPantasksServer () {
  
  int i;

  InitTasks ();
  InitJobs ();
  InitJobIDs ();

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