Enlightenment CVS committal
Author : lordchaos
Project : e17
Module : apps/evfs
Dir : e17/apps/evfs/src/demo
Modified Files:
evfs_demo.c
Log Message:
* Check for libbz2 properly
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/evfs/src/demo/evfs_demo.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- evfs_demo.c 5 Nov 2005 06:03:27 -0000 1.19
+++ evfs_demo.c 6 Nov 2005 04:54:24 -0000 1.20
@@ -1,4 +1,5 @@
#include <evfs.h>
+#include <string.h>
static int mon_current =0; /*A demo of stopping monitoring, after 10 events*/
evfs_file_uri_path* dir_path;
@@ -44,27 +45,56 @@
}*/
- /*TODO : Free event*/
}
-int main() {
+int main(int argc, char** argv) {
evfs_file_uri_path* path;
-
char pathi[1024];
+ char *patharg = NULL;
+ char *cmd = NULL;
+ int i;
+
+ for(i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-u")) {
+ if (++i < argc) {
+ patharg = strdup(argv[i]);
+ } else {
+ printf("The option \"-u\" requires a valid
URI\n");
+ return 1;
+ }
+ } else {
+ if (!cmd) {
+ cmd = strdup(argv[i]);
+ } else {
+ printf("Error: Enter only one command.\n");
+ return 1;
+ }
+ }
+
+ }
printf("EVFS Demo system..\n");
+
+ /*Check if the user entered a command. TODO: Add command
functionality.*/
+ if (!cmd)
+ {
+ printf("You did not enter a command. Defaulting to DIR.\n");
+ cmd = strdup("DIR");
+ }
+
+ if (!patharg)
+ {
+ snprintf(pathi,1024,"posix://%s", getenv("HOME"));
+ }
+ else
+ {
+ snprintf(pathi,1024,"%s", patharg);
+ }
con = evfs_connect(&callback);
//path = evfs_parse_uri("posix:///dev/ttyS0");
-
-
- //snprintf(pathi,1024,"posix://%s", getenv("HOME"));
- //snprintf(pathi,1024,"smb:///gown/MythVideos/musicvideos");
-
//snprintf(pathi,1024,"posix:///usr/src/linux-2.6.13.1.tar.bz2#bzip2:///#tar:///");
- snprintf(pathi,1024,"ftp://user:[EMAIL PROTECTED]");
-
printf ("Listing dir: %s\n", pathi);
dir_path = evfs_parse_uri(pathi);
@@ -75,14 +105,8 @@
/*evfs_monitor_add(con, dir_path->files[0]);
-
evfs_client_file_copy(con, dir_path->files[0], NULL);*/
-
evfs_client_dir_list(con, dir_path->files[0]);
-
ecore_main_loop_begin();
-
evfs_disconnect(con);
-
- return 0;
}
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs