]> mj.ucw.cz Git - libucw.git/commitdiff
Moved process-related functions to ucw/process.h
authorMartin Mares <mj@ucw.cz>
Thu, 9 Feb 2012 22:16:51 +0000 (23:16 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 9 Feb 2012 22:16:51 +0000 (23:16 +0100)
ucw/Makefile
ucw/exitstatus.c
ucw/lib.h
ucw/mainloop.c
ucw/mainloop.h
ucw/process.h [new file with mode: 0644]
ucw/proctitle.c
ucw/runcmd.c
ucw/shell/logoutput.c

index d33b01fbb3b43ae31f412522f11af1fb9f5699fa..77c5a08fd1f76193ead5722221686cbf75331951 100644 (file)
@@ -12,7 +12,7 @@ LIBUCW_MODS= \
        alloc alloc_str realloc bigalloc mempool mempool-str mempool-fmt eltpool \
        partmap hashfunc \
        slists simple-lists bitsig \
-       log log-stream log-file log-syslog log-conf proctitle tbf \
+       log log-stream log-file log-syslog log-conf tbf \
        conf-alloc conf-dump conf-input conf-intr conf-journal conf-parse conf-section \
        ipaccess \
        fastbuf ff-binary ff-string ff-printf ff-unicode ff-stkstring \
@@ -23,7 +23,7 @@ LIBUCW_MODS= \
        bit-ffs bit-fls \
        url \
        mainloop main-block main-rec \
-       exitstatus runcmd sighandler \
+       proctitle exitstatus runcmd sighandler \
        lizard lizard-safe adler32 \
        md5 sha1 sha1-hmac \
        base64 base224 \
@@ -51,6 +51,7 @@ LIBUCW_MAIN_INCLUDES= \
        fastbuf.h io.h ff-unicode.h ff-binary.h \
        url.h \
        mainloop.h \
+       process.h \
        lizard.h \
        md5.h sha1.h \
        base64.h base224.h \
index 4c04d49c69a2c7f944485ab883974580e63207f7..1d7b70a46589c36993134bdcf569e8457aad719f 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "ucw/lib.h"
+#include "ucw/process.h"
 
 #include <stdio.h>
 #include <sys/wait.h>
index 2b76b7a37d5e02c457928bb29021125759f433ca..29c2d236c9346f3088aea0dae05a11cb9fb7b23f 100644 (file)
--- a/ucw/lib.h
+++ b/ucw/lib.h
@@ -181,26 +181,6 @@ uns random_max(uns max);                   /** Return a pseudorandom 32-bit number in range [0,@
 u64 random_u64(void);                          /** Return a pseudorandom 64-bit number. **/
 u64 random_max_u64(u64 max);                   /** Return a pseudorandom 64-bit number in range [0,@max). **/
 
-/* proctitle.c */
-
-void setproctitle_init(int argc, char **argv);
-void setproctitle(const char *msg, ...) FORMAT_CHECK(printf,1,2);
-char *getproctitle(void);
-
-/* exitstatus.c */
-
-#define EXIT_STATUS_MSG_SIZE 32
-int format_exit_status(char *msg, int stat);
-
-/* runcmd.c */
-
-int run_command(const char *cmd, ...);
-void NONRET exec_command(const char *cmd, ...);
-void echo_command(char *buf, int size, const char *cmd, ...);
-int run_command_v(const char *cmd, va_list args);
-void NONRET exec_command_v(const char *cmd, va_list args);
-void echo_command_v(char *buf, int size, const char *cmd, va_list args);
-
 /* sighandler.c */
 
 typedef int (*ucw_sighandler_t)(int);  // gets signum, returns nonzero if abort() should be called
index 23eed5e14a4874c6134a4eaed5508bef2438bc6c..3c9dc623b4a4916648655ba2f6e17c8d23d98ceb 100644 (file)
@@ -14,6 +14,7 @@
 #include "ucw/mainloop.h"
 #include "ucw/threads.h"
 #include "ucw/gary.h"
+#include "ucw/process.h"
 
 #include <stdio.h>
 #include <string.h>
index 0a4a8bbf78a88b89a35d594eff50cf8c39277d2c..336439beed7ed0cc881d628d581dd34c51e9f601 100644 (file)
@@ -11,6 +11,7 @@
 #define _UCW_MAINLOOP_H
 
 #include "ucw/clists.h"
+#include "ucw/process.h"
 
 #include <signal.h>
 
diff --git a/ucw/process.h b/ucw/process.h
new file mode 100644 (file)
index 0000000..1bbeeda
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *     UCW Library -- Processes
+ *
+ *     (c) 2012 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
+ */
+
+#ifndef _UCW_PROCESS_H
+#define _UCW_PROCESS_H
+
+/* proctitle.c */
+
+void setproctitle_init(int argc, char **argv);
+void setproctitle(const char *msg, ...) FORMAT_CHECK(printf,1,2);
+char *getproctitle(void);
+
+/* exitstatus.c */
+
+#define EXIT_STATUS_MSG_SIZE 32
+int format_exit_status(char *msg, int stat);
+
+/* runcmd.c */
+
+int run_command(const char *cmd, ...);
+void NONRET exec_command(const char *cmd, ...);
+void echo_command(char *buf, int size, const char *cmd, ...);
+int run_command_v(const char *cmd, va_list args);
+void NONRET exec_command_v(const char *cmd, va_list args);
+void echo_command_v(char *buf, int size, const char *cmd, va_list args);
+
+#endif /* !_UCW_PROCESS_H */
index c1f8ff78c00e1ee74d7367a8b6846285582f5bf3..1862f0b5c3b9f36942c5646e27619c493726979a 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "ucw/lib.h"
+#include "ucw/process.h"
 
 #include <stdio.h>
 #include <string.h>
index 9670187df38069f3d4005b3c5f054323dcc80ac9..6f82d40ef79f0469c5aa9a1d460d96456d3e9cda 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "ucw/lib.h"
+#include "ucw/process.h"
 
 #include <stdlib.h>
 #include <string.h>
index 3705ce4bc2bec2b937cf1dc019fed8d8aa04c30b..aa0c2f47f6dfdca8ebf9273eb00cb4db7a30461a 100644 (file)
@@ -16,6 +16,7 @@
 #include "ucw/clists.h"
 #include "ucw/getopt.h"
 #include "ucw/conf.h"
+#include "ucw/process.h"
 
 #include <stdio.h>
 #include <string.h>