)]}'
{
  "commit": "a6826fbc5c3802075d98e86488e1116ed0ad6fe5",
  "tree": "a5cd2a296f38dec7de45cd3509c6a126e94c5e55",
  "parents": [
    "54c6977e9ca41fb38b45f1746d90f2806be3b5cb"
  ],
  "author": {
    "name": "Wolfgang Denk",
    "email": "wd@denx.de",
    "time": "Sun Jun 20 13:17:12 2010 +0200"
  },
  "committer": {
    "name": "Wolfgang Denk",
    "email": "wd@denx.de",
    "time": "Sun Sep 19 19:29:47 2010 +0200"
  },
  "message": "Add hash table support as base for new environment code\n\nThis implementation is based on code from uClibc-0.9.30.3 but was\nmodified and extended for use within U-Boot.\n\nMajor modifications and extensions:\n\n* hsearch() [modified / extended]:\n  - While the standard version does not make any assumptions about\n    the type of the stored data objects at all, this implementation\n    works with NUL terminated strings only.\n  - Instead of storing just pointers to the original objects, we\n    create local copies so the caller does not need to care about the\n    data any more.\n  - The standard implementation does not provide a way to update an\n    existing entry.  This version will create a new entry or update an\n    existing one when both \"action \u003d\u003d ENTER\" and \"item.data !\u003d NULL\".\n  - hsearch_r(): Instead of returning 1 on success, we return the\n    index into the internal hash table, which is also guaranteed to be\n    positive.  This allows us direct access to the found hash table\n    slot for example for functions like hdelete().\n* hdelete() [added]:\n  - The standard implementation of hsearch(3) does not provide any way\n    to delete any entries from the hash table.  We extend the code to\n    do that.\n* hexport() [added]:\n  - Export the data stored in the hash table in linearized form:\n    Entries are exported as \"name\u003dvalue\" strings, separated by an\n    arbitrary (non-NUL, of course) separator character. This allows to\n    use this function both when formatting the U-Boot environment for\n    external storage (using \u0027\\0\u0027 as separator), but also when using it\n    for the \"printenv\" command to print all variables, simply by using\n    as \u0027\\n\" as separator. This can also be used for new features like\n    exporting the environment data as text file, including the option\n    for later re-import.\n  - The entries in the result list will be sorted by ascending key\n    values.\n* himport() [added]:\n  - Import linearized data into hash table.  This is the inverse\n    function to hexport(): it takes a linear list of \"name\u003dvalue\"\n    pairs and creates hash table entries from it.\n  - Entries without \"value\", i. e. consisting of only \"name\" or\n    \"name\u003d\", will cause this entry to be deleted from the hash table.\n  - The \"flag\" argument can be used to control the behaviour: when\n    the H_NOCLEAR bit is set, then an existing hash table will kept,\n    i. e. new data will be added to an existing hash table;\n    otherwise, old data will be discarded and a new hash table will\n    be created.\n  - The separator character for the \"name\u003dvalue\" pairs can be\n    selected, so we both support importing from externally stored\n    environment data (separated by NUL characters) and from plain text\n    files (entries separated by newline characters).\n  - To allow for nicely formatted text input, leading white space\n    (sequences of SPACE and TAB chars) is ignored, and entries\n    starting (after removal of any leading white space) with a \u0027#\u0027\n    character are considered comments and ignored.\n  - NOTE: this means that a variable name cannot start with a \u0027#\u0027\n    character.\n  - When using a non-NUL separator character, backslash is used as\n    escape character in the value part, allowing for example fo\n    multi-line values.\n  - In theory, arbitrary separator characters can be used, but only\n    \u0027\\0\u0027 and \u0027\\n\u0027 have really been tested.\n\nSigned-off-by: Wolfgang Denk \u003cwd@denx.de\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "fccc757e0e5882cb20f2955bc24bd78427ece13c",
      "new_mode": 33188,
      "new_path": "include/search.h"
    },
    {
      "type": "modify",
      "old_id": "2d969a3d77df063830a094175c9b61bbee1af000",
      "old_mode": 33188,
      "old_path": "lib/Makefile",
      "new_id": "a8de3e1df6d441364b26d689a0b58f797fd7d03e",
      "new_mode": 33188,
      "new_path": "lib/Makefile"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2f3b5c8d1026eaa7cc9edd0864e505fcd9056d40",
      "new_mode": 33188,
      "new_path": "lib/hashtable.c"
    }
  ]
}
