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
31typedef struct {
32 pid_t pid;
33 char *cmdLine;
35} ProcInfo;
36
37
58const ProcInfo *plistAdd(pid_t pid, const char cmdLine[], bool background);
59
73const ProcInfo *plistGet(pid_t pid);
74
86int plistRemove(pid_t pid);
87
107int plistIterate(int (*callback)(const ProcInfo *));
108
129int plistNotifyEvent(pid_t pid, int event);
130
157int 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.
const ProcInfo * plistGet(pid_t pid)
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...
const ProcInfo * plistAdd(pid_t pid, const char cmdLine[], bool background)
Adds a new process to the list.
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...
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