GNUnet  0.10.x
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 
37 #ifndef GNUNET_HELPER_LIB_H
38 #define GNUNET_HELPER_LIB_H
39 
40 #include "gnunet_scheduler_lib.h"
41 #include "gnunet_mst_lib.h"
42 
43 
48 
49 
56 typedef void
58 
59 
76 struct GNUNET_HELPER_Handle *
78  const char *binary_name,
79  char *const binary_argv[],
82  void *cb_cls);
83 
84 
94 int
95 GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill);
96 
97 
106 int
108 
109 
115 void
117 
118 
127 void
128 GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill);
129 
130 
139 typedef void (*GNUNET_HELPER_Continuation)(void *cls,
140  int result);
141 
142 
147 
148 
164  const struct GNUNET_MessageHeader *msg,
165  int can_drop,
167  void *cont_cls);
168 
169 
176 void
178 
179 
180 #endif
181 /* end of include guard: GNUNET_HELPER_LIB_H */
182  /* end of group */
int GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
Definition: helper.c:180
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
void(* GNUNET_HELPER_ExceptionCallback)(void *cls)
Callback that will be called when the helper process dies.
The handle to a helper process.
Definition: helper.c:80
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:491
void(* GNUNET_HELPER_Continuation)(void *cls, int result)
Continuation function.
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:569
Entry in the queue of messages we need to transmit to the helper.
Definition: helper.c:36
int with_control_pipe
Does the helper support the use of a control pipe for signalling?
Definition: helper.c:161
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
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...
void GNUNET_HELPER_send_cancel(struct GNUNET_HELPER_SendHandle *sh)
Cancel a GNUNET_HELPER_send operation.
Definition: helper.c:701
static struct SolverHandle * sh
static int result
Global testing status.
char * binary_name
Binary to run.
Definition: helper.c:136
GNUNET_HELPER_ExceptionCallback exp_cb
The exception callback.
Definition: helper.c:116
char ** binary_argv
NULL-terminated list of command-line arguments.
Definition: helper.c:141
void * cb_cls
The closure for callbacks.
Definition: helper.c:121
void GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h)
Free&#39;s the resources occupied by the helper handle.
Definition: helper.c:530
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:660
int GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h)
Reap the helper process.
Definition: helper.c:231
Header for all communications.
GNUNET_HELPER_Continuation cont
Function to call upon completion.
Definition: helper.c:62
void * cont_cls
Closure to &#39;cont&#39;.
Definition: helper.c:67