Apache2
ap_regkey.h File Reference

APR-style Win32 Registry Manipulation. More...

#include "apr.h"
#include "apr_pools.h"
#include "ap_config.h"
Include dependency graph for ap_regkey.h:

Go to the source code of this file.

Macros

#define AP_REGKEY_CLASSES_ROOT   ap_regkey_const(0)
 
#define AP_REGKEY_CURRENT_CONFIG   ap_regkey_const(1)
 
#define AP_REGKEY_CURRENT_USER   ap_regkey_const(2)
 
#define AP_REGKEY_LOCAL_MACHINE   ap_regkey_const(3)
 
#define AP_REGKEY_USERS   ap_regkey_const(4)
 
#define AP_REGKEY_PERFORMANCE_DATA   ap_regkey_const(5)
 
#define AP_REGKEY_DYN_DATA   ap_regkey_const(6)
 
#define AP_REGKEY_EXPAND   0x0001
 

Typedefs

typedef struct ap_regkey_t ap_regkey_t
 

Functions

const ap_regkey_tap_regkey_const (int i)
 
apr_status_t ap_regkey_open (ap_regkey_t **newkey, const ap_regkey_t *parentkey, const char *keyname, apr_int32_t flags, apr_pool_t *pool)
 
apr_status_t ap_regkey_close (ap_regkey_t *key)
 
apr_status_t ap_regkey_remove (const ap_regkey_t *parent, const char *keyname, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_get (char **result, ap_regkey_t *key, const char *valuename, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_set (ap_regkey_t *key, const char *valuename, const char *value, apr_int32_t flags, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_raw_get (void **result, apr_size_t *resultsize, apr_int32_t *resulttype, ap_regkey_t *key, const char *valuename, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_raw_set (ap_regkey_t *key, const char *valuename, const void *value, apr_size_t valuesize, apr_int32_t valuetype, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_array_get (apr_array_header_t **result, ap_regkey_t *key, const char *valuename, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_array_set (ap_regkey_t *key, const char *valuename, int nelts, const char *const *elts, apr_pool_t *pool)
 
apr_status_t ap_regkey_value_remove (const ap_regkey_t *key, const char *valuename, apr_pool_t *pool)
 

Detailed Description

APR-style Win32 Registry Manipulation.

Macro Definition Documentation

◆ AP_REGKEY_CLASSES_ROOT

#define AP_REGKEY_CLASSES_ROOT   ap_regkey_const(0)

Win32 Only: Constants for ap_regkey_open()

◆ AP_REGKEY_CURRENT_CONFIG

#define AP_REGKEY_CURRENT_CONFIG   ap_regkey_const(1)

◆ AP_REGKEY_CURRENT_USER

#define AP_REGKEY_CURRENT_USER   ap_regkey_const(2)

◆ AP_REGKEY_DYN_DATA

#define AP_REGKEY_DYN_DATA   ap_regkey_const(6)

◆ AP_REGKEY_EXPAND

#define AP_REGKEY_EXPAND   0x0001

Win32 Only: Flags for ap_regkey_value_set()

◆ AP_REGKEY_LOCAL_MACHINE

#define AP_REGKEY_LOCAL_MACHINE   ap_regkey_const(3)

◆ AP_REGKEY_PERFORMANCE_DATA

#define AP_REGKEY_PERFORMANCE_DATA   ap_regkey_const(5)

◆ AP_REGKEY_USERS

#define AP_REGKEY_USERS   ap_regkey_const(4)

Typedef Documentation

◆ ap_regkey_t

typedef struct ap_regkey_t ap_regkey_t

Function Documentation

◆ ap_regkey_close()

apr_status_t ap_regkey_close ( ap_regkey_t key)

Win32 Only: Close the registry key opened or created by ap_regkey_open().

Parameters
keyThe registry key to close

◆ ap_regkey_const()

const ap_regkey_t* ap_regkey_const ( int  i)

◆ ap_regkey_open()

apr_status_t ap_regkey_open ( ap_regkey_t **  newkey,
const ap_regkey_t parentkey,
const char *  keyname,
apr_int32_t  flags,
apr_pool_t pool 
)

Win32 Only: Open the specified registry key.

Parameters
newkeyThe opened registry key
parentkeyThe open registry key of the parent, or one of
          AP_REGKEY_CLASSES_ROOT
          AP_REGKEY_CURRENT_CONFIG
          AP_REGKEY_CURRENT_USER
          AP_REGKEY_LOCAL_MACHINE
          AP_REGKEY_USERS
          AP_REGKEY_PERFORMANCE_DATA
          AP_REGKEY_DYN_DATA
keynameThe path of the key relative to the parent key
flagsOr'ed value of:
          APR_READ             open key for reading
          APR_WRITE            open key for writing
          APR_CREATE           create the key if it doesn't exist
          APR_EXCL             return error if APR_CREATE and key exists
poolThe pool in which newkey is allocated

◆ ap_regkey_remove()

apr_status_t ap_regkey_remove ( const ap_regkey_t parent,
const char *  keyname,
apr_pool_t pool 
)

Win32 Only: Remove the given registry key.

Parameters
parentThe open registry key of the parent, or one of
          AP_REGKEY_CLASSES_ROOT
          AP_REGKEY_CURRENT_CONFIG
          AP_REGKEY_CURRENT_USER
          AP_REGKEY_LOCAL_MACHINE
          AP_REGKEY_USERS
          AP_REGKEY_PERFORMANCE_DATA
          AP_REGKEY_DYN_DATA
keynameThe path of the key relative to the parent key
poolThe pool used for temp allocations
Remarks
ap_regkey_remove() is not recursive, although it removes all values within the given keyname, it will not remove a key containing subkeys.

◆ ap_regkey_value_array_get()

apr_status_t ap_regkey_value_array_get ( apr_array_header_t **  result,
ap_regkey_t key,
const char *  valuename,
apr_pool_t pool 
)

Win32 Only: Retrieve a registry value string from an open key.

Parameters
resultThe string elements retrieved from a REG_MULTI_SZ string array
keyThe registry key to retrieve the value from
valuenameThe named value to retrieve (pass "" for the default)
poolThe pool used to store the result

◆ ap_regkey_value_array_set()

apr_status_t ap_regkey_value_array_set ( ap_regkey_t key,
const char *  valuename,
int  nelts,
const char *const *  elts,
apr_pool_t pool 
)

Win32 Only: Store a registry value string array into an open key.

Parameters
keyThe registry key to store the value into
valuenameThe named value to store (pass "" for the default)
neltsThe string elements to store in a REG_MULTI_SZ string array
eltsThe number of elements in the elts string array
poolThe pool used for temp allocations

◆ ap_regkey_value_get()

apr_status_t ap_regkey_value_get ( char **  result,
ap_regkey_t key,
const char *  valuename,
apr_pool_t pool 
)

Win32 Only: Retrieve a registry value string from an open key.

Parameters
resultThe string value retrieved
keyThe registry key to retrieve the value from
valuenameThe named value to retrieve (pass "" for the default)
poolThe pool used to store the result
Remarks
There is no toggle to prevent environment variable expansion if the registry value is set with AP_REG_EXPAND (REG_EXPAND_SZ), such expansions are always performed.

◆ ap_regkey_value_raw_get()

apr_status_t ap_regkey_value_raw_get ( void **  result,
apr_size_t resultsize,
apr_int32_t resulttype,
ap_regkey_t key,
const char *  valuename,
apr_pool_t pool 
)

Win32 Only: Retrieve a raw byte value from an open key.

Parameters
resultThe raw bytes value retrieved
resultsizePointer to a variable to store the number raw bytes retrieved
resulttypePointer to a variable to store the registry type of the value retrieved
keyThe registry key to retrieve the value from
valuenameThe named value to retrieve (pass "" for the default)
poolThe pool used to store the result

◆ ap_regkey_value_raw_set()

apr_status_t ap_regkey_value_raw_set ( ap_regkey_t key,
const char *  valuename,
const void *  value,
apr_size_t  valuesize,
apr_int32_t  valuetype,
apr_pool_t pool 
)

Win32 Only: Store a raw bytes value into an open key.

Parameters
keyThe registry key to store the value into
valuenameThe named value to store (pass "" for the default)
valueThe bytes to store for the named value
valuesizeThe number of bytes for value
valuetypeThe values will find all foo% variables expanded from the environment.
poolThe pool used for temp allocations

◆ ap_regkey_value_remove()

apr_status_t ap_regkey_value_remove ( const ap_regkey_t key,
const char *  valuename,
apr_pool_t pool 
)

Win32 Only: Remove a registry value from an open key.

Parameters
keyThe registry key to remove the value from
valuenameThe named value to remove (pass "" for the default)
poolThe pool used for temp allocations

◆ ap_regkey_value_set()

apr_status_t ap_regkey_value_set ( ap_regkey_t key,
const char *  valuename,
const char *  value,
apr_int32_t  flags,
apr_pool_t pool 
)

Win32 Only: Store a registry value string into an open key.

Parameters
keyThe registry key to store the value into
valuenameThe named value to store (pass "" for the default)
valueThe string to store for the named value
flagsThe option AP_REGKEY_EXPAND or 0, where AP_REGKEY_EXPAND values will find all foo% variables expanded from the environment.
poolThe pool used for temp allocations