gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r333 - in GNUnet: . src/applications/fs/fsui src/applicatio


From: grothoff
Subject: [GNUnet-SVN] r333 - in GNUnet: . src/applications/fs/fsui src/applications/fs/tools src/include
Date: Sat, 26 Feb 2005 22:56:57 -0800 (PST)

Author: grothoff
Date: 2005-02-26 22:56:56 -0800 (Sat, 26 Feb 2005)
New Revision: 333

Modified:
   GNUnet/src/applications/fs/fsui/collection.c
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsui.h
   GNUnet/src/applications/fs/fsui/namespace_info.c
   GNUnet/src/applications/fs/fsui/search.c
   GNUnet/src/applications/fs/fsui/upload.c
   GNUnet/src/applications/fs/tools/gnunet-download.c
   GNUnet/src/applications/fs/tools/gnunet-insert.c
   GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
   GNUnet/src/applications/fs/tools/gnunet-search.c
   GNUnet/src/include/gnunet_fsui_lib.h
   GNUnet/src/include/gnunet_util.h
   GNUnet/todo
Log:
completing FSUI API refactoring

Modified: GNUnet/src/applications/fs/fsui/collection.c
===================================================================
--- GNUnet/src/applications/fs/fsui/collection.c        2005-02-27 06:32:47 UTC 
(rev 332)
+++ GNUnet/src/applications/fs/fsui/collection.c        2005-02-27 06:56:56 UTC 
(rev 333)
@@ -67,6 +67,7 @@
  * Start collection.
  */
 int FSUI_startCollection(struct FSUI_Context * ctx,
+                        unsigned int anonymityLevel,
                         const char * name,
                         const struct ECRS_MetaData * meta) {
   struct ECRS_URI * advertisement;
@@ -88,7 +89,7 @@
   makeRandomId(&nextId);
   if (OK != ECRS_createNamespace(name,
                                 meta,
-                                ctx->anonymityLevel,
+                                anonymityLevel,
                                 prio,
                                 now + COLLECTION_ADV_LIFETIME,
                                 advertisement,

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2005-02-27 06:32:47 UTC (rev 
332)
+++ GNUnet/src/applications/fs/fsui/download.c  2005-02-27 06:56:56 UTC (rev 
333)
@@ -41,12 +41,14 @@
  *  if the disk does not have enough space).
  */
 static int startDownload(struct FSUI_Context * ctx,
+                        unsigned int anonymityLevel,                    
                         const struct ECRS_URI * uri,
                         const char * filename,
                         int is_recursive,
                         FSUI_DownloadList * parent);
 
 static int triggerRecursiveDownload(const ECRS_FileInfo * fi,
+                                   unsigned int anonymityLevel,
                                    const HashCode160 * key,
                                    FSUI_DownloadList * parent) {
   int i;
@@ -83,6 +85,7 @@
   strcat(fullName, filename);
   FREE(filename);
   startDownload(parent->ctx,
+               anonymityLevel,
                fi->uri,
                fullName,
                YES,
@@ -277,6 +280,7 @@
  *  if the disk does not have enough space).
  */
 static int startDownload(struct FSUI_Context * ctx,
+                        unsigned int anonymityLevel, 
                         const struct ECRS_URI * uri,
                         const char * filename,
                         int is_recursive,
@@ -296,7 +300,7 @@
   dl->is_recursive = is_recursive;
   dl->parent = parent;
   dl->is_directory = SYSERR; /* don't know */
-  dl->anonymityLevel = ctx->anonymityLevel;
+  dl->anonymityLevel = anonymityLevel;
   dl->ctx = ctx;
   dl->filename = STRDUP(filename);
   dl->uri = ECRS_dupUri(uri);
@@ -332,9 +336,15 @@
  *  if the disk does not have enough space).
  */
 int FSUI_startDownload(struct FSUI_Context * ctx,
+                      unsigned int anonymityLevel,                      
                       const struct ECRS_URI * uri,
                       const char * filename) {
-  return startDownload(ctx, uri, filename, NO, NULL);
+  return startDownload(ctx,
+                      anonymityLevel, 
+                      uri, 
+                      filename,
+                      NO, 
+                      NULL);
 }
 
 /**
@@ -404,9 +414,15 @@
  *  SYSERR if the file does not exist
  */
 int FSUI_startDownloadAll(struct FSUI_Context * ctx,
+                         unsigned int anonymityLevel,                   
                          const struct ECRS_URI * uri,
                          const char * dirname) {
-  return startDownload(ctx, uri, dirname, YES, NULL);
+  return startDownload(ctx, 
+                      anonymityLevel,
+                      uri, 
+                      dirname, 
+                      YES,
+                      NULL);
 }
 
 /**

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2005-02-27 06:32:47 UTC (rev 
332)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2005-02-27 06:56:56 UTC (rev 
333)
@@ -35,7 +35,9 @@
  *
  * @return NULL on error
  */
-struct FSUI_Context * FSUI_start(FSUI_EventCallback cb,
+struct FSUI_Context * FSUI_start(const char * name,
+                                int doResume,
+                                FSUI_EventCallback cb,
                                 void * closure) {
   FSUI_Context * ret;  
   char * fn;
@@ -43,24 +45,27 @@
 
   ret = MALLOC(sizeof(FSUI_Context));
   memset(ret, 0, sizeof(FSUI_Context));
-  fn = getConfigurationString("",
-                             "GNUNET_HOME");
-  gh = expandFileName(fn);
-  FREE(fn);
-  fn = MALLOC(strlen(gh) + strlen("fsui-lock") + 2);
-  strcpy(fn, gh);
-  FREE(gh);
-  strcat(fn, DIR_SEPARATOR_STR);
-  strcat(fn, "fsui-lock");
-  ret->ipc = IPC_SEMAPHORE_NEW(fn,
-                              1);
-  LOG(LOG_INFO,
-      "Getting IPC lock for FSUI (%s).\n",
-      fn);
-  FREE(fn);
-  IPC_SEMAPHORE_DOWN(ret->ipc);
-  LOG(LOG_INFO,
-      "Aquired IPC lock.\n");
+  if (doResume) {
+    fn = getConfigurationString("",
+                               "GNUNET_HOME");
+    gh = expandFileName(fn);
+    FREE(fn);
+    fn = MALLOC(strlen(gh) + strlen(name) + 2);
+    strcpy(fn, gh);
+    FREE(gh);
+    strcat(fn, DIR_SEPARATOR_STR);
+    strcat(fn, "fsui-lock");
+    ret->ipc = IPC_SEMAPHORE_NEW(fn,
+                                1);
+    LOG(LOG_INFO,
+       "Getting IPC lock for FSUI (%s).\n",
+       fn);
+    FREE(fn);
+    IPC_SEMAPHORE_DOWN(ret->ipc);
+    LOG(LOG_INFO,
+       "Aquired IPC lock.\n");
+  } else
+    ret->ipc = NULL;
   MUTEX_CREATE_RECURSIVE(&ret->lock);
   ret->ecb = cb;
   ret->ecbClosure = closure;
@@ -145,34 +150,17 @@
   /* FIXME: serialize dpos state! */
   freeDownloadList(ctx->activeDownloads);
   ctx->activeDownloads = NULL;
-
-  IPC_SEMAPHORE_UP(ctx->ipc);
-  IPC_SEMAPHORE_FREE(ctx->ipc);
+  if (ctx->ipc != NULL) {
+    IPC_SEMAPHORE_UP(ctx->ipc);
+    IPC_SEMAPHORE_FREE(ctx->ipc);
+  }
   MUTEX_DESTROY(&ctx->lock);
   FREE(ctx);
   LOG(LOG_INFO,
       "FSUI shutdown complete.\n");
 }
 
-/**
- * Set the anonymity level in this FSUI context for
- * all actions that are started from now on (until
- * the next call to setAnonymityLevel).
- */
-void FSUI_setAnonymityLevel(struct FSUI_Context * ctx,
-                           unsigned int anonymityLevel) {
-  ctx->anonymityLevel = anonymityLevel;
-}
 
-/**
- * Get the anonymity level that is currently used
- * by this FSUI context.
- */
-unsigned int FSUI_getAnonymityLevel(const struct FSUI_Context * ctx) {
-  return ctx->anonymityLevel;
-}
-
-
 /* *************** internal helper functions *********** */
 
 

Modified: GNUnet/src/applications/fs/fsui/fsui.h
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.h      2005-02-27 06:32:47 UTC (rev 
332)
+++ GNUnet/src/applications/fs/fsui/fsui.h      2005-02-27 06:56:56 UTC (rev 
333)
@@ -91,6 +91,8 @@
    */
   struct ECRS_URI * uri;
 
+  unsigned int anonymityLevel;
+
   /**
    * Of how many individual queries does the
    * boolean query consist (1 for non-boolean queries).
@@ -240,11 +242,6 @@
   void * ecbClosure;
 
   /**
-   * Current anonymity level.
-   */
-  unsigned int anonymityLevel;
-
-  /**
    * Collection related data.
    */
   DataContainer * collectionData;

Modified: GNUnet/src/applications/fs/fsui/namespace_info.c
===================================================================
--- GNUnet/src/applications/fs/fsui/namespace_info.c    2005-02-27 06:32:47 UTC 
(rev 332)
+++ GNUnet/src/applications/fs/fsui/namespace_info.c    2005-02-27 06:56:56 UTC 
(rev 333)
@@ -147,6 +147,7 @@
  * @return OK on success, SYSERR on error (namespace already exists)
  */
 int FSUI_createNamespace(struct FSUI_Context * ctx,
+                        unsigned int anonymityLevel,
                         const char * namespaceName,
                         const struct ECRS_MetaData * meta,
                         const struct ECRS_URI * advertisementURI,
@@ -156,7 +157,7 @@
 
   ret = ECRS_createNamespace(namespaceName,
                             meta,
-                            ctx->anonymityLevel,
+                            anonymityLevel,
                             getConfigurationInt("FS", "INSERT-PRIORITY"),
                             getConfigurationInt("FS", "INSERT-EXPIRATION") * 
cronYEARS + cronTime(NULL),
                             advertisementURI,
@@ -318,6 +319,7 @@
  * @param uri set to the resulting URI
  */
 int FSUI_addToNamespace(struct FSUI_Context * ctx,
+                       unsigned int anonymityLevel,
                        const char * name,
                        cron_t updateInterval,
                        const HashCode160 * lastId,
@@ -333,7 +335,7 @@
 
 
   ret = ECRS_addToNamespace(name,
-                           ctx->anonymityLevel,
+                           anonymityLevel,
                            getConfigurationInt("FS", "INSERT-PRIORITY"),
                            getConfigurationInt("FS", "INSERT-EXPIRATION") * 
cronYEARS + cronTime(NULL),
                            creationTime,

Modified: GNUnet/src/applications/fs/fsui/search.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search.c    2005-02-27 06:32:47 UTC (rev 
332)
+++ GNUnet/src/applications/fs/fsui/search.c    2005-02-27 06:56:56 UTC (rev 
333)
@@ -133,7 +133,7 @@
 
 static void * searchThread(FSUI_SearchList * pos) {
   ECRS_search(pos->uri,
-             pos->ctx->anonymityLevel,
+             pos->anonymityLevel,
              cronTime(NULL) + cronYEARS, /* timeout!?*/
              (ECRS_SearchProgressCallback) &spcb,
              pos,
@@ -146,6 +146,7 @@
  * Start a search.
  */
 int FSUI_startSearch(struct FSUI_Context * ctx,
+                    unsigned int anonymityLevel,
                     const struct ECRS_URI * uri) {
   FSUI_SearchList * pos;
 
@@ -167,6 +168,7 @@
   pos->resultsReceived = NULL;
   pos->sizeUnmatchedResultsReceived = 0;
   pos->unmatchedResultsReceived = 0;
+  pos->anonymityLevel = anonymityLevel;
   pos->ctx = ctx;
   if (0 != PTHREAD_CREATE(&pos->handle,
                          (PThreadMain) &searchThread,
@@ -253,6 +255,7 @@
     if (iter != NULL) {
       if (OK != iter(closure,
                     pos->uri,
+                    pos->anonymityLevel,
                     pos->sizeResultsReceived,
                     pos->resultsReceived)) {
        MUTEX_UNLOCK(&ctx->lock);

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2005-02-27 06:32:47 UTC (rev 
332)
+++ GNUnet/src/applications/fs/fsui/upload.c    2005-02-27 06:56:56 UTC (rev 
333)
@@ -439,6 +439,7 @@
  */
 int FSUI_upload(struct FSUI_Context * ctx,
                const char * filename,
+               unsigned int anonymityLevel,
                int doIndex,
                const struct ECRS_MetaData * md,
                unsigned int keywordCount,
@@ -447,7 +448,7 @@
   UploadThreadClosure * utc;
   
   utc = MALLOC(sizeof(UploadThreadClosure));
-  utc->anonymityLevel = ctx->anonymityLevel;
+  utc->anonymityLevel = anonymityLevel;
   utc->priority = getConfigurationInt("FS",
                                      "INSERT-PRIORITY");
   utc->expiration = cronTime(NULL) + 120 * cronYEARS;
@@ -501,6 +502,7 @@
 */
 int FSUI_uploadAll(struct FSUI_Context * ctx,
                   const char * dirname,
+                  unsigned int anonymityLevel,
                   int doIndex,
                   const struct ECRS_MetaData * directoryMetaData,
                   const char * extractorPluginNames,
@@ -514,7 +516,7 @@
   utc = MALLOC(sizeof(UploadThreadClosure));
   utc->ctx = ctx;
   utc->isRecursive = YES;
-  utc->anonymityLevel = ctx->anonymityLevel;
+  utc->anonymityLevel = anonymityLevel;
   utc->priority = getConfigurationInt("FS",
                                      "INSERT-PRIORITY");
   utc->expiration = cronTime(NULL) + 120 * cronYEARS;

Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c  2005-02-27 06:32:47 UTC 
(rev 332)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c  2005-02-27 06:56:56 UTC 
(rev 333)
@@ -234,20 +234,23 @@
   }
   FREE(fstring);
   signalFinished = SEMAPHORE_NEW(0);
-  ctx = FSUI_start(&progressModel,
+  ctx = FSUI_start("gnunet-download",
+                  NO,
+                  &progressModel,
                   &ok);
-  FSUI_setAnonymityLevel(ctx,
-                        getConfigurationInt("FS",
-                                            "ANONYMITY-SEND"));
   startCron();
   if (testConfigurationString("GNUNET-DOWNLOAD",
                              "RECURSIVE",
                              "YES"))
     ok = FSUI_startDownloadAll(ctx,
+                              getConfigurationInt("FS",
+                                                  "ANONYMITY-RECEIVE"),
                               uri,
                               filename);
   else
     ok = FSUI_startDownload(ctx,
+                           getConfigurationInt("FS",
+                                               "ANONYMITY-RECEIVE"),
                            uri,
                            filename);
   if (OK == ok) 

Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c    2005-02-27 06:32:47 UTC 
(rev 332)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c    2005-02-27 06:56:56 UTC 
(rev 333)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001, 2002, 2003, 2004 Christian Grothoff (and other contributing 
authors)
+     (C) 2001, 2002, 2003, 2004, 2005 Christian Grothoff (and other 
contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -95,6 +95,8 @@
                                       "INTERVAL");
 
   FSUI_addToNamespace(ctx,
+                     getConfigurationInt("FS",
+                                         "ANONYMITY-SEND"),
                      pname,
                      updateInterval,
                      pid == NULL ? NULL : &prevId,
@@ -612,12 +614,11 @@
 
   exitSignal = SEMAPHORE_NEW(0);
   /* fundamental init */
-  ctx = FSUI_start((FSUI_EventCallback) &printstatus,
+  ctx = FSUI_start("gnunet-insert",
+                  NO,
+                  (FSUI_EventCallback) &printstatus,
                   &verbose);
-  FSUI_setAnonymityLevel(ctx,
-                        getConfigurationInt("FS",
-                                            "ANONYMITY-SEND"));
-  
+ 
   /* first insert all of the top-level files or directories */
   tmp = getConfigurationString("GNUNET-INSERT",
                               "MAIN-FILE");
@@ -639,6 +640,8 @@
                              "YES")) {
     ret = FSUI_uploadAll(ctx,
                         filename,
+                        getConfigurationInt("FS",
+                                            "ANONYMITY-SEND"),
                         doIndex,
                         meta,
                         extractors,
@@ -649,6 +652,8 @@
   } else {
     ret = FSUI_upload(ctx,
                      filename,
+                     getConfigurationInt("FS",
+                                         "ANONYMITY-SEND"),
                      doIndex,
                      meta,
                      topKeywordCnt,

Modified: GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2005-02-27 06:32:47 UTC 
(rev 332)
+++ GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2005-02-27 06:56:56 UTC 
(rev 333)
@@ -298,7 +298,9 @@
   if (OK != initUtil(argc, argv, &parser))
     return SYSERR;
 
-  ctx = FSUI_start(&eventCallback,
+  ctx = FSUI_start("gnunet-pseudonym",
+                  NO,
+                  &eventCallback,
                   NULL);
 
   /* stop collections */
@@ -368,6 +370,7 @@
                         EXTRACTOR_OWNER,
                         pname);
       if (OK == FSUI_startCollection(ctx,
+                                    0, /* FIXME: anonymity level! */
                                     pname,
                                     meta)) {
        printf(_("Started collection '%s'.\n"),
@@ -410,6 +413,7 @@
       }
       FREE(keyword);
       if (OK != FSUI_createNamespace(ctx,
+                                    0, /* FIXME: anonymity level! */
                                     pname,
                                     meta,
                                     advertisement,

Modified: GNUnet/src/applications/fs/tools/gnunet-search.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-search.c    2005-02-27 06:32:47 UTC 
(rev 332)
+++ GNUnet/src/applications/fs/tools/gnunet-search.c    2005-02-27 06:56:56 UTC 
(rev 333)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001, 2002, 2003, 2004 Christian Grothoff (and other contributing 
authors)
+     (C) 2001, 2002, 2003, 2004, 2005 Christian Grothoff (and other 
contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -254,17 +254,17 @@
     max.max = (unsigned int)-1; /* infty */
   /* FIXME: initialize max.buildDirectory */
 
-  ctx = FSUI_start((FSUI_EventCallback) &eventCallback,
+  ctx = FSUI_start("gnunet-search",
+                  NO,
+                  (FSUI_EventCallback) &eventCallback,
                   &max);
   if (ctx == NULL) {
     ECRS_freeUri(uri);
     return SYSERR;
   }
-  FSUI_setAnonymityLevel(ctx,
-                        getConfigurationInt("FS",
-                                            "ANONYMITY-RECEIVE"));
-
   FSUI_startSearch(ctx,
+                  getConfigurationInt("FS",
+                                      "ANONYMITY-RECEIVE"),
                   uri);  
   wait_for_shutdown();
   FSUI_stopSearch(ctx,

Modified: GNUnet/src/include/gnunet_fsui_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fsui_lib.h        2005-02-27 06:32:47 UTC (rev 
332)
+++ GNUnet/src/include/gnunet_fsui_lib.h        2005-02-27 06:56:56 UTC (rev 
333)
@@ -1,5 +1,6 @@
 /*
      This file is part of GNUnet
+     (C) 2004, 2005 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -290,6 +291,7 @@
  */
 typedef int (*FSUI_SearchIterator)(void * cls,
                                   const struct ECRS_URI * searchUri,
+                                  unsigned int anonymityLevel,
                                   unsigned int resultCount,
                                   const ECRS_FileInfo * results);
 
@@ -322,40 +324,49 @@
                                     unsigned int anonymityLevel);
 
 /**
- * Start FSUI manager.  Use the given progress callback to notify the
- * UI about events.  Start processing pending activities that were
- * running when FSUI_stop was called previously.  There can only be
- * one FSUI_Context open PER USER.  The second time anyone tries to
- * open an FSUI_Context, FSUI_start will BLOCK until the first
- * FSUI_Context is released (with FSUI_stop).  This may seem totally
- * awful, but it is the only way to ensure that everything stays
- * consistent.
+ * @brief Start the FSUI manager.  Use the given progress callback to
+ * notify the UI about events.  May resume processing pending
+ * activities that were running when FSUI_stop was called
+ * previously.<p>
  *
+ * The basic idea is that graphical user interfaces use their UI name
+ * (i.e.  gnunet-gtk) for 'name' and set doResume to YES.  They should
+ * have a command-line switch --resume=NAME to allow the user to
+ * change 'name' to something else (such that the user can resume
+ * state from another GUI).  Shell UIs on the other hand should set
+ * doResume to NO and may hard-wire a 'name' (which has no semantic
+ * meaning, however, the name of the UI would still be a good choice).
+ * <p>
+ *
+ * Note that suspend/resume is not implemented in this version of
+ * GNUnet.  
+ *
+ * @param name name of the tool or set of tools; used to
+ *          resume activities; tools that use the same name here
+ *          and that also use resume cannot run multiple instances
+ *          in parallel (for the same user account); the name
+ *          must be a valid filename (not a path)
+ * @param doResume YES if old activities should be resumed (also
+ *          implies that on shutdown, all pending activities are
+ *          suspended instead of canceled);
+ *          NO if activities should never be resumed
+ * @param cb function to call for events, must not be NULL
+ * @param closure extra argument to cb
  * @return NULL on error
  */
-struct FSUI_Context * FSUI_start(FSUI_EventCallback cb,
+struct FSUI_Context * FSUI_start(const char * name,
+                                int doResume,
+                                FSUI_EventCallback cb,
                                 void * closure); /* fsui.c */
 
 /**
- * Stop all processes under FSUI control (serialize state, continue
- * later if possible).
+ * Stop all processes under FSUI control (may serialize
+ * state to continue later if possible).  Will also let
+ * uninterruptable activities complete (you may want to
+ * signal the user that this may take a while).
  */
 void FSUI_stop(struct FSUI_Context * ctx); /* fsui.c */
 
-/**
- * Set the anonymity level in this FSUI context for
- * all actions that are started from now on (until
- * the next call to setAnonymityLevel).
- */
-void FSUI_setAnonymityLevel(struct FSUI_Context * ctx,
-                           unsigned int anonymityLevel); /* fsui.c */
-
-/**
- * Get the anonymity level that is currently used
- * by this FSUI context.
- */
-unsigned int FSUI_getAnonymityLevel(const struct FSUI_Context * ctx); /* 
fsui.c */
-
 /* ******************** simple FS API **************** */
 
 /**
@@ -385,6 +396,7 @@
  *  success
  */
 int FSUI_startSearch(struct FSUI_Context * ctx,
+                    unsigned int anonymityLevel,
                     const struct ECRS_URI * uri); /* search.c */
 
 /**
@@ -410,6 +422,7 @@
  *  if the disk does not have enough space).
  */
 int FSUI_startDownload(struct FSUI_Context * ctx,
+                      unsigned int anonymityLevel,
                       const struct ECRS_URI * uri,
                       const char * filename); /* download.c */
 
@@ -419,8 +432,8 @@
  * @return SYSERR if no such download is pending
  */
 int FSUI_stopDownload(struct FSUI_Context * ctx,
-                      const struct ECRS_URI * uri,
-                      const char * filename); /* download.c */
+                     const struct ECRS_URI * uri,
+                     const char * filename); /* download.c */
 
 /**
  * List active downloads.  Will NOT list completed
@@ -444,6 +457,7 @@
  */
 int FSUI_upload(struct FSUI_Context * ctx,
                const char * filename,
+               unsigned int anonymityLevel,
                int doIndex,
                const struct ECRS_MetaData * md,
                unsigned int keywordCount,
@@ -478,6 +492,7 @@
 */
 int FSUI_uploadAll(struct FSUI_Context * ctx,
                   const char * dirname,
+                  unsigned int anonymityLevel,
                   int doIndex,
                   const struct ECRS_MetaData * directoryMetaData,
                   const char * extractorPluginNames,
@@ -493,6 +508,7 @@
  *  SYSERR if the file does not exist
  */
 int FSUI_startDownloadAll(struct FSUI_Context * ctx,
+                         unsigned int anonymityLevel,
                          const struct ECRS_URI * uri,
                          const char * dirname); /* download.c */
 
@@ -512,6 +528,7 @@
  * Start collection.
  */
 int FSUI_startCollection(struct FSUI_Context * ctx,
+                        unsigned int anonymityLevel,
                         const char * name,
                         const struct ECRS_MetaData * meta); /* collection.c */
 
@@ -543,6 +560,7 @@
  * @return OK on success, SYSERR on error (namespace already exists)
  */
 int FSUI_createNamespace(struct FSUI_Context * ctx,
+                        unsigned int anonymityLevel,
                         const char * namespaceName,
                         const struct ECRS_MetaData * meta,
                         const struct ECRS_URI * advertisementURI,
@@ -606,6 +624,7 @@
  * @param uri set to the resulting URI
  */
 int FSUI_addToNamespace(struct FSUI_Context * ctx,
+                       unsigned int anonymityLevel,
                        const char * name,
                        cron_t updateInterval,
                        const HashCode160 * lastId,

Modified: GNUnet/src/include/gnunet_util.h
===================================================================
--- GNUnet/src/include/gnunet_util.h    2005-02-27 06:32:47 UTC (rev 332)
+++ GNUnet/src/include/gnunet_util.h    2005-02-27 06:56:56 UTC (rev 333)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001, 2002, 2003, 2004 Christian Grothoff (and other contributing 
authors)
+     (C) 2001, 2002, 2003, 2004, 2005 Christian Grothoff (and other 
contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2005-02-27 06:32:47 UTC (rev 332)
+++ GNUnet/todo 2005-02-27 06:56:56 UTC (rev 333)
@@ -17,8 +17,6 @@
   * ECRS-directories (build, iterate)
   * gnunet-directory
   * gnunet-pseudonym
-- FSUI:
-  * API changes (Krista discussion, anonymity level)
 
 0.7.0pre1 [4'05] (aka "preview"):
 - util:





reply via email to

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