From daefaa92b8d3330f4190ce5e3c0416c934927d9c Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Tue, 8 Mar 2005 19:03:09 +0000 Subject: [PATCH] from jaap keuter: add info how to update from old to new style plugin registering svn path=/trunk/; revision=13661 --- doc/README.plugins | 55 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/doc/README.plugins b/doc/README.plugins index d5eb9fb7b6..58ae5372ba 100644 --- a/doc/README.plugins +++ b/doc/README.plugins @@ -74,7 +74,7 @@ Here is a sample code for the function: proto_reg_handoff_xxx(); -As you can see the plugin_reg_handoff and plugin_init are just +As you can see the plugin_reg_handoff and plugin_register are just wrappers for the proto_reg_handoff_xxx and proto_register_xxx functions. 4 Directory structure and other file changes @@ -307,6 +307,59 @@ by going to the plugins/xxx directory and running make install +6 How to update an "old style" plugin (using plugin_init function) + +The plugin registering has changed between 0.10.9 and 0.10.10, everyone +is encouraged to update it's plugins as outlined below: + +--- Remove following include statements from all plugin sources --- + +#include "plugins/plugin_api.h" +#include "plugins/plugin_api_defs.h" + +--- Change init function from this --- + +G_MODULE_EXPORT void +plugin_init(plugin_address_table_t *pat +#ifndef PLUGINS_NEED_ADDRESS_TABLE +_U_ +#endif +){ + /* initialise the table of pointers needed in Win32 DLLs */ + plugin_address_table_init(pat); + /* register the new protocol, protocol fields, and subtrees */ + if (proto_xxx == -1) { /* execute protocol initialization only once */ + proto_register_xxx(); + } +} + +------ to this ------ + +G_MODULE_EXPORT void +plugin_register(void) +{ + /* register the new protocol, protocol fields, and subtrees */ + if (proto_xxx == -1) { /* execute protocol initialization only once */ + proto_register_xxx(); + } +} + +--- Changes to plugin's Makefile.nmake --- +change +!IFDEF LINK_PLUGINS_WITH_LIBETHEREAL +to +!IFDEF ENABLE_LIBETHEREAL + +remove +!ELSE +LINK_PLUGIN_WITH=..\plugin_api.obj + +move +!ENDIF +to the line just before the clean target + +---------------- + Ed Warnicke Derived and expanded from the plugin section of README.developers