2 * Sherlock Library -- Miscellaneous Functions
4 * (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
7 #include <lib/config.h>
19 void open_temp(struct tempfile *, byte *);
20 void delete_temp(struct tempfile *);
23 #define TF_GENERIC "t"
24 #define TF_QUEUE_CONTROL "c"
25 #define TF_QUEUE_DATA "d"
41 typedef byte *(*ci_func)(struct cfitem *, byte *);
43 void cf_read(byte *, struct cfitem *);
53 void log(byte *, ...);
54 void die(byte *, ...) NONRET;
60 byte *stralloc(byte *);
62 /* Content-Type pattern matching and filters */
66 int match_ct_patt(byte *, byte *);
68 struct ct_filter *new_ct_filter(void);
69 byte *add_ct_filter(struct ct_filter *, byte *);
70 int match_ct_filter(struct ct_filter *, byte *);
75 #define log2(x) (ffs(x) - 1)
82 struct odes { /* Object description */
86 struct oattr { /* Object attribute */
87 struct oattr *next, *same;
92 void obj_dump(struct odes *);
93 struct odes *obj_fload(FILE *);
94 struct odes *obj_new(void);
95 struct odes *obj_load(byte *);
96 void obj_fwrite(FILE *, struct odes *); /* Closes the file afterwards... */
97 void obj_free(struct odes *);
98 struct oattr *find_attr(struct odes *, uns);
99 struct oattr *find_attr_last(struct odes *, uns);
100 byte *find_aval(struct odes *, uns);
101 struct oattr *set_attr(struct odes *, uns, byte *);
102 struct oattr *set_attr_num(struct odes *, uns, uns);
103 struct oattr *add_attr(struct odes *, struct oattr *, uns, byte *);
104 struct oattr *prepend_attr(struct odes *, uns, byte *);
108 void mk_obj_name(byte *, ulg, byte *);
109 FILE *create_obj_file(byte *, ulg);
113 int wordsplit(byte *, byte **, uns);
117 int match_pattern(byte *, byte *);