API to access console manager


Classes

struct  cons_info_t
struct  cons_proc_t

Defines

#define CONS_STATUS_STARTED   0x01
 process has started
#define CONS_STATUS_NOTIFIED   0x02
 process has startup notified
#define CONS_STATUS_DIED   0x04
 process has exited
#define CONS_STATUS_TERMINATED   0x10
 process is going to be terminated
#define CONS_STATUS_KILLED   0x08
 process is going to die

Functions

int cons_set_name (char *consolename)
int cons_get_name (char *consolename, int len)
int cons_cmd_local (char *cmd)
int cons_cmd (char *cmd)
int cons_cmd_sync (char *cmd)
int parse_cmd (char *cmd, xcons_request_t *preq)
int cons_info (cons_info_t *pinfo)
int cons_print_status (int status, char *buf, int buflen)
int cons_proc_check (char *proc, cons_proc_t *pstatus)
int cons_proc_set (char *proc, cons_proc_t *pstatus)
int cons_proc_init (void)
char * cons_get_logenv (void)
char * cons_get_logsuf (void)
char * cons_get_logname (void)

Function Documentation

int cons_cmd_local ( char *  cmd  ) 

Send command to console manager

The format of command refers to vms console manager command format:

start program: P+[C] name

stop program: P-[C] name

add program: P>[C] name [command] [runlevel]

remove program: P<[C] name

execute program (i.e. insert, start, remove): P%[C] name [command]

start programs with runlevel between min and max: P*[C] min max

set program as running: P![C] name

quit consmngr: Pq

set beamline: B

Parameters:
cmd command to execute
Returns:
  • 0: Ok
  • else: error

char* cons_get_logenv ( void   ) 

Get environment name for log messages path

char* cons_get_logname ( void   ) 

absolute pathname/filename of log-pipe (the file name i.e. console name is determined by environment of the console manager, so any program running in the enviroment of the console can achieve with this function its corresponding log pipe)

char* cons_get_logsuf ( void   ) 

Suffix of log pipe of console manager

int cons_get_name ( char *  consolename,
int  len 
)

Get the console name from environment

Parameters:
consolename name of console
len length of buffer to store consolename
Returns:
  • 0: OK
  • else: error

int cons_info ( cons_info_t pinfo  ) 

Get console info, i.e. name and node info

Parameters:
pinfo where console info is stored
Returns:
  • 0: Ok
  • else: error

int cons_print_status ( int  status,
char *  buf,
int  buflen 
)

Print status as textual representatio

Parameters:
status status to print
buf buffer where text is dumped
buflen length of buffer
Returns:
  • bytecount written to buf
  • <0 error

int cons_proc_check ( char *  proc,
cons_proc_t pstatus 
)

Check process status

Parameters:
proc name of process
pstatus where status object is stored
Returns:
  • 0: Ok
  • else: error

int cons_proc_init ( void   ) 

Reset proc table

Returns:
  • 0: Ok
  • else: error

int cons_proc_set ( char *  proc,
cons_proc_t pstatus 
)

Set process status

Parameters:
proc name of process
pstatus status to set
Returns:
  • 0: Ok
  • else: error

int cons_set_name ( char *  consolename  ) 

Set the console name in environment (this function is mainly for console manager itself)

Parameters:
consolename name of console we want to set
Returns:
  • 0: OK
  • else: error

int parse_cmd ( char *  cmd,
xcons_request_t *  preq 
)

Parse a command line and fill the xcons request structure (this function is mainly to be used as utility funciton for the consolemanager in zd mode

Parameters:
cmd command line
preq pointer to the request structure to be filled
Returns:
  • 0: OK
  • else: error


Generated on 4 Mar 2014 for consintf by  doxygen 1.4.7