gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5755 - in GNUnet: . src/applications/advertising src/appli


From: gnunet
Subject: [GNUnet-SVN] r5755 - in GNUnet: . src/applications/advertising src/applications/bootstrap_http src/applications/chat src/applications/datastore src/applications/dht/module src/applications/dht/tools src/applications/dstore src/applications/fragmentation src/applications/fs src/applications/fs/collection src/applications/fs/ecrs src/applications/fs/fsui src/applications/fs/lib src/applications/fs/module src/applications/fs/namespace src/applications/fs/tools src/applications/fs/uritrack src/applications/gap src/applications/getoption src/applications/identity src/applications/kvstore_sqlite src/applications/pingpong src/applications/rpc src/applications/session src/applications/sqstore_mysql src/applications/sqstore_sqlite src/applications/state src/applications/stats src/applications/tbench src/applications/template src/applications/testbed src/applications/testing src/applications/topology_default src/applications/topology_f2f src/applications/tracekit src/applications/traffic src/applications/transport src/applications/vpn src/include src/server src/setup src/setup/gtk src/setup/lib src/setup/ncurses src/setup/text src/transports src/transports/upnp src/util/boot src/util/config src/util/config_impl src/util/containers src/util/cron src/util/crypto src/util/disk src/util/error src/util/getopt src/util/loggers src/util/network src/util/network_client src/util/os src/util/string src/util/threads src/util/win
Date: Sun, 25 Nov 2007 05:04:49 -0700 (MST)

Author: grothoff
Date: 2007-11-25 05:04:45 -0700 (Sun, 25 Nov 2007)
New Revision: 5755

Added:
   GNUnet/src/include/gnunet_rpc_lib.h
Modified:
   GNUnet/HACKING
   GNUnet/src/applications/advertising/advertising.c
   GNUnet/src/applications/advertising/advertising_test.c
   GNUnet/src/applications/advertising/bootstrap.c
   GNUnet/src/applications/advertising/bootstrap.h
   GNUnet/src/applications/bootstrap_http/http.c
   GNUnet/src/applications/bootstrap_http/httptest.c
   GNUnet/src/applications/chat/chat.c
   GNUnet/src/applications/chat/chat.h
   GNUnet/src/applications/chat/clientapi.c
   GNUnet/src/applications/chat/gnunet-chat.c
   GNUnet/src/applications/datastore/datastore.c
   GNUnet/src/applications/datastore/filter.c
   GNUnet/src/applications/datastore/filter.h
   GNUnet/src/applications/datastore/prefetch.c
   GNUnet/src/applications/datastore/prefetch.h
   GNUnet/src/applications/dht/module/cs.c
   GNUnet/src/applications/dht/module/dstore.c
   GNUnet/src/applications/dht/module/dstore.h
   GNUnet/src/applications/dht/module/routing.c
   GNUnet/src/applications/dht/module/routing.h
   GNUnet/src/applications/dht/module/service.c
   GNUnet/src/applications/dht/module/table.c
   GNUnet/src/applications/dht/module/table.h
   GNUnet/src/applications/dht/tools/dht-query.c
   GNUnet/src/applications/dht/tools/dht_api.c
   GNUnet/src/applications/dht/tools/dhttest.c
   GNUnet/src/applications/dht/tools/dhttest2.c
   GNUnet/src/applications/dstore/dstore.c
   GNUnet/src/applications/dstore/dstore_test.c
   GNUnet/src/applications/fragmentation/fragmentation.c
   GNUnet/src/applications/fragmentation/fragmentationtest.c
   GNUnet/src/applications/fs/collection/collection.c
   GNUnet/src/applications/fs/collection/collectiontest.c
   GNUnet/src/applications/fs/ecrs/bincoder.c
   GNUnet/src/applications/fs/ecrs/directory.c
   GNUnet/src/applications/fs/ecrs/directorytest.c
   GNUnet/src/applications/fs/ecrs/download.c
   GNUnet/src/applications/fs/ecrs/downloadtest.c
   GNUnet/src/applications/fs/ecrs/ecrs.c
   GNUnet/src/applications/fs/ecrs/ecrs.h
   GNUnet/src/applications/fs/ecrs/ecrstest.c
   GNUnet/src/applications/fs/ecrs/helper.c
   GNUnet/src/applications/fs/ecrs/indexinfo.c
   GNUnet/src/applications/fs/ecrs/keyspace.c
   GNUnet/src/applications/fs/ecrs/meta.c
   GNUnet/src/applications/fs/ecrs/metatest.c
   GNUnet/src/applications/fs/ecrs/metatest2.c
   GNUnet/src/applications/fs/ecrs/namespace.c
   GNUnet/src/applications/fs/ecrs/namespacetest.c
   GNUnet/src/applications/fs/ecrs/parser.c
   GNUnet/src/applications/fs/ecrs/search.c
   GNUnet/src/applications/fs/ecrs/searchtest.c
   GNUnet/src/applications/fs/ecrs/tree.c
   GNUnet/src/applications/fs/ecrs/unindex.c
   GNUnet/src/applications/fs/ecrs/upload.c
   GNUnet/src/applications/fs/ecrs/uri.c
   GNUnet/src/applications/fs/ecrs/uritest.c
   GNUnet/src/applications/fs/ecrs_core.c
   GNUnet/src/applications/fs/ecrs_core_test.c
   GNUnet/src/applications/fs/fsui/deserialize.c
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/fsui/downloadtest.c
   GNUnet/src/applications/fs/fsui/fsui-loader.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsui.h
   GNUnet/src/applications/fs/fsui/fsuitest.c
   GNUnet/src/applications/fs/fsui/fsuitest2.c
   GNUnet/src/applications/fs/fsui/search.c
   GNUnet/src/applications/fs/fsui/searchtest.c
   GNUnet/src/applications/fs/fsui/serialize.c
   GNUnet/src/applications/fs/fsui/serializetest.c
   GNUnet/src/applications/fs/fsui/serializetest2.c
   GNUnet/src/applications/fs/fsui/serializetest3.c
   GNUnet/src/applications/fs/fsui/serializetest4.c
   GNUnet/src/applications/fs/fsui/unindex.c
   GNUnet/src/applications/fs/fsui/upload.c
   GNUnet/src/applications/fs/lib/fslib.c
   GNUnet/src/applications/fs/lib/fslibtest.c
   GNUnet/src/applications/fs/module/anonymity.c
   GNUnet/src/applications/fs/module/anonymity.h
   GNUnet/src/applications/fs/module/dht_push.c
   GNUnet/src/applications/fs/module/dht_push.h
   GNUnet/src/applications/fs/module/fs.c
   GNUnet/src/applications/fs/module/migration.c
   GNUnet/src/applications/fs/module/migration.h
   GNUnet/src/applications/fs/module/ondemand.c
   GNUnet/src/applications/fs/module/ondemand.h
   GNUnet/src/applications/fs/module/querymanager.c
   GNUnet/src/applications/fs/module/querymanager.h
   GNUnet/src/applications/fs/namespace/namespace_info.c
   GNUnet/src/applications/fs/namespace/namespace_infotest.c
   GNUnet/src/applications/fs/tools/gnunet-directory.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/applications/fs/tools/gnunet-unindex.c
   GNUnet/src/applications/fs/uritrack/callbacks.c
   GNUnet/src/applications/fs/uritrack/callbacks.h
   GNUnet/src/applications/fs/uritrack/file_info.c
   GNUnet/src/applications/fs/uritrack/tracktest.c
   GNUnet/src/applications/fs/uritrack/uri_info.c
   GNUnet/src/applications/gap/gap.c
   GNUnet/src/applications/gap/gaptest.c
   GNUnet/src/applications/gap/gaptest2.c
   GNUnet/src/applications/gap/gaptest3.c
   GNUnet/src/applications/gap/pid_table.c
   GNUnet/src/applications/gap/pid_table.h
   GNUnet/src/applications/getoption/clientapi.c
   GNUnet/src/applications/getoption/getoption.c
   GNUnet/src/applications/getoption/getoption.h
   GNUnet/src/applications/identity/clientapi.c
   GNUnet/src/applications/identity/hostkey.c
   GNUnet/src/applications/identity/hostkey.h
   GNUnet/src/applications/identity/identity.c
   GNUnet/src/applications/identity/identitytest.c
   GNUnet/src/applications/kvstore_sqlite/kv_sqlite.c
   GNUnet/src/applications/kvstore_sqlite/kv_sqlitetest.c
   GNUnet/src/applications/pingpong/pingpong.c
   GNUnet/src/applications/rpc/parameters.c
   GNUnet/src/applications/rpc/parameterstest.c
   GNUnet/src/applications/rpc/rpc.c
   GNUnet/src/applications/session/connect.c
   GNUnet/src/applications/session/sessiontest.c
   GNUnet/src/applications/session/sessiontest2.c
   GNUnet/src/applications/session/sessiontest_http.c
   GNUnet/src/applications/sqstore_mysql/mysql.c
   GNUnet/src/applications/sqstore_mysql/mysqltest.c
   GNUnet/src/applications/sqstore_mysql/mysqltest2.c
   GNUnet/src/applications/sqstore_mysql/mysqltest3.c
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
   GNUnet/src/applications/sqstore_sqlite/sqlitetest.c
   GNUnet/src/applications/sqstore_sqlite/sqlitetest2.c
   GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c
   GNUnet/src/applications/state/state.c
   GNUnet/src/applications/stats/clientapi.c
   GNUnet/src/applications/stats/gnunet-stats.c
   GNUnet/src/applications/stats/sqstats.c
   GNUnet/src/applications/stats/statistics.c
   GNUnet/src/applications/stats/statistics.h
   GNUnet/src/applications/tbench/gnunet-tbench.c
   GNUnet/src/applications/tbench/tbench.c
   GNUnet/src/applications/tbench/tbenchtest.c
   GNUnet/src/applications/template/gnunet-template.c
   GNUnet/src/applications/template/template.c
   GNUnet/src/applications/testbed/commands.c
   GNUnet/src/applications/testbed/gnunet-testbed.c
   GNUnet/src/applications/testbed/testbed.c
   GNUnet/src/applications/testbed/testbed.h
   GNUnet/src/applications/testing/testing.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/applications/topology_f2f/topology.c
   GNUnet/src/applications/tracekit/gnunet-tracekit.c
   GNUnet/src/applications/tracekit/tracekit.c
   GNUnet/src/applications/tracekit/tracekit.h
   GNUnet/src/applications/traffic/clientapi.c
   GNUnet/src/applications/traffic/traffic.c
   GNUnet/src/applications/traffic/traffic.h
   GNUnet/src/applications/transport/check.c
   GNUnet/src/applications/transport/transport.c
   GNUnet/src/applications/vpn/gnunet-vpn.c
   GNUnet/src/applications/vpn/vpn.c
   GNUnet/src/include/Makefile.am
   GNUnet/src/include/core.h
   GNUnet/src/include/ecrs_core.h
   GNUnet/src/include/fs.h
   GNUnet/src/include/gnunet_blockstore.h
   GNUnet/src/include/gnunet_bootstrap_service.h
   GNUnet/src/include/gnunet_chat_lib.h
   GNUnet/src/include/gnunet_collection_lib.h
   GNUnet/src/include/gnunet_core.h
   GNUnet/src/include/gnunet_datastore_service.h
   GNUnet/src/include/gnunet_dht_lib.h
   GNUnet/src/include/gnunet_dht_service.h
   GNUnet/src/include/gnunet_directories.h
   GNUnet/src/include/gnunet_dstore_service.h
   GNUnet/src/include/gnunet_ecrs_lib.h
   GNUnet/src/include/gnunet_fragmentation_service.h
   GNUnet/src/include/gnunet_fs_lib.h
   GNUnet/src/include/gnunet_fsui_lib.h
   GNUnet/src/include/gnunet_gap_service.h
   GNUnet/src/include/gnunet_identity_service.h
   GNUnet/src/include/gnunet_kvstore_service.h
   GNUnet/src/include/gnunet_namespace_lib.h
   GNUnet/src/include/gnunet_peerinfo_lib.h
   GNUnet/src/include/gnunet_pingpong_service.h
   GNUnet/src/include/gnunet_protocols.h
   GNUnet/src/include/gnunet_rpc_service.h
   GNUnet/src/include/gnunet_session_service.h
   GNUnet/src/include/gnunet_setup_lib.h
   GNUnet/src/include/gnunet_sqstore_service.h
   GNUnet/src/include/gnunet_state_service.h
   GNUnet/src/include/gnunet_stats_lib.h
   GNUnet/src/include/gnunet_stats_service.h
   GNUnet/src/include/gnunet_topology_service.h
   GNUnet/src/include/gnunet_traffic_lib.h
   GNUnet/src/include/gnunet_traffic_service.h
   GNUnet/src/include/gnunet_transport.h
   GNUnet/src/include/gnunet_transport_service.h
   GNUnet/src/include/gnunet_upnp_service.h
   GNUnet/src/include/gnunet_uritrack_lib.h
   GNUnet/src/include/gnunet_util_boot.h
   GNUnet/src/include/gnunet_util_config.h
   GNUnet/src/include/gnunet_util_containers.h
   GNUnet/src/include/gnunet_util_cron.h
   GNUnet/src/include/gnunet_util_crypto.h
   GNUnet/src/include/gnunet_util_disk.h
   GNUnet/src/include/gnunet_util_error.h
   GNUnet/src/include/gnunet_util_error_loggers.h
   GNUnet/src/include/gnunet_util_getopt.h
   GNUnet/src/include/gnunet_util_network.h
   GNUnet/src/include/gnunet_util_network_client.h
   GNUnet/src/include/gnunet_util_os.h
   GNUnet/src/include/gnunet_util_string.h
   GNUnet/src/include/plibc.h
   GNUnet/src/server/connection.c
   GNUnet/src/server/connection.h
   GNUnet/src/server/core.c
   GNUnet/src/server/gnunet-peer-info.c
   GNUnet/src/server/gnunet-transport-check.c
   GNUnet/src/server/gnunet-update.c
   GNUnet/src/server/gnunetd.c
   GNUnet/src/server/handler.c
   GNUnet/src/server/handler.h
   GNUnet/src/server/startup.c
   GNUnet/src/server/startup.h
   GNUnet/src/server/tcpserver.c
   GNUnet/src/server/tcpserver.h
   GNUnet/src/server/version.c
   GNUnet/src/server/version.h
   GNUnet/src/setup/gnunet-setup.c
   GNUnet/src/setup/gnunet-win-tool.c
   GNUnet/src/setup/gtk/gconf.c
   GNUnet/src/setup/gtk/gconf.h
   GNUnet/src/setup/gtk/glade_support.c
   GNUnet/src/setup/gtk/glade_support.h
   GNUnet/src/setup/gtk/ngconf.c
   GNUnet/src/setup/gtk/wizard_gtk.c
   GNUnet/src/setup/gtk/wizard_gtk.h
   GNUnet/src/setup/lib/gns.c
   GNUnet/src/setup/lib/tree.c
   GNUnet/src/setup/lib/tree.h
   GNUnet/src/setup/lib/wizard_util.c
   GNUnet/src/setup/lib/wizard_util.h
   GNUnet/src/setup/ncurses/mconf.c
   GNUnet/src/setup/ncurses/mconf.h
   GNUnet/src/setup/ncurses/wizard_curs.c
   GNUnet/src/setup/ncurses/wizard_curs.h
   GNUnet/src/setup/text/conf.c
   GNUnet/src/setup/text/conf.h
   GNUnet/src/transports/http.c
   GNUnet/src/transports/ip.c
   GNUnet/src/transports/ip.h
   GNUnet/src/transports/ip6.c
   GNUnet/src/transports/ip6.h
   GNUnet/src/transports/nat.c
   GNUnet/src/transports/smtp.c
   GNUnet/src/transports/tcp.c
   GNUnet/src/transports/tcp6.c
   GNUnet/src/transports/tcp_helper.c
   GNUnet/src/transports/test.c
   GNUnet/src/transports/test_repeat.c
   GNUnet/src/transports/udp.c
   GNUnet/src/transports/udp6.c
   GNUnet/src/transports/udp_helper.c
   GNUnet/src/transports/upnp/error.c
   GNUnet/src/transports/upnp/init.c
   GNUnet/src/transports/upnp/ip.c
   GNUnet/src/transports/upnp/ip.h
   GNUnet/src/transports/upnp/upnp.c
   GNUnet/src/transports/upnp/upnp.h
   GNUnet/src/transports/upnp/upnptest.c
   GNUnet/src/util/boot/startup.c
   GNUnet/src/util/config/config.c
   GNUnet/src/util/config/configtest.c
   GNUnet/src/util/config_impl/configtest.c
   GNUnet/src/util/containers/bloomfilter.c
   GNUnet/src/util/cron/cron.c
   GNUnet/src/util/crypto/crc32.c
   GNUnet/src/util/crypto/hashing.c
   GNUnet/src/util/crypto/hostkey_gcrypt.c
   GNUnet/src/util/crypto/kblockkey.c
   GNUnet/src/util/crypto/kblockkey_test.c
   GNUnet/src/util/crypto/random.c
   GNUnet/src/util/crypto/symcipher_gcrypt.c
   GNUnet/src/util/crypto/symciphertest.c
   GNUnet/src/util/crypto/weakkeytest.c
   GNUnet/src/util/disk/storage.c
   GNUnet/src/util/error/error.c
   GNUnet/src/util/getopt/getopt.c
   GNUnet/src/util/getopt/setoption.c
   GNUnet/src/util/loggers/file.c
   GNUnet/src/util/loggers/memory.c
   GNUnet/src/util/loggers/smtp.c
   GNUnet/src/util/network/io.c
   GNUnet/src/util/network/ip.c
   GNUnet/src/util/network/ipcheck.c
   GNUnet/src/util/network/network.h
   GNUnet/src/util/network/select.c
   GNUnet/src/util/network/selecttest.c
   GNUnet/src/util/network_client/daemon.c
   GNUnet/src/util/network_client/tcpio.c
   GNUnet/src/util/network_client/tcpiotest.c
   GNUnet/src/util/os/console.c
   GNUnet/src/util/os/cpustatus.c
   GNUnet/src/util/os/daemon.c
   GNUnet/src/util/os/daemontest.c
   GNUnet/src/util/os/dso.c
   GNUnet/src/util/os/init.c
   GNUnet/src/util/os/installpath.c
   GNUnet/src/util/os/osconfig.c
   GNUnet/src/util/os/priority.c
   GNUnet/src/util/os/semaphore.c
   GNUnet/src/util/os/semaphoretest.c
   GNUnet/src/util/os/statuscalls.c
   GNUnet/src/util/os/statuscallstest.c
   GNUnet/src/util/os/user.c
   GNUnet/src/util/string/string.c
   GNUnet/src/util/string/xmalloc.c
   GNUnet/src/util/threads/mutex.c
   GNUnet/src/util/threads/pthread.c
   GNUnet/src/util/threads/semaphore.c
   GNUnet/src/util/threads/shutdown.c
   GNUnet/src/util/threads/signal.c
   GNUnet/src/util/win/winproc.c
Log:
2nd round of renaming

Modified: GNUnet/HACKING
===================================================================
--- GNUnet/HACKING      2007-11-25 03:50:33 UTC (rev 5754)
+++ GNUnet/HACKING      2007-11-25 12:04:45 UTC (rev 5755)
@@ -2,16 +2,6 @@
 
 1) All exported symbols (function names, macros and structures) should begin
    with the prefix "GNUNET_".  No global variables should be exported.  
-   Accepted exceptions (for now, to be reconsidered):
-   a) This rule only applies to exported symbols in normal shared libraries.  
-      For all plugins, the exported symbols must end in "_libraryname" (and 
-      follow other conventions as established by the plugin API).  Plugins
-      should avoid exporting symbols other than those used by the plugin API.
-   b) Error handling and logging functions have the prefix "GE_" (for now).
-   c) Configuration functions have the prefix "GC_" (for now).
-   d) Certain very specific libraries (ECRS, FSUI, DHT) have their own
-      prefix.  This can be ok if the prefix alone is long enough and the
-      library is highly application specific.  
 2) All function names should use lower-caps names with underscores.  Common
    abbreviations like "RSA" should be in all-caps in function names.  Example:
    "GNUNET_semaphore_create".
@@ -26,15 +16,24 @@
    conventions (except for the "GNUNET_" prefix).
 6) Global symbols that are exported but should not usually be used directly
    (i.e., because a convenience macro is provided), should end with an 
underscore.
+7) For all plugins, the exported symbols must end in "_libraryname" (and 
+   follow other conventions as established by the plugin API).  Plugins should 
+   avoid exporting symbols other than those used by the plugin API.
+8) Libraries (other than gnunetutil and plugins) should add a second prefix 
after 
+   the "GNUNET_" to indicate the specific GNUnet library that the functions
+   belong to, for example,  "GNUNET_ECRS_foo_bar" for "libgnunetecrs". 
 
 NOTE:
 =====
 
 The existing codebase does not yet follow these conventions in many
-places (especially with respect to local symbols).  libgnunetutil.so
-should be clean.  Patches to fix things are welcome.
+places (especially with respect to local symbols and exported symbols
+from plugins).  Patches to fix these are welcome.
 
-Also, we should have a naming convention for fields of a struct.  
+Also, the above does not specify a naming convention for fields of structs.  
 Using the simple no-caps with underscores notation that is also
-used for local functions would make sense.
+used for local functions would make sense.  An open question is if
+we should distinguish function pointer in structs and normal value
+fields by using a different naming convention for one of these.
+Comments on this would be welcome.
 

Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c   2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/advertising/advertising.c   2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -62,19 +62,19 @@
 
 #define DEBUG_ADVERTISING GNUNET_NO
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static Transport_ServiceAPI *transport;
+static GNUNET_Transport_ServiceAPI *transport;
 
-static Identity_ServiceAPI *identity;
+static GNUNET_Identity_ServiceAPI *identity;
 
-static Pingpong_ServiceAPI *pingpong;
+static GNUNET_Pingpong_ServiceAPI *pingpong;
 
-static Topology_ServiceAPI *topology;
+static GNUNET_Topology_ServiceAPI *topology;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static int stat_hello_in;
 
@@ -151,7 +151,7 @@
 receivedhello (const GNUNET_PeerIdentity * sender,
                const GNUNET_MessageHeader * message)
 {
-  TSession *tsession;
+  GNUNET_TSession *tsession;
   GNUNET_MessageHello *copy;
   GNUNET_PeerIdentity foreignId;
   const GNUNET_MessageHello *msg;
@@ -168,14 +168,14 @@
   if ((ntohs (msg->header.size) < sizeof (GNUNET_MessageHello)) ||
       (ntohs (msg->header.size) != GNUNET_sizeof_hello (msg)))
     {
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;
     }
   identity->getPeerIdentity (&msg->publicKey, &foreignId);
   if (0 != memcmp (&msg->senderIdentity.hashPubKey,
                    &foreignId.hashPubKey, sizeof (GNUNET_HashCode)))
     {
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;     /* public key and host GNUNET_hash do not 
match */
     }
   if (GNUNET_SYSERR == GNUNET_RSA_verify (&msg->senderIdentity,
@@ -186,34 +186,34 @@
                                           &msg->signature, &msg->publicKey))
     {
       IF_GELOG (ectx,
-                GE_WARNING | GE_BULK | GE_USER,
+                GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("HELLO message from `%s' has an invalid signature. 
Dropping.\n"),
               (char *) &enc);
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;     /* message invalid */
     }
   if ((GNUNET_Int32Time) ntohl (msg->expirationTime) >
-      GNUNET_get_time_int32 (NULL) + MAX_HELLO_EXPIRES)
+      GNUNET_get_time_int32 (NULL) + GNUNET_MAX_HELLO_EXPIRES)
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("HELLO message has expiration too far in the future. 
Dropping.\n"));
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;
     }
   if (GNUNET_SYSERR == transport->verifyhello (msg))
     {
 #if DEBUG_ADVERTISING
       IF_GELOG (ectx,
-                GE_INFO | GE_BULK | GE_USER,
+                GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_DEBUG | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Transport verification of HELLO message from `%s' failed 
(%u).\n",
               &enc, ntohs (msg->protocol));
 #endif
@@ -223,14 +223,14 @@
     stats->change (stat_hello_in, 1);
 #if DEBUG_ADVERTISING
   IF_GELOG (ectx,
-            GE_INFO | GE_REQUEST | GE_USER,
+            GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-  GE_LOG (ectx,
-          GE_INFO | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "HELLO advertisement from `%s' for protocol %d received.\n",
           &enc, ntohs (msg->protocol));
 #endif
-  if (ntohs (msg->protocol) == NAT_PROTOCOL_NUMBER)
+  if (ntohs (msg->protocol) == GNUNET_TRANSPORT_PROTOCOL_NUMBER_NAT)
     {
       /* We *can* not verify NAT.  Ever.  So all we
          can do is just accept it.  The best thing
@@ -247,10 +247,10 @@
         stats->change (stat_hello_nat_in, 1);
 #if DEBUG_ADVERTISING
       IF_GELOG (ectx,
-                GE_INFO | GE_REQUEST | GE_USER,
+                GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "HELLO advertisement from `%s' for NAT, no verification 
required.\n",
               &enc);
 #endif
@@ -280,25 +280,25 @@
           GNUNET_free (copy);
 #if DEBUG_ADVERTISING
           IF_GELOG (ectx,
-                    GE_INFO | GE_REQUEST | GE_USER,
+                    GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                     GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey,
                                         &enc));
-          GE_LOG (ectx, GE_INFO | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_INFO | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                   "HELLO advertisement from `%s' for protocol %d updates old 
advertisement, no verification required.\n",
                   &enc, ntohs (msg->protocol));
 #endif
           return GNUNET_OK;
         }
 #if DEBUG_ADVERTISING
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "HELLO advertisement differs from prior knowledge,"
               " requireing ping-pong confirmation.\n");
 #endif
       GNUNET_free (copy);
     }
 
-  if (GNUNET_YES == GC_get_configuration_value_yesno (coreAPI->cfg,
+  if (GNUNET_YES == GNUNET_GC_get_configuration_value_yesno (coreAPI->cfg,
                                                       "GNUNETD",
                                                       "PRIVATE-NETWORK",
                                                       GNUNET_NO))
@@ -318,8 +318,8 @@
          a couple of lines above would need some minor
          editing :-). */
 #if DEBUG_ADVERTISING
-      GE_LOG (ectx,
-              GE_INFO | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Private network, discarding unknown advertisements\n");
 #endif
       return GNUNET_SYSERR;
@@ -347,8 +347,8 @@
          we don't want to follow that up with massive
          hello-ing by ourselves. */
 #if DEBUG_ADVERTISING
-      GE_LOG (ectx,
-              GE_INFO | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Not enough resources to verify HELLO message at this time (%u * 
%u < %u * 10)\n",
               (unsigned int) ((now - lasthelloMsg) / GNUNET_CRON_SECONDS),
               (unsigned int) GNUNET_network_monitor_get_limit (coreAPI->
@@ -371,10 +371,10 @@
         stats->change (stat_hello_no_transport, 1);
 #if DEBUG_ADVERTISING
       IF_GELOG (ectx,
-                GE_INFO | GE_REQUEST | GE_USER,
+                GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Failed to connect to `%s'.  Verification failed.\n", &enc);
 #endif
       return GNUNET_SYSERR;     /* could not connect */
@@ -389,8 +389,8 @@
     }
   else
     {
-      GE_ASSERT (ectx, mtu > P2P_MESSAGE_OVERHEAD);
-      mtu -= P2P_MESSAGE_OVERHEAD;
+      GNUNET_GE_ASSERT (ectx, mtu > GNUNET_P2P_MESSAGNUNET_GE_OVERHEAD);
+      mtu -= GNUNET_P2P_MESSAGNUNET_GE_OVERHEAD;
     }
   copy = GNUNET_malloc (GNUNET_sizeof_hello (msg));
   memcpy (copy, msg, GNUNET_sizeof_hello (msg));
@@ -399,8 +399,8 @@
   if (ping == NULL)
     {
       res = GNUNET_SYSERR;
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               _("Could not send HELLO+PING, ping buffer full.\n"));
       transport->disconnect (tsession, __FILE__);
       if (stats != NULL)
@@ -412,7 +412,7 @@
     {
       helloEnd = transport->getAdvertisedhellos (mtu - ntohs (ping->size),
                                                  buffer);
-      GE_ASSERT (ectx, mtu - ntohs (ping->size) >= helloEnd);
+      GNUNET_GE_ASSERT (ectx, mtu - ntohs (ping->size) >= helloEnd);
     }
   else
     {
@@ -420,8 +420,8 @@
     }
   if (helloEnd <= 0)
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("Failed to create an advertisement for this peer. Will not send 
PING.\n"));
       GNUNET_free (buffer);
@@ -430,10 +430,10 @@
       transport->disconnect (tsession, __FILE__);
 #if DEBUG_ADVERTISING
       IF_GELOG (ectx,
-                GE_INFO | GE_REQUEST | GE_USER,
+                GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Failed to connect advertisement for myself.  Verification 
failed.\n",
               &enc);
 #endif
@@ -453,10 +453,10 @@
         stats->change (stat_hello_send_error, 1);
 #if DEBUG_ADVERTISING
       IF_GELOG (ectx,
-                GE_INFO | GE_REQUEST | GE_USER,
+                GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&msg->senderIdentity.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Failed to transmit advertisement for myself.  Verification 
failed.\n",
               &enc);
 #endif
@@ -487,7 +487,7 @@
 {
   SendData *sd = cls;
   GNUNET_MessageHello *hello;
-  TSession *tsession;
+  GNUNET_TSession *tsession;
   int prio;
 #if DEBUG_ADVERTISING
   GNUNET_EncName other;
@@ -495,7 +495,7 @@
 
   if (confirmed == GNUNET_NO)
     return GNUNET_OK;
-  if (proto == NAT_PROTOCOL_NUMBER)
+  if (proto == GNUNET_TRANSPORT_PROTOCOL_NUMBER_NAT)
     {
       sd->n--;
       return GNUNET_OK;         /* don't advertise NAT addresses via broadcast 
*/
@@ -505,17 +505,17 @@
     return GNUNET_OK;
 #if DEBUG_ADVERTISING
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&hi->hashPubKey, &other));
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Entering `%s' with target `%s'.\n", __FUNCTION__, &other);
 #endif
   if (0 == memcmp (hi, coreAPI->myIdentity, sizeof (GNUNET_PeerIdentity)))
     return GNUNET_OK;           /* never advertise to myself... */
   prio = (int) getConnectPriority ();
-  if (prio >= EXTREME_PRIORITY)
-    prio = EXTREME_PRIORITY / 4;
+  if (prio >= GNUNET_EXTREME_PRIORITY)
+    prio = GNUNET_EXTREME_PRIORITY / 4;
   if (GNUNET_OK == coreAPI->queryPeerStatus (hi, NULL, NULL))
     {
       coreAPI->unicast (hi, &sd->m->header, prio, HELLO_BROADCAST_FREQUENCY);
@@ -537,7 +537,7 @@
   if (NULL == hello)
     {
 #if DEBUG_ADVERTISING
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Exit from `%s' (error: `%s' failed).\n",
               __FUNCTION__, "identity2Hello");
 #endif
@@ -548,8 +548,8 @@
   if (tsession == NULL)
     {
 #if DEBUG_ADVERTISING
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Exit from `%s' (%s error).\n",
               __FUNCTION__, "transportConnect");
 #endif
@@ -562,8 +562,8 @@
                           GNUNET_sizeof_hello (sd->m));
   transport->disconnect (tsession, __FILE__);
 #if DEBUG_ADVERTISING
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER, "Exit from %s.\n", __FUNCTION__);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "Exit from 
%s.\n", __FUNCTION__);
 #endif
   return GNUNET_OK;
 }
@@ -591,8 +591,8 @@
   if (sd.m == NULL)
     return;
 #if DEBUG_ADVERTISING
-  GE_LOG (ectx,
-          GE_INFO | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("Advertising my transport %d to selected peers.\n"),
           tapi->protocolNumber);
 #endif
@@ -600,8 +600,8 @@
   if (sd.n < 1)
     {
       if (identity->forEachHost (0, NULL, NULL) == 0)
-        GE_LOG (ectx,
-                GE_WARNING | GE_BULK | GE_USER,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                 _("Announcing ourselves pointless: "
                   "no other peers are known to us so far.\n"));
       GNUNET_free (sd.m);
@@ -675,7 +675,7 @@
     return GNUNET_SYSERR;       /* network load too high... */
   if (confirmed == GNUNET_NO)
     return GNUNET_OK;
-  if (protocol == NAT_PROTOCOL_NUMBER)
+  if (protocol == GNUNET_TRANSPORT_PROTOCOL_NUMBER_NAT)
     return GNUNET_OK;           /* don't forward NAT addresses */
   hello = identity->identity2Hello (peer, protocol, GNUNET_NO);
   if (NULL == hello)
@@ -688,10 +688,10 @@
       GNUNET_EncName enc;
       /* remove hellos that expired */
       IF_GELOG (ectx,
-                GE_INFO | GE_REQUEST | GE_USER,
+                GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&peer->hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Removing HELLO from peer `%s' (expired %ds ago).\n",
               &enc, now - ntohl (hello->expirationTime));
 #endif
@@ -760,7 +760,7 @@
  */
 static int
 phelloHandler (const GNUNET_PeerIdentity * sender,
-               const GNUNET_MessageHeader * message, TSession * session)
+               const GNUNET_MessageHeader * message, GNUNET_TSession * session)
 {
   receivedhello (sender, message);
   return GNUNET_OK;
@@ -773,15 +773,15 @@
  */
 static int
 configurationUpdateCallback (void *ctx,
-                             struct GC_Configuration *cfg,
-                             struct GE_Context *ectx,
+                             struct GNUNET_GC_Configuration *cfg,
+                             struct GNUNET_GE_Context *ectx,
                              const char *section, const char *option)
 {
   if (0 != strcmp (section, "NETWORK"))
     return 0;
   if (ACJ_ANNOUNCE == (activeCronJobs & ACJ_ANNOUNCE))
     {
-      if (GNUNET_YES == GC_get_configuration_value_yesno (cfg,
+      if (GNUNET_YES == GNUNET_GC_get_configuration_value_yesno (cfg,
                                                           "NETWORK",
                                                           
"DISABLE-ADVERTISEMENTS",
                                                           GNUNET_NO))
@@ -792,7 +792,7 @@
     }
   else
     {
-      if (GNUNET_YES != GC_get_configuration_value_yesno (cfg,
+      if (GNUNET_YES != GNUNET_GC_get_configuration_value_yesno (cfg,
                                                           "NETWORK",
                                                           
"DISABLE-ADVERTISEMENTS",
                                                           GNUNET_NO))
@@ -804,7 +804,7 @@
     }
   if (ACJ_FORWARD == (activeCronJobs & ACJ_FORWARD))
     {
-      if (GNUNET_YES != GC_get_configuration_value_yesno (cfg,
+      if (GNUNET_YES != GNUNET_GC_get_configuration_value_yesno (cfg,
                                                           "NETWORK",
                                                           "HELLOEXCHANGE",
                                                           GNUNET_YES))
@@ -815,7 +815,7 @@
     }
   else
     {
-      if (GNUNET_YES == GC_get_configuration_value_yesno (cfg,
+      if (GNUNET_YES == GNUNET_GC_get_configuration_value_yesno (cfg,
                                                           "NETWORK",
                                                           "HELLOEXCHANGE",
                                                           GNUNET_YES))
@@ -834,20 +834,20 @@
  * Start advertising.
  */
 int
-initialize_module_advertising (CoreAPIForApplication * capi)
+initialize_module_advertising (GNUNET_CoreAPIForPlugins * capi)
 {
   coreAPI = capi;
   ectx = capi->ectx;
   identity = capi->requestService ("identity");
   if (identity == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   transport = capi->requestService ("transport");
   if (transport == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       capi->releaseService (identity);
       identity = NULL;
       return GNUNET_SYSERR;
@@ -855,7 +855,7 @@
   pingpong = capi->requestService ("pingpong");
   if (pingpong == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       capi->releaseService (identity);
       identity = NULL;
       capi->releaseService (transport);
@@ -865,7 +865,7 @@
   topology = capi->requestService ("topology");
   if (topology == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       capi->releaseService (identity);
       identity = NULL;
       capi->releaseService (transport);
@@ -916,19 +916,19 @@
         stats->create (gettext_noop ("# plaintext PING messages sent"));
     }
 
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering handler %d (plaintext and ciphertext)\n"),
-          "advertising", p2p_PROTO_hello);
+          "advertising", GNUNET_P2P_PROTO_HELLO);
 
-  capi->registerHandler (p2p_PROTO_hello, &ehelloHandler);
-  capi->registerPlaintextHandler (p2p_PROTO_hello, &phelloHandler);
-  if (0 != GC_attach_change_listener (capi->cfg,
+  capi->registerHandler (GNUNET_P2P_PROTO_HELLO, &ehelloHandler);
+  capi->registerPlaintextHandler (GNUNET_P2P_PROTO_HELLO, &phelloHandler);
+  if (0 != GNUNET_GC_attach_change_listener (capi->cfg,
                                       &configurationUpdateCallback, NULL))
-    GE_BREAK (capi->ectx, 0);
+    GNUNET_GE_BREAK (capi->ectx, 0);
   startBootstrap (capi);
-  GE_ASSERT (capi->ectx,
-             0 == GC_set_configuration_value_string (capi->cfg,
+  GNUNET_GE_ASSERT (capi->ectx,
+             0 == GNUNET_GC_set_configuration_value_string (capi->cfg,
                                                      capi->ectx,
                                                      "ABOUT",
                                                      "advertising",
@@ -945,7 +945,7 @@
 done_module_advertising ()
 {
   stopBootstrap ();
-  GC_detach_change_listener (coreAPI->cfg,
+  GNUNET_GC_detach_change_listener (coreAPI->cfg,
                              &configurationUpdateCallback, NULL);
   if (ACJ_ANNOUNCE == (activeCronJobs & ACJ_ANNOUNCE))
     {
@@ -958,8 +958,8 @@
       GNUNET_cron_del_job (coreAPI->cron, &forwardhello, 
HELLO_FORWARD_FREQUENCY, NULL);        /* seven minutes: exchange */
       activeCronJobs -= ACJ_FORWARD;
     }
-  coreAPI->unregisterHandler (p2p_PROTO_hello, &ehelloHandler);
-  coreAPI->unregisterPlaintextHandler (p2p_PROTO_hello, &phelloHandler);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_HELLO, &ehelloHandler);
+  coreAPI->unregisterPlaintextHandler (GNUNET_P2P_PROTO_HELLO, &phelloHandler);
   coreAPI->releaseService (transport);
   transport = NULL;
   coreAPI->releaseService (identity);

Modified: GNUnet/src/applications/advertising/advertising_test.c
===================================================================
--- GNUnet/src/applications/advertising/advertising_test.c      2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/advertising/advertising_test.c      2007-11-25 
12:04:45 UTC (rev 5755)
@@ -63,8 +63,8 @@
 {
   struct GNUNET_TESTING_DaemonContext *peers;
   int ret = 0;
-  struct GE_Context *ectx;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_ClientServerConnection *sock;
   int i;
   int k;
@@ -74,10 +74,10 @@
   int min;
 
   ectx = NULL;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   peers =
@@ -87,7 +87,7 @@
                                   NUM_PEERS);
   if (peers == NULL)
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   /* do circular connect */
@@ -102,7 +102,7 @@
           fprintf (stderr,
                    "Failed to connect peers %d and %d!\n",
                    i, (i + 1) % NUM_PEERS);
-          GC_free (cfg);
+          GNUNET_GC_free (cfg);
           return -1;
         }
     }
@@ -118,10 +118,10 @@
       for (i = 0; i < NUM_PEERS; i++)
         {
           GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + i * 10);
-          GC_set_configuration_value_string (cfg,
+          GNUNET_GC_set_configuration_value_string (cfg,
                                              ectx, "NETWORK", "HOST", buf);
           sock = GNUNET_client_connection_create (NULL, cfg);
-          STATS_getStatistics (NULL, sock, &countConnections, &have);
+          GNUNET_STATS_get_statistics (NULL, sock, &countConnections, &have);
           GNUNET_client_connection_destroy (sock);
           found += have;
           if (have < min)
@@ -134,7 +134,7 @@
         GNUNET_thread_sleep (45 * GNUNET_CRON_SECONDS); /* one hello-forward 
round is 45s! */
     }
   GNUNET_TESTING_stop_daemons (peers);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return ret;
 }
 

Modified: GNUnet/src/applications/advertising/bootstrap.c
===================================================================
--- GNUnet/src/applications/advertising/bootstrap.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/advertising/bootstrap.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -35,11 +35,11 @@
 
 #define hello_HELPER_TABLE_START_SIZE 64
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static Bootstrap_ServiceAPI *bootstrap;
+static GNUNET_Bootstrap_ServiceAPI *bootstrap;
 
-static State_ServiceAPI *state;
+static GNUNET_State_ServiceAPI *state;
 
 static struct GNUNET_ThreadHandle *pt;
 
@@ -69,7 +69,7 @@
 
   if (NULL == hcq)
     {
-      GE_BREAK (coreAPI->ectx, 0);
+      GNUNET_GE_BREAK (coreAPI->ectx, 0);
       return;
     }
   while ((!hcq->do_shutdown) && (hcq->hellosCount > 0))
@@ -78,8 +78,8 @@
       rndidx =
         GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, hcq->hellosCount);
 #if DEBUG_BOOTSTRAP
-      GE_LOG (coreAPI->ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "%s chose hello %d of %d\n",
               __FUNCTION__, rndidx, hcq->hellosCount);
 #endif
@@ -205,7 +205,7 @@
       if (GNUNET_YES == hlc.do_shutdown)
         break;
 #if DEBUG_BOOTSTRAP
-      GE_LOG (coreAPI->ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Starting bootstrap.\n");
 #endif
       hlc.hellosLen = 0;
@@ -223,16 +223,16 @@
  * advertisements if needed.
  */
 void
-startBootstrap (CoreAPIForApplication * capi)
+startBootstrap (GNUNET_CoreAPIForPlugins * capi)
 {
   coreAPI = capi;
   state = capi->requestService ("state");
-  GE_ASSERT (capi->ectx, state != NULL);
+  GNUNET_GE_ASSERT (capi->ectx, state != NULL);
   bootstrap = capi->requestService ("bootstrap");
-  GE_ASSERT (capi->ectx, bootstrap != NULL);
+  GNUNET_GE_ASSERT (capi->ectx, bootstrap != NULL);
   hlc.do_shutdown = GNUNET_NO;
   pt = GNUNET_thread_create (&processThread, NULL, 64 * 1024);
-  GE_ASSERT (capi->ectx, pt != NULL);
+  GNUNET_GE_ASSERT (capi->ectx, pt != NULL);
 }
 
 /**

Modified: GNUnet/src/applications/advertising/bootstrap.h
===================================================================
--- GNUnet/src/applications/advertising/bootstrap.h     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/advertising/bootstrap.h     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,7 +34,7 @@
  * Start using the bootstrap service to obtain
  * advertisements if needed.
  */
-void startBootstrap (CoreAPIForApplication * capi);
+void startBootstrap (GNUNET_CoreAPIForPlugins * capi);
 
 /**
  * Stop the bootstap service.

Modified: GNUnet/src/applications/bootstrap_http/http.c
===================================================================
--- GNUnet/src/applications/bootstrap_http/http.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/bootstrap_http/http.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -36,22 +36,22 @@
 /**
  * Stats service (maybe NULL!)
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static int stat_hellodownloaded;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 typedef struct
 {
 
-  bootstrap_hello_callback callback;
+  GNUNET_BootstrapHelloCallback callback;
 
   void *arg;
 
-  bootstrap_terminate_callback termTest;
+  GNUNET_BootstrapTerminateCallback termTest;
 
   void *targ;
 
@@ -100,12 +100,12 @@
       hs = ntohs (hello->header.size);
       if (bctx->bsize < hs)
         break;                  /* incomplete */
-      if ((ntohs (hello->header.type) != p2p_PROTO_hello) ||
+      if ((ntohs (hello->header.type) != GNUNET_P2P_PROTO_HELLO) ||
           (ntohs (hello->header.size) != GNUNET_sizeof_hello (hello)) ||
           (GNUNET_sizeof_hello (hello) >= GNUNET_MAX_BUFFER_SIZE))
         {
-          GE_LOG (ectx,
-                  GE_WARNING | GE_USER | GE_IMMEDIATE,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_IMMEDIATE,
                   _("Bootstrap data obtained from `%s' is invalid.\n"),
                   bctx->url);
           return 0;             /* Error: invalid format! */
@@ -119,13 +119,13 @@
   return size * nmemb;
 }
 
-#define CURL_EASY_SETOPT(c, a, b) do { ret = curl_easy_setopt(c, a, b); if 
(ret != CURLE_OK) GE_LOG(ectx, GE_WARNING | GE_USER | GE_BULK, _("%s failed at 
%s:%d: `%s'\n"), "curl_easy_setopt", __FILE__, __LINE__, 
curl_easy_strerror(ret)); } while (0);
+#define CURL_EASY_SETOPT(c, a, b) do { ret = curl_easy_setopt(c, a, b); if 
(ret != CURLE_OK) GNUNET_GE_LOG(ectx, GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_BULK, _("%s failed at %s:%d: `%s'\n"), "curl_easy_setopt", __FILE__, 
__LINE__, curl_easy_strerror(ret)); } while (0);
 
 
 static void
-downloadHostlist (bootstrap_hello_callback callback,
+downloadHostlist (GNUNET_BootstrapHelloCallback callback,
                   void *arg,
-                  bootstrap_terminate_callback termTest, void *targ)
+                  GNUNET_BootstrapTerminateCallback termTest, void *targ)
 {
   BootstrapContext bctx;
   char *url;
@@ -148,7 +148,7 @@
 
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   bctx.callback = callback;
@@ -163,16 +163,16 @@
 #endif
   if (curl == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   url = NULL;
-  if (0 != GC_get_configuration_value_string (coreAPI->cfg,
+  if (0 != GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                               "GNUNETD",
                                               "HOSTLISTURL", "", &url))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("No hostlist URL specified in configuration, will not 
bootstrap.\n"));
       GNUNET_free (url);
@@ -213,12 +213,12 @@
         }
       pos--;
     }
-  GE_LOG (ectx,
-          GE_INFO | GE_BULK | GE_USER, _("Bootstrapping using `%s'.\n"), url);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER, _("Bootstrapping 
using `%s'.\n"), url);
   bctx.url = url;
   bctx.total = 0;
   proxy = NULL;
-  GC_get_configuration_value_string (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                      "GNUNETD", "HTTP-PROXY", "", &proxy);
   CURL_EASY_SETOPT (curl, CURLOPT_WRITEFUNCTION, &downloadHostlistHelper);
   CURL_EASY_SETOPT (curl, CURLOPT_WRITEDATA, &bctx);
@@ -226,8 +226,8 @@
     goto cleanup;
   CURL_EASY_SETOPT (curl, CURLOPT_FAILONERROR, 1);
   CURL_EASY_SETOPT (curl, CURLOPT_URL, &url[pos]);
-  GE_LOG (ectx,
-          GE_INFO | GE_USER | GE_BULK,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
           _("Trying to download hostlist from `%s'\n"), &url[pos]);
   if (strlen (proxy) > 0)
     CURL_EASY_SETOPT (curl, CURLOPT_PROXY, proxy);
@@ -243,14 +243,14 @@
   multi = curl_multi_init ();
   if (multi == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       goto cleanup;
     }
   mret = curl_multi_add_handle (multi, curl);
   if (mret != CURLM_OK)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_BULK,
               _("%s failed at %s:%d: `%s'\n"),
               "curl_multi_add_handle",
               __FILE__, __LINE__, curl_multi_strerror (mret));
@@ -266,8 +266,8 @@
       mret = curl_multi_fdset (multi, &rs, &ws, &es, &max);
       if (mret != CURLM_OK)
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                   _("%s failed at %s:%d: `%s'\n"),
                   "curl_multi_fdset",
                   __FILE__, __LINE__, curl_multi_strerror (mret));
@@ -290,15 +290,15 @@
               do
                 {
                   msg = curl_multi_info_read (multi, &running);
-                  GE_BREAK (ectx, msg != NULL);
+                  GNUNET_GE_BREAK (ectx, msg != NULL);
                   if (msg == NULL)
                     break;
                   switch (msg->msg)
                     {
                     case CURLMSG_DONE:
                       if (msg->data.result != CURLE_OK)
-                        GE_LOG (ectx,
-                                GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        GNUNET_GE_LOG (ectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                                 _("%s failed at %s:%d: `%s'\n"),
                                 "curl_multi_perform",
                                 __FILE__,
@@ -317,8 +317,8 @@
              && (GNUNET_YES == termTest (targ)));
       if ((mret != CURLM_OK) && (mret != CURLM_CALL_MULTI_PERFORM))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                   _("%s failed at %s:%d: `%s'\n"),
                   "curl_multi_perform",
                   __FILE__, __LINE__, curl_multi_strerror (mret));
@@ -330,8 +330,8 @@
   mret = curl_multi_remove_handle (multi, curl);
   if (mret != CURLM_OK)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_ADMIN | GE_DEVELOPER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_DEVELOPER | 
GNUNET_GE_BULK,
               _("%s failed at %s:%d: `%s'\n"),
               "curl_multi_remove_handle",
               __FILE__, __LINE__, curl_multi_strerror (mret));
@@ -340,8 +340,8 @@
 #else
   ret = curl_easy_perform (curl);
   if (ret != CURLE_OK)
-    GE_LOG (ectx,
-            GE_ERROR | GE_ADMIN | GE_DEVELOPER | GE_BULK,
+    GNUNET_GE_LOG (ectx,
+            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_DEVELOPER | 
GNUNET_GE_BULK,
             _("%s failed at %s:%d: `%s'\n"),
             "curl_easy_perform",
             __FILE__, __LINE__, curl_easy_strerror (ret));
@@ -350,21 +350,21 @@
 #if USE_MULTI
   mret = curl_multi_cleanup (multi);
   if (mret != CURLM_OK)
-    GE_LOG (ectx,
-            GE_ERROR | GE_ADMIN | GE_DEVELOPER | GE_BULK,
+    GNUNET_GE_LOG (ectx,
+            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_DEVELOPER | 
GNUNET_GE_BULK,
             _("%s failed at %s:%d: `%s'\n"),
             "curl_multi_cleanup",
             __FILE__, __LINE__, curl_multi_strerror (mret));
 #endif
-  GE_LOG (ectx,
-          GE_INFO | GE_BULK | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER,
           _("Downloaded %llu bytes from `%s'.\n"), bctx.total, url);
   GNUNET_free (url);
   GNUNET_free (proxy);
   curl_global_cleanup ();
   return;
 cleanup:
-  GE_BREAK (ectx, ret != CURLE_OK);
+  GNUNET_GE_BREAK (ectx, ret != CURLE_OK);
 #if USE_MULTI
   if (multi != NULL)
     curl_multi_remove_handle (multi, curl);
@@ -380,10 +380,10 @@
 }
 
 
-Bootstrap_ServiceAPI *
-provide_module_bootstrap (CoreAPIForApplication * capi)
+GNUNET_Bootstrap_ServiceAPI *
+provide_module_bootstrap (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Bootstrap_ServiceAPI api;
+  static GNUNET_Bootstrap_ServiceAPI api;
 
   coreAPI = capi;
   ectx = capi->ectx;

Modified: GNUnet/src/applications/bootstrap_http/httptest.c
===================================================================
--- GNUnet/src/applications/bootstrap_http/httptest.c   2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/bootstrap_http/httptest.c   2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,7 +34,7 @@
 
 void release_module_bootstrap ();
 
-Bootstrap_ServiceAPI *provide_module_bootstrap (CoreAPIForApplication * capi);
+GNUNET_Bootstrap_ServiceAPI *provide_module_bootstrap 
(GNUNET_CoreAPIForPlugins * capi);
 
 static void *
 rs (const char *name)
@@ -68,7 +68,7 @@
 static void *
 pt (void *b)
 {
-  Bootstrap_ServiceAPI *boot = b;
+  GNUNET_Bootstrap_ServiceAPI *boot = b;
 
   boot->bootstrap (&hello, NULL, &terminate, NULL);
   return NULL;
@@ -77,23 +77,23 @@
 int
 main (int argc, char **argv)
 {
-  static CoreAPIForApplication capi;
-  struct GC_Configuration *cfg;
+  static GNUNET_CoreAPIForPlugins capi;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_PluginHandle *plugin;
-  Bootstrap_ServiceAPI *boot;
+  GNUNET_Bootstrap_ServiceAPI *boot;
   struct GNUNET_ThreadHandle *p;
   void *unused;
-  ServiceInitMethod init;
-  ServiceDoneMethod done;
+  GNUNET_ServicePluginInitializationMethod init;
+  GNUNET_ServicePluginShutdownMethod done;
 
   count = 0;
-  cfg = GC_create ();
-  GC_set_configuration_value_string (cfg,
+  cfg = GNUNET_GC_create ();
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      NULL,
                                      "GNUNETD",
                                      "HOSTLISTURL",
                                      "http://gnunet.org/hostlist";);
-  memset (&capi, 0, sizeof (CoreAPIForApplication));
+  memset (&capi, 0, sizeof (GNUNET_CoreAPIForPlugins));
   capi.cfg = cfg;
   capi.requestService = &rs;
   capi.releaseService = &rsx;
@@ -107,7 +107,7 @@
     GNUNET_plugin_resolve_function (plugin, "release_module_", GNUNET_YES);
   done ();
   GNUNET_plugin_unload (plugin);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (count == 0)
     return 1;
   return 0;

Modified: GNUnet/src/applications/chat/chat.c
===================================================================
--- GNUnet/src/applications/chat/chat.c 2007-11-25 03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/chat/chat.c 2007-11-25 12:04:45 UTC (rev 5755)
@@ -30,12 +30,12 @@
 #include "gnunet_protocols.h"
 #include "chat.h"
 
-static CoreAPIForApplication *coreAPI = NULL;
+static GNUNET_CoreAPIForPlugins *coreAPI = NULL;
 
 #define MAX_LAST_MESSAGES 12
 #define MAX_CLIENTS 4
 
-static ClientHandle clients[MAX_CLIENTS];
+static GNUNET_ClientHandle clients[MAX_CLIENTS];
 static int clientCount;
 static GNUNET_HashCode lastMsgs[MAX_LAST_MESSAGES];
 static int ringIndex;
@@ -70,7 +70,7 @@
   bcc.message = message;
   bcc.prio = prio;
   bcc.delay = delay;
-  coreAPI->forAllConnectedNodes ((PerNodeCallback) bccHelper, &bcc);
+  coreAPI->forAllConnectedNodes ((GNUNET_NodeIteratorCallback) bccHelper, 
&bcc);
 }
 
 static int
@@ -85,7 +85,7 @@
 
   if (ntohs (message->size) != sizeof (P2P_chat_MESSAGE))
     {
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Message received from peer is invalid.\n"));
       return GNUNET_SYSERR;
     }
@@ -105,13 +105,13 @@
          and broadcast to all peers */
       markSeen (&hc);
       broadcastToConnected (message, 5, 1);
-      cmsg->header.type = htons (CS_PROTO_chat_MSG);
+      cmsg->header.type = htons (GNUNET_CS_PROTO_CHAT_MSG);
       for (j = 0; j < clientCount; j++)
         coreAPI->sendToClient (clients[j], &cmsg->header);
       pmsg->nick[CHAT_NICK_LENGTH - 1] = '\0';
       pmsg->message[CHAT_MSG_LENGTH - 1] = '\0';
       /*
-         GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+         GNUNET_GE_LOG(ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
          " CHAT: received new message from %s: %s\n",
          &pmsg->nick[0],
          &pmsg->message[0]);
@@ -122,7 +122,7 @@
 }
 
 static int
-csHandleChatRequest (ClientHandle client, const CS_MESSAGE_HEADER * message)
+csHandleChatRequest (GNUNET_ClientHandle client, const 
CS_MESSAGNUNET_GE_HEADER * message)
 {
   int i;
   int j;
@@ -132,7 +132,7 @@
 
   if (ntohs (message->size) != sizeof (CS_chat_MESSAGE))
     {
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Message received from client is invalid\n"));
       return GNUNET_SYSERR;     /* invalid message */
     }
@@ -152,32 +152,32 @@
   if (j == -1)
     {
       if (clientCount == MAX_CLIENTS)
-        GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+        GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                 _("Maximum number of chat clients reached.\n"));
       else
         {
           clients[clientCount++] = client;
-          GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                   _("Now %d of %d chat clients at this node.\n"),
                   clientCount, MAX_CLIENTS);
         }
     }
   /* forward to all other nodes in the network */
-  pmsg->header.type = htons (P2P_PROTO_chat_MSG);
+  pmsg->header.type = htons (GNUNET_P2P_PROTO_CHAT_MSG);
   broadcastToConnected (&pmsg->header, 5, 1);
   GNUNET_mutex_unlock (&chatMutex);
   return GNUNET_OK;
 }
 
 static void
-chatClientExitHandler (ClientHandle client)
+chatClientExitHandler (GNUNET_ClientHandle client)
 {
   int i;
   GNUNET_mutex_lock (&chatMutex);
   for (i = 0; i < clientCount; i++)
     if (clients[i] == client)
       {
-        GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+        GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                 "Chat client exits.\n");
         clients[i] = clients[--clientCount];
         break;
@@ -191,30 +191,30 @@
  * @return GNUNET_SYSERR on errors
  */
 int
-initialize_module_chat (CoreAPIForApplication * capi)
+initialize_module_chat (GNUNET_CoreAPIForPlugins * capi)
 {
   int ok = GNUNET_OK;
 
-  GE_ASSERT (ectx, sizeof (P2P_chat_MESSAGE) == sizeof (CS_chat_MESSAGE));
+  GNUNET_GE_ASSERT (ectx, sizeof (P2P_chat_MESSAGE) == sizeof 
(CS_chat_MESSAGE));
   GNUNET_mutex_create (&chatMutex);
   clientCount = 0;
   coreAPI = capi;
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering handlers %d and %d\n"),
-          "chat", P2P_PROTO_chat_MSG, CS_PROTO_chat_MSG);
+          "chat", GNUNET_P2P_PROTO_CHAT_MSG, GNUNET_CS_PROTO_CHAT_MSG);
 
   if (GNUNET_SYSERR ==
-      capi->registerHandler (P2P_PROTO_chat_MSG, &handleChatMSG))
+      capi->registerHandler (GNUNET_P2P_PROTO_CHAT_MSG, &handleChatMSG))
     ok = GNUNET_SYSERR;
   if (GNUNET_SYSERR ==
       capi->registerClientExitHandler (&chatClientExitHandler))
     ok = GNUNET_SYSERR;
-  if (GNUNET_SYSERR == capi->registerClientHandler (CS_PROTO_chat_MSG,
+  if (GNUNET_SYSERR == capi->registerClientHandler (GNUNET_CS_PROTO_CHAT_MSG,
                                                     &csHandleChatRequest))
     ok = GNUNET_SYSERR;
 
-  GE_ASSERT (capi->ectx,
-             0 == GC_set_configuration_value_string (capi->cfg,
+  GNUNET_GE_ASSERT (capi->ectx,
+             0 == GNUNET_GC_set_configuration_value_string (capi->cfg,
                                                      capi->ectx,
                                                      "ABOUT",
                                                      "chat",
@@ -226,9 +226,9 @@
 void
 done_module_chat ()
 {
-  coreAPI->unregisterHandler (P2P_PROTO_chat_MSG, &handleChatMSG);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_CHAT_MSG, &handleChatMSG);
   coreAPI->unregisterClientExitHandler (&chatClientExitHandler);
-  coreAPI->unregisterClientHandler (CS_PROTO_chat_MSG, &csHandleChatRequest);
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_CHAT_MSG, 
&csHandleChatRequest);
   GNUNET_mutex_destroy (&chatMutex);
   coreAPI = NULL;
 }

Modified: GNUnet/src/applications/chat/chat.h
===================================================================
--- GNUnet/src/applications/chat/chat.h 2007-11-25 03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/chat/chat.h 2007-11-25 12:04:45 UTC (rev 5755)
@@ -39,7 +39,7 @@
 
 typedef struct
 {
-  CS_MESSAGE_HEADER header;
+  CS_MESSAGNUNET_GE_HEADER header;
   char nick[CHAT_NICK_LENGTH];
   char message[CHAT_MSG_LENGTH];
 } CS_chat_MESSAGE;

Modified: GNUnet/src/applications/chat/clientapi.c
===================================================================
--- GNUnet/src/applications/chat/clientapi.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/chat/clientapi.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -39,9 +39,9 @@
 
   struct GNUNET_ThreadHandle *listen_thread;
 
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
   char *nickname;
 
@@ -69,8 +69,8 @@
  * @return number of rooms on success, GNUNET_SYSERR if iterator aborted
  */
 int
-GNUNET_CHAT_list_rooms (struct GE_Context *ectx,
-                        struct GC_Configuration *cfg,
+GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx,
+                        struct GNUNET_GC_Configuration *cfg,
                         GNUNET_CHAT_RoomIterator it, void *cls)
 {
   return GNUNET_SYSERR;
@@ -87,8 +87,8 @@
  * @return NULL on error
  */
 struct GNUNET_CHAT_Room *
-GNUNET_CHAT_join_room (struct GE_Context *ectx,
-                       struct GC_Configuration *cfg,
+GNUNET_CHAT_join_room (struct GNUNET_GE_Context *ectx,
+                       struct GNUNET_GC_Configuration *cfg,
                        const char *nickname,
                        const GNUNET_RSA_PublicKey * me,
                        const struct GNUNET_RSA_PrivateKey *key,

Modified: GNUnet/src/applications/chat/gnunet-chat.c
===================================================================
--- GNUnet/src/applications/chat/gnunet-chat.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/chat/gnunet-chat.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -28,11 +28,11 @@
 #include "gnunet_protocols.h"
 #include "gnunet_chat_lib.h"
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
 static char *nickname;
 
@@ -51,7 +51,7 @@
   {'r', "room", "NAME",
    gettext_noop ("set the chat room to join (requred)"),
    1, &GNUNET_getopt_configure_set_string, &roomname},
-  COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+  COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };

Modified: GNUnet/src/applications/datastore/datastore.c
===================================================================
--- GNUnet/src/applications/datastore/datastore.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/datastore/datastore.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -43,12 +43,12 @@
 /**
  * SQ-store handle
  */
-static SQstore_ServiceAPI *sq;
+static GNUNET_SQstore_ServiceAPI *sq;
 
 /**
  * Core API handle.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * Minimum priority in the DB.
@@ -67,7 +67,7 @@
 
 static struct GNUNET_CronManager *cron;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_filtered;
 
@@ -106,7 +106,7 @@
 
 static int
 get (const GNUNET_HashCode * query,
-     unsigned int type, Datum_Iterator iter, void *closure)
+     unsigned int type, GNUNET_DatastoreValueIterator iter, void *closure)
 {
   int ret;
 
@@ -116,9 +116,9 @@
       GNUNET_EncName enc;
 
       IF_GELOG (coreAPI->ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER, GNUNET_hash_to_enc (query,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
GNUNET_hash_to_enc (query,
                                                                      &enc));
-      GE_LOG (coreAPI->ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Datastore availability pre-test failed for `%s'.\n", &enc);
 #endif
       if (stats != NULL)
@@ -134,16 +134,16 @@
 
 static int
 deleteCB (const GNUNET_HashCode * key,
-          const Datastore_Value * value, void *closure,
+          const GNUNET_DatastoreValue * value, void *closure,
           unsigned long long uid)
 {
-  const Datastore_Value *have = closure;
+  const GNUNET_DatastoreValue *have = closure;
   if (have == NULL)
     return GNUNET_NO;
   if ((value->size == have->size) &&
       (0 == memcmp (&have[1],
                     &value[1],
-                    ntohl (value->size) - sizeof (Datastore_Value))))
+                    ntohl (value->size) - sizeof (GNUNET_DatastoreValue))))
     return GNUNET_NO;
   return GNUNET_OK;
 }
@@ -152,7 +152,7 @@
  * Explicitly remove some content from the database.
  */
 static int
-del (const GNUNET_HashCode * query, const Datastore_Value * value)
+del (const GNUNET_HashCode * query, const GNUNET_DatastoreValue * value)
 {
   int ok;
   GNUNET_EncName enc;
@@ -160,9 +160,9 @@
   if (!testAvailable (query))
     {
       IF_GELOG (coreAPI->ectx,
-                GE_WARNING | GE_BULK | GE_USER, GNUNET_hash_to_enc (query,
+                GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER, 
GNUNET_hash_to_enc (query,
                                                                     &enc));
-      GE_LOG (coreAPI->ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
               _("Availability test failed for `%s' at %s:%d.\n"), &enc,
               __FILE__, __LINE__);
       return 0;
@@ -186,24 +186,24 @@
  *   other serious error (i.e. IO permission denied)
  */
 static int
-put (const GNUNET_HashCode * key, const Datastore_Value * value)
+put (const GNUNET_HashCode * key, const GNUNET_DatastoreValue * value)
 {
   int ok;
-  Datastore_Value *nvalue;
+  GNUNET_DatastoreValue *nvalue;
 
   /* check if we have enough space / priority */
   if (GNUNET_ntohll (value->expirationTime) < GNUNET_get_time ())
     {
-      GE_LOG (coreAPI->ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Received content for put already expired!\n");
       return GNUNET_NO;
     }
   if ((available < ntohl (value->size)) &&
       (minPriority > ntohl (value->prio) + comp_priority ()))
     {
-      GE_LOG (coreAPI->ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Datastore full (%llu/%llu) and content priority too low to kick 
out other content.  Refusing put.\n",
               sq->getSize (), quota);
       return GNUNET_NO;         /* new content has such a low priority that
@@ -229,21 +229,21 @@
 typedef struct
 {
   int exists;
-  const Datastore_Value *value;
+  const GNUNET_DatastoreValue *value;
   unsigned long long uid;
   unsigned long long expiration;
 } CE;
 
 static int
 checkExists (const GNUNET_HashCode * key,
-             const Datastore_Value * value, void *cls, unsigned long long uid)
+             const GNUNET_DatastoreValue * value, void *cls, unsigned long 
long uid)
 {
   CE *ce = cls;
 
   if ((value->size != ce->value->size) ||
       (0 != memcmp (&value[1],
                     &ce->value[1],
-                    ntohl (value->size) - sizeof (Datastore_Value))))
+                    ntohl (value->size) - sizeof (GNUNET_DatastoreValue))))
     return GNUNET_OK;           /* found another value, but different content! 
*/
   ce->uid = uid;
   ce->expiration = GNUNET_ntohll (value->expirationTime);
@@ -262,19 +262,19 @@
  *   other serious error (i.e. IO permission denied)
  */
 static int
-putUpdate (const GNUNET_HashCode * key, const Datastore_Value * value)
+putUpdate (const GNUNET_HashCode * key, const GNUNET_DatastoreValue * value)
 {
   CE cls;
   int ok;
   int comp_prio;
-  Datastore_Value *nvalue;
+  GNUNET_DatastoreValue *nvalue;
 
   /* check if it already exists... */
   cls.exists = GNUNET_NO;
   cls.value = value;
   sq->get (key, ntohl (value->type), &checkExists, &cls);
-  if (ntohl (value->type) == D_BLOCK)
-    sq->get (key, ONDEMAND_BLOCK, &checkExists, &cls);
+  if (ntohl (value->type) == GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA)
+    sq->get (key, GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND, &checkExists, &cls);
 
   if (cls.exists)
     {
@@ -290,8 +290,8 @@
     }
   comp_prio = comp_priority ();
 #if DEBUG_DATASTORE
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Migration: available %llu (need %u), min priority %u have %u\n",
           available, ntohl (value->size), minPriority,
           ntohl (value->prio) + comp_prio);
@@ -325,7 +325,7 @@
  */
 static int
 freeSpaceExpired (const GNUNET_HashCode * key,
-                  const Datastore_Value * value, void *closure,
+                  const GNUNET_DatastoreValue * value, void *closure,
                   unsigned long long uid)
 {
   if ((available > 0) && (available >= MIN_GNUNET_free))
@@ -338,7 +338,7 @@
 
 static int
 freeSpaceLow (const GNUNET_HashCode * key,
-              const Datastore_Value * value, void *closure,
+              const GNUNET_DatastoreValue * value, void *closure,
               unsigned long long uid)
 {
   if ((available > 0) && (available >= MIN_GNUNET_free))
@@ -360,9 +360,9 @@
   available = quota - sq->getSize ();
   if ((available < 0) || (available < MIN_GNUNET_free))
     {
-      sq->iterateExpirationTime (ANY_BLOCK, &freeSpaceExpired, NULL);
+      sq->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, 
&freeSpaceExpired, NULL);
       if ((available < 0) || (available < MIN_GNUNET_free))
-        sq->iterateLowPriority (ANY_BLOCK, &freeSpaceLow, NULL);
+        sq->iterateLowPriority (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, 
&freeSpaceLow, NULL);
     }
   else
     {
@@ -373,24 +373,24 @@
 /**
  * Initialize the manager-module.
  */
-Datastore_ServiceAPI *
-provide_module_datastore (CoreAPIForApplication * capi)
+GNUNET_Datastore_ServiceAPI *
+provide_module_datastore (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Datastore_ServiceAPI api;
+  static GNUNET_Datastore_ServiceAPI api;
   unsigned long long lquota;
   unsigned long long sqot;
-  State_ServiceAPI *state;
+  GNUNET_State_ServiceAPI *state;
   struct stat sbuf;
   char *fsdir;
 
-  if (-1 == GC_get_configuration_value_number (capi->cfg,
+  if (-1 == GNUNET_GC_get_configuration_value_number (capi->cfg,
                                                "FS",
                                                "QUOTA",
                                                0,
                                                ((unsigned long long) -1) /
                                                1024 / 1024, 1024, &lquota))
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       return NULL;              /* OOPS */
     }
   quota = lquota * 1024 * 1024; /* MB to bytes */
@@ -416,8 +416,8 @@
     }
   else
     {
-      GE_LOG (capi->ectx,
-              GE_USER | GE_ADMIN | GE_ERROR | GE_BULK,
+      GNUNET_GE_LOG (capi->ectx,
+              GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_ERROR | 
GNUNET_GE_BULK,
               _("Failed to load state service. Trying to do without.\n"));
     }
   sq = capi->requestService ("sqstore");
@@ -428,14 +428,14 @@
           capi->releaseService (stats);
           stats = NULL;
         }
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       return NULL;
     }
   coreAPI = capi;
   initPrefetch (capi->ectx, capi->cfg, sq);
   if (GNUNET_OK != initFilters (capi->ectx, capi->cfg))
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       donePrefetch ();
       capi->releaseService (sq);
       if (stats != NULL)
@@ -446,10 +446,10 @@
       return NULL;
     }
   fsdir = NULL;
-  GC_get_configuration_value_filename (capi->cfg,
+  GNUNET_GC_get_configuration_value_filename (capi->cfg,
                                        "FS",
                                        "DIR",
-                                       VAR_DAEMON_DIRECTORY "/data/fs/",
+                                       GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY 
"/data/fs/",
                                        &fsdir);
   /* just in case dir does not exist ... */
   GNUNET_disk_directory_create (NULL, fsdir);
@@ -503,7 +503,7 @@
  */
 static int
 filterAddAll (const GNUNET_HashCode * key,
-              const Datastore_Value * value, void *closure,
+              const GNUNET_DatastoreValue * value, void *closure,
               unsigned long long uid)
 {
   makeAvailable (key);
@@ -516,14 +516,14 @@
  * different sqstore's here, too.
  */
 void
-update_module_datastore (UpdateAPI * uapi)
+update_module_datastore (GNUNET_UpdateAPI * uapi)
 {
   unsigned long long quota;
   unsigned long long lastQuota;
   unsigned long long *lq;
-  State_ServiceAPI *state;
+  GNUNET_State_ServiceAPI *state;
 
-  if (-1 == GC_get_configuration_value_number (uapi->cfg,
+  if (-1 == GNUNET_GC_get_configuration_value_number (uapi->cfg,
                                                "FS",
                                                "QUOTA",
                                                0,
@@ -554,8 +554,8 @@
     }
   else
     {
-      GE_LOG (uapi->ectx,
-              GE_USER | GE_ADMIN | GE_ERROR | GE_BULK,
+      GNUNET_GE_LOG (uapi->ectx,
+              GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_ERROR | 
GNUNET_GE_BULK,
               _
               ("Failed to load sqstore service.  Check your 
configuration!\n"));
     }

Modified: GNUnet/src/applications/datastore/filter.c
===================================================================
--- GNUnet/src/applications/datastore/filter.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/datastore/filter.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -36,16 +36,16 @@
 static struct GNUNET_BloomFilter *filter;
 
 static char *
-getFilterName (struct GE_Context *ectx, struct GC_Configuration *cfg)
+getFilterName (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration 
*cfg)
 {
   char *fn;
   char *bf;
 
   fn = NULL;
-  if (-1 == GC_get_configuration_value_filename (cfg,
+  if (-1 == GNUNET_GC_get_configuration_value_filename (cfg,
                                                  "FS",
                                                  "DIR",
-                                                 VAR_DAEMON_DIRECTORY "/fs",
+                                                 
GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY "/fs",
                                                  &fn))
     return NULL;
   if (GNUNET_OK != GNUNET_disk_directory_create (ectx, fn))
@@ -61,13 +61,13 @@
 }
 
 int
-initFilters (struct GE_Context *ectx, struct GC_Configuration *cfg)
+initFilters (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration 
*cfg)
 {
   char *bf;
   unsigned long long quota;     /* in kb */
   unsigned int bf_size;
 
-  if (-1 == GC_get_configuration_value_number (cfg,
+  if (-1 == GNUNET_GC_get_configuration_value_number (cfg,
                                                "FS",
                                                "QUOTA",
                                                0,
@@ -94,11 +94,11 @@
 }
 
 void
-deleteFilter (struct GE_Context *ectx, struct GC_Configuration *cfg)
+deleteFilter (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration 
*cfg)
 {
   char *fn;
 
-  GE_ASSERT (ectx, filter == NULL);
+  GNUNET_GE_ASSERT (ectx, filter == NULL);
   fn = getFilterName (ectx, cfg);
   UNLINK (fn);
   GNUNET_free (fn);

Modified: GNUnet/src/applications/datastore/filter.h
===================================================================
--- GNUnet/src/applications/datastore/filter.h  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/datastore/filter.h  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -28,11 +28,11 @@
 
 #include "gnunet_util.h"
 
-int initFilters (struct GE_Context *ectx, struct GC_Configuration *cfg);
+int initFilters (struct GNUNET_GE_Context *ectx, struct 
GNUNET_GC_Configuration *cfg);
 
 void doneFilters (void);
 
-void deleteFilter (struct GE_Context *ectx, struct GC_Configuration *cfg);
+void deleteFilter (struct GNUNET_GE_Context *ectx, struct 
GNUNET_GC_Configuration *cfg);
 
 void makeAvailable (const GNUNET_HashCode * key);
 

Modified: GNUnet/src/applications/datastore/prefetch.c
===================================================================
--- GNUnet/src/applications/datastore/prefetch.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/datastore/prefetch.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -33,12 +33,12 @@
 
 static GNUNET_HashCode rkey;
 
-static Datastore_Value *rvalue;
+static GNUNET_DatastoreValue *rvalue;
 
 /**
  * SQ-store handle
  */
-static SQstore_ServiceAPI *sq;
+static GNUNET_SQstore_ServiceAPI *sq;
 
 /**
  * Semaphore on which the RCB acquire thread waits
@@ -58,14 +58,14 @@
 
 static struct GNUNET_ThreadHandle *gather_thread;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 
 static int
 acquire (const GNUNET_HashCode * key,
-         const Datastore_Value * value, void *closure, unsigned long long uid)
+         const GNUNET_DatastoreValue * value, void *closure, unsigned long 
long uid)
 {
   if (doneSignal)
     return GNUNET_SYSERR;
@@ -73,7 +73,7 @@
   if (doneSignal)
     return GNUNET_SYSERR;
   GNUNET_mutex_lock (lock);
-  GE_ASSERT (NULL, rvalue == NULL);
+  GNUNET_GE_ASSERT (NULL, rvalue == NULL);
   rkey = *key;
   rvalue = GNUNET_malloc (ntohl (value->size));
   memcpy (rvalue, value, ntohl (value->size));
@@ -113,7 +113,7 @@
  * @return GNUNET_SYSERR if the RCB is empty
  */
 int
-getRandom (GNUNET_HashCode * key, Datastore_Value ** value)
+getRandom (GNUNET_HashCode * key, GNUNET_DatastoreValue ** value)
 {
   GNUNET_mutex_lock (lock);
   if (rvalue == NULL)
@@ -130,8 +130,8 @@
 }
 
 void
-initPrefetch (struct GE_Context *e,
-              struct GC_Configuration *c, SQstore_ServiceAPI * s)
+initPrefetch (struct GNUNET_GE_Context *e,
+              struct GNUNET_GC_Configuration *c, GNUNET_SQstore_ServiceAPI * s)
 {
   ectx = e;
   cfg = c;
@@ -141,8 +141,8 @@
   lock = GNUNET_mutex_create (GNUNET_NO);
   gather_thread = GNUNET_thread_create (&rcbAcquire, NULL, 64 * 1024);
   if (gather_thread == NULL)
-    GE_LOG_STRERROR (ectx,
-                     GE_ERROR | GE_ADMIN | GE_USER | GE_IMMEDIATE,
+    GNUNET_GE_LOG_STRERROR (ectx,
+                     GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_IMMEDIATE,
                      "pthread_create");
 }
 

Modified: GNUnet/src/applications/datastore/prefetch.h
===================================================================
--- GNUnet/src/applications/datastore/prefetch.h        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/datastore/prefetch.h        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -33,8 +33,8 @@
 /**
  * Initialize the migration module.
  */
-void initPrefetch (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg, SQstore_ServiceAPI * sq);
+void initPrefetch (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg, 
GNUNET_SQstore_ServiceAPI * sq);
 
 void donePrefetch (void);
 
@@ -47,7 +47,7 @@
  *        for any type.
  * @return GNUNET_OK if a value was found, GNUNET_SYSERR if not
  */
-int getRandom (GNUNET_HashCode * key, Datastore_Value ** value);
+int getRandom (GNUNET_HashCode * key, GNUNET_DatastoreValue ** value);
 
 
 /* end of prefetch.h */

Modified: GNUnet/src/applications/dht/module/cs.c
===================================================================
--- GNUnet/src/applications/dht/module/cs.c     2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/module/cs.c     2007-11-25 12:04:45 UTC (rev 
5755)
@@ -38,19 +38,19 @@
 /**
  * Global core API.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * Reference to the DHT service API.
  */
-static DHT_ServiceAPI *dhtAPI;
+static GNUNET_DHT_ServiceAPI *dhtAPI;
 
 typedef struct
 {
 
-  struct ClientHandle *client;
+  struct GNUNET_ClientHandle *client;
 
-  struct DHT_GET_RECORD *get_record;
+  struct GNUNET_DHT_GetHandle *get_record;
 
 } DHT_CLIENT_GET_RECORD;
 
@@ -67,22 +67,22 @@
  * CS handler for inserting <key,value>-pair into DHT-table.
  */
 static int
-csPut (struct ClientHandle *client, const GNUNET_MessageHeader * message)
+csPut (struct GNUNET_ClientHandle *client, const GNUNET_MessageHeader * 
message)
 {
   const CS_dht_request_put_MESSAGE *req;
   unsigned int size;
 
   if (ntohs (message->size) < sizeof (CS_dht_request_put_MESSAGE))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   req = (const CS_dht_request_put_MESSAGE *) message;
   size = ntohs (req->header.size) - sizeof (CS_dht_request_put_MESSAGE);
-  GE_ASSERT (NULL, size < GNUNET_MAX_BUFFER_SIZE);
+  GNUNET_GE_ASSERT (NULL, size < GNUNET_MAX_BUFFER_SIZE);
 #if DEBUG_CS
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' at %s:%d processes put '%.*s'\n",
           __FUNCTION__, __FILE__, __LINE__, size, &req[1]);
 #endif
@@ -92,41 +92,41 @@
 }
 
 int
-get_result (const GNUNET_HashCode * key, const DataContainer * value,
+get_result (const GNUNET_HashCode * key, const GNUNET_DataContainer * value,
             void *cls)
 {
   DHT_CLIENT_GET_RECORD *record = cls;
   CS_dht_request_put_MESSAGE *msg;
   size_t n;
 
-  GE_ASSERT (NULL, ntohl (value->size) >= sizeof (DataContainer));
+  GNUNET_GE_ASSERT (NULL, ntohl (value->size) >= sizeof 
(GNUNET_DataContainer));
   n =
     sizeof (CS_dht_request_put_MESSAGE) + ntohl (value->size) -
-    sizeof (DataContainer);
+    sizeof (GNUNET_DataContainer);
   if (n > GNUNET_MAX_BUFFER_SIZE)
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   msg = GNUNET_malloc (n);
   msg->header.size = htons (n);
-  msg->header.type = htons (CS_PROTO_dht_REQUEST_PUT);
+  msg->header.type = htons (GNUNET_CS_PROTO_DHT_REQUEST_PUT);
   msg->expire = 0;              /* unknown */
   msg->key = *key;
-  memcpy (&msg[1], &value[1], ntohl (value->size) - sizeof (DataContainer));
+  memcpy (&msg[1], &value[1], ntohl (value->size) - sizeof 
(GNUNET_DataContainer));
 #if DEBUG_CS
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' at %s:%d processes reply '%.*s'\n",
           __FUNCTION__,
           __FILE__,
-          __LINE__, ntohl (value->size) - sizeof (DataContainer), &value[1]);
+          __LINE__, ntohl (value->size) - sizeof (GNUNET_DataContainer), 
&value[1]);
 #endif
   if (GNUNET_OK !=
       coreAPI->sendToClient (record->client, &msg->header, GNUNET_YES))
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_IMMEDIATE | GE_USER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_IMMEDIATE | GNUNET_GE_USER,
               _("`%s' failed. Terminating connection to client.\n"),
               "sendToClient");
       coreAPI->terminateClientConnection (record->client);
@@ -164,19 +164,19 @@
  * CS handler for inserting <key,value>-pair into DHT-table.
  */
 static int
-csGet (struct ClientHandle *client, const GNUNET_MessageHeader * message)
+csGet (struct GNUNET_ClientHandle *client, const GNUNET_MessageHeader * 
message)
 {
   const CS_dht_request_get_MESSAGE *get;
   DHT_CLIENT_GET_RECORD *cpc;
 
   if (ntohs (message->size) != sizeof (CS_dht_request_get_MESSAGE))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
 #if DEBUG_CS
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' at %s:%d processes get\n", __FUNCTION__, __FILE__, __LINE__);
 #endif
   get = (const CS_dht_request_get_MESSAGE *) message;
@@ -197,10 +197,10 @@
  * get_stop for all operations that rely on this client.
  */
 static void
-csClientExit (struct ClientHandle *client)
+csClientExit (struct GNUNET_ClientHandle *client)
 {
   int i;
-  struct DHT_GET_RECORD *gr;
+  struct GNUNET_DHT_GetHandle *gr;
   DHT_CLIENT_GET_RECORD *cgr;
   GNUNET_mutex_lock (lock);
   for (i = 0; i < getRecordsSize; i++)
@@ -222,7 +222,7 @@
 }
 
 int
-initialize_module_dht (CoreAPIForApplication * capi)
+initialize_module_dht (GNUNET_CoreAPIForPlugins * capi)
 {
   int status;
 
@@ -230,22 +230,22 @@
   if (dhtAPI == NULL)
     return GNUNET_SYSERR;
   coreAPI = capi;
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering client handlers: %d %d\n"),
-          "dht", CS_PROTO_dht_REQUEST_PUT, CS_PROTO_dht_REQUEST_GET);
+          "dht", GNUNET_CS_PROTO_DHT_REQUEST_PUT, 
GNUNET_CS_PROTO_DHT_REQUEST_GET);
   status = GNUNET_OK;
   lock = GNUNET_mutex_create (GNUNET_NO);
-  if (GNUNET_SYSERR == capi->registerClientHandler (CS_PROTO_dht_REQUEST_PUT,
+  if (GNUNET_SYSERR == capi->registerClientHandler 
(GNUNET_CS_PROTO_DHT_REQUEST_PUT,
                                                     &csPut))
     status = GNUNET_SYSERR;
-  if (GNUNET_SYSERR == capi->registerClientHandler (CS_PROTO_dht_REQUEST_GET,
+  if (GNUNET_SYSERR == capi->registerClientHandler 
(GNUNET_CS_PROTO_DHT_REQUEST_GET,
                                                     &csGet))
     status = GNUNET_SYSERR;
   if (GNUNET_SYSERR == capi->registerClientExitHandler (&csClientExit))
     status = GNUNET_SYSERR;
-  GE_ASSERT (capi->ectx,
-             0 == GC_set_configuration_value_string (capi->cfg,
+  GNUNET_GE_ASSERT (capi->ectx,
+             0 == GNUNET_GC_set_configuration_value_string (capi->cfg,
                                                      capi->ectx,
                                                      "ABOUT",
                                                      "dht",
@@ -263,11 +263,11 @@
   int status;
 
   status = GNUNET_OK;
-  GE_LOG (coreAPI->ectx, GE_DEBUG | GE_REQUEST | GE_USER, "DHT: shutdown\n");
-  if (GNUNET_OK != coreAPI->unregisterClientHandler (CS_PROTO_dht_REQUEST_PUT,
+  GNUNET_GE_LOG (coreAPI->ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER, "DHT: shutdown\n");
+  if (GNUNET_OK != coreAPI->unregisterClientHandler 
(GNUNET_CS_PROTO_DHT_REQUEST_PUT,
                                                      &csPut))
     status = GNUNET_SYSERR;
-  if (GNUNET_OK != coreAPI->unregisterClientHandler (CS_PROTO_dht_REQUEST_GET,
+  if (GNUNET_OK != coreAPI->unregisterClientHandler 
(GNUNET_CS_PROTO_DHT_REQUEST_GET,
                                                      &csGet))
     status = GNUNET_SYSERR;
   if (GNUNET_OK != coreAPI->unregisterClientExitHandler (&csClientExit))

Modified: GNUnet/src/applications/dht/module/dstore.c
===================================================================
--- GNUnet/src/applications/dht/module/dstore.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/module/dstore.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -30,9 +30,9 @@
 
 #define DEBUG_DSTORE GNUNET_NO
 
-static Dstore_ServiceAPI *dstore;
+static GNUNET_Dstore_ServiceAPI *dstore;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * Lookup in the local datastore.
@@ -40,7 +40,7 @@
  */
 int
 dht_store_get (const GNUNET_HashCode * key,
-               unsigned int type, ResultHandler handler, void *cls)
+               unsigned int type, GNUNET_ResultProcessor handler, void *cls)
 {
   return dstore->get (key, type, handler, cls);
 }
@@ -57,8 +57,8 @@
   if (discard_time < GNUNET_get_time ())
     {
 #if DEBUG_DSTORE
-      GE_LOG (coreAPI->ectx,
-              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
               "Content already expired (%llu < %llu), will not keep.\n",
               discard_time, GNUNET_get_time ());
 #endif
@@ -74,7 +74,7 @@
  * @return GNUNET_OK on success
  */
 int
-init_dht_store (size_t max_size, CoreAPIForApplication * capi)
+init_dht_store (size_t max_size, GNUNET_CoreAPIForPlugins * capi)
 {
   coreAPI = capi;
   dstore = coreAPI->requestService ("dstore");

Modified: GNUnet/src/applications/dht/module/dstore.h
===================================================================
--- GNUnet/src/applications/dht/module/dstore.h 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/module/dstore.h 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -35,7 +35,7 @@
  * @return total number of results found
  */
 int dht_store_get (const GNUNET_HashCode * key,
-                   unsigned int type, ResultHandler handler, void *cls);
+                   unsigned int type, GNUNET_ResultProcessor handler, void 
*cls);
 
 /**
  * Store the given data in the local datastore.
@@ -51,7 +51,7 @@
  * @param capi the core API
  * @return GNUNET_OK on success
  */
-int init_dht_store (size_t max_size, CoreAPIForApplication * capi);
+int init_dht_store (size_t max_size, GNUNET_CoreAPIForPlugins * capi);
 
 /**
  * Shutdown dstore DHT component.

Modified: GNUnet/src/applications/dht/module/routing.c
===================================================================
--- GNUnet/src/applications/dht/module/routing.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/dht/module/routing.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -60,7 +60,7 @@
    * If local peer is NOT interested in results, this callback
    * will be NULL.
    */
-  ResultHandler receiver;
+  GNUNET_ResultProcessor receiver;
 
   void *receiver_closure;
 
@@ -198,11 +198,11 @@
 /**
  * Statistics service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static struct GNUNET_Mutex *lock;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static unsigned int stat_replies_routed;
 
@@ -241,7 +241,7 @@
     {
       result = GNUNET_malloc (sizeof (DHT_RESULT_MESSAGE) + size);
       result->header.size = htons (sizeof (DHT_RESULT_MESSAGE) + size);
-      result->header.type = htons (P2P_PROTO_DHT_RESULT);
+      result->header.type = htons (GNUNET_P2P_PROTO_DHT_RESULT);
       result->type = htonl (type);
       result->key = *key;
       memcpy (&result[1], data, size);
@@ -278,8 +278,8 @@
                            coreAPI->myIdentity, sizeof (GNUNET_PeerIdentity)))
             {
 #if DEBUG_ROUTING
-              GE_LOG (coreAPI->ectx,
-                      GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+              GNUNET_GE_LOG (coreAPI->ectx,
+                      GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_DEVELOPER,
                       "Routing result to other peer\n");
 #endif
               coreAPI->unicast (&pos->source, &result->header, 0,       /* 
FIXME: priority */
@@ -290,8 +290,8 @@
           else if (pos->receiver != NULL)
             {
 #if DEBUG_ROUTING
-              GE_LOG (coreAPI->ectx,
-                      GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+              GNUNET_GE_LOG (coreAPI->ectx,
+                      GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_DEVELOPER,
                       "Routing result to local client\n");
 #endif
               pos->receiver (key, type, size, data, pos->receiver_closure);
@@ -303,8 +303,8 @@
     }
   GNUNET_mutex_unlock (lock);
 #if DEBUG_ROUTING
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Routed result to %u out of %u pending requests\n",
           routed, tracked);
 #endif
@@ -317,7 +317,7 @@
  */
 static int
 addRoute (const GNUNET_PeerIdentity * sender,
-          ResultHandler handler, void *cls, const DHT_GET_MESSAGE * get)
+          GNUNET_ResultProcessor handler, void *cls, const DHT_GET_MESSAGE * 
get)
 {
   DHTQueryRecord *q;
   unsigned int i;
@@ -398,8 +398,8 @@
   pos->receiver = handler;
   pos->receiver_closure = cls;
 #if DEBUG_ROUTING
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Tracking request in slot %u\n", rt_pos);
 #endif
   rt_pos = (rt_pos + 1) % rt_size;
@@ -435,14 +435,14 @@
 
   if (ntohs (msg->size) != sizeof (DHT_GET_MESSAGE))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   get = (const DHT_GET_MESSAGE *) msg;
 #if DEBUG_ROUTING
   GNUNET_hash_to_enc (&get->key, &enc);
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Received DHT GET for key `%s'.\n", &enc);
 #endif
   if (stats != NULL)
@@ -453,8 +453,8 @@
   if ((total > GET_TRIES) && (sender != NULL))
     {
 #if DEBUG_ROUTING
-      GE_LOG (coreAPI->ectx,
-              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
               "Found %d results locally, will not route GET any further\n",
               total);
 #endif
@@ -512,7 +512,7 @@
 
   if (ntohs (msg->size) < sizeof (DHT_PUT_MESSAGE))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   if (stats != NULL)
@@ -520,8 +520,8 @@
   put = (const DHT_PUT_MESSAGE *) msg;
 #if DEBUG_ROUTING
   GNUNET_hash_to_enc (&put->key, &enc);
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Received DHT PUT for key `%s'.\n", &enc);
 #endif
   store = 0;
@@ -544,8 +544,8 @@
     {
       now = GNUNET_get_time ();
 #if DEBUG_ROUTING
-      GE_LOG (coreAPI->ectx,
-              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
               "Decided to cache data `%.*s' locally until %llu (for %llu 
ms)\n",
               ntohs (put->header.size) - sizeof (DHT_PUT_MESSAGE),
               &put[1], GNUNET_ntohll (put->timeout) + now,
@@ -560,8 +560,8 @@
   else
     {
 #if DEBUG_ROUTING
-      GE_LOG (coreAPI->ectx,
-              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
               "Decided NOT to cache data `%.*s' locally\n",
               ntohs (put->header.size) - sizeof (DHT_PUT_MESSAGE), &put[1]);
 #endif
@@ -583,7 +583,7 @@
 
   if (ntohs (msg->size) < sizeof (DHT_RESULT_MESSAGE))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   if (stats != NULL)
@@ -591,8 +591,8 @@
   result = (const DHT_RESULT_MESSAGE *) msg;
 #if DEBUG_ROUTING
   GNUNET_hash_to_enc (&result->key, &enc);
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Received DHT RESULT for key `%s'.\n", &enc);
 #endif
   routeResult (&result->key,
@@ -607,12 +607,12 @@
  */
 void
 dht_get_start (const GNUNET_HashCode * key,
-               unsigned int type, ResultHandler handler, void *cls)
+               unsigned int type, GNUNET_ResultProcessor handler, void *cls)
 {
   DHT_GET_MESSAGE get;
 
   get.header.size = htons (sizeof (DHT_GET_MESSAGE));
-  get.header.type = htons (P2P_PROTO_DHT_GET);
+  get.header.type = htons (GNUNET_P2P_PROTO_DHT_GET);
   get.type = htonl (type);
   get.prio = htonl (0);         /* FIXME */
   get.ttl = htonl (MAX_TTL);    /* FIXME? */
@@ -627,7 +627,7 @@
  */
 void
 dht_get_stop (const GNUNET_HashCode * key,
-              unsigned int type, ResultHandler handler, void *cls)
+              unsigned int type, GNUNET_ResultProcessor handler, void *cls)
 {
   int i;
   struct DHT_Source_Route *pos;
@@ -690,7 +690,7 @@
 
   put = GNUNET_malloc (sizeof (DHT_PUT_MESSAGE) + size);
   put->header.size = htons (sizeof (DHT_PUT_MESSAGE) + size);
-  put->header.type = htons (P2P_PROTO_DHT_PUT);
+  put->header.type = htons (GNUNET_P2P_PROTO_DHT_PUT);
   put->key = *key;
   put->type = htonl (type);
   put->timeout = GNUNET_htonll (expirationTime - GNUNET_get_time ());   /* 
convert to relative time */
@@ -721,13 +721,13 @@
  * @return GNUNET_OK on success
  */
 int
-init_dht_routing (CoreAPIForApplication * capi)
+init_dht_routing (GNUNET_CoreAPIForPlugins * capi)
 {
   unsigned long long rts;
 
   coreAPI = capi;
   rts = 65536;
-  GC_get_configuration_value_number (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_number (coreAPI->cfg,
                                      "DHT",
                                      "TABLESIZE",
                                      128, 1024 * 1024, 1024, &rts);
@@ -747,13 +747,13 @@
       stat_results_received =
         stats->create (gettext_noop ("# dht results received"));
     }
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering p2p handlers: %d %d %d\n"),
-          "dht", P2P_PROTO_DHT_GET, P2P_PROTO_DHT_PUT, P2P_PROTO_DHT_RESULT);
-  coreAPI->registerHandler (P2P_PROTO_DHT_GET, &handleGet);
-  coreAPI->registerHandler (P2P_PROTO_DHT_PUT, &handlePut);
-  coreAPI->registerHandler (P2P_PROTO_DHT_RESULT, &handleResult);
+          "dht", GNUNET_P2P_PROTO_DHT_GET, GNUNET_P2P_PROTO_DHT_PUT, 
GNUNET_P2P_PROTO_DHT_RESULT);
+  coreAPI->registerHandler (GNUNET_P2P_PROTO_DHT_GET, &handleGet);
+  coreAPI->registerHandler (GNUNET_P2P_PROTO_DHT_PUT, &handlePut);
+  coreAPI->registerHandler (GNUNET_P2P_PROTO_DHT_RESULT, &handleResult);
   coreAPI->registerSendCallback (sizeof (DHT_GET_MESSAGE),
                                  &extra_get_callback);
   return GNUNET_OK;
@@ -771,9 +771,9 @@
 
   coreAPI->unregisterSendCallback (sizeof (DHT_GET_MESSAGE),
                                    &extra_get_callback);
-  coreAPI->unregisterHandler (P2P_PROTO_DHT_GET, &handleGet);
-  coreAPI->unregisterHandler (P2P_PROTO_DHT_PUT, &handlePut);
-  coreAPI->unregisterHandler (P2P_PROTO_DHT_RESULT, &handleResult);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_DHT_GET, &handleGet);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_DHT_PUT, &handlePut);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_DHT_RESULT, &handleResult);
   if (stats != NULL)
     {
       coreAPI->releaseService (stats);

Modified: GNUnet/src/applications/dht/module/routing.h
===================================================================
--- GNUnet/src/applications/dht/module/routing.h        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/dht/module/routing.h        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -36,14 +36,14 @@
  * Start a DHT get operation.
  */
 void dht_get_start (const GNUNET_HashCode * key,
-                    unsigned int type, ResultHandler handler, void *cls);
+                    unsigned int type, GNUNET_ResultProcessor handler, void 
*cls);
 
 /**
  * Stop a DHT get operation (prevents calls to
  * the given iterator).
  */
 void dht_get_stop (const GNUNET_HashCode * key,
-                   unsigned int type, ResultHandler handler, void *cls);
+                   unsigned int type, GNUNET_ResultProcessor handler, void 
*cls);
 
 /**
  * Perform a DHT put operation.  Note that PUT operations always
@@ -65,7 +65,7 @@
  * @param capi the core API
  * @return GNUNET_OK on success
  */
-int init_dht_routing (CoreAPIForApplication * capi);
+int init_dht_routing (GNUNET_CoreAPIForPlugins * capi);
 
 /**
  * Shutdown routing DHT component.

Modified: GNUnet/src/applications/dht/module/service.c
===================================================================
--- GNUnet/src/applications/dht/module/service.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/dht/module/service.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,11 +34,11 @@
 /**
  * Global core API.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static struct GNUNET_CronManager *cron;
 
-typedef struct DHT_GET_RECORD
+typedef struct GNUNET_DHT_GetHandle
 {
   /**
    * Key that we are looking for.
@@ -48,7 +48,7 @@
   /**
    * Function to call for each result.
    */
-  DataProcessor callback;
+  GNUNET_DataProcessor callback;
 
   /**
    * Extra argument to callback.
@@ -58,7 +58,7 @@
   /**
    * Function to call once we are done
    */
-  DHT_OP_Complete callbackComplete;
+  GNUNET_DHT_OperationCompleteCallback callbackComplete;
 
   /**
    * Extra argument to callbackComplete
@@ -77,11 +77,11 @@
                          unsigned int type,
                          unsigned int size, const char *data, void *cls)
 {
-  struct DHT_GET_RECORD *get = cls;
-  DataContainer *dc;
+  struct GNUNET_DHT_GetHandle *get = cls;
+  GNUNET_DataContainer *dc;
 
-  dc = GNUNET_malloc (sizeof (DataContainer) + size);
-  dc->size = ntohl (sizeof (DataContainer) + size);
+  dc = GNUNET_malloc (sizeof (GNUNET_DataContainer) + size);
+  dc->size = ntohl (sizeof (GNUNET_DataContainer) + size);
   memcpy (&dc[1], data, size);
   get->callback (key, dc, get->cls);
   GNUNET_free (dc);
@@ -93,7 +93,7 @@
 static void
 timeout_callback (void *cls)
 {
-  struct DHT_GET_RECORD *rec = cls;
+  struct GNUNET_DHT_GetHandle *rec = cls;
 
   rec->callbackComplete (rec->closure);
 }
@@ -116,15 +116,15 @@
  *        (but not on explicit async_stop).
  * @return handle to stop the async get
  */
-static struct DHT_GET_RECORD *
+static struct GNUNET_DHT_GetHandle *
 dht_get_async_start (unsigned int type,
                      const GNUNET_HashCode * key,
                      GNUNET_CronTime timeout,
-                     DataProcessor callback,
+                     GNUNET_DataProcessor callback,
                      void *cls,
-                     DHT_OP_Complete callbackComplete, void *closure)
+                     GNUNET_DHT_OperationCompleteCallback callbackComplete, 
void *closure)
 {
-  struct DHT_GET_RECORD *ret;
+  struct GNUNET_DHT_GetHandle *ret;
 
   ret = GNUNET_malloc (sizeof (DHT_GET_RECORD));
   ret->key = *key;
@@ -142,7 +142,7 @@
  * Stop async DHT-get.  Frees associated resources.
  */
 static int
-dht_get_async_stop (struct DHT_GET_RECORD *record)
+dht_get_async_stop (struct GNUNET_DHT_GetHandle *record)
 {
   GNUNET_cron_suspend_jobs (cron, GNUNET_YES);
   GNUNET_cron_del_job (cron, &timeout_callback, 0, record);
@@ -159,27 +159,27 @@
  * @param capi the core API
  * @return NULL on errors, DHT_API otherwise
  */
-DHT_ServiceAPI *
-provide_module_dht (CoreAPIForApplication * capi)
+GNUNET_DHT_ServiceAPI *
+provide_module_dht (GNUNET_CoreAPIForPlugins * capi)
 {
-  static DHT_ServiceAPI api;
+  static GNUNET_DHT_ServiceAPI api;
 
   cron = cron_create (capi->ectx);
   GNUNET_cron_start (cron);
   if (GNUNET_OK != init_dht_store (1024 * 1024, capi))
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       return NULL;
     }
   if (GNUNET_OK != init_dht_table (capi))
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       done_dht_store ();
       return NULL;
     }
   if (GNUNET_OK != init_dht_routing (capi))
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       done_dht_table ();
       done_dht_store ();
       return NULL;

Modified: GNUnet/src/applications/dht/module/table.c
===================================================================
--- GNUnet/src/applications/dht/module/table.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/module/table.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -150,7 +150,7 @@
 /**
  * Global core API.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * The buckets (Kademlia style routing table).
@@ -175,17 +175,17 @@
 /**
  * Identity service.
  */
-static Identity_ServiceAPI *identity;
+static GNUNET_Identity_ServiceAPI *identity;
 
 /**
  * Statistics service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 /**
  * Pingpong service.
  */
-static Pingpong_ServiceAPI *pingpong;
+static GNUNET_Pingpong_ServiceAPI *pingpong;
 
 static int stat_dht_total_peers;
 
@@ -403,7 +403,7 @@
           selected -= distance;
         }
     }
-  GE_BREAK (NULL, 0);
+  GNUNET_GE_BREAK (NULL, 0);
   GNUNET_mutex_unlock (lock);
   return GNUNET_SYSERR;
 }
@@ -427,7 +427,7 @@
     {
       coreAPI->unicast (other,
                         &disco->header,
-                        EXTREME_PRIORITY / 4,
+                        GNUNET_EXTREME_PRIORITY / 4,
                         MAINTAIN_FREQUENCY * MAINTAIN_CHANCE / 2);
       return;
     }
@@ -439,7 +439,7 @@
   disco =
     GNUNET_malloc (pc * sizeof (GNUNET_PeerIdentity) +
                    sizeof (P2P_DHT_Discovery));
-  disco->header.type = htons (P2P_PROTO_DHT_DISCOVERY);
+  disco->header.type = htons (GNUNET_P2P_PROTO_DHT_DISCOVERY);
   disco->space_available = -1;  /* FIXME */
   pos = (GNUNET_PeerIdentity *) & disco[1];
   i = 0;
@@ -483,7 +483,7 @@
   if (total_peers == 0)
     {
       disc.header.size = htons (sizeof (P2P_DHT_Discovery));
-      disc.header.type = htons (P2P_PROTO_DHT_DISCOVERY);
+      disc.header.type = htons (GNUNET_P2P_PROTO_DHT_DISCOVERY);
       disc.space_available = -1;        /* FIXME */
       coreAPI->forAllConnectedNodes (&broadcast_dht_discovery_prob, &disc);
     }
@@ -599,12 +599,12 @@
   if (NULL != findPeerEntryInBucket (bucket, peer))
     return;                     /* already have this peer in buckets */
   /* do we know how to contact this peer? */
-  hello = identity->identity2Hello (peer, ANY_PROTOCOL_NUMBER, GNUNET_NO);
+  hello = identity->identity2Hello (peer, 
GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY, GNUNET_NO);
   if (hello == NULL)
     {
       /* if identity not known, ask sender for HELLO of other peer */
       ask.header.size = htons (sizeof (P2P_DHT_ASK_HELLO));
-      ask.header.type = htons (sizeof (P2P_PROTO_DHT_ASK_HELLO));
+      ask.header.type = htons (sizeof (GNUNET_P2P_PROTO_DHT_ASK_HELLO));
       ask.reserved = 0;
       ask.peer = *peer;
       coreAPI->unicast (sender, &ask.header, 0, /* FIXME: priority */
@@ -649,13 +649,13 @@
      sizeof (P2P_DHT_Discovery)) / sizeof (GNUNET_PeerIdentity);
   if (pc > MAINTAIN_ADV_CAP * 8)
     {
-      GE_BREAK (coreAPI->ectx, 0);
+      GNUNET_GE_BREAK (coreAPI->ectx, 0);
       return GNUNET_SYSERR;     /* far too big */
     }
   if (ntohs (msg->size) !=
       sizeof (P2P_DHT_Discovery) + pc * sizeof (GNUNET_PeerIdentity))
     {
-      GE_BREAK (coreAPI->ectx, 0);
+      GNUNET_GE_BREAK (coreAPI->ectx, 0);
       return GNUNET_SYSERR;     /* malformed */
     }
   disco = (const P2P_DHT_Discovery *) msg;
@@ -691,7 +691,7 @@
   if (NULL == findBucketFor (&ask->peer))
     return GNUNET_OK;
   hello =
-    identity->identity2Hello (&ask->peer, ANY_PROTOCOL_NUMBER, GNUNET_NO);
+    identity->identity2Hello (&ask->peer, 
GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY, GNUNET_NO);
   if (hello == NULL)
     return GNUNET_OK;
   coreAPI->unicast (sender, &hello->header, 0, 5 * GNUNET_CRON_SECONDS);
@@ -706,7 +706,7 @@
  * @return GNUNET_OK on success
  */
 int
-init_dht_table (CoreAPIForApplication * capi)
+init_dht_table (GNUNET_CoreAPIForPlugins * capi)
 {
   unsigned long long i;
 
@@ -736,11 +736,11 @@
         stats->create (gettext_noop ("# dht discovery messages sent"));
     }
   identity = coreAPI->requestService ("identity");
-  GE_ASSERT (coreAPI->ectx, identity != NULL);
+  GNUNET_GE_ASSERT (coreAPI->ectx, identity != NULL);
   pingpong = coreAPI->requestService ("pingpong");
-  GE_ASSERT (coreAPI->ectx, pingpong != NULL);
-  capi->registerHandler (P2P_PROTO_DHT_DISCOVERY, &handleDiscovery);
-  capi->registerHandler (P2P_PROTO_DHT_ASK_HELLO, &handleAskHello);
+  GNUNET_GE_ASSERT (coreAPI->ectx, pingpong != NULL);
+  capi->registerHandler (GNUNET_P2P_PROTO_DHT_DISCOVERY, &handleDiscovery);
+  capi->registerHandler (GNUNET_P2P_PROTO_DHT_ASK_HELLO, &handleAskHello);
   GNUNET_cron_add_job (coreAPI->cron,
                        &maintain_dht_job,
                        MAINTAIN_FREQUENCY, MAINTAIN_FREQUENCY, NULL);
@@ -758,8 +758,8 @@
   unsigned int i;
   unsigned int j;
 
-  coreAPI->unregisterHandler (P2P_PROTO_DHT_DISCOVERY, &handleDiscovery);
-  coreAPI->unregisterHandler (P2P_PROTO_DHT_ASK_HELLO, &handleAskHello);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_DHT_DISCOVERY, 
&handleDiscovery);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_DHT_ASK_HELLO, &handleAskHello);
   GNUNET_cron_del_job (coreAPI->cron, &maintain_dht_job, MAINTAIN_FREQUENCY,
                        NULL);
   if (stats != NULL)

Modified: GNUnet/src/applications/dht/module/table.h
===================================================================
--- GNUnet/src/applications/dht/module/table.h  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/module/table.h  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -53,7 +53,7 @@
  * @param capi the core API
  * @return GNUNET_OK on success
  */
-int init_dht_table (CoreAPIForApplication * capi);
+int init_dht_table (GNUNET_CoreAPIForPlugins * capi);
 
 /**
  * Shutdown table DHT component.

Modified: GNUnet/src/applications/dht/tools/dht-query.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht-query.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/dht/tools/dht-query.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -38,11 +38,11 @@
  */
 static GNUNET_CronTime timeout;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
 /**
  * All gnunet-dht-query command line options
@@ -56,20 +56,20 @@
    gettext_noop
    ("allow TIME ms to process a GET command or expire PUT content after ms 
TIME"),
    1, &GNUNET_getopt_configure_set_ulong, &timeout},
-   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
 
 static int
 printCallback (const GNUNET_HashCode * hash,
-               const DataContainer * data, void *cls)
+               const GNUNET_DataContainer * data, void *cls)
 {
   char *key = cls;
   printf ("%s(%s): '%.*s'\n",
           "get",
           key,
-          (int) (ntohl (data->size) - sizeof (DataContainer)),
+          (int) (ntohl (data->size) - sizeof (GNUNET_DataContainer)),
           (char *) &data[1]);
   return GNUNET_OK;
 }
@@ -82,15 +82,15 @@
 
   GNUNET_hash (key, strlen (key), &hc);
 #if DEBUG_DHT_QUERY
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Issuing '%s(%s)' command.\n", "get", key);
 #endif
   if (timeout == 0)
     timeout = 30 * GNUNET_CRON_SECONDS;
-  ret = DHT_LIB_get (cfg,
+  ret = GNUNET_DHT_get (cfg,
                      ectx,
-                     DHT_STRING2STRING_BLOCK,
+                     GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                      &hc, timeout, &printCallback, (void *) key);
   if (ret == 0)
     printf (_("%s(%s) operation returned no results.\n"), "get", key);
@@ -100,21 +100,21 @@
 do_put (struct GNUNET_ClientServerConnection *sock,
         const char *key, const char *value)
 {
-  DataContainer *dc;
+  GNUNET_DataContainer *dc;
   GNUNET_HashCode hc;
 
   GNUNET_hash (key, strlen (key), &hc);
-  dc = GNUNET_malloc (sizeof (DataContainer) + strlen (value));
-  dc->size = htonl (strlen (value) + sizeof (DataContainer));
+  dc = GNUNET_malloc (sizeof (GNUNET_DataContainer) + strlen (value));
+  dc->size = htonl (strlen (value) + sizeof (GNUNET_DataContainer));
   memcpy (&dc[1], value, strlen (value));
 #if DEBUG_DHT_QUERY
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("Issuing '%s(%s,%s)' command.\n"), "put", key, value);
 #endif
   if (timeout == 0)
     timeout = 30 * GNUNET_CRON_MINUTES;
-  if (GNUNET_OK == DHT_LIB_put (cfg, ectx, &hc, DHT_STRING2STRING_BLOCK, 
timeout + GNUNET_get_time (),  /* convert to absolute time */
+  if (GNUNET_OK == GNUNET_DHT_put (cfg, ectx, &hc, 
GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING, timeout + GNUNET_get_time (),  
/* convert to absolute time */
                                 dc))
     {
       printf (_("'%s(%s,%s)' succeeded\n"), "put", key, value);
@@ -146,8 +146,8 @@
   if (handle == NULL)
     {
       fprintf (stderr, _("Failed to connect to gnunetd.\n"));
-      GC_free (cfg);
-      GE_free_context (ectx);
+      GNUNET_GC_free (cfg);
+      GNUNET_GE_free_context (ectx);
       return 1;
     }
 

Modified: GNUnet/src/applications/dht/tools/dht_api.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_api.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/tools/dht_api.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -46,7 +46,7 @@
   /**
    * Callback to call for each result.
    */
-  DataProcessor processor;
+  GNUNET_DataProcessor processor;
 
   /**
    * Extra argument for processor.
@@ -80,7 +80,7 @@
   GetInfo *info = cls;
   GNUNET_MessageHeader *reply;
   CS_dht_request_put_MESSAGE *put;
-  DataContainer *cont;
+  GNUNET_DataContainer *cont;
   unsigned short size;
 
   while (info->aborted == GNUNET_NO)
@@ -91,20 +91,20 @@
       if (GNUNET_OK != GNUNET_client_connection_read (info->sock, &reply))
         break;
       if ((sizeof (CS_dht_request_put_MESSAGE) > ntohs (reply->size)) ||
-          (CS_PROTO_dht_REQUEST_PUT != ntohs (reply->type)))
+          (GNUNET_CS_PROTO_DHT_REQUEST_PUT != ntohs (reply->type)))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           info->total = GNUNET_SYSERR;
           break;                /*  invalid reply */
         }
 
       put = (CS_dht_request_put_MESSAGE *) reply;
       /* re-use "expire" field of the reply (which is 0 anyway)
-         for the header of DataContainer (which fits) to avoid
+         for the header of GNUNET_DataContainer (which fits) to avoid
          copying -- go C pointer arithmetic! */
-      cont = (DataContainer *) & ((char *) &put[1])[-sizeof (DataContainer)];
+      cont = (GNUNET_DataContainer *) & ((char *) &put[1])[-sizeof 
(GNUNET_DataContainer)];
       size = ntohs (reply->size) - sizeof (CS_dht_request_put_MESSAGE);
-      cont->size = htonl (size + sizeof (DataContainer));
+      cont->size = htonl (size + sizeof (GNUNET_DataContainer));
       if ((info->processor != NULL) &&
           (GNUNET_OK != info->processor (&put->key, cont, info->closure)))
         info->aborted = GNUNET_YES;
@@ -137,11 +137,11 @@
  * @return number of results on success, GNUNET_SYSERR on error (i.e. timeout)
  */
 int
-DHT_LIB_get (struct GC_Configuration *cfg,
-             struct GE_Context *ectx,
+GNUNET_DHT_get (struct GNUNET_GC_Configuration *cfg,
+             struct GNUNET_GE_Context *ectx,
              unsigned int type,
              const GNUNET_HashCode * key,
-             GNUNET_CronTime timeout, DataProcessor processor, void *closure)
+             GNUNET_CronTime timeout, GNUNET_DataProcessor processor, void 
*closure)
 {
   struct GNUNET_ClientServerConnection *sock;
   CS_dht_request_get_MESSAGE req;
@@ -156,7 +156,7 @@
   if (sock == NULL)
     return GNUNET_SYSERR;
   req.header.size = htons (sizeof (CS_dht_request_get_MESSAGE));
-  req.header.type = htons (CS_PROTO_dht_REQUEST_GET);
+  req.header.type = htons (GNUNET_CS_PROTO_DHT_REQUEST_GET);
   req.type = htonl (type);
   req.timeout = GNUNET_htonll (timeout);
   req.key = *key;
@@ -202,11 +202,11 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-DHT_LIB_put (struct GC_Configuration *cfg,
-             struct GE_Context *ectx,
+GNUNET_DHT_put (struct GNUNET_GC_Configuration *cfg,
+             struct GNUNET_GE_Context *ectx,
              const GNUNET_HashCode * key,
              unsigned int type, GNUNET_CronTime expire,
-             const DataContainer * value)
+             const GNUNET_DataContainer * value)
 {
   struct GNUNET_ClientServerConnection *sock;
   CS_dht_request_put_MESSAGE *req;
@@ -216,29 +216,29 @@
   now = GNUNET_get_time ();
   if (expire < now)
     {
-      GE_BREAK (ectx, 0);       /* content already expired!? */
+      GNUNET_GE_BREAK (ectx, 0);       /* content already expired!? */
       return GNUNET_SYSERR;
     }
 #if DEBUG_DHT_API
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "DHT_LIB_put called with value '%.*s'\n",
           ntohl (value->size), &value[1]);
 #endif
   sock = GNUNET_client_connection_create (ectx, cfg);
   if (sock == NULL)
     return GNUNET_SYSERR;
-  GE_ASSERT (NULL, ntohl (value->size) >= sizeof (DataContainer));
+  GNUNET_GE_ASSERT (NULL, ntohl (value->size) >= sizeof 
(GNUNET_DataContainer));
   req = GNUNET_malloc (sizeof (CS_dht_request_put_MESSAGE) +
-                       ntohl (value->size) - sizeof (DataContainer));
+                       ntohl (value->size) - sizeof (GNUNET_DataContainer));
   req->header.size
     = htons (sizeof (CS_dht_request_put_MESSAGE) +
-             ntohl (value->size) - sizeof (DataContainer));
-  req->header.type = htons (CS_PROTO_dht_REQUEST_PUT);
+             ntohl (value->size) - sizeof (GNUNET_DataContainer));
+  req->header.type = htons (GNUNET_CS_PROTO_DHT_REQUEST_PUT);
   req->key = *key;
   req->type = htonl (type);
   req->expire = GNUNET_htonll (expire - now);   /* convert to relative time */
-  memcpy (&req[1], &value[1], ntohl (value->size) - sizeof (DataContainer));
+  memcpy (&req[1], &value[1], ntohl (value->size) - sizeof 
(GNUNET_DataContainer));
   ret = GNUNET_client_connection_write (sock, &req->header);
   GNUNET_client_connection_destroy (sock);
   GNUNET_free (req);

Modified: GNUnet/src/applications/dht/tools/dhttest.c
===================================================================
--- GNUnet/src/applications/dht/tools/dhttest.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dht/tools/dhttest.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -50,7 +50,7 @@
   return GNUNET_OK;
 }
 
-#define CHECK(a) do { if (!(a)) { ret = 1; GE_BREAK(ectx, 0); goto FAILURE; } 
} while(0)
+#define CHECK(a) do { if (!(a)) { ret = 1; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; } } while(0)
 
 /**
  * Testcase to test DHT routing (many peers).
@@ -62,9 +62,9 @@
   struct GNUNET_TESTING_DaemonContext *peers;
   int ret = 0;
   GNUNET_HashCode key;
-  DataContainer *value;
-  struct GE_Context *ectx;
-  struct GC_Configuration *cfg;
+  GNUNET_DataContainer *value;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_ClientServerConnection *sock;
   int left;
   int i;
@@ -74,10 +74,10 @@
   char buf[128];
 
   ectx = NULL;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   peers = GNUNET_TESTING_start_daemons ("tcp",
@@ -86,7 +86,7 @@
                                         2087, 10, NUM_PEERS);
   if (peers == NULL)
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   for (i = 0; i < NUM_PEERS; i++)
@@ -98,7 +98,7 @@
             {
               GNUNET_TESTING_stop_daemons (peers);
               fprintf (stderr, "Failed to connect the peers!\n");
-              GC_free (cfg);
+              GNUNET_GC_free (cfg);
               return -1;
             }
         }
@@ -107,7 +107,7 @@
   /* wait for some DHT's to find each other! */
   sock = GNUNET_client_connection_create (NULL, cfg);
   left = 30;                    /* how many iterations should we wait? */
-  while (GNUNET_OK == STATS_getStatistics (NULL, sock, &waitForConnect, NULL))
+  while (GNUNET_OK == GNUNET_STATS_get_statistics (NULL, sock, 
&waitForConnect, NULL))
     {
       printf ("Waiting for peers to DHT-connect (%u iterations left)...\n",
               left);
@@ -121,7 +121,7 @@
     {
       GNUNET_TESTING_stop_daemons (peers);
       fprintf (stderr, "Peers' DHTs failed to DHT-connect!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 
@@ -129,15 +129,15 @@
   for (i = 0; i < NUM_PEERS; i++)
     {
       GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + i * 10);
-      GC_set_configuration_value_string (cfg, ectx, "NETWORK", "HOST", buf);
+      GNUNET_GC_set_configuration_value_string (cfg, ectx, "NETWORK", "HOST", 
buf);
       GNUNET_hash (buf, 4, &key);
       value = GNUNET_malloc (8);
       value->size = ntohl (8);
       memset (&value[1], 'A' + i, 4);
-      CHECK (GNUNET_OK == DHT_LIB_put (cfg,
+      CHECK (GNUNET_OK == GNUNET_DHT_put (cfg,
                                        ectx,
                                        &key,
-                                       DHT_STRING2STRING_BLOCK,
+                                       
GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                                        GNUNET_get_time () +
                                        15 * GNUNET_CRON_MINUTES * NUM_ROUNDS *
                                        NUM_PEERS * NUM_PEERS, value));
@@ -150,16 +150,16 @@
       for (i = 0; i < NUM_PEERS; i++)
         {
           GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + i * 10);
-          GC_set_configuration_value_string (cfg,
+          GNUNET_GC_set_configuration_value_string (cfg,
                                              ectx, "NETWORK", "HOST", buf);
           for (j = 0; j < NUM_PEERS; j++)
             {
               GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + j * 10);
               GNUNET_hash (buf, 4, &key);
               fprintf (stderr, "Peer %d gets key %d", i, j);
-              if (0 < DHT_LIB_get (cfg,
+              if (0 < GNUNET_DHT_get (cfg,
                                    ectx,
-                                   DHT_STRING2STRING_BLOCK,
+                                   
GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                                    &key,
                                    (NUM_ROUNDS - k) * GNUNET_CRON_SECONDS,
                                    NULL, NULL))
@@ -178,7 +178,7 @@
     }
 FAILURE:
   GNUNET_TESTING_stop_daemons (peers);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return ret;
 }
 

Modified: GNUnet/src/applications/dht/tools/dhttest2.c
===================================================================
--- GNUnet/src/applications/dht/tools/dhttest2.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/dht/tools/dhttest2.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -50,7 +50,7 @@
   return GNUNET_OK;
 }
 
-#define CHECK(a) do { if (!(a)) { ret = 1; GE_BREAK(ectx, 0); goto FAILURE; } 
} while(0)
+#define CHECK(a) do { if (!(a)) { ret = 1; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; } } while(0)
 
 /**
  * Testcase to test DHT routing (2 peers only).
@@ -64,17 +64,17 @@
 #endif
   int ret = 0;
   GNUNET_HashCode key;
-  DataContainer *value;
-  struct GE_Context *ectx;
-  struct GC_Configuration *cfg;
+  GNUNET_DataContainer *value;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_ClientServerConnection *sock;
   int left;
 
   ectx = NULL;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
@@ -84,7 +84,7 @@
                                         2087, 10000, 2);
   if (peers == NULL)
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -92,14 +92,14 @@
     {
       GNUNET_TESTING_stop_daemons (peers);
       fprintf (stderr, "Failed to connect the peers!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 
   /* wait for DHT's to find each other! */
   sock = GNUNET_client_connection_create (NULL, cfg);
   left = 30;                    /* how many iterations should we wait? */
-  while (GNUNET_OK == STATS_getStatistics (NULL, sock, &waitForConnect, NULL))
+  while (GNUNET_OK == GNUNET_STATS_get_statistics (NULL, sock, 
&waitForConnect, NULL))
     {
       printf ("Waiting for peers to DHT-connect (%u iterations left)...\n",
               left);
@@ -113,19 +113,19 @@
     {
       GNUNET_TESTING_stop_daemons (peers);
       fprintf (stderr, "Peers' DHTs failed to DHT-connect!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 
   /* switch to peer2 */
-  GC_set_configuration_value_string (cfg,
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:12087");
   /* verify that peer2 also sees the other DHT! */
   ok = 0;
   sock = GNUNET_client_connection_create (NULL, cfg);
   left = 30;                    /* how many iterations should we wait? */
-  while (GNUNET_OK == STATS_getStatistics (NULL, sock, &waitForConnect, NULL))
+  while (GNUNET_OK == GNUNET_STATS_get_statistics (NULL, sock, 
&waitForConnect, NULL))
     {
       printf ("Waiting for peers to DHT-connect (%u iterations left)...\n",
               left);
@@ -139,13 +139,13 @@
     {
       GNUNET_TESTING_stop_daemons (peers);
       fprintf (stderr, "Peers' DHTs failed to DHT-connect!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 
 
   /* switch to peer1 */
-  GC_set_configuration_value_string (cfg,
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:2087");
 
@@ -155,19 +155,19 @@
   value->size = ntohl (8);
   memset (&value[1], 'A', 4);
   printf ("Peer1 stores key2\n");
-  CHECK (GNUNET_OK == DHT_LIB_put (cfg,
+  CHECK (GNUNET_OK == GNUNET_DHT_put (cfg,
                                    ectx,
                                    &key,
-                                   DHT_STRING2STRING_BLOCK,
+                                   
GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                                    GNUNET_get_time () +
                                    5 * GNUNET_CRON_MINUTES, value));
   printf ("Peer1 gets key2\n");
-  CHECK (1 == DHT_LIB_get (cfg,
+  CHECK (1 == GNUNET_DHT_get (cfg,
                            ectx,
-                           DHT_STRING2STRING_BLOCK,
+                           GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                            &key, 2 * GNUNET_CRON_SECONDS, NULL, NULL));
   /* switch to peer2 */
-  GC_set_configuration_value_string (cfg,
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:12087");
   GNUNET_hash ("key", 3, &key);
@@ -175,32 +175,32 @@
   value->size = ntohl (8);
   memset (&value[1], 'B', 4);
   printf ("Peer2 stores key.\n");
-  CHECK (GNUNET_OK == DHT_LIB_put (cfg,
+  CHECK (GNUNET_OK == GNUNET_DHT_put (cfg,
                                    ectx,
                                    &key,
-                                   DHT_STRING2STRING_BLOCK,
+                                   
GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                                    GNUNET_get_time () +
                                    5 * GNUNET_CRON_MINUTES, value));
   printf ("Peer2 gets key.\n");
-  CHECK (1 == DHT_LIB_get (cfg,
+  CHECK (1 == GNUNET_DHT_get (cfg,
                            ectx,
-                           DHT_STRING2STRING_BLOCK,
+                           GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                            &key, 2 * GNUNET_CRON_SECONDS, NULL, NULL));
 
   GNUNET_hash ("key2", 4, &key);
   printf ("Peer2 gets key2.\n");
-  CHECK (1 == DHT_LIB_get (cfg,
+  CHECK (1 == GNUNET_DHT_get (cfg,
                            ectx,
-                           DHT_STRING2STRING_BLOCK,
+                           GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                            &key, 30 * GNUNET_CRON_SECONDS, NULL, NULL));
   /* switch to peer1 */
-  GC_set_configuration_value_string (cfg,
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:2087");
   printf ("Peer1 gets key\n");
-  CHECK (1 == DHT_LIB_get (cfg,
+  CHECK (1 == GNUNET_DHT_get (cfg,
                            ectx,
-                           DHT_STRING2STRING_BLOCK,
+                           GNUNET_GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
                            &key, 30 * GNUNET_CRON_SECONDS, NULL, NULL));
   /* end of actual test code */
 
@@ -208,7 +208,7 @@
 #if START_PEERS
   GNUNET_TESTING_stop_daemons (peers);
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return ret;
 }
 

Modified: GNUnet/src/applications/dstore/dstore.c
===================================================================
--- GNUnet/src/applications/dstore/dstore.c     2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/dstore/dstore.c     2007-11-25 12:04:45 UTC (rev 
5755)
@@ -56,14 +56,14 @@
  */
 static char *fn;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static struct GNUNET_Mutex *lock;
 
 /**
  * Statistics service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static unsigned int stat_dstore_size;
 
@@ -89,14 +89,14 @@
                           strlen (zSql), ppStmt, (const char **) &dummy);
 }
 
-#define SQLITE3_EXEC(db, cmd) do { if (SQLITE_OK != sqlite3_exec(db, cmd, 
NULL, NULL, &emsg)) { GE_LOG(coreAPI->ectx, GE_ERROR | GE_ADMIN | GE_BULK, 
_("`%s' failed at %s:%d with error: %s\n"), "sqlite3_exec", __FILE__, __LINE__, 
emsg); sqlite3_free(emsg); } } while(0)
+#define SQLITE3_EXEC(db, cmd) do { if (SQLITE_OK != sqlite3_exec(db, cmd, 
NULL, NULL, &emsg)) { GNUNET_GE_LOG(coreAPI->ectx, GNUNET_GE_ERROR | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK, _("`%s' failed at %s:%d with error: %s\n"), 
"sqlite3_exec", __FILE__, __LINE__, emsg); sqlite3_free(emsg); } } while(0)
 
 /**
  * Log an error message at log-level 'level' that indicates
  * a failure of the command 'cmd' on file 'filename'
  * with the message given by strerror(errno).
  */
-#define LOG_SQLITE(db, level, cmd) do { GE_LOG(coreAPI->ectx, level, _("`%s' 
failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, 
sqlite3_errmsg(db)); } while(0)
+#define LOG_SQLITE(db, level, cmd) do { GNUNET_GE_LOG(coreAPI->ectx, level, 
_("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, 
sqlite3_errmsg(db)); } while(0)
 
 static void
 db_init (sqlite3 * dbh)
@@ -142,7 +142,7 @@
   fd = mkstemp (fn);
   if (fd == -1)
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       GNUNET_free (fn);
       fn = NULL;
       return GNUNET_SYSERR;
@@ -175,8 +175,8 @@
   if (payload * 10 <= quota * 9)
     return GNUNET_OK;           /* we seem to be about 10% off */
 #if DEBUG_DSTORE
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "DStore above qutoa (have %llu, allowed %llu), will delete some 
data.\n",
           payload, quota);
 #endif
@@ -190,11 +190,11 @@
                    "WHERE size = ? AND type = ? AND puttime = ? AND expire = ? 
AND key = ? AND value = ?",
                    &dstmt) != SQLITE_OK))
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sq_prepare", __FILE__, __LINE__, sqlite3_errmsg (dbh));
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       if (dstmt != NULL)
         sqlite3_finalize (dstmt);
       if (stmt != NULL)
@@ -210,13 +210,13 @@
       dtype = sqlite3_column_int (stmt, 1);
       dputtime = sqlite3_column_int64 (stmt, 2);
       dexpire = sqlite3_column_int64 (stmt, 3);
-      GE_BREAK (NULL,
+      GNUNET_GE_BREAK (NULL,
                 sqlite3_column_bytes (stmt, 4) == sizeof (GNUNET_HashCode));
-      GE_BREAK (NULL, dsize == sqlite3_column_bytes (stmt, 5));
+      GNUNET_GE_BREAK (NULL, dsize == sqlite3_column_bytes (stmt, 5));
       memcpy (&dkey, sqlite3_column_blob (stmt, 4), sizeof (GNUNET_HashCode));
       if (dsize >= MAX_CONTENT_SIZE)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           dsize = MAX_CONTENT_SIZE;
         }
       memcpy (dcontent, sqlite3_column_blob (stmt, 5), dsize);
@@ -231,18 +231,18 @@
       sqlite3_bind_blob (dstmt, 6, dcontent, dsize, SQLITE_TRANSIENT);
       if ((err = sqlite3_step (dstmt)) != SQLITE_DONE)
         {
-          GE_LOG (coreAPI->ectx,
-                  GE_ERROR | GE_ADMIN | GE_BULK,
+          GNUNET_GE_LOG (coreAPI->ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "sqlite3_step", __FILE__, __LINE__, sqlite3_errmsg (dbh));
           sqlite3_reset (dstmt);
-          GE_BREAK (NULL, 0);   /* should delete but cannot!? */
+          GNUNET_GE_BREAK (NULL, 0);   /* should delete but cannot!? */
           break;
         }
       payload -= (dsize + OVERHEAD);
 #if DEBUG_DSTORE
-      GE_LOG (coreAPI->ectx,
-              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
               "Deleting %u bytes decreases DStore payload to %llu out of 
%llu\n",
               dsize, payload, quota);
 #endif
@@ -250,8 +250,8 @@
     }
   if (err != SQLITE_DONE)
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sqlite3_step", __FILE__, __LINE__, sqlite3_errmsg (dbh));
     }
@@ -261,8 +261,8 @@
   if (payload * 10 > quota * 9)
     {
       /* we seem to be about 10% off */
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_BULK | GE_DEVELOPER,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_DEVELOPER,
               "Failed to delete content to drop below quota (bug?).\n",
               payload, quota);
       return GNUNET_SYSERR;
@@ -294,8 +294,8 @@
       return GNUNET_SYSERR;
     }
 #if DEBUG_DSTORE
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "dstore processes put `%.*s\n", size, data);
 #endif
 
@@ -305,8 +305,8 @@
                   "WHERE key=? AND type=? AND size=? AND value=?",
                   &stmt) != SQLITE_OK)
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sq_prepare", __FILE__, __LINE__, sqlite3_errmsg (dbh));
       sqlite3_close (dbh);
@@ -323,8 +323,8 @@
       || (SQLITE_OK !=
           sqlite3_bind_blob (stmt, 6, data, size, SQLITE_TRANSIENT)))
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sqlite3_bind_xxx", __FILE__, __LINE__, sqlite3_errmsg (dbh));
       sqlite3_finalize (stmt);
@@ -334,8 +334,8 @@
     }
   if (SQLITE_DONE != sqlite3_step (stmt))
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sqlite3_step", __FILE__, __LINE__, sqlite3_errmsg (dbh));
       sqlite3_finalize (stmt);
@@ -365,8 +365,8 @@
                   "(size, type, puttime, expire, key, value) "
                   "VALUES (?, ?, ?, ?, ?, ?)", &stmt) != SQLITE_OK)
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sq_prepare", __FILE__, __LINE__, sqlite3_errmsg (dbh));
       sqlite3_close (dbh);
@@ -385,24 +385,24 @@
     {
       if (SQLITE_DONE != sqlite3_step (stmt))
         LOG_SQLITE (dbh,
-                    GE_ERROR | GE_DEVELOPER | GE_ADMIN | GE_BULK,
+                    GNUNET_GE_ERROR | GNUNET_GE_DEVELOPER | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                     "sqlite3_step");
       else
         payload += size + OVERHEAD;
       if (SQLITE_OK != sqlite3_finalize (stmt))
         LOG_SQLITE (dbh,
-                    GE_ERROR | GE_DEVELOPER | GE_ADMIN | GE_BULK,
+                    GNUNET_GE_ERROR | GNUNET_GE_DEVELOPER | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                     "sqlite3_finalize");
     }
   else
     {
       LOG_SQLITE (dbh,
-                  GE_ERROR | GE_DEVELOPER | GE_ADMIN | GE_BULK,
+                  GNUNET_GE_ERROR | GNUNET_GE_DEVELOPER | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                   "sqlite3_bind_xxx");
     }
 #if DEBUG_DSTORE
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Storing %u bytes increases DStore payload to %llu out of %llu\n",
           size, payload, quota);
 #endif
@@ -426,7 +426,7 @@
  */
 static int
 d_get (const GNUNET_HashCode * key,
-       unsigned int type, ResultHandler handler, void *closure)
+       unsigned int type, GNUNET_ResultProcessor handler, void *closure)
 {
   sqlite3 *dbh;
   sqlite3_stmt *stmt;
@@ -448,16 +448,16 @@
       return GNUNET_SYSERR;
     }
 #if DEBUG_DSTORE
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_DEVELOPER, "dstore processes get\n");
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER, "dstore 
processes get\n");
 #endif
   now = GNUNET_get_time ();
   if (sq_prepare (dbh,
                   "SELECT size, value FROM ds071 WHERE key=? AND type=? AND 
expire >= ?",
                   &stmt) != SQLITE_OK)
     {
-      GE_LOG (coreAPI->ectx,
-              GE_ERROR | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG (coreAPI->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK,
               _("`%s' failed at %s:%d with error: %s\n"),
               "sq_prepare", __FILE__, __LINE__, sqlite3_errmsg (dbh));
       sqlite3_close (dbh);
@@ -474,7 +474,7 @@
       size = sqlite3_column_int (stmt, 0);
       if (size != sqlite3_column_bytes (stmt, 1))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           continue;
         }
       dat = sqlite3_column_blob (stmt, 1);
@@ -487,20 +487,20 @@
   return cnt;
 }
 
-Dstore_ServiceAPI *
-provide_module_dstore (CoreAPIForApplication * capi)
+GNUNET_Dstore_ServiceAPI *
+provide_module_dstore (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Dstore_ServiceAPI api;
+  static GNUNET_Dstore_ServiceAPI api;
   int fd;
 
 #if DEBUG_SQLITE
-  GE_LOG (capi->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (capi->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "SQLite Dstore: initializing database\n");
 #endif
   if (GNUNET_OK != db_reset ())
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       return NULL;
     }
   lock = GNUNET_mutex_create (GNUNET_NO);
@@ -509,7 +509,7 @@
   coreAPI = capi;
   api.get = &d_get;
   api.put = &d_put;
-  GC_get_configuration_value_number (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_number (coreAPI->cfg,
                                      "DSTORE", "QUOTA", 1, 1024, 1, &quota);
   if (quota == 0)               /* error */
     quota = 1;
@@ -552,8 +552,8 @@
       stats = NULL;
     }
 #if DEBUG_SQLITE
-  GE_LOG (coreAPI->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (coreAPI->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "SQLite Dstore: database shutdown\n");
 #endif
   GNUNET_mutex_destroy (lock);

Modified: GNUnet/src/applications/dstore/dstore_test.c
===================================================================
--- GNUnet/src/applications/dstore/dstore_test.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/dstore/dstore_test.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -55,7 +55,7 @@
  * Add testcode here!
  */
 static int
-test (Dstore_ServiceAPI * api)
+test (GNUNET_Dstore_ServiceAPI * api)
 {
   GNUNET_HashCode k;
   GNUNET_HashCode n;
@@ -90,15 +90,15 @@
 int
 main (int argc, char *argv[])
 {
-  Dstore_ServiceAPI *api;
+  GNUNET_Dstore_ServiceAPI *api;
   int ok;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_CronManager *cron;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   cron = cron_create (NULL);

Modified: GNUnet/src/applications/fragmentation/fragmentation.c
===================================================================
--- GNUnet/src/applications/fragmentation/fragmentation.c       2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/fragmentation/fragmentation.c       2007-11-25 
12:04:45 UTC (rev 5755)
@@ -98,9 +98,9 @@
 
 #define FRAGSIZE(fl) 
((ntohs(fl->frag->header.size)-sizeof(P2P_fragmentation_MESSAGE)))
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_defragmented;
 
@@ -195,7 +195,7 @@
   unsigned short len;
   char *msg;
 
-  GE_ASSERT (NULL, pep != NULL);
+  GNUNET_GE_ASSERT (NULL, pep != NULL);
   pos = pep->head;
   if (pos == NULL)
     return;
@@ -269,7 +269,7 @@
   FL *tmp;
   unsigned short end;
 
-  GE_ASSERT (NULL, entry != NULL);
+  GNUNET_GE_ASSERT (NULL, entry != NULL);
   if (0 != memcmp (sender, &entry->sender, sizeof (GNUNET_PeerIdentity)))
     return GNUNET_SYSERR;       /* wrong fragment list, try another! */
   if (ntohl (packet->id) != entry->id)
@@ -299,8 +299,8 @@
     sizeof (P2P_fragmentation_MESSAGE);
   if (end <= ntohs (packet->off))
     {
-      GE_LOG (NULL,
-              GE_DEVELOPER | GE_DEBUG | GE_BULK,
+      GNUNET_GE_LOG (NULL,
+              GNUNET_GE_DEVELOPER | GNUNET_GE_DEBUG | GNUNET_GE_BULK,
               "Received invalid fragment at %s:%d\n", __FILE__, __LINE__);
       return GNUNET_SYSERR;     /* yuck! integer overflow! */
     }
@@ -454,7 +454,7 @@
  * Send a message that had to be fragmented (right now!).  First grabs
  * the first part of the message (obtained from ctx->se) and stores
  * that in a P2P_fragmentation_MESSAGE envelope.  The remaining fragments are
- * added to the send queue with EXTREME_PRIORITY (to ensure that they
+ * added to the send queue with GNUNET_EXTREME_PRIORITY (to ensure that they
  * will be transmitted next).  The logic here is that if the priority
  * for the first fragment was sufficiently high, the priority should
  * also have been sufficiently high for all of the other fragments (at
@@ -484,7 +484,7 @@
   /* write first fragment to buf */
   frag = (P2P_fragmentation_MESSAGE *) buf;
   frag->header.size = htons (len);
-  frag->header.type = htons (P2P_PROTO_fragment);
+  frag->header.type = htons (GNUNET_P2P_PROTO_MESSAGNUNET_GE_FRAGMENT);
   frag->id = id;
   frag->off = htons (0);
   frag->len = htons (ctx->len);
@@ -498,9 +498,9 @@
       mlen = sizeof (P2P_fragmentation_MESSAGE) + ctx->len - pos;
       if (mlen > ctx->mtu)
         mlen = ctx->mtu;
-      GE_ASSERT (NULL, mlen > sizeof (P2P_fragmentation_MESSAGE));
+      GNUNET_GE_ASSERT (NULL, mlen > sizeof (P2P_fragmentation_MESSAGE));
       frag->header.size = htons (mlen);
-      frag->header.type = htons (P2P_PROTO_fragment);
+      frag->header.type = htons (GNUNET_P2P_PROTO_MESSAGNUNET_GE_FRAGMENT);
       frag->id = id;
       frag->off = htons (pos);
       frag->len = htons (ctx->len);
@@ -509,11 +509,11 @@
               mlen - sizeof (P2P_fragmentation_MESSAGE));
       coreAPI->unicast (&ctx->sender,
                         &frag->header,
-                        EXTREME_PRIORITY,
+                        GNUNET_EXTREME_PRIORITY,
                         ctx->transmissionTime - GNUNET_get_time ());
       pos += mlen - sizeof (P2P_fragmentation_MESSAGE);
     }
-  GE_ASSERT (NULL, pos == ctx->len);
+  GNUNET_GE_ASSERT (NULL, pos == ctx->len);
   GNUNET_free (frag);
   GNUNET_free (ctx);
   return GNUNET_OK;
@@ -530,13 +530,13 @@
           unsigned int mtu,
           unsigned int prio,
           unsigned int targetTime,
-          unsigned int len, BuildMessageCallback bmc, void *bmcClosure)
+          unsigned int len, GNUNET_BuildMessageCallback bmc, void *bmcClosure)
 {
   FragmentBMC *fbmc;
   int xlen;
 
-  GE_ASSERT (NULL, len > mtu);
-  GE_ASSERT (NULL, mtu > sizeof (P2P_fragmentation_MESSAGE));
+  GNUNET_GE_ASSERT (NULL, len > mtu);
+  GNUNET_GE_ASSERT (NULL, mtu > sizeof (P2P_fragmentation_MESSAGE));
   fbmc = GNUNET_malloc (sizeof (FragmentBMC) + len);
   fbmc->mtu = mtu;
   fbmc->sender = *peer;
@@ -563,10 +563,10 @@
 /**
  * Initialize Fragmentation module.
  */
-Fragmentation_ServiceAPI *
-provide_module_fragmentation (CoreAPIForApplication * capi)
+GNUNET_Fragmentation_ServiceAPI *
+provide_module_fragmentation (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Fragmentation_ServiceAPI ret;
+  static GNUNET_Fragmentation_ServiceAPI ret;
   int i;
 
   coreAPI = capi;
@@ -586,10 +586,10 @@
                        &defragmentationPurgeCron,
                        60 * GNUNET_CRON_SECONDS, 60 * GNUNET_CRON_SECONDS,
                        NULL);
-  GE_LOG (capi->ectx, GE_INFO | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (capi->ectx, GNUNET_GE_INFO | GNUNET_GE_USER | 
GNUNET_GE_REQUEST,
           _("`%s' registering handler %d\n"), "fragmentation",
-          P2P_PROTO_fragment);
-  capi->registerHandler (P2P_PROTO_fragment, &processFragment);
+          GNUNET_P2P_PROTO_MESSAGNUNET_GE_FRAGMENT);
+  capi->registerHandler (GNUNET_P2P_PROTO_MESSAGNUNET_GE_FRAGMENT, 
&processFragment);
 
   ret.fragment = &fragment;
   return &ret;
@@ -603,7 +603,7 @@
 {
   int i;
 
-  coreAPI->unregisterHandler (P2P_PROTO_fragment, &processFragment);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_MESSAGNUNET_GE_FRAGMENT, 
&processFragment);
   GNUNET_cron_del_job (coreAPI->cron,
                        &defragmentationPurgeCron, 60 * GNUNET_CRON_SECONDS,
                        NULL);

Modified: GNUnet/src/applications/fragmentation/fragmentationtest.c
===================================================================
--- GNUnet/src/applications/fragmentation/fragmentationtest.c   2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/fragmentation/fragmentationtest.c   2007-11-25 
12:04:45 UTC (rev 5755)
@@ -57,9 +57,9 @@
 static void
 handleHelper (const GNUNET_PeerIdentity * sender,
               const char *msg,
-              const unsigned int len, int wasEncrypted, TSession * ts)
+              const unsigned int len, int wasEncrypted, GNUNET_TSession * ts)
 {
-  GE_ASSERT (NULL,
+  GNUNET_GE_ASSERT (NULL,
              0 == memcmp (sender, &mySender, sizeof (GNUNET_PeerIdentity)));
   myMsg = resultBuffer;
   memcpy (resultBuffer, msg, len);
@@ -115,10 +115,10 @@
 {
   int i;
 
-  GE_ASSERT (NULL, myMsg != NULL);
-  GE_ASSERT (NULL, myMsgLen == len);
+  GNUNET_GE_ASSERT (NULL, myMsg != NULL);
+  GNUNET_GE_ASSERT (NULL, myMsgLen == len);
   for (i = 0; i < len; i++)
-    GE_ASSERT (NULL, myMsg[i] == (char) (i + id));
+    GNUNET_GE_ASSERT (NULL, myMsg[i] == (char) (i + id));
   myMsgLen = 0;
   myMsg = NULL;
 }
@@ -133,7 +133,7 @@
 
   pep = makeFragment (0, 16, 32, 42);
   processFragment (&mySender, pep);
-  GE_ASSERT (NULL, myMsg == NULL);
+  GNUNET_GE_ASSERT (NULL, myMsg == NULL);
   pep = makeFragment (16, 16, 32, 42);
   processFragment (&mySender, pep);
   checkPacket (42, 32);
@@ -146,11 +146,11 @@
 
   pep = makeFragment (0, 16, 32, 42);
   processFragment (&mySender, pep);
-  GE_ASSERT (NULL, myMsg == NULL);
+  GNUNET_GE_ASSERT (NULL, myMsg == NULL);
   makeTimeout ();
   pep = makeFragment (16, 16, 32, 42);
   processFragment (&mySender, pep);
-  GE_ASSERT (NULL, myMsg == NULL);
+  GNUNET_GE_ASSERT (NULL, myMsg == NULL);
   pep = makeFragment (0, 16, 32, 42);
   processFragment (&mySender, pep);
   checkPacket (42, 32);
@@ -163,7 +163,7 @@
 
   pep = makeFragment (16, 16, 32, 42);
   processFragment (&mySender, pep);
-  GE_ASSERT (NULL, myMsg == NULL);
+  GNUNET_GE_ASSERT (NULL, myMsg == NULL);
   pep = makeFragment (0, 16, 32, 42);
   processFragment (&mySender, pep);
   checkPacket (42, 32);
@@ -179,7 +179,7 @@
     {
       pep = makeFragment (i * 16, 16, 51 * 16, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   pep = makeFragment (50 * 16, 16, 51 * 16, 42);
   processFragment (&mySender, pep);
@@ -196,7 +196,7 @@
     {
       pep = makeFragment (i * 16, 16, 4001 * 16, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   pep = makeFragment (4000 * 16, 16, 4001 * 16, 42);
   processFragment (&mySender, pep);
@@ -213,7 +213,7 @@
     {
       pep = makeFragment (i * 16, 8, 6 * 16 + 8, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   pep = makeFragment (5 * 16, 24, 6 * 16 + 8, 42);
   processFragment (&mySender, pep);
@@ -235,13 +235,13 @@
     {
       pep = makeFragment (i * 16, 8, 51 * 16 + 8, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   for (i = 0; i < 50; i++)
     {
       pep = makeFragment (i * 16 + 8, 8, 51 * 16 + 8, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   pep = makeFragment (50 * 16, 24, 51 * 16 + 8, 42);
   processFragment (&mySender, pep);
@@ -258,13 +258,13 @@
     {
       pep = makeFragment (i * 32, 16, 51 * 32, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   for (i = 0; i < 50; i++)
     {
       pep = makeFragment (i * 32 + 8, 24, 51 * 32, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   pep = makeFragment (50 * 32, 32, 51 * 32, 42);
   processFragment (&mySender, pep);
@@ -281,7 +281,7 @@
     {
       pep = makeFragment (0, i * 16 + 16, 51 * 16, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   pep = makeFragment (50 * 16, 16, 51 * 16, 42);
   processFragment (&mySender, pep);
@@ -298,12 +298,12 @@
     {
       pep = makeFragment (0, i * 16 + 16, 51 * 16 + 8, 42);
       processFragment (&mySender, pep);
-      GE_ASSERT (NULL, myMsg == NULL);
+      GNUNET_GE_ASSERT (NULL, myMsg == NULL);
     }
   makeTimeout ();
   pep = makeFragment (50 * 16, 24, 51 * 16 + 8, 42);
   processFragment (&mySender, pep);
-  GE_ASSERT (NULL, myMsg == NULL);
+  GNUNET_GE_ASSERT (NULL, myMsg == NULL);
   for (i = 0; i < 50; i++)
     {
       pep = makeFragment (0, i * 16 + 16, 51 * 16 + 8, 42);
@@ -326,7 +326,7 @@
           pep = makeFragment (i * 16, 16, 51 * 16, id + 5);
           mySender.hashPubKey.bits[0] = id;
           processFragment (&mySender, pep);
-          GE_ASSERT (NULL, myMsg == NULL);
+          GNUNET_GE_ASSERT (NULL, myMsg == NULL);
         }
     }
   for (id = 0; id < DEFRAG_BUCKET_COUNT; id++)
@@ -352,7 +352,7 @@
           pep = makeFragment (i * 16, 16, 6 * 16, id + 5);
           mySender.hashPubKey.bits[0] = id;
           processFragment (&mySender, pep);
-          GE_ASSERT (NULL, myMsg == NULL);
+          GNUNET_GE_ASSERT (NULL, myMsg == NULL);
         }
     }
   for (id = 0; id < DEFRAG_BUCKET_COUNT * 4; id++)
@@ -367,13 +367,13 @@
 /* ************* driver ****************** */
 
 static int
-registerp2pHandler (const unsigned short type, MessagePartHandler callback)
+registerp2pHandler (const unsigned short type, GNUNET_P2PRequestHandler 
callback)
 {
   return GNUNET_OK;
 }
 
 static int
-unregisterp2pHandler (const unsigned short type, MessagePartHandler callback)
+unregisterp2pHandler (const unsigned short type, GNUNET_P2PRequestHandler 
callback)
 {
   return GNUNET_OK;
 }
@@ -388,9 +388,9 @@
 int
 main (int argc, char *argv[])
 {
-  CoreAPIForApplication capi;
+  GNUNET_CoreAPIForPlugins capi;
 
-  memset (&capi, 0, sizeof (CoreAPIForApplication));
+  memset (&capi, 0, sizeof (GNUNET_CoreAPIForPlugins));
   capi.cron = cron_create (NULL);
   capi.injectMessage = &handleHelper;
   capi.requestService = &requestService;

Modified: GNUnet/src/applications/fs/collection/collection.c
===================================================================
--- GNUnet/src/applications/fs/collection/collection.c  2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/collection/collection.c  2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -103,12 +103,12 @@
   /**
    * Metadata describing the collection
    */
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
 
   /**
    * Files in the collection.
    */
-  ECRS_FileInfo *files;
+  GNUNET_ECRS_FileInfo *files;
 
   /**
    * How many files are in files?
@@ -126,9 +126,9 @@
 
 static struct GNUNET_Mutex *lock;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static char *
 getCollectionFileName ()
@@ -136,10 +136,10 @@
   char *fn;
   char *fnBase;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fnBase);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &fnBase);
   fn = GNUNET_malloc (strlen (fnBase) + strlen (COLLECTION) + 4);
   strcpy (fn, fnBase);
   GNUNET_disk_directory_create (ectx, fn);
@@ -153,7 +153,7 @@
  * Initialize collection module.
  */
 void
-CO_init (struct GE_Context *e, struct GC_Configuration *c)
+GNUNET_CO_init (struct GNUNET_GE_Context *e, struct GNUNET_GC_Configuration *c)
 {
   char *fn;
   int len;
@@ -184,7 +184,7 @@
   if ((size > 0x7FFFFFFF) ||
       (size < sizeof (CollectionData) + 4 * sizeof (int)))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       UNLINK (fn);
       GNUNET_free (fn);
       return;
@@ -192,7 +192,7 @@
   fd = OPEN (fn, O_RDONLY | O_LARGEFILE);
   if (fd == -1)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       UNLINK (fn);
       GNUNET_free (fn);
       return;
@@ -201,8 +201,8 @@
   buf = MMAP (NULL, rsize, PROT_READ, MAP_SHARED, fd, 0);
   if (buf == MAP_FAILED)
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER 
| GNUNET_GE_BULK,
                             "mmap", fn);
       CLOSE (fd);
       GNUNET_free (fn);
@@ -215,7 +215,7 @@
   len = ntohl (*(int *) pos);
   if (len > 1024 * 1024 * 4)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       len = 1024 * 1024 * 4;
     }
   GNUNET_array_grow (collectionData->files, collectionData->file_count, len);
@@ -227,7 +227,7 @@
   len = ntohl (*(int *) pos);
   if (len > 1024)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       len = 1024;
     }
   collectionData->name = GNUNET_malloc (len + 1);
@@ -235,7 +235,7 @@
   rsize -= 4 * sizeof (int);
   if (len > rsize)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       len = rsize;
     }
   memcpy (collectionData->name, pos, len);
@@ -243,18 +243,18 @@
   pos += len;
   if (mlen > rsize)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       mlen = rsize;
     }
-  collectionData->meta = ECRS_deserializeMetaData (ectx, pos, mlen);
+  collectionData->meta = GNUNET_ECRS_meta_data_deserialize (ectx, pos, mlen);
   rsize -= mlen;
   pos += mlen;
-  GE_BREAK (ectx, collectionData->meta != NULL);
+  GNUNET_GE_BREAK (ectx, collectionData->meta != NULL);
   for (i = 0; i < collectionData->file_count; i++)
     {
       if (rsize < 2 * sizeof (int))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           break;
         }
       len = ntohl (*(int *) pos);
@@ -264,12 +264,12 @@
       rsize -= 2 * sizeof (int);
       if (rsize < mlen + len)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           break;
         }
       if (len > 1024 * 16)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           len = 1024 * 16;
         }
       tmp = GNUNET_malloc (len + 1);
@@ -277,16 +277,16 @@
       memcpy (tmp, pos, len);
       pos += len;
       rsize -= len;
-      collectionData->files[i].uri = ECRS_stringToUri (ectx, tmp);
-      GE_ASSERT (ectx, collectionData->files[i].uri != NULL);
+      collectionData->files[i].uri = GNUNET_ECRS_string_to_uri (ectx, tmp);
+      GNUNET_GE_ASSERT (ectx, collectionData->files[i].uri != NULL);
       GNUNET_free (tmp);
       collectionData->files[i].meta
-        = ECRS_deserializeMetaData (ectx, pos, mlen);
-      GE_ASSERT (ectx, collectionData->files[i].meta != NULL);
+        = GNUNET_ECRS_meta_data_deserialize (ectx, pos, mlen);
+      GNUNET_GE_ASSERT (ectx, collectionData->files[i].meta != NULL);
       pos += mlen;
       rsize -= mlen;
     }
-  GE_ASSERT (ectx, rsize == 0);
+  GNUNET_GE_ASSERT (ectx, rsize == 0);
   MUNMAP (buf, (size_t) size);
   CLOSE (fd);
   GNUNET_free (fn);
@@ -297,9 +297,9 @@
           (collectionData->files[i].meta != NULL))
         continue;
       if (collectionData->files[i].uri != NULL)
-        ECRS_freeUri (collectionData->files[i].uri);
+        GNUNET_ECRS_uri_destroy (collectionData->files[i].uri);
       if (collectionData->files[i].meta != NULL)
-        ECRS_freeMetaData (collectionData->files[i].meta);
+        GNUNET_ECRS_meta_data_destroy (collectionData->files[i].meta);
       collectionData->files[i]
         = collectionData->files[collectionData->file_count - 1];
       GNUNET_array_grow (collectionData->files,
@@ -331,13 +331,13 @@
     return;
 
   /* write collection data */
-  mlen = ECRS_sizeofMetaData (collectionData->meta, GNUNET_NO);
+  mlen = GNUNET_ECRS_meta_data_get_serialized_size (collectionData->meta, 
GNUNET_NO);
   buf = GNUNET_malloc (mlen);
-  if (mlen != ECRS_serializeMetaData (ectx,
+  if (mlen != GNUNET_ECRS_meta_data_serialize (ectx,
                                       collectionData->meta, buf, mlen,
                                       GNUNET_NO))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       GNUNET_free (buf);
       return;
     }
@@ -347,39 +347,39 @@
              O_CREAT | O_LARGEFILE | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR);
   if (fd == -1)
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_USER | GE_ADMIN | GE_ERROR | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_ERROR 
| GNUNET_GE_BULK,
                             "open", fn);
       GNUNET_free (fn);
       GNUNET_free (buf);
       return;
     }
-  GE_BREAK (ectx, collectionData->file_count <= 1024 * 1024 * 4);
+  GNUNET_GE_BREAK (ectx, collectionData->file_count <= 1024 * 1024 * 4);
   WRITE (fd, collectionData, sizeof (CollectionData));
   WRITEINT (fd, collectionData->file_count);
   WRITEINT (fd, collectionData->changed);
   WRITEINT (fd, mlen);
-  GE_BREAK (ectx, strlen (collectionData->name) < 1024);
+  GNUNET_GE_BREAK (ectx, strlen (collectionData->name) < 1024);
   WRITEINT (fd, strlen (collectionData->name));
   WRITE (fd, collectionData->name, strlen (collectionData->name));
   WRITE (fd, buf, mlen);
   GNUNET_free (buf);
   for (i = 0; i < collectionData->file_count; i++)
     {
-      mlen = ECRS_sizeofMetaData (collectionData->files[i].meta, GNUNET_NO);
+      mlen = GNUNET_ECRS_meta_data_get_serialized_size 
(collectionData->files[i].meta, GNUNET_NO);
       buf = GNUNET_malloc (mlen);
-      if (mlen != ECRS_serializeMetaData (ectx,
+      if (mlen != GNUNET_ECRS_meta_data_serialize (ectx,
                                           collectionData->files[i].meta,
                                           buf, mlen, GNUNET_NO))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (buf);
           break;
         }
-      tmp = ECRS_uriToString (collectionData->files[i].uri);
+      tmp = GNUNET_ECRS_uri_to_string (collectionData->files[i].uri);
       WRITEINT (fd, strlen (tmp));
       WRITEINT (fd, mlen);
-      GE_BREAK (ectx, strlen (tmp) < 16 * 1024);
+      GNUNET_GE_BREAK (ectx, strlen (tmp) < 16 * 1024);
       WRITE (fd, tmp, strlen (tmp));
       GNUNET_free (tmp);
       WRITE (fd, buf, mlen);
@@ -393,10 +393,10 @@
  * Shutdown collection module.
  */
 void
-CO_done ()
+GNUNET_CO_done ()
 {
   writeCO ();
-  CO_stopCollection ();
+  GNUNET_CO_collection_stop ();
   GNUNET_mutex_destroy (lock);
   lock = NULL;
   ectx = NULL;
@@ -407,31 +407,31 @@
 /**
  * Start collection.
  *
- * @param updateInterval of ECRS_SBLOCK_UPDATE_NONE
+ * @param updateInterval of GNUNET_ECRS_SBLOCK_UPDATE_NONE
  *        means to update _immediately_ on any change,
- *        wherease ECRS_SBLOCK_UPDATE_SPORADIC means
+ *        wherease GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC means
  *        to publish updates when the CO_Context
  *        is destroyed (i.e. on exit from the UI).
  */
 int
-CO_startCollection (unsigned int anonymityLevel,
+GNUNET_CO_collection_start (unsigned int anonymityLevel,
                     unsigned int prio,
                     GNUNET_Int32Time updateInterval,
-                    const char *name, const struct ECRS_MetaData *meta)
+                    const char *name, const struct GNUNET_ECRS_MetaData *meta)
 {
-  struct ECRS_URI *advertisement;
-  struct ECRS_URI *rootURI;
+  struct GNUNET_ECRS_URI *advertisement;
+  struct GNUNET_ECRS_URI *rootURI;
   GNUNET_HashCode nextId;
   GNUNET_Int32Time now;
 
   GNUNET_mutex_lock (lock);
-  CO_stopCollection ();         /* cancel old collection */
-  GE_ASSERT (ectx, name != NULL);
-  advertisement = ECRS_parseCharKeywordURI (ectx, COLLECTION);
-  GE_ASSERT (ectx, advertisement != NULL);
+  GNUNET_CO_collection_stop ();         /* cancel old collection */
+  GNUNET_GE_ASSERT (ectx, name != NULL);
+  advertisement = GNUNET_ECRS_keyword_string_to_uri (ectx, COLLECTION);
+  GNUNET_GE_ASSERT (ectx, advertisement != NULL);
   GNUNET_get_time_int32 (&now);
   GNUNET_create_random_hash (&nextId);
-  rootURI = ECRS_createNamespace (ectx,
+  rootURI = GNUNET_ECRS_namespace_create (ectx,
                                   cfg,
                                   name,
                                   meta,
@@ -442,12 +442,12 @@
                                   &nextId);
   if (rootURI == NULL)
     {
-      ECRS_freeUri (advertisement);
+      GNUNET_ECRS_uri_destroy (advertisement);
       GNUNET_mutex_unlock (lock);
       return GNUNET_SYSERR;
     }
-  ECRS_freeUri (advertisement);
-  ECRS_freeUri (rootURI);
+  GNUNET_ECRS_uri_destroy (advertisement);
+  GNUNET_ECRS_uri_destroy (rootURI);
   collectionData = GNUNET_malloc (sizeof (CollectionInfo));
   memset (collectionData, 0, sizeof (CollectionInfo));
   GNUNET_create_random_hash (&collectionData->data.lastId);
@@ -455,7 +455,7 @@
   collectionData->data.updateInterval = htonl (updateInterval);
   collectionData->data.anonymityLevel = htonl (anonymityLevel);
   collectionData->data.priority = htonl (prio);
-  collectionData->meta = ECRS_dupMetaData (meta);
+  collectionData->meta = GNUNET_ECRS_meta_data_duplicate (meta);
   collectionData->name = GNUNET_strdup (name);
   GNUNET_mutex_unlock (lock);
   return GNUNET_OK;
@@ -467,7 +467,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if no collection is active
  */
 int
-CO_stopCollection ()
+GNUNET_CO_collection_stop ()
 {
   unsigned int i;
 
@@ -477,12 +477,12 @@
       GNUNET_mutex_unlock (lock);
       return GNUNET_SYSERR;
     }
-  ECRS_deleteNamespace (ectx, cfg, collectionData->name);
-  ECRS_freeMetaData (collectionData->meta);
+  GNUNET_ECRS_namespace_delete (ectx, cfg, collectionData->name);
+  GNUNET_ECRS_meta_data_destroy (collectionData->meta);
   for (i = 0; i < collectionData->file_count; i++)
     {
-      ECRS_freeMetaData (collectionData->files[i].meta);
-      ECRS_freeUri (collectionData->files[i].uri);
+      GNUNET_ECRS_meta_data_destroy (collectionData->files[i].meta);
+      GNUNET_ECRS_uri_destroy (collectionData->files[i].uri);
     }
   GNUNET_array_grow (collectionData->files, collectionData->file_count, 0);
   GNUNET_free (collectionData->name);
@@ -498,7 +498,7 @@
  * @return NULL if there is no collection, otherwise its name
  */
 char *
-CO_getCollection ()
+GNUNET_CO_collection_get_name ()
 {
   char *name;
 
@@ -531,12 +531,12 @@
  * time is desired.
  */
 void
-CO_publishCollectionNow ()
+GNUNET_CO_collection_publish_now ()
 {
   GNUNET_HashCode delta;
   GNUNET_Int32Time now;
-  struct ECRS_URI *uri;
-  struct ECRS_URI *directoryURI;
+  struct GNUNET_ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *directoryURI;
   unsigned long long dirLen;
   char *tmpName;
   int fd;
@@ -549,18 +549,18 @@
       return;
     }
   GNUNET_get_time_int32 (&now);
-  if ((ntohl (collectionData->data.updateInterval) != ECRS_SBLOCK_UPDATE_NONE)
+  if ((ntohl (collectionData->data.updateInterval) != 
GNUNET_ECRS_SBLOCK_UPDATE_NONE)
       && (ntohl (collectionData->data.updateInterval) !=
-          ECRS_SBLOCK_UPDATE_SPORADIC)
+          GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC)
       && (ntohl (collectionData->data.lastPublication) +
           ntohl (collectionData->data.updateInterval) < now))
     {
       GNUNET_mutex_unlock (lock);
       return;
     }
-  if ((ntohl (collectionData->data.updateInterval) != ECRS_SBLOCK_UPDATE_NONE)
+  if ((ntohl (collectionData->data.updateInterval) != 
GNUNET_ECRS_SBLOCK_UPDATE_NONE)
       && (ntohl (collectionData->data.updateInterval) !=
-          ECRS_SBLOCK_UPDATE_SPORADIC))
+          GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC))
     {
       GNUNET_hash_difference (&collectionData->data.nextId,
                               &collectionData->data.lastId, &delta);
@@ -577,14 +577,14 @@
   fd = mkstemp (tmpName);
   if (fd == -1)
     {
-      GE_LOG_STRERROR (ectx, GE_ERROR | GE_ADMIN | GE_BULK, "mkstemp");
+      GNUNET_GE_LOG_STRERROR (ectx, GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "mkstemp");
       GNUNET_free (tmpName);
       GNUNET_mutex_unlock (lock);
       return;
     }
   dirData = NULL;
-  GE_ASSERT (ectx,
-             GNUNET_OK == ECRS_createDirectory (ectx,
+  GNUNET_GE_ASSERT (ectx,
+             GNUNET_OK == GNUNET_ECRS_directory_create (ectx,
                                                 &dirData,
                                                 &dirLen,
                                                 collectionData->file_count,
@@ -592,7 +592,7 @@
                                                 collectionData->meta));
   if (-1 == WRITE (fd, dirData, dirLen))
     {
-      GE_LOG_STRERROR (ectx, GE_ERROR | GE_ADMIN | GE_BULK, "write");
+      GNUNET_GE_LOG_STRERROR (ectx, GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "write");
       GNUNET_free (tmpName);
       GNUNET_free (dirData);
       GNUNET_mutex_unlock (lock);
@@ -600,7 +600,7 @@
     }
   GNUNET_free (dirData);
   CLOSE (fd);
-  if (GNUNET_OK != ECRS_uploadFile (ectx, cfg, tmpName, GNUNET_NO,      /* 
indexing */
+  if (GNUNET_OK != GNUNET_ECRS_file_upload (ectx, cfg, tmpName, GNUNET_NO,     
 /* indexing */
                                     ntohl (collectionData->data.
                                            anonymityLevel),
                                     ntohl (collectionData->data.priority),
@@ -615,7 +615,7 @@
     }
   UNLINK (tmpName);
   GNUNET_free (tmpName);
-  uri = ECRS_addToNamespace (ectx,
+  uri = GNUNET_ECRS_namespace_add_content (ectx,
                              cfg,
                              collectionData->name,
                              ntohl (collectionData->data.anonymityLevel),
@@ -630,7 +630,7 @@
     {
       collectionData->data.lastPublication = htonl (now);
       collectionData->changed = GNUNET_NO;
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_uri_destroy (uri);
     }
   GNUNET_mutex_unlock (lock);
 }
@@ -649,19 +649,19 @@
  * ways to explicitly extend a collection.
  */
 void
-CO_publishToCollection (const ECRS_FileInfo * fi)
+GNUNET_CO_collection_add_item (const GNUNET_ECRS_FileInfo * fi)
 {
   unsigned int i;
-  ECRS_FileInfo fc;
+  GNUNET_ECRS_FileInfo fc;
 
-  if ((ECRS_isKeywordUri (fi->uri)))
+  if ((GNUNET_ECRS_uri_test_ksk (fi->uri)))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   if (lock == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   GNUNET_mutex_lock (lock);
@@ -672,18 +672,18 @@
     }
   for (i = 0; i < collectionData->file_count; i++)
     {
-      if (ECRS_equalsUri (fi->uri, collectionData->files[i].uri))
+      if (GNUNET_ECRS_uri_test_equal (fi->uri, collectionData->files[i].uri))
         {
           GNUNET_mutex_unlock (lock);
           return;
         }
     }
-  fc.uri = ECRS_dupUri (fi->uri);
-  fc.meta = ECRS_dupMetaData (fi->meta);
+  fc.uri = GNUNET_ECRS_uri_duplicate (fi->uri);
+  fc.meta = GNUNET_ECRS_meta_data_duplicate (fi->meta);
   GNUNET_array_append (collectionData->files, collectionData->file_count, fc);
   collectionData->changed = GNUNET_YES;
-  if (ntohl (collectionData->data.updateInterval) == ECRS_SBLOCK_UPDATE_NONE)
-    CO_publishCollectionNow ();
+  if (ntohl (collectionData->data.updateInterval) == 
GNUNET_ECRS_SBLOCK_UPDATE_NONE)
+    GNUNET_CO_collection_publish_now ();
   GNUNET_mutex_unlock (lock);
 }
 

Modified: GNUnet/src/applications/fs/collection/collectiontest.c
===================================================================
--- GNUnet/src/applications/fs/collection/collectiontest.c      2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/fs/collection/collectiontest.c      2007-11-25 
12:04:45 UTC (rev 5755)
@@ -30,86 +30,86 @@
 #include "gnunet_util_config_impl.h"
 #include "gnunet_util_network_client.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 #define START_DAEMON 1
 
 int
 main (int argc, char *argv[])
 {
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 #if START_DAEMON
   pid_t daemon;
 #endif
   int ok;
   struct GNUNET_ClientServerConnection *sock;
-  struct ECRS_MetaData *meta;
-  ECRS_FileInfo fi;
+  struct GNUNET_ECRS_MetaData *meta;
+  GNUNET_ECRS_FileInfo fi;
   char *have;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   sock = NULL;
   meta = NULL;
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          300 * GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
 #endif
   ok = GNUNET_YES;
-  meta = ECRS_createMetaData ();
-  ECRS_addToMetaData (meta, EXTRACTOR_MIMETYPE, "test/foo");
+  meta = GNUNET_ECRS_meta_data_create ();
+  GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_MIMETYPE, "test/foo");
   sock = GNUNET_client_connection_create (NULL, cfg);
   CHECK (sock != NULL);
-  CO_init (NULL, cfg);
+  GNUNET_CO_init (NULL, cfg);
 
   /* ACTUAL TEST CODE */
-  CO_stopCollection ();
-  ECRS_deleteNamespace (NULL, cfg, "test-collection");
-  CHECK (NULL == CO_getCollection ());
-  CHECK (GNUNET_OK == CO_startCollection (1, 100, 60,   /* 60s */
+  GNUNET_CO_collection_stop ();
+  GNUNET_ECRS_namespace_delete (NULL, cfg, "test-collection");
+  CHECK (NULL == GNUNET_CO_collection_get_name ());
+  CHECK (GNUNET_OK == GNUNET_CO_collection_start (1, 100, 60,   /* 60s */
                                           "test-collection", meta));
-  have = CO_getCollection ();
+  have = GNUNET_CO_collection_get_name ();
   CHECK (NULL != have);
   CHECK (0 == strcmp (have, "test-collection"));
   GNUNET_free (have);
   fi.meta = meta;
   fi.uri =
-    ECRS_stringToUri (NULL,
+    GNUNET_ECRS_string_to_uri (NULL,
                       
"gnunet://ecrs/chk/0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0");
-  CO_publishToCollection (&fi);
-  ECRS_freeUri (fi.uri);
-  CO_done ();
-  CO_init (NULL, cfg);
-  have = CO_getCollection ();
+  GNUNET_CO_collection_add_item (&fi);
+  GNUNET_ECRS_uri_destroy (fi.uri);
+  GNUNET_CO_done ();
+  GNUNET_CO_init (NULL, cfg);
+  have = GNUNET_CO_collection_get_name ();
   CHECK (NULL != have);
   CHECK (0 == strcmp (have, "test-collection"));
   GNUNET_free (have);
-  CO_publishCollectionNow ();
-  CO_stopCollection ();
-  ECRS_deleteNamespace (NULL, cfg, "test-collection");
-  CHECK (NULL == CO_getCollection ());
+  GNUNET_CO_collection_publish_now ();
+  GNUNET_CO_collection_stop ();
+  GNUNET_ECRS_namespace_delete (NULL, cfg, "test-collection");
+  CHECK (NULL == GNUNET_CO_collection_get_name ());
 
   /* END OF TEST CODE */
 FAILURE:
   if (sock != NULL)
     {
-      CO_done ();
+      GNUNET_CO_done ();
       GNUNET_client_connection_destroy (sock);
     }
   if (meta != NULL)
-    ECRS_freeMetaData (meta);
+    GNUNET_ECRS_meta_data_destroy (meta);
 #if START_DAEMON
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/ecrs/bincoder.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/bincoder.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/bincoder.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -62,7 +62,7 @@
   unsigned int hbits;
   char *ret;
 
-  GE_ASSERT (NULL, strlen (encTable__) == 64);
+  GNUNET_GE_ASSERT (NULL, strlen (encTable__) == 64);
   len = size * 8 / 6;
   if (((size * 8) % 6) != 0)
     len++;

Modified: GNUnet/src/applications/fs/ecrs/directory.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/directory.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/directory.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -33,7 +33,7 @@
  * are structured such that it is possible to iterate over the
  * individual blocks as well as over the entire directory.  Thus
  * a client can call this function on the lastBlock in the
- * ECRS_DownloadProgressCallback.  Note that if a directory entry
+ * GNUNET_ECRS_DownloadProgressCallback.  Note that if a directory entry
  * spans multiple blocks, listDirectory may signal an error when
  * run on individual blocks even if the final directory is intact.
  * <p>
@@ -50,17 +50,17 @@
  *         directory is malformed
  */
 int
-ECRS_listDirectory (struct GE_Context *ectx,
+GNUNET_ECRS_directory_list_contents (struct GNUNET_GE_Context *ectx,
                     const char *data,
                     unsigned long long len,
-                    struct ECRS_MetaData **md,
-                    ECRS_SearchProgressCallback spcb, void *spcbClosure)
+                    struct GNUNET_ECRS_MetaData **md,
+                    GNUNET_ECRS_SearchResultProcessor spcb, void *spcbClosure)
 {
   unsigned long long pos;
   unsigned long long align;
   unsigned int mdSize;
   unsigned long long epos;
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
   int count;
 
   count = 0;
@@ -73,12 +73,12 @@
       mdSize = ntohl (mdSize);
       if (mdSize > len - 8 - sizeof (unsigned int))
         return GNUNET_SYSERR;   /* invalid size */
-      *md = ECRS_deserializeMetaData (ectx,
+      *md = GNUNET_ECRS_meta_data_deserialize (ectx,
                                       &data[8 + sizeof (unsigned int)],
                                       mdSize);
       if (*md == NULL)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return GNUNET_SYSERR; /* malformed ! */
         }
       pos = 8 + sizeof (unsigned int) + mdSize;
@@ -109,17 +109,17 @@
       if (epos >= len)
         return GNUNET_SYSERR;   /* malformed - or partial download */
 
-      fi.uri = ECRS_stringToUri (ectx, &data[pos]);
+      fi.uri = GNUNET_ECRS_string_to_uri (ectx, &data[pos]);
       pos = epos + 1;
       if (fi.uri == NULL)
         {
           pos--;                /* go back to '\0' to force going to next 
alignment */
           continue;
         }
-      if (ECRS_isKeywordUri (fi.uri))
+      if (GNUNET_ECRS_uri_test_ksk (fi.uri))
         {
-          ECRS_freeUri (fi.uri);
-          GE_BREAK (ectx, 0);
+          GNUNET_ECRS_uri_destroy (fi.uri);
+          GNUNET_GE_BREAK (ectx, 0);
           return GNUNET_SYSERR; /* illegal in directory! */
         }
 
@@ -129,23 +129,23 @@
       pos += sizeof (unsigned int);
       if (pos + mdSize > len)
         {
-          ECRS_freeUri (fi.uri);
+          GNUNET_ECRS_uri_destroy (fi.uri);
           return GNUNET_SYSERR; /* malformed - or partial download */
         }
 
-      fi.meta = ECRS_deserializeMetaData (ectx, &data[pos], mdSize);
+      fi.meta = GNUNET_ECRS_meta_data_deserialize (ectx, &data[pos], mdSize);
       if (fi.meta == NULL)
         {
-          ECRS_freeUri (fi.uri);
-          GE_BREAK (ectx, 0);
+          GNUNET_ECRS_uri_destroy (fi.uri);
+          GNUNET_GE_BREAK (ectx, 0);
           return GNUNET_SYSERR; /* malformed ! */
         }
       pos += mdSize;
       count++;
       if (spcb != NULL)
         spcb (&fi, NULL, GNUNET_NO, spcbClosure);
-      ECRS_freeMetaData (fi.meta);
-      ECRS_freeUri (fi.uri);
+      GNUNET_ECRS_meta_data_destroy (fi.meta);
+      GNUNET_ECRS_uri_destroy (fi.uri);
     }
   return count;
 }
@@ -259,11 +259,11 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-ECRS_createDirectory (struct GE_Context *ectx,
+GNUNET_ECRS_directory_create (struct GNUNET_GE_Context *ectx,
                       char **data,
                       unsigned long long *len,
                       unsigned int count,
-                      const ECRS_FileInfo * fis, struct ECRS_MetaData *meta)
+                      const GNUNET_ECRS_FileInfo * fis, struct 
GNUNET_ECRS_MetaData *meta)
 {
   int i;
   int j;
@@ -277,26 +277,26 @@
 
   for (i = 0; i < count; i++)
     {
-      if (ECRS_isKeywordUri (fis[i].uri))
+      if (GNUNET_ECRS_uri_test_ksk (fis[i].uri))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return GNUNET_SYSERR; /* illegal in directory! */
         }
     }
   ucs = GNUNET_malloc (sizeof (char *) * count);
   size = 8 + sizeof (unsigned int);
-  size += ECRS_sizeofMetaData (meta, ECRS_SERIALIZE_FULL);
+  size += GNUNET_ECRS_meta_data_get_serialized_size (meta, 
GNUNET_ECRS_SERIALIZE_FULL);
   sizes = GNUNET_malloc (count * sizeof (unsigned long long));
   perm = GNUNET_malloc (count * sizeof (int));
   for (i = 0; i < count; i++)
     {
       perm[i] = i;
-      ucs[i] = ECRS_uriToString (fis[i].uri);
-      GE_ASSERT (ectx, ucs[i] != NULL);
-      psize = ECRS_sizeofMetaData (fis[i].meta, ECRS_SERIALIZE_FULL);
+      ucs[i] = GNUNET_ECRS_uri_to_string (fis[i].uri);
+      GNUNET_GE_ASSERT (ectx, ucs[i] != NULL);
+      psize = GNUNET_ECRS_meta_data_get_serialized_size (fis[i].meta, 
GNUNET_ECRS_SERIALIZE_FULL);
       if (psize == -1)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (sizes);
           GNUNET_free (perm);
           while (i >= 0)
@@ -323,12 +323,12 @@
   pos = 8;
   memcpy (*data, GNUNET_DIRECTORY_MAGIC, 8);
 
-  ret = ECRS_serializeMetaData (ectx,
+  ret = GNUNET_ECRS_meta_data_serialize (ectx,
                                 meta,
                                 &(*data)[pos + sizeof (unsigned int)],
                                 size - pos - sizeof (unsigned int),
-                                ECRS_SERIALIZE_FULL);
-  GE_ASSERT (ectx, ret != GNUNET_SYSERR);
+                                GNUNET_ECRS_SERIALIZE_FULL);
+  GNUNET_GE_ASSERT (ectx, ret != GNUNET_SYSERR);
   ret = htonl (ret);
   memcpy (&(*data)[pos], &ret, sizeof (unsigned int));
   pos += ntohl (ret) + sizeof (unsigned int);
@@ -343,12 +343,12 @@
       memcpy (&(*data)[pos], ucs[i], strlen (ucs[i]) + 1);
       pos += strlen (ucs[i]) + 1;
       GNUNET_free (ucs[i]);
-      ret = ECRS_serializeMetaData (ectx,
+      ret = GNUNET_ECRS_meta_data_serialize (ectx,
                                     fis[i].meta,
                                     &(*data)[pos + sizeof (unsigned int)],
                                     size - pos - sizeof (unsigned int),
-                                    ECRS_SERIALIZE_FULL);
-      GE_ASSERT (ectx, ret != GNUNET_SYSERR);
+                                    GNUNET_ECRS_SERIALIZE_FULL);
+      GNUNET_GE_ASSERT (ectx, ret != GNUNET_SYSERR);
       ret = htonl (ret);
       memcpy (&(*data)[pos], &ret, sizeof (unsigned int));
       pos += ntohl (ret) + sizeof (unsigned int);
@@ -356,7 +356,7 @@
   GNUNET_free (sizes);
   GNUNET_free (perm);
   GNUNET_free (ucs);
-  GE_ASSERT (ectx, pos == size);
+  GNUNET_GE_ASSERT (ectx, pos == size);
 
   return GNUNET_OK;
 }

Modified: GNUnet/src/applications/fs/ecrs/directorytest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/directorytest.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/ecrs/directorytest.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,13 +34,13 @@
 
 struct PCLS
 {
-  ECRS_FileInfo *fi;
+  GNUNET_ECRS_FileInfo *fi;
   unsigned int pos;
   unsigned int max;
 };
 
 static int
-processor (const ECRS_FileInfo * fi,
+processor (const GNUNET_ECRS_FileInfo * fi,
            const GNUNET_HashCode * key, int isRoot, void *cls)
 {
   struct PCLS *p = cls;
@@ -48,9 +48,9 @@
 
   for (i = 0; i < p->max; i++)
     {
-      if (ECRS_equalsMetaData (p->fi[i].meta,
+      if (GNUNET_ECRS_meta_data_test_equal (p->fi[i].meta,
                                fi->meta) &&
-          ECRS_equalsUri (p->fi[i].uri, fi->uri))
+          GNUNET_ECRS_uri_test_equal (p->fi[i].uri, fi->uri))
         {
           p->pos++;
           return GNUNET_OK;
@@ -65,9 +65,9 @@
 {
   char *data;
   unsigned long long dlen;
-  ECRS_FileInfo *fis;
-  struct ECRS_MetaData *meta;
-  struct ECRS_MetaData *meta2;
+  GNUNET_ECRS_FileInfo *fis;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta2;
   struct PCLS cls;
   int p;
   int q;
@@ -76,14 +76,14 @@
   int ret = 0;
 
   cls.max = i;
-  fis = GNUNET_malloc (sizeof (ECRS_FileInfo) * i);
+  fis = GNUNET_malloc (sizeof (GNUNET_ECRS_FileInfo) * i);
   for (p = 0; p < i; p++)
     {
-      fis[p].meta = ECRS_createMetaData ();
+      fis[p].meta = GNUNET_ECRS_meta_data_create ();
       for (q = 0; q <= p; q++)
         {
           GNUNET_snprintf (txt, 128, "%u -- %u\n", p, q);
-          ECRS_addToMetaData (fis[p].meta,
+          GNUNET_ECRS_meta_data_inser (fis[p].meta,
                               q % EXTRACTOR_getHighestKeywordTypeNumber (),
                               txt);
         }
@@ -91,54 +91,54 @@
                        512,
                        
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H000004400000.%u",
                        p);
-      fis[p].uri = ECRS_stringToUri (NULL, uri);
+      fis[p].uri = GNUNET_ECRS_string_to_uri (NULL, uri);
       if (fis[p].uri == NULL)
         {
-          ECRS_freeMetaData (fis[p].meta);
+          GNUNET_ECRS_meta_data_destroy (fis[p].meta);
           while (--p > 0)
             {
-              ECRS_freeMetaData (fis[p].meta);
-              ECRS_freeUri (fis[p].uri);
+              GNUNET_ECRS_meta_data_destroy (fis[p].meta);
+              GNUNET_ECRS_uri_destroy (fis[p].uri);
             }
           GNUNET_free (fis);
           ABORT ();             /* error in testcase */
         }
     }
-  meta = ECRS_createMetaData ();
-  ECRS_addToMetaData (meta, EXTRACTOR_TITLE, "A title");
-  ECRS_addToMetaData (meta, EXTRACTOR_AUTHOR, "An author");
-  if (GNUNET_OK != ECRS_createDirectory (NULL, &data, &dlen, i, fis, meta))
+  meta = GNUNET_ECRS_meta_data_create ();
+  GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_TITLE, "A title");
+  GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_AUTHOR, "An author");
+  if (GNUNET_OK != GNUNET_ECRS_directory_create (NULL, &data, &dlen, i, fis, 
meta))
     {
-      ECRS_freeMetaData (meta);
+      GNUNET_ECRS_meta_data_destroy (meta);
       for (p = 0; p < i; p++)
         {
-          ECRS_freeMetaData (fis[p].meta);
-          ECRS_freeUri (fis[p].uri);
+          GNUNET_ECRS_meta_data_destroy (fis[p].meta);
+          GNUNET_ECRS_uri_destroy (fis[p].uri);
         }
       GNUNET_free (fis);
       ABORT ();
     }
   cls.pos = 0;
   cls.fi = fis;
-  if (i != ECRS_listDirectory (NULL, data, dlen, &meta2, &processor, &cls))
+  if (i != GNUNET_ECRS_directory_list_contents (NULL, data, dlen, &meta2, 
&processor, &cls))
     {
       printf ("expected %u\n", i);
       ret = 1;
       goto END;
     }
-  if (!ECRS_equalsMetaData (meta, meta2))
+  if (!GNUNET_ECRS_meta_data_test_equal (meta, meta2))
     {
       ret = 1;
       goto END;
     }
 END:
   GNUNET_free (data);
-  ECRS_freeMetaData (meta);
-  ECRS_freeMetaData (meta2);
+  GNUNET_ECRS_meta_data_destroy (meta);
+  GNUNET_ECRS_meta_data_destroy (meta2);
   for (p = 0; p < i; p++)
     {
-      ECRS_freeMetaData (fis[p].meta);
-      ECRS_freeUri (fis[p].uri);
+      GNUNET_ECRS_meta_data_destroy (fis[p].meta);
+      GNUNET_ECRS_uri_destroy (fis[p].uri);
     }
   GNUNET_free (fis);
   return ret;

Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/download.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -67,7 +67,7 @@
 typedef struct IOContext
 {
 
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
   /**
    * A lock for synchronizing access.
@@ -126,8 +126,8 @@
           strcat (fn, ".A");
           fn[strlen (fn) - 1] += i;
           if (0 != UNLINK (fn))
-            GE_LOG (this->ectx,
-                    GE_WARNING | GE_BULK | GE_USER,
+            GNUNET_GE_LOG (this->ectx,
+                    GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                     _("Could not unlink temporary file `%s': %s\n"),
                     fn, STRERROR (errno));
           GNUNET_free (fn);
@@ -147,7 +147,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
 static int
-createIOContext (struct GE_Context *ectx,
+createIOContext (struct GNUNET_GE_Context *ectx,
                  IOContext * this,
                  int no_temporaries,
                  unsigned long long filesize, const char *filename)
@@ -157,7 +157,7 @@
   struct stat st;
 
   this->ectx = ectx;
-  GE_ASSERT (ectx, filename != NULL);
+  GNUNET_GE_ASSERT (ectx, filename != NULL);
   this->treedepth = computeDepth (filesize);
   this->lock = GNUNET_mutex_create (GNUNET_NO);
   this->handles = GNUNET_malloc (sizeof (int) * (this->treedepth + 1));
@@ -168,8 +168,8 @@
       /* if exists and oversized, truncate */
       if (truncate (filename, filesize) != 0)
         {
-          GE_LOG_STRERROR_FILE (ectx,
-                                GE_ERROR | GE_ADMIN | GE_BULK,
+          GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                                 "truncate", filename);
           return GNUNET_SYSERR;
         }
@@ -231,8 +231,8 @@
   ret = READ (this->handles[level], buf, len);
   GNUNET_mutex_unlock (this->lock);
 #if DEBUG_DOWNLOAD
-  GE_LOG (this->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (this->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "IOC read at level %u offset %llu wanted %u got %d\n",
           level, pos, len, ret);
 #endif
@@ -266,15 +266,15 @@
   ret = WRITE (this->handles[level], buf, len);
   if (ret != len)
     {
-      GE_LOG (this->ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (this->ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Write(%d, %p, %d) failed: %s\n"),
               this->handles[level], buf, len, STRERROR (errno));
     }
   GNUNET_mutex_unlock (this->lock);
 #if DEBUG_DOWNLOAD
-  GE_LOG (this->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (this->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "IOC write at level %u offset %llu writes %u\n", level, pos, len);
 #endif
   return ret;
@@ -336,7 +336,7 @@
    * Search handle of the last request (NULL if never
    * requested).
    */
-  struct FS_SEARCH_HANDLE *searchHandle;
+  struct GNUNET_FS_SearchHandle *searchHandle;
 
   /**
    * Last time the query was send.
@@ -383,13 +383,13 @@
    */
   RequestEntry **requestList;
 
-  struct FS_SEARCH_CONTEXT *sctx;
+  struct GNUNET_FS_SearchContext *sctx;
 
   struct GNUNET_ThreadHandle *requestThread;
 
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
   GNUNET_PeerIdentity target;
 
@@ -452,14 +452,14 @@
  * @return NULL on error
  */
 static RequestManager *
-createRequestManager (struct GE_Context *ectx, struct GC_Configuration *cfg)
+createRequestManager (struct GNUNET_GE_Context *ectx, struct 
GNUNET_GC_Configuration *cfg)
 {
   RequestManager *rm;
 
   rm = GNUNET_malloc (sizeof (RequestManager));
   rm->shutdown = GNUNET_NO;
   rm->lock = GNUNET_mutex_create (GNUNET_YES);
-  rm->sctx = FS_SEARCH_makeContext (ectx, cfg, rm->lock);
+  rm->sctx = GNUNET_FS_create_search_context (ectx, cfg, rm->lock);
   if (rm->sctx == NULL)
     {
       GNUNET_mutex_destroy (rm->lock);
@@ -486,8 +486,8 @@
   rm->congestionWindow = 1;     /* RSS is 1 */
   rm->ssthresh = 65535;
 #if DEBUG_DOWNLOAD
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "created request manager %p\n", rm);
 #endif
   return rm;
@@ -506,8 +506,8 @@
   int i;
 
 #if DEBUG_DOWNLOAD
-  GE_LOG (rm->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (rm->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "destroying request manager %p\n", rm);
 #endif
   GNUNET_mutex_lock (rm->lock);
@@ -520,12 +520,12 @@
   for (i = 0; i < rm->requestListIndex; i++)
     {
       if (rm->requestList[i]->searchHandle != NULL)
-        FS_stop_search (rm->sctx, rm->requestList[i]->searchHandle);
+        GNUNET_FS_stop_search (rm->sctx, rm->requestList[i]->searchHandle);
       GNUNET_free (rm->requestList[i]->node);
       GNUNET_free (rm->requestList[i]);
     }
   GNUNET_array_grow (rm->requestList, rm->requestListSize, 0);
-  FS_SEARCH_destroyContext (rm->sctx);
+  GNUNET_FS_destroy_search_context (rm->sctx);
   rm->sctx = NULL;
   GNUNET_mutex_destroy (rm->lock);
   GNUNET_thread_release_self (rm->requestThread);
@@ -568,14 +568,14 @@
   GNUNET_EncName enc;
 
   IF_GELOG (rm->ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&node->chk.query, &enc));
-  GE_LOG (rm->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (rm->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Queuing request (query: %s)\n", &enc);
 #endif
 
-  GE_ASSERT (rm->ectx, node != NULL);
+  GNUNET_GE_ASSERT (rm->ectx, node != NULL);
   entry = GNUNET_malloc (sizeof (RequestEntry));
   entry->node = node;
   entry->lasttime = 0;          /* never sent */
@@ -586,7 +586,7 @@
   GNUNET_mutex_lock (rm->lock);
   if (rm->shutdown == GNUNET_NO)
     {
-      GE_ASSERT (rm->ectx, rm->requestListSize > 0);
+      GNUNET_GE_ASSERT (rm->ectx, rm->requestListSize > 0);
       if (rm->requestListSize == rm->requestListIndex)
         GNUNET_array_grow (rm->requestList, rm->requestListSize,
                            rm->requestListSize * 2);
@@ -594,7 +594,7 @@
     }
   else
     {
-      GE_BREAK (rm->ectx, 0);
+      GNUNET_GE_BREAK (rm->ectx, 0);
       GNUNET_free (entry);
     }
   GNUNET_mutex_unlock (rm->lock);
@@ -625,14 +625,14 @@
               rm->requestList[rm->requestListIndex] = NULL;
               GNUNET_mutex_unlock (rm->lock);
               if (NULL != re->searchHandle)
-                FS_stop_search (rm->sctx, re->searchHandle);
+                GNUNET_FS_stop_search (rm->sctx, re->searchHandle);
               GNUNET_free (re);
               return;
             }
         }
     }
   GNUNET_mutex_unlock (rm->lock);
-  GE_BREAK (rm->ectx, 0);       /* uh uh - at least a memory leak... */
+  GNUNET_GE_BREAK (rm->ectx, 0);       /* uh uh - at least a memory leak... */
 }
 
 
@@ -652,7 +652,7 @@
   GNUNET_CronTime TTL_DECREMENT;
   RequestManager *rm;
   IOContext *ioc;
-  ECRS_DownloadProgressCallback dpcb;
+  GNUNET_ECRS_DownloadProgressCallback dpcb;
   void *dpcbClosure;
   unsigned int anonymityLevel;
 } CommonCtx;
@@ -670,15 +670,15 @@
   unsigned long long spos;
   unsigned long long epos;
 
-  GE_ASSERT (node->ctx->rm->ectx, node->offset < node->ctx->total);
+  GNUNET_GE_ASSERT (node->ctx->rm->ectx, node->offset < node->ctx->total);
   if (node->level == 0)
     {
       ret = DBLOCK_SIZE;
       if (node->offset + (unsigned long long) ret > node->ctx->total)
         ret = (unsigned int) (node->ctx->total - node->offset);
 #if DEBUG_DOWNLOAD
-      GE_LOG (node->ctx->rm->ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (node->ctx->rm->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Node at offset %llu and level %d has size %u\n",
               node->offset, node->level, ret);
 #endif
@@ -695,8 +695,8 @@
   if (ret * rsize < epos - spos)
     ret++;                      /* need to round up! */
 #if DEBUG_DOWNLOAD
-  GE_LOG (node->ctx->rm->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (node->ctx->rm->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Node at offset %llu and level %d has size %u\n",
           node->offset, node->level, ret * sizeof (CHK));
 #endif
@@ -754,7 +754,7 @@
       pos = i;
   if (pos == -1)
     {
-      /* GE_BREAK(ectx, 0); *//* should never happen */
+      /* GNUNET_GE_BREAK(ectx, 0); *//* should never happen */
       GNUNET_mutex_unlock (rm->lock);
       return;
     }
@@ -864,8 +864,8 @@
     ret = GNUNET_NO;
   GNUNET_free (data);
 #if DEBUG_DOWNLOAD
-  GE_LOG (node->ctx->rm->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (node->ctx->rm->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Checked presence of block at %llu level %u.  Result: %s\n",
           node->offset, node->level, ret == GNUNET_YES ? "YES" : "NO");
 #endif
@@ -881,7 +881,7 @@
 static void
 iblock_download_children (NodeClosure * node, char *data, unsigned int size)
 {
-  struct GE_Context *ectx = node->ctx->rm->ectx;
+  struct GNUNET_GE_Context *ectx = node->ctx->rm->ectx;
   int i;
   NodeClosure *child;
   unsigned int childcount;
@@ -889,11 +889,11 @@
   unsigned int levelSize;
   unsigned long long baseOffset;
 
-  GE_ASSERT (ectx, node->level > 0);
+  GNUNET_GE_ASSERT (ectx, node->level > 0);
   childcount = size / sizeof (CHK);
   if (size != childcount * sizeof (CHK))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   if (node->level == 1)
@@ -913,9 +913,9 @@
       child->ctx = node->ctx;
       child->chk = chks[i];
       child->offset = baseOffset + i * levelSize;
-      GE_ASSERT (ectx, child->offset < node->ctx->total);
+      GNUNET_GE_ASSERT (ectx, child->offset < node->ctx->total);
       child->level = node->level - 1;
-      GE_ASSERT (ectx, (child->level != 0) ||
+      GNUNET_GE_ASSERT (ectx, (child->level != 0) ||
                  ((child->offset % DBLOCK_SIZE) == 0));
       if (GNUNET_NO == checkPresent (child))
         addRequest (node->ctx->rm, child);
@@ -942,7 +942,7 @@
   GNUNET_AES_InitializationVector iv;
   GNUNET_AES_SessionKey skey;
 
-  GE_ASSERT (NULL, (data != NULL) && (hashcode != NULL) && (result != NULL));
+  GNUNET_GE_ASSERT (NULL, (data != NULL) && (hashcode != NULL) && (result != 
NULL));
   /* get key and init value from the GNUNET_hash code */
   GNUNET_hash_to_AES_key (hashcode, &skey, &iv);
   return GNUNET_AES_decrypt (&skey, data, size, &iv, result);
@@ -964,10 +964,10 @@
  */
 static int
 nodeReceive (const GNUNET_HashCode * query,
-             const Datastore_Value * reply, void *cls, unsigned long long uid)
+             const GNUNET_DatastoreValue * reply, void *cls, unsigned long 
long uid)
 {
   NodeClosure *node = cls;
-  struct GE_Context *ectx = node->ctx->rm->ectx;
+  struct GNUNET_GE_Context *ectx = node->ctx->rm->ectx;
   GNUNET_HashCode hc;
   unsigned int size;
   int i;
@@ -975,32 +975,32 @@
 #if DEBUG_DOWNLOAD
   GNUNET_EncName enc;
 
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Receiving reply to query `%s'\n", &enc);
 #endif
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              0 == memcmp (query, &node->chk.query, sizeof (GNUNET_HashCode)));
-  size = ntohl (reply->size) - sizeof (Datastore_Value);
+  size = ntohl (reply->size) - sizeof (GNUNET_DatastoreValue);
   if ((size <= sizeof (DBlock)) ||
       (size - sizeof (DBlock) != getNodeSize (node)))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;     /* invalid size! */
     }
   size -= sizeof (DBlock);
   data = GNUNET_malloc (size);
   if (GNUNET_SYSERR == decryptContent ((char *) &((DBlock *) & reply[1])[1],
                                        size, &node->chk.key, data))
-    GE_ASSERT (ectx, 0);
+    GNUNET_GE_ASSERT (ectx, 0);
   GNUNET_hash (data, size, &hc);
   if (0 != memcmp (&hc, &node->chk.key, sizeof (GNUNET_HashCode)))
     {
       delRequest (node->ctx->rm, node);
       GNUNET_free (data);
-      GE_BREAK (ectx, 0);
-      GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Decrypted content does not match key. "
                 "This is either a bug or a maliciously inserted "
                 "file. Download aborted.\n"));
@@ -1010,8 +1010,8 @@
   if (size != writeToIOC (node->ctx->ioc,
                           node->level, node->offset, data, size))
     {
-      GE_LOG_STRERROR (ectx,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "WRITE");
+      GNUNET_GE_LOG_STRERROR (ectx,
+                       GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_BULK, "WRITE");
       node->ctx->rm->abortFlag = GNUNET_YES;
       return GNUNET_SYSERR;
     }
@@ -1032,7 +1032,7 @@
           requestManagerEndgame (node->ctx->rm);
         }
     }
-  GE_ASSERT (node->ctx->rm->ectx, node->ctx->rm->requestThread != NULL);
+  GNUNET_GE_ASSERT (node->ctx->rm->ectx, node->ctx->rm->requestThread != NULL);
   GNUNET_thread_stop_sleep (node->ctx->rm->requestThread);
   GNUNET_free (data);
   GNUNET_free (node);
@@ -1074,7 +1074,7 @@
       struct GNUNET_ClientServerConnection *sock;
 
       sock = GNUNET_client_connection_create (rm->ectx, rm->cfg);
-      lastmpriority = FS_getAveragePriority (sock);
+      lastmpriority = GNUNET_FS_get_current_average_priority (sock);
       lastmpritime = now;
       GNUNET_client_connection_destroy (sock);
     }
@@ -1101,7 +1101,7 @@
   TTL_DECREMENT = entry->node->ctx->TTL_DECREMENT;
 
   if (entry->lastTimeout + TTL_DECREMENT > now)
-    GE_BREAK (rm->ectx, 0);
+    GNUNET_GE_BREAK (rm->ectx, 0);
   if (entry->lasttime == 0)
     {
       timeout = now + rm->initialTTL;
@@ -1145,21 +1145,21 @@
 
 #if DEBUG_DOWNLOAD
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&entry->node->chk.query, &enc));
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting FS search for %s:%llu:%u `%s'\n",
           entry->node->ctx->ioc->filename,
           entry->node->offset, entry->node->level, &enc);
 #endif
 
   if (entry->searchHandle != NULL)
-    FS_stop_search (rm->sctx, entry->searchHandle);
+    GNUNET_FS_stop_search (rm->sctx, entry->searchHandle);
   entry->searchHandle
-    = FS_start_search (rm->sctx,
+    = GNUNET_FS_start_search (rm->sctx,
                        rm->have_target == GNUNET_NO ? NULL : &rm->target,
-                       D_BLOCK,
+                       GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA,
                        1,
                        &entry->node->chk.query,
                        entry->node->ctx->anonymityLevel,
@@ -1189,10 +1189,10 @@
     {
       GNUNET_EncName enc;
       IF_GELOG (rm->ectx,
-                GE_WARNING | GE_BULK | GE_USER,
+                GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&entry->node->chk.key, &enc));
-      GE_LOG (rm->ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (rm->ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("Content `%s' seems to be not available on the network (tried 
%u times).\n"),
               &enc, entry->tries);
@@ -1235,7 +1235,7 @@
         }
       else if (rm->requestList[i]->searchHandle != NULL)
         {
-          FS_stop_search (rm->sctx, rm->requestList[i]->searchHandle);
+          GNUNET_FS_stop_search (rm->sctx, rm->requestList[i]->searchHandle);
           rm->requestList[i]->searchHandle = NULL;
         }
     }
@@ -1293,20 +1293,20 @@
  * @param filename where to store the file
  */
 int
-ECRS_downloadFile (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg,
-                   const struct ECRS_URI *uri,
+GNUNET_ECRS_file_download (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg,
+                   const struct GNUNET_ECRS_URI *uri,
                    const char *filename,
                    unsigned int anonymityLevel,
-                   ECRS_DownloadProgressCallback dpcb,
-                   void *dpcbClosure, ECRS_TestTerminate tt, void *ttClosure)
+                   GNUNET_ECRS_DownloadProgressCallback dpcb,
+                   void *dpcbClosure, GNUNET_ECRS_TestTerminate tt, void 
*ttClosure)
 {
-  return ECRS_downloadPartialFile (ectx,
+  return GNUNET_ECRS_file_download_partial (ectx,
                                    cfg,
                                    uri,
                                    filename,
                                    0,
-                                   ECRS_fileSize (uri),
+                                   GNUNET_ECRS_uri_get_file_siz (uri),
                                    anonymityLevel,
                                    GNUNET_NO, dpcb, dpcbClosure, tt,
                                    ttClosure);
@@ -1333,17 +1333,17 @@
  * @param length length of the download (starting at offset)
  */
 int
-ECRS_downloadPartialFile (struct GE_Context *ectx,
-                          struct GC_Configuration *cfg,
-                          const struct ECRS_URI *uri,
+GNUNET_ECRS_file_download_partial (struct GNUNET_GE_Context *ectx,
+                          struct GNUNET_GC_Configuration *cfg,
+                          const struct GNUNET_ECRS_URI *uri,
                           const char *filename,
                           unsigned long long offset,
                           unsigned long long length,
                           unsigned int anonymityLevel,
                           int no_temporaries,
-                          ECRS_DownloadProgressCallback dpcb,
+                          GNUNET_ECRS_DownloadProgressCallback dpcb,
                           void *dpcbClosure,
-                          ECRS_TestTerminate tt, void *ttClosure)
+                          GNUNET_ECRS_TestTerminate tt, void *ttClosure)
 {
   IOContext ioc;
   RequestManager *rm;
@@ -1358,11 +1358,11 @@
   struct stat buf;
 
 #if DEBUG_DOWNLOAD
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' running for file `%s'\n", __FUNCTION__, filename);
 #endif
-  GE_ASSERT (ectx, filename != NULL);
+  GNUNET_GE_ASSERT (ectx, filename != NULL);
   if ((filename[strlen (filename) - 1] == '/') ||
       (filename[strlen (filename) - 1] == '\\'))
     {
@@ -1408,7 +1408,7 @@
       GNUNET_free (realFN);
       return GNUNET_SYSERR;
     }
-  if (0 == ECRS_fileSize (uri))
+  if (0 == GNUNET_ECRS_uri_get_file_siz (uri))
     {
       ret = GNUNET_disk_file_open (ectx,
                                    realFN,
@@ -1423,9 +1423,9 @@
     }
   fid = uri->data.fi;
 
-  if ((!ECRS_isFileUri (uri)) && (!ECRS_isLocationUri (uri)))
+  if ((!GNUNET_ECRS_uri_test_chk (uri)) && (!GNUNET_ECRS_uri_test_loc (uri)))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       GNUNET_free (realFN);
       return GNUNET_SYSERR;
     }
@@ -1436,8 +1436,8 @@
                                     GNUNET_ntohll (fid.file_length), realFN))
     {
 #if DEBUG_DOWNLOAD
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "`%s' aborted for file `%s'\n", __FUNCTION__, realFN);
 #endif
       GNUNET_free (realFN);
@@ -1450,7 +1450,7 @@
       GNUNET_free (realFN);
       return GNUNET_SYSERR;
     }
-  if (ECRS_isLocationUri (uri))
+  if (GNUNET_ECRS_uri_test_loc (uri))
     {
       GNUNET_hash (&uri->data.loc.peer, sizeof (GNUNET_RSA_PublicKey),
                    &rm->target.hashPubKey);
@@ -1496,8 +1496,8 @@
   else
     {
 #if 0
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Download ends prematurely: %d %llu == %llu %d TT: %d\n",
               rm->requestListIndex,
               ctx.completed, ctx.total, rm->abortFlag, tt (ttClosure));
@@ -1514,8 +1514,8 @@
       freeIOC (&ioc, GNUNET_YES);
       if (0 != UNLINK (realFN))
         {
-          GE_LOG_STRERROR_FILE (ectx,
-                                GE_WARNING | GE_USER | GE_BULK,
+          GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                                 "unlink", realFN);
         }
       else
@@ -1540,8 +1540,8 @@
       freeIOC (&ioc, GNUNET_NO);        /* aborted */
     }
 #if DEBUG_DOWNLOAD
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' terminating for file `%s' with result %s\n",
           __FUNCTION__, filename,
           ret == GNUNET_OK ? "SUCCESS" : "INCOMPLETE");

Modified: GNUnet/src/applications/fs/ecrs/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/downloadtest.c      2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/ecrs/downloadtest.c      2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -31,7 +31,7 @@
 #include "gnunet_util_network_client.h"
 #include "tree.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 /**
  * Must be a multiple of 16k.
@@ -58,7 +58,7 @@
 }
 
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static char *
 makeName (unsigned int i)
@@ -73,14 +73,14 @@
   return fn;
 }
 
-static struct ECRS_URI *
+static struct GNUNET_ECRS_URI *
 uploadFile (unsigned int size)
 {
   int ret;
   char *name;
   int fd;
   char *buf;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
 
   name = makeName (size);
@@ -95,7 +95,7 @@
   WRITE (fd, buf, size);
   GNUNET_free (buf);
   CLOSE (fd);
-  ret = ECRS_uploadFile (NULL, cfg, name, GNUNET_YES,   /* index */
+  ret = GNUNET_ECRS_file_upload (NULL, cfg, name, GNUNET_YES,   /* index */
                          0,     /* anon */
                          0,     /* prio */
                          GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES, /* 
expire */
@@ -106,7 +106,7 @@
 }
 
 static int
-downloadFile (unsigned int size, const struct ECRS_URI *uri)
+downloadFile (unsigned int size, const struct GNUNET_ECRS_URI *uri)
 {
   int ret;
   char *tmpName;
@@ -117,16 +117,16 @@
   int j;
   char *tmp;
 
-  tmp = ECRS_uriToString (uri);
-  GE_LOG (NULL,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  tmp = GNUNET_ECRS_uri_to_string (uri);
+  GNUNET_GE_LOG (NULL,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting download of `%s'\n", tmp);
   GNUNET_free (tmp);
   tmpName = makeName (0);
   ret = GNUNET_SYSERR;
   for (j = SIZE - 16 * 1024; j >= 0; j -= 16 * 1024)
     {
-      if (GNUNET_OK == ECRS_downloadPartialFile (NULL,
+      if (GNUNET_OK == GNUNET_ECRS_file_download_partial (NULL,
                                                  cfg,
                                                  uri,
                                                  tmpName,
@@ -168,7 +168,7 @@
   char *name;
 
   name = makeName (size);
-  ret = ECRS_unindexFile (NULL, cfg, name, NULL, NULL, &testTerminate, NULL);
+  ret = GNUNET_ECRS_file_uninde (NULL, cfg, name, NULL, NULL, &testTerminate, 
NULL);
   if (0 != UNLINK (name))
     ret = GNUNET_SYSERR;
   GNUNET_free (name);
@@ -181,16 +181,16 @@
   pid_t daemon;
   int ok;
   struct GNUNET_ClientServerConnection *sock;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   sock = NULL;
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
@@ -204,7 +204,7 @@
   uri = uploadFile (SIZE);
   CHECK (NULL != uri);
   CHECK (GNUNET_OK == downloadFile (SIZE, uri));
-  ECRS_freeUri (uri);
+  GNUNET_ECRS_uri_destroy (uri);
   CHECK (GNUNET_OK == unindexFile (SIZE));
   fprintf (stderr, " Ok.\n");
 
@@ -213,8 +213,8 @@
 FAILURE:
   if (sock != NULL)
     GNUNET_client_connection_destroy (sock);
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
-  GC_free (cfg);
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/ecrs/ecrs.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrs.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/ecrs.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -30,7 +30,7 @@
 #include "ecrs.h"
 
 void
-ECRS_encryptInPlace (const GNUNET_HashCode * hc, void *data, unsigned int len)
+GNUNET_ECRS_encryptInPlace (const GNUNET_HashCode * hc, void *data, unsigned 
int len)
 {
   char *tmp;
   GNUNET_AES_SessionKey skey;
@@ -38,13 +38,13 @@
 
   GNUNET_hash_to_AES_key (hc, &skey, &iv);
   tmp = GNUNET_malloc (len);
-  GE_ASSERT (NULL, len == GNUNET_AES_encrypt (data, len, &skey, &iv, tmp));
+  GNUNET_GE_ASSERT (NULL, len == GNUNET_AES_encrypt (data, len, &skey, &iv, 
tmp));
   memcpy (data, tmp, len);
   GNUNET_free (tmp);
 }
 
 void
-ECRS_decryptInPlace (const GNUNET_HashCode * hc, void *data, unsigned int len)
+GNUNET_ECRS_decryptInPlace (const GNUNET_HashCode * hc, void *data, unsigned 
int len)
 {
   char *tmp;
   GNUNET_AES_SessionKey skey;
@@ -52,7 +52,7 @@
 
   GNUNET_hash_to_AES_key (hc, &skey, &iv);
   tmp = GNUNET_malloc (len);
-  GE_ASSERT (NULL, len == GNUNET_AES_decrypt (&skey, data, len, &iv, tmp));
+  GNUNET_GE_ASSERT (NULL, len == GNUNET_AES_decrypt (&skey, data, len, &iv, 
tmp));
   memcpy (data, tmp, len);
   GNUNET_free (tmp);
 }

Modified: GNUnet/src/applications/fs/ecrs/ecrs.h
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrs.h      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/ecrs.h      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -24,8 +24,8 @@
  * @author Igor Wronsky, Christian Grothoff
  */
 
-#ifndef ECRS_H
-#define ECRS_H
+#ifndef GNUNET_ECRS_H
+#define GNUNET_ECRS_H
 
 #include "ecrs_core.h"
 #include "tree.h"
@@ -39,8 +39,8 @@
  * are interpreted as durations (in seconds) for periodical
  * updates.
  */
-#define SBLOCK_UPDATE_SPORADIC ECRS_SBLOCK_UPDATE_SPORADIC
-#define SBLOCK_UPDATE_NONE     ECRS_SBLOCK_UPDATE_NONE
+#define SBLOCK_UPDATE_SPORADIC GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC
+#define SBLOCK_UPDATE_NONE     GNUNET_ECRS_SBLOCK_UPDATE_NONE
 
 
 #define BLOCK_ALIGN_SIZE (DBLOCK_SIZE)
@@ -75,7 +75,7 @@
 enum uri_types
 { chk, sks, ksk, loc };
 
-typedef struct ECRS_URI
+typedef struct GNUNET_ECRS_URI
 {
   enum uri_types type;
   union
@@ -104,17 +104,17 @@
 /**
  * Meta data to associate with a file, directory or namespace.
  */
-typedef struct ECRS_MetaData
+typedef struct GNUNET_ECRS_MetaData
 {
   unsigned int itemCount;
   Item *items;
 } MetaData;
 
 
-void ECRS_encryptInPlace (const GNUNET_HashCode * hc,
+void GNUNET_ECRS_encryptInPlace (const GNUNET_HashCode * hc,
                           void *data, unsigned int len);
 
-void ECRS_decryptInPlace (const GNUNET_HashCode * hc,
+void GNUNET_ECRS_decryptInPlace (const GNUNET_HashCode * hc,
                           void *data, unsigned int len);
 
 

Modified: GNUnet/src/applications/fs/ecrs/ecrstest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrstest.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/ecrstest.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -31,7 +31,7 @@
 #include "gnunet_util_network_client.h"
 #include "tree.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 static int
 testTerminate (void *unused)
@@ -39,7 +39,7 @@
   return GNUNET_OK;
 }
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static char *
 makeName (unsigned int i)
@@ -54,14 +54,14 @@
   return fn;
 }
 
-static struct ECRS_URI *
+static struct GNUNET_ECRS_URI *
 uploadFile (unsigned int size)
 {
   int ret;
   char *name;
   int fd;
   char *buf;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
 
   name = makeName (size);
@@ -76,7 +76,7 @@
   WRITE (fd, buf, size);
   GNUNET_free (buf);
   CLOSE (fd);
-  ret = ECRS_uploadFile (NULL, cfg, name, GNUNET_YES,   /* index */
+  ret = GNUNET_ECRS_file_upload (NULL, cfg, name, GNUNET_YES,   /* index */
                          0,     /* anon */
                          0,     /* prio */
                          GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES, /* 
expire */
@@ -84,19 +84,19 @@
                          NULL, &testTerminate, NULL, &uri);
   if (ret != GNUNET_SYSERR)
     {
-      struct ECRS_MetaData *meta;
-      struct ECRS_URI *key;
+      struct GNUNET_ECRS_MetaData *meta;
+      struct GNUNET_ECRS_URI *key;
       const char *keywords[2];
 
       keywords[0] = name;
       keywords[1] = NULL;
 
-      meta = ECRS_createMetaData ();
-      key = ECRS_keywordsToUri (keywords);
-      ret = ECRS_addToKeyspace (NULL, cfg, key, 0, 0, GNUNET_get_time () + 10 
* GNUNET_CRON_MINUTES,    /* expire */
+      meta = GNUNET_ECRS_meta_data_create ();
+      key = GNUNET_ECRS_keyword_strings_to_uri (keywords);
+      ret = GNUNET_ECRS_publish_under_keyword (NULL, cfg, key, 0, 0, 
GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,    /* expire */
                                 uri, meta);
-      ECRS_freeMetaData (meta);
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_meta_data_destroy (meta);
+      GNUNET_ECRS_uri_destroy (uri);
       GNUNET_free (name);
       if (ret == GNUNET_OK)
         {
@@ -104,7 +104,7 @@
         }
       else
         {
-          ECRS_freeUri (key);
+          GNUNET_ECRS_uri_destroy (key);
           return NULL;
         }
     }
@@ -116,18 +116,18 @@
 }
 
 static int
-searchCB (const ECRS_FileInfo * fi,
+searchCB (const GNUNET_ECRS_FileInfo * fi,
           const GNUNET_HashCode * key, int isRoot, void *closure)
 {
-  struct ECRS_URI **my = closure;
+  struct GNUNET_ECRS_URI **my = closure;
   char *tmp;
 
-  tmp = ECRS_uriToString (fi->uri);
-  GE_LOG (NULL,
-          GE_DEBUG | GE_REQUEST | GE_USER, "Search found URI `%s'\n", tmp);
+  tmp = GNUNET_ECRS_uri_to_string (fi->uri);
+  GNUNET_GE_LOG (NULL,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "Search found 
URI `%s'\n", tmp);
   GNUNET_free (tmp);
-  GE_ASSERT (NULL, NULL == *my);
-  *my = ECRS_dupUri (fi->uri);
+  GNUNET_GE_ASSERT (NULL, NULL == *my);
+  *my = GNUNET_ECRS_uri_duplicate (fi->uri);
   return GNUNET_SYSERR;         /* abort search */
 }
 
@@ -136,19 +136,19 @@
  * @return GNUNET_OK on success
  */
 static int
-searchFile (struct ECRS_URI **uri)
+searchFile (struct GNUNET_ECRS_URI **uri)
 {
   int ret;
-  struct ECRS_URI *myURI;
+  struct GNUNET_ECRS_URI *myURI;
 
   myURI = NULL;
-  ret = ECRS_search (NULL,
+  ret = GNUNET_ECRS_search (NULL,
                      cfg,
                      *uri,
                      0,
                      15 * GNUNET_CRON_SECONDS,
                      &searchCB, &myURI, &testTerminate, NULL);
-  ECRS_freeUri (*uri);
+  GNUNET_ECRS_uri_destroy (*uri);
   *uri = myURI;
   if ((ret != GNUNET_SYSERR) && (myURI != NULL))
     return GNUNET_OK;
@@ -157,7 +157,7 @@
 }
 
 static int
-downloadFile (unsigned int size, const struct ECRS_URI *uri)
+downloadFile (unsigned int size, const struct GNUNET_ECRS_URI *uri)
 {
   int ret;
   char *tmpName;
@@ -167,14 +167,14 @@
   int i;
   char *tmp;
 
-  tmp = ECRS_uriToString (uri);
-  GE_LOG (NULL,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  tmp = GNUNET_ECRS_uri_to_string (uri);
+  GNUNET_GE_LOG (NULL,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting download of `%s'\n", tmp);
   GNUNET_free (tmp);
   tmpName = makeName (0);
   ret = GNUNET_SYSERR;
-  if (GNUNET_OK == ECRS_downloadFile (NULL,
+  if (GNUNET_OK == GNUNET_ECRS_file_download (NULL,
                                       cfg,
                                       uri,
                                       tmpName, 0, NULL, NULL, &testTerminate,
@@ -210,7 +210,7 @@
   char *name;
 
   name = makeName (size);
-  ret = ECRS_unindexFile (NULL, cfg, name, NULL, NULL, &testTerminate, NULL);
+  ret = GNUNET_ECRS_file_uninde (NULL, cfg, name, NULL, NULL, &testTerminate, 
NULL);
   if (0 != UNLINK (name))
     ret = GNUNET_SYSERR;
   GNUNET_free (name);
@@ -238,17 +238,17 @@
   pid_t daemon;
   int ok;
   struct GNUNET_ClientServerConnection *sock;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   sock = NULL;
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
@@ -267,7 +267,7 @@
       CHECK (NULL != uri);
       CHECK (GNUNET_OK == searchFile (&uri));
       CHECK (GNUNET_OK == downloadFile (filesizes[i], uri));
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_uri_destroy (uri);
       CHECK (GNUNET_OK == unindexFile (filesizes[i]));
       fprintf (stderr, " Ok.\n");
       i++;
@@ -277,8 +277,8 @@
 FAILURE:
   if (sock != NULL)
     GNUNET_client_connection_destroy (sock);
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
-  GC_free (cfg);
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/ecrs/helper.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/helper.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/helper.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -36,19 +36,19 @@
  * @return an ECRS URI for the given keywords, NULL
  *  if keywords is not legal (i.e. empty).
  */
-struct ECRS_URI *
-ECRS_parseCharKeywordURI (struct GE_Context *ectx, const char *input)
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_keyword_string_to_uri (struct GNUNET_GE_Context *ectx, const char 
*input)
 {
   char **keywords;
   unsigned int num_Words;
   int inWord;
   char *c;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   char *searchString;
 
   if (input == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   searchString = GNUNET_strdup (input);
@@ -69,8 +69,8 @@
   if (num_Words == 0)
     {
       GNUNET_free_non_null (searchString);
-      GE_LOG (ectx,
-              GE_ERROR | GE_IMMEDIATE | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_IMMEDIATE | GNUNET_GE_USER,
               _("No keywords specified!\n"));
       return NULL;
     }
@@ -90,7 +90,7 @@
           ++num_Words;
         }
     }
-  uri = ECRS_parseArgvKeywordURI (ectx, num_Words, (const char **) keywords);
+  uri = GNUNET_ECRS_keyword_command_line_to_uri (ectx, num_Words, (const char 
**) keywords);
   GNUNET_free (keywords);
   GNUNET_free (searchString);
   return uri;
@@ -104,22 +104,22 @@
  * @return an ECRS URI for the given keywords, NULL
  *  if keywords is not legal (i.e. empty).
  */
-struct ECRS_URI *
-ECRS_parseArgvKeywordURI (struct GE_Context *ectx,
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_keyword_command_line_to_uri (struct GNUNET_GE_Context *ectx,
                           unsigned int num_keywords, const char **keywords)
 {
   unsigned int i;
   unsigned int uriLen;
   char *uriString;
   unsigned int uriSize;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   uriString = NULL;
   uriSize = 0;
   GNUNET_array_grow (uriString, uriSize, 4096);
-  strcpy (uriString, ECRS_URI_PREFIX);
-  strcat (uriString, ECRS_SEARCH_INFIX);
-  uriLen = 1 + strlen (ECRS_URI_PREFIX) + strlen (ECRS_SEARCH_INFIX);
+  strcpy (uriString, GNUNET_ECRS_URI_PREFIX);
+  strcat (uriString, GNUNET_ECRS_SEARCH_INFIX);
+  uriLen = 1 + strlen (GNUNET_ECRS_URI_PREFIX) + strlen 
(GNUNET_ECRS_SEARCH_INFIX);
 
 
   for (i = 0; i < num_keywords; i++)
@@ -145,7 +145,7 @@
           uriLen += strlen (keywords[i]);
         }
     }
-  uri = ECRS_stringToUri (ectx, uriString);
+  uri = GNUNET_ECRS_string_to_uri (ectx, uriString);
   GNUNET_array_grow (uriString, uriSize, 0);
   return uri;
 }
@@ -158,22 +158,22 @@
  * @return an ECRS URI for the given keywords, NULL
  *  if keywords is not legal (i.e. empty).
  */
-struct ECRS_URI *
-ECRS_parseListKeywordURI (struct GE_Context *ectx,
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_keyword_list_to_uri (struct GNUNET_GE_Context *ectx,
                           unsigned int num_keywords, const char **keywords)
 {
   unsigned int i;
   unsigned int uriLen;
   char *uriString;
   unsigned int uriSize;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   uriString = NULL;
   uriSize = 0;
   GNUNET_array_grow (uriString, uriSize, 4096);
-  strcpy (uriString, ECRS_URI_PREFIX);
-  strcat (uriString, ECRS_SEARCH_INFIX);
-  uriLen = 1 + strlen (ECRS_URI_PREFIX) + strlen (ECRS_SEARCH_INFIX);
+  strcpy (uriString, GNUNET_ECRS_URI_PREFIX);
+  strcat (uriString, GNUNET_ECRS_SEARCH_INFIX);
+  uriLen = 1 + strlen (GNUNET_ECRS_URI_PREFIX) + strlen 
(GNUNET_ECRS_SEARCH_INFIX);
 
 
   for (i = 0; i < num_keywords; i++)
@@ -189,7 +189,7 @@
       strcat (uriString, keywords[i]);
       uriLen += strlen (keywords[i]);
     }
-  uri = ECRS_stringToUri (ectx, uriString);
+  uri = GNUNET_ECRS_string_to_uri (ectx, uriString);
   GNUNET_array_grow (uriString, uriSize, 0);
   return uri;
 }

Modified: GNUnet/src/applications/fs/ecrs/indexinfo.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/indexinfo.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/indexinfo.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -39,8 +39,8 @@
  *  be notified that 'something is wrong')
  */
 int
-ECRS_isFileIndexed (struct GE_Context *ectx,
-                    struct GC_Configuration *cfg, const char *filename)
+GNUNET_ECRS_file_test_indexed (struct GNUNET_GE_Context *ectx,
+                    struct GNUNET_GC_Configuration *cfg, const char *filename)
 {
   GNUNET_HashCode hc;
   struct GNUNET_ClientServerConnection *sock;
@@ -51,15 +51,15 @@
   sock = GNUNET_client_connection_create (ectx, cfg);
   if (sock == NULL)
     return GNUNET_SYSERR;
-  ret = FS_testIndexed (sock, &hc);
+  ret = GNUNET_FS_test_indexed (sock, &hc);
   GNUNET_client_connection_destroy (sock);
   return ret;
 }
 
 struct iiC
 {
-  struct GE_Context *ectx;
-  ECRS_FileIterator iterator;
+  struct GNUNET_GE_Context *ectx;
+  GNUNET_ECRS_FileProcessor iterator;
   void *closure;
   int cnt;
 };
@@ -97,8 +97,8 @@
             }
           if (errno != EINVAL)
             {
-              GE_LOG_STRERROR_FILE (cls->ectx,
-                                    GE_WARNING | GE_BULK | GE_ADMIN | GE_USER,
+              GNUNET_GE_LOG_STRERROR_FILE (cls->ectx,
+                                    GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_ADMIN | GNUNET_GE_USER,
                                     "readlink", fullName);
             }
           GNUNET_free (lnkName);
@@ -137,9 +137,9 @@
  * @return number of files indexed, GNUNET_SYSERR if iterator aborted
  */
 int
-ECRS_iterateIndexedFiles (struct GE_Context *ectx,
-                          struct GC_Configuration *cfg,
-                          ECRS_FileIterator iterator, void *closure)
+GNUNET_ECRS_get_indexed_files (struct GNUNET_GE_Context *ectx,
+                          struct GNUNET_GC_Configuration *cfg,
+                          GNUNET_ECRS_FileProcessor iterator, void *closure)
 {
   char *tmp;
   char *indexDirectory;

Modified: GNUnet/src/applications/fs/ecrs/keyspace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/keyspace.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/keyspace.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -52,11 +52,11 @@
  * @return GNUNET_SYSERR if the entry is malformed
  */
 static int
-verifyKBlock (struct GE_Context *ectx,
-              const GNUNET_HashCode * key, Datastore_Value * value)
+verifyKBlock (struct GNUNET_GE_Context *ectx,
+              const GNUNET_HashCode * key, GNUNET_DatastoreValue * value)
 {
   unsigned int type;
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
   unsigned int size;
   GNUNET_HashCode query;
   KBlock *kb;
@@ -64,42 +64,42 @@
   int j;
 
   type = ntohl (value->type);
-  size = ntohl (value->size) - sizeof (Datastore_Value);
+  size = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
   if (GNUNET_OK !=
       getQueryFor (size, (DBlock *) & value[1], GNUNET_YES, &query))
     return GNUNET_SYSERR;
-  GE_ASSERT (ectx, type == K_BLOCK);
+  GNUNET_GE_ASSERT (ectx, type == GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
 
   if (size < sizeof (KBlock))
     return GNUNET_SYSERR;
   kb = (KBlock *) & value[1];
-  ECRS_decryptInPlace (key, &kb[1], size - sizeof (KBlock));
+  GNUNET_ECRS_decryptInPlace (key, &kb[1], size - sizeof (KBlock));
   j = sizeof (KBlock);
   while ((j < size) && (((const char *) kb)[j] != '\0'))
     j++;
   if (j == size)
     {
-      GE_BREAK (NULL, 0);       /* kblock malformed */
+      GNUNET_GE_BREAK (NULL, 0);       /* kblock malformed */
       return GNUNET_SYSERR;
     }
   dstURI = (const char *) &kb[1];
   j++;
-  fi.meta = ECRS_deserializeMetaData (ectx,
+  fi.meta = GNUNET_ECRS_meta_data_deserialize (ectx,
                                       &((const char *) kb)[j], size - j);
   if (fi.meta == NULL)
     {
-      GE_BREAK (ectx, 0);       /* kblock malformed */
+      GNUNET_GE_BREAK (ectx, 0);       /* kblock malformed */
       return GNUNET_SYSERR;
     }
-  fi.uri = ECRS_stringToUri (ectx, dstURI);
+  fi.uri = GNUNET_ECRS_string_to_uri (ectx, dstURI);
   if (fi.uri == NULL)
     {
-      GE_BREAK (ectx, 0);       /* kblock malformed */
-      ECRS_freeMetaData (fi.meta);
+      GNUNET_GE_BREAK (ectx, 0);       /* kblock malformed */
+      GNUNET_ECRS_meta_data_destroy (fi.meta);
       return GNUNET_SYSERR;
     }
-  ECRS_freeUri (fi.uri);
-  ECRS_freeMetaData (fi.meta);
+  GNUNET_ECRS_uri_destroy (fi.uri);
+  GNUNET_ECRS_meta_data_destroy (fi.meta);
   return GNUNET_OK;
 }
 
@@ -116,17 +116,17 @@
  *        entry?
  */
 int
-ECRS_addToKeyspace (struct GE_Context *ectx,
-                    struct GC_Configuration *cfg,
-                    const struct ECRS_URI *uri,
+GNUNET_ECRS_publish_under_keyword (struct GNUNET_GE_Context *ectx,
+                    struct GNUNET_GC_Configuration *cfg,
+                    const struct GNUNET_ECRS_URI *uri,
                     unsigned int anonymityLevel,
                     unsigned int priority,
                     GNUNET_CronTime expirationTime,
-                    const struct ECRS_URI *dst,
-                    const struct ECRS_MetaData *md)
+                    const struct GNUNET_ECRS_URI *dst,
+                    const struct GNUNET_ECRS_MetaData *md)
 {
   struct GNUNET_ClientServerConnection *sock;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   int ret;
   unsigned int size;
   unsigned int mdsize;
@@ -144,32 +144,32 @@
 #endif
   GNUNET_HashCode key;
   char *cpy;                    /* copy of the encrypted portion */
-  struct ECRS_URI *xuri;
+  struct GNUNET_ECRS_URI *xuri;
 
-  if (!ECRS_isKeywordUri (uri))
+  if (!GNUNET_ECRS_uri_test_ksk (uri))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
-  mdsize = ECRS_sizeofMetaData (md, ECRS_SERIALIZE_PART);
-  dstURI = ECRS_uriToString (dst);
+  mdsize = GNUNET_ECRS_meta_data_get_serialized_size (md, 
GNUNET_ECRS_SERIALIZE_PART);
+  dstURI = GNUNET_ECRS_uri_to_string (dst);
   size = mdsize + sizeof (KBlock) + strlen (dstURI) + 1;
   if (size > MAX_KBLOCK_SIZE)
     {
       size = MAX_KBLOCK_SIZE;
-      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
+      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
       kb = (KBlock *) & value[1];
-      kb->type = htonl (K_BLOCK);
+      kb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
       memcpy (&kb[1], dstURI, strlen (dstURI) + 1);
       mdsize = size - sizeof (KBlock) - strlen (dstURI) - 1;
-      mdsize = ECRS_serializeMetaData (ectx,
+      mdsize = GNUNET_ECRS_meta_data_serialize (ectx,
                                        md,
                                        &((char *) &kb[1])[strlen (dstURI) +
                                                           1], mdsize,
-                                       ECRS_SERIALIZE_PART);
+                                       GNUNET_ECRS_SERIALIZE_PART);
       if (mdsize == -1)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (dstURI);
           return GNUNET_SYSERR;
         }
@@ -177,33 +177,33 @@
     }
   else
     {
-      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
+      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
       kb = (KBlock *) & value[1];
-      kb->type = htonl (K_BLOCK);
+      kb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
       memcpy (&kb[1], dstURI, strlen (dstURI) + 1);
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  mdsize ==
-                 ECRS_serializeMetaData (ectx,
+                 GNUNET_ECRS_meta_data_serialize (ectx,
                                          md,
                                          &((char *) &kb[1])[strlen (dstURI) +
                                                             1], mdsize,
-                                         ECRS_SERIALIZE_FULL));
+                                         GNUNET_ECRS_SERIALIZE_FULL));
     }
-  value->size = htonl (sizeof (Datastore_Value) + size);
-  value->type = htonl (K_BLOCK);
+  value->size = htonl (sizeof (GNUNET_DatastoreValue) + size);
+  value->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
   value->prio = htonl (priority);
   value->anonymityLevel = htonl (anonymityLevel);
   value->expirationTime = GNUNET_htonll (expirationTime);
   sock = GNUNET_client_connection_create (ectx, cfg);
   ret = GNUNET_OK;
 
-  if (GC_get_configuration_value_yesno (cfg,
+  if (GNUNET_GC_get_configuration_value_yesno (cfg,
                                         "FS",
                                         "DISABLE-CREATION-TIME",
                                         GNUNET_NO) == GNUNET_YES)
-    xuri = ECRS_dupUri (uri);
+    xuri = GNUNET_ECRS_uri_duplicate (uri);
   else
-    xuri = ECRS_dateExpandKeywordUri (uri);
+    xuri = GNUNET_ECRS_uri_expand_keywords_with_date (uri);
   keywords = xuri->data.ksk.keywords;
   keywordCount = xuri->data.ksk.keywordCount;
   cpy = GNUNET_malloc (mdsize + strlen (dstURI) + 1);
@@ -213,32 +213,32 @@
       memcpy (&kb[1], cpy, mdsize + strlen (dstURI) + 1);
       GNUNET_hash (keywords[i], strlen (keywords[i]), &key);
 #if DEBUG_KEYSPACE
-      IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&key, &enc));
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Encrypting KBlock with key %s.\n", &enc);
 #endif
-      ECRS_encryptInPlace (&key, &kb[1], mdsize + strlen (dstURI) + 1);
+      GNUNET_ECRS_encryptInPlace (&key, &kb[1], mdsize + strlen (dstURI) + 1);
       pk = GNUNET_RSA_create_key_from_hash (&key);
       GNUNET_RSA_get_public_key (pk, &kb->keyspace);
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  GNUNET_OK == GNUNET_RSA_sign (pk,
                                                mdsize + strlen (dstURI) + 1,
                                                &kb[1], &kb->signature));
 #if EXTRA_CHECKS
       /* extra check: verify sig */
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  GNUNET_OK == getQueryFor (size, (DBlock *) kb, GNUNET_YES,
                                            &hc));
 #endif
       GNUNET_RSA_free_key (pk);
-      if (GNUNET_OK != FS_insert (sock, value))
+      if (GNUNET_OK != GNUNET_FS_insert (sock, value))
         ret = GNUNET_SYSERR;
 #if EXTRA_CHECKS
-      GE_ASSERT (ectx, GNUNET_OK == verifyKBlock (ectx, &key, value))
+      GNUNET_GE_ASSERT (ectx, GNUNET_OK == verifyKBlock (ectx, &key, value))
 #endif
     }
-  ECRS_freeUri (xuri);
+  GNUNET_ECRS_uri_destroy (xuri);
   GNUNET_free (cpy);
   GNUNET_free (dstURI);
   GNUNET_client_connection_destroy (sock);

Modified: GNUnet/src/applications/fs/ecrs/meta.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/meta.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/meta.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -35,7 +35,7 @@
  * Create a fresh MetaData token.
  */
 MetaData *
-ECRS_createMetaData ()
+GNUNET_ECRS_meta_data_create ()
 {
   MetaData *ret;
   ret = GNUNET_malloc (sizeof (MetaData));
@@ -48,7 +48,7 @@
  * Free meta data.
  */
 void
-ECRS_freeMetaData (MetaData * md)
+GNUNET_ECRS_meta_data_destroy (MetaData * md)
 {
   int i;
   for (i = 0; i < md->itemCount; i++)
@@ -62,15 +62,15 @@
  * to the meta-data.
  */
 void
-ECRS_addPublicationDateToMetaData (MetaData * md)
+GNUNET_ECRS_meta_data_add_publication_date (MetaData * md)
 {
   char *dat;
   GNUNET_Int32Time t;
 
   GNUNET_get_time_int32 (&t);
-  ECRS_delFromMetaData (md, EXTRACTOR_PUBLICATION_DATE, NULL);
+  GNUNET_ECRS_meta_data_delete (md, EXTRACTOR_PUBLICATION_DATE, NULL);
   dat = GNUNET_int32_time_to_string (&t);
-  ECRS_addToMetaData (md, EXTRACTOR_PUBLICATION_DATE, dat);
+  GNUNET_ECRS_meta_data_inser (md, EXTRACTOR_PUBLICATION_DATE, dat);
   GNUNET_free (dat);
 }
 
@@ -79,12 +79,12 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists
  */
 int
-ECRS_addToMetaData (MetaData * md,
+GNUNET_ECRS_meta_data_inser (MetaData * md,
                     EXTRACTOR_KeywordType type, const char *data)
 {
   int idx;
 
-  GE_ASSERT (NULL, data != NULL);
+  GNUNET_GE_ASSERT (NULL, data != NULL);
   for (idx = 0; idx < md->itemCount; idx++)
     {
       if ((md->items[idx].type == type) &&
@@ -103,7 +103,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md
  */
 int
-ECRS_delFromMetaData (MetaData * md,
+GNUNET_ECRS_meta_data_delete (MetaData * md,
                       EXTRACTOR_KeywordType type, const char *data)
 {
   int idx;
@@ -133,8 +133,8 @@
  * @return number of entries
  */
 int
-ECRS_getMetaData (const MetaData * md,
-                  ECRS_MetaDataIterator iterator, void *closure)
+GNUNET_ECRS_meta_data_get_contents (const MetaData * md,
+                  GNUNET_ECRS_MetaDataProcessor iterator, void *closure)
 {
   int i;
   int sub;
@@ -161,7 +161,7 @@
  * @return number of entries
  */
 char *
-ECRS_getFromMetaData (const MetaData * md, EXTRACTOR_KeywordType type)
+GNUNET_ECRS_meta_data_get_by_type (const MetaData * md, EXTRACTOR_KeywordType 
type)
 {
   int i;
 
@@ -177,7 +177,7 @@
  * @return number of entries
  */
 char *
-ECRS_getFirstFromMetaData (const MetaData * md, ...)
+GNUNET_ECRS_meta_data_get_first_by_types (const MetaData * md, ...)
 {
   char *ret;
   va_list args;
@@ -190,7 +190,7 @@
       type = va_arg (args, EXTRACTOR_KeywordType);
       if (type == -1)
         break;
-      ret = ECRS_getFromMetaData (md, type);
+      ret = GNUNET_ECRS_meta_data_get_by_type (md, type);
       if (ret != NULL)
         break;
     }
@@ -252,14 +252,14 @@
  * @return number of bytes in thumbnail, 0 if not available
  */
 size_t
-ECRS_getThumbnailFromMetaData (const struct ECRS_MetaData * md,
+GNUNET_ECRS_meta_data_get_thumbnail (const struct GNUNET_ECRS_MetaData * md,
                                unsigned char **thumb)
 {
   char *encoded;
   int ret;
   size_t size;
 
-  encoded = ECRS_getFromMetaData (md, EXTRACTOR_THUMBNAIL_DATA);
+  encoded = GNUNET_ECRS_meta_data_get_by_type (md, EXTRACTOR_THUMBNAIL_DATA);
   if (encoded == NULL)
     return 0;
   if (strlen (encoded) == 0)
@@ -280,16 +280,16 @@
  * Duplicate MetaData.
  */
 MetaData *
-ECRS_dupMetaData (const MetaData * md)
+GNUNET_ECRS_meta_data_duplicate (const MetaData * md)
 {
   int i;
   MetaData *ret;
 
   if (md == NULL)
     return NULL;
-  ret = ECRS_createMetaData ();
+  ret = GNUNET_ECRS_meta_data_create ();
   for (i = md->itemCount - 1; i >= 0; i--)
-    ECRS_addToMetaData (ret, md->items[i].type, md->items[i].data);
+    GNUNET_ECRS_meta_data_inser (ret, md->items[i].type, md->items[i].data);
   return ret;
 }
 
@@ -300,7 +300,7 @@
  *   of meta-data items obtained
  */
 int
-ECRS_extractMetaData (struct GE_Context *ectx,
+GNUNET_ECRS_meta_data_extract_from_file (struct GNUNET_GE_Context *ectx,
                       MetaData * md,
                       const char *filename,
                       EXTRACTOR_ExtractorList * extractors)
@@ -321,7 +321,7 @@
   while (pos != NULL)
     {
       if (GNUNET_OK ==
-          ECRS_addToMetaData (md, pos->keywordType, pos->keyword))
+          GNUNET_ECRS_meta_data_inser (md, pos->keywordType, pos->keyword))
         ret++;
       pos = pos->next;
     }
@@ -435,7 +435,7 @@
  *         space)
  */
 int
-ECRS_serializeMetaData (struct GE_Context *ectx,
+GNUNET_ECRS_meta_data_serialize (struct GNUNET_GE_Context *ectx,
                         const MetaData * md,
                         char *target, unsigned int max, int part)
 {
@@ -474,7 +474,7 @@
         }
 
       hdr->size = htonl (size);
-      if ((part & ECRS_SERIALIZE_NO_COMPRESS) == 0)
+      if ((part & GNUNET_ECRS_SERIALIZE_NO_COMPRESS) == 0)
         {
           pos = tryCompression ((char *) &hdr[1],
                                 size - sizeof (MetaDataHeader));
@@ -493,7 +493,7 @@
       GNUNET_free (hdr);
       hdr = NULL;
 
-      if ((part & ECRS_SERIALIZE_PART) == 0)
+      if ((part & GNUNET_ECRS_SERIALIZE_PART) == 0)
         {
           return GNUNET_SYSERR; /* does not fit! */
         }
@@ -503,16 +503,16 @@
       else
         ic--;                   /* small steps, we're close */
     }
-  GE_ASSERT (ectx, size <= max);
+  GNUNET_GE_ASSERT (ectx, size <= max);
   memcpy (target, hdr, size);
   GNUNET_free (hdr);
   /* extra check: deserialize! */
 #if EXTRA_CHECKS
   {
     MetaData *mdx;
-    mdx = ECRS_deserializeMetaData (ectx, target, size);
-    GE_ASSERT (ectx, NULL != mdx);
-    ECRS_freeMetaData (mdx);
+    mdx = GNUNET_ECRS_meta_data_deserialize (ectx, target, size);
+    GNUNET_GE_ASSERT (ectx, NULL != mdx);
+    GNUNET_ECRS_meta_data_destroy (mdx);
   }
 #endif
   return size;
@@ -524,7 +524,7 @@
  * than what is strictly needed.
  */
 unsigned int
-ECRS_sizeofMetaData (const MetaData * md, int part)
+GNUNET_ECRS_meta_data_get_serialized_size (const MetaData * md, int part)
 {
   MetaDataHeader *hdr;
   size_t size;
@@ -553,7 +553,7 @@
       memcpy (&((char *) hdr)[pos], md->items[i].data, len);
       pos += len;
     }
-  if ((part & ECRS_SERIALIZE_NO_COMPRESS) == 0)
+  if ((part & GNUNET_ECRS_SERIALIZE_NO_COMPRESS) == 0)
     {
       pos = tryCompression ((char *) &hdr[1], size - sizeof (MetaDataHeader));
     }
@@ -575,8 +575,8 @@
  * @return MD on success, NULL on error (i.e.
  *         bad format)
  */
-struct ECRS_MetaData *
-ECRS_deserializeMetaData (struct GE_Context *ectx,
+struct GNUNET_ECRS_MetaData *
+GNUNET_ECRS_meta_data_deserialize (struct GNUNET_GE_Context *ectx,
                           const char *input, unsigned int size)
 {
   MetaData *md;
@@ -602,7 +602,7 @@
       dataSize = ntohl (MAKE_UNALIGNED (hdr->size)) - sizeof (MetaDataHeader);
       if (dataSize > 2 * 1042 * 1024)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return NULL;          /* only 2 MB allowed [to make sure we don't 
blow
                                    our memory limit because of a mal-formed
                                    message... ] */
@@ -611,7 +611,7 @@
                          size - sizeof (MetaDataHeader), dataSize);
       if (data == NULL)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return NULL;
         }
     }
@@ -621,23 +621,23 @@
       dataSize = size - sizeof (MetaDataHeader);
       if (size != ntohl (MAKE_UNALIGNED (hdr->size)))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return NULL;
         }
     }
 
   if ((sizeof (unsigned int) * ic + ic) > dataSize)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       goto FAILURE;
     }
   if ((ic > 0) && (data[dataSize - 1] != '\0'))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       goto FAILURE;
     }
 
-  md = ECRS_createMetaData ();
+  md = GNUNET_ECRS_meta_data_create ();
   GNUNET_array_grow (md->items, md->itemCount, ic);
   i = 0;
   pos = sizeof (unsigned int) * ic;
@@ -652,7 +652,7 @@
     }
   if (i < ic)
     {                           /* oops */
-      ECRS_freeMetaData (md);
+      GNUNET_ECRS_meta_data_destroy (md);
       goto FAILURE;
     }
   if (compressed)
@@ -669,7 +669,7 @@
  * Checks if the mime-type is that of a GNUnet directory.
  */
 int
-ECRS_isDirectory (const MetaData * md)
+GNUNET_ECRS_meta_data_test_for_directory (const MetaData * md)
 {
   int i;
 
@@ -758,7 +758,7 @@
  * @return the new filename
  */
 char *
-ECRS_suggestFilename (struct GE_Context *ectx, const char *filename)
+GNUNET_ECRS_suggest_better_filename (struct GNUNET_GE_Context *ectx, const 
char *filename)
 {
   EXTRACTOR_ExtractorList *l;
   EXTRACTOR_KeywordList *list;
@@ -797,7 +797,7 @@
       while ((mimeMap[i][0] != NULL) && (0 != strcmp (mime, mimeMap[i][0])))
         i++;
       if (mimeMap[i][1] == NULL)
-        GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+        GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                 "Did not find mime type `%s' in extension list.\n", mime);
       mime = mimeMap[i][1];
     }
@@ -873,7 +873,7 @@
       if (0 != STAT (renameTo, &filestat))
         {
           if (0 != RENAME (filename, renameTo))
-            GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+            GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                     _("Renaming of file `%s' to `%s' failed: %s\n"),
                     filename, renameTo, STRERROR (errno));
           else
@@ -881,7 +881,7 @@
         }
       else
         {
-          GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                   _("Could not rename file `%s' to `%s': file exists\n"),
                   filename, renameTo);
         }
@@ -897,8 +897,8 @@
  * Test if two MDs are equal.
  */
 int
-ECRS_equalsMetaData (const struct ECRS_MetaData *md1,
-                     const struct ECRS_MetaData *md2)
+GNUNET_ECRS_meta_data_test_equal (const struct GNUNET_ECRS_MetaData *md1,
+                     const struct GNUNET_ECRS_MetaData *md2)
 {
   int i;
   int j;

Modified: GNUnet/src/applications/fs/ecrs/metatest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/metatest.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/metatest.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -30,64 +30,64 @@
 #include "gnunet_ecrs_lib.h"
 #include "ecrs.h"
 
-#define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if 
(m != NULL) ECRS_freeMetaData(m); return 1; }
+#define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if 
(m != NULL) GNUNET_ECRS_meta_data_destroy(m); return 1; }
 
 static int
 testMeta (int i)
 {
-  struct ECRS_MetaData *m;
+  struct GNUNET_ECRS_MetaData *m;
   char *val;
   int j;
   unsigned int size;
 
-  m = ECRS_createMetaData ();
-  if (GNUNET_OK != ECRS_addToMetaData (m, EXTRACTOR_TITLE, "TestTitle"))
+  m = GNUNET_ECRS_meta_data_create ();
+  if (GNUNET_OK != GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_TITLE, 
"TestTitle"))
     ABORT (m);
-  if (GNUNET_OK != ECRS_addToMetaData (m, EXTRACTOR_AUTHOR, "TestTitle"))
+  if (GNUNET_OK != GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_AUTHOR, 
"TestTitle"))
     ABORT (m);
-  if (GNUNET_OK == ECRS_addToMetaData (m, EXTRACTOR_TITLE, "TestTitle"))       
 /* dup! */
+  if (GNUNET_OK == GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_TITLE, 
"TestTitle"))        /* dup! */
     ABORT (m);
-  if (GNUNET_OK == ECRS_addToMetaData (m, EXTRACTOR_AUTHOR, "TestTitle"))      
 /* dup! */
+  if (GNUNET_OK == GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_AUTHOR, 
"TestTitle"))       /* dup! */
     ABORT (m);
-  if (2 != ECRS_getMetaData (m, NULL, NULL))
+  if (2 != GNUNET_ECRS_meta_data_get_contents (m, NULL, NULL))
     ABORT (m);
-  if (GNUNET_OK != ECRS_delFromMetaData (m, EXTRACTOR_AUTHOR, "TestTitle"))
+  if (GNUNET_OK != GNUNET_ECRS_meta_data_delete (m, EXTRACTOR_AUTHOR, 
"TestTitle"))
     ABORT (m);
-  if (GNUNET_OK == ECRS_delFromMetaData (m, EXTRACTOR_AUTHOR, "TestTitle"))    
 /* already gone */
+  if (GNUNET_OK == GNUNET_ECRS_meta_data_delete (m, EXTRACTOR_AUTHOR, 
"TestTitle"))     /* already gone */
     ABORT (m);
-  if (1 != ECRS_getMetaData (m, NULL, NULL))
+  if (1 != GNUNET_ECRS_meta_data_get_contents (m, NULL, NULL))
     ABORT (m);
-  if (GNUNET_OK != ECRS_delFromMetaData (m, EXTRACTOR_TITLE, "TestTitle"))
+  if (GNUNET_OK != GNUNET_ECRS_meta_data_delete (m, EXTRACTOR_TITLE, 
"TestTitle"))
     ABORT (m);
-  if (GNUNET_OK == ECRS_delFromMetaData (m, EXTRACTOR_TITLE, "TestTitle"))     
 /* already gone */
+  if (GNUNET_OK == GNUNET_ECRS_meta_data_delete (m, EXTRACTOR_TITLE, 
"TestTitle"))      /* already gone */
     ABORT (m);
-  if (0 != ECRS_getMetaData (m, NULL, NULL))
+  if (0 != GNUNET_ECRS_meta_data_get_contents (m, NULL, NULL))
     ABORT (m);
   val = GNUNET_malloc (256);
   for (j = 0; j < i; j++)
     {
       GNUNET_snprintf (val, 256, "%s.%d",
                        "A teststring that should compress well.", j);
-      if (GNUNET_OK != ECRS_addToMetaData (m, EXTRACTOR_UNKNOWN, val))
+      if (GNUNET_OK != GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_UNKNOWN, val))
         {
           GNUNET_free (val);
           ABORT (m);
         }
     }
   GNUNET_free (val);
-  if (i != ECRS_getMetaData (m, NULL, NULL))
+  if (i != GNUNET_ECRS_meta_data_get_contents (m, NULL, NULL))
     ABORT (m);
 
-  size = ECRS_sizeofMetaData (m, ECRS_SERIALIZE_FULL);
+  size = GNUNET_ECRS_meta_data_get_serialized_size (m, 
GNUNET_ECRS_SERIALIZE_FULL);
   val = GNUNET_malloc (size);
-  if (size != ECRS_serializeMetaData (NULL,
-                                      m, val, size, ECRS_SERIALIZE_FULL))
+  if (size != GNUNET_ECRS_meta_data_serialize (NULL,
+                                      m, val, size, 
GNUNET_ECRS_SERIALIZE_FULL))
     {
       GNUNET_free (val);
       ABORT (m);
     }
-  ECRS_freeMetaData (m);
-  m = ECRS_deserializeMetaData (NULL, val, size);
+  GNUNET_ECRS_meta_data_destroy (m);
+  m = GNUNET_ECRS_meta_data_deserialize (NULL, val, size);
   GNUNET_free (val);
   if (m == NULL)
     ABORT (m);
@@ -96,47 +96,47 @@
     {
       GNUNET_snprintf (val, 256, "%s.%d",
                        "A teststring that should compress well.", j);
-      if (GNUNET_OK != ECRS_delFromMetaData (m, EXTRACTOR_UNKNOWN, val))
+      if (GNUNET_OK != GNUNET_ECRS_meta_data_delete (m, EXTRACTOR_UNKNOWN, 
val))
         {
           GNUNET_free (val);
           ABORT (m);
         }
     }
   GNUNET_free (val);
-  if (0 != ECRS_getMetaData (m, NULL, NULL))
+  if (0 != GNUNET_ECRS_meta_data_get_contents (m, NULL, NULL))
     {
       ABORT (m);
     }
-  ECRS_freeMetaData (m);
+  GNUNET_ECRS_meta_data_destroy (m);
   return 0;
 }
 
 int
 testMetaMore (int i)
 {
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
   int q;
   char txt[128];
   char *data;
   unsigned long long size;
 
-  meta = ECRS_createMetaData ();
+  meta = GNUNET_ECRS_meta_data_create ();
   for (q = 0; q <= i; q++)
     {
       GNUNET_snprintf (txt, 128, "%u -- %u\n", i, q);
-      ECRS_addToMetaData (meta,
+      GNUNET_ECRS_meta_data_inser (meta,
                           q % EXTRACTOR_getHighestKeywordTypeNumber (), txt);
     }
-  size = ECRS_sizeofMetaData (meta, ECRS_SERIALIZE_FULL);
+  size = GNUNET_ECRS_meta_data_get_serialized_size (meta, 
GNUNET_ECRS_SERIALIZE_FULL);
   data = GNUNET_malloc (size * 4);
-  if (size != ECRS_serializeMetaData (NULL,
+  if (size != GNUNET_ECRS_meta_data_serialize (NULL,
                                       meta,
-                                      data, size * 4, ECRS_SERIALIZE_FULL))
+                                      data, size * 4, 
GNUNET_ECRS_SERIALIZE_FULL))
     {
       GNUNET_free (data);
       ABORT (meta);
     }
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   GNUNET_free (data);
   return 0;
 }

Modified: GNUnet/src/applications/fs/ecrs/metatest2.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/metatest2.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/metatest2.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -35,36 +35,36 @@
 static int
 testMeta ()
 {
-  struct ECRS_MetaData *m;
+  struct GNUNET_ECRS_MetaData *m;
   char *val;
   unsigned int size;
 
-  m = ECRS_createMetaData ();
-  if (GNUNET_OK != ECRS_addToMetaData (m, EXTRACTOR_UNKNOWN, "link"))
+  m = GNUNET_ECRS_meta_data_create ();
+  if (GNUNET_OK != GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_UNKNOWN, "link"))
     {
-      ECRS_freeMetaData (m);
+      GNUNET_ECRS_meta_data_destroy (m);
       ABORT ();
     }
-  if (GNUNET_OK != ECRS_addToMetaData (m, EXTRACTOR_FILENAME, "lib-link.m4"))
+  if (GNUNET_OK != GNUNET_ECRS_meta_data_inser (m, EXTRACTOR_FILENAME, 
"lib-link.m4"))
     {
-      ECRS_freeMetaData (m);
+      GNUNET_ECRS_meta_data_destroy (m);
       ABORT ();
     }
-  size = ECRS_sizeofMetaData (m, ECRS_SERIALIZE_FULL);
+  size = GNUNET_ECRS_meta_data_get_serialized_size (m, 
GNUNET_ECRS_SERIALIZE_FULL);
   val = GNUNET_malloc (size);
-  if (size != ECRS_serializeMetaData (NULL,
-                                      m, val, size, ECRS_SERIALIZE_FULL))
+  if (size != GNUNET_ECRS_meta_data_serialize (NULL,
+                                      m, val, size, 
GNUNET_ECRS_SERIALIZE_FULL))
     {
-      ECRS_freeMetaData (m);
+      GNUNET_ECRS_meta_data_destroy (m);
       GNUNET_free (val);
       ABORT ();
     }
-  ECRS_freeMetaData (m);
-  m = ECRS_deserializeMetaData (NULL, val, size);
+  GNUNET_ECRS_meta_data_destroy (m);
+  m = GNUNET_ECRS_meta_data_deserialize (NULL, val, size);
   GNUNET_free (val);
   if (m == NULL)
     ABORT ();
-  ECRS_freeMetaData (m);
+  GNUNET_ECRS_meta_data_destroy (m);
   return 0;
 }
 

Modified: GNUnet/src/applications/fs/ecrs/namespace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespace.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/namespace.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -38,16 +38,16 @@
 #define MAX_SBLOCK_SIZE 32000
 
 static char *
-getPseudonymFileName (struct GE_Context *ectx,
-                      struct GC_Configuration *cfg, const char *name)
+getPseudonymFileName (struct GNUNET_GE_Context *ectx,
+                      struct GNUNET_GC_Configuration *cfg, const char *name)
 {
   char *gnHome;
   char *fileName;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fileName);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, 
&fileName);
   gnHome = GNUNET_expand_file_name (ectx, fileName);
   GNUNET_free (fileName);
   fileName =
@@ -67,8 +67,8 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-ECRS_deleteNamespace (struct GE_Context *ectx,
-                      struct GC_Configuration *cfg, const char *name)
+GNUNET_ECRS_namespace_delete (struct GNUNET_GE_Context *ectx,
+                      struct GNUNET_GC_Configuration *cfg, const char *name)
 {
   char *fileName;
 
@@ -80,8 +80,8 @@
     }
   if (0 != UNLINK (fileName))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                             "unlink", fileName);
       GNUNET_free (fileName);
       return GNUNET_SYSERR;
@@ -110,18 +110,18 @@
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on error (namespace already 
exists)
  */
-struct ECRS_URI *
-ECRS_createNamespace (struct GE_Context *ectx,
-                      struct GC_Configuration *cfg,
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_namespace_create (struct GNUNET_GE_Context *ectx,
+                      struct GNUNET_GC_Configuration *cfg,
                       const char *name,
-                      const struct ECRS_MetaData *meta,
+                      const struct GNUNET_ECRS_MetaData *meta,
                       unsigned int anonymityLevel,
                       unsigned int priority,
                       GNUNET_CronTime expiration,
-                      const struct ECRS_URI *advertisementURI,
+                      const struct GNUNET_ECRS_URI *advertisementURI,
                       const GNUNET_HashCode * rootEntry)
 {
-  struct ECRS_URI *rootURI;
+  struct GNUNET_ECRS_URI *rootURI;
   char *fileName;
   struct GNUNET_RSA_PrivateKey *hk;
   GNUNET_RSA_PrivateKeyEncoded *hke;
@@ -129,8 +129,8 @@
   unsigned short len;
   GNUNET_HashCode hc;
   struct GNUNET_ClientServerConnection *sock;
-  Datastore_Value *value;
-  Datastore_Value *knvalue;
+  GNUNET_DatastoreValue *value;
+  GNUNET_DatastoreValue *knvalue;
   unsigned int size;
   unsigned int mdsize;
   struct GNUNET_RSA_PrivateKey *pk;
@@ -141,16 +141,16 @@
   int i;
   char *cpy;
 
-  if ((advertisementURI != NULL) && (!ECRS_isKeywordUri (advertisementURI)))
+  if ((advertisementURI != NULL) && (!GNUNET_ECRS_uri_test_ksk 
(advertisementURI)))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   fileName = getPseudonymFileName (ectx, cfg, name);
   if (GNUNET_YES == GNUNET_disk_file_test (ectx, fileName))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Cannot create pseudonym `%s', file `%s' exists.\n"),
               name, fileName);
       GNUNET_free (fileName);
@@ -166,23 +166,23 @@
 
   /* create advertisements */
 
-  mdsize = ECRS_sizeofMetaData (meta, ECRS_SERIALIZE_PART);
+  mdsize = GNUNET_ECRS_meta_data_get_serialized_size (meta, 
GNUNET_ECRS_SERIALIZE_PART);
   size = mdsize + sizeof (NBlock);
   if (size > MAX_NBLOCK_SIZE)
     {
       size = MAX_NBLOCK_SIZE;
-      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
+      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
       nb = (NBlock *) & value[1];
-      nb->type = htonl (N_BLOCK);
+      nb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE);
       mdsize = size - sizeof (NBlock);
-      mdsize = ECRS_serializeMetaData (ectx,
+      mdsize = GNUNET_ECRS_meta_data_serialize (ectx,
                                        meta,
                                        (char *) &nb[1],
-                                       mdsize, ECRS_SERIALIZE_PART);
+                                       mdsize, GNUNET_ECRS_SERIALIZE_PART);
       if (mdsize == -1)
         {
-          GE_BREAK (ectx, 0);
-          ECRS_deleteNamespace (ectx, cfg, name);
+          GNUNET_GE_BREAK (ectx, 0);
+          GNUNET_ECRS_namespace_delete (ectx, cfg, name);
           GNUNET_RSA_free_key (hk);
           return NULL;
         }
@@ -190,15 +190,15 @@
     }
   else
     {
-      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
+      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
       nb = (NBlock *) & value[1];
-      nb->type = htonl (N_BLOCK);
-      ECRS_serializeMetaData (ectx,
+      nb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE);
+      GNUNET_ECRS_meta_data_serialize (ectx,
                               meta,
-                              (char *) &nb[1], mdsize, ECRS_SERIALIZE_FULL);
+                              (char *) &nb[1], mdsize, 
GNUNET_ECRS_SERIALIZE_FULL);
     }
-  value->size = htonl (sizeof (Datastore_Value) + size);
-  value->type = htonl (N_BLOCK);
+  value->size = htonl (sizeof (GNUNET_DatastoreValue) + size);
+  value->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE);
   value->prio = htonl (priority);
   value->anonymityLevel = htonl (anonymityLevel);
   value->expirationTime = GNUNET_htonll (expiration);
@@ -215,31 +215,31 @@
 
   nb->rootEntry = *rootEntry;
 
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_OK == GNUNET_RSA_sign (hk,
                                            mdsize +
                                            3 * sizeof (GNUNET_HashCode),
                                            &nb->identifier, &nb->signature));
-  if (GNUNET_OK != FS_insert (sock, value))
+  if (GNUNET_OK != GNUNET_FS_insert (sock, value))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       GNUNET_free (rootURI);
       GNUNET_free (value);
       GNUNET_client_connection_destroy (sock);
       GNUNET_RSA_free_key (hk);
-      ECRS_deleteNamespace (ectx, cfg, name);
+      GNUNET_ECRS_namespace_delete (ectx, cfg, name);
       return NULL;
     }
 
 
   /* publish KNBlocks */
   size += sizeof (KNBlock) - sizeof (NBlock);
-  knvalue = GNUNET_malloc (sizeof (Datastore_Value) + size);
+  knvalue = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
   *knvalue = *value;
-  knvalue->type = htonl (KN_BLOCK);
-  knvalue->size = htonl (sizeof (Datastore_Value) + size);
+  knvalue->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD_FOR_NAMESPACE);
+  knvalue->size = htonl (sizeof (GNUNET_DatastoreValue) + size);
   knb = (KNBlock *) & knvalue[1];
-  knb->type = htonl (KN_BLOCK);
+  knb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD_FOR_NAMESPACE);
   memcpy (&knb->nblock, nb, sizeof (NBlock) + mdsize);
 
   if (advertisementURI != NULL)
@@ -254,25 +254,25 @@
           GNUNET_hash (keywords[i], strlen (keywords[i]), &hc);
           pk = GNUNET_RSA_create_key_from_hash (&hc);
           GNUNET_RSA_get_public_key (pk, &knb->kblock.keyspace);
-          GE_ASSERT (ectx, size - sizeof (KBlock) - sizeof (unsigned int)
+          GNUNET_GE_ASSERT (ectx, size - sizeof (KBlock) - sizeof (unsigned 
int)
                      == sizeof (NBlock) + mdsize);
-          ECRS_encryptInPlace (&hc,
+          GNUNET_ECRS_encryptInPlace (&hc,
                                &knb->nblock,
                                size - sizeof (KBlock) -
                                sizeof (unsigned int));
 
-          GE_ASSERT (ectx,
+          GNUNET_GE_ASSERT (ectx,
                      GNUNET_OK == GNUNET_RSA_sign (pk,
                                                    sizeof (NBlock) + mdsize,
                                                    &knb->nblock,
                                                    &knb->kblock.signature));
           /* extra check: verify sig */
           GNUNET_RSA_free_key (pk);
-          if (GNUNET_OK != FS_insert (sock, knvalue))
+          if (GNUNET_OK != GNUNET_FS_insert (sock, knvalue))
             {
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               GNUNET_free (rootURI);
-              ECRS_deleteNamespace (ectx, cfg, name);
+              GNUNET_ECRS_namespace_delete (ectx, cfg, name);
               GNUNET_free (cpy);
               GNUNET_free (knvalue);
               GNUNET_free (value);
@@ -302,8 +302,8 @@
  * @return GNUNET_OK if the namespace exists, GNUNET_SYSERR if not
  */
 int
-ECRS_testNamespaceExists (struct GE_Context *ectx,
-                          struct GC_Configuration *cfg,
+GNUNET_ECRS_namespace_test_exists (struct GNUNET_GE_Context *ectx,
+                          struct GNUNET_GC_Configuration *cfg,
                           const char *name, const GNUNET_HashCode * hc)
 {
   struct GNUNET_RSA_PrivateKey *hk;
@@ -323,7 +323,7 @@
     }
   if (len < 2)
     {
-      GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("File `%s' does not contain a pseudonym.\n"), fileName);
       GNUNET_free (fileName);
       return GNUNET_SYSERR;
@@ -334,8 +334,8 @@
   hke = (GNUNET_RSA_PrivateKeyEncoded *) dst;
   if (ntohs (hke->len) != len)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Format of pseudonym `%s' is invalid.\n"), name);
       GNUNET_free (hke);
       return GNUNET_SYSERR;
@@ -363,9 +363,9 @@
  * @param md what meta-data should be associated with the
  *        entry?
  */
-struct ECRS_URI *
-ECRS_addToNamespace (struct GE_Context *ectx,
-                     struct GC_Configuration *cfg,
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_namespace_add_content (struct GNUNET_GE_Context *ectx,
+                     struct GNUNET_GC_Configuration *cfg,
                      const char *name,
                      unsigned int anonymityLevel,
                      unsigned int priority,
@@ -374,12 +374,12 @@
                      GNUNET_Int32Time updateInterval,
                      const GNUNET_HashCode * thisId,
                      const GNUNET_HashCode * nextId,
-                     const struct ECRS_URI *dstU,
-                     const struct ECRS_MetaData *md)
+                     const struct GNUNET_ECRS_URI *dstU,
+                     const struct GNUNET_ECRS_MetaData *md)
 {
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   struct GNUNET_ClientServerConnection *sock;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   unsigned int size;
   unsigned int mdsize;
   struct GNUNET_RSA_PrivateKey *hk;
@@ -403,7 +403,7 @@
     }
   if (len < 2)
     {
-      GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("File `%s' does not contain a pseudonym.\n"), fileName);
       GNUNET_free (fileName);
       return NULL;
@@ -414,7 +414,7 @@
   hke = (GNUNET_RSA_PrivateKeyEncoded *) dst;
   if (ntohs (hke->len) != len)
     {
-      GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Format of pseudonym `%s' is invalid.\n"), name);
       GNUNET_free (hke);
       return NULL;
@@ -425,25 +425,25 @@
     return NULL;
 
   /* THEN: construct SBlock */
-  dstURI = ECRS_uriToString (dstU);
-  mdsize = ECRS_sizeofMetaData (md, ECRS_SERIALIZE_PART);
+  dstURI = GNUNET_ECRS_uri_to_string (dstU);
+  mdsize = GNUNET_ECRS_meta_data_get_serialized_size (md, 
GNUNET_ECRS_SERIALIZE_PART);
   size = mdsize + sizeof (SBlock) + strlen (dstURI) + 1;
   if (size > MAX_SBLOCK_SIZE)
     {
       size = MAX_SBLOCK_SIZE;
-      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
+      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
       sb = (SBlock *) & value[1];
-      sb->type = htonl (S_BLOCK);
+      sb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED);
       destPos = (char *) &sb[1];
       memcpy (destPos, dstURI, strlen (dstURI) + 1);
       mdsize = size - sizeof (SBlock) - strlen (dstURI) - 1;
-      mdsize = ECRS_serializeMetaData (ectx,
+      mdsize = GNUNET_ECRS_meta_data_serialize (ectx,
                                        md,
                                        &destPos[strlen (dstURI) + 1],
-                                       mdsize, ECRS_SERIALIZE_PART);
+                                       mdsize, GNUNET_ECRS_SERIALIZE_PART);
       if (mdsize == -1)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (dstURI);
           GNUNET_RSA_free_key (hk);
           return NULL;
@@ -452,18 +452,18 @@
     }
   else
     {
-      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
+      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + size);
       sb = (SBlock *) & value[1];
-      sb->type = htonl (S_BLOCK);
+      sb->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED);
       destPos = (char *) &sb[1];
       memcpy (destPos, dstURI, strlen (dstURI) + 1);
-      ECRS_serializeMetaData (ectx,
+      GNUNET_ECRS_meta_data_serialize (ectx,
                               md,
                               &destPos[strlen (dstURI) + 1],
-                              mdsize, ECRS_SERIALIZE_FULL);
+                              mdsize, GNUNET_ECRS_SERIALIZE_FULL);
     }
-  value->size = htonl (sizeof (Datastore_Value) + size);
-  value->type = htonl (S_BLOCK);
+  value->size = htonl (sizeof (GNUNET_DatastoreValue) + size);
+  value->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED);
   value->prio = htonl (priority);
   value->anonymityLevel = htonl (anonymityLevel);
   value->expirationTime = GNUNET_htonll (expiration);
@@ -484,7 +484,7 @@
   uri->data.sks.namespace = namespace;
   uri->data.sks.identifier = *thisId;
 
-  ECRS_encryptInPlace (thisId,
+  GNUNET_ECRS_encryptInPlace (thisId,
                        &sb->creationTime,
                        size
                        - sizeof (unsigned int)
@@ -492,7 +492,7 @@
                        - sizeof (GNUNET_RSA_PublicKey) -
                        sizeof (GNUNET_HashCode));
   /* FINALLY: GNUNET_RSA_sign & publish SBlock */
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_OK == GNUNET_RSA_sign (hk,
                                            size
                                            - sizeof (GNUNET_RSA_Signature)
@@ -502,7 +502,7 @@
   GNUNET_RSA_free_key (hk);
 
   sock = GNUNET_client_connection_create (ectx, cfg);
-  ret = FS_insert (sock, value);
+  ret = GNUNET_FS_insert (sock, value);
   if (ret != GNUNET_OK)
     {
       GNUNET_free (uri);
@@ -517,9 +517,9 @@
 
 struct lNCLS
 {
-  struct GE_Context *ectx;
-  struct GC_Configuration *cfg;
-  ECRS_NamespaceInfoCallback cb;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
+  GNUNET_ECRS_NamespaceInfoProcessor cb;
   void *cls;
   int cnt;
 };
@@ -545,8 +545,8 @@
     }
   if (len < 2)
     {
-      GE_LOG (c->ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (c->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("File `%s' does not contain a pseudonym.\n"), fileName);
       GNUNET_free (fileName);
       return GNUNET_OK;
@@ -556,8 +556,8 @@
   hke = (GNUNET_RSA_PrivateKeyEncoded *) dst;
   if (ntohs (hke->len) != len)
     {
-      GE_LOG (c->ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (c->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Format of file `%s' is invalid.\n"), fileName);
       GNUNET_free (hke);
       GNUNET_free (fileName);
@@ -567,11 +567,11 @@
   GNUNET_free (hke);
   if (hk == NULL)
     {
-      GE_LOG (c->ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (c->ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Format of file `%s' is invalid.\n"), fileName);
       GNUNET_free (fileName);
-      GE_BREAK (c->ectx, 0);
+      GNUNET_GE_BREAK (c->ectx, 0);
       return GNUNET_SYSERR;
     }
   GNUNET_free (fileName);
@@ -597,9 +597,9 @@
  * @return GNUNET_SYSERR on error, otherwise the number of pseudonyms in list
  */
 int
-ECRS_listNamespaces (struct GE_Context *ectx,
-                     struct GC_Configuration *cfg,
-                     ECRS_NamespaceInfoCallback cb, void *cls)
+GNUNET_ECRS_get_namespaces (struct GNUNET_GE_Context *ectx,
+                     struct GNUNET_GC_Configuration *cfg,
+                     GNUNET_ECRS_NamespaceInfoProcessor cb, void *cls)
 {
   char *dirName;
   struct lNCLS myCLS;

Modified: GNUnet/src/applications/fs/ecrs/namespacetest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespacetest.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/ecrs/namespacetest.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -36,22 +36,22 @@
 
 #define CHECKNAME "gnunet-namespace-test"
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static int match;
 
 static int
-spcb (const ECRS_FileInfo * fi,
+spcb (const GNUNET_ECRS_FileInfo * fi,
       const GNUNET_HashCode * key, int isRoot, void *closure)
 {
-  struct ECRS_URI *want = closure;
+  struct GNUNET_ECRS_URI *want = closure;
 
-  if (ECRS_equalsUri (want, fi->uri))
+  if (GNUNET_ECRS_uri_test_equal (want, fi->uri))
     match = 1;
   else
     fprintf (stderr,
              "Namespace search returned unexpected result: \nHAVE: %s\nWANT: 
%s...\n",
-             ECRS_uriToString (fi->uri), ECRS_uriToString (want));
+             GNUNET_ECRS_uri_to_string (fi->uri), GNUNET_ECRS_uri_to_string 
(want));
   return GNUNET_OK;
 }
 
@@ -61,23 +61,23 @@
   GNUNET_HashCode root;
   GNUNET_HashCode thisId;
   GNUNET_HashCode nextId;
-  struct ECRS_URI *adv;
-  struct ECRS_URI *uri;
-  struct ECRS_URI *advURI;
-  struct ECRS_URI *rootURI;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *adv;
+  struct GNUNET_ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *advURI;
+  struct GNUNET_ECRS_URI *rootURI;
+  struct GNUNET_ECRS_MetaData *meta;
   const char *keys[] = {
     "testNamespace",
     NULL,
   };
 
 
-  ECRS_deleteNamespace (NULL, cfg, CHECKNAME);  /* make sure old one is 
deleted */
-  meta = ECRS_createMetaData ();
-  adv = ECRS_keywordsToUri (keys);
+  GNUNET_ECRS_namespace_delete (NULL, cfg, CHECKNAME);  /* make sure old one 
is deleted */
+  meta = GNUNET_ECRS_meta_data_create ();
+  adv = GNUNET_ECRS_keyword_strings_to_uri (keys);
   GNUNET_hash ("root", 4, &root);
   rootURI =
-    ECRS_createNamespace (NULL,
+    GNUNET_ECRS_namespace_create (NULL,
                           cfg,
                           CHECKNAME,
                           meta,
@@ -87,24 +87,24 @@
   GNUNET_hash ("this", 4, &thisId);
   GNUNET_hash ("next", 4, &nextId);
   uri = rootURI;                /* just for fun: NS::this advertises NS::root 
*/
-  advURI = ECRS_addToNamespace (NULL, cfg, CHECKNAME, 1,        /* anonymity */
+  advURI = GNUNET_ECRS_namespace_add_content (NULL, cfg, CHECKNAME, 1,        
/* anonymity */
                                 1000,   /* priority */
                                 5 * GNUNET_CRON_MINUTES + GNUNET_get_time (),
                                 GNUNET_get_time_int32 (NULL) + 300,
                                 0, &thisId, &nextId, uri, meta);
   CHECK (NULL != advURI);
   fprintf (stderr, "Starting namespace search...\n");
-  CHECK (GNUNET_OK == ECRS_search (NULL,
+  CHECK (GNUNET_OK == GNUNET_ECRS_search (NULL,
                                    cfg,
                                    advURI,
                                    1, 60 * GNUNET_CRON_SECONDS, &spcb, uri,
                                    NULL, NULL));
   fprintf (stderr, "Completed namespace search...\n");
-  CHECK (GNUNET_OK == ECRS_deleteNamespace (NULL, cfg, CHECKNAME));
-  CHECK (GNUNET_SYSERR == ECRS_deleteNamespace (NULL, cfg, CHECKNAME));
-  ECRS_freeMetaData (meta);
-  ECRS_freeUri (rootURI);
-  ECRS_freeUri (advURI);
+  CHECK (GNUNET_OK == GNUNET_ECRS_namespace_delete (NULL, cfg, CHECKNAME));
+  CHECK (GNUNET_SYSERR == GNUNET_ECRS_namespace_delete (NULL, cfg, CHECKNAME));
+  GNUNET_ECRS_meta_data_destroy (meta);
+  GNUNET_ECRS_uri_destroy (rootURI);
+  GNUNET_ECRS_uri_destroy (advURI);
   CHECK (match == 1);
   return 0;
 }
@@ -115,14 +115,14 @@
   pid_t daemon;
   int failureCount = 0;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   if (GNUNET_OK !=
       GNUNET_wait_for_daemon_running (NULL, cfg, 60 * GNUNET_CRON_SECONDS))
     {
@@ -133,7 +133,7 @@
       GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);
       failureCount += testNamespace ();
     }
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 
   return (failureCount == 0) ? 0 : 1;
 }

Modified: GNUnet/src/applications/fs/ecrs/parser.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/parser.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/parser.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -29,19 +29,19 @@
 #include "gnunet_ecrs_lib.h"
 
 /**
- * @param scls must be of type "struct ECRS_URI **"
+ * @param scls must be of type "struct GNUNET_ECRS_URI **"
  */
 int
-gnunet_getopt_configure_set_keywords (GNUNET_CommandLineProcessorContext *
+GNUNET_ECRS_getopt_configure_set_keywords (GNUNET_CommandLineProcessorContext *
                                       ctx, void *scls, const char *option,
                                       const char *value)
 {
-  struct ECRS_URI **uri = scls;
-  struct ECRS_URI *u = *uri;
+  struct GNUNET_ECRS_URI **uri = scls;
+  struct GNUNET_ECRS_URI *u = *uri;
 
   if (u == NULL)
     {
-      u = GNUNET_malloc (sizeof (struct ECRS_URI));
+      u = GNUNET_malloc (sizeof (struct GNUNET_ECRS_URI));
       *uri = u;
       u->type = ksk;
       u->data.ksk.keywordCount = 0;
@@ -49,7 +49,7 @@
     }
   else
     {
-      GE_ASSERT (NULL, u->type == ksk);
+      GNUNET_GE_ASSERT (NULL, u->type == ksk);
     }
   GNUNET_array_grow (u->data.ksk.keywords,
                      u->data.ksk.keywordCount, u->data.ksk.keywordCount + 1);
@@ -59,24 +59,24 @@
 
 
 /**
- * @param scls must be of type "struct ECRS_MetaData **"
+ * @param scls must be of type "struct GNUNET_ECRS_MetaData **"
  */
 int
-gnunet_getopt_configure_set_metadata (GNUNET_CommandLineProcessorContext *
+GNUNET_ECRS_getopt_configure_set_metadata (GNUNET_CommandLineProcessorContext *
                                       ctx, void *scls, const char *option,
                                       const char *value)
 {
-  struct ECRS_MetaData **mm = scls;
+  struct GNUNET_ECRS_MetaData **mm = scls;
   EXTRACTOR_KeywordType type;
   const char *typename;
   const char *typename_i18n;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
   char *tmp;
 
   meta = *mm;
   if (meta == NULL)
     {
-      meta = ECRS_createMetaData ();
+      meta = GNUNET_ECRS_meta_data_create ();
       *mm = meta;
     }
 
@@ -97,7 +97,7 @@
           (tmp[strlen (typename)] == ':') &&
           (0 == strncmp (typename, tmp, strlen (typename))))
         {
-          ECRS_addToMetaData (meta, type, &tmp[strlen (typename) + 1]);
+          GNUNET_ECRS_meta_data_inser (meta, type, &tmp[strlen (typename) + 
1]);
           GNUNET_free (tmp);
           tmp = NULL;
           break;
@@ -106,7 +106,7 @@
           (tmp[strlen (typename_i18n)] == ':') &&
           (0 == strncmp (typename_i18n, tmp, strlen (typename_i18n))))
         {
-          ECRS_addToMetaData (meta, type, &tmp[strlen (typename_i18n) + 1]);
+          GNUNET_ECRS_meta_data_inser (meta, type, &tmp[strlen (typename_i18n) 
+ 1]);
           GNUNET_free (tmp);
           tmp = NULL;
           break;
@@ -114,7 +114,7 @@
     }
   if (tmp != NULL)
     {
-      ECRS_addToMetaData (meta, EXTRACTOR_UNKNOWN, tmp);
+      GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_UNKNOWN, tmp);
       GNUNET_free (tmp);
       printf (_
               ("Unknown metadata type in metadata option `%s'.  Using metadata 
type `unknown' instead.\n"),

Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/search.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -39,7 +39,7 @@
   /**
    * The handle for the query.
    */
-  struct FS_SEARCH_HANDLE *handle;
+  struct GNUNET_FS_SearchHandle *handle;
 
   /**
    * The keys (for the search).
@@ -98,22 +98,22 @@
   /**
    * Search context
    */
-  struct FS_SEARCH_CONTEXT *sctx;
+  struct GNUNET_FS_SearchContext *sctx;
 
   /**
    * queryCount pending searches.
    */
   PendingSearch **queries;
 
-  ECRS_SearchProgressCallback spcb;
+  GNUNET_ECRS_SearchResultProcessor spcb;
 
   void *spcbClosure;
 
   struct GNUNET_Mutex *lock;
 
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
   int aborted;
 
@@ -156,15 +156,15 @@
  * to the SQC.
  */
 static void
-addQueryForURI (const struct ECRS_URI *uri, SendQueriesContext * sqc)
+addQueryForURI (const struct GNUNET_ECRS_URI *uri, SendQueriesContext * sqc)
 {
-  struct GE_Context *ectx = sqc->ectx;
+  struct GNUNET_GE_Context *ectx = sqc->ectx;
 
   switch (uri->type)
     {
     case chk:
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("CHK URI not allowed for search.\n"));
       break;
     case sks:
@@ -176,7 +176,7 @@
                      &hk);
         GNUNET_hash_xor (&hk, &uri->data.sks.namespace, &keys[0]);      /* 
compute routing key r = H(identifier) ^ namespace */
         keys[1] = uri->data.sks.namespace;
-        addPS (S_BLOCK, 2, &keys[0], &uri->data.sks.identifier, /* identifier 
= decryption key */
+        addPS (GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED, 2, &keys[0], 
&uri->data.sks.identifier, /* identifier = decryption key */
                sqc);
         break;
       }
@@ -189,8 +189,8 @@
         int i;
 
 #if DEBUG_SEARCH
-        GE_LOG (ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 "Computing queries (this may take a while).\n");
 #endif
         for (i = 0; i < uri->data.ksk.keywordCount; i++)
@@ -200,22 +200,22 @@
             pk = GNUNET_RSA_create_key_from_hash (&hc);
             GNUNET_RSA_get_public_key (pk, &pub);
             GNUNET_hash (&pub, sizeof (GNUNET_RSA_PublicKey), &query);
-            addPS (ANY_BLOCK,   /* K_BLOCK, N_BLOCK or KN_BLOCK ok */
+            addPS (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,   /* 
GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD, GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE or 
GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD_FOR_NAMESPACE ok */
                    1, &query, &hc, sqc);
             GNUNET_RSA_free_key (pk);
           }
 #if DEBUG_SEARCH
-        GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER, "Queries ready.\n");
+        GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER, "Queries ready.\n");
 #endif
         break;
       }
     case loc:
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("LOC URI not allowed for search.\n"));
       break;
     default:
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       /* unknown URI type */
       break;
     }
@@ -250,7 +250,7 @@
                               c);
       return GNUNET_OK;
     }
-  GE_ASSERT (NULL, ntohl (sb->updateInterval) != 0);
+  GNUNET_GE_ASSERT (NULL, ntohl (sb->updateInterval) != 0);
   pos = ntohl (sb->creationTime);
   GNUNET_hash_difference (&sb->identifierIncrement, &sb->nextIdentifier, c);
 
@@ -278,17 +278,17 @@
                const GNUNET_HashCode * key,
                unsigned int size, SendQueriesContext * sqc)
 {
-  struct GE_Context *ectx = sqc->ectx;
-  ECRS_FileInfo fi;
-  struct ECRS_URI uri;
+  struct GNUNET_GE_Context *ectx = sqc->ectx;
+  GNUNET_ECRS_FileInfo fi;
+  struct GNUNET_ECRS_URI uri;
   int ret;
 
-  fi.meta = ECRS_deserializeMetaData (ectx,
+  fi.meta = GNUNET_ECRS_meta_data_deserialize (ectx,
                                       (const char *) &nb[1],
                                       size - sizeof (NBlock));
   if (fi.meta == NULL)
     {
-      GE_BREAK (ectx, 0);       /* nblock malformed */
+      GNUNET_GE_BREAK (ectx, 0);       /* nblock malformed */
       return GNUNET_SYSERR;
     }
   fi.uri = &uri;
@@ -303,7 +303,7 @@
     }
   else
     ret = GNUNET_OK;
-  ECRS_freeMetaData (fi.meta);
+  GNUNET_ECRS_meta_data_destroy (fi.meta);
   return ret;
 }
 
@@ -316,11 +316,11 @@
  */
 static int
 receiveReplies (const GNUNET_HashCode * key,
-                const Datastore_Value * value, SendQueriesContext * sqc)
+                const GNUNET_DatastoreValue * value, SendQueriesContext * sqc)
 {
-  struct GE_Context *ectx = sqc->ectx;
+  struct GNUNET_GE_Context *ectx = sqc->ectx;
   unsigned int type;
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
   int i;
   unsigned int size;
   PendingSearch *ps;
@@ -328,10 +328,10 @@
   GNUNET_HashCode query;
 
   type = ntohl (value->type);
-  size = ntohl (value->size) - sizeof (Datastore_Value);
+  size = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
 #if DEBUG_SEARCH
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Search received reply of type %u and size %u.\n", type, size);
 #endif
   if (GNUNET_OK !=
@@ -343,7 +343,7 @@
       if ((0 == memcmp (&query,
                         &ps->keys[0], sizeof (GNUNET_HashCode))) &&
           ((ps->type == type) ||
-           (ps->type == ANY_BLOCK)) &&
+           (ps->type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY)) &&
           (GNUNET_YES == isDatumApplicable (type,
                                             size,
                                             (const DBlock *) &value[1],
@@ -351,7 +351,7 @@
         {
           switch (type)
             {
-            case K_BLOCK:
+            case GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD:
               {
                 KBlock *kb;
                 const char *dstURI;
@@ -365,39 +365,39 @@
                 kb = GNUNET_malloc (size);
                 memcpy (kb, &value[1], size);
 #if DEBUG_SEARCH
-                IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+                IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                           GNUNET_hash_to_enc (&ps->decryptKey, &enc));
-                GE_LOG (ectx,
-                        GE_DEBUG | GE_REQUEST | GE_USER,
+                GNUNET_GE_LOG (ectx,
+                        GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                         "Decrypting KBlock with key %s.\n", &enc);
 #endif
-                ECRS_decryptInPlace (&ps->decryptKey,
+                GNUNET_ECRS_decryptInPlace (&ps->decryptKey,
                                      &kb[1], size - sizeof (KBlock));
                 j = sizeof (KBlock);
                 while ((j < size) && (((const char *) kb)[j] != '\0'))
                   j++;
                 if (j == size)
                   {
-                    GE_BREAK (ectx, 0); /* kblock malformed */
+                    GNUNET_GE_BREAK (ectx, 0); /* kblock malformed */
                     GNUNET_free (kb);
                     return GNUNET_SYSERR;
                   }
                 dstURI = (const char *) &kb[1];
                 j++;
-                fi.meta = ECRS_deserializeMetaData (ectx,
+                fi.meta = GNUNET_ECRS_meta_data_deserialize (ectx,
                                                     &((const char *) kb)[j],
                                                     size - j);
                 if (fi.meta == NULL)
                   {
-                    GE_BREAK (ectx, 0); /* kblock malformed */
+                    GNUNET_GE_BREAK (ectx, 0); /* kblock malformed */
                     GNUNET_free (kb);
                     return GNUNET_SYSERR;
                   }
-                fi.uri = ECRS_stringToUri (ectx, dstURI);
+                fi.uri = GNUNET_ECRS_string_to_uri (ectx, dstURI);
                 if (fi.uri == NULL)
                   {
-                    GE_BREAK (ectx, 0); /* kblock malformed */
-                    ECRS_freeMetaData (fi.meta);
+                    GNUNET_GE_BREAK (ectx, 0); /* kblock malformed */
+                    GNUNET_ECRS_meta_data_destroy (fi.meta);
                     GNUNET_free (kb);
                     return GNUNET_SYSERR;
                   }
@@ -411,12 +411,12 @@
                   }
                 else
                   ret = GNUNET_OK;
-                ECRS_freeUri (fi.uri);
-                ECRS_freeMetaData (fi.meta);
+                GNUNET_ECRS_uri_destroy (fi.uri);
+                GNUNET_ECRS_meta_data_destroy (fi.meta);
                 GNUNET_free (kb);
                 return ret;
               }
-            case N_BLOCK:
+            case GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE:
               {
                 const NBlock *nb;
 
@@ -425,7 +425,7 @@
                 nb = (const NBlock *) &value[1];
                 return processNBlock (nb, NULL, size, sqc);
               }
-            case KN_BLOCK:
+            case GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD_FOR_NAMESPACE:
               {
                 KNBlock *kb;
                 int ret;
@@ -434,7 +434,7 @@
                   return GNUNET_SYSERR;
                 kb = GNUNET_malloc (size);
                 memcpy (kb, &value[1], size);
-                ECRS_decryptInPlace (&ps->decryptKey,
+                GNUNET_ECRS_decryptInPlace (&ps->decryptKey,
                                      &kb->nblock,
                                      size - sizeof (KBlock) -
                                      sizeof (unsigned int));
@@ -445,7 +445,7 @@
                 GNUNET_free (kb);
                 return ret;
               }
-            case S_BLOCK:
+            case GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED:
               {
                 SBlock *sb;
                 const char *dstURI;
@@ -458,7 +458,7 @@
                   return GNUNET_SYSERR;
                 sb = GNUNET_malloc (size);
                 memcpy (sb, &value[1], size);
-                ECRS_decryptInPlace (&ps->decryptKey,
+                GNUNET_ECRS_decryptInPlace (&ps->decryptKey,
                                      &sb->creationTime,
                                      size
                                      - sizeof (unsigned int)
@@ -471,27 +471,27 @@
                   j++;
                 if (j == size - sizeof (SBlock))
                   {
-                    GE_BREAK (ectx, 0); /* sblock malformed */
+                    GNUNET_GE_BREAK (ectx, 0); /* sblock malformed */
                     GNUNET_free (sb);
                     return GNUNET_SYSERR;
                   }
                 j++;
                 /* j == strlen(dstURI) + 1 */
-                fi.meta = ECRS_deserializeMetaData (ectx,
+                fi.meta = GNUNET_ECRS_meta_data_deserialize (ectx,
                                                     &dstURI[j],
                                                     size - j -
                                                     sizeof (SBlock));
                 if (fi.meta == NULL)
                   {
-                    GE_BREAK (ectx, 0); /* sblock malformed */
+                    GNUNET_GE_BREAK (ectx, 0); /* sblock malformed */
                     GNUNET_free (sb);
                     return GNUNET_SYSERR;
                   }
-                fi.uri = ECRS_stringToUri (ectx, dstURI);
+                fi.uri = GNUNET_ECRS_string_to_uri (ectx, dstURI);
                 if (fi.uri == NULL)
                   {
-                    GE_BREAK (ectx, 0); /* sblock malformed */
-                    ECRS_freeMetaData (fi.meta);
+                    GNUNET_GE_BREAK (ectx, 0); /* sblock malformed */
+                    GNUNET_ECRS_meta_data_destroy (fi.meta);
                     GNUNET_free (sb);
                     return GNUNET_SYSERR;
                   }
@@ -503,8 +503,8 @@
                   }
                 else
                   ret = GNUNET_OK;
-                ECRS_freeUri (fi.uri);
-                ECRS_freeMetaData (fi.meta);
+                GNUNET_ECRS_uri_destroy (fi.uri);
+                GNUNET_ECRS_meta_data_destroy (fi.meta);
 
                 /* compute current/NEXT URI (if updateable SBlock) and issue
                    respective query automatically! */
@@ -523,7 +523,7 @@
                   }
                 if (ps->keyCount != 2)
                   {
-                    GE_BREAK (ectx, 0);
+                    GNUNET_GE_BREAK (ectx, 0);
                     GNUNET_free (sb);
                     return GNUNET_SYSERR;
                   }
@@ -536,7 +536,7 @@
                 return ret;
               }
             default:
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               break;
             }                   /* end switch */
         }                       /* for all matches */
@@ -553,13 +553,13 @@
  * @param uri set to the URI of the uploaded file
  */
 int
-ECRS_search (struct GE_Context *ectx,
-             struct GC_Configuration *cfg,
-             const struct ECRS_URI *uri,
+GNUNET_ECRS_search (struct GNUNET_GE_Context *ectx,
+             struct GNUNET_GC_Configuration *cfg,
+             const struct GNUNET_ECRS_URI *uri,
              unsigned int anonymityLevel,
              GNUNET_CronTime timeout,
-             ECRS_SearchProgressCallback spcb,
-             void *spcbClosure, ECRS_TestTerminate tt, void *ttClosure)
+             GNUNET_ECRS_SearchResultProcessor spcb,
+             void *spcbClosure, GNUNET_ECRS_TestTerminate tt, void *ttClosure)
 {
   SendQueriesContext ctx;
   PendingSearch *ps;
@@ -581,7 +581,7 @@
   ctx.spcbClosure = spcbClosure;
   ctx.aborted = GNUNET_NO;
   ctx.lock = GNUNET_mutex_create (GNUNET_YES);
-  ctx.sctx = FS_SEARCH_makeContext (ectx, cfg, ctx.lock);
+  ctx.sctx = GNUNET_FS_create_search_context (ectx, cfg, ctx.lock);
   addQueryForURI (uri, &ctx);
   while (((NULL == tt) ||
           (GNUNET_OK == tt (ttClosure))) &&
@@ -597,7 +597,7 @@
           if ((now < ps->timeout) && (ps->timeout != 0))
             continue;
           if (ps->handle != NULL)
-            FS_stop_search (ctx.sctx, ps->handle);
+            GNUNET_FS_stop_search (ctx.sctx, ps->handle);
           /* increase ttl/priority */
           new_ttl = ps->timeout - ps->lastTransmission;
           if (new_ttl < 4 * 5 * GNUNET_CRON_SECONDS)
@@ -623,13 +623,13 @@
           ps->priority = new_priority;
           ps->lastTransmission = now;
 #if DEBUG_SEARCH
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "ECRS initiating FS search with timeout %llus and priority 
%u.\n",
                   (ps->timeout - now) / GNUNET_CRON_SECONDS, ps->priority);
 #endif
           ps->handle
-            = FS_start_search (ctx.sctx,
+            = GNUNET_FS_start_search (ctx.sctx,
                                NULL,
                                ps->type,
                                ps->keyCount,
@@ -637,7 +637,7 @@
                                anonymityLevel,
                                ps->priority,
                                ps->timeout,
-                               (Datum_Iterator) & receiveReplies, &ctx);
+                               (GNUNET_DatastoreValueIterator) & 
receiveReplies, &ctx);
         }
       GNUNET_mutex_unlock (ctx.lock);
       if (((NULL != tt) &&
@@ -650,12 +650,12 @@
   for (i = 0; i < ctx.queryCount; i++)
     {
       if (ctx.queries[i]->handle != NULL)
-        FS_stop_search (ctx.sctx, ctx.queries[i]->handle);
+        GNUNET_FS_stop_search (ctx.sctx, ctx.queries[i]->handle);
       GNUNET_free (ctx.queries[i]->keys);
       GNUNET_free (ctx.queries[i]);
     }
   GNUNET_array_grow (ctx.queries, ctx.queryCount, 0);
-  FS_SEARCH_destroyContext (ctx.sctx);
+  GNUNET_FS_destroy_search_context (ctx.sctx);
   GNUNET_mutex_destroy (ctx.lock);
   return GNUNET_OK;
 }

Modified: GNUnet/src/applications/fs/ecrs/searchtest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/searchtest.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/ecrs/searchtest.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -31,7 +31,7 @@
 #include "gnunet_util_network_client.h"
 #include "tree.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 static int
 testTerminate (void *unused)
@@ -39,17 +39,17 @@
   return GNUNET_OK;
 }
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static int
-searchCB (const ECRS_FileInfo * fi,
+searchCB (const GNUNET_ECRS_FileInfo * fi,
           const GNUNET_HashCode * key, int isRoot, void *closure)
 {
   int *cnt = closure;
 #if 1
   char *st;
 
-  st = ECRS_uriToString (fi->uri);
+  st = GNUNET_ECRS_uri_to_string (fi->uri);
   printf ("Got result `%s'\n", st);
   GNUNET_free (st);
 #endif
@@ -64,9 +64,9 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 static int
-searchFile (const struct ECRS_URI *uri, int resultCount)
+searchFile (const struct GNUNET_ECRS_URI *uri, int resultCount)
 {
-  ECRS_search (NULL,
+  GNUNET_ECRS_search (NULL,
                cfg,
                uri,
                0,
@@ -83,21 +83,21 @@
   pid_t daemon;
   int ok;
   struct GNUNET_ClientServerConnection *sock;
-  struct ECRS_URI *uri;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *key;
+  struct GNUNET_ECRS_URI *uri;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *key;
   const char *keywords[6];
 
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   sock = NULL;
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
@@ -110,50 +110,50 @@
 #if 1
   printf ("Testing search for 'XXtest' with one result.\n");
 #endif
-  uri = ECRS_stringToUri (NULL,
+  uri = GNUNET_ECRS_string_to_uri (NULL,
                           
"gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test");
-  meta = ECRS_createMetaData ();
+  meta = GNUNET_ECRS_meta_data_create ();
   keywords[0] = "XXtest";
   keywords[1] = NULL;
 
-  key = ECRS_keywordsToUri (keywords);
-  CHECK (GNUNET_OK == ECRS_addToKeyspace (NULL, cfg, key, 0, 0, 
GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,  /* expire */
+  key = GNUNET_ECRS_keyword_strings_to_uri (keywords);
+  CHECK (GNUNET_OK == GNUNET_ECRS_publish_under_keyword (NULL, cfg, key, 0, 0, 
GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,  /* expire */
                                           uri, meta));
   CHECK (GNUNET_OK == searchFile (key, 1));
-  ECRS_freeUri (key);
-  ECRS_freeUri (uri);
+  GNUNET_ECRS_uri_destroy (key);
+  GNUNET_ECRS_uri_destroy (uri);
 
   /* inserting another URI under the 'XXtest' keyword and under 'binary'
      should give both URIs since ECRS knows nothing about 'AND'ing: */
 #if 1
   printf ("Testing search for 'XXtest AND binary' with two results.\n");
 #endif
-  uri = ECRS_stringToUri (NULL,
+  uri = GNUNET_ECRS_string_to_uri (NULL,
                           
"gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test-different");
   keywords[1] = "binary";
   keywords[2] = NULL;
-  key = ECRS_keywordsToUri (keywords);
-  CHECK (GNUNET_OK == ECRS_addToKeyspace (NULL, cfg, key, 0, 0, 
GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,  /* expire */
+  key = GNUNET_ECRS_keyword_string_to_uri (keywords);
+  CHECK (GNUNET_OK == GNUNET_ECRS_publish_under_keyword (NULL, cfg, key, 0, 0, 
GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,  /* expire */
                                           uri, meta));
   CHECK (GNUNET_OK == searchFile (key, 2));
-  ECRS_freeUri (key);
-  ECRS_freeUri (uri);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_uri_destroy (key);
+  GNUNET_ECRS_uri_destroy (uri);
+  GNUNET_ECRS_meta_data_destroy (meta);
 
   /* now searching just for 'XXtest' should again give 2 results! */
 #if 0
   printf ("Testing search for 'XXtest' with two results.\n");
 #endif
   keywords[1] = NULL;
-  key = ECRS_keywordsToUri (keywords);
+  key = GNUNET_ECRS_keyword_string_to_uri (keywords);
   CHECK (GNUNET_OK == searchFile (key, 2));
-  ECRS_freeUri (key);
+  GNUNET_ECRS_uri_destroy (key);
 
   /* END OF TEST CODE */
 FAILURE:
   if (sock != NULL)
     GNUNET_client_connection_destroy (sock);
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/ecrs/tree.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/tree.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/tree.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -33,8 +33,8 @@
   unsigned int treeDepth;
   unsigned long long fl;
 
-  GE_ASSERT (NULL, DBLOCK_SIZE < GNUNET_MAX_BUFFER_SIZE);
-  GE_ASSERT (NULL, IBLOCK_SIZE < GNUNET_MAX_BUFFER_SIZE);
+  GNUNET_GE_ASSERT (NULL, DBLOCK_SIZE < GNUNET_MAX_BUFFER_SIZE);
+  GNUNET_GE_ASSERT (NULL, IBLOCK_SIZE < GNUNET_MAX_BUFFER_SIZE);
   treeDepth = 0;
   fl = DBLOCK_SIZE;
   while (fl < flen)

Modified: GNUnet/src/applications/fs/ecrs/unindex.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/unindex.c   2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/unindex.c   2007-11-25 12:04:45 UTC (rev 
5755)
@@ -48,21 +48,21 @@
  * be big enough.
  *
  * This function matches exactly upload.c::pushBlock,
- * except in the call to 'FS_delete'.  TODO: refactor
+ * except in the call to 'GNUNET_FS_delete'.  TODO: refactor
  * to avoid code duplication (move to block.c, pass
- * FS_delete as argument!).
+ * GNUNET_FS_delete as argument!).
  */
 static int
 pushBlock (struct GNUNET_ClientServerConnection *sock,
-           const CHK * chk, unsigned int level, Datastore_Value ** iblocks)
+           const CHK * chk, unsigned int level, GNUNET_DatastoreValue ** 
iblocks)
 {
   unsigned int size;
   unsigned int present;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   DBlock *db;
   CHK ichk;
 
-  size = ntohl (iblocks[level]->size) - sizeof (Datastore_Value);
+  size = ntohl (iblocks[level]->size) - sizeof (GNUNET_DatastoreValue);
   present = (size - sizeof (DBlock)) / sizeof (CHK);
   db = (DBlock *) & iblocks[level][1];
   if (present == CHK_PER_INODE)
@@ -71,19 +71,19 @@
       fileBlockGetQuery (db, size, &ichk.query);
       if (GNUNET_OK != pushBlock (sock, &ichk, level + 1, iblocks))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
       fileBlockEncode (db, size, &ichk.query, &value);
 #if STRICT_CHECKS
-      if (GNUNET_SYSERR == FS_delete (sock, value))
+      if (GNUNET_SYSERR == GNUNET_FS_delete (sock, value))
         {
           GNUNET_free (value);
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
 #else
-      FS_delete (sock, value);
+      GNUNET_FS_delete (sock, value);
 #endif
       GNUNET_free (value);
       size = sizeof (DBlock);
@@ -91,7 +91,7 @@
   /* append CHK */
   memcpy (&((char *) db)[size], chk, sizeof (CHK));
   iblocks[level]->size = htonl (size +
-                                sizeof (CHK) + sizeof (Datastore_Value));
+                                sizeof (CHK) + sizeof (GNUNET_DatastoreValue));
   return GNUNET_OK;
 }
 
@@ -103,7 +103,7 @@
  * b) delete symbolic link
  */
 static int
-undoSymlinking (struct GE_Context *ectx,
+undoSymlinking (struct GNUNET_GE_Context *ectx,
                 const char *fn,
                 const GNUNET_HashCode * fileId,
                 struct GNUNET_ClientServerConnection *sock)
@@ -119,8 +119,8 @@
 #endif
   if (0 != LSTAT (fn, &buf))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_BULK | GE_USER | GE_ADMIN,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER 
| GNUNET_GE_ADMIN,
                             "stat", fn);
       return GNUNET_SYSERR;
     }
@@ -141,8 +141,8 @@
 
   if (0 != UNLINK (serverFN))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_BULK | GE_USER | GE_ADMIN,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER 
| GNUNET_GE_ADMIN,
                             "unlink", serverFN);
       GNUNET_free (serverFN);
       return GNUNET_SYSERR;
@@ -159,11 +159,11 @@
  * @return GNUNET_SYSERR if the unindexing failed (i.e. not indexed)
  */
 int
-ECRS_unindexFile (struct GE_Context *ectx,
-                  struct GC_Configuration *cfg,
+GNUNET_ECRS_file_uninde (struct GNUNET_GE_Context *ectx,
+                  struct GNUNET_GC_Configuration *cfg,
                   const char *filename,
-                  ECRS_UploadProgressCallback upcb,
-                  void *upcbClosure, ECRS_TestTerminate tt, void *ttClosure)
+                  GNUNET_ECRS_UploadProgressCallback upcb,
+                  void *upcbClosure, GNUNET_ECRS_TestTerminate tt, void 
*ttClosure)
 {
   unsigned long long filesize;
   unsigned long long pos;
@@ -171,10 +171,10 @@
   int fd;
   int i;
   unsigned int size;
-  Datastore_Value **iblocks;
-  Datastore_Value *dblock;
+  GNUNET_DatastoreValue **iblocks;
+  GNUNET_DatastoreValue *dblock;
   DBlock *db;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   struct GNUNET_ClientServerConnection *sock;
   GNUNET_HashCode fileId;
   CHK chk;
@@ -186,7 +186,7 @@
   start = GNUNET_get_time ();
   if (GNUNET_YES != GNUNET_disk_file_test (ectx, filename))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   if (GNUNET_OK !=
@@ -201,7 +201,7 @@
   if (GNUNET_SYSERR == GNUNET_hash_file (ectx, filename, &fileId))
     {
       GNUNET_client_connection_destroy (sock);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   now = GNUNET_get_time ();
@@ -216,33 +216,33 @@
   treedepth = computeDepth (filesize);
 
   /* Test if file is indexed! */
-  wasIndexed = FS_testIndexed (sock, &fileId);
+  wasIndexed = GNUNET_FS_test_indexed (sock, &fileId);
 
   fd = GNUNET_disk_file_open (ectx, filename, O_RDONLY | O_LARGEFILE);
   if (fd == -1)
     return GNUNET_SYSERR;
   dblock =
-    GNUNET_malloc (sizeof (Datastore_Value) + DBLOCK_SIZE + sizeof (DBlock));
+    GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + DBLOCK_SIZE + sizeof 
(DBlock));
   dblock->size =
-    htonl (sizeof (Datastore_Value) + DBLOCK_SIZE + sizeof (DBlock));
+    htonl (sizeof (GNUNET_DatastoreValue) + DBLOCK_SIZE + sizeof (DBlock));
   dblock->anonymityLevel = htonl (0);
   dblock->prio = htonl (0);
-  dblock->type = htonl (D_BLOCK);
+  dblock->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   dblock->expirationTime = GNUNET_htonll (0);
   db = (DBlock *) & dblock[1];
-  db->type = htonl (D_BLOCK);
-  iblocks = GNUNET_malloc (sizeof (Datastore_Value *) * (treedepth + 1));
+  db->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
+  iblocks = GNUNET_malloc (sizeof (GNUNET_DatastoreValue *) * (treedepth + 1));
   for (i = 0; i <= treedepth; i++)
     {
       iblocks[i] =
-        GNUNET_malloc (sizeof (Datastore_Value) + IBLOCK_SIZE +
+        GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + IBLOCK_SIZE +
                        sizeof (DBlock));
-      iblocks[i]->size = htonl (sizeof (Datastore_Value) + sizeof (DBlock));
+      iblocks[i]->size = htonl (sizeof (GNUNET_DatastoreValue) + sizeof 
(DBlock));
       iblocks[i]->anonymityLevel = htonl (0);
       iblocks[i]->prio = htonl (0);
-      iblocks[i]->type = htonl (D_BLOCK);
+      iblocks[i]->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
       iblocks[i]->expirationTime = GNUNET_htonll (0);
-      ((DBlock *) & iblocks[i][1])->type = htonl (D_BLOCK);
+      ((DBlock *) & iblocks[i][1])->type = htonl 
(GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
     }
 
   pos = 0;
@@ -260,11 +260,11 @@
           memset (&db[1], 0, DBLOCK_SIZE);
         }
       dblock->size =
-        htonl (sizeof (Datastore_Value) + size + sizeof (DBlock));
+        htonl (sizeof (GNUNET_DatastoreValue) + size + sizeof (DBlock));
       if (size != READ (fd, &db[1], size))
         {
-          GE_LOG_STRERROR_FILE (ectx,
-                                GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
+          GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_USER | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK,
                                 "READ", filename);
           goto FAILURE;
         }
@@ -276,7 +276,7 @@
       if (GNUNET_OK != pushBlock (sock, &chk, 0,        /* dblocks are on 
level 0 */
                                   iblocks))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FAILURE;
         }
       if (!wasIndexed)
@@ -285,14 +285,14 @@
             {
               *value = *dblock; /* copy options! */
 #if STRICT_CHECKS
-              if (GNUNET_OK != FS_delete (sock, value))
+              if (GNUNET_OK != GNUNET_FS_delete (sock, value))
                 {
                   GNUNET_free (value);
-                  GE_BREAK (ectx, 0);
+                  GNUNET_GE_BREAK (ectx, 0);
                   goto FAILURE;
                 }
 #else
-              FS_delete (sock, value);
+              GNUNET_FS_delete (sock, value);
 #endif
               GNUNET_free (value);
             }
@@ -312,25 +312,25 @@
       goto FAILURE;
   for (i = 0; i < treedepth; i++)
     {
-      size = ntohl (iblocks[i]->size) - sizeof (Datastore_Value);
+      size = ntohl (iblocks[i]->size) - sizeof (GNUNET_DatastoreValue);
       db = (DBlock *) & iblocks[i][1];
       fileBlockGetKey (db, size, &chk.key);
       fileBlockGetQuery (db, size, &chk.query);
       if (GNUNET_OK != pushBlock (sock, &chk, i + 1, iblocks))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FAILURE;
         }
       fileBlockEncode (db, size, &chk.query, &value);
 #if STRICT_CHECKS
-      if (GNUNET_OK != FS_delete (sock, value))
+      if (GNUNET_OK != GNUNET_FS_delete (sock, value))
         {
           GNUNET_free (value);
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FAILURE;
         }
 #else
-      FS_delete (sock, value);
+      GNUNET_FS_delete (sock, value);
 #endif
       GNUNET_free (value);
       GNUNET_free (iblocks[i]);
@@ -341,15 +341,15 @@
     {
       if (GNUNET_OK == undoSymlinking (ectx, filename, &fileId, sock))
         {
-          if (GNUNET_OK != FS_unindex (sock, DBLOCK_SIZE, &fileId))
+          if (GNUNET_OK != GNUNET_FS_unindex (sock, DBLOCK_SIZE, &fileId))
             {
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               goto FAILURE;
             }
         }
       else
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FAILURE;
         }
     }

Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/upload.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -50,12 +50,12 @@
 pushBlock (struct GNUNET_ClientServerConnection *sock,
            const CHK * chk,
            unsigned int level,
-           Datastore_Value ** iblocks,
+           GNUNET_DatastoreValue ** iblocks,
            unsigned int prio, GNUNET_CronTime expirationTime)
 {
   unsigned int size;
   unsigned int present;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   DBlock *db;
   CHK ichk;
 #if DEBUG_UPLOAD
@@ -63,9 +63,9 @@
 #endif
 
   size = ntohl (iblocks[level]->size);
-  GE_ASSERT (NULL, size > sizeof (Datastore_Value));
-  size -= sizeof (Datastore_Value);
-  GE_ASSERT (NULL, size - sizeof (DBlock) <= IBLOCK_SIZE);
+  GNUNET_GE_ASSERT (NULL, size > sizeof (GNUNET_DatastoreValue));
+  size -= sizeof (GNUNET_DatastoreValue);
+  GNUNET_GE_ASSERT (NULL, size - sizeof (DBlock) <= IBLOCK_SIZE);
   present = (size - sizeof (DBlock)) / sizeof (CHK);
   db = (DBlock *) & iblocks[level][1];
   if (present == CHK_PER_INODE)
@@ -79,12 +79,12 @@
       fileBlockEncode (db, size, &ichk.query, &value);
       if (value == NULL)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
       value->prio = htonl (prio);
       value->expirationTime = GNUNET_htonll (expirationTime);
-      if (GNUNET_OK != FS_insert (sock, value))
+      if (GNUNET_OK != GNUNET_FS_insert (sock, value))
         {
           GNUNET_free (value);
           return GNUNET_SYSERR;
@@ -94,8 +94,8 @@
     }
   /* append CHK */
   memcpy (&((char *) db)[size], chk, sizeof (CHK));
-  size += sizeof (CHK) + sizeof (Datastore_Value);
-  GE_ASSERT (NULL, size < GNUNET_MAX_BUFFER_SIZE);
+  size += sizeof (CHK) + sizeof (GNUNET_DatastoreValue);
+  GNUNET_GE_ASSERT (NULL, size < GNUNET_MAX_BUFFER_SIZE);
   iblocks[level]->size = htonl (size);
 
   return GNUNET_OK;
@@ -113,17 +113,17 @@
  *  or gnunetd not running)
  */
 int
-ECRS_uploadFile (struct GE_Context *ectx,
-                 struct GC_Configuration *cfg,
+GNUNET_ECRS_file_upload (struct GNUNET_GE_Context *ectx,
+                 struct GNUNET_GC_Configuration *cfg,
                  const char *filename,
                  int doIndex,
                  unsigned int anonymityLevel,
                  unsigned int priority,
                  GNUNET_CronTime expirationTime,
-                 ECRS_UploadProgressCallback upcb,
+                 GNUNET_ECRS_UploadProgressCallback upcb,
                  void *upcbClosure,
-                 ECRS_TestTerminate tt,
-                 void *ttClosure, struct ECRS_URI **uri)
+                 GNUNET_ECRS_TestTerminate tt,
+                 void *ttClosure, struct GNUNET_ECRS_URI **uri)
 {
   unsigned long long filesize;
   unsigned long long pos;
@@ -131,10 +131,10 @@
   int fd;
   int i;
   unsigned int size;
-  Datastore_Value **iblocks;
-  Datastore_Value *dblock;
+  GNUNET_DatastoreValue **iblocks;
+  GNUNET_DatastoreValue *dblock;
   DBlock *db;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   struct GNUNET_ClientServerConnection *sock;
   GNUNET_HashCode fileId;
   CHK mchk;
@@ -146,21 +146,21 @@
   GNUNET_EncName enc;
 #endif
 
-  GE_ASSERT (ectx, cfg != NULL);
+  GNUNET_GE_ASSERT (ectx, cfg != NULL);
   start = GNUNET_get_time ();
   memset (&mchk, 0, sizeof (CHK));
   if (GNUNET_YES != GNUNET_disk_file_test (ectx, filename))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' is not a file.\n"), filename);
       return GNUNET_SYSERR;
     }
   if (GNUNET_OK !=
       GNUNET_disk_file_size (ectx, filename, &filesize, GNUNET_YES))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Cannot get size of file `%s'"), filename);
 
       return GNUNET_SYSERR;
@@ -168,8 +168,8 @@
   sock = GNUNET_client_connection_create (ectx, cfg);
   if (sock == NULL)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Failed to connect to gnunetd."));
       return GNUNET_SYSERR;
     }
@@ -180,8 +180,8 @@
     {
       if (GNUNET_SYSERR == GNUNET_hash_file (ectx, filename, &fileId))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("Cannot hash `%s'.\n"), filename);
           GNUNET_client_connection_destroy (sock);
           return GNUNET_SYSERR;
@@ -196,18 +196,18 @@
       /* reset the counter since the formula later does not
          take the time for GNUNET_hash_file into account */
 
-      switch (FS_initIndex (sock, &fileId, filename))
+      switch (GNUNET_FS_prepare_to_inde (sock, &fileId, filename))
         {
         case GNUNET_SYSERR:
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("Initialization for indexing file `%s' failed.\n"),
                   filename);
           GNUNET_client_connection_destroy (sock);
           return GNUNET_SYSERR;
         case GNUNET_NO:
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("Indexing file `%s' failed. Trying to insert file...\n"),
                   filename);
           doIndex = GNUNET_YES;
@@ -220,8 +220,8 @@
   fd = GNUNET_disk_file_open (ectx, filename, O_RDONLY | O_LARGEFILE);
   if (fd == -1)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Cannot open file `%s': `%s'"), filename, STRERROR (errno));
 
       GNUNET_client_connection_destroy (sock);
@@ -229,27 +229,27 @@
     }
 
   dblock =
-    GNUNET_malloc (sizeof (Datastore_Value) + DBLOCK_SIZE + sizeof (DBlock));
+    GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + DBLOCK_SIZE + sizeof 
(DBlock));
   dblock->size =
-    htonl (sizeof (Datastore_Value) + DBLOCK_SIZE + sizeof (DBlock));
+    htonl (sizeof (GNUNET_DatastoreValue) + DBLOCK_SIZE + sizeof (DBlock));
   dblock->anonymityLevel = htonl (anonymityLevel);
   dblock->prio = htonl (priority);
-  dblock->type = htonl (D_BLOCK);
+  dblock->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   dblock->expirationTime = GNUNET_htonll (expirationTime);
   db = (DBlock *) & dblock[1];
-  db->type = htonl (D_BLOCK);
-  iblocks = GNUNET_malloc (sizeof (Datastore_Value *) * (treedepth + 1));
+  db->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
+  iblocks = GNUNET_malloc (sizeof (GNUNET_DatastoreValue *) * (treedepth + 1));
   for (i = 0; i <= treedepth; i++)
     {
       iblocks[i] =
-        GNUNET_malloc (sizeof (Datastore_Value) + IBLOCK_SIZE +
+        GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + IBLOCK_SIZE +
                        sizeof (DBlock));
-      iblocks[i]->size = htonl (sizeof (Datastore_Value) + sizeof (DBlock));
+      iblocks[i]->size = htonl (sizeof (GNUNET_DatastoreValue) + sizeof 
(DBlock));
       iblocks[i]->anonymityLevel = htonl (anonymityLevel);
       iblocks[i]->prio = htonl (priority);
-      iblocks[i]->type = htonl (D_BLOCK);
+      iblocks[i]->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
       iblocks[i]->expirationTime = GNUNET_htonll (expirationTime);
-      ((DBlock *) & iblocks[i][1])->type = htonl (D_BLOCK);
+      ((DBlock *) & iblocks[i][1])->type = htonl 
(GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
     }
 
   pos = 0;
@@ -266,15 +266,15 @@
           size = filesize - pos;
           memset (&db[1], 0, DBLOCK_SIZE);
         }
-      GE_ASSERT (ectx,
-                 sizeof (Datastore_Value) + size + sizeof (DBlock) <
+      GNUNET_GE_ASSERT (ectx,
+                 sizeof (GNUNET_DatastoreValue) + size + sizeof (DBlock) <
                  GNUNET_MAX_BUFFER_SIZE);
       dblock->size =
-        htonl (sizeof (Datastore_Value) + size + sizeof (DBlock));
+        htonl (sizeof (GNUNET_DatastoreValue) + size + sizeof (DBlock));
       if (size != READ (fd, &db[1], size))
         {
-          GE_LOG_STRERROR_FILE (ectx,
-                                GE_ERROR | GE_BULK | GE_ADMIN | GE_USER,
+          GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_ADMIN | GNUNET_GE_USER,
                                 "READ", filename);
           goto FAILURE;
         }
@@ -285,18 +285,18 @@
       fileBlockGetQuery (db, size + sizeof (DBlock), &mchk.query);
 #if DEBUG_UPLOAD
       IF_GELOG (ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&mchk.query, &enc));
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Query for current block of size %u is %s\n", size, &enc);
 #endif
       if (doIndex)
         {
-          if (GNUNET_SYSERR == FS_index (sock, &fileId, dblock, pos))
+          if (GNUNET_SYSERR == GNUNET_FS_index (sock, &fileId, dblock, pos))
             {
-              GE_LOG (ectx,
-                      GE_ERROR | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx,
+                      GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                       _("Indexing data failed at position %i.\n"), pos);
               goto FAILURE;
             }
@@ -308,15 +308,15 @@
               fileBlockEncode (db,
                                size + sizeof (DBlock), &mchk.query, &value))
             {
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               goto FAILURE;
             }
-          GE_ASSERT (ectx, value != NULL);
+          GNUNET_GE_ASSERT (ectx, value != NULL);
           *value = *dblock;     /* copy options! */
 
-          if (GNUNET_SYSERR == FS_insert (sock, value))
+          if (GNUNET_SYSERR == GNUNET_FS_insert (sock, value))
             {
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               GNUNET_free (value);
               goto FAILURE;
             }
@@ -338,56 +338,56 @@
     if (GNUNET_OK != tt (ttClosure))
       goto FAILURE;
 #if DEBUG_UPLOAD
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Tree depth is %u, walking up tree.\n", treedepth);
 #endif
   for (i = 0; i < treedepth; i++)
     {
-      size = ntohl (iblocks[i]->size) - sizeof (Datastore_Value);
-      GE_ASSERT (ectx, size < GNUNET_MAX_BUFFER_SIZE);
+      size = ntohl (iblocks[i]->size) - sizeof (GNUNET_DatastoreValue);
+      GNUNET_GE_ASSERT (ectx, size < GNUNET_MAX_BUFFER_SIZE);
       if (size == sizeof (DBlock))
         {
 #if DEBUG_UPLOAD
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER, "Level %u is empty\n", i);
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "Level 
%u is empty\n", i);
 #endif
           continue;
         }
       db = (DBlock *) & iblocks[i][1];
       fileBlockGetKey (db, size, &mchk.key);
 #if DEBUG_UPLOAD
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Computing query for %u bytes content.\n", size);
 #endif
       fileBlockGetQuery (db, size, &mchk.query);
 #if DEBUG_UPLOAD
       IF_GELOG (ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&mchk.query, &enc));
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Query for current block at level %u is `%s'.\n", i, &enc);
 #endif
       if (GNUNET_OK != pushBlock (sock,
                                   &mchk, i + 1, iblocks, priority,
                                   expirationTime))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FAILURE;
         }
       fileBlockEncode (db, size, &mchk.query, &value);
       if (value == NULL)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FAILURE;
         }
       value->expirationTime = GNUNET_htonll (expirationTime);
       value->prio = htonl (priority);
-      if (GNUNET_SYSERR == FS_insert (sock, value))
+      if (GNUNET_SYSERR == GNUNET_FS_insert (sock, value))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           GNUNET_free (value);
           goto FAILURE;
         }
@@ -397,9 +397,9 @@
     }
 #if DEBUG_UPLOAD
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER, GNUNET_hash_to_enc (&mchk.query,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
GNUNET_hash_to_enc (&mchk.query,
                                                                  &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Query for top block is %s\n", &enc);
 #endif
   /* build URI */

Modified: GNUnet/src/applications/fs/ecrs/uri.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/uri.c       2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/uri.c       2007-11-25 12:04:45 UTC (rev 
5755)
@@ -97,12 +97,12 @@
   unsigned int i;
 
   n =
-    keywordCount + strlen (ECRS_URI_PREFIX) + strlen (ECRS_SEARCH_INFIX) + 1;
+    keywordCount + strlen (GNUNET_ECRS_URI_PREFIX) + strlen 
(GNUNET_ECRS_SEARCH_INFIX) + 1;
   for (i = 0; i < keywordCount; i++)
     n += strlen (keywords[i]);
   ret = GNUNET_malloc (n);
-  strcpy (ret, ECRS_URI_PREFIX);
-  strcat (ret, ECRS_SEARCH_INFIX);
+  strcpy (ret, GNUNET_ECRS_URI_PREFIX);
+  strcat (ret, GNUNET_ECRS_SEARCH_INFIX);
   for (i = 0; i < keywordCount; i++)
     {
       strcat (ret, keywords[i]);
@@ -125,14 +125,14 @@
   GNUNET_EncName id;
 
   n =
-    sizeof (GNUNET_EncName) * 2 + strlen (ECRS_URI_PREFIX) +
-    strlen (ECRS_SUBSPACE_INFIX) + 1;
+    sizeof (GNUNET_EncName) * 2 + strlen (GNUNET_ECRS_URI_PREFIX) +
+    strlen (GNUNET_ECRS_SUBSPACE_INFIX) + 1;
   ret = GNUNET_malloc (n);
   GNUNET_hash_to_enc (namespace, &ns);
   GNUNET_hash_to_enc (identifier, &id);
   GNUNET_snprintf (ret, n,
                    "%s%s%s/%s",
-                   ECRS_URI_PREFIX, ECRS_SUBSPACE_INFIX, (char *) &ns,
+                   GNUNET_ECRS_URI_PREFIX, GNUNET_ECRS_SUBSPACE_INFIX, (char 
*) &ns,
                    (char *) &id);
   return ret;
 }
@@ -152,14 +152,14 @@
   GNUNET_hash_to_enc (&fi->chk.query, &queryhash);
 
   n =
-    strlen (ECRS_URI_PREFIX) + 2 * sizeof (GNUNET_EncName) + 8 + 16 + 32 +
-    strlen (ECRS_FILE_INFIX);
+    strlen (GNUNET_ECRS_URI_PREFIX) + 2 * sizeof (GNUNET_EncName) + 8 + 16 + 
32 +
+    strlen (GNUNET_ECRS_FILE_INFIX);
   ret = GNUNET_malloc (n);
   GNUNET_snprintf (ret,
                    n,
                    "%s%s%s.%s.%llu",
-                   ECRS_URI_PREFIX,
-                   ECRS_FILE_INFIX,
+                   GNUNET_ECRS_URI_PREFIX,
+                   GNUNET_ECRS_FILE_INFIX,
                    (char *) &keyhash, (char *) &queryhash,
                    GNUNET_ntohll (fi->file_length));
   return ret;
@@ -189,8 +189,8 @@
   GNUNET_snprintf (ret,
                    n,
                    "%s%s%s.%s.%llu.%s.%s.%u",
-                   ECRS_URI_PREFIX,
-                   ECRS_LOCATION_INFIX,
+                   GNUNET_ECRS_URI_PREFIX,
+                   GNUNET_ECRS_LOCATION_INFIX,
                    (char *) &keyhash,
                    (char *) &queryhash,
                    GNUNET_ntohll (loc->fi.file_length),
@@ -204,11 +204,11 @@
  * Convert a URI to a UTF-8 String.
  */
 char *
-ECRS_uriToString (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_to_string (const struct GNUNET_ECRS_URI *uri)
 {
   if (uri == NULL)
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return NULL;
     }
   switch (uri->type)
@@ -224,7 +224,7 @@
     case loc:
       return createLocURI (&uri->data.loc);
     default:
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return NULL;
     }
 }
@@ -238,7 +238,7 @@
  *  the number of keywords placed in the array
  */
 static int
-parseKeywordURI (struct GE_Context *ectx, const char *uri, char ***keywords)
+parseKeywordURI (struct GNUNET_GE_Context *ectx, const char *uri, char 
***keywords)
 {
   unsigned int pos;
   int ret;
@@ -247,16 +247,16 @@
   size_t slen;
   char *dup;
 
-  GE_ASSERT (ectx, uri != NULL);
+  GNUNET_GE_ASSERT (ectx, uri != NULL);
 
   slen = strlen (uri);
-  pos = strlen (ECRS_URI_PREFIX);
+  pos = strlen (GNUNET_ECRS_URI_PREFIX);
 
-  if (0 != strncmp (uri, ECRS_URI_PREFIX, pos))
+  if (0 != strncmp (uri, GNUNET_ECRS_URI_PREFIX, pos))
     return GNUNET_SYSERR;
-  if (0 != strncmp (&uri[pos], ECRS_SEARCH_INFIX, strlen (ECRS_SEARCH_INFIX)))
+  if (0 != strncmp (&uri[pos], GNUNET_ECRS_SEARCH_INFIX, strlen 
(GNUNET_ECRS_SEARCH_INFIX)))
     return GNUNET_SYSERR;
-  pos += strlen (ECRS_SEARCH_INFIX);
+  pos += strlen (GNUNET_ECRS_SEARCH_INFIX);
   if (slen == pos)
     {
       /* no keywords */
@@ -288,7 +288,7 @@
         }
     }
   (*keywords)[--ret] = GNUNET_strdup (&dup[pos]);
-  GE_ASSERT (ectx, ret == 0);
+  GNUNET_GE_ASSERT (ectx, ret == 0);
   GNUNET_free (dup);
   return iret;
 }
@@ -302,7 +302,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if this is not a namespace URI
  */
 static int
-parseSubspaceURI (struct GE_Context *ectx,
+parseSubspaceURI (struct GNUNET_GE_Context *ectx,
                   const char *uri,
                   GNUNET_HashCode * namespace, GNUNET_HashCode * identifier)
 {
@@ -310,17 +310,17 @@
   size_t slen;
   char *up;
 
-  GE_ASSERT (ectx, uri != NULL);
+  GNUNET_GE_ASSERT (ectx, uri != NULL);
 
   slen = strlen (uri);
-  pos = strlen (ECRS_URI_PREFIX);
+  pos = strlen (GNUNET_ECRS_URI_PREFIX);
 
-  if (0 != strncmp (uri, ECRS_URI_PREFIX, pos))
+  if (0 != strncmp (uri, GNUNET_ECRS_URI_PREFIX, pos))
     return GNUNET_SYSERR;
   if (0 != strncmp (&uri[pos],
-                    ECRS_SUBSPACE_INFIX, strlen (ECRS_SUBSPACE_INFIX)))
+                    GNUNET_ECRS_SUBSPACE_INFIX, strlen 
(GNUNET_ECRS_SUBSPACE_INFIX)))
     return GNUNET_SYSERR;
-  pos += strlen (ECRS_SUBSPACE_INFIX);
+  pos += strlen (GNUNET_ECRS_SUBSPACE_INFIX);
   if ((slen < pos + sizeof (GNUNET_EncName) + 1) ||
       (!((uri[pos + sizeof (GNUNET_EncName) - 1] == '/') ||
          (uri[pos + sizeof (GNUNET_EncName) - 1] == '\\'))))
@@ -354,22 +354,22 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if this is not a file URI
  */
 static int
-parseFileURI (struct GE_Context *ectx, const char *uri, FileIdentifier * fi)
+parseFileURI (struct GNUNET_GE_Context *ectx, const char *uri, FileIdentifier 
* fi)
 {
   unsigned int pos;
   size_t slen;
   char *dup;
 
-  GE_ASSERT (ectx, uri != NULL);
+  GNUNET_GE_ASSERT (ectx, uri != NULL);
 
   slen = strlen (uri);
-  pos = strlen (ECRS_URI_PREFIX);
+  pos = strlen (GNUNET_ECRS_URI_PREFIX);
 
-  if (0 != strncmp (uri, ECRS_URI_PREFIX, pos))
+  if (0 != strncmp (uri, GNUNET_ECRS_URI_PREFIX, pos))
     return GNUNET_SYSERR;
-  if (0 != strncmp (&uri[pos], ECRS_FILE_INFIX, strlen (ECRS_FILE_INFIX)))
+  if (0 != strncmp (&uri[pos], GNUNET_ECRS_FILE_INFIX, strlen 
(GNUNET_ECRS_FILE_INFIX)))
     return GNUNET_SYSERR;
-  pos += strlen (ECRS_FILE_INFIX);
+  pos += strlen (GNUNET_ECRS_FILE_INFIX);
   if ((slen < pos + 2 * sizeof (GNUNET_EncName) + 1) ||
       (uri[pos + sizeof (GNUNET_EncName) - 1] != '.') ||
       (uri[pos + sizeof (GNUNET_EncName) * 2 - 1] != '.'))
@@ -402,7 +402,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if this is not a file URI
  */
 static int
-parseLocationURI (struct GE_Context *ectx, const char *uri, Location * loc)
+parseLocationURI (struct GNUNET_GE_Context *ectx, const char *uri, Location * 
loc)
 {
   unsigned int pos;
   unsigned int npos;
@@ -412,17 +412,17 @@
   char *addr;
 
 
-  GE_ASSERT (ectx, uri != NULL);
+  GNUNET_GE_ASSERT (ectx, uri != NULL);
   addr = NULL;
   slen = strlen (uri);
-  pos = strlen (ECRS_URI_PREFIX);
+  pos = strlen (GNUNET_ECRS_URI_PREFIX);
 
-  if (0 != strncmp (uri, ECRS_URI_PREFIX, pos))
+  if (0 != strncmp (uri, GNUNET_ECRS_URI_PREFIX, pos))
     return GNUNET_SYSERR;
   if (0 != strncmp (&uri[pos],
-                    ECRS_LOCATION_INFIX, strlen (ECRS_LOCATION_INFIX)))
+                    GNUNET_ECRS_LOCATION_INFIX, strlen 
(GNUNET_ECRS_LOCATION_INFIX)))
     return GNUNET_SYSERR;
-  pos += strlen (ECRS_LOCATION_INFIX);
+  pos += strlen (GNUNET_ECRS_LOCATION_INFIX);
   if ((slen < pos + 2 * sizeof (GNUNET_EncName) + 1) ||
       (uri[pos + sizeof (GNUNET_EncName) - 1] != '.') ||
       (uri[pos + sizeof (GNUNET_EncName) * 2 - 1] != '.'))
@@ -480,7 +480,7 @@
  * Convert a UTF-8 String to a URI.
  */
 URI *
-ECRS_stringToUri (struct GE_Context * ectx, const char *uri)
+GNUNET_ECRS_string_to_uri (struct GNUNET_GE_Context * ectx, const char *uri)
 {
   URI *ret;
   int len;
@@ -519,11 +519,11 @@
  * Free URI.
  */
 void
-ECRS_freeUri (struct ECRS_URI *uri)
+GNUNET_ECRS_uri_destroy (struct GNUNET_ECRS_URI *uri)
 {
   int i;
 
-  GE_ASSERT (NULL, uri != NULL);
+  GNUNET_GE_ASSERT (NULL, uri != NULL);
   switch (uri->type)
     {
     case ksk:
@@ -545,7 +545,7 @@
  * Is this a namespace URI?
  */
 int
-ECRS_isNamespaceUri (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_test_sks (const struct GNUNET_ECRS_URI *uri)
 {
   return uri->type == sks;
 }
@@ -557,7 +557,7 @@
  *  must free it.
  */
 char *
-ECRS_getNamespaceName (const GNUNET_HashCode * id)
+GNUNET_ECRS_get_namespace_name (const GNUNET_HashCode * id)
 {
   char *ret;
 
@@ -573,11 +573,11 @@
  * @return GNUNET_OK on success
  */
 int
-ECRS_getNamespaceId (const struct ECRS_URI *uri, GNUNET_HashCode * id)
+GNUNET_ECRS_uri_get_namespace_from_sks (const struct GNUNET_ECRS_URI *uri, 
GNUNET_HashCode * id)
 {
-  if (!ECRS_isNamespaceUri (uri))
+  if (!GNUNET_ECRS_uri_test_sks (uri))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   *id = uri->data.sks.namespace;
@@ -590,11 +590,11 @@
  * @return GNUNET_OK on success
  */
 int
-ECRS_getSKSContentHash (const struct ECRS_URI *uri, GNUNET_HashCode * id)
+GNUNET_ECRS_uri_get_content_hash_from_sks (const struct GNUNET_ECRS_URI *uri, 
GNUNET_HashCode * id)
 {
-  if (!ECRS_isNamespaceUri (uri))
+  if (!GNUNET_ECRS_uri_test_sks (uri))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   *id = uri->data.sks.identifier;
@@ -605,7 +605,7 @@
  * Is this a keyword URI?
  */
 int
-ECRS_isKeywordUri (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_test_ksk (const struct GNUNET_ECRS_URI *uri)
 {
 #if EXTRA_CHECKS
   int i;
@@ -613,7 +613,7 @@
   if (uri->type == ksk)
     {
       for (i = uri->data.ksk.keywordCount - 1; i >= 0; i--)
-        GE_ASSERT (NULL, uri->data.ksk.keywords[i] != NULL);
+        GNUNET_GE_ASSERT (NULL, uri->data.ksk.keywords[i] != NULL);
     }
 #endif
   return uri->type == ksk;
@@ -625,7 +625,7 @@
  * @return 0 if this is not a keyword URI
  */
 unsigned int
-ECRS_countKeywordsOfUri (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_get_keyword_count_from_ksk (const struct GNUNET_ECRS_URI *uri)
 {
   if (uri->type != ksk)
     return 0;
@@ -638,8 +638,8 @@
  *   keywords iterated over until iterator aborted
  */
 int
-ECRS_getKeywordsFromUri (const struct ECRS_URI *uri,
-                         ECRS_KeywordIterator iterator, void *cls)
+GNUNET_ECRS_uri_get_keywords_from_ksk (const struct GNUNET_ECRS_URI *uri,
+                         GNUNET_ECRS_KeywordIterator iterator, void *cls)
 {
   int i;
   if (uri->type != ksk)
@@ -661,7 +661,7 @@
  * Is this a file (or directory) URI?
  */
 int
-ECRS_isFileUri (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_test_chk (const struct GNUNET_ECRS_URI *uri)
 {
   return uri->type == chk;
 }
@@ -670,7 +670,7 @@
  * Is this a location URI? (DHT specific!)
  */
 int
-ECRS_isLocationUri (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_test_loc (const struct GNUNET_ECRS_URI *uri)
 {
   return uri->type == loc;
 }
@@ -681,7 +681,7 @@
  * refers to?
  */
 unsigned long long
-ECRS_fileSize (const struct ECRS_URI *uri)
+GNUNET_ECRS_uri_get_file_siz (const struct GNUNET_ECRS_URI *uri)
 {
   switch (uri->type)
     {
@@ -690,7 +690,7 @@
     case loc:
       return GNUNET_ntohll (uri->data.loc.fi.file_length);
     default:
-      GE_ASSERT (NULL, 0);
+      GNUNET_GE_ASSERT (NULL, 0);
     }
   return 0;                     /* unreachable */
 }
@@ -700,9 +700,9 @@
  * Duplicate URI.
  */
 URI *
-ECRS_dupUri (const URI * uri)
+GNUNET_ECRS_uri_duplicate (const URI * uri)
 {
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
   int i;
 
   ret = GNUNET_malloc (sizeof (URI));
@@ -733,7 +733,7 @@
  * keyword.
  */
 URI *
-ECRS_dateExpandKeywordUri (const URI * uri)
+GNUNET_ECRS_uri_expand_keywords_with_date (const URI * uri)
 {
   URI *ret;
   int i;
@@ -743,7 +743,7 @@
   time_t now;
   unsigned int keywordCount;
 
-  GE_ASSERT (NULL, uri->type == ksk);
+  GNUNET_GE_ASSERT (NULL, uri->type == ksk);
   time (&now);
 #ifdef HAVE_GMTIME_R
   gmtime_r (&now, &t);
@@ -762,7 +762,7 @@
       for (i = 0; i < keywordCount; i++)
         {
           key = uri->data.ksk.keywords[i];
-          GE_ASSERT (NULL, key != NULL);
+          GNUNET_GE_ASSERT (NULL, key != NULL);
           ret->data.ksk.keywords[2 * i] = GNUNET_strdup (key);
           kd = GNUNET_malloc (strlen (key) + 13);
           memset (kd, 0, strlen (key) + 13);
@@ -784,7 +784,7 @@
  * that lists all keywords that can be found in the meta-data).
  */
 URI *
-ECRS_metaDataToUri (const MetaData * md)
+GNUNET_ECRS_meta_data_to_uri (const MetaData * md)
 {
   URI *ret;
   int i;
@@ -839,7 +839,7 @@
             }
           if (add == 1)
             {
-              GE_ASSERT (NULL, md->items[i].data != NULL);
+              GNUNET_GE_ASSERT (NULL, md->items[i].data != NULL);
               ret->data.ksk.keywords[i - havePreview]
                 = GNUNET_strdup (md->items[i].data);
             }
@@ -852,8 +852,8 @@
  * Convert a NULL-terminated array of keywords
  * to an ECRS URI.
  */
-struct ECRS_URI *
-ECRS_keywordsToUri (const char *keyword[])
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_keyword_strings_to_uri (const char *keyword[])
 {
   unsigned int count;
   URI *ret;
@@ -880,14 +880,14 @@
  * Are these two URIs equal?
  */
 int
-ECRS_equalsUri (const struct ECRS_URI *uri1, const struct ECRS_URI *uri2)
+GNUNET_ECRS_uri_test_equal (const struct GNUNET_ECRS_URI *uri1, const struct 
GNUNET_ECRS_URI *uri2)
 {
   int ret;
   int i;
   int j;
 
-  GE_ASSERT (NULL, uri1 != NULL);
-  GE_ASSERT (NULL, uri2 != NULL);
+  GNUNET_GE_ASSERT (NULL, uri1 != NULL);
+  GNUNET_GE_ASSERT (NULL, uri2 != NULL);
   if (uri1->type != uri2->type)
     return GNUNET_NO;
   switch (uri1->type)
@@ -945,7 +945,7 @@
  * @return -1 if this is not a location URI, otherwise GNUNET_OK
  */
 int
-ECRS_getPeerFromUri (const struct ECRS_URI *uri, GNUNET_PeerIdentity * peer)
+GNUNET_ECRS_uri_get_peer_identity_from_loc (const struct GNUNET_ECRS_URI *uri, 
GNUNET_PeerIdentity * peer)
 {
   if (uri->type != loc)
     return -1;
@@ -959,14 +959,14 @@
  *
  * @return NULL if argument is not a location URI
  */
-struct ECRS_URI *
-ECRS_getContentUri (const struct ECRS_URI *uri)
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_uri_get_content_uri_from_loc (const struct GNUNET_ECRS_URI *uri)
 {
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
 
   if (uri->type != loc)
     return NULL;
-  ret = GNUNET_malloc (sizeof (struct ECRS_URI));
+  ret = GNUNET_malloc (sizeof (struct GNUNET_ECRS_URI));
   ret->type = chk;
   ret->data.fi = uri->data.loc.fi;
   return ret;
@@ -985,18 +985,18 @@
  *        RSA signatures for "sender".
  * @return the location URI
  */
-struct ECRS_URI *
-ECRS_uriFromLocation (const struct ECRS_URI *baseUri,
+struct GNUNET_ECRS_URI *
+GNUNET_ECRS_location_to_uri (const struct GNUNET_ECRS_URI *baseUri,
                       const GNUNET_RSA_PublicKey * sender,
                       GNUNET_Int32Time expirationTime,
-                      ECRS_SignFunction signer, void *signer_cls)
+                      GNUNET_ECRS_SignFunction signer, void *signer_cls)
 {
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   if (baseUri->type != chk)
     return NULL;
 
-  uri = GNUNET_malloc (sizeof (struct ECRS_URI));
+  uri = GNUNET_malloc (sizeof (struct GNUNET_ECRS_URI));
   uri->type = loc;
   uri->data.loc.fi = baseUri->data.fi;
   uri->data.loc.peer = *sender;

Modified: GNUnet/src/applications/fs/ecrs/uritest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/uritest.c   2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs/uritest.c   2007-11-25 12:04:45 UTC (rev 
5755)
@@ -36,103 +36,103 @@
 testKeyword ()
 {
   char *uri;
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
 
-  if (NULL != ECRS_stringToUri (NULL, "gnunet://ecrs/ksk/++"))
+  if (NULL != GNUNET_ECRS_string_to_uri (NULL, "gnunet://ecrs/ksk/++"))
     ABORT ();
-  ret = ECRS_stringToUri (NULL, "gnunet://ecrs/ksk/foo+bar");
+  ret = GNUNET_ECRS_string_to_uri (NULL, "gnunet://ecrs/ksk/foo+bar");
   if (ret == NULL)
     ABORT ();
-  if (!ECRS_isKeywordUri (ret))
+  if (!GNUNET_ECRS_uri_test_ksk (ret))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
   if ((2 != ret->data.ksk.keywordCount) ||
       (0 != strcmp ("foo", ret->data.ksk.keywords[0])) ||
       (0 != strcmp ("bar", ret->data.ksk.keywords[1])))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
 
-  uri = ECRS_uriToString (ret);
+  uri = GNUNET_ECRS_uri_to_string (ret);
   if (0 != strcmp (uri, "gnunet://ecrs/ksk/foo+bar"))
     {
       GNUNET_free (uri);
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
   GNUNET_free (uri);
-  ECRS_freeUri (ret);
+  GNUNET_ECRS_uri_destroy (ret);
   return 0;
 }
 
 static int
 testLocation ()
 {
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   char *uric;
-  struct ECRS_URI *uri2;
+  struct GNUNET_ECRS_URI *uri2;
   GNUNET_RSA_PublicKey pk;
   struct GNUNET_RSA_PrivateKey *hk;
-  struct ECRS_URI *baseURI;
+  struct GNUNET_ECRS_URI *baseURI;
 
   baseURI =
-    ECRS_stringToUri (NULL,
+    GNUNET_ECRS_string_to_uri (NULL,
                       
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H000004400000.42");
   hk = GNUNET_RSA_create_key ();
   GNUNET_RSA_get_public_key (hk, &pk);
-  uri = ECRS_uriFromLocation (baseURI,
-                              &pk, 43, (ECRS_SignFunction) & GNUNET_RSA_sign,
+  uri = GNUNET_ECRS_location_to_uri (baseURI,
+                              &pk, 43, (GNUNET_ECRS_SignFunction) & 
GNUNET_RSA_sign,
                               hk);
   GNUNET_RSA_free_key (hk);
   if (uri == NULL)
     {
-      GE_BREAK (NULL, 0);
-      ECRS_freeUri (baseURI);
+      GNUNET_GE_BREAK (NULL, 0);
+      GNUNET_ECRS_uri_destroy (baseURI);
       return 1;
     }
-  if (!ECRS_isLocationUri (uri))
+  if (!GNUNET_ECRS_uri_test_loc (uri))
     {
-      GE_BREAK (NULL, 0);
-      ECRS_freeUri (uri);
-      ECRS_freeUri (baseURI);
+      GNUNET_GE_BREAK (NULL, 0);
+      GNUNET_ECRS_uri_destroy (uri);
+      GNUNET_ECRS_uri_destroy (baseURI);
       return 1;
     }
-  uri2 = ECRS_getContentUri (uri);
-  if (!ECRS_equalsUri (baseURI, uri2))
+  uri2 = GNUNET_ECRS_uri_get_content_uri_from_loc (uri);
+  if (!GNUNET_ECRS_uri_test_equal (baseURI, uri2))
     {
-      GE_BREAK (NULL, 0);
-      ECRS_freeUri (uri);
-      ECRS_freeUri (uri2);
-      ECRS_freeUri (baseURI);
+      GNUNET_GE_BREAK (NULL, 0);
+      GNUNET_ECRS_uri_destroy (uri);
+      GNUNET_ECRS_uri_destroy (uri2);
+      GNUNET_ECRS_uri_destroy (baseURI);
       return 1;
     }
-  ECRS_freeUri (uri2);
-  ECRS_freeUri (baseURI);
-  uric = ECRS_uriToString (uri);
+  GNUNET_ECRS_uri_destroy (uri2);
+  GNUNET_ECRS_uri_destroy (baseURI);
+  uric = GNUNET_ECRS_uri_to_string (uri);
 #if 0
   /* not for the faint of heart: */
   printf ("URI: `%s'\n", uric);
 #endif
-  uri2 = ECRS_stringToUri (NULL, uric);
+  uri2 = GNUNET_ECRS_string_to_uri (NULL, uric);
   GNUNET_free (uric);
   if (uri2 == NULL)
     {
-      GE_BREAK (NULL, 0);
-      ECRS_freeUri (uri);
+      GNUNET_GE_BREAK (NULL, 0);
+      GNUNET_ECRS_uri_destroy (uri);
       return 1;
     }
-  if (GNUNET_YES != ECRS_equalsUri (uri, uri2))
+  if (GNUNET_YES != GNUNET_ECRS_uri_test_equal (uri, uri2))
     {
-      GE_BREAK (NULL, 0);
-      ECRS_freeUri (uri);
-      ECRS_freeUri (uri2);
+      GNUNET_GE_BREAK (NULL, 0);
+      GNUNET_ECRS_uri_destroy (uri);
+      GNUNET_ECRS_uri_destroy (uri2);
       return 1;
     }
-  ECRS_freeUri (uri2);
-  ECRS_freeUri (uri);
+  GNUNET_ECRS_uri_destroy (uri2);
+  GNUNET_ECRS_uri_destroy (uri);
   return 0;
 }
 
@@ -140,44 +140,44 @@
 testNamespace (int i)
 {
   char *uri;
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
 
   if (NULL !=
-      ECRS_stringToUri (NULL,
+      GNUNET_ECRS_string_to_uri (NULL,
                         "gnunet://ecrs/sks/D1KJS9H2A82Q65VKQ0ML3RFU6U1D3VUK"))
     ABORT ();
   if (NULL !=
-      ECRS_stringToUri (NULL,
+      GNUNET_ECRS_string_to_uri (NULL,
                         
"gnunet://ecrs/sks/D1KJS9H2A82Q65VKQ0ML3RFU6U1D3V/test"))
     ABORT ();
-  if (NULL != ECRS_stringToUri (NULL, "gnunet://ecrs/sks/test"))
+  if (NULL != GNUNET_ECRS_string_to_uri (NULL, "gnunet://ecrs/sks/test"))
     ABORT ();
   ret =
-    ECRS_stringToUri (NULL,
+    GNUNET_ECRS_string_to_uri (NULL,
                       
"gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/test");
   if (ret == NULL)
     ABORT ();
-  if (ECRS_isKeywordUri (ret))
+  if (GNUNET_ECRS_uri_test_ksk (ret))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
-  if (!ECRS_isNamespaceUri (ret))
+  if (!GNUNET_ECRS_uri_test_sks (ret))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
 
-  uri = ECRS_uriToString (ret);
+  uri = GNUNET_ECRS_uri_to_string (ret);
   if (0 != strcmp (uri,
                    
"gnunet://ecrs/sks/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820/TOJB1NAAUVJKJAGQHRHS22N9I8VM32C0ESN4EFS836IT950E1MP7LGC5V2GE3LFO9U4BP23VQPTH8DPIOC2CONT9LM76ULVL00KAHVO"))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       GNUNET_free (uri);
       ABORT ();
     }
   GNUNET_free (uri);
-  ECRS_freeUri (ret);
+  GNUNET_ECRS_uri_destroy (ret);
   return 0;
 }
 
@@ -185,51 +185,51 @@
 testFile (int i)
 {
   char *uri;
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
 
   if (NULL !=
-      ECRS_stringToUri (NULL,
+      GNUNET_ECRS_string_to_uri (NULL,
                         
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H00000440000.42"))
     ABORT ();
   if (NULL !=
-      ECRS_stringToUri (NULL,
+      GNUNET_ECRS_string_to_uri (NULL,
                         
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H000004400000"))
     ABORT ();
   if (NULL !=
-      ECRS_stringToUri (NULL,
+      GNUNET_ECRS_string_to_uri (NULL,
                         
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H000004400000.FGH"))
     ABORT ();
   ret =
-    ECRS_stringToUri (NULL,
+    GNUNET_ECRS_string_to_uri (NULL,
                       
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H000004400000.42");
   if (ret == NULL)
     ABORT ();
-  if (ECRS_isKeywordUri (ret))
+  if (GNUNET_ECRS_uri_test_ksk (ret))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
-  if (ECRS_isNamespaceUri (ret))
+  if (GNUNET_ECRS_uri_test_sks (ret))
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
   if (GNUNET_ntohll (ret->data.fi.file_length) != 42)
     {
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
 
-  uri = ECRS_uriToString (ret);
+  uri = GNUNET_ECRS_uri_to_string (ret);
   if (0 != strcmp (uri,
                    
"gnunet://ecrs/chk/C282GG70GKK41O4551011DO413KFBVTVMQG1OG30I0K4045N0G41HAPB82G680A02JRVVFO8URVRU2F159011DO41000000022RG820.RNVVVVOOLCLK065B5D04HTNVNSIB2AI022RG8200HSLK1CO1000ATQ98824DMA2032LIMG50CG0K057NVUVG200000H000004400000.42"))
     {
       GNUNET_free (uri);
-      ECRS_freeUri (ret);
+      GNUNET_ECRS_uri_destroy (ret);
       ABORT ();
     }
   GNUNET_free (uri);
-  ECRS_freeUri (ret);
+  GNUNET_ECRS_uri_destroy (ret);
   return 0;
 }
 

Modified: GNUnet/src/applications/fs/ecrs_core.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs_core.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -46,28 +46,28 @@
 int
 fileBlockEncode (const DBlock * data,
                  unsigned int len,
-                 const GNUNET_HashCode * query, Datastore_Value ** value)
+                 const GNUNET_HashCode * query, GNUNET_DatastoreValue ** value)
 {
   GNUNET_HashCode hc;
   GNUNET_AES_SessionKey skey;
   GNUNET_AES_InitializationVector iv;   /* initial value */
-  Datastore_Value *val;
+  GNUNET_DatastoreValue *val;
   DBlock *db;
 
-  GE_ASSERT (NULL, len >= sizeof (DBlock));
-  GE_ASSERT (NULL, (data != NULL) && (query != NULL));
+  GNUNET_GE_ASSERT (NULL, len >= sizeof (DBlock));
+  GNUNET_GE_ASSERT (NULL, (data != NULL) && (query != NULL));
   GNUNET_hash (&data[1], len - sizeof (DBlock), &hc);
   GNUNET_hash_to_AES_key (&hc, &skey, &iv);
-  val = GNUNET_malloc (sizeof (Datastore_Value) + len);
-  val->size = htonl (sizeof (Datastore_Value) + len);
-  val->type = htonl (D_BLOCK);
+  val = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + len);
+  val->size = htonl (sizeof (GNUNET_DatastoreValue) + len);
+  val->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   val->prio = htonl (0);
   val->anonymityLevel = htonl (0);
   val->expirationTime = GNUNET_htonll (0);
   db = (DBlock *) & val[1];
-  db->type = htonl (D_BLOCK);
-  GE_ASSERT (NULL, len - sizeof (DBlock) < GNUNET_MAX_BUFFER_SIZE);
-  GE_ASSERT (NULL,
+  db->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
+  GNUNET_GE_ASSERT (NULL, len - sizeof (DBlock) < GNUNET_MAX_BUFFER_SIZE);
+  GNUNET_GE_ASSERT (NULL,
              len - sizeof (DBlock)
              == GNUNET_AES_encrypt (&data[1],
                                     len - sizeof (DBlock), &skey, &iv,
@@ -90,7 +90,7 @@
 void
 fileBlockGetKey (const DBlock * data, unsigned int len, GNUNET_HashCode * key)
 {
-  GE_ASSERT (NULL, len >= sizeof (DBlock));
+  GNUNET_GE_ASSERT (NULL, len >= sizeof (DBlock));
   GNUNET_hash (&data[1], len - sizeof (DBlock), key);
 }
 
@@ -110,14 +110,14 @@
   GNUNET_AES_SessionKey skey;
   GNUNET_AES_InitializationVector iv;
 
-  GE_ASSERT (NULL, len >= sizeof (DBlock));
+  GNUNET_GE_ASSERT (NULL, len >= sizeof (DBlock));
   data = (const char *) &db[1];
   len -= sizeof (DBlock);
-  GE_ASSERT (NULL, len < GNUNET_MAX_BUFFER_SIZE);
+  GNUNET_GE_ASSERT (NULL, len < GNUNET_MAX_BUFFER_SIZE);
   GNUNET_hash (data, len, &hc);
   GNUNET_hash_to_AES_key (&hc, &skey, &iv);
   tmp = GNUNET_malloc (len);
-  GE_ASSERT (NULL, len == GNUNET_AES_encrypt (data, len, &skey, &iv, tmp));
+  GNUNET_GE_ASSERT (NULL, len == GNUNET_AES_encrypt (data, len, &skey, &iv, 
tmp));
   GNUNET_hash (tmp, len, query);
   GNUNET_free (tmp);
 }
@@ -127,8 +127,8 @@
 {
   if (size <= 4)
     {
-      GE_BREAK (NULL, 0);
-      return ANY_BLOCK;         /* signal error */
+      GNUNET_GE_BREAK (NULL, 0);
+      return GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY;         /* signal error */
     }
   return ntohl (*((const unsigned int *) data));
 }
@@ -149,23 +149,23 @@
   unsigned int type;
 
   type = getTypeOfBlock (size, data);
-  if (type == ANY_BLOCK)
+  if (type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY)
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   switch (type)
     {
-    case D_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA:
       /* CHK: GNUNET_hash of content == query */
       GNUNET_hash (&data[1], size - sizeof (DBlock), query);
       return GNUNET_OK;
-    case S_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED:
       {
         const SBlock *sb;
         if (size < sizeof (SBlock))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         sb = (const SBlock *) data;
@@ -177,18 +177,18 @@
                                              - sizeof (unsigned int),
                                              &sb->signature, &sb->subspace)))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         *query = sb->identifier;
         return GNUNET_OK;
       }
-    case K_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD:
       {
         const KBlock *kb;
         if (size < sizeof (KBlock))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         kb = (const KBlock *) data;
@@ -198,18 +198,18 @@
                                               &kb->signature,
                                               &kb->keyspace))))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         GNUNET_hash (&kb->keyspace, sizeof (GNUNET_RSA_PublicKey), query);
         return GNUNET_OK;
       }
-    case N_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE:
       {
         const NBlock *nb;
         if (size < sizeof (NBlock))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         nb = (const NBlock *) data;
@@ -221,18 +221,18 @@
                                              - sizeof (unsigned int),
                                              &nb->signature, &nb->subspace)))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         *query = nb->namespace; /* XOR with all zeros makes no difference... */
         return GNUNET_OK;
       }
-    case KN_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD_FOR_NAMESPACE:
       {
         const KNBlock *kb;
         if (size < sizeof (KNBlock))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         kb = (const KNBlock *) data;
@@ -244,21 +244,21 @@
                                               &kb->kblock.signature,
                                               &kb->kblock.keyspace))))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             return GNUNET_SYSERR;
           }
         GNUNET_hash (&kb->kblock.keyspace, sizeof (GNUNET_RSA_PublicKey),
                      query);
         return GNUNET_OK;
       }
-    case ONDEMAND_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND:
       {
-        GE_BREAK (NULL, 0);     /* should never be used here! */
+        GNUNET_GE_BREAK (NULL, 0);     /* should never be used here! */
         return GNUNET_SYSERR;
       }
     default:
       {
-        GE_BREAK (NULL, 0);     /* unknown block type */
+        GNUNET_GE_BREAK (NULL, 0);     /* unknown block type */
         return GNUNET_SYSERR;
       }
     }                           /* end switch */
@@ -291,12 +291,12 @@
 
   if (type != getTypeOfBlock (size, data))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;     /* type mismatch */
     }
   if (0 != memcmp (hc, &keys[0], sizeof (GNUNET_HashCode)))
     {
-      GE_BREAK (NULL, 0);       /* mismatch between primary queries,
+      GNUNET_GE_BREAK (NULL, 0);       /* mismatch between primary queries,
                                    we should not even see those here. */
       return GNUNET_SYSERR;
     }
@@ -304,7 +304,7 @@
     return GNUNET_YES;          /* request was to match only primary key */
   switch (type)
     {
-    case S_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_SIGNED:
       if (keyCount != 2)
         return GNUNET_SYSERR;   /* no match */
       GNUNET_hash (&((const SBlock *) data)->subspace,
@@ -312,7 +312,7 @@
       if (0 == memcmp (&keys[1], &h, sizeof (GNUNET_HashCode)))
         return GNUNET_OK;
       return GNUNET_SYSERR;
-    case N_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_NAMESPACE:
       if (keyCount != 2)
         return GNUNET_SYSERR;   /* no match */
       GNUNET_hash (&((const NBlock *) data)->subspace,
@@ -320,17 +320,17 @@
       if (0 != memcmp (&keys[1], &h, sizeof (GNUNET_HashCode)))
         return GNUNET_SYSERR;
       return GNUNET_OK;
-    case D_BLOCK:
-    case K_BLOCK:
-    case KN_BLOCK:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD:
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD_FOR_NAMESPACE:
       if (keyCount != 1)
-        GE_BREAK (NULL, 0);     /* keyCount should be 1 */
+        GNUNET_GE_BREAK (NULL, 0);     /* keyCount should be 1 */
       return GNUNET_OK;         /* if query matches, everything matches! */
-    case ANY_BLOCK:
-      GE_BREAK (NULL, 0);       /* block type should be known */
+    case GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY:
+      GNUNET_GE_BREAK (NULL, 0);       /* block type should be known */
       return GNUNET_SYSERR;
     default:
-      GE_BREAK (NULL, 0);       /* unknown block type */
+      GNUNET_GE_BREAK (NULL, 0);       /* unknown block type */
       return GNUNET_SYSERR;
     }
 }

Modified: GNUnet/src/applications/fs/ecrs_core_test.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core_test.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/ecrs_core_test.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -34,7 +34,7 @@
 testEC ()
 {
   DBlock *data;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   GNUNET_HashCode query;
   GNUNET_HashCode key;
   unsigned int len;
@@ -42,14 +42,14 @@
   len = sizeof (DBlock) + 42;
   data = GNUNET_malloc (len);
   memset (&data[1], rand (), len - sizeof (DBlock));
-  data->type = htonl (D_BLOCK);
-  CHECK (D_BLOCK == getTypeOfBlock (len, data), data);
+  data->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
+  CHECK (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA == getTypeOfBlock (len, data), 
data);
   fileBlockGetKey (data, len, &key);
   fileBlockGetQuery (data, len, &query);
   CHECK (GNUNET_OK == fileBlockEncode (data, len, &query, &value), data);
   memcpy (data, &value[1], len);
   GNUNET_free (value);
-  CHECK (GNUNET_YES == isDatumApplicable (D_BLOCK,
+  CHECK (GNUNET_YES == isDatumApplicable (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA,
                                           len, data, &query, 1, &query),
          data);
   GNUNET_free (data);

Modified: GNUnet/src/applications/fs/fsui/deserialize.c
===================================================================
--- GNUnet/src/applications/fs/fsui/deserialize.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/deserialize.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -58,11 +58,11 @@
 
 #define READLONG(a) if (GNUNET_OK != read_long(fd, (long long*) &a)) return 
GNUNET_SYSERR;
 
-static struct ECRS_URI *
-read_uri (struct GE_Context *ectx, int fd)
+static struct GNUNET_ECRS_URI *
+read_uri (struct GNUNET_GE_Context *ectx, int fd)
 {
   char *buf;
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
   unsigned int size;
 
   if (GNUNET_OK != read_int (fd, (int *) &size))
@@ -74,8 +74,8 @@
       GNUNET_free (buf);
       return NULL;
     }
-  ret = ECRS_stringToUri (ectx, buf);
-  GE_BREAK (ectx, ret != NULL);
+  ret = GNUNET_ECRS_string_to_uri (ectx, buf);
+  GNUNET_GE_BREAK (ectx, ret != NULL);
   GNUNET_free (buf);
   return ret;
 }
@@ -105,29 +105,29 @@
 #define READSTRING(c, max) if (NULL == (c = read_string(fd, max))) return 
GNUNET_SYSERR;
 
 static void
-fixState (FSUI_State * state)
+fixState (GNUNET_FSUI_State * state)
 {
   switch (*state)
     {                           /* try to correct errors */
-    case FSUI_ACTIVE:
-      *state = FSUI_PENDING;
+    case GNUNET_FSUI_ACTIVE:
+      *state = GNUNET_FSUI_PENDING;
       break;
-    case FSUI_PENDING:
-    case FSUI_COMPLETED_JOINED:
-    case FSUI_ABORTED_JOINED:
-    case FSUI_ERROR_JOINED:
+    case GNUNET_FSUI_PENDING:
+    case GNUNET_FSUI_COMPLETED_JOINED:
+    case GNUNET_FSUI_ABORTED_JOINED:
+    case GNUNET_FSUI_ERROR_JOINED:
       break;
-    case FSUI_ERROR:
-      *state = FSUI_ERROR_JOINED;
+    case GNUNET_FSUI_ERROR:
+      *state = GNUNET_FSUI_ERROR_JOINED;
       break;
-    case FSUI_ABORTED:
-      *state = FSUI_ABORTED_JOINED;
+    case GNUNET_FSUI_ABORTED:
+      *state = GNUNET_FSUI_ABORTED_JOINED;
       break;
-    case FSUI_COMPLETED:
-      *state = FSUI_COMPLETED_JOINED;
+    case GNUNET_FSUI_COMPLETED:
+      *state = GNUNET_FSUI_COMPLETED_JOINED;
       break;
     default:
-      *state = FSUI_ERROR_JOINED;
+      *state = GNUNET_FSUI_ERROR_JOINED;
       break;
     }
 }
@@ -138,35 +138,35 @@
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-static struct ECRS_MetaData *
-read_meta (struct GE_Context *ectx, int fd)
+static struct GNUNET_ECRS_MetaData *
+read_meta (struct GNUNET_GE_Context *ectx, int fd)
 {
   unsigned int size;
   char *buf;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
 
   if (read_int (fd, (int *) &size) != GNUNET_OK)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   if (size > 1024 * 1024)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   buf = GNUNET_malloc (size);
   if (size != READ (fd, buf, size))
     {
       GNUNET_free (buf);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
-  meta = ECRS_deserializeMetaData (ectx, buf, size);
+  meta = GNUNET_ECRS_meta_data_deserialize (ectx, buf, size);
   if (meta == NULL)
     {
       GNUNET_free (buf);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   GNUNET_free (buf);
@@ -179,12 +179,12 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 static int
-readFileInfo (struct GE_Context *ectx, int fd, ECRS_FileInfo * fi)
+readFileInfo (struct GNUNET_GE_Context *ectx, int fd, GNUNET_ECRS_FileInfo * 
fi)
 {
   fi->meta = read_meta (ectx, fd);
   if (fi->meta == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   fi->uri = NULL;
@@ -192,9 +192,9 @@
   fi->uri = read_uri (ectx, fd);
   if (fi->uri == NULL)
     {
-      ECRS_freeMetaData (fi->meta);
+      GNUNET_ECRS_meta_data_destroy (fi->meta);
       fi->meta = NULL;
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   return GNUNET_OK;
@@ -209,22 +209,22 @@
  * @return NULL on error AND on read of empty
  *  list (these two cannot be distinguished)
  */
-static FSUI_DownloadList *
-readDownloadList (struct GE_Context *ectx,
-                  int fd, FSUI_Context * ctx, FSUI_DownloadList * parent)
+static GNUNET_FSUI_DownloadList *
+readDownloadList (struct GNUNET_GE_Context *ectx,
+                  int fd, GNUNET_FSUI_Context * ctx, GNUNET_FSUI_DownloadList 
* parent)
 {
-  FSUI_DownloadList *ret;
-  FSUI_SearchList *pos;
+  GNUNET_FSUI_DownloadList *ret;
+  GNUNET_FSUI_SearchList *pos;
   unsigned int big;
   int i;
   int ok;
   int soff;
 
-  GE_ASSERT (ectx, ctx != NULL);
+  GNUNET_GE_ASSERT (ectx, ctx != NULL);
   if ((GNUNET_OK != read_int (fd, (int *) &big)) || (big == 0))
     return NULL;
-  ret = GNUNET_malloc (sizeof (FSUI_DownloadList));
-  memset (ret, 0, sizeof (FSUI_DownloadList));
+  ret = GNUNET_malloc (sizeof (GNUNET_FSUI_DownloadList));
+  memset (ret, 0, sizeof (GNUNET_FSUI_DownloadList));
   ret->ctx = ctx;
   if ((GNUNET_OK != read_int (fd, (int *) &soff)) ||
       (GNUNET_OK != read_int (fd, (int *) &ret->state)) ||
@@ -237,7 +237,7 @@
       (GNUNET_OK != read_long (fd, (long long *) &ret->runTime)) ||
       (GNUNET_OK != read_int (fd, (int *) &big)) || (big > 1024 * 1024))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       GNUNET_free (ret);
       return NULL;
     }
@@ -246,14 +246,14 @@
   ret->filename[big] = '\0';
   if (big != READ (fd, ret->filename, big))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       GNUNET_free (ret->filename);
       GNUNET_free (ret);
       return NULL;
     }
   if (GNUNET_OK != readFileInfo (ectx, fd, &ret->fi))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       GNUNET_free (ret->filename);
       GNUNET_free (ret);
       return NULL;
@@ -261,7 +261,7 @@
   if (ret->completedDownloadsCount > 0)
     ret->completedDownloads
       =
-      GNUNET_malloc (sizeof (struct ECRS_URI *) *
+      GNUNET_malloc (sizeof (struct GNUNET_ECRS_URI *) *
                      ret->completedDownloadsCount);
   ok = GNUNET_YES;
   for (i = 0; i < ret->completedDownloadsCount; i++)
@@ -269,23 +269,23 @@
       ret->completedDownloads[i] = read_uri (ectx, fd);
       if (ret->completedDownloads[i] == NULL)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           ok = GNUNET_NO;
         }
     }
   if (GNUNET_NO == ok)
     {
       GNUNET_free (ret->filename);
-      ECRS_freeUri (ret->fi.uri);
-      ECRS_freeMetaData (ret->fi.meta);
+      GNUNET_ECRS_uri_destroy (ret->fi.uri);
+      GNUNET_ECRS_meta_data_destroy (ret->fi.meta);
       for (i = 0; i < ret->completedDownloadsCount; i++)
         {
           if (ret->completedDownloads[i] != NULL)
-            ECRS_freeUri (ret->completedDownloads[i]);
+            GNUNET_ECRS_uri_destroy (ret->completedDownloads[i]);
         }
       GNUNET_free (ret->completedDownloads);
       GNUNET_free (ret);
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return NULL;
     }
   ret->parent = parent;
@@ -300,7 +300,7 @@
         {
           if (pos == NULL)
             {
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               break;
             }
           pos = pos->next;
@@ -317,8 +317,8 @@
   ret->next = readDownloadList (ectx, fd, ctx, parent);
   ret->child = readDownloadList (ectx, fd, ctx, ret);
 #if DEBUG_PERSISTENCE
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FSUI persistence: restoring download `%s': (%llu, %llu)\n",
           ret->filename, ret->completed, ret->total);
 #endif
@@ -332,19 +332,19 @@
 
   if (8 != READ (fd, magic, 8))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   if (0 != memcmp (magic, "FSUI01\n\0", 8))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   return GNUNET_OK;
 }
 
 static int
-readCollection (int fd, struct FSUI_Context *ctx)
+readCollection (int fd, struct GNUNET_FSUI_Context *ctx)
 {
   int big;
 
@@ -357,7 +357,7 @@
     }
   if ((big > 16 * 1024 * 1024) || (big < sizeof (unsigned int)))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   ctx->collectionData = GNUNET_malloc (big);
@@ -366,18 +366,18 @@
     {
       GNUNET_free (ctx->collectionData);
       ctx->collectionData = NULL;
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   return GNUNET_OK;
 }
 
 static int
-readSearches (int fd, struct FSUI_Context *ctx)
+readSearches (int fd, struct GNUNET_FSUI_Context *ctx)
 {
   int big;
-  FSUI_SearchList *list;
-  FSUI_SearchList *last;
+  GNUNET_FSUI_SearchList *list;
+  GNUNET_FSUI_SearchList *last;
   int i;
   ResultPending *rp;
   char *buf;
@@ -388,8 +388,8 @@
       READINT (big);
       if (big == 0)
         return GNUNET_OK;
-      list = GNUNET_malloc (sizeof (FSUI_SearchList));
-      memset (list, 0, sizeof (FSUI_SearchList));
+      list = GNUNET_malloc (sizeof (GNUNET_FSUI_SearchList));
+      memset (list, 0, sizeof (GNUNET_FSUI_SearchList));
       if ((GNUNET_OK != read_int (fd, (int *) &list->state)) ||
           (GNUNET_OK != read_int (fd, (int *) &list->maxResults)) ||
           (GNUNET_OK != read_long (fd, (long long *) &list->timeout)) ||
@@ -402,7 +402,7 @@
           || (list->sizeResultsReceived > 1024 * 1024)
           || (list->sizeUnmatchedResultsReceived > 1024 * 1024))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
       fixState (&list->state);
@@ -412,30 +412,30 @@
       buf = read_string (fd, 1024 * 1024);
       if (buf == NULL)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
-      list->uri = ECRS_stringToUri (NULL, buf);
+      list->uri = GNUNET_ECRS_string_to_uri (NULL, buf);
       GNUNET_free (buf);
       if (list->uri == NULL)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
-      if (!(ECRS_isKeywordUri (list->uri) || ECRS_isNamespaceUri (list->uri)))
+      if (!(GNUNET_ECRS_uri_test_ksk (list->uri) || GNUNET_ECRS_uri_test_sks 
(list->uri)))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
-      list->numberOfURIKeys = ECRS_countKeywordsOfUri (list->uri);
+      list->numberOfURIKeys = GNUNET_ECRS_uri_get_keyword_count_from_ksk 
(list->uri);
       if (list->sizeResultsReceived > 0)
         {
           list->resultsReceived
             =
             GNUNET_malloc (list->sizeResultsReceived *
-                           sizeof (ECRS_FileInfo));
+                           sizeof (GNUNET_ECRS_FileInfo));
           memset (list->resultsReceived, 0,
-                  list->sizeResultsReceived * sizeof (ECRS_FileInfo));
+                  list->sizeResultsReceived * sizeof (GNUNET_ECRS_FileInfo));
         }
       if (list->sizeUnmatchedResultsReceived > 0)
         {
@@ -451,7 +451,7 @@
         if (GNUNET_OK !=
             readFileInfo (ctx->ectx, fd, &list->resultsReceived[i]))
           {
-            GE_BREAK (NULL, 0);
+            GNUNET_GE_BREAK (NULL, 0);
             goto ERR;
           }
       for (i = 0; i < list->sizeUnmatchedResultsReceived; i++)
@@ -459,18 +459,18 @@
           rp = &list->unmatchedResultsReceived[i];
           if (GNUNET_OK != readFileInfo (ctx->ectx, fd, &rp->fi))
             {
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               goto ERR;
             }
           if (GNUNET_OK != read_int (fd, (int *) &rp->matchingKeyCount))
             {
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               goto ERR;
             }
           if ((rp->matchingKeyCount > 1024) ||
               (rp->matchingKeyCount >= list->numberOfURIKeys))
             {
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               goto ERR;
             }
           if (rp->matchingKeyCount > 0)
@@ -483,7 +483,7 @@
                   READ (fd, rp->matchingKeys,
                         sizeof (GNUNET_HashCode) * rp->matchingKeyCount))
                 {
-                  GE_BREAK (NULL, 0);
+                  GNUNET_GE_BREAK (NULL, 0);
                   goto ERR;
                 }
             }
@@ -511,9 +511,9 @@
       for (i = 0; i < list->sizeResultsReceived; i++)
         {
           if (list->resultsReceived[i].uri != NULL)
-            ECRS_freeUri (list->resultsReceived[i].uri);
+            GNUNET_ECRS_uri_destroy (list->resultsReceived[i].uri);
           if (list->resultsReceived[i].meta != NULL)
-            ECRS_freeMetaData (list->resultsReceived[i].meta);
+            GNUNET_ECRS_meta_data_destroy (list->resultsReceived[i].meta);
         }
       GNUNET_array_grow (list->resultsReceived, list->sizeResultsReceived, 0);
     }
@@ -524,42 +524,42 @@
           rp = &list->unmatchedResultsReceived[i];
 
           if (rp->fi.uri != NULL)
-            ECRS_freeUri (rp->fi.uri);
+            GNUNET_ECRS_uri_destroy (rp->fi.uri);
           if (rp->fi.meta != NULL)
-            ECRS_freeMetaData (rp->fi.meta);
+            GNUNET_ECRS_meta_data_destroy (rp->fi.meta);
           GNUNET_free_non_null (rp->matchingKeys);
         }
       GNUNET_array_grow (list->resultsReceived, list->sizeResultsReceived, 0);
     }
   if (list->uri != NULL)
-    ECRS_freeUri (list->uri);
+    GNUNET_ECRS_uri_destroy (list->uri);
   GNUNET_free (list);
   return GNUNET_SYSERR;
 }
 
 static int
-readDownloads (int fd, struct FSUI_Context *ctx)
+readDownloads (int fd, struct GNUNET_FSUI_Context *ctx)
 {
-  memset (&ctx->activeDownloads, 0, sizeof (FSUI_DownloadList));
+  memset (&ctx->activeDownloads, 0, sizeof (GNUNET_FSUI_DownloadList));
   ctx->activeDownloads.child
     = readDownloadList (ctx->ectx, fd, ctx, &ctx->activeDownloads);
   return GNUNET_OK;
 }
 
 static int
-readUploadList (struct FSUI_Context *ctx,
-                struct FSUI_UploadList *parent,
-                int fd, struct FSUI_UploadShared *shared, int top)
+readUploadList (struct GNUNET_FSUI_Context *ctx,
+                struct GNUNET_FSUI_UploadList *parent,
+                int fd, struct GNUNET_FSUI_UploadShared *shared, int top)
 {
-  struct FSUI_UploadList *list;
-  struct FSUI_UploadList l;
+  struct GNUNET_FSUI_UploadList *list;
+  struct GNUNET_FSUI_UploadList l;
   unsigned long long stime;
   int big;
   int bag;
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
   ectx = ctx->ectx;
-  GE_ASSERT (ectx, shared != NULL);
+  GNUNET_GE_ASSERT (ectx, shared != NULL);
   while (1)
     {
       READINT (big);
@@ -567,20 +567,20 @@
         return GNUNET_OK;
       if ((big < 1) || (big > 15))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
       READINT (bag);
       if (bag != 0x34D1F023)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
-      memset (&l, 0, sizeof (FSUI_UploadList));
+      memset (&l, 0, sizeof (GNUNET_FSUI_UploadList));
       READINT (l.state);
       fixState (&l.state);
-      if (l.state == FSUI_PENDING)
-        l.state = FSUI_ACTIVE;
+      if (l.state == GNUNET_FSUI_PENDING)
+        l.state = GNUNET_FSUI_ACTIVE;
       READLONG (l.completed);
       READLONG (l.total);
       READLONG (stime);
@@ -598,8 +598,8 @@
           if (l.keywords == NULL)
             {
               if (l.uri != NULL)
-                ECRS_freeUri (l.uri);
-              GE_BREAK (NULL, 0);
+                GNUNET_ECRS_uri_destroy (l.uri);
+              GNUNET_GE_BREAK (NULL, 0);
               break;
             }
         }
@@ -609,10 +609,10 @@
           if (l.meta == NULL)
             {
               if (l.uri != NULL)
-                ECRS_freeUri (l.uri);
+                GNUNET_ECRS_uri_destroy (l.uri);
               if (l.keywords != NULL)
-                ECRS_freeUri (l.keywords);
-              GE_BREAK (NULL, 0);
+                GNUNET_ECRS_uri_destroy (l.keywords);
+              GNUNET_GE_BREAK (NULL, 0);
               break;
             }
         }
@@ -620,25 +620,25 @@
       if (l.filename == NULL)
         {
           if (l.uri != NULL)
-            ECRS_freeUri (l.uri);
+            GNUNET_ECRS_uri_destroy (l.uri);
           if (l.meta != NULL)
-            ECRS_freeMetaData (l.meta);
+            GNUNET_ECRS_meta_data_destroy (l.meta);
           if (l.keywords != NULL)
-            ECRS_freeUri (l.keywords);
-          GE_BREAK (NULL, 0);
+            GNUNET_ECRS_uri_destroy (l.keywords);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
-      list = GNUNET_malloc (sizeof (struct FSUI_UploadList));
-      memcpy (list, &l, sizeof (struct FSUI_UploadList));
+      list = GNUNET_malloc (sizeof (struct GNUNET_FSUI_UploadList));
+      memcpy (list, &l, sizeof (struct GNUNET_FSUI_UploadList));
       list->shared = shared;
       list->parent = parent;
       if (GNUNET_OK != readUploadList (ctx, list, fd, shared, GNUNET_NO))
         {
           if (l.uri != NULL)
-            ECRS_freeUri (l.uri);
+            GNUNET_ECRS_uri_destroy (l.uri);
           GNUNET_free (l.filename);
           GNUNET_free (list);
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
       list->next = parent->child;
@@ -651,14 +651,14 @@
 
 
 static int
-readUploads (int fd, struct FSUI_Context *ctx)
+readUploads (int fd, struct GNUNET_FSUI_Context *ctx)
 {
   int big;
   int bag;
-  struct FSUI_UploadShared *shared;
-  struct FSUI_UploadShared sshared;
+  struct GNUNET_FSUI_UploadShared *shared;
+  struct GNUNET_FSUI_UploadShared sshared;
 
-  memset (&ctx->activeUploads, 0, sizeof (FSUI_UploadList));
+  memset (&ctx->activeUploads, 0, sizeof (GNUNET_FSUI_UploadList));
   while (1)
     {
       READINT (big);
@@ -666,16 +666,16 @@
         return GNUNET_OK;
       if ((big < 1) && (big > 7))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
       READINT (bag);
       if (bag != 0x44D1F024)
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
-      memset (&sshared, 0, sizeof (FSUI_UploadShared));
+      memset (&sshared, 0, sizeof (GNUNET_FSUI_UploadShared));
       READINT (sshared.doIndex);
       READINT (sshared.anonymityLevel);
       READINT (sshared.priority);
@@ -689,17 +689,17 @@
           if (sshared.global_keywords == NULL)
             {
               GNUNET_free_non_null (sshared.extractor_config);
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               return GNUNET_SYSERR;
             }
         }
-      shared = GNUNET_malloc (sizeof (FSUI_UploadShared));
-      memcpy (shared, &sshared, sizeof (FSUI_UploadShared));
+      shared = GNUNET_malloc (sizeof (GNUNET_FSUI_UploadShared));
+      memcpy (shared, &sshared, sizeof (GNUNET_FSUI_UploadShared));
       shared->ctx = ctx;
       if (GNUNET_OK !=
           readUploadList (ctx, &ctx->activeUploads, fd, shared, GNUNET_YES))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
 #if 0
           /* cannot do this, readUploadList
              may have added *some* uploads that
@@ -717,11 +717,11 @@
 }
 
 static int
-readUnindex (int fd, struct FSUI_Context *ctx)
+readUnindex (int fd, struct GNUNET_FSUI_Context *ctx)
 {
   int big;
   char *name;
-  struct FSUI_UnindexList *ul;
+  struct GNUNET_FSUI_UnindexList *ul;
 
   while (1)
     {
@@ -730,7 +730,7 @@
         return GNUNET_OK;
       READINT (big);            /* state */
       READSTRING (name, 1024 * 1024);
-      ul = GNUNET_malloc (sizeof (struct FSUI_UnindexList));
+      ul = GNUNET_malloc (sizeof (struct GNUNET_FSUI_UnindexList));
       ul->state = big;
       ul->filename = name;
       ul->next = ctx->unindexOperations;
@@ -742,7 +742,7 @@
 
 
 void
-FSUI_deserialize (struct FSUI_Context *ctx)
+GNUNET_FSUI_deserialize (struct GNUNET_FSUI_Context *ctx)
 {
   int fd;
 
@@ -760,9 +760,9 @@
       (GNUNET_OK != readUnindex (fd, ctx))
       || (GNUNET_OK != readUploads (fd, ctx)))
     {
-      GE_BREAK (ctx->ectx, 0);
-      GE_LOG (ctx->ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_BREAK (ctx->ectx, 0);
+      GNUNET_GE_LOG (ctx->ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("FSUI state file `%s' had syntax error at offset %u.\n"),
               ctx->name, LSEEK (fd, 0, SEEK_CUR));
     }

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/download.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -39,15 +39,15 @@
  * in URITRACK.
  */
 static int
-listURIfoundDirectory (const ECRS_FileInfo * fi,
+listURIfoundDirectory (const GNUNET_ECRS_FileInfo * fi,
                        const GNUNET_HashCode * key, int isRoot, void *prnt)
 {
-  FSUI_DownloadList *dl = prnt;
+  GNUNET_FSUI_DownloadList *dl = prnt;
 
   if (isRoot == GNUNET_YES)
     return GNUNET_OK;           /* namespace ad, ignore */
-  URITRACK_addState (dl->ctx->ectx,
-                     dl->ctx->cfg, fi->uri, URITRACK_DIRECTORY_FOUND);
+  GNUNET_URITRACK_add_state (dl->ctx->ectx,
+                     dl->ctx->cfg, fi->uri, GNUNET_URITRACK_DIRECTORY_FOUND);
 
   return GNUNET_OK;
 }
@@ -57,27 +57,27 @@
 /**
  * Start to download a file.
  */
-static FSUI_DownloadList *startDownload (struct FSUI_Context *ctx,
+static GNUNET_FSUI_DownloadList *startDownload (struct GNUNET_FSUI_Context 
*ctx,
                                          unsigned int anonymityLevel,
                                          int is_recursive,
-                                         const struct ECRS_URI *uri,
-                                         const struct ECRS_MetaData *meta,
+                                         const struct GNUNET_ECRS_URI *uri,
+                                         const struct GNUNET_ECRS_MetaData 
*meta,
                                          const char *filename,
-                                         struct FSUI_SearchList *psearch,
-                                         FSUI_DownloadList * parent);
+                                         struct GNUNET_FSUI_SearchList 
*psearch,
+                                         GNUNET_FSUI_DownloadList * parent);
 
 /**
  * Initiate a (recursive) download of the given
  * directory entry.
  */
 static int
-triggerRecursiveDownload (const ECRS_FileInfo * fi,
+triggerRecursiveDownload (const GNUNET_ECRS_FileInfo * fi,
                           const GNUNET_HashCode * key, int isRoot, void *prnt)
 {
-  FSUI_DownloadList *parent = prnt;
-  struct GE_Context *ectx;
+  GNUNET_FSUI_DownloadList *parent = prnt;
+  struct GNUNET_GE_Context *ectx;
   int i;
-  FSUI_DownloadList *pos;
+  GNUNET_FSUI_DownloadList *pos;
   char *filename;
   char *fullName;
   char *dotdot;
@@ -86,27 +86,27 @@
   if (isRoot == GNUNET_YES)
     return GNUNET_OK;           /* namespace ad, ignore */
 
-  URITRACK_trackURI (ectx, parent->ctx->cfg, fi);
+  GNUNET_URITRACK_track (ectx, parent->ctx->cfg, fi);
   for (i = 0; i < parent->completedDownloadsCount; i++)
-    if (ECRS_equalsUri (parent->completedDownloads[i], fi->uri))
+    if (GNUNET_ECRS_uri_test_equal (parent->completedDownloads[i], fi->uri))
       return GNUNET_OK;         /* already complete! */
   pos = parent->child;
   while (pos != NULL)
     {
-      if (ECRS_equalsUri (pos->fi.uri, fi->uri))
+      if (GNUNET_ECRS_uri_test_equal (pos->fi.uri, fi->uri))
         return GNUNET_OK;       /* already downloading */
       pos = pos->next;
     }
-  filename = ECRS_getFromMetaData (fi->meta, EXTRACTOR_FILENAME);
+  filename = GNUNET_ECRS_meta_data_get_by_type (fi->meta, EXTRACTOR_FILENAME);
   if (filename == NULL)
     {
-      char *tmp = ECRS_uriToString (fi->uri);
-      GE_ASSERT (ectx,
+      char *tmp = GNUNET_ECRS_uri_to_string (fi->uri);
+      GNUNET_GE_ASSERT (ectx,
                  strlen (tmp) >=
-                 strlen (ECRS_URI_PREFIX) + strlen (ECRS_FILE_INFIX));
+                 strlen (GNUNET_ECRS_URI_PREFIX) + strlen 
(GNUNET_ECRS_FILE_INFIX));
       filename =
         GNUNET_strdup (&tmp
-                       [strlen (ECRS_URI_PREFIX) + strlen (ECRS_FILE_INFIX)]);
+                       [strlen (GNUNET_ECRS_URI_PREFIX) + strlen 
(GNUNET_ECRS_FILE_INFIX)]);
       GNUNET_free (tmp);
     }
   fullName =
@@ -117,8 +117,8 @@
     dotdot[0] = dotdot[1] = '_';
   GNUNET_free (filename);
 #if DEBUG_DTM
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting recursive download of `%s'\n", fullName);
 #endif
   startDownload (parent->ctx,
@@ -140,15 +140,15 @@
                           const char *lastBlock,
                           unsigned int lastBlockSize, void *cls)
 {
-  FSUI_DownloadList *dl = cls;
-  FSUI_Event event;
-  struct ECRS_MetaData *md;
+  GNUNET_FSUI_DownloadList *dl = cls;
+  GNUNET_FSUI_Event event;
+  struct GNUNET_ECRS_MetaData *md;
   GNUNET_CronTime now;
   GNUNET_CronTime run_time;
 
-  GE_ASSERT (dl->ctx->ectx, dl->total == totalBytes);
+  GNUNET_GE_ASSERT (dl->ctx->ectx, dl->total == totalBytes);
   dl->completed = completedBytes;
-  event.type = FSUI_download_progress;
+  event.type = GNUNET_FSUI_download_progress;
   event.data.DownloadProgress.dc.pos = dl;
   event.data.DownloadProgress.dc.cctx = dl->cctx;
   event.data.DownloadProgress.dc.ppos =
@@ -194,22 +194,22 @@
   if (dl->is_directory == GNUNET_YES)
     {
       md = NULL;
-      ECRS_listDirectory (dl->ctx->ectx,
+      GNUNET_ECRS_directory_list_contents (dl->ctx->ectx,
                           lastBlock,
                           lastBlockSize, &md, &listURIfoundDirectory, dl);
       if (md != NULL)
-        ECRS_freeMetaData (md);
+        GNUNET_ECRS_meta_data_destroy (md);
     }
   if ((dl->is_recursive == GNUNET_YES) && (dl->is_directory == GNUNET_YES))
     {
       md = NULL;
       GNUNET_mutex_lock (dl->ctx->lock);
-      ECRS_listDirectory (dl->ctx->ectx,
+      GNUNET_ECRS_directory_list_contents (dl->ctx->ectx,
                           lastBlock,
                           lastBlockSize, &md, &triggerRecursiveDownload, dl);
       GNUNET_mutex_unlock (dl->ctx->lock);
       if (md != NULL)
-        ECRS_freeMetaData (md);
+        GNUNET_ECRS_meta_data_destroy (md);
     }
 }
 
@@ -219,11 +219,11 @@
 static int
 testTerminate (void *cls)
 {
-  FSUI_DownloadList *dl = cls;
+  GNUNET_FSUI_DownloadList *dl = cls;
 
-  if ((dl->state == FSUI_ERROR) || (dl->state == FSUI_ABORTED))
+  if ((dl->state == GNUNET_FSUI_ERROR) || (dl->state == GNUNET_FSUI_ABORTED))
     return GNUNET_SYSERR;       /* aborted - delete! */
-  if (dl->state != FSUI_ACTIVE)
+  if (dl->state != GNUNET_FSUI_ACTIVE)
     return GNUNET_NO;           /* suspended */
   return GNUNET_OK;
 }
@@ -234,34 +234,34 @@
 void *
 downloadThread (void *cls)
 {
-  FSUI_DownloadList *dl = cls;
+  GNUNET_FSUI_DownloadList *dl = cls;
   int ret;
-  FSUI_Event event;
-  struct GE_Context *ectx;
-  struct GE_Memory *mem;
-  struct GE_Context *ee;
+  GNUNET_FSUI_Event event;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GE_Memory *mem;
+  struct GNUNET_GE_Context *ee;
 
   dl->startTime = GNUNET_get_time () - dl->runTime;
   ectx = dl->ctx->ectx;
 #if DEBUG_DTM
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Download thread for `%s' started...\n", dl->filename);
 #endif
-  GE_ASSERT (ectx, dl->ctx != NULL);
-  GE_ASSERT (ectx, dl->filename != NULL);
-  mem = GE_memory_create (2);
+  GNUNET_GE_ASSERT (ectx, dl->ctx != NULL);
+  GNUNET_GE_ASSERT (ectx, dl->filename != NULL);
+  mem = GNUNET_GE_memory_create (2);
   ee =
-    GE_create_context_memory (GE_USER | GE_ADMIN | GE_ERROR | GE_WARNING |
-                              GE_FATAL | GE_BULK | GE_IMMEDIATE, mem);
+    GNUNET_GE_create_context_memory (GNUNET_GE_USER | GNUNET_GE_ADMIN | 
GNUNET_GE_ERROR | GNUNET_GE_WARNING |
+                              GNUNET_GE_FATAL | GNUNET_GE_BULK | 
GNUNET_GE_IMMEDIATE, mem);
   ret =
-    ECRS_downloadFile (ee, dl->ctx->cfg, dl->fi.uri, dl->filename,
+    GNUNET_ECRS_file_download (ee, dl->ctx->cfg, dl->fi.uri, dl->filename,
                        dl->anonymityLevel, &downloadProgressCallback, dl,
                        &testTerminate, dl);
   if (ret == GNUNET_OK)
     {
-      dl->state = FSUI_COMPLETED;
-      event.type = FSUI_download_completed;
+      dl->state = GNUNET_FSUI_COMPLETED;
+      event.type = GNUNET_FSUI_download_completed;
       event.data.DownloadCompleted.dc.pos = dl;
       event.data.DownloadCompleted.dc.cctx = dl->cctx;
       event.data.DownloadCompleted.dc.ppos =
@@ -273,18 +273,18 @@
       event.data.DownloadCompleted.total = dl->total;
       event.data.DownloadCompleted.filename = dl->filename;
       event.data.DownloadCompleted.uri = dl->fi.uri;
-      URITRACK_addState (dl->ctx->ectx,
+      GNUNET_URITRACK_add_state (dl->ctx->ectx,
                          dl->ctx->cfg,
-                         dl->fi.uri, URITRACK_DOWNLOAD_COMPLETED);
+                         dl->fi.uri, GNUNET_URITRACK_DOWNLOAD_COMPLETED);
       dl->ctx->ecb (dl->ctx->ecbClosure, &event);
     }
-  else if (dl->state == FSUI_ACTIVE)
+  else if (dl->state == GNUNET_FSUI_ACTIVE)
     {
       const char *error;
 
       /* ECRS error */
-      dl->state = FSUI_ERROR;
-      event.type = FSUI_download_error;
+      dl->state = GNUNET_FSUI_ERROR;
+      event.type = GNUNET_FSUI_download_error;
       event.data.DownloadError.dc.pos = dl;
       event.data.DownloadError.dc.cctx = dl->cctx;
       event.data.DownloadError.dc.ppos =
@@ -293,17 +293,17 @@
       event.data.DownloadError.dc.spos = dl->search;
       event.data.DownloadError.dc.sctx =
         dl->search == NULL ? NULL : dl->search->cctx;
-      error = GE_memory_get (mem, 0);
+      error = GNUNET_GE_memory_get (mem, 0);
       if (error == NULL)
         error = _("Download failed (no reason given)");
       event.data.DownloadError.message = error;
-      URITRACK_addState (dl->ctx->ectx,
-                         dl->ctx->cfg, dl->fi.uri, URITRACK_DOWNLOAD_ABORTED);
+      GNUNET_URITRACK_add_state (dl->ctx->ectx,
+                         dl->ctx->cfg, dl->fi.uri, 
GNUNET_URITRACK_DOWNLOAD_ABORTED);
       dl->ctx->ecb (dl->ctx->ecbClosure, &event);
     }
-  else if (dl->state == FSUI_ABORTED)
+  else if (dl->state == GNUNET_FSUI_ABORTED)
     {                           /* aborted */
-      event.type = FSUI_download_aborted;
+      event.type = GNUNET_FSUI_download_aborted;
       event.data.DownloadAborted.dc.pos = dl;
       event.data.DownloadAborted.dc.cctx = dl->cctx;
       event.data.DownloadAborted.dc.ppos =
@@ -312,27 +312,27 @@
       event.data.DownloadAborted.dc.spos = dl->search;
       event.data.DownloadAborted.dc.sctx =
         dl->search == NULL ? NULL : dl->search->cctx;
-      URITRACK_addState (dl->ctx->ectx, dl->ctx->cfg, dl->fi.uri,
-                         URITRACK_DOWNLOAD_ABORTED);
+      GNUNET_URITRACK_add_state (dl->ctx->ectx, dl->ctx->cfg, dl->fi.uri,
+                         GNUNET_URITRACK_DOWNLOAD_ABORTED);
       dl->ctx->ecb (dl->ctx->ecbClosure, &event);
     }
   else
     {
       /* else: suspended */
-      GE_BREAK (NULL, dl->state == FSUI_SUSPENDING);
+      GNUNET_GE_BREAK (NULL, dl->state == GNUNET_FSUI_SUSPENDING);
     }
 
 
   if ((ret == GNUNET_OK) &&
-      (dl->is_directory == GNUNET_YES) && (ECRS_fileSize (dl->fi.uri) > 0))
+      (dl->is_directory == GNUNET_YES) && (GNUNET_ECRS_uri_get_file_siz 
(dl->fi.uri) > 0))
     {
       char *dirBlock;
       int fd;
       char *fn;
       size_t totalBytes;
-      struct ECRS_MetaData *md;
+      struct GNUNET_ECRS_MetaData *md;
 
-      totalBytes = ECRS_fileSize (dl->fi.uri);
+      totalBytes = GNUNET_ECRS_uri_get_file_siz (dl->fi.uri);
       fn =
         GNUNET_malloc (strlen (dl->filename) + strlen (GNUNET_DIRECTORY_EXT) +
                        1);
@@ -349,31 +349,31 @@
           dirBlock = MMAP (NULL, totalBytes, PROT_READ, MAP_SHARED, fd, 0);
           if (MAP_FAILED == dirBlock)
             {
-              GE_LOG_STRERROR_FILE (ectx,
-                                    GE_ERROR | GE_BULK | GE_ADMIN | GE_USER,
+              GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                    GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_ADMIN | GNUNET_GE_USER,
                                     "mmap", fn);
             }
           else
             {
               md = NULL;
-              ECRS_listDirectory (dl->ctx->ectx,
+              GNUNET_ECRS_directory_list_contents (dl->ctx->ectx,
                                   dirBlock,
                                   totalBytes,
                                   &md, &listURIfoundDirectory, dl);
               if (md != NULL)
-                ECRS_freeMetaData (md);
+                GNUNET_ECRS_meta_data_destroy (md);
 
               if (dl->is_recursive)
                 {
                   /* load directory, start downloads */
                   md = NULL;
                   GNUNET_mutex_lock (dl->ctx->lock);
-                  ECRS_listDirectory (dl->ctx->ectx,
+                  GNUNET_ECRS_directory_list_contents (dl->ctx->ectx,
                                       dirBlock,
                                       totalBytes,
                                       &md, &triggerRecursiveDownload, dl);
                   GNUNET_mutex_unlock (dl->ctx->lock);
-                  ECRS_freeMetaData (md);
+                  GNUNET_ECRS_meta_data_destroy (md);
                   MUNMAP (dirBlock, totalBytes);
                 }
             }
@@ -382,44 +382,44 @@
       GNUNET_free (fn);
     }
 #if DEBUG_DTM
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Download thread for `%s' terminated (%s)...\n",
           dl->filename, ret == GNUNET_OK ? "COMPLETED" : "ABORTED");
 #endif
   dl->runTime = GNUNET_get_time () - dl->startTime;
-  GE_free_context (ee);
-  GE_memory_free (mem);
+  GNUNET_GE_free_context (ee);
+  GNUNET_GE_memory_free (mem);
   return NULL;
 }
 
 /**
  * Start to download a file.
  */
-static FSUI_DownloadList *
-startDownload (struct FSUI_Context *ctx,
+static GNUNET_FSUI_DownloadList *
+startDownload (struct GNUNET_FSUI_Context *ctx,
                unsigned int anonymityLevel,
                int is_recursive,
-               const struct ECRS_URI *uri,
-               const struct ECRS_MetaData *meta,
+               const struct GNUNET_ECRS_URI *uri,
+               const struct GNUNET_ECRS_MetaData *meta,
                const char *filename,
-               struct FSUI_SearchList *psearch, FSUI_DownloadList * parent)
+               struct GNUNET_FSUI_SearchList *psearch, 
GNUNET_FSUI_DownloadList * parent)
 {
-  FSUI_DownloadList *dl;
-  FSUI_Event event;
+  GNUNET_FSUI_DownloadList *dl;
+  GNUNET_FSUI_Event event;
 
-  GE_ASSERT (NULL, ctx != NULL);
-  GE_ASSERT (NULL, parent != NULL);
-  if (!(ECRS_isFileUri (uri) || ECRS_isLocationUri (uri)))
+  GNUNET_GE_ASSERT (NULL, ctx != NULL);
+  GNUNET_GE_ASSERT (NULL, parent != NULL);
+  if (!(GNUNET_ECRS_uri_test_chk (uri) || GNUNET_ECRS_uri_test_loc (uri)))
     {
-      GE_BREAK (NULL, 0);       /* wrong type of URI! */
+      GNUNET_GE_BREAK (NULL, 0);       /* wrong type of URI! */
       return NULL;
     }
-  dl = GNUNET_malloc (sizeof (FSUI_DownloadList));
-  memset (dl, 0, sizeof (FSUI_DownloadList));
+  dl = GNUNET_malloc (sizeof (GNUNET_FSUI_DownloadList));
+  memset (dl, 0, sizeof (GNUNET_FSUI_DownloadList));
   dl->startTime = 0;            /* not run at all so far! */
   dl->runTime = 0;              /* not run at all so far! */
-  dl->state = FSUI_PENDING;
+  dl->state = GNUNET_FSUI_PENDING;
   dl->is_recursive = is_recursive;
   dl->parent = parent;
   dl->search = psearch;
@@ -427,13 +427,13 @@
   dl->anonymityLevel = anonymityLevel;
   dl->ctx = ctx;
   dl->filename = GNUNET_strdup (filename);
-  dl->fi.uri = ECRS_dupUri (uri);
-  dl->fi.meta = ECRS_dupMetaData (meta);
-  dl->total = ECRS_fileSize (uri);
+  dl->fi.uri = GNUNET_ECRS_uri_duplicate (uri);
+  dl->fi.meta = GNUNET_ECRS_meta_data_duplicate (meta);
+  dl->total = GNUNET_ECRS_uri_get_file_siz (uri);
   dl->child = NULL;
   dl->cctx = NULL;
   /* signal start! */
-  event.type = FSUI_download_started;
+  event.type = GNUNET_FSUI_download_started;
   event.data.DownloadStarted.dc.pos = dl;
   event.data.DownloadStarted.dc.cctx = NULL;
   event.data.DownloadStarted.dc.ppos =
@@ -442,12 +442,12 @@
   event.data.DownloadStarted.dc.spos = dl->search;
   event.data.DownloadStarted.dc.sctx =
     dl->search == NULL ? NULL : dl->search->cctx;
-  event.data.DownloadStarted.total = ECRS_fileSize (dl->fi.uri);
+  event.data.DownloadStarted.total = GNUNET_ECRS_uri_get_file_siz (dl->fi.uri);
   event.data.DownloadStarted.filename = dl->filename;
   event.data.DownloadStarted.fi.uri = dl->fi.uri;
   event.data.DownloadStarted.fi.meta = dl->fi.meta;
   event.data.DownloadStarted.anonymityLevel = dl->anonymityLevel;
-  URITRACK_addState (ctx->ectx, ctx->cfg, uri, URITRACK_DOWNLOAD_STARTED);
+  GNUNET_URITRACK_add_state (ctx->ectx, ctx->cfg, uri, 
GNUNET_URITRACK_DOWNLOAD_STARTED);
   dl->cctx = dl->ctx->ecb (dl->ctx->ecbClosure, &event);
   dl->next = parent->child;
   parent->child = dl;
@@ -468,17 +468,17 @@
  *  already used for another download at the moment (or
  *  if the disk does not have enough space).
  */
-struct FSUI_DownloadList *
-FSUI_startDownload (struct FSUI_Context *ctx,
+struct GNUNET_FSUI_DownloadList *
+GNUNET_FSUI_download_start (struct GNUNET_FSUI_Context *ctx,
                     unsigned int anonymityLevel,
                     int doRecursive,
-                    const struct ECRS_URI *uri,
-                    const struct ECRS_MetaData *meta,
+                    const struct GNUNET_ECRS_URI *uri,
+                    const struct GNUNET_ECRS_MetaData *meta,
                     const char *filename,
-                    struct FSUI_SearchList *psearch,
-                    struct FSUI_DownloadList *pdownload)
+                    struct GNUNET_FSUI_SearchList *psearch,
+                    struct GNUNET_FSUI_DownloadList *pdownload)
 {
-  struct FSUI_DownloadList *ret;
+  struct GNUNET_FSUI_DownloadList *ret;
 
   GNUNET_mutex_lock (ctx->lock);
   if (pdownload == NULL)
@@ -498,10 +498,10 @@
  * @return GNUNET_YES if change done that may require re-trying
  */
 int
-FSUI_updateDownloadThread (FSUI_DownloadList * list)
+GNUNET_FSUI_updateDownloadThread (GNUNET_FSUI_DownloadList * list)
 {
-  struct GE_Context *ectx;
-  FSUI_DownloadList *dpos;
+  struct GNUNET_GE_Context *ectx;
+  GNUNET_FSUI_DownloadList *dpos;
   void *unused;
   int ret;
 
@@ -510,8 +510,8 @@
   ectx = list->ctx->ectx;
 
 #if DEBUG_DTM
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Download thread manager investigates pending download of file `%s' 
(%u/%u downloads)\n",
           list->filename,
           list->ctx->activeDownloadThreads, list->ctx->threadPoolSize);
@@ -520,16 +520,16 @@
   /* should this one be started? */
   if ((list->ctx->threadPoolSize
        > list->ctx->activeDownloadThreads) &&
-      (list->state == FSUI_PENDING) &&
+      (list->state == GNUNET_FSUI_PENDING) &&
       ((list->total > list->completed) || (list->total == 0)))
     {
 #if DEBUG_DTM
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Download thread manager starts download of file `%s'\n",
               list->filename);
 #endif
-      list->state = FSUI_ACTIVE;
+      list->state = GNUNET_FSUI_ACTIVE;
       list->handle = GNUNET_thread_create (&downloadThread, list, 128 * 1024);
       if (list->handle != NULL)
         {
@@ -537,41 +537,41 @@
         }
       else
         {
-          GE_LOG_STRERROR (ectx,
-                           GE_ADMIN | GE_USER | GE_BULK | GE_ERROR,
+          GNUNET_GE_LOG_STRERROR (ectx,
+                           GNUNET_GE_ADMIN | GNUNET_GE_USER | GNUNET_GE_BULK | 
GNUNET_GE_ERROR,
                            "pthread_create");
-          list->state = FSUI_ERROR_JOINED;
+          list->state = GNUNET_FSUI_ERROR_JOINED;
         }
     }
 
   /* should this one be stopped? */
   if ((list->ctx->threadPoolSize
-       < list->ctx->activeDownloadThreads) && (list->state == FSUI_ACTIVE))
+       < list->ctx->activeDownloadThreads) && (list->state == 
GNUNET_FSUI_ACTIVE))
     {
 #if DEBUG_DTM
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Download thread manager aborts active download of file `%s' 
(%u/%u downloads)\n",
               list->filename,
               list->ctx->activeDownloadThreads, list->ctx->threadPoolSize);
 #endif
-      list->state = FSUI_SUSPENDING;
-      GE_ASSERT (ectx, list->handle != NULL);
+      list->state = GNUNET_FSUI_SUSPENDING;
+      GNUNET_GE_ASSERT (ectx, list->handle != NULL);
       GNUNET_thread_stop_sleep (list->handle);
       GNUNET_thread_join (list->handle, &unused);
       list->handle = NULL;
       list->ctx->activeDownloadThreads--;
-      list->state = FSUI_PENDING;
+      list->state = GNUNET_FSUI_PENDING;
       ret = GNUNET_YES;
     }
 
   /* has this one "died naturally"? */
-  if ((list->state == FSUI_COMPLETED) ||
-      (list->state == FSUI_ABORTED) || (list->state == FSUI_ERROR))
+  if ((list->state == GNUNET_FSUI_COMPLETED) ||
+      (list->state == GNUNET_FSUI_ABORTED) || (list->state == 
GNUNET_FSUI_ERROR))
     {
 #if DEBUG_DTM
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Download thread manager collects inactive download of file 
`%s'\n",
               list->filename);
 #endif
@@ -586,7 +586,7 @@
   dpos = list->child;
   while (dpos != NULL)
     {
-      if (GNUNET_YES == FSUI_updateDownloadThread (dpos))
+      if (GNUNET_YES == GNUNET_FSUI_updateDownloadThread (dpos))
         ret = GNUNET_YES;
       dpos = dpos->next;
     }
@@ -601,27 +601,27 @@
  *         GNUNET_NO if the download has already finished
  */
 int
-FSUI_abortDownload (struct FSUI_Context *ctx, struct FSUI_DownloadList *dl)
+GNUNET_FSUI_download_abort (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_DownloadList *dl)
 {
-  struct FSUI_DownloadList *c;
+  struct GNUNET_FSUI_DownloadList *c;
 
-  GE_ASSERT (ctx->ectx, dl != NULL);
+  GNUNET_GE_ASSERT (ctx->ectx, dl != NULL);
   c = dl->child;
   while (c != NULL)
     {
-      FSUI_abortDownload (ctx, c);
+      GNUNET_FSUI_download_abort (ctx, c);
       c = c->next;
     }
-  if ((dl->state != FSUI_ACTIVE) && (dl->state != FSUI_PENDING))
+  if ((dl->state != GNUNET_FSUI_ACTIVE) && (dl->state != GNUNET_FSUI_PENDING))
     return GNUNET_NO;
-  if (dl->state == FSUI_ACTIVE)
+  if (dl->state == GNUNET_FSUI_ACTIVE)
     {
-      dl->state = FSUI_ABORTED;
+      dl->state = GNUNET_FSUI_ABORTED;
       GNUNET_thread_stop_sleep (dl->handle);
     }
   else
     {
-      dl->state = FSUI_ABORTED_JOINED;
+      dl->state = GNUNET_FSUI_ABORTED_JOINED;
     }
   return GNUNET_OK;
 }
@@ -633,16 +633,16 @@
  * @return GNUNET_SYSERR if no such download is pending
  */
 int
-FSUI_stopDownload (struct FSUI_Context *ctx, struct FSUI_DownloadList *dl)
+GNUNET_FSUI_download_stop (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_DownloadList *dl)
 {
   void *unused;
-  struct FSUI_DownloadList *prev;
-  FSUI_Event event;
+  struct GNUNET_FSUI_DownloadList *prev;
+  GNUNET_FSUI_Event event;
   int i;
 
-  GE_ASSERT (ctx->ectx, dl != NULL);
+  GNUNET_GE_ASSERT (ctx->ectx, dl != NULL);
   while (dl->child != NULL)
-    FSUI_stopDownload (ctx, dl->child);
+    GNUNET_FSUI_download_stop (ctx, dl->child);
   GNUNET_mutex_lock (ctx->lock);
   prev =
     (dl->parent != NULL) ? dl->parent->child : ctx->activeDownloads.child;
@@ -651,9 +651,9 @@
   if (prev == NULL)
     {
       GNUNET_mutex_unlock (ctx->lock);
-      GE_LOG (ctx->ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
-              "FSUI_stopDownload failed to locate download.\n");
+      GNUNET_GE_LOG (ctx->ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
+              "GNUNET_FSUI_stopDownload failed to locate download.\n");
       return GNUNET_SYSERR;
     }
   if (prev == dl)
@@ -661,27 +661,27 @@
   else
     prev->next = dl->next;      /* not first child */
   GNUNET_mutex_unlock (ctx->lock);
-  if ((dl->state == FSUI_ACTIVE) ||
-      (dl->state == FSUI_COMPLETED) ||
-      (dl->state == FSUI_ABORTED) || (dl->state == FSUI_ERROR))
+  if ((dl->state == GNUNET_FSUI_ACTIVE) ||
+      (dl->state == GNUNET_FSUI_COMPLETED) ||
+      (dl->state == GNUNET_FSUI_ABORTED) || (dl->state == GNUNET_FSUI_ERROR))
     {
-      GE_ASSERT (ctx->ectx, dl->handle != NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, dl->handle != NULL);
       GNUNET_thread_stop_sleep (dl->handle);
       GNUNET_thread_join (dl->handle, &unused);
       GNUNET_mutex_lock (ctx->lock);
       dl->ctx->activeDownloadThreads--;
       GNUNET_mutex_unlock (ctx->lock);
       dl->handle = NULL;
-      if (dl->state == FSUI_ACTIVE)
-        dl->state = FSUI_PENDING;
+      if (dl->state == GNUNET_FSUI_ACTIVE)
+        dl->state = GNUNET_FSUI_PENDING;
       else
         dl->state++;            /* add _JOINED */
     }
   else
     {
-      GE_ASSERT (ctx->ectx, dl->handle == NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, dl->handle == NULL);
     }
-  event.type = FSUI_download_stopped;
+  event.type = GNUNET_FSUI_download_stopped;
   event.data.DownloadStopped.dc.pos = dl;
   event.data.DownloadStopped.dc.cctx = dl->cctx;
   event.data.DownloadStopped.dc.ppos =
@@ -706,10 +706,10 @@
         }
     }
   for (i = dl->completedDownloadsCount - 1; i >= 0; i--)
-    ECRS_freeUri (dl->completedDownloads[i]);
+    GNUNET_ECRS_uri_destroy (dl->completedDownloads[i]);
   GNUNET_array_grow (dl->completedDownloads, dl->completedDownloadsCount, 0);
-  ECRS_freeUri (dl->fi.uri);
-  ECRS_freeMetaData (dl->fi.meta);
+  GNUNET_ECRS_uri_destroy (dl->fi.uri);
+  GNUNET_ECRS_meta_data_destroy (dl->fi.meta);
   GNUNET_free (dl->filename);
   GNUNET_free (dl);
   return GNUNET_OK;

Modified: GNUnet/src/applications/fs/fsui/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/downloadtest.c      2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/downloadtest.c      2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -33,11 +33,11 @@
 
 #define DEBUG_VERBOSE GNUNET_NO
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; }
 
 static volatile int suspendRestart = 0;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static char *
 makeName (unsigned int i)
@@ -52,39 +52,39 @@
   return fn;
 }
 
-static volatile enum FSUI_EventType lastEvent;
-static volatile enum FSUI_EventType waitForEvent;
-static struct FSUI_Context *ctx;
-static struct ECRS_URI *upURI;
-static struct FSUI_SearchList *search;
-static struct FSUI_DownloadList *download;
+static volatile enum GNUNET_FSUI_EventType lastEvent;
+static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static struct GNUNET_FSUI_Context *ctx;
+static struct GNUNET_ECRS_URI *upURI;
+static struct GNUNET_FSUI_SearchList *search;
+static struct GNUNET_FSUI_DownloadList *download;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   char *fn;
 
   switch (event->type)
     {
-    case FSUI_search_suspended:
+    case GNUNET_FSUI_search_suspended:
       search = NULL;
       break;
-    case FSUI_download_suspended:
+    case GNUNET_FSUI_download_suspended:
       download = NULL;
       break;
-    case FSUI_search_resumed:
+    case GNUNET_FSUI_search_resumed:
 #if DEBUG_VERBOSE
       printf ("Search resuming\n");
 #endif
       search = event->data.SearchResumed.sc.pos;
       break;
-    case FSUI_download_resumed:
+    case GNUNET_FSUI_download_resumed:
 #if DEBUG_VERBOSE
       printf ("Download resuming\n");
 #endif
       download = event->data.DownloadResumed.dc.pos;
       break;
-    case FSUI_search_completed:
+    case GNUNET_FSUI_search_completed:
 #if DEBUG_VERBOSE
       printf ("Search completed\n");
 #endif
@@ -94,7 +94,7 @@
                    "ERROR: Search completed but download not started!\n");
         }
       break;
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
 #if DEBUG_VERBOSE
       printf ("Received search result\n");
 #endif
@@ -102,7 +102,7 @@
         {
           char *u;
 
-          if (!ECRS_equalsUri (upURI, event->data.SearchResult.fi.uri))
+          if (!GNUNET_ECRS_uri_test_equal (upURI, 
event->data.SearchResult.fi.uri))
             {
 #if DEBUG_VERBOSE
               printf
@@ -111,12 +111,12 @@
               return NULL;      /* ignore */
             }
           fn = makeName (43);
-          u = ECRS_uriToString (event->data.SearchResult.fi.uri);
+          u = GNUNET_ECRS_uri_to_string (event->data.SearchResult.fi.uri);
 #if DEBUG_VERBOSE
           printf ("Download started: %s.\n", u);
 #endif
           GNUNET_free (u);
-          download = FSUI_startDownload (ctx,
+          download = GNUNET_FSUI_download_start (ctx,
                                          0,
                                          GNUNET_NO,
                                          event->data.SearchResult.fi.uri,
@@ -124,80 +124,80 @@
                                          fn, NULL, NULL);
           if (download == NULL)
             {
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               return NULL;
             }
           GNUNET_free (fn);
           suspendRestart = 4;
         }
       break;
-    case FSUI_upload_progress:
+    case GNUNET_FSUI_upload_progress:
 #if DEBUG_VERBOSE
       printf ("Upload is progressing (%llu/%llu)...\n",
               event->data.UploadProgress.completed,
               event->data.UploadProgress.total);
 #endif
       break;
-    case FSUI_upload_completed:
-      upURI = ECRS_dupUri (event->data.UploadCompleted.uri);
+    case GNUNET_FSUI_upload_completed:
+      upURI = GNUNET_ECRS_uri_duplicate (event->data.UploadCompleted.uri);
 #if DEBUG_VERBOSE
       printf ("Upload complete.\n");
 #endif
       break;
-    case FSUI_download_completed:
+    case GNUNET_FSUI_download_completed:
 #if DEBUG_VERBOSE
       printf ("Download complete.\n");
 #endif
-      FSUI_abortSearch (ctx, search);
-      FSUI_stopSearch (ctx, search);
+      GNUNET_FSUI_search_abort (ctx, search);
+      GNUNET_FSUI_search_stop (ctx, search);
       search = NULL;
       break;
-    case FSUI_download_progress:
+    case GNUNET_FSUI_download_progress:
 #if DEBUG_VERBOSE
       printf ("Download is progressing (%llu/%llu)...\n",
               event->data.DownloadProgress.completed,
               event->data.DownloadProgress.total);
 #endif
       break;
-    case FSUI_unindex_progress:
+    case GNUNET_FSUI_unindex_progress:
 #if DEBUG_VERBOSE
       printf ("Unindex is progressing (%llu/%llu)...\n",
               event->data.UnindexProgress.completed,
               event->data.UnindexProgress.total);
 #endif
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
 #if DEBUG_VERBOSE
       printf ("Unindex complete.\n");
 #endif
       break;
-    case FSUI_unindex_error:
-    case FSUI_upload_error:
-    case FSUI_download_error:
-    case FSUI_search_error:
+    case GNUNET_FSUI_unindex_error:
+    case GNUNET_FSUI_upload_error:
+    case GNUNET_FSUI_download_error:
+    case GNUNET_FSUI_search_error:
       fprintf (stderr, "Received ERROR: %d\n", event->type);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_download_aborted:
+    case GNUNET_FSUI_download_aborted:
 #if DEBUG_VERBOSE
       printf ("Received download aborted event.\n");
 #endif
       break;
-    case FSUI_unindex_suspended:
-    case FSUI_upload_suspended:
+    case GNUNET_FSUI_unindex_suspended:
+    case GNUNET_FSUI_upload_suspended:
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received SUSPENDING: %d\n", event->type);
 #endif
       break;
-    case FSUI_upload_started:
-    case FSUI_upload_stopped:
-    case FSUI_download_started:
-    case FSUI_download_stopped:
-    case FSUI_search_started:
-    case FSUI_search_aborted:
-    case FSUI_search_stopped:
-    case FSUI_unindex_started:
-    case FSUI_unindex_stopped:
+    case GNUNET_FSUI_upload_started:
+    case GNUNET_FSUI_upload_stopped:
+    case GNUNET_FSUI_download_started:
+    case GNUNET_FSUI_download_stopped:
+    case GNUNET_FSUI_search_started:
+    case GNUNET_FSUI_search_aborted:
+    case GNUNET_FSUI_search_stopped:
+    case GNUNET_FSUI_unindex_started:
+    case GNUNET_FSUI_unindex_stopped:
       break;
     default:
       printf ("Unexpected event: %d\n", event->type);
@@ -221,7 +221,7 @@
 #endif
   int ok;
   int i;
-  struct ECRS_URI *uri = NULL;
+  struct GNUNET_ECRS_URI *uri = NULL;
   char *fn = NULL;
   char *keywords[] = {
     "down_foo",
@@ -231,29 +231,29 @@
   char keyword[40];
   int prog;
   char *buf;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *kuri = NULL;
-  struct GC_Configuration *cfg;
-  struct FSUI_UnindexList *unindex = NULL;
-  struct FSUI_UploadList *upload = NULL;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *kuri = NULL;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_FSUI_UnindexList *unindex = NULL;
+  struct GNUNET_FSUI_UploadList *upload = NULL;
 
   ok = GNUNET_YES;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
   /* ACTUAL TEST CODE */
 #endif
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "fsuidownloadtest", 32, GNUNET_YES, &eventCallback,
                     NULL);
   CHECK (ctx != NULL);
@@ -263,22 +263,22 @@
     buf[i] = GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 256);
   GNUNET_disk_file_write (ectx, fn, buf, FILESIZE, "600");
   GNUNET_free (buf);
-  meta = ECRS_createMetaData ();
-  kuri = ECRS_parseListKeywordURI (ectx, 2, (const char **) keywords);
-  waitForEvent = FSUI_upload_completed;
-  upload = FSUI_startUpload (ctx,
+  meta = GNUNET_ECRS_meta_data_create ();
+  kuri = GNUNET_ECRS_keyword_list_to_uri (ectx, 2, (const char **) keywords);
+  waitForEvent = GNUNET_FSUI_upload_completed;
+  upload = GNUNET_FSUI_upload_star (ctx,
                              fn,
-                             (DirectoryScanCallback) &
+                             (GNUNET_FSUI_DirectoryScanCallback) &
                              GNUNET_disk_directory_scan, NULL, 0, 0,
                              GNUNET_YES, GNUNET_NO, GNUNET_NO,
                              GNUNET_get_time () + 5 * GNUNET_CRON_HOURS, meta,
                              kuri, kuri);
   CHECK (upload != NULL);
-  ECRS_freeUri (kuri);
+  GNUNET_ECRS_uri_destroy (kuri);
   kuri = NULL;
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   prog = 0;
-  while (lastEvent != FSUI_upload_completed)
+  while (lastEvent != GNUNET_FSUI_upload_completed)
     {
       prog++;
       CHECK (prog < 5000);
@@ -286,12 +286,12 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopUpload (ctx, upload);
+  GNUNET_FSUI_upload_stop (ctx, upload);
   GNUNET_snprintf (keyword, 40, "%s %s %s", keywords[0], _("AND"),
                    keywords[1]);
-  uri = ECRS_parseCharKeywordURI (ectx, keyword);
-  waitForEvent = FSUI_download_completed;
-  search = FSUI_startSearch (ctx, 0, 10000, 240 * GNUNET_CRON_SECONDS, uri);
+  uri = GNUNET_ECRS_keyword_string_to_uri (ectx, keyword);
+  waitForEvent = GNUNET_FSUI_download_completed;
+  search = GNUNET_FSUI_search_start (ctx, 0, 10000, 240 * GNUNET_CRON_SECONDS, 
uri);
   CHECK (search != NULL);
   prog = 0;
   while (search != NULL)
@@ -306,11 +306,11 @@
 #if DEBUG_VERBOSE
           printf ("Testing FSUI suspend-resume\n");
 #endif
-          FSUI_stop (ctx);      /* download possibly incomplete
+          GNUNET_FSUI_stop (ctx);      /* download possibly incomplete
                                    at this point, thus testing resume */
           CHECK (search == NULL);
           CHECK (download == NULL);
-          ctx = FSUI_start (NULL,
+          ctx = GNUNET_FSUI_start (NULL,
                             cfg,
                             "fsuidownloadtest",
                             32, GNUNET_YES, &eventCallback, NULL);
@@ -325,29 +325,29 @@
     }
   CHECK (search == NULL);
   CHECK (download != NULL);
-  waitForEvent = FSUI_unindex_completed;
-  unindex = FSUI_startUnindex (ctx, fn);
+  waitForEvent = GNUNET_FSUI_unindex_completed;
+  unindex = GNUNET_FSUI_unindex_start (ctx, fn);
   CHECK (unindex != NULL);
   prog = 0;
-  while (lastEvent != FSUI_unindex_completed)
+  while (lastEvent != GNUNET_FSUI_unindex_completed)
     {
       prog++;
       CHECK (prog < 5000);
       GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
-      CHECK (lastEvent != FSUI_unindex_error);
+      CHECK (lastEvent != GNUNET_FSUI_unindex_error);
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  CHECK (lastEvent == FSUI_unindex_completed);
+  CHECK (lastEvent == GNUNET_FSUI_unindex_completed);
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
     {
       if (unindex != NULL)
-        FSUI_stopUnindex (ctx, unindex);
+        GNUNET_FSUI_unindex_stop (ctx, unindex);
       if (download != NULL)
-        FSUI_stopDownload (ctx, download);
-      FSUI_stop (ctx);
+        GNUNET_FSUI_download_stop (ctx, download);
+      GNUNET_FSUI_stop (ctx);
     }
   if (fn != NULL)
     {
@@ -355,20 +355,20 @@
       GNUNET_free (fn);
     }
   if (uri != NULL)
-    ECRS_freeUri (uri);
+    GNUNET_ECRS_uri_destroy (uri);
   if (kuri != NULL)
-    ECRS_freeUri (kuri);
+    GNUNET_ECRS_uri_destroy (kuri);
   fn = makeName (43);
   /* TODO: verify file 'fn(42)' == file 'fn(43)' */
   UNLINK (fn);
   GNUNET_free (fn);
   if (upURI != NULL)
-    ECRS_freeUri (upURI);
+    GNUNET_ECRS_uri_destroy (upURI);
 
 #if START_DAEMON
-  GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/fsui/fsui-loader.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui-loader.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/fsui-loader.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -29,21 +29,21 @@
 #include "gnunet_util.h"
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
 #if 0
   switch (event->type)
     {
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
       printf ("Received search result\n");
       break;
-    case FSUI_upload_complete:
+    case GNUNET_FSUI_upload_complete:
       printf ("Upload complete.\n");
       break;
-    case FSUI_download_complete:
+    case GNUNET_FSUI_download_complete:
       printf ("Download complete.\n");
       break;
-    case FSUI_unindex_complete:
+    case GNUNET_FSUI_unindex_complete:
       printf ("Unindex complete.\n");
       break;
     default:
@@ -57,21 +57,21 @@
 int
 main (int argc, char *argv[])
 {
-  struct FSUI_Context *ctx;
-  struct GC_Configuration *cfg;
+  struct GNUNET_FSUI_Context *ctx;
+  struct GNUNET_GC_Configuration *cfg;
 
   GNUNET_os_init (NULL);
-  cfg = GC_create ();
+  cfg = GNUNET_GC_create ();
   if (argc != 2)
     {
       fprintf (stderr, "Call with name of FSUI resource file!\n");
       return -1;
     }
-  ctx = FSUI_start (NULL, cfg, argv[1], 16, GNUNET_YES, &eventCallback, NULL);
+  ctx = GNUNET_FSUI_start (NULL, cfg, argv[1], 16, GNUNET_YES, &eventCallback, 
NULL);
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
   else
-    fprintf (stderr, "FSUI_start failed!\n");
-  GC_free (cfg);
+    fprintf (stderr, "GNUNET_FSUI_start failed!\n");
+  GNUNET_GC_free (cfg);
   return (ctx == NULL);
 }

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -33,7 +33,7 @@
 
 /* ***************** CRON code ***************** */
 
-#define FSUI_UDT_FREQUENCY (2 * GNUNET_CRON_SECONDS)
+#define GNUNET_FSUI_UDT_FREQUENCY (2 * GNUNET_CRON_SECONDS)
 
 /**
  * Cron job for download load management.
@@ -41,20 +41,20 @@
 static void
 updateDownloadThreads (void *c)
 {
-  FSUI_Context *ctx = c;
-  FSUI_DownloadList *dpos;
+  GNUNET_FSUI_Context *ctx = c;
+  GNUNET_FSUI_DownloadList *dpos;
 
   GNUNET_mutex_lock (ctx->lock);
   dpos = ctx->activeDownloads.child;
 #if DEBUG_PERSISTENCE
   if (dpos != NULL)
-    GE_LOG (ctx->ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+    GNUNET_GE_LOG (ctx->ectx,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             "Download thread manager schedules pending downloads...\n");
 #endif
   while (dpos != NULL)
     {
-      FSUI_updateDownloadThread (dpos);
+      GNUNET_FSUI_updateDownloadThread (dpos);
       dpos = dpos->next;
     }
   GNUNET_mutex_unlock (ctx->lock);
@@ -63,15 +63,15 @@
 /* ******************* START code *********************** */
 
 static void
-signalDownloadResume (struct FSUI_DownloadList *ret, FSUI_Context * ctx)
+signalDownloadResume (struct GNUNET_FSUI_DownloadList *ret, 
GNUNET_FSUI_Context * ctx)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
   GNUNET_CronTime now;
   GNUNET_CronTime eta;
 
   while (ret != NULL)
     {
-      event.type = FSUI_download_resumed;
+      event.type = GNUNET_FSUI_download_resumed;
       event.data.DownloadResumed.dc.pos = ret;
       event.data.DownloadResumed.dc.cctx = ret->cctx;
       event.data.DownloadResumed.dc.ppos =
@@ -110,15 +110,15 @@
 }
 
 static void
-signalUploadResume (struct FSUI_UploadList *ret, FSUI_Context * ctx)
+signalUploadResume (struct GNUNET_FSUI_UploadList *ret, GNUNET_FSUI_Context * 
ctx)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
   GNUNET_CronTime now;
   GNUNET_CronTime eta;
 
   while (ret != NULL)
     {
-      event.type = FSUI_upload_resumed;
+      event.type = GNUNET_FSUI_upload_resumed;
       event.data.UploadResumed.uc.pos = ret;
       event.data.UploadResumed.uc.cctx = NULL;
       event.data.UploadResumed.uc.ppos = ret->parent;
@@ -157,17 +157,17 @@
  * threads below are controlled by the parent.
  */
 static void
-doResumeUploads (struct FSUI_UploadList *ret, FSUI_Context * ctx)
+doResumeUploads (struct GNUNET_FSUI_UploadList *ret, GNUNET_FSUI_Context * ctx)
 {
   while (ret != NULL)
     {
-      if (ret->state == FSUI_ACTIVE)
+      if (ret->state == GNUNET_FSUI_ACTIVE)
         {
-          ret->shared->handle = GNUNET_thread_create (&FSUI_uploadThread,
+          ret->shared->handle = GNUNET_thread_create 
(&GNUNET_FSUI_uploadThread,
                                                       ret, 128 * 1024);
           if (ret->shared->handle == NULL)
-            GE_DIE_STRERROR (ctx->ectx,
-                             GE_FATAL | GE_ADMIN | GE_IMMEDIATE,
+            GNUNET_GE_DIE_STRERROR (ctx->ectx,
+                             GNUNET_GE_FATAL | GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE,
                              "pthread_create");
         }
       ret = ret->next;
@@ -177,30 +177,30 @@
 /**
  * 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.
+ * running when GNUNET_FSUI_stop was called previously.
  *
  * @param name name of the context, must not be NULL
  * @return NULL on error
  */
-struct FSUI_Context *
-FSUI_start (struct GE_Context *ectx,
-            struct GC_Configuration *cfg,
+struct GNUNET_FSUI_Context *
+GNUNET_FSUI_start (struct GNUNET_GE_Context *ectx,
+            struct GNUNET_GC_Configuration *cfg,
             const char *name,
             unsigned int threadPoolSize,
-            int doResume, FSUI_EventCallback cb, void *closure)
+            int doResume, GNUNET_FSUI_EventProcessor cb, void *closure)
 {
-  FSUI_Event event;
-  FSUI_Context *ret;
-  FSUI_SearchList *list;
-  FSUI_UnindexList *xlist;
+  GNUNET_FSUI_Event event;
+  GNUNET_FSUI_Context *ret;
+  GNUNET_FSUI_SearchList *list;
+  GNUNET_FSUI_UnindexList *xlist;
   char *fn;
   char *gh;
   unsigned long long size;
 
-  GE_ASSERT (ectx, cfg != NULL);
-  ret = GNUNET_malloc (sizeof (FSUI_Context));
-  memset (ret, 0, sizeof (FSUI_Context));
-  ret->activeDownloads.state = FSUI_PENDING;    /* !? */
+  GNUNET_GE_ASSERT (ectx, cfg != NULL);
+  ret = GNUNET_malloc (sizeof (GNUNET_FSUI_Context));
+  memset (ret, 0, sizeof (GNUNET_FSUI_Context));
+  ret->activeDownloads.state = GNUNET_FSUI_PENDING;    /* !? */
   ret->activeDownloads.ctx = ret;
   ret->cfg = cfg;
   ret->ecb = cb;
@@ -210,10 +210,10 @@
     ret->threadPoolSize = 32;
   ret->activeDownloadThreads = 0;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &gh);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &gh);
   GNUNET_disk_directory_create (ectx, gh);
   fn = GNUNET_malloc (strlen (gh) + strlen (name) + 2 + 5);
   strcpy (fn, gh);
@@ -227,16 +227,16 @@
     {
       ret->ipc = GNUNET_IPC_semaphore_create (ectx, fn, 1);
 #if DEBUG_PERSISTENCE
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Getting IPC lock for FSUI (%s).\n", fn);
 #endif
       GNUNET_IPC_semaphore_down (ret->ipc, GNUNET_YES);
 #if DEBUG_PERSISTENCE
-      GE_LOG (ectx, GE_INFO | GE_REQUEST | GE_USER, "Aquired IPC lock.\n");
+      GNUNET_GE_LOG (ectx, GNUNET_GE_INFO | GNUNET_GE_REQUEST | 
GNUNET_GE_USER, "Aquired IPC lock.\n");
 #endif
       strcat (fn, ".res");
-      FSUI_deserialize (ret);
+      GNUNET_FSUI_deserialize (ret);
     }
   else
     {
@@ -251,7 +251,7 @@
   list = ret->activeSearches;
   while (list != NULL)
     {
-      event.type = FSUI_search_resumed;
+      event.type = GNUNET_FSUI_search_resumed;
       event.data.SearchResumed.sc.pos = list;
       event.data.SearchResumed.sc.cctx = NULL;
       event.data.SearchResumed.fis = list->resultsReceived;
@@ -271,11 +271,11 @@
       if (GNUNET_OK !=
           GNUNET_disk_file_size (ectx, xlist->filename, &size, GNUNET_YES))
         size = 0;
-      event.type = FSUI_unindex_resumed;
+      event.type = GNUNET_FSUI_unindex_resumed;
       event.data.UnindexResumed.uc.pos = xlist;
       event.data.UnindexResumed.uc.cctx = NULL;
       event.data.UnindexResumed.completed =
-        (xlist->state == FSUI_COMPLETED_JOINED) ? size : 0;
+        (xlist->state == GNUNET_FSUI_COMPLETED_JOINED) ? size : 0;
       event.data.UnindexResumed.total = size;
       event.data.UnindexResumed.eta = GNUNET_get_time ();
       event.data.UnindexResumed.filename = xlist->filename;
@@ -288,7 +288,7 @@
   ret->cron = cron_create (ectx);
   /* 3a) resume downloads */
   GNUNET_cron_add_job (ret->cron,
-                       &updateDownloadThreads, 0, FSUI_UDT_FREQUENCY, ret);
+                       &updateDownloadThreads, 0, GNUNET_FSUI_UDT_FREQUENCY, 
ret);
   GNUNET_cron_start (ret->cron);
   /* 3b) resume uploads */
   doResumeUploads (ret->activeUploads.child, ret);
@@ -296,14 +296,14 @@
   xlist = ret->unindexOperations;
   while (xlist != NULL)
     {
-      if (xlist->state == FSUI_PENDING)
+      if (xlist->state == GNUNET_FSUI_PENDING)
         {
-          xlist->state = FSUI_ACTIVE;
-          xlist->handle = GNUNET_thread_create (&FSUI_unindexThread,
+          xlist->state = GNUNET_FSUI_ACTIVE;
+          xlist->handle = GNUNET_thread_create (&GNUNET_FSUI_unindexThread,
                                                 xlist, 32 * 1024);
           if (xlist->handle == NULL)
-            GE_DIE_STRERROR (ectx,
-                             GE_FATAL | GE_ADMIN | GE_IMMEDIATE,
+            GNUNET_GE_DIE_STRERROR (ectx,
+                             GNUNET_GE_FATAL | GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE,
                              "pthread_create");
         }
       xlist = xlist->next;
@@ -312,14 +312,14 @@
   list = ret->activeSearches;
   while (list != NULL)
     {
-      if (list->state == FSUI_PENDING)
+      if (list->state == GNUNET_FSUI_PENDING)
         {
-          list->state = FSUI_ACTIVE;
+          list->state = GNUNET_FSUI_ACTIVE;
           list->handle =
-            GNUNET_thread_create (&FSUI_searchThread, list, 32 * 1024);
+            GNUNET_thread_create (&GNUNET_FSUI_searchThread, list, 32 * 1024);
           if (list->handle == NULL)
-            GE_DIE_STRERROR (ectx,
-                             GE_FATAL | GE_ADMIN | GE_IMMEDIATE,
+            GNUNET_GE_DIE_STRERROR (ectx,
+                             GNUNET_GE_FATAL | GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE,
                              "pthread_create");
         }
       list = list->next;
@@ -334,14 +334,14 @@
  * (recursively) signal download suspension.
  */
 static void
-signalDownloadSuspend (struct GE_Context *ectx,
-                       FSUI_Context * ctx, FSUI_DownloadList * list)
+signalDownloadSuspend (struct GNUNET_GE_Context *ectx,
+                       GNUNET_FSUI_Context * ctx, GNUNET_FSUI_DownloadList * 
list)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
   while (list != NULL)
     {
       signalDownloadSuspend (ectx, ctx, list->child);
-      event.type = FSUI_download_suspended;
+      event.type = GNUNET_FSUI_download_suspended;
       event.data.DownloadSuspended.dc.pos = list;
       event.data.DownloadSuspended.dc.cctx = list->cctx;
       event.data.DownloadSuspended.dc.ppos =
@@ -359,14 +359,14 @@
  * (recursively) signal upload suspension.
  */
 static void
-signalUploadSuspend (struct GE_Context *ectx,
-                     FSUI_Context * ctx, FSUI_UploadList * upos)
+signalUploadSuspend (struct GNUNET_GE_Context *ectx,
+                     GNUNET_FSUI_Context * ctx, GNUNET_FSUI_UploadList * upos)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
   while (upos != NULL)
     {
       signalUploadSuspend (ectx, ctx, upos->child);
-      event.type = FSUI_upload_suspended;
+      event.type = GNUNET_FSUI_upload_suspended;
       event.data.UploadSuspended.uc.pos = upos;
       event.data.UploadSuspended.uc.cctx = upos->cctx;
       event.data.UploadSuspended.uc.ppos = upos->parent;
@@ -380,19 +380,19 @@
  * (recursively) free download list
  */
 static void
-freeDownloadList (FSUI_DownloadList * list)
+freeDownloadList (GNUNET_FSUI_DownloadList * list)
 {
-  FSUI_DownloadList *next;
+  GNUNET_FSUI_DownloadList *next;
   int i;
 
   while (list != NULL)
     {
       freeDownloadList (list->child);
-      ECRS_freeUri (list->fi.uri);
-      ECRS_freeMetaData (list->fi.meta);
+      GNUNET_ECRS_uri_destroy (list->fi.uri);
+      GNUNET_ECRS_meta_data_destroy (list->fi.meta);
       GNUNET_free (list->filename);
       for (i = 0; i < list->completedDownloadsCount; i++)
-        ECRS_freeUri (list->completedDownloads[i]);
+        GNUNET_ECRS_uri_destroy (list->completedDownloads[i]);
       GNUNET_array_grow (list->completedDownloads,
                          list->completedDownloadsCount, 0);
       next = list->next;
@@ -405,10 +405,10 @@
  * (recursively) free upload list
  */
 static void
-freeUploadList (struct FSUI_Context *ctx, FSUI_UploadList * list)
+freeUploadList (struct GNUNET_FSUI_Context *ctx, GNUNET_FSUI_UploadList * list)
 {
-  FSUI_UploadList *next;
-  FSUI_UploadShared *shared;
+  GNUNET_FSUI_UploadList *next;
+  GNUNET_FSUI_UploadShared *shared;
 
   while (list != NULL)
     {
@@ -416,17 +416,17 @@
       next = list->next;
       GNUNET_free (list->filename);
       if (list->meta != NULL)
-        ECRS_freeMetaData (list->meta);
+        GNUNET_ECRS_meta_data_destroy (list->meta);
       if (list->keywords != NULL)
-        ECRS_freeUri (list->keywords);
+        GNUNET_ECRS_uri_destroy (list->keywords);
       if (list->uri != NULL)
-        ECRS_freeUri (list->uri);
+        GNUNET_ECRS_uri_destroy (list->uri);
       if (list->parent == &ctx->activeUploads)
         {
           shared = list->shared;
           EXTRACTOR_removeAll (shared->extractors);
           if (shared->global_keywords != NULL)
-            ECRS_freeUri (shared->global_keywords);
+            GNUNET_ECRS_uri_destroy (shared->global_keywords);
           GNUNET_free_non_null (shared->extractor_config);
           GNUNET_free (shared);
         }
@@ -440,26 +440,26 @@
  * later if possible).
  */
 void
-FSUI_stop (struct FSUI_Context *ctx)
+GNUNET_FSUI_stop (struct GNUNET_FSUI_Context *ctx)
 {
-  struct GE_Context *ectx;
-  FSUI_SearchList *spos;
-  FSUI_DownloadList *dpos;
-  FSUI_UnindexList *xpos;
-  FSUI_UploadList *upos;
-  FSUI_Event event;
+  struct GNUNET_GE_Context *ectx;
+  GNUNET_FSUI_SearchList *spos;
+  GNUNET_FSUI_DownloadList *dpos;
+  GNUNET_FSUI_UnindexList *xpos;
+  GNUNET_FSUI_UploadList *upos;
+  GNUNET_FSUI_Event event;
   void *unused;
   int i;
 
   ectx = ctx->ectx;
   if (ctx->ipc != NULL)
-    GE_LOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+    GNUNET_GE_LOG (ectx,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             "FSUI shutdown.  This may take a while.\n");
 
   /* 1) stop everything */
   GNUNET_cron_stop (ctx->cron);
-  GNUNET_cron_del_job (ctx->cron, &updateDownloadThreads, FSUI_UDT_FREQUENCY,
+  GNUNET_cron_del_job (ctx->cron, &updateDownloadThreads, 
GNUNET_FSUI_UDT_FREQUENCY,
                        ctx);
   GNUNET_cron_destroy (ctx->cron);
 
@@ -468,22 +468,22 @@
   dpos = ctx->activeDownloads.child;
   while (dpos != NULL)
     {
-      FSUI_updateDownloadThread (dpos);
+      GNUNET_FSUI_updateDownloadThread (dpos);
       dpos = dpos->next;
     }
   /* 1b) stop searching */
   spos = ctx->activeSearches;
   while (spos != NULL)
     {
-      if ((spos->state == FSUI_ACTIVE) ||
-          (spos->state == FSUI_ABORTED) ||
-          (spos->state == FSUI_ERROR) || (spos->state == FSUI_COMPLETED))
+      if ((spos->state == GNUNET_FSUI_ACTIVE) ||
+          (spos->state == GNUNET_FSUI_ABORTED) ||
+          (spos->state == GNUNET_FSUI_ERROR) || (spos->state == 
GNUNET_FSUI_COMPLETED))
         {
-          if (spos->state == FSUI_ACTIVE)
-            spos->state = FSUI_PENDING;
+          if (spos->state == GNUNET_FSUI_ACTIVE)
+            spos->state = GNUNET_FSUI_PENDING;
           GNUNET_thread_stop_sleep (spos->handle);
           GNUNET_thread_join (spos->handle, &unused);
-          if (spos->state != FSUI_PENDING)
+          if (spos->state != GNUNET_FSUI_PENDING)
             spos->state++;      /* _JOINED */
         }
       spos = spos->next;
@@ -492,15 +492,15 @@
   xpos = ctx->unindexOperations;
   while (xpos != NULL)
     {
-      if ((xpos->state == FSUI_ACTIVE) ||
-          (xpos->state == FSUI_ABORTED) ||
-          (xpos->state == FSUI_ERROR) || (xpos->state == FSUI_COMPLETED))
+      if ((xpos->state == GNUNET_FSUI_ACTIVE) ||
+          (xpos->state == GNUNET_FSUI_ABORTED) ||
+          (xpos->state == GNUNET_FSUI_ERROR) || (xpos->state == 
GNUNET_FSUI_COMPLETED))
         {
-          if (xpos->state == FSUI_ACTIVE)
-            xpos->state = FSUI_PENDING;
+          if (xpos->state == GNUNET_FSUI_ACTIVE)
+            xpos->state = GNUNET_FSUI_PENDING;
           GNUNET_thread_stop_sleep (xpos->handle);
           GNUNET_thread_join (xpos->handle, &unused);
-          if (xpos->state != FSUI_PENDING)
+          if (xpos->state != GNUNET_FSUI_PENDING)
             xpos->state++;      /* _JOINED */
         }
       xpos = xpos->next;
@@ -509,17 +509,17 @@
   upos = ctx->activeUploads.child;
   while (upos != NULL)
     {
-      if ((upos->state == FSUI_ACTIVE) ||
-          (upos->state == FSUI_ABORTED) ||
-          (upos->state == FSUI_ERROR) || (upos->state == FSUI_COMPLETED))
+      if ((upos->state == GNUNET_FSUI_ACTIVE) ||
+          (upos->state == GNUNET_FSUI_ABORTED) ||
+          (upos->state == GNUNET_FSUI_ERROR) || (upos->state == 
GNUNET_FSUI_COMPLETED))
         {
           /* NOTE: will force transitive termination
              of rest of tree! */
-          if (upos->state == FSUI_ACTIVE)
-            upos->state = FSUI_PENDING;
+          if (upos->state == GNUNET_FSUI_ACTIVE)
+            upos->state = GNUNET_FSUI_PENDING;
           GNUNET_thread_stop_sleep (upos->shared->handle);
           GNUNET_thread_join (upos->shared->handle, &unused);
-          if (upos->state != FSUI_PENDING)
+          if (upos->state != GNUNET_FSUI_PENDING)
             upos->state++;      /* _JOINED */
         }
       upos = upos->next;
@@ -530,7 +530,7 @@
   spos = ctx->activeSearches;
   while (spos != NULL)
     {
-      event.type = FSUI_search_suspended;
+      event.type = GNUNET_FSUI_search_suspended;
       event.data.SearchSuspended.sc.pos = spos;
       event.data.SearchSuspended.sc.cctx = spos->cctx;
       ctx->ecb (ctx->ecbClosure, &event);
@@ -544,7 +544,7 @@
   xpos = ctx->unindexOperations;
   while (xpos != NULL)
     {
-      event.type = FSUI_unindex_suspended;
+      event.type = GNUNET_FSUI_unindex_suspended;
       event.data.UnindexSuspended.uc.pos = xpos;
       event.data.UnindexSuspended.uc.cctx = xpos->cctx;
       ctx->ecb (ctx->ecbClosure, &event);
@@ -553,7 +553,7 @@
 
   /* 3) serialize all of the FSUI state */
   if (ctx->ipc != NULL)
-    FSUI_serialize (ctx);
+    GNUNET_FSUI_serialize (ctx);
 
   /* 4) finally, free memory */
   /* 4a) free search memory */
@@ -561,13 +561,13 @@
     {
       spos = ctx->activeSearches;
       ctx->activeSearches = spos->next;
-      ECRS_freeUri (spos->uri);
+      GNUNET_ECRS_uri_destroy (spos->uri);
       for (i = spos->sizeResultsReceived - 1; i >= 0; i--)
         {
-          ECRS_FileInfo *fi;
+          GNUNET_ECRS_FileInfo *fi;
           fi = &spos->resultsReceived[i];
-          ECRS_freeMetaData (fi->meta);
-          ECRS_freeUri (fi->uri);
+          GNUNET_ECRS_meta_data_destroy (fi->meta);
+          GNUNET_ECRS_uri_destroy (fi->uri);
         }
       GNUNET_array_grow (spos->resultsReceived, spos->sizeResultsReceived, 0);
       for (i = spos->sizeUnmatchedResultsReceived - 1; i >= 0; i--)
@@ -576,8 +576,8 @@
 
           rp = &spos->unmatchedResultsReceived[i];
           GNUNET_array_grow (rp->matchingKeys, rp->matchingKeyCount, 0);
-          ECRS_freeMetaData (rp->fi.meta);
-          ECRS_freeUri (rp->fi.uri);
+          GNUNET_ECRS_meta_data_destroy (rp->fi.meta);
+          GNUNET_ECRS_uri_destroy (rp->fi.uri);
         }
       GNUNET_array_grow (spos->unmatchedResultsReceived,
                          spos->sizeUnmatchedResultsReceived, 0);
@@ -605,8 +605,8 @@
   GNUNET_mutex_destroy (ctx->lock);
   GNUNET_free (ctx->name);
   if (ctx->ipc != NULL)
-    GE_LOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER, "FSUI shutdown complete.\n");
+    GNUNET_GE_LOG (ectx,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "FSUI 
shutdown complete.\n");
   GNUNET_free (ctx);
 }
 

Modified: GNUnet/src/applications/fs/fsui/fsui.h
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.h      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/fsui.h      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -23,8 +23,8 @@
  * @brief internal definitions for libfsui
  * @author Christian Grothoff
  */
-#ifndef FSUI_H
-#define FSUI_H
+#ifndef GNUNET_FSUI_H
+#define GNUNET_FSUI_H
 
 #include "gnunet_util.h"
 #include "gnunet_util_cron.h"
@@ -45,7 +45,7 @@
   /**
    * What info do we have about this result?
    */
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
 
   /**
    * For how many keys (GNUNET_hash of keyword) did we
@@ -58,7 +58,7 @@
 /**
  * @brief list of active searches
  */
-typedef struct FSUI_SearchList
+typedef struct GNUNET_FSUI_SearchList
 {
 
   /**
@@ -74,12 +74,12 @@
   /**
    * Searches are kept in a simple linked list.
    */
-  struct FSUI_SearchList *next;
+  struct GNUNET_FSUI_SearchList *next;
 
   /**
    * Context for this search
    */
-  struct FSUI_Context *ctx;
+  struct GNUNET_FSUI_Context *ctx;
 
   /**
    * Handle to the thread which performs the search.
@@ -89,17 +89,17 @@
   /**
    * Which URI are we searching?
    */
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   /**
    * What downloads belong to this search?
    */
-  struct FSUI_DownloadList **my_downloads;
+  struct GNUNET_FSUI_DownloadList **my_downloads;
 
   /**
    * List of all results found so far.
    */
-  ECRS_FileInfo *resultsReceived;
+  GNUNET_ECRS_FileInfo *resultsReceived;
 
   ResultPending *unmatchedResultsReceived;
 
@@ -138,14 +138,14 @@
    */
   unsigned int sizeUnmatchedResultsReceived;
 
-  FSUI_State state;
+  GNUNET_FSUI_State state;
 
-} FSUI_SearchList;
+} GNUNET_FSUI_SearchList;
 
 /**
  * @brief list of active downloads
  */
-typedef struct FSUI_DownloadList
+typedef struct GNUNET_FSUI_DownloadList
 {
 
   /**
@@ -162,7 +162,7 @@
   /**
    * URI for this download.
    */
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
 
   /**
    * Filename for this download.
@@ -173,30 +173,30 @@
    * Next in the linked list of all downloads
    * kept in FSUI context.
    */
-  struct FSUI_DownloadList *next;
+  struct GNUNET_FSUI_DownloadList *next;
 
   /**
    * For recursive downloads, download entry for
    * the parent.
    */
-  struct FSUI_DownloadList *parent;
+  struct GNUNET_FSUI_DownloadList *parent;
 
   /**
    * If this is a recursive download, this is the
    * list of sub-downloads that are currently
    * going on in parallel.
    */
-  struct FSUI_DownloadList *child;
+  struct GNUNET_FSUI_DownloadList *child;
 
   /**
    * Search that this download belongs to (maybe NULL)
    */
-  struct FSUI_SearchList *search;
+  struct GNUNET_FSUI_SearchList *search;
 
   /**
    * FSUI context for this download.
    */
-  struct FSUI_Context *ctx;
+  struct GNUNET_FSUI_Context *ctx;
 
   /**
    * Client context for the downloadx
@@ -211,7 +211,7 @@
   /**
    * FIs of completed sub-downloads.
    */
-  struct ECRS_URI **completedDownloads;
+  struct GNUNET_ECRS_URI **completedDownloads;
 
   /**
    * When did the download start?  Note that if a download is resumed,
@@ -265,55 +265,55 @@
   /**
    * State of the download.
    */
-  FSUI_State state;
+  GNUNET_FSUI_State state;
 
-} FSUI_DownloadList;
+} GNUNET_FSUI_DownloadList;
 
 /**
  * Context for the unindex thread.
  */
-typedef struct FSUI_UnindexList
+typedef struct GNUNET_FSUI_UnindexList
 {
 
   GNUNET_CronTime start_time;
 
-  struct FSUI_UnindexList *next;
+  struct GNUNET_FSUI_UnindexList *next;
 
   struct GNUNET_ThreadHandle *handle;
 
   char *filename;
 
-  struct FSUI_Context *ctx;
+  struct GNUNET_FSUI_Context *ctx;
 
   void *cctx;
 
-  FSUI_State state;
+  GNUNET_FSUI_State state;
 
-} FSUI_UnindexList;
+} GNUNET_FSUI_UnindexList;
 
 
 /**
  * Shared context for upload of entire structure.
  */
-typedef struct FSUI_UploadShared
+typedef struct GNUNET_FSUI_UploadShared
 {
 
   GNUNET_CronTime expiration;
 
-  DirectoryScanCallback dsc;
+  GNUNET_FSUI_DirectoryScanCallback dsc;
 
   void *dscClosure;
 
   EXTRACTOR_ExtractorList *extractors;
 
-  struct FSUI_Context *ctx;
+  struct GNUNET_FSUI_Context *ctx;
 
   struct GNUNET_ThreadHandle *handle;
 
   /**
    * Keywords to be used for all uploads.
    */
-  struct ECRS_URI *global_keywords;
+  struct GNUNET_ECRS_URI *global_keywords;
 
   char *extractor_config;
 
@@ -325,12 +325,12 @@
 
   int individualKeywords;
 
-} FSUI_UploadShared;
+} GNUNET_FSUI_UploadShared;
 
 /**
  * Context for each file upload.
  */
-typedef struct FSUI_UploadList
+typedef struct GNUNET_FSUI_UploadList
 {
 
   unsigned long long completed;
@@ -339,28 +339,28 @@
 
   GNUNET_CronTime start_time;
 
-  struct FSUI_UploadShared *shared;
+  struct GNUNET_FSUI_UploadShared *shared;
 
-  struct FSUI_UploadList *next;
+  struct GNUNET_FSUI_UploadList *next;
 
-  struct FSUI_UploadList *child;
+  struct GNUNET_FSUI_UploadList *child;
 
-  struct FSUI_UploadList *parent;
+  struct GNUNET_FSUI_UploadList *parent;
 
   /**
    * Metadata for this file.
    */
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
 
   /**
    * Keywords to be used for this upload.
    */
-  struct ECRS_URI *keywords;
+  struct GNUNET_ECRS_URI *keywords;
 
   /**
    * URI for this file (set upon completion).
    */
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   char *filename;
 
@@ -372,19 +372,19 @@
   /**
    * State of this sub-process.
    */
-  FSUI_State state;
+  GNUNET_FSUI_State state;
 
-} FSUI_UploadList;
+} GNUNET_FSUI_UploadList;
 
 /**
  * @brief global state of the FSUI library
  */
-typedef struct FSUI_Context
+typedef struct GNUNET_FSUI_Context
 {
 
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
   /**
    * IPC semaphore used to ensure mutual exclusion
@@ -408,7 +408,7 @@
   /**
    * Callback for notifying the client about events.
    */
-  FSUI_EventCallback ecb;
+  GNUNET_FSUI_EventProcessor ecb;
 
   /**
    * Extra argument to ecb.
@@ -418,25 +418,25 @@
   /**
    * Collection related data.
    */
-  DataContainer *collectionData;
+  GNUNET_DataContainer *collectionData;
 
   /**
    * List of active searches.
    */
-  FSUI_SearchList *activeSearches;
+  GNUNET_FSUI_SearchList *activeSearches;
 
   /**
    * List of active unindex operations.
    */
-  FSUI_UnindexList *unindexOperations;
+  GNUNET_FSUI_UnindexList *unindexOperations;
 
-  FSUI_UploadList activeUploads;
+  GNUNET_FSUI_UploadList activeUploads;
 
   /**
    * Root of the tree of downloads.  On shutdown,
    * FSUI must abort each of these downloads.
    */
-  FSUI_DownloadList activeDownloads;
+  GNUNET_FSUI_DownloadList activeDownloads;
 
   /**
    * Target size of the thread pool for parallel
@@ -450,7 +450,7 @@
    */
   unsigned int activeDownloadThreads;
 
-} FSUI_Context;
+} GNUNET_FSUI_Context;
 
 /* ************ cross-file prototypes ************ */
 
@@ -461,16 +461,16 @@
  *
  * @return GNUNET_YES if change done that may require re-trying
  */
-int FSUI_updateDownloadThread (FSUI_DownloadList * list);
+int GNUNET_FSUI_updateDownloadThread (GNUNET_FSUI_DownloadList * list);
 
-void *FSUI_uploadThread (void *dl);
+void *GNUNET_FSUI_uploadThread (void *dl);
 
-void *FSUI_searchThread (void *pos);
+void *GNUNET_FSUI_searchThread (void *pos);
 
-void *FSUI_unindexThread (void *cls);
+void *GNUNET_FSUI_unindexThread (void *cls);
 
-void FSUI_serialize (struct FSUI_Context *ctx);
+void GNUNET_FSUI_serialize (struct GNUNET_FSUI_Context *ctx);
 
-void FSUI_deserialize (struct FSUI_Context *ctx);
+void GNUNET_FSUI_deserialize (struct GNUNET_FSUI_Context *ctx);
 
 #endif

Modified: GNUnet/src/applications/fs/fsui/fsuitest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsuitest.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/fsuitest.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -32,7 +32,7 @@
 
 #define DEBUG_VERBOSE GNUNET_NO
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 static char *
 makeName (unsigned int i)
@@ -47,31 +47,31 @@
   return fn;
 }
 
-static volatile enum FSUI_EventType lastEvent;
+static volatile enum GNUNET_FSUI_EventType lastEvent;
 
-static struct FSUI_Context *ctx;
+static struct GNUNET_FSUI_Context *ctx;
 
-static struct FSUI_DownloadList *download;
+static struct GNUNET_FSUI_DownloadList *download;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   static char unused;
   char *fn;
 
   switch (event->type)
     {
-    case FSUI_search_resumed:
-    case FSUI_download_resumed:
-    case FSUI_upload_resumed:
-    case FSUI_unindex_resumed:
+    case GNUNET_FSUI_search_resumed:
+    case GNUNET_FSUI_download_resumed:
+    case GNUNET_FSUI_upload_resumed:
+    case GNUNET_FSUI_unindex_resumed:
       return &unused;
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
 #if DEBUG_VERBOSE
       printf ("Received search result\n");
 #endif
       fn = makeName (43);
-      download = FSUI_startDownload (ctx,
+      download = GNUNET_FSUI_download_start (ctx,
                                      0,
                                      GNUNET_NO,
                                      event->data.SearchResult.fi.uri,
@@ -79,17 +79,17 @@
                                      fn, NULL, NULL);
       GNUNET_free (fn);
       break;
-    case FSUI_upload_completed:
+    case GNUNET_FSUI_upload_completed:
 #if DEBUG_VERBOSE
       printf ("Upload complete.\n");
 #endif
       break;
-    case FSUI_download_completed:
+    case GNUNET_FSUI_download_completed:
 #if DEBUG_VERBOSE
       printf ("Download complete.\n");
 #endif
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
 #if DEBUG_VERBOSE
       printf ("Unindex complete.\n");
 #endif
@@ -110,7 +110,7 @@
   pid_t daemon;
 #endif
   int ok;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   char *filename = NULL;
   char *keywords[] = {
     "fsui_foo",
@@ -119,22 +119,22 @@
   };
   char keyword[40];
   int prog;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *kuri;
-  struct GC_Configuration *cfg;
-  struct FSUI_UploadList *upload;
-  struct FSUI_SearchList *search;
-  struct FSUI_UnindexList *unindex;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *kuri;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_FSUI_UploadList *upload;
+  struct GNUNET_FSUI_SearchList *search;
+  struct GNUNET_FSUI_UnindexList *unindex;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          60 * GNUNET_CRON_SECONDS));
@@ -143,7 +143,7 @@
   ok = GNUNET_YES;
 
   /* ACTUAL TEST CODE */
-  ctx = FSUI_start (NULL, cfg, "fsuitest", 32,  /* thread pool size */
+  ctx = GNUNET_FSUI_start (NULL, cfg, "fsuitest", 32,  /* thread pool size */
                     GNUNET_NO,  /* no resume */
                     &eventCallback, NULL);
   CHECK (ctx != NULL);
@@ -151,9 +151,9 @@
   GNUNET_disk_file_write (NULL,
                           filename,
                           "foo bar test!", strlen ("foo bar test!"), "600");
-  meta = ECRS_createMetaData ();
-  kuri = ECRS_parseListKeywordURI (NULL, 2, (const char **) keywords);
-  upload = FSUI_startUpload (ctx, filename, (DirectoryScanCallback) & 
GNUNET_disk_directory_scan, NULL, 0,      /* anonymity */
+  meta = GNUNET_ECRS_meta_data_create ();
+  kuri = GNUNET_ECRS_keyword_list_to_uri (NULL, 2, (const char **) keywords);
+  upload = GNUNET_FSUI_upload_star (ctx, filename, 
(GNUNET_FSUI_DirectoryScanCallback) & GNUNET_disk_directory_scan, NULL, 0,      
/* anonymity */
                              0, /* priority */
                              GNUNET_YES,
                              GNUNET_NO,
@@ -161,10 +161,10 @@
                              GNUNET_get_time () + 5 * GNUNET_CRON_HOURS, meta,
                              kuri, kuri);
   CHECK (upload != NULL);
-  ECRS_freeUri (kuri);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_uri_destroy (kuri);
+  GNUNET_ECRS_meta_data_destroy (meta);
   prog = 0;
-  while (lastEvent != FSUI_upload_completed)
+  while (lastEvent != GNUNET_FSUI_upload_completed)
     {
       prog++;
       CHECK (prog <
@@ -174,12 +174,12 @@
     }
   GNUNET_snprintf (keyword, 40, "%s %s %s", keywords[0], _("AND"),
                    keywords[1]);
-  uri = ECRS_parseCharKeywordURI (NULL, keyword);
-  search = FSUI_startSearch (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, uri);
-  ECRS_freeUri (uri);
+  uri = GNUNET_ECRS_keyword_string_to_uri (NULL, keyword);
+  search = GNUNET_FSUI_search_start (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, 
uri);
+  GNUNET_ECRS_uri_destroy (uri);
   CHECK (search != NULL);
   prog = 0;
-  while (lastEvent != FSUI_download_completed)
+  while (lastEvent != GNUNET_FSUI_download_completed)
     {
       prog++;
       CHECK (prog < 10000);
@@ -187,11 +187,11 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_abortSearch (ctx, search);
-  FSUI_stopSearch (ctx, search);
-  unindex = FSUI_startUnindex (ctx, filename);
+  GNUNET_FSUI_search_abort (ctx, search);
+  GNUNET_FSUI_search_stop (ctx, search);
+  unindex = GNUNET_FSUI_unindex_start (ctx, filename);
   prog = 0;
-  while (lastEvent != FSUI_unindex_completed)
+  while (lastEvent != GNUNET_FSUI_unindex_completed)
     {
       prog++;
       CHECK (prog < 10000);
@@ -199,15 +199,15 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  if (lastEvent != FSUI_unindex_completed)
-    FSUI_abortUnindex (ctx, unindex);
-  FSUI_stopUnindex (ctx, unindex);
+  if (lastEvent != GNUNET_FSUI_unindex_completed)
+    GNUNET_FSUI_unindex_abort (ctx, unindex);
+  GNUNET_FSUI_unindex_stop (ctx, unindex);
 
 
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
   if (filename != NULL)
     {
       UNLINK (filename);
@@ -219,9 +219,9 @@
   GNUNET_free (filename);
 
 #if START_DAEMON
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
 
   return (ok == GNUNET_YES) ? 0 : 1;
 }

Modified: GNUnet/src/applications/fs/fsui/fsuitest2.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsuitest2.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/fsuitest2.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -30,13 +30,13 @@
 #include "gnunet_util_config_impl.h"
 #include "gnunet_util_network_client.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 
-static struct FSUI_Context *ctx;
+static struct GNUNET_FSUI_Context *ctx;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   return NULL;
 }
@@ -50,17 +50,17 @@
   pid_t daemon;
 #endif
   int ok;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          60 * GNUNET_CRON_SECONDS));
@@ -69,20 +69,20 @@
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
 
   /* ACTUAL TEST CODE */
-  ctx = FSUI_start (NULL, cfg, "fsuitest2", 32, GNUNET_YES,     /* do resume! 
*/
+  ctx = GNUNET_FSUI_start (NULL, cfg, "fsuitest2", 32, GNUNET_YES,     /* do 
resume! */
                     &eventCallback, NULL);
   CHECK (ctx != NULL);
-  FSUI_stop (ctx);
+  GNUNET_FSUI_stop (ctx);
   ctx =
-    FSUI_start (NULL, cfg, "fsuitest2", 32, GNUNET_YES, &eventCallback, NULL);
+    GNUNET_FSUI_start (NULL, cfg, "fsuitest2", 32, GNUNET_YES, &eventCallback, 
NULL);
   CHECK (ctx != NULL);
 FAILURE:
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
 #if START_DAEMON
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
 
   return (ok == GNUNET_YES) ? 0 : 1;
 }

Modified: GNUnet/src/applications/fs/fsui/search.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/search.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -41,25 +41,25 @@
  * Pass the result to the client and note it as shown.
  */
 static void
-processResult (const ECRS_FileInfo * fi, FSUI_SearchList * pos)
+processResult (const GNUNET_ECRS_FileInfo * fi, GNUNET_FSUI_SearchList * pos)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
 
   GNUNET_array_grow (pos->resultsReceived,
                      pos->sizeResultsReceived, pos->sizeResultsReceived + 1);
   pos->resultsReceived[pos->sizeResultsReceived - 1].uri
-    = ECRS_dupUri (fi->uri);
+    = GNUNET_ECRS_uri_duplicate (fi->uri);
   pos->resultsReceived[pos->sizeResultsReceived - 1].meta
-    = ECRS_dupMetaData (fi->meta);
+    = GNUNET_ECRS_meta_data_duplicate (fi->meta);
 
-  event.type = FSUI_search_result;
+  event.type = GNUNET_FSUI_search_result;
   event.data.SearchResult.sc.pos = pos;
   event.data.SearchResult.sc.cctx = pos->cctx;
   event.data.SearchResult.fi = *fi;
   event.data.SearchResult.searchURI = pos->uri;
   pos->ctx->ecb (pos->ctx->ecbClosure, &event);
-  URITRACK_addState (pos->ctx->ectx,
-                     pos->ctx->cfg, pos->uri, URITRACK_SEARCH_RESULT);
+  GNUNET_URITRACK_add_state (pos->ctx->ectx,
+                     pos->ctx->cfg, pos->uri, GNUNET_URITRACK_SEARCH_RESULT);
 }
 
 
@@ -67,30 +67,30 @@
  * Process results found by ECRS.
  */
 static int
-spcb (const ECRS_FileInfo * fi,
+spcb (const GNUNET_ECRS_FileInfo * fi,
       const GNUNET_HashCode * key, int isRoot, void *cls)
 {
-  FSUI_SearchList *pos = cls;
+  GNUNET_FSUI_SearchList *pos = cls;
   unsigned int i;
   unsigned int j;
   ResultPending *rp;
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
   ectx = pos->ctx->ectx;
 
-  URITRACK_trackURI (ectx, pos->ctx->cfg, fi);
+  GNUNET_URITRACK_track (ectx, pos->ctx->cfg, fi);
   if (isRoot)
     {
-      NS_setNamespaceRoot (ectx, pos->ctx->cfg, fi->uri);
-      NS_addNamespaceInfo (ectx, pos->ctx->cfg, fi->uri, fi->meta);
+      GNUNET_NS_namespace_set_root (ectx, pos->ctx->cfg, fi->uri);
+      GNUNET_NS_namespace_add_information (ectx, pos->ctx->cfg, fi->uri, 
fi->meta);
       return GNUNET_OK;
     }
   for (i = 0; i < pos->sizeResultsReceived; i++)
-    if (ECRS_equalsUri (fi->uri, pos->resultsReceived[i].uri))
+    if (GNUNET_ECRS_uri_test_equal (fi->uri, pos->resultsReceived[i].uri))
       {
 #if DEBUG_SEARCH
-        GE_LOG (ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 "Received search result that I have seen before.\n");
 #endif
         return GNUNET_OK;       /* seen before */
@@ -99,10 +99,10 @@
     {
       if (key == NULL)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
 #if DEBUG_SEARCH
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Received search result without key to decrypt.\n");
 #endif
           return GNUNET_SYSERR;
@@ -110,7 +110,7 @@
       for (i = 0; i < pos->sizeUnmatchedResultsReceived; i++)
         {
           rp = &pos->unmatchedResultsReceived[i];
-          if (ECRS_equalsUri (fi->uri, rp->fi.uri))
+          if (GNUNET_ECRS_uri_test_equal (fi->uri, rp->fi.uri))
             {
               for (j = 0; j < rp->matchingKeyCount; j++)
                 if (0 == memcmp (key,
@@ -118,8 +118,8 @@
                                  sizeof (GNUNET_HashCode)))
                   {
 #if DEBUG_SEARCH
-                    GE_LOG (ectx,
-                            GE_DEBUG | GE_REQUEST | GE_USER,
+                    GNUNET_GE_LOG (ectx,
+                            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                             "Received search result that I have seen before 
(missing keyword to show client).\n");
 #endif
                     return GNUNET_OK;
@@ -127,15 +127,15 @@
               if (rp->matchingKeyCount + 1 == pos->numberOfURIKeys)
                 {
 #if DEBUG_SEARCH
-                  GE_LOG (ectx,
-                          GE_DEBUG | GE_REQUEST | GE_USER,
+                  GNUNET_GE_LOG (ectx,
+                          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                           "Received search result (showing client)!\n");
 #endif
                   GNUNET_array_grow (rp->matchingKeys, rp->matchingKeyCount,
                                      0);
                   processResult (&rp->fi, pos);
-                  ECRS_freeUri (rp->fi.uri);
-                  ECRS_freeMetaData (rp->fi.meta);
+                  GNUNET_ECRS_uri_destroy (rp->fi.uri);
+                  GNUNET_ECRS_meta_data_destroy (rp->fi.meta);
                   pos->unmatchedResultsReceived[i]
                     =
                     pos->unmatchedResultsReceived[pos->
@@ -153,8 +153,8 @@
                                      rp->matchingKeyCount + 1);
                   rp->matchingKeys[rp->matchingKeyCount - 1] = *key;
 #if DEBUG_SEARCH
-                  GE_LOG (ectx,
-                          GE_DEBUG | GE_REQUEST | GE_USER,
+                  GNUNET_GE_LOG (ectx,
+                          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                           "Received search result (waiting for more %u keys 
before showing client).\n",
                           pos->numberOfURIKeys - rp->matchingKeyCount);
 #endif
@@ -167,15 +167,15 @@
                          pos->sizeUnmatchedResultsReceived + 1);
       rp =
         &pos->unmatchedResultsReceived[pos->sizeUnmatchedResultsReceived - 1];
-      rp->fi.meta = ECRS_dupMetaData (fi->meta);
-      rp->fi.uri = ECRS_dupUri (fi->uri);
+      rp->fi.meta = GNUNET_ECRS_meta_data_duplicate (fi->meta);
+      rp->fi.uri = GNUNET_ECRS_uri_duplicate (fi->uri);
       rp->matchingKeys = NULL;
       rp->matchingKeyCount = 0;
       GNUNET_array_grow (rp->matchingKeys, rp->matchingKeyCount, 1);
       rp->matchingKeys[0] = *key;
 #if DEBUG_SEARCH
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Received search result (waiting for %u more keys before showing 
client).\n",
               pos->numberOfURIKeys - rp->matchingKeyCount);
 #endif
@@ -184,8 +184,8 @@
   else
     {
 #if DEBUG_SEARCH
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Received search result (showing client)!\n");
 #endif
       processResult (fi, pos);
@@ -196,8 +196,8 @@
 static int
 testTerminate (void *cls)
 {
-  FSUI_SearchList *pos = cls;
-  if ((pos->state == FSUI_ACTIVE) &&
+  GNUNET_FSUI_SearchList *pos = cls;
+  if ((pos->state == GNUNET_FSUI_ACTIVE) &&
       (pos->maxResults > pos->sizeResultsReceived))
     return GNUNET_OK;
   return GNUNET_SYSERR;
@@ -207,19 +207,19 @@
  * Thread that searches for data.
  */
 void *
-FSUI_searchThread (void *cls)
+GNUNET_FSUI_searchThread (void *cls)
 {
-  FSUI_SearchList *pos = cls;
-  FSUI_Event event;
+  GNUNET_FSUI_SearchList *pos = cls;
+  GNUNET_FSUI_Event event;
   int ret;
-  struct GE_Memory *mem;
-  struct GE_Context *ee;
+  struct GNUNET_GE_Memory *mem;
+  struct GNUNET_GE_Context *ee;
 
-  mem = GE_memory_create (2);
-  ee = GE_create_context_memory (GE_USER | GE_ADMIN |
-                                 GE_ERROR | GE_WARNING | GE_FATAL |
-                                 GE_BULK | GE_IMMEDIATE, mem);
-  ret = ECRS_search (ee,
+  mem = GNUNET_GE_memory_create (2);
+  ee = GNUNET_GE_create_context_memory (GNUNET_GE_USER | GNUNET_GE_ADMIN |
+                                 GNUNET_GE_ERROR | GNUNET_GE_WARNING | 
GNUNET_GE_FATAL |
+                                 GNUNET_GE_BULK | GNUNET_GE_IMMEDIATE, mem);
+  ret = GNUNET_ECRS_search (ee,
                      pos->ctx->cfg,
                      pos->uri,
                      pos->anonymityLevel,
@@ -228,38 +228,38 @@
     {
       const char *error;
 
-      pos->state = FSUI_ERROR;
-      event.type = FSUI_search_error;
+      pos->state = GNUNET_FSUI_ERROR;
+      event.type = GNUNET_FSUI_search_error;
       event.data.SearchError.sc.pos = pos;
       event.data.SearchError.sc.cctx = pos->cctx;
-      error = GE_memory_get (mem, 0);
+      error = GNUNET_GE_memory_get (mem, 0);
       if (error == NULL)
         error = _("Error running search (no reason given).");
       event.data.SearchError.message = error;
       pos->ctx->ecb (pos->ctx->ecbClosure, &event);
     }
-  else if (pos->state == FSUI_ABORTED)
+  else if (pos->state == GNUNET_FSUI_ABORTED)
     {
-      event.type = FSUI_search_aborted;
+      event.type = GNUNET_FSUI_search_aborted;
       event.data.SearchAborted.sc.pos = pos;
       event.data.SearchAborted.sc.cctx = pos->cctx;
       pos->ctx->ecb (pos->ctx->ecbClosure, &event);
     }
-  else if (pos->state == FSUI_ACTIVE)
+  else if (pos->state == GNUNET_FSUI_ACTIVE)
     {
-      pos->state = FSUI_COMPLETED;
-      event.type = FSUI_search_completed;
+      pos->state = GNUNET_FSUI_COMPLETED;
+      event.type = GNUNET_FSUI_search_completed;
       event.data.SearchCompleted.sc.pos = pos;
       event.data.SearchCompleted.sc.cctx = pos->cctx;
       pos->ctx->ecb (pos->ctx->ecbClosure, &event);
     }
   else
     {
-      GE_ASSERT (NULL, pos->state == FSUI_PENDING);
+      GNUNET_GE_ASSERT (NULL, pos->state == GNUNET_FSUI_PENDING);
       /* must be suspending */
     }
-  GE_free_context (ee);
-  GE_memory_free (mem);
+  GNUNET_GE_free_context (ee);
+  GNUNET_GE_memory_free (mem);
 
   return NULL;
 }
@@ -268,39 +268,39 @@
  * Thread that searches for data (and signals startup).
  */
 void *
-FSUI_searchThreadSignal (void *cls)
+GNUNET_FSUI_searchThreadSignal (void *cls)
 {
-  FSUI_SearchList *pos = cls;
-  FSUI_Event event;
+  GNUNET_FSUI_SearchList *pos = cls;
+  GNUNET_FSUI_Event event;
 
-  event.type = FSUI_search_started;
+  event.type = GNUNET_FSUI_search_started;
   event.data.SearchStarted.sc.pos = pos;
   event.data.SearchStarted.sc.cctx = NULL;
   event.data.SearchStarted.searchURI = pos->uri;
   event.data.SearchStarted.anonymityLevel = pos->anonymityLevel;
   pos->cctx = pos->ctx->ecb (pos->ctx->ecbClosure, &event);
-  return FSUI_searchThread (pos);
+  return GNUNET_FSUI_searchThread (pos);
 }
 
 /**
  * Start a search.
  */
-struct FSUI_SearchList *
-FSUI_startSearch (struct FSUI_Context *ctx,
+struct GNUNET_FSUI_SearchList *
+GNUNET_FSUI_search_start (struct GNUNET_FSUI_Context *ctx,
                   unsigned int anonymityLevel,
                   unsigned int maxResults,
-                  GNUNET_CronTime timeout, const struct ECRS_URI *uri)
+                  GNUNET_CronTime timeout, const struct GNUNET_ECRS_URI *uri)
 {
-  FSUI_SearchList *pos;
-  struct GE_Context *ectx;
+  GNUNET_FSUI_SearchList *pos;
+  struct GNUNET_GE_Context *ectx;
 
   ectx = ctx->ectx;
   GNUNET_mutex_lock (ctx->lock);
-  pos = GNUNET_malloc (sizeof (FSUI_SearchList));
+  pos = GNUNET_malloc (sizeof (GNUNET_FSUI_SearchList));
   pos->maxResults = maxResults;
-  pos->state = FSUI_ACTIVE;
-  pos->uri = ECRS_dupUri (uri);
-  pos->numberOfURIKeys = ECRS_countKeywordsOfUri (uri);
+  pos->state = GNUNET_FSUI_ACTIVE;
+  pos->uri = GNUNET_ECRS_uri_duplicate (uri);
+  pos->numberOfURIKeys = GNUNET_ECRS_uri_get_keyword_count_from_ksk (uri);
   pos->sizeResultsReceived = 0;
   pos->resultsReceived = NULL;
   pos->sizeUnmatchedResultsReceived = 0;
@@ -310,13 +310,13 @@
   pos->start_time = GNUNET_get_time ();
   pos->timeout = timeout;
   pos->handle =
-    GNUNET_thread_create (&FSUI_searchThreadSignal, pos, 32 * 1024);
+    GNUNET_thread_create (&GNUNET_FSUI_searchThreadSignal, pos, 32 * 1024);
   if (pos->handle == NULL)
     {
-      GE_LOG_STRERROR (ectx,
-                       GE_ERROR | GE_IMMEDIATE | GE_USER | GE_ADMIN,
+      GNUNET_GE_LOG_STRERROR (ectx,
+                       GNUNET_GE_ERROR | GNUNET_GE_IMMEDIATE | GNUNET_GE_USER 
| GNUNET_GE_ADMIN,
                        "PTHREAD_CREATE");
-      ECRS_freeUri (pos->uri);
+      GNUNET_ECRS_uri_destroy (pos->uri);
       GNUNET_free (pos);
       GNUNET_mutex_unlock (ctx->lock);
       return NULL;
@@ -331,16 +331,16 @@
  * Abort a search.
  */
 int
-FSUI_abortSearch (struct FSUI_Context *ctx, struct FSUI_SearchList *sl)
+GNUNET_FSUI_search_abort (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_SearchList *sl)
 {
-  if (sl->state == FSUI_PENDING)
+  if (sl->state == GNUNET_FSUI_PENDING)
     {
-      sl->state = FSUI_ABORTED_JOINED;
+      sl->state = GNUNET_FSUI_ABORTED_JOINED;
       return GNUNET_OK;
     }
-  if (sl->state != FSUI_ACTIVE)
+  if (sl->state != GNUNET_FSUI_ACTIVE)
     return GNUNET_SYSERR;
-  sl->state = FSUI_ABORTED;
+  sl->state = GNUNET_FSUI_ABORTED;
   GNUNET_thread_stop_sleep (sl->handle);
   return GNUNET_OK;
 }
@@ -349,11 +349,11 @@
  * Stop a search.
  */
 int
-FSUI_stopSearch (struct FSUI_Context *ctx, struct FSUI_SearchList *sl)
+GNUNET_FSUI_search_stop (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_SearchList *sl)
 {
-  FSUI_Event event;
-  FSUI_SearchList *pos;
-  FSUI_SearchList *prev;
+  GNUNET_FSUI_Event event;
+  GNUNET_FSUI_SearchList *pos;
+  GNUNET_FSUI_SearchList *prev;
   void *unused;
   int i;
 
@@ -379,39 +379,39 @@
   GNUNET_array_grow (sl->my_downloads, sl->my_downloads_size, 0);
   GNUNET_mutex_unlock (ctx->lock);
   pos->next = NULL;
-  if ((pos->state == FSUI_ACTIVE) ||
-      (pos->state == FSUI_COMPLETED) ||
-      (pos->state == FSUI_ABORTED) || (pos->state == FSUI_ERROR))
+  if ((pos->state == GNUNET_FSUI_ACTIVE) ||
+      (pos->state == GNUNET_FSUI_COMPLETED) ||
+      (pos->state == GNUNET_FSUI_ABORTED) || (pos->state == GNUNET_FSUI_ERROR))
     {
-      GE_ASSERT (ctx->ectx, pos->handle != NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, pos->handle != NULL);
       GNUNET_thread_join (pos->handle, &unused);
       pos->handle = NULL;
-      if (pos->state == FSUI_ACTIVE)
-        pos->state = FSUI_PENDING;
+      if (pos->state == GNUNET_FSUI_ACTIVE)
+        pos->state = GNUNET_FSUI_PENDING;
       else
         pos->state++;           /* add _JOINED */
     }
   else
     {
-      GE_ASSERT (ctx->ectx, pos->handle == NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, pos->handle == NULL);
     }
-  event.type = FSUI_search_stopped;
+  event.type = GNUNET_FSUI_search_stopped;
   event.data.SearchStopped.sc.pos = pos;
   event.data.SearchStopped.sc.cctx = pos->cctx;
   pos->ctx->ecb (pos->ctx->ecbClosure, &event);
 
 
-  ECRS_freeUri (pos->uri);
+  GNUNET_ECRS_uri_destroy (pos->uri);
   for (i = 0; i < pos->sizeResultsReceived; i++)
     {
-      ECRS_freeUri (pos->resultsReceived[i].uri);
-      ECRS_freeMetaData (pos->resultsReceived[i].meta);
+      GNUNET_ECRS_uri_destroy (pos->resultsReceived[i].uri);
+      GNUNET_ECRS_meta_data_destroy (pos->resultsReceived[i].meta);
     }
   GNUNET_array_grow (pos->resultsReceived, pos->sizeResultsReceived, 0);
   for (i = 0; i < pos->sizeUnmatchedResultsReceived; i++)
     {
-      ECRS_freeUri (pos->unmatchedResultsReceived[i].fi.uri);
-      ECRS_freeMetaData (pos->unmatchedResultsReceived[i].fi.meta);
+      GNUNET_ECRS_uri_destroy (pos->unmatchedResultsReceived[i].fi.uri);
+      GNUNET_ECRS_meta_data_destroy (pos->unmatchedResultsReceived[i].fi.meta);
       GNUNET_array_grow (pos->unmatchedResultsReceived[i].matchingKeys,
                          pos->unmatchedResultsReceived[i].matchingKeyCount,
                          0);

Modified: GNUnet/src/applications/fs/fsui/searchtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/searchtest.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/searchtest.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -30,7 +30,7 @@
 #include "gnunet_util_config_impl.h"
 #include "gnunet_util_network_client.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 static char *
 makeName (unsigned int i)
@@ -45,57 +45,57 @@
   return fn;
 }
 
-static volatile enum FSUI_EventType lastEvent;
+static volatile enum GNUNET_FSUI_EventType lastEvent;
 
-static struct FSUI_SearchList *search;
+static struct GNUNET_FSUI_SearchList *search;
 
-static struct ECRS_URI *uri;
+static struct GNUNET_ECRS_URI *uri;
 
-static struct FSUI_Context *ctx;
+static struct GNUNET_FSUI_Context *ctx;
 
 static struct GNUNET_Mutex *lock;
 
-static volatile enum FSUI_EventType waitForEvent;
+static volatile enum GNUNET_FSUI_EventType waitForEvent;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   static char unused;
 
   GNUNET_mutex_lock (lock);
   switch (event->type)
     {
-    case FSUI_search_resumed:
+    case GNUNET_FSUI_search_resumed:
       search = event->data.SearchResumed.sc.pos;
       break;
-    case FSUI_search_suspended:
+    case GNUNET_FSUI_search_suspended:
       search = NULL;
       break;
-    case FSUI_download_resumed:
-    case FSUI_upload_resumed:
-    case FSUI_unindex_resumed:
+    case GNUNET_FSUI_download_resumed:
+    case GNUNET_FSUI_upload_resumed:
+    case GNUNET_FSUI_unindex_resumed:
       GNUNET_mutex_unlock (lock);
       return &unused;
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
       printf ("Received search result\n");
-      uri = ECRS_dupUri (event->data.SearchResult.fi.uri);
+      uri = GNUNET_ECRS_uri_duplicate (event->data.SearchResult.fi.uri);
       break;
-    case FSUI_upload_completed:
+    case GNUNET_FSUI_upload_completed:
       printf ("Upload complete.\n");
       break;
-    case FSUI_download_completed:
+    case GNUNET_FSUI_download_completed:
       printf ("Download complete.\n");
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
       printf ("Unindex complete.\n");
       break;
-    case FSUI_upload_error:
+    case GNUNET_FSUI_upload_error:
       printf ("Upload error.\n");
       break;
-    case FSUI_download_error:
+    case GNUNET_FSUI_download_error:
       printf ("Download error.\n");
       break;
-    case FSUI_unindex_error:
+    case GNUNET_FSUI_unindex_error:
       printf ("Unindex error.\n");
       break;
     default:
@@ -124,24 +124,24 @@
   };
   char keyword[40];
   int prog;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *kuri;
-  struct GC_Configuration *cfg;
-  struct FSUI_UploadList *upload;
-  struct FSUI_UnindexList *unindex;
-  struct FSUI_DownloadList *download;
-  struct ECRS_URI *luri;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *kuri;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_FSUI_UploadList *upload;
+  struct GNUNET_FSUI_UnindexList *unindex;
+  struct GNUNET_FSUI_DownloadList *download;
+  struct GNUNET_ECRS_URI *luri;
 
   ok = GNUNET_YES;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
@@ -149,33 +149,33 @@
   /* ACTUAL TEST CODE */
 #endif
   lock = GNUNET_mutex_create (GNUNET_NO);
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "fsuisearchtest", 32, GNUNET_YES, &eventCallback,
                     NULL);
   CHECK (ctx != NULL);
   GNUNET_snprintf (keyword, 40, "%s %s %s", keywords[0], _("AND"),
                    keywords[1]);
-  luri = ECRS_parseCharKeywordURI (NULL, keyword);
-  search = FSUI_startSearch (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, luri);
-  ECRS_freeUri (luri);
+  luri = GNUNET_ECRS_keyword_string_to_uri (NULL, keyword);
+  search = GNUNET_FSUI_search_start (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, 
luri);
+  GNUNET_ECRS_uri_destroy (luri);
   uri = NULL;
   CHECK (NULL != search);
-  FSUI_stop (ctx);
+  GNUNET_FSUI_stop (ctx);
   /* resume search! */
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "fsuisearchtest", 32, GNUNET_YES, &eventCallback,
                     NULL);
   fn = makeName (42);
   GNUNET_disk_file_write (NULL,
                           fn, "foo bar test!", strlen ("foo bar test!"),
                           "600");
-  meta = ECRS_createMetaData ();
-  kuri = ECRS_parseListKeywordURI (NULL, 2, (const char **) keywords);
-  waitForEvent = FSUI_upload_completed;
+  meta = GNUNET_ECRS_meta_data_create ();
+  kuri = GNUNET_ECRS_keyword_list_to_uri (NULL, 2, (const char **) keywords);
+  waitForEvent = GNUNET_FSUI_upload_completed;
   upload =
-    FSUI_startUpload (ctx,
+    GNUNET_FSUI_upload_star (ctx,
                       fn,
-                      (DirectoryScanCallback) & GNUNET_disk_directory_scan,
+                      (GNUNET_FSUI_DirectoryScanCallback) & 
GNUNET_disk_directory_scan,
                       NULL,
                       0,
                       0,
@@ -186,10 +186,10 @@
   CHECK (NULL != upload);
   GNUNET_free (fn);
   fn = NULL;
-  ECRS_freeUri (kuri);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_uri_destroy (kuri);
+  GNUNET_ECRS_meta_data_destroy (meta);
   prog = 0;
-  while (lastEvent != FSUI_upload_completed)
+  while (lastEvent != GNUNET_FSUI_upload_completed)
     {
       prog++;
       if (prog == 10000)
@@ -203,7 +203,7 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopUpload (ctx, upload);
+  GNUNET_FSUI_upload_stop (ctx, upload);
 
   while (uri == NULL)
     {
@@ -211,21 +211,21 @@
       CHECK (prog <
              10000) GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
     }
-  FSUI_abortSearch (ctx, search);
-  FSUI_stopSearch (ctx, search);
+  GNUNET_FSUI_search_abort (ctx, search);
+  GNUNET_FSUI_search_stop (ctx, search);
   CHECK (uri != NULL);
   fn = makeName (43);
-  meta = ECRS_createMetaData ();
-  waitForEvent = FSUI_download_completed;
+  meta = GNUNET_ECRS_meta_data_create ();
+  waitForEvent = GNUNET_FSUI_download_completed;
   download =
-    FSUI_startDownload (ctx, 0, GNUNET_NO, uri, meta, fn, NULL, NULL);
-  ECRS_freeMetaData (meta);
+    GNUNET_FSUI_download_start (ctx, 0, GNUNET_NO, uri, meta, fn, NULL, NULL);
+  GNUNET_ECRS_meta_data_destroy (meta);
   GNUNET_free (fn);
   fn = NULL;
-  ECRS_freeUri (uri);
+  GNUNET_ECRS_uri_destroy (uri);
 
   prog = 0;
-  while (lastEvent != FSUI_download_completed)
+  while (lastEvent != GNUNET_FSUI_download_completed)
     {
       prog++;
       CHECK (prog < 10000);
@@ -233,15 +233,15 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopDownload (ctx, download);
+  GNUNET_FSUI_download_stop (ctx, download);
   fn = makeName (42);
-  waitForEvent = FSUI_unindex_completed;
-  unindex = FSUI_startUnindex (ctx, fn);
+  waitForEvent = GNUNET_FSUI_unindex_completed;
+  unindex = GNUNET_FSUI_unindex_start (ctx, fn);
   GNUNET_free (fn);
   fn = NULL;
   CHECK (NULL != unindex);
   prog = 0;
-  while (lastEvent != FSUI_unindex_completed)
+  while (lastEvent != GNUNET_FSUI_unindex_completed)
     {
       prog++;
       CHECK (prog < 10000);
@@ -249,12 +249,12 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopUnindex (ctx, unindex);
+  GNUNET_FSUI_unindex_stop (ctx, unindex);
 
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
   if (lock != NULL)
     GNUNET_mutex_destroy (lock);
   GNUNET_free_non_null (fn);
@@ -267,9 +267,9 @@
   GNUNET_free (fn);
 
 #if START_DAEMON
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/fsui/serialize.c
===================================================================
--- GNUnet/src/applications/fs/fsui/serialize.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/serialize.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -48,12 +48,12 @@
 }
 
 static void
-writeURI (int fd, const struct ECRS_URI *uri)
+writeURI (int fd, const struct GNUNET_ECRS_URI *uri)
 {
   char *buf;
   unsigned int size;
 
-  buf = ECRS_uriToString (uri);
+  buf = GNUNET_ECRS_uri_to_string (uri);
   size = strlen (buf);
   WRITEINT (fd, size);
   WRITE (fd, buf, size);
@@ -63,29 +63,29 @@
 static void
 WRITESTRING (int fd, const char *name)
 {
-  GE_BREAK (NULL, name != NULL);
+  GNUNET_GE_BREAK (NULL, name != NULL);
   WRITEINT (fd, strlen (name));
   WRITE (fd, name, strlen (name));
 }
 
 static void
-writeMetaData (struct GE_Context *ectx,
-               int fd, const struct ECRS_MetaData *meta)
+writeMetaData (struct GNUNET_GE_Context *ectx,
+               int fd, const struct GNUNET_ECRS_MetaData *meta)
 {
   unsigned int size;
   char *buf;
 
-  size = ECRS_sizeofMetaData (meta,
-                              ECRS_SERIALIZE_FULL |
-                              ECRS_SERIALIZE_NO_COMPRESS);
+  size = GNUNET_ECRS_meta_data_get_serialized_size (meta,
+                              GNUNET_ECRS_SERIALIZE_FULL |
+                              GNUNET_ECRS_SERIALIZE_NO_COMPRESS);
   if (size > 1024 * 1024)
     size = 1024 * 1024;
   buf = GNUNET_malloc (size);
-  ECRS_serializeMetaData (ectx,
+  GNUNET_ECRS_meta_data_serialize (ectx,
                           meta,
                           buf,
                           size,
-                          ECRS_SERIALIZE_PART | ECRS_SERIALIZE_NO_COMPRESS);
+                          GNUNET_ECRS_SERIALIZE_PART | 
GNUNET_ECRS_SERIALIZE_NO_COMPRESS);
   WRITEINT (fd, size);
   WRITE (fd, buf, size);
   GNUNET_free (buf);
@@ -93,7 +93,7 @@
 
 
 static void
-writeFileInfo (struct GE_Context *ectx, int fd, const ECRS_FileInfo * fi)
+writeFileInfo (struct GNUNET_GE_Context *ectx, int fd, const 
GNUNET_ECRS_FileInfo * fi)
 {
   writeMetaData (ectx, fd, fi->meta);
   writeURI (fd, fi->uri);
@@ -104,11 +104,11 @@
  * (recursively) write a download list.
  */
 static void
-writeDownloadList (struct GE_Context *ectx,
-                   int fd, FSUI_Context * ctx, FSUI_DownloadList * list)
+writeDownloadList (struct GNUNET_GE_Context *ectx,
+                   int fd, GNUNET_FSUI_Context * ctx, GNUNET_FSUI_DownloadList 
* list)
 {
   int i;
-  FSUI_SearchList *pos;
+  GNUNET_FSUI_SearchList *pos;
 
   if (list == NULL)
     {
@@ -116,8 +116,8 @@
       return;
     }
 #if DEBUG_PERSISTENCE
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Serializing download state of download `%s': (%llu, %llu)\n",
           list->filename, list->completed, list->total);
 #endif
@@ -138,7 +138,7 @@
           pos = pos->next;
           if (pos == NULL)
             {
-              GE_BREAK (ectx, 0);
+              GNUNET_GE_BREAK (ectx, 0);
               i = 0;
               break;
             }
@@ -167,7 +167,7 @@
 }
 
 static void
-writeCollection (int fd, struct FSUI_Context *ctx)
+writeCollection (int fd, struct GNUNET_FSUI_Context *ctx)
 {
   if ((ctx->collectionData == NULL) ||
       (ctx->collectionData->size > 16 * 1024 * 1024))
@@ -180,9 +180,9 @@
 }
 
 static void
-writeSearches (int fd, struct FSUI_Context *ctx)
+writeSearches (int fd, struct GNUNET_FSUI_Context *ctx)
 {
-  FSUI_SearchList *spos;
+  GNUNET_FSUI_SearchList *spos;
   int i;
 
   spos = ctx->activeSearches;
@@ -195,9 +195,9 @@
           spos = spos->next;
           continue;
         }
-      GE_ASSERT (ctx->ectx,
-                 ECRS_isKeywordUri (spos->uri) ||
-                 ECRS_isNamespaceUri (spos->uri));
+      GNUNET_GE_ASSERT (ctx->ectx,
+                 GNUNET_ECRS_uri_test_ksk (spos->uri) ||
+                 GNUNET_ECRS_uri_test_sks (spos->uri));
       WRITEINT (fd, 1);
       WRITEINT (fd, spos->state);
       WRITEINT (fd, spos->maxResults);
@@ -216,7 +216,7 @@
 
           rp = &spos->unmatchedResultsReceived[i];
           writeFileInfo (ctx->ectx, fd, &rp->fi);
-          GE_ASSERT (ctx->ectx, rp->matchingKeyCount < spos->numberOfURIKeys);
+          GNUNET_GE_ASSERT (ctx->ectx, rp->matchingKeyCount < 
spos->numberOfURIKeys);
           if (rp->matchingKeyCount > 1024)
             {
               WRITEINT (fd, 0); /* too large to serialize */
@@ -233,9 +233,9 @@
 }
 
 static void
-writeUnindexing (int fd, struct FSUI_Context *ctx)
+writeUnindexing (int fd, struct GNUNET_FSUI_Context *ctx)
 {
-  FSUI_UnindexList *xpos;
+  GNUNET_FSUI_UnindexList *xpos;
 
 
   xpos = ctx->unindexOperations;
@@ -252,8 +252,8 @@
 
 static void
 writeUploadList (int fd,
-                 struct FSUI_Context *ctx,
-                 struct FSUI_UploadList *upos, int top)
+                 struct GNUNET_FSUI_Context *ctx,
+                 struct GNUNET_FSUI_UploadList *upos, int top)
 {
   int bits;
 
@@ -289,9 +289,9 @@
 }
 
 static void
-writeUploads (int fd, struct FSUI_Context *ctx, struct FSUI_UploadList *upos)
+writeUploads (int fd, struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_UploadList *upos)
 {
-  struct FSUI_UploadShared *shared;
+  struct GNUNET_FSUI_UploadShared *shared;
   int bits;
 
   while (upos != NULL)
@@ -320,7 +320,7 @@
 }
 
 void
-FSUI_serialize (struct FSUI_Context *ctx)
+GNUNET_FSUI_serialize (struct GNUNET_FSUI_Context *ctx)
 {
   int fd;
 

Modified: GNUnet/src/applications/fs/fsui/serializetest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/serializetest.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/serializetest.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -33,11 +33,11 @@
 
 #define DEBUG_VERBOSE GNUNET_NO
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; }
 
 static volatile int suspendRestart = 0;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static char *
 makeName (unsigned int i)
@@ -53,85 +53,85 @@
   return fn;
 }
 
-static volatile enum FSUI_EventType lastEvent;
-static volatile enum FSUI_EventType waitForEvent;
-static struct FSUI_Context *ctx;
-static struct ECRS_URI *upURI;
-static struct FSUI_UnindexList *unindex;
-static struct FSUI_UploadList *upload;
+static volatile enum GNUNET_FSUI_EventType lastEvent;
+static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static struct GNUNET_FSUI_Context *ctx;
+static struct GNUNET_ECRS_URI *upURI;
+static struct GNUNET_FSUI_UnindexList *unindex;
+static struct GNUNET_FSUI_UploadList *upload;
 
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   switch (event->type)
     {
-    case FSUI_upload_progress:
+    case GNUNET_FSUI_upload_progress:
 #if DEBUG_VERBOSE
       printf ("Upload is progressing (%llu/%llu)...\n",
               event->data.UploadProgress.completed,
               event->data.UploadProgress.total);
 #endif
       break;
-    case FSUI_upload_completed:
-      upURI = ECRS_dupUri (event->data.UploadCompleted.uri);
+    case GNUNET_FSUI_upload_completed:
+      upURI = GNUNET_ECRS_uri_duplicate (event->data.UploadCompleted.uri);
 #if DEBUG_VERBOSE
       printf ("Upload complete.\n");
 #endif
       break;
-    case FSUI_unindex_progress:
+    case GNUNET_FSUI_unindex_progress:
 #if DEBUG_VERBOSE
       printf ("Unindex is progressing (%llu/%llu)...\n",
               event->data.UnindexProgress.completed,
               event->data.UnindexProgress.total);
 #endif
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
 #if DEBUG_VERBOSE
       printf ("Unindex complete.\n");
 #endif
       break;
-    case FSUI_unindex_error:
-    case FSUI_upload_error:
-    case FSUI_download_error:
-    case FSUI_search_error:
+    case GNUNET_FSUI_unindex_error:
+    case GNUNET_FSUI_upload_error:
+    case GNUNET_FSUI_download_error:
+    case GNUNET_FSUI_search_error:
       fprintf (stderr, "Received ERROR: %d\n", event->type);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_download_aborted:
+    case GNUNET_FSUI_download_aborted:
 #if DEBUG_VERBOSE
       printf ("Received download aborted event.\n");
 #endif
       break;
-    case FSUI_unindex_resumed:
+    case GNUNET_FSUI_unindex_resumed:
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received RESUMING: %d\n", event->type);
 #endif
       unindex = event->data.UnindexResumed.uc.pos;
       break;
-    case FSUI_upload_resumed:
+    case GNUNET_FSUI_upload_resumed:
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received RESUMING: %d\n", event->type);
 #endif
       upload = event->data.UploadResumed.uc.pos;
       break;
       break;
-    case FSUI_unindex_suspended:
+    case GNUNET_FSUI_unindex_suspended:
       unindex = NULL;
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received SUSPENDING: %d\n", event->type);
 #endif
       break;
-    case FSUI_upload_suspended:
+    case GNUNET_FSUI_upload_suspended:
       upload = NULL;
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received SUSPENDING: %d\n", event->type);
 #endif
       break;
-    case FSUI_upload_started:
-    case FSUI_upload_stopped:
-    case FSUI_unindex_started:
-    case FSUI_unindex_stopped:
+    case GNUNET_FSUI_upload_started:
+    case GNUNET_FSUI_upload_stopped:
+    case GNUNET_FSUI_unindex_started:
+    case GNUNET_FSUI_unindex_stopped:
       break;
     default:
       printf ("Unexpected event: %d\n", event->type);
@@ -163,27 +163,27 @@
   };
   int prog;
   char *buf;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *kuri = NULL;
-  struct GC_Configuration *cfg;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *kuri = NULL;
+  struct GNUNET_GC_Configuration *cfg;
 
   ok = GNUNET_YES;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
   /* ACTUAL TEST CODE */
 #endif
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "fsuiserializetest", 32, GNUNET_YES, &eventCallback,
                     NULL);
   CHECK (ctx != NULL);
@@ -193,23 +193,23 @@
     buf[i] = GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 256);
   GNUNET_disk_file_write (ectx, fn, buf, FILESIZE, "600");
   GNUNET_free (buf);
-  meta = ECRS_createMetaData ();
-  kuri = ECRS_parseListKeywordURI (ectx, 2, (const char **) keywords);
-  waitForEvent = FSUI_upload_completed;
-  upload = FSUI_startUpload (ctx,
+  meta = GNUNET_ECRS_meta_data_create ();
+  kuri = GNUNET_ECRS_keyword_list_to_uri (ectx, 2, (const char **) keywords);
+  waitForEvent = GNUNET_FSUI_upload_completed;
+  upload = GNUNET_FSUI_upload_star (ctx,
                              fn,
-                             (DirectoryScanCallback) &
+                             (GNUNET_FSUI_DirectoryScanCallback) &
                              GNUNET_disk_directory_scan, NULL, 0, 0,
                              GNUNET_YES, GNUNET_NO, GNUNET_NO,
                              GNUNET_get_time () + 5 * GNUNET_CRON_HOURS, meta,
                              kuri, kuri);
   CHECK (upload != NULL);
-  ECRS_freeUri (kuri);
+  GNUNET_ECRS_uri_destroy (kuri);
   kuri = NULL;
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   prog = 0;
   suspendRestart = 4;
-  while (lastEvent != FSUI_upload_completed)
+  while (lastEvent != GNUNET_FSUI_upload_completed)
     {
       if ((suspendRestart > 0)
           && (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 4) == 0))
@@ -218,9 +218,9 @@
 #if DEBUG_VERBOSE
           printf ("Testing FSUI suspend-resume\n");
 #endif
-          FSUI_stop (ctx);      /* download possibly incomplete
+          GNUNET_FSUI_stop (ctx);      /* download possibly incomplete
                                    at this point, thus testing resume */
-          ctx = FSUI_start (NULL,
+          ctx = GNUNET_FSUI_start (NULL,
                             cfg,
                             "fsuiserializetest",
                             32, GNUNET_YES, &eventCallback, NULL);
@@ -236,13 +236,13 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopUpload (ctx, upload);
-  waitForEvent = FSUI_unindex_completed;
-  unindex = FSUI_startUnindex (ctx, fn);
+  GNUNET_FSUI_upload_stop (ctx, upload);
+  waitForEvent = GNUNET_FSUI_unindex_completed;
+  unindex = GNUNET_FSUI_unindex_start (ctx, fn);
   CHECK (unindex != NULL);
   prog = 0;
   suspendRestart = 4;
-  while (lastEvent != FSUI_unindex_completed)
+  while (lastEvent != GNUNET_FSUI_unindex_completed)
     {
       if ((suspendRestart > 0)
           && (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 4) == 0))
@@ -251,9 +251,9 @@
 #if DEBUG_VERBOSE
           printf ("Testing FSUI suspend-resume\n");
 #endif
-          FSUI_stop (ctx);      /* download possibly incomplete
+          GNUNET_FSUI_stop (ctx);      /* download possibly incomplete
                                    at this point, thus testing resume */
-          ctx = FSUI_start (NULL,
+          ctx = GNUNET_FSUI_start (NULL,
                             cfg,
                             "fsuiserializetest",
                             32, GNUNET_YES, &eventCallback, NULL);
@@ -266,18 +266,18 @@
       prog++;
       CHECK (prog < 5000);
       GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
-      CHECK (lastEvent != FSUI_unindex_error);
+      CHECK (lastEvent != GNUNET_FSUI_unindex_error);
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  CHECK (lastEvent == FSUI_unindex_completed);
+  CHECK (lastEvent == GNUNET_FSUI_unindex_completed);
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
     {
       if (unindex != NULL)
-        FSUI_stopUnindex (ctx, unindex);
-      FSUI_stop (ctx);
+        GNUNET_FSUI_unindex_stop (ctx, unindex);
+      GNUNET_FSUI_stop (ctx);
     }
   if (fn != NULL)
     {
@@ -285,18 +285,18 @@
       GNUNET_free (fn);
     }
   if (kuri != NULL)
-    ECRS_freeUri (kuri);
+    GNUNET_ECRS_uri_destroy (kuri);
   fn = makeName (43);
   /* TODO: verify file 'fn(42)' == file 'fn(43)' */
   UNLINK (fn);
   GNUNET_free (fn);
   if (upURI != NULL)
-    ECRS_freeUri (upURI);
+    GNUNET_ECRS_uri_destroy (upURI);
 
 #if START_DAEMON
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/fsui/serializetest2.c
===================================================================
--- GNUnet/src/applications/fs/fsui/serializetest2.c    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/serializetest2.c    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -36,9 +36,9 @@
 
 #define UPLOAD_PREFIX "/tmp/gnunet-fsui-searializetest2"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; }
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static char *
 makeName (unsigned int i)
@@ -53,10 +53,10 @@
   return fn;
 }
 
-static struct FSUI_Context *ctx;
-static struct ECRS_URI *upURI;
-static struct FSUI_SearchList *search;
-static struct FSUI_DownloadList *download;
+static struct GNUNET_FSUI_Context *ctx;
+static struct GNUNET_ECRS_URI *upURI;
+static struct GNUNET_FSUI_SearchList *search;
+static struct GNUNET_FSUI_DownloadList *download;
 static int have_error;
 
 /**
@@ -67,16 +67,16 @@
 static int no_check;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   if (no_check)
     return NULL;
   switch (event->type)
     {
-    case FSUI_search_suspended:
+    case GNUNET_FSUI_search_suspended:
       search = NULL;
       break;
-    case FSUI_download_suspended:
+    case GNUNET_FSUI_download_suspended:
       if (event->data.DownloadSuspended.dc.spos != search)
         {
           fprintf (stderr,
@@ -101,13 +101,13 @@
       if (event->data.DownloadSuspended.dc.pos == download)
         download = NULL;
       break;
-    case FSUI_search_resumed:
+    case GNUNET_FSUI_search_resumed:
 #if DEBUG_VERBOSE
       printf ("Search resuming\n");
 #endif
       search = event->data.SearchResumed.sc.pos;
       break;
-    case FSUI_download_resumed:
+    case GNUNET_FSUI_download_resumed:
       if (download == NULL)
         download = event->data.DownloadResumed.dc.pos;
       if (event->data.DownloadResumed.dc.spos != search)
@@ -134,27 +134,27 @@
       printf ("Download resuming\n");
 #endif
       break;
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
 #if DEBUG_VERBOSE
       printf ("Received search result\n");
 #endif
       break;
-    case FSUI_upload_progress:
+    case GNUNET_FSUI_upload_progress:
 #if DEBUG_VERBOSE
       printf ("Upload is progressing (%llu/%llu)...\n",
               event->data.UploadProgress.completed,
               event->data.UploadProgress.total);
 #endif
       break;
-    case FSUI_upload_completed:
+    case GNUNET_FSUI_upload_completed:
       if (upURI != NULL)
-        ECRS_freeUri (upURI);
-      upURI = ECRS_dupUri (event->data.UploadCompleted.uri);
+        GNUNET_ECRS_uri_destroy (upURI);
+      upURI = GNUNET_ECRS_uri_duplicate (event->data.UploadCompleted.uri);
 #if DEBUG_VERBOSE
       printf ("Upload complete.\n");
 #endif
       break;
-    case FSUI_download_completed:
+    case GNUNET_FSUI_download_completed:
       if (event->data.DownloadCompleted.dc.spos != search)
         {
           fprintf (stderr,
@@ -179,7 +179,7 @@
       printf ("Download complete.\n");
 #endif
       break;
-    case FSUI_download_progress:
+    case GNUNET_FSUI_download_progress:
       if (event->data.DownloadResumed.dc.spos != search)
         {
           fprintf (stderr,
@@ -206,54 +206,54 @@
               event->data.DownloadProgress.total);
 #endif
       break;
-    case FSUI_unindex_progress:
+    case GNUNET_FSUI_unindex_progress:
 #if DEBUG_VERBOSE
       printf ("Unindex is progressing (%llu/%llu)...\n",
               event->data.UnindexProgress.completed,
               event->data.UnindexProgress.total);
 #endif
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
 #if DEBUG_VERBOSE
       printf ("Unindex complete.\n");
 #endif
       break;
-    case FSUI_unindex_error:
+    case GNUNET_FSUI_unindex_error:
       fprintf (stderr,
                "Received ERROR: %d %s\n",
                event->type, event->data.UnindexError.message);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_upload_error:
+    case GNUNET_FSUI_upload_error:
       fprintf (stderr,
                "Received ERROR: %d %s\n",
                event->type, event->data.UploadError.message);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_download_error:
+    case GNUNET_FSUI_download_error:
       fprintf (stderr,
                "Received ERROR: %d %s\n",
                event->type, event->data.DownloadError.message);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_search_error:
+    case GNUNET_FSUI_search_error:
       fprintf (stderr,
                "Received ERROR: %d %s\n",
                event->type, event->data.SearchError.message);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_download_aborted:
+    case GNUNET_FSUI_download_aborted:
 #if DEBUG_VERBOSE
       printf ("Received download aborted event.\n");
 #endif
       break;
-    case FSUI_unindex_suspended:
-    case FSUI_upload_suspended:
+    case GNUNET_FSUI_unindex_suspended:
+    case GNUNET_FSUI_upload_suspended:
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received SUSPENDING: %d\n", event->type);
 #endif
       break;
-    case FSUI_download_started:
+    case GNUNET_FSUI_download_started:
       if (download == NULL)
         download = event->data.DownloadStarted.dc.pos;
       if (event->data.DownloadStarted.dc.spos != search)
@@ -277,7 +277,7 @@
           have_error = 1;
         }
       break;
-    case FSUI_download_stopped:
+    case GNUNET_FSUI_download_stopped:
       if (event->data.DownloadStopped.dc.spos != search)
         {
           fprintf (stderr,
@@ -299,13 +299,13 @@
           have_error = 1;
         }
       break;
-    case FSUI_upload_started:
-    case FSUI_upload_stopped:
-    case FSUI_search_started:
-    case FSUI_search_aborted:
-    case FSUI_search_stopped:
-    case FSUI_unindex_started:
-    case FSUI_unindex_stopped:
+    case GNUNET_FSUI_upload_started:
+    case GNUNET_FSUI_upload_stopped:
+    case GNUNET_FSUI_search_started:
+    case GNUNET_FSUI_search_aborted:
+    case GNUNET_FSUI_search_stopped:
+    case GNUNET_FSUI_unindex_started:
+    case GNUNET_FSUI_unindex_stopped:
       break;
     default:
       printf ("Unexpected event: %d\n", event->type);
@@ -327,7 +327,7 @@
   int ok;
   int i;
   int j;
-  struct ECRS_URI *uri = NULL;
+  struct GNUNET_ECRS_URI *uri = NULL;
   char *fn = NULL;
   char *keywords[] = {
     "down_foo",
@@ -337,31 +337,31 @@
   char keyword[40];
   int prog;
   char *buf;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *kuri = NULL;
-  struct GC_Configuration *cfg;
-  struct FSUI_UnindexList *unindex = NULL;
-  struct FSUI_UploadList *upload = NULL;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *kuri = NULL;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_FSUI_UnindexList *unindex = NULL;
+  struct GNUNET_FSUI_UploadList *upload = NULL;
   int suspendRestart = 0;
 
 
   ok = GNUNET_YES;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
   /* ACTUAL TEST CODE */
 #endif
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "serializetest2", 32, GNUNET_YES, &eventCallback,
                     NULL);
   CHECK (ctx != NULL);
@@ -375,33 +375,33 @@
       GNUNET_free (buf);
       GNUNET_free (fn);
     }
-  meta = ECRS_createMetaData ();
-  kuri = ECRS_parseListKeywordURI (ectx, 2, (const char **) keywords);
-  ECRS_addToMetaData (meta, EXTRACTOR_MIMETYPE, GNUNET_DIRECTORY_MIME);
-  upload = FSUI_startUpload (ctx,
+  meta = GNUNET_ECRS_meta_data_create ();
+  kuri = GNUNET_ECRS_keyword_list_to_uri (ectx, 2, (const char **) keywords);
+  GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_MIMETYPE, 
GNUNET_DIRECTORY_MIME);
+  upload = GNUNET_FSUI_upload_star (ctx,
                              UPLOAD_PREFIX,
-                             (DirectoryScanCallback) &
+                             (GNUNET_FSUI_DirectoryScanCallback) &
                              GNUNET_disk_directory_scan, NULL, 0, 0,
                              GNUNET_YES, GNUNET_NO, GNUNET_NO,
                              GNUNET_get_time () + 5 * GNUNET_CRON_HOURS, meta,
                              kuri, kuri);
   CHECK (upload != NULL);
-  ECRS_freeUri (kuri);
+  GNUNET_ECRS_uri_destroy (kuri);
   kuri = NULL;
-  FSUI_stopUpload (ctx, upload);
+  GNUNET_FSUI_upload_stop (ctx, upload);
   CHECK (upURI != NULL);
   GNUNET_snprintf (keyword, 40, "%s %s %s", keywords[0], _("AND"),
                    keywords[1]);
-  uri = ECRS_parseCharKeywordURI (ectx, keyword);
-  search = FSUI_startSearch (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, uri);
+  uri = GNUNET_ECRS_keyword_string_to_uri (ectx, keyword);
+  search = GNUNET_FSUI_search_start (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, 
uri);
   CHECK (search != NULL);
-  download = FSUI_startDownload (ctx,
+  download = GNUNET_FSUI_download_start (ctx,
                                  0,
                                  GNUNET_YES,
                                  upURI,
                                  meta,
                                  UPLOAD_PREFIX "-download", search, NULL);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   prog = 0;
   suspendRestart = 10;
   while (prog < 1000)
@@ -415,11 +415,11 @@
 #if DEBUG_VERBOSE
           printf ("Testing FSUI suspend-resume\n");
 #endif
-          FSUI_stop (ctx);      /* download possibly incomplete
+          GNUNET_FSUI_stop (ctx);      /* download possibly incomplete
                                    at this point, thus testing resume */
           CHECK (search == NULL);
           CHECK (download == NULL);
-          ctx = FSUI_start (NULL,
+          ctx = GNUNET_FSUI_start (NULL,
                             cfg,
                             "serializetest2", 32, GNUNET_YES, &eventCallback,
                             NULL);
@@ -433,38 +433,38 @@
         {
           no_check = 1;
           GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
-          FSUI_abortSearch (ctx, search);
-          FSUI_stopSearch (ctx, search);
+          GNUNET_FSUI_search_abort (ctx, search);
+          GNUNET_FSUI_search_stop (ctx, search);
           search = NULL;
           no_check = 0;
         }
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopDownload (ctx, download);
+  GNUNET_FSUI_download_stop (ctx, download);
   for (j = 4; j < 256; j += 4)
     {
       fn = makeName (j);
-      unindex = FSUI_startUnindex (ctx, fn);
-      FSUI_stopUnindex (ctx, unindex);
+      unindex = GNUNET_FSUI_unindex_start (ctx, fn);
+      GNUNET_FSUI_unindex_stop (ctx, unindex);
       UNLINK (fn);
       GNUNET_free (fn);
     }
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
   if (uri != NULL)
-    ECRS_freeUri (uri);
+    GNUNET_ECRS_uri_destroy (uri);
   if (kuri != NULL)
-    ECRS_freeUri (kuri);
+    GNUNET_ECRS_uri_destroy (kuri);
   if (upURI != NULL)
-    ECRS_freeUri (upURI);
+    GNUNET_ECRS_uri_destroy (upURI);
 
 #if START_DAEMON
-  GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (have_error)
     ok = GNUNET_NO;
   return (ok == GNUNET_YES) ? 0 : 1;

Modified: GNUnet/src/applications/fs/fsui/serializetest3.c
===================================================================
--- GNUnet/src/applications/fs/fsui/serializetest3.c    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/serializetest3.c    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -35,83 +35,83 @@
 
 #define UPLOAD_PREFIX "/tmp/gnunet-fsui-searializetest3"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; }
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct FSUI_Context *ctx;
-static struct FSUI_SearchList *search;
+static struct GNUNET_FSUI_Context *ctx;
+static struct GNUNET_FSUI_SearchList *search;
 static int have_error;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   switch (event->type)
     {
-    case FSUI_search_suspended:
+    case GNUNET_FSUI_search_suspended:
       search = NULL;
       break;
-    case FSUI_search_resumed:
+    case GNUNET_FSUI_search_resumed:
 #if DEBUG_VERBOSE
       printf ("Search resuming\n");
 #endif
       search = event->data.SearchResumed.sc.pos;
       break;
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
 #if DEBUG_VERBOSE
       printf ("Received search result\n");
 #endif
       break;
-    case FSUI_upload_progress:
+    case GNUNET_FSUI_upload_progress:
 #if DEBUG_VERBOSE
       printf ("Upload is progressing (%llu/%llu)...\n",
               event->data.UploadProgress.completed,
               event->data.UploadProgress.total);
 #endif
       break;
-    case FSUI_upload_completed:
+    case GNUNET_FSUI_upload_completed:
 #if DEBUG_VERBOSE
       printf ("Upload complete.\n");
 #endif
       break;
-    case FSUI_unindex_progress:
+    case GNUNET_FSUI_unindex_progress:
 #if DEBUG_VERBOSE
       printf ("Unindex is progressing (%llu/%llu)...\n",
               event->data.UnindexProgress.completed,
               event->data.UnindexProgress.total);
 #endif
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
 #if DEBUG_VERBOSE
       printf ("Unindex complete.\n");
 #endif
       break;
-    case FSUI_unindex_error:
-    case FSUI_upload_error:
-    case FSUI_download_error:
-    case FSUI_search_error:
+    case GNUNET_FSUI_unindex_error:
+    case GNUNET_FSUI_upload_error:
+    case GNUNET_FSUI_download_error:
+    case GNUNET_FSUI_search_error:
       fprintf (stderr, "Received ERROR: %d\n", event->type);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_download_aborted:
+    case GNUNET_FSUI_download_aborted:
 #if DEBUG_VERBOSE
       printf ("Received download aborted event.\n");
 #endif
       break;
-    case FSUI_unindex_suspended:
-    case FSUI_upload_suspended:
+    case GNUNET_FSUI_unindex_suspended:
+    case GNUNET_FSUI_upload_suspended:
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received SUSPENDING: %d\n", event->type);
 #endif
       break;
-    case FSUI_upload_started:
-    case FSUI_upload_stopped:
-    case FSUI_search_started:
-    case FSUI_search_aborted:
-    case FSUI_search_stopped:
-    case FSUI_search_completed:
-    case FSUI_unindex_started:
-    case FSUI_unindex_stopped:
+    case GNUNET_FSUI_upload_started:
+    case GNUNET_FSUI_upload_stopped:
+    case GNUNET_FSUI_search_started:
+    case GNUNET_FSUI_search_aborted:
+    case GNUNET_FSUI_search_stopped:
+    case GNUNET_FSUI_search_completed:
+    case GNUNET_FSUI_unindex_started:
+    case GNUNET_FSUI_unindex_stopped:
       break;
     default:
       printf ("Unexpected event: %d\n", event->type);
@@ -131,7 +131,7 @@
   pid_t daemon;
 #endif
   int ok;
-  struct ECRS_URI *uri = NULL;
+  struct GNUNET_ECRS_URI *uri = NULL;
   char *keywords[] = {
     "down_foo",
     "down_bar",
@@ -139,34 +139,34 @@
   };
   char keyword[40];
   int prog;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
   int suspendRestart = 0;
 
 
   ok = GNUNET_YES;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
   /* ACTUAL TEST CODE */
 #endif
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "serializetest3", 32, GNUNET_YES, &eventCallback,
                     NULL);
   CHECK (ctx != NULL);
   GNUNET_snprintf (keyword, 40, "%s %s %s", keywords[0], _("AND"),
                    keywords[1]);
-  uri = ECRS_parseCharKeywordURI (ectx, keyword);
-  search = FSUI_startSearch (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, uri);
+  uri = GNUNET_ECRS_keyword_string_to_uri (ectx, keyword);
+  search = GNUNET_FSUI_search_start (ctx, 0, 100, 240 * GNUNET_CRON_SECONDS, 
uri);
   CHECK (search != NULL);
   prog = 0;
   suspendRestart = 10;
@@ -181,10 +181,10 @@
 #if DEBUG_VERBOSE
           printf ("Testing FSUI suspend-resume\n");
 #endif
-          FSUI_stop (ctx);      /* download possibly incomplete
+          GNUNET_FSUI_stop (ctx);      /* download possibly incomplete
                                    at this point, thus testing resume */
           CHECK (search == NULL);
-          ctx = FSUI_start (NULL,
+          ctx = GNUNET_FSUI_start (NULL,
                             cfg,
                             "serializetest3", 32, GNUNET_YES, &eventCallback,
                             NULL);
@@ -197,20 +197,20 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_abortSearch (ctx, search);
-  FSUI_stopSearch (ctx, search);
+  GNUNET_FSUI_search_abort (ctx, search);
+  GNUNET_FSUI_search_stop (ctx, search);
   search = NULL;
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
   if (uri != NULL)
-    ECRS_freeUri (uri);
+    GNUNET_ECRS_uri_destroy (uri);
 
 #if START_DAEMON
-  GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (have_error)
     ok = GNUNET_NO;
   return (ok == GNUNET_YES) ? 0 : 1;

Modified: GNUnet/src/applications/fs/fsui/serializetest4.c
===================================================================
--- GNUnet/src/applications/fs/fsui/serializetest4.c    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/fsui/serializetest4.c    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -36,9 +36,9 @@
 
 #define UPLOAD_PREFIX "/tmp/gnunet-fsui-searializetest4"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; }
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static char *
 makeName (unsigned int i)
@@ -53,9 +53,9 @@
   return fn;
 }
 
-static struct FSUI_Context *ctx;
-static struct ECRS_URI *upURI;
-static struct FSUI_DownloadList *download;
+static struct GNUNET_FSUI_Context *ctx;
+static struct GNUNET_ECRS_URI *upURI;
+static struct GNUNET_FSUI_DownloadList *download;
 static int have_error;
 
 /**
@@ -66,13 +66,13 @@
 static int no_check;
 
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   if (no_check)
     return NULL;
   switch (event->type)
     {
-    case FSUI_download_suspended:
+    case GNUNET_FSUI_download_suspended:
       if (event->data.DownloadSuspended.dc.spos != NULL)
         {
           fprintf (stderr,
@@ -97,7 +97,7 @@
       if (event->data.DownloadSuspended.dc.pos == download)
         download = NULL;
       break;
-    case FSUI_download_resumed:
+    case GNUNET_FSUI_download_resumed:
       if (download == NULL)
         download = event->data.DownloadResumed.dc.pos;
       if (event->data.DownloadResumed.dc.spos != NULL)
@@ -124,22 +124,22 @@
       printf ("Download resuming\n");
 #endif
       break;
-    case FSUI_upload_progress:
+    case GNUNET_FSUI_upload_progress:
 #if DEBUG_VERBOSE
       printf ("Upload is progressing (%llu/%llu)...\n",
               event->data.UploadProgress.completed,
               event->data.UploadProgress.total);
 #endif
       break;
-    case FSUI_upload_completed:
+    case GNUNET_FSUI_upload_completed:
       if (upURI != NULL)
-        ECRS_freeUri (upURI);
-      upURI = ECRS_dupUri (event->data.UploadCompleted.uri);
+        GNUNET_ECRS_uri_destroy (upURI);
+      upURI = GNUNET_ECRS_uri_duplicate (event->data.UploadCompleted.uri);
 #if DEBUG_VERBOSE
       printf ("Upload complete.\n");
 #endif
       break;
-    case FSUI_download_completed:
+    case GNUNET_FSUI_download_completed:
       if (event->data.DownloadCompleted.dc.spos != NULL)
         {
           fprintf (stderr,
@@ -164,7 +164,7 @@
       printf ("Download complete.\n");
 #endif
       break;
-    case FSUI_download_progress:
+    case GNUNET_FSUI_download_progress:
       if (event->data.DownloadResumed.dc.spos != NULL)
         {
           fprintf (stderr,
@@ -191,37 +191,37 @@
               event->data.DownloadProgress.total);
 #endif
       break;
-    case FSUI_unindex_progress:
+    case GNUNET_FSUI_unindex_progress:
 #if DEBUG_VERBOSE
       printf ("Unindex is progressing (%llu/%llu)...\n",
               event->data.UnindexProgress.completed,
               event->data.UnindexProgress.total);
 #endif
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
 #if DEBUG_VERBOSE
       printf ("Unindex complete.\n");
 #endif
       break;
-    case FSUI_unindex_error:
-    case FSUI_upload_error:
-    case FSUI_download_error:
-    case FSUI_search_error:
+    case GNUNET_FSUI_unindex_error:
+    case GNUNET_FSUI_upload_error:
+    case GNUNET_FSUI_download_error:
+    case GNUNET_FSUI_search_error:
       fprintf (stderr, "Received ERROR: %d\n", event->type);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
-    case FSUI_download_aborted:
+    case GNUNET_FSUI_download_aborted:
 #if DEBUG_VERBOSE
       printf ("Received download aborted event.\n");
 #endif
       break;
-    case FSUI_unindex_suspended:
-    case FSUI_upload_suspended:
+    case GNUNET_FSUI_unindex_suspended:
+    case GNUNET_FSUI_upload_suspended:
 #if DEBUG_VERBOSE
       fprintf (stderr, "Received SUSPENDING: %d\n", event->type);
 #endif
       break;
-    case FSUI_download_started:
+    case GNUNET_FSUI_download_started:
       if (download == NULL)
         download = event->data.DownloadStarted.dc.pos;
       if (event->data.DownloadStarted.dc.spos != NULL)
@@ -245,7 +245,7 @@
           have_error = 1;
         }
       break;
-    case FSUI_download_stopped:
+    case GNUNET_FSUI_download_stopped:
       if (event->data.DownloadStopped.dc.spos != NULL)
         {
           fprintf (stderr,
@@ -267,13 +267,13 @@
           have_error = 1;
         }
       break;
-    case FSUI_upload_started:
-    case FSUI_upload_stopped:
-    case FSUI_search_started:
-    case FSUI_search_aborted:
-    case FSUI_search_stopped:
-    case FSUI_unindex_started:
-    case FSUI_unindex_stopped:
+    case GNUNET_FSUI_upload_started:
+    case GNUNET_FSUI_upload_stopped:
+    case GNUNET_FSUI_search_started:
+    case GNUNET_FSUI_search_aborted:
+    case GNUNET_FSUI_search_stopped:
+    case GNUNET_FSUI_unindex_started:
+    case GNUNET_FSUI_unindex_stopped:
       break;
     default:
       printf ("Unexpected event: %d\n", event->type);
@@ -295,7 +295,7 @@
   int ok;
   int i;
   int j;
-  struct ECRS_URI *uri = NULL;
+  struct GNUNET_ECRS_URI *uri = NULL;
   char *fn = NULL;
   char *keywords[] = {
     "down_foo",
@@ -305,31 +305,31 @@
   char keyword[40];
   int prog;
   char *buf;
-  struct ECRS_MetaData *meta;
-  struct ECRS_URI *kuri = NULL;
-  struct GC_Configuration *cfg;
-  struct FSUI_UnindexList *unindex = NULL;
-  struct FSUI_UploadList *upload = NULL;
+  struct GNUNET_ECRS_MetaData *meta;
+  struct GNUNET_ECRS_URI *kuri = NULL;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_FSUI_UnindexList *unindex = NULL;
+  struct GNUNET_FSUI_UploadList *upload = NULL;
   int suspendRestart = 0;
 
 
   ok = GNUNET_YES;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
   /* ACTUAL TEST CODE */
 #endif
-  ctx = FSUI_start (NULL,
+  ctx = GNUNET_FSUI_start (NULL,
                     cfg, "serializetest4", 32, GNUNET_YES, &eventCallback,
                     NULL);
   CHECK (ctx != NULL);
@@ -343,29 +343,29 @@
       GNUNET_free (buf);
       GNUNET_free (fn);
     }
-  meta = ECRS_createMetaData ();
-  kuri = ECRS_parseListKeywordURI (ectx, 2, (const char **) keywords);
-  ECRS_addToMetaData (meta, EXTRACTOR_MIMETYPE, GNUNET_DIRECTORY_MIME);
-  upload = FSUI_startUpload (ctx,
+  meta = GNUNET_ECRS_meta_data_create ();
+  kuri = GNUNET_ECRS_keyword_list_to_uri (ectx, 2, (const char **) keywords);
+  GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_MIMETYPE, 
GNUNET_DIRECTORY_MIME);
+  upload = GNUNET_FSUI_upload_star (ctx,
                              UPLOAD_PREFIX,
-                             (DirectoryScanCallback) &
+                             (GNUNET_FSUI_DirectoryScanCallback) &
                              GNUNET_disk_directory_scan, NULL, 0, 0,
                              GNUNET_YES, GNUNET_NO, GNUNET_NO,
                              GNUNET_get_time () + 5 * GNUNET_CRON_HOURS, meta,
                              kuri, kuri);
   CHECK (upload != NULL);
-  ECRS_freeUri (kuri);
+  GNUNET_ECRS_uri_destroy (kuri);
   kuri = NULL;
-  FSUI_stopUpload (ctx, upload);
+  GNUNET_FSUI_upload_stop (ctx, upload);
   GNUNET_snprintf (keyword, 40, "%s %s %s", keywords[0], _("AND"),
                    keywords[1]);
-  uri = ECRS_parseCharKeywordURI (ectx, keyword);
-  download = FSUI_startDownload (ctx,
+  uri = GNUNET_ECRS_keyword_string_to_uri (ectx, keyword);
+  download = GNUNET_FSUI_download_start (ctx,
                                  0,
                                  GNUNET_YES,
                                  upURI,
                                  meta, UPLOAD_PREFIX "-download", NULL, NULL);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   prog = 0;
   suspendRestart = 10;
   while (prog < 1000)
@@ -379,10 +379,10 @@
 #if DEBUG_VERBOSE
           printf ("Testing FSUI suspend-resume\n");
 #endif
-          FSUI_stop (ctx);      /* download possibly incomplete
+          GNUNET_FSUI_stop (ctx);      /* download possibly incomplete
                                    at this point, thus testing resume */
           CHECK (download == NULL);
-          ctx = FSUI_start (NULL,
+          ctx = GNUNET_FSUI_start (NULL,
                             cfg,
                             "serializetest4", 32, GNUNET_YES, &eventCallback,
                             NULL);
@@ -395,30 +395,30 @@
       if (GNUNET_shutdown_test () == GNUNET_YES)
         break;
     }
-  FSUI_stopDownload (ctx, download);
+  GNUNET_FSUI_download_stop (ctx, download);
   for (j = 4; j < 16; j += 4)
     {
       fn = makeName (j);
-      unindex = FSUI_startUnindex (ctx, fn);
-      FSUI_stopUnindex (ctx, unindex);
+      unindex = GNUNET_FSUI_unindex_start (ctx, fn);
+      GNUNET_FSUI_unindex_stop (ctx, unindex);
       UNLINK (fn);
       GNUNET_free (fn);
     }
   /* END OF TEST CODE */
 FAILURE:
   if (ctx != NULL)
-    FSUI_stop (ctx);
+    GNUNET_FSUI_stop (ctx);
   if (uri != NULL)
-    ECRS_freeUri (uri);
+    GNUNET_ECRS_uri_destroy (uri);
   if (kuri != NULL)
-    ECRS_freeUri (kuri);
+    GNUNET_ECRS_uri_destroy (kuri);
   if (upURI != NULL)
-    ECRS_freeUri (upURI);
+    GNUNET_ECRS_uri_destroy (upURI);
 
 #if START_DAEMON
-  GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_BREAK (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (have_error)
     ok = GNUNET_NO;
   return (ok == GNUNET_YES) ? 0 : 1;

Modified: GNUnet/src/applications/fs/fsui/unindex.c
===================================================================
--- GNUnet/src/applications/fs/fsui/unindex.c   2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/unindex.c   2007-11-25 12:04:45 UTC (rev 
5755)
@@ -40,10 +40,10 @@
                   unsigned long long completedBytes, GNUNET_CronTime eta,
                   void *cls)
 {
-  FSUI_UnindexList *utc = cls;
-  FSUI_Event event;
+  GNUNET_FSUI_UnindexList *utc = cls;
+  GNUNET_FSUI_Event event;
 
-  event.type = FSUI_unindex_progress;
+  event.type = GNUNET_FSUI_unindex_progress;
   event.data.UnindexProgress.uc.pos = utc;
   event.data.UnindexProgress.uc.cctx = utc->cctx;
   event.data.UnindexProgress.total = totalBytes;
@@ -56,8 +56,8 @@
 static int
 tt (void *cls)
 {
-  FSUI_UnindexList *utc = cls;
-  if (utc->state != FSUI_ACTIVE)
+  GNUNET_FSUI_UnindexList *utc = cls;
+  if (utc->state != GNUNET_FSUI_ACTIVE)
     return GNUNET_SYSERR;
   return GNUNET_OK;
 }
@@ -66,56 +66,56 @@
  * Thread that does the unindex.
  */
 void *
-FSUI_unindexThread (void *cls)
+GNUNET_FSUI_unindexThread (void *cls)
 {
-  FSUI_UnindexList *utc = cls;
-  FSUI_Event event;
+  GNUNET_FSUI_UnindexList *utc = cls;
+  GNUNET_FSUI_Event event;
   int ret;
   unsigned long long size;
-  struct GE_Memory *mem;
-  struct GE_Context *ee;
+  struct GNUNET_GE_Memory *mem;
+  struct GNUNET_GE_Context *ee;
 
   if (GNUNET_OK !=
       GNUNET_disk_file_size (utc->ctx->ectx, utc->filename, &size,
                              GNUNET_YES))
     {
-      GE_BREAK (utc->ctx->ectx, 0);
+      GNUNET_GE_BREAK (utc->ctx->ectx, 0);
       size = 0;
     }
-  mem = GE_memory_create (2);
+  mem = GNUNET_GE_memory_create (2);
   ee =
-    GE_create_context_memory (GE_USER | GE_ADMIN | GE_ERROR | GE_WARNING |
-                              GE_FATAL | GE_BULK | GE_IMMEDIATE, mem);
+    GNUNET_GE_create_context_memory (GNUNET_GE_USER | GNUNET_GE_ADMIN | 
GNUNET_GE_ERROR | GNUNET_GE_WARNING |
+                              GNUNET_GE_FATAL | GNUNET_GE_BULK | 
GNUNET_GE_IMMEDIATE, mem);
   ret =
-    ECRS_unindexFile (ee, utc->ctx->cfg, utc->filename, &progressCallback,
+    GNUNET_ECRS_file_uninde (ee, utc->ctx->cfg, utc->filename, 
&progressCallback,
                       utc, &tt, utc);
   if (ret == GNUNET_OK)
     {
-      utc->state = FSUI_COMPLETED;
-      event.type = FSUI_unindex_completed;
+      utc->state = GNUNET_FSUI_COMPLETED;
+      event.type = GNUNET_FSUI_unindex_completed;
       event.data.UnindexCompleted.uc.pos = utc;
       event.data.UnindexCompleted.uc.cctx = utc->cctx;
       event.data.UnindexCompleted.total = size;
       event.data.UnindexCompleted.filename = utc->filename;
       utc->ctx->ecb (utc->ctx->ecbClosure, &event);
     }
-  else if (utc->state == FSUI_ACTIVE)
+  else if (utc->state == GNUNET_FSUI_ACTIVE)
     {
       const char *error;
 
-      utc->state = FSUI_ERROR;
-      event.type = FSUI_unindex_error;
+      utc->state = GNUNET_FSUI_ERROR;
+      event.type = GNUNET_FSUI_unindex_error;
       event.data.UnindexError.uc.pos = utc;
       event.data.UnindexError.uc.cctx = utc->cctx;
-      error = GE_memory_get (mem, 0);
+      error = GNUNET_GE_memory_get (mem, 0);
       if (error == NULL)
         error = _("Unindexing failed (no reason given)");
       event.data.UnindexError.message = error;
       utc->ctx->ecb (utc->ctx->ecbClosure, &event);
     }
-  else if (utc->state == FSUI_ABORTED)
+  else if (utc->state == GNUNET_FSUI_ABORTED)
     {
-      event.type = FSUI_unindex_aborted;
+      event.type = GNUNET_FSUI_unindex_aborted;
       event.data.UnindexAborted.uc.pos = utc;
       event.data.UnindexAborted.uc.cctx = utc->cctx;
       utc->ctx->ecb (utc->ctx->ecbClosure, &event);
@@ -123,15 +123,15 @@
   else
     {
       /* must be suspending */
-      GE_BREAK (NULL, utc->state == FSUI_PENDING);
+      GNUNET_GE_BREAK (NULL, utc->state == GNUNET_FSUI_PENDING);
     }
 #if 0
-  GE_LOG (utc->ctx->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (utc->ctx->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FSUI unindexThread exits in state %u.\n", utc->state);
 #endif
-  GE_free_context (ee);
-  GE_memory_free (mem);
+  GNUNET_GE_free_context (ee);
+  GNUNET_GE_memory_free (mem);
   return NULL;
 }
 
@@ -139,26 +139,26 @@
  * Thread that does the unindex.
  */
 static void *
-FSUI_unindexThreadEvent (void *cls)
+GNUNET_FSUI_unindexThreadEvent (void *cls)
 {
-  FSUI_UnindexList *utc = cls;
-  FSUI_Event event;
+  GNUNET_FSUI_UnindexList *utc = cls;
+  GNUNET_FSUI_Event event;
   unsigned long long size;
 
   if (GNUNET_OK !=
       GNUNET_disk_file_size (utc->ctx->ectx, utc->filename, &size,
                              GNUNET_YES))
     {
-      GE_BREAK (utc->ctx->ectx, 0);
+      GNUNET_GE_BREAK (utc->ctx->ectx, 0);
       size = 0;
     }
-  event.type = FSUI_unindex_started;
+  event.type = GNUNET_FSUI_unindex_started;
   event.data.UnindexStarted.uc.pos = utc;
   event.data.UnindexStarted.uc.cctx = NULL;
   event.data.UnindexStarted.total = size;
   event.data.UnindexStarted.filename = utc->filename;
   utc->cctx = utc->ctx->ecb (utc->ctx->ecbClosure, &event);
-  return FSUI_unindexThread (utc);
+  return GNUNET_FSUI_unindexThread (utc);
 }
 
 /**
@@ -171,32 +171,32 @@
  *  GNUNET_SYSERR if the file does not exist or gnunetd is not
  *  running
  */
-struct FSUI_UnindexList *
-FSUI_startUnindex (struct FSUI_Context *ctx, const char *filename)
+struct GNUNET_FSUI_UnindexList *
+GNUNET_FSUI_unindex_start (struct GNUNET_FSUI_Context *ctx, const char 
*filename)
 {
-  FSUI_UnindexList *utc;
+  GNUNET_FSUI_UnindexList *utc;
 
   if (GNUNET_YES == GNUNET_disk_directory_test (ctx->ectx, filename))
     {
-      GE_BREAK (ctx->ectx, 0);
+      GNUNET_GE_BREAK (ctx->ectx, 0);
       return NULL;
     }
   if (GNUNET_YES != GNUNET_disk_file_test (ctx->ectx, filename))
     {
-      GE_BREAK (ctx->ectx, 0);
+      GNUNET_GE_BREAK (ctx->ectx, 0);
       return NULL;
     }
-  utc = GNUNET_malloc (sizeof (FSUI_UnindexList));
+  utc = GNUNET_malloc (sizeof (GNUNET_FSUI_UnindexList));
   utc->ctx = ctx;
   utc->filename = GNUNET_strdup (filename);
   utc->start_time = GNUNET_get_time ();
-  utc->state = FSUI_ACTIVE;
+  utc->state = GNUNET_FSUI_ACTIVE;
   utc->handle =
-    GNUNET_thread_create (&FSUI_unindexThreadEvent, utc, 32 * 1024);
+    GNUNET_thread_create (&GNUNET_FSUI_unindexThreadEvent, utc, 32 * 1024);
   if (utc->handle == NULL)
     {
-      GE_LOG_STRERROR (ctx->ectx,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_IMMEDIATE,
+      GNUNET_GE_LOG_STRERROR (ctx->ectx,
+                       GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_IMMEDIATE,
                        "PTHREAD_CREATE");
       GNUNET_free (utc->filename);
       GNUNET_free (utc);
@@ -216,18 +216,18 @@
  * @return GNUNET_SYSERR if no such unindex is pending
  */
 int
-FSUI_abortUnindex (struct FSUI_Context *ctx, struct FSUI_UnindexList *ul)
+GNUNET_FSUI_unindex_abort (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_UnindexList *ul)
 {
-  if ((ul->state != FSUI_ACTIVE) && (ul->state != FSUI_PENDING))
+  if ((ul->state != GNUNET_FSUI_ACTIVE) && (ul->state != GNUNET_FSUI_PENDING))
     return GNUNET_NO;
-  if (ul->state == FSUI_ACTIVE)
+  if (ul->state == GNUNET_FSUI_ACTIVE)
     {
-      ul->state = FSUI_ABORTED;
+      ul->state = GNUNET_FSUI_ABORTED;
       GNUNET_thread_stop_sleep (ul->handle);
     }
   else
     {
-      ul->state = FSUI_ABORTED_JOINED;
+      ul->state = GNUNET_FSUI_ABORTED_JOINED;
     }
   return GNUNET_OK;
 }
@@ -239,22 +239,22 @@
  * @return GNUNET_SYSERR if no such unindex is pending
  */
 int
-FSUI_stopUnindex (struct FSUI_Context *ctx, struct FSUI_UnindexList *dl)
+GNUNET_FSUI_unindex_stop (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_UnindexList *dl)
 {
-  FSUI_UnindexList *prev;
-  struct GE_Context *ectx;
+  GNUNET_FSUI_UnindexList *prev;
+  struct GNUNET_GE_Context *ectx;
   void *unused;
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
 
   ectx = ctx->ectx;
   if (dl == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
 #if 0
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER, "FSUI_stopUnindex called.\n");
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
"GNUNET_FSUI_stopUnindex called.\n");
 #endif
   GNUNET_mutex_lock (ctx->lock);
   prev = ctx->unindexOperations;
@@ -263,9 +263,9 @@
   if (prev == NULL)
     {
       GNUNET_mutex_unlock (ctx->lock);
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
-              "FSUI_stopUnindex failed to locate deletion operation.\n");
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
+              "GNUNET_FSUI_stopUnindex failed to locate deletion 
operation.\n");
       return GNUNET_SYSERR;
     }
   if (prev == dl)
@@ -277,23 +277,23 @@
       prev->next = dl->next;
     }
   GNUNET_mutex_unlock (ctx->lock);
-  if ((dl->state == FSUI_ACTIVE) ||
-      (dl->state == FSUI_COMPLETED) ||
-      (dl->state == FSUI_ABORTED) || (dl->state == FSUI_ERROR))
+  if ((dl->state == GNUNET_FSUI_ACTIVE) ||
+      (dl->state == GNUNET_FSUI_COMPLETED) ||
+      (dl->state == GNUNET_FSUI_ABORTED) || (dl->state == GNUNET_FSUI_ERROR))
     {
-      GE_ASSERT (ctx->ectx, dl->handle != NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, dl->handle != NULL);
       GNUNET_thread_join (dl->handle, &unused);
       dl->handle = NULL;
-      if (dl->state == FSUI_ACTIVE)
-        dl->state = FSUI_PENDING;
+      if (dl->state == GNUNET_FSUI_ACTIVE)
+        dl->state = GNUNET_FSUI_PENDING;
       else
         dl->state++;            /* add _JOINED */
     }
   else
     {
-      GE_ASSERT (ctx->ectx, dl->handle == NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, dl->handle == NULL);
     }
-  event.type = FSUI_unindex_stopped;
+  event.type = GNUNET_FSUI_unindex_stopped;
   event.data.UnindexStopped.uc.pos = dl;
   event.data.UnindexStopped.uc.cctx = dl->cctx;
   dl->ctx->ecb (dl->ctx->ecbClosure, &event);

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/fsui/upload.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -48,19 +48,19 @@
                    unsigned long long completedBytes, GNUNET_CronTime eta,
                    void *ptr, int direct, int add, int unaccounted)
 {
-  FSUI_UploadList *utc = ptr;
-  FSUI_Event event;
+  GNUNET_FSUI_UploadList *utc = ptr;
+  GNUNET_FSUI_Event event;
   unsigned long long subtotal;
-  FSUI_UploadList *pos;
+  GNUNET_FSUI_UploadList *pos;
   GNUNET_CronTime xeta;
   GNUNET_CronTime now;
 
-  event.type = FSUI_upload_progress;
+  event.type = GNUNET_FSUI_upload_progress;
   event.data.UploadProgress.uc.pos = utc;
   event.data.UploadProgress.uc.cctx = utc->cctx;
   event.data.UploadProgress.uc.ppos = utc->parent;
   event.data.UploadProgress.uc.pcctx = utc->parent->cctx;
-  if (GNUNET_YES == ECRS_isDirectory (utc->meta))
+  if (GNUNET_YES == GNUNET_ECRS_meta_data_test_for_directory (utc->meta))
     {
       if (direct == GNUNET_YES)
         unaccounted = GNUNET_YES;
@@ -77,7 +77,7 @@
         }
       else
         {
-          GE_ASSERT (NULL, totalBytes == completedBytes);
+          GNUNET_GE_ASSERT (NULL, totalBytes == completedBytes);
           event.data.UploadProgress.completed =
             completedBytes + utc->completed;
           event.data.UploadProgress.total = totalBytes + utc->total;
@@ -133,8 +133,8 @@
 static int
 testTerminate (void *cls)
 {
-  FSUI_UploadList *utc = cls;
-  if (utc->state != FSUI_ACTIVE)
+  GNUNET_FSUI_UploadList *utc = cls;
+  if (utc->state != GNUNET_FSUI_ACTIVE)
     return GNUNET_SYSERR;
   return GNUNET_OK;
 }
@@ -144,22 +144,22 @@
  * a directory, upload it and store the uri in  *uri.
  */
 static char *
-createDirectoryHelper (struct GE_Context *ectx,
-                       struct GC_Configuration *cfg,
-                       struct FSUI_UploadList *children,
-                       struct ECRS_MetaData *meta, char **error)
+createDirectoryHelper (struct GNUNET_GE_Context *ectx,
+                       struct GNUNET_GC_Configuration *cfg,
+                       struct GNUNET_FSUI_UploadList *children,
+                       struct GNUNET_ECRS_MetaData *meta, char **error)
 {
-  ECRS_FileInfo *fis;
+  GNUNET_ECRS_FileInfo *fis;
   unsigned int count;
   unsigned int size;
   char *data;
   unsigned long long len;
   int ret;
   char *tempName;
-  struct FSUI_UploadList *pos;
+  struct GNUNET_FSUI_UploadList *pos;
   int handle;
-  struct GE_Memory *mem;
-  struct GE_Context *ee;
+  struct GNUNET_GE_Memory *mem;
+  struct GNUNET_GE_Context *ee;
 
   fis = NULL;
   size = 0;
@@ -184,54 +184,54 @@
         }
       pos = pos->next;
     }
-  GE_BREAK (ectx, count == size);
-  mem = GE_memory_create (2);
+  GNUNET_GE_BREAK (ectx, count == size);
+  mem = GNUNET_GE_memory_create (2);
   ee =
-    GE_create_context_memory (GE_USER | GE_ADMIN | GE_ERROR | GE_WARNING |
-                              GE_FATAL | GE_BULK | GE_IMMEDIATE, mem);
-  ret = ECRS_createDirectory (ee, &data, &len, size, fis, meta);
+    GNUNET_GE_create_context_memory (GNUNET_GE_USER | GNUNET_GE_ADMIN | 
GNUNET_GE_ERROR | GNUNET_GE_WARNING |
+                              GNUNET_GE_FATAL | GNUNET_GE_BULK | 
GNUNET_GE_IMMEDIATE, mem);
+  ret = GNUNET_ECRS_directory_create (ee, &data, &len, size, fis, meta);
   GNUNET_array_grow (fis, size, 0);
   if (ret != GNUNET_OK)
     {
-      *error = GNUNET_strdup (GE_memory_get (mem, 0));
-      GE_free_context (ee);
-      GE_memory_free (mem);
+      *error = GNUNET_strdup (GNUNET_GE_memory_get (mem, 0));
+      GNUNET_GE_free_context (ee);
+      GNUNET_GE_memory_free (mem);
       return NULL;
     }
   pos = children;
   while (pos != NULL)
     {
       if (pos->uri != NULL)
-        URITRACK_addState (ectx, cfg, pos->uri, URITRACK_DIRECTORY_ADDED);
+        GNUNET_URITRACK_add_state (ectx, cfg, pos->uri, 
GNUNET_URITRACK_DIRECTORY_ADDED);
       pos = pos->next;
     }
-  GE_memory_reset (mem);
+  GNUNET_GE_memory_reset (mem);
   tempName = GNUNET_strdup ("/tmp/gnunet-upload-dir.XXXXXX");
   handle = mkstemp (tempName);
   if (handle == -1)
     {
-      GE_LOG_STRERROR_FILE (ee,
-                            GE_ERROR | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ee,
+                            GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_BULK,
                             "mkstemp", tempName);
       GNUNET_free (tempName);
       GNUNET_free (data);
-      *error = GNUNET_strdup (GE_memory_get (mem, 0));
-      GE_free_context (ee);
-      GE_memory_free (mem);
+      *error = GNUNET_strdup (GNUNET_GE_memory_get (mem, 0));
+      GNUNET_GE_free_context (ee);
+      GNUNET_GE_memory_free (mem);
       return NULL;
     }
   if (len != WRITE (handle, data, len))
     {
-      GE_LOG_STRERROR_FILE (ee,
-                            GE_ERROR | GE_USER | GE_BULK, "write", tempName);
-      *error = GNUNET_strdup (GE_memory_get (mem, 0));
-      GE_free_context (ee);
-      GE_memory_free (mem);
+      GNUNET_GE_LOG_STRERROR_FILE (ee,
+                            GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_BULK, 
"write", tempName);
+      *error = GNUNET_strdup (GNUNET_GE_memory_get (mem, 0));
+      GNUNET_GE_free_context (ee);
+      GNUNET_GE_memory_free (mem);
       GNUNET_free (data);
       return NULL;
     }
-  GE_free_context (ee);
-  GE_memory_free (mem);
+  GNUNET_GE_free_context (ee);
+  GNUNET_GE_memory_free (mem);
   CLOSE (handle);
   GNUNET_free (data);
   return tempName;
@@ -241,12 +241,12 @@
  * Signal upload error to client.
  */
 static void
-signalError (FSUI_UploadList * utc, const char *message)
+signalError (GNUNET_FSUI_UploadList * utc, const char *message)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
 
-  utc->state = FSUI_ERROR;
-  event.type = FSUI_upload_error;
+  utc->state = GNUNET_FSUI_ERROR;
+  event.type = GNUNET_FSUI_upload_error;
   event.data.UploadError.uc.pos = utc;
   event.data.UploadError.uc.cctx = utc->cctx;
   event.data.UploadError.uc.ppos = utc->parent;
@@ -256,13 +256,13 @@
 }
 
 static void
-signalUploadStarted (struct FSUI_UploadList *utc, int first_only)
+signalUploadStarted (struct GNUNET_FSUI_UploadList *utc, int first_only)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
 
   while (utc != NULL)
     {
-      event.type = FSUI_upload_started;
+      event.type = GNUNET_FSUI_upload_started;
       event.data.UploadStarted.uc.pos = utc;
       event.data.UploadStarted.uc.cctx = utc->cctx;
       event.data.UploadStarted.uc.ppos = utc->parent;
@@ -283,34 +283,34 @@
  * Thread that does the upload.
  */
 void *
-FSUI_uploadThread (void *cls)
+GNUNET_FSUI_uploadThread (void *cls)
 {
-  FSUI_UploadList *utc = cls;
-  FSUI_UploadList *cpos;
-  FSUI_Event event;
-  ECRS_FileInfo fi;
+  GNUNET_FSUI_UploadList *utc = cls;
+  GNUNET_FSUI_UploadList *cpos;
+  GNUNET_FSUI_Event event;
+  GNUNET_ECRS_FileInfo fi;
   int ret;
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
   char *filename;
   char *pfn;
-  struct ECRS_URI *uri;
-  struct ECRS_URI *loc;
+  struct GNUNET_ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *loc;
   size_t tpos;
   char *error;
-  struct GE_Memory *mem;
-  struct GE_Context *ee;
+  struct GNUNET_GE_Memory *mem;
+  struct GNUNET_GE_Context *ee;
 
 
   ectx = utc->shared->ctx->ectx;
-  GE_ASSERT (ectx, utc->filename != NULL);
+  GNUNET_GE_ASSERT (ectx, utc->filename != NULL);
   cpos = utc->child;
   while (cpos != NULL)
     {
-      if (cpos->state == FSUI_ACTIVE)
-        FSUI_uploadThread (cpos);
+      if (cpos->state == GNUNET_FSUI_ACTIVE)
+        GNUNET_FSUI_uploadThread (cpos);
       cpos = cpos->next;
     }
-  if (utc->state != FSUI_ACTIVE)
+  if (utc->state != GNUNET_FSUI_ACTIVE)
     return NULL;                /* aborted or suspended */
   if (GNUNET_YES == GNUNET_disk_directory_test (ectx, utc->filename))
     {
@@ -333,12 +333,12 @@
       filename = GNUNET_strdup (utc->filename);
     }
   utc->start_time = GNUNET_get_time ();
-  mem = GE_memory_create (2);
+  mem = GNUNET_GE_memory_create (2);
   ee =
-    GE_create_context_memory (GE_USER | GE_ADMIN | GE_ERROR | GE_WARNING |
-                              GE_FATAL | GE_BULK | GE_IMMEDIATE, mem);
+    GNUNET_GE_create_context_memory (GNUNET_GE_USER | GNUNET_GE_ADMIN | 
GNUNET_GE_ERROR | GNUNET_GE_WARNING |
+                              GNUNET_GE_FATAL | GNUNET_GE_BULK | 
GNUNET_GE_IMMEDIATE, mem);
   ret =
-    ECRS_uploadFile (ee, utc->shared->ctx->cfg, filename,
+    GNUNET_ECRS_file_upload (ee, utc->shared->ctx->cfg, filename,
                      utc->shared->doIndex == GNUNET_YES ? (utc->child ==
                                                            NULL ? GNUNET_YES :
                                                            GNUNET_NO) :
@@ -347,16 +347,16 @@
                      &progressCallback, utc, &testTerminate, utc, &utc->uri);
   if (ret != GNUNET_OK)
     {
-      if (utc->state == FSUI_ACTIVE)
+      if (utc->state == GNUNET_FSUI_ACTIVE)
         {
           const char *err;
 
-          err = GE_memory_get (mem, 0);
+          err = GNUNET_GE_memory_get (mem, 0);
           signalError (utc, err ? err : "");
         }
-      else if (utc->state == FSUI_ABORTED)
+      else if (utc->state == GNUNET_FSUI_ABORTED)
         {
-          event.type = FSUI_upload_aborted;
+          event.type = GNUNET_FSUI_upload_aborted;
           event.data.UploadAborted.uc.pos = utc;
           event.data.UploadAborted.uc.cctx = utc->cctx;
           event.data.UploadAborted.uc.ppos = utc->parent;
@@ -366,21 +366,21 @@
       else
         {
           /* must be suspended */
-          GE_BREAK (NULL, utc->state == FSUI_PENDING);
+          GNUNET_GE_BREAK (NULL, utc->state == GNUNET_FSUI_PENDING);
         }
       if (utc->child != NULL)
         UNLINK (filename);
       GNUNET_free (filename);
-      GE_free_context (ee);
-      GE_memory_free (mem);
+      GNUNET_GE_free_context (ee);
+      GNUNET_GE_memory_free (mem);
       return NULL;
     }
-  utc->state = FSUI_COMPLETED;
+  utc->state = GNUNET_FSUI_COMPLETED;
   if (utc->child == NULL)
-    ECRS_extractMetaData (utc->shared->ctx->ectx,
+    GNUNET_ECRS_meta_data_extract_from_file (utc->shared->ctx->ectx,
                           utc->meta, utc->filename, utc->shared->extractors);
   while (GNUNET_OK ==
-         ECRS_delFromMetaData (utc->meta, EXTRACTOR_FILENAME, NULL));
+         GNUNET_ECRS_meta_data_delete (utc->meta, EXTRACTOR_FILENAME, NULL));
   /* only publish the last part of the path
      -- we do not want to publish $HOME or similar
      trivially deanonymizing information */
@@ -394,7 +394,7 @@
   if ((utc->child != NULL) &&
       ((strlen (pfn) == 0) || (pfn[strlen (pfn) - 1] != DIR_SEPARATOR)))
     strcat (pfn, DIR_SEPARATOR_STR);
-  ECRS_addToMetaData (utc->meta, EXTRACTOR_FILENAME, pfn);
+  GNUNET_ECRS_meta_data_inser (utc->meta, EXTRACTOR_FILENAME, pfn);
   GNUNET_free (pfn);
   if ((utc->shared->anonymityLevel == 0)
       && (utc->shared->doIndex == GNUNET_YES))
@@ -408,10 +408,10 @@
 
       if (GNUNET_OK == GNUNET_IDENTITY_get_self (sock, &hello))
         {
-          loc = ECRS_uriFromLocation (utc->uri,
+          loc = GNUNET_ECRS_location_to_uri (utc->uri,
                                       &hello->publicKey,
                                       ntohl (hello->expirationTime),
-                                      (ECRS_SignFunction) &
+                                      (GNUNET_ECRS_SignFunction) &
                                       GNUNET_IDENTITY_sign_function, sock);
 
           GNUNET_free (hello);
@@ -419,7 +419,7 @@
       else
         {
           /* may happen if no transports are available... */
-          loc = ECRS_dupUri (utc->uri);
+          loc = GNUNET_ECRS_uri_duplicate (utc->uri);
         }
       GNUNET_client_connection_destroy (sock);
     }
@@ -427,17 +427,17 @@
     {
       /* no location URI, use standard URI
          (copied here to allow free later) */
-      loc = ECRS_dupUri (utc->uri);
+      loc = GNUNET_ECRS_uri_duplicate (utc->uri);
     }
   if (utc->shared->global_keywords != NULL)
-    ECRS_addToKeyspace (ectx,
+    GNUNET_ECRS_publish_under_keyword (ectx,
                         utc->shared->ctx->cfg,
                         utc->shared->global_keywords,
                         utc->shared->anonymityLevel,
                         utc->shared->priority,
                         utc->shared->expiration, loc, utc->meta);
   if (utc->keywords != NULL)
-    ECRS_addToKeyspace (ectx,
+    GNUNET_ECRS_publish_under_keyword (ectx,
                         utc->shared->ctx->cfg,
                         utc->keywords,
                         utc->shared->anonymityLevel,
@@ -445,28 +445,28 @@
                         utc->shared->expiration, loc, utc->meta);
   if (utc->shared->individualKeywords == GNUNET_YES)
     {
-      uri = ECRS_metaDataToUri (utc->meta);
-      ECRS_addToKeyspace (ectx,
+      uri = GNUNET_ECRS_meta_data_to_uri (utc->meta);
+      GNUNET_ECRS_publish_under_keyword (ectx,
                           utc->shared->ctx->cfg,
                           uri,
                           utc->shared->anonymityLevel,
                           utc->shared->priority,
                           utc->shared->expiration, loc, utc->meta);
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_uri_destroy (uri);
     }
-  ECRS_freeUri (loc);
+  GNUNET_ECRS_uri_destroy (loc);
   loc = NULL;
   while (GNUNET_OK ==
-         ECRS_delFromMetaData (utc->meta, EXTRACTOR_SPLIT, NULL));
+         GNUNET_ECRS_meta_data_delete (utc->meta, EXTRACTOR_SPLIT, NULL));
   fi.meta = utc->meta;
   fi.uri = utc->uri;
-  URITRACK_trackURI (ectx, utc->shared->ctx->cfg, &fi);
-  URITRACK_addState (ectx,
+  GNUNET_URITRACK_track (ectx, utc->shared->ctx->cfg, &fi);
+  GNUNET_URITRACK_add_state (ectx,
                      utc->shared->ctx->cfg,
                      utc->uri,
                      utc->shared->doIndex ==
-                     GNUNET_YES ? URITRACK_INDEXED : URITRACK_INSERTED);
-  event.type = FSUI_upload_completed;
+                     GNUNET_YES ? GNUNET_URITRACK_INDEXED : 
GNUNET_URITRACK_INSERTED);
+  event.type = GNUNET_FSUI_upload_completed;
   event.data.UploadCompleted.uc.pos = utc;
   event.data.UploadCompleted.uc.cctx = utc->cctx;
   event.data.UploadCompleted.uc.ppos = utc->parent;
@@ -478,8 +478,8 @@
   if (utc->child != NULL)
     UNLINK (filename);
   GNUNET_free (filename);
-  GE_free_context (ee);
-  GE_memory_free (mem);
+  GNUNET_GE_free_context (ee);
+  GNUNET_GE_memory_free (mem);
   return NULL;
 }
 
@@ -487,24 +487,24 @@
  * Thread that does the upload.
  */
 static void *
-FSUI_uploadThreadEvent (void *cls)
+GNUNET_FSUI_uploadThreadEvent (void *cls)
 {
-  FSUI_UploadList *utc = cls;
+  GNUNET_FSUI_UploadList *utc = cls;
 
   if (utc->parent == &utc->shared->ctx->activeUploads)
     {
       /* top-level call: signal client! */
       signalUploadStarted (utc, 1);
     }
-  return FSUI_uploadThread (utc);
+  return GNUNET_FSUI_uploadThread (utc);
 }
 
 
 static void
-freeUploadList (struct FSUI_UploadList *ul)
+freeUploadList (struct GNUNET_FSUI_UploadList *ul)
 {
-  struct FSUI_UploadList *next;
-  struct FSUI_Context *ctx;
+  struct GNUNET_FSUI_UploadList *next;
+  struct GNUNET_FSUI_Context *ctx;
 
   ctx = ul->shared->ctx;
   while (ul->child != NULL)
@@ -512,16 +512,16 @@
   GNUNET_mutex_lock (ctx->lock);
   GNUNET_free (ul->filename);
   if (ul->keywords != NULL)
-    ECRS_freeUri (ul->keywords);
+    GNUNET_ECRS_uri_destroy (ul->keywords);
   if (ul->uri != NULL)
-    ECRS_freeUri (ul->uri);
+    GNUNET_ECRS_uri_destroy (ul->uri);
   if (ul->meta != NULL)
-    ECRS_freeMetaData (ul->meta);
+    GNUNET_ECRS_meta_data_destroy (ul->meta);
   /* unlink from parent */
   next = ul->parent->child;
   if (next == NULL)
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       GNUNET_mutex_unlock (ctx->lock);
       return;
     }
@@ -536,7 +536,7 @@
           next = next->next;
           if (next == NULL)
             {
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               GNUNET_mutex_unlock (ctx->lock);
               return;
             }
@@ -547,43 +547,43 @@
   GNUNET_mutex_unlock (ctx->lock);
 }
 
-static struct FSUI_UploadList *addUploads (struct FSUI_UploadShared *shared,
+static struct GNUNET_FSUI_UploadList *addUploads (struct 
GNUNET_FSUI_UploadShared *shared,
                                            const char *filename,
-                                           const struct ECRS_URI *keywords,
-                                           const struct ECRS_MetaData *md,
-                                           struct FSUI_UploadList *parent);
+                                           const struct GNUNET_ECRS_URI 
*keywords,
+                                           const struct GNUNET_ECRS_MetaData 
*md,
+                                           struct GNUNET_FSUI_UploadList 
*parent);
 
 static int
 addChildUpload (const char *name, const char *dirName, void *data)
 {
-  struct FSUI_UploadList *parent = data;
+  struct GNUNET_FSUI_UploadList *parent = data;
   char *filename;
-  struct FSUI_UploadList *child;
-  struct ECRS_MetaData *md;
+  struct GNUNET_FSUI_UploadList *child;
+  struct GNUNET_ECRS_MetaData *md;
 
   filename = GNUNET_malloc (strlen (dirName) + strlen (name) + 2);
   strcpy (filename, dirName);
   strcat (filename, DIR_SEPARATOR_STR);
   strcat (filename, name);
-  md = ECRS_createMetaData ();
+  md = GNUNET_ECRS_meta_data_create ();
   child = addUploads (parent->shared, filename, NULL, md, parent);
   GNUNET_free (filename);
-  ECRS_freeMetaData (md);
+  GNUNET_ECRS_meta_data_destroy (md);
   if (child == NULL)
     return GNUNET_SYSERR;
   parent->total += child->total;
   return GNUNET_OK;
 }
 
-static struct FSUI_UploadList *
-addUploads (struct FSUI_UploadShared *shared,
+static struct GNUNET_FSUI_UploadList *
+addUploads (struct GNUNET_FSUI_UploadShared *shared,
             const char *filename,
-            const struct ECRS_URI *keywords,
-            const struct ECRS_MetaData *md, struct FSUI_UploadList *parent)
+            const struct GNUNET_ECRS_URI *keywords,
+            const struct GNUNET_ECRS_MetaData *md, struct 
GNUNET_FSUI_UploadList *parent)
 {
-  FSUI_UploadList *utc;
+  GNUNET_FSUI_UploadList *utc;
 
-  utc = GNUNET_malloc (sizeof (FSUI_UploadList));
+  utc = GNUNET_malloc (sizeof (GNUNET_FSUI_UploadList));
   utc->completed = 0;
   utc->total = 0;               /* to be set later */
   utc->start_time = GNUNET_get_time ();
@@ -593,7 +593,7 @@
   utc->parent = parent;
   utc->uri = NULL;
   utc->cctx = NULL;             /* to be set later */
-  utc->state = FSUI_ACTIVE;
+  utc->state = GNUNET_FSUI_ACTIVE;
   if (GNUNET_YES == GNUNET_disk_file_test (shared->ctx->ectx, filename))
     {
       /* add this file */
@@ -604,7 +604,7 @@
           GNUNET_free (utc);
           return NULL;
         }
-      utc->meta = ECRS_dupMetaData (md);
+      utc->meta = GNUNET_ECRS_meta_data_duplicate (md);
     }
   else
     {
@@ -617,12 +617,12 @@
           GNUNET_free (utc);
           return NULL;
         }
-      utc->meta = ECRS_dupMetaData (md);
-      ECRS_addToMetaData (utc->meta,
+      utc->meta = GNUNET_ECRS_meta_data_duplicate (md);
+      GNUNET_ECRS_meta_data_inser (utc->meta,
                           EXTRACTOR_MIMETYPE, GNUNET_DIRECTORY_MIME);
     }
   if (keywords != NULL)
-    utc->keywords = ECRS_dupUri (keywords);
+    utc->keywords = GNUNET_ECRS_uri_duplicate (keywords);
   else
     utc->keywords = NULL;
   utc->filename = GNUNET_strdup (filename);
@@ -636,14 +636,14 @@
 }
 
 static void
-signalUploadStopped (struct FSUI_UploadList *ul, int first_only)
+signalUploadStopped (struct GNUNET_FSUI_UploadList *ul, int first_only)
 {
-  FSUI_Event event;
+  GNUNET_FSUI_Event event;
 
   while (ul != NULL)
     {
       signalUploadStopped (ul->child, 0);
-      event.type = FSUI_upload_stopped;
+      event.type = GNUNET_FSUI_upload_stopped;
       event.data.UploadStopped.uc.pos = ul;
       event.data.UploadStopped.uc.cctx = ul->cctx;
       event.data.UploadStopped.uc.ppos = ul->parent;
@@ -656,10 +656,10 @@
 }
 
 static void
-freeShared (struct FSUI_UploadShared *shared)
+freeShared (struct GNUNET_FSUI_UploadShared *shared)
 {
   if (shared->global_keywords != NULL)
-    ECRS_freeUri (shared->global_keywords);
+    GNUNET_ECRS_uri_destroy (shared->global_keywords);
   EXTRACTOR_removeAll (shared->extractors);
   GNUNET_free_non_null (shared->extractor_config);
   GNUNET_free (shared);
@@ -675,10 +675,10 @@
  *  GNUNET_SYSERR if the file does not exist or gnunetd is not
  *  running
  */
-struct FSUI_UploadList *
-FSUI_startUpload (struct FSUI_Context *ctx,
+struct GNUNET_FSUI_UploadList *
+GNUNET_FSUI_upload_star (struct GNUNET_FSUI_Context *ctx,
                   const char *filename,
-                  DirectoryScanCallback dsc,
+                  GNUNET_FSUI_DirectoryScanCallback dsc,
                   void *dscClosure,
                   unsigned int anonymityLevel,
                   unsigned int priority,
@@ -686,23 +686,23 @@
                   int doExtract,
                   int individualKeywords,
                   GNUNET_CronTime expiration,
-                  const struct ECRS_MetaData *md,
-                  const struct ECRS_URI *globalURI,
-                  const struct ECRS_URI *keyUri)
+                  const struct GNUNET_ECRS_MetaData *md,
+                  const struct GNUNET_ECRS_URI *globalURI,
+                  const struct GNUNET_ECRS_URI *keyUri)
 {
   char *config;
   EXTRACTOR_ExtractorList *extractors;
-  struct FSUI_UploadShared *shared;
-  struct FSUI_UploadList *ul;
+  struct GNUNET_FSUI_UploadShared *shared;
+  struct GNUNET_FSUI_UploadList *ul;
 
   config = NULL;
   extractors = NULL;
   if (doExtract)
     {
       extractors = EXTRACTOR_loadDefaultLibraries ();
-      if (GC_have_configuration_value (ctx->cfg, "FS", "EXTRACTORS"))
+      if (GNUNET_GC_have_configuration_value (ctx->cfg, "FS", "EXTRACTORS"))
         {
-          GC_get_configuration_value_string (ctx->cfg,
+          GNUNET_GC_get_configuration_value_string (ctx->cfg,
                                              "FS",
                                              "EXTRACTORS", NULL, &config);
           if (config != NULL)
@@ -711,7 +711,7 @@
             }
         }
     }
-  shared = GNUNET_malloc (sizeof (FSUI_UploadShared));
+  shared = GNUNET_malloc (sizeof (GNUNET_FSUI_UploadShared));
   shared->dsc = dsc;
   shared->dscClosure = dscClosure;
   shared->extractors = extractors;
@@ -719,7 +719,7 @@
   shared->ctx = ctx;
   shared->handle = NULL;
   shared->global_keywords =
-    globalURI != NULL ? ECRS_dupUri (globalURI) : NULL;
+    globalURI != NULL ? GNUNET_ECRS_uri_duplicate (globalURI) : NULL;
   shared->extractor_config = config;
   shared->doIndex = doIndex;
   shared->anonymityLevel = anonymityLevel;
@@ -733,16 +733,16 @@
       return NULL;
     }
   shared->handle =
-    GNUNET_thread_create (&FSUI_uploadThreadEvent, ul, 128 * 1024);
+    GNUNET_thread_create (&GNUNET_FSUI_uploadThreadEvent, ul, 128 * 1024);
   if (shared->handle == NULL)
     {
-      GE_LOG_STRERROR (ctx->ectx,
-                       GE_ERROR | GE_USER | GE_BULK, "PTHREAD_CREATE");
+      GNUNET_GE_LOG_STRERROR (ctx->ectx,
+                       GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_BULK, 
"PTHREAD_CREATE");
       freeUploadList (ul);
       freeShared (shared);
       return NULL;
     }
-  GE_ASSERT (ctx->ectx, ul->shared == shared);
+  GNUNET_GE_ASSERT (ctx->ectx, ul->shared == shared);
   return ul;
 }
 
@@ -756,31 +756,31 @@
  * @return GNUNET_SYSERR on error
  */
 int
-FSUI_abortUpload (struct FSUI_Context *ctx, struct FSUI_UploadList *ul)
+GNUNET_FSUI_upload_abort (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_UploadList *ul)
 {
-  FSUI_UploadList *c;
+  GNUNET_FSUI_UploadList *c;
 
-  GE_ASSERT (ctx->ectx, ul != NULL);
-  if ((ul->state != FSUI_ACTIVE) && (ul->state != FSUI_PENDING))
+  GNUNET_GE_ASSERT (ctx->ectx, ul != NULL);
+  if ((ul->state != GNUNET_FSUI_ACTIVE) && (ul->state != GNUNET_FSUI_PENDING))
     return GNUNET_NO;
-  if (ul->state == FSUI_ACTIVE)
+  if (ul->state == GNUNET_FSUI_ACTIVE)
     {
-      ul->state = FSUI_ABORTED;
+      ul->state = GNUNET_FSUI_ABORTED;
       c = ul->child;
       while (c != NULL)
         {
-          FSUI_abortUpload (ctx, c);
+          GNUNET_FSUI_upload_abort (ctx, c);
           c = c->next;
         }
       GNUNET_thread_stop_sleep (ul->shared->handle);
     }
   else
     {
-      ul->state = FSUI_ABORTED_JOINED;
+      ul->state = GNUNET_FSUI_ABORTED_JOINED;
       c = ul->child;
       while (c != NULL)
         {
-          FSUI_abortUpload (ctx, c);
+          GNUNET_FSUI_upload_abort (ctx, c);
           c = c->next;
         }
     }
@@ -794,28 +794,28 @@
  * @return GNUNET_SYSERR on error
  */
 int
-FSUI_stopUpload (struct FSUI_Context *ctx, struct FSUI_UploadList *ul)
+GNUNET_FSUI_upload_stop (struct GNUNET_FSUI_Context *ctx, struct 
GNUNET_FSUI_UploadList *ul)
 {
   void *unused;
-  struct FSUI_UploadShared *shared;
+  struct GNUNET_FSUI_UploadShared *shared;
 
-  GE_ASSERT (ctx->ectx, ul != NULL);
-  GE_ASSERT (ctx->ectx, ul->parent == &ctx->activeUploads);
-  if ((ul->state == FSUI_ACTIVE) ||
-      (ul->state == FSUI_COMPLETED) ||
-      (ul->state == FSUI_ABORTED) || (ul->state == FSUI_ERROR))
+  GNUNET_GE_ASSERT (ctx->ectx, ul != NULL);
+  GNUNET_GE_ASSERT (ctx->ectx, ul->parent == &ctx->activeUploads);
+  if ((ul->state == GNUNET_FSUI_ACTIVE) ||
+      (ul->state == GNUNET_FSUI_COMPLETED) ||
+      (ul->state == GNUNET_FSUI_ABORTED) || (ul->state == GNUNET_FSUI_ERROR))
     {
-      GE_ASSERT (ctx->ectx, ul->shared->handle != NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, ul->shared->handle != NULL);
       GNUNET_thread_join (ul->shared->handle, &unused);
       ul->shared->handle = NULL;
-      if (ul->state == FSUI_ACTIVE)
-        ul->state = FSUI_PENDING;
+      if (ul->state == GNUNET_FSUI_ACTIVE)
+        ul->state = GNUNET_FSUI_PENDING;
       else
         ul->state++;            /* add _JOINED */
     }
   else
     {
-      GE_ASSERT (ctx->ectx, ul->shared->handle == NULL);
+      GNUNET_GE_ASSERT (ctx->ectx, ul->shared->handle == NULL);
     }
   signalUploadStopped (ul, 1);
   shared = ul->shared;

Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/lib/fslib.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -32,17 +32,17 @@
 
 #define DEBUG_FSLIB GNUNET_NO
 
-typedef struct FS_SEARCH_HANDLE
+typedef struct GNUNET_FS_SearchHandle
 {
   CS_fs_request_search_MESSAGE *req;
-  Datum_Iterator callback;
+  GNUNET_DatastoreValueIterator callback;
   void *closure;
 } SEARCH_HANDLE;
 
-typedef struct FS_SEARCH_CONTEXT
+typedef struct GNUNET_FS_SearchContext
 {
-  struct GC_Configuration *cfg;
-  struct GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_GE_Context *ectx;
   struct GNUNET_ClientServerConnection *sock;
   struct GNUNET_ThreadHandle *thread;
   struct GNUNET_Mutex *lock;
@@ -81,8 +81,8 @@
       if (GNUNET_OK == GNUNET_client_connection_read (ctx->sock, &hdr))
         {
 #if DEBUG_FSLIB
-          GE_LOG (ctx->ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ctx->ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "FSLIB: received message from gnunetd\n");
 #endif
           delay = 100 * GNUNET_CRON_MILLISECONDS;
@@ -90,9 +90,9 @@
              signal protocol problem; if ok, find
              matching callback, call on value */
           if ((ntohs (hdr->size) < sizeof (CS_fs_reply_content_MESSAGE)) ||
-              (ntohs (hdr->type) != CS_PROTO_gap_RESULT))
+              (ntohs (hdr->type) != GNUNET_CS_PROTO_GAP_RESULT))
             {
-              GE_BREAK (ctx->ectx, 0);
+              GNUNET_GE_BREAK (ctx->ectx, 0);
               GNUNET_free (hdr);
               continue;
             }
@@ -101,7 +101,7 @@
           if (GNUNET_OK != getQueryFor (size, (DBlock *) & rep[1], GNUNET_NO,  
 /* gnunetd will have checked already */
                                         &query))
             {
-              GE_BREAK (ctx->ectx, 0);
+              GNUNET_GE_BREAK (ctx->ectx, 0);
               GNUNET_free (hdr);
               continue;
             }
@@ -113,13 +113,13 @@
                   memcmp (&query, &ctx->handles[i]->req->query[0],
                           sizeof (GNUNET_HashCode)))
                 {
-                  Datastore_Value *value;
+                  GNUNET_DatastoreValue *value;
 
                   matched++;
                   if (ctx->handles[i]->callback != NULL)
                     {
-                      value = GNUNET_malloc (sizeof (Datastore_Value) + size);
-                      value->size = htonl (size + sizeof (Datastore_Value));
+                      value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + 
size);
+                      value->size = htonl (size + sizeof 
(GNUNET_DatastoreValue));
                       value->type = htonl (getTypeOfBlock (size,
                                                            (DBlock *) &
                                                            rep[1]));
@@ -144,16 +144,16 @@
           GNUNET_mutex_unlock (ctx->lock);
 #if DEBUG_FSLIB
           if (matched == 0)
-            GE_LOG (ctx->ectx,
-                    GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_LOG (ctx->ectx,
+                    GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                     "FSLIB: received content but have no pending request\n");
 #endif
         }
       else
         {
 #if DEBUG_FSLIB
-          GE_LOG (ctx->ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ctx->ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "FSLIB: error communicating with gnunetd; sleeping for 
%ums\n",
                   delay);
 #endif
@@ -169,13 +169,13 @@
 }
 
 SEARCH_CONTEXT *
-FS_SEARCH_makeContext (struct GE_Context * ectx,
-                       struct GC_Configuration * cfg,
+GNUNET_FS_create_search_context (struct GNUNET_GE_Context * ectx,
+                       struct GNUNET_GC_Configuration * cfg,
                        struct GNUNET_Mutex * lock)
 {
   SEARCH_CONTEXT *ret;
 
-  GE_ASSERT (ectx, lock != NULL);
+  GNUNET_GE_ASSERT (ectx, lock != NULL);
   ret = GNUNET_malloc (sizeof (SEARCH_CONTEXT));
   ret->ectx = ectx;
   ret->cfg = cfg;
@@ -192,17 +192,17 @@
   ret->abort = GNUNET_NO;
   ret->thread = GNUNET_thread_create (&processReplies, ret, 128 * 1024);
   if (ret->thread == NULL)
-    GE_DIE_STRERROR (ectx, GE_FATAL | GE_ADMIN | GE_BULK, "PTHREAD_CREATE");
+    GNUNET_GE_DIE_STRERROR (ectx, GNUNET_GE_FATAL | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "PTHREAD_CREATE");
   return ret;
 }
 
 void
-FS_SEARCH_destroyContext (struct FS_SEARCH_CONTEXT *ctx)
+GNUNET_FS_destroy_search_context (struct GNUNET_FS_SearchContext *ctx)
 {
   void *unused;
 
   GNUNET_mutex_lock (ctx->lock);
-  GE_ASSERT (ctx->ectx, ctx->handleCount == 0);
+  GNUNET_GE_ASSERT (ctx->ectx, ctx->handleCount == 0);
   ctx->abort = GNUNET_YES;
   GNUNET_client_connection_close_forever (ctx->sock);
   GNUNET_mutex_unlock (ctx->lock);
@@ -225,14 +225,14 @@
  * @param prio priority to use for the search
  */
 SEARCH_HANDLE *
-FS_start_search (SEARCH_CONTEXT * ctx,
+GNUNET_FS_start_search (SEARCH_CONTEXT * ctx,
                  const GNUNET_PeerIdentity * target,
                  unsigned int type,
                  unsigned int keyCount,
                  const GNUNET_HashCode * keys,
                  unsigned int anonymityLevel,
                  unsigned int prio,
-                 GNUNET_CronTime timeout, Datum_Iterator callback,
+                 GNUNET_CronTime timeout, GNUNET_DatastoreValueIterator 
callback,
                  void *closure)
 {
   SEARCH_HANDLE *ret;
@@ -243,8 +243,8 @@
 
   ret = GNUNET_malloc (sizeof (SEARCH_HANDLE));
 #if DEBUG_FSLIB
-  GE_LOG (ctx->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER, "FSLIB: start search (%p)\n", ret);
+  GNUNET_GE_LOG (ctx->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "FSLIB: start 
search (%p)\n", ret);
 #endif
   req =
     GNUNET_malloc (sizeof (CS_fs_request_search_MESSAGE) +
@@ -252,7 +252,7 @@
   req->header.size =
     htons (sizeof (CS_fs_request_search_MESSAGE) +
            (keyCount - 1) * sizeof (GNUNET_HashCode));
-  req->header.type = htons (CS_PROTO_gap_QUERY_START);
+  req->header.type = htons (GNUNET_CS_PROTO_GAP_QUERY_START);
   req->prio = htonl (prio);
   req->anonymityLevel = htonl (anonymityLevel);
   req->expiration = GNUNET_htonll (timeout);
@@ -275,20 +275,20 @@
   GNUNET_mutex_unlock (ctx->lock);
 #if DEBUG_FSLIB
   IF_GELOG (ctx->ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&req->query[0], &enc));
-  GE_LOG (ctx->ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ctx->ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
           "FSLIB: initiating search for `%s' of type %u\n", &enc, type);
 #endif
-  GE_ASSERT (NULL, ctx->sock != NULL);
+  GNUNET_GE_ASSERT (NULL, ctx->sock != NULL);
   if (GNUNET_OK != GNUNET_client_connection_write (ctx->sock, &req->header))
     {
-      FS_stop_search (ctx, ret);
+      GNUNET_FS_stop_search (ctx, ret);
       return NULL;
     }
 #if DEBUG_FSLIB
-  GE_LOG (ctx->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ctx->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FSLIB: search started (%p)\n", ret);
 #endif
   return ret;
@@ -298,22 +298,22 @@
  * Stop searching.
  */
 void
-FS_stop_search (SEARCH_CONTEXT * ctx, SEARCH_HANDLE * handle)
+GNUNET_FS_stop_search (SEARCH_CONTEXT * ctx, SEARCH_HANDLE * handle)
 {
   int i;
 
 #if DEBUG_FSLIB
-  GE_LOG (ctx->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ctx->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FSLIB: stop search (%p)\n", handle);
 #endif
-  handle->req->header.type = htons (CS_PROTO_gap_QUERY_STOP);
-  GE_ASSERT (NULL, ctx->sock != NULL);
+  handle->req->header.type = htons (GNUNET_CS_PROTO_GAP_QUERY_STOP);
+  GNUNET_GE_ASSERT (NULL, ctx->sock != NULL);
   if (GNUNET_OK !=
       GNUNET_client_connection_write (ctx->sock, &handle->req->header))
     {
-      GE_LOG (ctx->ectx,
-              GE_WARNING | GE_REQUEST | GE_DEVELOPER,
+      GNUNET_GE_LOG (ctx->ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
               "FSLIB: failed to request stop search with gnunetd\n");
     }
   GNUNET_mutex_lock (ctx->lock);
@@ -326,8 +326,8 @@
   GNUNET_mutex_unlock (ctx->lock);
   GNUNET_free (handle->req);
 #if DEBUG_FSLIB
-  GE_LOG (ctx->ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ctx->ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FSLIB: search stopped (%p)\n", handle);
 #endif
   GNUNET_free (handle);
@@ -338,13 +338,13 @@
  * in the routing table like?  Returns -1 on error.
  */
 int
-FS_getAveragePriority (struct GNUNET_ClientServerConnection *sock)
+GNUNET_FS_get_current_average_priority (struct GNUNET_ClientServerConnection 
*sock)
 {
   GNUNET_MessageHeader req;
   int ret;
 
   req.size = htons (sizeof (GNUNET_MessageHeader));
-  req.type = htons (CS_PROTO_gap_GET_AVG_PRIORITY);
+  req.type = htons (GNUNET_CS_PROTO_GAP_GET_AVG_PRIORITY);
   if (GNUNET_OK != GNUNET_client_connection_write (sock, &req))
     return -1;
   if (GNUNET_OK != GNUNET_client_connection_read_result (sock, &ret))
@@ -359,23 +359,23 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error, GNUNET_NO on 
transient error
  */
 int
-FS_insert (struct GNUNET_ClientServerConnection *sock,
-           const Datastore_Value * block)
+GNUNET_FS_insert (struct GNUNET_ClientServerConnection *sock,
+           const GNUNET_DatastoreValue * block)
 {
   int ret;
   CS_fs_request_insert_MESSAGE *ri;
   unsigned int size;
   int retry;
 
-  if (ntohl (block->size) <= sizeof (Datastore_Value))
+  if (ntohl (block->size) <= sizeof (GNUNET_DatastoreValue))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
-  size = ntohl (block->size) - sizeof (Datastore_Value);
+  size = ntohl (block->size) - sizeof (GNUNET_DatastoreValue);
   ri = GNUNET_malloc (sizeof (CS_fs_request_insert_MESSAGE) + size);
   ri->header.size = htons (sizeof (CS_fs_request_insert_MESSAGE) + size);
-  ri->header.type = htons (CS_PROTO_gap_INSERT);
+  ri->header.type = htons (GNUNET_CS_PROTO_GAP_INSERT);
   ri->prio = block->prio;
   ri->expiration = block->expirationTime;
   ri->anonymityLevel = block->anonymityLevel;
@@ -390,7 +390,7 @@
         }
       if (GNUNET_OK != GNUNET_client_connection_read_result (sock, &ret))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           GNUNET_free (ri);
           return GNUNET_SYSERR;
         }
@@ -404,7 +404,7 @@
  * Initialize to index a file
  */
 int
-FS_initIndex (struct GNUNET_ClientServerConnection *sock,
+GNUNET_FS_prepare_to_inde (struct GNUNET_ClientServerConnection *sock,
               const GNUNET_HashCode * fileHc, const char *fn)
 {
   int ret;
@@ -415,18 +415,18 @@
   fnSize = strlen (fn);
   fnSize = (fnSize + 7) & (~7); /* align */
   size = sizeof (CS_fs_request_init_index_MESSAGE) + fnSize;
-  GE_ASSERT (NULL, size < 65536);
+  GNUNET_GE_ASSERT (NULL, size < 65536);
   ri = GNUNET_malloc (size);
   memset (ri, 0, size);
   ri->header.size = htons (size);
-  ri->header.type = htons (CS_PROTO_gap_INIT_INDEX);
+  ri->header.type = htons (GNUNET_CS_PROTO_GAP_INIT_INDEX);
   ri->reserved = htonl (0);
   ri->fileId = *fileHc;
   memcpy (&ri[1], fn, strlen (fn));
 
 #if DEBUG_FSLIB
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Sending index initialization request to gnunetd\n");
 #endif
   if (GNUNET_OK != GNUNET_client_connection_write (sock, &ri->header))
@@ -436,8 +436,8 @@
     }
   GNUNET_free (ri);
 #if DEBUG_FSLIB
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Waiting for confirmation of index initialization request by 
gnunetd\n");
 #endif
   if (GNUNET_OK != GNUNET_client_connection_read_result (sock, &ret))
@@ -454,19 +454,19 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-FS_index (struct GNUNET_ClientServerConnection *sock,
+GNUNET_FS_index (struct GNUNET_ClientServerConnection *sock,
           const GNUNET_HashCode * fileHc,
-          const Datastore_Value * block, unsigned long long offset)
+          const GNUNET_DatastoreValue * block, unsigned long long offset)
 {
   int ret;
   CS_fs_request_index_MESSAGE *ri;
   unsigned int size;
   int retry;
 
-  size = ntohl (block->size) - sizeof (Datastore_Value);
+  size = ntohl (block->size) - sizeof (GNUNET_DatastoreValue);
   ri = GNUNET_malloc (sizeof (CS_fs_request_index_MESSAGE) + size);
   ri->header.size = htons (sizeof (CS_fs_request_index_MESSAGE) + size);
-  ri->header.type = htons (CS_PROTO_gap_INDEX);
+  ri->header.type = htons (GNUNET_CS_PROTO_GAP_INDEX);
   ri->prio = block->prio;
   ri->expiration = block->expirationTime;
   ri->anonymityLevel = block->anonymityLevel;
@@ -474,8 +474,8 @@
   ri->fileOffset = GNUNET_htonll (offset);
   memcpy (&ri[1], &block[1], size);
 #if DEBUG_FSLIB
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Sending index request to gnunetd\n");
 #endif
   retry = AUTO_RETRY;
@@ -487,8 +487,8 @@
           return GNUNET_SYSERR;
         }
 #if DEBUG_FSLIB
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Waiting for confirmation of index request by gnunetd\n");
 #endif
       if (GNUNET_OK != GNUNET_client_connection_read_result (sock, &ret))
@@ -504,25 +504,25 @@
 
 /**
  * Delete a block.  The arguments are the same as the ones for
- * FS_insert.
+ * GNUNET_FS_insert.
  *
  * @param block the block (properly encoded and all)
  * @return number of items deleted on success,
  *    GNUNET_SYSERR on error
  */
 int
-FS_delete (struct GNUNET_ClientServerConnection *sock,
-           const Datastore_Value * block)
+GNUNET_FS_delete (struct GNUNET_ClientServerConnection *sock,
+           const GNUNET_DatastoreValue * block)
 {
   int ret;
   CS_fs_request_delete_MESSAGE *rd;
   unsigned int size;
   int retry;
 
-  size = ntohl (block->size) - sizeof (Datastore_Value);
+  size = ntohl (block->size) - sizeof (GNUNET_DatastoreValue);
   rd = GNUNET_malloc (sizeof (CS_fs_request_delete_MESSAGE) + size);
   rd->header.size = htons (sizeof (CS_fs_request_delete_MESSAGE) + size);
-  rd->header.type = htons (CS_PROTO_gap_DELETE);
+  rd->header.type = htons (GNUNET_CS_PROTO_GAP_DELETE);
   memcpy (&rd[1], &block[1], size);
   retry = AUTO_RETRY;
   do
@@ -530,12 +530,12 @@
       if (GNUNET_OK != GNUNET_client_connection_write (sock, &rd->header))
         {
           GNUNET_free (rd);
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           return GNUNET_SYSERR;
         }
       if (GNUNET_OK != GNUNET_client_connection_read_result (sock, &ret))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           GNUNET_free (rd);
           return GNUNET_SYSERR;
         }
@@ -552,14 +552,14 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-FS_unindex (struct GNUNET_ClientServerConnection *sock,
+GNUNET_FS_unindex (struct GNUNET_ClientServerConnection *sock,
             unsigned int blocksize, const GNUNET_HashCode * hc)
 {
   int ret;
   CS_fs_request_unindex_MESSAGE ru;
 
   ru.header.size = htons (sizeof (CS_fs_request_unindex_MESSAGE));
-  ru.header.type = htons (CS_PROTO_gap_UNINDEX);
+  ru.header.type = htons (GNUNET_CS_PROTO_GAP_UNINDEX);
   ru.blocksize = htonl (blocksize);
   ru.fileId = *hc;
   if (GNUNET_OK != GNUNET_client_connection_write (sock, &ru.header))
@@ -576,14 +576,14 @@
  * @return GNUNET_YES if so, GNUNET_NO if not, GNUNET_SYSERR on error
  */
 int
-FS_testIndexed (struct GNUNET_ClientServerConnection *sock,
+GNUNET_FS_test_indexed (struct GNUNET_ClientServerConnection *sock,
                 const GNUNET_HashCode * hc)
 {
   RequestTestindex ri;
   int ret;
 
   ri.header.size = htons (sizeof (RequestTestindex));
-  ri.header.type = htons (CS_PROTO_gap_TESTINDEX);
+  ri.header.type = htons (GNUNET_CS_PROTO_GAP_TESTINDEX);
   ri.reserved = htonl (0);
   ri.fileId = *hc;
   if (GNUNET_OK != GNUNET_client_connection_write (sock, &ri.header))

Modified: GNUnet/src/applications/fs/lib/fslibtest.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslibtest.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/lib/fslibtest.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -32,7 +32,7 @@
 #include "gnunet_protocols.h"
 #include "ecrs_core.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(NULL, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto 
FAILURE; }
 
 static struct GNUNET_CronManager *cron;
 
@@ -40,40 +40,40 @@
 
 static struct GNUNET_ThreadHandle *mainThread;
 
-static Datastore_Value *
+static GNUNET_DatastoreValue *
 makeBlock (int i)
 {
-  Datastore_Value *block;
+  GNUNET_DatastoreValue *block;
   DBlock *db;
 
-  block = GNUNET_malloc (sizeof (Datastore_Value) + sizeof (DBlock) + i);
-  block->size = htonl (sizeof (Datastore_Value) + sizeof (DBlock) + i);
-  block->type = htonl (D_BLOCK);
+  block = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + sizeof (DBlock) + i);
+  block->size = htonl (sizeof (GNUNET_DatastoreValue) + sizeof (DBlock) + i);
+  block->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   block->prio = htonl (0);
   block->anonymityLevel = htonl (0);
   block->expirationTime = GNUNET_htonll (now + 1 * GNUNET_CRON_HOURS);
   db = (DBlock *) & block[1];
-  db->type = htonl (D_BLOCK);
+  db->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   memset (&db[1], i + (i / 253), i);
   return block;
 }
 
-static Datastore_Value *
+static GNUNET_DatastoreValue *
 makeKBlock (unsigned int i, const GNUNET_HashCode * key,
             GNUNET_HashCode * query)
 {
-  Datastore_Value *block;
+  GNUNET_DatastoreValue *block;
   KBlock *db;
   struct GNUNET_RSA_PrivateKey *kkey;
 
-  block = GNUNET_malloc (sizeof (Datastore_Value) + sizeof (KBlock) + i);
-  block->size = htonl (sizeof (Datastore_Value) + sizeof (KBlock) + i);
-  block->type = htonl (K_BLOCK);
+  block = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + sizeof (KBlock) + i);
+  block->size = htonl (sizeof (GNUNET_DatastoreValue) + sizeof (KBlock) + i);
+  block->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
   block->prio = htonl (0);
   block->anonymityLevel = htonl (0);
   block->expirationTime = GNUNET_htonll (now + 1 * GNUNET_CRON_HOURS);
   db = (KBlock *) & block[1];
-  db->type = htonl (K_BLOCK);
+  db->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
   memset (&db[1], i + (i / 253), i);
   kkey = GNUNET_RSA_create_key_from_hash (key);
   GNUNET_RSA_sign (kkey, i, &db[1], &db->signature);
@@ -104,7 +104,7 @@
  */
 static int
 countCallback (const GNUNET_HashCode * key,
-               const Datastore_Value * value, void *cls)
+               const GNUNET_DatastoreValue * value, void *cls)
 {
   int *cnt = cls;
   (*cnt)--;
@@ -117,26 +117,26 @@
 
 static int
 searchResultCB (const GNUNET_HashCode * key,
-                const Datastore_Value * value, TSC * cls)
+                const GNUNET_DatastoreValue * value, TSC * cls)
 {
   GNUNET_HashCode ekey;
-  Datastore_Value *blk;
-  Datastore_Value *eblk;
+  GNUNET_DatastoreValue *blk;
+  GNUNET_DatastoreValue *eblk;
   int ret;
 
   blk = makeBlock (cls->i);
   fileBlockGetQuery ((DBlock *) & blk[1],
-                     ntohl (blk->size) - sizeof (Datastore_Value), &ekey);
-  GE_ASSERT (NULL, GNUNET_OK ==
+                     ntohl (blk->size) - sizeof (GNUNET_DatastoreValue), 
&ekey);
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK ==
              fileBlockEncode ((DBlock *) & blk[1],
-                              ntohl (blk->size) - sizeof (Datastore_Value),
+                              ntohl (blk->size) - sizeof 
(GNUNET_DatastoreValue),
                               &ekey, &eblk));
   if ((0 == memcmp (&ekey,
                     key, sizeof (GNUNET_HashCode))) &&
       (value->size == blk->size) &&
       (0 == memcmp (&value[1],
                     &eblk[1],
-                    ntohl (value->size) - sizeof (Datastore_Value))))
+                    ntohl (value->size) - sizeof (GNUNET_DatastoreValue))))
     {
       cls->found = GNUNET_YES;
       GNUNET_semaphore_up (cls->sem);
@@ -144,7 +144,7 @@
     }
   else
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       printf ("Received unexpected result.\n");
       ret = GNUNET_OK;
     }
@@ -154,36 +154,36 @@
 }
 
 static int
-trySearch (struct FS_SEARCH_CONTEXT *ctx, int i)
+trySearch (struct GNUNET_FS_SearchContext *ctx, int i)
 {
-  struct FS_SEARCH_HANDLE *handle;
+  struct GNUNET_FS_SearchHandle *handle;
   GNUNET_CronTime now;
   GNUNET_HashCode query;
   TSC closure;
-  Datastore_Value *dv;
+  GNUNET_DatastoreValue *dv;
   DBlock *db;
 
   dv = makeBlock (i);
   db = (DBlock *) & dv[1];
-  fileBlockGetQuery (db, ntohl (dv->size) - sizeof (Datastore_Value), &query);
+  fileBlockGetQuery (db, ntohl (dv->size) - sizeof (GNUNET_DatastoreValue), 
&query);
   GNUNET_free (dv);
   closure.found = GNUNET_NO;
   closure.i = i;
   closure.sem = GNUNET_semaphore_create (0);
   now = GNUNET_get_time ();
-  handle = FS_start_search (ctx,
+  handle = GNUNET_FS_start_search (ctx,
                             NULL,
-                            D_BLOCK,
+                            GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA,
                             1,
                             &query,
                             0,
                             0,
                             now + 30 * GNUNET_CRON_SECONDS,
-                            (Datum_Iterator) & searchResultCB, &closure);
+                            (GNUNET_DatastoreValueIterator) & searchResultCB, 
&closure);
   GNUNET_cron_add_job (cron, &abortSem, 30 * GNUNET_CRON_SECONDS, 0,
                        closure.sem);
   GNUNET_semaphore_down (closure.sem, GNUNET_YES);
-  FS_stop_search (ctx, handle);
+  GNUNET_FS_stop_search (ctx, handle);
   GNUNET_cron_suspend_jobs (cron, GNUNET_NO);
   GNUNET_cron_del_job (cron, &abortSem, 0, closure.sem);
   GNUNET_cron_resume_jobs (cron, GNUNET_NO);
@@ -200,42 +200,42 @@
   pid_t daemon;
 #endif
   int ok;
-  struct FS_SEARCH_CONTEXT *ctx = NULL;
-  struct FS_SEARCH_HANDLE *hnd;
+  struct GNUNET_FS_SearchContext *ctx = NULL;
+  struct GNUNET_FS_SearchHandle *hnd;
   struct GNUNET_Mutex *lock;
   struct GNUNET_ClientServerConnection *sock;
-  Datastore_Value *block;
-  Datastore_Value *eblock;
+  GNUNET_DatastoreValue *block;
+  GNUNET_DatastoreValue *eblock;
   GNUNET_HashCode hc;
   GNUNET_HashCode query;
   int i;
   char *tmpName;
   int fd;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   now = GNUNET_get_time ();
   cron = cron_create (NULL);
 #if START_DAEMON
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
 #endif
   ok = GNUNET_YES;
   GNUNET_cron_start (cron);
   lock = GNUNET_mutex_create (GNUNET_NO);
-  GE_ASSERT (NULL,
+  GNUNET_GE_ASSERT (NULL,
              GNUNET_OK == GNUNET_wait_for_daemon_running (NULL, cfg,
                                                           60 *
                                                           
GNUNET_CRON_SECONDS));
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
   sock = GNUNET_client_connection_create (NULL, cfg);
   CHECK (sock != NULL);
-  ctx = FS_SEARCH_makeContext (NULL, cfg, lock);
+  ctx = GNUNET_FS_create_search_context (NULL, cfg, lock);
   CHECK (ctx != NULL);
 
   /* ACTUAL TEST CODE */
@@ -244,37 +244,37 @@
       fprintf (stderr, ".");
       block = makeBlock (i);
       fileBlockGetQuery ((DBlock *) & block[1],
-                         ntohl (block->size) - sizeof (Datastore_Value),
+                         ntohl (block->size) - sizeof (GNUNET_DatastoreValue),
                          &query);
       CHECK (GNUNET_OK == fileBlockEncode ((DBlock *) & block[1],
                                            ntohl (block->size) -
-                                           sizeof (Datastore_Value), &query,
+                                           sizeof (GNUNET_DatastoreValue), 
&query,
                                            &eblock));
       eblock->expirationTime = block->expirationTime;
       eblock->prio = block->prio;
-      CHECK (GNUNET_OK == FS_insert (sock, eblock));
+      CHECK (GNUNET_OK == GNUNET_FS_insert (sock, eblock));
       CHECK (GNUNET_OK == trySearch (ctx, i));
-      CHECK (GNUNET_SYSERR != FS_delete (sock, eblock));
+      CHECK (GNUNET_SYSERR != GNUNET_FS_delete (sock, eblock));
       GNUNET_free (eblock);
       GNUNET_hash (&((DBlock *) & block[1])[1],
-                   ntohl (block->size) - sizeof (Datastore_Value) -
+                   ntohl (block->size) - sizeof (GNUNET_DatastoreValue) -
                    sizeof (DBlock), &hc);
       /* indexing without symlink */
-      CHECK (GNUNET_OK == FS_index (sock, &hc, block, 0));
+      CHECK (GNUNET_OK == GNUNET_FS_index (sock, &hc, block, 0));
       CHECK (GNUNET_OK == trySearch (ctx, i));
-      CHECK (GNUNET_OK == FS_unindex (sock, GNUNET_MAX_BUFFER_SIZE, &hc));
+      CHECK (GNUNET_OK == GNUNET_FS_unindex (sock, GNUNET_MAX_BUFFER_SIZE, 
&hc));
       /* indexing with symlink */
       tmpName = GNUNET_strdup ("/tmp/symlinkTestXXXXXX");
       CHECK (-1 != (fd = mkstemp (tmpName)));
       CHECK (-1 != WRITE (fd,
                           &((DBlock *) & block[1])[1],
-                          ntohl (block->size) - sizeof (Datastore_Value) -
+                          ntohl (block->size) - sizeof (GNUNET_DatastoreValue) 
-
                           sizeof (DBlock)));
       CLOSE (fd);
-      CHECK (FS_initIndex (sock, &hc, tmpName) == GNUNET_YES);
-      CHECK (GNUNET_OK == FS_index (sock, &hc, block, 0));
+      CHECK (GNUNET_FS_prepare_to_inde (sock, &hc, tmpName) == GNUNET_YES);
+      CHECK (GNUNET_OK == GNUNET_FS_index (sock, &hc, block, 0));
       CHECK (GNUNET_OK == trySearch (ctx, i));
-      CHECK (GNUNET_OK == FS_unindex (sock, GNUNET_MAX_BUFFER_SIZE, &hc));
+      CHECK (GNUNET_OK == GNUNET_FS_unindex (sock, GNUNET_MAX_BUFFER_SIZE, 
&hc));
       UNLINK (tmpName);
       GNUNET_free (tmpName);
       GNUNET_free (block);
@@ -285,24 +285,24 @@
       fprintf (stderr, ".");
       block = makeBlock (i);
       fileBlockGetQuery ((DBlock *) & block[1],
-                         ntohl (block->size) - sizeof (Datastore_Value),
+                         ntohl (block->size) - sizeof (GNUNET_DatastoreValue),
                          &query);
       CHECK (GNUNET_OK == fileBlockEncode ((DBlock *) & block[1],
                                            ntohl (block->size) -
-                                           sizeof (Datastore_Value), &query,
+                                           sizeof (GNUNET_DatastoreValue), 
&query,
                                            &eblock));
       eblock->expirationTime = block->expirationTime;
       eblock->prio = block->prio;
-      CHECK (GNUNET_OK == FS_insert (sock, eblock));
+      CHECK (GNUNET_OK == GNUNET_FS_insert (sock, eblock));
       CHECK (GNUNET_OK == trySearch (ctx, i));
-      CHECK (1 == FS_delete (sock, eblock));
+      CHECK (1 == GNUNET_FS_delete (sock, eblock));
       GNUNET_free (eblock);
       GNUNET_hash (&((DBlock *) & block[1])[1],
-                   ntohl (block->size) - sizeof (Datastore_Value) -
+                   ntohl (block->size) - sizeof (GNUNET_DatastoreValue) -
                    sizeof (DBlock), &hc);
-      CHECK (GNUNET_OK == FS_index (sock, &hc, block, 0));
+      CHECK (GNUNET_OK == GNUNET_FS_index (sock, &hc, block, 0));
       CHECK (GNUNET_OK == trySearch (ctx, i));
-      CHECK (GNUNET_OK == FS_unindex (sock, GNUNET_MAX_BUFFER_SIZE, &hc));
+      CHECK (GNUNET_OK == GNUNET_FS_unindex (sock, GNUNET_MAX_BUFFER_SIZE, 
&hc));
       GNUNET_free (block);
     }
   fprintf (stderr, "\n");
@@ -310,43 +310,43 @@
   /* multiple search results test */
   GNUNET_create_random_hash (&hc);
   block = makeKBlock (40, &hc, &query);
-  CHECK (GNUNET_OK == FS_insert (sock, block));
+  CHECK (GNUNET_OK == GNUNET_FS_insert (sock, block));
   GNUNET_free (block);
   block = makeKBlock (60, &hc, &query);
-  CHECK (GNUNET_OK == FS_insert (sock, block));
+  CHECK (GNUNET_OK == GNUNET_FS_insert (sock, block));
   GNUNET_free (block);
   i = 2;
   mainThread = GNUNET_thread_get_self ();
-  hnd = FS_start_search (ctx,
+  hnd = GNUNET_FS_start_search (ctx,
                          NULL,
-                         ANY_BLOCK,
+                         GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
                          1,
                          &query, 0, 0, 10 * GNUNET_CRON_SECONDS,
                          &countCallback, &i);
   CHECK (hnd != NULL);
   GNUNET_thread_sleep (10 * GNUNET_CRON_SECONDS);
-  FS_stop_search (ctx, hnd);
+  GNUNET_FS_stop_search (ctx, hnd);
   GNUNET_thread_release_self (mainThread);
   CHECK (i <= 0);
 
 
   /* just to check if it crashes... */
-  FS_getAveragePriority (sock);
+  GNUNET_FS_get_current_average_priority (sock);
   /* END OF TEST CODE */
 
 FAILURE:
   fprintf (stderr, "\n");
   if (ctx != NULL)
-    FS_SEARCH_destroyContext (ctx);
+    GNUNET_FS_destroy_search_context (ctx);
   if (sock != NULL)
     GNUNET_client_connection_destroy (sock);
   GNUNET_mutex_destroy (lock);
   GNUNET_cron_stop (cron);
   GNUNET_cron_destroy (cron);
 #if START_DAEMON
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/module/anonymity.c
===================================================================
--- GNUnet/src/applications/fs/module/anonymity.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/anonymity.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -35,7 +35,7 @@
  * with anonymity and GAP messages).  So we should
  * probably move it below the callback by passing
  * the anonymity level along.  But that would
- * require changing the DataProcessor somewhat,
+ * require changing the GNUNET_DataProcessor somewhat,
  * which would also be ugly.  So to keep things
  * simple, we do the anonymity-level check for
  * outgoing content right here.
@@ -43,8 +43,8 @@
  * @return GNUNET_OK if cover traffic is sufficient
  */
 int
-checkCoverTraffic (struct GE_Context *ectx,
-                   Traffic_ServiceAPI * traffic, unsigned int level)
+checkCoverTraffic (struct GNUNET_GE_Context *ectx,
+                   GNUNET_Traffic_ServiceAPI * traffic, unsigned int level)
 {
   unsigned int count;
   unsigned int peers;
@@ -56,13 +56,13 @@
   level--;
   if (traffic == NULL)
     return GNUNET_SYSERR;
-  if (GNUNET_OK != traffic->get (5 * GNUNET_CRON_SECONDS / TRAFFIC_TIME_UNIT,  
 /* TTL_DECREMENT/TTU */
-                                 P2P_PROTO_gap_RESULT,
-                                 TC_RECEIVED, &count, &peers, &sizes,
+  if (GNUNET_OK != traffic->get (5 * GNUNET_CRON_SECONDS / 
GNUNET_TRAFFIC_TIME_UNIT,   /* TTL_DECREMENT/TTU */
+                                 GNUNET_P2P_PROTO_GAP_RESULT,
+                                 GNUNET_TRAFFIC_TYPE_RECEIVED, &count, &peers, 
&sizes,
                                  &timevect))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Failed to get traffic stats.\n"));
       return GNUNET_SYSERR;
     }
@@ -70,16 +70,16 @@
     {
       if (peers < level / 1000)
         {
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Not enough cover traffic to satisfy anonymity requirements 
(%u, %u peers). "
                   "Result dropped.\n", level, peers);
           return GNUNET_SYSERR;
         }
       if (count < level % 1000)
         {
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Not enough cover traffic to satisfy anonymity requirements 
(%u, %u messages). "
                   "Result dropped.\n", level, count);
           return GNUNET_SYSERR;
@@ -89,8 +89,8 @@
     {
       if (count < level)
         {
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Not enough cover traffic to satisfy anonymity requirements 
(%u, %u messages). "
                   "Result dropped.\n", level, count);
           return GNUNET_SYSERR;

Modified: GNUnet/src/applications/fs/module/anonymity.h
===================================================================
--- GNUnet/src/applications/fs/module/anonymity.h       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/anonymity.h       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -36,14 +36,14 @@
  * with anonymity and GAP messages).  So we should
  * probably move it below the callback by passing
  * the anonymity level along.  But that would
- * require changing the DataProcessor somewhat,
+ * require changing the GNUNET_DataProcessor somewhat,
  * which would also be ugly.  So to keep things
  * simple, we do the anonymity-level check for
  * outgoing content right here.
  *
  * @return GNUNET_OK if cover traffic is sufficient
  */
-int checkCoverTraffic (struct GE_Context *ectx,
-                       Traffic_ServiceAPI * traffic, unsigned int level);
+int checkCoverTraffic (struct GNUNET_GE_Context *ectx,
+                       GNUNET_Traffic_ServiceAPI * traffic, unsigned int 
level);
 
 #endif

Modified: GNUnet/src/applications/fs/module/dht_push.c
===================================================================
--- GNUnet/src/applications/fs/module/dht_push.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/dht_push.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -43,17 +43,17 @@
 /**
  * DHT service.  Set to NULL to terminate
  */
-static DHT_ServiceAPI *dht;
+static GNUNET_DHT_ServiceAPI *dht;
 
 /**
  * Global core API.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * SQStore service.
  */
-static SQstore_ServiceAPI *sqstore;
+static GNUNET_SQstore_ServiceAPI *sqstore;
 
 
 /**
@@ -68,14 +68,14 @@
  */
 static int total;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_push_count;
 
 
 static int
 push_callback (const GNUNET_HashCode * key,
-               const Datastore_Value * value, void *closure,
+               const GNUNET_DatastoreValue * value, void *closure,
                unsigned long long uid)
 {
   GNUNET_CronTime delay;
@@ -94,7 +94,7 @@
     return GNUNET_SYSERR;
   dht->put (key,
             ntohl (value->type),
-            ntohl (value->size) - sizeof (Datastore_Value),
+            ntohl (value->size) - sizeof (GNUNET_DatastoreValue),
             GNUNET_ntohll (value->expirationTime), (const char *) &value[1]);
   if (stats != NULL)
     stats->change (stat_push_count, 1);
@@ -122,14 +122,14 @@
  * Initialize the migration module.
  */
 void
-init_dht_push (CoreAPIForApplication * capi, DHT_ServiceAPI * d)
+init_dht_push (GNUNET_CoreAPIForPlugins * capi, GNUNET_DHT_ServiceAPI * d)
 {
   coreAPI = capi;
   dht = d;
   sqstore = capi->requestService ("sqstore");
   if (sqstore == NULL)
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       return;
     }
   stats = capi->requestService ("stats");

Modified: GNUnet/src/applications/fs/module/dht_push.h
===================================================================
--- GNUnet/src/applications/fs/module/dht_push.h        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/dht_push.h        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,7 +34,7 @@
 /**
  * Initialize the migration module.
  */
-void init_dht_push (CoreAPIForApplication * capi, DHT_ServiceAPI * s);
+void init_dht_push (GNUNET_CoreAPIForPlugins * capi, GNUNET_DHT_ServiceAPI * 
s);
 
 void done_dht_push (void);
 

Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/fs/module/fs.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -47,7 +47,7 @@
 
 typedef struct
 {
-  struct DHT_GET_RECORD *rec;
+  struct GNUNET_DHT_GetHandle *rec;
   unsigned int prio;
 } DHT_GET_CLS;
 
@@ -62,32 +62,32 @@
 /**
  * Global core API.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * GAP service.
  */
-static GAP_ServiceAPI *gap;
+static GNUNET_GAP_ServiceAPI *gap;
 
 /**
  * DHT service.  Maybe NULL!
  */
-static DHT_ServiceAPI *dht;
+static GNUNET_DHT_ServiceAPI *dht;
 
 /**
  * Datastore service.
  */
-static Datastore_ServiceAPI *datastore;
+static GNUNET_Datastore_ServiceAPI *datastore;
 
 /**
  * Traffic service.
  */
-static Traffic_ServiceAPI *traffic;
+static GNUNET_Traffic_ServiceAPI *traffic;
 
 /**
  * Stats service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_expired_replies_dropped;
 
@@ -103,12 +103,12 @@
 
 static LG_Job *lg_jobs;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static Datastore_Value *
-gapWrapperToDatastoreValue (const DataContainer * value, int prio)
+static GNUNET_DatastoreValue *
+gapWrapperToDatastoreValue (const GNUNET_DataContainer * value, int prio)
 {
-  Datastore_Value *dv;
+  GNUNET_DatastoreValue *dv;
   const GapWrapper *gw;
   unsigned int size;
   GNUNET_CronTime et;
@@ -116,14 +116,14 @@
 
   if (ntohl (value->size) < sizeof (GapWrapper))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   gw = (const GapWrapper *) value;
-  size = ntohl (gw->dc.size) - sizeof (GapWrapper) + sizeof (Datastore_Value);
+  size = ntohl (gw->dc.size) - sizeof (GapWrapper) + sizeof 
(GNUNET_DatastoreValue);
   dv = GNUNET_malloc (size);
   dv->size = htonl (size);
-  dv->type = htonl (getTypeOfBlock (size - sizeof (Datastore_Value),
+  dv->type = htonl (getTypeOfBlock (size - sizeof (GNUNET_DatastoreValue),
                                     (DBlock *) & gw[1]));
   dv->prio = htonl (prio);
   dv->anonymityLevel = htonl (0);
@@ -137,7 +137,7 @@
       et += now;
     }
   dv->expirationTime = GNUNET_htonll (et);
-  memcpy (&dv[1], &gw[1], size - sizeof (Datastore_Value));
+  memcpy (&dv[1], &gw[1], size - sizeof (GNUNET_DatastoreValue));
   return dv;
 }
 
@@ -155,9 +155,9 @@
 static int
 gapPut (void *closure,
         const GNUNET_HashCode * query,
-        const DataContainer * value, unsigned int prio)
+        const GNUNET_DataContainer * value, unsigned int prio)
 {
-  Datastore_Value *dv;
+  GNUNET_DatastoreValue *dv;
   const GapWrapper *gw;
   unsigned int size;
   int ret;
@@ -173,22 +173,22 @@
                                  GNUNET_YES, &hc))
       || (0 != memcmp (&hc, query, sizeof (GNUNET_HashCode))))
     {
-      GE_BREAK_OP (ectx, 0);    /* value failed verification! */
+      GNUNET_GE_BREAK_OP (ectx, 0);    /* value failed verification! */
       return GNUNET_SYSERR;
     }
   dv = gapWrapperToDatastoreValue (value, prio);
   if (dv == NULL)
     {
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;
     }
   if (GNUNET_YES != isDatumApplicable (ntohl (dv->type),
                                        ntohl (dv->size) -
-                                       sizeof (Datastore_Value),
+                                       sizeof (GNUNET_DatastoreValue),
                                        (const DBlock *) &dv[1], &hc, 0,
                                        query))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       GNUNET_free (dv);
       return GNUNET_SYSERR;
     }
@@ -200,7 +200,7 @@
          _except_ if it is pure content that one
          of our clients has requested -- then we
          should ignore expiration */
-      if (ntohl (dv->type) == D_BLOCK)
+      if (ntohl (dv->type) == GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA)
         processResponse (query, dv);
       else if (stats != NULL)
         stats->change (stat_expired_replies_dropped, 1);
@@ -212,9 +212,9 @@
 
 
 #if DEBUG_FS
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received GAP-PUT request (query: `%s')\n", &enc);
 #endif
   if (migration)
@@ -229,7 +229,7 @@
 
 static int
 get_result_callback (const GNUNET_HashCode * query,
-                     const DataContainer * value, void *ctx)
+                     const GNUNET_DataContainer * value, void *ctx)
 {
   DHT_GET_CLS *cls = ctx;
   const GapWrapper *gw;
@@ -238,9 +238,9 @@
 #if DEBUG_FS
   GNUNET_EncName enc;
 
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Found reply to query `%s'.\n", &enc);
 #endif
   gw = (const GapWrapper *) value;
@@ -250,7 +250,7 @@
                                  GNUNET_YES, &hc))
       || (0 != memcmp (&hc, query, sizeof (GNUNET_HashCode))))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_OK;
     }
 
@@ -272,7 +272,7 @@
  * @return GNUNET_SYSERR if the TCP connection should be closed, otherwise 
GNUNET_OK
  */
 static int
-csHandleRequestQueryStop (struct ClientHandle *sock,
+csHandleRequestQueryStop (struct GNUNET_ClientHandle *sock,
                           const GNUNET_MessageHeader * req)
 {
   const CS_fs_request_search_MESSAGE *rs;
@@ -282,15 +282,15 @@
 
   if (ntohs (req->size) < sizeof (CS_fs_request_search_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   rs = (const CS_fs_request_search_MESSAGE *) req;
 #if DEBUG_FS
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&rs->query[0], &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received QUERY STOP (query: `%s')\n", &enc);
 #endif
   gap->get_stop (ntohl (rs->type),
@@ -307,12 +307,12 @@
  * @return GNUNET_SYSERR if the TCP connection should be closed, otherwise 
GNUNET_OK
  */
 static int
-csHandleCS_fs_request_insert_MESSAGE (struct ClientHandle *sock,
+csHandleCS_fs_request_insert_MESSAGE (struct GNUNET_ClientHandle *sock,
                                       const GNUNET_MessageHeader * req)
 {
   const CS_fs_request_insert_MESSAGE *ri;
-  Datastore_Value *datum;
-  struct GE_Context *cectx;
+  GNUNET_DatastoreValue *datum;
+  struct GNUNET_GE_Context *cectx;
   GNUNET_HashCode query;
   int ret;
   unsigned int type;
@@ -321,21 +321,21 @@
 #endif
 
   cectx =
-    coreAPI->createClientLogContext (GE_USER | GE_EVENTKIND | GE_ROUTEKIND,
+    coreAPI->createClientLogContext (GNUNET_GE_USER | GNUNET_GE_EVENTKIND | 
GNUNET_GE_ROUTEKIND,
                                      sock);
   if (ntohs (req->size) < sizeof (CS_fs_request_insert_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
   ri = (const CS_fs_request_insert_MESSAGE *) req;
-  datum = GNUNET_malloc (sizeof (Datastore_Value) +
+  datum = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) +
                          ntohs (req->size) -
                          sizeof (CS_fs_request_insert_MESSAGE));
   datum->size =
-    htonl (sizeof (Datastore_Value) + ntohs (req->size) -
+    htonl (sizeof (GNUNET_DatastoreValue) + ntohs (req->size) -
            sizeof (CS_fs_request_insert_MESSAGE));
   datum->expirationTime = ri->expiration;
   datum->prio = ri->prio;
@@ -345,10 +345,10 @@
                    sizeof (CS_fs_request_insert_MESSAGE),
                    (const DBlock *) &ri[1], GNUNET_YES, &query))
     {
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
       GNUNET_free (datum);
-      GE_free_context (cectx);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
   type =
@@ -356,9 +356,9 @@
                     sizeof (CS_fs_request_insert_MESSAGE),
                     (const DBlock *) &ri[1]);
 #if DEBUG_FS
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received REQUEST INSERT (query: `%s', type: %u, priority %u)\n",
           &enc, type, ntohl (ri->prio));
 #endif
@@ -366,7 +366,7 @@
   memcpy (&datum[1],
           &ri[1], ntohs (req->size) - sizeof (CS_fs_request_insert_MESSAGE));
   GNUNET_mutex_lock (lock);
-  if ((type != D_BLOCK) || (0 == datastore->get (&query, type, NULL, NULL)))
+  if ((type != GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA) || (0 == datastore->get 
(&query, type, NULL, NULL)))
     ret = datastore->put (&query, datum);
   else
     ret = GNUNET_OK;
@@ -404,7 +404,7 @@
                                      &hc))
           || (0 != memcmp (&hc, &query, sizeof (GNUNET_HashCode))))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
         }
       else
         {
@@ -413,7 +413,7 @@
       GNUNET_free (gw);
     }
   GNUNET_free (datum);
-  GE_free_context (cectx);
+  GNUNET_GE_free_context (cectx);
   return coreAPI->sendValueToClient (sock, ret);
 }
 
@@ -421,23 +421,23 @@
  * Process a request to symlink a file
  */
 static int
-csHandleCS_fs_request_init_index_MESSAGE (struct ClientHandle *sock,
+csHandleCS_fs_request_init_index_MESSAGE (struct GNUNET_ClientHandle *sock,
                                           const GNUNET_MessageHeader * req)
 {
   int ret;
   char *fn;
   CS_fs_request_init_index_MESSAGE *ri;
   int fnLen;
-  struct GE_Context *cectx;
+  struct GNUNET_GE_Context *cectx;
 
   cectx =
-    coreAPI->createClientLogContext (GE_USER | GE_EVENTKIND | GE_ROUTEKIND,
+    coreAPI->createClientLogContext (GNUNET_GE_USER | GNUNET_GE_EVENTKIND | 
GNUNET_GE_ROUTEKIND,
                                      sock);
   if (ntohs (req->size) < sizeof (CS_fs_request_init_index_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
 
@@ -447,8 +447,8 @@
 #if WINDOWS
   if (fnLen > _MAX_PATH)
     {
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
 #endif
@@ -459,12 +459,12 @@
 
   GNUNET_free (fn);
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Sending confirmation (%s) of index initialization request to 
client\n",
           ret == GNUNET_OK ? "success" : "failure");
 #endif
-  GE_free_context (cectx);
+  GNUNET_GE_free_context (cectx);
   return coreAPI->sendValueToClient (sock, ret);
 }
 
@@ -474,21 +474,21 @@
  * @return GNUNET_SYSERR if the TCP connection should be closed, otherwise 
GNUNET_OK
  */
 static int
-csHandleCS_fs_request_index_MESSAGE (struct ClientHandle *sock,
+csHandleCS_fs_request_index_MESSAGE (struct GNUNET_ClientHandle *sock,
                                      const GNUNET_MessageHeader * req)
 {
   int ret;
   const CS_fs_request_index_MESSAGE *ri;
-  struct GE_Context *cectx;
+  struct GNUNET_GE_Context *cectx;
 
   cectx =
-    coreAPI->createClientLogContext (GE_USER | GE_EVENTKIND | GE_ROUTEKIND,
+    coreAPI->createClientLogContext (GNUNET_GE_USER | GNUNET_GE_EVENTKIND | 
GNUNET_GE_ROUTEKIND,
                                      sock);
   if (ntohs (req->size) < sizeof (CS_fs_request_index_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
   ri = (const CS_fs_request_index_MESSAGE *) req;
@@ -503,12 +503,12 @@
                         sizeof (CS_fs_request_index_MESSAGE),
                         (const DBlock *) &ri[1]);
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Sending confirmation (%s) of index request to client\n",
           ret == GNUNET_OK ? "success" : "failure");
 #endif
-  GE_free_context (cectx);
+  GNUNET_GE_free_context (cectx);
   return coreAPI->sendValueToClient (sock, ret);
 }
 
@@ -520,19 +520,19 @@
  */
 static int
 completeValue (const GNUNET_HashCode * key,
-               const Datastore_Value * value, void *closure,
+               const GNUNET_DatastoreValue * value, void *closure,
                unsigned long long uid)
 {
-  Datastore_Value *comp = closure;
+  GNUNET_DatastoreValue *comp = closure;
 
   if ((comp->size != value->size) ||
       (0 != memcmp (&value[1],
                     &comp[1],
-                    ntohl (value->size) - sizeof (Datastore_Value))))
+                    ntohl (value->size) - sizeof (GNUNET_DatastoreValue))))
     {
 #if DEBUG_FS
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "`%s' found value that does not match (%u, %u).\n",
               __FUNCTION__, ntohl (comp->size), ntohl (value->size));
 #endif
@@ -540,8 +540,8 @@
     }
   *comp = *value;               /* make copy! */
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' found value that matches.\n", __FUNCTION__);
 #endif
   return GNUNET_SYSERR;
@@ -553,35 +553,35 @@
  * @return GNUNET_SYSERR if the TCP connection should be closed, otherwise 
GNUNET_OK
  */
 static int
-csHandleCS_fs_request_delete_MESSAGE (struct ClientHandle *sock,
+csHandleCS_fs_request_delete_MESSAGE (struct GNUNET_ClientHandle *sock,
                                       const GNUNET_MessageHeader * req)
 {
   int ret;
   const CS_fs_request_delete_MESSAGE *rd;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   GNUNET_HashCode query;
   unsigned int type;
 #if DEBUG_FS
   GNUNET_EncName enc;
 #endif
-  struct GE_Context *cectx;
+  struct GNUNET_GE_Context *cectx;
 
   cectx =
-    coreAPI->createClientLogContext (GE_USER | GE_EVENTKIND | GE_ROUTEKIND,
+    coreAPI->createClientLogContext (GNUNET_GE_USER | GNUNET_GE_EVENTKIND | 
GNUNET_GE_ROUTEKIND,
                                      sock);
   if (ntohs (req->size) < sizeof (CS_fs_request_delete_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
   rd = (const CS_fs_request_delete_MESSAGE *) req;
-  value = GNUNET_malloc (sizeof (Datastore_Value) +
+  value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) +
                          ntohs (req->size) -
                          sizeof (CS_fs_request_delete_MESSAGE));
   value->size =
-    ntohl (sizeof (Datastore_Value) + ntohs (req->size) -
+    ntohl (sizeof (GNUNET_DatastoreValue) + ntohs (req->size) -
            sizeof (CS_fs_request_delete_MESSAGE));
   type =
     getTypeOfBlock (ntohs (rd->header.size) -
@@ -596,15 +596,15 @@
                    (const DBlock *) &rd[1], GNUNET_NO, &query))
     {
       GNUNET_free (value);
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
 #if DEBUG_FS
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received REQUEST DELETE (query: `%s', type: %u)\n", &enc, type);
 #endif
   GNUNET_mutex_lock (lock);
@@ -615,12 +615,12 @@
   GNUNET_mutex_unlock (lock);
   GNUNET_free (value);
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Sending confirmation (%s) of delete request to client\n",
           ret != GNUNET_SYSERR ? "success" : "failure");
 #endif
-  GE_free_context (cectx);
+  GNUNET_GE_free_context (cectx);
   return coreAPI->sendValueToClient (sock, ret);
 }
 
@@ -628,31 +628,31 @@
  * Process a client request unindex content.
  */
 static int
-csHandleCS_fs_request_unindex_MESSAGE (struct ClientHandle *sock,
+csHandleCS_fs_request_unindex_MESSAGE (struct GNUNET_ClientHandle *sock,
                                        const GNUNET_MessageHeader * req)
 {
   int ret;
   const CS_fs_request_unindex_MESSAGE *ru;
-  struct GE_Context *cectx;
+  struct GNUNET_GE_Context *cectx;
 
   cectx =
-    coreAPI->createClientLogContext (GE_USER | GE_EVENTKIND | GE_ROUTEKIND,
+    coreAPI->createClientLogContext (GNUNET_GE_USER | GNUNET_GE_EVENTKIND | 
GNUNET_GE_ROUTEKIND,
                                      sock);
   if (ntohs (req->size) != sizeof (CS_fs_request_unindex_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
-      GE_BREAK (cectx, 0);
-      GE_free_context (cectx);
+      GNUNET_GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_free_context (cectx);
       return GNUNET_SYSERR;
     }
   ru = (const CS_fs_request_unindex_MESSAGE *) req;
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER, "FS received REQUEST UNINDEX\n");
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "FS received 
REQUEST UNINDEX\n");
 #endif
   ret = ONDEMAND_unindex (cectx,
                           datastore, ntohl (ru->blocksize), &ru->fileId);
-  GE_free_context (cectx);
+  GNUNET_GE_free_context (cectx);
   return coreAPI->sendValueToClient (sock, ret);
 }
 
@@ -661,7 +661,7 @@
  * data is indexed.
  */
 static int
-csHandleCS_fs_request_test_index_MESSAGEed (struct ClientHandle *sock,
+csHandleCS_fs_request_test_index_MESSAGEed (struct GNUNET_ClientHandle *sock,
                                             const GNUNET_MessageHeader * req)
 {
   int ret;
@@ -669,13 +669,13 @@
 
   if (ntohs (req->size) != sizeof (RequestTestindex))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   ru = (const RequestTestindex *) req;
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received REQUEST TESTINDEXED\n");
 #endif
   ret = ONDEMAND_testindexed (datastore, &ru->fileId);
@@ -687,12 +687,12 @@
  * averge priority.
  */
 static int
-csHandleRequestGetAvgPriority (struct ClientHandle *sock,
+csHandleRequestGetAvgPriority (struct GNUNET_ClientHandle *sock,
                                const GNUNET_MessageHeader * req)
 {
 #if DEBUG_FS
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received REQUEST GETAVGPRIORITY\n");
 #endif
   return coreAPI->sendValueToClient (sock, gap->getAvgPriority ());
@@ -703,7 +703,7 @@
  */
 typedef struct
 {
-  DataProcessor resultCallback;
+  GNUNET_DataProcessor resultCallback;
   void *resCallbackClosure;
   unsigned int keyCount;
   const GNUNET_HashCode *keys;
@@ -711,13 +711,13 @@
 } GGC;
 
 /**
- * Callback that converts the Datastore_Value values
- * from the datastore to Blockstore values for the
+ * Callback that converts the GNUNET_DatastoreValue values
+ * from the datastore to GNUNET_Blockstore values for the
  * gap routing protocol.
  */
 static int
 gapGetConverter (const GNUNET_HashCode * key,
-                 const Datastore_Value * invalue, void *cls,
+                 const GNUNET_DatastoreValue * invalue, void *cls,
                  unsigned long long uid)
 {
   GGC *ggc = (GGC *) cls;
@@ -726,8 +726,8 @@
   unsigned int size;
   GNUNET_CronTime et;
   GNUNET_CronTime now;
-  const Datastore_Value *value;
-  Datastore_Value *xvalue;
+  const GNUNET_DatastoreValue *value;
+  GNUNET_DatastoreValue *xvalue;
   unsigned int level;
   GNUNET_EncName enc;
 #if EXTRA_CHECKS
@@ -735,20 +735,20 @@
 #endif
 
 #if DEBUG_FS
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (key, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Converting reply for query `%s' for gap.\n", &enc);
 #endif
   et = GNUNET_ntohll (invalue->expirationTime);
   now = GNUNET_get_time ();
-  if ((et <= now) && (ntohl (invalue->type) != D_BLOCK))
+  if ((et <= now) && (ntohl (invalue->type) != 
GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA))
     {
       /* content expired and not just data -- drop! */
       return GNUNET_OK;
     }
 
-  if (ntohl (invalue->type) == ONDEMAND_BLOCK)
+  if (ntohl (invalue->type) == GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND)
     {
       if (GNUNET_OK != ONDEMAND_getIndexed (datastore, invalue, key, &xvalue))
         return GNUNET_SYSERR;
@@ -761,23 +761,23 @@
     }
 #if EXTRA_CHECKS
   if ((GNUNET_OK !=
-       getQueryFor (ntohl (value->size) - sizeof (Datastore_Value),
+       getQueryFor (ntohl (value->size) - sizeof (GNUNET_DatastoreValue),
                     (const DBlock *) &value[1], GNUNET_YES, &hc))
       || (!equalsGNUNET_HashCode (&hc, key)))
     {
-      GE_BREAK (ectx, 0);       /* value failed verification! */
+      GNUNET_GE_BREAK (ectx, 0);       /* value failed verification! */
       return GNUNET_SYSERR;
     }
 #endif
   ret = isDatumApplicable (ntohl (value->type),
-                           ntohl (value->size) - sizeof (Datastore_Value),
+                           ntohl (value->size) - sizeof 
(GNUNET_DatastoreValue),
                            (const DBlock *) &value[1],
                            key, ggc->keyCount, ggc->keys);
   if (ret == GNUNET_SYSERR)
     {
-      IF_GELOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      IF_GELOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (key, &enc));
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Converting reply for query `%s' for gap failed (datum not 
applicable).\n",
               &enc);
       GNUNET_free_non_null (xvalue);
@@ -785,9 +785,9 @@
     }
   if (ret == GNUNET_NO)
     {
-      IF_GELOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      IF_GELOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (key, &enc));
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Converting reply for query `%s' for gap failed (type not 
applicable).\n",
               &enc);
       GNUNET_free_non_null (xvalue);
@@ -795,7 +795,7 @@
                                    i.e., namespace request and namespace
                                    in reply does not match namespace in query 
*/
     }
-  size = sizeof (GapWrapper) + ntohl (value->size) - sizeof (Datastore_Value);
+  size = sizeof (GapWrapper) + ntohl (value->size) - sizeof 
(GNUNET_DatastoreValue);
 
   level = ntohl (value->anonymityLevel);
   if (GNUNET_OK != checkCoverTraffic (ectx, traffic, level))
@@ -804,9 +804,9 @@
          refuse to hand out data that requires
          anonymity! */
       GNUNET_free_non_null (xvalue);
-      IF_GELOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      IF_GELOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (key, &enc));
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               "Converting reply for query `%s' for gap failed (insufficient 
cover traffic).\n",
               &enc);
       return GNUNET_OK;
@@ -849,16 +849,16 @@
         unsigned int prio,
         unsigned int keyCount,
         const GNUNET_HashCode * keys,
-        DataProcessor resultCallback, void *resCallbackClosure)
+        GNUNET_DataProcessor resultCallback, void *resCallbackClosure)
 {
   int ret;
   GGC myClosure;
 #if DEBUG_FS
   GNUNET_EncName enc;
 
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&keys[0], &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "GAP requests content for `%s' of type %u\n", &enc, type);
 #endif
   myClosure.count = 0;
@@ -867,10 +867,10 @@
   myClosure.resultCallback = resultCallback;
   myClosure.resCallbackClosure = resCallbackClosure;
   ret = GNUNET_OK;
-  if (type == D_BLOCK)
+  if (type == GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA)
     {
       ret = datastore->get (&keys[0],
-                            ONDEMAND_BLOCK, &gapGetConverter, &myClosure);
+                            GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND, 
&gapGetConverter, &myClosure);
     }
   if (ret != GNUNET_SYSERR)
     ret = datastore->get (&keys[0], type, &gapGetConverter, &myClosure);
@@ -890,9 +890,9 @@
  */
 static int
 gapDel (void *closure, const GNUNET_HashCode * key,
-        const DataContainer * value)
+        const GNUNET_DataContainer * value)
 {
-  GE_BREAK (ectx, 0);           /* gap does not use 'del'! */
+  GNUNET_GE_BREAK (ectx, 0);           /* gap does not use 'del'! */
   return GNUNET_SYSERR;
 }
 
@@ -904,14 +904,14 @@
  * @return number of results, GNUNET_SYSERR on error
  */
 static int
-gapIterate (void *closure, DataProcessor processor, void *cls)
+gapIterate (void *closure, GNUNET_DataProcessor processor, void *cls)
 {
-  GE_BREAK (ectx, 0);           /* gap does not use 'iterate' */
+  GNUNET_GE_BREAK (ectx, 0);           /* gap does not use 'iterate' */
   return GNUNET_SYSERR;
 }
 
 static int
-replyHashFunction (const DataContainer * content, GNUNET_HashCode * id)
+replyHashFunction (const GNUNET_DataContainer * content, GNUNET_HashCode * id)
 {
   const GapWrapper *gw;
   unsigned int size;
@@ -919,7 +919,7 @@
   size = ntohl (content->size);
   if (size < sizeof (GapWrapper))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       memset (id, 0, sizeof (GNUNET_HashCode));
       return GNUNET_SYSERR;
     }
@@ -929,7 +929,7 @@
 }
 
 static int
-uniqueReplyIdentifier (const DataContainer * content,
+uniqueReplyIdentifier (const GNUNET_DataContainer * content,
                        unsigned int type,
                        int verify, const GNUNET_HashCode * primaryKey)
 {
@@ -941,7 +941,7 @@
   size = ntohl (content->size);
   if (size < sizeof (GapWrapper))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_NO;
     }
   gw = (const GapWrapper *) content;
@@ -951,13 +951,13 @@
                                  &q)) &&
       (0 == memcmp (&q,
                     primaryKey, sizeof (GNUNET_HashCode))) &&
-      ((type == ANY_BLOCK) ||
+      ((type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY) ||
        (type == (t = getTypeOfBlock (size - sizeof (GapWrapper),
                                      (const DBlock *) &gw[1])))))
     {
       switch (type)
         {
-        case D_BLOCK:
+        case GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA:
           return GNUNET_YES;
         default:
           return GNUNET_NO;
@@ -969,9 +969,9 @@
 
 static int
 fastPathProcessor (const GNUNET_HashCode * query,
-                   const DataContainer * value, void *cls)
+                   const GNUNET_DataContainer * value, void *cls)
 {
-  Datastore_Value *dv;
+  GNUNET_DatastoreValue *dv;
 
   dv = gapWrapperToDatastoreValue (value, 0);
   if (dv == NULL)
@@ -988,10 +988,10 @@
  */
 static int
 fastPathProcessorFirst (const GNUNET_HashCode * query,
-                        const DataContainer * value, void *cls)
+                        const GNUNET_DataContainer * value, void *cls)
 {
   int *done = cls;
-  Datastore_Value *dv;
+  GNUNET_DatastoreValue *dv;
 
   dv = gapWrapperToDatastoreValue (value, 0);
   if (dv == NULL)
@@ -1026,7 +1026,7 @@
       GNUNET_mutex_unlock (lock);
       gapGet (NULL,
               job->type,
-              EXTREME_PRIORITY,
+              GNUNET_EXTREME_PRIORITY,
               job->keyCount, job->queries, &fastPathProcessor, NULL);
       GNUNET_free (job->queries);
       GNUNET_free (job);
@@ -1057,7 +1057,7 @@
  * @return GNUNET_SYSERR if the TCP connection should be closed, otherwise 
GNUNET_OK
  */
 static int
-csHandleRequestQueryStart (struct ClientHandle *sock,
+csHandleRequestQueryStart (struct GNUNET_ClientHandle *sock,
                            const GNUNET_MessageHeader * req)
 {
   static GNUNET_PeerIdentity all_zeros;
@@ -1072,7 +1072,7 @@
 
   if (ntohs (req->size) < sizeof (CS_fs_request_search_MESSAGE))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   rs = (const CS_fs_request_search_MESSAGE *) req;
@@ -1082,9 +1082,9 @@
     have_target = GNUNET_YES;
 #if DEBUG_FS
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&rs->query[0], &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "FS received QUERY START (query: `%s', ttl %llu, priority %u, 
anonymity %u)\n",
           &enc, GNUNET_ntohll (rs->expiration) - GNUNET_get_time (),
           ntohl (rs->prio), ntohl (rs->anonymityLevel));
@@ -1099,13 +1099,13 @@
   done = GNUNET_NO;
   gapGet (NULL,
           type,
-          EXTREME_PRIORITY,
+          GNUNET_EXTREME_PRIORITY,
           keyCount, &rs->query[0], &fastPathProcessorFirst, &done);
   if (done == GNUNET_YES)
     {
 #if DEBUG_FS
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "FS successfully took GAP shortcut for `%s'.\n", &enc);
 #endif
       return GNUNET_OK;
@@ -1150,33 +1150,33 @@
  * @return GNUNET_SYSERR on errors
  */
 int
-initialize_module_fs (CoreAPIForApplication * capi)
+initialize_module_fs (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Blockstore dsGap;
+  static GNUNET_Blockstore dsGap;
   unsigned long long quota;
 
   ectx = capi->ectx;
-  GE_ASSERT (ectx, sizeof (CHK) == 128);
-  GE_ASSERT (ectx, sizeof (DBlock) == 4);
-  GE_ASSERT (ectx, sizeof (IBlock) == 132);
-  GE_ASSERT (ectx, sizeof (KBlock) == 524);
-  GE_ASSERT (ectx, sizeof (SBlock) == 724);
-  GE_ASSERT (ectx, sizeof (NBlock) == 716);
-  GE_ASSERT (ectx, sizeof (KNBlock) == 1244);
-  migration = GC_get_configuration_value_yesno (capi->cfg,
+  GNUNET_GE_ASSERT (ectx, sizeof (CHK) == 128);
+  GNUNET_GE_ASSERT (ectx, sizeof (DBlock) == 4);
+  GNUNET_GE_ASSERT (ectx, sizeof (IBlock) == 132);
+  GNUNET_GE_ASSERT (ectx, sizeof (KBlock) == 524);
+  GNUNET_GE_ASSERT (ectx, sizeof (SBlock) == 724);
+  GNUNET_GE_ASSERT (ectx, sizeof (NBlock) == 716);
+  GNUNET_GE_ASSERT (ectx, sizeof (KNBlock) == 1244);
+  migration = GNUNET_GC_get_configuration_value_yesno (capi->cfg,
                                                 "FS", "ACTIVEMIGRATION",
                                                 GNUNET_YES);
   if (migration == GNUNET_SYSERR)
     return GNUNET_SYSERR;
-  if (GC_get_configuration_value_number (capi->cfg,
+  if (GNUNET_GC_get_configuration_value_number (capi->cfg,
                                          "FS",
                                          "QUOTA",
                                          1,
                                          ((unsigned long long) -1) / 1024,
                                          1024, &quota) == -1)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("You must specify a postive number for `%s' in the 
configuration in section `%s'.\n"),
               "QUOTA", "FS");
@@ -1185,7 +1185,7 @@
   datastore = capi->requestService ("datastore");
   if (datastore == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   traffic = capi->requestService ("traffic");
@@ -1200,7 +1200,7 @@
   gap = capi->requestService ("gap");
   if (gap == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       capi->releaseService (datastore);
       if (stats != NULL)
         capi->releaseService (stats);
@@ -1213,7 +1213,7 @@
   ltgSignal = GNUNET_semaphore_create (0);
   localGetProcessor = GNUNET_thread_create (&localGetter, NULL, 128 * 1024);
   if (localGetProcessor == NULL)
-    GE_DIE_STRERROR (ectx, GE_ADMIN | GE_FATAL | GE_BULK, "pthread_create");
+    GNUNET_GE_DIE_STRERROR (ectx, GNUNET_GE_ADMIN | GNUNET_GE_FATAL | 
GNUNET_GE_BULK, "pthread_create");
   coreAPI = capi;
   ONDEMAND_init (capi);
   lock = GNUNET_mutex_create (GNUNET_NO);
@@ -1225,58 +1225,58 @@
   dsGap.fast_get = &fastGet;
   initQueryManager (capi);
   gap->init (&dsGap,
-             &uniqueReplyIdentifier, (ReplyHashFunction) & replyHashFunction);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+             &uniqueReplyIdentifier, (GNUNET_ReplyHashingCallback) & 
replyHashFunction);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering client handlers %d %d %d %d %d %d %d %d %d\n"),
           "fs",
-          CS_PROTO_gap_QUERY_START,
-          CS_PROTO_gap_QUERY_STOP,
-          CS_PROTO_gap_INSERT,
-          CS_PROTO_gap_INDEX,
-          CS_PROTO_gap_DELETE,
-          CS_PROTO_gap_UNINDEX,
-          CS_PROTO_gap_TESTINDEX,
-          CS_PROTO_gap_GET_AVG_PRIORITY, CS_PROTO_gap_INIT_INDEX);
+          GNUNET_CS_PROTO_GAP_QUERY_START,
+          GNUNET_CS_PROTO_GAP_QUERY_STOP,
+          GNUNET_CS_PROTO_GAP_INSERT,
+          GNUNET_CS_PROTO_GAP_INDEX,
+          GNUNET_CS_PROTO_GAP_DELETE,
+          GNUNET_CS_PROTO_GAP_UNINDEX,
+          GNUNET_CS_PROTO_GAP_TESTINDEX,
+          GNUNET_CS_PROTO_GAP_GET_AVG_PRIORITY, 
GNUNET_CS_PROTO_GAP_INIT_INDEX);
 
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_QUERY_START,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_QUERY_START,
                                           &csHandleRequestQueryStart));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_QUERY_STOP,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_QUERY_STOP,
                                           &csHandleRequestQueryStop));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_INSERT,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_INSERT,
                                           
&csHandleCS_fs_request_insert_MESSAGE));
-  GE_ASSERT (ectx,
-             GNUNET_SYSERR != capi->registerClientHandler (CS_PROTO_gap_INDEX,
+  GNUNET_GE_ASSERT (ectx,
+             GNUNET_SYSERR != capi->registerClientHandler 
(GNUNET_CS_PROTO_GAP_INDEX,
                                                            
&csHandleCS_fs_request_index_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_INIT_INDEX,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_INIT_INDEX,
                                           
&csHandleCS_fs_request_init_index_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_DELETE,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_DELETE,
                                           
&csHandleCS_fs_request_delete_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_UNINDEX,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_UNINDEX,
                                           
&csHandleCS_fs_request_unindex_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_TESTINDEX,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_TESTINDEX,
                                           
&csHandleCS_fs_request_test_index_MESSAGEed));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             capi->registerClientHandler (CS_PROTO_gap_GET_AVG_PRIORITY,
+             capi->registerClientHandler (GNUNET_CS_PROTO_GAP_GET_AVG_PRIORITY,
                                           &csHandleRequestGetAvgPriority));
   initMigration (capi, datastore, gap, dht, traffic);
-  GE_ASSERT (capi->ectx,
-             0 == GC_set_configuration_value_string (capi->cfg,
+  GNUNET_GE_ASSERT (capi->ectx,
+             0 == GNUNET_GC_set_configuration_value_string (capi->cfg,
                                                      capi->ectx,
                                                      "ABOUT",
                                                      "fs",
@@ -1291,43 +1291,43 @@
   LG_Job *job;
   void *unused;
 
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER, "fs shutdown\n");
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
"fs shutdown\n");
   doneMigration ();
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_QUERY_START,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_QUERY_START,
                                                &csHandleRequestQueryStart));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_QUERY_STOP,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_QUERY_STOP,
                                                &csHandleRequestQueryStop));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_INSERT,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_INSERT,
                                                
&csHandleCS_fs_request_insert_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_INDEX,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_INDEX,
                                                
&csHandleCS_fs_request_index_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_INIT_INDEX,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_INIT_INDEX,
                                                
&csHandleCS_fs_request_init_index_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_DELETE,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_DELETE,
                                                
&csHandleCS_fs_request_delete_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_UNINDEX,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_UNINDEX,
                                                
&csHandleCS_fs_request_unindex_MESSAGE));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_TESTINDEX,
+             coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GAP_TESTINDEX,
                                                
&csHandleCS_fs_request_test_index_MESSAGEed));
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
-             coreAPI->unregisterClientHandler (CS_PROTO_gap_GET_AVG_PRIORITY,
+             coreAPI->unregisterClientHandler 
(GNUNET_CS_PROTO_GAP_GET_AVG_PRIORITY,
                                                
&csHandleRequestGetAvgPriority));
   doneQueryManager ();
   while (lg_jobs != NULL)
@@ -1371,7 +1371,7 @@
  * Update FS module.
  */
 void
-update_module_fs (UpdateAPI * uapi)
+update_module_fs (GNUNET_UpdateAPI * uapi)
 {
   /* general sub-module updates */
   uapi->updateModule ("datastore");

Modified: GNUnet/src/applications/fs/module/migration.c
===================================================================
--- GNUnet/src/applications/fs/module/migration.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/migration.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -61,29 +61,29 @@
 /**
  * Datastore service.
  */
-static Datastore_ServiceAPI *datastore;
+static GNUNET_Datastore_ServiceAPI *datastore;
 
 /**
  * Global core API.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * GAP service.
  */
-static GAP_ServiceAPI *gap;
+static GNUNET_GAP_ServiceAPI *gap;
 
 /**
  * DHT service.  Maybe NULL!
  */
-static DHT_ServiceAPI *dht;
+static GNUNET_DHT_ServiceAPI *dht;
 
 /**
  * Traffic service.
  */
-static Traffic_ServiceAPI *traffic;
+static GNUNET_Traffic_ServiceAPI *traffic;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_migration_count;
 
@@ -98,7 +98,7 @@
 
 struct MigrationRecord
 {
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   GNUNET_HashCode key;
   unsigned int receiverIndices[MAX_RECEIVERS];
   unsigned int sentCount;
@@ -106,7 +106,7 @@
 
 static struct MigrationRecord content[MAX_RECORDS];
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 /**
  * Callback method for pushing content into the network.
@@ -134,8 +134,8 @@
   GNUNET_CronTime et;
   GNUNET_CronTime now;
   unsigned int anonymity;
-  Datastore_Value *enc;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *enc;
+  GNUNET_DatastoreValue *value;
   unsigned int index;
   int entry;
   int discard_entry;
@@ -174,7 +174,7 @@
         }
       match = 1;
       if (ntohl (content[i].value->size) + sizeof (GapWrapper) -
-          sizeof (Datastore_Value) <= padding)
+          sizeof (GNUNET_DatastoreValue) <= padding)
         {
           match = 0;
           for (j = 0; j < content[i].sentCount; j++)
@@ -232,8 +232,8 @@
   if (entry == -1)
     {
 #if DEBUG_MIGRATION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Migration: no content available for migration.\n");
 #endif
       GNUNET_mutex_unlock (lock);
@@ -242,16 +242,16 @@
   value = content[entry].value;
   if (value == NULL)
     {
-      GE_ASSERT (NULL, 0);
+      GNUNET_GE_ASSERT (NULL, 0);
       GNUNET_mutex_unlock (lock);
       return 0;
     }
-  size = sizeof (GapWrapper) + ntohl (value->size) - sizeof (Datastore_Value);
+  size = sizeof (GapWrapper) + ntohl (value->size) - sizeof 
(GNUNET_DatastoreValue);
   if (size > padding)
     {
 #if DEBUG_MIGRATION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Migration: available content too big (%u > %u) for 
migration.\n",
               size, padding);
 #endif
@@ -259,12 +259,12 @@
       return 0;
     }
 #if DEBUG_MIGRATION
-  GE_LOG (ectx,
-          GE_DEBUG | GE_BULK | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_BULK | GNUNET_GE_USER,
           "Migration: random lookup in datastore returned type %d.\n",
           ntohl (value->type));
 #endif
-  if (ntohl (value->type) == ONDEMAND_BLOCK)
+  if (ntohl (value->type) == GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND)
     {
       if (ONDEMAND_getIndexed (datastore,
                                value, &content[entry].key, &enc) != GNUNET_OK)
@@ -273,8 +273,8 @@
           content[entry].value = NULL;
           GNUNET_mutex_unlock (lock);
 #if DEBUG_MIGRATION
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Migration: failed to locate indexed content for 
migration.\n");
 #endif
           return 0;
@@ -286,13 +286,13 @@
       value = enc;
     }
 
-  size = sizeof (GapWrapper) + ntohl (value->size) - sizeof (Datastore_Value);
+  size = sizeof (GapWrapper) + ntohl (value->size) - sizeof 
(GNUNET_DatastoreValue);
   if (size > padding)
     {
       GNUNET_mutex_unlock (lock);
 #if DEBUG_MIGRATION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Migration: available content too big (%u > %u) for 
migration.\n",
               size, padding);
 #endif
@@ -321,8 +321,8 @@
       ret = gap->tryMigrate (&gw->dc, &content[entry].key, position, padding);
       GNUNET_free (gw);
 #if DEBUG_MIGRATION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "gap's tryMigrate returned %u\n", ret);
 #endif
       if (ret != 0)
@@ -342,8 +342,8 @@
       else
         {
 #if DEBUG_MIGRATION
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Migration: not enough cover traffic\n");
 #endif
         }
@@ -351,14 +351,14 @@
   GNUNET_mutex_unlock (lock);
   if ((ret > 0) && (stats != NULL))
     stats->change (stat_migration_count, 1);
-  GE_BREAK (NULL, ret <= padding);
+  GNUNET_GE_BREAK (NULL, ret <= padding);
   return ret;
 }
 
 void
-initMigration (CoreAPIForApplication * capi,
-               Datastore_ServiceAPI * ds,
-               GAP_ServiceAPI * g, DHT_ServiceAPI * d, Traffic_ServiceAPI * t)
+initMigration (GNUNET_CoreAPIForPlugins * capi,
+               GNUNET_Datastore_ServiceAPI * ds,
+               GNUNET_GAP_ServiceAPI * g, GNUNET_DHT_ServiceAPI * d, 
GNUNET_Traffic_ServiceAPI * t)
 {
   ectx = capi->ectx;
   lock = GNUNET_mutex_create (GNUNET_NO);
@@ -367,7 +367,7 @@
   gap = g;
   dht = d;
   traffic = t;
-  coreAPI->registerSendCallback (GAP_ESTIMATED_DATA_SIZE,
+  coreAPI->registerSendCallback (GNUNET_GAP_ESTIMATED_DATA_SIZE,
                                  &activeMigrationCallback);
   stats = capi->requestService ("stats");
   if (stats != NULL)
@@ -387,7 +387,7 @@
 doneMigration ()
 {
   int i;
-  coreAPI->unregisterSendCallback (GAP_ESTIMATED_DATA_SIZE,
+  coreAPI->unregisterSendCallback (GNUNET_GAP_ESTIMATED_DATA_SIZE,
                                    &activeMigrationCallback);
   if (stats != NULL)
     {

Modified: GNUnet/src/applications/fs/module/migration.h
===================================================================
--- GNUnet/src/applications/fs/module/migration.h       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/migration.h       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -81,10 +81,10 @@
 /**
  * Initialize the migration module.
  */
-void initMigration (CoreAPIForApplication * capi,
-                    Datastore_ServiceAPI * s,
-                    GAP_ServiceAPI * g,
-                    DHT_ServiceAPI * d, Traffic_ServiceAPI * t);
+void initMigration (GNUNET_CoreAPIForPlugins * capi,
+                    GNUNET_Datastore_ServiceAPI * s,
+                    GNUNET_GAP_ServiceAPI * g,
+                    GNUNET_DHT_ServiceAPI * d, GNUNET_Traffic_ServiceAPI * t);
 
 void doneMigration (void);
 

Modified: GNUnet/src/applications/fs/module/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/ondemand.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -42,7 +42,7 @@
  */
 typedef struct
 {
-  Datastore_Value header;
+  GNUNET_DatastoreValue header;
 
   unsigned int type;
 
@@ -69,11 +69,11 @@
 
 static char *index_directory;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static State_ServiceAPI *state;
+static GNUNET_State_ServiceAPI *state;
 
 static char *
 getOnDemandFile (const GNUNET_HashCode * fileId)
@@ -97,15 +97,15 @@
  */
 static int
 checkPresent (const GNUNET_HashCode * key,
-              const Datastore_Value * value, void *closure,
+              const GNUNET_DatastoreValue * value, void *closure,
               unsigned long long uid)
 {
-  Datastore_Value *comp = closure;
+  GNUNET_DatastoreValue *comp = closure;
 
   if ((comp->size != value->size) ||
       (0 != memcmp (&value[1],
                     &comp[1],
-                    ntohl (value->size) - sizeof (Datastore_Value))))
+                    ntohl (value->size) - sizeof (GNUNET_DatastoreValue))))
     return GNUNET_OK;
   return GNUNET_SYSERR;
 }
@@ -119,7 +119,7 @@
  *         GNUNET_YES on success
  */
 int
-ONDEMAND_initIndex (struct GE_Context *cectx,
+ONDEMAND_initIndex (struct GNUNET_GE_Context *cectx,
                     const GNUNET_HashCode * fileId, const char *fn)
 {
   GNUNET_EncName enc;
@@ -145,11 +145,11 @@
   GNUNET_disk_directory_create_for_file (cectx, serverFN);
   if (0 != SYMLINK (fn, serverFN))
     {
-      GE_LOG_STRERROR_FILE (cectx,
-                            GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (cectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER 
| GNUNET_GE_BULK,
                             "symlink", fn);
-      GE_LOG_STRERROR_FILE (cectx,
-                            GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (cectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER 
| GNUNET_GE_BULK,
                             "symlink", serverFN);
       GNUNET_free (serverFN);
       return GNUNET_NO;
@@ -168,8 +168,8 @@
  *  GNUNET_SYSERR on other error (i.e. datastore full)
  */
 int
-ONDEMAND_index (struct GE_Context *cectx,
-                Datastore_ServiceAPI * datastore,
+ONDEMAND_index (struct GNUNET_GE_Context *cectx,
+                GNUNET_Datastore_ServiceAPI * datastore,
                 unsigned int prio,
                 GNUNET_CronTime expiration,
                 unsigned long long fileOffset,
@@ -189,8 +189,8 @@
 
   if (size <= sizeof (DBlock))
     {
-      GE_BREAK (cectx, 0);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (cectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
 
@@ -205,8 +205,8 @@
 
       /* not sym-linked, write content to offset! */
 #if DEBUG_ONDEMAND
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Storing on-demand encoded data in `%s'.\n", fn);
 #endif
       fd = GNUNET_disk_file_open (cectx, fn, O_LARGEFILE | O_CREAT | O_WRONLY, 
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);  /* 644 */
@@ -223,8 +223,8 @@
         }
       else
         {
-          GE_LOG_STRERROR_FILE (cectx,
-                                GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+          GNUNET_GE_LOG_STRERROR_FILE (cectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                                 "write", fn);
           ret = GNUNET_SYSERR;
         }
@@ -238,11 +238,11 @@
   GNUNET_free (fn);
 
   odb.header.size = htonl (sizeof (OnDemandBlock));
-  odb.header.type = htonl (ONDEMAND_BLOCK);
+  odb.header.type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND);
   odb.header.prio = htonl (prio);
   odb.header.anonymityLevel = htonl (anonymityLevel);
   odb.header.expirationTime = GNUNET_htonll (expiration);
-  odb.type = htonl (ONDEMAND_BLOCK);
+  odb.type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND);
   odb.fileOffset = GNUNET_htonll (fileOffset);
   odb.blockSize = htonl (size - sizeof (DBlock));
   odb.fileId = *fileId;
@@ -250,11 +250,11 @@
   fileBlockGetQuery (content, size, &key);
 #if EXTRA_CHECKS
   {
-    Datastore_Value *dsvalue;
+    GNUNET_DatastoreValue *dsvalue;
     if (GNUNET_OK != fileBlockEncode (content, size, &key, &dsvalue))
       {
-        GE_BREAK (cectx, 0);
-        GE_BREAK (ectx, 0);
+        GNUNET_GE_BREAK (cectx, 0);
+        GNUNET_GE_BREAK (ectx, 0);
       }
     else
       {
@@ -264,13 +264,13 @@
 #endif
 
 #if DEBUG_ONDEMAND
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&key, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Storing on-demand content for query `%s'\n", &enc);
 #endif
 
-  ret = datastore->get (&key, ONDEMAND_BLOCK, &checkPresent, &odb.header);
+  ret = datastore->get (&key, GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND, 
&checkPresent, &odb.header);
   if (ret >= 0)
     {
       ret = datastore->put (&key, &odb.header);
@@ -284,8 +284,8 @@
 
 struct adJ
 {
-  Datastore_ServiceAPI *datastore;
-  Datastore_Value *dbv;
+  GNUNET_Datastore_ServiceAPI *datastore;
+  GNUNET_DatastoreValue *dbv;
   GNUNET_HashCode query;
 };
 
@@ -304,8 +304,8 @@
  * a del operation during "get" would deadlock!
  */
 static void
-asyncDelete (Datastore_ServiceAPI * datastore,
-             const Datastore_Value * dbv, const GNUNET_HashCode * query)
+asyncDelete (GNUNET_Datastore_ServiceAPI * datastore,
+             const GNUNET_DatastoreValue * dbv, const GNUNET_HashCode * query)
 {
   struct adJ *job;
 #if DEBUG_ONDEMAND
@@ -319,8 +319,8 @@
   memcpy (job->dbv, dbv, ntohl (dbv->size));
 #if DEBUG_ONDEMAND
   GNUNET_hash_to_enc (query, &enc);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("Indexed file disappeared, deleting block for query `%s'\n"),
           &enc);
 #endif
@@ -338,9 +338,9 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR if there was an error
  */
 int
-ONDEMAND_getIndexed (Datastore_ServiceAPI * datastore,
-                     const Datastore_Value * dbv,
-                     const GNUNET_HashCode * query, Datastore_Value ** enc)
+ONDEMAND_getIndexed (GNUNET_Datastore_ServiceAPI * datastore,
+                     const GNUNET_DatastoreValue * dbv,
+                     const GNUNET_HashCode * query, GNUNET_DatastoreValue ** 
enc)
 {
   char *fn;
   char *iobuf;
@@ -352,7 +352,7 @@
 
   if (ntohl (dbv->size) != sizeof (OnDemandBlock))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   odb = (OnDemandBlock *) dbv;
@@ -368,8 +368,8 @@
       unsigned long long *first_unavail;
       struct stat linkStat;
 
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                             "open", fn);
 
       /* Is the symlink there? */
@@ -407,7 +407,7 @@
                          (errno == ENAMETOOLONG) && (len < 4 * 1024 * 1024))
                     if (len * 2 < len)
                       {
-                        GE_BREAK (ectx, 0);
+                        GNUNET_GE_BREAK (ectx, 0);
                         GNUNET_array_grow (ofn, len, 0);
                         GNUNET_free (fn);
                         return GNUNET_SYSERR;
@@ -416,8 +416,8 @@
 
                   if (ret != -1)
                     {
-                      GE_LOG (ectx,
-                              GE_ERROR | GE_BULK | GE_USER,
+                      GNUNET_GE_LOG (ectx,
+                              GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                               _
                               ("Because the file `%s' has been unavailable for 
3 days"
                                " it got removed from your share.  Please 
unindex files before"
@@ -466,8 +466,8 @@
                                                                fileOffset),
                                                 SEEK_SET))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                             "lseek", fn);
       GNUNET_free (fn);
       CLOSE (fileHandle);
@@ -475,13 +475,13 @@
       return GNUNET_SYSERR;
     }
   db = GNUNET_malloc (sizeof (DBlock) + ntohl (odb->blockSize));
-  db->type = htonl (D_BLOCK);
+  db->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   iobuf = (char *) &db[1];
   blen = READ (fileHandle, iobuf, ntohl (odb->blockSize));
   if (blen != ntohl (odb->blockSize))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_ADMIN | GE_USER | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                             "read", fn);
       GNUNET_free (fn);
       GNUNET_free (db);
@@ -497,8 +497,8 @@
   GNUNET_free (fn);
   if (ret == GNUNET_SYSERR)
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Indexed content changed (does not match its hash).\n"));
       asyncDelete (datastore, dbv, query);
       return GNUNET_SYSERR;
@@ -516,7 +516,7 @@
  * @return GNUNET_YES if so, GNUNET_NO if not.
  */
 int
-ONDEMAND_testindexed (Datastore_ServiceAPI * datastore,
+ONDEMAND_testindexed (GNUNET_Datastore_ServiceAPI * datastore,
                       const GNUNET_HashCode * fileId)
 {
   char *fn;
@@ -540,19 +540,19 @@
  */
 static int
 completeValue (const GNUNET_HashCode * key,
-               const Datastore_Value * value, void *closure,
+               const GNUNET_DatastoreValue * value, void *closure,
                unsigned long long uid)
 {
-  Datastore_Value *comp = closure;
+  GNUNET_DatastoreValue *comp = closure;
 
   if ((comp->size != value->size) ||
       (0 != memcmp (&value[1],
                     &comp[1],
-                    ntohl (value->size) - sizeof (Datastore_Value))))
+                    ntohl (value->size) - sizeof (GNUNET_DatastoreValue))))
     {
 #if DEBUG_ONDEMAND
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "`%s' found value that does not match (%u, %u).\n",
               __FUNCTION__, ntohl (comp->size), ntohl (value->size));
 #endif
@@ -560,8 +560,8 @@
     }
   *comp = *value;               /* make copy! */
 #if DEBUG_ONDEMAND
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "`%s' found value that matches.\n", __FUNCTION__);
 #endif
   return GNUNET_SYSERR;
@@ -578,8 +578,8 @@
  *        the keys of the odb blocks).
  */
 int
-ONDEMAND_unindex (struct GE_Context *cectx,
-                  Datastore_ServiceAPI * datastore,
+ONDEMAND_unindex (struct GNUNET_GE_Context *cectx,
+                  GNUNET_Datastore_ServiceAPI * datastore,
                   unsigned int blocksize, const GNUNET_HashCode * fileId)
 {
   char *fn;
@@ -596,8 +596,8 @@
 
   fn = getOnDemandFile (fileId);
 #if DEBUG_ONDEMAND
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Removing on-demand encoded data stored in `%s'.\n", fn);
 #endif
   fd = GNUNET_disk_file_open (cectx, fn, O_RDONLY | O_LARGEFILE, S_IRUSR | 
S_IWUSR | S_IRGRP | S_IROTH);        /* 644 */
@@ -613,7 +613,7 @@
       return GNUNET_SYSERR;
     }
   block = GNUNET_malloc (sizeof (DBlock) + blocksize);
-  block->type = htonl (D_BLOCK);
+  block->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
   while (pos < size)
     {
       delta = size - pos;
@@ -621,8 +621,8 @@
         delta = blocksize;
       if (delta != READ (fd, &block[1], delta))
         {
-          GE_LOG_STRERROR_FILE (cectx,
-                                GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+          GNUNET_GE_LOG_STRERROR_FILE (cectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                                 "read", fn);
           CLOSE (fd);
           GNUNET_free (fn);
@@ -630,26 +630,26 @@
           return GNUNET_SYSERR;
         }
       odb.header.size = htonl (sizeof (OnDemandBlock));
-      odb.header.type = htonl (ONDEMAND_BLOCK);
+      odb.header.type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND);
       odb.header.prio = 0;
       odb.header.anonymityLevel = 0;
       odb.header.expirationTime = 0;
-      odb.type = htonl (ONDEMAND_BLOCK);
+      odb.type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND);
       odb.fileOffset = GNUNET_htonll (pos);
       odb.blockSize = htonl (delta);
       odb.fileId = *fileId;
       /* compute the primary key */
       fileBlockGetQuery (block, delta + sizeof (DBlock), &key);
-      if (GNUNET_SYSERR == datastore->get (&key, ONDEMAND_BLOCK, 
&completeValue, &odb.header))  /* aborted == found! */
+      if (GNUNET_SYSERR == datastore->get (&key, 
GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND, &completeValue, &odb.header))  /* 
aborted == found! */
         ret = datastore->del (&key, &odb.header);
       else                      /* not found */
         ret = GNUNET_SYSERR;
       if (ret == GNUNET_SYSERR)
         {
           IF_GELOG (cectx,
-                    GE_WARNING | GE_BULK | GE_USER, GNUNET_hash_to_enc (&key,
+                    GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER, 
GNUNET_hash_to_enc (&key,
                                                                         &enc));
-          GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                   _
                   ("Unindexed ODB block `%s' from offset %llu already missing 
from datastore.\n"),
                   &enc, pos);
@@ -668,7 +668,7 @@
 }
 
 int
-ONDEMAND_init (CoreAPIForApplication * capi)
+ONDEMAND_init (GNUNET_CoreAPIForPlugins * capi)
 {
   char *tmp;
 
@@ -676,18 +676,18 @@
   state = capi->requestService ("state");
   if (state == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   ectx = capi->ectx;
-  GC_get_configuration_value_filename (capi->cfg,
+  GNUNET_GC_get_configuration_value_filename (capi->cfg,
                                        "GNUNETD",
                                        "GNUNETD_HOME",
-                                       VAR_DAEMON_DIRECTORY, &tmp);
-  GE_ASSERT (ectx, NULL != tmp);
+                                       GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY, 
&tmp);
+  GNUNET_GE_ASSERT (ectx, NULL != tmp);
   tmp = GNUNET_realloc (tmp, strlen (tmp) + strlen ("/data/shared/") + 1);
   strcat (tmp, "/data/shared/");
-  GC_get_configuration_value_filename (capi->cfg,
+  GNUNET_GC_get_configuration_value_filename (capi->cfg,
                                        "FS",
                                        "INDEX-DIRECTORY",
                                        tmp, &index_directory);

Modified: GNUnet/src/applications/fs/module/ondemand.h
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.h        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/ondemand.h        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -38,15 +38,15 @@
  * @return GNUNET_SYSERR on error, GNUNET_NO if symlinking failed,
  *         GNUNET_YES on success
  */
-int ONDEMAND_initIndex (struct GE_Context *cectx,
+int ONDEMAND_initIndex (struct GNUNET_GE_Context *cectx,
                         const GNUNET_HashCode * fileId, const char *fn);
 
 /**
  * @return GNUNET_NO if already present, GNUNET_YES on success,
  *  GNUNET_SYSERR on other error (i.e. datastore full)
  */
-int ONDEMAND_index (struct GE_Context *cectx,
-                    Datastore_ServiceAPI * datastore,
+int ONDEMAND_index (struct GNUNET_GE_Context *cectx,
+                    GNUNET_Datastore_ServiceAPI * datastore,
                     unsigned int prio,
                     GNUNET_CronTime expiration,
                     unsigned long long fileOffset,
@@ -62,10 +62,10 @@
  * this function also removes the OD-Entry
  * @return GNUNET_OK on success, GNUNET_SYSERR if there was an error
  */
-int ONDEMAND_getIndexed (Datastore_ServiceAPI * datastore,
-                         const Datastore_Value * odb,
+int ONDEMAND_getIndexed (GNUNET_Datastore_ServiceAPI * datastore,
+                         const GNUNET_DatastoreValue * odb,
                          const GNUNET_HashCode * query,
-                         Datastore_Value ** enc);
+                         GNUNET_DatastoreValue ** enc);
 
 /**
  * Unindex the file with the given ID.  Removes the file from the
@@ -77,8 +77,8 @@
  *        up the file properly when computing
  *        the keys of the odb blocks).
  */
-int ONDEMAND_unindex (struct GE_Context *cectx,
-                      Datastore_ServiceAPI * datastore,
+int ONDEMAND_unindex (struct GNUNET_GE_Context *cectx,
+                      GNUNET_Datastore_ServiceAPI * datastore,
                       unsigned int blocksize, const GNUNET_HashCode * fileId);
 
 /**
@@ -86,10 +86,10 @@
  * indexed.
  * @return GNUNET_YES if so, GNUNET_NO if not.
  */
-int ONDEMAND_testindexed (Datastore_ServiceAPI * datastore,
+int ONDEMAND_testindexed (GNUNET_Datastore_ServiceAPI * datastore,
                           const GNUNET_HashCode * fileId);
 
-int ONDEMAND_init (CoreAPIForApplication * capi);
+int ONDEMAND_init (GNUNET_CoreAPIForPlugins * capi);
 
 int ONDEMAND_done (void);
 

Modified: GNUnet/src/applications/fs/module/querymanager.c
===================================================================
--- GNUnet/src/applications/fs/module/querymanager.c    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/querymanager.c    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -38,14 +38,14 @@
 {
   GNUNET_HashCode query;
   unsigned int type;
-  struct ClientHandle *client;
+  struct GNUNET_ClientHandle *client;
 } TrackRecord;
 
 
 /**
  * Stats service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_queries_tracked;
 
@@ -65,14 +65,14 @@
  */
 static struct GNUNET_Mutex *queryManagerLock;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static void
 removeEntry (unsigned int off)
 {
-  GE_ASSERT (ectx, off < trackerCount);
+  GNUNET_GE_ASSERT (ectx, off < trackerCount);
   GNUNET_free (trackers[off]);
   if (stats != NULL)
     stats->change (stat_queries_tracked, -1);
@@ -83,7 +83,7 @@
 }
 
 static void
-ceh (struct ClientHandle *client)
+ceh (struct GNUNET_ClientHandle *client)
 {
   int i;
   GNUNET_mutex_lock (queryManagerLock);
@@ -102,9 +102,9 @@
  */
 void
 trackQuery (const GNUNET_HashCode * query,
-            unsigned int type, struct ClientHandle *client)
+            unsigned int type, struct GNUNET_ClientHandle *client)
 {
-  GE_ASSERT (ectx, client != NULL);
+  GNUNET_GE_ASSERT (ectx, client != NULL);
   GNUNET_mutex_lock (queryManagerLock);
   if (trackerSize == trackerCount)
     GNUNET_array_grow (trackers, trackerSize, trackerSize * 2);
@@ -125,7 +125,7 @@
  * @param client where did the query come from?
  */
 void
-untrackQuery (const GNUNET_HashCode * query, struct ClientHandle *client)
+untrackQuery (const GNUNET_HashCode * query, struct GNUNET_ClientHandle 
*client)
 {
   int i;
 
@@ -148,7 +148,7 @@
  * @param value the response
  */
 void
-processResponse (const GNUNET_HashCode * key, const Datastore_Value * value)
+processResponse (const GNUNET_HashCode * key, const GNUNET_DatastoreValue * 
value)
 {
   int i;
   CS_fs_reply_content_MESSAGE *rc;
@@ -157,14 +157,14 @@
   GNUNET_EncName enc;
 #endif
 
-  GE_ASSERT (ectx, ntohl (value->size) > sizeof (Datastore_Value));
+  GNUNET_GE_ASSERT (ectx, ntohl (value->size) > sizeof 
(GNUNET_DatastoreValue));
   if ((GNUNET_ntohll (value->expirationTime) < GNUNET_get_time ()) &&
-      (ntohl (value->type) != D_BLOCK))
+      (ntohl (value->type) != GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA))
     return;                     /* ignore expired, non-data responses! */
 
   matchCount = 0;
 #if DEBUG_QUERYMANAGER
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (key, &enc));
 #endif
   GNUNET_mutex_lock (queryManagerLock);
@@ -172,23 +172,23 @@
     {
       if ((0 == memcmp (&trackers[i]->query,
                         key, sizeof (GNUNET_HashCode))) &&
-          ((trackers[i]->type == ANY_BLOCK) ||
+          ((trackers[i]->type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY) ||
            (trackers[i]->type == ntohl (value->type))))
         {
           matchCount++;
           rc = GNUNET_malloc (sizeof (CS_fs_reply_content_MESSAGE) +
-                              ntohl (value->size) - sizeof (Datastore_Value));
+                              ntohl (value->size) - sizeof 
(GNUNET_DatastoreValue));
           rc->header.size = htons (sizeof (CS_fs_reply_content_MESSAGE) +
                                    ntohl (value->size) -
-                                   sizeof (Datastore_Value));
-          rc->header.type = htons (CS_PROTO_gap_RESULT);
+                                   sizeof (GNUNET_DatastoreValue));
+          rc->header.type = htons (GNUNET_CS_PROTO_GAP_RESULT);
           rc->anonymityLevel = value->anonymityLevel;
           rc->expirationTime = value->expirationTime;
           memcpy (&rc[1],
-                  &value[1], ntohl (value->size) - sizeof (Datastore_Value));
+                  &value[1], ntohl (value->size) - sizeof 
(GNUNET_DatastoreValue));
 #if DEBUG_QUERYMANAGER
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                   "Sending reply for `%s' to client waiting in slot %u.\n",
                   &enc, i);
 #endif
@@ -201,8 +201,8 @@
 #if DEBUG_QUERYMANAGER && 0
   if (matchCount == 0)
     {
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Reply `%s' did not match any request.\n", &enc);
     }
 #endif
@@ -213,7 +213,7 @@
  * Initialize the query management.
  */
 int
-initQueryManager (CoreAPIForApplication * capi)
+initQueryManager (GNUNET_CoreAPIForPlugins * capi)
 {
   coreAPI = capi;
   ectx = capi->ectx;

Modified: GNUnet/src/applications/fs/module/querymanager.h
===================================================================
--- GNUnet/src/applications/fs/module/querymanager.h    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/module/querymanager.h    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -31,7 +31,7 @@
 /**
  * Initialize the query management.
  */
-int initQueryManager (CoreAPIForApplication * capi);
+int initQueryManager (GNUNET_CoreAPIForPlugins * capi);
 
 /**
  * Shutdown query management.
@@ -46,7 +46,7 @@
  * @param client where did the query come from?
  */
 void trackQuery (const GNUNET_HashCode * query,
-                 unsigned int type, struct ClientHandle *client);
+                 unsigned int type, struct GNUNET_ClientHandle *client);
 
 /**
  * Stop keeping track of a query.
@@ -55,7 +55,7 @@
  * @param client where did the query come from?
  */
 void untrackQuery (const GNUNET_HashCode * query,
-                   struct ClientHandle *client);
+                   struct GNUNET_ClientHandle *client);
 
 /**
  * We received a reply from 'responder'.
@@ -64,6 +64,6 @@
  * @param value the response
  */
 void processResponse (const GNUNET_HashCode * key,
-                      const Datastore_Value * value);
+                      const GNUNET_DatastoreValue * value);
 
 #endif

Modified: GNUnet/src/applications/fs/namespace/namespace_info.c
===================================================================
--- GNUnet/src/applications/fs/namespace/namespace_info.c       2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/fs/namespace/namespace_info.c       2007-11-25 
12:04:45 UTC (rev 5755)
@@ -39,7 +39,7 @@
 struct DiscoveryCallback
 {
   struct DiscoveryCallback *next;
-  NS_NamespaceIterator callback;
+  GNUNET_NS_NamespaceIterator callback;
   void *closure;
 };
 
@@ -53,7 +53,7 @@
 static void
 internal_notify (const char *name,
                  const GNUNET_HashCode * id,
-                 const struct ECRS_MetaData *md, int rating)
+                 const struct GNUNET_ECRS_MetaData *md, int rating)
 {
   struct DiscoveryCallback *pos;
 
@@ -68,10 +68,10 @@
 }
 
 static void
-writeNamespaceInfo (struct GE_Context *ectx,
-                    struct GC_Configuration *cfg,
+writeNamespaceInfo (struct GNUNET_GE_Context *ectx,
+                    struct GNUNET_GC_Configuration *cfg,
                     const char *namespaceName,
-                    const struct ECRS_MetaData *meta, int ranking)
+                    const struct GNUNET_ECRS_MetaData *meta, int ranking)
 {
   unsigned int size;
   unsigned int tag;
@@ -80,10 +80,10 @@
   char *fnBase;
 
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fnBase);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &fnBase);
   fn = GNUNET_malloc (strlen (fnBase) +
                       strlen (NS_DIR) + strlen (namespaceName) + 6);
   strcpy (fn, fnBase);
@@ -94,25 +94,25 @@
   strcat (fn, namespaceName);
   GNUNET_free (fnBase);
 
-  size = ECRS_sizeofMetaData (meta, ECRS_SERIALIZE_FULL);
+  size = GNUNET_ECRS_meta_data_get_serialized_size (meta, 
GNUNET_ECRS_SERIALIZE_FULL);
   tag = size + sizeof (int);
   buf = GNUNET_malloc (tag);
   ((int *) buf)[0] = htonl (ranking);   /* ranking */
-  GE_ASSERT (ectx,
-             size == ECRS_serializeMetaData (ectx,
+  GNUNET_GE_ASSERT (ectx,
+             size == GNUNET_ECRS_meta_data_serialize (ectx,
                                              meta,
                                              &buf[sizeof (int)],
-                                             size, ECRS_SERIALIZE_FULL));
+                                             size, 
GNUNET_ECRS_SERIALIZE_FULL));
   GNUNET_disk_file_write (ectx, fn, buf, tag, "660");
   GNUNET_free (fn);
   GNUNET_free (buf);
 }
 
 static int
-readNamespaceInfo (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg,
+readNamespaceInfo (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg,
                    const char *namespaceName,
-                   struct ECRS_MetaData **meta, int *ranking)
+                   struct GNUNET_ECRS_MetaData **meta, int *ranking)
 {
   unsigned long long len;
   unsigned int size;
@@ -121,10 +121,10 @@
   char *fnBase;
 
   *meta = NULL;
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fnBase);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &fnBase);
   fn = GNUNET_malloc (strlen (fnBase) +
                       strlen (NS_DIR) + strlen (namespaceName) + 6);
   strcpy (fn, fnBase);
@@ -150,7 +150,7 @@
   if (len > 16 * 1024 * 1024)
     {
       /* too big, must be invalid! remove! */
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       UNLINK (fn);
       GNUNET_free (fn);
       return GNUNET_SYSERR;
@@ -165,11 +165,11 @@
 
   size = len - sizeof (int);
   *ranking = ntohl (((int *) buf)[0]);
-  *meta = ECRS_deserializeMetaData (ectx, &buf[sizeof (int)], size);
+  *meta = GNUNET_ECRS_meta_data_deserialize (ectx, &buf[sizeof (int)], size);
   if ((*meta) == NULL)
     {
       /* invalid data! remove! */
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       UNLINK (fn);
       GNUNET_free (buf);
       GNUNET_free (fn);
@@ -189,20 +189,20 @@
  * @param meta meta-data about the namespace (maybe NULL)
  * @return namespace root URI on success, NULL on error (namespace already 
exists)
  */
-struct ECRS_URI *
-NS_createNamespace (struct GE_Context *ectx,
-                    struct GC_Configuration *cfg,
+struct GNUNET_ECRS_URI *
+GNUNET_NS_namespace_create (struct GNUNET_GE_Context *ectx,
+                    struct GNUNET_GC_Configuration *cfg,
                     unsigned int anonymityLevel,
                     unsigned int insertPriority,
                     GNUNET_CronTime insertExpiration,
                     const char *namespaceName,
-                    const struct ECRS_MetaData *meta,
-                    const struct ECRS_URI *advertisementURI,
+                    const struct GNUNET_ECRS_MetaData *meta,
+                    const struct GNUNET_ECRS_URI *advertisementURI,
                     const GNUNET_HashCode * rootEntry)
 {
-  struct ECRS_URI *ret;
+  struct GNUNET_ECRS_URI *ret;
 
-  ret = ECRS_createNamespace (ectx,
+  ret = GNUNET_ECRS_namespace_create (ectx,
                               cfg,
                               namespaceName,
                               meta,
@@ -215,9 +215,9 @@
       GNUNET_HashCode id;
       char *name;
 
-      NS_setNamespaceRoot (ectx, cfg, ret);
-      ECRS_getNamespaceId (ret, &id);
-      name = ECRS_getNamespaceName (&id);
+      GNUNET_NS_namespace_set_root (ectx, cfg, ret);
+      GNUNET_ECRS_uri_get_namespace_from_sks (ret, &id);
+      name = GNUNET_ECRS_get_namespace_name (&id);
       writeNamespaceInfo (ectx, cfg, name, meta, 0);
       internal_notify (namespaceName, &id, meta, 0);
       GNUNET_free (name);
@@ -232,18 +232,18 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-NS_deleteNamespace (struct GE_Context *ectx,
-                    struct GC_Configuration *cfg, const char *namespaceName)
+GNUNET_NS_namespace_delete (struct GNUNET_GE_Context *ectx,
+                    struct GNUNET_GC_Configuration *cfg, const char 
*namespaceName)
 {
   int ret;
   char *tmp;
   char *fn;
 
-  ret = ECRS_deleteNamespace (ectx, cfg, namespaceName);
-  GC_get_configuration_value_filename (cfg,
+  ret = GNUNET_ECRS_namespace_delete (ectx, cfg, namespaceName);
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &tmp);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &tmp);
   fn = GNUNET_malloc (strlen (tmp) + strlen (NS_UPDATE_DIR) +
                       strlen (namespaceName) + 20);
   strcpy (fn, tmp);
@@ -263,16 +263,16 @@
  * Change the ranking of a (non-local) namespace.
  *
  * @param ns the name of the namespace, as obtained
- *  from ECRS_getNamespaceName
+ *  from GNUNET_ECRS_get_namespace_name
  * @param delta by how much should the rating be
  *  changed?
  * @return new rating of the namespace
  */
 int
-NS_rankNamespace (struct GE_Context *ectx,
-                  struct GC_Configuration *cfg, const char *ns, int delta)
+GNUNET_NS_namespace_rank (struct GNUNET_GE_Context *ectx,
+                  struct GNUNET_GC_Configuration *cfg, const char *ns, int 
delta)
 {
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
   int ret;
   int ranking;
 
@@ -280,20 +280,20 @@
   if (ret == GNUNET_SYSERR)
     {
       ranking = 0;
-      meta = ECRS_createMetaData ();
+      meta = GNUNET_ECRS_meta_data_create ();
     }
   ranking += delta;
   writeNamespaceInfo (ectx, cfg, ns, meta, ranking);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   return ranking;
 }
 
 typedef struct
 {
-  NS_NamespaceIterator iterator;
+  GNUNET_NS_NamespaceIterator iterator;
   void *closure;
-  struct GE_Context *ectx;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
 } LNClosure;
 
 static int
@@ -302,21 +302,21 @@
 {
   LNClosure *c = cls;
   int ret;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
   int rating;
 
   meta = NULL;
   rating = 0;
   readNamespaceInfo (c->ectx, c->cfg, name, &meta, &rating);
   if (meta == NULL)
-    meta = ECRS_createMetaData ();
+    meta = GNUNET_ECRS_meta_data_create ();
   if (c->iterator != NULL)
     {
       ret = c->iterator (c->closure, name, nsid, meta, rating);
     }
   else
     ret = GNUNET_OK;
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   return ret;
 }
 
@@ -325,7 +325,7 @@
 {
   LNClosure *c = cls;
   int ret;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_ECRS_MetaData *meta;
   int rating;
   GNUNET_HashCode id;
 
@@ -339,7 +339,7 @@
     }
   else
     ret = GNUNET_OK;
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   return GNUNET_OK;
 }
 
@@ -348,9 +348,9 @@
  *
  */
 int
-NS_listNamespaces (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg,
-                   NS_NamespaceIterator iterator, void *closure)
+GNUNET_NS_namespace_list_all (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg,
+                   GNUNET_NS_NamespaceIterator iterator, void *closure)
 {
   LNClosure cls;
   char *fn;
@@ -362,13 +362,13 @@
   cls.closure = closure;
   cls.ectx = ectx;
   cls.cfg = cfg;
-  ret1 = ECRS_listNamespaces (ectx, cfg, &localListNamespaceHelper, &cls);
+  ret1 = GNUNET_ECRS_get_namespaces (ectx, cfg, &localListNamespaceHelper, 
&cls);
   if (ret1 == -1)
     return ret1;
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fnBase);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &fnBase);
   fn = GNUNET_malloc (strlen (fnBase) + strlen (NS_DIR) + 4);
   strcpy (fn, fnBase);
   GNUNET_free (fnBase);
@@ -388,17 +388,17 @@
  * @param lastId maybe NULL
  */
 static char *
-getUpdateDataFilename (struct GE_Context *ectx,
-                       struct GC_Configuration *cfg,
+getUpdateDataFilename (struct GNUNET_GE_Context *ectx,
+                       struct GNUNET_GC_Configuration *cfg,
                        const char *nsname, const GNUNET_HashCode * lastId)
 {
   char *tmp;
   char *ret;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &tmp);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &tmp);
   ret = GNUNET_malloc (strlen (tmp) + strlen (NS_UPDATE_DIR) +
                        strlen (nsname) + sizeof (GNUNET_EncName) + 20);
   strcpy (ret, tmp);
@@ -434,12 +434,12 @@
  * @return GNUNET_OK if update data was found, GNUNET_SYSERR if not.
  */
 static int
-readUpdateData (struct GE_Context *ectx,
-                struct GC_Configuration *cfg,
+readUpdateData (struct GNUNET_GE_Context *ectx,
+                struct GNUNET_GC_Configuration *cfg,
                 const char *nsname,
                 const GNUNET_HashCode * lastId,
                 GNUNET_HashCode * nextId,
-                ECRS_FileInfo * fi,
+                GNUNET_ECRS_FileInfo * fi,
                 GNUNET_Int32Time * updateInterval,
                 GNUNET_Int32Time * lastPubTime)
 {
@@ -485,25 +485,25 @@
   if (size == 0)
     {
       GNUNET_free (buf);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   if (fi != NULL)
     {
-      fi->meta = ECRS_deserializeMetaData (ectx, &uri[pos], size);
+      fi->meta = GNUNET_ECRS_meta_data_deserialize (ectx, &uri[pos], size);
       if (fi->meta == NULL)
         {
           GNUNET_free (buf);
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return GNUNET_SYSERR;
         }
-      fi->uri = ECRS_stringToUri (ectx, uri);
+      fi->uri = GNUNET_ECRS_string_to_uri (ectx, uri);
       if (fi->uri == NULL)
         {
-          ECRS_freeMetaData (fi->meta);
+          GNUNET_ECRS_meta_data_destroy (fi->meta);
           fi->meta = NULL;
           GNUNET_free (buf);
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           return GNUNET_SYSERR;
         }
     }
@@ -521,12 +521,12 @@
  * Write content update information.
  */
 static int
-writeUpdateData (struct GE_Context *ectx,
-                 struct GC_Configuration *cfg,
+writeUpdateData (struct GNUNET_GE_Context *ectx,
+                 struct GNUNET_GC_Configuration *cfg,
                  const char *nsname,
                  const GNUNET_HashCode * thisId,
                  const GNUNET_HashCode * nextId,
-                 const ECRS_FileInfo * fi,
+                 const GNUNET_ECRS_FileInfo * fi,
                  const GNUNET_Int32Time updateInterval,
                  const GNUNET_Int32Time lastPubTime)
 {
@@ -536,8 +536,8 @@
   size_t size;
   struct UpdateData *buf;
 
-  uri = ECRS_uriToString (fi->uri);
-  metaSize = ECRS_sizeofMetaData (fi->meta, ECRS_SERIALIZE_FULL);
+  uri = GNUNET_ECRS_uri_to_string (fi->uri);
+  metaSize = GNUNET_ECRS_meta_data_get_serialized_size (fi->meta, 
GNUNET_ECRS_SERIALIZE_FULL);
   size = sizeof (struct UpdateData) + metaSize + strlen (uri) + 1;
   buf = GNUNET_malloc (size);
   buf->nextId = *nextId;
@@ -545,12 +545,12 @@
   buf->updateInterval = htonl (updateInterval);
   buf->lastPubTime = htonl (lastPubTime);
   memcpy (&buf[1], uri, strlen (uri) + 1);
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              metaSize ==
-             ECRS_serializeMetaData (ectx,
+             GNUNET_ECRS_meta_data_serialize (ectx,
                                      fi->meta,
                                      &((char *) &buf[1])[strlen (uri) + 1],
-                                     metaSize, ECRS_SERIALIZE_FULL));
+                                     metaSize, GNUNET_ECRS_SERIALIZE_FULL));
   GNUNET_free (uri);
   fn = getUpdateDataFilename (ectx, cfg, nsname, thisId);
   GNUNET_disk_file_write (ectx, fn, buf, size, "400");  /* no editing, just 
deletion */
@@ -567,8 +567,8 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-NS_computeNextId (struct GE_Context *ectx,
-                  struct GC_Configuration *cfg,
+GNUNET_NS_compute_next_identifier (struct GNUNET_GE_Context *ectx,
+                  struct GNUNET_GC_Configuration *cfg,
                   const char *name,
                   const GNUNET_HashCode * lastId,
                   const GNUNET_HashCode * thisId,
@@ -580,8 +580,8 @@
   GNUNET_Int32Time lastTime;
   GNUNET_Int32Time ui;
 
-  if ((updateInterval == ECRS_SBLOCK_UPDATE_SPORADIC) ||
-      (updateInterval == ECRS_SBLOCK_UPDATE_NONE))
+  if ((updateInterval == GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC) ||
+      (updateInterval == GNUNET_ECRS_SBLOCK_UPDATE_NONE))
     return GNUNET_SYSERR;
 
   if (GNUNET_OK != readUpdateData (ectx,
@@ -615,9 +615,9 @@
  *        entry?
  * @param uri set to the resulting URI
  */
-struct ECRS_URI *
-NS_addToNamespace (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg,
+struct GNUNET_ECRS_URI *
+GNUNET_NS_add_to_namespace (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg,
                    unsigned int anonymityLevel,
                    unsigned int insertPriority,
                    GNUNET_CronTime insertExpiration,
@@ -626,7 +626,7 @@
                    const GNUNET_HashCode * lastId,
                    const GNUNET_HashCode * thisId,
                    const GNUNET_HashCode * nextId,
-                   const struct ECRS_URI *dst, const struct ECRS_MetaData *md)
+                   const struct GNUNET_ECRS_URI *dst, const struct 
GNUNET_ECRS_MetaData *md)
 {
   GNUNET_Int32Time creationTime;
   GNUNET_HashCode nid;
@@ -634,15 +634,15 @@
   GNUNET_Int32Time now;
   GNUNET_Int32Time lastTime;
   GNUNET_Int32Time lastInterval;
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
   char *old;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   /* computation of IDs of update(s).  Not as terrible as
      it looks, just enumerating all of the possible cases
      of periodic/sporadic updates and how IDs are computed. */
   creationTime = GNUNET_get_time_int32 (&now);
-  if (updateInterval != ECRS_SBLOCK_UPDATE_NONE)
+  if (updateInterval != GNUNET_ECRS_SBLOCK_UPDATE_NONE)
     {
       if ((lastId != NULL) &&
           (GNUNET_OK == readUpdateData (ectx,
@@ -654,14 +654,14 @@
         {
           if (lastInterval != updateInterval)
             {
-              GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                       _
                       ("Publication interval for periodic publication 
changed."));
             }
           /* try to compute tid and/or
              nid based on information read from lastId */
 
-          if (updateInterval != ECRS_SBLOCK_UPDATE_SPORADIC)
+          if (updateInterval != GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC)
             {
               GNUNET_HashCode delta;
 
@@ -675,7 +675,7 @@
                 }
               if (creationTime > GNUNET_get_time () + 7 * GNUNET_CRON_DAYS)
                 {
-                  GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+                  GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                           _("Publishing update for periodically updated "
                             "content more than a week ahead of schedule.\n"));
                 }
@@ -736,7 +736,7 @@
           nid = tid;
         }
     }
-  uri = ECRS_addToNamespace (ectx,
+  uri = GNUNET_ECRS_namespace_add_content (ectx,
                              cfg,
                              name,
                              anonymityLevel,
@@ -746,12 +746,12 @@
                              updateInterval, &tid, &nid, dst, md);
   if ((uri != NULL) && (dst != NULL))
     {
-      fi.uri = ECRS_dupUri (dst);
-      fi.meta = (struct ECRS_MetaData *) md;
+      fi.uri = GNUNET_ECRS_uri_duplicate (dst);
+      fi.meta = (struct GNUNET_ECRS_MetaData *) md;
       writeUpdateData (ectx,
                        cfg,
                        name, &tid, &nid, &fi, updateInterval, creationTime);
-      ECRS_freeUri (fi.uri);
+      GNUNET_ECRS_uri_destroy (fi.uri);
       if (lastId != NULL)
         {
           old = getUpdateDataFilename (ectx, cfg, name, lastId);
@@ -765,18 +765,18 @@
 struct lNCC
 {
   const char *name;
-  NS_UpdateIterator it;
+  GNUNET_NS_UpdateIterator it;
   void *closure;
   int cnt;
-  struct GE_Context *ectx;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GE_Context *ectx;
+  struct GNUNET_GC_Configuration *cfg;
 };
 
 static int
 lNCHelper (const char *fil, const char *dir, void *ptr)
 {
   struct lNCC *cls = ptr;
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
   GNUNET_HashCode lastId;
   GNUNET_HashCode nextId;
   GNUNET_Int32Time pubFreq;
@@ -786,7 +786,7 @@
 
   if (GNUNET_OK != GNUNET_enc_to_hash (fil, &lastId))
     {
-      GE_BREAK (cls->ectx, 0);
+      GNUNET_GE_BREAK (cls->ectx, 0);
       return GNUNET_OK;
     }
   fi.uri = NULL;
@@ -797,11 +797,11 @@
                                    &lastId, &nextId, &fi, &pubFreq,
                                    &lastTime))
     {
-      GE_BREAK (cls->ectx, 0);
+      GNUNET_GE_BREAK (cls->ectx, 0);
       return GNUNET_OK;
     }
   cls->cnt++;
-  if (pubFreq == ECRS_SBLOCK_UPDATE_SPORADIC)
+  if (pubFreq == GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC)
     {
       nextTime = 0;
     }
@@ -817,13 +817,13 @@
       if (GNUNET_OK != cls->it (cls->closure,
                                 &fi, &lastId, &nextId, pubFreq, nextTime))
         {
-          ECRS_freeUri (fi.uri);
-          ECRS_freeMetaData (fi.meta);
+          GNUNET_ECRS_uri_destroy (fi.uri);
+          GNUNET_ECRS_meta_data_destroy (fi.meta);
           return GNUNET_SYSERR;
         }
     }
-  ECRS_freeUri (fi.uri);
-  ECRS_freeMetaData (fi.meta);
+  GNUNET_ECRS_uri_destroy (fi.uri);
+  GNUNET_ECRS_meta_data_destroy (fi.meta);
   return GNUNET_OK;
 }
 
@@ -831,10 +831,10 @@
  * List all updateable content in a given namespace.
  */
 int
-NS_listNamespaceContent (struct GE_Context *ectx,
-                         struct GC_Configuration *cfg,
+GNUNET_NS_namespace_list_contents (struct GNUNET_GE_Context *ectx,
+                         struct GNUNET_GC_Configuration *cfg,
                          const char *name,
-                         NS_UpdateIterator iterator, void *closure)
+                         GNUNET_NS_UpdateIterator iterator, void *closure)
 {
   struct lNCC cls;
   char *dirName;
@@ -860,8 +860,8 @@
 static int
 mergeMeta (EXTRACTOR_KeywordType type, const char *data, void *cls)
 {
-  struct ECRS_MetaData *meta = cls;
-  ECRS_addToMetaData (meta, type, data);
+  struct GNUNET_ECRS_MetaData *meta = cls;
+  GNUNET_ECRS_meta_data_inser (meta, type, data);
   return GNUNET_OK;
 }
 
@@ -873,34 +873,34 @@
  * @param ns the namespace identifier
  */
 void
-NS_addNamespaceInfo (struct GE_Context *ectx,
-                     struct GC_Configuration *cfg,
-                     const struct ECRS_URI *uri,
-                     const struct ECRS_MetaData *meta)
+GNUNET_NS_namespace_add_information (struct GNUNET_GE_Context *ectx,
+                     struct GNUNET_GC_Configuration *cfg,
+                     const struct GNUNET_ECRS_URI *uri,
+                     const struct GNUNET_ECRS_MetaData *meta)
 {
   char *name;
   int ranking;
-  struct ECRS_MetaData *old;
+  struct GNUNET_ECRS_MetaData *old;
   GNUNET_HashCode id;
 
-  if (!ECRS_isNamespaceUri (uri))
+  if (!GNUNET_ECRS_uri_test_sks (uri))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
-  ECRS_getNamespaceId (uri, &id);
-  name = ECRS_getNamespaceName (&id);
+  GNUNET_ECRS_uri_get_namespace_from_sks (uri, &id);
+  name = GNUNET_ECRS_get_namespace_name (&id);
   if (name == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   ranking = 0;
   if (GNUNET_OK == readNamespaceInfo (ectx, cfg, name, &old, &ranking))
     {
-      ECRS_getMetaData (meta, &mergeMeta, old);
+      GNUNET_ECRS_meta_data_get_contents (meta, &mergeMeta, old);
       writeNamespaceInfo (ectx, cfg, name, old, ranking);
-      ECRS_freeMetaData (old);
+      GNUNET_ECRS_meta_data_destroy (old);
     }
   else
     {
@@ -916,18 +916,18 @@
  * @return GNUNET_SYSERR on error, GNUNET_OK on success
  */
 int
-NS_getNamespaceRoot (struct GE_Context *ectx,
-                     struct GC_Configuration *cfg,
+GNUNET_NS_namespace_get_root (struct GNUNET_GE_Context *ectx,
+                     struct GNUNET_GC_Configuration *cfg,
                      const char *ns, GNUNET_HashCode * root)
 {
   char *fn;
   char *fnBase;
   int ret;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fnBase);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &fnBase);
   fn = GNUNET_malloc (strlen (fnBase) + strlen (NS_ROOTS) + strlen (ns) + 6);
   strcpy (fn, fnBase);
   strcat (fn, DIR_SEPARATOR_STR);
@@ -946,24 +946,24 @@
 }
 
 void
-NS_setNamespaceRoot (struct GE_Context *ectx,
-                     struct GC_Configuration *cfg, const struct ECRS_URI *uri)
+GNUNET_NS_namespace_set_root (struct GNUNET_GE_Context *ectx,
+                     struct GNUNET_GC_Configuration *cfg, const struct 
GNUNET_ECRS_URI *uri)
 {
   char *fn;
   char *fnBase;
   GNUNET_HashCode ns;
   char *name;
 
-  if (GNUNET_OK != ECRS_getNamespaceId (uri, &ns))
+  if (GNUNET_OK != GNUNET_ECRS_uri_get_namespace_from_sks (uri, &ns))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
-  name = ECRS_getNamespaceName (&ns);
-  GC_get_configuration_value_filename (cfg,
+  name = GNUNET_ECRS_get_namespace_name (&ns);
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &fnBase);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &fnBase);
   fn =
     GNUNET_malloc (strlen (fnBase) + strlen (NS_ROOTS) + strlen (name) + 6);
   strcpy (fn, fnBase);
@@ -974,7 +974,7 @@
   strcat (fn, name);
   GNUNET_free (name);
   GNUNET_free (fnBase);
-  if (GNUNET_OK == ECRS_getSKSContentHash (uri, &ns))
+  if (GNUNET_OK == GNUNET_ECRS_uri_get_content_hash_from_sks (uri, &ns))
     {
       GNUNET_disk_file_write (ectx, fn, &ns, sizeof (GNUNET_HashCode), "644");
     }
@@ -986,9 +986,9 @@
  * a new namespace.
  */
 int
-NS_registerDiscoveryCallback (struct GE_Context *ectx,
-                              struct GC_Configuration *cfg,
-                              NS_NamespaceIterator iterator, void *closure)
+GNUNET_NS_register_discovery_callback (struct GNUNET_GE_Context *ectx,
+                              struct GNUNET_GC_Configuration *cfg,
+                              GNUNET_NS_NamespaceIterator iterator, void 
*closure)
 {
   struct DiscoveryCallback *list;
 
@@ -998,7 +998,7 @@
   GNUNET_mutex_lock (lock);
   list->next = head;
   head = list;
-  NS_listNamespaces (ectx, cfg, iterator, closure);
+  GNUNET_NS_namespace_list_all (ectx, cfg, iterator, closure);
   GNUNET_mutex_unlock (lock);
   return GNUNET_OK;
 }
@@ -1007,7 +1007,7 @@
  * Unregister namespace discovery callback.
  */
 int
-NS_unregisterDiscoveryCallback (NS_NamespaceIterator iterator, void *closure)
+GNUNET_NS_unregister_discovery_callback (GNUNET_NS_NamespaceIterator iterator, 
void *closure)
 {
   struct DiscoveryCallback *prev;
   struct DiscoveryCallback *pos;

Modified: GNUnet/src/applications/fs/namespace/namespace_infotest.c
===================================================================
--- GNUnet/src/applications/fs/namespace/namespace_infotest.c   2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/fs/namespace/namespace_infotest.c   2007-11-25 
12:04:45 UTC (rev 5755)
@@ -33,76 +33,76 @@
 #include "gnunet_util_crypto.h"
 #include "gnunet_util_network_client.h"
 
-#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(ectx, 0); goto 
FAILURE; }
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 int
 main (int argc, char *argv[])
 {
   pid_t daemon;
   int ok;
-  struct ECRS_URI *uri = NULL;
-  struct ECRS_URI *euri = NULL;
-  struct ECRS_MetaData *meta = NULL;
+  struct GNUNET_ECRS_URI *uri = NULL;
+  struct GNUNET_ECRS_URI *euri = NULL;
+  struct GNUNET_ECRS_MetaData *meta = NULL;
   GNUNET_HashCode root;
   int old;
   int newVal;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon > 0);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
   ok = GNUNET_YES;
-  NS_deleteNamespace (ectx, cfg, "test");
+  GNUNET_NS_namespace_delete (ectx, cfg, "test");
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
 
   /* ACTUAL TEST CODE */
-  old = NS_listNamespaces (ectx, cfg, NULL, NULL);
+  old = GNUNET_NS_namespace_list_all (ectx, cfg, NULL, NULL);
 
-  meta = ECRS_createMetaData ();
-  ECRS_addToMetaData (meta, 0, "test");
+  meta = GNUNET_ECRS_meta_data_create ();
+  GNUNET_ECRS_meta_data_inser (meta, 0, "test");
   GNUNET_create_random_hash (&root);
-  uri = NS_createNamespace (ectx,
+  uri = GNUNET_NS_namespace_create (ectx,
                             cfg,
                             1,
                             1,
                             GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,
                             "test", meta, NULL, &root);
   CHECK (uri != NULL);
-  newVal = NS_listNamespaces (ectx, cfg, NULL, NULL);
+  newVal = GNUNET_NS_namespace_list_all (ectx, cfg, NULL, NULL);
   CHECK (old < newVal);
-  old = NS_listNamespaceContent (ectx, cfg, "test", NULL, NULL);
-  euri = NS_addToNamespace (ectx,
+  old = GNUNET_NS_namespace_list_contents (ectx, cfg, "test", NULL, NULL);
+  euri = GNUNET_NS_add_to_namespace (ectx,
                             cfg,
                             1,
                             1,
                             GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,
                             "test", 42, NULL, &root, NULL, uri, meta);
   CHECK (euri != NULL);
-  newVal = NS_listNamespaceContent (ectx, cfg, "test", NULL, NULL);
+  newVal = GNUNET_NS_namespace_list_contents (ectx, cfg, "test", NULL, NULL);
   CHECK (old < newVal);
-  CHECK (GNUNET_OK == NS_deleteNamespace (ectx, cfg, "test"));
+  CHECK (GNUNET_OK == GNUNET_NS_namespace_delete (ectx, cfg, "test"));
   /* END OF TEST CODE */
 FAILURE:
   if (uri != NULL)
-    ECRS_freeUri (uri);
+    GNUNET_ECRS_uri_destroy (uri);
   if (euri != NULL)
-    ECRS_freeUri (euri);
+    GNUNET_ECRS_uri_destroy (euri);
   if (meta != NULL)
-    ECRS_freeMetaData (meta);
-  ECRS_deleteNamespace (ectx, cfg, "test");
+    GNUNET_ECRS_meta_data_destroy (meta);
+  GNUNET_ECRS_namespace_delete (ectx, cfg, "test");
 
-  GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
-  GC_free (cfg);
+  GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: GNUnet/src/applications/fs/tools/gnunet-directory.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-directory.c 2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/tools/gnunet-directory.c 2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -32,7 +32,7 @@
 #include "gnunet_uritrack_lib.h"
 #include "gnunet_util.h"
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
 static int do_list;
 
@@ -40,7 +40,7 @@
 
 static int do_track;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static int
 itemPrinter (EXTRACTOR_KeywordType type, const char *data, void *closure)
@@ -52,18 +52,18 @@
 }
 
 static void
-printMeta (const struct ECRS_MetaData *meta)
+printMeta (const struct GNUNET_ECRS_MetaData *meta)
 {
-  ECRS_getMetaData (meta, &itemPrinter, NULL);
+  GNUNET_ECRS_meta_data_get_contents (meta, &itemPrinter, NULL);
 }
 
 static int
-printNode (const ECRS_FileInfo * fi,
+printNode (const GNUNET_ECRS_FileInfo * fi,
            const GNUNET_HashCode * key, int isRoot, void *unused)
 {
   char *string;
 
-  string = ECRS_uriToString (fi->uri);
+  string = GNUNET_ECRS_uri_to_string (fi->uri);
   printf ("%s:\n", string);
   GNUNET_free (string);
   printMeta (fi->meta);
@@ -74,7 +74,7 @@
 printDirectory (const char *filename)
 {
   unsigned long long len;
-  struct ECRS_MetaData *md;
+  struct GNUNET_ECRS_MetaData *md;
   char *data;
   int ret;
   char *name;
@@ -100,13 +100,13 @@
       data = MMAP (NULL, len, PROT_READ, MAP_SHARED, fd, 0);
       if (data == MAP_FAILED)
         {
-          GE_LOG_STRERROR_FILE (ectx,
-                                GE_ERROR | GE_ADMIN | GE_BULK, "mmap", name);
+          GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "mmap", name);
           ret = -1;
         }
       else
         {
-          ret = ECRS_listDirectory (ectx, data, len, &md, &printNode, NULL);
+          ret = GNUNET_ECRS_directory_list_contents (ectx, data, len, &md, 
&printNode, NULL);
           MUNMAP (data, len);
         }
       CLOSE (fd);
@@ -118,7 +118,7 @@
   if (md != NULL)
     {
       printMeta (md);
-      ECRS_freeMetaData (md);
+      GNUNET_ECRS_meta_data_destroy (md);
     }
   printf ("\n");
   GNUNET_free (name);
@@ -141,7 +141,7 @@
   {'t', "track", NULL,
    gettext_noop ("start tracking entries for the directory database"),
    0, &GNUNET_getopt_configure_set_one, &do_track},
-   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -150,7 +150,7 @@
 main (int argc, char *const *argv)
 {
   int i;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
   i = GNUNET_init (argc,
                    argv,
@@ -163,14 +163,14 @@
     }
   if (do_list)
     printf (_("Listed %d matching entries.\n"),
-            URITRACK_listURIs (ectx, cfg, GNUNET_YES, &printNode, NULL));
+            GNUNET_URITRACK_list (ectx, cfg, GNUNET_YES, &printNode, NULL));
   if (do_kill)
     {
-      URITRACK_trackURIS (ectx, cfg, GNUNET_NO);
-      URITRACK_clearTrackedURIS (ectx, cfg);
+      GNUNET_URITRACK_toggle_tracking (ectx, cfg, GNUNET_NO);
+      GNUNET_URITRACK_clear (ectx, cfg);
     }
   if (do_track)
-    URITRACK_trackURIS (ectx, cfg, GNUNET_YES);
+    GNUNET_URITRACK_toggle_tracking (ectx, cfg, GNUNET_YES);
 
   while (i < argc)
     printDirectory (argv[i++]);

Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c  2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c  2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -29,9 +29,9 @@
 #include "gnunet_fsui_lib.h"
 #include "gnunet_util.h"
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static unsigned long long verbose;
 
@@ -39,7 +39,7 @@
 
 static int do_directory;
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
 static char *filename;
 
@@ -49,13 +49,13 @@
 
 static GNUNET_CronTime start_time;
 
-static struct FSUI_DownloadList *dl;
+static struct GNUNET_FSUI_DownloadList *dl;
 
 static int errorCode;
 
 static unsigned int downloads_running;
 
-static struct FSUI_DownloadList **downloads;
+static struct GNUNET_FSUI_DownloadList **downloads;
 
 static unsigned int downloads_size;
 
@@ -86,7 +86,7 @@
   {'R', "recursive", NULL,
    gettext_noop ("download a GNUnet directory recursively"),
    0, &GNUNET_getopt_configure_set_one, &do_recursive},
-   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -97,12 +97,12 @@
  * method exits once the download is complete.
  */
 static void *
-progressModel (void *unused, const FSUI_Event * event)
+progressModel (void *unused, const GNUNET_FSUI_Event * event)
 {
   GNUNET_mutex_lock (lock);
   switch (event->type)
     {
-    case FSUI_download_progress:
+    case GNUNET_FSUI_download_progress:
       if (verbose)
         {
           PRINTF (_("Download of file `%s' at "
@@ -115,7 +115,7 @@
                    / (double) GNUNET_CRON_SECONDS));
         }
       break;
-    case FSUI_download_aborted:
+    case GNUNET_FSUI_download_aborted:
       if (dl == event->data.DownloadError.dc.pos)
         {
           /* top-download aborted */
@@ -124,13 +124,13 @@
           GNUNET_shutdown_initiate ();
         }
       break;
-    case FSUI_download_error:
+    case GNUNET_FSUI_download_error:
       printf (_("Error downloading: %s\n"),
               event->data.DownloadError.message);
       errorCode = 3;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_download_completed:
+    case GNUNET_FSUI_download_completed:
       PRINTF (_("Download of file `%s' complete.  "
                 "Speed was %8.3f KiB per second.\n"),
               event->data.DownloadCompleted.filename,
@@ -144,14 +144,14 @@
           GNUNET_shutdown_initiate ();
         }
       break;
-    case FSUI_download_started:
+    case GNUNET_FSUI_download_started:
       downloads_running++;
       GNUNET_array_append (downloads, downloads_size,
                            event->data.DownloadStarted.dc.pos);
-    case FSUI_download_stopped:
+    case GNUNET_FSUI_download_stopped:
       break;
     default:
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
     }
   GNUNET_mutex_unlock (lock);
@@ -159,15 +159,15 @@
 }
 
 static int
-directoryIterator (const ECRS_FileInfo * fi,
+directoryIterator (const GNUNET_ECRS_FileInfo * fi,
                    const GNUNET_HashCode * key, int isRoot, void *cls)
 {
-  struct FSUI_Context *ctx = cls;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_FSUI_Context *ctx = cls;
+  struct GNUNET_ECRS_MetaData *meta;
   char *fn;
   char *f;
 
-  f = ECRS_getFirstFromMetaData (fi->meta,
+  f = GNUNET_ECRS_meta_data_get_first_by_types (fi->meta,
                                  EXTRACTOR_FILENAME,
                                  EXTRACTOR_TITLE,
                                  EXTRACTOR_ARTIST,
@@ -184,10 +184,10 @@
   if (verbose > 1)
     printf (_("Starting download `%s'\n"), f);
   GNUNET_free (f);
-  meta = ECRS_createMetaData ();
-  FSUI_startDownload (ctx,
+  meta = GNUNET_ECRS_meta_data_create ();
+  GNUNET_FSUI_download_start (ctx,
                       anonymity, do_recursive, fi->uri, meta, fn, NULL, NULL);
-  ECRS_freeMetaData (meta);
+  GNUNET_ECRS_meta_data_destroy (meta);
   GNUNET_free (fn);
   return GNUNET_OK;
 }
@@ -205,9 +205,9 @@
 {
   int ok;
   int try_rename;
-  struct FSUI_Context *ctx;
-  struct ECRS_URI *uri;
-  struct ECRS_MetaData *meta;
+  struct GNUNET_FSUI_Context *ctx;
+  struct GNUNET_ECRS_URI *uri;
+  struct GNUNET_ECRS_MetaData *meta;
   int i;
 
   i = GNUNET_init (argc,
@@ -221,25 +221,25 @@
     }
   if (i == argc)
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Not enough arguments. "
                 "You must specify a GNUnet file URI\n"));
       errorCode = -1;
       goto quit;
     }
-  GC_get_configuration_value_number (cfg,
+  GNUNET_GC_get_configuration_value_number (cfg,
                                      "GNUNET",
                                      "VERBOSE", 0, 9999, 0, &verbose);
   uri = NULL;
   if (!do_directory)
     {
-      uri = ECRS_stringToUri (ectx, argv[i]);
+      uri = GNUNET_ECRS_string_to_uri (ectx, argv[i]);
       if ((NULL == uri) ||
-          (!(ECRS_isLocationUri (uri) || ECRS_isFileUri (uri))))
+          (!(GNUNET_ECRS_uri_test_loc (uri) || GNUNET_ECRS_uri_test_chk 
(uri))))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("URI `%s' invalid for gnunet-download.\n"), argv[i]);
           errorCode = -1;
           goto quit;
@@ -269,15 +269,15 @@
         }
       else
         {
-          GE_ASSERT (ectx,
+          GNUNET_GE_ASSERT (ectx,
                      strlen (argv[i]) >
-                     strlen (ECRS_URI_PREFIX) + strlen (ECRS_FILE_INFIX));
+                     strlen (GNUNET_ECRS_URI_PREFIX) + strlen 
(GNUNET_ECRS_FILE_INFIX));
           filename = GNUNET_expand_file_name (ectx,
                                               &argv[i][strlen
-                                                       (ECRS_URI_PREFIX) +
+                                                       
(GNUNET_ECRS_URI_PREFIX) +
                                                        strlen
-                                                       (ECRS_FILE_INFIX)]);
-          GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+                                                       
(GNUNET_ECRS_FILE_INFIX)]);
+          GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                   _("No filename specified, using `%s' instead (for now).\n"),
                   filename);
           try_rename = GNUNET_YES;
@@ -285,7 +285,7 @@
     }
   ok = GNUNET_NO;
   lock = GNUNET_mutex_create (GNUNET_NO);
-  ctx = FSUI_start (ectx,
+  ctx = GNUNET_FSUI_start (ectx,
                     cfg,
                     "gnunet-download",
                     parallelism == 0 ? 1 : parallelism,
@@ -317,20 +317,20 @@
         {
           if (fd != -1)
             CLOSE (fd);
-          GE_LOG (ectx,
-                  GE_ERROR | GE_IMMEDIATE | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_IMMEDIATE | GNUNET_GE_USER,
                   _("Could not access gnunet-directory file `%s'\n"), efn);
-          FSUI_stop (ctx);
+          GNUNET_FSUI_stop (ctx);
           GNUNET_mutex_destroy (lock);
           GNUNET_free (efn);
           goto quit;
         }
-      meta = ECRS_createMetaData ();
-      count = ECRS_listDirectory (ectx,
+      meta = GNUNET_ECRS_meta_data_create ();
+      count = GNUNET_ECRS_directory_list_contents (ectx,
                                   data,
                                   sbuf.st_size,
                                   &meta, &directoryIterator, ctx);
-      ECRS_freeMetaData (meta);
+      GNUNET_ECRS_meta_data_destroy (meta);
       MUNMAP (data, sbuf.st_size);
       CLOSE (fd);
       GNUNET_free (efn);
@@ -345,14 +345,14 @@
     }
   else
     {
-      meta = ECRS_createMetaData ();
-      dl = FSUI_startDownload (ctx,
+      meta = GNUNET_ECRS_meta_data_create ();
+      dl = GNUNET_FSUI_download_start (ctx,
                                anonymity,
                                do_recursive, uri, meta, filename, NULL, NULL);
-      ECRS_freeMetaData (meta);
+      GNUNET_ECRS_meta_data_destroy (meta);
       if (dl == NULL)
         {
-          FSUI_stop (ctx);
+          GNUNET_FSUI_stop (ctx);
           GNUNET_mutex_destroy (lock);
           goto quit;
         }
@@ -361,17 +361,17 @@
   if (errorCode == 1)
     {
       for (i = 0; i < downloads_size; i++)
-        FSUI_abortDownload (ctx, downloads[i]);
+        GNUNET_FSUI_download_abort (ctx, downloads[i]);
     }
   for (i = 0; i < downloads_size; i++)
-    FSUI_stopDownload (ctx, downloads[i]);
+    GNUNET_FSUI_download_stop (ctx, downloads[i]);
   GNUNET_array_grow (downloads, downloads_size, 0);
-  FSUI_stop (ctx);
+  GNUNET_FSUI_stop (ctx);
   GNUNET_mutex_destroy (lock);
 
   if ((errorCode == 0) && (dl != NULL) && (try_rename == GNUNET_YES))
     {
-      char *newname = ECRS_suggestFilename (ectx,
+      char *newname = GNUNET_ECRS_suggest_better_filename (ectx,
                                             filename);
 
       if (newname != NULL)
@@ -382,7 +382,7 @@
     }
   GNUNET_free (filename);
   if (uri != NULL)
-    ECRS_freeUri (uri);
+    GNUNET_ECRS_uri_destroy (uri);
 quit:
   GNUNET_fini (ectx, cfg);
   return errorCode;

Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -39,27 +39,27 @@
 
 static int errorCode;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct FSUI_Context *ctx;
+static struct GNUNET_FSUI_Context *ctx;
 
-static struct FSUI_UploadList *ul;
+static struct GNUNET_FSUI_UploadList *ul;
 
 static GNUNET_CronTime start_time;
 
 /* ************ config options ******** */
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
-static struct ECRS_MetaData *meta;
+static struct GNUNET_ECRS_MetaData *meta;
 
-static struct ECRS_URI *topKeywords;
+static struct GNUNET_ECRS_URI *topKeywords;
 
-static struct ECRS_URI *gloKeywords;
+static struct GNUNET_ECRS_URI *gloKeywords;
 
-static struct ECRS_MetaData *meta;
+static struct GNUNET_ECRS_MetaData *meta;
 
 static unsigned int anonymity = 1;
 
@@ -101,12 +101,12 @@
  * post-processing.
  */
 static void
-postProcess (const struct ECRS_URI *uri)
+postProcess (const struct GNUNET_ECRS_URI *uri)
 {
   GNUNET_HashCode prevId;
   GNUNET_HashCode thisId;
   GNUNET_HashCode nextId;
-  struct ECRS_URI *nsuri;
+  struct GNUNET_ECRS_URI *nsuri;
   char *us;
 
   if (pseudonym == NULL)
@@ -114,7 +114,7 @@
   convertId (next_id, &nextId);
   convertId (this_id, &thisId);
   convertId (prev_id, &prevId);
-  nsuri = NS_addToNamespace (ectx,
+  nsuri = GNUNET_NS_add_to_namespace (ectx,
                              cfg,
                              anonymity,
                              priority,
@@ -126,8 +126,8 @@
                              next_id == NULL ? NULL : &nextId, uri, meta);
   if (nsuri != NULL)
     {
-      us = ECRS_uriToString (nsuri);
-      ECRS_freeUri (nsuri);
+      us = GNUNET_ECRS_uri_to_string (nsuri);
+      GNUNET_ECRS_uri_destroy (nsuri);
       printf (_("Created entry `%s' in namespace `%s'\n"), us, pseudonym);
       GNUNET_free (us);
     }
@@ -185,7 +185,7 @@
  * Print progess message.
  */
 static void *
-printstatus (void *ctx, const FSUI_Event * event)
+printstatus (void *ctx, const GNUNET_FSUI_Event * event)
 {
   unsigned long long *verboselevel = ctx;
   unsigned long long delta;
@@ -193,7 +193,7 @@
 
   switch (event->type)
     {
-    case FSUI_upload_progress:
+    case GNUNET_FSUI_upload_progress:
       if (*verboselevel)
         {
           char *ret;
@@ -212,7 +212,7 @@
           GNUNET_free (ret);
         }
       break;
-    case FSUI_upload_completed:
+    case GNUNET_FSUI_upload_completed:
       if (*verboselevel)
         {
           delta = GNUNET_get_time () - start_time;
@@ -226,7 +226,7 @@
                   : (double) (event->data.UploadCompleted.total
                               / 1024.0 * GNUNET_CRON_SECONDS / delta));
         }
-      fstring = ECRS_uriToString (event->data.UploadCompleted.uri);
+      fstring = GNUNET_ECRS_uri_to_string (event->data.UploadCompleted.uri);
       printf (_("File `%s' has URI: %s\n"),
               event->data.UploadCompleted.filename, fstring);
       GNUNET_free (fstring);
@@ -237,23 +237,23 @@
           GNUNET_shutdown_initiate ();
         }
       break;
-    case FSUI_upload_aborted:
+    case GNUNET_FSUI_upload_aborted:
       printf (_("\nUpload aborted.\n"));
       errorCode = 2;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_upload_error:
+    case GNUNET_FSUI_upload_error:
       printf (_("\nError uploading file: %s"),
               event->data.UploadError.message);
       errorCode = 3;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_upload_started:
-    case FSUI_upload_stopped:
+    case GNUNET_FSUI_upload_started:
+    case GNUNET_FSUI_upload_stopped:
       break;
     default:
       printf (_("\nUnexpected event: %d\n"), event->type);
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
     }
   return NULL;
@@ -293,15 +293,15 @@
    gettext_noop
    ("add an additional keyword for the top-level file or directory"
     " (this option can be specified multiple times)"),
-   1, &gnunet_getopt_configure_set_keywords, &topKeywords},
+   1, &GNUNET_ECRS_getopt_configure_set_keywords, &topKeywords},
   {'K', "global-key", "KEYWORD",
    gettext_noop ("add an additional keyword for all files and directories"
                  " (this option can be specified multiple times)"),
-   1, &gnunet_getopt_configure_set_keywords, &gloKeywords},
+   1, &GNUNET_ECRS_getopt_configure_set_keywords, &gloKeywords},
   GNUNET_COMMAND_LINE_OPTION_LOGGING,   /* -L */
   {'m', "meta", "TYPE:VALUE",
    gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
-   1, &gnunet_getopt_configure_set_metadata, &meta},
+   1, &GNUNET_ECRS_getopt_configure_set_metadata, &meta},
   {'n', "noindex", NULL,
    gettext_noop ("do not index, perform full insertion (stores entire "
                  "file in encrypted form in GNUnet database)"),
@@ -334,7 +334,7 @@
    gettext_noop ("ID of the previous version of the content"
                  " (for namespace update only)"),
    1, &GNUNET_getopt_configure_set_string, &prev_id},
-   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -354,7 +354,7 @@
   char *tmp;
   unsigned long long verbose;
 
-  meta = ECRS_createMetaData ();
+  meta = GNUNET_ECRS_meta_data_create ();
   i = GNUNET_init (argc,
                    argv,
                    "gnunet-insert [OPTIONS] FILENAME",
@@ -382,37 +382,37 @@
 
       l = EXTRACTOR_loadDefaultLibraries ();
       ex = NULL;
-      GC_get_configuration_value_string (cfg, "FS", "EXTRACTORS", "", &ex);
+      GNUNET_GC_get_configuration_value_string (cfg, "FS", "EXTRACTORS", "", 
&ex);
       if (strlen (ex) > 0)
         l = EXTRACTOR_loadConfigLibraries (l, ex);
       GNUNET_free (ex);
       dirname = GNUNET_expand_file_name (ectx, filename);
-      GE_ASSERT (ectx, dirname != NULL);
+      GNUNET_GE_ASSERT (ectx, dirname != NULL);
       while ((strlen (dirname) > 0) &&
              (dirname[strlen (dirname) - 1] == DIR_SEPARATOR))
         dirname[strlen (dirname) - 1] = '\0';
       fname = dirname;
       while (strstr (fname, DIR_SEPARATOR_STR) != NULL)
         fname = strstr (fname, DIR_SEPARATOR_STR) + 1;
-      GE_ASSERT (ectx, fname != dirname);
+      GNUNET_GE_ASSERT (ectx, fname != dirname);
       fname[-1] = '\0';
       listKeywords (fname, dirname, l);
       GNUNET_free (dirname);
       EXTRACTOR_removeAll (l);
-      ECRS_freeMetaData (meta);
+      GNUNET_ECRS_meta_data_destroy (meta);
 
       errorCode = 0;
       goto quit;
     }
 
 
-  GC_get_configuration_value_number (cfg,
+  GNUNET_GC_get_configuration_value_number (cfg,
                                      "GNUNET",
                                      "VERBOSE", 0, 9999, 0, &verbose);
   /* check arguments */
   if (pseudonym != NULL)
     {
-      if (GNUNET_OK != ECRS_testNamespaceExists (ectx, cfg, pseudonym, NULL))
+      if (GNUNET_OK != GNUNET_ECRS_namespace_test_exists (ectx, cfg, 
pseudonym, NULL))
         {
           printf (_("Could not access namespace `%s' (does not exist?).\n"),
                   pseudonym);
@@ -431,8 +431,8 @@
 #endif
           if ((NULL == strptime (creation_time, fmt, &t)))
             {
-              GE_LOG_STRERROR (ectx,
-                               GE_FATAL | GE_USER | GE_IMMEDIATE, "strptime");
+              GNUNET_GE_LOG_STRERROR (ectx,
+                               GNUNET_GE_FATAL | GNUNET_GE_USER | 
GNUNET_GE_IMMEDIATE, "strptime");
               printf (_("Parsing time failed. Use `%s' format.\n"), fmt);
               errorCode = -1;
               goto quit;
@@ -484,18 +484,18 @@
     }
 
   /* fundamental init */
-  ctx = FSUI_start (ectx, cfg, "gnunet-insert", GNUNET_NO, 32,  /* make 
configurable */
+  ctx = GNUNET_FSUI_start (ectx, cfg, "gnunet-insert", GNUNET_NO, 32,  /* make 
configurable */
                     &printstatus, &verbose);
 
   /* first insert all of the top-level files or directories */
   tmp = GNUNET_expand_file_name (ectx, filename);
   if (!do_disable_creation_time)
-    ECRS_addPublicationDateToMetaData (meta);
+    GNUNET_ECRS_meta_data_add_publication_date (meta);
   start_time = GNUNET_get_time ();
   errorCode = 1;
-  ul = FSUI_startUpload (ctx,
+  ul = GNUNET_FSUI_upload_star (ctx,
                          tmp,
-                         (DirectoryScanCallback) & GNUNET_disk_directory_scan,
+                         (GNUNET_FSUI_DirectoryScanCallback) & 
GNUNET_disk_directory_scan,
                          ectx,
                          anonymity,
                          priority,
@@ -505,19 +505,19 @@
                          start_time + 2 * GNUNET_CRON_YEARS,
                          meta, gloKeywords, topKeywords);
   if (gloKeywords != NULL)
-    ECRS_freeUri (gloKeywords);
+    GNUNET_ECRS_uri_destroy (gloKeywords);
   if (topKeywords != NULL)
-    ECRS_freeUri (topKeywords);
+    GNUNET_ECRS_uri_destroy (topKeywords);
   GNUNET_free (tmp);
   if (ul != NULL)
     {
       GNUNET_shutdown_wait_for ();
       if (errorCode == 1)
-        FSUI_abortUpload (ctx, ul);
-      FSUI_stopUpload (ctx, ul);
+        GNUNET_FSUI_upload_abort (ctx, ul);
+      GNUNET_FSUI_upload_stop (ctx, ul);
     }
-  ECRS_freeMetaData (meta);
-  FSUI_stop (ctx);
+  GNUNET_ECRS_meta_data_destroy (meta);
+  GNUNET_FSUI_stop (ctx);
 
 quit:
   GNUNET_fini (ectx, cfg);

Modified: GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -30,9 +30,9 @@
 #include "gnunet_namespace_lib.h"
 #include "gnunet_util.h"
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static int start_collection;
 
@@ -56,11 +56,11 @@
 
 static GNUNET_CronTime expiration = 2 * GNUNET_CRON_YEARS;
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
-static struct ECRS_MetaData *meta;
+static struct GNUNET_ECRS_MetaData *meta;
 
-static struct ECRS_URI *advertisement;
+static struct GNUNET_ECRS_URI *advertisement;
 
 /**
  * All gnunet-pseudonym command line options
@@ -87,10 +87,10 @@
   {'k', "keyword", "KEYWORD",
    gettext_noop
    ("use the given keyword to advertise the namespace (use when creating a new 
pseudonym)"),
-   1, &gnunet_getopt_configure_set_keywords, &advertisement},
+   1, &GNUNET_ECRS_getopt_configure_set_keywords, &advertisement},
   {'m', "meta", "TYPE=VALUE",
    gettext_noop ("specify metadata describing the namespace or collection"),
-   1, &gnunet_getopt_configure_set_metadata, &meta},
+   1, &GNUNET_ECRS_getopt_configure_set_metadata, &meta},
   {'n', "no-advertisement", NULL,
    gettext_noop
    ("do not generate an advertisement for this namespace (use when creating a 
new pseudonym)"),
@@ -105,7 +105,7 @@
   {'s', "set-rating", "ID:VALUE",
    gettext_noop ("set the rating of a namespace"),
    0, &GNUNET_getopt_configure_set_string, &set_rating},
-   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -120,16 +120,16 @@
 }
 
 static void
-printMeta (const struct ECRS_MetaData *m)
+printMeta (const struct GNUNET_ECRS_MetaData *m)
 {
-  ECRS_getMetaData (m, &itemPrinter, NULL);
+  GNUNET_ECRS_meta_data_get_contents (m, &itemPrinter, NULL);
 }
 
 static int
 namespacePrinter (void *unused,
                   const char *namespaceName,
                   const GNUNET_HashCode * id,
-                  const struct ECRS_MetaData *md, int rating)
+                  const struct GNUNET_ECRS_MetaData *md, int rating)
 {
   GNUNET_EncName enc;
   int cpos;
@@ -166,7 +166,7 @@
 
       if (delta != 0)
         {
-          rating = NS_rankNamespace (ectx, cfg, namespaceName, delta);
+          rating = GNUNET_NS_namespace_rank (ectx, cfg, namespaceName, delta);
           printf (_("\tRating (after update): %d\n"), rating);
         }
     }
@@ -182,24 +182,24 @@
   int i;
   GNUNET_HashCode hc;
 
-  meta = ECRS_createMetaData ();
+  meta = GNUNET_ECRS_meta_data_create ();
   i = GNUNET_init (argc,
                    argv,
                    "gnunet-pseudonym [OPTIONS]",
                    &cfgFilename, gnunetpseudonymOptions, &ectx, &cfg);
   if (i == -1)
     {
-      ECRS_freeMetaData (meta);
+      GNUNET_ECRS_meta_data_destroy (meta);
       GNUNET_fini (ectx, cfg);
       return -1;
     }
   success = 0;                  /* no errors */
-  CO_init (ectx, cfg);
+  GNUNET_CO_init (ectx, cfg);
 
   /* stop collections */
   if (stop_collection && (!start_collection))
     {
-      if (GNUNET_OK == CO_stopCollection ())
+      if (GNUNET_OK == GNUNET_CO_collection_stop ())
         printf (_("Collection stopped.\n"));
       else
         printf (_("Failed to stop collection (not active?).\n"));
@@ -208,7 +208,7 @@
   /* delete pseudonyms */
   if (delete_name != NULL)
     {
-      if (GNUNET_OK == NS_deleteNamespace (ectx, cfg, delete_name))
+      if (GNUNET_OK == GNUNET_NS_namespace_delete (ectx, cfg, delete_name))
         {
           printf (_("Pseudonym `%s' deleted.\n"), delete_name);
         }
@@ -226,8 +226,8 @@
     {
       if (start_collection)
         {
-          ECRS_addToMetaData (meta, EXTRACTOR_OWNER, create_name);
-          if (GNUNET_OK == CO_startCollection (anonymity, priority, 
ECRS_SBLOCK_UPDATE_SPORADIC,        /* FIXME: allow other update policies */
+          GNUNET_ECRS_meta_data_inser (meta, EXTRACTOR_OWNER, create_name);
+          if (GNUNET_OK == GNUNET_CO_collection_start (anonymity, priority, 
GNUNET_ECRS_SBLOCK_UPDATE_SPORADIC,        /* FIXME: allow other update 
policies */
                                                create_name, meta))
             {
               printf (_("Started collection `%s'.\n"), create_name);
@@ -238,12 +238,12 @@
               success++;
             }
 
-          ECRS_delFromMetaData (meta, EXTRACTOR_OWNER, create_name);
+          GNUNET_ECRS_meta_data_delete (meta, EXTRACTOR_OWNER, create_name);
         }
       else
         {                       /* no collection */
           GNUNET_HashCode rootEntry;
-          struct ECRS_URI *rootURI;
+          struct GNUNET_ECRS_URI *rootURI;
           char *root;
 
           if (root_name == NULL)
@@ -258,15 +258,15 @@
           if (no_advertisement)
             {
               if (advertisement != NULL)
-                ECRS_freeUri (advertisement);
+                GNUNET_ECRS_uri_destroy (advertisement);
               advertisement = NULL;
             }
           else
             {
               if (advertisement == NULL)
-                advertisement = ECRS_parseCharKeywordURI (ectx, "namespace");
+                advertisement = GNUNET_ECRS_keyword_string_to_uri (ectx, 
"namespace");
             }
-          rootURI = NS_createNamespace (ectx,
+          rootURI = GNUNET_NS_namespace_create (ectx,
                                         cfg,
                                         anonymity,
                                         priority,
@@ -281,14 +281,14 @@
             }
           else
             {
-              root = ECRS_uriToString (rootURI);
+              root = GNUNET_ECRS_uri_to_string (rootURI);
               printf (_("Namespace `%s' created (root: %s).\n"),
                       create_name, root);
               GNUNET_free (root);
-              ECRS_freeUri (rootURI);
+              GNUNET_ECRS_uri_destroy (rootURI);
             }
           if (NULL != advertisement)
-            ECRS_freeUri (advertisement);
+            GNUNET_ECRS_uri_destroy (advertisement);
         }
       GNUNET_free (create_name);
       create_name = NULL;
@@ -303,12 +303,12 @@
   if (0 == be_quiet)
     {
       /* print information about pseudonyms */
-      cnt = NS_listNamespaces (ectx, cfg, &namespacePrinter, NULL);
+      cnt = GNUNET_NS_namespace_list_all (ectx, cfg, &namespacePrinter, NULL);
       if (cnt == -1)
         printf (_("Could not access namespace information.\n"));
     }
-  ECRS_freeMetaData (meta);
-  CO_done ();
+  GNUNET_ECRS_meta_data_destroy (meta);
+  GNUNET_CO_done ();
   GNUNET_fini (ectx, cfg);
   return success;
 }

Modified: GNUnet/src/applications/fs/tools/gnunet-search.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-search.c    2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/tools/gnunet-search.c    2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -30,9 +30,9 @@
 #include "gnunet_util.h"
 
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static unsigned int anonymity = 1;
 
@@ -40,13 +40,13 @@
 
 static unsigned int max_results;
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
 static char *output_filename;
 
 static int errorCode;
 
-static ECRS_FileInfo *fis;
+static GNUNET_ECRS_FileInfo *fis;
 
 static unsigned int fiCount;
 
@@ -61,44 +61,44 @@
 }
 
 static void
-printMeta (const struct ECRS_MetaData *meta)
+printMeta (const struct GNUNET_ECRS_MetaData *meta)
 {
-  ECRS_getMetaData (meta, &itemPrinter, NULL);
+  GNUNET_ECRS_meta_data_get_contents (meta, &itemPrinter, NULL);
 }
 
 /**
  * Handle the search result.
  */
 static void *
-eventCallback (void *cls, const FSUI_Event * event)
+eventCallback (void *cls, const GNUNET_FSUI_Event * event)
 {
   char *uri;
   char *filename;
 
   switch (event->type)
     {
-    case FSUI_search_error:
+    case GNUNET_FSUI_search_error:
       errorCode = 3;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_search_aborted:
+    case GNUNET_FSUI_search_aborted:
       errorCode = 4;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_search_completed:
+    case GNUNET_FSUI_search_completed:
       errorCode = 0;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_search_result:
+    case GNUNET_FSUI_search_result:
       /* retain URIs for possible directory dump later */
       GNUNET_array_grow (fis, fiCount, fiCount + 1);
-      fis[fiCount - 1].uri = ECRS_dupUri (event->data.SearchResult.fi.uri);
+      fis[fiCount - 1].uri = GNUNET_ECRS_uri_duplicate 
(event->data.SearchResult.fi.uri);
       fis[fiCount - 1].meta
-        = ECRS_dupMetaData (event->data.SearchResult.fi.meta);
+        = GNUNET_ECRS_meta_data_duplicate (event->data.SearchResult.fi.meta);
 
-      uri = ECRS_uriToString (event->data.SearchResult.fi.uri);
+      uri = GNUNET_ECRS_uri_to_string (event->data.SearchResult.fi.uri);
       printf ("%s:\n", uri);
-      filename = ECRS_getFromMetaData (event->data.SearchResult.fi.meta,
+      filename = GNUNET_ECRS_meta_data_get_by_type 
(event->data.SearchResult.fi.meta,
                                        EXTRACTOR_FILENAME);
       if (filename != NULL)
         {
@@ -116,11 +116,11 @@
       GNUNET_free_non_null (filename);
       GNUNET_free (uri);
       break;
-    case FSUI_search_started:
-    case FSUI_search_stopped:
+    case GNUNET_FSUI_search_started:
+    case GNUNET_FSUI_search_stopped:
       break;
     default:
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       break;
     }
   return NULL;
@@ -146,7 +146,7 @@
   {'t', "timeout", "DELAY",
    gettext_noop ("wait DELAY seconds for search results before aborting"),
    1, &GNUNET_getopt_configure_set_uint, &delay},
-   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+   GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -161,10 +161,10 @@
 int
 main (int argc, char *const *argv)
 {
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
-  struct FSUI_Context *ctx;
-  struct FSUI_SearchList *s;
+  struct GNUNET_FSUI_Context *ctx;
+  struct GNUNET_FSUI_SearchList *s;
 
   i = GNUNET_init (argc,
                    argv,
@@ -176,7 +176,7 @@
       return -1;
     }
   /* convert args to URI */
-  uri = ECRS_parseArgvKeywordURI (ectx, argc - i, (const char **) &argv[i]);
+  uri = GNUNET_ECRS_keyword_command_line_to_uri (ectx, argc - i, (const char 
**) &argv[i]);
   if (uri == NULL)
     {
       printf (_("Error converting arguments to URI!\n"));
@@ -186,42 +186,42 @@
   if (max_results == 0)
     max_results = (unsigned int) -1;    /* infty */
   ctx =
-    FSUI_start (ectx, cfg, "gnunet-search", 4, GNUNET_NO, &eventCallback,
+    GNUNET_FSUI_start (ectx, cfg, "gnunet-search", 4, GNUNET_NO, 
&eventCallback,
                 NULL);
   if (ctx == NULL)
     {
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_uri_destroy (uri);
       GNUNET_fini (ectx, cfg);
       return GNUNET_SYSERR;
     }
   errorCode = 1;
-  s = FSUI_startSearch (ctx,
+  s = GNUNET_FSUI_search_start (ctx,
                         anonymity, max_results, delay * GNUNET_CRON_SECONDS,
                         uri);
-  ECRS_freeUri (uri);
+  GNUNET_ECRS_uri_destroy (uri);
   if (s == NULL)
     {
       errorCode = 2;
-      FSUI_stop (ctx);
+      GNUNET_FSUI_stop (ctx);
       goto quit;
     }
   GNUNET_shutdown_wait_for ();
   if (errorCode == 1)
-    FSUI_abortSearch (ctx, s);
-  FSUI_stopSearch (ctx, s);
-  FSUI_stop (ctx);
+    GNUNET_FSUI_search_abort (ctx, s);
+  GNUNET_FSUI_search_stop (ctx, s);
+  GNUNET_FSUI_stop (ctx);
 
   if (output_filename != NULL)
     {
       char *outfile;
       unsigned long long n;
       char *data;
-      struct ECRS_MetaData *meta;
+      struct GNUNET_ECRS_MetaData *meta;
 
-      meta = ECRS_createMetaData ();
+      meta = GNUNET_ECRS_meta_data_create ();
       /* ?: anything here to put into meta? */
       if (GNUNET_OK ==
-          ECRS_createDirectory (ectx, &data, &n, fiCount, fis, meta))
+          GNUNET_ECRS_directory_create (ectx, &data, &n, fiCount, fis, meta))
         {
           outfile = GNUNET_expand_file_name (ectx, output_filename);
           GNUNET_disk_file_write (ectx, outfile, data, n, "600");
@@ -232,8 +232,8 @@
     }
   for (i = 0; i < fiCount; i++)
     {
-      ECRS_freeUri (fis[i].uri);
-      ECRS_freeMetaData (fis[i].meta);
+      GNUNET_ECRS_uri_destroy (fis[i].uri);
+      GNUNET_ECRS_meta_data_destroy (fis[i].meta);
     }
   GNUNET_array_grow (fis, fiCount, 0);
 quit:

Modified: GNUnet/src/applications/fs/tools/gnunet-unindex.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-unindex.c   2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/tools/gnunet-unindex.c   2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -32,28 +32,28 @@
 #include "gnunet_fsui_lib.h"
 #include "gnunet_util.h"
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static GNUNET_CronTime start_time;
 
 static int errorCode;
 
-static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
+static char *cfgFilename = GNUNET_DEFAULT_CLIENT_CONFIG_FILE;
 
 /**
  * Print progess message.
  */
 static void *
-printstatus (void *cls, const FSUI_Event * event)
+printstatus (void *cls, const GNUNET_FSUI_Event * event)
 {
   unsigned long long *verboselevel = cls;
   unsigned long long delta;
 
   switch (event->type)
     {
-    case FSUI_unindex_progress:
+    case GNUNET_FSUI_unindex_progress:
       if (*verboselevel)
         {
           delta = event->data.UnindexProgress.eta - GNUNET_get_time ();
@@ -65,7 +65,7 @@
           printf ("\r");
         }
       break;
-    case FSUI_unindex_completed:
+    case GNUNET_FSUI_unindex_completed:
       if (*verboselevel)
         {
           delta = GNUNET_get_time () - start_time;
@@ -84,17 +84,17 @@
       errorCode = 0;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_unindex_error:
+    case GNUNET_FSUI_unindex_error:
       printf (_("\nError unindexing file: %s\n"),
               event->data.UnindexError.message);
       errorCode = 3;
       GNUNET_shutdown_initiate ();
       break;
-    case FSUI_unindex_started:
-    case FSUI_unindex_stopped:
+    case GNUNET_FSUI_unindex_started:
+    case GNUNET_FSUI_unindex_stopped:
       break;
     default:
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       break;
     }
   return NULL;
@@ -108,7 +108,7 @@
   GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Unindex files.")),   /* -h */
   GNUNET_COMMAND_LINE_OPTION_HOSTNAME,  /* -H */
   GNUNET_COMMAND_LINE_OPTION_LOGGING,   /* -L */
-  GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION),        /* -v */
+  GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGNUNET_GE_VERSION),        /* -v */
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -123,11 +123,11 @@
 int
 main (int argc, char *const *argv)
 {
-  static struct FSUI_Context *ctx;
+  static struct GNUNET_FSUI_Context *ctx;
   char *filename;
   int i;
   unsigned long long verbose;
-  struct FSUI_UnindexList *ul;
+  struct GNUNET_FSUI_UnindexList *ul;
 
   i = GNUNET_init (argc,
                    argv,
@@ -140,37 +140,37 @@
     }
   if (i == argc)
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Not enough arguments. " "You must specify a filename.\n"));
       GNUNET_fini (ectx, cfg);
       return -1;
     }
-  GC_get_configuration_value_number (cfg,
+  GNUNET_GC_get_configuration_value_number (cfg,
                                      "GNUNET",
                                      "VERBOSE", 0, 9999, 0, &verbose);
   /* fundamental init */
-  ctx = FSUI_start (ectx,
+  ctx = GNUNET_FSUI_start (ectx,
                     cfg, "gnunet-unindex", 2, GNUNET_NO, &printstatus,
                     &verbose);
   errorCode = 1;
   start_time = GNUNET_get_time ();
   filename = GNUNET_expand_file_name (ectx, argv[i]);
-  ul = FSUI_startUnindex (ctx, filename);
+  ul = GNUNET_FSUI_unindex_start (ctx, filename);
   if (ul == NULL)
     {
-      printf (_("`%s' failed.  Is `%s' a file?\n"), "FSUI_unindex", filename);
+      printf (_("`%s' failed.  Is `%s' a file?\n"), "GNUNET_FSUI_unindex", 
filename);
       errorCode = 2;
     }
   else
     {
       GNUNET_shutdown_wait_for ();
       if (errorCode == 1)
-        FSUI_abortUnindex (ctx, ul);
-      FSUI_stopUnindex (ctx, ul);
+        GNUNET_FSUI_unindex_abort (ctx, ul);
+      GNUNET_FSUI_unindex_stop (ctx, ul);
     }
   GNUNET_free (filename);
-  FSUI_stop (ctx);
+  GNUNET_FSUI_stop (ctx);
   GNUNET_fini (ectx, cfg);
   return errorCode;
 }

Modified: GNUnet/src/applications/fs/uritrack/callbacks.c
===================================================================
--- GNUnet/src/applications/fs/uritrack/callbacks.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/uritrack/callbacks.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,11 +34,11 @@
  */
 typedef struct
 {
-  struct GE_Context *ectx;
+  struct GNUNET_GE_Context *ectx;
 
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  ECRS_SearchProgressCallback iterator;
+  GNUNET_ECRS_SearchResultProcessor iterator;
 
   void *closure;
 
@@ -54,7 +54,7 @@
 static unsigned int callbacks_size;
 
 static int
-init_iterator (const ECRS_FileInfo * fi,
+init_iterator (const GNUNET_ECRS_FileInfo * fi,
                const GNUNET_HashCode * key, int isRoot, void *closure)
 {
   Callback *c = closure;
@@ -69,7 +69,7 @@
 init_thread (void *arg)
 {
   Callback *c = arg;
-  URITRACK_listURIs (c->ectx, c->cfg, GNUNET_YES, &init_iterator, arg);
+  GNUNET_URITRACK_list (c->ectx, c->cfg, GNUNET_YES, &init_iterator, arg);
   return NULL;
 }
 
@@ -80,9 +80,9 @@
  * for all existing URIs as well.
  */
 int
-URITRACK_registerTrackCallback (struct GE_Context *ectx,
-                                struct GC_Configuration *cfg,
-                                ECRS_SearchProgressCallback iterator,
+GNUNET_URITRACK_register_track_callback (struct GNUNET_GE_Context *ectx,
+                                struct GNUNET_GC_Configuration *cfg,
+                                GNUNET_ECRS_SearchResultProcessor iterator,
                                 void *closure)
 {
   Callback *c;
@@ -105,7 +105,7 @@
  * Unregister a URI callback.
  */
 int
-URITRACK_unregisterTrackCallback (ECRS_SearchProgressCallback iterator,
+GNUNET_URITRACK_unregister_track_callback (GNUNET_ECRS_SearchResultProcessor 
iterator,
                                   void *closure)
 {
   int i;
@@ -135,7 +135,7 @@
  * Internal notification about new tracked URI.
  */
 void
-URITRACK_internal_notify (const ECRS_FileInfo * fi)
+URITRACK_internal_notify (const GNUNET_ECRS_FileInfo * fi)
 {
   int i;
 

Modified: GNUnet/src/applications/fs/uritrack/callbacks.h
===================================================================
--- GNUnet/src/applications/fs/uritrack/callbacks.h     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/uritrack/callbacks.h     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -30,6 +30,6 @@
 /**
  * Internal notification about new tracked URI.
  */
-void URITRACK_internal_notify (const ECRS_FileInfo * fi);
+void URITRACK_internal_notify (const GNUNET_ECRS_FileInfo * fi);
 
 #endif

Modified: GNUnet/src/applications/fs/uritrack/file_info.c
===================================================================
--- GNUnet/src/applications/fs/uritrack/file_info.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/uritrack/file_info.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -39,17 +39,17 @@
 #define TRACK_OPTION "fs_uridb_status"
 
 static struct GNUNET_IPC_Semaphore *
-createIPC (struct GE_Context *ectx, struct GC_Configuration *cfg)
+createIPC (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg)
 {
   char *basename;
   char *ipcName;
   struct GNUNET_IPC_Semaphore *sem;
   size_t n;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &basename);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, 
&basename);
   n = strlen (basename) + 512;
   ipcName = GNUNET_malloc (n);
   GNUNET_snprintf (ipcName, n, "%s/directory_ipc_lock", basename);
@@ -60,15 +60,15 @@
 }
 
 static char *
-getUriDbName (struct GE_Context *ectx, struct GC_Configuration *cfg)
+getUriDbName (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration 
*cfg)
 {
   char *nw;
   char *pfx;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &pfx);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &pfx);
   nw = GNUNET_malloc (strlen (pfx) + strlen (STATE_NAME) + 2);
   strcpy (nw, pfx);
   strcat (nw, DIR_SEPARATOR_STR);
@@ -79,15 +79,15 @@
 }
 
 static char *
-getToggleName (struct GE_Context *ectx, struct GC_Configuration *cfg)
+getToggleName (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration 
*cfg)
 {
   char *nw;
   char *pfx;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &pfx);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, &pfx);
   nw = GNUNET_malloc (strlen (pfx) + strlen (TRACK_OPTION) + 2);
   strcpy (nw, pfx);
   strcat (nw, DIR_SEPARATOR_STR);
@@ -103,7 +103,7 @@
  * @return GNUNET_YES of tracking is enabled, GNUNET_NO if not
  */
 int
-URITRACK_trackStatus (struct GE_Context *ectx, struct GC_Configuration *cfg)
+GNUNET_URITRACK_get_tracking_status (struct GNUNET_GE_Context *ectx, struct 
GNUNET_GC_Configuration *cfg)
 {
   int status;
   char *tn;
@@ -122,8 +122,8 @@
     {
       GNUNET_free (tn);
 #if DEBUG_FILE_INFO
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               _("Collecting file identifiers disabled.\n"));
 #endif
       return GNUNET_NO;
@@ -137,16 +137,16 @@
 
 struct CheckPresentClosure
 {
-  const ECRS_FileInfo *fi;
+  const GNUNET_ECRS_FileInfo *fi;
   int present;
 };
 
 static int
-checkPresent (const ECRS_FileInfo * fi,
+checkPresent (const GNUNET_ECRS_FileInfo * fi,
               const GNUNET_HashCode * key, int isRoot, void *closure)
 {
   struct CheckPresentClosure *cpc = closure;
-  if (ECRS_equalsUri (fi->uri, cpc->fi->uri))
+  if (GNUNET_ECRS_uri_test_equal (fi->uri, cpc->fi->uri))
     {
       cpc->present = 1;
       return GNUNET_SYSERR;
@@ -158,8 +158,8 @@
  * Makes a URI available for directory building.
  */
 void
-URITRACK_trackURI (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg, const ECRS_FileInfo * fi)
+GNUNET_URITRACK_track (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg, const 
GNUNET_ECRS_FileInfo * fi)
 {
   struct GNUNET_IPC_Semaphore *sem;
   char *data;
@@ -169,26 +169,26 @@
   char *fn;
   struct CheckPresentClosure cpc;
 
-  if (GNUNET_NO == URITRACK_trackStatus (ectx, cfg))
+  if (GNUNET_NO == GNUNET_URITRACK_get_tracking_status (ectx, cfg))
     return;
   cpc.present = 0;
   cpc.fi = fi;
-  URITRACK_listURIs (ectx, cfg, GNUNET_NO, &checkPresent, &cpc);
+  GNUNET_URITRACK_list (ectx, cfg, GNUNET_NO, &checkPresent, &cpc);
   if (cpc.present == 1)
     return;
-  size = ECRS_sizeofMetaData (fi->meta,
-                              ECRS_SERIALIZE_FULL |
-                              ECRS_SERIALIZE_NO_COMPRESS);
+  size = GNUNET_ECRS_meta_data_get_serialized_size (fi->meta,
+                              GNUNET_ECRS_SERIALIZE_FULL |
+                              GNUNET_ECRS_SERIALIZE_NO_COMPRESS);
   data = GNUNET_malloc (size);
-  GE_ASSERT (ectx,
-             size == ECRS_serializeMetaData (ectx,
+  GNUNET_GE_ASSERT (ectx,
+             size == GNUNET_ECRS_meta_data_serialize (ectx,
                                              fi->meta,
                                              data,
                                              size,
-                                             ECRS_SERIALIZE_FULL |
-                                             ECRS_SERIALIZE_NO_COMPRESS));
+                                             GNUNET_ECRS_SERIALIZE_FULL |
+                                             
GNUNET_ECRS_SERIALIZE_NO_COMPRESS));
   size = htonl (size);
-  suri = ECRS_uriToString (fi->uri);
+  suri = GNUNET_ECRS_uri_to_string (fi->uri);
   sem = createIPC (ectx, cfg);
   GNUNET_IPC_semaphore_down (sem, GNUNET_YES);
   fn = getUriDbName (ectx, cfg);
@@ -216,8 +216,8 @@
  * from the tracking database.
  */
 void
-URITRACK_clearTrackedURIS (struct GE_Context *ectx,
-                           struct GC_Configuration *cfg)
+GNUNET_URITRACK_clear (struct GNUNET_GE_Context *ectx,
+                           struct GNUNET_GC_Configuration *cfg)
 {
   struct GNUNET_IPC_Semaphore *sem;
   char *fn;
@@ -228,8 +228,8 @@
   if (GNUNET_YES == GNUNET_disk_file_test (ectx, fn))
     {
       if (0 != UNLINK (fn))
-        GE_LOG_STRERROR_FILE (ectx,
-                              GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
+        GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                              GNUNET_GE_ERROR | GNUNET_GE_USER | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK,
                               "unlink", fn);
     }
   GNUNET_free (fn);
@@ -244,8 +244,8 @@
  *  disabling tracking
  */
 void
-URITRACK_trackURIS (struct GE_Context *ectx,
-                    struct GC_Configuration *cfg, int onOff)
+GNUNET_URITRACK_toggle_tracking (struct GNUNET_GE_Context *ectx,
+                    struct GNUNET_GC_Configuration *cfg, int onOff)
 {
   int o = htonl (onOff);
   char *tn;
@@ -266,10 +266,10 @@
  * @return number of entries found
  */
 int
-URITRACK_listURIs (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg,
+GNUNET_URITRACK_list (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg,
                    int need_metadata,
-                   ECRS_SearchProgressCallback iterator, void *closure)
+                   GNUNET_ECRS_SearchResultProcessor iterator, void *closure)
 {
   struct GNUNET_IPC_Semaphore *sem;
   int rval;
@@ -278,7 +278,7 @@
   off_t pos;
   off_t spos;
   unsigned int msize;
-  ECRS_FileInfo fi;
+  GNUNET_ECRS_FileInfo fi;
   int fd;
   char *fn;
   struct stat buf;
@@ -298,8 +298,8 @@
     {
       GNUNET_IPC_semaphore_up (sem);
       GNUNET_IPC_semaphore_destroy (sem);
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_ADMIN 
| GNUNET_GE_BULK,
                             "open", fn);
       GNUNET_free (fn);
       return GNUNET_SYSERR;     /* error opening URI db */
@@ -308,8 +308,8 @@
   if (result == MAP_FAILED)
     {
       CLOSE (fd);
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_USER | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_ADMIN 
| GNUNET_GE_BULK,
                             "mmap", fn);
       GNUNET_free (fn);
       GNUNET_IPC_semaphore_up (sem);
@@ -327,13 +327,13 @@
       spos++;                   /* skip '\0' */
       if ((spos + sizeof (int) >= ret) || (spos + sizeof (int) < spos))
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FORMATERROR;
         }
-      fi.uri = ECRS_stringToUri (ectx, &result[pos]);
+      fi.uri = GNUNET_ECRS_string_to_uri (ectx, &result[pos]);
       if (fi.uri == NULL)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           goto FORMATERROR;
         }
       memcpy (&msize, &result[spos], sizeof (int));
@@ -341,17 +341,17 @@
       spos += sizeof (int);
       if ((spos + msize > ret) || (spos + msize < spos))
         {
-          GE_BREAK (ectx, 0);
-          ECRS_freeUri (fi.uri);
+          GNUNET_GE_BREAK (ectx, 0);
+          GNUNET_ECRS_uri_destroy (fi.uri);
           goto FORMATERROR;
         }
       if (need_metadata == GNUNET_YES)
         {
-          fi.meta = ECRS_deserializeMetaData (ectx, &result[spos], msize);
+          fi.meta = GNUNET_ECRS_meta_data_deserialize (ectx, &result[spos], 
msize);
           if (fi.meta == NULL)
             {
-              GE_BREAK (ectx, 0);
-              ECRS_freeUri (fi.uri);
+              GNUNET_GE_BREAK (ectx, 0);
+              GNUNET_ECRS_uri_destroy (fi.uri);
               goto FORMATERROR;
             }
         }
@@ -365,11 +365,11 @@
           if (GNUNET_OK != iterator (&fi, NULL, GNUNET_NO, closure))
             {
               if (fi.meta != NULL)
-                ECRS_freeMetaData (fi.meta);
-              ECRS_freeUri (fi.uri);
+                GNUNET_ECRS_meta_data_destroy (fi.meta);
+              GNUNET_ECRS_uri_destroy (fi.uri);
               if (0 != MUNMAP (result, buf.st_size))
-                GE_LOG_STRERROR_FILE (ectx,
-                                      GE_ERROR | GE_ADMIN | GE_BULK,
+                GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                      GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                                       "munmap", fn);
               CLOSE (fd);
               GNUNET_free (fn);
@@ -380,27 +380,27 @@
         }
       rval++;
       if (fi.meta != NULL)
-        ECRS_freeMetaData (fi.meta);
-      ECRS_freeUri (fi.uri);
+        GNUNET_ECRS_meta_data_destroy (fi.meta);
+      GNUNET_ECRS_uri_destroy (fi.uri);
     }
   if (0 != MUNMAP (result, buf.st_size))
-    GE_LOG_STRERROR_FILE (ectx, GE_ERROR | GE_ADMIN | GE_BULK, "munmap", fn);
+    GNUNET_GE_LOG_STRERROR_FILE (ectx, GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "munmap", fn);
   CLOSE (fd);
   GNUNET_free (fn);
   GNUNET_IPC_semaphore_up (sem);
   GNUNET_IPC_semaphore_destroy (sem);
   return rval;
 FORMATERROR:
-  GE_LOG (ectx,
-          GE_WARNING | GE_BULK | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
           _("Deleted corrupt URI database in `%s'."), STATE_NAME);
   if (0 != MUNMAP (result, buf.st_size))
-    GE_LOG_STRERROR_FILE (ectx, GE_ERROR | GE_ADMIN | GE_BULK, "munmap", fn);
+    GNUNET_GE_LOG_STRERROR_FILE (ectx, GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "munmap", fn);
   CLOSE (fd);
   GNUNET_free (fn);
   GNUNET_IPC_semaphore_up (sem);
   GNUNET_IPC_semaphore_destroy (sem);
-  URITRACK_clearTrackedURIS (ectx, cfg);
+  GNUNET_URITRACK_clear (ectx, cfg);
   return GNUNET_SYSERR;
 }
 

Modified: GNUnet/src/applications/fs/uritrack/tracktest.c
===================================================================
--- GNUnet/src/applications/fs/uritrack/tracktest.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/uritrack/tracktest.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -32,30 +32,30 @@
 
 #define CHECK(a) { if (! (a)) { fprintf(stderr, "Error at %s:%d\n", __FILE__, 
__LINE__); return 1; } }
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
-static ECRS_FileInfo fi1;
+static GNUNET_ECRS_FileInfo fi1;
 
-static ECRS_FileInfo fi2;
+static GNUNET_ECRS_FileInfo fi2;
 
 static unsigned int notifications;
 
 static int
-notified (const ECRS_FileInfo * fi,
+notified (const GNUNET_ECRS_FileInfo * fi,
           const GNUNET_HashCode * key, int isRoot, void *cls)
 {
   if ((fi1.meta != NULL) &&
       (fi1.uri != NULL) &&
-      (ECRS_equalsMetaData (fi->meta,
-                            fi1.meta)) && (ECRS_equalsUri (fi->uri, fi1.uri)))
+      (GNUNET_ECRS_meta_data_test_equal (fi->meta,
+                            fi1.meta)) && (GNUNET_ECRS_uri_test_equal 
(fi->uri, fi1.uri)))
     {
       notifications++;
       return GNUNET_OK;
     }
   if ((fi2.meta != NULL) &&
       (fi2.uri != NULL) &&
-      (ECRS_equalsMetaData (fi->meta,
-                            fi2.meta)) && (ECRS_equalsUri (fi->uri, fi2.uri)))
+      (GNUNET_ECRS_meta_data_test_equal (fi->meta,
+                            fi2.meta)) && (GNUNET_ECRS_uri_test_equal 
(fi->uri, fi2.uri)))
     {
       notifications++;
       return GNUNET_OK;
@@ -64,28 +64,28 @@
 }
 
 static int
-processor (const ECRS_FileInfo * fi,
+processor (const GNUNET_ECRS_FileInfo * fi,
            const GNUNET_HashCode * key, int isRoot, void *cls)
 {
   if ((fi1.meta != NULL) &&
       (fi1.uri != NULL) &&
-      (ECRS_equalsMetaData (fi->meta,
-                            fi1.meta)) && (ECRS_equalsUri (fi->uri, fi1.uri)))
+      (GNUNET_ECRS_meta_data_test_equal (fi->meta,
+                            fi1.meta)) && (GNUNET_ECRS_uri_test_equal 
(fi->uri, fi1.uri)))
     {
-      ECRS_freeUri (fi1.uri);
+      GNUNET_ECRS_uri_destroy (fi1.uri);
       fi1.uri = NULL;
-      ECRS_freeMetaData (fi1.meta);
+      GNUNET_ECRS_meta_data_destroy (fi1.meta);
       fi1.meta = NULL;
       return GNUNET_OK;
     }
   if ((fi2.meta != NULL) &&
       (fi2.uri != NULL) &&
-      (ECRS_equalsMetaData (fi->meta,
-                            fi2.meta)) && (ECRS_equalsUri (fi->uri, fi2.uri)))
+      (GNUNET_ECRS_meta_data_test_equal (fi->meta,
+                            fi2.meta)) && (GNUNET_ECRS_uri_test_equal 
(fi->uri, fi2.uri)))
     {
-      ECRS_freeUri (fi2.uri);
+      GNUNET_ECRS_uri_destroy (fi2.uri);
       fi2.uri = NULL;
-      ECRS_freeMetaData (fi2.meta);
+      GNUNET_ECRS_meta_data_destroy (fi2.meta);
       fi2.meta = NULL;
       return GNUNET_OK;
     }
@@ -103,35 +103,35 @@
     "foot",
     NULL,
   };
-  fi1.uri = ECRS_keywordsToUri (k1);
-  fi1.meta = ECRS_createMetaData ();
-  ECRS_addToMetaData (fi1.meta, EXTRACTOR_MIMETYPE, "foo/bar");
-  fi2.uri = ECRS_keywordsToUri (k2);
-  fi2.meta = ECRS_createMetaData ();
-  ECRS_addToMetaData (fi2.meta, EXTRACTOR_MIMETYPE, "foo/bar");
+  fi1.uri = GNUNET_ECRS_keyword_string_to_uri (k1);
+  fi1.meta = GNUNET_ECRS_meta_data_create ();
+  GNUNET_ECRS_meta_data_inser (fi1.meta, EXTRACTOR_MIMETYPE, "foo/bar");
+  fi2.uri = GNUNET_ECRS_keyword_string_to_uri (k2);
+  fi2.meta = GNUNET_ECRS_meta_data_create ();
+  GNUNET_ECRS_meta_data_inser (fi2.meta, EXTRACTOR_MIMETYPE, "foo/bar");
 
-  URITRACK_clearTrackedURIS (NULL, cfg);
-  URITRACK_registerTrackCallback (NULL, cfg, &notified, NULL);
-  URITRACK_trackURIS (NULL, cfg, GNUNET_NO);
-  URITRACK_clearTrackedURIS (NULL, cfg);
+  GNUNET_URITRACK_clear (NULL, cfg);
+  GNUNET_URITRACK_register_track_callback (NULL, cfg, &notified, NULL);
+  GNUNET_URITRACK_toggle_tracking (NULL, cfg, GNUNET_NO);
+  GNUNET_URITRACK_clear (NULL, cfg);
   /* test non-tracking */
-  URITRACK_trackURI (NULL, cfg, &fi1);
-  CHECK (0 == URITRACK_listURIs (NULL, cfg, GNUNET_NO, NULL, NULL));
-  CHECK (GNUNET_NO == URITRACK_trackStatus (NULL, cfg));
-  URITRACK_clearTrackedURIS (NULL, cfg);
-  URITRACK_trackURIS (NULL, cfg, GNUNET_YES);
-  URITRACK_clearTrackedURIS (NULL, cfg);
-  CHECK (0 == URITRACK_listURIs (NULL, cfg, GNUNET_NO, NULL, NULL));
-  CHECK (GNUNET_YES == URITRACK_trackStatus (NULL, cfg));
-  URITRACK_trackURI (NULL, cfg, &fi1);
-  CHECK (1 == URITRACK_listURIs (NULL, cfg, GNUNET_NO, NULL, NULL));
-  URITRACK_trackURI (NULL, cfg, &fi2);
-  CHECK (2 == URITRACK_listURIs (NULL, cfg, GNUNET_YES, &processor, NULL));
-  URITRACK_trackURIS (NULL, cfg, GNUNET_NO);
-  CHECK (GNUNET_NO == URITRACK_trackStatus (NULL, cfg));
-  URITRACK_clearTrackedURIS (NULL, cfg);
+  GNUNET_URITRACK_track (NULL, cfg, &fi1);
+  CHECK (0 == GNUNET_URITRACK_list (NULL, cfg, GNUNET_NO, NULL, NULL));
+  CHECK (GNUNET_NO == GNUNET_URITRACK_get_tracking_status (NULL, cfg));
+  GNUNET_URITRACK_clear (NULL, cfg);
+  GNUNET_URITRACK_toggle_tracking (NULL, cfg, GNUNET_YES);
+  GNUNET_URITRACK_clear (NULL, cfg);
+  CHECK (0 == GNUNET_URITRACK_list (NULL, cfg, GNUNET_NO, NULL, NULL));
+  CHECK (GNUNET_YES == GNUNET_URITRACK_get_tracking_status (NULL, cfg));
+  GNUNET_URITRACK_track (NULL, cfg, &fi1);
+  CHECK (1 == GNUNET_URITRACK_list (NULL, cfg, GNUNET_NO, NULL, NULL));
+  GNUNET_URITRACK_track (NULL, cfg, &fi2);
+  CHECK (2 == GNUNET_URITRACK_list (NULL, cfg, GNUNET_YES, &processor, NULL));
+  GNUNET_URITRACK_toggle_tracking (NULL, cfg, GNUNET_NO);
+  CHECK (GNUNET_NO == GNUNET_URITRACK_get_tracking_status (NULL, cfg));
+  GNUNET_URITRACK_clear (NULL, cfg);
   CHECK (notifications == 2);
-  URITRACK_unregisterTrackCallback (&notified, NULL);
+  GNUNET_URITRACK_unregister_track_callback (&notified, NULL);
   return 0;
 }
 
@@ -140,14 +140,14 @@
 {
   int failureCount = 0;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   failureCount += testTracking ();
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (failureCount != 0)
     return 1;
   return 0;

Modified: GNUnet/src/applications/fs/uritrack/uri_info.c
===================================================================
--- GNUnet/src/applications/fs/uritrack/uri_info.c      2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/fs/uritrack/uri_info.c      2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -34,16 +34,16 @@
 #include "platform.h"
 
 static char *
-getDBName (struct GC_Configuration *cfg)
+getDBName (struct GNUNET_GC_Configuration *cfg)
 {
   char *basename;
   char *ipcName;
   size_t n;
 
-  GC_get_configuration_value_filename (cfg,
+  GNUNET_GC_get_configuration_value_filename (cfg,
                                        "GNUNET",
                                        "GNUNET_HOME",
-                                       GNUNET_HOME_DIRECTORY, &basename);
+                                       GNUNET_DEFAULT_HOME_DIRECTORY, 
&basename);
   n = strlen (basename) + 512;
   ipcName = GNUNET_malloc (n);
   GNUNET_snprintf (ipcName, n, "%s/uri_info.db", basename);
@@ -52,12 +52,12 @@
 }
 
 static unsigned long long
-getDBSize (struct GC_Configuration *cfg)
+getDBSize (struct GNUNET_GC_Configuration *cfg)
 {
   unsigned long long value;
 
   value = 1024 * 1024;
-  GC_get_configuration_value_number (cfg,
+  GNUNET_GC_get_configuration_value_number (cfg,
                                      "FS",
                                      "URI_DB_SIZE",
                                      1,
@@ -69,14 +69,14 @@
  * Find out what we know about a given URI's past.  Note that we only
  * track the states for a (finite) number of URIs and that the
  * information that we give back maybe inaccurate (returning
- * URITRACK_FRESH if the URI did not fit into our bounded-size map,
+ * GNUNET_URITRACK_FRESH if the URI did not fit into our bounded-size map,
  * even if the URI is not fresh anymore; also, if the URI has a
  * GNUNET_hash-collision in the map, there is a 1:256 chance that we will
  * return information from the wrong URI without detecting it).
  */
-enum URITRACK_STATE
-URITRACK_getState (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg, const struct ECRS_URI *uri)
+enum GNUNET_URITRACK_STATE
+GNUNET_URITRACK_get_state (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg, const struct 
GNUNET_ECRS_URI *uri)
 {
   char *s;
   int crc;
@@ -85,44 +85,44 @@
   unsigned char io[2];
   off_t o;
 
-  s = ECRS_uriToString (uri);
+  s = GNUNET_ECRS_uri_to_string (uri);
   crc = GNUNET_crc32_n (s, strlen (s));
   GNUNET_free (s);
   s = getDBName (cfg);
   if (GNUNET_NO == GNUNET_disk_file_test (ectx, s))
-    return URITRACK_FRESH;
+    return GNUNET_URITRACK_FRESH;
   size = getDBSize (cfg);
   fd = GNUNET_disk_file_open (ectx, s, O_RDONLY);
   GNUNET_free (s);
   if (fd == -1)
-    return URITRACK_FRESH;
+    return GNUNET_URITRACK_FRESH;
   o = 2 * (crc % size);
   if (o != LSEEK (fd, o, SEEK_SET))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_USER | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK,
                             "lseek", s);
       CLOSE (fd);
-      return URITRACK_FRESH;
+      return GNUNET_URITRACK_FRESH;
     }
   if (2 != read (fd, io, 2))
     {
       CLOSE (fd);
-      return URITRACK_FRESH;
+      return GNUNET_URITRACK_FRESH;
     }
   CLOSE (fd);
   if (io[0] == (unsigned char) crc)
-    return (enum URITRACK_STATE) io[1];
-  return URITRACK_FRESH;
+    return (enum GNUNET_URITRACK_STATE) io[1];
+  return GNUNET_URITRACK_FRESH;
 }
 
 /**
  * Add additional information about a given URI's past.
  */
 void
-URITRACK_addState (struct GE_Context *ectx,
-                   struct GC_Configuration *cfg,
-                   const struct ECRS_URI *uri, enum URITRACK_STATE state)
+GNUNET_URITRACK_add_state (struct GNUNET_GE_Context *ectx,
+                   struct GNUNET_GC_Configuration *cfg,
+                   const struct GNUNET_ECRS_URI *uri, enum 
GNUNET_URITRACK_STATE state)
 {
   char *s;
   int crc;
@@ -131,7 +131,7 @@
   unsigned char io[2];
   off_t o;
 
-  s = ECRS_uriToString (uri);
+  s = GNUNET_ECRS_uri_to_string (uri);
   crc = GNUNET_crc32_n (s, strlen (s));
   GNUNET_free (s);
   s = getDBName (cfg);
@@ -145,8 +145,8 @@
   o = 2 * (crc % size);
   if (o != LSEEK (fd, o, SEEK_SET))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_USER | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK,
                             "lseek", s);
       CLOSE (fd);
       GNUNET_free (s);
@@ -155,26 +155,26 @@
   if (2 != read (fd, io, 2))
     {
       io[0] = crc;
-      io[1] = URITRACK_FRESH;
+      io[1] = GNUNET_URITRACK_FRESH;
     }
   else if (io[0] != (unsigned char) crc)
     {
       io[0] = (unsigned char) crc;
-      io[1] = URITRACK_FRESH;
+      io[1] = GNUNET_URITRACK_FRESH;
     }
   io[1] |= state;
   if (o != LSEEK (fd, o, SEEK_SET))
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_WARNING | GE_USER | GE_ADMIN | GE_BULK,
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK,
                             "lseek", s);
       CLOSE (fd);
       GNUNET_free (s);
       return;
     }
   if (2 != write (fd, io, 2))
-    GE_LOG_STRERROR_FILE (ectx,
-                          GE_WARNING | GE_USER | GE_ADMIN | GE_BULK,
+    GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                          GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_ADMIN 
| GNUNET_GE_BULK,
                           "write", s);
   GNUNET_disk_file_close (ectx, s, fd);
   GNUNET_free (s);

Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c   2007-11-25 03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/gap/gap.c   2007-11-25 12:04:45 UTC (rev 5755)
@@ -53,17 +53,17 @@
 /**
  * GNUnet core.
  */
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * Identity service.
  */
-static Identity_ServiceAPI *identity;
+static GNUNET_Identity_ServiceAPI *identity;
 
 /**
  * Statistics service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_routing_collisions;
 
@@ -106,26 +106,26 @@
 /**
  * Topology service.
  */
-static Topology_ServiceAPI *topology;
+static GNUNET_Topology_ServiceAPI *topology;
 
 /**
  * Traffic service.
  */
-static Traffic_ServiceAPI *traffic;
+static GNUNET_Traffic_ServiceAPI *traffic;
 
 /**
  * For migration / local stores, local lookup and
  * content verification.
  */
-static Blockstore *bs;
+static GNUNET_Blockstore *bs;
 
 /**
  * Function that can be used to identify unique
  * replies.
  */
-static UniqueReplyIdentifier uri;
+static GNUNET_UniqueReplyIdentifierCallback uri;
 
-static ReplyHashFunction rhf;
+static GNUNET_ReplyHashingCallback rhf;
 
 /**
  * The routing table. This table has entries for all
@@ -184,9 +184,9 @@
 static int hist_total;
 #endif
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 /* ****************** helper functions ***************** */
 
@@ -528,8 +528,8 @@
   ((char *) &enc)[6] = '\0';
   GNUNET_hash_to_enc (&peer->hashPubKey, &enc2);
   ((char *) &enc2)[6] = '\0';
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Q %s peer %2u (%s) ranks (responses: %2u, distance %4d): %u%s\n",
           &enc,
           idx,
@@ -557,7 +557,7 @@
 }
 
 /**
- * A "PerNodeCallback" method that forwards the query to the selected
+ * A "GNUNET_NodeIteratorCallback" method that forwards the query to the 
selected
  * nodes.
  */
 static void
@@ -590,11 +590,11 @@
     {
 #if DEBUG_GAP
       IF_GELOG (ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&peer->hashPubKey, &encp);
                 GNUNET_hash_to_enc (&qr->msg->queries[0], &encq));
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Sending query `%s' to `%s'\n", &encq, &encp);
 #endif
       if (stats != NULL)
@@ -735,7 +735,7 @@
               if (pos > sel)
                 {
                   setBit (qr, j);
-                  GE_ASSERT (ectx, rankingSum >= qr->rankings[j]);
+                  GNUNET_GE_ASSERT (ectx, rankingSum >= qr->rankings[j]);
                   rankingSum -= qr->rankings[j];
                   qr->rankings[j] = 0;
                   break;
@@ -804,7 +804,7 @@
     = (((unsigned int *) query)[0] ^
        ((unsigned int *) query)[1] / (1 + random_qsel))
     % indirectionTableSize;
-  GE_ASSERT (ectx, res < indirectionTableSize);
+  GNUNET_GE_ASSERT (ectx, res < indirectionTableSize);
 #if DO_HISTOGRAM
   histogram[res % 65536]++;
   if (++hist_total % 10000 == 0)
@@ -846,7 +846,7 @@
  *
  * @param sender the next hop
  * @param result the content that was found
- * @param data is a DataContainer which
+ * @param data is a GNUNET_DataContainer which
  *  wraps the content in the format that
  *  can be passed to the FS module (GapWrapper),
  *  which in turn wraps the DBlock (including
@@ -854,7 +854,7 @@
  */
 static int
 queueReply (const GNUNET_PeerIdentity * sender,
-            const GNUNET_HashCode * primaryKey, const DataContainer * data)
+            const GNUNET_HashCode * primaryKey, const GNUNET_DataContainer * 
data)
 {
   P2P_gap_reply_MESSAGE *pmsg;
   IndirectionTableEntry *ite;
@@ -863,23 +863,23 @@
   GNUNET_EncName enc;
 
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER, GNUNET_hash_to_enc (primaryKey,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
GNUNET_hash_to_enc (primaryKey,
                                                                  &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Gap queues reply to query `%s' for later use.\n", &enc);
 #endif
 
 #if EXTRA_CHECKS
   /* verify data is valid */
-  uri (data, ANY_BLOCK, GNUNET_YES, primaryKey);
+  uri (data, GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, GNUNET_YES, primaryKey);
 #endif
 
   ite = &ROUTING_indTable_[computeRoutingIndex (primaryKey)];
   if (0 != memcmp (&ite->primaryKey, primaryKey, sizeof (GNUNET_HashCode)))
     {
 #if DEBUG_GAP
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "GAP: Dropping reply, routing table has no query associated with 
it (anymore)\n");
 #endif
       return GNUNET_NO;         /* we don't care for the reply (anymore) */
@@ -887,8 +887,8 @@
   if (GNUNET_YES == ite->successful_local_lookup_in_delay_loop)
     {
 #if DEBUG_GAP
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "GAP: Dropping reply, found reply locally during delay\n");
 #endif
       return GNUNET_NO;         /* wow, really bad concurrent DB lookup and 
processing for
@@ -897,16 +897,16 @@
     }
   size =
     sizeof (P2P_gap_reply_MESSAGE) + ntohl (data->size) -
-    sizeof (DataContainer);
+    sizeof (GNUNET_DataContainer);
   if (size >= GNUNET_MAX_BUFFER_SIZE)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   ite->successful_local_lookup_in_delay_loop = GNUNET_YES;
   pmsg = GNUNET_malloc (size);
   pmsg->header.size = htons (size);
-  pmsg->header.type = htons (P2P_PROTO_gap_RESULT);
+  pmsg->header.type = htons (GNUNET_P2P_PROTO_GAP_RESULT);
   pmsg->primaryKey = *primaryKey;
   memcpy (&pmsg[1], &data[1], size - sizeof (P2P_gap_reply_MESSAGE));
   /* delay reply, delay longer if we are busy (makes it harder
@@ -997,12 +997,12 @@
 #if DEBUG__GAP
   GNUNET_EncName enc;
 
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "GAP: Queueing query '%s' in slot %p\n", &enc, ite);
 #endif
-  GE_ASSERT (ectx, sender != 0);        /* do NOT add to RT for local clients! 
*/
+  GNUNET_GE_ASSERT (ectx, sender != 0);        /* do NOT add to RT for local 
clients! */
   now = GNUNET_get_time ();
   if ((stats != NULL) && (ite->ttl == 0))
     stats->change (stat_routing_slots_used, 1);
@@ -1034,7 +1034,7 @@
     }
   else
     {                           /* GNUNET_array_grow mode */
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  0 == memcmp (query, &ite->primaryKey,
                               sizeof (GNUNET_HashCode)));
       /* extend lifetime */
@@ -1425,10 +1425,10 @@
       resolve_pid (ite->destination[j], &recv);
 #if DEBUG_GAP
       IF_GELOG (ectx,
-                GE_DEBUG | GE_REQUEST | GE_USER,
+                GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                 GNUNET_hash_to_enc (&recv.hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "GAP sending reply to `%s'\n", &enc);
 #endif
       coreAPI->unicast (&recv, msg, BASE_REPLY_PRIORITY * (ite->priority + 5),
@@ -1439,7 +1439,7 @@
 
 struct qLRC
 {
-  DataContainer **values;
+  GNUNET_DataContainer **values;
   unsigned int valueCount;
   GNUNET_HashCode query;
 };
@@ -1450,7 +1450,7 @@
  *
  * @param primaryKey is the key needed to decrypt
  *  the block
- * @param value is a DataContainer which
+ * @param value is a GNUNET_DataContainer which
  *  wraps the content in the format that
  *  can be passed to the FS module (GapWrapper),
  *  which in turn wraps the DBlock (including
@@ -1458,14 +1458,14 @@
  */
 static int
 queryLocalResultCallback (const GNUNET_HashCode * primaryKey,
-                          const DataContainer * value, void *closure)
+                          const GNUNET_DataContainer * value, void *closure)
 {
   struct qLRC *cls = closure;
   int i;
 
 #if EXTRA_CHECKS
   /* verify data is valid */
-  uri (value, ANY_BLOCK, GNUNET_YES, primaryKey);
+  uri (value, GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, GNUNET_YES, primaryKey);
 #endif
   /* check seen */
   if ((cls->valueCount > MAX_SEEN_VALUES) &&
@@ -1522,7 +1522,7 @@
     return GNUNET_SYSERR;       /* not fully initialized */
 
   senderID = intern_pid (sender);
-  GE_ASSERT (ectx, (senderID != 0) || (sender == NULL));
+  GNUNET_GE_ASSERT (ectx, (senderID != 0) || (sender == NULL));
   ite = &ROUTING_indTable_[computeRoutingIndex (&query->queries[0])];
   GNUNET_mutex_lock (lookup_exclusion);
   i = -1;
@@ -1559,11 +1559,11 @@
 
 #if DEBUG_GAP
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&query->queries[0], &enc));
   ((char *) &enc)[6] = '\0';
-  GE_LOG (ectx,
-          GE_INFO | GE_IMMEDIATE | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_IMMEDIATE | GNUNET_GE_USER,
           "GAP is executing request for `%s':%s%s (%d)\n",
           &enc,
           doForward ? " forwarding" : "", isRouted ? " routing" : "", i);
@@ -1609,7 +1609,7 @@
                                          &query->queries[0],
                                          cls.values[perm[i]], ite->priority)))
             {
-              GE_BREAK (NULL, 0);
+              GNUNET_GE_BREAK (NULL, 0);
               GNUNET_free (cls.values[perm[i]]);
               continue;
             }
@@ -1665,7 +1665,7 @@
   unsigned int size;
   int ret;
   unsigned int prio;
-  DataContainer *value;
+  GNUNET_DataContainer *value;
   double preference;
   PID_INDEX hostId;
 #if DEBUG_GAP
@@ -1675,18 +1675,18 @@
 
   if (ntohs (pmsg->size) < sizeof (P2P_gap_reply_MESSAGE))
     {
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;     /* invalid! */
     }
   msg = (const P2P_gap_reply_MESSAGE *) pmsg;
 #if DEBUG_GAP
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             if (host != NULL) GNUNET_hash_to_enc (&host->hashPubKey, &enc));
   GNUNET_hash_to_enc (&msg->primaryKey, &enc2);
   ((char *) &enc2)[6] = '\0';
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "GAP received content `%s' from `%s'\n",
           &enc2, (host != NULL) ? (const char *) &enc : "myself");
 #endif
@@ -1702,8 +1702,8 @@
         stats->change (stat_routing_reply_drops, 1);
       return GNUNET_OK;         /* not fully initialized! */
     }
-  value = GNUNET_malloc (size + sizeof (DataContainer));
-  value->size = htonl (size + sizeof (DataContainer));
+  value = GNUNET_malloc (size + sizeof (GNUNET_DataContainer));
+  value->size = htonl (size + sizeof (GNUNET_DataContainer));
   memcpy (&value[1], &msg[1], size);
   rhf (value, &contentHC);
 
@@ -1714,13 +1714,13 @@
       GNUNET_EncName enc;
 
       IF_GELOG (ectx,
-                GE_ERROR | GE_BULK | GE_USER,
+                GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                 if (host != NULL) GNUNET_hash_to_enc (&host->hashPubKey,
                                                       &enc));
-      GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("GAP received invalid content from `%s'\n"),
               (host != NULL) ? (const char *) &enc : _("myself"));
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       GNUNET_free (value);
       return GNUNET_SYSERR;     /* invalid */
     }
@@ -1844,11 +1844,11 @@
  * @return GNUNET_SYSERR on error, GNUNET_OK on success
  */
 static int
-init (Blockstore * datastore, UniqueReplyIdentifier uid, ReplyHashFunction rh)
+init (GNUNET_Blockstore * datastore, GNUNET_UniqueReplyIdentifierCallback uid, 
GNUNET_ReplyHashingCallback rh)
 {
   if (bs != NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   bs = datastore;
@@ -1891,7 +1891,7 @@
                                       1) * sizeof (GNUNET_HashCode);
   if (size >= GNUNET_MAX_BUFFER_SIZE)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;     /* too many keys! */
     }
 
@@ -1907,19 +1907,19 @@
       anonymityLevel--;
       if (traffic == NULL)
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _
                   ("Cover traffic requested but traffic service not loaded.  
Rejecting request.\n"));
           return GNUNET_SYSERR;
         }
       if (GNUNET_OK !=
-          traffic->get ((TTL_DECREMENT + timeout) / TRAFFIC_TIME_UNIT,
-                        P2P_PROTO_gap_QUERY, TC_RECEIVED, &count, &peers,
+          traffic->get ((TTL_DECREMENT + timeout) / GNUNET_TRAFFIC_TIME_UNIT,
+                        GNUNET_P2P_PROTO_GAP_QUERY, 
GNUNET_TRAFFIC_TYPE_RECEIVED, &count, &peers,
                         &sizes, &timevect))
         {
-          GE_LOG (ectx,
-                  GE_WARNING | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("Failed to get traffic stats.\n"));
           return GNUNET_SYSERR;
         }
@@ -1927,16 +1927,16 @@
         {
           if (peers < anonymityLevel / 1000)
             {
-              GE_LOG (ectx,
-                      GE_WARNING | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx,
+                      GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                       _
                       ("Cannot satisfy desired level of anonymity, ignoring 
request.\n"));
               return GNUNET_SYSERR;
             }
           if (count < anonymityLevel % 1000)
             {
-              GE_LOG (ectx,
-                      GE_WARNING | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx,
+                      GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                       _
                       ("Cannot satisfy desired level of anonymity, ignoring 
request.\n"));
               return GNUNET_SYSERR;
@@ -1946,8 +1946,8 @@
         {
           if (count < anonymityLevel)
             {
-              GE_LOG (ectx,
-                      GE_WARNING | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx,
+                      GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
                       _
                       ("Cannot satisfy desired level of anonymity, ignoring 
request.\n"));
               return GNUNET_SYSERR;
@@ -1958,7 +1958,7 @@
 
   msg = GNUNET_malloc (size);
   msg->header.size = htons (size);
-  msg->header.type = htons (P2P_PROTO_gap_QUERY);
+  msg->header.type = htons (GNUNET_P2P_PROTO_GAP_QUERY);
   msg->type = htonl (type);
   msg->priority = htonl (prio);
   msg->ttl = htonl (adjustTTL ((int) timeout - GNUNET_get_time (), prio));
@@ -1997,7 +1997,7 @@
  *   that buffer (must be a positive number).
  */
 static unsigned int
-tryMigrate (const DataContainer * data,
+tryMigrate (const GNUNET_DataContainer * data,
             const GNUNET_HashCode * primaryKey,
             char *position, unsigned int padding)
 {
@@ -2006,11 +2006,11 @@
 
   size =
     sizeof (P2P_gap_reply_MESSAGE) + ntohl (data->size) -
-    sizeof (DataContainer);
+    sizeof (GNUNET_DataContainer);
   if ((size > padding) || (size >= GNUNET_MAX_BUFFER_SIZE))
     return 0;
   reply = (P2P_gap_reply_MESSAGE *) position;
-  reply->header.type = htons (P2P_PROTO_gap_RESULT);
+  reply->header.type = htons (GNUNET_P2P_PROTO_GAP_RESULT);
   reply->header.size = htons (size);
   reply->primaryKey = *primaryKey;
   memcpy (&reply[1], &data[1], size - sizeof (P2P_gap_reply_MESSAGE));
@@ -2037,7 +2037,7 @@
 
   if (bs == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return 0;
     }
   /* Load above hard limit? */
@@ -2047,11 +2047,11 @@
       if (sender != NULL)
         {
           IF_GELOG (ectx,
-                    GE_DEBUG | GE_REQUEST | GE_USER,
+                    GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                     GNUNET_hash_to_enc (&sender->hashPubKey, &enc));
         }
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Dropping query from %s, this peer is too busy.\n",
               sender == NULL ? "localhost" : (char *) &enc);
 #endif
@@ -2064,7 +2064,7 @@
       (ntohs (msg->size) != sizeof (P2P_gap_query_MESSAGE) +
        (queries - 1) * sizeof (GNUNET_HashCode)))
     {
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       return GNUNET_SYSERR;     /* malformed query */
     }
 
@@ -2079,7 +2079,7 @@
          (or B directly back to A; also should not happen)
          in this case, A must just drop; however, this
          should not happen (peers should check). */
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       GNUNET_free (qmsg);
       return GNUNET_OK;
     }
@@ -2111,10 +2111,10 @@
   policy = evaluateQuery (sender, &prio);
 #if DEBUG_GAP
   IF_GELOG (ectx,
-            GE_DEBUG | GE_REQUEST | GE_USER,
+            GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (&qmsg->queries[0], &enc));
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received GAP query `%s'.\n", &enc);
 #endif
   if ((policy & QUERY_DROPMASK) == 0)
@@ -2125,11 +2125,11 @@
 #if DEBUG_GAP
       if (sender != NULL)
         {
-          IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+          IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
                     GNUNET_hash_to_enc (&sender->hashPubKey, &enc));
         }
-      GE_LOG (ectx,
-              GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
               "Dropping query from %s, policy decided that this peer is too 
busy.\n",
               sender == NULL ? "localhost" : (const char *) &enc);
 #endif
@@ -2190,29 +2190,29 @@
 }
 
 
-GAP_ServiceAPI *
-provide_module_gap (CoreAPIForApplication * capi)
+GNUNET_GAP_ServiceAPI *
+provide_module_gap (GNUNET_CoreAPIForPlugins * capi)
 {
-  static GAP_ServiceAPI api;
+  static GNUNET_GAP_ServiceAPI api;
   unsigned int i;
 
   ectx = capi->ectx;
   cfg = capi->cfg;
   coreAPI = capi;
-  if ((-1 == GC_get_configuration_value_number (cfg, "LOAD", "HARDCPULIMIT", 
0, 100000, /* 1000 CPUs!? */
+  if ((-1 == GNUNET_GC_get_configuration_value_number (cfg, "LOAD", 
"HARDCPULIMIT", 0, 100000, /* 1000 CPUs!? */
                                                 0,      /* 0 == no limit */
-                                                &hardCPULimit)) || (-1 == 
GC_get_configuration_value_number (cfg, "LOAD", "HARDUPLIMIT", 0, 999999999, 0, 
      /* 0 == no limit */
+                                                &hardCPULimit)) || (-1 == 
GNUNET_GC_get_configuration_value_number (cfg, "LOAD", "HARDUPLIMIT", 0, 
999999999, 0,       /* 0 == no limit */
                                                                                
                              &hardUpLimit))
       || (-1 ==
-          GC_get_configuration_value_number (cfg, "GAP", "TABLESIZE",
+          GNUNET_GC_get_configuration_value_number (cfg, "GAP", "TABLESIZE",
                                              MIN_INDIRECTION_TABLE_SIZE,
                                              GNUNET_MAX_GNUNET_malloc_CHECKED
                                              / sizeof (IndirectionTableEntry),
                                              MIN_INDIRECTION_TABLE_SIZE,
                                              &indirectionTableSize)))
     return NULL;
-  GE_ASSERT (ectx, sizeof (P2P_gap_reply_MESSAGE) == 68);
-  GE_ASSERT (ectx, sizeof (P2P_gap_query_MESSAGE) == 144);
+  GNUNET_GE_ASSERT (ectx, sizeof (P2P_gap_reply_MESSAGE) == 68);
+  GNUNET_GE_ASSERT (ectx, sizeof (P2P_gap_query_MESSAGE) == 144);
 
   stats = capi->requestService ("stats");
   if (stats != NULL)
@@ -2273,13 +2273,13 @@
 
 
   identity = coreAPI->requestService ("identity");
-  GE_ASSERT (ectx, identity != NULL);
+  GNUNET_GE_ASSERT (ectx, identity != NULL);
   topology = coreAPI->requestService ("topology");
-  GE_ASSERT (ectx, topology != NULL);
+  GNUNET_GE_ASSERT (ectx, topology != NULL);
   traffic = coreAPI->requestService ("traffic");
   if (traffic == NULL)
     {
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("Traffic service failed to load; gap cannot ensure 
cover-traffic availability.\n"));
     }
@@ -2303,12 +2303,12 @@
   GNUNET_cron_add_job (capi->cron, &ageRTD, 2 * GNUNET_CRON_MINUTES,
                        2 * GNUNET_CRON_MINUTES, NULL);
 
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering handlers %d %d\n"),
-          "gap", P2P_PROTO_gap_QUERY, P2P_PROTO_gap_RESULT);
-  capi->registerHandler (P2P_PROTO_gap_QUERY, &handleQuery);
-  capi->registerHandler (P2P_PROTO_gap_RESULT, &useContent);
+          "gap", GNUNET_P2P_PROTO_GAP_QUERY, GNUNET_P2P_PROTO_GAP_RESULT);
+  capi->registerHandler (GNUNET_P2P_PROTO_GAP_QUERY, &handleQuery);
+  capi->registerHandler (GNUNET_P2P_PROTO_GAP_RESULT, &useContent);
   coreAPI->registerSendCallback (sizeof (P2P_gap_query_MESSAGE),
                                  &fillInQuery);
 
@@ -2328,8 +2328,8 @@
   ReplyTrackData *pos;
   IndirectionTableEntry *ite;
 
-  coreAPI->unregisterHandler (P2P_PROTO_gap_QUERY, &handleQuery);
-  coreAPI->unregisterHandler (P2P_PROTO_gap_RESULT, &useContent);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_GAP_QUERY, &handleQuery);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_GAP_RESULT, &useContent);
   coreAPI->unregisterSendCallback (sizeof (P2P_gap_query_MESSAGE),
                                    &fillInQuery);
 

Modified: GNUnet/src/applications/gap/gaptest.c
===================================================================
--- GNUnet/src/applications/gap/gaptest.c       2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/gap/gaptest.c       2007-11-25 12:04:45 UTC (rev 
5755)
@@ -34,9 +34,9 @@
 #include "gnunet_util_network_client.h"
 #include "gnunet_stats_lib.h"
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static int
 testTerminate (void *unused)
@@ -77,14 +77,14 @@
   return fn;
 }
 
-static struct ECRS_URI *
+static struct GNUNET_ECRS_URI *
 uploadFile (unsigned int size)
 {
   int ret;
   char *name;
   int fd;
   char *buf;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
 
   name = makeName (size);
@@ -99,26 +99,26 @@
   WRITE (fd, buf, size);
   GNUNET_free (buf);
   GNUNET_disk_file_close (ectx, name, fd);
-  ret = ECRS_uploadFile (ectx, cfg, name, GNUNET_YES,   /* index */
+  ret = GNUNET_ECRS_file_upload (ectx, cfg, name, GNUNET_YES,   /* index */
                          0,     /* anon */
                          0,     /* prio */
                          GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES, /* 
expire */
                          &uprogress, NULL, &testTerminate, NULL, &uri);
   if (ret != GNUNET_SYSERR)
     {
-      struct ECRS_MetaData *meta;
-      struct ECRS_URI *key;
+      struct GNUNET_ECRS_MetaData *meta;
+      struct GNUNET_ECRS_URI *key;
       const char *keywords[2];
 
       keywords[0] = name;
       keywords[1] = NULL;
 
-      meta = ECRS_createMetaData ();
-      key = ECRS_keywordsToUri (keywords);
-      ret = ECRS_addToKeyspace (ectx, cfg, key, 0, 0, GNUNET_get_time () + 10 
* GNUNET_CRON_MINUTES,    /* expire */
+      meta = GNUNET_ECRS_meta_data_create ();
+      key = GNUNET_ECRS_keyword_strings_to_uri (keywords);
+      ret = GNUNET_ECRS_publish_under_keyword (ectx, cfg, key, 0, 0, 
GNUNET_get_time () + 10 * GNUNET_CRON_MINUTES,    /* expire */
                                 uri, meta);
-      ECRS_freeMetaData (meta);
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_meta_data_destroy (meta);
+      GNUNET_ECRS_uri_destroy (uri);
       GNUNET_free (name);
       if (ret == GNUNET_OK)
         {
@@ -126,7 +126,7 @@
         }
       else
         {
-          ECRS_freeUri (key);
+          GNUNET_ECRS_uri_destroy (key);
           return NULL;
         }
     }
@@ -138,18 +138,18 @@
 }
 
 static int
-searchCB (const ECRS_FileInfo * fi,
+searchCB (const GNUNET_ECRS_FileInfo * fi,
           const GNUNET_HashCode * key, int isRoot, void *closure)
 {
-  struct ECRS_URI **my = closure;
+  struct GNUNET_ECRS_URI **my = closure;
   char *tmp;
 
-  tmp = ECRS_uriToString (fi->uri);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER, "Search found URI `%s'\n", tmp);
+  tmp = GNUNET_ECRS_uri_to_string (fi->uri);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, "Search found 
URI `%s'\n", tmp);
   GNUNET_free (tmp);
-  GE_ASSERT (ectx, NULL == *my);
-  *my = ECRS_dupUri (fi->uri);
+  GNUNET_GE_ASSERT (ectx, NULL == *my);
+  *my = GNUNET_ECRS_uri_duplicate (fi->uri);
   return GNUNET_SYSERR;         /* abort search */
 }
 
@@ -158,19 +158,19 @@
  * @return GNUNET_OK on success
  */
 static int
-searchFile (struct ECRS_URI **uri)
+searchFile (struct GNUNET_ECRS_URI **uri)
 {
   int ret;
-  struct ECRS_URI *myURI;
+  struct GNUNET_ECRS_URI *myURI;
 
   myURI = NULL;
-  ret = ECRS_search (ectx,
+  ret = GNUNET_ECRS_search (ectx,
                      cfg,
                      *uri,
                      0,
                      15 * GNUNET_CRON_SECONDS,
                      &searchCB, &myURI, &testTerminate, NULL);
-  ECRS_freeUri (*uri);
+  GNUNET_ECRS_uri_destroy (*uri);
   *uri = myURI;
   if ((ret != GNUNET_SYSERR) && (myURI != NULL))
     return GNUNET_OK;
@@ -179,7 +179,7 @@
 }
 
 static int
-downloadFile (unsigned int size, const struct ECRS_URI *uri)
+downloadFile (unsigned int size, const struct GNUNET_ECRS_URI *uri)
 {
   int ret;
   char *tmpName;
@@ -189,14 +189,14 @@
   int i;
   char *tmp;
 
-  tmp = ECRS_uriToString (uri);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  tmp = GNUNET_ECRS_uri_to_string (uri);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting download of `%s'\n", tmp);
   GNUNET_free (tmp);
   tmpName = makeName (0);
   ret = GNUNET_SYSERR;
-  if (GNUNET_OK == ECRS_downloadFile (ectx,
+  if (GNUNET_OK == GNUNET_ECRS_file_download (ectx,
                                       cfg,
                                       uri,
                                       tmpName,
@@ -232,14 +232,14 @@
   char *name;
 
   name = makeName (size);
-  ret = ECRS_unindexFile (ectx, cfg, name, NULL, NULL, &testTerminate, NULL);
+  ret = GNUNET_ECRS_file_uninde (ectx, cfg, name, NULL, NULL, &testTerminate, 
NULL);
   if (0 != UNLINK (name))
     ret = GNUNET_SYSERR;
   GNUNET_free (name);
   return ret;
 }
 
-#define CHECK(a) if (!(a)) { ret = 1; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ret = 1; GNUNET_GE_BREAK(ectx, 0); goto FAILURE; }
 
 #define START_PEERS 1
 
@@ -252,13 +252,13 @@
 {
   struct GNUNET_TESTING_DaemonContext *peers;
   int ret;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
 
   ret = 0;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
@@ -269,7 +269,7 @@
   if (peers == NULL)
     {
       fprintf (stderr, "Failed to start the gnunetd daemons!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -277,19 +277,19 @@
     {
       GNUNET_TESTING_stop_daemons (peers);
       fprintf (stderr, "Failed to connect the peers!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 
   uri = uploadFile (12345);
   CHECK (NULL != uri);
-  GC_set_configuration_value_string (cfg,
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:12087");
   CHECK (GNUNET_OK == searchFile (&uri));
   CHECK (GNUNET_OK == downloadFile (12345, uri));
-  ECRS_freeUri (uri);
-  GC_set_configuration_value_string (cfg,
+  GNUNET_ECRS_uri_destroy (uri);
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:2087");
   CHECK (GNUNET_OK == unindexFile (12345));
@@ -299,7 +299,7 @@
   GNUNET_TESTING_stop_daemons (peers);
 #endif
 
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return ret;
 }
 

Modified: GNUnet/src/applications/gap/gaptest2.c
===================================================================
--- GNUnet/src/applications/gap/gaptest2.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/gap/gaptest2.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -41,9 +41,9 @@
 
 #define SIZE 1024 * 1024 * 2
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static int
 testTerminate (void *unused)
@@ -82,14 +82,14 @@
   return fn;
 }
 
-static struct ECRS_URI *
+static struct GNUNET_ECRS_URI *
 uploadFile (unsigned int size)
 {
   int ret;
   char *name;
   int fd;
   char *buf;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
 
   name = makeName (size);
@@ -104,7 +104,7 @@
   WRITE (fd, buf, size);
   GNUNET_free (buf);
   GNUNET_disk_file_close (ectx, name, fd);
-  ret = ECRS_uploadFile (ectx, cfg, name, GNUNET_YES,   /* index */
+  ret = GNUNET_ECRS_file_upload (ectx, cfg, name, GNUNET_YES,   /* index */
                          1,     /* anon */
                          0,     /* prio */
                          GNUNET_get_time () + 100 * GNUNET_CRON_MINUTES,       
 /* expire */
@@ -112,19 +112,19 @@
                          NULL, &testTerminate, NULL, &uri);
   if (ret != GNUNET_SYSERR)
     {
-      struct ECRS_MetaData *meta;
-      struct ECRS_URI *key;
+      struct GNUNET_ECRS_MetaData *meta;
+      struct GNUNET_ECRS_URI *key;
       const char *keywords[2];
 
       keywords[0] = name;
       keywords[1] = NULL;
 
-      meta = ECRS_createMetaData ();
-      key = ECRS_keywordsToUri (keywords);
-      ret = ECRS_addToKeyspace (ectx, cfg, key, 0, 0, GNUNET_get_time () + 100 
* GNUNET_CRON_MINUTES,   /* expire */
+      meta = GNUNET_ECRS_meta_data_create ();
+      key = GNUNET_ECRS_keyword_strings_to_uri (keywords);
+      ret = GNUNET_ECRS_publish_under_keyword (ectx, cfg, key, 0, 0, 
GNUNET_get_time () + 100 * GNUNET_CRON_MINUTES,   /* expire */
                                 uri, meta);
-      ECRS_freeMetaData (meta);
-      ECRS_freeUri (uri);
+      GNUNET_ECRS_meta_data_destroy (meta);
+      GNUNET_ECRS_uri_destroy (uri);
       GNUNET_free (name);
       if (ret == GNUNET_OK)
         {
@@ -132,7 +132,7 @@
         }
       else
         {
-          ECRS_freeUri (key);
+          GNUNET_ECRS_uri_destroy (key);
           return NULL;
         }
     }
@@ -144,18 +144,18 @@
 }
 
 static int
-searchCB (const ECRS_FileInfo * fi,
+searchCB (const GNUNET_ECRS_FileInfo * fi,
           const GNUNET_HashCode * key, int isRoot, void *closure)
 {
-  struct ECRS_URI **my = closure;
+  struct GNUNET_ECRS_URI **my = closure;
   char *tmp;
 
-  tmp = ECRS_uriToString (fi->uri);
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  tmp = GNUNET_ECRS_uri_to_string (fi->uri);
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Search found URI `%s'\n", tmp);
   GNUNET_free (tmp);
-  GE_ASSERT (ectx, NULL == *my);
-  *my = ECRS_dupUri (fi->uri);
+  GNUNET_GE_ASSERT (ectx, NULL == *my);
+  *my = GNUNET_ECRS_uri_duplicate (fi->uri);
   return GNUNET_SYSERR;         /* abort search */
 }
 
@@ -164,19 +164,19 @@
  * @return GNUNET_OK on success
  */
 static int
-searchFile (struct ECRS_URI **uri)
+searchFile (struct GNUNET_ECRS_URI **uri)
 {
   int ret;
-  struct ECRS_URI *myURI;
+  struct GNUNET_ECRS_URI *myURI;
 
   myURI = NULL;
-  ret = ECRS_search (ectx,
+  ret = GNUNET_ECRS_search (ectx,
                      cfg,
                      *uri,
                      1,
                      1450 * GNUNET_CRON_SECONDS,
                      &searchCB, &myURI, &testTerminate, NULL);
-  ECRS_freeUri (*uri);
+  GNUNET_ECRS_uri_destroy (*uri);
   *uri = myURI;
   if ((ret != GNUNET_SYSERR) && (myURI != NULL))
     return GNUNET_OK;
@@ -185,7 +185,7 @@
 }
 
 static int
-downloadFile (unsigned int size, const struct ECRS_URI *uri)
+downloadFile (unsigned int size, const struct GNUNET_ECRS_URI *uri)
 {
   int ret;
   char *tmpName;
@@ -195,14 +195,14 @@
   int i;
   char *tmp;
 
-  tmp = ECRS_uriToString (uri);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  tmp = GNUNET_ECRS_uri_to_string (uri);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting download of `%s'\n", tmp);
   GNUNET_free (tmp);
   tmpName = makeName (0);
   ret = GNUNET_SYSERR;
-  if (GNUNET_OK == ECRS_downloadFile (ectx,
+  if (GNUNET_OK == GNUNET_ECRS_file_download (ectx,
                                       cfg,
                                       uri,
                                       tmpName,
@@ -238,14 +238,14 @@
   char *name;
 
   name = makeName (size);
-  ret = ECRS_unindexFile (ectx, cfg, name, NULL, NULL, &testTerminate, NULL);
+  ret = GNUNET_ECRS_file_uninde (ectx, cfg, name, NULL, NULL, &testTerminate, 
NULL);
   if (0 != UNLINK (name))
     ret = GNUNET_SYSERR;
   GNUNET_free (name);
   return ret;
 }
 
-#define CHECK(a) if (!(a)) { ret = 1; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ret = 1; GNUNET_GE_BREAK(ectx, 0); goto FAILURE; }
 
 /**
  * Testcase to test gap routing (2 peers only).
@@ -256,16 +256,16 @@
 {
   struct GNUNET_TESTING_DaemonContext *peers;
   int ret;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
   char buf[128];
   GNUNET_CronTime start;
 
   ret = 0;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
@@ -276,7 +276,7 @@
   if (peers == NULL)
     {
       fprintf (stderr, "Failed to start the gnunetd daemons!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -287,7 +287,7 @@
         {
           GNUNET_TESTING_stop_daemons (peers);
           fprintf (stderr, "Failed to connect the peers!\n");
-          GC_free (cfg);
+          GNUNET_GC_free (cfg);
           return -1;
         }
     }
@@ -296,7 +296,7 @@
   uri = uploadFile (SIZE);
   CHECK (NULL != uri);
   GNUNET_snprintf (buf, 128, "localhost:%u", 2077 + PEER_COUNT * 10);
-  GC_set_configuration_value_string (cfg, ectx, "NETWORK", "HOST", buf);
+  GNUNET_GC_set_configuration_value_string (cfg, ectx, "NETWORK", "HOST", buf);
   CHECK (GNUNET_OK == searchFile (&uri));
   printf ("Search successful!\n");
   start = GNUNET_get_time ();
@@ -305,8 +305,8 @@
   printf ("Download successful at %llu kbps!\n",
           (SIZE / 1024) / ((GNUNET_get_time () - start) /
                            GNUNET_CRON_SECONDS));
-  ECRS_freeUri (uri);
-  GC_set_configuration_value_string (cfg,
+  GNUNET_ECRS_uri_destroy (uri);
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:2087");
   CHECK (GNUNET_OK == unindexFile (SIZE));
@@ -316,7 +316,7 @@
   GNUNET_TESTING_stop_daemons (peers);
 #endif
 
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return ret;
 }
 

Modified: GNUnet/src/applications/gap/gaptest3.c
===================================================================
--- GNUnet/src/applications/gap/gaptest3.c      2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/gap/gaptest3.c      2007-11-25 12:04:45 UTC (rev 
5755)
@@ -41,9 +41,9 @@
 
 #define SIZE 1024*1024*2
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 static int
 testTerminate (void *unused)
@@ -82,14 +82,14 @@
   return fn;
 }
 
-static struct ECRS_URI *
+static struct GNUNET_ECRS_URI *
 uploadFile (unsigned int size)
 {
   int ret;
   char *name;
   int fd;
   char *buf;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
 
   name = makeName (size);
@@ -104,7 +104,7 @@
   WRITE (fd, buf, size);
   GNUNET_free (buf);
   GNUNET_disk_file_close (ectx, name, fd);
-  ret = ECRS_uploadFile (ectx, cfg, name, GNUNET_YES,   /* index */
+  ret = GNUNET_ECRS_file_upload (ectx, cfg, name, GNUNET_YES,   /* index */
                          1,     /* anon */
                          0,     /* prio */
                          GNUNET_get_time () + 100 * GNUNET_CRON_MINUTES,       
 /* expire */
@@ -116,7 +116,7 @@
 }
 
 static int
-downloadFile (unsigned int size, const struct ECRS_URI *uri)
+downloadFile (unsigned int size, const struct GNUNET_ECRS_URI *uri)
 {
   int ret;
   char *tmpName;
@@ -126,14 +126,14 @@
   int i;
   char *tmp;
 
-  tmp = ECRS_uriToString (uri);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  tmp = GNUNET_ECRS_uri_to_string (uri);
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Starting download of `%s'\n", tmp);
   GNUNET_free (tmp);
   tmpName = makeName (0);
   ret = GNUNET_SYSERR;
-  if (GNUNET_OK == ECRS_downloadFile (ectx,
+  if (GNUNET_OK == GNUNET_ECRS_file_download (ectx,
                                       cfg,
                                       uri,
                                       tmpName,
@@ -162,7 +162,7 @@
   return ret;
 }
 
-#define CHECK(a) if (!(a)) { ret = 1; GE_BREAK(ectx, 0); goto FAILURE; }
+#define CHECK(a) if (!(a)) { ret = 1; GNUNET_GE_BREAK(ectx, 0); goto FAILURE; }
 
 static GNUNET_PeerIdentity goodPeers[PEER_COUNT];
 static unsigned int goodPeerPos;
@@ -202,7 +202,7 @@
 {
   struct GNUNET_TESTING_DaemonContext *peers;
   int ret;
-  struct ECRS_URI *uri;
+  struct GNUNET_ECRS_URI *uri;
   int i;
   char buf[128];
   GNUNET_MessageHello *hello;
@@ -211,10 +211,10 @@
   GNUNET_EncName enc;
 
   ret = 0;
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
@@ -225,7 +225,7 @@
   if (peers == NULL)
     {
       fprintf (stderr, "Failed to start the gnunetd daemons!\n");
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -236,7 +236,7 @@
         {
           GNUNET_TESTING_stop_daemons (peers);
           fprintf (stderr, "Failed to connect the peers!\n");
-          GC_free (cfg);
+          GNUNET_GC_free (cfg);
           return -1;
         }
     }
@@ -246,17 +246,17 @@
   for (i = 1; i < PEER_COUNT; i += 2)
     {
       GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + i * 10);
-      GC_set_configuration_value_string (cfg, ectx, "NETWORK", "HOST", buf);
+      GNUNET_GC_set_configuration_value_string (cfg, ectx, "NETWORK", "HOST", 
buf);
       sock = GNUNET_client_connection_create (NULL, cfg);
       if (GNUNET_OK != GNUNET_IDENTITY_get_self (sock, &hello))
         {
           GNUNET_client_connection_destroy (sock);
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           break;
         }
       GNUNET_client_connection_destroy (sock);
       if (uri != NULL)
-        ECRS_freeUri (uri);
+        GNUNET_ECRS_uri_destroy (uri);
       GNUNET_hash_to_enc (&hello->senderIdentity.hashPubKey, &enc);
       printf ("Uploading to peer `%8s'\n", (const char *) &enc);
       uri = uploadFile (SIZE);
@@ -266,7 +266,7 @@
       GNUNET_free (hello);
 
     }
-  GC_set_configuration_value_string (cfg,
+  GNUNET_GC_set_configuration_value_string (cfg,
                                      ectx,
                                      "NETWORK", "HOST", "localhost:2087");
   printf ("Downloading...\n");
@@ -285,7 +285,7 @@
 #if START_PEERS
   GNUNET_TESTING_stop_daemons (peers);
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return ret;
 }
 

Modified: GNUnet/src/applications/gap/pid_table.c
===================================================================
--- GNUnet/src/applications/gap/pid_table.c     2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/gap/pid_table.c     2007-11-25 12:04:45 UTC (rev 
5755)
@@ -30,13 +30,13 @@
 /**
  * Statistics service.
  */
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
 static int stat_pid_entries;
 
 static int stat_pid_rc;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 typedef struct
 {
@@ -95,7 +95,7 @@
     }
   if (ret == 0)
     ret = 1;
-  GE_ASSERT (ectx, ret < size);
+  GNUNET_GE_ASSERT (ectx, ret < size);
   table[ret].id = pid->hashPubKey;
   table[ret].rc = 1;
   GNUNET_mutex_unlock (lock);
@@ -118,8 +118,8 @@
   for (i = count - 1; i >= 0; i--)
     {
       id = ids[i];
-      GE_ASSERT (ectx, id < size);
-      GE_ASSERT (ectx, table[id].rc > 0);
+      GNUNET_GE_ASSERT (ectx, id < size);
+      GNUNET_GE_ASSERT (ectx, table[id].rc > 0);
       table[id].rc--;
       if ((table[id].rc == 0) && (stats != NULL))
         stats->change (stat_pid_entries, -1);
@@ -135,8 +135,8 @@
   if (id == 0)
     return;
   GNUNET_mutex_lock (lock);
-  GE_ASSERT (ectx, id < size);
-  GE_ASSERT (ectx, table[id].rc > 0);
+  GNUNET_GE_ASSERT (ectx, id < size);
+  GNUNET_GE_ASSERT (ectx, table[id].rc > 0);
   table[id].rc += delta;
   if (stats != NULL)
     {
@@ -153,19 +153,19 @@
   if (id == 0)
     {
       memset (pid, 0, sizeof (GNUNET_PeerIdentity));
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return;
     }
   GNUNET_mutex_lock (lock);
-  GE_ASSERT (ectx, id < size);
-  GE_ASSERT (ectx, table[id].rc > 0);
+  GNUNET_GE_ASSERT (ectx, id < size);
+  GNUNET_GE_ASSERT (ectx, table[id].rc > 0);
   pid->hashPubKey = table[id].id;
   GNUNET_mutex_unlock (lock);
 }
 
 
 void
-init_pid_table (struct GE_Context *e, Stats_ServiceAPI * s)
+init_pid_table (struct GNUNET_GE_Context *e, GNUNET_Stats_ServiceAPI * s)
 {
   ectx = e;
   stats = s;

Modified: GNUnet/src/applications/gap/pid_table.h
===================================================================
--- GNUnet/src/applications/gap/pid_table.h     2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/gap/pid_table.h     2007-11-25 12:04:45 UTC (rev 
5755)
@@ -27,7 +27,7 @@
 #include "gnunet_util.h"
 #include "gnunet_stats_service.h"
 
-void init_pid_table (struct GE_Context *ectx, Stats_ServiceAPI * s);
+void init_pid_table (struct GNUNET_GE_Context *ectx, GNUNET_Stats_ServiceAPI * 
s);
 
 void done_pid_table (void);
 

Modified: GNUnet/src/applications/getoption/clientapi.c
===================================================================
--- GNUnet/src/applications/getoption/clientapi.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/getoption/clientapi.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -47,10 +47,10 @@
   char *ret;
 
   memset (&req, 0, sizeof (CS_getoption_request_MESSAGE));
-  req.header.type = htons (CS_PROTO_GET_OPTION_REQUEST);
+  req.header.type = htons (GNUNET_CS_PROTO_GET_OPTION_REQUEST);
   req.header.size = htons (sizeof (CS_getoption_request_MESSAGE));
-  if ((strlen (section) >= CS_getoption_request_MESSAGE_OPT_LEN) ||
-      (strlen (option) >= CS_getoption_request_MESSAGE_OPT_LEN))
+  if ((strlen (section) >= CS_getoption_request_MESSAGNUNET_GE_OPT_LEN) ||
+      (strlen (option) >= CS_getoption_request_MESSAGNUNET_GE_OPT_LEN))
     return NULL;
   strcpy (&req.section[0], section);
   strcpy (&req.option[0], option);

Modified: GNUnet/src/applications/getoption/getoption.c
===================================================================
--- GNUnet/src/applications/getoption/getoption.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/getoption/getoption.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -31,10 +31,10 @@
  * @author Christian Grothoff
  */
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static int
-handleGetOption (struct ClientHandle *sock,
+handleGetOption (struct GNUNET_ClientHandle *sock,
                  const GNUNET_MessageHeader * message)
 {
   CS_getoption_request_MESSAGE *req;
@@ -45,13 +45,13 @@
   if (ntohs (message->size) != sizeof (CS_getoption_request_MESSAGE))
     return GNUNET_SYSERR;
   req = (CS_getoption_request_MESSAGE *) message;
-  req->section[CS_getoption_request_MESSAGE_OPT_LEN - 1] = '\0';
-  req->option[CS_getoption_request_MESSAGE_OPT_LEN - 1] = '\0';
+  req->section[CS_getoption_request_MESSAGNUNET_GE_OPT_LEN - 1] = '\0';
+  req->option[CS_getoption_request_MESSAGNUNET_GE_OPT_LEN - 1] = '\0';
   val = NULL;
-  if (GNUNET_NO == GC_have_configuration_value (coreAPI->cfg,
+  if (GNUNET_NO == GNUNET_GC_have_configuration_value (coreAPI->cfg,
                                                 req->section, req->option))
     return GNUNET_SYSERR;       /* signal error: option not set */
-  if ((0 != GC_get_configuration_value_string (coreAPI->cfg,
+  if ((0 != GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                                req->section,
                                                req->option,
                                                NULL, &val)) || (val == NULL))
@@ -60,7 +60,7 @@
   rep = GNUNET_malloc (sizeof (GNUNET_MessageHeader) + strlen (val) + 1);
   rep->header.size = htons (sizeof (GNUNET_MessageHeader) + strlen (val) + 1);
   memcpy (rep->value, val, strlen (val) + 1);
-  rep->header.type = htons (CS_PROTO_GET_OPTION_REPLY);
+  rep->header.type = htons (GNUNET_CS_PROTO_GET_OPTION_REPLY);
   ret = coreAPI->sendToClient (sock, &rep->header, GNUNET_YES);
   GNUNET_free (rep);
   GNUNET_free (val);
@@ -68,16 +68,16 @@
 }
 
 int
-initialize_module_getoption (CoreAPIForApplication * capi)
+initialize_module_getoption (GNUNET_CoreAPIForPlugins * capi)
 {
   coreAPI = capi;
-  GE_LOG (capi->ectx,
-          GE_INFO | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (capi->ectx,
+          GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           _("`%s' registering client handler %d\n"),
-          "getoption", CS_PROTO_GET_OPTION_REQUEST);
-  capi->registerClientHandler (CS_PROTO_GET_OPTION_REQUEST, &handleGetOption);
-  GE_ASSERT (capi->ectx,
-             0 == GC_set_configuration_value_string (capi->cfg,
+          "getoption", GNUNET_CS_PROTO_GET_OPTION_REQUEST);
+  capi->registerClientHandler (GNUNET_CS_PROTO_GET_OPTION_REQUEST, 
&handleGetOption);
+  GNUNET_GE_ASSERT (capi->ectx,
+             0 == GNUNET_GC_set_configuration_value_string (capi->cfg,
                                                      capi->ectx,
                                                      "ABOUT",
                                                      "getoption",
@@ -90,7 +90,7 @@
 void
 done_module_getoption ()
 {
-  coreAPI->unregisterClientHandler (CS_PROTO_GET_OPTION_REQUEST,
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_GET_OPTION_REQUEST,
                                     &handleGetOption);
   coreAPI = NULL;
 }

Modified: GNUnet/src/applications/getoption/getoption.h
===================================================================
--- GNUnet/src/applications/getoption/getoption.h       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/getoption/getoption.h       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -21,7 +21,7 @@
 #ifndef GETOPTION_H
 #define GETOPTION_H
 
-#define CS_getoption_request_MESSAGE_OPT_LEN 32
+#define CS_getoption_request_MESSAGNUNET_GE_OPT_LEN 32
 
 /**
  * Request for option value.
@@ -29,8 +29,8 @@
 typedef struct
 {
   GNUNET_MessageHeader header;
-  char section[CS_getoption_request_MESSAGE_OPT_LEN];
-  char option[CS_getoption_request_MESSAGE_OPT_LEN];
+  char section[CS_getoption_request_MESSAGNUNET_GE_OPT_LEN];
+  char option[CS_getoption_request_MESSAGNUNET_GE_OPT_LEN];
 } CS_getoption_request_MESSAGE;
 
 /**

Modified: GNUnet/src/applications/identity/clientapi.c
===================================================================
--- GNUnet/src/applications/identity/clientapi.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/identity/clientapi.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -43,7 +43,7 @@
 
   msg = GNUNET_malloc (GNUNET_sizeof_hello (hello));
   memcpy (msg, hello, GNUNET_sizeof_hello (hello));
-  msg->header.type = htons (CS_PROTO_identity_HELLO);
+  msg->header.type = htons (GNUNET_CS_PROTO_IDENTITY_HELLO);
   /* check that signature is valid -- internal
      sanity check... */
   if (GNUNET_SYSERR == GNUNET_RSA_verify (&msg->senderIdentity,
@@ -53,7 +53,7 @@
                                           - sizeof (GNUNET_MessageHeader),
                                           &msg->signature, &msg->publicKey))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       GNUNET_free (msg);
       return GNUNET_SYSERR;
     }
@@ -82,7 +82,7 @@
 
   req = GNUNET_malloc (sizeof (GNUNET_MessageHeader) + size);
   req->size = htons (sizeof (GNUNET_MessageHeader) + size);
-  req->type = htons (CS_PROTO_identity_request_SIGN);
+  req->type = htons (GNUNET_CS_PROTO_IDENTITY_REQUEST_SIGNATURE);
   memcpy (&req[1], data, size);
   if (GNUNET_SYSERR == GNUNET_client_connection_write (sock, req))
     {
@@ -97,7 +97,7 @@
       return GNUNET_SYSERR;
     }
   if ((ntohs (reply->header.size) != sizeof (CS_identity_signature_MESSAGE))
-      || (ntohs (reply->header.type) != CS_PROTO_identity_SIGNATURE))
+      || (ntohs (reply->header.type) != GNUNET_CS_PROTO_IDENTITY_SIGNATURE))
     {
       GNUNET_free (reply);
       return GNUNET_SYSERR;
@@ -122,7 +122,7 @@
   GNUNET_MessageHello *reply;
 
   req.size = htons (sizeof (GNUNET_MessageHeader));
-  req.type = htons (CS_PROTO_identity_request_HELLO);
+  req.type = htons (GNUNET_CS_PROTO_IDENTITY_REQUEST_HELLO);
   if (GNUNET_SYSERR == GNUNET_client_connection_write (sock, &req))
     return GNUNET_SYSERR;
   if (GNUNET_OK !=
@@ -132,13 +132,13 @@
       return GNUNET_SYSERR;
     }
   if ((ntohs (reply->header.size) < sizeof (GNUNET_MessageHello)) ||
-      (ntohs (reply->header.type) != CS_PROTO_identity_HELLO) ||
+      (ntohs (reply->header.type) != GNUNET_CS_PROTO_IDENTITY_HELLO) ||
       (ntohs (reply->header.size) != GNUNET_sizeof_hello (reply)))
     {
       GNUNET_free (reply);
       return GNUNET_SYSERR;
     }
-  reply->header.type = htons (p2p_PROTO_hello);
+  reply->header.type = htons (GNUNET_P2P_PROTO_HELLO);
   *msg = reply;
   return GNUNET_OK;
 }
@@ -157,7 +157,7 @@
   CS_identity_connect_MESSAGE msg;
   int result;
 
-  msg.header.type = htons (CS_PROTO_identity_CONNECT);
+  msg.header.type = htons (GNUNET_CS_PROTO_IDENTITY_CONNECT);
   msg.header.size = htons (sizeof (CS_identity_connect_MESSAGE));
   msg.other = *peer;
   if (GNUNET_SYSERR == GNUNET_client_connection_write (sock, &msg.header))
@@ -185,7 +185,7 @@
   unsigned int count;
 
   req.size = htons (sizeof (GNUNET_MessageHeader));
-  req.type = htons (CS_PROTO_identity_request_INFO);
+  req.type = htons (GNUNET_CS_PROTO_IDENTITY_REQUEST_INFO);
   if (GNUNET_SYSERR == GNUNET_client_connection_write (sock, &req))
     return GNUNET_SYSERR;
   count = 0;
@@ -193,20 +193,20 @@
     {
       if (ntohs (reply->size) < sizeof (GNUNET_MessageHeader))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           GNUNET_free (reply);
           return GNUNET_SYSERR;
         }
-      if (ntohs (reply->type) == CS_PROTO_RETURN_VALUE)
+      if (ntohs (reply->type) == GNUNET_CS_PROTO_RETURN_VALUE)
         {
           GNUNET_free (reply);
           return count;
         }
       count++;
-      if ((ntohs (reply->type) != CS_PROTO_identity_INFO) ||
+      if ((ntohs (reply->type) != GNUNET_CS_PROTO_IDENTITY_INFO) ||
           (ntohs (reply->size) < sizeof (CS_identity_peer_info_MESSAGE)))
         {
-          GE_BREAK (NULL, 0);
+          GNUNET_GE_BREAK (NULL, 0);
           GNUNET_free (reply);
           return GNUNET_SYSERR;
         }

Modified: GNUnet/src/applications/identity/hostkey.c
===================================================================
--- GNUnet/src/applications/identity/hostkey.c  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/identity/hostkey.c  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -73,7 +73,7 @@
 #if EXTRA_CHECKS
   if (ret == GNUNET_OK)
     {
-      GE_ASSERT (NULL,
+      GNUNET_GE_ASSERT (NULL,
                  GNUNET_OK == GNUNET_RSA_verify (data, size, result,
                                                  &publicKey));
     }
@@ -98,7 +98,7 @@
 }
 
 void
-initPrivateKey (struct GE_Context *ectx, struct GC_Configuration *cfg)
+initPrivateKey (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration 
*cfg)
 {
   char *gnHome;
   char *hostkeyfile;
@@ -106,17 +106,17 @@
   unsigned short len;
   int res;
 
-  GE_ASSERT (ectx,
-             -1 != GC_get_configuration_value_filename (cfg,
+  GNUNET_GE_ASSERT (ectx,
+             -1 != GNUNET_GC_get_configuration_value_filename (cfg,
                                                         "GNUNETD",
                                                         "GNUNETD_HOME",
-                                                        VAR_DAEMON_DIRECTORY,
+                                                        
GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY,
                                                         &gnHome));
   GNUNET_disk_directory_create (ectx, gnHome);
   if (GNUNET_YES != GNUNET_disk_directory_test (ectx, gnHome))
     {
-      GE_LOG (ectx,
-              GE_FATAL | GE_ADMIN | GE_USER | GE_IMMEDIATE,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_FATAL | GNUNET_GE_ADMIN | GNUNET_GE_USER | 
GNUNET_GE_IMMEDIATE,
               _("Failed to access GNUnet home directory `%s'\n"), gnHome);
       abort ();
     }
@@ -145,8 +145,8 @@
                                  encPrivateKey))
         {
           GNUNET_free (encPrivateKey);
-          GE_LOG (ectx,
-                  GE_WARNING | GE_USER | GE_IMMEDIATE | GE_ADMIN,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_IMMEDIATE | 
GNUNET_GE_ADMIN,
                   _
                   ("Existing hostkey in file `%s' failed format check, 
creating new hostkey.\n"),
                   hostkeyfile);
@@ -155,20 +155,20 @@
     }
   if (encPrivateKey == NULL)
     {                           /* make new hostkey */
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
               _("Creating new hostkey (this may take a while).\n"));
       hostkey = GNUNET_RSA_create_key ();
-      GE_ASSERT (ectx, hostkey != NULL);
+      GNUNET_GE_ASSERT (ectx, hostkey != NULL);
       encPrivateKey = GNUNET_RSA_encode_key (hostkey);
-      GE_ASSERT (ectx, encPrivateKey != NULL);
+      GNUNET_GE_ASSERT (ectx, encPrivateKey != NULL);
       GNUNET_disk_file_write (ectx,
                               hostkeyfile,
                               encPrivateKey, ntohs (encPrivateKey->len),
                               "600");
       GNUNET_free (encPrivateKey);
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_BULK, _("Done creating hostkey.\n"));
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK, _("Done 
creating hostkey.\n"));
     }
   else
     {
@@ -176,7 +176,7 @@
       GNUNET_free (encPrivateKey);
     }
   GNUNET_free (hostkeyfile);
-  GE_ASSERT (ectx, hostkey != NULL);
+  GNUNET_GE_ASSERT (ectx, hostkey != NULL);
   GNUNET_RSA_get_public_key (hostkey, &publicKey);
 }
 
@@ -184,7 +184,7 @@
 void
 donePrivateKey ()
 {
-  GE_ASSERT (NULL, hostkey != NULL);
+  GNUNET_GE_ASSERT (NULL, hostkey != NULL);
   GNUNET_RSA_free_key (hostkey);
   hostkey = NULL;
 }

Modified: GNUnet/src/applications/identity/hostkey.h
===================================================================
--- GNUnet/src/applications/identity/hostkey.h  2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/identity/hostkey.h  2007-11-25 12:04:45 UTC (rev 
5755)
@@ -59,7 +59,7 @@
 
 
 
-void initPrivateKey (struct GE_Context *ectx, struct GC_Configuration *cfg);
+void initPrivateKey (struct GNUNET_GE_Context *ectx, struct 
GNUNET_GC_Configuration *cfg);
 
 void donePrivateKey (void);
 

Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/identity/identity.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -143,9 +143,9 @@
 
 static GNUNET_PeerIdentity myIdentity;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 /**
  * Get the filename under which we would store the GNUNET_MessageHello
@@ -177,7 +177,7 @@
 {
   int i;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   for (i = 0; i < numberOfHosts_; i++)
     if ((0 ==
          memcmp (id, &hosts_[i]->identity, sizeof (GNUNET_PeerIdentity))))
@@ -200,7 +200,7 @@
   char *fn;
   unsigned int trust;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   GNUNET_mutex_lock (lock_);
   entry = findHost (identity);
   if (entry == NULL)
@@ -271,11 +271,11 @@
   host = findHost (hostId);
   if (host == NULL)
     {
-      addHostToKnown (hostId, NAT_PROTOCOL_NUMBER);
+      addHostToKnown (hostId, GNUNET_TRANSPORT_PROTOCOL_NUMBER_NAT);
       host = findHost (hostId);
       if (host == NULL)
         {
-          GE_BREAK (ectx, 0);
+          GNUNET_GE_BREAK (ectx, 0);
           GNUNET_mutex_unlock (lock_);
           return 0;
         }
@@ -325,8 +325,8 @@
   unsigned int protoNumber;
   char *fullname;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
-  GE_ASSERT (ectx, sizeof (GNUNET_EncName) == 104);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, sizeof (GNUNET_EncName) == 104);
   if (2 == sscanf (filename, "%103c.%u", (char *) &id, &protoNumber))
     {
       id.encoding[sizeof (GNUNET_EncName) - 1] = '\0';
@@ -345,27 +345,27 @@
   if (GNUNET_disk_file_test (ectx, fullname) == GNUNET_YES)
     {
       if (0 == UNLINK (fullname))
-        GE_LOG (ectx,
-                GE_WARNING | GE_USER | GE_ADMIN | GE_BULK,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                 _
                 ("File `%s' in directory `%s' does not match naming 
convention. "
                  "Removed.\n"), filename, networkIdDirectory);
       else
-        GE_LOG_STRERROR_FILE (ectx,
-                              GE_ERROR | GE_USER | GE_BULK,
+        GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                              GNUNET_GE_ERROR | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                               "unlink", fullname);
     }
   else if (GNUNET_disk_directory_test (ectx, fullname) == GNUNET_YES)
     {
       if (0 == RMDIR (fullname))
-        GE_LOG (ectx,
-                GE_WARNING | GE_USER | GE_ADMIN | GE_BULK,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK,
                 _
                 ("Directory `%s' in directory `%s' does not match naming 
convention. "
                  "Removed.\n"), filename, networkIdDirectory);
       else
-        GE_LOG_STRERROR_FILE (ectx,
-                              GE_ERROR | GE_USER | GE_BULK,
+        GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                              GNUNET_GE_ERROR | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                               "rmdir", fullname);
     }
   GNUNET_free (fullname);
@@ -395,12 +395,12 @@
       retries++;
       if ((retries & 32) > 0)
         {
-          GE_LOG (ectx,
-                  GE_WARNING | GE_USER | GE_BULK,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_BULK,
                   _("Still no peers found in `%s'!\n"), networkIdDirectory);
         }
     }
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
 }
 
 
@@ -440,7 +440,7 @@
   getPeerIdentity (&tmp->publicKey, &have);
   if (0 != memcmp (&have, &tmp->senderIdentity, sizeof (GNUNET_PeerIdentity)))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return;
     }
   GNUNET_mutex_lock (lock_);
@@ -490,8 +490,8 @@
   int i;
   int j;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
-  GE_ASSERT (ectx, protocol != ANY_PROTOCOL_NUMBER);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, protocol != GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY);
   GNUNET_mutex_lock (lock_);
   for (i = 0; i < numberOfHosts_; i++)
     {
@@ -524,8 +524,8 @@
           /* also remove hello file itself */
           fn = getHostFileName (identity, protocol);
           if (0 != UNLINK (fn))
-            GE_LOG_STRERROR_FILE (ectx,
-                                  GE_WARNING | GE_USER | GE_BULK,
+            GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                                  GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                                   "unlink", fn);
           GNUNET_free (fn);
 
@@ -541,7 +541,7 @@
               GNUNET_free (entry);
             }
           GNUNET_mutex_unlock (lock_);
-          GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+          GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
           return;               /* deleted */
         }
     }
@@ -566,11 +566,11 @@
   getPeerIdentity (&msg->publicKey, &have);
   if (0 != memcmp (&have, &msg->senderIdentity, sizeof (GNUNET_PeerIdentity)))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return;
     }
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
-  GE_ASSERT (ectx, msg != NULL);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, msg != NULL);
   fn = getHostFileName (&msg->senderIdentity, ntohs (msg->protocol));
   buffer = GNUNET_malloc (GNUNET_MAX_BUFFER_SIZE);
   if (GNUNET_disk_file_test (ectx, fn) == GNUNET_YES)
@@ -598,7 +598,7 @@
   GNUNET_mutex_lock (lock_);
   addHostToKnown (&msg->senderIdentity, ntohs (msg->protocol));
   host = findHost (&msg->senderIdentity);
-  GE_ASSERT (ectx, host != NULL);
+  GNUNET_GE_ASSERT (ectx, host != NULL);
 
   for (i = 0; i < host->helloCount; i++)
     {
@@ -614,17 +614,17 @@
   host->hellos[i] = GNUNET_malloc (GNUNET_sizeof_hello (msg));
   memcpy (host->hellos[i], msg, GNUNET_sizeof_hello (msg));
   GNUNET_mutex_unlock (lock_);
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
 }
 
 /**
  * Obtain the public key and address of a known host.  If no specific
- * protocol is specified (ANY_PROTOCOL_NUMBER), hellos for cheaper
+ * protocol is specified (GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY), hellos for 
cheaper
  * protocols are returned with preference (randomness!).
  *
  * @param hostId the host id
  * @param protocol the protocol that we need,
- *        ANY_PROTOCOL_NUMBER if we do not care which protocol
+ *        GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY if we do not care which protocol
  * @param tryTemporaryList is it ok to check the unverified hellos?
  * @param result where to store the result
  * @returns GNUNET_SYSERR on failure, GNUNET_OK on success
@@ -642,7 +642,7 @@
   int i;
   int j;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   GNUNET_mutex_lock (lock_);
   if (GNUNET_YES == tryTemporaryList)
     {
@@ -656,7 +656,7 @@
                memcmp (hostId, &host->identity,
                        sizeof (GNUNET_PeerIdentity))))
             {
-              if (protocol == ANY_PROTOCOL_NUMBER)
+              if (protocol == GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY)
                 {
                   j =
                     GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK,
@@ -691,7 +691,7 @@
       return NULL;
     }
 
-  if (protocol == ANY_PROTOCOL_NUMBER)
+  if (protocol == GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY)
     protocol =
       host->
       protocols[GNUNET_random_u32
@@ -722,12 +722,12 @@
   if (size != sizeof (GNUNET_MessageHello))
     {
       if (0 == UNLINK (fn))
-        GE_LOG (ectx,
-                GE_WARNING | GE_USER | GE_BULK,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_BULK,
                 _("Removed file `%s' containing invalid HELLO data.\n"), fn);
       else
-        GE_LOG_STRERROR_FILE (ectx,
-                              GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+        GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                               "unlink", fn);
       GNUNET_free (fn);
       GNUNET_mutex_unlock (lock_);
@@ -745,12 +745,12 @@
        memcmp (&have, &result->senderIdentity, sizeof (GNUNET_PeerIdentity))))
     {
       if (0 == UNLINK (fn))
-        GE_LOG (ectx,
-                GE_WARNING | GE_USER | GE_BULK,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_WARNING | GNUNET_GE_USER | GNUNET_GE_BULK,
                 _("Removed file `%s' containing invalid HELLO data.\n"), fn);
       else
-        GE_LOG_STRERROR_FILE (ectx,
-                              GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+        GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                              GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER | GNUNET_GE_BULK,
                               "unlink", fn);
       GNUNET_free (fn);
       GNUNET_free (result);
@@ -784,17 +784,17 @@
   GNUNET_MessageHello *hello;
   int res;
 
-  hello = identity2Hello (signer, ANY_PROTOCOL_NUMBER, GNUNET_YES);
+  hello = identity2Hello (signer, GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY, 
GNUNET_YES);
   if (hello == NULL)
     {
 #if DEBUG_IDENTITY
       GNUNET_EncName enc;
 
       IF_GELOG (ectx,
-                GE_INFO | GE_USER | GE_BULK,
+                GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
                 GNUNET_hash_to_enc (&signer->hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
               _("Signature failed verification: peer `%s' not known.\n"),
               &enc);
 #endif
@@ -802,8 +802,8 @@
     }
   res = GNUNET_RSA_verify (message, size, sig, &hello->publicKey);
   if (res == GNUNET_SYSERR)
-    GE_LOG (ectx,
-            GE_ERROR | GE_REQUEST | GE_DEVELOPER | GE_USER,
+    GNUNET_GE_LOG (ectx,
+            GNUNET_GE_ERROR | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER | 
GNUNET_GE_USER,
             _("Signature failed verification: signature invalid.\n"));
   GNUNET_free (hello);
   return res;
@@ -827,7 +827,7 @@
   int i;
   GNUNET_CronTime now;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   GNUNET_mutex_lock (lock_);
   entry = findHost (identity);
   if (entry == NULL)
@@ -876,8 +876,8 @@
   entry->strict = strict;
   GNUNET_hash_to_enc (&identity->hashPubKey, &hn);
 #if DEBUG_IDENTITY
-  GE_LOG (ectx,
-          GE_INFO | GE_REQUEST | GE_DEVELOPER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_DEVELOPER,
           "Blacklisting host `%s' for %llu seconds"
           " until %llu (strict=%d).\n",
           &hn, entry->delta / GNUNET_CRON_SECONDS, entry->until, strict);
@@ -898,7 +898,7 @@
   GNUNET_CronTime now;
   HostEntry *entry;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   GNUNET_mutex_lock (lock_);
   entry = findHost (identity);
   if (entry == NULL)
@@ -914,10 +914,10 @@
       GNUNET_EncName enc;
 
       IF_GELOG (ectx,
-                GE_INFO | GE_USER | GE_BULK,
+                GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
                 GNUNET_hash_to_enc (&identity->hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
               _
               ("Peer `%s' is currently strictly blacklisted (for another 
%llums).\n"),
               &enc, entry->until - now);
@@ -944,7 +944,7 @@
   HostEntry *entry;
   int i;
 
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   GNUNET_mutex_lock (lock_);
   entry = findHost (identity);
   if (entry == NULL)
@@ -983,7 +983,7 @@
  * @return the number of hosts matching
  */
 static int
-forEachHost (GNUNET_CronTime now, HostIterator callback, void *data)
+forEachHost (GNUNET_CronTime now, GNUNET_HostProcessor callback, void *data)
 {
   int i;
   int j;
@@ -994,7 +994,7 @@
   int ret;
 
   ret = GNUNET_OK;
-  GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
+  GNUNET_GE_ASSERT (ectx, numberOfHosts_ <= sizeOfHosts_);
   count = 0;
   GNUNET_mutex_lock (lock_);
   for (i = 0; i < numberOfHosts_; i++)
@@ -1036,10 +1036,10 @@
           GNUNET_EncName enc;
 
           IF_GELOG (ectx,
-                    GE_INFO | GE_USER | GE_BULK,
+                    GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
                     GNUNET_hash_to_enc (&entry->identity.hashPubKey, &enc));
-          GE_LOG (ectx,
-                  GE_INFO | GE_USER | GE_BULK,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_BULK,
                   entry->strict ?
                   _
                   ("Peer `%s' is currently strictly blacklisted (for another 
%llums).\n")
@@ -1099,8 +1099,8 @@
   if (host->trust == 0)
     {
       if ((0 != UNLINK (fn)) && (errno != ENOENT))
-        GE_LOG_STRERROR_FILE (ectx,
-                              GE_WARNING | GE_USER | GE_BULK, "unlink", fn);
+        GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                              GNUNET_GE_WARNING | GNUNET_GE_USER | 
GNUNET_GE_BULK, "unlink", fn);
     }
   else
     {
@@ -1169,7 +1169,7 @@
 
 
 static int
-identityRequestConnectHandler (struct ClientHandle *sock,
+identityRequestConnectHandler (struct GNUNET_ClientHandle *sock,
                                const GNUNET_MessageHeader * message)
 {
   const CS_identity_connect_MESSAGE *msg;
@@ -1186,7 +1186,7 @@
 }
 
 static int
-identityHelloHandler (struct ClientHandle *sock,
+identityHelloHandler (struct GNUNET_ClientHandle *sock,
                       const GNUNET_MessageHeader * message)
 {
   const GNUNET_MessageHello *msg;
@@ -1194,18 +1194,18 @@
 
   if (sizeof (GNUNET_MessageHello) > ntohs (message->size))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   msg = (const GNUNET_MessageHello *) message;
   if (GNUNET_sizeof_hello (msg) != ntohs (message->size))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   hello = GNUNET_malloc (ntohs (msg->header.size));
   memcpy (hello, msg, ntohs (msg->header.size));
-  hello->header.type = htons (p2p_PROTO_hello);
+  hello->header.type = htons (GNUNET_P2P_PROTO_HELLO);
   coreAPI->injectMessage (NULL,
                           (const char *) hello,
                           ntohs (msg->header.size), GNUNET_NO, NULL);
@@ -1214,23 +1214,23 @@
 }
 
 static int
-identityRequestHelloHandler (struct ClientHandle *sock,
+identityRequestHelloHandler (struct GNUNET_ClientHandle *sock,
                              const GNUNET_MessageHeader * message)
 {
   /* transport types in order of preference
      for location URIs (by best guess at what
      people are most likely to actually run) */
   static unsigned short types[] = {
-    TCP_PROTOCOL_NUMBER,
-    UDP_PROTOCOL_NUMBER,
-    HTTP_PROTOCOL_NUMBER,
-    TCP6_PROTOCOL_NUMBER,
-    UDP6_PROTOCOL_NUMBER,
-    SMTP_PROTOCOL_NUMBER,
-    NAT_PROTOCOL_NUMBER,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_TCP,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_UDP,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_HTTP,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_TCP6,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_UDP6,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_SMTP,
+    GNUNET_TRANSPORT_PROTOCOL_NUMBER_NAT,
     0,
   };
-  Transport_ServiceAPI *tapi;
+  GNUNET_Transport_ServiceAPI *tapi;
   GNUNET_MessageHello *hello;
   int pos;
   int ret;
@@ -1248,14 +1248,14 @@
   coreAPI->releaseService (tapi);
   if (hello == NULL)
     return GNUNET_SYSERR;
-  hello->header.type = htons (CS_PROTO_identity_HELLO);
+  hello->header.type = htons (GNUNET_CS_PROTO_IDENTITY_HELLO);
   ret = coreAPI->sendToClient (sock, &hello->header, GNUNET_YES);
   GNUNET_free (hello);
   return ret;
 }
 
 static int
-identityRequestSignatureHandler (struct ClientHandle *sock,
+identityRequestSignatureHandler (struct GNUNET_ClientHandle *sock,
                                  const GNUNET_MessageHeader * message)
 {
   CS_identity_signature_MESSAGE reply;
@@ -1263,7 +1263,7 @@
   if (ntohs (message->size) <= sizeof (GNUNET_MessageHeader))
     return GNUNET_SYSERR;
   reply.header.size = htons (sizeof (CS_identity_signature_MESSAGE));
-  reply.header.type = htons (CS_PROTO_identity_SIGNATURE);
+  reply.header.type = htons (GNUNET_CS_PROTO_IDENTITY_SIGNATURE);
   if (GNUNET_OK != signData (&message[1],
                              ntohs (message->size) -
                              sizeof (GNUNET_MessageHeader), &reply.sig))
@@ -1275,8 +1275,8 @@
 hostInfoIterator (const GNUNET_PeerIdentity * identity,
                   unsigned short protocol, int confirmed, void *data)
 {
-  struct ClientHandle *sock = data;
-  Transport_ServiceAPI *transport;
+  struct GNUNET_ClientHandle *sock = data;
+  GNUNET_Transport_ServiceAPI *transport;
   CS_identity_peer_info_MESSAGE *reply;
   GNUNET_MessageHello *hello;
   void *address;
@@ -1315,7 +1315,7 @@
     }
   reply = GNUNET_malloc (sizeof (CS_identity_peer_info_MESSAGE) + len);
   reply->header.size = htons (sizeof (CS_identity_peer_info_MESSAGE) + len);
-  reply->header.type = htons (CS_PROTO_identity_INFO);
+  reply->header.type = htons (GNUNET_CS_PROTO_IDENTITY_INFO);
   reply->peer = *identity;
   reply->last_message = GNUNET_htonll (last);
   reply->trust = htonl (getHostTrust (identity));
@@ -1328,7 +1328,7 @@
 }
 
 static int
-identityRequestInfoHandler (struct ClientHandle *sock,
+identityRequestInfoHandler (struct GNUNET_ClientHandle *sock,
                             const GNUNET_MessageHeader * message)
 {
   forEachHost (0, &hostInfoIterator, sock);
@@ -1342,10 +1342,10 @@
  * @param capi the core API
  * @return NULL on errors, ID_API otherwise
  */
-Identity_ServiceAPI *
-provide_module_identity (CoreAPIForApplication * capi)
+GNUNET_Identity_ServiceAPI *
+provide_module_identity (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Identity_ServiceAPI id;
+  static GNUNET_Identity_ServiceAPI id;
   char *gnHome;
   char *tmp;
   int i;
@@ -1373,11 +1373,11 @@
   numberOfHosts_ = 0;
 
   gnHome = NULL;
-  GE_ASSERT (ectx,
-             -1 != GC_get_configuration_value_filename (coreAPI->cfg,
+  GNUNET_GE_ASSERT (ectx,
+             -1 != GNUNET_GC_get_configuration_value_filename (coreAPI->cfg,
                                                         "GNUNETD",
                                                         "GNUNETD_HOME",
-                                                        VAR_DAEMON_DIRECTORY,
+                                                        
GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY,
                                                         &gnHome));
   if (gnHome == NULL)
     return NULL;
@@ -1387,8 +1387,8 @@
   strcat (tmp, DIR_SEPARATOR_STR);
   strcat (tmp, HOST_DIR);
   networkIdDirectory = NULL;
-  GE_ASSERT (ectx,
-             -1 != GC_get_configuration_value_filename (coreAPI->cfg,
+  GNUNET_GE_ASSERT (ectx,
+             -1 != GNUNET_GC_get_configuration_value_filename (coreAPI->cfg,
                                                         "GNUNETD",
                                                         "HOSTS",
                                                         tmp,
@@ -1415,15 +1415,15 @@
   GNUNET_cron_add_job (coreAPI->cron,
                        &cronDiscardHosts, 0, CRON_DISCARD_HOSTS_INTERVAL,
                        NULL);
-  coreAPI->registerClientHandler (CS_PROTO_identity_CONNECT,
+  coreAPI->registerClientHandler (GNUNET_CS_PROTO_IDENTITY_CONNECT,
                                   &identityRequestConnectHandler);
-  coreAPI->registerClientHandler (CS_PROTO_identity_HELLO,
+  coreAPI->registerClientHandler (GNUNET_CS_PROTO_IDENTITY_HELLO,
                                   &identityHelloHandler);
-  coreAPI->registerClientHandler (CS_PROTO_identity_request_HELLO,
+  coreAPI->registerClientHandler (GNUNET_CS_PROTO_IDENTITY_REQUEST_HELLO,
                                   &identityRequestHelloHandler);
-  coreAPI->registerClientHandler (CS_PROTO_identity_request_SIGN,
+  coreAPI->registerClientHandler (GNUNET_CS_PROTO_IDENTITY_REQUEST_SIGNATURE,
                                   &identityRequestSignatureHandler);
-  coreAPI->registerClientHandler (CS_PROTO_identity_request_INFO,
+  coreAPI->registerClientHandler (GNUNET_CS_PROTO_IDENTITY_REQUEST_INFO,
                                   &identityRequestInfoHandler);
   return &id;
 }
@@ -1438,15 +1438,15 @@
   int j;
   HostEntry *entry;
 
-  coreAPI->unregisterClientHandler (CS_PROTO_identity_CONNECT,
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_IDENTITY_CONNECT,
                                     &identityRequestConnectHandler);
-  coreAPI->unregisterClientHandler (CS_PROTO_identity_HELLO,
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_IDENTITY_HELLO,
                                     &identityHelloHandler);
-  coreAPI->unregisterClientHandler (CS_PROTO_identity_request_HELLO,
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_IDENTITY_REQUEST_HELLO,
                                     &identityRequestHelloHandler);
-  coreAPI->unregisterClientHandler (CS_PROTO_identity_request_SIGN,
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_IDENTITY_REQUEST_SIGNATURE,
                                     &identityRequestSignatureHandler);
-  coreAPI->unregisterClientHandler (CS_PROTO_identity_request_INFO,
+  coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_IDENTITY_REQUEST_INFO,
                                     &identityRequestInfoHandler);
   for (i = 0; i < MAX_TEMP_HOSTS; i++)
     {

Modified: GNUnet/src/applications/identity/identitytest.c
===================================================================
--- GNUnet/src/applications/identity/identitytest.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/identity/identitytest.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -37,7 +37,7 @@
 
 static struct GNUNET_CronManager *cron;
 
-static struct GC_Configuration *cfg;
+static struct GNUNET_GC_Configuration *cfg;
 
 
 #define ASSERT(cond) do { \
@@ -54,8 +54,8 @@
 static int
 runTest ()
 {
-  Identity_ServiceAPI *identity;
-  Transport_ServiceAPI *transport;
+  GNUNET_Identity_ServiceAPI *identity;
+  GNUNET_Transport_ServiceAPI *transport;
   GNUNET_PeerIdentity pid;
   const GNUNET_RSA_PublicKey *pkey;
   GNUNET_RSA_Signature sig;
@@ -66,7 +66,7 @@
   GNUNET_cron_start (cron);
   /* give cron job chance to run */
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);
-  hello = transport->createhello (ANY_PROTOCOL_NUMBER);
+  hello = transport->createhello (GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY);
   if (NULL == hello)
     {
       printf ("Cannot run test, failed to create any hello.\n");
@@ -136,10 +136,10 @@
 {
   int err;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   cron = cron_create (NULL);
@@ -151,7 +151,7 @@
     err = 1;
   doneCore ();
   GNUNET_cron_destroy (cron);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return err;
 }
 

Modified: GNUnet/src/applications/kvstore_sqlite/kv_sqlite.c
===================================================================
--- GNUnet/src/applications/kvstore_sqlite/kv_sqlite.c  2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/kvstore_sqlite/kv_sqlite.c  2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -41,14 +41,14 @@
  * a failure of the command 'cmd' with the message given
  * by strerror(errno).
  */
-#define DIE_SQLITE(dbh, cmd) do { GE_LOG(ectx, GE_FATAL | GE_ADMIN | GE_BULK, 
_("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, 
sqlite3_errmsg(dbh)); abort(); } while(0);
+#define DIE_SQLITE(dbh, cmd) do { GNUNET_GE_LOG(ectx, GNUNET_GE_FATAL | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK, _("`%s' failed at %s:%d with error: %s\n"), 
cmd, __FILE__, __LINE__, sqlite3_errmsg(dbh)); abort(); } while(0);
 
 /**
  * Log an error message at log-level 'level' that indicates
  * a failure of the command 'cmd' on file 'filename'
  * with the message given by strerror(errno).
  */
-#define LOG_SQLITE(dbh, level, cmd) do { GE_LOG(ectx, GE_ERROR | GE_ADMIN | 
GE_BULK, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, 
sqlite3_errmsg(dbh)); } while(0);
+#define LOG_SQLITE(dbh, level, cmd) do { GNUNET_GE_LOG(ectx, GNUNET_GE_ERROR | 
GNUNET_GE_ADMIN | GNUNET_GE_BULK, _("`%s' failed at %s:%d with error: %s\n"), 
cmd, __FILE__, __LINE__, sqlite3_errmsg(dbh)); } while(0);
 
 /**
  * @brief Wrapper for SQLite
@@ -103,9 +103,9 @@
 
 } sqliteDatabase;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static unsigned int databases;
 
@@ -200,10 +200,10 @@
   char *fn;
   size_t mem;
 
-  GC_get_configuration_value_filename (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_filename (coreAPI->cfg,
                                        "KEYVALUE_DATABASE",
                                        "DIR",
-                                       VAR_DAEMON_DIRECTORY "/kvstore/",
+                                       GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY 
"/kvstore/",
                                        &dir);
   GNUNET_disk_directory_create (ectx, dir);
   mem = strlen (dir) + strlen (name) + 6;
@@ -263,7 +263,7 @@
   if (sqlite3_open (db->fn, &dbh->dbh) != SQLITE_OK)
     {
       printf ("FN: %s\n", db->fn);
-      LOG_SQLITE (dbh->dbh, GE_ERROR | GE_BULK | GE_USER, "sqlite3_open");
+      LOG_SQLITE (dbh->dbh, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER, 
"sqlite3_open");
       sqlite3_close (dbh->dbh);
       GNUNET_mutex_unlock (lock);
       GNUNET_thread_release_self (dbh->tid);
@@ -331,12 +331,12 @@
  * @param table the name of the Key/Value-Table
  * @return a handle
  */
-static KVHandle *
+static GNUNET_KeyValueRecord *
 getTable (const char *database, const char *table)
 {
   sqlite3_stmt *stmt;
   unsigned int len;
-  KVHandle *ret;
+  GNUNET_KeyValueRecord *ret;
   sqliteHandle *dbh;
   char *idx;
 
@@ -371,7 +371,7 @@
   sprintf (idx, "CREATE INDEX idx_key ON %s (gn_key)", table);
   sqlite3_exec (dbh->dbh, idx, NULL, NULL, NULL);
   GNUNET_free (idx);
-  ret = GNUNET_malloc (sizeof (KVHandle));
+  ret = GNUNET_malloc (sizeof (GNUNET_KeyValueRecord));
   ret->table = GNUNET_strdup (table);
   ret->db = GNUNET_strdup (database);
 
@@ -389,10 +389,10 @@
  * @param closure optional parameter for handler
  */
 static void *
-get (KVHandle * kv,
+get (GNUNET_KeyValueRecord * kv,
      void *key,
      int keylen,
-     unsigned int sort, unsigned int limit, KVCallback handler, void *closure)
+     unsigned int sort, unsigned int limit, GNUNET_KeyValueProcessor handler, 
void *closure)
 {
   unsigned int len, enclen, retlen;
   char *sel, *order, *where, limit_spec[30];
@@ -489,7 +489,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
 static int
-put (KVHandle * kv, void *key, int keylen, void *val, int vallen,
+put (GNUNET_KeyValueRecord * kv, void *key, int keylen, void *val, int vallen,
      unsigned long long age)
 {
   unsigned int len;
@@ -544,7 +544,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
 static int
-del (KVHandle * kv, void *key, int keylen, unsigned long long age)
+del (GNUNET_KeyValueRecord * kv, void *key, int keylen, unsigned long long age)
 {
   unsigned int len;
   char *del, *key_where, *age_where;
@@ -613,7 +613,7 @@
  * @param kv the handle to close
  */
 static void
-closeTable (KVHandle * kv)
+closeTable (GNUNET_KeyValueRecord * kv)
 {
   GNUNET_free (kv->table);
   GNUNET_free (kv->db);
@@ -625,7 +625,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
 static int
-dropTable (KVHandle * kv)
+dropTable (GNUNET_KeyValueRecord * kv)
 {
   sqlite3_stmt *stmt;
   sqliteHandle *dbh;
@@ -650,15 +650,15 @@
   return GNUNET_OK;
 }
 
-KVstore_ServiceAPI *
-provide_module_kvstore_sqlite (CoreAPIForApplication * capi)
+GNUNET_KVstore_ServiceAPI *
+provide_module_kvstore_sqlite (GNUNET_CoreAPIForPlugins * capi)
 {
-  static KVstore_ServiceAPI api;
+  static GNUNET_KVstore_ServiceAPI api;
 
   ectx = capi->ectx;
 #if DEBUG_SQLITE
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "KV-SQLite: initializing database\n");
 #endif
 
@@ -687,8 +687,8 @@
   GNUNET_array_grow (dbs, databases, 0);
 
 #if DEBUG_SQLITE
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "SQLite KVStore: database shutdown\n");
 #endif
 

Modified: GNUnet/src/applications/kvstore_sqlite/kv_sqlitetest.c
===================================================================
--- GNUnet/src/applications/kvstore_sqlite/kv_sqlitetest.c      2007-11-25 
03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/kvstore_sqlite/kv_sqlitetest.c      2007-11-25 
12:04:45 UTC (rev 5755)
@@ -38,9 +38,9 @@
  * Add testcode here!
  */
 static int
-test (KVstore_ServiceAPI * api)
+test (GNUNET_KVstore_ServiceAPI * api)
 {
-  KVHandle *kv;
+  GNUNET_KeyValueRecord *kv;
   GNUNET_HashCode k, v;
   GNUNET_HashCode *r;
 
@@ -78,15 +78,15 @@
 int
 main (int argc, char *argv[])
 {
-  KVstore_ServiceAPI *api;
+  GNUNET_KVstore_ServiceAPI *api;
   int ok;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_CronManager *cron;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   cron = cron_create (NULL);

Modified: GNUnet/src/applications/pingpong/pingpong.c
===================================================================
--- GNUnet/src/applications/pingpong/pingpong.c 2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/pingpong/pingpong.c 2007-11-25 12:04:45 UTC (rev 
5755)
@@ -88,15 +88,15 @@
 
 static struct GNUNET_Mutex *pingPongLock;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static Transport_ServiceAPI *transport;
+static GNUNET_Transport_ServiceAPI *transport;
 
-static Identity_ServiceAPI *identity;
+static GNUNET_Identity_ServiceAPI *identity;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static int stat_encryptedPongReceived;
 
@@ -128,8 +128,8 @@
 
   if (ntohs (msg->size) != sizeof (P2P_pingpong_MESSAGE))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER | GE_DEVELOPER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER | 
GNUNET_GE_DEVELOPER,
               _("Received malformed `%s' message. Dropping.\n"), "ping");
       return GNUNET_SYSERR;
     }
@@ -139,8 +139,8 @@
   if (0 != memcmp (coreAPI->myIdentity,
                    &pmsg->receiver, sizeof (GNUNET_PeerIdentity)))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_ADMIN,
               _("Received ping for another peer. Dropping.\n"));
       return GNUNET_SYSERR;     /* not for us */
     }
@@ -149,15 +149,15 @@
   GNUNET_EncName enc;
 
   GNUNET_hash_to_enc (&sender->hashPubKey, &enc);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received ping from peer %s.\n", &enc);
 #endif
   pong = *pmsg;
-  pong.header.type = htons (p2p_PROTO_PONG);
+  pong.header.type = htons (GNUNET_P2P_PROTO_PONG);
   if (stats != NULL)
     stats->change (stat_pingReceived, 1);
-  coreAPI->unicast (sender, &pong.header, EXTREME_PRIORITY, 0); /* send now! */
+  coreAPI->unicast (sender, &pong.header, GNUNET_EXTREME_PRIORITY, 0); /* send 
now! */
   if (stats != NULL)
     stats->change (stat_pongSent, 1);
   return GNUNET_OK;
@@ -167,7 +167,7 @@
 sendPlaintext (const GNUNET_PeerIdentity * peer,
                const P2P_pingpong_MESSAGE * msg)
 {
-  TSession *mytsession;
+  GNUNET_TSession *mytsession;
   int ret;
 
   mytsession = transport->connectFreely (peer, GNUNET_YES, __FILE__);
@@ -185,7 +185,7 @@
  */
 static int
 plaintextPingReceived (const GNUNET_PeerIdentity * sender,
-                       const GNUNET_MessageHeader * hmsg, TSession * tsession)
+                       const GNUNET_MessageHeader * hmsg, GNUNET_TSession * 
tsession)
 {
 #if DEBUG_PINGPONG
   GNUNET_EncName enc;
@@ -196,31 +196,31 @@
 
   if (ntohs (hmsg->size) != sizeof (P2P_pingpong_MESSAGE))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER | GE_DEVELOPER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER | 
GNUNET_GE_DEVELOPER,
               _("Received malformed `%s' message. Dropping.\n"), "ping");
-      GE_BREAK_OP (NULL, 0);
+      GNUNET_GE_BREAK_OP (NULL, 0);
       return GNUNET_SYSERR;
     }
   pmsg = (const P2P_pingpong_MESSAGE *) hmsg;
   if (0 != memcmp (coreAPI->myIdentity,
                    &pmsg->receiver, sizeof (GNUNET_PeerIdentity)))
     {
-      GE_LOG (ectx,
-              GE_INFO | GE_REQUEST | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_REQUEST | GNUNET_GE_ADMIN,
               _("Received PING not destined for us!\n"));
-      GE_BREAK_OP (NULL, 0);
+      GNUNET_GE_BREAK_OP (NULL, 0);
       return GNUNET_SYSERR;     /* not for us */
     }
 
 #if DEBUG_PINGPONG
   GNUNET_hash_to_enc (&sender->hashPubKey, &enc);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received plaintext ping from peer %s.\n", &enc);
 #endif
   pong = *pmsg;
-  pong.header.type = htons (p2p_PROTO_PONG);
+  pong.header.type = htons (GNUNET_P2P_PROTO_PONG);
   /* allow using a different transport for sending the reply, the
      transport may have been uni-directional! */
   ret = GNUNET_SYSERR;
@@ -262,15 +262,15 @@
   if ((ntohs (msg->size) != sizeof (P2P_pingpong_MESSAGE)) ||
       (0 != memcmp (sender, &pmsg->receiver, sizeof (GNUNET_PeerIdentity))))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER | GE_DEVELOPER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER | 
GNUNET_GE_DEVELOPER,
               _("Received malformed `%s' message. Dropping.\n"), "pong");
       return GNUNET_SYSERR;     /* bad pong */
     }
 #if DEBUG_PINGPONG
   GNUNET_hash_to_enc (&sender->hashPubKey, &enc);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received PONG from `%s'.\n", &enc);
 #endif
   matched = 0;
@@ -295,15 +295,15 @@
   GNUNET_mutex_unlock (pingPongLock);
 #if DEBUG_PINGPONG
   GNUNET_hash_to_enc (&sender->hashPubKey, &enc);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received PONG from `%s' matched %u peers.\n", &enc, matched);
 #endif
   if (matched == 0)
     {
 #if DEBUG_PINGPONG
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_ADMIN,
               _("Could not match PONG against any PING. "
                 "Try increasing MAX_PING_PONG constant.\n"));
 #endif
@@ -316,7 +316,7 @@
  */
 static int
 plaintextPongReceived (const GNUNET_PeerIdentity * sender,
-                       const GNUNET_MessageHeader * msg, TSession * session)
+                       const GNUNET_MessageHeader * msg, GNUNET_TSession * 
session)
 {
   int i;
   const P2P_pingpong_MESSAGE *pmsg;
@@ -330,8 +330,8 @@
   if ((ntohs (msg->size) != sizeof (P2P_pingpong_MESSAGE)) ||
       (0 != memcmp (sender, &pmsg->receiver, sizeof (GNUNET_PeerIdentity))))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_USER | GE_DEVELOPER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER | 
GNUNET_GE_DEVELOPER,
               _("Received malformed `%s' message. Dropping.\n"), "pong");
       return GNUNET_SYSERR;     /* bad pong */
     }
@@ -357,16 +357,16 @@
   GNUNET_mutex_unlock (pingPongLock);
 #if DEBUG_PINGPONG
   GNUNET_hash_to_enc (&sender->hashPubKey, &enc);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received plaintext PONG from `%s' matched %u peers.\n",
           &enc, matched);
 #endif
   if (matched == 0)
     {
 #if DEBUG_PINGPONG
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_ADMIN,
               _("Could not match PONG against any PING. "
                 "Try increasing MAX_PING_PONG constant.\n"));
 #endif
@@ -409,8 +409,8 @@
       }
   if (j == -1)
     {                           /* all send this second!? */
-      GE_LOG (ectx,
-              GE_WARNING | GE_BULK | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_ADMIN,
               _("Cannot create PING, table full. "
                 "Try increasing MAX_PING_PONG.\n"));
       GNUNET_mutex_unlock (pingPongLock);
@@ -425,7 +425,7 @@
   entry->receiverIdentity = *receiver;
   pmsg = GNUNET_malloc (sizeof (P2P_pingpong_MESSAGE));
   pmsg->header.size = htons (sizeof (P2P_pingpong_MESSAGE));
-  pmsg->header.type = htons (p2p_PROTO_PING);
+  pmsg->header.type = htons (GNUNET_P2P_PROTO_PING);
   pmsg->receiver = *receiver;
   entry->challenge = challenge;
   pmsg->challenge = htonl (challenge);
@@ -467,7 +467,7 @@
     }
   else
     {
-      coreAPI->unicast (receiver, pmsg, EXTREME_PRIORITY, 0);
+      coreAPI->unicast (receiver, pmsg, GNUNET_EXTREME_PRIORITY, 0);
       if (stats != NULL)
         stats->change (stat_ciphertextPingSent, 1);
     }
@@ -478,24 +478,24 @@
 /**
  * Initialize the pingpong module.
  */
-Pingpong_ServiceAPI *
-provide_module_pingpong (CoreAPIForApplication * capi)
+GNUNET_Pingpong_ServiceAPI *
+provide_module_pingpong (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Pingpong_ServiceAPI ret;
+  static GNUNET_Pingpong_ServiceAPI ret;
 
   ectx = capi->ectx;
-  GE_ASSERT (ectx, sizeof (P2P_pingpong_MESSAGE) == 72);
+  GNUNET_GE_ASSERT (ectx, sizeof (P2P_pingpong_MESSAGE) == 72);
   coreAPI = capi;
   identity = capi->requestService ("identity");
   if (identity == NULL)
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       return NULL;
     }
   transport = capi->requestService ("transport");
   if (transport == NULL)
     {
-      GE_BREAK (capi->ectx, 0);
+      GNUNET_GE_BREAK (capi->ectx, 0);
       capi->releaseService (identity);
       return NULL;
     }
@@ -528,14 +528,14 @@
   pingPongs =
     (PingPongEntry *) GNUNET_malloc (sizeof (PingPongEntry) * MAX_PING_PONG);
   memset (pingPongs, 0, sizeof (PingPongEntry) * MAX_PING_PONG);
-  GE_LOG (ectx,
-          GE_DEBUG | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           _("`%s' registering handlers %d %d (plaintext and ciphertext)\n"),
-          "pingpong", p2p_PROTO_PING, p2p_PROTO_PONG);
-  capi->registerHandler (p2p_PROTO_PING, &pingReceived);
-  capi->registerHandler (p2p_PROTO_PONG, &pongReceived);
-  capi->registerPlaintextHandler (p2p_PROTO_PING, &plaintextPingReceived);
-  capi->registerPlaintextHandler (p2p_PROTO_PONG, &plaintextPongReceived);
+          "pingpong", GNUNET_P2P_PROTO_PING, GNUNET_P2P_PROTO_PONG);
+  capi->registerHandler (GNUNET_P2P_PROTO_PING, &pingReceived);
+  capi->registerHandler (GNUNET_P2P_PROTO_PONG, &pongReceived);
+  capi->registerPlaintextHandler (GNUNET_P2P_PROTO_PING, 
&plaintextPingReceived);
+  capi->registerPlaintextHandler (GNUNET_P2P_PROTO_PONG, 
&plaintextPongReceived);
   ret.ping = &initiatePing;
   ret.pingUser = &createPing;
   ret.ping_size = sizeof (P2P_pingpong_MESSAGE);
@@ -559,11 +559,11 @@
   for (i = 0; i < MAX_PING_PONG; i++)
     GNUNET_free_non_null (pingPongs[i].data);
   GNUNET_free (pingPongs);
-  coreAPI->unregisterHandler (p2p_PROTO_PING, &pingReceived);
-  coreAPI->unregisterHandler (p2p_PROTO_PONG, &pongReceived);
-  coreAPI->unregisterPlaintextHandler (p2p_PROTO_PING,
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_PING, &pingReceived);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_PONG, &pongReceived);
+  coreAPI->unregisterPlaintextHandler (GNUNET_P2P_PROTO_PING,
                                        &plaintextPingReceived);
-  coreAPI->unregisterPlaintextHandler (p2p_PROTO_PONG,
+  coreAPI->unregisterPlaintextHandler (GNUNET_P2P_PROTO_PONG,
                                        &plaintextPongReceived);
   coreAPI = NULL;
   return GNUNET_OK;

Modified: GNUnet/src/applications/rpc/parameters.c
===================================================================
--- GNUnet/src/applications/rpc/parameters.c    2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/rpc/parameters.c    2007-11-25 12:04:45 UTC (rev 
5755)
@@ -27,12 +27,12 @@
 
 #include "gnunet_util.h"
 #include "gnunet_util_containers.h"
-#include "gnunet_rpc_service.h"
+#include "gnunet_rpc_lib.h"
 #include "platform.h"
 
 /**
  * A parameter to/from an RPC call. These (and nothing else) are stored in
- * the GNUNET_Vector of the RPC_Param structure.
+ * the GNUNET_Vector of the GNUNET_RPC_CallParameters structure.
  */
 typedef struct
 {
@@ -44,10 +44,10 @@
 /**
  * Allocate a new, empty RPC parameter structure.
  *
- * @return An empty RPC_Param structure
+ * @return An empty GNUNET_RPC_CallParameters structure
  */
-RPC_Param *
-RPC_paramNew ()
+GNUNET_RPC_CallParameters *
+GNUNET_RPC_parameters_create ()
 {
   return GNUNET_vector_create (4);
 }
@@ -60,7 +60,7 @@
  * @param param The RPC parameter structure to be freed
  */
 void
-RPC_paramFree (RPC_Param * param)
+GNUNET_RPC_parameters_destroy(GNUNET_RPC_CallParameters * param)
 {
   if (param == NULL)
     return;
@@ -76,10 +76,10 @@
 
 /**
  * Serialize the param array.  target must point to at least
- * RPC_paramSize(param) bytes of memory.
+ * GNUNET_RPC_parameters_get_serialized_size(param) bytes of memory.
  */
 void
-RPC_paramSerialize (RPC_Param * param, char *target)
+GNUNET_RPC_parameters_serialize (GNUNET_RPC_CallParameters * param, char 
*target)
 {
   int i;
   const char *paramName;
@@ -93,11 +93,11 @@
     return;
   pos = 0;
   dataLength = 0;
-  for (i = 0; i < RPC_paramCount (param); i++)
+  for (i = 0; i < GNUNET_RPC_parameters_count (param); i++)
     {
-      paramName = RPC_paramName (param, i);
+      paramName = GNUNET_RPC_parameters_get_name (param, i);
       paramValue = NULL;
-      RPC_paramValueByPosition (param, i, &dataLength, &paramValue);
+      GNUNET_RPC_parameters_get_value_by_index (param, i, &dataLength, 
&paramValue);
       memcpy (&target[pos], paramName, strlen (paramName) + 1);
       pos += strlen (paramName) + 1;
       *(unsigned int *) &target[pos] = htonl (dataLength);
@@ -110,17 +110,17 @@
 /**
  * Deserialize parameters from buffer.
  */
-RPC_Param *
-RPC_paramDeserialize (char *buffer, size_t size)
+GNUNET_RPC_CallParameters *
+GNUNET_RPC_parameters_deserialize (char *buffer, size_t size)
 {
-  RPC_Param *ret;
+  GNUNET_RPC_CallParameters *ret;
   size_t pos;
   size_t xpos;
   unsigned int dataLength;
 
   if (buffer == NULL)
     return NULL;
-  ret = RPC_paramNew ();
+  ret = GNUNET_RPC_parameters_create ();
   pos = 0;
   while (pos < size)
     {
@@ -130,18 +130,18 @@
       pos++;
       if (pos + sizeof (unsigned int) > size)
         {
-          RPC_paramFree (ret);
+          GNUNET_RPC_parameters_destroy (ret);
           return NULL;
         }
       dataLength = ntohl (*(unsigned int *) &buffer[pos]);
       pos += sizeof (unsigned int);
       if ((pos + dataLength < pos) || (pos + dataLength > size))
         {
-          RPC_paramFree (ret);
+          GNUNET_RPC_parameters_destroy (ret);
           return NULL;
         }
 
-      RPC_paramAdd (ret, &buffer[xpos], dataLength, &buffer[pos]);
+      GNUNET_RPC_parameters_add (ret, &buffer[xpos], dataLength, &buffer[pos]);
       pos += dataLength;
     }
   return ret;
@@ -151,7 +151,7 @@
  * How many bytes are required to serialize the param array?
  */
 size_t
-RPC_paramSize (RPC_Param * param)
+GNUNET_RPC_parameters_get_serialized_size (GNUNET_RPC_CallParameters * param)
 {
   int i;
   const char *paramName;
@@ -163,11 +163,11 @@
     return 0;
   pos = 0;
   dataLength = 0;
-  for (i = 0; i < RPC_paramCount (param); i++)
+  for (i = 0; i < GNUNET_RPC_parameters_count (param); i++)
     {
-      paramName = RPC_paramName (param, i);
+      paramName = GNUNET_RPC_parameters_get_name (param, i);
       paramValue = NULL;
-      RPC_paramValueByPosition (param, i, &dataLength, &paramValue);
+      GNUNET_RPC_parameters_get_value_by_index (param, i, &dataLength, 
&paramValue);
       if (pos + strlen (paramName) + 1 + sizeof (unsigned int) < pos)
         return 0;
       pos += strlen (paramName) + 1;
@@ -187,7 +187,7 @@
  * @return The number of parameters
  */
 unsigned int
-RPC_paramCount (RPC_Param * param)
+GNUNET_RPC_paramters_count (GNUNET_RPC_CallParameters * param)
 {
   if (param == NULL)
     return 0;
@@ -208,7 +208,7 @@
  */
 
 void
-RPC_paramAdd (RPC_Param * param,
+GNUNET_RPC_parameters_add (GNUNET_RPC_CallParameters * param,
               const char *name, unsigned int dataLength, const void *data)
 {
   Parameter *new;
@@ -243,8 +243,8 @@
  * @param data Value of the parameter
  */
 void
-RPC_paramAddDataContainer (RPC_Param * param,
-                           const char *name, const DataContainer * data)
+GNUNET_RPC_parameters_add_data_container (GNUNET_RPC_CallParameters * param,
+                           const char *name, const GNUNET_DataContainer * data)
 {
   Parameter *new;
 
@@ -252,7 +252,7 @@
     return;
   new = GNUNET_malloc (sizeof (Parameter));
   new->name = GNUNET_strdup (name);
-  new->dataLength = ntohl (data->size) - sizeof (DataContainer);
+  new->dataLength = ntohl (data->size) - sizeof (GNUNET_DataContainer);
   if (new->dataLength == 0)
     {
       new->data = NULL;
@@ -273,7 +273,7 @@
  * @return Name of the parameter
  */
 const char *
-RPC_paramName (RPC_Param * param, unsigned int i)
+GNUNET_RPC_parameters_get_name (GNUNET_RPC_CallParameters * param, unsigned 
int i)
 {
   Parameter *p;
 
@@ -295,7 +295,7 @@
  * @return GNUNET_SYSERR on error
  */
 int
-RPC_paramValueByName (RPC_Param * param,
+GNUNET_RPC_parameters_get_value_by_name (GNUNET_RPC_CallParameters * param,
                       const char *name,
                       unsigned int *dataLength, void **value)
 {
@@ -325,11 +325,11 @@
  * @param value set to the value of the named parameter
  * @return GNUNET_SYSERR on error
  */
-DataContainer *
-RPC_paramDataContainerByName (RPC_Param * param, const char *name)
+GNUNET_DataContainer *
+GNUNET_RPC_parameters_get_data_container_by_name (GNUNET_RPC_CallParameters * 
param, const char *name)
 {
   Parameter *p;
-  DataContainer *ret;
+  GNUNET_DataContainer *ret;
 
   if (param == NULL)
     return NULL;
@@ -338,8 +338,8 @@
     {
       if (!strcmp (p->name, name))
         {
-          ret = GNUNET_malloc (sizeof (DataContainer) + p->dataLength);
-          ret->size = htonl (sizeof (DataContainer) + p->dataLength);
+          ret = GNUNET_malloc (sizeof (GNUNET_DataContainer) + p->dataLength);
+          ret->size = htonl (sizeof (GNUNET_DataContainer) + p->dataLength);
           memcpy (&ret[1], p->data, p->dataLength);
           return ret;
         }
@@ -356,7 +356,7 @@
  * @param value set to the value of the parameter
  */
 int
-RPC_paramValueByPosition (RPC_Param * param,
+GNUNET_RPC_parameters_get_value_by_index (GNUNET_RPC_CallParameters * param,
                           unsigned int i,
                           unsigned int *dataLength, void **value)
 {
@@ -380,19 +380,19 @@
  * @param param Target RPC parameter structure
  * @param value set to the value of the parameter
  */
-DataContainer *
-RPC_paramDataContainerByPosition (RPC_Param * param, unsigned int i)
+GNUNET_DataContainer *
+GNUNET_RPC_parameters_get_data_container_by_index (GNUNET_RPC_CallParameters * 
param, unsigned int i)
 {
   Parameter *p;
-  DataContainer *ret;
+  GNUNET_DataContainer *ret;
 
   if (param == NULL)
     return NULL;
   p = GNUNET_vector_get (param, i);
   if (p != NULL)
     {
-      ret = GNUNET_malloc (sizeof (DataContainer) + p->dataLength);
-      ret->size = htonl (sizeof (DataContainer) + p->dataLength);
+      ret = GNUNET_malloc (sizeof (GNUNET_DataContainer) + p->dataLength);
+      ret->size = htonl (sizeof (GNUNET_DataContainer) + p->dataLength);
       memcpy (&ret[1], p->data, p->dataLength);
       return ret;
     }

Modified: GNUnet/src/applications/rpc/parameterstest.c
===================================================================
--- GNUnet/src/applications/rpc/parameterstest.c        2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/rpc/parameterstest.c        2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -29,58 +29,58 @@
 int
 main (int argc, char *argv[])
 {
-  RPC_Param *p;
+  GNUNET_RPC_CallParameters *p;
   void *buf;
   size_t size;
   unsigned int len;
 
-  p = RPC_paramNew ();
+  p = GNUNET_RPC_parameters_create ();
 
-  if (GNUNET_SYSERR != RPC_paramValueByPosition (p, 0, &len, &buf))
+  if (GNUNET_SYSERR != GNUNET_RPC_parameters_get_value_by_index (p, 0, &len, 
&buf))
     return 1;
 
-  if (GNUNET_SYSERR != RPC_paramValueByName (p, "not there", &len, &buf))
+  if (GNUNET_SYSERR != GNUNET_RPC_parameters_get_value_by_name (p, "not 
there", &len, &buf))
     return 1;
 
-  if (RPC_paramCount (p) != 0)
+  if (GNUNET_RPC_parameters_count (p) != 0)
     return 1;
-  RPC_paramAdd (p, "foo", 4, "bar");
-  RPC_paramAdd (p, "bar", 4, "foo");
-  if (RPC_paramCount (p) != 2)
+  GNUNET_RPC_parameters_add (p, "foo", 4, "bar");
+  GNUNET_RPC_parameters_add (p, "bar", 4, "foo");
+  if (GNUNET_RPC_parameters_count (p) != 2)
     return 1;
-  if (0 != strcmp (RPC_paramName (p, 0), "foo"))
+  if (0 != strcmp (GNUNET_RPC_parameters_get_name (p, 0), "foo"))
     return 1;
-  if (0 != strcmp (RPC_paramName (p, 1), "bar"))
+  if (0 != strcmp (GNUNET_RPC_parameters_get_name (p, 1), "bar"))
     return 1;
 
-  size = RPC_paramSize (p);
+  size = GNUNET_RPC_parameters_get_serialized_size (p);
   buf = GNUNET_malloc (size);
-  RPC_paramSerialize (p, buf);
-  RPC_paramFree (p);
-  p = RPC_paramDeserialize (buf, size);
+  GNUNET_RPC_parameters_serialize (p, buf);
+  GNUNET_RPC_parameters_destroy (p);
+  p = GNUNET_RPC_parameters_deserialize (buf, size);
   GNUNET_free (buf);
   if (p == NULL)
     return 1;
   buf = NULL;
-  if (GNUNET_OK != RPC_paramValueByName (p, "foo", &len, &buf))
+  if (GNUNET_OK != GNUNET_RPC_parameters_get_value_by_name (p, "foo", &len, 
&buf))
     return 1;
   if (strcmp ("bar", buf) != 0)
     return 1;
   buf = NULL;
   if (4 != len)
     return 1;
-  if (GNUNET_OK != RPC_paramValueByPosition (p, 1, &len, &buf))
+  if (GNUNET_OK != GNUNET_RPC_parameters_get_value_by_index (p, 1, &len, &buf))
     return 1;
   if (strcmp ("foo", buf) != 0)
     return 1;
   if (4 != len)
     return 1;
-  if (GNUNET_SYSERR != RPC_paramValueByPosition (p, 2, &len, &buf))
+  if (GNUNET_SYSERR != GNUNET_RPC_parameters_get_value_by_index (p, 2, &len, 
&buf))
     return 1;
 
-  if (GNUNET_SYSERR != RPC_paramValueByName (p, "not there", &len, &buf))
+  if (GNUNET_SYSERR != GNUNET_RPC_parameters_get_value_by_name (p, "not 
there", &len, &buf))
     return 1;
-  RPC_paramFree (p);
+  GNUNET_RPC_parameters_destroy (p);
 
   return 0;
 }

Modified: GNUnet/src/applications/rpc/rpc.c
===================================================================
--- GNUnet/src/applications/rpc/rpc.c   2007-11-25 03:50:33 UTC (rev 5754)
+++ GNUnet/src/applications/rpc/rpc.c   2007-11-25 12:04:45 UTC (rev 5755)
@@ -27,6 +27,7 @@
 #include "gnunet_util.h"
 #include "gnunet_protocols.h"
 #include "gnunet_rpc_service.h"
+#include "gnunet_rpc_lib.h"
 
 /**
  * Flag that determines if the RPC test will be build as
@@ -63,7 +64,7 @@
 
 
 #if DEBUG_RPC_CLIENT
-#define RPC_STATUS(a,b,c) GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER, "RPC: 
`%s' (%p) %s at %s\n", a, c, b, __FUNCTION__);
+#define RPC_STATUS(a,b,c) GNUNET_GE_LOG(ectx, GNUNET_GE_DEBUG | 
GNUNET_GE_REQUEST | GNUNET_GE_USER, "RPC: `%s' (%p) %s at %s\n", a, c, b, 
__FUNCTION__);
 #else
 #define RPC_STATUS(a,b,c)
 #endif
@@ -72,7 +73,7 @@
 /**
  * Access to GNUnet core API.
  */
-static CoreAPIForApplication *coreAPI = NULL;
+static GNUNET_CoreAPIForPlugins *coreAPI = NULL;
 
 /**
  * A mutex for synchronous access to all module-wide data structures. This
@@ -81,7 +82,7 @@
  */
 static struct GNUNET_Mutex *rpcLock;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 /* *************** RPC registration ****************** */
 
@@ -94,12 +95,12 @@
   /**
    * Callback for a synchronous RPC.  NULL for async RPCs.
    */
-  RPC_Function callback;
+  GNUNET_RPC_SynchronousFunction callback;
 
   /**
    * Callback for an asynchronous RPC.  NULL for sync RPCs.
    */
-  ASYNC_RPC_Function async_callback;
+  GNUNET_RPC_AsynchronousFunction async_callback;
 } RegisteredRPC;
 
 /**
@@ -117,12 +118,12 @@
  *   (typically if a callback of that name is already in use).
  */
 static int
-RPC_register (const char *name, RPC_Function callback)
+RPC_register (const char *name, GNUNET_RPC_SynchronousFunction callback)
 {
   RegisteredRPC *rrpc;
 
-  GE_ASSERT (ectx, name != NULL);
-  GE_ASSERT (ectx, callback != NULL);
+  GNUNET_GE_ASSERT (ectx, name != NULL);
+  GNUNET_GE_ASSERT (ectx, callback != NULL);
   GNUNET_mutex_lock (rpcLock);
   rrpc = GNUNET_vector_get_first (list_of_callbacks);
   while (rrpc != NULL)
@@ -130,7 +131,7 @@
       if (0 == strcmp (rrpc->name, name))
         {
           GNUNET_mutex_unlock (rpcLock);
-          GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                   _("%s::%s - RPC %s:%p could not be registered:"
                     " another callback is already using this name (%p)\n"),
                   __FILE__, __FUNCTION__, name, callback, rrpc->callback);
@@ -143,7 +144,7 @@
   rrpc->callback = callback;
   rrpc->async_callback = NULL;
   GNUNET_vector_insert_last (list_of_callbacks, rrpc);
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "%s::%s - Registered RPC %d: %s\n",
           __FILE__, __FUNCTION__, GNUNET_vector_get_size (list_of_callbacks),
           name);
@@ -159,12 +160,12 @@
  *   (typically if a callback of that name is already in use).
  */
 static int
-RPC_register_async (const char *name, ASYNC_RPC_Function callback)
+RPC_register_async (const char *name, GNUNET_RPC_AsynchronousFunction callback)
 {
   RegisteredRPC *rrpc;
 
-  GE_ASSERT (ectx, name != NULL);
-  GE_ASSERT (ectx, callback != NULL);
+  GNUNET_GE_ASSERT (ectx, name != NULL);
+  GNUNET_GE_ASSERT (ectx, callback != NULL);
   GNUNET_mutex_lock (rpcLock);
   rrpc = GNUNET_vector_get_first (list_of_callbacks);
   while (rrpc != NULL)
@@ -172,7 +173,7 @@
       if (0 == strcmp (rrpc->name, name))
         {
           GNUNET_mutex_unlock (rpcLock);
-          GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                   _("%s::%s - RPC %s:%p could not be registered:"
                     " another callback is already using this name (%p)\n"),
                   __FILE__, __FUNCTION__, name, callback, rrpc->callback);
@@ -185,7 +186,7 @@
   rrpc->callback = NULL;
   rrpc->async_callback = callback;
   GNUNET_vector_insert_last (list_of_callbacks, rrpc);
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "%s::%s - Registered asynchronous RPC %d: %s\n",
           __FILE__, __FUNCTION__, GNUNET_vector_get_size (list_of_callbacks),
           name);
@@ -203,11 +204,11 @@
  *    bound to a different function).
  */
 static int
-RPC_unregister (const char *name, RPC_Function callback)
+RPC_unregister (const char *name, GNUNET_RPC_SynchronousFunction callback)
 {
   RegisteredRPC *rrpc;
 
-  GE_ASSERT (ectx, name != NULL);
+  GNUNET_GE_ASSERT (ectx, name != NULL);
   GNUNET_mutex_lock (rpcLock);
   rrpc = GNUNET_vector_get_first (list_of_callbacks);
   while (rrpc != NULL)
@@ -216,7 +217,7 @@
         {
           if ((rrpc->callback != callback) && (callback != NULL))
             {
-              GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                       _("%s::%s - RPC %s:%p could not be unregistered:"
                         " another callback registered under that name: %p\n"),
                       __FILE__, __FUNCTION__, name, callback, rrpc->callback);
@@ -227,7 +228,7 @@
           GNUNET_free (rrpc->name);
           GNUNET_free (rrpc);
           GNUNET_mutex_unlock (rpcLock);
-          GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                   "%s::%s - Unregistered RPC %s\n",
                   __FILE__, __FUNCTION__, name);
           return GNUNET_OK;
@@ -235,7 +236,7 @@
       rrpc = GNUNET_vector_get_next (list_of_callbacks);
     }
   GNUNET_mutex_unlock (rpcLock);
-  GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
           _("%s::%s - RPC %s:%p could not be unregistered: not found\n"),
           __FILE__, __FUNCTION__, name, callback);
   return GNUNET_SYSERR;
@@ -250,11 +251,11 @@
  *    bound to a different function).
  */
 static int
-RPC_unregister_async (const char *name, ASYNC_RPC_Function callback)
+RPC_unregister_async (const char *name, GNUNET_RPC_AsynchronousFunction 
callback)
 {
   RegisteredRPC *rrpc;
 
-  GE_ASSERT (ectx, name != NULL);
+  GNUNET_GE_ASSERT (ectx, name != NULL);
   GNUNET_mutex_lock (rpcLock);
   rrpc = GNUNET_vector_get_first (list_of_callbacks);
   while (rrpc != NULL)
@@ -263,7 +264,7 @@
         {
           if ((rrpc->async_callback != callback) && (callback != NULL))
             {
-              GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+              GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                       _("%s::%s - RPC %s:%p could not be unregistered:"
                         " another callback registered under that name: %p\n"),
                       __FILE__, __FUNCTION__, name, callback, rrpc->callback);
@@ -274,7 +275,7 @@
           GNUNET_free (rrpc->name);
           GNUNET_free (rrpc);
           GNUNET_mutex_unlock (rpcLock);
-          GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                   "%s::%s - Unregistered asynchronous RPC %s\n",
                   __FILE__, __FUNCTION__, name);
           return GNUNET_OK;
@@ -282,7 +283,7 @@
       rrpc = GNUNET_vector_get_next (list_of_callbacks);
     }
   GNUNET_mutex_unlock (rpcLock);
-  GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
           _
           ("%s::%s - async RPC %s:%p could not be unregistered: not found\n"),
           __FILE__, __FUNCTION__, name, callback);
@@ -417,7 +418,7 @@
  * Ensure replies and requests have different IDs when dealing
  * with the same peer.
  */
-#define MINGLE(a,b) (((b) == P2P_PROTO_rpc_RES) ? (a) : (a) ^ 0x12345678)
+#define MINGLE(a,b) (((b) == GNUNET_P2P_PROTO_RPC_RES) ? (a) : (a) ^ 
0x12345678)
 
 /**
  * Notification: we sent a message to the peer.
@@ -532,7 +533,7 @@
    * followed by a serialization of argumentCount arguments.
    */
   char data[1];
-} P2P_rpc_MESSAGE_GENERIC;
+} P2P_rpc_MESSAGNUNET_GE_GENERIC;
 
 
 /**
@@ -562,12 +563,12 @@
 typedef void (*RPCFinishedCallback) (void *context,
                                      unsigned int sequenceNumber,
                                      unsigned short errorCode,
-                                     RPC_Param * result);
+                                     GNUNET_RPC_CallParameters * result);
 
 /**
  * A per-RPC structure.
  */
-typedef struct CallInstance
+typedef struct GNUNET_RPC_CallHandle
 {
   /**
    * The sequence number of this RPC.
@@ -629,13 +630,13 @@
 } CallInstance;
 
 /**
- * A set of CallInstance structures for active incoming rpc calls.
+ * A set of GNUNET_RPC_CallHandle structures for active incoming rpc calls.
  * (requests without a reply).
  */
 static struct GNUNET_Vector *incomingCalls;
 
 /**
- * A set of CallInstance structures for active outgoing rpc calls.
+ * A set of GNUNET_RPC_CallHandle structures for active outgoing rpc calls.
  * (reply messages without an ACK).
  */
 static struct GNUNET_Vector *outgoingCalls;
@@ -650,7 +651,7 @@
 
 /**
  * Cron-job that processes the RPC queues.  Created for
- * each CallInstance.  Not renewed if the call times out,
+ * each GNUNET_RPC_CallHandle.  Not renewed if the call times out,
  * deleted if the appropriate response is received.
  */
 static void
@@ -660,7 +661,7 @@
   GNUNET_CronTime now;
 
   now = GNUNET_get_time ();
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              (GNUNET_get_time () + 1 * GNUNET_CRON_MINUTES >
               call->expirationTime)
              || (call->expirationTime - GNUNET_get_time () <
@@ -669,14 +670,14 @@
   if (now > call->expirationTime)
     {
 #if DEBUG_RPC
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Completed RPC %p (timeout).\n", call);
 #endif
       if (call->finishedCallback != NULL)
         {
           call->finishedCallback (call->rpcCallbackArgs,
                                   call->sequenceNumber,
-                                  RPC_ERROR_TIMEOUT, NULL);
+                                  GNUNET_RPC_ERROR_TIMEOUT, NULL);
           GNUNET_vector_delete (outgoingCalls, call);
         }
       else
@@ -711,19 +712,19 @@
                              MINGLE (call->sequenceNumber,
                                      ntohs (call->msg->header.type)));
 #if DEBUG_RPC
-          if (ntohs (call->msg->header.type) == P2P_PROTO_rpc_REQ)
+          if (ntohs (call->msg->header.type) == GNUNET_P2P_PROTO_RPC_REQ)
             {
-              GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+              GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                       "Sending RPC request %p: '%.*s' (expires in %llums, last 
attempt %llums ago; attempt %u).\n",
                       call,
                       ntohs (call->msg->functionNameLength),
-                      &((P2P_rpc_MESSAGE_GENERIC *) call->msg)->data[0],
+                      &((P2P_rpc_MESSAGNUNET_GE_GENERIC *) call->msg)->data[0],
                       call->expirationTime - now,
                       now - call->lastAttempt, call->attempts);
             }
           else
             {
-              GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+              GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
                       "Sending RPC reply %p (expires in %llums, last attempt 
%llums ago, attempt %u).\n",
                       call,
                       call->expirationTime - now,
@@ -736,7 +737,7 @@
                             &call->msg->header,
                             ntohl (call->msg->importance), maxdelay);
         }
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  (GNUNET_get_time () + 1 * GNUNET_CRON_MINUTES >
                   call->expirationTime)
                  || (call->expirationTime - GNUNET_get_time () <
@@ -758,7 +759,7 @@
   RPC_ACK_Message msg;
 
   msg.header.size = htons (sizeof (RPC_ACK_Message));
-  msg.header.type = htons (P2P_PROTO_rpc_ACK);
+  msg.header.type = htons (GNUNET_P2P_PROTO_RPC_ACK);
   msg.sequenceNumber = htonl (sequenceNumber);
   coreAPI->unicast (receiver, &msg.header, importance, maxDelay);
 }
@@ -773,29 +774,29 @@
   if (ntohs (req->header.size) < sizeof (P2P_rpc_MESSAGE) + slen)
     return NULL;                /* invalid! */
   ret = GNUNET_malloc (slen + 1);
-  memcpy (ret, &((P2P_rpc_MESSAGE_GENERIC *) req)->data[0], slen);
+  memcpy (ret, &((P2P_rpc_MESSAGNUNET_GE_GENERIC *) req)->data[0], slen);
   ret[slen] = '\0';
   return ret;
 }
 
-static RPC_Param *
+static GNUNET_RPC_CallParameters *
 deserializeArguments (P2P_rpc_MESSAGE * req)
 {
   unsigned short slen;
-  RPC_Param *ret;
+  GNUNET_RPC_CallParameters *ret;
 
-  if (ntohs (req->header.type) == P2P_PROTO_rpc_REQ)
+  if (ntohs (req->header.type) == GNUNET_P2P_PROTO_RPC_REQ)
     slen = ntohs (req->functionNameLength);
   else
     slen = 0;
   if (ntohs (req->header.size) < sizeof (P2P_rpc_MESSAGE) + slen)
     return NULL;                /* invalid! */
-  ret = RPC_paramDeserialize (&((P2P_rpc_MESSAGE_GENERIC *) req)->data[slen],
+  ret = GNUNET_RPC_parameters_deserialize (&((P2P_rpc_MESSAGNUNET_GE_GENERIC 
*) req)->data[slen],
                               ntohs (req->header.size) -
                               sizeof (P2P_rpc_MESSAGE) - slen);
-  if (RPC_paramCount (ret) != ntohs (req->argumentCount))
+  if (GNUNET_RPC_parameters_count (ret) != ntohs (req->argumentCount))
     {
-      RPC_paramFree (ret);
+      GNUNET_RPC_parameters_destroy (ret);
       return NULL;              /* invalid! */
     }
   return ret;
@@ -815,7 +816,7 @@
 buildMessage (unsigned short errorCode,
               const char *name,
               unsigned int sequenceNumber,
-              unsigned int importance, RPC_Param * values)
+              unsigned int importance, GNUNET_RPC_CallParameters * values)
 {
   P2P_rpc_MESSAGE *ret;
   size_t size = sizeof (P2P_rpc_MESSAGE);
@@ -829,7 +830,7 @@
   else
     slen = 0;
   if (values != NULL)
-    size += RPC_paramSize (values);
+    size += GNUNET_RPC_parameters_get_serialized_size (values);
   if (size >= GNUNET_MAX_BUFFER_SIZE)
     return NULL;                /* message to big! */
   ret = GNUNET_malloc (size);
@@ -841,17 +842,17 @@
     ret->functionNameLength = htons (errorCode);
   else
     ret->functionNameLength = htons (slen);
-  ret->argumentCount = htons (RPC_paramCount (values));
+  ret->argumentCount = htons (GNUNET_RPC_parameters_count (values));
   if (name != NULL)
     {
-      memcpy (&((P2P_rpc_MESSAGE_GENERIC *) ret)->data[0], name, slen);
+      memcpy (&((P2P_rpc_MESSAGNUNET_GE_GENERIC *) ret)->data[0], name, slen);
     }
-  RPC_paramSerialize (values, &((P2P_rpc_MESSAGE_GENERIC *) ret)->data[slen]);
+  GNUNET_RPC_parameters_serialize (values, &((P2P_rpc_MESSAGNUNET_GE_GENERIC 
*) ret)->data[slen]);
 
   if (name == NULL)
-    ret->header.type = htons (P2P_PROTO_rpc_RES);
+    ret->header.type = htons (GNUNET_P2P_PROTO_RPC_RES);
   else
-    ret->header.type = htons (P2P_PROTO_rpc_REQ);
+    ret->header.type = htons (GNUNET_P2P_PROTO_RPC_REQ);
 
   return ret;
 }
@@ -867,7 +868,7 @@
  * case o complete the reply (since it's the same code).
  */
 static void
-async_rpc_complete_callback (RPC_Param * results,
+async_rpc_complete_callback (GNUNET_RPC_CallParameters * results,
                              int errorCode, CallInstance * calls)
 {
   GNUNET_mutex_lock (rpcLock);
@@ -877,13 +878,13 @@
                              calls->sequenceNumber,
                              calls->importance, results);
   if (calls->msg == NULL)
-    calls->msg = buildMessage (RPC_ERROR_RETURN_VALUE_TOO_LARGE,
+    calls->msg = buildMessage (GNUNET_RPC_ERROR_RETURN_VALUE_TOO_LARGE,
                                NULL,
                                calls->sequenceNumber,
                                calls->importance, results);
   GNUNET_vector_insert_last (incomingCalls, calls);
 
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              (GNUNET_get_time () + 1 * GNUNET_CRON_MINUTES >
               calls->expirationTime)
              || (calls->expirationTime - GNUNET_get_time () <
@@ -908,16 +909,16 @@
   unsigned int sq;
   unsigned short errorCode;
   char *functionName;
-  RPC_Param *argumentValues;
-  RPC_Param *returnValues;
+  GNUNET_RPC_CallParameters *argumentValues;
+  GNUNET_RPC_CallParameters *returnValues;
   RegisteredRPC *rpc;
   unsigned int minSQ;
 
-  if ((ntohs (message->type) != P2P_PROTO_rpc_REQ) ||
+  if ((ntohs (message->type) != GNUNET_P2P_PROTO_RPC_REQ) ||
       (ntohs (message->size) < sizeof (P2P_rpc_MESSAGE)))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_REQUEST | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_REQUEST | GNUNET_GE_ADMIN,
               _("Invalid message of type %u received.  Dropping.\n"),
               ntohs (message->type));
       return GNUNET_SYSERR;
@@ -925,8 +926,8 @@
   req = (P2P_rpc_MESSAGE *) message;
   sq = ntohl (req->sequenceNumber);
 #if DEBUG_RPC
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received RPC request with id %u.\n", sq);
 #endif
   GNUNET_mutex_lock (rpcLock);
@@ -961,14 +962,14 @@
         }
       RPC_STATUS ("", "received duplicate request", calls);
       calls->expirationTime = GNUNET_get_time () + MAX_RPC_TIMEOUT;
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Dropping RPC request %u, duplicate.\n", sq);
       GNUNET_mutex_unlock (rpcLock);
       return GNUNET_OK;         /* seen before */
     }
   if (minSQ > sq)
     {
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "Dropping RPC request %u, sequence number too old (current 
minimum is %u).\n",
               sq, minSQ);
       GNUNET_mutex_unlock (rpcLock);
@@ -982,9 +983,9 @@
     {
       GNUNET_free_non_null (functionName);
       if (argumentValues != NULL)
-        RPC_paramFree (argumentValues);
+        GNUNET_RPC_parameters_destroy (argumentValues);
       GNUNET_mutex_unlock (rpcLock);
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Dropping RPC request %u: message malformed.\n"));
       return GNUNET_SYSERR;     /* message malformed */
     }
@@ -1012,9 +1013,9 @@
   /* if possible, perform RPC call */
   if (rpc == NULL)
     {
-      RPC_paramFree (argumentValues);
+      GNUNET_RPC_parameters_destroy (argumentValues);
       returnValues = NULL;
-      errorCode = RPC_ERROR_UNKNOWN_FUNCTION;
+      errorCode = GNUNET_RPC_ERROR_UNKNOWN_FUNCTION;
     }
   else
     {
@@ -1027,10 +1028,10 @@
           GNUNET_mutex_unlock (rpcLock);
           return GNUNET_OK;
         }
-      returnValues = RPC_paramNew ();
+      returnValues = GNUNET_RPC_parameters_create ();
       rpc->callback (sender, argumentValues, returnValues);
-      RPC_paramFree (argumentValues);
-      errorCode = RPC_ERROR_OK;
+      GNUNET_RPC_parameters_destroy(argumentValues);
+      errorCode = GNUNET_RPC_ERROR_OK;
     }
   GNUNET_mutex_unlock (rpcLock);
   async_rpc_complete_callback (returnValues, errorCode, calls);
@@ -1049,25 +1050,25 @@
   P2P_rpc_MESSAGE *res;
   CallInstance *call;
 
-  if ((ntohs (message->type) != P2P_PROTO_rpc_RES) ||
+  if ((ntohs (message->type) != GNUNET_P2P_PROTO_RPC_RES) ||
       (ntohs (message->size) < sizeof (P2P_rpc_MESSAGE)))
     {
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Invalid message of type %u received.  Dropping.\n"),
               ntohs (message->type));
       return GNUNET_SYSERR;
     }
   res = (P2P_rpc_MESSAGE *) message;
 #if DEBUG_RPC
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received RPC reply with id %u.\n", ntohl (res->sequenceNumber));
 #endif
 
   GNUNET_cron_suspend_jobs (coreAPI->cron, GNUNET_NO);
   GNUNET_mutex_lock (rpcLock);
 
-  /* Locate the CallInstance structure. */
+  /* Locate the GNUNET_RPC_CallHandle structure. */
   call = GNUNET_vector_get_first (outgoingCalls);
   while (call != NULL)
     {
@@ -1080,25 +1081,25 @@
     }
   if (NULL != call)
     {
-      RPC_Param *reply;
-      P2P_rpc_MESSAGE_GENERIC *gen;
+      GNUNET_RPC_CallParameters *reply;
+      P2P_rpc_MESSAGNUNET_GE_GENERIC *gen;
       unsigned short error;
 
       RPC_STATUS ("", "received reply", call);
-      gen = (P2P_rpc_MESSAGE_GENERIC *) res;
+      gen = (P2P_rpc_MESSAGNUNET_GE_GENERIC *) res;
       reply = NULL;
       error = ntohs (res->functionNameLength);
 
-      if (error == RPC_ERROR_OK)
+      if (error == GNUNET_RPC_ERROR_OK)
         {
-          reply = RPC_paramDeserialize (&gen->data[0],
+          reply = GNUNET_RPC_parameters_deserialize (&gen->data[0],
                                         ntohs (message->size) -
                                         sizeof (P2P_rpc_MESSAGE));
-          if (ntohs (res->argumentCount) != RPC_paramCount (reply))
+          if (ntohs (res->argumentCount) != GNUNET_RPC_parameters_count 
(reply))
             {
-              RPC_paramFree (reply);
+              GNUNET_RPC_parameters_destroy(reply);
               reply = NULL;
-              error = RPC_ERROR_REPLY_MALFORMED;
+              error = GNUNET_RPC_ERROR_REPLY_MALFORMED;
             }
         }
       if (call->finishedCallback != NULL)
@@ -1109,12 +1110,12 @@
         }
       GNUNET_vector_delete (outgoingCalls, call);
       notifyPeerReply (sender,
-                       MINGLE (call->sequenceNumber, P2P_PROTO_rpc_REQ));
+                       MINGLE (call->sequenceNumber, 
GNUNET_P2P_PROTO_RPC_REQ));
       GNUNET_cron_del_job (coreAPI->cron, &retryRPCJob, 0, call);
       GNUNET_free (call->msg);
       GNUNET_free (call);
       if (reply != NULL)
-        RPC_paramFree (reply);
+        GNUNET_RPC_parameters_destroy (reply);
     }
   sendAck (sender, ntohl (res->sequenceNumber), 0,      /* not important, ACK 
should be tiny enough to go through anyway */
            0 /* right away */ );
@@ -1125,7 +1126,7 @@
 
 
 /**
- * Handle a peer-to-peer message of type P2P_PROTO_rpc_ACK.
+ * Handle a peer-to-peer message of type GNUNET_P2P_PROTO_RPC_ACK.
  */
 static int
 handleRPCMessageAck (const GNUNET_PeerIdentity * sender,
@@ -1134,11 +1135,11 @@
   RPC_ACK_Message *ack;
   CallInstance *call;
 
-  if ((ntohs (message->type) != P2P_PROTO_rpc_ACK) ||
+  if ((ntohs (message->type) != GNUNET_P2P_PROTO_RPC_ACK) ||
       (ntohs (message->size) != sizeof (RPC_ACK_Message)))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_REQUEST | GE_ADMIN,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_REQUEST | GNUNET_GE_ADMIN,
               _("Invalid message of type %u received.  Dropping.\n"),
               ntohs (message->type));
       return GNUNET_SYSERR;
@@ -1146,13 +1147,13 @@
 
   ack = (RPC_ACK_Message *) message;
 #if DEBUG_RPC
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Received RPC ACK with id %u.\n", ntohl (ack->sequenceNumber));
 #endif
   GNUNET_cron_suspend_jobs (coreAPI->cron, GNUNET_NO);
   GNUNET_mutex_lock (rpcLock);
 
-  /* Locate the CallInstance structure. */
+  /* Locate the GNUNET_RPC_CallHandle structure. */
   call = (CallInstance *) GNUNET_vector_get_first (incomingCalls);
   while (call != NULL)
     {
@@ -1170,7 +1171,7 @@
       RPC_STATUS ("", "acknowledged reply", call);
       notifyPeerReply (sender,
                        MINGLE (ntohl (ack->sequenceNumber),
-                               P2P_PROTO_rpc_RES));
+                               GNUNET_P2P_PROTO_RPC_RES));
       GNUNET_cron_del_job (coreAPI->cron, &retryRPCJob, 0, call);
       GNUNET_vector_delete (incomingCalls, call);
       GNUNET_free (call->msg);
@@ -1185,7 +1186,7 @@
             pi->averageResponseTime *= 2;
         }
 #if DEBUG_RPC
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "ACK is a duplicate (or invalid).\n");
 #endif
     }
@@ -1200,7 +1201,7 @@
 typedef struct
 {
   struct GNUNET_Semaphore *sem;
-  RPC_Param *result;
+  GNUNET_RPC_CallParameters *result;
   unsigned short ec;
 } RPC_EXEC_CLS;
 
@@ -1210,17 +1211,17 @@
  */
 static void
 RPC_execute_callback (RPC_EXEC_CLS * context,
-                      unsigned int sq, unsigned short ec, RPC_Param * res)
+                      unsigned int sq, unsigned short ec, 
GNUNET_RPC_CallParameters * res)
 {
   int i;
   unsigned int dl;
   void *data;
 
-  for (i = RPC_paramCount (res) - 1; i >= 0; i--)
+  for (i = GNUNET_RPC_parameters_count (res) - 1; i >= 0; i--)
     {
       data = NULL;
-      RPC_paramValueByPosition (res, i, &dl, &data);
-      RPC_paramAdd (context->result, RPC_paramName (res, i), dl, data);
+      GNUNET_RPC_parameters_get_value_by_index (res, i, &dl, &data);
+      GNUNET_RPC_parameters_add (context->result, 
GNUNET_RPC_parameters_get_name (res, i), dl, data);
     }
   context->ec = ec;
   GNUNET_semaphore_up (context->sem);
@@ -1239,8 +1240,8 @@
 static int
 RPC_execute (const GNUNET_PeerIdentity * receiver,
              const char *name,
-             RPC_Param * requestParam,
-             RPC_Param * returnParam, unsigned int importance,
+             GNUNET_RPC_CallParameters * requestParam,
+             GNUNET_RPC_CallParameters * returnParam, unsigned int importance,
              GNUNET_CronTime timeout)
 {
   RPC_EXEC_CLS cls;
@@ -1257,13 +1258,13 @@
   call->expirationTime = GNUNET_get_time () + timeout;
   call->receiver = *receiver;
   call->sequenceNumber = rpcIdentifier++;
-  call->msg = buildMessage (RPC_ERROR_OK,
+  call->msg = buildMessage (GNUNET_RPC_ERROR_OK,
                             name,
                             call->sequenceNumber, importance, requestParam);
   call->finishedCallback = (RPCFinishedCallback) & RPC_execute_callback;
   call->rpcCallbackArgs = &cls;
   GNUNET_vector_insert_last (outgoingCalls, call);
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              (GNUNET_get_time () + 1 * GNUNET_CRON_MINUTES >
               call->expirationTime)
              || (call->expirationTime - GNUNET_get_time () <
@@ -1276,11 +1277,11 @@
   return cls.ec;
 }
 
-typedef struct RPC_Record
+typedef struct GNUNET_RPC_RequestHandle
 {
   GNUNET_PeerIdentity peer;
   CallInstance *call;
-  RPC_Complete callback;
+  GNUNET_RPC_AsynchronousCompletionCallback callback;
   void *closure;
   unsigned short errorCode;
 } RPC_Record;
@@ -1288,9 +1289,9 @@
 static void
 RPC_async_callback (RPC_Record * rec,
                     unsigned int sequenceNumber,
-                    unsigned short errorCode, RPC_Param * result)
+                    unsigned short errorCode, GNUNET_RPC_CallParameters * 
result)
 {
-  if ((errorCode == RPC_ERROR_OK) && (rec->callback != NULL))
+  if ((errorCode == GNUNET_RPC_ERROR_OK) && (rec->callback != NULL))
     {
       rec->callback (&rec->peer, result, rec->closure);
       rec->callback = NULL;     /* never call callback twice */
@@ -1311,15 +1312,15 @@
 static RPC_Record *
 RPC_start (const GNUNET_PeerIdentity * receiver,
            const char *name,
-           RPC_Param * request_param,
+           GNUNET_RPC_CallParameters * request_param,
            unsigned int importance,
-           GNUNET_CronTime timeout, RPC_Complete callback, void *closure)
+           GNUNET_CronTime timeout, GNUNET_RPC_AsynchronousCompletionCallback 
callback, void *closure)
 {
   RPC_Record *ret;
 
   if (timeout > 1 * GNUNET_CRON_HOURS)
     {
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' called with timeout above 1 hour (bug?)\n"),
               __FUNCTION__);
       timeout = 1 * GNUNET_CRON_HOURS;
@@ -1329,7 +1330,7 @@
   ret->peer = *receiver;
   ret->callback = callback;
   ret->closure = closure;
-  ret->errorCode = RPC_ERROR_TIMEOUT;
+  ret->errorCode = GNUNET_RPC_ERROR_TIMEOUT;
   GNUNET_mutex_lock (rpcLock);
   ret->call = GNUNET_malloc (sizeof (CallInstance));
   ret->call->lastAttempt = 0;
@@ -1338,14 +1339,14 @@
   ret->call->expirationTime = GNUNET_get_time () + timeout;
   ret->call->receiver = *receiver;
   ret->call->sequenceNumber = rpcIdentifier++;
-  ret->call->msg = buildMessage (RPC_ERROR_OK,
+  ret->call->msg = buildMessage (GNUNET_RPC_ERROR_OK,
                                  name,
                                  ret->call->sequenceNumber,
                                  importance, request_param);
   ret->call->finishedCallback = (RPCFinishedCallback) & RPC_async_callback;
   ret->call->rpcCallbackArgs = ret;
   GNUNET_vector_insert_last (outgoingCalls, ret->call);
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              (GNUNET_get_time () + 1 * GNUNET_CRON_MINUTES >
               ret->call->expirationTime)
              || (ret->call->expirationTime - GNUNET_get_time () <
@@ -1359,7 +1360,7 @@
  * Stop an asynchronous RPC (and free associated resources)
  *
  * @param record the return value from RPC_start
- * @return RPC_ERROR_OK if the RPC was successful,
+ * @return GNUNET_RPC_ERROR_OK if the RPC was successful,
  *  another RPC_ERROR code if it was aborted
  */
 static int
@@ -1396,9 +1397,9 @@
 
   GNUNET_cron_del_job (coreAPI->cron,
                        &agePeerStats, PEER_TRACKING_TIME_INTERVAL, NULL);
-  coreAPI->unregisterHandler (P2P_PROTO_rpc_REQ, &handleRPCMessageReq);
-  coreAPI->unregisterHandler (P2P_PROTO_rpc_RES, &handleRPCMessageRes);
-  coreAPI->unregisterHandler (P2P_PROTO_rpc_ACK, &handleRPCMessageAck);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_RPC_REQ, &handleRPCMessageReq);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_RPC_RES, &handleRPCMessageRes);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_RPC_ACK, &handleRPCMessageAck);
   if (NULL != peerInformation)
     {
       while (GNUNET_vector_get_size (peerInformation) > 0)
@@ -1437,7 +1438,7 @@
           RegisteredRPC *rpc;
           rpc =
             (RegisteredRPC *) GNUNET_vector_delete_last (list_of_callbacks);
-          GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | 
GNUNET_GE_USER,
                   _("RPC not unregistered: %s:%p\n"), rpc->name,
                   rpc->callback);
           GNUNET_free (rpc->name);
@@ -1453,10 +1454,10 @@
 /**
  * Initialize the RPC service.
  */
-RPC_ServiceAPI *
-provide_module_rpc (CoreAPIForApplication * capi)
+GNUNET_RPC_ServiceAPI *
+provide_module_rpc (GNUNET_CoreAPIForPlugins * capi)
 {
-  static RPC_ServiceAPI rpcAPI;
+  static GNUNET_RPC_ServiceAPI rpcAPI;
   int rvalue;
 
   ectx = capi->ectx;
@@ -1466,23 +1467,23 @@
   incomingCalls = GNUNET_vector_create (16);
   outgoingCalls = GNUNET_vector_create (16);
   list_of_callbacks = GNUNET_vector_create (16);
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("`%s' registering handlers %d %d %d\n"),
-          "rpc", P2P_PROTO_rpc_REQ, P2P_PROTO_rpc_RES, P2P_PROTO_rpc_ACK);
+          "rpc", GNUNET_P2P_PROTO_RPC_REQ, GNUNET_P2P_PROTO_RPC_RES, 
GNUNET_P2P_PROTO_RPC_ACK);
   rvalue = GNUNET_OK;
-  if (capi->registerHandler (P2P_PROTO_rpc_REQ,
+  if (capi->registerHandler (GNUNET_P2P_PROTO_RPC_REQ,
                              &handleRPCMessageReq) == GNUNET_SYSERR)
     rvalue = GNUNET_SYSERR;
-  if (capi->registerHandler (P2P_PROTO_rpc_RES,
+  if (capi->registerHandler (GNUNET_P2P_PROTO_RPC_RES,
                              &handleRPCMessageRes) == GNUNET_SYSERR)
     rvalue = GNUNET_SYSERR;
-  if (capi->registerHandler (P2P_PROTO_rpc_ACK,
+  if (capi->registerHandler (GNUNET_P2P_PROTO_RPC_ACK,
                              &handleRPCMessageAck) == GNUNET_SYSERR)
     rvalue = GNUNET_SYSERR;
   if (rvalue == GNUNET_SYSERR)
     {
       release_module_rpc ();
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("Failed to initialize `%s' service.\n"), "rpc");
       return NULL;
     }
@@ -1507,123 +1508,123 @@
 
 static void
 testCallback (const GNUNET_PeerIdentity * sender,
-              RPC_Param * arguments, RPC_Param * results)
+              GNUNET_RPC_CallParameters * arguments, GNUNET_RPC_CallParameters 
* results)
 {
   unsigned int dl;
   char *data;
 
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER, "RPC callback invoked!\n");
-  if ((GNUNET_OK == RPC_paramValueByName (arguments,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
"RPC callback invoked!\n");
+  if ((GNUNET_OK == GNUNET_RPC_parameters_get_value_by_name (arguments,
                                           "command",
                                           &dl,
                                           (void **) &data)) &&
       (strncmp ("Hello", data, dl) == 0))
     {
-      GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | 
GNUNET_GE_USER,
               "RPC callback received Hello command!\n");
-      RPC_paramAdd (results,
+      GNUNET_RPC_parameters_add (results,
                     "response",
                     strlen ("Hello RPC World") + 1, "Hello RPC World");
     }
 }
 
 static void
-async_RPC_Complete_callback (RPC_Param * results,
+async_RPC_Complete_callback (GNUNET_RPC_CallParameters * results,
                              struct GNUNET_Semaphore *GNUNET_RSA_sign)
 {
   unsigned int dl;
   char *reply;
 
   GNUNET_semaphore_down (GNUNET_RSA_sign, GNUNET_YES);
-  if ((GNUNET_OK != RPC_paramValueByName (results,
+  if ((GNUNET_OK != GNUNET_RPC_parameters_get_value_by_name (results,
                                           "response",
                                           &dl,
                                           (void **) &reply)) ||
       (strncmp ("Hello RPC World", reply, dl) != 0))
     {
-      GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("RPC async reply invalid.\n"));
     }
   else
-    GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+    GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             "RPC async reply received.\n");
 }
 
 int
-initialize_module_rpc (CoreAPIForApplication * capi)
+initialize_module_rpc (GNUNET_CoreAPIForPlugins * capi)
 {
-  RPC_ServiceAPI *rpcAPI;
+  GNUNET_RPC_ServiceAPI *rpcAPI;
   int ret;
-  RPC_Param *args;
-  RPC_Param *rets;
+  GNUNET_RPC_CallParameters *args;
+  GNUNET_RPC_CallParameters *rets;
   unsigned int dl;
   char *reply;
   int code;
-  RPC_Record *record;
+  struct GNUNET_RPC_RequestHandle *record;
   struct GNUNET_Semaphore *GNUNET_RSA_sign;
 
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER, "RPC testcase starting\n");
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER, 
"RPC testcase starting\n");
   rpcAPI = capi->requestService ("rpc");
   if (rpcAPI == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   ret = GNUNET_OK;
 
   if (GNUNET_OK != rpcAPI->RPC_register ("testFunction", &testCallback))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       ret = GNUNET_SYSERR;
     }
 
-  args = RPC_paramNew ();
-  RPC_paramAdd (args, "command", strlen ("Hello") + 1, "Hello");
+  args = GNUNET_RPC_parameters_create ();
+  GNUNET_RPC_parameters_add (args, "command", strlen ("Hello") + 1, "Hello");
   GNUNET_RSA_sign = GNUNET_semaphore_create (0);
   record = rpcAPI->RPC_start (coreAPI->myIdentity,
                               "testFunction",
                               args,
                               0,
                               5 * GNUNET_CRON_SECONDS,
-                              (RPC_Complete) & async_RPC_Complete_callback,
+                              (GNUNET_RPC_AsynchronousCompletionCallback) & 
async_RPC_Complete_callback,
                               GNUNET_RSA_sign);
   GNUNET_semaphore_up (GNUNET_RSA_sign);        /* allow callback now - forces 
async! */
-  rets = RPC_paramNew ();
+  rets = GNUNET_RPC_parameters_create ();
   code = rpcAPI->RPC_execute (coreAPI->myIdentity,
                               "testFunction", args, rets, 0,
                               5 * GNUNET_CRON_SECONDS);
-  if (code != RPC_ERROR_OK)
+  if (code != GNUNET_RPC_ERROR_OK)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       ret = GNUNET_SYSERR;
     }
-  RPC_paramFree (args);
-  if ((GNUNET_OK != RPC_paramValueByName (rets,
+  GNUNET_RPC_parameters_destroy (args);
+  if ((GNUNET_OK != GNUNET_RPC_parameters_get_value_by_name (rets,
                                           "response",
                                           &dl,
                                           (void **) &reply)) ||
       (strncmp ("Hello RPC World", reply, dl) != 0))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       ret = GNUNET_SYSERR;
     }
-  RPC_paramFree (rets);
+  GNUNET_RPC_parameters_destroy (rets);
   GNUNET_thread_sleep (1 * GNUNET_CRON_SECONDS);
-  if (RPC_ERROR_OK != rpcAPI->RPC_stop (record))
-    GE_LOG (ectx, GE_WARNING | GE_BULK | GE_USER,
+  if (GNUNET_RPC_ERROR_OK != rpcAPI->RPC_stop (record))
+    GNUNET_GE_LOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
             _("async RPC reply not received.\n"));
 
   if (GNUNET_OK != rpcAPI->RPC_unregister ("testFunction", &testCallback))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       ret = GNUNET_SYSERR;
     }
   if (GNUNET_OK != capi->releaseService (rpcAPI))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       ret = GNUNET_SYSERR;
     }
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "RPC testcase completed with status %s\n",
           ret == GNUNET_OK ? "SUCCESS" : "FAILURE");
   return ret;

Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c   2007-11-25 03:50:33 UTC (rev 
5754)
+++ GNUnet/src/applications/session/connect.c   2007-11-25 12:04:45 UTC (rev 
5755)
@@ -41,19 +41,19 @@
 
 #define EXTRA_CHECKS ALLOW_EXTRA_CHECKS
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
-static Identity_ServiceAPI *identity;
+static GNUNET_Identity_ServiceAPI *identity;
 
-static Transport_ServiceAPI *transport;
+static GNUNET_Transport_ServiceAPI *transport;
 
-static Pingpong_ServiceAPI *pingpong;
+static GNUNET_Pingpong_ServiceAPI *pingpong;
 
-static Topology_ServiceAPI *topology;
+static GNUNET_Topology_ServiceAPI *topology;
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 static int stat_skeySent;
 
@@ -159,16 +159,16 @@
   GNUNET_EncName enc;
 #endif
 
-  GE_ASSERT (ectx, hostId != NULL);
+  GNUNET_GE_ASSERT (ectx, hostId != NULL);
 #if DEBUG_SESSION
   IF_GELOG (ectx,
-            GE_DEBUG | GE_USER | GE_REQUEST,
+            GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
             GNUNET_hash_to_enc (&hostId->hashPubKey, &enc));
-  GE_LOG (ectx,
-          GE_DEBUG | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           "Received `%s' from `%s', marking session as up.\n", "PONG", &enc);
 #endif
-  GE_ASSERT (ectx, hostId != NULL);
+  GNUNET_GE_ASSERT (ectx, hostId != NULL);
   if (stats != NULL)
     stats->change (stat_sessionEstablished, 1);
   coreAPI->confirmSessionUp (hostId);
@@ -197,13 +197,13 @@
 
   if ((sks == NULL) || (hostId == NULL))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   /* check if we are allowed to accept connections
      from that peer */
   limited = NULL;
-  GC_get_configuration_value_string (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                      "GNUNETD", "LIMIT-ALLOW", "", &limited);
   if (strlen (limited) > 0)
     {
@@ -211,8 +211,8 @@
       if (NULL == strstr (limited, (char *) &enc))
         {
 #if DEBUG_SESSION
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_USER | GE_REQUEST,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
                   "Connection from peer `%s' was rejected (not allowed).\n",
                   &enc);
 #endif
@@ -222,7 +222,7 @@
     }
   GNUNET_free (limited);
   limited = NULL;
-  GC_get_configuration_value_string (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                      "GNUNETD", "LIMIT-DENY", "", &limited);
   if (strlen (limited) > 0)
     {
@@ -230,8 +230,8 @@
       if (NULL != strstr (limited, (char *) &enc))
         {
 #if DEBUG_SESSION
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_USER | GE_REQUEST,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
                   "Connection from peer `%s' was rejected (explicitly 
denied).\n",
                   &enc);
 #endif
@@ -248,12 +248,12 @@
     {
       GNUNET_EncName enc;
 
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       IF_GELOG (ectx,
-                GE_INFO | GE_USER | GE_REQUEST,
+                GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
                 GNUNET_hash_to_enc (&hostId->hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               _("Session key from peer `%s' could not be verified.\n"), &enc);
       return GNUNET_SYSERR;
     }
@@ -268,10 +268,10 @@
       GNUNET_EncName enc;
 
       IF_GELOG (ectx,
-                GE_INFO | GE_USER | GE_REQUEST,
+                GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
                 GNUNET_hash_to_enc (&hostId->hashPubKey, &enc));
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               _("Session key from peer `%s' could not be verified.\n"), &enc);
 #endif
       return GNUNET_SYSERR;     /*reject! */
@@ -305,15 +305,15 @@
   GNUNET_EncName enc;
   GNUNET_PeerIdentity hc;
 
-  GE_ASSERT (ectx, sk != NULL);
+  GNUNET_GE_ASSERT (ectx, sk != NULL);
   foreignHello =
-    identity->identity2Hello (hostId, ANY_PROTOCOL_NUMBER, GNUNET_YES);
+    identity->identity2Hello (hostId, GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY, 
GNUNET_YES);
   /* create and encrypt sessionkey */
   if (NULL == foreignHello)
     {
       GNUNET_hash_to_enc (&hostId->hashPubKey, &enc);
-      GE_LOG (ectx,
-              GE_INFO | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               _("Cannot encrypt sessionkey, peer `%s' not known!\n"), &enc);
       return NULL;              /* other host not known */
     }
@@ -325,13 +325,13 @@
                     &foreignHello->senderIdentity,
                     sizeof (GNUNET_PeerIdentity))))
     {
-      GE_BREAK_OP (NULL,
+      GNUNET_GE_BREAK_OP (NULL,
                    0 == memcmp (&hc,
                                 &foreignHello->senderIdentity,
                                 sizeof (GNUNET_PeerIdentity)));
-      GE_BREAK_OP (NULL,
+      GNUNET_GE_BREAK_OP (NULL,
                    0 == memcmp (&hc, hostId, sizeof (GNUNET_PeerIdentity)));
-      GE_BREAK_OP (NULL, 0);
+      GNUNET_GE_BREAK_OP (NULL, 0);
       GNUNET_free (foreignHello);
       return NULL;
     }
@@ -349,7 +349,7 @@
                                            &foreignHello->publicKey,
                                            &msg->key))
     {
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       GNUNET_free (foreignHello);
       GNUNET_free (msg);
       return NULL;              /* encrypt failed */
@@ -358,9 +358,9 @@
 
   /* complete header */
   msg->header.size = htons (size);
-  msg->header.type = htons (P2P_PROTO_setkey);
+  msg->header.type = htons (GNUNET_P2P_PROTO_SET_KEY);
   msg->creationTime = htonl (created);
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR !=
              identity->signData (msg,
                                  sizeof (P2P_new_setkey_MESSAGE)
@@ -368,7 +368,7 @@
                                  &msg->signature));
 #if EXTRA_CHECKS
   /* verify signature/SKS */
-  GE_ASSERT (ectx,
+  GNUNET_GE_ASSERT (ectx,
              GNUNET_SYSERR != verifySKS (coreAPI->myIdentity,
                                          (const P2P_setkey_MESSAGE *) msg,
                                          &msg->signature));
@@ -394,12 +394,12 @@
           size += ntohs (pong->size);
         }
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Encrypting %d bytes of PINGPONG with key %s and IV %u\n",
               size, printSKEY (sk), *(int *) &msg->signature);
 #endif
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  -1 != GNUNET_AES_encrypt (pt,
                                            size,
                                            sk,
@@ -423,7 +423,7 @@
  */
 static int
 exchangeKey (const GNUNET_PeerIdentity * receiver,
-             TSession * tsession, GNUNET_MessageHeader * pong)
+             GNUNET_TSession * tsession, GNUNET_MessageHeader * pong)
 {
   GNUNET_MessageHello *hello;
   P2P_new_setkey_MESSAGE *skey;
@@ -433,11 +433,11 @@
   GNUNET_PeerIdentity *sndr;
   GNUNET_EncName enc;
 
-  GE_ASSERT (ectx, receiver != NULL);
+  GNUNET_GE_ASSERT (ectx, receiver != NULL);
   if ((tsession != NULL) &&
       (0 != memcmp (&tsession->peer, receiver, sizeof (GNUNET_PeerIdentity))))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       tsession = NULL;
     }
   if ((topology != NULL) &&
@@ -451,8 +451,8 @@
   if (tsession == NULL)
     {
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Key exchange with `%s' failed: could not connect.\n", &enc);
 #endif
       return GNUNET_SYSERR;     /* failed to connect */
@@ -476,8 +476,8 @@
       age = GNUNET_get_time_int32 (NULL);
       GNUNET_AES_create_session_key (&sk);
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Created fresh sessionkey `%s' for peer `%s'.\n",
               printSKEY (&sk), &enc);
 #endif
@@ -495,16 +495,16 @@
   /* create hello */
   hello = transport->createhello (tsession->ttype);
   if (NULL == hello)
-    hello = transport->createhello (ANY_PROTOCOL_NUMBER);
+    hello = transport->createhello (GNUNET_TRANSPORT_PROTOCOL_NUMBER_ANY);
   if (NULL == hello)
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_USER | GE_IMMEDIATE,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_IMMEDIATE,
               _("Could not create any HELLO for myself!\n"));
     }
 #if DEBUG_SESSION
-  GE_LOG (ectx,
-          GE_DEBUG | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           "Sending session key  to peer `%s'.\n", &enc);
 #endif
   if (stats != NULL)
@@ -527,7 +527,7 @@
   GNUNET_free (skey);
   if (0 != memcmp (receiver, &tsession->peer, sizeof (GNUNET_PeerIdentity)))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
     }
   else
     {
@@ -552,7 +552,7 @@
  */
 static int
 acceptSessionKey (const GNUNET_PeerIdentity * sender,
-                  const GNUNET_MessageHeader * msg, TSession * tsession)
+                  const GNUNET_MessageHeader * msg, GNUNET_TSession * tsession)
 {
   GNUNET_AES_SessionKey key;
   GNUNET_MessageHeader *ping;
@@ -569,7 +569,7 @@
 
   if (sender == NULL)
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return GNUNET_SYSERR;
     }
   GNUNET_hash_to_enc (&sender->hashPubKey, &enc);
@@ -577,8 +577,8 @@
       (topology->allowConnectionFrom (sender) == GNUNET_SYSERR))
     {
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Topology rejected session key from peer `%s'.\n", &enc);
 #endif
       return GNUNET_SYSERR;
@@ -587,19 +587,19 @@
                    &coreAPI->myIdentity->hashPubKey,
                    sizeof (GNUNET_HashCode)))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
 #if DEBUG_SESSION
-  GE_LOG (ectx,
-          GE_DEBUG | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           "Received session key from peer `%s'.\n", &enc);
 #endif
 
   if (ntohs (msg->size) < sizeof (P2P_setkey_MESSAGE))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_DEVELOPER | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_DEVELOPER | GNUNET_GE_USER | 
GNUNET_GE_BULK,
               _
               ("Session key received from peer `%s' has invalid format 
(discarded).\n"),
               &enc);
@@ -631,8 +631,8 @@
         {
           GNUNET_EncName ta;
           GNUNET_hash_to_enc (&newMsg->target.hashPubKey, &ta);
-          GE_LOG (ectx,
-                  GE_WARNING | GE_DEVELOPER | GE_USER | GE_BULK,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_WARNING | GNUNET_GE_DEVELOPER | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                   _
                   ("Session key received from peer `%s' is for `%s' and not 
for me!\n"),
                   &enc, &ta);
@@ -650,8 +650,8 @@
     {
 #if DEBUG_SESSION
       if (ret == GNUNET_SYSERR)
-        GE_LOG (ectx,
-                GE_INFO | GE_USER | GE_REQUEST | GE_DEVELOPER,
+        GNUNET_GE_LOG (ectx,
+                GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST | 
GNUNET_GE_DEVELOPER,
                 "Signature of session key from `%s' failed"
                 " verification (discarded).\n", &enc);
 #endif
@@ -664,8 +664,8 @@
                                 &key, sizeof (GNUNET_AES_SessionKey));
   if (size != sizeof (GNUNET_AES_SessionKey))
     {
-      GE_LOG (ectx,
-              GE_WARNING | GE_DEVELOPER | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_DEVELOPER | GNUNET_GE_USER | 
GNUNET_GE_BULK,
               _("Invalid `%s' message received from peer `%s'.\n"),
               "setkey", &enc);
       return GNUNET_SYSERR;
@@ -673,21 +673,21 @@
   if (key.crc32 != htonl (GNUNET_crc32_n (&key, GNUNET_SESSIONKEY_LEN)))
     {
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_WARNING | GE_DEVELOPER | GE_USER | GE_BULK,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_WARNING | GNUNET_GE_DEVELOPER | GNUNET_GE_USER | 
GNUNET_GE_BULK,
               _
               ("setkey `%s' from `%s' fails CRC check (have: %u, want %u).\n"),
               printSKEY (&key), &enc, ntohl (key.crc32), GNUNET_crc32_n (&key,
                                                                          
GNUNET_SESSIONKEY_LEN));
 #endif
-      GE_BREAK_OP (ectx, 0);
+      GNUNET_GE_BREAK_OP (ectx, 0);
       stats->change (stat_skeyRejected, 1);
       return GNUNET_SYSERR;
     }
 
 #if DEBUG_SESSION
-  GE_LOG (ectx,
-          GE_DEBUG | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           "Received setkey message from `%s' with %u bytes of data and key 
`%s'.\n",
           &enc, ntohs (sessionkeySigned->header.size), printSKEY (&key));
 #endif
@@ -719,12 +719,12 @@
         }
       plaintext = GNUNET_malloc (size);
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Decrypting %d bytes of PINGPONG from `%s' with key `%s' and IV 
%u\n",
               size, &enc, printSKEY (&key), *(int *) sig);
 #endif
-      GE_ASSERT (ectx,
+      GNUNET_GE_ASSERT (ectx,
                  -1 != GNUNET_AES_decrypt (&key,
                                            end,
                                            size,
@@ -740,19 +740,19 @@
           hdr = (GNUNET_MessageHeader *) & plaintext[pos];
           if (htons (hdr->size) + pos > size)
             {
-              GE_LOG (ectx,
-                      GE_WARNING | GE_DEVELOPER | GE_USER | GE_BULK,
+              GNUNET_GE_LOG (ectx,
+                      GNUNET_GE_WARNING | GNUNET_GE_DEVELOPER | GNUNET_GE_USER 
| GNUNET_GE_BULK,
                       _("Error parsing encrypted session key from `%s', "
                         "given message part size is invalid.\n"), &enc);
               break;
             }
-          if (htons (hdr->type) == p2p_PROTO_PING)
+          if (htons (hdr->type) == GNUNET_P2P_PROTO_PING)
             ping = hdr;
-          else if (htons (hdr->type) == p2p_PROTO_PONG)
+          else if (htons (hdr->type) == GNUNET_P2P_PROTO_PONG)
             pong = hdr;
           else
-            GE_LOG (ectx,
-                    GE_WARNING | GE_DEVELOPER | GE_USER | GE_BULK,
+            GNUNET_GE_LOG (ectx,
+                    GNUNET_GE_WARNING | GNUNET_GE_DEVELOPER | GNUNET_GE_USER | 
GNUNET_GE_BULK,
                     _
                     ("Unknown type in embedded message from `%s': %u (size: 
%u)\n"),
                     &enc, htons (hdr->type), htons (hdr->size));
@@ -764,8 +764,8 @@
       /* we initiated, this is the response */
       /* notify ourselves about encapsulated pong */
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Received PONG in session key from `%s', injecting!\n", &enc);
 #endif
       coreAPI->injectMessage (sender,
@@ -775,15 +775,15 @@
         {                       /* should always be true for well-behaved 
peers */
           /* pong can go out over ordinary channels */
 #if DEBUG_SESSION
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_USER | GE_REQUEST,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
                   "Received PING in session key from `%s', "
                   "sending PONG over normal encrypted session!\n", &enc);
 #endif
-          ping->type = htons (p2p_PROTO_PONG);
+          ping->type = htons (GNUNET_P2P_PROTO_PONG);
           if (stats != NULL)
             stats->change (stat_pongSent, 1);
-          coreAPI->unicast (sender, ping, EXTREME_PRIORITY, 0);
+          coreAPI->unicast (sender, ping, GNUNET_EXTREME_PRIORITY, 0);
         }
     }
   else
@@ -791,19 +791,19 @@
       if (ping != NULL)
         {
 #if DEBUG_SESSION
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_USER | GE_REQUEST,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
                   "Received ping in session key from `%s', "
                   "sending pong together with my session key!\n", &enc);
 #endif
-          ping->type = htons (p2p_PROTO_PONG);
+          ping->type = htons (GNUNET_P2P_PROTO_PONG);
           if (stats != NULL)
             stats->change (stat_pongSent, 1);
           exchangeKey (sender, tsession, ping); /* ping is now pong */
         }
       else
         {
-          GE_BREAK_OP (ectx, 0);
+          GNUNET_GE_BREAK_OP (ectx, 0);
           /* PING not included in SKEY - bug (in other peer!?) */
         }
     }
@@ -825,15 +825,15 @@
   GNUNET_EncName enc;
 
   IF_GELOG (ectx,
-            GE_DEBUG | GE_USER | GE_REQUEST,
+            GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
             GNUNET_hash_to_enc (&peer->hashPubKey, &enc));
 #endif
   if ((topology != NULL)
       && (topology->allowConnectionFrom (peer) == GNUNET_SYSERR))
     {
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Topology rejected connecting to `%s'.\n", &enc);
 #endif
       return GNUNET_SYSERR;
@@ -841,15 +841,15 @@
   if (coreAPI->queryPeerStatus (peer, NULL, NULL) == GNUNET_OK)
     {
 #if DEBUG_SESSION
-      GE_LOG (ectx,
-              GE_DEBUG | GE_USER | GE_REQUEST,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
               "Connection to `%s' already up\n", &enc);
 #endif
       return GNUNET_YES;        /* trivial case */
     }
 #if DEBUG_SESSION
-  GE_LOG (ectx,
-          GE_DEBUG | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           "Trying to exchange key with `%s'.\n", &enc);
 #endif
   if (GNUNET_YES == identity->isBlacklisted (peer, GNUNET_NO))
@@ -876,24 +876,24 @@
 /**
  * Initialize the module.
  */
-Session_ServiceAPI *
-provide_module_session (CoreAPIForApplication * capi)
+GNUNET_Session_ServiceAPI *
+provide_module_session (GNUNET_CoreAPIForPlugins * capi)
 {
-  static Session_ServiceAPI ret;
+  static GNUNET_Session_ServiceAPI ret;
 
   ectx = capi->ectx;
-  GE_ASSERT (ectx, sizeof (P2P_setkey_MESSAGE) == 520);
+  GNUNET_GE_ASSERT (ectx, sizeof (P2P_setkey_MESSAGE) == 520);
   coreAPI = capi;
   identity = capi->requestService ("identity");
   if (identity == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return NULL;
     }
   transport = capi->requestService ("transport");
   if (transport == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       coreAPI->releaseService (identity);
       identity = NULL;
       return NULL;
@@ -901,7 +901,7 @@
   pingpong = capi->requestService ("pingpong");
   if (pingpong == NULL)
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       coreAPI->releaseService (transport);
       transport = NULL;
       coreAPI->releaseService (identity);
@@ -925,12 +925,12 @@
         = stats->create (gettext_noop ("# encrypted PONG messages sent"));
     }
 
-  GE_LOG (ectx,
-          GE_INFO | GE_USER | GE_REQUEST,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
           _("`%s' registering handler %d (plaintext and ciphertext)\n"),
-          "session", P2P_PROTO_setkey);
-  coreAPI->registerPlaintextHandler (P2P_PROTO_setkey, &acceptSessionKey);
-  coreAPI->registerHandler (P2P_PROTO_setkey, &acceptSessionKeyUpdate);
+          "session", GNUNET_P2P_PROTO_SET_KEY);
+  coreAPI->registerPlaintextHandler (GNUNET_P2P_PROTO_SET_KEY, 
&acceptSessionKey);
+  coreAPI->registerHandler (GNUNET_P2P_PROTO_SET_KEY, &acceptSessionKeyUpdate);
   ret.tryConnect = &tryConnect;
   return &ret;
 }
@@ -941,8 +941,8 @@
 int
 release_module_session ()
 {
-  coreAPI->unregisterPlaintextHandler (P2P_PROTO_setkey, &acceptSessionKey);
-  coreAPI->unregisterHandler (P2P_PROTO_setkey, &acceptSessionKeyUpdate);
+  coreAPI->unregisterPlaintextHandler (GNUNET_P2P_PROTO_SET_KEY, 
&acceptSessionKey);
+  coreAPI->unregisterHandler (GNUNET_P2P_PROTO_SET_KEY, 
&acceptSessionKeyUpdate);
   if (topology != NULL)
     {
       coreAPI->releaseService (topology);

Modified: GNUnet/src/applications/session/sessiontest.c
===================================================================
--- GNUnet/src/applications/session/sessiontest.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/session/sessiontest.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -64,12 +64,12 @@
   struct GNUNET_ClientServerConnection *sock1;
   struct GNUNET_ClientServerConnection *sock2;
   int left;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
@@ -79,7 +79,7 @@
                                         10000, 2);
   if (peers == NULL)
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -88,14 +88,14 @@
       GNUNET_wait_for_daemon_running (NULL, cfg, 30 * GNUNET_CRON_SECONDS))
     {
       sock1 = GNUNET_client_connection_create (NULL, cfg);
-      GC_set_configuration_value_string (cfg,
+      GNUNET_GC_set_configuration_value_string (cfg,
                                          NULL,
                                          "NETWORK",
                                          "HOST", "localhost:12087");
       sock2 = GNUNET_client_connection_create (NULL, cfg);
       left = 30;                /* how many iterations should we wait? */
       while (GNUNET_OK ==
-             STATS_getStatistics (NULL, sock1, &waitForConnect, NULL))
+             GNUNET_STATS_get_statistics (NULL, sock1, &waitForConnect, NULL))
         {
           printf ("Waiting for peers to connect (%u iterations left)...\n",
                   left);
@@ -116,7 +116,7 @@
               while (GNUNET_shutdown_test () == GNUNET_NO)
                 {
                   printf ("Checking that peers are staying connected 1...\n");
-                  STATS_getStatistics (NULL, sock1, &waitForConnect, NULL);
+                  GNUNET_STATS_get_statistics (NULL, sock1, &waitForConnect, 
NULL);
                   sleep (1);
                   if (ok == 0)
                     {
@@ -124,7 +124,7 @@
                       break;
                     }
                   printf ("Checking that peers are staying connected 2...\n");
-                  STATS_getStatistics (NULL, sock2, &waitForConnect, NULL);
+                  GNUNET_STATS_get_statistics (NULL, sock2, &waitForConnect, 
NULL);
                   sleep (1);
                   if (ok == 0)
                     {
@@ -151,7 +151,7 @@
 #if START_PEERS
   GNUNET_TESTING_stop_daemons (peers);
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == 0) ? 1 : 0;
 }
 

Modified: GNUnet/src/applications/session/sessiontest2.c
===================================================================
--- GNUnet/src/applications/session/sessiontest2.c      2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/session/sessiontest2.c      2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -59,8 +59,8 @@
 connect_daemons (unsigned short port1, unsigned short port2)
 {
   char host[128];
-  GC_Configuration *cfg1 = GC_create ();
-  GC_Configuration *cfg2 = GC_create ();
+  GNUNET_GC_Configuration *cfg1 = GNUNET_GC_create ();
+  GNUNET_GC_Configuration *cfg2 = GNUNET_GC_create ();
   struct GNUNET_ClientServerConnection *sock1;
   struct GNUNET_ClientServerConnection *sock2;
   int ret;
@@ -68,9 +68,9 @@
 
   ret = GNUNET_SYSERR;
   GNUNET_snprintf (host, 128, "localhost:%u", port1);
-  GC_set_configuration_value_string (cfg1, NULL, "NETWORK", "HOST", host);
+  GNUNET_GC_set_configuration_value_string (cfg1, NULL, "NETWORK", "HOST", 
host);
   GNUNET_snprintf (host, 128, "localhost:%u", port2);
-  GC_set_configuration_value_string (cfg2, NULL, "NETWORK", "HOST", host);
+  GNUNET_GC_set_configuration_value_string (cfg2, NULL, "NETWORK", "HOST", 
host);
   if ((GNUNET_OK == GNUNET_wait_for_daemon_running (NULL,
                                                     cfg1,
                                                     300 *
@@ -100,8 +100,8 @@
     {
       fprintf (stderr, "Failed to establish connection with peers.\n");
     }
-  GC_free (cfg1);
-  GC_free (cfg2);
+  GNUNET_GC_free (cfg1);
+  GNUNET_GC_free (cfg2);
   return ret;
 }
 
@@ -123,26 +123,26 @@
   int ret;
   struct GNUNET_ClientServerConnection *sock;
   int left;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
   peer1 = GNUNET_daemon_start (NULL, cfg, "tcp-peer.conf", GNUNET_NO);
   if (peer1 == -1)
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   peer2 = GNUNET_daemon_start (NULL, cfg, "nat-peer.conf", GNUNET_NO);
   if (peer2 == -1)
     {
       GNUNET_daemon_stop (NULL, peer1);
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -153,7 +153,7 @@
       sock = GNUNET_client_connection_create (NULL, cfg);
       left = 30;                /* how many iterations should we wait? */
       while (GNUNET_OK ==
-             STATS_getStatistics (NULL, sock, &waitForConnect, NULL))
+             GNUNET_STATS_get_statistics (NULL, sock, &waitForConnect, NULL))
         {
           printf ("Waiting for peers to connect (%u iterations left)...\n",
                   left);
@@ -176,7 +176,7 @@
   GNUNET_daemon_stop (NULL, peer1);
   GNUNET_daemon_stop (NULL, peer2);
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == 0) ? 1 : 0;
 }
 

Modified: GNUnet/src/applications/session/sessiontest_http.c
===================================================================
--- GNUnet/src/applications/session/sessiontest_http.c  2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/session/sessiontest_http.c  2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -59,8 +59,8 @@
 connect_daemons (unsigned short port1, unsigned short port2)
 {
   char host[128];
-  GC_Configuration *cfg1 = GC_create ();
-  GC_Configuration *cfg2 = GC_create ();
+  GNUNET_GC_Configuration *cfg1 = GNUNET_GC_create ();
+  GNUNET_GC_Configuration *cfg2 = GNUNET_GC_create ();
   struct GNUNET_ClientServerConnection *sock1;
   struct GNUNET_ClientServerConnection *sock2;
   int ret;
@@ -68,9 +68,9 @@
 
   ret = GNUNET_SYSERR;
   GNUNET_snprintf (host, 128, "localhost:%u", port1);
-  GC_set_configuration_value_string (cfg1, NULL, "NETWORK", "HOST", host);
+  GNUNET_GC_set_configuration_value_string (cfg1, NULL, "NETWORK", "HOST", 
host);
   GNUNET_snprintf (host, 128, "localhost:%u", port2);
-  GC_set_configuration_value_string (cfg2, NULL, "NETWORK", "HOST", host);
+  GNUNET_GC_set_configuration_value_string (cfg2, NULL, "NETWORK", "HOST", 
host);
   if ((GNUNET_OK == GNUNET_wait_for_daemon_running (NULL,
                                                     cfg1,
                                                     300 *
@@ -100,8 +100,8 @@
     {
       fprintf (stderr, "Failed to establish connection with peers.\n");
     }
-  GC_free (cfg1);
-  GC_free (cfg2);
+  GNUNET_GC_free (cfg1);
+  GNUNET_GC_free (cfg2);
   return ret;
 }
 
@@ -123,26 +123,26 @@
   int ret;
   struct GNUNET_ClientServerConnection *sock;
   int left;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #if START_PEERS
   peer1 = GNUNET_daemon_start (NULL, cfg, "http-peer.conf", GNUNET_NO);
   if (peer1 == -1)
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   peer2 = GNUNET_daemon_start (NULL, cfg, "nat-http-peer.conf", GNUNET_NO);
   if (peer2 == -1)
     {
       GNUNET_daemon_stop (NULL, peer1);
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
 #endif
@@ -153,7 +153,7 @@
       sock = GNUNET_client_connection_create (NULL, cfg);
       left = 30;                /* how many iterations should we wait? */
       while (GNUNET_OK ==
-             STATS_getStatistics (NULL, sock, &waitForConnect, NULL))
+             GNUNET_STATS_get_statistics (NULL, sock, &waitForConnect, NULL))
         {
           printf ("Waiting for peers to connect (%u iterations left)...\n",
                   left);
@@ -176,7 +176,7 @@
   GNUNET_daemon_stop (NULL, peer1);
   GNUNET_daemon_stop (NULL, peer2);
 #endif
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   return (ok == 0) ? 1 : 0;
 }
 

Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c       2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c       2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -142,18 +142,18 @@
  * a failure of the command 'cmd' with the message given
  * by strerror(errno).
  */
-#define DIE_MYSQL(cmd, dbh) do { GE_LOG(ectx, GE_FATAL | GE_ADMIN | 
GE_IMMEDIATE, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, 
__LINE__, mysql_error((dbh)->dbf)); abort(); } while(0);
+#define DIE_MYSQL(cmd, dbh) do { GNUNET_GE_LOG(ectx, GNUNET_GE_FATAL | 
GNUNET_GE_ADMIN | GNUNET_GE_IMMEDIATE, _("`%s' failed at %s:%d with error: 
%s\n"), cmd, __FILE__, __LINE__, mysql_error((dbh)->dbf)); abort(); } while(0);
 
 /**
  * Log an error message at log-level 'level' that indicates
  * a failure of the command 'cmd' on file 'filename'
  * with the message given by strerror(errno).
  */
-#define LOG_MYSQL(level, cmd, dbh) do { GE_LOG(ectx, level, _("`%s' failed at 
%s:%d with error: %s\n"), cmd, __FILE__, __LINE__, mysql_error((dbh)->dbf)); } 
while(0);
+#define LOG_MYSQL(level, cmd, dbh) do { GNUNET_GE_LOG(ectx, level, _("`%s' 
failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, 
mysql_error((dbh)->dbf)); } while(0);
 
-static Stats_ServiceAPI *stats;
+static GNUNET_Stats_ServiceAPI *stats;
 
-static CoreAPIForApplication *coreAPI;
+static GNUNET_CoreAPIForPlugins *coreAPI;
 
 static unsigned int stat_size;
 
@@ -167,7 +167,7 @@
  */
 static struct GNUNET_Mutex *lock;
 
-static struct GE_Context *ectx;
+static struct GNUNET_GE_Context *ectx;
 
 /**
  * @brief mysql wrapper
@@ -332,14 +332,14 @@
   mysql_options (dbh->dbf, MYSQL_OPT_WRITE_TIMEOUT, (const void *) &timeout);
 
   dbname = NULL;
-  GC_get_configuration_value_string (coreAPI->cfg,
+  GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
                                      "MYSQL", "DATABASE", "gnunet", &dbname);
-  GE_ASSERT (ectx, dbname != NULL);
+  GNUNET_GE_ASSERT (ectx, dbname != NULL);
   mysql_real_connect (dbh->dbf, NULL, NULL, NULL, dbname, 0, NULL, 0);
   GNUNET_free (dbname);
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_real_connect", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_real_connect", dbh);
       iclose ();
       return GNUNET_SYSERR;
     }
@@ -347,7 +347,7 @@
                "SET SESSION net_read_timeout=60, SESSION 
net_write_timeout=60");
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
       iclose ();
       return GNUNET_SYSERR;
     }
@@ -394,7 +394,7 @@
     }
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
       iclose ();
       return GNUNET_SYSERR;
     }
@@ -404,20 +404,20 @@
                " value BLOB NOT NULL DEFAULT '') ENGINE=MyISAM");
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
       iclose ();
       return GNUNET_SYSERR;
     }
   mysql_query (dbh->dbf, "SET AUTOCOMMIT = 1");
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
       iclose ();
       return GNUNET_SYSERR;
     }
 #define PINIT(a,b) a = mysql_stmt_init(dbh->dbf); if (a == NULL) { iclose(); 
return GNUNET_SYSERR; } else { \
     if (mysql_stmt_prepare (a, b, strlen(b))) { \
-      GE_LOG (ectx, GE_ERROR | GE_BULK | GE_USER, \
+      GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER, \
              _("`%s' failed at %s:%d with error: %s"), "mysql_stmt_prepare", 
__FILE__, __LINE__, \
              mysql_stmt_error (a));  iclose(); return GNUNET_SYSERR; } }
   PINIT (dbh->select_value, SELECT_VALUE);
@@ -462,11 +462,11 @@
   qbind[0].is_unsigned = GNUNET_YES;
   qbind[0].buffer_type = MYSQL_TYPE_LONGLONG;
   qbind[0].buffer = &vkey;
-  GE_ASSERT (ectx, mysql_stmt_param_count (dbh->delete_value) == 1);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (dbh->delete_value) == 1);
   if (mysql_stmt_bind_param (dbh->delete_value, qbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_param",
               __FILE__, __LINE__, mysql_stmt_error (dbh->delete_value));
@@ -475,8 +475,8 @@
     }
   if (mysql_stmt_execute (dbh->delete_value))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_execute",
               __FILE__, __LINE__, mysql_stmt_error (dbh->delete_value));
@@ -510,11 +510,11 @@
   qbind[0].buffer = (void *) value;
   qbind[0].buffer_length = size;
   qbind[0].length = &length;
-  GE_ASSERT (ectx, mysql_stmt_param_count (dbh->insert_value) == 1);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (dbh->insert_value) == 1);
   if (mysql_stmt_bind_param (dbh->insert_value, qbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_param",
               __FILE__, __LINE__, mysql_stmt_error (dbh->insert_value));
@@ -523,8 +523,8 @@
     }
   if (mysql_stmt_execute (dbh->insert_value))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_execute",
               __FILE__, __LINE__, mysql_stmt_error (dbh->insert_value));
@@ -552,11 +552,11 @@
   qbind[0].is_unsigned = GNUNET_YES;
   qbind[0].buffer_type = MYSQL_TYPE_LONGLONG;
   qbind[0].buffer = &vkey;
-  GE_ASSERT (ectx, mysql_stmt_param_count (dbh->delete_entry_by_vkey) == 1);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (dbh->delete_entry_by_vkey) 
== 1);
   if (mysql_stmt_bind_param (dbh->delete_entry_by_vkey, qbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_param",
               __FILE__, __LINE__,
@@ -566,8 +566,8 @@
     }
   if (mysql_stmt_execute (dbh->delete_entry_by_vkey))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_execute",
               __FILE__, __LINE__,
@@ -585,7 +585,7 @@
 
 /**
  * Given a full (SELECT *) result set from gn071 table,
- * assemble it into a Datastore_Value representation.
+ * assemble it into a GNUNET_DatastoreValue representation.
  *
  * Call *without* holding the lock, but while within
  * mysql_thread_start/end.
@@ -593,10 +593,10 @@
  * @param result location where mysql_stmt_fetch stored the results
  * @return NULL on error
  */
-static Datastore_Value *
+static GNUNET_DatastoreValue *
 assembleDatum (MYSQL_BIND * result)
 {
-  Datastore_Value *datum;
+  GNUNET_DatastoreValue *datum;
   unsigned int contentSize;
   unsigned int type;
   unsigned int prio;
@@ -623,21 +623,21 @@
       (result[6].buffer_type != MYSQL_TYPE_LONGLONG) ||
       (!result[6].is_unsigned))
     {
-      GE_BREAK (NULL, 0);
+      GNUNET_GE_BREAK (NULL, 0);
       return NULL;              /* error */
     }
 
   contentSize = *(unsigned int *) result[0].buffer;
-  if (contentSize < sizeof (Datastore_Value))
+  if (contentSize < sizeof (GNUNET_DatastoreValue))
     return NULL;                /* error */
-  contentSize -= sizeof (Datastore_Value);
+  contentSize -= sizeof (GNUNET_DatastoreValue);
   type = *(unsigned int *) result[1].buffer;
   prio = *(unsigned int *) result[2].buffer;
   level = *(unsigned int *) result[3].buffer;
   exp = *(unsigned long long *) result[4].buffer;
   vkey = *(unsigned long long *) result[6].buffer;
-  datum = GNUNET_malloc (sizeof (Datastore_Value) + contentSize);
-  datum->size = htonl (contentSize + sizeof (Datastore_Value));
+  datum = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + contentSize);
+  datum->size = htonl (contentSize + sizeof (GNUNET_DatastoreValue));
   datum->type = htonl (type);
   datum->prio = htonl (prio);
   datum->anonymityLevel = htonl (level);
@@ -661,11 +661,11 @@
       GNUNET_free (datum);
       return NULL;
     }
-  GE_ASSERT (ectx, mysql_stmt_param_count (dbh->select_value) == 1);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (dbh->select_value) == 1);
   if (mysql_stmt_bind_param (dbh->select_value, qbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_param",
               __FILE__, __LINE__, mysql_stmt_error (dbh->select_value));
@@ -676,8 +676,8 @@
     }
   if (mysql_stmt_execute (dbh->select_value))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_execute",
               __FILE__, __LINE__, mysql_stmt_error (dbh->select_value));
@@ -685,11 +685,11 @@
       GNUNET_free (datum);
       return NULL;
     }
-  GE_ASSERT (ectx, mysql_stmt_field_count (dbh->select_value) == 1);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_field_count (dbh->select_value) == 1);
   if (mysql_stmt_bind_result (dbh->select_value, rbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_result",
               __FILE__, __LINE__, mysql_stmt_error (dbh->select_value));
@@ -702,8 +702,8 @@
       (rbind[0].buffer_length != contentSize) || (length != contentSize))
     {
       mysql_stmt_reset (dbh->select_value);
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_result",
               __FILE__, __LINE__, mysql_stmt_error (dbh->select_value));
@@ -724,7 +724,7 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 static int
-put (const GNUNET_HashCode * key, const Datastore_Value * value)
+put (const GNUNET_HashCode * key, const GNUNET_DatastoreValue * value)
 {
   unsigned long contentSize;
   unsigned long hashSize;
@@ -739,10 +739,10 @@
   GNUNET_EncName enc;
 #endif
 
-  if (((ntohl (value->size) < sizeof (Datastore_Value))) ||
-      ((ntohl (value->size) - sizeof (Datastore_Value)) > MAX_DATUM_SIZE))
+  if (((ntohl (value->size) < sizeof (GNUNET_DatastoreValue))) ||
+      ((ntohl (value->size) - sizeof (GNUNET_DatastoreValue)) > 
MAX_DATUM_SIZE))
     {
-      GE_BREAK (ectx, 0);
+      GNUNET_GE_BREAK (ectx, 0);
       return GNUNET_SYSERR;
     }
   GNUNET_mutex_lock (lock);
@@ -753,7 +753,7 @@
       GNUNET_mutex_unlock (lock);
       return GNUNET_SYSERR;
     }
-  contentSize = ntohl (value->size) - sizeof (Datastore_Value);
+  contentSize = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
   if (GNUNET_OK != insert_value (&value[1], contentSize, &vkey))
     {
       mysql_thread_end ();
@@ -767,12 +767,12 @@
   level = ntohl (value->anonymityLevel);
   expiration = GNUNET_ntohll (value->expirationTime);
 #if DEBUG_MYSQL
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (key, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "Storing in database block with type %u and key %s.\n", type, &enc);
 #endif
-  GE_ASSERT (ectx, mysql_stmt_param_count (dbh->insert_entry) == 7);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (dbh->insert_entry) == 7);
   memset (qbind, 0, sizeof (qbind));
   qbind[0].buffer_type = MYSQL_TYPE_LONG;       /* size */
   qbind[0].buffer = &size;
@@ -799,8 +799,8 @@
 
   if (mysql_stmt_bind_param (dbh->insert_entry, qbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_param",
               __FILE__, __LINE__, mysql_stmt_error (dbh->insert_entry));
@@ -813,8 +813,8 @@
 
   if (mysql_stmt_execute (dbh->insert_entry))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_execute",
               __FILE__, __LINE__, mysql_stmt_error (dbh->insert_entry));
@@ -852,9 +852,9 @@
                int is_asc,
                int is_prio,
                int is_migr,
-               unsigned int iter_select, Datum_Iterator iter, void *closure)
+               unsigned int iter_select, GNUNET_DatastoreValueIterator iter, 
void *closure)
 {
-  Datastore_Value *datum;
+  GNUNET_DatastoreValue *datum;
   int count;
   int ret;
   unsigned int last_prio;
@@ -873,7 +873,7 @@
   MYSQL_BIND rbind[7];
   MYSQL_STMT *stmt;
 
-  GE_ASSERT (NULL, ((is_migr == 1) || (is_migr == 0)));
+  GNUNET_GE_ASSERT (NULL, ((is_migr == 1) || (is_migr == 0)));
   if (is_asc)
     {
       last_prio = 0;
@@ -958,13 +958,13 @@
           return GNUNET_SYSERR;
         }
       stmt = dbh->iter[iter_select];
-      GE_ASSERT (ectx, mysql_stmt_param_count (stmt) <= 6);
-      GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 7);
+      GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (stmt) <= 6);
+      GNUNET_GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 7);
       now = GNUNET_get_time ();
       if (mysql_stmt_bind_param (stmt, qbind))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "mysql_stmt_bind_param",
                   __FILE__, __LINE__, mysql_stmt_error (stmt));
@@ -975,8 +975,8 @@
         }
       if (mysql_stmt_execute (stmt))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "mysql_stmt_execute",
                   __FILE__, __LINE__, mysql_stmt_error (stmt));
@@ -987,8 +987,8 @@
         }
       if (mysql_stmt_bind_result (stmt, rbind))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "mysql_stmt_bind_result",
                   __FILE__, __LINE__, mysql_stmt_error (stmt));
@@ -1047,7 +1047,7 @@
  *   iter is non-NULL and aborted the iteration
  */
 static int
-iterateLowPriority (unsigned int type, Datum_Iterator iter, void *closure)
+iterateLowPriority (unsigned int type, GNUNET_DatastoreValueIterator iter, 
void *closure)
 {
   return iterateHelper (type, GNUNET_YES, GNUNET_YES, GNUNET_NO, 0, iter,
                         closure);
@@ -1064,7 +1064,7 @@
  *   iter is non-NULL and aborted the iteration
  */
 static int
-iterateNonAnonymous (unsigned int type, Datum_Iterator iter, void *closure)
+iterateNonAnonymous (unsigned int type, GNUNET_DatastoreValueIterator iter, 
void *closure)
 {
   return iterateHelper (type, GNUNET_NO, GNUNET_YES, GNUNET_NO, 1, iter,
                         closure);
@@ -1081,7 +1081,7 @@
  *   iter is non-NULL and aborted the iteration
  */
 static int
-iterateExpirationTime (unsigned int type, Datum_Iterator iter, void *closure)
+iterateExpirationTime (unsigned int type, GNUNET_DatastoreValueIterator iter, 
void *closure)
 {
   return iterateHelper (type, GNUNET_YES, GNUNET_NO, GNUNET_NO, 2, iter,
                         closure);
@@ -1096,7 +1096,7 @@
  *   iter is non-NULL and aborted the iteration
  */
 static int
-iterateMigrationOrder (Datum_Iterator iter, void *closure)
+iterateMigrationOrder (GNUNET_DatastoreValueIterator iter, void *closure)
 {
   return iterateHelper (0, GNUNET_NO, GNUNET_NO, GNUNET_YES, 3, iter,
                         closure);
@@ -1111,7 +1111,7 @@
  *   iter is non-NULL and aborted the iteration
  */
 static int
-iterateAllNow (Datum_Iterator iter, void *closure)
+iterateAllNow (GNUNET_DatastoreValueIterator iter, void *closure)
 {
   return iterateHelper (0, GNUNET_YES, GNUNET_YES, GNUNET_NO, 0, iter,
                         closure);
@@ -1130,7 +1130,7 @@
  */
 static int
 get (const GNUNET_HashCode * query,
-     unsigned int type, Datum_Iterator iter, void *closure)
+     unsigned int type, GNUNET_DatastoreValueIterator iter, void *closure)
 {
   int count;
   int ret;
@@ -1142,7 +1142,7 @@
   unsigned long long expiration;
   unsigned long long vkey;
   unsigned long long last_vkey;
-  Datastore_Value *datum;
+  GNUNET_DatastoreValue *datum;
   GNUNET_HashCode key;
   unsigned long hashSize;
   MYSQL_BIND qbind[3];
@@ -1155,9 +1155,9 @@
     return iterateLowPriority (type, iter, closure);
 
 #if DEBUG_MYSQL
-  IF_GELOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
             GNUNET_hash_to_enc (query, &enc));
-  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           "MySQL looks for `%s' of type %u\n", &enc, type);
 #endif
 
@@ -1225,15 +1225,15 @@
             stmt = dbh->select_entry_by_hash;
         }
 
-      GE_ASSERT (ectx, mysql_stmt_param_count (stmt) <= 3);
+      GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (stmt) <= 3);
       if (iter == NULL)
-        GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 1);
+        GNUNET_GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 1);
       else
-        GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 7);
+        GNUNET_GE_ASSERT (ectx, mysql_stmt_field_count (stmt) == 7);
       if (mysql_stmt_bind_param (stmt, qbind))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "mysql_stmt_bind_param",
                   __FILE__, __LINE__, mysql_stmt_error (stmt));
@@ -1244,8 +1244,8 @@
         }
       if (mysql_stmt_execute (stmt))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "mysql_stmt_execute",
                   __FILE__, __LINE__, mysql_stmt_error (stmt));
@@ -1256,8 +1256,8 @@
         }
       if (mysql_stmt_bind_result (stmt, rbind))
         {
-          GE_LOG (ectx,
-                  GE_ERROR | GE_BULK | GE_USER,
+          GNUNET_GE_LOG (ectx,
+                  GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                   _("`%s' failed at %s:%d with error: %s\n"),
                   "mysql_stmt_bind_result",
                   __FILE__, __LINE__, mysql_stmt_error (stmt));
@@ -1338,11 +1338,11 @@
   qbind[3].buffer_type = MYSQL_TYPE_LONGLONG;
   qbind[3].is_unsigned = GNUNET_YES;
   qbind[3].buffer = &vkey;
-  GE_ASSERT (ectx, mysql_stmt_param_count (dbh->update_entry) == 4);
+  GNUNET_GE_ASSERT (ectx, mysql_stmt_param_count (dbh->update_entry) == 4);
   if (mysql_stmt_bind_param (dbh->update_entry, qbind))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error: %s\n"),
               "mysql_stmt_bind_param",
               __FILE__, __LINE__, mysql_stmt_error (dbh->update_entry));
@@ -1359,8 +1359,8 @@
   start = GNUNET_get_time ();
   if (mysql_stmt_execute (dbh->update_entry))
     {
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _("`%s' failed at %s:%d with error `%s' after %llums\n"),
               "mysql_stmt_execute",
               __FILE__, __LINE__,
@@ -1418,13 +1418,13 @@
   mysql_query (dbh->dbf, "DROP TABLE gn071");
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
       ok = GNUNET_NO;
     }
   mysql_query (dbh->dbf, "DROP TABLE gn072");
   if (mysql_error (dbh->dbf)[0])
     {
-      LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+      LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
       ok = GNUNET_NO;
     }
   if (ok == GNUNET_YES)
@@ -1434,11 +1434,11 @@
   GNUNET_mutex_unlock (lock);
 }
 
-SQstore_ServiceAPI *
-provide_module_sqstore_mysql (CoreAPIForApplication * capi)
+GNUNET_SQstore_ServiceAPI *
+provide_module_sqstore_mysql (GNUNET_CoreAPIForPlugins * capi)
 {
-  static SQstore_ServiceAPI api;
-  State_ServiceAPI *state;
+  static GNUNET_SQstore_ServiceAPI api;
+  GNUNET_State_ServiceAPI *state;
   char *cnffile;
   FILE *fp;
   struct passwd *pw;
@@ -1458,7 +1458,7 @@
 #ifndef WINDOWS
   pw = getpwuid (getuid ());
   if (!pw)
-    GE_DIE_STRERROR (ectx, GE_FATAL | GE_ADMIN | GE_IMMEDIATE, "getpwuid");
+    GNUNET_GE_DIE_STRERROR (ectx, GNUNET_GE_FATAL | GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE, "getpwuid");
   home_dir = GNUNET_strdup (pw->pw_dir);
 #else
   home_dir = (char *) GNUNET_malloc (_MAX_PATH + 1);
@@ -1468,18 +1468,18 @@
   cnffile = GNUNET_malloc (nX);
   GNUNET_snprintf (cnffile, nX, "%s/.my.cnf", home_dir);
   GNUNET_free (home_dir);
-  GC_get_configuration_value_filename (capi->cfg,
+  GNUNET_GC_get_configuration_value_filename (capi->cfg,
                                        "MYSQL", "CONFIG", cnffile, &home_dir);
   GNUNET_free (cnffile);
   cnffile = home_dir;
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("Trying to use file `%s' for MySQL configuration.\n"), cnffile);
   fp = FOPEN (cnffile, "r");
   if (!fp)
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_ADMIN | GE_BULK, "fopen", cnffile);
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "fopen", cnffile);
       if (stats != NULL)
         coreAPI->releaseService (stats);
       GNUNET_free (cnffile);
@@ -1496,8 +1496,8 @@
     {
       GNUNET_free (cnffile);
       GNUNET_free (dbh);
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("Failed to load MySQL database module.  Check that MySQL is 
running and configured properly!\n"));
       dbh = NULL;
@@ -1519,7 +1519,7 @@
           (!(sql_res = mysql_use_result (dbh->dbf))) ||
           (!(sql_row = mysql_fetch_row (sql_res))))
         {
-          LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);
+          LOG_MYSQL (GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_BULK, 
"mysql_query", dbh);
           content_size = 0;
           iclose (dbh);
         }
@@ -1527,14 +1527,14 @@
         {
           if ((mysql_num_fields (sql_res) != 1) || (sql_row[0] == NULL))
             {
-              GE_BREAK (ectx, mysql_num_fields (sql_res) == 1);
+              GNUNET_GE_BREAK (ectx, mysql_num_fields (sql_res) == 1);
               content_size = 0;
             }
           else
             {
               if (1 != SSCANF (sql_row[0], "%llu", &content_size))
                 {
-                  GE_BREAK (ectx, 0);
+                  GNUNET_GE_BREAK (ectx, 0);
                   content_size = 0;
                 }
             }
@@ -1570,7 +1570,7 @@
 void
 release_module_sqstore_mysql ()
 {
-  State_ServiceAPI *state;
+  GNUNET_State_ServiceAPI *state;
 
   iclose (dbh);
   GNUNET_free (dbh->cnffile);
@@ -1593,7 +1593,7 @@
  * Update mysql database module.
  */
 void
-update_module_sqstore_mysql (UpdateAPI * uapi)
+update_module_sqstore_mysql (GNUNET_UpdateAPI * uapi)
 {
   char *cnffile;
   FILE *fp;
@@ -1605,7 +1605,7 @@
 #ifndef WINDOWS
   pw = getpwuid (getuid ());
   if (!pw)
-    GE_DIE_STRERROR (ectx, GE_FATAL | GE_ADMIN | GE_IMMEDIATE, "getpwuid");
+    GNUNET_GE_DIE_STRERROR (ectx, GNUNET_GE_FATAL | GNUNET_GE_ADMIN | 
GNUNET_GE_IMMEDIATE, "getpwuid");
   home_dir = GNUNET_strdup (pw->pw_dir);
 #else
   home_dir = (char *) GNUNET_malloc (_MAX_PATH + 1);
@@ -1615,18 +1615,18 @@
   cnffile = GNUNET_malloc (nX);
   GNUNET_snprintf (cnffile, nX, "%s/.my.cnf", home_dir);
   GNUNET_free (home_dir);
-  GC_get_configuration_value_filename (uapi->cfg,
+  GNUNET_GC_get_configuration_value_filename (uapi->cfg,
                                        "MYSQL", "CONFIG", cnffile, &home_dir);
   GNUNET_free (cnffile);
   cnffile = home_dir;
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
+  GNUNET_GE_LOG (ectx,
+          GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
           _("Trying to use file `%s' for MySQL configuration.\n"), cnffile);
   fp = FOPEN (cnffile, "r");
   if (!fp)
     {
-      GE_LOG_STRERROR_FILE (ectx,
-                            GE_ERROR | GE_ADMIN | GE_BULK, "fopen", cnffile);
+      GNUNET_GE_LOG_STRERROR_FILE (ectx,
+                            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_BULK, "fopen", cnffile);
       GNUNET_free (cnffile);
       return;
     }
@@ -1641,8 +1641,8 @@
     {
       GNUNET_free (cnffile);
       GNUNET_free (dbh);
-      GE_LOG (ectx,
-              GE_ERROR | GE_BULK | GE_USER,
+      GNUNET_GE_LOG (ectx,
+              GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
               _
               ("Failed to load MySQL database module.  Check that MySQL is 
running and configured properly!\n"));
       dbh = NULL;

Modified: GNUnet/src/applications/sqstore_mysql/mysqltest.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest.c   2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest.c   2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -35,13 +35,13 @@
 
 static GNUNET_CronTime now;
 
-static Datastore_Value *
+static GNUNET_DatastoreValue *
 initValue (int i)
 {
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
 
-  value = GNUNET_malloc (sizeof (Datastore_Value) + 8 * i);
-  value->size = htonl (sizeof (Datastore_Value) + 8 * i);
+  value = GNUNET_malloc (sizeof (GNUNET_DatastoreValue) + 8 * i);
+  value->size = htonl (sizeof (GNUNET_DatastoreValue) + 8 * i);
   value->type = htonl (i);
   value->prio = htonl (i + 1);
   value->anonymityLevel = htonl (i);
@@ -52,12 +52,12 @@
 
 static int
 checkValue (const GNUNET_HashCode * key,
-            const Datastore_Value * val, void *closure,
+            const GNUNET_DatastoreValue * val, void *closure,
             unsigned long long uid)
 {
   int i;
   int ret;
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
 
   i = *(int *) closure;
   value = initValue (i);
@@ -78,7 +78,7 @@
 }
 
 static int
-iterateUp (const GNUNET_HashCode * key, const Datastore_Value * val,
+iterateUp (const GNUNET_HashCode * key, const GNUNET_DatastoreValue * val,
            int *closure, unsigned long long uid)
 {
   int ret;
@@ -90,7 +90,7 @@
 
 static int
 iterateDown (const GNUNET_HashCode * key,
-             const Datastore_Value * val, int *closure,
+             const GNUNET_DatastoreValue * val, int *closure,
              unsigned long long uid)
 {
   int ret;
@@ -102,7 +102,7 @@
 
 static int
 iterateDelete (const GNUNET_HashCode * key,
-               const Datastore_Value * val, void *closure,
+               const GNUNET_DatastoreValue * val, void *closure,
                unsigned long long uid)
 {
   return GNUNET_NO;
@@ -110,7 +110,7 @@
 
 static int
 iteratePriority (const GNUNET_HashCode * key,
-                 const Datastore_Value * val, SQstore_ServiceAPI * api,
+                 const GNUNET_DatastoreValue * val, GNUNET_SQstore_ServiceAPI 
* api,
                  unsigned long long uid)
 {
   api->update (uid, 4, 0);
@@ -119,7 +119,7 @@
 
 static int
 priorityCheck (const GNUNET_HashCode * key,
-               const Datastore_Value * val, int *closure,
+               const GNUNET_DatastoreValue * val, int *closure,
                unsigned long long uid)
 {
   int id;
@@ -133,7 +133,7 @@
 
 static int
 multipleCheck (const GNUNET_HashCode * key,
-               const Datastore_Value * val, Datastore_Value ** last,
+               const GNUNET_DatastoreValue * val, GNUNET_DatastoreValue ** 
last,
                unsigned long long uid)
 {
   if (*last != NULL)
@@ -153,9 +153,9 @@
  * Add testcode here!
  */
 static int
-test (SQstore_ServiceAPI * api)
+test (GNUNET_SQstore_ServiceAPI * api)
 {
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   GNUNET_HashCode key;
   unsigned long long oldSize;
   int i;
@@ -170,8 +170,8 @@
       GNUNET_free (value);
     }
   ASSERT (oldSize < api->getSize ());
-  ASSERT (256 == api->iterateLowPriority (ANY_BLOCK, NULL, NULL));
-  ASSERT (256 == api->iterateExpirationTime (ANY_BLOCK, NULL, NULL));
+  ASSERT (256 == api->iterateLowPriority (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, 
NULL, NULL));
+  ASSERT (256 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, 
NULL, NULL));
   for (i = 255; i >= 0; i--)
     {
       memset (&key, 256 - i, sizeof (GNUNET_HashCode));
@@ -188,31 +188,31 @@
     }
   ASSERT (oldSize > api->getSize ());
   i = 0;
-  ASSERT (128 == api->iterateLowPriority (ANY_BLOCK,
-                                          (Datum_Iterator) & iterateUp, &i));
+  ASSERT (128 == api->iterateLowPriority (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                          (GNUNET_DatastoreValueIterator) & 
iterateUp, &i));
   ASSERT (256 == i);
-  ASSERT (128 == api->iterateExpirationTime (ANY_BLOCK,
-                                             (Datum_Iterator) & iterateDown,
+  ASSERT (128 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                             (GNUNET_DatastoreValueIterator) & 
iterateDown,
                                              &i));
   ASSERT (0 == i);
-  ASSERT (128 == api->iterateExpirationTime (ANY_BLOCK,
-                                             (Datum_Iterator) & iterateDelete,
+  ASSERT (128 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                             (GNUNET_DatastoreValueIterator) & 
iterateDelete,
                                              api));
-  ASSERT (0 == api->iterateExpirationTime (ANY_BLOCK,
-                                           (Datum_Iterator) & iterateDown,
+  ASSERT (0 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                           (GNUNET_DatastoreValueIterator) & 
iterateDown,
                                            &i));
 
   i = 42;
   value = initValue (i);
   memset (&key, 256 - i, sizeof (GNUNET_HashCode));
   api->put (&key, value);
-  ASSERT (1 == api->iterateExpirationTime (ANY_BLOCK,
-                                           (Datum_Iterator) & priorityCheck,
+  ASSERT (1 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                           (GNUNET_DatastoreValueIterator) & 
priorityCheck,
                                            &i));
-  ASSERT (1 == api->iterateAllNow ((Datum_Iterator) & iteratePriority, api));
+  ASSERT (1 == api->iterateAllNow ((GNUNET_DatastoreValueIterator) & 
iteratePriority, api));
   i += 4;
-  ASSERT (1 == api->iterateExpirationTime (ANY_BLOCK,
-                                           (Datum_Iterator) & priorityCheck,
+  ASSERT (1 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                           (GNUNET_DatastoreValueIterator) & 
priorityCheck,
                                            &i));
   GNUNET_free (value);
 
@@ -222,12 +222,12 @@
   GNUNET_free (value);
 
   value = NULL;
-  ASSERT (2 == api->iterateExpirationTime (ANY_BLOCK,
-                                           (Datum_Iterator) & multipleCheck,
+  ASSERT (2 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY,
+                                           (GNUNET_DatastoreValueIterator) & 
multipleCheck,
                                            &value));
   GNUNET_free (value);
-  ASSERT (2 == api->iterateAllNow ((Datum_Iterator) & iterateDelete, api));
-  ASSERT (0 == api->iterateExpirationTime (ANY_BLOCK, NULL, NULL));
+  ASSERT (2 == api->iterateAllNow ((GNUNET_DatastoreValueIterator) & 
iterateDelete, api));
+  ASSERT (0 == api->iterateExpirationTime (GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY, 
NULL, NULL));
   api->drop ();
 
   return GNUNET_OK;
@@ -240,15 +240,15 @@
 int
 main (int argc, char *argv[])
 {
-  SQstore_ServiceAPI *api;
+  GNUNET_SQstore_ServiceAPI *api;
   int ok;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_CronManager *cron;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   cron = cron_create (NULL);
@@ -263,7 +263,7 @@
     ok = GNUNET_SYSERR;
   doneCore ();
   GNUNET_cron_destroy (cron);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (ok == GNUNET_SYSERR)
     return 1;
   return 0;

Modified: GNUnet/src/applications/sqstore_mysql/mysqltest2.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest2.c  2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest2.c  2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -124,18 +124,18 @@
 static GNUNET_CronTime start_time;
 
 static int
-putValue (SQstore_ServiceAPI * api, int i)
+putValue (GNUNET_SQstore_ServiceAPI * api, int i)
 {
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   size_t size;
   static GNUNET_HashCode key;
   static int ic;
 
   /* most content is 32k */
-  size = sizeof (Datastore_Value) + 32 * 1024;
+  size = sizeof (GNUNET_DatastoreValue) + 32 * 1024;
   if (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 16) == 0)  /* but some of 
it is less! */
     size =
-      sizeof (Datastore_Value) +
+      sizeof (GNUNET_DatastoreValue) +
       GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 32 * 1024);
   size = size - (size & 7);     /* always multiple of 8 */
 
@@ -149,7 +149,7 @@
   value->expirationTime =
     GNUNET_htonll (GNUNET_get_time () +
                    GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 1000));
-  memset (&value[1], i, size - sizeof (Datastore_Value));
+  memset (&value[1], i, size - sizeof (GNUNET_DatastoreValue));
   if (GNUNET_OK != api->put (&key, value))
     {
       GNUNET_free (value);
@@ -170,9 +170,9 @@
 
 static int
 iterateDelete (const GNUNET_HashCode * key,
-               const Datastore_Value * val, void *cls, unsigned long long uid)
+               const GNUNET_DatastoreValue * val, void *cls, unsigned long 
long uid)
 {
-  SQstore_ServiceAPI *api = cls;
+  GNUNET_SQstore_ServiceAPI *api = cls;
   static int dc;
 
   if (api->getSize () < MAX_SIZE)
@@ -193,7 +193,7 @@
  * Add testcode here!
  */
 static int
-test (SQstore_ServiceAPI * api)
+test (GNUNET_SQstore_ServiceAPI * api)
 {
   int i;
   int j;
@@ -249,15 +249,15 @@
 int
 main (int argc, char *argv[])
 {
-  SQstore_ServiceAPI *api;
+  GNUNET_SQstore_ServiceAPI *api;
   int ok;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_CronManager *cron;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   cron = cron_create (NULL);
@@ -273,7 +273,7 @@
     ok = GNUNET_SYSERR;
   doneCore ();
   GNUNET_cron_destroy (cron);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (ok == GNUNET_SYSERR)
     return 1;
   return 0;

Modified: GNUnet/src/applications/sqstore_mysql/mysqltest3.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest3.c  2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest3.c  2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -56,19 +56,19 @@
 static GNUNET_CronTime start_time;
 
 static int
-putValue (SQstore_ServiceAPI * api, int i)
+putValue (GNUNET_SQstore_ServiceAPI * api, int i)
 {
-  Datastore_Value *value;
+  GNUNET_DatastoreValue *value;
   size_t size;
   static GNUNET_HashCode key;
   static int ic;
 
   /* most content is 32k */
-  size = sizeof (Datastore_Value) + 32 * 1024;
+  size = sizeof (GNUNET_DatastoreValue) + 32 * 1024;
 
   if (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 16) == 0)  /* but some of 
it is less! */
     size =
-      sizeof (Datastore_Value) +
+      sizeof (GNUNET_DatastoreValue) +
       GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 32 * 1024);
   size = size - (size & 7);     /* always multiple of 8 */
 
@@ -83,7 +83,7 @@
   value->expirationTime =
     GNUNET_htonll (GNUNET_get_time () + 60 * GNUNET_CRON_HOURS +
                    GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 1000));
-  memset (&value[1], i, size - sizeof (Datastore_Value));
+  memset (&value[1], i, size - sizeof (GNUNET_DatastoreValue));
   if (GNUNET_OK != api->put (&key, value))
     {
       GNUNET_free (value);
@@ -99,7 +99,7 @@
 }
 
 static int
-iterateDummy (const GNUNET_HashCode * key, const Datastore_Value * val,
+iterateDummy (const GNUNET_HashCode * key, const GNUNET_DatastoreValue * val,
               void *cls, unsigned long long uid)
 {
   if (GNUNET_shutdown_test () == GNUNET_YES)
@@ -108,7 +108,7 @@
 }
 
 static int
-test (SQstore_ServiceAPI * api)
+test (GNUNET_SQstore_ServiceAPI * api)
 {
   int i;
   int j;
@@ -174,15 +174,15 @@
 int
 main (int argc, char *argv[])
 {
-  SQstore_ServiceAPI *api;
+  GNUNET_SQstore_ServiceAPI *api;
   int ok;
-  struct GC_Configuration *cfg;
+  struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_CronManager *cron;
 
-  cfg = GC_create ();
-  if (-1 == GC_parse_configuration (cfg, "check.conf"))
+  cfg = GNUNET_GC_create ();
+  if (-1 == GNUNET_GC_parse_configuration (cfg, "check.conf"))
     {
-      GC_free (cfg);
+      GNUNET_GC_free (cfg);
       return -1;
     }
   cron = cron_create (NULL);
@@ -198,7 +198,7 @@
     ok = GNUNET_SYSERR;
   doneCore ();
   GNUNET_cron_destroy (cron);
-  GC_free (cfg);
+  GNUNET_GC_free (cfg);
   if (ok == GNUNET_SYSERR)
     return 1;
   return 0;

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-11-25 03:50:33 UTC 
(rev 5754)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-11-25 12:04:45 UTC 
(rev 5755)
@@ -44,14 +44,14 @@
  * a failure of the command 'cmd' with the message given
  * by strerror(errno).
  */
-#define DIE_SQLITE(db, cmd) do { GE_LOG(ectx, GE_FATAL | GE_IMMEDIATE | 
GE_ADMIN, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, 
sqlite3_errmsg(db->dbh)); abort(); } while(0)
+#define DIE_SQLITE(db, cmd) do { GNUNET_GE_LOG(ectx, GNUNET_GE_FATAL | 
GNUNET_GE_IMMEDIATE | GNUNET_GE_ADMIN, _("`%s' failed at %s:%d with error: 
%s\n"), cmd, __FILE__, __LINE__, sqlite3_errmsg(db->dbh)); abort(); } while(0)
 
 /**
  * Log an error message at log-level 'level' that indicates
  * a failure of the command 'cmd' on file 'filename'
  * with the message given by strerror(errno).
  */
-#define LOG_SQLITE(db, level, cmd) do { GE_LOG(ectx, level, _("`%s' failed at 
%s:%d with error: %s\n"), cmd, __FILE__, __LINE__, sqlite3_errmsg(db->dbh)); } 
while(0)
+#define LOG_SQLITE(db, level, cm