NetSurf
|
#include <winsock2.h>
#include <windows.h>
#include <limits.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils/log.h"
#include "utils/url.h"
#include "utils/utils.h"
#include "utils/filepath.h"
#include "windows/findfile.h"
Go to the source code of this file.
Functions | |
char ** | nsws_init_resource (const char *resource_path) |
Create an array of valid paths to search for resources. More... | |
static char * | realpath (const char *path, char *resolved_path) |
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_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().
|
static |
Definition at line 76 of file findfile.c.
References path(), and PATH_MAX.
Referenced by nsws_find_resource().