rush
Revamped UNIX Shell
plist.h
Go to the documentation of this file.
1 
22 #ifndef PLIST_H
23 #define PLIST_H
24 
25 
26 #include <stdbool.h>
27 #include <sys/types.h>
28 
29 
31 typedef struct {
32  pid_t pid;
33  char *cmdLine;
34  bool background;
35 } ProcInfo;
36 
37 
58 const ProcInfo *plistAdd(pid_t pid, const char cmdLine[], bool background);
59 
73 const ProcInfo *plistGet(pid_t pid);
74 
86 int plistRemove(pid_t pid);
87 
107 int plistIterate(int (*callback)(const ProcInfo *));
108 
129 int plistNotifyEvent(pid_t pid, int event);
130 
157 int plistHandleEvents(int (*callback)(const ProcInfo *, int));
158 
159 
160 #endif /* PLIST_H */
int plistNotifyEvent(pid_t pid, int event)
Notifies the process list that a process has changed its state.
int plistRemove(pid_t pid)
Removes a specific process from the list.
int plistIterate(int(*callback)(const ProcInfo *))
Invokes a callback function on each element in the list whose state has not changed since the last ca...
int plistHandleEvents(int(*callback)(const ProcInfo *, int))
Invokes a callback function on each element in the list whose state has changed since the last call t...
const ProcInfo * plistGet(pid_t pid)
const ProcInfo * plistAdd(pid_t pid, const char cmdLine[], bool background)
Adds a new process to the list.
Process-information structure.
Definition: plist.h:31
char * cmdLine
Definition: plist.h:33
bool background
Definition: plist.h:34
pid_t pid
Definition: plist.h:32