gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r37157 - gnunet/src/social


From: gnunet
Subject: [GNUnet-SVN] r37157 - gnunet/src/social
Date: Thu, 12 May 2016 03:50:28 +0200

Author: tg
Date: 2016-05-12 03:50:28 +0200 (Thu, 12 May 2016)
New Revision: 37157

Modified:
   gnunet/src/social/gnunet-social.c
Log:
social cli docs

Modified: gnunet/src/social/gnunet-social.c
===================================================================
--- gnunet/src/social/gnunet-social.c   2016-05-12 00:21:25 UTC (rev 37156)
+++ gnunet/src/social/gnunet-social.c   2016-05-12 01:50:28 UTC (rev 37157)
@@ -157,6 +157,9 @@
 /* DISCONNECT */
 
 
+/**
+ * Callback called after the host or guest place disconnected.
+ */
 static void
 disconnected (void *cls)
 {
@@ -164,6 +167,9 @@
 }
 
 
+/**
+ * Callback called after the application disconnected.
+ */
 static void
 app_disconnected (void *cls)
 {
@@ -185,6 +191,9 @@
 }
 
 
+/**
+ * Disconnect from connected GNUnet services.
+ */
 static void
 disconnect ()
 {
@@ -193,9 +202,7 @@
 }
 
 /**
- * Terminate the test case (failure).
- *
- * @param cls NULL
+ * Callback called when the program failed to finish the requested operation 
in time.
  */
 static void
 timeout (void *cls)
@@ -219,6 +226,9 @@
 }
 
 
+/**
+ * Schedule exit with succes result.
+ */
 static void
 exit_success ()
 {
@@ -231,6 +241,9 @@
 }
 
 
+/**
+ * Schedule exit with failure result.
+ */
 static void
 exit_fail ()
 {
@@ -246,6 +259,11 @@
 /* LEAVE */
 
 
+/**
+ * Callback notifying about the host has left and stopped hosting the place.
+ *
+ * This also indicates the end of the connection to the service.
+ */
 static void
 host_left ()
 {
@@ -255,6 +273,9 @@
 }
 
 
+/**
+ * Leave a place permanently and stop hosting a place.
+ */
 static void
 host_leave ()
 {
@@ -264,6 +285,11 @@
 }
 
 
+/**
+ * Callback notifying about the guest has left the place.
+ *
+ * This also indicates the end of the connection to the service.
+ */
 static void
 guest_left (void *cls)
 {
@@ -272,13 +298,15 @@
 }
 
 
+/**
+ * Leave a place permanently as guest.
+ */
 static void
 guest_leave ()
 {
   struct GNUNET_PSYC_Environment *env = GNUNET_PSYC_env_create ();
-    // method in the middle of vars? FIXME
   GNUNET_PSYC_env_add (env, GNUNET_PSYC_OP_SET,
-                       "_notice_place_leave", DATA2ARG ("Leaving."));
+                       "_message", DATA2ARG ("Leaving."));
   GNUNET_SOCIAL_guest_leave (gst, env, guest_left, NULL);
   GNUNET_PSYC_env_destroy (env);
   gst = NULL;
@@ -296,6 +324,10 @@
 } tmit;
 
 
+/**
+ * Callback notifying about available buffer space to write message data
+ * when transmitting messages using host_announce() or guest_talk()
+ */
 static int
 notify_data (void *cls, uint16_t *data_size, void *data)
 {
@@ -326,6 +358,9 @@
 }
 
 
+/**
+ * Host announcement - send a message to the place.
+ */
 static void
 host_announce (const char *method, const char *data, size_t data_size)
 {
@@ -342,6 +377,10 @@
                                GNUNET_SOCIAL_ANNOUNCE_NONE);
 }
 
+
+/**
+ * Assign a state var of @a name to the value of @a data.
+ */
 static void
 host_assign (const char *name, const char *data, size_t data_size)
 {
@@ -356,6 +395,9 @@
 }
 
 
+/**
+ * Guest talk request to host.
+ */
 static void
 guest_talk (const char *method,
             const char *data, size_t data_size)
@@ -377,6 +419,9 @@
 /* HISTORY REPLAY */
 
 
+/**
+ * Callback notifying about the end of history replay results.
+ */
 static void
 recv_history_replay_result (void *cls, int64_t result,
                             const void *data, uint16_t data_size)
@@ -393,6 +438,10 @@
 }
 
 
+/**
+ * Replay history between a given @a start and @a end message IDs,
+ * optionally filtered by a method @a prefix.
+ */
 static void
 history_replay (uint64_t start, uint64_t end, const char *prefix)
 {
@@ -404,6 +453,9 @@
 }
 
 
+/**
+ * Replay latest @a limit messages.
+ */
 static void
 history_replay_latest (uint64_t limit, const char *prefix)
 {
@@ -418,6 +470,9 @@
 /* LOOK AT/FOR */
 
 
+/**
+ * Callback notifying about the end of state var results.
+ */
 static void
 look_result (void *cls, int64_t result_code,
              const void *data, uint16_t data_size)
@@ -432,6 +487,9 @@
 }
 
 
+/**
+ * Callback notifying about a state var result.
+ */
 static void
 look_var (void *cls,
           const struct GNUNET_MessageHeader *mod,
@@ -441,22 +499,28 @@
           uint32_t full_value_size)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "look_at_var: %s\n%.*s\n",
+              "Received var: %s\n%.*s\n",
               name, value_size, (const char *) value);
 }
 
 
+/**
+ * Look for a state var using exact match of the name.
+ */
 static void
-look_at (const char *name)
+look_at (const char *full_name)
 {
-  GNUNET_SOCIAL_place_look_at (plc, name, look_var, look_result, NULL);
+  GNUNET_SOCIAL_place_look_at (plc, full_name, look_var, look_result, NULL);
 }
 
 
+/**
+ * Look for state vars by name prefix.
+ */
 static void
-look_for (const char *name)
+look_for (const char *name_prefix)
 {
-  GNUNET_SOCIAL_place_look_for (plc, name, look_var, look_result, NULL);
+  GNUNET_SOCIAL_place_look_for (plc, name_prefix, look_var, look_result, NULL);
 }
 
 
@@ -463,6 +527,9 @@
 /* SLICER */
 
 
+/**
+ * Callback notifying about the start of a new incoming message.
+ */
 static void
 slicer_recv_method (void *cls,
                     const struct GNUNET_PSYC_MessageHeader *msg,
@@ -477,6 +544,9 @@
 }
 
 
+/**
+ * Callback notifying about an incoming modifier.
+ */
 static void
 slicer_recv_modifier (void *cls,
                       const struct GNUNET_PSYC_MessageHeader *msg,
@@ -495,6 +565,9 @@
 }
 
 
+/**
+ * Callback notifying about an incoming data fragment.
+ */
 static void
 slicer_recv_data (void *cls,
                   const struct GNUNET_PSYC_MessageHeader *msg,
@@ -510,6 +583,9 @@
 }
 
 
+/**
+ * Callback notifying about the end of a message.
+ */
 static void
 slicer_recv_eom (void *cls,
                 const struct GNUNET_PSYC_MessageHeader *msg,
@@ -524,6 +600,9 @@
 }
 
 
+/**
+ * Create a slicer for receiving message parts.
+ */
 static struct GNUNET_PSYC_Slicer *
 slicer_create ()
 {
@@ -540,6 +619,12 @@
 /* GUEST ENTER */
 
 
+/**
+ * Callback called when the guest receives an entry decision from the host.
+ *
+ * It is called once after using guest_enter() or guest_enter_by_name(),
+ * in case of a reconnection only the local enter callback is called.
+ */
 static void
 guest_recv_entry_decision (void *cls,
                            int is_admitted,
@@ -572,6 +657,9 @@
 }
 
 
+/**
+ * Callback called after a guest connection is established to the local 
service.
+ */
 static void
 guest_recv_local_enter (void *cls, int result,
                         const struct GNUNET_CRYPTO_EddsaPublicKey *pub_key,
@@ -590,6 +678,9 @@
 }
 
 
+/**
+ * Create entry requset message.
+ */
 static struct GNUNET_PSYC_Message *
 guest_enter_msg_create ()
 {
@@ -604,6 +695,9 @@
 }
 
 
+/**
+ * Enter a place as guest, using its public key and peer ID.
+ */
 static void
 guest_enter (const struct GNUNET_CRYPTO_EddsaPublicKey *pub_key,
              const struct GNUNET_PeerIdentity *peer)
@@ -628,6 +722,9 @@
 }
 
 
+/**
+ * Enter a place as guest using its GNS address.
+ */
 static void
 guest_enter_by_name (const char *gns_name)
 {
@@ -645,6 +742,11 @@
 /* HOST ENTER */
 
 
+/**
+ * Callback called when a @a nym wants to enter the place.
+ *
+ * The request needs to be replied with an entry decision.
+ */
 static void
 host_answer_door (void *cls,
                   struct GNUNET_SOCIAL_Nym *nym,
@@ -683,6 +785,9 @@
 }
 
 
+/**
+ * Callback called when a @a nym has left the place.
+ */
 static void
 host_farewell (void *cls,
                const struct GNUNET_SOCIAL_Nym *nym,
@@ -699,6 +804,9 @@
 }
 
 
+/**
+ * Callback called after the host entered the place.
+ */
 static void
 host_entered (void *cls, int result,
               const struct GNUNET_CRYPTO_EddsaPublicKey *pub_key,
@@ -717,6 +825,9 @@
 }
 
 
+/**
+ * Enter and start hosting a place.
+ */
 static void
 host_enter ()
 {
@@ -740,6 +851,9 @@
 /* PLACE RECONNECT */
 
 
+/**
+ * Perform operations common to both host & guest places.
+ */
 static void
 place_reconnected ()
 {
@@ -763,6 +877,9 @@
 }
 
 
+/**
+ * Callback called after reconnecting to a host place.
+ */
 static void
 host_reconnected (void *cls, int result,
                  const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
@@ -786,6 +903,9 @@
 }
 
 
+/**
+ * Callback called after reconnecting to a guest place.
+ */
 static void
 guest_reconnected (void *cls, int result,
                    const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key,
@@ -809,6 +929,9 @@
 /* APP */
 
 
+/**
+ * Callback called after the ego and place callbacks.
+ */
 static void
 app_connected (void *cls)
 {
@@ -853,6 +976,9 @@
 }
 
 
+/**
+ * Callback notifying about a host place available for reconnection.
+ */
 static void
 app_recv_host (void *cls,
                struct GNUNET_SOCIAL_HostConnection *hconn,
@@ -877,6 +1003,9 @@
 }
 
 
+/**
+ * Callback notifying about a guest place available for reconnection.
+ */
 static void
 app_recv_guest (void *cls,
                 struct GNUNET_SOCIAL_GuestConnection *gconn,
@@ -901,6 +1030,9 @@
 }
 
 
+/**
+ * Callback notifying about an available ego.
+ */
 static void
 app_recv_ego (void *cls,
               struct GNUNET_SOCIAL_Ego *e,
@@ -920,6 +1052,10 @@
 }
 
 
+
+/**
+ * Establish application connection to receive available egos and places.
+ */
 static void
 app_connect ()
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]