- Main Page
- Related Pages
- Modules
- Data Structures
- Files

# rpmsq.h

Go to the documentation of this file.

    00001 #ifndef H_RPMSQ
    00002 #define H_RPMSQ
    00003
    00009 #include <rpm/rpmsw.h>
    00010
    00011 #ifdef __cplusplus
    00012 extern "C" {
    00013 #endif
    00014
    00017 typedef struct rpmsig_s * rpmsig;
    00018
    00021 typedef struct rpmsqElem * rpmsq;
    00022
    00029 typedef void (*rpmsqAction_t) (int signum, void * info, void * context);
    00030
    00031 extern int _rpmsq_debug;
    00032
    00033 /* XXX make this fully opaque? */
    00034 #if defined(_RPMSQ_INTERNAL)
    00035
    00038 struct rpmsqElem {
    00039     struct rpmsqElem * q_forw;
    00040     struct rpmsqElem * q_back;
    00041     pid_t child;
    00042     volatile pid_t reaped;
    00043     volatile int status;
    00044     struct rpmop_s op;
    00045     rpmtime_t ms_scriptlets;
    00046     int reaper;
    00047     int pipes[2];
    00048     void * id;
    00049     pthread_mutex_t mutex;
    00050     pthread_cond_t cond;
    00051 };
    00052 #endif /* _RPMSQ_INTERNAL */
    00053
    00060 int rpmsqIsCaught(int signum);
    00061
    00068 void rpmsqAction(int signum, void * info, void * context);
    00069
    00076 int rpmsqEnable(int signum, rpmsqAction_t handler);
    00077
    00083 pid_t rpmsqFork(rpmsq sq);
    00084
    00090 pid_t rpmsqWait(rpmsq sq);
    00091
    00098 void * rpmsqThread(void * (*start) (void * arg), void * arg);
    00099
    00105 int rpmsqJoin(void * thread);
    00106
    00112 int rpmsqThreadEqual(void * thread);
    00113
    00117 int rpmsqExecve (const char ** argv);
    00118
    00119 #ifdef __cplusplus
    00120 }
    00121 #endif
    00122
    00123 #endif  /* H_RPMSQ */