* NAME: node->index() * DESCRIPTION: create an index record from a key and node pointer */
| 224 | * DESCRIPTION: create an index record from a key and node pointer |
| 225 | */ |
| 226 | void 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() |