diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-12-16 09:09:41 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-16 16:20:52 -0800 |
commit | ca8aee4701f95a758f93033eb88ca851d61b2008 (patch) | |
tree | a5d0989a975791a6eea8f0bf610430490a47d7b6 /parse-xml.c | |
parent | 5f12660870be4b1692eae28339785bc4b2d08550 (diff) | |
download | subsurface-ca8aee4701f95a758f93033eb88ca851d61b2008.tar.gz |
Move the XSLT files into a Qt resource
This means we no longer need to keep them on disk and worry about
installing / uninstalling them. They will always be kept in-memory
(compressed).
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/parse-xml.c b/parse-xml.c index 3a3f65419..ea9e96a5e 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -1970,57 +1970,6 @@ void parse_xml_exit(void) xmlCleanupParser(); } -static xsltStylesheetPtr try_get_stylesheet(const char *path, int len, const char *name) -{ - xsltStylesheetPtr ret; - int namelen = strlen(name); - char *filename = malloc(len+1+namelen+1); - - if (!filename) - return NULL; - - memcpy(filename, path, len); -#ifdef WIN32 - filename[len] = '\\'; -#else - filename[len] = '/'; -#endif - memcpy(filename + len + 1, name, namelen+1); - - ret = NULL; - if (!access(filename, R_OK)) - ret = xsltParseStylesheetFile(filename); - free(filename); - - return ret; -} - -xsltStylesheetPtr get_stylesheet(const char *name) -{ - const char *path, *next; - - path = getenv("SUBSURFACE_XSLT_PATH"); - if (!path) - path = xslt_path; - - do { - int len; - xsltStylesheetPtr ret; - - next = strchr(path, ':'); - len = strlen(path); - if (next) { - len = next - path; - next++; - } - ret = try_get_stylesheet(path, len, name); - if (ret) - return ret; - } while ((path = next) != NULL); - - return NULL; -} - static struct xslt_files { const char *root; const char *file; |