From 3e750a903ff5d2a7c2d08436c4b1779da203ee83 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 7 Apr 2012 21:33:18 -0400 Subject: [PATCH] Added getmointpoint command to test_physfs. --- docs/TODO.txt | 1 - test/test_physfs.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/TODO.txt b/docs/TODO.txt index 03539d2f..39abe02b 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -51,7 +51,6 @@ From old TODO.txt... - 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. diff --git a/test/test_physfs.c b/test/test_physfs.c index c1930a8a..68346e05 100644 --- a/test/test_physfs.c +++ b/test/test_physfs.c @@ -272,6 +272,17 @@ static int cmd_mount_handle(char *args) 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 @@ static const command_info commands[] = { "setbuffer", cmd_setbuffer, 1, "" }, { "stressbuffer", cmd_stressbuffer, 1, "" }, { "crc32", cmd_crc32, 1, "" }, + { "getmountpoint", cmd_getmountpoint, 1, "" }, { NULL, NULL, -1, NULL } };