diff options
author | Gabor X Toth <*@tg-x.net> | 2013-06-13 11:57:07 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2013-06-13 11:57:07 +0000 |
commit | 6aee2f9a042c1a35a8fd05b70ac5e7d153baa578 (patch) | |
tree | acc3d24277cbc446ef058fc21f8d45863637b9c7 /src/include/gnunet_psycstore_service.h | |
parent | 64efd936f628330ab9c005342eb7a46f11210148 (diff) | |
download | gnunet-6aee2f9a042c1a35a8fd05b70ac5e7d153baa578.tar.gz gnunet-6aee2f9a042c1a35a8fd05b70ac5e7d153baa578.zip |
psycstore api docs
Diffstat (limited to 'src/include/gnunet_psycstore_service.h')
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 57 |
1 files changed, 48 insertions, 9 deletions
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index 856824e60..701f6940f 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #ifdef __cplusplus | 30 | #ifdef __cplusplus |
31 | extern "C" | 31 | extern "C" |
32 | {no | 32 | { |
33 | #if 0 /* keep Emacsens' auto-indent happy */ | 33 | #if 0 /* keep Emacsens' auto-indent happy */ |
34 | } | 34 | } |
35 | #endif | 35 | #endif |
@@ -48,10 +48,22 @@ extern "C" | |||
48 | struct GNUNET_PSYCSTORE_Handle; | 48 | struct GNUNET_PSYCSTORE_Handle; |
49 | 49 | ||
50 | 50 | ||
51 | /** | ||
52 | * Connect to the PSYCstore service. | ||
53 | * | ||
54 | * @param cfg Configuration to use. | ||
55 | * | ||
56 | * @return Handle for the connecton. | ||
57 | */ | ||
51 | struct GNUNET_PSYCSTORE_Handle * | 58 | struct GNUNET_PSYCSTORE_Handle * |
52 | GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); | 59 | GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
53 | 60 | ||
54 | 61 | ||
62 | /** | ||
63 | * Disconnect from the PSYCstore service. | ||
64 | * | ||
65 | * @param h Handle for the connection. | ||
66 | */ | ||
55 | void | 67 | void |
56 | GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h); | 68 | GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h); |
57 | 69 | ||
@@ -71,18 +83,45 @@ struct GNUNET_PSYCSTORE_OperationHandle; | |||
71 | typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls, | 83 | typedef void (*GNUNET_PSYCSTORE_ContinuationCallback)(void *cls, |
72 | int result); | 84 | int result); |
73 | 85 | ||
74 | 86 | /** | |
87 | * Store join/leave events for a PSYC channel in order to be able to answer | ||
88 | * membership test queries later. | ||
89 | * | ||
90 | * @param h Handle for the PSYCstore. | ||
91 | * @param channel_id ID of the channel where the event happened. | ||
92 | * @param message_id ID of the message in which this event was announced. | ||
93 | * @param peer Identity of joining/leaving peer. | ||
94 | * @param did_join GNUNET_YES on join, GNUNET_NO on leave. | ||
95 | * @param ccb Callback to call with the result of the storage operation. | ||
96 | * @param ccb_cls Closure for the callback. | ||
97 | * | ||
98 | * @return Operation handle that can be used to cancel the operation. | ||
99 | */ | ||
75 | struct GNUNET_PSYCSTORE_OperationHandle * | 100 | struct GNUNET_PSYCSTORE_OperationHandle * |
76 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | 101 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, |
77 | const struct GNUNET_HashCode *channel_id, | 102 | const struct GNUNET_HashCode *channel_id, |
78 | uint64_t message_id, | 103 | uint64_t message_id, |
79 | const struct GNUNET_PeerIdentity *peer, | 104 | const struct GNUNET_PeerIdentity *peer, |
80 | int did_join, | 105 | int did_join, |
81 | GNUNET_PSYCSTORE_ContinuationCallback ccb, | 106 | GNUNET_PSYCSTORE_ContinuationCallback ccb, |
82 | void *ccb_cls); | 107 | void *ccb_cls); |
83 | 108 | ||
84 | 109 | ||
85 | struct GNUNET_PSYCSTORE_OperationHandle * | 110 | /** |
111 | * Test if a peer was a member of the channel when the message with the | ||
112 | * specified ID was sent to the channel. This is useful in case of | ||
113 | * retransmissions to check if the peer was authorized to see the requested | ||
114 | * message. | ||
115 | * | ||
116 | * @param h Handle for the PSYCstore. | ||
117 | * @param channel_id The channel we are interested in. | ||
118 | * @param message_id Message ID to check. | ||
119 | * @param peer Peer whose membership to check. | ||
120 | * @param ccb Callback to call with the test result. | ||
121 | * @param ccb_cls Closure for the callback. | ||
122 | * | ||
123 | * @return Operation handle that can be used to cancel the operation. | ||
124 | */struct GNUNET_PSYCSTORE_OperationHandle * | ||
86 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | 125 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, |
87 | const struct GNUNET_HashCode *channel_id, | 126 | const struct GNUNET_HashCode *channel_id, |
88 | uint64_t message_id, | 127 | uint64_t message_id, |