Commit Graph

16 Commits

Author SHA1 Message Date
Nicolas Williams
f4ba41ebdd Pluggable libheimbase interface for DBs and misc libheimbase enhancements
[Code reviewed by Love Hörnquist Åstrand <lha@kth.se>]

    Added heim_db_*() entry points for dealing with databases, and
    make krb5_aname_to_localname() use it.

    The following enhancements to libheimbase are included:

     - Add heim_data_t and heim_string_t "reference" variants to
       avoid memory copies of potentially large data/strings.

       See heim_data_ref_create() and heim_string_ref_create().

     - Added enhancements to heim_array_t to allow their use for
       queues and stacks, and to improve performance.  See
       heim_array_insert_value().

     - Added XPath-like accessors for heim_object_t.  See
       heim_path_get(), heim_path_copy(), heim_path_create(), and
       heim_path_delete().  These are used extensively in the DB
       framework's generic composition of ACID support and in the
       test_base program

     - Made libheimbase more consistent with Core Foundation naming
       conventions.  See heim_{dict, array}_{get, copy}_value() and
       heim_path_{get, copy}().

     - Added functionality to and fixed bugs in base/json.c:
        - heim_serialize();
        - depth limit for JSON parsing (for DoS protection);
        - pretty-printing;
        - JSON compliance (see below);
        - flag options for parsing and serializing; these are needed
          because of impedance mismatches between heim_object_t and
          JSON (e.g., heim_dict_t allows non-string keys, but JSON
          does not; heimbase supports binary data, while JSON does
          not).

     - Added heim_error_enomem().

     - Enhanced the test_base program to test new functionality and
       to use heim_path*() to better test JSON encoding.  This
       includes some fuzz testing of JSON parsing, and running the
       test under valgrind.

     - Started to add doxygen documentation for libheimbase (but doc
       build for libheimbase is still incomplete).

    Note that there's still some incomplete JSON support:

     - JSON string quoting is not fully implemented;

     - libheimbase lacks support for real numbers, while JSON has
       it -- otherwise libheimbase is a superset of JSON,
       specifically in that any heim_object_t can be a key for an
       associative array.

    The following DB backends are supported natively:

     - "sorted-text", a binary search of sorted (in C locale), flat
       text files;

     - "json", a backend that stores DB contents serialized as JSON
       (this is intended for configuration-like contents).

    The DB framework supports:

     - multiple key/value tables per-DB
     - ACID transactions

    The DB framework also natively implements ACID transactions for
    any DB backends that a) do not provide transactions natively, b)
    do provide lock/unlock/sync methods (even on Windows).  This
    includes autocommit of DB updates outside transactions.

    Future DB enhancements may include:

     - add backends for various DB types (BDB, CDB, MDB, ...);

     - make libhdb use heim_db_t;

     - add a command-line tool for interfacing to databases via
       libheimbase (e.g., to get/set/delete values, create/copy/
       backup DBs, inspect history, check integrity);

     - framework-level transaction logging (with redo and undo
       logging), for generic incremental replication;

     - framework-level DB integrity checking.

       We could store a MAC of the XOR of a hash function applied to
       {key, value} for every entry in the DB, then use this to check
       DB integrity incrementally during incremental replication, as
       well as for the whole DB.
2012-02-05 16:26:32 -06:00
Nicolas Williams
11763aecc7 There's no HEIM_BOOL_TRUE; use heim_bool_create(1) instead 2012-01-13 16:18:50 -06:00
Love Hornquist Astrand
b6f3ca6712 add heim_show, sort lines 2011-12-15 21:51:06 -08:00
Nicolas Williams
659c761213 Add private text file binary search API to libheimbase 2011-12-02 01:02:44 -06:00
Nicolas Williams
c930853dd1 Export heim_bool_val from libheimbase 2011-11-24 00:00:50 -06:00
Nicolas Williams
121ab46bb6 Add missing symbols needed for make check in base 2011-11-22 11:49:26 -06:00
Nicolas Williams
1572b762b6 Fix missing symbols. 2011-11-22 00:32:52 -06:00
Love Hörnquist Åstrand
354ef711f3 restructure 2011-11-21 20:34:35 -08:00
Love Hörnquist Åstrand
58ea7f5b0c use get and set 2011-11-21 20:34:35 -08:00
Nicolas Williams
4ae39ce0b3 Added one more export to libheimbase -- needed by tests 2011-09-27 16:29:11 -05:00
Love Hornquist Astrand
e138bed4c7 export error functions 2011-09-26 09:29:14 +02:00
Jelmer Vernooij
0c7e233195 base: Make heim_cmp global, as it is used by test_base.
"make checK" breaks without this symbol.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-12-19 22:49:41 -08:00
Love Hornquist Astrand
25a79a1ba8 remove tag string 2010-12-12 12:29:09 -08:00
Andrew Bartlett
387b0fa7ba Add more required functions to base/version-script.map
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-11-11 20:43:20 -08:00
Andrew Bartlett
712c6209f2 Fix base/version-script.map to match syntax of other version-script.map files
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-11-11 20:42:04 -08:00
Love Hornquist Astrand
f6f4517eda first drop of version-script.map 2010-11-10 09:03:52 +01:00