diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-05-31 14:06:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-05-31 14:06:52 +0000 |
commit | 8590cba90ab53a070d5ce3d8ec8f1a7f4fb4ee23 (patch) | |
tree | eb71ea7a5072aef95bc83c9d3849d8c4a2e936a6 /src/include | |
parent | 254fd9d19ec754cd82e40338565790874fb82561 (diff) | |
download | gnunet-8590cba90ab53a070d5ce3d8ec8f1a7f4fb4ee23.tar.gz gnunet-8590cba90ab53a070d5ce3d8ec8f1a7f4fb4ee23.zip |
-hacking up new regex client library
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_client_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 18 | ||||
-rw-r--r-- | src/include/gnunet_regex_service.h | 14 |
3 files changed, 27 insertions, 7 deletions
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 51da46de6..8642dd941 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -84,7 +84,7 @@ GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *client); | |||
84 | */ | 84 | */ |
85 | typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, | 85 | typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, |
86 | const struct GNUNET_MessageHeader | 86 | const struct GNUNET_MessageHeader |
87 | * msg); | 87 | *msg); |
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 9325416ec..15bbae2e8 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -1881,7 +1881,23 @@ extern "C" | |||
1881 | #define GNUNET_MESSAGE_TYPE_EXPERIMENTATION_RESPONSE 611 | 1881 | #define GNUNET_MESSAGE_TYPE_EXPERIMENTATION_RESPONSE 611 |
1882 | 1882 | ||
1883 | /** | 1883 | /** |
1884 | * Next available: 620 | 1884 | * Advertise regex capability. |
1885 | */ | ||
1886 | #define GNUNET_MESSAGE_TYPE_REGEX_ANNOUNCE 620 | ||
1887 | |||
1888 | /** | ||
1889 | * Search for peer with matching capability. | ||
1890 | */ | ||
1891 | #define GNUNET_MESSAGE_TYPE_REGEX_SEARCH 621 | ||
1892 | |||
1893 | /** | ||
1894 | * Result in response to regex search. | ||
1895 | */ | ||
1896 | #define GNUNET_MESSAGE_TYPE_REGEX_RESULT 622 | ||
1897 | |||
1898 | |||
1899 | /** | ||
1900 | * Next available: 624 | ||
1885 | */ | 1901 | */ |
1886 | 1902 | ||
1887 | 1903 | ||
diff --git a/src/include/gnunet_regex_service.h b/src/include/gnunet_regex_service.h index 57f98b19f..2a176f401 100644 --- a/src/include/gnunet_regex_service.h +++ b/src/include/gnunet_regex_service.h | |||
@@ -60,6 +60,7 @@ struct GNUNET_REGEX_Search; | |||
60 | * not free resources, must call GNUNET_REGEX_announce_cancel for | 60 | * not free resources, must call GNUNET_REGEX_announce_cancel for |
61 | * that. | 61 | * that. |
62 | * | 62 | * |
63 | * @param cfg configuration to use | ||
63 | * @param id ID to announce as provider of regex. Own ID in most cases. | 64 | * @param id ID to announce as provider of regex. Own ID in most cases. |
64 | * @param regex Regular expression to announce. | 65 | * @param regex Regular expression to announce. |
65 | * @param refresh_delay after what delay should the announcement be repeated? | 66 | * @param refresh_delay after what delay should the announcement be repeated? |
@@ -68,7 +69,8 @@ struct GNUNET_REGEX_Search; | |||
68 | * Must be freed by calling GNUNET_REGEX_announce_cancel. | 69 | * Must be freed by calling GNUNET_REGEX_announce_cancel. |
69 | */ | 70 | */ |
70 | struct GNUNET_REGEX_Announcement * | 71 | struct GNUNET_REGEX_Announcement * |
71 | GNUNET_REGEX_announce (const struct GNUNET_PeerIdentity *id, | 72 | GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, |
73 | const struct GNUNET_PeerIdentity *id, | ||
72 | const char *regex, | 74 | const char *regex, |
73 | struct GNUNET_TIME_Relative refresh_delay, | 75 | struct GNUNET_TIME_Relative refresh_delay, |
74 | uint16_t compression); | 76 | uint16_t compression); |
@@ -77,10 +79,10 @@ GNUNET_REGEX_announce (const struct GNUNET_PeerIdentity *id, | |||
77 | /** | 79 | /** |
78 | * Stop announcing the regex specified by the given handle. | 80 | * Stop announcing the regex specified by the given handle. |
79 | * | 81 | * |
80 | * @param h handle returned by a previous GNUNET_REGEX_announce call. | 82 | * @param a handle returned by a previous GNUNET_REGEX_announce call. |
81 | */ | 83 | */ |
82 | void | 84 | void |
83 | GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_Announcement *h); | 85 | GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_Announcement *a); |
84 | 86 | ||
85 | 87 | ||
86 | /** | 88 | /** |
@@ -106,6 +108,7 @@ typedef void (*GNUNET_REGEX_Found)(void *cls, | |||
106 | * The search runs until GNUNET_REGEX_search_cancel is called, even if results | 108 | * The search runs until GNUNET_REGEX_search_cancel is called, even if results |
107 | * are returned. | 109 | * are returned. |
108 | * | 110 | * |
111 | * @param cfg configuration to use | ||
109 | * @param string String to match against the regexes in the DHT. | 112 | * @param string String to match against the regexes in the DHT. |
110 | * @param callback Callback for found peers. | 113 | * @param callback Callback for found peers. |
111 | * @param callback_cls Closure for @c callback. | 114 | * @param callback_cls Closure for @c callback. |
@@ -113,7 +116,8 @@ typedef void (*GNUNET_REGEX_Found)(void *cls, | |||
113 | * Must be freed by calling GNUNET_REGEX_search_cancel. | 116 | * Must be freed by calling GNUNET_REGEX_search_cancel. |
114 | */ | 117 | */ |
115 | struct GNUNET_REGEX_Search * | 118 | struct GNUNET_REGEX_Search * |
116 | GNUNET_REGEX_search (const char *string, | 119 | GNUNET_REGEX_search (const struct GNUNET_CONFIGURATION_Handle *cfg, |
120 | const char *string, | ||
117 | GNUNET_REGEX_Found callback, | 121 | GNUNET_REGEX_Found callback, |
118 | void *callback_cls); | 122 | void *callback_cls); |
119 | 123 | ||
@@ -124,7 +128,7 @@ GNUNET_REGEX_search (const char *string, | |||
124 | * @param h Handle returned by a previous GNUNET_REGEX_search call. | 128 | * @param h Handle returned by a previous GNUNET_REGEX_search call. |
125 | */ | 129 | */ |
126 | void | 130 | void |
127 | GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_Search *h); | 131 | GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_Search *s); |
128 | 132 | ||
129 | 133 | ||
130 | #if 0 /* keep Emacsens' auto-indent happy */ | 134 | #if 0 /* keep Emacsens' auto-indent happy */ |