tGetDocIndex() function added, to return the URL of the locally-installed HTML … | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit a0831a1eb64a537baf102ef17d48d4001730b4bf | |
parent 595f93c2d9494c8687cde117f26f0d2ad609b169 | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 25 Feb 2002 18:43:19 +0000 | |
GetDocIndex() function added, to return the URL of the locally-installed | |
HTML documentation | |
Diffstat: | |
M src/dopewars.c | 20 ++++++++++++++++++++ | |
M src/dopewars.h | 1 + | |
2 files changed, 21 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/src/dopewars.c b/src/dopewars.c | |
t@@ -2249,6 +2249,26 @@ gboolean SetConfigValue(int GlobalIndex, int StructInde… | |
return TRUE; | |
} | |
+/* | |
+ * Returns the URL of the index file for the local HTML documentation. | |
+ */ | |
+gchar *GetDocIndex(void) | |
+{ | |
+ static gchar *indexfile = "index.html"; | |
+ gchar *path; | |
+#ifdef CYGWIN | |
+ gchar *bindir; | |
+ | |
+ bindir = GetBinaryDir(); | |
+ path = g_strdup_printf("file://%s\\%s", bindir, indexfile); | |
+ g_free(bindir); | |
+#else | |
+ path = g_strdup_printf("file://%s/doc/%s-%s/%s", DATADIR, PACKAGE, | |
+ VERSION, indexfile); | |
+#endif | |
+ return path; | |
+} | |
+ | |
/* | |
* Sets up data - such as the location of the high score file - to | |
* hard-coded internal values, and then processes the global and | |
diff --git a/src/dopewars.h b/src/dopewars.h | |
t@@ -421,4 +421,5 @@ void CloseLog(void); | |
gboolean IsConnectedPlayer(Player *play); | |
void BackupConfig(void); | |
void WriteConfigFile(void); | |
+gchar *GetDocIndex(void); | |
#endif |