]> git.pld-linux.org Git - packages/poldek.git/blame - poldek-sigint_emit.patch
- git fixes, config fixes
[packages/poldek.git] / poldek-sigint_emit.patch
CommitLineData
517e249f 1diff -urN poldek-0.30-cvs20080225.00/libpoldek.sym poldek-0.30-cvs20080225.00.new/libpoldek.sym
2--- poldek-0.30-cvs20080225.00/libpoldek.sym 2008-04-08 19:25:12.000000000 +0200
3+++ poldek-0.30-cvs20080225.00.new/libpoldek.sym 2008-04-08 19:26:26.000000000 +0200
4@@ -261,6 +261,7 @@
5 sigint_destroy
6 sigint_init
7 sigint_enable
8+sigint_emit
9 sigint_pop
10 sigint_push
11 sigint_reached
12diff -urN poldek-0.30-cvs20080225.00/sigint/sigint.c poldek-0.30-cvs20080225.00.new/sigint/sigint.c
13--- poldek-0.30-cvs20080225.00/sigint/sigint.c 2008-02-02 22:49:05.000000000 +0100
14+++ poldek-0.30-cvs20080225.00.new/sigint/sigint.c 2008-04-08 19:12:37.000000000 +0200
15@@ -48,6 +48,21 @@
16 orig_sighandler(sig);
17 }
18
19+void sigint_emit (void)
20+{
21+ int i;
22+
23+ if (enabled == 0)
24+ return;
25+
26+ interrupted = 1;
27+
28+ for (i = 0; i < n_array_size (cb_stack); i++) {
29+ void (*cb)(void) = n_array_nth (cb_stack, i);
30+
31+ cb ();
32+ }
33+}
34
35 void sigint_enable(int v)
36 {
37diff -urN poldek-0.30-cvs20080225.00/sigint/sigint.h poldek-0.30-cvs20080225.00.new/sigint/sigint.h
38--- poldek-0.30-cvs20080225.00/sigint/sigint.h 2008-02-02 22:38:26.000000000 +0100
39+++ poldek-0.30-cvs20080225.00.new/sigint/sigint.h 2008-04-08 19:22:41.000000000 +0200
40@@ -6,7 +6,12 @@
41 void sigint_destroy(void);
42 void sigint_reset(void);
43
44-void sigint_reset(void);
45+/*
46+ * emit sigint. Can be used in some external applications
47+ * using libpoldek to interrupt given action (eg. searching,
48+ * processing dependencies and others)
49+ */
50+void sigint_emit(void);
51
52 void sigint_push(void (*cb)(void));
53 void *sigint_pop(void);
This page took 0.033195 seconds and 4 git commands to generate.