diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-19 22:35:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-19 22:35:24 +0000 |
commit | f22d7bf5f70549ce384b33d2fbb6b881fb2f2298 (patch) | |
tree | b052959bd1a13a9c02fc805fbd5b52ca68be1dea /src/social/test_social.c | |
parent | ca95e95dab4bfc82a0009fd04a64e28aae8c25f8 (diff) | |
download | gnunet-f22d7bf5f70549ce384b33d2fbb6b881fb2f2298.tar.gz gnunet-f22d7bf5f70549ce384b33d2fbb6b881fb2f2298.zip |
-use static
Diffstat (limited to 'src/social/test_social.c')
-rw-r--r-- | src/social/test_social.c | 84 |
1 files changed, 46 insertions, 38 deletions
diff --git a/src/social/test_social.c b/src/social/test_social.c index ce4714651..320526594 100644 --- a/src/social/test_social.c +++ b/src/social/test_social.c | |||
@@ -114,22 +114,22 @@ enum | |||
114 | } test; | 114 | } test; |
115 | 115 | ||
116 | 116 | ||
117 | void | 117 | static void |
118 | guest_enter (); | 118 | guest_enter (); |
119 | 119 | ||
120 | 120 | ||
121 | void | 121 | static void |
122 | guest_talk (); | 122 | guest_talk (); |
123 | 123 | ||
124 | 124 | ||
125 | void | 125 | static void |
126 | host_announce2 (); | 126 | host_announce2 (); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
130 | * Clean up all resources used. | 130 | * Clean up all resources used. |
131 | */ | 131 | */ |
132 | void | 132 | static void |
133 | cleanup () | 133 | cleanup () |
134 | { | 134 | { |
135 | if (NULL != core) | 135 | if (NULL != core) |
@@ -164,7 +164,7 @@ cleanup () | |||
164 | * @param cls NULL | 164 | * @param cls NULL |
165 | * @param tc scheduler context | 165 | * @param tc scheduler context |
166 | */ | 166 | */ |
167 | void | 167 | static void |
168 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 168 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
169 | { | 169 | { |
170 | res = 1; | 170 | res = 1; |
@@ -179,7 +179,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
179 | * @param cls NULL | 179 | * @param cls NULL |
180 | * @param tc scheduler context | 180 | * @param tc scheduler context |
181 | */ | 181 | */ |
182 | void | 182 | static void |
183 | end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 183 | end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
184 | { | 184 | { |
185 | res = 0; | 185 | res = 0; |
@@ -191,7 +191,7 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
191 | /** | 191 | /** |
192 | * Finish the test case (successfully). | 192 | * Finish the test case (successfully). |
193 | */ | 193 | */ |
194 | void | 194 | static void |
195 | end () | 195 | end () |
196 | { | 196 | { |
197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n"); | 197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n"); |
@@ -218,7 +218,7 @@ transmit_resume (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | int | 221 | static int |
222 | notify_data (void *cls, uint16_t *data_size, void *data) | 222 | notify_data (void *cls, uint16_t *data_size, void *data) |
223 | { | 223 | { |
224 | struct TransmitClosure *tmit = cls; | 224 | struct TransmitClosure *tmit = cls; |
@@ -265,7 +265,8 @@ notify_data (void *cls, uint16_t *data_size, void *data) | |||
265 | } | 265 | } |
266 | 266 | ||
267 | 267 | ||
268 | void host_left () | 268 | static void |
269 | host_left () | ||
269 | { | 270 | { |
270 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 271 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
271 | "The host has left the place.\n"); | 272 | "The host has left the place.\n"); |
@@ -277,7 +278,7 @@ void host_left () | |||
277 | } | 278 | } |
278 | 279 | ||
279 | 280 | ||
280 | void | 281 | static void |
281 | schedule_host_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 282 | schedule_host_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
282 | { | 283 | { |
283 | test = TEST_HOST_LEAVE; | 284 | test = TEST_HOST_LEAVE; |
@@ -285,7 +286,7 @@ schedule_host_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
285 | } | 286 | } |
286 | 287 | ||
287 | 288 | ||
288 | void | 289 | static void |
289 | host_farewell (void *cls, | 290 | host_farewell (void *cls, |
290 | struct GNUNET_SOCIAL_Nym *nym, | 291 | struct GNUNET_SOCIAL_Nym *nym, |
291 | struct GNUNET_ENV_Environment *env, | 292 | struct GNUNET_ENV_Environment *env, |
@@ -307,7 +308,7 @@ host_farewell (void *cls, | |||
307 | } | 308 | } |
308 | 309 | ||
309 | 310 | ||
310 | void | 311 | static void |
311 | guest_left (void *cls) | 312 | guest_left (void *cls) |
312 | { | 313 | { |
313 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 314 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -320,7 +321,7 @@ guest_left (void *cls) | |||
320 | } | 321 | } |
321 | 322 | ||
322 | 323 | ||
323 | void | 324 | static void |
324 | guest_leave() | 325 | guest_leave() |
325 | { | 326 | { |
326 | test = TEST_GUEST_LEAVE; | 327 | test = TEST_GUEST_LEAVE; |
@@ -329,8 +330,7 @@ guest_leave() | |||
329 | } | 330 | } |
330 | 331 | ||
331 | 332 | ||
332 | 333 | static void | |
333 | void | ||
334 | guest_recv_method (void *cls, | 334 | guest_recv_method (void *cls, |
335 | const struct GNUNET_PSYC_MessageMethod *meth, | 335 | const struct GNUNET_PSYC_MessageMethod *meth, |
336 | uint64_t message_id, | 336 | uint64_t message_id, |
@@ -346,7 +346,7 @@ guest_recv_method (void *cls, | |||
346 | } | 346 | } |
347 | 347 | ||
348 | 348 | ||
349 | void | 349 | static void |
350 | guest_recv_modifier (void *cls, | 350 | guest_recv_modifier (void *cls, |
351 | const struct GNUNET_PSYC_MessageModifier *mod, | 351 | const struct GNUNET_PSYC_MessageModifier *mod, |
352 | uint64_t message_id, | 352 | uint64_t message_id, |
@@ -362,7 +362,7 @@ guest_recv_modifier (void *cls, | |||
362 | } | 362 | } |
363 | 363 | ||
364 | 364 | ||
365 | void | 365 | static void |
366 | guest_recv_data (void *cls, | 366 | guest_recv_data (void *cls, |
367 | const struct GNUNET_MessageHeader *msg, | 367 | const struct GNUNET_MessageHeader *msg, |
368 | uint64_t message_id, | 368 | uint64_t message_id, |
@@ -377,7 +377,7 @@ guest_recv_data (void *cls, | |||
377 | } | 377 | } |
378 | 378 | ||
379 | 379 | ||
380 | void | 380 | static void |
381 | guest_recv_eom (void *cls, | 381 | guest_recv_eom (void *cls, |
382 | const struct GNUNET_MessageHeader *msg, | 382 | const struct GNUNET_MessageHeader *msg, |
383 | uint64_t message_id, | 383 | uint64_t message_id, |
@@ -404,7 +404,7 @@ guest_recv_eom (void *cls, | |||
404 | } | 404 | } |
405 | 405 | ||
406 | 406 | ||
407 | void | 407 | static void |
408 | host_recv_method (void *cls, | 408 | host_recv_method (void *cls, |
409 | const struct GNUNET_PSYC_MessageMethod *meth, | 409 | const struct GNUNET_PSYC_MessageMethod *meth, |
410 | uint64_t message_id, | 410 | uint64_t message_id, |
@@ -420,7 +420,7 @@ host_recv_method (void *cls, | |||
420 | } | 420 | } |
421 | 421 | ||
422 | 422 | ||
423 | void | 423 | static void |
424 | host_recv_modifier (void *cls, | 424 | host_recv_modifier (void *cls, |
425 | const struct GNUNET_PSYC_MessageModifier *mod, | 425 | const struct GNUNET_PSYC_MessageModifier *mod, |
426 | uint64_t message_id, | 426 | uint64_t message_id, |
@@ -436,7 +436,7 @@ host_recv_modifier (void *cls, | |||
436 | } | 436 | } |
437 | 437 | ||
438 | 438 | ||
439 | void | 439 | static void |
440 | host_recv_data (void *cls, | 440 | host_recv_data (void *cls, |
441 | const struct GNUNET_MessageHeader *msg, | 441 | const struct GNUNET_MessageHeader *msg, |
442 | uint64_t message_id, | 442 | uint64_t message_id, |
@@ -451,7 +451,7 @@ host_recv_data (void *cls, | |||
451 | } | 451 | } |
452 | 452 | ||
453 | 453 | ||
454 | void | 454 | static void |
455 | host_recv_eom (void *cls, | 455 | host_recv_eom (void *cls, |
456 | const struct GNUNET_MessageHeader *msg, | 456 | const struct GNUNET_MessageHeader *msg, |
457 | uint64_t message_id, | 457 | uint64_t message_id, |
@@ -483,7 +483,7 @@ host_recv_eom (void *cls, | |||
483 | } | 483 | } |
484 | 484 | ||
485 | 485 | ||
486 | void | 486 | static void |
487 | guest_talk () | 487 | guest_talk () |
488 | { | 488 | { |
489 | test = TEST_GUEST_TALK; | 489 | test = TEST_GUEST_TALK; |
@@ -505,7 +505,8 @@ guest_talk () | |||
505 | GNUNET_SOCIAL_TALK_NONE); | 505 | GNUNET_SOCIAL_TALK_NONE); |
506 | } | 506 | } |
507 | 507 | ||
508 | void | 508 | |
509 | static void | ||
509 | host_announce () | 510 | host_announce () |
510 | { | 511 | { |
511 | test = TEST_HOST_ANNOUNCE; | 512 | test = TEST_HOST_ANNOUNCE; |
@@ -530,7 +531,8 @@ host_announce () | |||
530 | GNUNET_SOCIAL_ANNOUNCE_NONE); | 531 | GNUNET_SOCIAL_ANNOUNCE_NONE); |
531 | } | 532 | } |
532 | 533 | ||
533 | void | 534 | |
535 | static void | ||
534 | host_announce2 () | 536 | host_announce2 () |
535 | { | 537 | { |
536 | test = TEST_HOST_ANNOUNCE; | 538 | test = TEST_HOST_ANNOUNCE; |
@@ -555,7 +557,7 @@ host_announce2 () | |||
555 | } | 557 | } |
556 | 558 | ||
557 | 559 | ||
558 | void | 560 | static void |
559 | guest_recv_entry_decision (void *cls, | 561 | guest_recv_entry_decision (void *cls, |
560 | int is_admitted, | 562 | int is_admitted, |
561 | const struct GNUNET_PSYC_Message *entry_resp) | 563 | const struct GNUNET_PSYC_Message *entry_resp) |
@@ -596,7 +598,7 @@ guest_recv_entry_decision (void *cls, | |||
596 | } | 598 | } |
597 | 599 | ||
598 | 600 | ||
599 | void | 601 | static void |
600 | host_answer_door (void *cls, | 602 | host_answer_door (void *cls, |
601 | struct GNUNET_SOCIAL_Nym *nym, | 603 | struct GNUNET_SOCIAL_Nym *nym, |
602 | const char *method_name, | 604 | const char *method_name, |
@@ -635,7 +637,7 @@ host_answer_door (void *cls, | |||
635 | } | 637 | } |
636 | 638 | ||
637 | 639 | ||
638 | void | 640 | static void |
639 | guest_recv_local_enter (void *cls, int result, uint64_t max_message_id) | 641 | guest_recv_local_enter (void *cls, int result, uint64_t max_message_id) |
640 | { | 642 | { |
641 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Guest entered to local place.\n"); | 643 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Guest entered to local place.\n"); |
@@ -643,7 +645,7 @@ guest_recv_local_enter (void *cls, int result, uint64_t max_message_id) | |||
643 | } | 645 | } |
644 | 646 | ||
645 | 647 | ||
646 | void | 648 | static void |
647 | guest_enter () | 649 | guest_enter () |
648 | { | 650 | { |
649 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Entering to place as guest.\n"); | 651 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Entering to place as guest.\n"); |
@@ -668,7 +670,8 @@ guest_enter () | |||
668 | } | 670 | } |
669 | 671 | ||
670 | 672 | ||
671 | void id_guest_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | 673 | static void |
674 | id_guest_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | ||
672 | { | 675 | { |
673 | GNUNET_assert (NULL != ego); | 676 | GNUNET_assert (NULL != ego); |
674 | guest_ego = ego; | 677 | guest_ego = ego; |
@@ -683,7 +686,8 @@ void id_guest_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | |||
683 | } | 686 | } |
684 | 687 | ||
685 | 688 | ||
686 | void id_guest_created (void *cls, const char *emsg) | 689 | static void |
690 | id_guest_created (void *cls, const char *emsg) | ||
687 | { | 691 | { |
688 | if (NULL != emsg) | 692 | if (NULL != emsg) |
689 | { | 693 | { |
@@ -698,7 +702,8 @@ void id_guest_created (void *cls, const char *emsg) | |||
698 | } | 702 | } |
699 | 703 | ||
700 | 704 | ||
701 | void host_entered (void *cls, int result, uint64_t max_message_id) | 705 | static void |
706 | host_entered (void *cls, int result, uint64_t max_message_id) | ||
702 | { | 707 | { |
703 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Host entered to place.\n"); | 708 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Host entered to place.\n"); |
704 | 709 | ||
@@ -706,7 +711,8 @@ void host_entered (void *cls, int result, uint64_t max_message_id) | |||
706 | } | 711 | } |
707 | 712 | ||
708 | 713 | ||
709 | void id_host_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | 714 | static void |
715 | id_host_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | ||
710 | { | 716 | { |
711 | GNUNET_assert (NULL != ego); | 717 | GNUNET_assert (NULL != ego); |
712 | host_ego = ego; | 718 | host_ego = ego; |
@@ -724,7 +730,8 @@ void id_host_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | |||
724 | } | 730 | } |
725 | 731 | ||
726 | 732 | ||
727 | void id_host_created (void *cls, const char *emsg) | 733 | static void |
734 | id_host_created (void *cls, const char *emsg) | ||
728 | { | 735 | { |
729 | if (NULL != emsg) | 736 | if (NULL != emsg) |
730 | { | 737 | { |
@@ -739,14 +746,15 @@ void id_host_created (void *cls, const char *emsg) | |||
739 | } | 746 | } |
740 | 747 | ||
741 | 748 | ||
742 | void identity_ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, | 749 | static void |
743 | void **ctx, const char *name) | 750 | identity_ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, |
751 | void **ctx, const char *name) | ||
744 | { | 752 | { |
745 | 753 | ||
746 | } | 754 | } |
747 | 755 | ||
748 | 756 | ||
749 | void | 757 | static void |
750 | core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) | 758 | core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) |
751 | { | 759 | { |
752 | this_peer = *my_identity; | 760 | this_peer = *my_identity; |
@@ -763,7 +771,7 @@ core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) | |||
763 | * @param cfg configuration we use (also to connect to Social service) | 771 | * @param cfg configuration we use (also to connect to Social service) |
764 | * @param peer handle to access more of the peer (not used) | 772 | * @param peer handle to access more of the peer (not used) |
765 | */ | 773 | */ |
766 | void | 774 | static void |
767 | #if DEBUG_TEST_SOCIAL | 775 | #if DEBUG_TEST_SOCIAL |
768 | run (void *cls, char *const *args, const char *cfgfile, | 776 | run (void *cls, char *const *args, const char *cfgfile, |
769 | const struct GNUNET_CONFIGURATION_Handle *c) | 777 | const struct GNUNET_CONFIGURATION_Handle *c) |