gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r1315 - Extractor Extractor/libltdl GNUnet/src/applications


From: grothoff
Subject: [GNUnet-SVN] r1315 - Extractor Extractor/libltdl GNUnet/src/applications/fs/ecrs GNUnet/src/applications/fs/fsui GNUnet/src/applications/fs/tools GNUnet/src/include GNUnet/src/util gnunet-gtk/src/plugins/fs
Date: Fri, 8 Jul 2005 12:31:45 -0700 (PDT)

Author: grothoff
Date: 2005-07-08 12:31:29 -0700 (Fri, 08 Jul 2005)
New Revision: 1315

Modified:
   Extractor/INSTALL
   Extractor/compile
   Extractor/libltdl/install-sh
   GNUnet/src/applications/fs/ecrs/namespace.c
   GNUnet/src/applications/fs/fsui/collection.c
   GNUnet/src/applications/fs/fsui/namespace_info.c
   GNUnet/src/applications/fs/tools/gnunet-insert.c
   GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
   GNUnet/src/include/gnunet_ecrs_lib.h
   GNUnet/src/include/gnunet_fsui_lib.h
   GNUnet/src/include/gnunet_util.h
   GNUnet/src/util/configuration.c
   GNUnet/src/util/logging.c
   gnunet-gtk/src/plugins/fs/namespace.c
Log:
cleaning up APIs

Modified: Extractor/INSTALL
===================================================================
--- Extractor/INSTALL   2005-07-08 19:30:42 UTC (rev 1314)
+++ Extractor/INSTALL   2005-07-08 19:31:29 UTC (rev 1315)
@@ -1,16 +1,13 @@
-Installation Instructions
-*************************
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
+   This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
 
 Basic Installation
 ==================
 
-These are generic installation instructions.
+   These are generic installation instructions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -70,9 +67,9 @@
 Compilers and Options
 =====================
 
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -85,7 +82,7 @@
 Compiling For Multiple Architectures
 ====================================
 
-You can compile the package for more than one kind of computer at the
+   You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you must use a version of `make' that
 supports the `VPATH' variable, such as GNU `make'.  `cd' to the
@@ -102,19 +99,19 @@
 Installation Names
 ==================
 
-By default, `make install' will install the package's files in
+   By default, `make install' will install the package's files in
 `/usr/local/bin', `/usr/local/man', etc.  You can specify an
 installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
+option `--prefix=PATH'.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
 Documentation and other data files will still use the regular prefix.
 
    In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
+options like `--bindir=PATH' to specify different values for particular
 kinds of files.  Run `configure --help' for a list of the directories
 you can set and what kinds of files go in them.
 
@@ -125,7 +122,7 @@
 Optional Features
 =================
 
-Some packages pay attention to `--enable-FEATURE' options to
+   Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -140,11 +137,11 @@
 Specifying the System Type
 ==========================
 
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -170,9 +167,9 @@
 Sharing Defaults
 ================
 
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -181,7 +178,7 @@
 Defining Variables
 ==================
 
-Variables not defined in a site shell script can be set in the
+   Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -189,18 +186,14 @@
 
      ./configure CC=/usr/local2/bin/gcc
 
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).  Here is a another example:
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
 
-     /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
-
 `configure' Invocation
 ======================
 
-`configure' recognizes the following options to control how it operates.
+   `configure' recognizes the following options to control how it
+operates.
 
 `--help'
 `-h'

Modified: Extractor/compile
===================================================================
--- Extractor/compile   2005-07-08 19:30:42 UTC (rev 1314)
+++ Extractor/compile   2005-07-08 19:31:29 UTC (rev 1315)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2005-02-03.08
+scriptversion=2003-11-09.00
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 # Written by Tom Tromey <address@hidden>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -47,49 +47,45 @@
 
 Report bugs to <address@hidden>.
 EOF
-    exit $?
+    exit 0
     ;;
   -v | --v*)
     echo "compile $scriptversion"
-    exit $?
+    exit 0
     ;;
 esac
 
+
+prog=$1
+shift
+
 ofile=
 cfile=
-eat=
-
-for arg
-do
-  if test -n "$eat"; then
-    eat=
-  else
-    case $1 in
-      -o)
-       # configure might choose to run compile as `compile cc -o foo foo.c'.
-       # So we strip `-o arg' only if arg is an object.
-       eat=1
-       case $2 in
-         *.o | *.obj)
-           ofile=$2
-           ;;
-         *)
-           set x "$@" -o "$2"
-           shift
-           ;;
-       esac
-       ;;
-      *.c)
-       cfile=$1
-       set x "$@" "$1"
-       shift
-       ;;
-      *)
-       set x "$@" "$1"
-       shift
-       ;;
-    esac
-  fi
+args=
+while test $# -gt 0; do
+  case "$1" in
+    -o)
+      # configure might choose to run compile as `compile cc -o foo foo.c'.
+      # So we do something ugly here.
+      ofile=$2
+      shift
+      case "$ofile" in
+       *.o | *.obj)
+         ;;
+       *)
+         args="$args -o $ofile"
+         ofile=
+         ;;
+      esac
+       ;;
+    *.c)
+      cfile=$1
+      args="$args $1"
+      ;;
+    *)
+      args="$args $1"
+      ;;
+  esac
   shift
 done
 
@@ -99,38 +95,36 @@
   # normal compilation that the losing compiler can handle.  If no
   # `.c' file was seen then we are probably linking.  That is also
   # ok.
-  exec "$@"
+  exec "$prog" $args
 fi
 
 # Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
 
 # Create the lock directory.
 # Note: use `[/.-]' here to ensure that we don't use the same name
 # that we are using for the .o file.  Also, base the name on the expected
 # object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
 while true; do
-  if mkdir "$lockdir" >/dev/null 2>&1; then
+  if mkdir $lockdir > /dev/null 2>&1; then
     break
   fi
   sleep 1
 done
 # FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
+trap "rmdir $lockdir; exit 1" 1 2 15
 
 # Run the compile.
-"$@"
-ret=$?
+"$prog" $args
+status=$?
 
 if test -f "$cofile"; then
   mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
-  mv "${cofile}bj" "$ofile"
 fi
 
-rmdir "$lockdir"
-exit $ret
+rmdir $lockdir
+exit $status
 
 # Local Variables:
 # mode: shell-script

Modified: Extractor/libltdl/install-sh
===================================================================
--- Extractor/libltdl/install-sh        2005-07-08 19:30:42 UTC (rev 1314)
+++ Extractor/libltdl/install-sh        2005-07-08 19:31:29 UTC (rev 1315)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2005-02-02.21
+scriptversion=2004-04-01.17
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -58,6 +58,9 @@
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
 
+transformbasename=
+transform_arg=
+instcmd="$mvprog"
 chmodcmd="$chmodprog 0755"
 chowncmd=
 chgrpcmd=
@@ -67,27 +70,23 @@
 src=
 dst=
 dir_arg=
-dstarg=
-no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
+   or: $0 -d DIRECTORIES...
 
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
 
 Options:
--c         (ignored)
+-b=TRANSFORMBASENAME
+-c         copy source (using $cpprog) instead of moving (using $mvprog).
 -d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
+-g GROUP   $chgrp installed files to GROUP.
+-m MODE    $chmod installed files to MODE.
+-o USER    $chown installed files to USER.
+-s         strip installed files (using $stripprog).
+-t=TRANSFORM
 --help     display this help and exit.
 --version  display version info and exit.
 
@@ -97,9 +96,14 @@
 
 while test -n "$1"; do
   case $1 in
-    -c) shift
+    -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+        shift
         continue;;
 
+    -c) instcmd=$cpprog
+        shift
+        continue;;
+
     -d) dir_arg=true
         shift
         continue;;
@@ -109,7 +113,7 @@
         shift
         continue;;
 
-    --help) echo "$usage"; exit $?;;
+    --help) echo "$usage"; exit 0;;
 
     -m) chmodcmd="$chmodprog $2"
         shift
@@ -125,20 +129,14 @@
         shift
         continue;;
 
-    -t) dstarg=$2
-       shift
-       shift
-       continue;;
+    -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+        shift
+        continue;;
 
-    -T) no_target_directory=true
-       shift
-       continue;;
+    --version) echo "$0 $scriptversion"; exit 0;;
 
-    --version) echo "$0 $scriptversion"; exit $?;;
-
     *)  # When -d is used, all remaining arguments are directories to create.
-       # When -t is used, the destination is already specified.
-       test -n "$dir_arg$dstarg" && break
+       test -n "$dir_arg" && break
         # Otherwise, the last argument is the destination.  Remove it from 
address@hidden
        for arg
        do
@@ -176,13 +174,13 @@
     src=
 
     if test -d "$dst"; then
-      mkdircmd=:
+      instcmd=:
       chmodcmd=
     else
-      mkdircmd=$mkdirprog
+      instcmd=$mkdirprog
     fi
   else
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
     if test ! -f "$src" && test ! -d "$src"; then
@@ -204,16 +202,12 @@
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-       echo "$0: $dstarg: Is a directory" >&2
-       exit 1
-      fi
       dst=$dst/`basename "$src"`
     fi
   fi
 
   # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+  dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
 
   # Make sure that the destination directory exists.
 
@@ -226,8 +220,7 @@
     oIFS=$IFS
     # Some sh's can't handle IFS=/ for some reason.
     IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@address@hidden' -e 'address@hidden@/@'`
-    shift
+    set - `echo "$dstdir" | sed -e 's@/@address@hidden' -e 'address@hidden@/@'`
     IFS=$oIFS
 
     pathcomp=
@@ -236,42 +229,51 @@
       pathcomp=$pathcomp$1
       shift
       if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
+        $mkdirprog "$pathcomp" || lasterr=$?
        # mkdir can fail with a `File exist' error in case several
        # install-sh are creating the directory concurrently.  This
        # is OK.
-       test -d "$pathcomp" || exit
+       test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; }
       fi
       pathcomp=$pathcomp/
     done
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
+    $doit $instcmd "$dst" \
       && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
       && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
 
   else
-    dstfile=`basename "$dst"`
+    # If we're going to rename the final executable, determine the name now.
+    if test -z "$transformarg"; then
+      dstfile=`basename "$dst"`
+    else
+      dstfile=`basename "$dst" $transformbasename \
+               | sed $transformarg`$transformbasename
+    fi
 
+    # don't allow the sed command to completely eliminate the filename.
+    test -z "$dstfile" && dstfile=`basename "$dst"`
+
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
     rmtmp=$dstdir/_rm.$$_
 
     # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
     trap '(exit $?); exit' 1 2 13 15
 
-    # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    # Move or copy the file name to the temp name
+    $doit $instcmd "$src" "$dsttmp" &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
     # If any of these fail, we abort the whole thing.  If we want to
     # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    # errors from the above "$doit $instcmd $src $dsttmp" command.
     #
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
@@ -296,7 +298,7 @@
               || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
               || {
                 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-                (exit 1); exit 1
+                (exit 1); exit
               }
             else
               :
@@ -307,12 +309,12 @@
           $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
         }
     }
-  fi || { (exit 1); exit 1; }
+  fi || { (exit 1); exit; }
 done
 
 # The final little trick to "correctly" pass the exit status to the exit trap.
 {
-  (exit 0); exit 0
+  (exit 0); exit
 }
 
 # Local variables:

Modified: GNUnet/src/applications/fs/ecrs/namespace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespace.c 2005-07-08 19:30:42 UTC (rev 
1314)
+++ GNUnet/src/applications/fs/ecrs/namespace.c 2005-07-08 19:31:29 UTC (rev 
1315)
@@ -93,14 +93,15 @@
  *
  * @return OK on success, SYSERR on error (namespace already exists)
  */
-int ECRS_createNamespace(const char * name,
-                        const struct ECRS_MetaData * meta,
-                        unsigned int anonymityLevel,
-                        unsigned int priority,
-                        cron_t expiration,
-                        const struct ECRS_URI * advertisementURI,
-                        const HashCode512 * rootEntry,
-                        struct ECRS_URI ** rootURI) {
+struct ECRS_URI *
+ECRS_createNamespace(const char * name,
+                    const struct ECRS_MetaData * meta,
+                    unsigned int anonymityLevel,
+                    unsigned int priority,
+                    cron_t expiration,
+                    const struct ECRS_URI * advertisementURI,
+                    const HashCode512 * rootEntry) {
+  struct ECRS_URI * rootURI;
   char * fileName;
   char tmp;
   struct PrivateKey * hk;
@@ -111,7 +112,6 @@
   GNUNET_TCP_SOCKET * sock;
   Datastore_Value * value;
   Datastore_Value * knvalue;
-  int ret;
   unsigned int size;
   unsigned int mdsize;
   struct PrivateKey * pk;
@@ -125,7 +125,7 @@
   if ( (advertisementURI != NULL) &&
        (! ECRS_isKeywordUri(advertisementURI)) ) {
     BREAK();
-    return SYSERR;
+    return NULL;
   }
   fileName = getPseudonymFileName(name);
   if (1 == readFile(fileName, 1, &tmp)) {
@@ -134,7 +134,7 @@
         name,
         fileName);
     FREE(fileName);
-    return SYSERR;
+    return NULL;
   }
   hk  = makePrivateKey();
   hke = encodePrivateKey(hk);
@@ -166,7 +166,7 @@
       BREAK();
       ECRS_deleteNamespace(name);
       freePrivateKey(hk);
-      return SYSERR;
+      return NULL;
     }
     size = sizeof(NBlock) + mdsize;
   } else {
@@ -185,7 +185,6 @@
   value->anonymityLevel = htonl(anonymityLevel);
   value->expirationTime = htonll(expiration);
   sock = getClientSocket();
-  ret = OK;
 
   /* publish NBlock */
   memset(&nb->identifier, 0, sizeof(HashCode512));
@@ -194,10 +193,10 @@
   hash(&nb->subspace,
        sizeof(PublicKey),
        &nb->namespace);
-  *rootURI = MALLOC(sizeof(URI));
-  (*rootURI)->type = sks;
-  (*rootURI)->data.sks.namespace = nb->namespace;
-  (*rootURI)->data.sks.identifier = *rootEntry;
+  rootURI = MALLOC(sizeof(URI));
+  rootURI->type = sks;
+  rootURI->data.sks.namespace = nb->namespace;
+  rootURI->data.sks.identifier = *rootEntry;
 
   nb->rootEntry = *rootEntry;
 
@@ -205,8 +204,14 @@
                           mdsize + 3 * sizeof(HashCode512),
                           &nb->identifier,
                           &nb->signature));
-  if (OK != FS_insert(sock, value))
-    ret = SYSERR;
+  if (OK != FS_insert(sock, value)) {
+    FREE(rootURI);
+    FREE(value);
+    releaseClientSocket(sock);
+    freePrivateKey(hk);
+    ECRS_deleteNamespace(name);
+    return NULL;
+  }
 
 
   /* publish KNBlocks */
@@ -246,8 +251,16 @@
                             &knb->kblock.signature));
     /* extra check: verify sig */
     freePrivateKey(pk);
-    if (OK != FS_insert(sock, knvalue))
-      ret = SYSERR;
+    if (OK != FS_insert(sock, knvalue)) {
+      FREE(rootURI);
+      ECRS_deleteNamespace(name);
+      FREE(cpy);
+      FREE(knvalue);
+      FREE(value);
+      releaseClientSocket(sock);
+      freePrivateKey(hk);
+      return NULL;
+    }
     /* restore nblock to avoid re-encryption! */
     memcpy(&knb->nblock,
           cpy,            
@@ -255,15 +268,11 @@
   }
   FREE(cpy);
   FREE(knvalue);
+  FREE(value);
   releaseClientSocket(sock);
-  FREE(value);
-
   freePrivateKey(hk);
-  if (ret != OK) {
-    FREE(*rootURI);
-    ECRS_deleteNamespace(name);
-  }
-  return ret;
+  
+  return rootURI;
 }
 
 
@@ -333,20 +342,20 @@
  * @param md what meta-data should be associated with the
  *        entry?
  */
-int ECRS_addToNamespace(const char * name,
-                       unsigned int anonymityLevel,
-                       unsigned int priority,
-                       cron_t expiration,
-                       cron_t creationTime,
-                       cron_t updateInterval,
-                       const HashCode512 * thisId,
-                       const HashCode512 * nextId,
-                       const struct ECRS_URI * dstU,
-                       const struct ECRS_MetaData * md,
-                       struct ECRS_URI ** uri) {
+struct ECRS_URI *
+ECRS_addToNamespace(const char * name,
+                   unsigned int anonymityLevel,
+                   unsigned int priority,
+                   cron_t expiration,
+                   cron_t creationTime,
+                   cron_t updateInterval,
+                   const HashCode512 * thisId,
+                   const HashCode512 * nextId,
+                   const struct ECRS_URI * dstU,
+                   const struct ECRS_MetaData * md) {
+  struct ECRS_URI * uri;
   GNUNET_TCP_SOCKET * sock;
   Datastore_Value * value;
-  int ret;
   unsigned int size;
   unsigned int mdsize;
   struct PrivateKey * hk;
@@ -364,14 +373,14 @@
   if (OK != getFileSize(fileName,
                        &len)) {
     FREE(fileName);
-    return SYSERR;
+    return NULL;
   }
   if (len < 2) {
     LOG(LOG_ERROR,
         _("File '%s' does not contain a pseudonym.\n"),
         fileName);
     FREE(fileName);
-    return SYSERR;
+    return NULL;
   }
   dst = MALLOC(len);
   len = readFile(fileName, len, dst);
@@ -382,12 +391,12 @@
         _("Format of pseudonym '%s' is invalid.\n"),
         name);
     FREE(hke);
-    return SYSERR;
+    return NULL;
   }
   hk = decodePrivateKey(hke);
   FREE(hke);
   if (hk == NULL)
-    return SYSERR;
+    return NULL;
 
   /* THEN: construct SBlock */
   dstURI = ECRS_uriToString(dstU);
@@ -410,7 +419,7 @@
     if (mdsize == -1) {
       BREAK();
       FREE(dstURI);
-      return SYSERR;
+      return NULL;
     }
     size = sizeof(SBlock) + mdsize;
   } else {
@@ -452,10 +461,10 @@
               &namespace,
               &sb->identifier); /* sb->identifier = primary key in query! */
 
-  *uri = MALLOC(sizeof(URI));
-  (*uri)->type = sks;
-  (*uri)->data.sks.namespace = namespace;
-  (*uri)->data.sks.identifier = *thisId;
+  uri = MALLOC(sizeof(URI));
+  uri->type = sks;
+  uri->data.sks.namespace = namespace;
+  uri->data.sks.identifier = *thisId;
 
   ECRS_encryptInPlace(thisId,
                      &sb->creationTime,
@@ -475,16 +484,15 @@
   freePrivateKey(hk);
 
   sock = getClientSocket();
-  ret = OK;
   if (OK != FS_insert(sock, value)) {
-    ret = SYSERR;
-    FREE(*uri);
+    FREE(uri);
+    uri = NULL;
   }
   releaseClientSocket(sock);
   FREE(value);
   FREE(dstURI);
 
-  return ret;
+  return uri;
 }
 
 struct lNCLS {

Modified: GNUnet/src/applications/fs/fsui/collection.c
===================================================================
--- GNUnet/src/applications/fs/fsui/collection.c        2005-07-08 19:30:42 UTC 
(rev 1314)
+++ GNUnet/src/applications/fs/fsui/collection.c        2005-07-08 19:31:29 UTC 
(rev 1315)
@@ -124,14 +124,14 @@
   if (prio == 0)
     prio = DEFAULT_ADVERTISEMENT_PRIORITY;
   makeRandomId(&nextId);
-  if (OK != ECRS_createNamespace(name,
+  rootURI = ECRS_createNamespace(name,
                                 meta,
                                 anonymityLevel,
                                 prio,
                                 now + COLLECTION_ADV_LIFETIME,
                                 advertisement,
-                                &nextId,
-                                &rootURI)) {
+                                &nextId);
+  if (rootURI == NULL) {
     ECRS_freeUri(advertisement);
     return SYSERR;
   }
@@ -281,22 +281,22 @@
                                         &metaData,
                                         NULL,
                                         NULL));
-  if (OK == ECRS_addToNamespace(cd->name,
-                               ntohl(cd->anonymityLevel),
-                               getConfigurationInt("FS",
-                                                   "ADVERTISEMENT-PRIORITY"),
-                               now + COLLECTION_ADV_LIFETIME,
-                               now,
-                               ntohll(cd->updateInterval),
-                               &cd->lastId,
-                               &cd->nextId,
-                               directoryURI,
-                               metaData,
-                               &uri)) {
+  uri = ECRS_addToNamespace(cd->name,
+                           ntohl(cd->anonymityLevel),
+                           getConfigurationInt("FS",
+                                               "ADVERTISEMENT-PRIORITY"),
+                           now + COLLECTION_ADV_LIFETIME,
+                           now,
+                           ntohll(cd->updateInterval),
+                           &cd->lastId,
+                           &cd->nextId,
+                           directoryURI,
+                           metaData);
+  if (uri != NULL) {
     cd->lastPublication = htonll(now);
     cd->changed = htonl(NO);
+    ECRS_freeUri(uri);
   }
-  ECRS_freeUri(uri);
   ECRS_freeMetaData(metaData);
 }
 

Modified: GNUnet/src/applications/fs/fsui/namespace_info.c
===================================================================
--- GNUnet/src/applications/fs/fsui/namespace_info.c    2005-07-08 19:30:42 UTC 
(rev 1314)
+++ GNUnet/src/applications/fs/fsui/namespace_info.c    2005-07-08 19:31:29 UTC 
(rev 1315)
@@ -147,19 +147,16 @@
  * for a while since it must create a public-private key pair!
  *
  * @param meta meta-data about the namespace (maybe NULL)
- * @param root set to the URI of the namespace, NULL if no advertisement
- *        was created
- *
- * @return OK on success, SYSERR on error (namespace already exists)
+ * @return URI on success, NULL 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,
-                        const HashCode512 * rootEntry,
-                        struct ECRS_URI ** root) {
-  int ret;
+struct ECRS_URI *
+FSUI_createNamespace(struct FSUI_Context * ctx,
+                    unsigned int anonymityLevel,
+                    const char * namespaceName,
+                    const struct ECRS_MetaData * meta,
+                    const struct ECRS_URI * advertisementURI,
+                    const HashCode512 * rootEntry) {
+  struct ECRS_URI * ret;
 
   ret = ECRS_createNamespace(namespaceName,
                             meta,
@@ -169,14 +166,13 @@
                                                 "INSERT-EXPIRATION") 
                             * cronYEARS + cronTime(NULL),
                             advertisementURI,
-                            rootEntry,
-                            root);
+                            rootEntry);
   /* store binding of namespaceName to 'meta' in state DB! */
-  if (ret == OK) {
+  if (ret != NULL) {
     HashCode512 id;
     char * name;
 
-    ECRS_getNamespaceId(*root,
+    ECRS_getNamespaceId(ret,
                        &id);
     name = ECRS_getNamespaceName(&id);
     writeNamespaceInfo(name,
@@ -490,17 +486,16 @@
  *        entry?
  * @param uri set to the resulting URI
  */
-int FSUI_addToNamespace(struct FSUI_Context * ctx,
-                       unsigned int anonymityLevel,
-                       const char * name,
-                       cron_t updateInterval,
-                       const HashCode512 * lastId,
-                       const HashCode512 * thisId,
-                       const HashCode512 * nextId,
-                       const struct ECRS_URI * dst,
-                       const struct ECRS_MetaData * md,
-                       struct ECRS_URI ** uri) {
-  int ret;
+struct ECRS_URI *
+FSUI_addToNamespace(struct FSUI_Context * ctx,
+                   unsigned int anonymityLevel,
+                   const char * name,
+                   cron_t updateInterval,
+                   const HashCode512 * lastId,
+                   const HashCode512 * thisId,
+                   const HashCode512 * nextId,
+                   const struct ECRS_URI * dst,
+                   const struct ECRS_MetaData * md) {
   cron_t creationTime;
   HashCode512 nid;
   HashCode512 tid;
@@ -509,6 +504,7 @@
   cron_t lastInterval;
   ECRS_FileInfo fi;
   char * old;
+  struct ECRS_URI * uri;
 
   /* computation of IDs of update(s).  Not as terrible as
      it looks, just enumerating all of the possible cases
@@ -589,7 +585,7 @@
       nid = tid;
     }
   }
-  ret = ECRS_addToNamespace(name,
+  uri = ECRS_addToNamespace(name,
                            anonymityLevel,
                            getConfigurationInt("FS", "INSERT-PRIORITY"),
                            getConfigurationInt("FS", 
@@ -600,25 +596,26 @@
                            &tid,
                            &nid,
                            dst,
-                           md,
-                           uri);
-  if (updateInterval != ECRS_SBLOCK_UPDATE_NONE) {
-    fi.uri = (struct ECRS_URI*) uri;
-    fi.meta = (struct ECRS_MetaData*) md;
-    writeUpdateData(name,
-                   &tid,
-                   &nid,
-                   &fi,
-                   updateInterval,
-                   creationTime);
+                           md);
+  if (uri != NULL) {
+    if (updateInterval != ECRS_SBLOCK_UPDATE_NONE) {
+      fi.uri = uri;
+      fi.meta = (struct ECRS_MetaData*) md;
+      writeUpdateData(name,
+                     &tid,
+                     &nid,
+                     &fi,
+                     updateInterval,
+                     creationTime);
+    }
+    if (lastId != NULL) {
+      old = getUpdateDataFilename(name,
+                                 lastId);
+      UNLINK(old);
+      FREE(old);
+    }
   }
-  if (lastId != NULL) {
-    old = getUpdateDataFilename(name,
-                               lastId);
-    UNLINK(old);
-    FREE(old);
-  }
-  return ret;
+  return uri;
 }
 
 struct lNCC {

Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c    2005-07-08 19:30:42 UTC 
(rev 1314)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c    2005-07-08 19:31:29 UTC 
(rev 1315)
@@ -70,6 +70,7 @@
   char * nid;
   struct ECRS_URI * nsuri;
   unsigned int updateInterval;
+  char * us;
 
   pname = getConfigurationString("GNUNET-INSERT",
                                 "PSEUDONYM");
@@ -90,26 +91,31 @@
   updateInterval = getConfigurationInt("GNUNET-INSERT",
                                       "INTERVAL");
 
-  FSUI_addToNamespace(ctx,
-                     getConfigurationInt("FS",
-                                         "ANONYMITY-SEND"),
-                     pname,
-                     updateInterval,
-                     pid == NULL ? NULL : &prevId,
-                     tid == NULL ? NULL : &thisId,
-                     nid == NULL ? NULL : &nextId,
-                     uri,
-                     meta,
-                     &nsuri);
-  FREE(pname);
+  nsuri = FSUI_addToNamespace(ctx,
+                             getConfigurationInt("FS",
+                                                 "ANONYMITY-SEND"),
+                             pname,
+                             updateInterval,
+                             pid == NULL ? NULL : &prevId,
+                             tid == NULL ? NULL : &thisId,
+                             nid == NULL ? NULL : &nextId,
+                             uri,
+                             meta);
   FREENONNULL(pid);
   FREENONNULL(tid);
   FREENONNULL(nid);
-  pname = ECRS_uriToString(nsuri);
-  ECRS_freeUri(nsuri);
-  printf(_("Created namespace entry '%s'\n"),
-        pname);
-  FREE(pname);
+  if (nsuri != NULL) {
+    us = ECRS_uriToString(nsuri);
+    ECRS_freeUri(nsuri);
+    printf(_("Created entry '%s' in namespace '%s'\n"),
+          us,
+          pname);
+    FREE(us);
+  } else {
+    printf(_("Failed to add entry to namespace '%s' (does it exist?)\n"),
+          pname);
+  }
+  FREE(pname);  
 }
 
 /**

Modified: GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2005-07-08 19:30:42 UTC 
(rev 1314)
+++ GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2005-07-08 19:31:29 UTC 
(rev 1315)
@@ -444,14 +444,14 @@
        advertisement = FSUI_parseCharKeywordURI(keyword);
       }
       FREE(keyword);
-      if (OK != FSUI_createNamespace(ctx,
+      rootURI = FSUI_createNamespace(ctx,
                                     getConfigurationInt("FS",
                                                         "ANONYMITY-SEND"),
                                     pname,
                                     meta,
                                     advertisement,
-                                    &rootEntry,
-                                    &rootURI)) {
+                                    &rootEntry);
+      if (rootURI == NULL) {
        printf(_("Could not create namespace '%s' (exists?).\n"),
               pname);
        success += 1;

Modified: GNUnet/src/include/gnunet_ecrs_lib.h
===================================================================
--- GNUnet/src/include/gnunet_ecrs_lib.h        2005-07-08 19:30:42 UTC (rev 
1314)
+++ GNUnet/src/include/gnunet_ecrs_lib.h        2005-07-08 19:31:29 UTC (rev 
1315)
@@ -457,16 +457,16 @@
  * @param rootURI set to the URI of the namespace, NULL if
  *        no advertisement was created
  *
- * @return OK on success, SYSERR on error (namespace already exists)
+ * @return URI on success, NULL on error (namespace already exists)
  */
-int ECRS_createNamespace(const char * name,
-                        const struct ECRS_MetaData * meta,
-                        unsigned int anonymityLevel,
-                        unsigned int priority,
-                        cron_t expiration,
-                        const struct ECRS_URI * advertisementURI,
-                        const HashCode512 * rootEntry,
-                        struct ECRS_URI ** rootURI); /* namespace.c */
+struct ECRS_URI *
+ECRS_createNamespace(const char * name,
+                    const struct ECRS_MetaData * meta,
+                    unsigned int anonymityLevel,
+                    unsigned int priority,
+                    cron_t expiration,
+                    const struct ECRS_URI * advertisementURI,
+                    const HashCode512 * rootEntry); /* namespace.c */
 
 /**
  * Check if the given namespace exists (locally).
@@ -514,19 +514,19 @@
  * @param dst to which URI should the namespace entry refer?
  * @param md what meta-data should be associated with the
  *        entry?
- * @param uri set to the resulting URI
+ * @return URI on success, NULL on error
  */
-int ECRS_addToNamespace(const char * name,
-                       unsigned int anonymityLevel,
-                       unsigned int priority,
-                       cron_t expirationTime,
-                       cron_t creationTime,
-                       cron_t updateInterval,
-                       const HashCode512 * thisId,
-                       const HashCode512 * nextId,
-                       const struct ECRS_URI * dst,
-                       const struct ECRS_MetaData * md,
-                       struct ECRS_URI ** uri); /* namespace.c */
+struct ECRS_URI *
+ECRS_addToNamespace(const char * name,
+                   unsigned int anonymityLevel,
+                   unsigned int priority,
+                   cron_t expirationTime,
+                   cron_t creationTime,
+                   cron_t updateInterval,
+                   const HashCode512 * thisId,
+                   const HashCode512 * nextId,
+                   const struct ECRS_URI * dst,
+                   const struct ECRS_MetaData * md); /* namespace.c */
 
 /**
  * Add an entry into the K-space (keyword space).

Modified: GNUnet/src/include/gnunet_fsui_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fsui_lib.h        2005-07-08 19:30:42 UTC (rev 
1314)
+++ GNUnet/src/include/gnunet_fsui_lib.h        2005-07-08 19:31:29 UTC (rev 
1315)
@@ -660,18 +660,15 @@
  * for a while since it must create a public-private key pair!
  *
  * @param meta meta-data about the namespace (maybe NULL)
- * @param root set to the URI of the namespace, NULL if no advertisement
- *        was created
- *
- * @return OK on success, SYSERR on error (namespace already exists)
+ * @return URI on success, NULL 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,
-                        const HashCode512 * rootEntry,
-                        struct ECRS_URI ** root); /* namespace_info.c */
+struct ECRS_URI * 
+FSUI_createNamespace(struct FSUI_Context * ctx,
+                    unsigned int anonymityLevel,
+                    const char * namespaceName,
+                    const struct ECRS_MetaData * meta,
+                    const struct ECRS_URI * advertisementURI,
+                    const HashCode512 * rootEntry); /* namespace_info.c */
 
 /**
  * Delete a local namespace.  Only prevents future insertions into the
@@ -746,18 +743,18 @@
  * @param dst to which URI should the namespace entry refer?
  * @param md what meta-data should be associated with the
  *        entry?
- * @param uri set to the resulting URI
+ * @return the resulting URI, NULL on error
  */
-int FSUI_addToNamespace(struct FSUI_Context * ctx,
-                       unsigned int anonymityLevel,
-                       const char * name,
-                       cron_t updateInterval,
-                       const HashCode512 * lastId,
-                       const HashCode512 * thisId,
-                       const HashCode512 * nextId,
-                       const struct ECRS_URI * dst,
-                       const struct ECRS_MetaData * md,
-                       struct ECRS_URI ** uri); /* namespace_info.c */
+struct ECRS_URI *
+FSUI_addToNamespace(struct FSUI_Context * ctx,
+                   unsigned int anonymityLevel,
+                   const char * name,
+                   cron_t updateInterval,
+                   const HashCode512 * lastId,
+                   const HashCode512 * thisId,
+                   const HashCode512 * nextId,
+                   const struct ECRS_URI * dst,
+                   const struct ECRS_MetaData * md); /* namespace_info.c */
 
 /**
  * List all updateable content in a given namespace.

Modified: GNUnet/src/include/gnunet_util.h
===================================================================
--- GNUnet/src/include/gnunet_util.h    2005-07-08 19:30:42 UTC (rev 1314)
+++ GNUnet/src/include/gnunet_util.h    2005-07-08 19:31:29 UTC (rev 1315)
@@ -20,7 +20,7 @@
 
 /**
  * @file include/gnunet_util.h
- * @brief public interface to libgnunet_util
+ * @brief public interface to libgnunetutil
  *
  * @author Christian Grothoff
  * @author Krista Bennett
@@ -65,7 +65,7 @@
  * frequently, even between different SVN versions.
  */
 
-#define GNUNET_UTIL_VERSION 0x00060903
+#define GNUNET_UTIL_VERSION 0x00070000
 
 /**
  * We use an unsigned short in the protocol header, thus:
@@ -78,7 +78,10 @@
 #define MAX_PRIO 0x7FFFFFFF
 
 /**
- * Named constants for return values.
+ * Named constants for return values.  The following
+ * invariants hold: "NO == 0" (to allow "if (NO)")
+ * "OK != SYSERR", "OK != NO", "NO != SYSERR" 
+ * and finally "YES != NO".
  */
 #define OK      1
 #define SYSERR -1
@@ -100,16 +103,18 @@
 /**
  * @brief log levels
  */
-#define LOG_NOTHING    0
-#define LOG_FATAL      1
-#define LOG_ERROR      2
-#define LOG_FAILURE    3
-#define LOG_WARNING    4
-#define LOG_MESSAGE    5
-#define LOG_INFO       6
-#define LOG_DEBUG      7
-#define LOG_CRON       8
-#define LOG_EVERYTHING 9
+typedef enum LOG_Level {
+  LOG_NOTHING = 0,
+  LOG_FATAL,
+  LOG_ERROR,
+  LOG_FAILURE,
+  LOG_WARNING,
+  LOG_MESSAGE,
+  LOG_INFO,
+  LOG_DEBUG,
+  LOG_CRON,
+  LOG_EVERYTHING,
+} LOG_Level;
 
 /**
  * @brief length of the sessionkey in bytes (256 BIT sessionkey)
@@ -950,7 +955,7 @@
 /**
  * Get the current loglevel.
  */
-int getLogLevel(void);
+LOG_Level getLogLevel(void);
 
 /**
  * Return the logfile
@@ -977,7 +982,7 @@
  * @param minLogLevel the minimum loglevel that we must be at
  * @param format the format string describing the message
  */
-void LOG(int minLogLevel,
+void LOG(LOG_Level minLogLevel,
         const char * format,
         ...);
 
@@ -2284,16 +2289,6 @@
 void ** vectorElements(struct Vector * v);
 
 /**
- * Configuration
- */
-int cfg_parse_file(char *filename);
-char * cfg_get_str(const char * sec,
-                  const char * ent);
-int cfg_get_signed_int(const char *sec,
-                      const char *ent);
-void doneParseConfig(void);
-
-/**
  * open() a file
  */
 int fileopen(const char *filename, int oflag, ...);

Modified: GNUnet/src/util/configuration.c
===================================================================
--- GNUnet/src/util/configuration.c     2005-07-08 19:30:42 UTC (rev 1314)
+++ GNUnet/src/util/configuration.c     2005-07-08 19:31:29 UTC (rev 1315)
@@ -136,7 +136,7 @@
        e->ent_values[i] = NULL;
 }
 
-int cfg_parse_file(char *filename) {
+static int cfg_parse_file(char *filename) {
   struct CFG_ENTRIES * e = NULL;
   char line[256],tag[64],value[192];
   FILE *fp;
@@ -227,8 +227,8 @@
 
 /* ------------------------------------------------------------------------ */
 
-char * cfg_get_str(const char * sec,
-                  const char * ent) {
+static char * cfg_get_str(const char * sec,
+                         const char * ent) {
   struct CFG_ENTRIES * e = NULL;
   int i;
 
@@ -245,7 +245,7 @@
   return NULL;
 }
 
-int cfg_get_signed_int(const char *sec,
+static int cfg_get_signed_int(const char *sec,
                              const char *ent) {
   char *val;
 
@@ -255,7 +255,7 @@
   return atoi(val);
 }
 
-void doneParseConfig() {
+static void doneParseConfig() {
   int i;
   int j;
 

Modified: GNUnet/src/util/logging.c
===================================================================
--- GNUnet/src/util/logging.c   2005-07-08 19:30:42 UTC (rev 1314)
+++ GNUnet/src/util/logging.c   2005-07-08 19:31:29 UTC (rev 1315)
@@ -39,7 +39,7 @@
 /**
  * Current loglevel.
  */
-static int loglevel__ = LOG_WARNING;
+static LOG_Level loglevel__ = LOG_WARNING;
 
 /**
  * Lock for logging activities.
@@ -62,7 +62,7 @@
 /**
  * Highest legal log level.
  */
-static int maxLogLevel = LOG_EVERYTHING;
+static LOG_Level maxLogLevel = LOG_EVERYTHING;
 
 /**
  * Day for which the current logfile is
@@ -229,7 +229,7 @@
 /**
  * Return the current logging level
  */
-int getLogLevel() {
+LOG_Level getLogLevel() {
   return loglevel__;
 }
 
@@ -243,8 +243,8 @@
 /**
  * Convert a textual description of a loglevel into an int.
  */
-static int getLoglevel(const char * log) {
-  int i;
+static LOG_Level getLoglevel(const char * log) {
+  LOG_Level i;
   char * caplog;
 
   if (log == NULL)
@@ -252,7 +252,7 @@
   caplog = strdup(log);
   for (i=strlen(caplog)-1;i>=0;i--)
     caplog[i] = toupper(caplog[i]);
-  i = 0;
+  i = LOG_NOTHING;
   while ( (loglevels[i] != NULL) &&
          ( (0 != strcmp(caplog, gettext(loglevels[i]))) &&
            (0 != strcmp(caplog, loglevels[i]))) )
@@ -270,7 +270,6 @@
  */
 static void resetLogging() {
   char * loglevelname;
-  int levelstatic = 0;
 
   MUTEX_LOCK(&logMutex);
   if (testConfigurationString("GNUNETD",
@@ -280,25 +279,18 @@
     loglevelname
       = getConfigurationString("GNUNETD",
                               "LOGLEVEL");
-   if (loglevelname == NULL) {
-      loglevelname = "WARNING";
-      levelstatic = 1;
-    }
   } else {
     base = "GNUNET";
     loglevelname
       = getConfigurationString("GNUNET",
                               "LOGLEVEL");
-    if (loglevelname == NULL) {
-      loglevelname = "WARNING";
-      levelstatic = 1;
-    }
   }
+   if (loglevelname == NULL) 
+     loglevelname = STRDUP("WARNING");
 
   loglevel__
     = getLoglevel(loglevelname); /* will errexit if loglevel == NULL */
-  if (! levelstatic)
-    FREE(loglevelname);
+  FREE(loglevelname);
   keepLog
     = getConfigurationInt(base,
                          "KEEPLOG");
@@ -401,7 +393,7 @@
  * @param minLogLevel minimum level at which this message should be logged
  * @param format the string describing the error message
  */
-void LOG(int minLogLevel,
+void LOG(LOG_Level minLogLevel,
         const char *format, ...) {
   va_list      args;
   size_t len;

Modified: gnunet-gtk/src/plugins/fs/namespace.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace.c       2005-07-08 19:30:42 UTC (rev 
1314)
+++ gnunet-gtk/src/plugins/fs/namespace.c       2005-07-08 19:31:29 UTC (rev 
1315)
@@ -614,15 +614,14 @@
     nameLine = glade_xml_get_widget(metaXML,
                                    "namespaceNameEntry");
     namespaceName = gtk_entry_get_text(GTK_ENTRY(nameLine));
-    root = NULL;
-    if (OK == FSUI_createNamespace(ctx,
-                                  gtk_spin_button_get_value_as_int
-                                  (GTK_SPIN_BUTTON(spin)),
-                                  namespaceName,
-                                  meta,
-                                  keywordURI,
-                                  &rootEntry,
-                                  &root)) {
+    root = FSUI_createNamespace(ctx,
+                               gtk_spin_button_get_value_as_int
+                               (GTK_SPIN_BUTTON(spin)),
+                               namespaceName,
+                               meta,
+                               keywordURI,
+                               &rootEntry);
+    if (root != NULL) {
       ECRS_getNamespaceId(root,
                          &namespaceId);
       addTabForNamespace(NULL,
@@ -630,6 +629,7 @@
                         &namespaceId,
                         meta,
                         0);
+      ECRS_freeUri(root);
     } else {
       GtkWidget * dialog;
       
@@ -646,7 +646,6 @@
       gtk_dialog_run(GTK_DIALOG(dialog));
       gtk_widget_destroy(dialog);  
     }
-    ECRS_freeUri(root);
     ECRS_freeMetaData(meta);
     ECRS_freeUri(keywordURI);
   }
@@ -768,16 +767,16 @@
     BREAK();
     return;
   }  
-  if (OK == FSUI_addToNamespace(ctx,
-                               cls->anonymityLevel,
-                               cls->namespaceName,
-                               cls->updateInterval,
-                               cls->lastId,
-                               &cls->thisId,
-                               cls->nextId,
-                               dst,
-                               meta,
-                               &resultURI)) {
+  resultURI = FSUI_addToNamespace(ctx,
+                                 cls->anonymityLevel,
+                                 cls->namespaceName,
+                                 cls->updateInterval,
+                                 cls->lastId,
+                                 &cls->thisId,
+                                 cls->nextId,
+                                 dst,
+                                 meta);
+  if (resultURI != NULL) {
     list = head;
     while ( (list != NULL) &&
            (0 != strcmp(cls->namespaceName,





reply via email to

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