/*++ /* NAME /* header_token 3 /* SUMMARY /* mail header parser /* SYNOPSIS /* #include <header_token.h> /* /* typedef struct { /* .in +4 /* int type; /* const char *u.value;
/* /* ... */ /* .in /* } HEADER_TOKEN; /* /* ssize_t header_token(token, token_len, token_buffer, ptr, /* specials, terminator) /* HEADER_TOKEN *token; /* ssize_t token_len; /* VSTRING *token_buffer; /* const char **ptr; /* const char *specials; /* int terminator; /* DESCRIPTION /* This module parses a mail header value (text after field-name:) /* into tokens. The parser understands RFC 822 linear white space, /* quoted-string, comment, control characters, and a set of /* user-specified special characters. /* /* A result token type is one of the following: /* .IP HEADER_TOK_QSTRING /* Quoted string as per RFC 822. /* .IP HEADER_TOK_TOKEN /* Token as per RFC 822, and the special characters supplied by the /* caller. /* .IP other /* The value of a control character or special character. /* .PP /* header_token() tokenizes the input and stops after a user-specified /* terminator (ignoring all tokens that exceed the capacity of /* the result storage), or when it runs out of space for the result. /* The terminator is not stored. The result value is the number of /* tokens stored, or -1 when the input was exhausted before any tokens /* were found. /* /* Arguments: /* .IP token /* Result array of HEADER_TOKEN structures. Token string values /* are pointers to null-terminated substrings in the token_buffer. /* .IP token_len /* Length of the array of HEADER_TOKEN structures. /* .IP token_buffer /* Storage for result token string values. /* .IP ptr /* Input/output read position. The input is a null-terminated string. /* .IP specials /* Special characters according to the relevant RFC, or a /* null pointer (default to the RFC 822 special characters). /* This must include the optional terminator if one is specified. /* .IP terminator /* The special character to stop after, or zero. /* BUGS /* Eight-bit characters are not given special treatment. /* SEE ALSO /* RFC 822 (ARPA Internet Text Messages) /* DIAGNOSTICS /* Fatal errors: memory allocation problem. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.