diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2015-04-10 14:31:02 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2015-04-10 14:31:02 +0000 |
commit | 731435d6ab893df087e46fc363e67a8135fa8572 (patch) | |
tree | 136d2be1570affac94564b81c4eb136671bb086c | |
parent | b5327d8c33053b9235a123ee5aeda879898f8873 (diff) | |
download | gnunet-731435d6ab893df087e46fc363e67a8135fa8572.tar.gz gnunet-731435d6ab893df087e46fc363e67a8135fa8572.zip |
-make static
-rw-r--r-- | src/gns/plugin_rest_gns.c | 6 | ||||
-rw-r--r-- | src/identity/plugin_rest_identity.c | 40 | ||||
-rw-r--r-- | src/namestore/plugin_rest_namestore.c | 8 |
3 files changed, 35 insertions, 19 deletions
diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c index 6922c7d79..d7fc31d4c 100644 --- a/src/gns/plugin_rest_gns.c +++ b/src/gns/plugin_rest_gns.c | |||
@@ -226,7 +226,7 @@ do_error (void *cls, | |||
226 | * | 226 | * |
227 | * @param rd the GNSRECORD_Data | 227 | * @param rd the GNSRECORD_Data |
228 | */ | 228 | */ |
229 | json_t * | 229 | static json_t * |
230 | gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd) | 230 | gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd) |
231 | { | 231 | { |
232 | const char *typename; | 232 | const char *typename; |
@@ -480,7 +480,7 @@ identity_master_cb (void *cls, | |||
480 | * @param handle lookup handle to populate | 480 | * @param handle lookup handle to populate |
481 | * @return GNUNET_SYSERR on error | 481 | * @return GNUNET_SYSERR on error |
482 | */ | 482 | */ |
483 | int | 483 | static int |
484 | parse_url (const char *url, struct LookupHandle *handle) | 484 | parse_url (const char *url, struct LookupHandle *handle) |
485 | { | 485 | { |
486 | char *name; | 486 | char *name; |
@@ -513,7 +513,7 @@ parse_url (const char *url, struct LookupHandle *handle) | |||
513 | * @param proc_cls closure for callback function | 513 | * @param proc_cls closure for callback function |
514 | * @return GNUNET_OK if request accepted | 514 | * @return GNUNET_OK if request accepted |
515 | */ | 515 | */ |
516 | void | 516 | static void |
517 | rest_gns_process_request(struct RestConnectionDataHandle *conndata_handle, | 517 | rest_gns_process_request(struct RestConnectionDataHandle *conndata_handle, |
518 | GNUNET_REST_ResultProcessor proc, | 518 | GNUNET_REST_ResultProcessor proc, |
519 | void *proc_cls) | 519 | void *proc_cls) |
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c index b9aa8db00..53c74dcf2 100644 --- a/src/identity/plugin_rest_identity.c +++ b/src/identity/plugin_rest_identity.c | |||
@@ -83,6 +83,7 @@ struct EgoEntry | |||
83 | struct GNUNET_IDENTITY_Ego *ego; | 83 | struct GNUNET_IDENTITY_Ego *ego; |
84 | }; | 84 | }; |
85 | 85 | ||
86 | |||
86 | struct RequestHandle | 87 | struct RequestHandle |
87 | { | 88 | { |
88 | /** | 89 | /** |
@@ -174,7 +175,7 @@ struct RequestHandle | |||
174 | * Cleanup lookup handle | 175 | * Cleanup lookup handle |
175 | * @param handle Handle to clean up | 176 | * @param handle Handle to clean up |
176 | */ | 177 | */ |
177 | void | 178 | static void |
178 | cleanup_handle (struct RequestHandle *handle) | 179 | cleanup_handle (struct RequestHandle *handle) |
179 | { | 180 | { |
180 | struct EgoEntry *ego_entry; | 181 | struct EgoEntry *ego_entry; |
@@ -227,7 +228,7 @@ do_error (void *cls, | |||
227 | * @param ctx the context | 228 | * @param ctx the context |
228 | * @param name the id of the ego | 229 | * @param name the id of the ego |
229 | */ | 230 | */ |
230 | void | 231 | static void |
231 | get_ego_for_subsys (void *cls, | 232 | get_ego_for_subsys (void *cls, |
232 | struct GNUNET_IDENTITY_Ego *ego, | 233 | struct GNUNET_IDENTITY_Ego *ego, |
233 | void **ctx, | 234 | void **ctx, |
@@ -281,7 +282,7 @@ get_ego_for_subsys (void *cls, | |||
281 | * | 282 | * |
282 | * @param handle the RequestHandle | 283 | * @param handle the RequestHandle |
283 | */ | 284 | */ |
284 | void | 285 | static void |
285 | ego_info_response (struct RestConnectionDataHandle *con, | 286 | ego_info_response (struct RestConnectionDataHandle *con, |
286 | const char *url, | 287 | const char *url, |
287 | void *cls) | 288 | void *cls) |
@@ -425,8 +426,9 @@ ego_create_cont (struct RestConnectionDataHandle *con, | |||
425 | struct JsonApiObject *json_obj; | 426 | struct JsonApiObject *json_obj; |
426 | struct JsonApiResource *json_res; | 427 | struct JsonApiResource *json_res; |
427 | json_t *egoname_json; | 428 | json_t *egoname_json; |
428 | char term_data[handle->data_size+1]; | ||
429 | const char* egoname; | 429 | const char* egoname; |
430 | char term_data[handle->data_size+1]; | ||
431 | |||
430 | if (strlen (GNUNET_REST_API_NS_IDENTITY) != strlen (handle->url)) | 432 | if (strlen (GNUNET_REST_API_NS_IDENTITY) != strlen (handle->url)) |
431 | { | 433 | { |
432 | GNUNET_SCHEDULER_add_now (&do_error, handle); | 434 | GNUNET_SCHEDULER_add_now (&do_error, handle); |
@@ -489,23 +491,31 @@ ego_create_cont (struct RestConnectionDataHandle *con, | |||
489 | handle); | 491 | handle); |
490 | } | 492 | } |
491 | 493 | ||
492 | void | 494 | |
495 | /** | ||
496 | * Handle ego edit request | ||
497 | * | ||
498 | * @param con rest connection handle | ||
499 | * @param url the url that is requested | ||
500 | * @param cls the RequestHandle | ||
501 | */ | ||
502 | static void | ||
493 | ego_edit_cont (struct RestConnectionDataHandle *con, | 503 | ego_edit_cont (struct RestConnectionDataHandle *con, |
494 | const char *url, | 504 | const char *url, |
495 | void *cls) | 505 | void *cls) |
496 | { | 506 | { |
497 | struct JsonApiObject *json_obj; | 507 | struct JsonApiObject *json_obj; |
498 | struct JsonApiResource *json_res; | 508 | struct JsonApiResource *json_res; |
499 | const char *egoname; | ||
500 | const char *subsys; | ||
501 | const char *newname; | ||
502 | struct RequestHandle *handle = cls; | 509 | struct RequestHandle *handle = cls; |
503 | char term_data[handle->data_size+1]; | ||
504 | struct EgoEntry *ego_entry; | 510 | struct EgoEntry *ego_entry; |
505 | struct MHD_Response *resp; | 511 | struct MHD_Response *resp; |
506 | int ego_exists = GNUNET_NO; | ||
507 | json_t *subsys_json; | 512 | json_t *subsys_json; |
508 | json_t *name_json; | 513 | json_t *name_json; |
514 | const char *egoname; | ||
515 | const char *subsys; | ||
516 | const char *newname; | ||
517 | char term_data[handle->data_size+1]; | ||
518 | int ego_exists = GNUNET_NO; | ||
509 | 519 | ||
510 | if (strlen (GNUNET_REST_API_NS_IDENTITY) > strlen (handle->url)) | 520 | if (strlen (GNUNET_REST_API_NS_IDENTITY) > strlen (handle->url)) |
511 | { | 521 | { |
@@ -642,7 +652,13 @@ ego_delete_cont (struct RestConnectionDataHandle *con_handle, | |||
642 | 652 | ||
643 | } | 653 | } |
644 | 654 | ||
645 | void | 655 | |
656 | /** | ||
657 | * Handle rest request | ||
658 | * | ||
659 | * @param handle the request handle | ||
660 | */ | ||
661 | static void | ||
646 | init_cont (struct RequestHandle *handle) | 662 | init_cont (struct RequestHandle *handle) |
647 | { | 663 | { |
648 | static const struct GNUNET_REST_RestConnectionHandler handlers[] = { | 664 | static const struct GNUNET_REST_RestConnectionHandler handlers[] = { |
@@ -726,7 +742,7 @@ list_ego (void *cls, | |||
726 | * @param proc_cls closure for callback function | 742 | * @param proc_cls closure for callback function |
727 | * @return GNUNET_OK if request accepted | 743 | * @return GNUNET_OK if request accepted |
728 | */ | 744 | */ |
729 | void | 745 | static void |
730 | rest_identity_process_request(struct RestConnectionDataHandle *conndata_handle, | 746 | rest_identity_process_request(struct RestConnectionDataHandle *conndata_handle, |
731 | GNUNET_REST_ResultProcessor proc, | 747 | GNUNET_REST_ResultProcessor proc, |
732 | void *proc_cls) | 748 | void *proc_cls) |
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c index a5287b158..7f5372a33 100644 --- a/src/namestore/plugin_rest_namestore.c +++ b/src/namestore/plugin_rest_namestore.c | |||
@@ -220,7 +220,7 @@ struct RequestHandle | |||
220 | * Cleanup lookup handle | 220 | * Cleanup lookup handle |
221 | * @param handle Handle to clean up | 221 | * @param handle Handle to clean up |
222 | */ | 222 | */ |
223 | void | 223 | static void |
224 | cleanup_handle (struct RequestHandle *handle) | 224 | cleanup_handle (struct RequestHandle *handle) |
225 | { | 225 | { |
226 | struct RecordEntry *record_entry; | 226 | struct RecordEntry *record_entry; |
@@ -274,7 +274,7 @@ cleanup_handle (struct RequestHandle *handle) | |||
274 | * | 274 | * |
275 | * @param rd the GNSRECORD_Data | 275 | * @param rd the GNSRECORD_Data |
276 | */ | 276 | */ |
277 | json_t * | 277 | static json_t * |
278 | gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd) | 278 | gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd) |
279 | { | 279 | { |
280 | const char *typename; | 280 | const char *typename; |
@@ -351,7 +351,7 @@ cleanup_handle_delayed (void *cls, | |||
351 | * | 351 | * |
352 | * @param handle the RequestHandle | 352 | * @param handle the RequestHandle |
353 | */ | 353 | */ |
354 | void | 354 | static void |
355 | namestore_list_response (void *cls, | 355 | namestore_list_response (void *cls, |
356 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 356 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, |
357 | const char *rname, | 357 | const char *rname, |
@@ -967,7 +967,7 @@ testservice_id_task (void *cls, int result) | |||
967 | * @param proc_cls closure for callback function | 967 | * @param proc_cls closure for callback function |
968 | * @return GNUNET_OK if request accepted | 968 | * @return GNUNET_OK if request accepted |
969 | */ | 969 | */ |
970 | void | 970 | static void |
971 | rest_identity_process_request(struct RestConnectionDataHandle *conndata_handle, | 971 | rest_identity_process_request(struct RestConnectionDataHandle *conndata_handle, |
972 | GNUNET_REST_ResultProcessor proc, | 972 | GNUNET_REST_ResultProcessor proc, |
973 | void *proc_cls) | 973 | void *proc_cls) |