• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..16-Jun-201413

.deps/H16-Jun-201410

cnid_tdb.hH A D19-Dec-20112.1 KiB

cnid_tdb_add.cH A D19-Dec-20115.9 KiB

cnid_tdb_close.cH A D19-Dec-2011401

cnid_tdb_delete.cH A D19-Dec-20111.1 KiB

cnid_tdb_get.cH A D19-Dec-2011970

cnid_tdb_lookup.cH A D19-Dec-20114.2 KiB

cnid_tdb_nextid.cH A D19-Dec-2011260

cnid_tdb_open.cH A D19-Dec-20114.3 KiB

cnid_tdb_resolve.cH A D19-Dec-2011918

cnid_tdb_update.cH A D19-Dec-20113.1 KiB

MakefileH A D26-Dec-201116.3 KiB

Makefile.amH A D19-Dec-2011358

Makefile.inH A D19-Dec-201116.6 KiB

READMEH A D19-Dec-20111.5 KiB

README

1the catalog database keeps track of three mappings:
2    CNID     -> dev/ino and did/name
3    dev/ino  -> CNID
4    did/name -> CNID
5
6dev/ino is used to keep track of magically moved files. did/name is
7for quick lookups of CNIDs. 
8
9NOTE: the database will append a nul byte to the end of name. in
10addition, name should be given as it appears on disk. this allows the
11creation of cnid updating/cleaning programs that don't have to deal
12with knowing what the particular codepage is.
13
14here's the ritual:
15	1) open a volume. call cnid_open.
16	2) every time you need a CNID, call cnid_add(). it will
17	   automatically look for an existing cnid and add a new one
18	   if one isn't already there. you can pass a hint if you
19	   want. the only use this has right now is to enable
20	   consistency between AFP and HFS. in the future, it would
21	   allow people to write conversion utilities that
22	   pre-instantiate a database without needing to re-assign
23	   CNIDs.
24	3) if you want to just look for a CNID without automatically
25	   adding one in, you have two choices:
26	     a) cnid_resolve takes a CNID, returns name, and
27	        over-writes the CNID given with the parent DID. this
28	        is good for FPResolveID.
29             b) cnid_lookup returns a CNID corresponding to the
30	        dev/ino,did/name keys. it will auto-update the catalog
31		database if there's a discrepancy. 
32		NOTE: cnid_add calls this before adding a new CNID. 
33	4) when you delete a file or directory, you need to call
34	   cnid_delete with the CNID for that file/directory.
35	5) call cnid_close when closing the volume.
36