Added getmointpoint command to test_physfs.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 07 Apr 2012 21:33:18 -0400
changeset 1282 62256a6a8e4e
parent 1281 cd136b8d3b1a
child 1283 8bcc48d243df
Added getmointpoint command to test_physfs.
docs/TODO.txt
test/test_physfs.c
--- a/docs/TODO.txt	Sun Mar 25 17:17:56 2012 -0400
+++ b/docs/TODO.txt	Sat Apr 07 21:33:18 2012 -0400
@@ -51,7 +51,6 @@
 - Multiple write dirs with mount points?
 - Replace code from SDL...
 - Should file enumeration return an error or set error state?
-- Need "getmountpoint" command in test_physfs.c ...
 - Write up a simple HOWTO on embedding physicsfs in another project.
 
 
--- a/test/test_physfs.c	Sun Mar 25 17:17:56 2012 -0400
+++ b/test/test_physfs.c	Sat Apr 07 21:33:18 2012 -0400
@@ -272,6 +272,17 @@
     return cmd_mount_internal(args, MNTTYPE_HANDLE);
 } /* cmd_mount_handle */
 
+static int cmd_getmountpoint(char *args)
+{
+    if (*args == '\"')
+    {
+        args++;
+        args[strlen(args) - 1] = '\0';
+    } /* if */
+
+    printf("Dir [%s] is mounted at [%s].\n", args, PHYSFS_getMountPoint(args));
+    return 1;
+} /* cmd_getmountpoint */
 
 static int cmd_removearchive(char *args)
 {
@@ -1172,6 +1183,7 @@
     { "setbuffer",      cmd_setbuffer,      1, "<bufferSize>"               },
     { "stressbuffer",   cmd_stressbuffer,   1, "<bufferSize>"               },
     { "crc32",          cmd_crc32,          1, "<fileToHash>"               },
+    { "getmountpoint",  cmd_getmountpoint,  1, "<dir>"                      },
     { NULL,             NULL,              -1, NULL                         }
 };