GNUnet  0.11.x
Macros | Functions
testing_api_trait_process.c File Reference

trait offering process handles. More...

#include "platform.h"
#include "gnunet_testing_ng_lib.h"
Include dependency graph for testing_api_trait_process.c:

Go to the source code of this file.

Macros

#define GNUNET_TESTING_TRAIT_PROCESS   "process"
 

Functions

int GNUNET_TESTING_get_trait_process (const struct GNUNET_TESTING_Command *cmd, unsigned int index, struct GNUNET_OS_Process ***processp)
 Obtain location where a command stores a pointer to a process. More...
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_process (unsigned int index, struct GNUNET_OS_Process **processp)
 Offer location where a command stores a pointer to a process. More...
 

Detailed Description

trait offering process handles.

Author
Christian Grothoff (GNU Taler testing)
Marcello Stanisci (GNU Taler testing)
t3sserakt

Definition in file testing_api_trait_process.c.

Macro Definition Documentation

◆ GNUNET_TESTING_TRAIT_PROCESS

#define GNUNET_TESTING_TRAIT_PROCESS   "process"

Function Documentation

◆ GNUNET_TESTING_get_trait_process()

int GNUNET_TESTING_get_trait_process ( const struct GNUNET_TESTING_Command cmd,
unsigned int  index,
struct GNUNET_OS_Process ***  processp 
)

Obtain location where a command stores a pointer to a process.

Parameters
cmdcommand to extract trait from.
indexwhich process to pick if cmd has multiple on offer.
[out]processpset to the address of the pointer to the process.
Returns
GNUNET_OK on success.

Definition at line 46 of file testing_api_trait_process.c.

References GNUNET_TESTING_Command::cls, GNUNET_TESTING_TRAIT_PROCESS, and GNUNET_TESTING_Command::traits.

49 {
50  return cmd->traits (cmd->cls,
51  (const void **) processp,
53  index);
54 }
int(* traits)(void *cls, const void **ret, const char *trait, unsigned int index)
Extract information from a command that is useful for other commands.
void * cls
Closure for all commands with command-specific context information.
#define GNUNET_TESTING_TRAIT_PROCESS

◆ GNUNET_TESTING_make_trait_process()

struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_process ( unsigned int  index,
struct GNUNET_OS_Process **  processp 
)

Offer location where a command stores a pointer to a process.

Parameters
indexoffered location index number, in case there are multiple on offer.
processpprocess location to offer.
Returns
the trait.

Definition at line 68 of file testing_api_trait_process.c.

References GNUNET_TESTING_TRAIT_PROCESS, GNUNET_TESTING_Trait::index, and ret.

70 {
71  struct GNUNET_TESTING_Trait ret = {
72  .index = index,
73  .trait_name = GNUNET_TESTING_TRAIT_PROCESS,
74  .ptr = (const void *) processp
75  };
76 
77  return ret;
78 }
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
unsigned int index
Index number associated with the trait.
#define GNUNET_TESTING_TRAIT_PROCESS