gnunet-fuse

GNUnet file-sharing directory mounting via FUSE
Log | Files | Refs | Submodules | README | LICENSE

commit ca394e6a20eb1693602c5aa8cdba8538db59baea
parent 0da6061bb7712259e739fe03e86a16bd5ce114cf
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 25 Nov 2007 12:05:48 +0000

2nd round of renaming

Diffstat:
Mdirectory.c | 68++++++++++++++++++++++++++++++++++----------------------------------
Mdirent.c | 22+++++++++++-----------
Mfile.c | 18+++++++++---------
Mgetattr.c | 8++++----
Mgnfs.h | 10+++++-----
Mmain.c | 26+++++++++++++-------------
Mmkdir.c | 12++++++------
Mmknod.c | 16++++++++--------
Mopen.c | 4++--
Mread.c | 12++++++------
Mreaddir.c | 6+++---
Mrelease.c | 4++--
Mrename.c | 8++++----
Mrmdir.c | 2+-
Mspecial_file.c | 4++--
Mtruncate.c | 6+++---
Munlink.c | 2+-
Mutimens.c | 4++--
Mwrite.c | 6+++---
19 files changed, 119 insertions(+), 119 deletions(-)

diff --git a/directory.c b/directory.c @@ -47,7 +47,7 @@ static int tt(void *cls) return GNUNET_OK; } -static int dir_cache_cb(const ECRS_FileInfo *fi, const GNUNET_HashCode *key, +static int dir_cache_cb(const GNUNET_ECRS_FileInfo *fi, const GNUNET_HashCode *key, int isRoot, void *data) { struct dirent *de, *deparent = data; @@ -60,15 +60,15 @@ static int dir_cache_cb(const ECRS_FileInfo *fi, const GNUNET_HashCode *key, return GNUNET_OK; /* Figure out the filename and type from metadata */ - filename = ECRS_getFromMetaData(fi->meta, EXTRACTOR_FILENAME); + filename = GNUNET_ECRS_getFromMetaData(fi->meta, EXTRACTOR_FILENAME); if(filename == NULL) { - GE_LOG(ectx, GE_BULK | GE_USER | GE_WARNING, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GWARNING, "%s: dirent has no filename\n", __FUNCTION__); return GNUNET_OK; } len = strlen(filename); - if(ECRS_isDirectory(fi->meta) == GNUNET_YES) + if(GNUNET_ECRS_isDirectory(fi->meta) == GNUNET_YES) { if(filename[len - 1] == '/' || filename[len - 1] == '\\') filename[len - 1] = '\0'; @@ -103,7 +103,7 @@ static int dir_cache_cb(const ECRS_FileInfo *fi, const GNUNET_HashCode *key, /* Add it to the directory's list (steals our ref)*/ GNUNET_mutex_lock(de->de_path_mutex); - GE_ASSERT(ectx, + GNUNET_GASSERT(ectx, !g_hash_table_lookup(deparent->de_dir_hash, de->de_basename)); g_hash_table_replace(deparent->de_dir_hash, de->de_basename, de); GNUNET_mutex_unlock(de->de_path_mutex); @@ -116,19 +116,19 @@ static int dir_cache_cb(const ECRS_FileInfo *fi, const GNUNET_HashCode *key, static int directory_cache_locked(struct dirent *de) { - struct ECRS_MetaData *md; + struct GNUNET_ECRS_MetaData *md; void *mem; int ret; guint64 len; - len = ECRS_fileSize(de->de_fi.uri); + len = GNUNET_ECRS_fileSize(de->de_fi.uri); mem = GNUNET_malloc(len); - ret = ECRS_downloadPartialFile(ectx, cfg, de->de_fi.uri, + ret = GNUNET_ECRS_downloadPartialFile(ectx, cfg, de->de_fi.uri, "/dev/null", 0, len, anonymity, GNUNET_YES, dpcb, mem, tt, NULL); if(ret != GNUNET_OK) { - GE_LOG(ectx, GE_BULK | GE_USER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GERROR, "%s: failed to download directory\n", __FUNCTION__); GNUNET_free(mem); @@ -136,11 +136,11 @@ static int directory_cache_locked(struct dirent *de) } de->de_dir_hash = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)gn_dirent_put); - ECRS_listDirectory(ectx, mem, len, &md, dir_cache_cb, de); + GNUNET_ECRS_listDirectory(ectx, mem, len, &md, dir_cache_cb, de); GNUNET_free(mem); - ECRS_freeMetaData(md); + GNUNET_ECRS_freeMetaData(md); de->de_cached = 1; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: cached %d entries\n", __FUNCTION__, g_hash_table_size(de->de_dir_hash)); return 0; @@ -224,7 +224,7 @@ int gn_directory_insert(struct dirent *de, struct dirent *dechild) { if(directory_cache_locked(de) == -1) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: failed to cache parent dir\n", __FUNCTION__); gn_unlock_path(de, GN_UNLOCK_CLEAN); @@ -265,7 +265,7 @@ int gn_directory_remove(struct dirent *de, struct dirent *dechild) { if(directory_cache_locked(de) == -1) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: failed to cache parent dir\n", __FUNCTION__); goto out_err; @@ -277,7 +277,7 @@ int gn_directory_remove(struct dirent *de, struct dirent *dechild) if(!g_hash_table_remove(de->de_dir_hash, dechild->de_basename)) { GNUNET_mutex_unlock(dechild->de_path_mutex); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: not found in dir_hash\n", __FUNCTION__); goto out_err; @@ -306,7 +306,7 @@ static void upcb(guint64 totalBytes, guint64 completedBytes, GNUNET_CronTime eta struct dir_upload_data { - ECRS_FileInfo *fis; + GNUNET_ECRS_FileInfo *fis; int count; int failed; }; @@ -342,8 +342,8 @@ static gboolean dir_upload_callback(gpointer key, gpointer value, gpointer data) } } } - d->fis[d->count].uri = ECRS_dupUri(de->de_fi.uri); - d->fis[d->count].meta = ECRS_dupMetaData(de->de_fi.meta); + d->fis[d->count].uri = GNUNET_ECRS_dupUri(de->de_fi.uri); + d->fis[d->count].meta = GNUNET_ECRS_dupMetaData(de->de_fi.meta); d->count++; out: GNUNET_semaphore_up(de->de_sema); @@ -358,7 +358,7 @@ int gn_directory_upload_locked(struct dirent *de) int i, ret, fd; char *buf, filename[] = GN_MKSTEMP_FILE; guint64 len; - struct ECRS_URI *uri; + struct GNUNET_ECRS_URI *uri; struct dir_upload_data d; /* We may be already clean */ @@ -372,24 +372,24 @@ int gn_directory_upload_locked(struct dirent *de) g_hash_table_find(de->de_dir_hash, dir_upload_callback, &d); if(d.failed) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: failed\n", __FUNCTION__); return -1; } - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: creating dir of %d elements\n", __FUNCTION__, d.count); - ret = ECRS_createDirectory(ectx, &buf, &len, d.count, d.fis, + ret = GNUNET_ECRS_createDirectory(ectx, &buf, &len, d.count, d.fis, de->de_fi.meta); for(i = 0; i < d.count; i++) { - ECRS_freeUri(d.fis[i].uri); - ECRS_freeMetaData(d.fis[i].meta); + GNUNET_ECRS_freeUri(d.fis[i].uri); + GNUNET_ECRS_freeMetaData(d.fis[i].meta); } GNUNET_free(d.fis); if(ret == GNUNET_SYSERR) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, - "%s: ECRS_createDirectory failed\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, + "%s: GNUNET_ECRS_createDirectory failed\n", __FUNCTION__); return -1; } @@ -398,30 +398,30 @@ int gn_directory_upload_locked(struct dirent *de) fd = mkstemp(filename); if(fd == -1) { - GE_LOG_STRERROR_FILE(ectx, GE_BULK | GE_DEVELOPER - | GE_ERROR, "mkstemp", filename); + GNUNET_GLOG_STRERROR_FILE(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER + | GNUNET_GERROR, "mkstemp", filename); return -1; } write(fd, buf, len); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: wrote to %lld bytes to '%s'\n", __FUNCTION__, len, filename); - ret = ECRS_uploadFile(ectx, cfg, filename, GNUNET_NO, anonymity, priority, + ret = GNUNET_ECRS_uploadFile(ectx, cfg, filename, GNUNET_NO, anonymity, priority, -1, upcb, NULL, tt, NULL, &uri); close(fd); unlink(filename); if(ret == GNUNET_SYSERR) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, - "%s: ECRS_uploadFile failed\n", __FUNCTION__); + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, + "%s: GNUNET_ECRS_uploadFile failed\n", __FUNCTION__); return -1; } - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: done\n", __FUNCTION__); /* Update the dirent info with our new URI and mark it clean */ if(de->de_fi.uri != NULL) - ECRS_freeUri(de->de_fi.uri); + GNUNET_ECRS_freeUri(de->de_fi.uri); de->de_fi.uri = uri; de->de_dirty = 0; return 0; diff --git a/dirent.c b/dirent.c @@ -71,9 +71,9 @@ void gn_dirent_put(struct dirent *de) GNUNET_mutex_destroy(de->de_refs_mutex); GNUNET_semaphore_destroy(de->de_sema); if(de->de_fi.uri != NULL) - ECRS_freeUri(de->de_fi.uri); + GNUNET_ECRS_freeUri(de->de_fi.uri); if(de->de_fi.meta != NULL) - ECRS_freeMetaData(de->de_fi.meta); + GNUNET_ECRS_freeMetaData(de->de_fi.meta); if(de->de_type == DE_DIR) { if(de->de_cached) @@ -125,8 +125,8 @@ void gn_dirent_cache_init(void) /* * Create a new dirent with a reference, path and uri are copied */ -struct dirent *gn_dirent_new(const gchar *path, struct ECRS_URI *uri, - struct ECRS_MetaData *meta, gchar type) +struct dirent *gn_dirent_new(const gchar *path, struct GNUNET_ECRS_URI *uri, + struct GNUNET_ECRS_MetaData *meta, gchar type) { struct dirent *de; @@ -142,7 +142,7 @@ struct dirent *gn_dirent_new(const gchar *path, struct ECRS_URI *uri, { de->de_dirty = 0; de->de_cached = 0; - de->de_fi.uri = ECRS_dupUri(uri); + de->de_fi.uri = GNUNET_ECRS_dupUri(uri); } else { @@ -163,9 +163,9 @@ struct dirent *gn_dirent_new(const gchar *path, struct ECRS_URI *uri, } } if(meta == NULL) - de->de_fi.meta = ECRS_createMetaData(); + de->de_fi.meta = GNUNET_ECRS_createMetaData(); else - de->de_fi.meta = ECRS_dupMetaData(meta); + de->de_fi.meta = GNUNET_ECRS_dupMetaData(meta); return de; } @@ -180,7 +180,7 @@ void gn_dirent_cache_insert(struct dirent *de) if(GNUNET_semaphore_down(path_sema, GNUNET_YES) == GNUNET_SYSERR) return; GNUNET_mutex_lock(de->de_path_mutex); - GE_ASSERT(ectx, !g_hash_table_lookup(path_hash, de->de_path)); + GNUNET_GASSERT(ectx, !g_hash_table_lookup(path_hash, de->de_path)); g_hash_table_replace(path_hash, de->de_path, de); GNUNET_mutex_unlock(de->de_path_mutex); gn_dirent_ref(de); @@ -298,7 +298,7 @@ struct dirent *gn_dirent_find(const gchar *path) { struct dirent *de = NULL; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: called for '%s'\n", __FUNCTION__, path); if(gn_path_foreach(path, dirent_find_callback, &de) == -1) { @@ -332,7 +332,7 @@ int gn_lock_path(struct dirent *de) if(gn_path_foreach(path, lock_path_callback, &detmp) == -1) { GNUNET_free(path); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: failed!\n", __FUNCTION__); /* Back out all the locks we aquired */ if(detmp != NULL) @@ -376,7 +376,7 @@ int gn_unlock_path(struct dirent *de, int dirty) if(gn_path_foreach(path, unlock_path_callback, &d) == -1) { GNUNET_free(path); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: failed!\n", __FUNCTION__); return -1; } diff --git a/file.c b/file.c @@ -74,18 +74,18 @@ int gn_file_download_locked(struct dirent *de) de->de_fd = mkstemp(filename); if(de->de_fd == -1) { - GE_LOG_STRERROR_FILE(ectx, GE_BULK | GE_DEVELOPER - | GE_ERROR, "mkstemp", filename); + GNUNET_GLOG_STRERROR_FILE(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER + | GNUNET_GERROR, "mkstemp", filename); return -1; } de->de_filename = GNUNET_strdup(filename); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: downloading '%s'\n", __FUNCTION__, de->de_filename); - if(ECRS_downloadFile(ectx, cfg, de->de_fi.uri, filename, anonymity, + if(GNUNET_ECRS_downloadFile(ectx, cfg, de->de_fi.uri, filename, anonymity, dpcb, NULL, tt, NULL) == GNUNET_SYSERR) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: download failed\n", __FUNCTION__); close(de->de_fd); unlink(de->de_filename); @@ -100,21 +100,21 @@ int gn_file_download_locked(struct dirent *de) int gn_file_upload_locked(struct dirent *de) { - struct ECRS_URI *uri; + struct GNUNET_ECRS_URI *uri; /* If we're not dirty then we're done */ if(!de->de_dirty) return 0; - if(ECRS_uploadFile(ectx, cfg, de->de_filename, GNUNET_NO, anonymity, priority, + if(GNUNET_ECRS_uploadFile(ectx, cfg, de->de_filename, GNUNET_NO, anonymity, priority, -1, upcb, NULL, tt, NULL, &uri) == GNUNET_SYSERR) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GERROR, "%s: upload failed\n", __FUNCTION__); return -1; } if(de->de_fi.uri != NULL) - ECRS_freeUri(de->de_fi.uri); + GNUNET_ECRS_freeUri(de->de_fi.uri); de->de_fi.uri = uri; de->de_cached = 0; de->de_dirty = 0; diff --git a/getattr.c b/getattr.c @@ -29,7 +29,7 @@ int gn_getattr(const char *path, struct stat *stbuf) struct dirent *de; int ret = 0; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Check to see if this is a special file */ @@ -47,7 +47,7 @@ int gn_getattr(const char *path, struct stat *stbuf) de = gn_dirent_find(path); if(de == NULL) { - GE_LOG(ectx, GE_BULK | GE_USER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GDEBUG, "%s: could not find path '%s'\n", __FUNCTION__, path); return -ENOENT; } @@ -64,7 +64,7 @@ int gn_getattr(const char *path, struct stat *stbuf) if(ret == -1) { ret = -errno; - GE_LOG_STRERROR(ectx, GE_BULK | GE_USER | GE_ERROR, + GNUNET_GLOG_STRERROR(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GERROR, "stat"); goto out; } @@ -76,7 +76,7 @@ int gn_getattr(const char *path, struct stat *stbuf) stbuf->st_mode |= de->de_type == DE_DIR ? S_IFDIR : S_IFREG; stbuf->st_nlink = 1; if(de->de_fi.uri != NULL) - stbuf->st_size = ECRS_fileSize(de->de_fi.uri); + stbuf->st_size = GNUNET_ECRS_fileSize(de->de_fi.uri); else stbuf->st_size = 0; out: diff --git a/gnfs.h b/gnfs.h @@ -59,7 +59,7 @@ struct dirent /* Dirty entires have been changed and not published in GNUnet (implies * cached) */ gboolean de_dirty; - ECRS_FileInfo de_fi; + GNUNET_ECRS_FileInfo de_fi; union { /* For cached directories */ @@ -75,8 +75,8 @@ struct dirent typedef gboolean (*gn_dir_foreach_callback)(struct dirent *de, void *data); -extern struct GC_Configuration *cfg; -extern struct GE_Context *ectx; +extern struct GNUNET_GC_Configuration *cfg; +extern struct GNUNET_GContext *ectx; extern int closing; extern unsigned int anonymity; extern unsigned int priority; @@ -84,8 +84,8 @@ extern int uri_files; extern struct dirent *root_de; /* dirent.c */ -struct dirent *gn_dirent_new(const gchar *path, struct ECRS_URI *uri, - struct ECRS_MetaData *meta, gchar type); +struct dirent *gn_dirent_new(const gchar *path, struct GNUNET_ECRS_URI *uri, + struct GNUNET_ECRS_MetaData *meta, gchar type); struct dirent *gn_dirent_get(const gchar *path); void gn_dirent_ref(struct dirent *de); void gn_dirent_put(struct dirent *de); diff --git a/main.c b/main.c @@ -30,8 +30,8 @@ #include "gnfs.h" #include "gettext.h" -struct GC_Configuration *cfg; -struct GE_Context *ectx; +struct GNUNET_GC_Configuration *cfg; +struct GNUNET_GContext *ectx; static char *cfgFilename = DEFAULT_CLIENT_CONFIG_FILE; static char *cfgLogfile = "/tmp/gnunet_fuse.log"; @@ -108,7 +108,7 @@ static struct GNUNET_CommandLineOption gn_options[] = int main(int argc, char **argv) { int i, ret; - struct ECRS_URI *uri; + struct GNUNET_ECRS_URI *uri; char *buf; /* Initialize fuse options */ @@ -129,8 +129,8 @@ int main(int argc, char **argv) /* Set up log file */ GNUNET_disk_directory_create_for_file(ectx, cfgLogfile); - ectx = GE_create_context_logfile(ectx, GE_ALL, cfgLogfile, NULL, GNUNET_YES, 0); - GE_setDefaultContext(ectx); + ectx = GNUNET_Gcreate_context_logfile(ectx, GNUNET_GALL, cfgLogfile, NULL, GNUNET_YES, 0); + GNUNET_GsetDefaultContext(ectx); /* There should be exactly two extra arguments */ if(i + 2 != argc) @@ -163,7 +163,7 @@ int main(int argc, char **argv) uribuf = GNUNET_malloc(len + 1); read(root_fd, uribuf, len); uribuf[len] = '\0'; - uri = ECRS_stringToUri(ectx, uribuf); + uri = GNUNET_ECRS_stringToUri(ectx, uribuf); GNUNET_free(uribuf); if(uri == NULL) { @@ -171,22 +171,22 @@ int main(int argc, char **argv) ret = -1; goto out_close_root; } - if(!ECRS_isFileUri(uri)) + if(!GNUNET_ECRS_isFileUri(uri)) { - struct ECRS_URI *new_uri; + struct GNUNET_ECRS_URI *new_uri; - new_uri = ECRS_getContentUri(uri); + new_uri = GNUNET_ECRS_getContentUri(uri); if(new_uri == NULL) { printf("URI cannot be mounted\n"); ret = -1; goto out_close_root; } - ECRS_freeUri(uri); + GNUNET_ECRS_freeUri(uri); uri = new_uri; } root_de = gn_dirent_new(G_DIR_SEPARATOR_S, uri, NULL, DE_DIR); - ECRS_freeUri(uri); + GNUNET_ECRS_freeUri(uri); } else { @@ -209,9 +209,9 @@ int main(int argc, char **argv) fuse_argc++; fuse_argv[fuse_argc] = NULL; - GE_LOG(ectx, GE_BULK | GE_USER | GE_DEBUG, "calling fuse_main\n"); + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GDEBUG, "calling fuse_main\n"); ret = fuse_main(fuse_argc, fuse_argv, &fops, NULL); - GE_LOG(ectx, GE_BULK | GE_USER | GE_DEBUG, "fuse_main returned\n"); + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GDEBUG, "fuse_main returned\n"); /* Save root uri */ closing = 1; diff --git a/mkdir.c b/mkdir.c @@ -28,12 +28,12 @@ int gn_mkdir(const char *path, mode_t mode) { struct dirent *de, *newde; - struct ECRS_MetaData *meta; + struct GNUNET_ECRS_MetaData *meta; char *parent, *file; int ret; (void)mode; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Check for special file */ @@ -56,11 +56,11 @@ int gn_mkdir(const char *path, mode_t mode) GNUNET_free(parent); return -ENOENT; } - meta = ECRS_createMetaData(); - ECRS_addToMetaData(meta, EXTRACTOR_FILENAME, file); - ECRS_addToMetaData(meta, EXTRACTOR_MIMETYPE, GNUNET_DIRECTORY_MIME); + meta = GNUNET_ECRS_createMetaData(); + GNUNET_ECRS_addToMetaData(meta, EXTRACTOR_FILENAME, file); + GNUNET_ECRS_addToMetaData(meta, EXTRACTOR_MIMETYPE, GNUNET_DIRECTORY_MIME); newde = gn_dirent_new(path, NULL, meta, DE_DIR); - ECRS_freeMetaData(meta); + GNUNET_ECRS_freeMetaData(meta); ret = gn_directory_insert(de, newde); gn_dirent_put(de); gn_dirent_put(newde); diff --git a/mknod.c b/mknod.c @@ -28,13 +28,13 @@ int gn_mknod(const char *path, mode_t mode, dev_t rdev) { struct dirent *de, *newde; - struct ECRS_URI *uri; - struct ECRS_MetaData *meta; + struct GNUNET_ECRS_URI *uri; + struct GNUNET_ECRS_MetaData *meta; char *parent, *file; int ret; (void)rdev; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* We only support regular files */ @@ -61,13 +61,13 @@ int gn_mknod(const char *path, mode_t mode, dev_t rdev) GNUNET_free(parent); return -ENOENT; } - uri = ECRS_stringToUri(ectx, GN_EMPTY_FILE_URI); - meta = ECRS_createMetaData(); - ECRS_addToMetaData(meta, EXTRACTOR_FILENAME, file); + uri = GNUNET_ECRS_stringToUri(ectx, GN_EMPTY_FILE_URI); + meta = GNUNET_ECRS_createMetaData(); + GNUNET_ECRS_addToMetaData(meta, EXTRACTOR_FILENAME, file); GNUNET_free(parent); newde = gn_dirent_new(path, uri, meta, DE_FILE); - ECRS_freeMetaData(meta); - ECRS_freeUri(uri); + GNUNET_ECRS_freeMetaData(meta); + GNUNET_ECRS_freeUri(uri); ret = gn_directory_insert(de, newde); gn_dirent_put(de); gn_dirent_put(newde); diff --git a/open.c b/open.c @@ -29,7 +29,7 @@ int gn_open(const char *path, struct fuse_file_info *fi) { struct dirent *de; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Check for special file */ @@ -48,7 +48,7 @@ int gn_open(const char *path, struct fuse_file_info *fi) return -ENOENT; if(de->de_type != DE_FILE) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: not a file\n", __FUNCTION__); gn_dirent_put(de); return -ENOENT; diff --git a/read.c b/read.c @@ -87,7 +87,7 @@ int gn_read(const char *path, char *buf, size_t size, off_t offset, (void)fi; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: called for '%s' %u bytes %lld offset\n", __FUNCTION__, path, size, offset); @@ -114,13 +114,13 @@ int gn_read(const char *path, char *buf, size_t size, off_t offset, de = gn_dirent_find(path); if(de == NULL) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: file not found\n", __FUNCTION__); return -ENOENT; } if(de->de_type != DE_FILE) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: not a file\n", __FUNCTION__); size = -ENOENT; goto out; @@ -139,7 +139,7 @@ int gn_read(const char *path, char *buf, size_t size, off_t offset, size = slen; goto out_sema_up; } - len = ECRS_fileSize(de->de_fi.uri); + len = GNUNET_ECRS_fileSize(de->de_fi.uri); if((guint64)offset >= len) { size = 0; @@ -152,11 +152,11 @@ int gn_read(const char *path, char *buf, size_t size, off_t offset, d.buf = buf; d.size = size; d.offset = offset; - ret = ECRS_downloadPartialFile(ectx, cfg, de->de_fi.uri, "/dev/null", + ret = GNUNET_ECRS_downloadPartialFile(ectx, cfg, de->de_fi.uri, "/dev/null", offset, size, anonymity, GNUNET_YES, dpcb, &d, tt, NULL); if(ret != GNUNET_OK) { - GE_LOG(ectx, GE_BULK | GE_USER | GE_ERROR, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GERROR, "%s: failed to download file\n", __FUNCTION__); size = -ENODATA; } diff --git a/readdir.c b/readdir.c @@ -69,18 +69,18 @@ int gn_readdir(const char *path, void *buf, fuse_fill_dir_t filler, (void)offset; (void)fi; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "readdir for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "readdir for '%s'\n", path); de = gn_dirent_find(path); if(de == NULL) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "readdir: file not found\n"); return -ENOENT; } if(de->de_type != DE_DIR) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "readdir: not a directory\n"); gn_dirent_put(de); ret = -ENOENT; diff --git a/release.c b/release.c @@ -27,7 +27,7 @@ int gn_release(const char *path, struct fuse_file_info *fi) int dirty = GN_UNLOCK_CLEAN; (void)fi; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Don't do anything for special files */ @@ -40,7 +40,7 @@ int gn_release(const char *path, struct fuse_file_info *fi) return 0; if(de->de_type != DE_FILE) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: not a file\n", __FUNCTION__); gn_dirent_put(de); return 0; diff --git a/rename.c b/rename.c @@ -40,7 +40,7 @@ int gn_rename(const char *from, const char *to) char *from_parent, *from_file, *to_parent, *to_file; int ret = 0, empty = 1; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: '%s' to '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: '%s' to '%s'\n", __FUNCTION__, from, to); /* Check for special file */ @@ -88,7 +88,7 @@ int gn_rename(const char *from, const char *to) } gn_directory_remove(from_parent_de, from_de); gn_dirent_put(from_parent_de); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: removed '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: removed '%s'\n", __FUNCTION__, from); /* Modify our path */ @@ -113,7 +113,7 @@ int gn_rename(const char *from, const char *to) ret = -EIO; goto out; } - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: removed '%s'\n", __FUNCTION__, to); } if(gn_directory_insert(to_parent_de, from_de) == -1) @@ -123,7 +123,7 @@ int gn_rename(const char *from, const char *to) goto out; } gn_dirent_put(to_parent_de); - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: inserted '%s'\n", __FUNCTION__, to); out: diff --git a/rmdir.c b/rmdir.c @@ -40,7 +40,7 @@ int gn_rmdir(const char *path) char *parent, *file; int ret, empty = 1; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Check for special file */ diff --git a/special_file.c b/special_file.c @@ -104,7 +104,7 @@ char *gn_get_special_file(const char *path) goto out; } } - buf = ECRS_uriToString(de->de_fi.uri); + buf = GNUNET_ECRS_uriToString(de->de_fi.uri); GNUNET_semaphore_up(de->de_sema); gn_dirent_put(de); buf = GNUNET_realloc(buf, strlen(buf) + 2); @@ -147,7 +147,7 @@ char *gn_get_special_file(const char *path) } } } - buf = ECRS_uriToString(de->de_fi.uri); + buf = GNUNET_ECRS_uriToString(de->de_fi.uri); GNUNET_semaphore_up(de->de_sema); gn_dirent_put(de); buf = GNUNET_realloc(buf, strlen(buf) + 2); diff --git a/truncate.c b/truncate.c @@ -28,7 +28,7 @@ int gn_truncate(const char *path, off_t size) struct dirent *de; int ret = 0, dirty = GN_UNLOCK_CLEAN; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: called for '%s' %lld bytes\n", __FUNCTION__, path, size); /* Check for special file */ @@ -39,13 +39,13 @@ int gn_truncate(const char *path, off_t size) de = gn_dirent_find(path); if(de == NULL) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: file not found\n", __FUNCTION__); return -ENOENT; } if(de->de_type != DE_FILE) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: not a file\n", __FUNCTION__); ret = -EISDIR; goto out; diff --git a/unlink.c b/unlink.c @@ -31,7 +31,7 @@ int gn_unlink(const char *path) char *parent, *file; int ret; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Check for special file */ diff --git a/utimens.c b/utimens.c @@ -31,7 +31,7 @@ int gn_utimens(const char *path, const struct timespec ts[2]) struct timeval tv[2]; int ret = 0; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, "%s: for '%s'\n", + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: for '%s'\n", __FUNCTION__, path); /* Check to see if this is a special file */ @@ -57,7 +57,7 @@ int gn_utimens(const char *path, const struct timespec ts[2]) if(ret == -1) { ret = -errno; - GE_LOG_STRERROR(ectx, GE_BULK | GE_USER | GE_ERROR, + GNUNET_GLOG_STRERROR(ectx, GNUNET_GBULK | GNUNET_GUSER | GNUNET_GERROR, "utimes"); goto out; } diff --git a/write.c b/write.c @@ -33,7 +33,7 @@ int gn_write(const char *path, const char *buf, size_t size, off_t offset, (void)fi; - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: called for '%s' %d bytes\n", __FUNCTION__, path, size); /* Check for special file */ @@ -44,13 +44,13 @@ int gn_write(const char *path, const char *buf, size_t size, off_t offset, de = gn_dirent_find(path); if(de == NULL) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: file not found\n", __FUNCTION__); return -ENOENT; } if(de->de_type != DE_FILE) { - GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG, + GNUNET_GLOG(ectx, GNUNET_GBULK | GNUNET_GDEVELOPER | GNUNET_GDEBUG, "%s: not a file\n", __FUNCTION__); size = -ENOENT; goto out;