dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
Functions
fsys-dir.c File Reference

(042ea3b92)

#include <config.h>
#include <compat.h>
#include <stdlib.h>
#include <dpkg/dpkg.h>
#include <dpkg/string.h>
#include <dpkg/path.h>
#include <dpkg/fsys.h>
Include dependency graph for fsys-dir.c:

Functions

const char * dpkg_fsys_set_dir (const char *dir)
 Set current on-disk filesystem root directory.
 
const char * dpkg_fsys_get_dir (void)
 Get current on-disk filesystem root directory.
 
char * dpkg_fsys_get_path (const char *pathpart)
 Get a pathname to the current on-disk filesystem root directory.
 

Function Documentation

◆ dpkg_fsys_get_dir()

const char * dpkg_fsys_get_dir ( void  )

Get current on-disk filesystem root directory.

This function will take care of initializing the directory if it has not been initialized before.

Returns
The current filesystem root directory.

Referenced by archivefiles(), conffderef(), dpkg_fsys_get_path(), and main().

Here is the caller graph for this function:

◆ dpkg_fsys_get_path()

char * dpkg_fsys_get_path ( const char *  pathpart)

Get a pathname to the current on-disk filesystem root directory.

This function returns an allocated string, which should be freed with free(2).

Parameters
pathpartThe pathpart to append to the new pathname.
Returns
The newly allocated pathname.

References dpkg_fsys_get_dir(), path_skip_slash_dotslash(), and str_fmt().

Referenced by set_root().

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

◆ dpkg_fsys_set_dir()

const char * dpkg_fsys_set_dir ( const char *  dir)

Set current on-disk filesystem root directory.

This function can be used to set the directory to a new value, or to reset it to a default value if dir is NULL.

Parameters
dirThe new filesystem root directory, or NULL to set to default.
Returns
The new filesystem root directory.

References m_strdup(), and path_trim_slash_slashdot().

Referenced by set_instdir(), and set_root().

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