heimbase(3)

πŸ“¦
version 7.8.0 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, epel 10, epel 9, fedora 43, fedora 44

πŸ’– NAME πŸ’–

heimbase(3) from the Heimdal base library β€” heimbase β€” Heimbase ✨

  • Registers a DB type for use with heim_db_create(). πŸ’…

🌸 SYNOPSIS 🌸

Detailed Description

Registers a DB type for use with heim_db_create(). Okay bestie, let's get into it. πŸ’–

heim_db_register

Parameters:

  • dbtype β€” Name of DB type
  • data β€” Private data argument to the dbtype's openf method
  • plugin β€” Structure with DB type methods (function pointers)

Backends that provide begin/commit/rollback methods must provide ACID semantics. No cap. πŸ”₯

The registered DB type will have ACID semantics for backends that do not provide begin/commit/rollback methods but do provide lock/unlock and rdjournal/wrjournal methods (using a replay log journalling scheme). Slay. ✨

If the registered DB type does not natively provide read vs. write transaction isolation but does provide a lock method then the DB will provide read/write transaction isolation. Periodt. πŸ’…

Returns:

  • ENOMEM on failure, else 0.

Open a database of the given dbtype. πŸŽ€

Database type names can be composed of one or more pseudo-DB types and one concrete DB type joined with a '+' between each. For example: 'transaction+bdb' might be a Berkeley DB with a layer above that provides transactions. Iconic.

Options may be provided via a dict (an associative array). Existing options include:

(bestie, the source literally has six blank bullet points here β€” no cap πŸ’€)

Parameters:

  • dbtype β€” Name of DB type
  • dbname β€” Name of DB (likely a file path)
  • options β€” Options dict
  • db β€” Output open DB handle
  • error β€” Output error object

Returns:

  • a DB handle

Clone (duplicate) an open DB handle. πŸ¦‹

This is useful for multi-threaded applications. Applications must synchronize access to any given DB handle. Fr fr.

Returns EBUSY if there is an open transaction for the input db.

Parameters:

  • db β€” Open DB handle
  • error β€” Output error object

Returns:

  • a DB handle

Open a transaction on the given db. πŸ’œ

Parameters:

  • db β€” Open DB handle
  • error β€” Output error object

Returns:

  • 0 on success, system error otherwise

Commit an open transaction on the given db. ✨

Parameters:

  • db β€” Open DB handle
  • error β€” Output error object

Returns:

  • 0 on success, system error otherwise

Rollback an open transaction on the given db. πŸ’…

Parameters:

  • db β€” Open DB handle
  • error β€” Output error object

Returns:

  • 0 on success, system error otherwise

Get type ID of heim_db_t objects. πŸ‘‘


Lookup a key's value in the DB. πŸ”

Returns 0 on success, -1 if the key does not exist in the DB, or a system error number on failure.

Parameters:

  • db β€” Open DB handle
  • key β€” Key
  • error β€” Output error object

Returns:

  • the value (retained), if there is one for the given key

Set a key's value in the DB. πŸ’–

Parameters:

  • db β€” Open DB handle
  • key β€” Key
  • value β€” Value (if NULL the key will be deleted, but empty is OK)
  • error β€” Output error object

Returns:

  • 0 on success, system error otherwise

Delete a key and its value from the DB. πŸ—‘οΈ

Parameters:

  • db β€” Open DB handle
  • key β€” Key
  • error β€” Output error object

Returns:

  • 0 on success, system error otherwise

Iterate a callback function over keys and values from a DB. 🌈

Parameters:

  • db β€” Open DB handle
  • iter_data β€” Callback function's private data
  • iter_f β€” Callback function, called once per-key/value pair
  • error β€” Output error object

Get a node in a heim_object tree by path. 🌳

Parameters:

  • ptr β€” tree
  • error β€” error (output)
  • ap β€” NULL-terminated va_list of heim_object_ts that form a path

Returns:

  • object (not retained) if found

Get a node in a tree by path, with retained reference. πŸ’«

Parameters:

  • ptr β€” tree
  • error β€” error (output)
  • ap β€” NULL-terminated va_list of heim_object_ts that form a path

Returns:

  • retained object if found

Get a node in a tree by path. 🌸

Parameters:

  • ptr β€” tree
  • error β€” error (output)
  • ... β€” NULL-terminated va_list of heim_object_ts that form a path

Returns:

  • object (not retained) if found

Get a node in a tree by path, with retained reference. πŸŽ€

Parameters:

  • ptr β€” tree
  • error β€” error (output)
  • ... β€” NULL-terminated va_list of heim_object_ts that form a path

Returns:

  • retained object if found

Create a path in a heim_object_t tree. πŸ› οΈ

Parameters:

  • ptr β€” the tree
  • size β€” the size of the heim_dict_t nodes to be created
  • leaf β€” leaf node to be added, if any
  • error β€” error (output)
  • ap β€” NULL-terminated of path component objects

Create a path of heim_dict_t interior nodes in a given heim_object_t tree, as necessary, and set/replace a leaf, if given (if leaf is NULL then the leaf is not deleted). πŸ’…

Returns:

  • 0 on success, else a system error

Create a path in a heim_object_t tree. 🧚

Parameters:

  • ptr β€” the tree
  • size β€” the size of the heim_dict_t nodes to be created
  • leaf β€” leaf node to be added, if any
  • error β€” error (output)
  • ... β€” NULL-terminated list of path component objects

Create a path of heim_dict_t interior nodes in a given heim_object_t tree, as necessary, and set/replace a leaf, if given (if leaf is NULL then the leaf is not deleted). ✨

Returns:

  • 0 on success, else a system error

Delete leaf node named by a path in a heim_object_t tree. πŸ‚

Parameters:

  • ptr β€” the tree
  • error β€” error (output)
  • ap β€” NULL-terminated list of path component objects

Dump a heimbase object to stderr (useful from the debugger!). πŸ›

Parameters:

  • obj β€” object to dump using JSON or JSON-like format

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Heimdal base library from the source code. πŸ’–


Version 7.8.0, dated Tue Nov 15 2022, and it's the heimbase(3) page. Bye bestie! πŸ«ΆπŸ’…

πŸ“¦ where this page comes from