2011-11-14 15:57:52 +01:00
|
|
|
/*
|
|
|
|
* parser.h, SJ
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PARSER_H
|
|
|
|
#define _PARSER_H
|
|
|
|
|
|
|
|
#include "cfg.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "defs.h"
|
|
|
|
|
2013-01-06 22:16:21 +01:00
|
|
|
struct _state parse_message(struct session_data *sdata, int take_into_pieces, struct __data *data, struct __config *cfg);
|
2012-01-03 00:19:43 +01:00
|
|
|
void post_parse(struct session_data *sdata, struct _state *state, struct __config *cfg);
|
2013-01-06 22:16:21 +01:00
|
|
|
int parse_line(char *buf, struct _state *state, struct session_data *sdata, int take_into_pieces, char *writebuffer, int writebuffersize, char *abuffer, int abuffersize, struct __data *data, struct __config *cfg);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
2011-11-16 14:47:47 +01:00
|
|
|
void init_state(struct _state *state);
|
2013-02-22 15:35:37 +01:00
|
|
|
unsigned long parse_date_header(char *s, struct __config *cfg);
|
2011-11-16 14:47:47 +01:00
|
|
|
int isHexNumber(char *p);
|
2011-11-14 15:57:52 +01:00
|
|
|
int extract_boundary(char *p, struct _state *state);
|
|
|
|
void fixupEncodedHeaderLine(char *buf);
|
|
|
|
void fixupSoftBreakInQuotedPritableLine(char *buf, struct _state *state);
|
|
|
|
void fixupBase64EncodedLine(char *buf, struct _state *state);
|
|
|
|
void markHTML(char *buf, struct _state *state);
|
|
|
|
int appendHTMLTag(char *buf, char *htmlbuf, int pos, struct _state *state);
|
|
|
|
void translateLine(unsigned char *p, struct _state *state);
|
2011-12-05 17:18:03 +01:00
|
|
|
void fix_email_address_for_sphinx(char *s);
|
2012-02-07 17:21:23 +01:00
|
|
|
void split_email_address(char *s);
|
2012-01-09 23:15:39 +01:00
|
|
|
int does_it_seem_like_an_email_address(char *email);
|
2011-11-14 15:57:52 +01:00
|
|
|
void reassembleToken(char *p);
|
|
|
|
void degenerateToken(unsigned char *p);
|
|
|
|
void fixURL(char *url);
|
2011-11-16 14:47:47 +01:00
|
|
|
int extractNameFromHeaderLine(char *s, char *name, char *resultbuf);
|
2011-12-30 15:52:59 +01:00
|
|
|
char *determine_attachment_type(char *filename, char *type);
|
2012-09-09 23:16:09 +02:00
|
|
|
char *get_attachment_extractor_by_filename(char *filename);
|
2012-02-08 23:14:28 +01:00
|
|
|
void parse_reference(struct _state *state, char *s);
|
2012-09-07 15:08:50 +02:00
|
|
|
int base64_decode_attachment_buffer(char *p, int plen, unsigned char *b, int blen);
|
2011-11-14 15:57:52 +01:00
|
|
|
|
|
|
|
#endif /* _PARSER_H */
|