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

..16-Jun-201413

.deps/H16-Jun-201411

cnid_cdb.hH A D19-Dec-20111.6 KiB

cnid_cdb_add.cH A D19-Dec-20118.8 KiB

cnid_cdb_close.cH A D19-Dec-2011824

cnid_cdb_delete.cH A D19-Dec-20111.1 KiB

cnid_cdb_get.cH A D19-Dec-20111.3 KiB

cnid_cdb_lookup.cH A D19-Dec-20114.1 KiB

cnid_cdb_meta.cH A D19-Dec-2011210

cnid_cdb_meta.hH A D19-Dec-20111.9 KiB

cnid_cdb_nextid.cH A D19-Dec-2011559

cnid_cdb_open.cH A D19-Dec-201112.5 KiB

cnid_cdb_private.hH A D19-Dec-20113.6 KiB

cnid_cdb_rebuild_add.cH A D19-Dec-20113.9 KiB

cnid_cdb_resolve.cH A D19-Dec-20111.2 KiB

cnid_cdb_update.cH A D19-Dec-20113.2 KiB

MakefileH A D26-Dec-201125.4 KiB

Makefile.amH A D19-Dec-2011543

Makefile.inH A D19-Dec-201127 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