group
group__libshare__sysctx
Provides access to a database which holds auxiliary contextual information.

Auxiliary Context Database

The context name is stored as a 224-bit key. The context data is limited to 4096 bytes. Context records automatically expire after two years of their creation or last modification. Context records can be generated through the Share Coin project suite via the various "shc" utility program commands provided. These context records are automatically saved in the primary system database accessible by the libshare runtime functions described here. All context records are automatically distributed across the sharenet when the "shared" daemon is running locally. Although you may over-ride any context record locally, the context records received by a remote host will not over-ride the local system Context Database unless they originate from the same identity that created it. Certain context name prefixes have been reserved, or at least utilized, for specific purposes;
  • "id:" Specifies account information similar to the information stored in a structure or recorded via the Share Coin identity management commands. The information is stored in JSON format. shadow_t structshadow__t compound
  • "geo:," Descriptive and metric information relating to a particular geodetic location stored in JSON format.
  • "loc:" The name of a location which references a particular geodetic location.
function
int shctx_set
(char *name, unsigned char *data, size_t data_len)
Set an auxillary context.
function
int shctx_setstr
(char *name, char *data)
Set an auxillary string context.
function
int shctx_get
(char *name, shctx_t *ctx)
Get an auxillary context.
function
int shctx_set_key
(shkey_t *name_key, unsigned char *data, size_t data_len)
Store auxillary context via a share-key.
function
int shctx_get_key
(shkey_t *name_key, shctx_t *ctx)
Retrieve auxillary context via a share-key.
function
int shctx_notify
(shkey_t *name_key)
inform the shared daemon to relay a local context.
function
shkey_t* shctx_key
(char *name)
A (shr160 / ripemd32) share key referencing the textual name.
Param
name
An unlimited length literal string.
Return Value
An un-allocated share-key.
Note
The returned share-key does not need to be freed.
define
SHCTX_DEFAULT_EXPIRE_TIME
63072000
define
SHCTX_MAX_VALUE_SIZE
4096
define
SHCTX_TABLE_COMMON
"common"
define
SHCTX_DATABASE_NAME
"ctx"