2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
19 typedef struct _Attrstore Attrstore;
20 typedef unsigned short NameId;
23 Attrstore * new_store (struct _Pool *pool);
24 unsigned int new_entry (Attrstore *s);
25 Attrstore * attr_store_read (FILE *fp, struct _Pool *pool);
26 void ensure_entry (Attrstore *s, unsigned int entry);
27 void write_attr_store (FILE *fp, Attrstore *s);
28 void attr_store_pack (Attrstore *s);
29 void attr_store_unpack (Attrstore *s);
31 NameId str2nameid (Attrstore *s, const char *str);
32 LocalId str2localid (Attrstore *s, const char *str, int create);
33 const char * localid2str(Attrstore *s, LocalId id);
35 void add_attr_int (Attrstore *s, unsigned int entry, NameId name, unsigned int val);
36 void add_attr_blob (Attrstore *s, unsigned int entry, NameId name, const void *ptr, unsigned int len);
37 void add_attr_string (Attrstore *s, unsigned int entry, NameId name, const char *val);
38 void add_attr_id (Attrstore *s, unsigned int entry, NameId name, Id val);
39 void add_attr_intlist_int (Attrstore *s, unsigned int entry, NameId name, int val);
40 void add_attr_localids_id (Attrstore *s, unsigned int entry, NameId name, LocalId id);
42 const void * attr_retrieve_blob (Attrstore *s, unsigned int ofs, unsigned int len);
44 #define SEARCH_SUBSTRING 1
45 #define SEARCH_STRING 2
47 #define SEARCH_REGEX 4
48 #define SEARCH_NOCASE 8
49 #define SEARCH_BLOBS 16
51 typedef int (*cb_attr_search_s) (Attrstore *s, unsigned entry, Id name, const char *str);
52 void attr_store_search_s (Attrstore *s, const char *pattern, int flags, NameId name, cb_attr_search_s cb);