JACK Plugin Launcher
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
loader.h File Reference

Interface to the code that starts programs (launcher module) More...

Go to the source code of this file.

Classes

struct  jpl_child_tag
 

Typedefs

typedef struct jpl_child_tagjpl_child_handle
 
typedef void(* jpl_on_child_exit) (void *ctx, int exit_status)
 function type for callback called on child exit
 
typedef void(* jpl_log_callback) (void *ctx, bool error, const char *format,...)
 function type for callback called on child exit
 

Functions

void jpl_init (jpl_on_child_exit on_child_exit, jpl_log_callback log_callback)
 initialize the launcher module
 
bool jpl_execute (void *ctx, const char *working_dir, bool run_in_terminal, const char *commandline, const char *const *env_vars, const char *const *ldpreload, pid_t *pid_ptr, jpl_child_handle *child_handle_ptr)
 run child program in a subprocess
 
void jpl_run (void)
 Read subprocess output and call the callbacks.
 
void jpl_uninit (void)
 uninitialize the launcher module
 
unsigned int jpl_get_app_count (void)
 get number of child processes
 

Detailed Description

Interface to the code that starts programs (launcher module)

Typedef Documentation

◆ jpl_child_handle

typedef struct jpl_child_tag * jpl_child_handle

Handle to object describing child

◆ jpl_log_callback

typedef void(* jpl_log_callback) (void *ctx, bool error, const char *format,...)

function type for callback called on child exit

Parameters
ctxcontext pointer with value as supplied by call to jpl_execute()
errorwhether line from stderr (true) is being logged or from stdout (false)
formatformat string
...optional args, as specified by format parameter

◆ jpl_on_child_exit

typedef void(* jpl_on_child_exit) (void *ctx, int exit_status)

function type for callback called on child exit

Parameters
ctxcontext pointer with value as supplied by call to jpl_execute()
exit_statusExit status of the child process

Function Documentation

◆ jpl_execute()

bool jpl_execute ( void *  ctx,
const char *  working_dir,
bool  run_in_terminal,
const char *  commandline,
const char *const *  env_vars,
const char *const *  ldpreload,
pid_t *  pid_ptr,
jpl_child_handle child_handle_ptr 
)

run child program in a subprocess

Parameters
ctxcontext pointer that will be passed as parameter when functions, previously specified int the jpl_init() call, are called.
working_dirworking dir where the program is started
run_in_terminalwhether to run the child program in a new terminal
commandlinecommand-line to use for starting the child process
env_varsoptional (can be NULL) array of strings for environment variables to be set in the child process the array is terminated by empty string element.
ldpreloadoptional (can be NULL) array of strings for LD_PRELOAD-ed libraries. the array is terminated by empty string element.
pid_ptrpointer to variable where, upon successful return, the child process identifier value will be stored.
child_handle_ptrpointer to variable where, upon successful return, child handle is stored.
Returns
success status

◆ jpl_init()

void jpl_init ( jpl_on_child_exit  on_child_exit,
jpl_log_callback  log_callback 
)

initialize the launcher module

Parameters
on_child_exitfunction to call back when child exits
log_callbackfunction to call back child produces a line