dpkg 1.21.11
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. More...
 
const char * dpkg_fsys_get_dir (void)
 Get current on-disk filesystem root directory. More...
 
char * dpkg_fsys_get_path (const char *pathpart)
 Get a pathname to the current on-disk filesystem root directory. More...
 

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 conffderef(), and dpkg_fsys_get_path().

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().

Here is the call 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.

Referenced by set_instdir().

Here is the caller graph for this function: