Wireshark-dev: Re: [Wireshark-dev] libwireshark.lib is missing some proto_registrar_* methods
From: Andreas <[email protected]>
Date: Tue, 15 Feb 2011 19:57:09 +0100
Am 11.02.2011 12:36, schrieb Ed Beroset:
Andreas wrote:
Am 11.02.2011 00:06, schrieb Guy Harris:
> They weren't omitted on purpose. They were probably omitted because
> they were added by a UN*X user; by default, UN*X dynamic shared
> libraries export every non-static symbol, unlike Windows DLLs.

I think this is a strong argument to move away from the export
definition in DEF file to a decoration in the header file. With the
prefix like i.e. WIRESHARK_API(1) you can decorate any function that is
intended to be public available.
I wonder if there's a way to do this by looking at whether the function
is declared static or not.
This might be easy. If all .obj files that are linked in the directory epan you can do
  cd epan
  dumpbin /symbols *.obj | find /v "UNDEF" | find "External"

and get all non-static symbols in this format:

0 SECT4  notype ()    External     | _rval_to_str
0 SECT4  notype ()    External     | _match_strrval_idx
0 SECT4  notype ()    External     | _match_strrval
0 SECT4  notype       External     | _ftype_vals
0 SECT4  notype       External     | _stype_vals
0 SECT4  notype       External     | _modifier_vals_cmd
0 SECT4  notype       External     | _modifier_vals_resp
0 SECT6  notype ()    External     | _get_xdlc_control
0 SECT6  notype ()    External     | _check_xdlc_control
0 SECT6  notype ()    External     | _dissect_xdlc_control

The 4th column may be used for the DATA modifier in the .DEF file. The last column holds just the name.
This might be a starting point. But there have been removed some symbols 
from the .DEF file, since they are intentionally "internal" functions.
--
Andy