NetSurf
Functions
findfile.h File Reference
This graph shows which files directly or indirectly include this file:

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...
 

Function Documentation

◆ nsws_find_resource()

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]

Parameters
bufbuffer to write to. must be at least PATH_MAX chars
filenamefile to look for
defdefault to return if file not found
Returns
The passed in buffer

Definition at line 96 of file findfile.c.

References NSLOG, PATH_MAX, realpath(), and SLEN.

Here is the call graph for this function:

◆ nsws_init_resource()

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().

Here is the call graph for this function:
Here is the caller graph for this function: