summaryrefslogtreecommitdiffabout
path: root/src/prog.h
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-12 12:25:26 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-02-12 12:25:26 (GMT)
commit05f16374d677f7c606d5100df3ca3499b9891aca (patch) (side-by-side diff)
treeefa6177f87df2ba1e9f63edec6cc55cb621c9745 /src/prog.h
parentd9d267052215f223897af18310e4adee310308e7 (diff)
downloadpies-05f16374d677f7c606d5100df3ca3499b9891aca.tar.gz
pies-05f16374d677f7c606d5100df3ca3499b9891aca.tar.bz2
Improve progman API (progman_foreach and progman_stop_component).
* src/progman.c (progman_foreach): Allow filter to remove its prog argument from the list. Return integer (result of the call to filter, that returned non-zero). All uses changed. (progman_running_count): Remove. (progman_stop_component): Take a pointer to pointer. Pass it to destroy_prog when needed. All uses changed. * src/comp.c (prog_is_leftover): New function. (cb_terminate_prog): Use prog_is_leftover. Don't raise CF_DISABLED flag, as prog will have been destroyed by progman_stop_component. (cb_kill_prog): Use prog_is_leftover. * src/ctl.c (fun_stop): Check if prog still exists after the call to progman_stop_component. * src/pies.h (progman_running_count): Removed. * src/prog.h (progman_foreach): Return int. (progman_stop_component): Change signature.
Diffstat (limited to 'src/prog.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/prog.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/prog.h b/src/prog.h
index fe42d3a..2dc8591 100644
--- a/src/prog.h
+++ b/src/prog.h
@@ -84,8 +84,8 @@ struct prog
#define IS_COMPONENT(p) ((p)->type == TYPE_COMPONENT)
struct prog *progman_locate (const char *name);
-void progman_foreach (int (*filter) (struct prog *, void *data), void *data);
+int progman_foreach (int (*filter) (struct prog *, void *data), void *data);
void prog_stop (struct prog *prog, int sig);
-void progman_stop_component (struct prog *prog);
+void progman_stop_component (struct prog **prog);
char const *prog_tag (struct prog const *prog);

Return to:

Send suggestions and report system problems to the System administrator.