mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
ea998b03f2
darcs-hash:20061019115023-ac50b-30c3fd51d8af8a616d63dfcac39370d7fe6d144e.gz
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/** \file path.h
|
|
|
|
Directory utilities. This library contains functions for locating
|
|
configuration directories, for testing if a command with a given
|
|
name can be found in the PATH, and various other path-related
|
|
issues.
|
|
*/
|
|
|
|
#ifndef FISH_PATH_H
|
|
#define FISH_PATH_H
|
|
|
|
/**
|
|
Returns the user configuration directory for fish. If the directory
|
|
or one of it's parents doesn't exist, they are first created.
|
|
|
|
\param context the halloc context to use for memory allocations
|
|
\return 0 if the no configuration directory can be located or created, the directory path otherwise.
|
|
*/
|
|
wchar_t *path_get_config( void *context);
|
|
|
|
/**
|
|
Finds the full path of an executable in a newly allocated string.
|
|
|
|
\param cmd The name of the executable.
|
|
\param context the halloc context to use for memory allocations
|
|
\return 0 if the command can not be found, the path of the command otherwise.
|
|
*/
|
|
wchar_t *path_get_path( void *context, const wchar_t *cmd );
|
|
|
|
/**
|
|
Returns the full path of the specified directory. If the \c in is a
|
|
full path to an existing directory, a copy of the string is
|
|
returned. If \c in is a directory relative to one of the
|
|
directories i the CDPATH, the full path is returned. If no
|
|
directory can be found, 0 is returned.
|
|
|
|
\param in The name of the directory.
|
|
\param context the halloc context to use for memory allocations
|
|
\return 0 if the command can not be found, the path of the command otherwise.
|
|
*/
|
|
wchar_t *path_get_cdpath( void *context, wchar_t *in );
|
|
|
|
#endif
|