headers.texi 2.06 KB
So far we plan support for RFC822 and RFC1522;

@deftypefun int header_init (header_t *@var{hdr}, const char *@var{blurb}, size_t @var{len}, int @var{flag})
Initialize a @var{hdr} to a supported type.  If @var{blurb} is not NULL, it is
parsed. @var{Flag} can be set to RFC8222 or RFC1522 so far onlyr rfc822  is
supported.
@end deftypefun
@deftypefun void header_destroy (header_t *@var{hdr})
The ressources allocate for @var{hdr} or freed.
@end deftypefun

@deftypefun int header_set_value (header_t @var{hdr}, const char *@var{fn}, const char *@var{fv}, size_t n, int @var{replace})
Set the field-name @var{fn} to field-value @var{fv} of size @var{n} in
@var{hdr}.  If @var{replace} is non-zero the initial value is replace, if zero
it is append.
@end deftypefun

@deftypefun int header_get_value (header_t @var{hdr}, const char *fn, char *fv, size_t len, size_t *n)
Value of field-name @var{fn} is return in buffer @var{fv} of size @var{len}.
The number of bytes written is put in @var{n}.
@end deftypefun

@deftypefun int header_get_mvalue (header_t @var{hdr}, const char *fn, char **fv, size_t *n)
Value of field-name @var{fn} is return in allocated buffer @var{fn} from
@code{malloc(3)}. The number of bytes written is put in @var{n}.
@end deftypefun

@deftypefun int header_gvalue (const char *@var{blurb}, size_t @var{bl}, const char *@var{fn}, char *@var{fv}, size_t @var{len}, size_t *@var{n})
Field-name @var{fn} is extract form @var{blurb} of size @var{bl} and put in
buffer @var{fv} of size @var{len}.
The number of bytes written is put in @var{n}.
@end deftypefun

@deftypefun int header_gmvalue (const char *@var{blurb}, size_t @var{bl}, const char *@var{fn}, char **@var{fv}, size_t *@var{nv})
Field-name @var{fn} is extract form @var{blurb} of size @var{bl} and put in
@code{malloc(3)}ted buffer @var{fv}.  The number of bytes written is put in
@var{n}.
@end deftypefun

@subsection Headers Macros
@cindex Headers Macros

@subsection Headers Parsed
@cindex Headers Parsed

Return a hash table, a dictionnary,  ???

@subsection Headers Regex
@cindex Headers Regex

Using regular expression ?