]> mj.ucw.cz Git - libucw.git/blob - ucw/process.h
tableprinter: code cleanup contd.
[libucw.git] / ucw / process.h
1 /*
2  *      UCW Library -- Processes
3  *
4  *      (c) 2012 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #ifndef _UCW_PROCESS_H
11 #define _UCW_PROCESS_H
12
13 #ifdef CONFIG_UCW_CLEAN_ABI
14 #define echo_command ucw_echo_command
15 #define echo_command_v ucw_echo_command_v
16 #define exec_command ucw_exec_command
17 #define exec_command_v ucw_exec_command_v
18 #define format_exit_status ucw_format_exit_status
19 #define getproctitle ucw_getproctitle
20 #define run_command ucw_run_command
21 #define run_command_v ucw_run_command_v
22 #define setproctitle ucw_setproctitle
23 #define setproctitle_init ucw_setproctitle_init
24 #endif
25
26 /* proctitle.c */
27
28 // Must be called before parsing of arguments
29 void setproctitle_init(int argc, char **argv);
30 void setproctitle(const char *msg, ...) FORMAT_CHECK(printf,1,2);
31 char *getproctitle(void);
32
33 /* exitstatus.c */
34
35 #define EXIT_STATUS_MSG_SIZE 64
36 int format_exit_status(char *msg, int stat);
37
38 /* runcmd.c */
39
40 int run_command(const char *cmd, ...);
41 void NONRET exec_command(const char *cmd, ...);
42 void echo_command(char *buf, int size, const char *cmd, ...);
43 int run_command_v(const char *cmd, va_list args);
44 void NONRET exec_command_v(const char *cmd, va_list args);
45 void echo_command_v(char *buf, int size, const char *cmd, va_list args);
46
47 #endif  /* !_UCW_PROCESS_H */