1 /* $Id: wire.h 6028 2002-12-24 05:10:39Z rra $
3 ** Wire format article utilities.
5 ** Originally written by Alex Kiernan (alex.kiernan@thus.net)
7 ** These routines manipulate wire format articles; in particular, they should
8 ** be safe in the presence of embedded NULs and UTF-8 characters.
14 #include <inn/defines.h>
18 /* Given a pointer to the start of an article, locate the first octet
19 of the body (which may be the octet beyond the end of the buffer if
20 your article is bodyless). */
21 char *wire_findbody(const char *, size_t);
23 /* Given a pointer into an article and a pointer to the end of the article,
24 find the start of the next line or return NULL if there are no more lines
25 remaining in the article. */
26 char *wire_nextline(const char *, const char *end);
28 /* Given a pointer to the start of an article and the name of a header, find
29 the beginning of the value of the given header (the returned pointer will
30 be after the name of the header and any initial whitespace). Headers whose
31 only content is whitespace are ignored. If the header isn't found, returns
34 WARNING: This function does not comply with RFC 2822's idea of header
35 content, particularly in its skipping of initial whitespace. */
36 char *wire_findheader(const char *article, size_t, const char *header);
38 /* Given a pointer inside a header's value and a pointer to the end of the
39 article, returns a pointer to the end of the header value (the \n at the
40 end of the terminating \r\n with folding taken into account), or NULL if no
41 such terminator was found before the end of the article. */
42 char *wire_endheader(const char *header, const char *end);
46 #endif /* INN_WIRE_H */