1 /* inv-ids.h: file inventory ids 2 * 3 **************************************************************** 4 * Copyright (C) 2002, 2003 Tom Lord 5 * 6 * See the file "COPYING" for further information about 7 * the copyright and warranty status of this work. 8 */ 9 10 #ifndef INCLUDE__LIBARCH__INV_IDS_H 11 #define INCLUDE__LIBARCH__INV_IDS_H 12 13 14 #include "hackerlab/machine/types.h" 15 #include "hackerlab/os/sys/stat.h" 16 #include "tla/libawk/associative.h" 17 #include "tla/libawk/relational.h" 18 19 20 21 enum arch_id_tagging_method 22 { 23 arch_names_id_tagging, 24 arch_implicit_id_tagging, 25 arch_tagline_id_tagging, 26 arch_explicit_id_tagging, 27 28 arch_unspecified_id_tagging, /* used in make/apply_changeset */ 29 }; 30 31 32 enum arch_inventory_category 33 { 34 arch_inventory_source = 1, 35 arch_inventory_precious = 2, 36 arch_inventory_backup = 4, 37 arch_inventory_junk = 8, 38 arch_inventory_tree = 16, 39 arch_inventory_unrecognized = 32, 40 arch_inventory_excludes = 64 41 }; 42 43 44 45 46 /* automatically generated __STDC__ prototypes */ 47 extern t_uchar * arch_log_file_id (const t_uchar * archive, 48 const t_uchar * revision); 49 extern assoc_table arch_filenames_ids (rel_table * file_list, 50 const t_uchar * tree_root); 51 extern t_uchar * arch_inventory_id (enum arch_id_tagging_method method, 52 int untagged_is_source, 53 const t_uchar * path, 54 assoc_table id_tagging_shortcut, 55 struct stat * known_lstat, 56 assoc_table * explicit_skips); 57 extern t_uchar * arch_id_tagging_method_name (enum arch_id_tagging_method m); 58 extern enum arch_id_tagging_method arch_id_tagging_method_from_name (const t_uchar * name); 59 extern t_uchar * arch_default_id_tagging_method_contents (enum arch_id_tagging_method method); 60 extern t_uchar * arch_tree_id_tagging_method_file (const t_uchar * tree_root); 61 extern enum arch_id_tagging_method arch_tree_id_tagging_method (enum arch_inventory_category * cat_var, 62 const t_uchar * tree_root, 63 int strict); 64 extern void arch_set_tree_id_tagging_method (const t_uchar * tree_root, 65 enum arch_id_tagging_method method); 66 extern t_uchar * arch_explicit_id_file_for (const t_uchar * path); 67 extern t_uchar * arch_generate_id (void); 68 extern int arch_add_explicit_id (const t_uchar * path, 69 const t_uchar * id); 70 extern void arch_delete_explicit_id (const t_uchar * path); 71 extern void arch_move_explicit_id (const t_uchar * from, 72 const t_uchar * to); 73 extern t_uchar * arch_strong_explicit_dflt_file (const t_uchar * dir); 74 extern t_uchar * arch_weak_explicit_dflt_file (const t_uchar * dir); 75 extern t_uchar * arch_dont_care_explicit_dflt_file (const t_uchar * dir); 76 extern int arch_is_dont_care_explicit_dflt_dir (const t_uchar * dir); 77 extern void arch_delete_strong_explicit_default (const t_uchar * dir); 78 extern void arch_delete_weak_explicit_default (const t_uchar * dir); 79 extern void arch_delete_dont_care_explicit_default (const t_uchar * dir); 80 extern void arch_set_strong_explicit_default (const t_uchar * dir, 81 const t_uchar * id); 82 extern void arch_set_weak_explicit_default (const t_uchar * dir, 83 const t_uchar * id); 84 extern void arch_set_dont_care_explicit_default (const t_uchar * dir); 85 extern t_uchar * arch_id_from_explicit_file (int *errn, 86 const t_uchar * path); 87 extern int str_cmp_suffix_n(t_uchar * a_string, t_uchar * b_string, int length); 88 89 #endif /* INCLUDE__LIBARCH__INV_IDS_H */ 90 91 92 /* tag: Tom Lord Sat Jan 5 15:26:10 2002 (inv-tags.h) 93 */ 94