diff options
Diffstat (limited to 'src/include/gnunet_db_lib.h')
-rw-r--r-- | src/include/gnunet_db_lib.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/include/gnunet_db_lib.h b/src/include/gnunet_db_lib.h index 85ad13e31..e88e836f6 100644 --- a/src/include/gnunet_db_lib.h +++ b/src/include/gnunet_db_lib.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #ifndef GNUNET_DB_LIB_H | 25 | #ifndef GNUNET_DB_LIB_H |
26 | #define GNUNET_DB_LIB_H | 26 | #define GNUNET_DB_LIB_H |
27 | 27 | ||
28 | #include "gnunet_common.h" | ||
28 | 29 | ||
29 | /** | 30 | /** |
30 | * Status code returned from functions running database commands. | 31 | * Status code returned from functions running database commands. |
@@ -61,4 +62,47 @@ enum GNUNET_DB_QueryStatus | |||
61 | that returned more than one result. */ | 62 | that returned more than one result. */ |
62 | }; | 63 | }; |
63 | 64 | ||
65 | |||
66 | /** | ||
67 | * Handle for an active LISTENer to a database. | ||
68 | */ | ||
69 | struct GNUNET_DB_EventHandler; | ||
70 | |||
71 | /** | ||
72 | * Function called on events received from Postgres. | ||
73 | * | ||
74 | * @param cls closure | ||
75 | * @param extra additional event data provided | ||
76 | * @param extra_size number of bytes in @a extra | ||
77 | */ | ||
78 | typedef void | ||
79 | (*GNUNET_DB_EventCallback)(void *cls, | ||
80 | const void *extra, | ||
81 | size_t extra_size); | ||
82 | |||
83 | GNUNET_NETWORK_STRUCT_BEGIN | ||
84 | |||
85 | |||
86 | /** | ||
87 | * Header of a structure that describes an | ||
88 | * event channel we may subscribe to or notify on. | ||
89 | */ | ||
90 | struct GNUNET_DB_EventHeaderP | ||
91 | { | ||
92 | /** | ||
93 | * The length of the struct (in bytes, including the length field itself), | ||
94 | * in big-endian format. | ||
95 | */ | ||
96 | uint16_t size GNUNET_PACKED; | ||
97 | |||
98 | /** | ||
99 | * The type of the message (GNUNET_DB_EVENT_TYPE_XXXX), in big-endian format. | ||
100 | */ | ||
101 | uint16_t type GNUNET_PACKED; | ||
102 | |||
103 | }; | ||
104 | |||
105 | GNUNET_NETWORK_STRUCT_END | ||
106 | |||
107 | |||
64 | #endif | 108 | #endif |