9716 unterminated %{ escape causes endless loop
Clean up memory handling and other aspects of xpidl. Fixes
11058 bad free in xpidl
13464 memory leak in xpidl
Store doc comments in IDL-processing phase, and emit them into generated header files. Fixes
24734 xpidl should emit doc comments
Add error towards fixing 24965, and fix 13100 'xpidl should error on multiple inheritance'
r=jband
* fix 20833 - generate numbers of appropriate form in header output mode for short, long, signed or unsigned IDL consts. Thanks to bratell@lysator.liu.se for finding this and confirming the fix.
* fix 11199, remove .h output file on failure - partially generated files caused trouble, as they had the proper timestamp to fool 'make' next time around. Punted on mac.
* Restore Mac hack to fix \r to \n, requested by Beard.
* Make 'const decl must be short or long' warning into error for typelib mode. This mirrors an existing error in header mode.
* Fix up various aspects of xpidl, including:
- Move shared functions from xpidl_idl.c and xpidl.c 'main' module to new xpidl_util.c.
- Recast nodehandler-table-per-backend as 'backend' struct, including broken-out prolog and epilog functions. Replaces overloaded IDLN_NONE node handler that did prolog code on non-null tree, epilog on null. Move backends to new API.
- Rename a few structs more logically.
- Add a new list to track files included from the base .idl file, for generated #includes in output header file. This replaces using the 'already-included' hashtable for this purpose, and lets us generate just the minimal set of #includes, in the order they occured in the .h file.
- Various fixes to quiet xpidl warnings.
- Change main() to only accept one input file from the command line, because the basename code assumes this, and multiple files aren't needed by our make system.
r=jband
- Fix to bug 17013; have xpidl produce an error when encountering a native declaration without an associated (c++-name).
- remove many DEBUG_shaver lines.
- provide xpidl_tree_warning as a fallback for libIDL versions for which IDL_tree warning is bad, and NULL-proof our message callback function. Also remove a 1k buffer limit from the message callback function.
- make enum in IDL files an error. We don't support it, and love consts instead.
- Fix to 12684; don't allow [retval] parameter + return or multiple [retval] parameters.
- Fix to 13390; make non-{short,long} const a fatal error.
As this changed the generated interface signatures, I had to change all of the uses to avoid bustage. Any corners of the browser that aren't built by default, or that I haven't discovered how to build, may be at risk of bustage if they use string or wstring attributes. (This could mean blackwood; sorry, guys!)
Many thanks to Alec Flett (alecf@netscape.com) for preparing diffs for the mailnews portion of the signature changes; thanks also to Ariel Backenroth (arielb@rice.edu) and Mike Shaver (shaver@mozilla.org) for help with updating the tree with NS_DECL_NSIFOO macros; everwhere where one of these macros was used was one less place I had to manually add 'const'.
Also removed extraneous space from generated method signatures, leftover from Brendan's capitalization spam, and made 'const decl must be of type short or long' an error rather than just a warning.
Fix bug where both GetFoo and SetFoo prototypes were generated into the NS_DECL_NSIFOO macro for readonly attributes. Thanks go to jband for catching this.
Also included are various architectural changes to support this, (which required descending the interface and method subtree of the IDL parse tree an extra time) including abstracting out the write_method_signature and write_attr_accessor methods so that they can be called both when generating the interface and when generating the macro.
Purged passing the single TreeState parameter from several leaf functions, and broke it out into parameters foo_tree and output file. This saved a lot of tree->state twiddling when calling tree-descent functions.
This checkin will cause depend builds to rebuild most of the tree, so be patient...
Error if an interface is declared [scriptable], but contains methods that can't be scripted because they refer to native-declared types, unless the method is declared [noscript].
This change is intended to make it easier to determine when an interface is not scriptable, and to make it easier to see what changes need to be made to make it scriptable.
As many of the .idl files in the tree defined [scriptable] interfaces that contained non-scriptable methods, I've sprinkled [noscript] throughout. As the interfaces weren't scriptable anyway, this shouldn't change their visibility to javascript.
- Added xpidl_sprint_iid method for printing an nsID to a string.
- Removed "this is a gross hack" code for parsing and printing iids, and replaced with calls to xpidl_sprint_iid
- Made write_classname_iid_define() void, and removed cluttering tests against its failure.
- Cleaned up.