summaryrefslogtreecommitdiff
path: root/file.cc
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-02-20 13:26:36 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-02-23 18:42:27 +0000
commit35c58a11cc2807f7d19cb94c24ba9eca297e8abe (patch)
tree3c2b958566e59c689758e93ffdbfb82a8a682aa3 /file.cc
parent49152eec37f47cddd355acd4ddfb1653923b62d1 (diff)
Use correct path to chm file when installed
... but still locate the chm file when being run uninstalled Note that we need the native Windows path to the installed chm file, as we need to pass it to the native HtmlHelp() function
Diffstat (limited to 'file.cc')
-rw-r--r--file.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/file.cc b/file.cc
new file mode 100644
index 0000000..032ddea
--- /dev/null
+++ b/file.cc
@@ -0,0 +1,38 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+#include "file.h"
+
+BOOL FileExists(const char *filename)
+{
+ FILE *file;
+ file = fopen(filename, "r");
+ if (NULL == file)
+ return FALSE;
+ fclose (file);
+ return TRUE;
+}