60#include <pdi/export.h>
61#include <pdi/version.h>
73typedef enum PDI_status_e {
108typedef struct PDI_errhandler_s {
183typedef enum PDI_inout_e {
272#ifdef PDI_WITH_DEPRECATED
288PDI_status_t PDI_DEPRECATED_EXPORT PDI_transaction_begin(
const char* name);
300PDI_status_t PDI_DEPRECATED_EXPORT PDI_transaction_end(
void);
PDI_status_t PDI_release(const char *name)
Releases ownership of a data shared with PDI.
PDI_status_t PDI_share(const char *name, void *data, PDI_inout_t access)
Shares some data with PDI.
PDI_inout_t
Access directions.
Definition: pdi.h:183
PDI_status_t PDI_access(const char *name, void **buffer, PDI_inout_t inout)
Requests for PDI to access a data buffer.
PDI_status_t PDI_event(const char *event)
Triggers a PDI "event".
PDI_status_t PDI_expose(const char *name, void *data, PDI_inout_t access)
Shortly exposes some data to PDI.
PDI_status_t PDI_reclaim(const char *name)
Reclaims ownership of a data buffer shared with PDI.
PDI_status_t PDI_multi_expose(const char *event_name, const char *name, void *data, PDI_inout_t access,...)
Performs multiple exposes at once.
@ PDI_OUT
data transfer from the main code to PDI
Definition: pdi.h:189
@ PDI_INOUT
data transfer in both direction
Definition: pdi.h:191
@ PDI_IN
data tranfer from PDI to the main code
Definition: pdi.h:187
@ PDI_NONE
No data transfert.
Definition: pdi.h:185
PDI_errfunc_f func
The function to handle the error (none if NULL)
Definition: pdi.h:111
void * context
the context that will be provided to the function
Definition: pdi.h:114
PDI_errhandler_t PDI_errhandler(PDI_errhandler_t handler)
Sets the error handler to use.
const PDI_errhandler_t PDI_ASSERT_HANDLER
Prints the error message and aborts if the status is invalid.
const PDI_errhandler_t PDI_NULL_HANDLER
Does nothing.
PDI_status_t
Error codes of PDI.
Definition: pdi.h:73
const char * PDI_errmsg(void)
Return a human-readabe message describing the last error that occured in PDI.
const PDI_errhandler_t PDI_WARN_HANDLER
Prints the error message and continue if the status is invalid.
void(* PDI_errfunc_f)(PDI_status_t status, const char *message, void *context)
Type of a callback function used when an error occurs.
Definition: pdi.h:104
@ PDI_UNAVAILABLE
on an input call, no such data is available
Definition: pdi.h:77
@ PDI_ERR_VALUE
A value expression is invalid.
Definition: pdi.h:81
@ PDI_ERR_STATE
A call to a function has been made at a wrong time (e.g.
Definition: pdi.h:91
@ PDI_ERR_CONFIG
The configuration file is invalid.
Definition: pdi.h:79
@ PDI_OK
everything went well
Definition: pdi.h:75
@ PDI_ERR_TYPE
Invalid type error.
Definition: pdi.h:95
@ PDI_ERR_SYSTEM
A system error occured (OS, etc.)
Definition: pdi.h:87
@ PDI_ERR_IMPL
Implementation limitation (typically an unimplemented feature)
Definition: pdi.h:85
@ PDI_ERR_PLUGIN
Tried to load a non-existing plugin.
Definition: pdi.h:83
@ PDI_ERR_RIGHT
A conflict of onwership over a content has been raised.
Definition: pdi.h:93
Definition of an error handler.
Definition: pdi.h:108
PDI_status_t PDI_init(PC_tree_t conf)
Initializes PDI.
PDI_status_t PDI_finalize(void)
Finalizes PDI.
PDI_status_t PDI_version(unsigned long *provided, unsigned long expected)
Checks PDI API version.