MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / n_index

Function n_index

dep/hfsutils/libhfs/node.c:226–245  ·  view source on GitHub ↗

* NAME: node->index() * DESCRIPTION: create an index record from a key and node pointer */

Source from the content-addressed store, hash-verified

224 * DESCRIPTION: create an index record from a key and node pointer
225 */
226void n_index(const node *np, byte *record, unsigned int *reclen)
227{
228 const byte *key = HFS_NODEREC(*np, 0);
229
230 if (np->bt == &np->bt->f.vol->cat)
231 {
232 /* force the key length to be 0x25 */
233
234 HFS_SETKEYLEN(record, 0x25);
235 memset(record + 1, 0, 0x25);
236 memcpy(record + 1, key + 1, HFS_RECKEYLEN(key));
237 }
238 else
239 memcpy(record, key, HFS_RECKEYSKIP(key));
240
241 d_putul(HFS_RECDATA(record), np->nnum);
242
243 if (reclen)
244 *reclen = HFS_RECKEYSKIP(record) + 4;
245}
246
247/*
248 * NAME: split()

Callers 5

splitFunction · 0.85
n_deleteFunction · 0.85
insertxFunction · 0.85
bt_insertFunction · 0.85
deletexFunction · 0.85

Calls 1

d_putulFunction · 0.85

Tested by

no test coverage detected