The Assimilation Project  based on Assimilation version 1.1.7.1474836767
childprocess.h
Go to the documentation of this file.
1 
24 #ifndef _CHILDPROCESS_H
25 # define _CHILDPROCESS_H
26 #include <projectcommon.h>
27 #include <configcontext.h>
28 #include <assimobj.h>
29 #include <logsourcefd.h>
30 
33 typedef struct _ChildProcess ChildProcess;
34 
35 enum HowDied {
36  NOT_EXITED = 0,
43 };
44 
50 };
51 
52 
53 struct _ChildProcess {
55  GPid child_pid;
58  guint timeout;
59  guint timeoutsrc_id;
60  guint childsrc_id;
61  gint child_state;
62  char * loggingname;
64  char ** argv;
65  char ** envp;
66  char * curdir;
67  void (*notify)(ChildProcess*, enum HowDied, int rc, int signal, gboolean core_dumped);
69  gpointer user_data;
70 
71 };
72 
73 WINEXPORT ChildProcess* childprocess_new(gsize cpsize, char** argv, const char** envp, ConfigContext* envmod
74 , const char* curdir
75 , void (*notify)(ChildProcess*, enum HowDied, int rc, int signal, gboolean core_dumped)
76 , gboolean save_stdout, const char * logdomain, const char * logprefix
77 , GLogLevelFlags loglevel, guint32 timeout_seconds, gpointer user_data
78 , enum ChildErrLogMode errlogmode, const char * loggingname);
79 
81 #endif/*CHILDPROCESS_H*/
Log all exits - normal or abnormal.
Definition: childprocess.h:49
Timed out and would not die.
Definition: childprocess.h:41
WINEXPORT ChildProcess * childprocess_new(gsize cpsize, char **argv, const char **envp, ConfigContext *envmod, const char *curdir, void(*notify)(ChildProcess *, enum HowDied, int rc, int signal, gboolean core_dumped), gboolean save_stdout, const char *logdomain, const char *logprefix, GLogLevelFlags loglevel, guint32 timeout_seconds, gpointer user_data, enum ChildErrLogMode errlogmode, const char *loggingname)
ChildProcess class. constructor.
Definition: childprocess.c:85
#define WINEXPORT
Definition: projectcommon.h:45
gpointer user_data
User data given to us when the object was created.
Definition: childprocess.h:69
int signal
Definition: childprocess.c:238
This file defines our base object class: AssimObj.
enum ChildErrLogMode logmode
Which types of exits should we log.
Definition: childprocess.h:63
guint timeout
Timeout value for this child.
Definition: childprocess.h:58
guint childsrc_id
GSource id for the child process.
Definition: childprocess.h:60
Exited with a signal.
Definition: childprocess.h:39
void(* notify)(ChildProcess *, enum HowDied, int rc, int signal, gboolean core_dumped)
Called when it exits.
Definition: childprocess.h:67
Log signal, timeouts, or non-zero exits.
Definition: childprocess.h:48
char * loggingname
Name to use when logging process exits.
Definition: childprocess.h:62
GPid child_pid
The GPid returned from spawning this object.
Definition: childprocess.h:55
char ** envp
Environment list for this child (malloced)
Definition: childprocess.h:65
GMainFd * stdout_src
GSource for logging/saving the standard output of child.
Definition: childprocess.h:56
Project common header file.
Was not attempted - invalid request.
Definition: childprocess.h:42
gint child_state
State for the child process.
Definition: childprocess.h:61
Don&#39;t log anything when it quits.
Definition: childprocess.h:46
Implements Configuration Context class.
Still running - should never be returned...
Definition: childprocess.h:36
char ** argv
Argument list for this child (malloced)
Definition: childprocess.h:64
AssimObj baseclass
Our base class.
Definition: childprocess.h:54
char * curdir
Starting directory for this child (malloced)
Definition: childprocess.h:66
HowDied
Definition: childprocess.h:35
Exited with nonzero return code.
Definition: childprocess.h:38
LogSourceFd * stderr_src
GSource for logging the standard error of this child.
Definition: childprocess.h:57
guint timeoutsrc_id
GSource id for the timeout for this child to complete.
Definition: childprocess.h:59
Timed out and was killed.
Definition: childprocess.h:40
Exited with zero return code.
Definition: childprocess.h:37
ChildErrLogMode
Definition: childprocess.h:45
Implements a gmainloop source for reading file descriptor pipes.
Log only death by signal or timeout.
Definition: childprocess.h:47