# Event Body Parser

Purpose of this parser is to parse body of an Event Header field. The parser can be found in file `parse_event.c` under `parser` subdirectory.

This is NOT fully featured Event body parser ! The parser was written for Presence Agent module only and thus can recognize Presence package only. No subpackages will be recognized. All other packages will be marked as "OTHER".

The parser should be replace by a more generic parser if subpackages or parameters should be parsed too.

Main function is `parse_event` in file `parse_event.c`. The function will create an instance of event_t structure and call the parser. If everything went OK, pointer to the newly created structure will be stored in parsed field of hdr_field structure representing the parsed header field.

As usually, the newly created structure will be freed when the whole message is being destroyed. See function `clean_hdr_field` in file `hf.c`.

The parser will be not called automatically when the main parser finds an Event header field. It is up to you to call the parser when you really need the body of the header field to be parsed (call `parse_event` function).