diff options
Diffstat (limited to 'src/set/plugin_block_set_test.c')
-rw-r--r-- | src/set/plugin_block_set_test.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/set/plugin_block_set_test.c b/src/set/plugin_block_set_test.c index e7322aea0..a9da9d549 100644 --- a/src/set/plugin_block_set_test.c +++ b/src/set/plugin_block_set_test.c | |||
@@ -46,20 +46,20 @@ | |||
46 | * @return characterization of result | 46 | * @return characterization of result |
47 | */ | 47 | */ |
48 | static enum GNUNET_BLOCK_EvaluationResult | 48 | static enum GNUNET_BLOCK_EvaluationResult |
49 | block_plugin_set_test_evaluate(void *cls, | 49 | block_plugin_set_test_evaluate (void *cls, |
50 | struct GNUNET_BLOCK_Context *ctx, | 50 | struct GNUNET_BLOCK_Context *ctx, |
51 | enum GNUNET_BLOCK_Type type, | 51 | enum GNUNET_BLOCK_Type type, |
52 | struct GNUNET_BLOCK_Group *group, | 52 | struct GNUNET_BLOCK_Group *group, |
53 | enum GNUNET_BLOCK_EvaluationOptions eo, | 53 | enum GNUNET_BLOCK_EvaluationOptions eo, |
54 | const struct GNUNET_HashCode *query, | 54 | const struct GNUNET_HashCode *query, |
55 | const void *xquery, | 55 | const void *xquery, |
56 | size_t xquery_size, | 56 | size_t xquery_size, |
57 | const void *reply_block, | 57 | const void *reply_block, |
58 | size_t reply_block_size) | 58 | size_t reply_block_size) |
59 | { | 59 | { |
60 | if ((NULL == reply_block) || | 60 | if ((NULL == reply_block) || |
61 | (reply_block_size == 0) || | 61 | (reply_block_size == 0) || |
62 | (0 != ((char *)reply_block)[0])) | 62 | (0 != ((char *) reply_block)[0])) |
63 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 63 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
64 | return GNUNET_BLOCK_EVALUATION_OK_MORE; | 64 | return GNUNET_BLOCK_EVALUATION_OK_MORE; |
65 | } | 65 | } |
@@ -77,11 +77,11 @@ block_plugin_set_test_evaluate(void *cls, | |||
77 | * (or if extracting a key from a block of this type does not work) | 77 | * (or if extracting a key from a block of this type does not work) |
78 | */ | 78 | */ |
79 | static int | 79 | static int |
80 | block_plugin_set_test_get_key(void *cls, | 80 | block_plugin_set_test_get_key (void *cls, |
81 | enum GNUNET_BLOCK_Type type, | 81 | enum GNUNET_BLOCK_Type type, |
82 | const void *block, | 82 | const void *block, |
83 | size_t block_size, | 83 | size_t block_size, |
84 | struct GNUNET_HashCode *key) | 84 | struct GNUNET_HashCode *key) |
85 | { | 85 | { |
86 | return GNUNET_SYSERR; | 86 | return GNUNET_SYSERR; |
87 | } | 87 | } |
@@ -91,16 +91,15 @@ block_plugin_set_test_get_key(void *cls, | |||
91 | * Entry point for the plugin. | 91 | * Entry point for the plugin. |
92 | */ | 92 | */ |
93 | void * | 93 | void * |
94 | libgnunet_plugin_block_set_test_init(void *cls) | 94 | libgnunet_plugin_block_set_test_init (void *cls) |
95 | { | 95 | { |
96 | static enum GNUNET_BLOCK_Type types[] = | 96 | static enum GNUNET_BLOCK_Type types[] = { |
97 | { | ||
98 | GNUNET_BLOCK_TYPE_SET_TEST, | 97 | GNUNET_BLOCK_TYPE_SET_TEST, |
99 | GNUNET_BLOCK_TYPE_ANY /* end of list */ | 98 | GNUNET_BLOCK_TYPE_ANY /* end of list */ |
100 | }; | 99 | }; |
101 | struct GNUNET_BLOCK_PluginFunctions *api; | 100 | struct GNUNET_BLOCK_PluginFunctions *api; |
102 | 101 | ||
103 | api = GNUNET_new(struct GNUNET_BLOCK_PluginFunctions); | 102 | api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); |
104 | api->evaluate = &block_plugin_set_test_evaluate; | 103 | api->evaluate = &block_plugin_set_test_evaluate; |
105 | api->get_key = &block_plugin_set_test_get_key; | 104 | api->get_key = &block_plugin_set_test_get_key; |
106 | api->types = types; | 105 | api->types = types; |
@@ -112,11 +111,11 @@ libgnunet_plugin_block_set_test_init(void *cls) | |||
112 | * Exit point from the plugin. | 111 | * Exit point from the plugin. |
113 | */ | 112 | */ |
114 | void * | 113 | void * |
115 | libgnunet_plugin_block_set_test_done(void *cls) | 114 | libgnunet_plugin_block_set_test_done (void *cls) |
116 | { | 115 | { |
117 | struct GNUNET_BLOCK_PluginFunctions *api = cls; | 116 | struct GNUNET_BLOCK_PluginFunctions *api = cls; |
118 | 117 | ||
119 | GNUNET_free(api); | 118 | GNUNET_free (api); |
120 | return NULL; | 119 | return NULL; |
121 | } | 120 | } |
122 | 121 | ||