diff options
author | Werner Koch <[email protected]> | 2024-06-28 15:50:23 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-06-28 15:59:55 +0000 |
commit | 675b12ddd8ca742314d96a02bc95b837841070fb (patch) | |
tree | 9ff52a10c5740f568ae9ffa8cc7f6bc637c7533e /tools/rfc822parse.h | |
parent | agent: Require use of "SCD DEVINFO --watch" command with socket. (diff) | |
download | gnupg-675b12ddd8ca742314d96a02bc95b837841070fb.tar.gz gnupg-675b12ddd8ca742314d96a02bc95b837841070fb.zip |
tools: New support functions for the mail parser.
* tools/rfc822parse.h (RFC822PARSE_HEADER_SEEN): New.
* tools/rfc822parse.c (rfc822_cmp_header_name): New.
(insert_header): Run header seen callback.
(rfc822parse_last_header_line): New.
(rfc822_free): New.
* tools/wks-receive.c (t2body): Use it here.
* tools/mime-parser.c (parse_message_cb): and here.
Diffstat (limited to 'tools/rfc822parse.h')
-rw-r--r-- | tools/rfc822parse.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/rfc822parse.h b/tools/rfc822parse.h index e2f2bedac..84315a50d 100644 --- a/tools/rfc822parse.h +++ b/tools/rfc822parse.h @@ -29,6 +29,7 @@ typedef enum RFC822PARSE_CANCEL, RFC822PARSE_T2BODY, RFC822PARSE_FINISH, + RFC822PARSE_HEADER_SEEN, RFC822PARSE_RCVD_SEEN, RFC822PARSE_LEVEL_DOWN, RFC822PARSE_LEVEL_UP, @@ -48,8 +49,10 @@ typedef int (*rfc822parse_cb_t) (void *opaque, rfc822parse_event_t event, rfc822parse_t msg); +void rfc822_free (void *); int rfc822_valid_header_name_p (const char *name); void rfc822_capitalize_header_name (char *name); +int rfc822_cmp_header_name (const char *a, const char *b); rfc822parse_t rfc822parse_open (rfc822parse_cb_t cb, void *opaque_value); @@ -60,6 +63,7 @@ int rfc822parse_finish (rfc822parse_t msg); int rfc822parse_insert (rfc822parse_t msg, const unsigned char *line, size_t length); +const char *rfc822parse_last_header_line (rfc822parse_t msg); char *rfc822parse_get_field (rfc822parse_t msg, const char *name, int which, size_t *valueoff); |