1 /* 2 * dtd.h 3 * 4 * XML dissector for Wireshark 5 * DTD import declarations 6 * 7 * Copyright 2005, Luis E. Garcia Ontanon <luis@ontanon.org> 8 * 9 * Wireshark - Network traffic analyzer 10 * By Gerald Combs <gerald@wireshark.org> 11 * Copyright 1998 Gerald Combs 12 * 13 * SPDX-License-Identifier: GPL-2.0-or-later 14 */ 15 16 #ifndef _DTD_H_ 17 #define _DTD_H_ 18 19 #include <glib.h> 20 #include <stdlib.h> /* exit() */ 21 #include "ws_attributes.h" 22 23 typedef struct _dtd_build_data_t { 24 gchar* proto_name; 25 gchar* media_type; 26 gchar* description; 27 gchar* proto_root; 28 gboolean recursion; 29 30 GPtrArray* elements; 31 GPtrArray* attributes; 32 33 GString* error; 34 } dtd_build_data_t; 35 36 typedef struct _dtd_token_data_t { 37 gchar* text; 38 gchar* location; 39 } dtd_token_data_t; 40 41 typedef struct _dtd_named_list_t { 42 gchar* name; 43 GPtrArray* list; 44 } dtd_named_list_t; 45 46 typedef struct _dtd_preparse_scanner_state Dtd_PreParse_scanner_state_t; 47 48 extern GString* dtd_preparse(const gchar* dname, const gchar* fname, GString* err); 49 extern dtd_build_data_t* dtd_parse(GString* s); 50 extern const gchar* dtd_location(Dtd_PreParse_scanner_state_t* state); 51 52 #endif 53