|
NetSurf
|
Go to the source code of this file.
Functions | |
| char * | nsws_find_resource (char *buf, const char *filename, const char *def) |
| Locate a shared resource file by searching known places in order. More... | |
| char ** | nsws_init_resource (const char *resource_path) |
| Create an array of valid paths to search for resources. More... | |
| char * nsws_find_resource | ( | char * | buf, |
| const char * | filename, | ||
| const char * | def | ||
| ) |
Locate a shared resource file by searching known places in order.
Search order is: ~/.netsurf/, $NETSURFRES/ (where NETSURFRES is an environment variable), then the path specified in NETSURF_WINDOWS_RESPATH in the Makefile then .\res\ [windows paths]
| buf | buffer to write to. must be at least PATH_MAX chars |
| filename | file to look for |
| def | default to return if file not found |
Definition at line 96 of file findfile.c.
References NSLOG, PATH_MAX, realpath(), and SLEN.
| char ** nsws_init_resource | ( | const char * | resource_path | ) |
Create an array of valid paths to search for resources.
The idea is that all the complex path computation to find resources is performed here, once, rather than every time a resource is searched for.
Definition at line 44 of file findfile.c.
References filepath_free_strvec(), filepath_generate(), and filepath_path_to_strvec().
Referenced by WinMain().