)]}'
{
  "commit": "248540e2312f052ada63bb6108feecc738dfa4cd",
  "tree": "daf0b6b40a6425975a2fb34904b66e62e9f8726a",
  "parents": [
    "b53d2680432b2e18b611b318e833eb0d80265b7b"
  ],
  "author": {
    "name": "Ryan CJ Huang",
    "email": "ryan_huang@jabil.com",
    "time": "Tue Jun 09 13:57:45 2026 +0800"
  },
  "committer": {
    "name": "Ryan CJ Huang",
    "email": "ryan_huang@jabil.com",
    "time": "Wed Jul 15 13:29:32 2026 +0800"
  },
  "message": "bej: add deferred binding substitution support\n\nAdd DSP0218 Table 42 deferred binding substitution to the BEJ encoder\nand decoder so resource-specific values (URIs, instance ids, action\ntargets, containing-resource links) travel as placeholders and bind\nfrom a caller-supplied map.\n\nBindings are keyed by the placeholder token -- the text after the \u0027%\u0027\nmarker, with no leading \u0027%\u0027 -- and map to the substitution value:\n\n\u0027\u0027\u0027\nusing BejDeferredBindingMap \u003d std::unordered_map\u003cstd::string, std::string\u003e;\n\u0027\u0027\u0027\n\nA single flat map holds id-bearing markers (%L\u003cid\u003e, %I\u003cid\u003e,\n%T\u003cid\u003e.\u003caction\u003e) and id-less markers (%C, %S) alike, with no\nper-resource struct and no empty unused fields. Keys are built with the\nbejBinding helpers (resourceLink, instanceId, action, chassis, system)\nso the caller and libbej share one token grammar.\n\nSupported markers (a subset of Table 42): %L, %I, %T, %C, %S, and the\n%% escape. The remaining markers (multi-symbol %PD/%PF/%PI,\n%P\u003cid\u003e.PAGE\u003coffset\u003e, %M, %U, %B, and the %. terminator) are not handled\nyet and pass through unchanged. The decode side models markers as a\ndata table (marker, parameter arity, invalid form), so adding one is a\ntable row rather than a new branch.\n\nEncoder: encode() takes an optional BejDeferredBindingMap, builds a\nvalue-\u003eplaceholder reverse map once, rewrites matching bejString leaves\nto placeholders for the encode, then restores the caller\u0027s tree (value\npointers and format flags) so encode() has no side effect on the input.\n\nDecoder: decode() takes the same map and runs in one of two modes. An\nempty map (the default) disables resolution: deferred binding strings\nand bejResourceLink ids are left raw (e.g. %L\u003cid\u003e), preserving the\ninput. A non-empty map enables resolution: a recognized token is\nsubstituted, an unrecognized id becomes its Table 42 invalid form\n(%L -\u003e /invalid.PDR\u003cid\u003e, %I -\u003e invalid, %T -\u003e /invalid.\u003cid\u003e.\u003cn\u003e), and an\nid-less marker with no binding stays raw. Substitution is gated on the\nper-string SFLV deferred-binding bit, so ordinary data is never touched.\nPlaceholder parsing uses std::from_chars so malformed input cannot throw\nacross the C decoder frames. Resource ids are 32-bit; a numeric\nbejResourceLink id beyond that range is treated as unrecognized rather\nthan truncated.\n\nThe token-key map type and marker constants live in\nbej_deferred_binding.hpp; the bejBinding key builders live in\nbej_deferred_binding_format.hpp, keeping \u003cformat\u003e out of the core type\nheader. Both encode and decode share these so the directions stay in\nsync.\n\nChange-Id: Id7aa215fc1dc701d60418d9ee92cd73f5629df87\nSigned-off-by: Ryan CJ Huang \u003cryan_huang@jabil.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3f19765f875b2ba69c7c56925c905b537772a944",
      "old_mode": 33188,
      "old_path": "include/libbej/bej_decoder_core.h",
      "new_id": "d94b4c5eb403b86bffd1dc1fe556f7aac0d7cb1e",
      "new_mode": 33188,
      "new_path": "include/libbej/bej_decoder_core.h"
    },
    {
      "type": "modify",
      "old_id": "0ad521ae4a1b84314c6e74cb381916843d0e64d4",
      "old_mode": 33188,
      "old_path": "include/libbej/bej_decoder_json.hpp",
      "new_id": "85713faef526fe9b72eb3aa88b610aedebf81955",
      "new_mode": 33188,
      "new_path": "include/libbej/bej_decoder_json.hpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "72a326e35b450702d314761d684e76ff5ada55ba",
      "new_mode": 33188,
      "new_path": "include/libbej/bej_deferred_binding.hpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6fb7eb4242661bdff749c8658a514e9fa64936dd",
      "new_mode": 33188,
      "new_path": "include/libbej/bej_deferred_binding_format.hpp"
    },
    {
      "type": "modify",
      "old_id": "79c0e18377c53b10b118c9e22d5ae500fb24aed0",
      "old_mode": 33188,
      "old_path": "include/libbej/bej_encoder_json.hpp",
      "new_id": "4dc568228cbec47973510af97bc37176a74ddd16",
      "new_mode": 33188,
      "new_path": "include/libbej/bej_encoder_json.hpp"
    },
    {
      "type": "modify",
      "old_id": "6dc2446eb5e3b54258409ebff3cff99c6504d524",
      "old_mode": 33188,
      "old_path": "include/libbej/meson.build",
      "new_id": "f6029d5f32b8891296b4e663a110120971bb0a4f",
      "new_mode": 33188,
      "new_path": "include/libbej/meson.build"
    },
    {
      "type": "modify",
      "old_id": "faa2f6748fc67e370096952fd8b65562c7fed00c",
      "old_mode": 33188,
      "old_path": "src/bej_decoder_core.c",
      "new_id": "11a938f898614d1078ad296c1d85dac261da1d80",
      "new_mode": 33188,
      "new_path": "src/bej_decoder_core.c"
    },
    {
      "type": "modify",
      "old_id": "7f29134b0d0bf4eccc2e2661a17824dc5c3dbe4e",
      "old_mode": 33188,
      "old_path": "src/bej_decoder_json.cpp",
      "new_id": "4d7198302f6f7c591097e23422bcb566a2b91082",
      "new_mode": 33188,
      "new_path": "src/bej_decoder_json.cpp"
    },
    {
      "type": "modify",
      "old_id": "8117f76d17b0cdbf4f280f75e717e5cd62f97876",
      "old_mode": 33188,
      "old_path": "src/bej_encoder_json.cpp",
      "new_id": "1c191651ce47a9b7acba4d664fa96497f7af06c1",
      "new_mode": 33188,
      "new_path": "src/bej_encoder_json.cpp"
    },
    {
      "type": "modify",
      "old_id": "5b9a0138a557f3e3f188ef8c8b88772f6ec39422",
      "old_mode": 33188,
      "old_path": "test/bej_decoder_test.cpp",
      "new_id": "8b26cf6310612f697c403c8c87fdf2edfb6e5d4c",
      "new_mode": 33188,
      "new_path": "test/bej_decoder_test.cpp"
    },
    {
      "type": "modify",
      "old_id": "f630a518a49ab02762b4415004137d625b2e3f91",
      "old_mode": 33188,
      "old_path": "test/bej_encoder_test.cpp",
      "new_id": "c04fa020ab830285eba881079507d327d6b8c9cc",
      "new_mode": 33188,
      "new_path": "test/bej_encoder_test.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b007438c251f8812c16098d387b278829d2fe45d",
      "new_mode": 33188,
      "new_path": "test/dictionaries/network_adapter_dict.bin"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "71942c3af9fb5f79267e6fcf313a0df71ac05b44",
      "new_mode": 33188,
      "new_path": "test/encoded/network_adapter_enc.bin"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "af852c8e7fca38e5edd87ffe1130e8f9688e35e3",
      "new_mode": 33188,
      "new_path": "test/json/network_adapter.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "59732138924505bb6ddbf062bb45161fd1793e57",
      "new_mode": 33188,
      "new_path": "test/json/network_adapter_resolved.json"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1e8427c93df157fa3e717f57e4113e37ab4913ec",
      "new_mode": 33188,
      "new_path": "test/pdr/network_adapter_pdr.json"
    }
  ]
}
