gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29271 - gnunet-gtk/src/fs


From: gnunet
Subject: [GNUnet-SVN] r29271 - gnunet-gtk/src/fs
Date: Sun, 15 Sep 2013 21:18:51 +0200

Author: grothoff
Date: 2013-09-15 21:18:51 +0200 (Sun, 15 Sep 2013)
New Revision: 29271

Modified:
   gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
Log:
-fix return value to agree with iteration API

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c     2013-09-15 19:04:38 UTC 
(rev 29270)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c     2013-09-15 19:18:51 UTC 
(rev 29271)
@@ -1000,7 +1000,7 @@
 /**
  * Callback invoked for each embedded URIs. 
  *
- * @return #GNUNET_OK to continue iteration
+ * @return 0 to continue iteration, 1 to abort
  */
 typedef int (*EmbeddedUriCallback) (void *cls, 
                                    const struct GNUNET_FS_Uri *uri);
@@ -1034,7 +1034,7 @@
  * @param data_mime_type mime type of the meta data
  * @param data the meta data value
  * @param data_size number of bytes in @a data
- * @return #GNUNET_OK if we did not invoke the callback, otherwise
+ * @return 0 we did not invoke the callback, otherwise
  *         whatever the callback returned
  */
 static int
@@ -1050,13 +1050,17 @@
   char *emsg;
   struct GNUNET_FS_Uri *uri;
 
+  fprintf (stderr,
+          "Checking meta %d/%d %.*s for URI\n",
+          type, format,
+          (int) data_size, data);
   if ((EXTRACTOR_METATYPE_URI != type) ||
       (EXTRACTOR_METAFORMAT_UTF8 != format) ||
       (NULL == data_mime_type) ||
       (0 != strcmp ("text/plain", data_mime_type)) ||
       (0 == data_size) ||
       ('\0' != data[data_size - 1]) )
-    return GNUNET_OK; 
+    return 0; 
   emsg = NULL;
   uri = GNUNET_FS_uri_parse (data, &emsg);
   if (NULL == uri)
@@ -1067,8 +1071,9 @@
                data,
                emsg);
     GNUNET_free_non_null (emsg);
-    return GNUNET_OK;
+    return 0;
   }
+  fprintf (stderr, "URI found!\n");
   result = ctx->cb (ctx->cls, uri);
   GNUNET_FS_uri_destroy (uri);
   return result;
@@ -1119,8 +1124,8 @@
  * 
  * @param cls the `struct UriPopulationContext`
  * @param uri URI to download
- * @return #GNUNET_OK if we might add more iterms,
- *         #GNUNET_SYSERR if we have reached the limit
+ * @return 0 if we might add more iterms,
+ *         1 if we have reached the limit
  */
 static int
 populate_popup_with_uri_items (void *cls,
@@ -1159,7 +1164,7 @@
   gtk_widget_show (child);
   gtk_menu_shell_append (GTK_MENU_SHELL (ctx->menu), child);
 
-  return (ctx->counter < 4) ? GNUNET_OK : GNUNET_SYSERR;
+  return (ctx->counter < 4) ? 0 : 1;
 }
 
 
@@ -1251,7 +1256,7 @@
 
   /* check for embedded URIs */
   uri_pop_ctx.counter = 0;
-  uri_pop_ctx.menu = menu;
+  uri_pop_ctx.menu = menu;  
   find_embedded_uris (meta, 
                      &populate_popup_with_uri_items,
                      &uri_pop_ctx);
@@ -2224,7 +2229,7 @@
  * 
  * @param cls pointer to a `gboolean`
  * @param sks_uri a URI
- * @return #GNUNET_SYSERR (abort iteration)
+ * @return 1 (abort iteration)
  */
 static int
 see_if_there_are_any_uris (void *cls,
@@ -2233,7 +2238,7 @@
   gboolean *gb = cls;
 
   *gb = TRUE;
-  return GNUNET_SYSERR;
+  return 1;
 }
 
 




reply via email to

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