Crossfire Server, Trunk  R20513
Functions
path.h File Reference

Path-related function prototypes. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * path_combine (const char *src, const char *dst, char *path, size_t size)
 Combine two paths and return the combined path. More...
 
char * path_combine_and_normalize (const char *src, const char *dst, char *path, size_t size)
 Combine two paths and normalize the result. More...
 
void path_normalize (char *path)
 Normalize a path; the passed in path is modified in-place. More...
 

Detailed Description

Path-related function prototypes.

Definition in file path.h.

Function Documentation

char* path_combine ( const char *  src,
const char *  dst,
char *  path,
size_t  size 
)

Combine two paths and return the combined path.

Returns path.

Combine two paths and return the combined path.

Parameters
srcpath we're starting from.
dstpath we're doing to.
pathbuffer containing the combined path.
sizesize of path.
Returns
path.
Note
this doesn't handle the '..', check path_normalize().

Definition at line 51 of file path.c.

References llevDebug, LOG(), and snprintf.

Referenced by check_combine(), and path_combine_and_normalize().

Here is the call graph for this function:

Here is the caller graph for this function:

char* path_combine_and_normalize ( const char *  src,
const char *  dst,
char *  path,
size_t  size 
)

Combine two paths and normalize the result.

The result is a static buffer; it is valid until the next call to either this function or to combine_path().

Combine two paths and normalize the result.

Parameters
srcpath we're starting from.
dstpath we're getting to.
pathbuffer that will contain combined paths.
sizelength of path.
Returns
path

Definition at line 172 of file path.c.

References path_combine(), and path_normalize().

Referenced by check_combine_and_normalize(), command_reset(), enter_exit(), enter_fixed_template_map(), enter_random_template_map(), enter_unique_map(), load_and_link_tiled_map(), load_map_header(), load_quests_from_file(), QuestManager::loadQuestFile(), CREMapInformationManager::process(), and process_map().

Here is the call graph for this function:

Here is the caller graph for this function:

void path_normalize ( char *  path)

Normalize a path; the passed in path is modified in-place.

Normalize a path; the passed in path is modified in-place.

Removes .. and things like that.

Parameters
pathpath to clear. It will be modified in place.
Note
there shouldn't be any buffer overflow, as we just remove stuff.

Definition at line 85 of file path.c.

References llevDebug, and LOG().

Referenced by check_normalize(), and path_combine_and_normalize().

Here is the call graph for this function:

Here is the caller graph for this function: