From 06f45b04aaa8a9832599035cafee142f09700b9b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 1 Aug 2021 13:20:49 +0200 Subject: -move DB-agnostic types to GNUNET_DB --- src/include/gnunet_db_lib.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/include/gnunet_db_lib.h') diff --git a/src/include/gnunet_db_lib.h b/src/include/gnunet_db_lib.h index 85ad13e31..63c45112d 100644 --- a/src/include/gnunet_db_lib.h +++ b/src/include/gnunet_db_lib.h @@ -61,4 +61,47 @@ enum GNUNET_DB_QueryStatus that returned more than one result. */ }; + +/** + * Handle for an active LISTENer to a database. + */ +struct GNUNET_DB_EventHandler; + +/** + * Function called on events received from Postgres. + * + * @param cls closure + * @param extra additional event data provided + * @param extra_size number of bytes in @a extra + */ +typedef void +(*GNUNET_DB_EventCallback)(void *cls, + const void *extra, + size_t extra_size); + +GNUNET_NETWORK_STRUCT_BEGIN + + +/** + * Header of a structure that describes an + * event channel we may subscribe to or notify on. + */ +struct GNUNET_DB_EventHeaderP +{ + /** + * The length of the struct (in bytes, including the length field itself), + * in big-endian format. + */ + uint16_t size GNUNET_PACKED; + + /** + * The type of the message (GNUNET_DB_EVENT_TYPE_XXXX), in big-endian format. + */ + uint16_t type GNUNET_PACKED; + +}; + +GNUNET_NETWORK_STRUCT_END + + #endif -- cgit v1.2.3