Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
Loading...
Searching...
No Matches
Macros | Functions
hw_inject.h File Reference
#include <adaptyst/amod_t.h>
#include <adaptyst/inject_errors.h>

Go to the source code of this file.

Macros

#define ADAPTYST_MODULE_OK   0
 
#define ADAPTYST_MODULE_ERR   1
 

Functions

int adaptyst_send_data (amod_t id, char *buf, unsigned int n)
 
int adaptyst_receive_data (amod_t id, char *buf, unsigned int buf_size, int *n)
 
int adaptyst_receive_data_timeout (amod_t id, char *buf, unsigned int buf_size, int *n, long timeout_seconds)
 
int adaptyst_send_string (amod_t id, const char *str)
 
int adaptyst_receive_string (amod_t id, const char **str)
 
int adaptyst_receive_string_timeout (amod_t id, const char **str, long timeout_seconds)
 
int adaptyst_send_data_nl (amod_t id, char *buf, unsigned int n)
 
int adaptyst_receive_data_nl (amod_t id, char *buf, unsigned int buf_size, int *n)
 
int adaptyst_receive_data_timeout_nl (amod_t id, char *buf, unsigned int buf_size, int *n, long timeout_seconds)
 
int adaptyst_send_string_nl (amod_t id, const char *str)
 
int adaptyst_receive_string_nl (amod_t id, const char **str)
 
int adaptyst_receive_string_timeout_nl (amod_t id, const char **str, long timeout_seconds)
 
void adaptyst_set_error (const char *msg)
 
void adaptyst_set_error_nl (const char *msg)
 
unsigned long long adaptyst_get_timestamp (int *err)
 

Macro Definition Documentation

◆ ADAPTYST_MODULE_ERR

#define ADAPTYST_MODULE_ERR   1

◆ ADAPTYST_MODULE_OK

#define ADAPTYST_MODULE_OK   0

Function Documentation

◆ adaptyst_get_timestamp()

unsigned long long adaptyst_get_timestamp ( int err)

◆ adaptyst_receive_data()

int adaptyst_receive_data ( amod_t  id,
char buf,
unsigned int  buf_size,
int n 
)

Receives data from the injection part of the module in a workflow, with no timeout.

Parameters
idThe module ID (use module_id).
bufBuffer where received data should be stored.
buf_sizeSize of the buffer in bytes.
nPointer to a variable where the number of received bytes should be stored.
Returns
Whether the operation has been successful.

◆ adaptyst_receive_data_nl()

int adaptyst_receive_data_nl ( amod_t  id,
char buf,
unsigned int  buf_size,
int n 
)

◆ adaptyst_receive_data_timeout()

int adaptyst_receive_data_timeout ( amod_t  id,
char buf,
unsigned int  buf_size,
int n,
long  timeout_seconds 
)

Receives data from the injection part of the module in a workflow, with a specific timeout.

Parameters
idThe module ID (use module_id).
bufBuffer where received data should be stored.
buf_sizeSize of the buffer in bytes.
nPointer to a variable where the number of received bytes should be stored.
timeout_secondsTimeout in seconds.
Returns
Whether the operation has been successful (it's false with adaptyst_get_internal_error_code() returning ADAPTYST_ERR_TIMEOUT in case of timeout).

◆ adaptyst_receive_data_timeout_nl()

int adaptyst_receive_data_timeout_nl ( amod_t  id,
char buf,
unsigned int  buf_size,
int n,
long  timeout_seconds 
)

◆ adaptyst_receive_string()

int adaptyst_receive_string ( amod_t  id,
const char **  str 
)

Receives a string from the injection part of the module in a workflow, with no timeout.

If the sender has sent n strings using adaptyst_send_string() (where n is a positive integer), adaptyst_receive_string() or its timeout variant must be called n times to receive all of these, in the order they have been sent in.

Parameters
idThe module ID (use module_id).
strPointer to a variable where the received string should be stored. If 0 bytes are received, the variable is set to a null pointer.
Returns
Whether the operation has been successful.

◆ adaptyst_receive_string_nl()

int adaptyst_receive_string_nl ( amod_t  id,
const char **  str 
)

◆ adaptyst_receive_string_timeout()

int adaptyst_receive_string_timeout ( amod_t  id,
const char **  str,
long  timeout_seconds 
)

Receives a string from the injection part of the module in a workflow, with a specific timeout.

If the sender has sent n strings using adaptyst_send_string() (where n is a positive integer), adaptyst_receive_string_timeout() or its non-timeout variant must be called n times to receive all of these, in the order they have been sent in.

Parameters
idThe module ID (use module_id).
strPointer to a variable where the received string should be stored. If 0 bytes are received, the variable is set to a null pointer.
timeout_secondsTimeout in seconds.
Returns
Whether the operation has been successful (it's false with adaptyst_get_internal_error_code() returning ADAPTYST_ERR_TIMEOUT in case of timeout).

◆ adaptyst_receive_string_timeout_nl()

int adaptyst_receive_string_timeout_nl ( amod_t  id,
const char **  str,
long  timeout_seconds 
)

◆ adaptyst_send_data()

int adaptyst_send_data ( amod_t  id,
char buf,
unsigned int  n 
)

Sends data to the injection part of the module in a workflow.

Parameters
idThe module ID (use module_id).
bufData to send.
nNumber of bytes to send.
Returns
Whether the operation has been successful.

◆ adaptyst_send_data_nl()

int adaptyst_send_data_nl ( amod_t  id,
char buf,
unsigned int  n 
)

◆ adaptyst_send_string()

int adaptyst_send_string ( amod_t  id,
const char str 
)

Sends a string to the injection part of the module in a workflow.

The recipient receives strings in the same order they are sent in as long as the sender uses adaptyst_send_string() and the receiver uses adaptyst_receive_string() or its timeout variant.

Parameters
idThe module ID (use module_id).
strString to send.
Returns
Whether the operation has been successful.

◆ adaptyst_send_string_nl()

int adaptyst_send_string_nl ( amod_t  id,
const char str 
)

◆ adaptyst_set_error()

void adaptyst_set_error ( const char msg)

◆ adaptyst_set_error_nl()

void adaptyst_set_error_nl ( const char msg)