Commit 344611f5 344611f57409fc78699198b165c8acf986aceb65 by Sergey Poznyakoff

Rewrite from scratch

1 parent 2039d455
...@@ -33,38 +33,42 @@ extern "C" { ...@@ -33,38 +33,42 @@ extern "C" {
33 33
34 /* The structure members are offset that point to the begin/end of header 34 /* The structure members are offset that point to the begin/end of header
35 fields. */ 35 fields. */
36 struct _hdr 36 struct mu_hdrent
37 { 37 {
38 char *fn; 38 struct mu_hdrent *prev;
39 char *fn_end; 39 struct mu_hdrent *next;
40 char *fv; 40 size_t fn;
41 char *fv_end; 41 size_t nlen;
42 size_t fv;
43 size_t vlen;
44 size_t nlines;
42 }; 45 };
43 46
44 /* The blurb member represents the headers, hdr_count the number of distinct
45 header field and the layout is done by struct_hdr *hdr. */
46 struct _mu_header 47 struct _mu_header
47 { 48 {
48 /* Owner. */ 49 /* Owner. */
49 void *owner; 50 void *owner;
50 51
51 /* Data. */ 52 /* Data. */
52 mu_stream_t mstream; 53 char *spool;
53 size_t stream_len; 54 size_t spool_size;
54 char *blurb; 55 size_t spool_used;
55 size_t blurb_len; 56 struct mu_hdrent *head, *tail;
56 size_t hdr_count;
57 struct _hdr *hdr;
58 int flags; 57 int flags;
59 58
60 mu_assoc_t cache; 59 size_t numhdr;
60 size_t numlines;
61 size_t size;
62
63 /* Temporary storage */
64 mu_stream_t mstream;
65 size_t mstream_size;
61 66
62 /* Stream. */ 67 /* Stream. */
63 mu_stream_t stream; 68 mu_stream_t stream;
64 int (*_get_value) (mu_header_t, const char *, char *, size_t , size_t *); 69 size_t strpos;
65 int (*_set_value) (mu_header_t, const char *, const char *, int); 70
66 int (*_lines) (mu_header_t, size_t *); 71 /* Methods */
67 int (*_size) (mu_header_t, size_t *);
68 int (*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *); 72 int (*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *);
69 }; 73 };
70 74
......