diff options
author | t3sserakt <t3ss@posteo.de> | 2021-04-25 16:01:49 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-04-25 16:01:49 +0200 |
commit | 9ffa19269054bf1e569fe584c0c51a00205a735d (patch) | |
tree | f7e79c09d957ba2836c986aeeb07ffc0d56e4087 /src/include/gnunet_child_management_lib.h | |
parent | 11f5b0148a8343c776b2562494840ad2963959fb (diff) | |
download | gnunet-9ffa19269054bf1e569fe584c0c51a00205a735d.tar.gz gnunet-9ffa19269054bf1e569fe584c0c51a00205a735d.zip |
- added testing cmd child management
Diffstat (limited to 'src/include/gnunet_child_management_lib.h')
-rw-r--r-- | src/include/gnunet_child_management_lib.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/include/gnunet_child_management_lib.h b/src/include/gnunet_child_management_lib.h new file mode 100644 index 000000000..465f71f0e --- /dev/null +++ b/src/include/gnunet_child_management_lib.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file include/anastasis_util_lib.h | ||
23 | * @brief GNUnet child management api | ||
24 | * @author Christian Grothoff | ||
25 | * @author Dominik Meister | ||
26 | * @author Dennis Neufeld | ||
27 | * @author t3sserakt | ||
28 | */ | ||
29 | #ifndef GNUNET_CHILD_MANAGEMENT_LIB_H | ||
30 | #define GNUNET_CHILD_MANAGEMENT_LIB_H | ||
31 | |||
32 | /** | ||
33 | * Handle for the child management | ||
34 | */ | ||
35 | struct GNUNET_ChildWaitHandle; | ||
36 | |||
37 | /** | ||
38 | * Defines a GNUNET_ChildCompletedCallback which is sent back | ||
39 | * upon death or completion of a child process. | ||
40 | * | ||
41 | * @param cls handle for the callback | ||
42 | * @param type type of the process | ||
43 | * @param exit_code status code of the process | ||
44 | * | ||
45 | */ | ||
46 | typedef void | ||
47 | (*GNUNET_ChildCompletedCallback)(void *cls, | ||
48 | enum GNUNET_OS_ProcessStatusType type, | ||
49 | long unsigned int exit_code); | ||
50 | |||
51 | /** | ||
52 | * Starts the handling of the child processes. | ||
53 | * Function checks the status of the child process and sends back a | ||
54 | * GNUNET_ChildCompletedCallback upon completion/death of the child. | ||
55 | * | ||
56 | * @param proc child process which is monitored | ||
57 | * @param cb reference to the callback which is called after completion | ||
58 | * @param cb_cls closure for the callback | ||
59 | * @return GNUNET_ChildWaitHandle is returned | ||
60 | */ | ||
61 | struct GNUNET_ChildWaitHandle * | ||
62 | GNUNET_wait_child (struct GNUNET_OS_Process *proc, | ||
63 | GNUNET_ChildCompletedCallback cb, | ||
64 | void *cb_cls); | ||
65 | |||
66 | /** | ||
67 | * Stop waiting on this child. | ||
68 | */ | ||
69 | void | ||
70 | GNUNET_wait_child_cancel (struct GNUNET_ChildWaitHandle *cwh); | ||
71 | |||
72 | #endif | ||