diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-01 13:20:49 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-01 13:20:55 +0200 |
commit | 06f45b04aaa8a9832599035cafee142f09700b9b (patch) | |
tree | b928a166e1dec9b55c85562de57cd67e03f60906 /src/include/gnunet_db_lib.h | |
parent | 2032f3ce3ed0ed7a6c1c6fb9df6222d85758bf70 (diff) | |
download | gnunet-06f45b04aaa8a9832599035cafee142f09700b9b.tar.gz gnunet-06f45b04aaa8a9832599035cafee142f09700b9b.zip |
-move DB-agnostic types to GNUNET_DB
Diffstat (limited to 'src/include/gnunet_db_lib.h')
-rw-r--r-- | src/include/gnunet_db_lib.h | 43 |
1 files changed, 43 insertions, 0 deletions
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 | |||
61 | that returned more than one result. */ | 61 | that returned more than one result. */ |
62 | }; | 62 | }; |
63 | 63 | ||
64 | |||
65 | /** | ||
66 | * Handle for an active LISTENer to a database. | ||
67 | */ | ||
68 | struct GNUNET_DB_EventHandler; | ||
69 | |||
70 | /** | ||
71 | * Function called on events received from Postgres. | ||
72 | * | ||
73 | * @param cls closure | ||
74 | * @param extra additional event data provided | ||
75 | * @param extra_size number of bytes in @a extra | ||
76 | */ | ||
77 | typedef void | ||
78 | (*GNUNET_DB_EventCallback)(void *cls, | ||
79 | const void *extra, | ||
80 | size_t extra_size); | ||
81 | |||
82 | GNUNET_NETWORK_STRUCT_BEGIN | ||
83 | |||
84 | |||
85 | /** | ||
86 | * Header of a structure that describes an | ||
87 | * event channel we may subscribe to or notify on. | ||
88 | */ | ||
89 | struct GNUNET_DB_EventHeaderP | ||
90 | { | ||
91 | /** | ||
92 | * The length of the struct (in bytes, including the length field itself), | ||
93 | * in big-endian format. | ||
94 | */ | ||
95 | uint16_t size GNUNET_PACKED; | ||
96 | |||
97 | /** | ||
98 | * The type of the message (GNUNET_DB_EVENT_TYPE_XXXX), in big-endian format. | ||
99 | */ | ||
100 | uint16_t type GNUNET_PACKED; | ||
101 | |||
102 | }; | ||
103 | |||
104 | GNUNET_NETWORK_STRUCT_END | ||
105 | |||
106 | |||
64 | #endif | 107 | #endif |