gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20726 - gnunet-fuse/src/ext


From: gnunet
Subject: [GNUnet-SVN] r20726 - gnunet-fuse/src/ext
Date: Fri, 23 Mar 2012 16:58:42 +0100

Author: mauricio
Date: 2012-03-23 16:58:42 +0100 (Fri, 23 Mar 2012)
New Revision: 20726

Modified:
   gnunet-fuse/src/ext/gnunet-fuse.c
   gnunet-fuse/src/ext/gnunet-fuse.h
   gnunet-fuse/src/ext/readdir.c
Log:
-n.w.c homework to do


Modified: gnunet-fuse/src/ext/gnunet-fuse.c
===================================================================
--- gnunet-fuse/src/ext/gnunet-fuse.c   2012-03-23 15:45:03 UTC (rev 20725)
+++ gnunet-fuse/src/ext/gnunet-fuse.c   2012-03-23 15:58:42 UTC (rev 20726)
@@ -30,6 +30,7 @@
 #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
 
 #include "gnunet-fuse.h"
+#include <gnunet/gnunet_container_lib.h>
 
 static int ret;
 
@@ -147,6 +148,8 @@
 main (int argc, char *const *argv)
 {
 
+
+
        static const struct GNUNET_GETOPT_CommandLineOption options[] = {
        {'s', "source", "URI",
        gettext_noop ("Source you get the URI from"), 1,
@@ -156,6 +159,8 @@
                &GNUNET_GETOPT_set_string, &directory},
        GNUNET_GETOPT_OPTION_END };
 
+
+
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run2(argc,
                               argv,

Modified: gnunet-fuse/src/ext/gnunet-fuse.h
===================================================================
--- gnunet-fuse/src/ext/gnunet-fuse.h   2012-03-23 15:45:03 UTC (rev 20725)
+++ gnunet-fuse/src/ext/gnunet-fuse.h   2012-03-23 15:58:42 UTC (rev 20726)
@@ -46,7 +46,18 @@
 static char *directory;
 
 
+/* struct containing mapped Path, with URI and other Information like 
Attributes etc. */
 
+struct gnunet_fuse_path_uri
+{
+/* uri to corresponding path */
+       char* source;
+
+/*name of temporary file */
+       char* tf;
+};
+
+
 /* FUSE function files */
 int gn_getattr(const char *path, struct stat *stbuf);
 int gn_mknod(const char *path, mode_t mode, dev_t rdev);

Modified: gnunet-fuse/src/ext/readdir.c
===================================================================
--- gnunet-fuse/src/ext/readdir.c       2012-03-23 15:45:03 UTC (rev 20725)
+++ gnunet-fuse/src/ext/readdir.c       2012-03-23 15:58:42 UTC (rev 20726)
@@ -161,11 +161,14 @@
        struct GNUNET_FS_Uri *uri;
        char *emsg;
        enum GNUNET_FS_DownloadOptions options;
-       const char* w = "datei1";
-       char* filename = GNUNET_DISK_mktemp(w);
+       struct gnunet_fuse_path_uri *w;
 
-       uri = GNUNET_FS_uri_parse(source, &emsg);
+       w = GNUNET_malloc (sizeof (struct gnunet_fuse_path_uri));
 
+       w->tf = GNUNET_DISK_mktemp("gnunet-fuse-tempfile");
+       w->source = source;
+       uri = GNUNET_FS_uri_parse(w->source, &emsg);
+
        if (NULL == uri)
        {
          FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg);
@@ -194,7 +197,7 @@
            options |= GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY;
 
        struct GNUNET_FS_DownloadContext* dc;
-       dc = GNUNET_FS_download_start (fs, uri, NULL, filename, NULL, 0,
+       dc = GNUNET_FS_download_start (fs, uri, NULL, w->tf, NULL, 0,
                                                                
GNUNET_FS_uri_chk_get_file_size(uri),
                                                                anonymity, 
options, NULL, NULL);
 




reply via email to

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