gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29247 - in gnunet/src: fs include util


From: gnunet
Subject: [GNUnet-SVN] r29247 - in gnunet/src: fs include util
Date: Sat, 14 Sep 2013 15:51:27 +0200

Author: grothoff
Date: 2013-09-14 15:51:27 +0200 (Sat, 14 Sep 2013)
New Revision: 29247

Modified:
   gnunet/src/fs/fs_file_information.c
   gnunet/src/fs/fs_publish.c
   gnunet/src/fs/gnunet-helper-fs-publish.c
   gnunet/src/fs/test_fs_publish_persistence.c
   gnunet/src/include/gnunet_fs_service.h
   gnunet/src/util/service.c
Log:
-fixing #3034

Modified: gnunet/src/fs/fs_file_information.c
===================================================================
--- gnunet/src/fs/fs_file_information.c 2013-09-13 19:46:45 UTC (rev 29246)
+++ gnunet/src/fs/fs_file_information.c 2013-09-14 13:51:27 UTC (rev 29247)
@@ -37,8 +37,7 @@
  *
  * @param s structure to get the filename for
  * @return NULL on error, otherwise filename that
- *         can be passed to "GNUNET_FS_file_information_recover"
- *         to read this fi-struct from disk.
+ *         can be used to read this fi-struct from disk.
  */
 const char *
 GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s)
@@ -80,6 +79,7 @@
     s->filename = NULL;
 }
 
+
 /**
  * Create an entry for a file in a publish-structure.
  *
@@ -89,8 +89,8 @@
  * @param keywords under which keywords should this file be available
  *         directly; can be NULL
  * @param meta metadata for the file
- * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
- *                GNUNET_SYSERR for simulation
+ * @param do_index #GNUNET_YES for index, #GNUNET_NO for insertion,
+ *                #GNUNET_SYSERR for simulation
  * @param bo block options
  * @return publish structure entry for the file
  */
@@ -215,8 +215,8 @@
  * @param keywords under which keywords should this file be available
  *         directly; can be NULL
  * @param meta metadata for the file
- * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
- *                GNUNET_SYSERR for simulation
+ * @param do_index #GNUNET_YES for index, #GNUNET_NO for insertion,
+ *                #GNUNET_SYSERR for simulation
  * @param bo block options
  * @return publish structure entry for the file
  */
@@ -316,13 +316,13 @@
 /**
  * Add an entry to a directory in a publish-structure.  Clients
  * should never modify publish structures that were passed to
- * "GNUNET_FS_publish_start" already.
+ * #GNUNET_FS_publish_start already.
  *
  * @param dir the directory
  * @param ent the entry to add; the entry must not have been
  *            added to any other directory at this point and
- *            must not include "dir" in its structure
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ *            must not include @a dir in its structure
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 int
 GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
@@ -344,16 +344,16 @@
 /**
  * Inspect a file or directory in a publish-structure.  Clients
  * should never modify publish structures that were passed to
- * "GNUNET_FS_publish_start" already.  When called on a directory,
- * this function will FIRST call "proc" with information about
+ * #GNUNET_FS_publish_start already.  When called on a directory,
+ * this function will FIRST call @a proc with information about
  * the directory itself and then for each of the files in the
  * directory (but not for files in subdirectories).  When called
- * on a file, "proc" will be called exactly once (with information
+ * on a file, @a proc will be called exactly once (with information
  * about the specific file).
  *
  * @param dir the directory
  * @param proc function to call on each entry
- * @param proc_cls closure for proc
+ * @param proc_cls closure for @a proc
  */
 void
 GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
@@ -392,13 +392,13 @@
 
 /**
  * Destroy publish-structure.  Clients should never destroy publish
- * structures that were passed to "GNUNET_FS_publish_start" already.
+ * structures that were passed to #GNUNET_FS_publish_start already.
  *
  * @param fi structure to destroy
  * @param cleaner function to call on each entry in the structure
  *        (useful to clean up client_info); can be NULL; return
  *        values are ignored
- * @param cleaner_cls closure for cleaner
+ * @param cleaner_cls closure for @a cleaner
  */
 void
 GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,

Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c  2013-09-13 19:46:45 UTC (rev 29246)
+++ gnunet/src/fs/fs_publish.c  2013-09-14 13:51:27 UTC (rev 29247)
@@ -106,8 +106,8 @@
  * Function called by the datastore API with
  * the result from the PUT request.
  *
- * @param cls the 'struct GNUNET_FS_PublishContext'
- * @param success GNUNET_OK on success
+ * @param cls the `struct GNUNET_FS_PublishContext *`
+ * @param success #GNUNET_OK on success
  * @param min_expiration minimum expiration time required for content to be 
stored
  * @param msg error message (or NULL)
  */
@@ -200,7 +200,7 @@
 /**
  * Datastore returns from reservation cancel request.
  *
- * @param cls the 'struct GNUNET_FS_PublishContext'
+ * @param cls the `struct GNUNET_FS_PublishContext *`
  * @param success success code (not used)
  * @param min_expiration minimum expiration time required for content to be 
stored
  * @param msg error message (typically NULL, not used)
@@ -284,7 +284,7 @@
  * We've finished publishing a KBlock as part of a larger upload.
  * Check the result and continue the larger upload.
  *
- * @param cls the "struct GNUNET_FS_PublishContext*"
+ * @param cls the `struct GNUNET_FS_PublishContext *`
  *        of the larger upload
  * @param uri URI of the published blocks
  * @param emsg NULL on success, otherwise error message
@@ -399,6 +399,7 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished with tree encoder\n");
   p = pc->fi_pos;
+  GNUNET_FS_file_information_sync_ (p);
   GNUNET_FS_tree_encoder_finish (p->te, &p->chk_uri, &emsg);
   p->te = NULL;
   if (NULL != emsg)
@@ -423,8 +424,7 @@
     pi.value.publish.specifics.progress.depth = GNUNET_FS_compute_depth (flen);
     p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen);
   }
-  GNUNET_FS_file_information_sync_ (p);
-  /* continue with main */
+  /* continue with main */  /* continue with main */
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
   pc->upload_task =
       GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -444,7 +444,7 @@
  * @param depth depth of the block in the file, 0 for DBLOCK
  * @param type type of the block (IBLOCK or DBLOCK)
  * @param block the (encrypted) block
- * @param block_size size of block (in bytes)
+ * @param block_size size of @a block (in bytes)
  */
 static void
 block_proc (void *cls, const struct ContentHashKey *chk, uint64_t offset,
@@ -508,7 +508,7 @@
  * @param cls closure
  * @param offset where are we in the file
  * @param pt_block plaintext of the currently processed block
- * @param pt_size size of pt_block
+ * @param pt_size size of @a pt_block
  * @param depth depth of the block in the tree, 0 for DBLOCK
  */
 static void
@@ -611,11 +611,12 @@
  * Process the response (or lack thereof) from
  * the "fs" service to our 'start index' request.
  *
- * @param cls closure (of type "struct GNUNET_FS_PublishContext*"_)
+ * @param cls closure (of type `struct GNUNET_FS_PublishContext *`)
  * @param msg the response we got
  */
 static void
-process_index_start_response (void *cls, const struct GNUNET_MessageHeader 
*msg)
+process_index_start_response (void *cls, 
+                             const struct GNUNET_MessageHeader *msg)
 {
   struct GNUNET_FS_PublishContext *pc = cls;
   struct GNUNET_FS_FileInformation *p;
@@ -668,7 +669,8 @@
  * @param res resulting hash, NULL on error
  */
 static void
-hash_for_index_cb (void *cls, const struct GNUNET_HashCode * res)
+hash_for_index_cb (void *cls,
+                  const struct GNUNET_HashCode *res)
 {
   struct GNUNET_FS_PublishContext *pc = cls;
   struct GNUNET_FS_FileInformation *p;
@@ -773,7 +775,7 @@
 /**
  * Main function that performs the upload.
  *
- * @param cls "struct GNUNET_FS_PublishContext" identifies the upload
+ * @param cls `struct GNUNET_FS_PublishContext *` identifies the upload
  * @param tc task context
  */
 void
@@ -799,8 +801,10 @@
     return;
   }
   /* find starting position */
-  while ((p->is_directory == GNUNET_YES) && (NULL != p->data.dir.entries) && 
(NULL == p->emsg)
-         && (NULL == p->data.dir.entries->chk_uri))
+  while ( (GNUNET_YES == p->is_directory) && 
+         (NULL != p->data.dir.entries) && 
+         (NULL == p->emsg) &&
+         (NULL == p->data.dir.entries->chk_uri) )
   {
     p = p->data.dir.entries;
     pc->fi_pos = p;
@@ -809,7 +813,9 @@
   /* abort on error */
   if (NULL != p->emsg)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error uploading: %s\n", p->emsg);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+               "Error uploading: %s\n", 
+               p->emsg);
     /* error with current file, abort all
      * related files as well! */
     while (NULL != p->dir)
@@ -897,7 +903,7 @@
  * Signal the FS's progress function that we are starting
  * an upload.
  *
- * @param cls closure (of type "struct GNUNET_FS_PublishContext*")
+ * @param cls closure (of type `struct GNUNET_FS_PublishContext *`)
  * @param fi the entry in the publish-structure
  * @param length length of the file or directory
  * @param meta metadata for the file or directory (can be modified)
@@ -905,13 +911,17 @@
  * @param bo block options
  * @param do_index should we index?
  * @param client_info pointer to client context set upon creation (can be 
modified)
- * @return GNUNET_OK to continue (always)
+ * @return #GNUNET_OK to continue (always)
  */
 static int
-fip_signal_start (void *cls, struct GNUNET_FS_FileInformation *fi,
-                  uint64_t length, struct GNUNET_CONTAINER_MetaData *meta,
-                  struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions 
*bo,
-                  int *do_index, void **client_info)
+fip_signal_start (void *cls,
+                 struct GNUNET_FS_FileInformation *fi,
+                  uint64_t length,
+                 struct GNUNET_CONTAINER_MetaData *meta,
+                  struct GNUNET_FS_Uri **uri, 
+                 struct GNUNET_FS_BlockOptions *bo,
+                  int *do_index, 
+                 void **client_info)
 {
   struct GNUNET_FS_PublishContext *pc = cls;
   struct GNUNET_FS_ProgressInfo pi;
@@ -1024,13 +1034,16 @@
  * @param bo block options
  * @param do_index should we index?
  * @param client_info pointer to client context set upon creation (can be 
modified)
- * @return GNUNET_OK to continue (always)
+ * @return #GNUNET_OK to continue (always)
  */
 static int
-fip_signal_suspend (void *cls, struct GNUNET_FS_FileInformation *fi,
-                    uint64_t length, struct GNUNET_CONTAINER_MetaData *meta,
+fip_signal_suspend (void *cls,
+                   struct GNUNET_FS_FileInformation *fi,
+                    uint64_t length, 
+                   struct GNUNET_CONTAINER_MetaData *meta,
                     struct GNUNET_FS_Uri **uri,
-                    struct GNUNET_FS_BlockOptions *bo, int *do_index,
+                    struct GNUNET_FS_BlockOptions *bo, 
+                   int *do_index,
                     void **client_info)
 {
   struct GNUNET_FS_PublishContext *pc = cls;
@@ -1081,7 +1094,7 @@
  * We have gotten a reply for our space reservation request.
  * Either fail (insufficient space) or start publishing for good.
  *
- * @param cls the 'struct GNUNET_FS_PublishContext*'
+ * @param cls the `struct GNUNET_FS_PublishContext *`
  * @param success positive reservation ID on success
  * @param min_expiration minimum expiration time required for content to be 
stored
  * @param msg error message on error, otherwise NULL
@@ -1097,7 +1110,8 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reservation complete (%d)!\n", 
success);
   if ((msg != NULL) || (success <= 0))
   {
-    GNUNET_asprintf (&pc->fi->emsg, _("Insufficient space for publishing: %s"),
+    GNUNET_asprintf (&pc->fi->emsg, 
+                    _("Insufficient space for publishing: %s"),
                      msg);
     signal_publish_error (pc->fi, pc, pc->fi->emsg);
     return;
@@ -1193,7 +1207,7 @@
  * Signal the FS's progress function that we are stopping
  * an upload.
  *
- * @param cls closure (of type "struct GNUNET_FS_PublishContext*")
+ * @param cls closure (of type `struct GNUNET_FS_PublishContext *`)
  * @param fi the entry in the publish-structure
  * @param length length of the file or directory
  * @param meta metadata for the file or directory (can be modified)
@@ -1201,7 +1215,7 @@
  * @param bo block options (can be modified)
  * @param do_index should we index?
  * @param client_info pointer to client context set upon creation (can be 
modified)
- * @return GNUNET_OK to continue (always)
+ * @return #GNUNET_OK to continue (always)
  */
 static int
 fip_signal_stop (void *cls, struct GNUNET_FS_FileInformation *fi,

Modified: gnunet/src/fs/gnunet-helper-fs-publish.c
===================================================================
--- gnunet/src/fs/gnunet-helper-fs-publish.c    2013-09-13 19:46:45 UTC (rev 
29246)
+++ gnunet/src/fs/gnunet-helper-fs-publish.c    2013-09-14 13:51:27 UTC (rev 
29247)
@@ -87,7 +87,12 @@
  */
 static struct EXTRACTOR_PluginList *plugins;
 
+/**
+ * File descriptor we use for IPC with the parent.
+ */
+static int output_stream;
 
+
 /**
  * Add meta data that libextractor finds to our meta data
  * container.
@@ -140,11 +145,11 @@
 
 
 /**
- * Write 'size' bytes from 'buf' into 'out'.
+ * Write @a size bytes from @a buf into the #output_stream.
  *
  * @param buf buffer with data to write
  * @param size number of bytes to write
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
 write_all (const void *buf,
@@ -157,7 +162,7 @@
   total = 0;
   do
   {
-    wr = write (1,
+    wr = write (output_stream,
                &cbuf[total],
                size - total);
     if (wr > 0)
@@ -176,8 +181,8 @@
  *
  * @param message_type message type to use
  * @param data data to append, NULL for none
- * @param data_length number of bytes in data
- * @return GNUNET_SYSERR to stop scanning (the pipe was broken somehow)
+ * @param data_length number of bytes in @a data
+ * @return #GNUNET_SYSERR to stop scanning (the pipe was broken somehow)
  */
 static int
 write_message (uint16_t message_type,
@@ -187,7 +192,8 @@
   struct GNUNET_MessageHeader hdr;
 
 #if 0
-  fprintf (stderr, "Helper sends %u-byte message of type %u\n",
+  fprintf (stderr, 
+          "Helper sends %u-byte message of type %u\n",
           (unsigned int) (sizeof (struct GNUNET_MessageHeader) + data_length),
           (unsigned int) message_type);
 #endif
@@ -211,8 +217,8 @@
  *
  * @param filename file or directory to scan
  * @param dst where to store the resulting share tree item;
- *         NULL is stored in 'dst' upon recoverable errors (GNUNET_OK is 
returned)
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ *         NULL is stored in @a dst upon recoverable errors (#GNUNET_OK is 
returned)
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
 preprocess_file (const char *filename,
@@ -241,9 +247,9 @@
  * of the files in the directory to the tree.  Called by the directory
  * scanner to initiate the scan.  Does NOT yet add any metadata.
  *
- * @param cls the 'struct RecursionContext'
+ * @param cls the `struct RecursionContext`
  * @param filename file or directory to scan
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
 scan_callback (void *cls,
@@ -276,8 +282,8 @@
  *
  * @param filename file or directory to scan
  * @param dst where to store the resulting share tree item;
- *         NULL is stored in 'dst' upon recoverable errors (GNUNET_OK is 
returned) 
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ *         NULL is stored in @a dst upon recoverable errors (#GNUNET_OK is 
returned) 
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
 preprocess_file (const char *filename,
@@ -340,7 +346,7 @@
  * Extract metadata from files.
  *
  * @param item entry we are processing
- * @return GNUNET_OK on success, GNUNET_SYSERR on fatal errors
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on fatal errors
  */
 static int
 extract_files (struct ScanTreeNode *item)
@@ -428,6 +434,29 @@
     fprintf (stderr,
              "Failed to install SIGPIPE handler: %s\n", strerror (errno));
 }
+
+
+/**
+ * Turn the given file descriptor in to '/dev/null'.
+ *
+ * @param fd fd to bind to /dev/null
+ * @param flags flags to use (O_RDONLY or O_WRONLY)
+ */
+static void
+make_dev_zero (int fd, 
+              int flags)
+{
+  int z;
+
+  GNUNET_assert (0 == close (fd));
+  z = open ("/dev/null", flags);
+  GNUNET_assert (-1 != z);
+  if (z == fd)
+    return;
+  dup2 (z, fd);
+  GNUNET_assert (0 == close (z));
+}
+
 #endif
 
 
@@ -441,8 +470,9 @@
  *                 otherwise custom plugins to load from LE
  * @return 0 on success
  */
-int main(int argc,
-        char *const *argv)
+int 
+main (int argc,
+      char *const *argv)
 {
   const char *filename_expanded;
   const char *ex;
@@ -456,8 +486,14 @@
   /* Get utf-8-encoded arguments */
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
     return 5;
+  output_stream = 1; /* stdout */
 #else
   ignore_sigpipe ();
+  /* move stdout to some other FD for IPC, bind 
+     stdout/stderr to /dev/null */
+  output_stream = dup (1);
+  make_dev_zero (1, O_WRONLY);
+  make_dev_zero (2, O_WRONLY);
 #endif
 
   /* parse command line */

Modified: gnunet/src/fs/test_fs_publish_persistence.c
===================================================================
--- gnunet/src/fs/test_fs_publish_persistence.c 2013-09-13 19:46:45 UTC (rev 
29246)
+++ gnunet/src/fs/test_fs_publish_persistence.c 2013-09-14 13:51:27 UTC (rev 
29247)
@@ -93,8 +93,10 @@
 {
   rtask = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_FS_stop (fs);
-  fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence", &progress_cb, NULL,
-                        GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_END);
+  fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence", 
+                       &progress_cb, NULL,
+                        GNUNET_FS_FLAGS_PERSISTENCE,
+                       GNUNET_FS_OPTIONS_END);
 }
 
 
@@ -123,7 +125,8 @@
 
 
 static void *
-progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event)
+progress_cb (void *cls,
+            const struct GNUNET_FS_ProgressInfo *event)
 {
   void *ret;
 
@@ -138,7 +141,8 @@
                                   (1 +
                                    GNUNET_TIME_absolute_get_duration
                                    (start).rel_value_us) / 1024));
-    if (0 == strcmp ("publish-context-dir", event->value.publish.cctx))
+    if ( (NULL != event->value.publish.cctx) &&
+        (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) )
       GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL);
     break;
   case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
@@ -206,7 +210,8 @@
     break;
   case GNUNET_FS_STATUS_PUBLISH_STOPPED:
     consider_restart (event->status);
-    if (0 == strcmp ("publish-context-dir", event->value.publish.cctx))
+    if ( (NULL != event->value.publish.cctx) &&
+        (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) )
       GNUNET_assert (publish == event->value.publish.pc);
     break;
   default:

Modified: gnunet/src/include/gnunet_fs_service.h
===================================================================
--- gnunet/src/include/gnunet_fs_service.h      2013-09-13 19:46:45 UTC (rev 
29246)
+++ gnunet/src/include/gnunet_fs_service.h      2013-09-14 13:51:27 UTC (rev 
29247)
@@ -186,7 +186,7 @@
  *
  * @param uri ksk uri to get the keywords from
  * @param iterator function to call on each keyword
- * @param iterator_cls closure for iterator
+ * @param iterator_cls closure for @a iterator
  * @return -1 if this is not a keyword URI, otherwise number of
  *   keywords iterated over until iterator aborted
  */
@@ -201,7 +201,7 @@
  *
  * @param uri the location URI to inspect
  * @param peer where to store the identify of the peer (presumably) offering 
the content
- * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK
+ * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK
  */
 int
 GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
@@ -303,7 +303,8 @@
  *  if keywords is not legal (i.e. empty).
  */
 struct GNUNET_FS_Uri *
-GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv);
+GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, 
+                                   const char **argv);
 
 
 /**
@@ -311,7 +312,7 @@
  *
  * @param u1 one of the URIs
  * @param u2 the other URI
- * @return GNUNET_YES if the URIs are equal
+ * @return #GNUNET_YES if the URIs are equal
  */
 int
 GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
@@ -322,7 +323,7 @@
  * Is this a namespace URI?
  *
  * @param uri the uri to check
- * @return GNUNET_YES if this is an SKS uri
+ * @return #GNUNET_YES if this is an SKS uri
  */
 int
 GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
@@ -346,7 +347,7 @@
  *
  * @param uri the uri to get the namespace ID from
  * @param pseudonym where to store the public key of the namespace
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
  */
 int
 GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
@@ -367,7 +368,7 @@
  * Is this a keyword URI?
  *
  * @param uri the uri
- * @return GNUNET_YES if this is a KSK uri
+ * @return #GNUNET_YES if this is a KSK uri
  */
 int
 GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
@@ -377,7 +378,7 @@
  * Is this a file (or directory) URI?
  *
  * @param uri the uri to check
- * @return GNUNET_YES if this is a CHK uri
+ * @return #GNUNET_YES if this is a CHK uri
  */
 int
 GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
@@ -398,7 +399,7 @@
  * Is this a location URI?
  *
  * @param uri the uri to check
- * @return GNUNET_YES if this is a LOC uri
+ * @return #GNUNET_YES if this is a LOC uri
  */
 int
 GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
@@ -429,7 +430,7 @@
  * @param scls must be of type "struct GNUNET_FS_Uri **"
  * @param option name of the option (typically 'k')
  * @param value command line argument given
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
  */
 int
 GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
@@ -444,10 +445,10 @@
  * the metadata must be passed as the "scls" argument.
  *
  * @param ctx command line processor context
- * @param scls must be of type "struct GNUNET_CONTAINER_MetaData **"
+ * @param scls must be of type `struct GNUNET_CONTAINER_MetaData **`
  * @param option name of the option (typically 'k')
  * @param value command line argument given
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
  */
 int
 GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
@@ -1664,7 +1665,7 @@
 
 
 /**
- * Function called on entries in a GNUNET_FS_FileInformation publish-structure.
+ * Function called on entries in a `struct GNUNET_FS_FileInformation` 
iteration.
  *
  * @param cls closure
  * @param fi the entry in the publish-structure
@@ -1674,8 +1675,8 @@
  * @param bo block options (can be modified)
  * @param do_index should we index (can be modified)
  * @param client_info pointer to client context set upon creation (can be 
modified)
- * @return GNUNET_OK to continue, GNUNET_NO to remove
- *         this entry from the directory, GNUNET_SYSERR
+ * @return #GNUNET_OK to continue, #GNUNET_NO to remove
+ *         this entry from the directory, #GNUNET_SYSERR
  *         to abort the iteration
  */
 typedef int (*GNUNET_FS_FileInformationProcessor) (void *cls,
@@ -1697,8 +1698,7 @@
  * file information structures.
  *
  * @param s structure to get the filename for
- * @return NULL on error, otherwise filename that
- *         can be passed to "GNUNET_FS_file_information_recover"
+ * @return NULL on error, otherwise filename that can be used 
  *         to read this fi-struct from disk.
  */
 const char *
@@ -1737,8 +1737,8 @@
  * @param keywords under which keywords should this file be available
  *         directly; can be NULL
  * @param meta metadata for the file
- * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
- *                GNUNET_SYSERR for simulation
+ * @param do_index #GNUNET_YES for index, #GNUNET_NO for insertion,
+ *                #GNUNET_SYSERR for simulation
  * @param bo block options
  * @return publish structure entry for the file
  */
@@ -1766,8 +1766,8 @@
  * @param keywords under which keywords should this file be available
  *         directly; can be NULL
  * @param meta metadata for the file
- * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
- *                GNUNET_SYSERR for simulation
+ * @param do_index #GNUNET_YES for index, #GNUNET_NO for insertion,
+ *                #GNUNET_SYSERR for simulation
  * @param bo block options
  * @return publish structure entry for the file
  */
@@ -1802,7 +1802,7 @@
  *            the reader to clean up its internal state
  * @param buf where the reader should write the data
  * @param emsg location for the reader to store an error message
- * @return number of bytes written, usually "max", 0 on error
+ * @return number of bytes written, usually @a max, 0 on error
  */
 typedef size_t (*GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max,
                                         void *buf, char **emsg);
@@ -1815,12 +1815,12 @@
  * @param client_info initial client-info value for this entry
  * @param length length of the file
  * @param reader function that can be used to obtain the data for the file
- * @param reader_cls closure for "reader"
+ * @param reader_cls closure for @a reader
  * @param keywords under which keywords should this file be available
  *         directly; can be NULL
  * @param meta metadata for the file
- * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
- *                GNUNET_SYSERR for simulation
+ * @param do_index #GNUNET_YES for index, #GNUNET_NO for insertion,
+ *                #GNUNET_SYSERR for simulation
  * @param bo block options
  * @return publish structure entry for the file
  */
@@ -1842,7 +1842,7 @@
 /**
  * Create an entry for an empty directory in a publish-structure.
  * This function should be used by applications for which the
- * use of "GNUNET_FS_file_information_create_from_directory"
+ * use of #GNUNET_FS_file_information_create_from_directory
  * is not appropriate.
  *
  * @param h handle to the file sharing subsystem
@@ -2100,7 +2100,7 @@
  * @param h handle to the file sharing subsystem
  * @param iterator function to call on each indexed file
  * @param iterator_cls closure for @a iterator
- * @return NULL on error ('iter' is not called)
+ * @return NULL on error (@a iterator is not called)
  */
 struct GNUNET_FS_GetIndexedContext *
 GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
@@ -2145,8 +2145,8 @@
  *
  * @param cls closure
  * @param last_id last identifier
- * @param last_uri uri used for the content published under the last_id
- * @param last_meta metadata associated with last_uri
+ * @param last_uri uri used for the content published under the @a last_id
+ * @param last_meta metadata associated with @a last_uri
  * @param next_id identifier that should be used for updates
  */
 typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, 
@@ -2282,35 +2282,35 @@
  */
 enum GNUNET_FS_DownloadOptions
 {
-    /**
-     * No options (use defaults for everything).
-     */
+  /**
+   * No options (use defaults for everything).
+   */
   GNUNET_FS_DOWNLOAD_OPTION_NONE = 0,
-
-    /**
-     * Only download from the local host, do not access remote systems (no P2P)
-     */
+  
+  /**
+   * Only download from the local host, do not access remote systems (no P2P)
+   */
   GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY = 1,
 
-    /**
-     * Do a recursive download (that is, automatically trigger the
-     * download of files in directories).
-     */
+  /**
+   * Do a recursive download (that is, automatically trigger the
+   * download of files in directories).
+   */
   GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE = 2,
 
-    /**
-     * Do not append temporary data to
-     * the target file (for the IBlocks).
-     */
+  /**
+   * Do not append temporary data to
+   * the target file (for the IBlocks).
+   */
   GNUNET_FS_DOWNLOAD_NO_TEMPORARIES = 4,
 
-    /**
-     * Internal option used to flag this download as a 'probe' for a
-     * search result.  Impacts the priority with which the download is
-     * run and causes signalling callbacks to be done differently.
-     * Also, probe downloads are not serialized on suspension.  Normal
-     * clients should not use this!
-     */
+  /**
+   * Internal option used to flag this download as a 'probe' for a
+   * search result.  Impacts the priority with which the download is
+   * run and causes signalling callbacks to be done differently.
+   * Also, probe downloads are not serialized on suspension.  Normal
+   * clients should not use this!
+   */
   GNUNET_FS_DOWNLOAD_IS_PROBE = (1 << 31)
 };
 

Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c   2013-09-13 19:46:45 UTC (rev 29246)
+++ gnunet/src/util/service.c   2013-09-14 13:51:27 UTC (rev 29247)
@@ -1573,7 +1573,7 @@
  * Detach from terminal.
  *
  * @param sctx service context
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
 detach_terminal (struct GNUNET_SERVICE_Context *sctx)




reply via email to

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