aboutsummaryrefslogtreecommitdiff
path: root/src/social/test_social.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-19 22:35:24 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-19 22:35:24 +0000
commitf22d7bf5f70549ce384b33d2fbb6b881fb2f2298 (patch)
treeb052959bd1a13a9c02fc805fbd5b52ca68be1dea /src/social/test_social.c
parentca95e95dab4bfc82a0009fd04a64e28aae8c25f8 (diff)
downloadgnunet-f22d7bf5f70549ce384b33d2fbb6b881fb2f2298.tar.gz
gnunet-f22d7bf5f70549ce384b33d2fbb6b881fb2f2298.zip
-use static
Diffstat (limited to 'src/social/test_social.c')
-rw-r--r--src/social/test_social.c84
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
117void 117static void
118guest_enter (); 118guest_enter ();
119 119
120 120
121void 121static void
122guest_talk (); 122guest_talk ();
123 123
124 124
125void 125static void
126host_announce2 (); 126host_announce2 ();
127 127
128 128
129/** 129/**
130 * Clean up all resources used. 130 * Clean up all resources used.
131 */ 131 */
132void 132static void
133cleanup () 133cleanup ()
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 */
167void 167static void
168end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 168end_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 */
182void 182static void
183end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 183end_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 */
194void 194static void
195end () 195end ()
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
221int 221static int
222notify_data (void *cls, uint16_t *data_size, void *data) 222notify_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
268void host_left () 268static void
269host_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
280void 281static void
281schedule_host_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 282schedule_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
288void 289static void
289host_farewell (void *cls, 290host_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
310void 311static void
311guest_left (void *cls) 312guest_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
323void 324static void
324guest_leave() 325guest_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 333static void
333void
334guest_recv_method (void *cls, 334guest_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
349void 349static void
350guest_recv_modifier (void *cls, 350guest_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
365void 365static void
366guest_recv_data (void *cls, 366guest_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
380void 380static void
381guest_recv_eom (void *cls, 381guest_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
407void 407static void
408host_recv_method (void *cls, 408host_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
423void 423static void
424host_recv_modifier (void *cls, 424host_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
439void 439static void
440host_recv_data (void *cls, 440host_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
454void 454static void
455host_recv_eom (void *cls, 455host_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
486void 486static void
487guest_talk () 487guest_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
508void 508
509static void
509host_announce () 510host_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
533void 534
535static void
534host_announce2 () 536host_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
558void 560static void
559guest_recv_entry_decision (void *cls, 561guest_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
599void 601static void
600host_answer_door (void *cls, 602host_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
638void 640static void
639guest_recv_local_enter (void *cls, int result, uint64_t max_message_id) 641guest_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
646void 648static void
647guest_enter () 649guest_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
671void id_guest_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) 673static void
674id_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
686void id_guest_created (void *cls, const char *emsg) 689static void
690id_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
701void host_entered (void *cls, int result, uint64_t max_message_id) 705static void
706host_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
709void id_host_ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) 714static void
715id_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
727void id_host_created (void *cls, const char *emsg) 733static void
734id_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
742void identity_ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, 749static void
743 void **ctx, const char *name) 750identity_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
749void 757static void
750core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) 758core_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 */
766void 774static void
767#if DEBUG_TEST_SOCIAL 775#if DEBUG_TEST_SOCIAL
768run (void *cls, char *const *args, const char *cfgfile, 776run (void *cls, char *const *args, const char *cfgfile,
769 const struct GNUNET_CONFIGURATION_Handle *c) 777 const struct GNUNET_CONFIGURATION_Handle *c)