NetSurf
Macros | Functions
findfile.c File Reference
#include <unistd.h>
#include "utils/log.h"
#include "utils/corestrings.h"
#include "atari/gemtk/gemtk.h"
#include "atari/findfile.h"
#include "atari/gui.h"
#include "atari/osspec.h"
Include dependency graph for findfile.c:

Go to the source code of this file.

Macros

#define BACKSLASH   0x5C
 
#define NETSURF_GEM_RESPATH   "./res/"
 Locate a shared resource file by searching known places in order. More...
 

Functions

char * local_file_to_url (const char *filename)
 
char * atari_find_resource (char *buf, const char *filename, const char *def)
 

Macro Definition Documentation

◆ BACKSLASH

#define BACKSLASH   0x5C

◆ NETSURF_GEM_RESPATH

#define NETSURF_GEM_RESPATH   "./res/"

Locate a shared resource file by searching known places in order.

Search order is: ./, NETSURF_GEM_RESPATH, ./$HOME/.netsurf/, $NETSURFRES/ (where NETSURFRES is an environment variable)

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

Definition at line 77 of file findfile.c.

Function Documentation

◆ atari_find_resource()

char * atari_find_resource ( char *  buf,
const char *  filename,
const char *  def 
)

Definition at line 80 of file findfile.c.

References gemdos_realpath(), NETSURF_GEM_RESPATH, NSLOG, and PATH_MAX.

Referenced by atari_hotlist_init(), gui_get_resource_url(), gui_init(), main(), and read_locales().

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

◆ local_file_to_url()

char * local_file_to_url ( const char *  filename)

Definition at line 29 of file findfile.c.

References BACKSLASH, FILE_SCHEME_PREFIX, FILE_SCHEME_PREFIX_LEN, and NSLOG.

Referenced by main(), menu_open_file(), and on_file_dropped().

Here is the caller graph for this function: