From 019ed9005f9ca0e450750eb303ef13511c945c39 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 12 Sep 2005 19:32:35 +0000 Subject: [PATCH] Add a header file to declare routines defined in lexer and used in parser, or vice versa. svn path=/trunk/; revision=15769 --- epan/Makefile.common | 3 ++- epan/dtd_grammar.lemon | 5 +++-- epan/dtd_parse.h | 33 +++++++++++++++++++++++++++++++++ epan/dtd_parse.l | 7 ++----- 4 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 epan/dtd_parse.h diff --git a/epan/Makefile.common b/epan/Makefile.common index 339d516345..65762fa9a0 100644 --- a/epan/Makefile.common +++ b/epan/Makefile.common @@ -110,7 +110,8 @@ LIBETHEREAL_INCLUDES = \ crypt-md5.h \ crypt-rc4.h \ dtd.h \ - dtd_grammar.h \ + dtd_grammar.h \ + dtd_parse.h \ emem.h \ epan.h \ epan_dissect.h \ diff --git a/epan/dtd_grammar.lemon b/epan/dtd_grammar.lemon index d5f0f0281d..153f320efb 100644 --- a/epan/dtd_grammar.lemon +++ b/epan/dtd_grammar.lemon @@ -6,7 +6,7 @@ * * Copyright 2005, Luis E. Garcia Ontanon * -* $Id $ +* $Id$ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -27,9 +27,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include "dtd.h" - +#include "dtd_parse.h" static dtd_named_list_t* dtd_named_list_new(gchar* name, GPtrArray* list) { dtd_named_list_t* nl = g_malloc(sizeof(dtd_named_list_t)); diff --git a/epan/dtd_parse.h b/epan/dtd_parse.h new file mode 100644 index 0000000000..2e937fefe5 --- /dev/null +++ b/epan/dtd_parse.h @@ -0,0 +1,33 @@ +/* dtd_parse.h +* an XML dissector for ethereal +* header file to declare functions defined in lexer and used in parser, +* or vice versa +* +* Copyright 2004, Luis E. Garcia Ontanon +* +* $Id$ +* +* Ethereal - Network traffic analyzer +* By Gerald Combs +* Copyright 1998 Gerald Combs +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +extern void DtdParse(void*,int,dtd_token_data_t*,dtd_build_data_t*); +extern void *DtdParseAlloc(void *(*)(gulong)); +extern void DtdParseFree( void*, void(*)(void*) ); +extern void DtdParseTrace(FILE *TraceFILE, char *zTracePrompt); +extern int Dtd_Parse_lex(void); diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index 8c33ee26e6..249681c9b2 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -6,7 +6,7 @@ %{ - /* dtd_lexer.l + /* dtd_parse.l * an XML dissector for ethereal * lexical analyzer for DTDs * @@ -38,16 +38,13 @@ #include "dtd.h" #include "dtd_grammar.h" +#include "dtd_parse.h" struct _proto_xmlpi_attr { gchar* name; void (*act)(gchar*); }; - void DtdParse(void*,int,dtd_token_data_t*,dtd_build_data_t*); - void *DtdParseAlloc(void *(*)(gulong)); - void DtdParseFree( void*, void(*)(void*) ); - void DtdParseTrace(FILE *TraceFILE, char *zTracePrompt); void* pParser; GString* input_string; guint offset;