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 */
63 int match_ct_patt(byte *, byte *);
68 #define log2(x) (ffs(x) - 1)
75 struct odes { /* Object description */
79 struct oattr { /* Object attribute */
80 struct oattr *next, *same;
85 void obj_dump(struct odes *);
86 struct odes *obj_fload(FILE *);
87 struct odes *obj_new(void);
88 struct odes *obj_load(byte *);
89 void obj_fwrite(FILE *, struct odes *); /* Closes the file afterwards... */
90 void obj_free(struct odes *);
91 struct oattr *find_attr(struct odes *, uns);
92 struct oattr *find_attr_last(struct odes *, uns);
93 byte *find_aval(struct odes *, uns);
94 struct oattr *set_attr(struct odes *, uns, byte *);
95 struct oattr *set_attr_num(struct odes *, uns, uns);
96 struct oattr *add_attr(struct odes *, struct oattr *, uns, byte *);
100 void mk_obj_name(byte *, ulg, byte *);
101 FILE *create_obj_file(byte *, ulg);
105 int wordsplit(byte *, byte **, uns);
109 int match_pattern(byte *, byte *);