#include <server.h>
Inheritance diagram for sipwitch::history:
Collaboration diagram for sipwitch::history:
Public Member Functions
history (shell::loglevel_t lid, const char *msg)
void
set (shell::loglevel_t lid, const char *msg)
Static Public Member Functions
static void
add (shell::loglevel_t lid, const char *msg)
static void
set (unsigned size)
static bool
send (const char *format,...) __PRINTF(1
Send a printf-style message to the control fifo via the file system.
More...
static bool static char *
receive (void)
Used by the server to pull pending fifo requests.
More...
static void
reply (const char *error=NULL)
Used by the server to send replies back to control requests.
More...
Creates the control fifo using server configuration.
More...
Used by the server to destroy the control fifo.
More...
Sets server run state configuration.
More...
static bool
libexec (const char *fmt,...) __PRINTF(1
Execute an external shell command on behalf of the server.
More...
static bool static FILE *
output (const char *id)
Used to open an output session for returning control data.
More...
static const char *
env (const char *id)
Return the value of a server environment variable.
More...
static String
path (const char *id)
Get a string from a server environment variable.
More...
static void
config (shell *envp)
Data Fields
Detailed Description
Constructor & Destructor Documentation
sipwitch::history::history
(
shell::loglevel_t
lid,
const char *
msg
)
Member Function Documentation
void sipwitch::history::add
(
shell::loglevel_t
lid,
const char *
msg
)
static
size_t sipwitch::control::attach
(
shell_t *
env )
staticinherited
Creates the control fifo using server configuration.
This also attaches the shell environment and command line arguments to the current server instance so it can be accessed by other things.
- Parameters
-
env of server.
- Returns
- size of longest control message supported.
Definition at line 61 of file control.cpp.
static void sipwitch::control::config
(
shell *
envp )
inlinestaticinherited
static const char* sipwitch::control::env
(
const char *
id )
inlinestaticinherited
Return the value of a server environment variable.
This is commonly used by plugins to get access to the server environment.
- Parameters
-
id of environment symbol.
- Returns
- value of symbol or NULL if not found.
Definition at line 131 of file control.h.
bool sipwitch::control::libexec
(
const char *
fmt,
...
)
staticinherited
Execute an external shell command on behalf of the server.
This might also be used by plugins to execute supporting processes. The function waits until the child process completes but does not return the child exit code.
- Parameters
-
format of shell command to execute.
- Returns
- true if successfully executed.
Definition at line 261 of file control.cpp.
void sipwitch::history::out
(
void
)
static
FILE * sipwitch::control::output
(
const char *
id )
staticinherited
Used to open an output session for returning control data.
- Parameters
-
id of output type.
- Returns
- file handle to write to or NULL on failure.
Definition at line 380 of file control.cpp.
static String sipwitch::control::path
(
const char *
id )
inlinestaticinherited
Get a string from a server environment variable.
This is often used to get pathname variables which may then be further concatenated. This is commonly used by plugins to get paths.
- Parameters
-
id of environment symbol.
- Returns
- string value of symbol requested.
Definition at line 141 of file control.h.
char * sipwitch::control::receive
(
void
)
staticinherited
Used by the server to pull pending fifo requests.
- Returns
- string of next fifo input.
Definition at line 87 of file control.cpp.
void sipwitch::control::release
(
void
)
staticinherited
Used by the server to destroy the control fifo.
Definition at line 81 of file control.cpp.
void sipwitch::control::reply
(
const char *
error = NULL )
staticinherited
Used by the server to send replies back to control requests.
- Parameters
-
error string to report or NULL for none.
Definition at line 218 of file control.cpp.
bool sipwitch::control::send
(
const char *
format,
...
)
staticinherited
Send a printf-style message to the control fifo via the file system.
While plugins can also use this to send control messages back into the server, we should create a method that does not require going to the external filesystem to do this.
- Parameters
-
format string.
- Returns
- true if successful.
Definition at line 309 of file control.cpp.
void sipwitch::history::set
(
shell::loglevel_t
lid,
const char *
msg
)
void sipwitch::history::set
(
unsigned
size )
static
bool sipwitch::control::state
(
const char *
value )
staticinherited
Sets server run state configuration.
This is done by symlinking a state xml file when selecting a special running state.
- Parameters
-
state to select.
- Returns
- true if set to state.
Definition at line 354 of file control.cpp.
Field Documentation
char sipwitch::history::text[128]
The documentation for this class was generated from the following files: