4 # Registration Macros Generator
6 # (c) 2006, Luis E. Garcia Onatnon <luis.ontanon@gmail.com>
10 # Wireshark - Network traffic analyzer
11 # By Gerald Combs <gerald@wireshark.org>
12 # Copyright 1998 Gerald Combs
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License
16 # as published by the Free Software Foundation; either version 2
17 # of the License, or (at your option) any later version.
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write to the Free Software
26 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 push @classes, $1 if /WSLUA_CLASS_DEFINE\050\s*([A-Za-z0-9]+)/;
35 push @functions, $1 if /WSLUA_FUNCTION\s+wslua_([a-z_0-9]+)/;
38 open C, ">register_wslua.c";
39 open H, ">declare_wslua.h";
41 print H "/* This file is automatically genrated by make-reg.pl do not edit */\n\n";
42 print C "/* This file is automatically genrated by make-reg.pl do not edit */\n\n";
44 print H "#define WSLUA_DECLARE_CLASSES() \\\n";
46 print H "\tWSLUA_CLASS_DECLARE($_);\\\n"
50 print H "#define WSLUA_DECLARE_FUNCTIONS() \\\n";
52 print H "\tWSLUA_FUNCTION wslua_$_(lua_State* L);\\\n"
55 print H "extern void wslua_register_classes(lua_State* L);\n";
56 print H "extern void wslua_register_functions(lua_State* L);\n";
60 print C '#include "wslua.h"' . "\n\n";
61 print C "void wslua_register_classes(lua_State* L) { \n";
63 print C "\t${_}_register(L);\n"
65 print C "\tluaopen_bit(L);\n";
69 print C "void wslua_register_functions(lua_State* L) {\n";
71 print C "\tWSLUA_REGISTER_FUNCTION($_); \n"