diff options
Diffstat (limited to 'src/include/anastasis_util_lib.h')
-rw-r--r-- | src/include/anastasis_util_lib.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/include/anastasis_util_lib.h b/src/include/anastasis_util_lib.h new file mode 100644 index 0000000..9515c20 --- /dev/null +++ b/src/include/anastasis_util_lib.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | This file is part of Anastasis | ||
3 | Copyright (C) 2020 Taler Systems SA | ||
4 | |||
5 | Anastasis is free software; you can redistribute it and/or modify it under the | ||
6 | terms of the GNU Lesser General Public License as published by the Free Software | ||
7 | Foundation; either version 3, or (at your option) any later version. | ||
8 | |||
9 | Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY | ||
10 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
11 | A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with | ||
14 | Anastasis; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> | ||
15 | */ | ||
16 | /** | ||
17 | * @file include/anastasis_util_lib.h | ||
18 | * @brief anastasis client api | ||
19 | * @author Christian Grothoff | ||
20 | * @author Dominik Meister | ||
21 | * @author Dennis Neufeld | ||
22 | */ | ||
23 | #ifndef ANASTASIS_UTIL_LIB_H | ||
24 | #define ANASTASIS_UTIL_LIB_H | ||
25 | |||
26 | #include "anastasis_error_codes.h" | ||
27 | #define GNU_TALER_ERROR_CODES_H 1 | ||
28 | #include <gnunet/gnunet_util_lib.h> | ||
29 | #include <taler/taler_util.h> | ||
30 | |||
31 | |||
32 | /** | ||
33 | * Return default project data used by Anastasis. | ||
34 | */ | ||
35 | const struct GNUNET_OS_ProjectData * | ||
36 | ANASTASIS_project_data_default (void); | ||
37 | |||
38 | |||
39 | /** | ||
40 | * Handle for the child management | ||
41 | */ | ||
42 | struct ANASTASIS_ChildWaitHandle; | ||
43 | |||
44 | /** | ||
45 | * Defines a ANASTASIS_ChildCompletedCallback which is sent back | ||
46 | * upon death or completion of a child process. Used to trigger | ||
47 | * authentication commands. | ||
48 | * | ||
49 | * @param cls handle for the callback | ||
50 | * @param type type of the process | ||
51 | * @param exit_code status code of the process | ||
52 | * | ||
53 | */ | ||
54 | typedef void | ||
55 | (*ANASTASIS_ChildCompletedCallback)(void *cls, | ||
56 | enum GNUNET_OS_ProcessStatusType type, | ||
57 | long unsigned int exit_code); | ||
58 | |||
59 | |||
60 | /** | ||
61 | * Starts the handling of the child processes. | ||
62 | * Function checks the status of the child process and sends back a | ||
63 | * ANASTASIS_ChildCompletedCallback upon completion/death of the child. | ||
64 | * | ||
65 | * @param proc child process which is monitored | ||
66 | * @param cb reference to the callback which is called after completion | ||
67 | * @param cb_cls closure for the callback | ||
68 | * @return ANASTASIS_ChildWaitHandle is returned | ||
69 | */ | ||
70 | struct ANASTASIS_ChildWaitHandle * | ||
71 | ANASTASIS_wait_child (struct GNUNET_OS_Process *proc, | ||
72 | ANASTASIS_ChildCompletedCallback cb, | ||
73 | void *cb_cls); | ||
74 | |||
75 | /** | ||
76 | * Stop waiting on this child. | ||
77 | */ | ||
78 | void | ||
79 | ANASTASIS_wait_child_cancel (struct ANASTASIS_ChildWaitHandle *cwh); | ||
80 | |||
81 | |||
82 | #endif | ||