GNUnet  0.20.0
gnunet_helper_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2011, 2012 Christian Grothoff
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 
41 #if ! defined (__GNUNET_UTIL_LIB_H_INSIDE__)
42 #error "Only <gnunet_util_lib.h> can be included directly."
43 #endif
44 
45 #ifndef GNUNET_HELPER_LIB_H
46 #define GNUNET_HELPER_LIB_H
47 
48 
49 #include "gnunet_mst_lib.h"
50 
51 
56 
57 
64 typedef void
65 (*GNUNET_HELPER_ExceptionCallback) (void *cls);
66 
67 
84 struct GNUNET_HELPER_Handle *
86  const char *binary_name,
87  char *const binary_argv[],
90  void *cb_cls);
91 
92 
104  int soft_kill);
105 
106 
117 
118 
124 void
126 
127 
136 void
137 GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill);
138 
139 
148 typedef void
150  void *cls,
152 
153 
158 
159 
175  const struct GNUNET_MessageHeader *msg,
176  int can_drop,
178  void *cont_cls);
179 
180 
187 void
189 
190 
191 #endif
192 /* end of include guard: GNUNET_HELPER_LIB_H */
193  /* end of group */
195  /* end of group addition */
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct SolverHandle * sh
static int result
Global testing status.
Library for tokenizing a message stream.
void GNUNET_HELPER_send_cancel(struct GNUNET_HELPER_SendHandle *sh)
Cancel a GNUNET_HELPER_send operation.
Definition: helper.c:655
struct GNUNET_HELPER_SendHandle * GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h, const struct GNUNET_MessageHeader *msg, int can_drop, GNUNET_HELPER_Continuation cont, void *cont_cls)
Send an message to the helper.
Definition: helper.c:615
struct GNUNET_HELPER_Handle * GNUNET_HELPER_start(int with_control_pipe, const char *binary_name, char *const binary_argv[], GNUNET_MessageTokenizerCallback cb, GNUNET_HELPER_ExceptionCallback exp_cb, void *cb_cls)
Starts a helper and begins reading from it.
Definition: helper.c:462
enum GNUNET_GenericReturnValue GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h)
Reap the helper process.
Definition: helper.c:208
void(* GNUNET_HELPER_ExceptionCallback)(void *cls)
Callback that will be called when the helper process dies.
enum GNUNET_GenericReturnValue GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
Definition: helper.c:168
void GNUNET_HELPER_stop(struct GNUNET_HELPER_Handle *h, int soft_kill)
Kills the helper, closes the pipe, frees the handle and calls wait() on the helper process.
Definition: helper.c:538
void(* GNUNET_HELPER_Continuation)(void *cls, enum GNUNET_GenericReturnValue result)
Continuation function.
void GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h)
Free's the resources occupied by the helper handle.
Definition: helper.c:501
GNUNET_GenericReturnValue
Named constants for return values.
int(* GNUNET_MessageTokenizerCallback)(void *cls, const struct GNUNET_MessageHeader *message)
Functions with this signature are called whenever a complete message is received by the tokenizer.
The handle to a helper process.
Definition: helper.c:79
int with_control_pipe
Does the helper support the use of a control pipe for signalling?
Definition: helper.c:158
void * cb_cls
The closure for callbacks.
Definition: helper.c:118
char ** binary_argv
NULL-terminated list of command-line arguments.
Definition: helper.c:138
char * binary_name
Binary to run.
Definition: helper.c:133
Entry in the queue of messages we need to transmit to the helper.
Definition: helper.c:37
GNUNET_HELPER_Continuation cont
Function to call upon completion.
Definition: helper.c:61
void * cont_cls
Closure to 'cont'.
Definition: helper.c:66
Header for all communications.
static void exp_cb(void *cls)
Callback called if there was an exception during execution of the helper.