file
shpref_8h
[ ]
define
SHPREF_TRUE
"true"
Indicates a positive boolean value.
define
SHPREF_FALSE
"false"
Indicates a negative boolean value.
define
SHPREF_BASE_DIR
"base-dir"
Specifies the preferred location of where the sharefs filesystem is stored on the local file system.
Note
The default location is '$HOME/.share'. Use to temporarily overwrite this value.
shpref_sess_set() group__libshare_1gad814ced5efcb4f0cc806f9da0c9bd299 member
define
SHPREF_TRACK
"track"
Specifies whether to track sharefs filesystem revisions.
Note
Use to temporarily overwrite this value.
shpref_sess_set() group__libshare_1gad814ced5efcb4f0cc806f9da0c9bd299 member
define
SHPREF_OVERLAY
"overlay"
Specifies whether the sharefs file system references files on the local filesystem.
Note
Use to temporarily overwrite this value.
shpref_sess_set() group__libshare_1gad814ced5efcb4f0cc806f9da0c9bd299 member
define
SHPREF_ACC_NAME
SHMETA_USER_EMAIL
The account name is typically comprised of an email address optionally followed by a real name in 'LAST/FIRST' format.
define
SHPREF_ACC_PASS
SHMETA_USER_PASS
A key reference to the user's account password.
define
SHPREF_ACC_SALT
SHMETA_USER_SALT
The salt used to perturb the account password key.
define
SHPREF_ACC_GEO
SHMETA_USER_GEO
define
SHPREF_MAX
6
Specifies the number of preferences available.
define
SHPREF_NAME_MAX
4096
Specified the maximum size of a share library global preference name.
define
SHPREF_VALUE_MAX
4096
Specified the maximum size of a share library global preference value.
define
shpref_track
(0 == strcmp(shpref_get(SHPREF_TRACK), "true") ? TRUE : FALSE)
Specifies whether to track sharefs filesystem revisions.
Return Value
A zero (0) when disabled and a non-zero value when enabled.
define
shpref_set_track
(opt ? shpref_set(SHPREF_TRACK, "true") : shpref_set(SHPREF_TRACK, "false"))
Permanently sets the option.
SHPREF_TRACK
Param
opt
A zero to disable the option and a non-zero to enable.
define
shpref_overlay
(0 == strcmp(shpref_get(SHPREF_OVERLAY), "true") ? TRUE : FALSE)
Specifies whether to overlay the sharefs filesystem ontop of the work directory on the local filesystem.
Note
Disable this option to prevent libshare from writing outside of the base directory.
Return Value
A zero (0) when disabled and a non-zero value when enabled.
define
shpref_set_overlay
(opt ? shpref_set(SHPREF_OVERLAY, "true") : shpref_set(SHPREF_OVERLAY, "false"))
Permanently sets the option.
SHPREF_OVERLAY
Param
opt
A zero to disable the option and a non-zero to enable.
define
shpref_unset
shpref_set(pref, NULL)
Persistently unset a libshare configuration option.
define
shpref_sess_set
shmap_set_astr(_pref, ashkey_str(pref), value)
Overwrite a preference for the current session.
define
shpref_sess_unset
shmap_unset(_pref, ashkey_str(pref))
Temporarily unset a libshare configuration option.
function
char* shpref_base_dir
(void)
Specifies the preferred location of where the sharefs filesystem is stored on the local file system.
Return Value
The path to a directory on the local file-system.
function
char* shpref_path
(int uid)
The local filesystem path for storing configuration options.
Return Value
The path to the location on the local file-system that contains user-specific libshare configuration options.
function
int shpref_init
(void)
Initialize an instance of configuration options in memory.
Note
This function does not need to be called in order to retrieve or set configuration options.
Return Value
A zero (0) on success and a negative one (-1) on failure.
function
void shpref_free
(void)
Free the configuration options loaded into memory.
Note
This will remove all temporar configuration settings that have been made this process session.
function
const char* shpref_get
(char *pref, char *default_value)
Retrieve a configuration option value.
Param
pref
The name of the preference.
default_value
The default string value to return if the preference is not set.
Return Value
The configuration option value.
Note
This function is not thread-safe.
function
int shpref_set
(char *pref, char *value)
Set a persistent value for a particular libshare user-specific configuration option.
Specify user specific configuration items:
  • SHPREF_BASE_DIR The base directory to store sharefs file data.
  • SHPREF_TRACK Whether to automatically track file revisions.
  • SHPREF_OVERLAY Whether to write outside of the base directory. Set a configuration option value.
    Param
    pref
    The name of the preference.
    value
    The configuration option value.
    Return Value
    The configuration option value.