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"
40 typedef byte *(*ci_func)(struct cfitem *, byte *);
42 void cf_read(byte *, struct cfitem *);
52 void log(byte *, ...);
53 void die(byte *, ...) NONRET;
59 byte *stralloc(byte *);
61 /* Content-Type pattern matching and filters */
65 int match_ct_patt(byte *, byte *);
67 struct ct_filter *new_ct_filter(void);
68 byte *add_ct_filter(struct ct_filter *, byte *);
69 int match_ct_filter(struct ct_filter *, byte *);
74 #define log2(x) (ffs(x) - 1)
81 struct odes { /* Object description */
85 struct oattr { /* Object attribute */
86 struct oattr *next, *same;
91 void obj_dump(struct odes *);
92 struct odes *obj_fload(FILE *);
93 struct odes *obj_new(void);
94 struct odes *obj_load(byte *);
95 void obj_fwrite(FILE *, struct odes *); /* Closes the file afterwards... */
96 void obj_free(struct odes *);
97 struct oattr *find_attr(struct odes *, uns);
98 struct oattr *find_attr_last(struct odes *, uns);
99 byte *find_aval(struct odes *, uns);
100 struct oattr *set_attr(struct odes *, uns, byte *);
101 struct oattr *set_attr_num(struct odes *, uns, uns);
102 struct oattr *add_attr(struct odes *, struct oattr *, uns, byte *);
106 void mk_obj_name(byte *, ulg, byte *);
107 FILE *create_obj_file(byte *, ulg);
111 int wordsplit(byte *, byte **, uns);
115 int match_pattern(byte *, byte *);