diff --git a/CVSROOT/checkoutlist b/CVSROOT/checkoutlist deleted file mode 100644 index 2921bff..0000000 --- a/CVSROOT/checkoutlist +++ /dev/null @@ -1,13 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [][] -# -# comment lines begin with '#' diff --git a/CVSROOT/commitinfo b/CVSROOT/commitinfo deleted file mode 100644 index b19e7b7..0000000 --- a/CVSROOT/commitinfo +++ /dev/null @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff --git a/CVSROOT/config b/CVSROOT/config deleted file mode 100644 index 92c150b..0000000 --- a/CVSROOT/config +++ /dev/null @@ -1,21 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Put CVS lock files in this directory rather than directly in the repository. -#LockDir=/var/lock/cvs - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no - -# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the -# history file, or a subset as needed (ie `TMAR' logs all write operations) -#LogHistory=TOEFWUPCGMAR - -# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg -# script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra -# second per directory being committed, so it is not recommended for large -# repositories. Set it to `never' (the previous CVS behavior) to prevent -# verifymsg scripts from changing the log message. -#RereadLogAfterVerify=always diff --git a/CVSROOT/cvswrappers b/CVSROOT/cvswrappers deleted file mode 100644 index e989b75..0000000 --- a/CVSROOT/cvswrappers +++ /dev/null @@ -1,19 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b' diff --git a/CVSROOT/editinfo b/CVSROOT/editinfo deleted file mode 100644 index d78886c..0000000 --- a/CVSROOT/editinfo +++ /dev/null @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. diff --git a/CVSROOT/loginfo b/CVSROOT/loginfo deleted file mode 100644 index 537607d..0000000 --- a/CVSROOT/loginfo +++ /dev/null @@ -1,27 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# t = tag or branch name -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog diff --git a/CVSROOT/modules b/CVSROOT/modules deleted file mode 100644 index cb9e9ef..0000000 --- a/CVSROOT/modules +++ /dev/null @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository. diff --git a/CVSROOT/notify b/CVSROOT/notify deleted file mode 100644 index 74ae6f9..0000000 --- a/CVSROOT/notify +++ /dev/null @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail -s "CVS notification" %s diff --git a/CVSROOT/rcsinfo b/CVSROOT/rcsinfo deleted file mode 100644 index 49e59f4..0000000 --- a/CVSROOT/rcsinfo +++ /dev/null @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff --git a/CVSROOT/taginfo b/CVSROOT/taginfo deleted file mode 100644 index 274a46d..0000000 --- a/CVSROOT/taginfo +++ /dev/null @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff --git a/CVSROOT/verifymsg b/CVSROOT/verifymsg deleted file mode 100644 index 86f747c..0000000 --- a/CVSROOT/verifymsg +++ /dev/null @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. diff --git a/jacobgen/.cvsignore b/jacobgen/.cvsignore deleted file mode 100644 index ebf9efe..0000000 --- a/jacobgen/.cvsignore +++ /dev/null @@ -1,13 +0,0 @@ -jacob.dll -jacob.jar -jacobdll.jar -*.zip -RELEASE.txt -.project -.classpath -compilation_tools.properties -version.properties -release -.externalToolBuilders -.cdtproject - diff --git a/jacobgen/LICENSE.txt b/jacobgen/LICENSE.txt deleted file mode 100644 index b6f92f3..0000000 --- a/jacobgen/LICENSE.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/jacobgen/README.txt b/jacobgen/README.txt deleted file mode 100644 index 20181c5..0000000 --- a/jacobgen/README.txt +++ /dev/null @@ -1,29 +0,0 @@ -======================================================= -Jacobgen basic readme.txt -Most documentation is being moved to the docs directory -======================================================= - -Description ------------ -Jacobgen generates java class wrappers microsoft DLLs -that make them callable from java programs. The class -are built on top of the Jacob (Java-COM Bridge) project. -This library is ONLY useful if you are running Jacob. - -Running Jacobgen ----------------- -See docs/run_jacobgen.bat for an example script that -runs jacobgen - -ReleaseNotes and Technical Issues ---------------------------------- -see docs/ReleaseNotes.html - -Credits -------- -see docs/credits.txt - -History -------- -See docs/ReleaseNotes.html - \ No newline at end of file diff --git a/jacobgen/build.xml b/jacobgen/build.xml deleted file mode 100644 index 7484183..0000000 --- a/jacobgen/build.xml +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Building java classes... - - Building java sample classes... - - Building java test classes... - - - - - Removing old jars - - Packaging java classes... - - - - - - - - - -
- - - - -
-
-
-
- - - - - - - - - - - - - - - Clean up the target folders and file, for safety - - Compiling C++ classes with JDK JNI library ${JDK} - - - - - - - - - - - - - - - - - - - - - Clean up the target folders and file, for safety - - Creating dll_fullpath - - - - - - - - - - - - - - - - - - - - - - - - - - ${application.title}]]> - ${application.vendor}]]> - - - - - - - - - - - - - - Packaging release... ${jarfile_fullpath} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- diff --git a/jacobgen/docs/HowToBuild.txt b/jacobgen/docs/HowToBuild.txt deleted file mode 100644 index 2518ed6..0000000 --- a/jacobgen/docs/HowToBuild.txt +++ /dev/null @@ -1,48 +0,0 @@ -To build and run: - -Unpack the source archive or check the files out of CVS into d:\jacobgen - -Install the following tools - Microsoft Visual Studio, a stripped down version is available from the MS web site. - Eclipse from www.eclipse.org. - Java jdk 1.4 (this was built using 1.4.2.09) - -The following configuration was used by most of the development team: - JDK = d:\j2sdk1.4.2_09 - DEST_DIR = d:\jacobgen - MSDEVDIR = d:\apps\\"Microsoft Visual Studio"\VC98 - -This project has been converted completely over to ANT. You can -run ANT from inside of eclipse or from the command line. -The ant process is driven off of a configuration file -compilation_tools.properties. Instructions on the information required -in that file are contained in build.xml in the root directory. - -Ant, via build.xml will do the following with teh default target. - Build the Java code - Build the jni code - create the dll - create jar file - -The package target creates the - javadoc and - zip files - -ECLIPSE - -Eclipse users will have to do some minor tweaks to their project if they -want to use the integrated build process. This is because the unit -tests are files located in the "unittest" directory while -the project source files themselves are in "src" the root directory. - Eclipse automatically adds the whole project as a source directory - Remove the root of the project from the build path - Add folders samples, src and unittest to the build path - Exclude *.txt from each of the newly added folders. - -The Servlet examples that required j2ee libraries to compile have temporarily -been removed. - -The java code is in .\src -The C++ code is in .\jni. - -Last Modified 10/2005 diff --git a/jacobgen/docs/ReleaseNotes.html b/jacobgen/docs/ReleaseNotes.html deleted file mode 100644 index 3e17788..0000000 --- a/jacobgen/docs/ReleaseNotes.html +++ /dev/null @@ -1,101 +0,0 @@ - - -Jacobgen Release Notes - - -This document descibes the known changes made to Jacobgen across releases. -(Dates in this document are in the format yy/mm/dd) - -

Version 0.7 (06/04/28)

-
    -
  • BUG-FIX: 1460974 Replaced samskivert.jar with viztool.jar for jdk1.5 compatibility. -
  • BUT-FIX: 1478303 Fixed jacobgen to now generate compilable Date related code. -
- -

Version 0.6 (05/12/07)

-
    -
  • BUG-FIX: changed code generator for in/out parameters toVariant() and putVariantRef() -
- -

Version 0.5 (05/10/14)

-
    -
  • PROJECT: source code moved to jacob-project on sourceforge -
  • PROJECT: converted from makefile to ant -
  • PROJECT: compiles on XP -
- -

Version 0.4 (04/03/02)

-
    -
  • UPGRADE: support for middle argument list optional parameters (with Variant.noParam()) -
  • UPGRADE: support for out-parameters (thanks to Hannes Reisinger) -
  • UPGRADE: MSMQ 2.0 support. Almost. -
  • UPGRADE: now you can check tlbs using TypeLibInspector.main(), see testJacobgendll.bat -
  • BUG-FIX: corrected class attributes (only for VAR_CONST) -
  • BUG-FIX: corrected return code for SafeArray type (thanks to Bill Kelemen) -
  • UPGRADE: added AliasGenerator to create TKIND_ALIAS classes (reported by Richard Range) -
  • UPGRADE: alias of enums support -
- -

Version 0.3 (04/01/02)

-
    -
  • BUG-FIX: change to Dispatch.call() to support more than 8 method parameters -
  • UPGRADE: COM Date support (thanks to rev) -
  • UPGRADE: CLASSPATH searching for type referenced outside the component. - Warning: classes searching is based on class name. If different jars or - packgages contains the same class the result is unknown. -
  • BUG-FIX: better Enum identification. Now works with Excel8 -
  • BUG-FIX: Excel8 caused VM crash due to buffer size limitations -
  • BUG-FIX: the generator didn't produce last class in TLB file (thanks to Liz Heine) -
-

Version 0.2

-

Version 0.1

- -(**) Dates are in italian format (dd/mm/yy) - -
-

Known Issues

-
    -
  • The wrapper classes will require a little hand tweaking - in most situations to get them to compile. -
  • Some methods will be generated more than once if they are - detected in a "class" more than once. -
  • This will generate the wrappers for most of a DLL but - will sometimes run into problems with unrecognized types. - A good example is MSWord. It will generate a lot of classes - but will have problems with some so the wrappers will have - to be hand tweaked in roder to work. -
  • EVENTS and STRUCTURES. Not supported -
  • VT_PTR type is not well supported -
- - -

Features

-
    -
  • TLB/OLB/DLL inspection via native code -
  • IN/OUT/OPTIONAL parameters support -
- -
    -
  • Office8/Excel8/Word8 wrapper generation -
  • MSMQ 2.0 wrapper generation (Almost) -
  • Lotus Domino wrapper generation (Almost) -
- - -

Data Mapping Notes

-
    -
  • SafeArray by reference are passed as arrays -
  • MsoRGBType mapped to int -
  • Enum types mapped to int -
- - - -

Application LIMITATIONS

-
    -
  • Acrobat Reader. Jacobgen is unable to parse Acrobat Reader OCX. I'm still investigating - this issue. By now you need to wrap it inside an another COM component. -
- - - \ No newline at end of file diff --git a/jacobgen/docs/credits.txt b/jacobgen/docs/credits.txt deleted file mode 100644 index c7cc577..0000000 --- a/jacobgen/docs/credits.txt +++ /dev/null @@ -1,6 +0,0 @@ -This is the brainchild of Massimiliano Bigatti. All original work copyright -Massimiliano Bigatti and licensed under LGPL by Massimiliano Bigatti - -+ Jacobgen out parameters are contrib of Hannes Reisinger -+ Jacobgen now depends on Sam Skivert library and viztool (only some classes are - provided with Jacobgen - license is GPL and LGPL) diff --git a/jacobgen/docs/run_jacobgen.bat b/jacobgen/docs/run_jacobgen.bat deleted file mode 100644 index 851b027..0000000 --- a/jacobgen/docs/run_jacobgen.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off -cls - -REM run this from the root directory of the Jacobgen project -REM it will spit out the interface classes for a dll you pass in as a parameter -REM sample command line while sitting in the JACOBGEN project directory -REM -REM The following command built a sample in the jacob directory I have -REM installed near my jacobgen proejct directory -REM $ docs/run_jacobgen.bat -destdir:"..\jacob\samples" -listfile:"jacobgenlog.txt" -package:com.jacobgen.microsoft.msword "C:\Program Files\Microsoft Office\OFFICE11\MSWORD.OLB" -REM -REM -set JAVA_HOME=D:\j2sdk1.4.2_09 -set JRE=%JAVA_HOME%\bin\java - -set JACOBGEN_HOME=. -set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\dt.jar;%JACOBGEN_HOME%\release\jacobgen.jar;%JACOBGEN_HOME%\lib\viztool.jar -REM put the dll in the path where we can find it -set PATH=%PATH%;%JACOBGEN_HOME%\release - -rem echo %CLASSPATH% - -%JRE% -Xint com.jacob.jacobgen.Jacobgen %1 %2 %3 %4 %5 -pause diff --git a/jacobgen/docs/todo.txt b/jacobgen/docs/todo.txt deleted file mode 100644 index ce460e2..0000000 --- a/jacobgen/docs/todo.txt +++ /dev/null @@ -1,5 +0,0 @@ -Upgrade javadoc comments generation -Events -Structures -Better Array support -VT_PTR support diff --git a/jacobgen/jni/TypeLibInspector.cpp b/jacobgen/jni/TypeLibInspector.cpp deleted file mode 100644 index e69be5c..0000000 --- a/jacobgen/jni/TypeLibInspector.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/* - * Jacobgen.cpp - * Copyright (C) 2000 Massimiliano Bigatti - * - * 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 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. - */ -#include -#include -#include -#include -#include -// W2A conversion for converting BSTR to LPCTSTR -#include -#include -#include "TypeLibInspector.h" - -extern "C" -{ -LPTSTR buffer; -LPTSTR current_position; - - -/** - * Java_com_jacob_jacobgen_TypeLibInspector_queryInterface - * - * Main Java function - */ -JNIEXPORT jbyteArray JNICALL Java_com_jacob_jacobgen_TypeLibInspector_queryInterface -(JNIEnv *env, jobject jobj, jstring name) { - - jbyteArray jb; - jboolean iscopy; - int cchWideChar; - LPWSTR wname; - LPCSTR sname; - - buffer = NULL; - // could we just get the unicode characters to bein with? - sname = env->GetStringUTFChars( name, &iscopy ); - cchWideChar = strlen( sname ) * 2; - wname = (LPWSTR)malloc( cchWideChar ); - - //Perform conversion from non Unicode to Unicode string - int i = MultiByteToWideChar(CP_ACP,0,sname,strlen(sname),wname,cchWideChar); - printf("converted %s to %ls\n",sname,wname); - - CoInitialize( 0 ); - printf("calling ExtractTypeLib with %ls",wname); - ExtractTypeLib( wname ); - CoUninitialize(); - - if( buffer == NULL ) { - buffer = (char * )malloc( 1 ); - if( buffer != NULL ){ - *buffer = '\0'; - } - } - - //Construct return Java byte array - size_t dim = strlen( buffer ); - jb = env->NewByteArray( dim ); - env->SetByteArrayRegion( jb, 0, dim, (jbyte *)buffer ); - - return jb; -} -/** - * ExtractTypeLib - * - * Extract type lib information from specified file. It produces - * formatted output that the Generator is able to convert in source - * java files. - * - */ -void ExtractTypeLib( LPWSTR pszFileName ) -{ - LPTYPELIB pITypeLib; - - printf("trying to extract library %ls\n", pszFileName); - buffer = (LPTSTR )malloc( BUF_SIZE ); - if( buffer == NULL ) - { - _tprintf( _T("Jacobgen: unable to allocate temporary buffer\n") ); - return; - } - current_position = buffer; - HRESULT hr = LoadTypeLib( pszFileName, &pITypeLib ); - if ( S_OK != hr ) - { - append1( "ERROR: LoadTypeLib failed" ); - return; - } - - EnumTypeLib( pITypeLib ); - pITypeLib->Release(); -} - -void EnumTypeLib( LPTYPELIB pITypeLib ) -{ - UINT tiCount = pITypeLib->GetTypeInfoCount(); - printf("enumerating %d\n",tiCount); - //Extract Type lib name - BSTR pLibName; - pITypeLib->GetDocumentation(-1, &pLibName, NULL, 0, NULL ); - append2b("TYPELIB %ls\n", pLibName ); - - //hr = ptlib->GetDocumentation(-1, &pTypeLibrary->m_bstrName, &pTypeLibrary->m_bstrDocumentation, - // &pTypeLibrary->m_ulHelpContext, &pTypeLibrary->m_bstrHelpFile); - - for ( UINT i = 0; i < tiCount; i++ ) - { - LPTYPEINFO pITypeInfo; - - HRESULT hr = pITypeLib->GetTypeInfo( i, &pITypeInfo ); - - if ( S_OK == hr ) - { - ExtractTypeInfo( pITypeInfo ); - - pITypeInfo->Release(); - } - } -} - -void ExtractTypeInfo( LPTYPEINFO pITypeInfo ) -{ - HRESULT hr; - - BSTR pszTypeInfoName; - hr = pITypeInfo->GetDocumentation(MEMBERID_NIL, &pszTypeInfoName, 0, 0, 0); - if ( S_OK != hr ) - return; - printf("retrieved documentation %ls\n",pszTypeInfoName); - TYPEATTR * pTypeAttr; - hr = pITypeInfo->GetTypeAttr( &pTypeAttr ); - if ( S_OK != hr ) - { - printf("failed to get attribute!!!!!!!\n"); - SysFreeString( pszTypeInfoName ); - return; - } - - //append3("CLASS %ls;%ls\n", pszTypeInfoName, - append3("CLASS %ls;%s\n", pszTypeInfoName, - GetTypeKindName(pTypeAttr->typekind) ); - - if( pTypeAttr->typekind == TKIND_ALIAS ) { - TYPEDESC tdesc; - tdesc = pTypeAttr->tdescAlias; - - if( tdesc.vt == VT_PTR ) { - tdesc = *tdesc.lptdesc; - } - - if( tdesc.vt == VT_USERDEFINED ) { - BSTR pszRefFuncName = GetUserDefinedType( pITypeInfo, tdesc ); - if( pszRefFuncName ) { - append2b("EXTENDS;%ls\n",pszRefFuncName ); - SysFreeString( pszRefFuncName ); - } - } else { - append2("%EXTENDS;%ls\n",GetVarTypeName( tdesc.vt ) ); - } - } else - EnumTypeInfoMembers( pITypeInfo, pTypeAttr ); - - SysFreeString( pszTypeInfoName ); - - pITypeInfo->ReleaseTypeAttr( pTypeAttr ); -} - -void EnumTypeInfoMembers( LPTYPEINFO pITypeInfo, LPTYPEATTR pTypeAttr ) -{ - FUNCDESC * pFuncDesc; - BSTR pszFuncName; - ELEMDESC elemdesc; - TYPEDESC tdesc; - - if ( pTypeAttr->cImplTypes ) { - for ( unsigned i = 0; i < pTypeAttr->cImplTypes; i++ ) { - - LPTYPEINFO pImplInfo; - HREFTYPE hRefType; - - pITypeInfo->GetRefTypeOfImplType( i, &hRefType ); - pITypeInfo->GetRefTypeInfo( hRefType, &pImplInfo ); - - if( pImplInfo != NULL ) { - pImplInfo->GetDocumentation(MEMBERID_NIL, &pszFuncName,0,0,0); - append2b("EXTENDS;%ls",pszFuncName ); - } - append1("\n"); - SysFreeString( pszFuncName ); - } - } - - if ( pTypeAttr->cFuncs ) { - for ( unsigned i = 0; i < pTypeAttr->cFuncs; i++ ) { - - pITypeInfo->GetFuncDesc( i, &pFuncDesc ); - pITypeInfo->GetDocumentation(pFuncDesc->memid, &pszFuncName,0,0,0); - - append2("%ls;", GetInvokeKindName(pFuncDesc->invkind) ); - - elemdesc = pFuncDesc->elemdescFunc; - //PARAMDESC pdesc; //PENDING - //pdesc = elemdesc.paramdesc; - tdesc = elemdesc.tdesc; - - //If type type is pointer, dereference - if( tdesc.vt == VT_PTR ) { - tdesc = *tdesc.lptdesc; - } - - //Check for user defined types - //append2("%ls",GetVarTypeName( tdesc.vt ) ); - if( tdesc.vt == VT_USERDEFINED ) { - //append1( "^" ); - BSTR pszRefFuncName = GetUserDefinedType( pITypeInfo, tdesc ); - if( pszRefFuncName ) { - append2b("%ls",pszRefFuncName ); - SysFreeString( pszRefFuncName ); - } - } else - append2("%ls",GetVarTypeName( tdesc.vt ) ); - - append2b(" ;%ls;",pszFuncName ); - - //Extract function parameters - EnumParameters( pITypeInfo, pFuncDesc ); - - pITypeInfo->ReleaseFuncDesc( pFuncDesc ); - SysFreeString( pszFuncName ); - } - } - - if ( pTypeAttr->cVars ) - { - - for ( unsigned i = 0; i < pTypeAttr->cVars; i++ ) - { - VARDESC * pVarDesc; - - pITypeInfo->GetVarDesc( i, &pVarDesc ); - - BSTR pszVarName; - pITypeInfo->GetDocumentation(pVarDesc->memid, &pszVarName,0,0,0); - VARIANT *pvarValue = pVarDesc->lpvarValue; - - //_tprintf( _T(" %ls\n"), pszVarName ); - append2("%ls;", GetVarKindName( pVarDesc->varkind ) ); - append2b("%ls;",pszVarName ); - - if( pVarDesc->varkind == VAR_CONST ) { - if(pvarValue!=NULL) - append2("%ls;", GetVarTypeName( pvarValue->vt ) ); - else - append1("UNKNOWN" ); - - LPTSTR s = GetVarDefaultValue( pvarValue ); - append1( s ); - free( (void *)s ); - } - - append1("\n"); - - pITypeInfo->ReleaseVarDesc( pVarDesc ); - SysFreeString( pszVarName ); - } - } - -} - -/** - * For a USERDEFINED typedesc, extract the referred type - */ -BSTR GetUserDefinedType( LPTYPEINFO pITypeInfo, TYPEDESC tdesc ) { - HREFTYPE htype; - LPTYPEINFO ppTInfo = NULL; - HRESULT hr; - BSTR pszRefFuncName = NULL; - - if( tdesc.vt == VT_USERDEFINED ) { - htype = tdesc.hreftype; - - hr = pITypeInfo->GetRefTypeInfo( htype, &ppTInfo ); - if( ppTInfo ) - ppTInfo->GetDocumentation(MEMBERID_NIL, &pszRefFuncName, 0, 0, 0); - } - - return pszRefFuncName; -} - -void EnumParameters( ITypeInfo *pTypeInfo, FUNCDESC *pFuncDesc ) { - TYPEDESC tdesc; - - unsigned int cMaxNames = pFuncDesc->cParams; //+ pFuncDesc->cParamsOpt; - unsigned int pcNames; - - BSTR rgBstrNames[ 100 ]; - MEMBERID pMemId[ 100 ]; - - pTypeInfo->GetNames( pFuncDesc->memid, rgBstrNames, cMaxNames, &pcNames ); - pTypeInfo->GetIDsOfNames( rgBstrNames, pcNames, pMemId ); - - append1( "[" ); - for ( unsigned k = 0; k < pcNames; k++ ) - { - BSTR pszParName = rgBstrNames[ k ]; - - PARAMDESC pd = pFuncDesc->lprgelemdescParam[k].paramdesc; - - if( pd.wParamFlags != 0 ) { - append1( "{" ); - - if( pd.wParamFlags & PARAMFLAG_FIN ) - append1( "in-" ); - if( pd.wParamFlags & PARAMFLAG_FOUT ) - append1( "out-" ); - if( pd.wParamFlags & PARAMFLAG_FRETVAL ) - append1("retval-" ); - if( pd.wParamFlags & PARAMFLAG_FOPT ) - append1("optional-" ); - - append1( "}" ); - } - /* - VARTYPE vt = pFuncDesc->lprgelemdescParam[k].tdesc.vt; - if( vt == VT_PTR ) { - TYPEDESC *pPointedAt = pFuncDesc->lprgelemdescParam[k].tdesc.lptdesc; - vt = pPointedAt->vt; - append2( "%ls", GetVarTypeName( vt ) ); - } else if( vt == VT_SAFEARRAY ) { - TYPEDESC *pPointedAt = pFuncDesc->lprgelemdescParam[k].tdesc.lptdesc; - vt = pPointedAt->vt; - append2( "SAFEARRAY(%ls)", GetVarTypeName( vt ) ); - } else { - append2( "%ls", GetVarTypeName( vt ) ); - } - */ - - //If type type is pointer, dereference - tdesc = pFuncDesc->lprgelemdescParam[k].tdesc; - if( tdesc.vt == VT_PTR ) { - tdesc = *tdesc.lptdesc; - } - - //Check for user defined types - if( tdesc.vt == VT_USERDEFINED ) { - BSTR pszRefFuncName = GetUserDefinedType( pTypeInfo, tdesc ); - if( pszRefFuncName ) { - append2b("%ls",pszRefFuncName ); - SysFreeString( pszRefFuncName ); - } - } else - append2("%ls",GetVarTypeName( tdesc.vt ) ); - - if( k < pcNames-1 ) - append2b( " %ls,", rgBstrNames[k+1] ); - else - append1( " LastParam" ); - - } - append1("]\n" ); - -} - -/** - * Append a char array to destination buffer - */ -void append1( LPTSTR string ) { - LPTSTR s; - - s = string; - while( *s != '\0' ) { //TODO: add bound check - *current_position = *s; - s++; - current_position++; - } - - *current_position = '\0'; -} - -void append2b ( LPTSTR format, BSTR s1){ - append2c(format,s1); -} - -void append2c ( LPTSTR format, LPCWSTR s1){ - LPTSTR s; - //printf("append2c: '%s' %ls -- ",format, s1); - size_t dim = (wcslen( s1 )+ strlen(format)+1) * 2; - //printf("allocating %d -- ", dim); - //size_t dim = _tcslen( s1 ) * sizeof(_TCHAR) * 2; - - if( (dim > 0) ) { - s = (LPTSTR )malloc( dim ); - if( s != NULL ) { - *(s + dim - 1) = '\0'; - sprintf( s, format, s1 ); - //printf("generated %s\n", s); - append1( s ); - free( s ); - } - } -} - -/** - * Copy a generic text string to a char array and copies it - * to destination array - */ -void append2( LPTSTR format, LPCTSTR s1 ) { - //printf("append2 %s\n",s1); - USES_CONVERSION; - append2c(format,A2W(s1)); -} - -/** - * Copy two generic text strings to a char array and copies it - * to destination array - */ -void append3( LPTSTR format, BSTR s1, LPCTSTR s2 ) { - LPCWSTR wideS2; - LPTSTR s; - USES_CONVERSION; - wideS2 = A2W(s2); - int formatLength = strlen(format); - int width1 = wcslen(s1); - int width2 = wcslen(wideS2); - size_t dim = ( formatLength+ width1 + width2 +1 ) * 2; - //size_t dim = ( _tcslen( s1 ) + _tcslen( wideS2 ) ) * sizeof(_TCHAR) * 2; - - if( width1 > 0 && width2 > 0 ) { - s = (LPTSTR )malloc( dim ); - if( s != NULL ) { - *(s + dim - 1) = '\0'; - sprintf( s, format, s1, s2 ); - append1( s ); - free( s ); - } - } -} - - -#define CASE_STRING( x ) case x: s = _T(#x); break; - -LPCTSTR GetTypeKindName( TYPEKIND typekind ) -{ - LPTSTR s = _T(""); - - switch( typekind ) - { - CASE_STRING( TKIND_ENUM ) - CASE_STRING( TKIND_RECORD ) - CASE_STRING( TKIND_MODULE ) - CASE_STRING( TKIND_INTERFACE ) - CASE_STRING( TKIND_DISPATCH ) - CASE_STRING( TKIND_COCLASS ) - CASE_STRING( TKIND_ALIAS ) - CASE_STRING( TKIND_UNION ) - } - printf("found type %s\n"); - - return s; -} - -LPCTSTR GetInvokeKindName( INVOKEKIND invkind ) -{ - LPTSTR s = _T(""); - - switch( invkind ) - { - CASE_STRING( INVOKE_FUNC ) - CASE_STRING( INVOKE_PROPERTYGET ) - CASE_STRING( INVOKE_PROPERTYPUT ) - CASE_STRING( INVOKE_PROPERTYPUTREF ) - } - - return s; -} - -LPCTSTR GetVarTypeName( VARTYPE vt ) -{ - LPTSTR s = _T(""); - //LPTSTR s = _T(""); - - switch( vt ) - { - CASE_STRING( VT_EMPTY ) - CASE_STRING( VT_NULL ) - CASE_STRING( VT_I2 ) - CASE_STRING( VT_I4 ) - CASE_STRING( VT_R4 ) - CASE_STRING( VT_R8 ) - CASE_STRING( VT_CY ) - CASE_STRING( VT_DATE ) - CASE_STRING( VT_BSTR ) - CASE_STRING( VT_DISPATCH ) // IDispatch FAR* - CASE_STRING( VT_ERROR ) // Scodes - CASE_STRING( VT_BOOL ) - CASE_STRING( VT_VARIANT ) - CASE_STRING( VT_UNKNOWN ) // IUnknown FAR* - CASE_STRING( VT_I1 ) // Signed char. - CASE_STRING( VT_UI1 ) // Unsigned char. - CASE_STRING( VT_UI2 ) // Unsigned short. - CASE_STRING( VT_UI4 ) // Unsigned short. - CASE_STRING( VT_I8 ) // Signed 64-bit int. - CASE_STRING( VT_UI8 ) // Unsigned 64-bit int. - CASE_STRING( VT_INT ) // Signed machine int. - CASE_STRING( VT_UINT ) // Unsigned machine int. - CASE_STRING( VT_VOID ) // C-style void. - CASE_STRING( VT_HRESULT ) - CASE_STRING( VT_PTR ) // Pointer type. - CASE_STRING( VT_SAFEARRAY ) // Use VT_ARRAY in VARIANT. - CASE_STRING( VT_CARRAY ) // C-style array. - CASE_STRING( VT_USERDEFINED ) // User-defined type. - CASE_STRING( VT_LPSTR ) // Null-terminated string. - CASE_STRING( VT_LPWSTR ) // Wide null-terminated string. - CASE_STRING( VT_FILETIME ) // FILETIME. - CASE_STRING( VT_BLOB ) // Length-prefixed bytes. - CASE_STRING( VT_STREAM ) // Name of the stream follows. - CASE_STRING( VT_STORAGE ) // Name of the storage follows. - CASE_STRING( VT_STREAMED_OBJECT ) // Stream contains an object. - CASE_STRING( VT_STORED_OBJECT ) // Storage contains an object. - CASE_STRING( VT_BLOB_OBJECT ) // Blob contains an object. - CASE_STRING( VT_CF ) // Clipboard format. - CASE_STRING( VT_CLSID ) // A class ID. - CASE_STRING( VT_VECTOR ) // Simple counted array. - CASE_STRING( VT_ARRAY )// SAFEARRAY*. - CASE_STRING( VT_BYREF ) - CASE_STRING( VT_RESERVED ) - - //CASE_STRING( VT_USERDEFINED ) - //CASE_STRING( VT_RESERVED ) - //CASE_STRING( VT_BYREF ) // A pointer to data is passed - //CASE_STRING( VT_ARRAY ) // A safe array of the data is passed - } - - return s; -} - -LPCTSTR GetVarKindName( VARKIND vk ) -{ - LPTSTR s = _T(""); - - switch( vk ) - { - CASE_STRING( VAR_PERINSTANCE ) - CASE_STRING( VAR_STATIC ) - CASE_STRING( VAR_CONST ) - CASE_STRING( VAR_DISPATCH ) - } - - return s; -} - -LPTSTR GetVarDefaultValue( VARIANT *pv ) -{ - LPTSTR buf = (LPTSTR )malloc( 128 ); - - if( buf != NULL ) { - switch( pv->vt ) - { - case VT_I4: sprintf(buf, "%ld", pv->lVal ); break; - } - } - - return buf; -} - -} \ No newline at end of file diff --git a/jacobgen/jni/TypeLibInspector.h b/jacobgen/jni/TypeLibInspector.h deleted file mode 100644 index b408b8e..0000000 --- a/jacobgen/jni/TypeLibInspector.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Jacobgen.h - * Copyright (C) 2000 Massimiliano Bigatti - * - * 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 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. - */ -#include -/* Header for class com_jacob_jacobgen_TypeLibInspector */ - -#ifndef _Included_com_jacob_jacobgen_TypeLibInspector -#define _Included_com_jacob_jacobgen_TypeLibInspector -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_jacob_jacobgen_TypeLibInspector - * Method: queryInterface - * Signature: (Ljava/lang/String;)[B - */ -JNIEXPORT jbyteArray JNICALL Java_com_jacob_jacobgen_TypeLibInspector_queryInterface - (JNIEnv *, jobject, jstring); - -void ExtractTypeLib( LPWSTR pszFileName ); -void EnumTypeLib( LPTYPELIB pITypeLib ); -void ExtractTypeInfo( LPTYPEINFO pITypeInfo ); -void EnumTypeInfoMembers( LPTYPEINFO pITypeInfo, LPTYPEATTR pTypeAttr); -void EnumParameters( ITypeInfo *pTypeInfo, FUNCDESC *f ); - -BSTR GetUserDefinedType( LPTYPEINFO pITypeInfo, TYPEDESC tdesc ); - -LPCTSTR GetTypeKindName( TYPEKIND typekind ); -LPCTSTR GetInvokeKindName( INVOKEKIND invkind ); -LPCTSTR GetVarTypeName( VARTYPE vt ); -LPCTSTR GetVarKindName( VARKIND vk ); -LPTSTR GetVarDefaultValue( VARIANT *pv ); - -void append1( LPTSTR string ); -void append2( LPTSTR format, LPCTSTR s1 ); -void append2b( LPTSTR format, BSTR s1); -void append2c ( LPTSTR format, LPCWSTR s1); -void append3( LPTSTR format, BSTR bstr1, LPCTSTR s2 ); - -//Output buffer size -#define BUF_SIZE 5000000 - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/jacobgen/jni/makeh.bat b/jacobgen/jni/makeh.bat deleted file mode 100644 index d3a2e3c..0000000 --- a/jacobgen/jni/makeh.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -cls -REM This file uses javah to create the jni headers for a class -REM It will use the verbose naming convention - -set JAVA_HOME=D:\j2sdk1.4.2_09 -set JAVAH=%JAVA_HOME%\bin\javah -set CLASSPATH=%JAVA_HOME%\lib\classes.zip;src;release - -%JAVAH% -d jni -jni com.jacob.jacobgen.TypeLibInspector -pause diff --git a/jacobgen/lib/viztool.jar b/jacobgen/lib/viztool.jar deleted file mode 100644 index 553db19..0000000 Binary files a/jacobgen/lib/viztool.jar and /dev/null differ diff --git a/jacobgen/samples/README.txt b/jacobgen/samples/README.txt deleted file mode 100644 index 7502363..0000000 --- a/jacobgen/samples/README.txt +++ /dev/null @@ -1 +0,0 @@ -This file exists to make sure this directory hangs around until there are actual sample files to put in the samples directory \ No newline at end of file diff --git a/jacobgen/src/com/jacob/jacobgen/AbstractGenerator.java b/jacobgen/src/com/jacob/jacobgen/AbstractGenerator.java deleted file mode 100644 index 9038288..0000000 --- a/jacobgen/src/com/jacob/jacobgen/AbstractGenerator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * AbstractGenerator.java - * Copyright (C) 2000-2002 Massimiliano Bigatti - * - * 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 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. - */ -package com.jacob.jacobgen; - -import java.io.*; -import java.util.*; - -/** - * This class represents any of the Abstract classes generated by Jacobgen - * @version $Id$ - * - */ -public abstract class AbstractGenerator { - protected final String classHeader = - "/**\n" + - " * JacobGen generated file --- do not edit\n" + - " *\n" + - " * (http://www.sourceforge.net/projects/jacob-project"+ - " */\n"; - - protected String filename; - protected String typelibName; - protected String className; - protected String baseClass; - protected Vector classFields; - protected Vector classMethods; - protected String destinationPackage; - protected Writer w; - - protected boolean simpleEnums = true; - - protected AbstractGenerator( String filename, String typelibName, String destinationPackage, - String className, String baseClass, Vector classFields, Vector classMethods ) { - - this.filename = filename; - this.typelibName = typelibName; - this.className = className; - this.baseClass = baseClass; - this.classFields = classFields; - this.classMethods = classMethods; - this.destinationPackage =destinationPackage; - } - - public void generate() throws IOException { - w = new FileWriter( filename ); - w.write(classHeader); - - writePackageDeclaration(); - writeImports(); - writeClassDeclaration(); - writeFields(); - writeConstructors(); - writeMethods(); - writeEndings(); - writeClassClosing(); - - w.close(); - } - - protected void writeImports() throws IOException { - w.write( "import com.jacob.com.*;\n\n" ); - } - - protected void writePackageDeclaration() throws IOException { - if( destinationPackage != null && destinationPackage.trim().length() > 0 ) - w.write( "package " + destinationPackage + ";\n\n" ); - } - - protected abstract void writeClassDeclaration() throws IOException; - protected abstract void writeFields() throws IOException; - protected abstract void writeConstructors() throws IOException; - protected abstract void writeMethods() throws IOException; - protected void writeEndings() throws IOException { - } - - protected void writeClassClosing() throws IOException { - w.write( "}\n"); - } -} - diff --git a/jacobgen/src/com/jacob/jacobgen/AliasGenerator.java b/jacobgen/src/com/jacob/jacobgen/AliasGenerator.java deleted file mode 100644 index f1ac759..0000000 --- a/jacobgen/src/com/jacob/jacobgen/AliasGenerator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * AliasGenerator.java - * Copyright (C) 2002 Massimiliano Bigatti - * - * 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 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. - */ -package com.jacob.jacobgen; - -import java.io.*; - -/** - * This class creates any of the wrapper classes that map to a DLL object - * of type TKIND_ALIAS - * @version $Id$ - */ -class AliasGenerator extends AbstractGenerator { - - protected AliasGenerator( String filename, String typelibName, String destinationPackage, - String className, String baseClass ) { - super( filename, typelibName, destinationPackage, className, baseClass, - null, null ); - } - - protected void writeClassDeclaration() throws IOException { - w.write( "public interface " + className + " extends " + baseClass + " {\n\n" ); - } - - protected void writeFields() throws IOException { - } - - protected void writeConstructors() throws IOException { - } - - protected void writeMethods() throws IOException { - } - -} - diff --git a/jacobgen/src/com/jacob/jacobgen/ClassGenerator.java b/jacobgen/src/com/jacob/jacobgen/ClassGenerator.java deleted file mode 100644 index 01b9135..0000000 --- a/jacobgen/src/com/jacob/jacobgen/ClassGenerator.java +++ /dev/null @@ -1,508 +0,0 @@ -/* - * ClassGenerator.java - * Copyright (C) 2000-2002 Massimiliano Bigatti - * - * 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 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. - */ -package com.jacob.jacobgen; - -import java.io.*; -import java.util.*; - -/** - * The standard class generator for DLL entities of type - * TKIND_COCLASS and TKIND_DISPATCH - * - * @version $Id$ - * - */ -class ClassGenerator extends AbstractGenerator { - - public static String[] javaKeywords = { "goto", "default", "volatile", "import", - "new", "abstract"}; - - protected boolean containsDate = false; - - protected ClassGenerator( String filename, String typelibName, String destinationPackage, - String className, String baseClass, Vector classFields, Vector classMethods ) { - super( filename, typelibName, destinationPackage, className, baseClass, - classFields, classMethods ); - } - - protected void writeClassDeclaration() throws IOException { - w.write( "public class " + className + " extends " + baseClass + " {\n\n" ); - } - - protected void writeFields() throws IOException { - w.write("\tpublic static final String componentName = \"" + typelibName + "." + - className + "\";\n\n"); - } - - protected void writeConstructors() throws IOException { - if( baseClass.equals("Dispatch") ) { - writeConstructor1(); - writeConstructor2(); - writeConstructor4(); - } else - writeConstructor3(); - } - - protected void writeConstructor1() throws IOException { - w.write( "\tpublic " + className + - "() {\n\t\tsuper(componentName);\n\t}\n\n"); - } - - protected void writeConstructor2() throws IOException { - w.write("\t/**\n"); - w.write("\t* This constructor is used instead of a case operation to\n"); - w.write("\t* turn a Dispatch object into a wider object - it must exist\n"); - w.write("\t* in every wrapper class whose instances may be returned from\n"); - w.write("\t* method calls wrapped in VT_DISPATCH Variants.\n"); - w.write("\t*/\n"); - w.write("\tpublic " + className + "(Dispatch d) {\n"); - w.write("\t\t// take over the IDispatch pointer\n"); - w.write("\t\tm_pDispatch = d.m_pDispatch;\n"); - w.write("\t\t// null out the input's pointer\n"); - w.write("\t\td.m_pDispatch = 0;\n"); - w.write("\t}\n\n"); - } - - protected void writeConstructor4() throws IOException { - w.write( "\tpublic " + className + - "(String compName) {\n\t\tsuper(compName);\n\t}\n\n"); - } - - protected void writeConstructor3() throws IOException { - w.write( "\tpublic " + className + - "() {\n\t\tsuper(componentName);\n\t}\n\n"); - w.write("\tpublic " + className + "(Dispatch d) {\n"+ - "\t\tsuper(d);\n\t}\n"); - } - - protected void writeMethods() throws IOException { - Enumeration e = classMethods.elements(); - while( e.hasMoreElements() ) { - MethodItem mi = (MethodItem)e.nextElement(); - - if( mi.getMethodType() == MethodItem.METHODTYPE_FUNCTION || - mi.getMethodType() == MethodItem.METHODTYPE_PROPERTYGET || - mi.getMethodType() == MethodItem.METHODTYPE_PROPERTYPUT || - mi.getMethodType() == MethodItem.METHODTYPE_PROPERTYPUTREF ) { - - writeMethod( mi ); - if( mi.isAdditionalMethodRequired() ) - writeByRefMethod( mi ); - } - } - } - - protected void writeByRefMethod( MethodItem mi ) throws IOException { - ParameterItem[] parameters = mi.getParameters(); - - writeMethodDeclaration( mi, parameters.length, false ); - writeMethodBody( mi, parameters.length, false ); - } - - protected void writeMethod( MethodItem mi ) throws IOException { - ParameterItem[] parameters = mi.getParameters(); - - writeMethodDeclaration( mi, parameters.length, true ); - writeMethodBody( mi, parameters.length, true ); - - //Try to guess which overloaded methods to write - for( int i = parameters.length-1; i>=0; i-- ) { - ParameterItem p = parameters[i]; - - if( p.isOptional() ) { - writeMethodDeclaration( mi, i, true ); - writeMethodBody( mi, i, true ); - } - } - } - - /** - * This Method writes a short javadoc-comment in front of the method. - * Maybe in a future version the helpstring could be extracted an used - * instead the current weak description. - * @param mi the MethodItem which should be documented - * @param paramNum the count of parameters - * @param baseTypes is this a comment for method with only base types - * or is this a comment for method with output-parameters - * @throws IOException the used Writer could throw an IOException - */ - protected void writeMethodComment( MethodItem mi, int paramNum, - boolean baseTypes ) throws IOException { - // Short description of the method - w.write( "\t/**\n" ); - if ( baseTypes ) { - w.write( "\t * Wrapper for calling the ActiveX-Method with input-parameter(s).\n" ); - } else { - w.write( "\t * Wrapper for calling the ActiveX-Method and receiving the output-parameter(s).\n" ); - } - - // descriptions of the parameters - ParameterItem[] parameters = mi.getParameters(); - for ( int i = 0; i < paramNum; i++ ) { - ParameterItem p = parameters[i]; - if ( baseTypes || p.getDirection() == ParameterItem.DIRECTION_IN ) { - w.write( "\t * @param " + p.getJavaName() + " an input-parameter of type " + p.getType() + "\n" ); - } else { - // this is only necessary if we want to comment non-basetypes and if it is an output-parameter - char[] achParamSpace = new char[p.getJavaName().length()]; - Arrays.fill(achParamSpace, ' '); - // don't want to put a char array in a write() statement - String achParamSpaceString = new String(achParamSpace); - w.write( "\t * @param " + p.getJavaName() + " is an one-element array which sends the input-parameter\n" - + "\t * " + achParamSpaceString + " to the ActiveX-Component and receives the output-parameter\n" ); - } - } - - // and the return-value - if( !mi.getReturnType().equals("void") ) { - w.write( "\t * @return the result is of type " + mi.getReturnType() + "\n"); - } - - w.write( "\t */\n" ); - } - - protected void writeMethodDeclaration( MethodItem mi, int paramNum, - boolean baseTypes ) throws IOException { - String[] objectMethods = { "clone", "equals", "finalize", "getClass" - , "hashCode", "notify", "notifyAll", "toString", "wait" }; - - writeMethodComment(mi, paramNum, baseTypes); - - w.write( "\tpublic " ); - if( mi.getMethodType() == MethodItem.METHODTYPE_PROPERTYGET - && mi.getReturnType().trim().length() == 0 ) - w.write( "Variant" ); - else if( mi.getReturnType().trim().length() == 0 ) - w.write( "void" ); - else - w.write( mi.getReturnType() ); - - w.write( " " ); - - StringBuffer methodName = new StringBuffer(); - - //Change Method name if it is a property get or set - switch( mi.getMethodType() ) { - case MethodItem.METHODTYPE_FUNCTION: - if( checkForJavaKeywords( mi.getName() ) ) - methodName.append( "m_" ); - methodName.append( mi.getName().substring(0,1).toLowerCase() ); - methodName.append( mi.getName().substring(1) ); - break; - - case MethodItem.METHODTYPE_PROPERTYGET: - methodName.append( "get" ); - methodName.append( mi.getName() ); - break; - - case MethodItem.METHODTYPE_PROPERTYPUT: - case MethodItem.METHODTYPE_PROPERTYPUTREF: - methodName.append( "set" ); - methodName.append( mi.getName() ); - break; - } - - for( int i=0; i 8 ) - w.write("N"); - w.write("(this, \"" + mi.getName() + "\""); - if( paramNum > 0 ) - w.write(", "); - - if( paramNum > 8 ) - w.write( "new Object[] { " ); - - for( int i = 0; i < paramNum; i++ ) { - if( i!=0 ) - w.write( ", " ); - - ParameterItem p = parameters[i]; - if ( p.getDirection() == ParameterItem.DIRECTION_IN ) { - // if it is an input-parameter we use the normal behaviour - w.write( p.getParameterCallingCode() ); - } else { - // if it is an output-parameter we use the variant-variable - w.write( p.getVariantName() ); - } - } - - if( paramNum > 8 ) - w.write( "}" ); - - w.write( ")" ); - if( !mi.getReturnType().equals("void") ) - w.write( mi.getReturnConversionMethodCode() ); - - if( mi.isCustomReturnType() ) - w.write( ".toDispatch())" ); - - if( mi.getReturnType().equals("java.util.Date") ) - w.write( ")" ); - - w.write( ";\n\n" ); - - // If we are using paramters with return values we have to retrieve this - // values from the Varaints with to*(). This has to be done after the call. - // It should look like the following: lastParam[0] = param1.getInt(); - for( int i = 0; i < paramNum; i++ ) { - ParameterItem p = parameters[i]; - // this is only necessary if it is an output-parameter - if ( p.getDirection() == ParameterItem.DIRECTION_OUT ) { - w.write("\t\tif( "+p.getJavaName()+" != null && "+p.getJavaName()+".length > 0 )\n"); - if (p.getVariantGetMethod().equals("toVariant")){ - // 12/2005 hack to get get this to generate compileable code. - // Hopefully someone will look at this later and make sure it is correct - w.write("\t\t\t" +p.getJavaName() + "[0] = " +p.getVariantName() + ";\n"); - } else { - w.write("\t\t\t" + p.getJavaName() + "[0] = " + p.getVariantName() + "." + p.getVariantGetMethod() + "();\n"); - } - } - } - - // Now it is time to return the result - if( !mi.getReturnType().equals("void") ) { - w.write("\n\t\treturn result_of_" + mi.getName() + ";\n"); - } - } - - protected void writeFunctionMethodBody( MethodItem mi, int paramNum ) throws IOException { - w.write("\t\t"); - - if( !mi.getReturnType().equals("void") ) { - w.write("return "); - - if( mi.isCustomReturnType() ) - w.write("new " + mi.getReturnType() + "("); - } - - w.write("Dispatch.call"); - if( paramNum > 8 ) - w.write("N"); - w.write("(this, \"" + mi.getName() + "\""); - if( paramNum > 0 ) - w.write(", "); - - ParameterItem[] parameters = mi.getParameters(); - if( paramNum > 8 ) - w.write( "new Object[] { " ); - - for( int i = 0; i < paramNum; i++ ) { - if( i!=0 ) - w.write( ", " ); - - ParameterItem p = parameters[i]; - w.write( p.getParameterCallingCode() ); - } - - if( paramNum > 8 ) - w.write( "}" ); - - w.write( ")" ); - if( !mi.getReturnType().equals("void") ) - w.write( mi.getReturnConversionMethodCode() ); - - if( mi.isCustomReturnType() ) - w.write( ".toDispatch())" ); - - w.write( ";\n" ); - } - - protected void writeDateConversionCode() throws IOException { - w.write( "\tstatic long zoneOffset" ); - w.write( "\t= java.util.Calendar.getInstance().get(java.util.Calendar.ZONE_OFFSET);\n\n" ); -/* - w.write( "\tstatic java.util.Date comDateToJavaDate(double comDate) {\n"); - w.write( "\t\tcomDate = comDate - 25569D;\n"); - w.write( "\t\tlong millis = Math.round(86400000L * comDate) - zoneOffset;\n\n"); - w.write( "\t\tjava.util.Calendar cal = java.util.Calendar.getInstance();\n"); - w.write( "\t\tcal.setTime(new java.util.Date(millis));\n"); - w.write( "\t\tmillis -= cal.get(java.util.Calendar.DST_OFFSET);\n\n"); - w.write( "\t\treturn new java.util.Date(millis);\n"); - w.write( "\t}\n\n"); -*/ - w.write( "\tstatic double javaDateToComDate(java.util.Date javaDate) {\n\n"); - w.write( "\t\tjava.util.Calendar cal = java.util.Calendar.getInstance();\n"); - w.write( "\t\tcal.setTime(javaDate);\n"); - w.write( "\t\tlong gmtOffset = (cal.get(java.util.Calendar.ZONE_OFFSET) + cal.get(java.util.Calendar.DST_OFFSET));\n\n"); - w.write( "\t\tlong millis = javaDate.getTime() + gmtOffset;\n"); - w.write( "\t\treturn 25569D+millis/86400000D;\n"); - w.write( "\t}\n\n"); - } - - protected void writeEndings() throws IOException { - if( containsDate ) - writeDateConversionCode(); - } - - /* - protected String computeParamType( ParameterItem pi ) { - String result = "new Variant(" + pi.getName() + ")"; - if( pi.getType().equals("String" ) || pi.isObject() || pi.isCustomType() ) - result = pi.getName(); - - return result; - } - */ - - /** - * Change contents of StringBuffer if contains a Java Keyword. It should - * prevent compile errors. - */ - public static boolean checkForJavaKeywords( String s ) { - boolean result = false; - for( int i=0; i - * %JRE% -Xint com.jacob.jacobgen.Jacobgen %1 %2 %3 %4 %5 - * - * - * @version $Id$ - * @author Massimiliano Bigatti - */ -public class Jacobgen { - - public static final String version = "0.4"; - public static Jacobgen instance; - protected Vector methodsToAvoid; - - /** - * Package where to put generated classes - */ - protected String destinationPackage = ""; - - protected String destinationPath = ""; - - protected String typelibFilename = null; - - protected String tempFileName = null; - - protected Vector internalEnums = new Vector(); - - protected Hashtable externalClasses; - - private Jacobgen() { - methodsToAvoid = new Vector(); - methodsToAvoid.addElement( "QueryInterface" ); - methodsToAvoid.addElement( "AddRef" ); - methodsToAvoid.addElement( "Release" ); - methodsToAvoid.addElement( "GetTypeInfoCount" ); - methodsToAvoid.addElement( "GetTypeInfo" ); - methodsToAvoid.addElement( "GetIDsOfNames" ); - methodsToAvoid.addElement( "Invoke" ); - } - - protected void loadExternalClasses() { - String classpath = System.getProperty("java.class.path"); - ClassEnumerator aClassEnumerator = new ClassEnumerator(classpath); - - // print out the warnings - ClassEnumerator.Warning[] warnings = aClassEnumerator.getWarnings(); - for (int i = 0; i < warnings.length; i++) { - System.out.println("External Class Loader Warning: " + warnings[i].reason); - } - - externalClasses = new Hashtable(); - while (aClassEnumerator.hasNext()) { - String s = (String)aClassEnumerator.next(); - int p = s.lastIndexOf('.'); - externalClasses.put(s.substring(p+1), s); - } - } - - protected String getExternalClass( String className ) { - return (String)externalClasses.get( className ); - } - - public boolean isEnum( String className ) { - String fullClassName = null; - boolean result = internalEnums.contains( className.toLowerCase() ); - - //Check for pointed JARs. We assume that all enums are implemented - //as interfaces. - if( !result ) { - fullClassName = getExternalClass( className ); - if( fullClassName != null ) - try { - Class clazz = Class.forName( fullClassName ); - result = clazz.isInterface(); //Little hack - //if( result ) - // System.out.println("isEnum : " + fullClassName ); - - } catch( ClassNotFoundException ex1 ) { - } catch( NoClassDefFoundError ex2 ) { - } - } - - return result; - } - - public void generate() throws IOException { - - System.out.println("JACOBGEN " + version + ". Copyright 2000-2002 Massimiliano Bigatti. Relased under GNU GPL License"); - System.out.println("starting ..." ); - - //Create a list of external classes - loadExternalClasses(); - System.out.println("creating TypeLibInspector"); - //Query TypeLib informations - TypeLibInspector inspector = new TypeLibInspector(); - System.out.println("calling TypeLibInspector.queryInterface with "+typelibFilename); - byte[] typelibinfo = inspector.queryInterface(typelibFilename); - - //Convert byte array to a vector of lines - LineNumberReader reader = new LineNumberReader( new StringReader( new - String( typelibinfo ) ) ); - - Vector lines = new Vector(); - while( true ) { - String line = reader.readLine(); - if( line == null ) - break; - - lines.addElement( line ); - } - - if( tempFileName != null ) { - try { - File out = new File(tempFileName); - FileWriter fw = new FileWriter( out ); - - Enumeration e = lines.elements(); - while( e.hasMoreElements() ) { - fw.write( (String)e.nextElement() ); - fw.write( '\n' ); - } - - fw.close(); - - } catch( IOException io ) { - System.err.println("Unable to generate temporary output file\n"); - } - } - - generateClasses( lines ); - } - - protected void generateClasses( Vector lines ) throws IOException { - int count = 0; - boolean startClass = false; - Vector classMethods = null; - Vector classFields = null; - String className = ""; - String classType = ""; - String typelibName = ""; - String baseClass = ""; - - int enums = 0; - System.out.print("finding ENUMS ("+lines.size()+")... " ); - for( int i=0; i 0 ) - if( !destinationPath.endsWith( File.separator ) ) - destinationPath += File.separator; - - if( destinationPackage.length() > 0 ){ - directory = convertPackageToDir(destinationPackage) + File.separator; - } - - filename = destinationPath + directory + className + ".java"; - - System.out.println("Creating " + filename + " ..." ); - - File file = new File( destinationPath + directory ); - if( !file.exists() ){ - if( !file.mkdirs() ){ - System.err.println("Unable to create directories (" + destinationPath + directory + ") !" ); - } - } - - g = null; - if( classType.equals("TKIND_ENUM") ) { - g = new EnumGenerator( filename, typelibName, destinationPackage, className, baseClass, classFields, null ); - } else if( classType.equals("TKIND_COCLASS") ) { - g = new ClassGenerator( filename, typelibName, destinationPackage, className, baseClass, null, classMethods ); - } else if( classType.equals("TKIND_DISPATCH") ) { - g = new ClassGenerator( filename, typelibName, destinationPackage, className, baseClass, null, classMethods ); - } else if( classType.equals("TKIND_ALIAS") ) { - g = new AliasGenerator( filename, typelibName, destinationPackage, className, baseClass ); - } else { - //System.err.println("Unrecognized class type "+classType); - } - - if( g != null ) - g.generate(); - - } - - protected String convertPackageToDir( String packageName ) { - StringTokenizer st = new StringTokenizer( packageName, "." ); - StringBuffer buffer = new StringBuffer(); - - while( st.hasMoreTokens() ) { - buffer.append( st.nextToken() ); - if( st.hasMoreTokens() ) - buffer.append( File.separator ); - } - - return buffer.toString(); - } - - protected Vector readFile(String filename) throws FileNotFoundException, IOException { - Vector result = new Vector(); - - FileReader fr = new FileReader( filename ); - LineNumberReader reader = new LineNumberReader( fr ); - - while( true ) { - String line = reader.readLine(); - if( line == null ) - break; - - result.addElement( line ); - } - - return result; - } - - public static Jacobgen getInstance() { - if( instance == null ) - instance = new Jacobgen(); - - return instance; - } - - public void parseOptions( String[] args ) { - for( int i=0; i"); - System.out.println("\t-destdir:"); - System.out.println("\t-listfile:"); - System.out.println(); - System.exit(0); - } else { - Jacobgen g = getInstance(); - try { - g.parseOptions( args ); - if( g.typelibFilename == null ) - System.out.println("Jacobgen you need to specify an input file"); - else - g.generate(); - //g.generate( argv[0], argv[1] ); - } catch( IOException ex2 ) { - System.err.println("Jacobgen: I/O error (file " + g.typelibFilename +")" ); - } - } - } -} diff --git a/jacobgen/src/com/jacob/jacobgen/MethodItem.java b/jacobgen/src/com/jacob/jacobgen/MethodItem.java deleted file mode 100644 index 51d4f2e..0000000 --- a/jacobgen/src/com/jacob/jacobgen/MethodItem.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * MethodItem.java - * Copyright (C) 2000-2002 Massimiliano Bigatti - * - * 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 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. - */ -package com.jacob.jacobgen; - -import java.util.*; - -/** - * Represents a class method. - * - * @version $Id$ - * @author Massimiliano Bigatti - */ -public class MethodItem { - - private String name; - private String returnType; - private String nativeReturnType; - private int methodType; - private Vector parametersList; - private boolean customReturnType; - private boolean additionalMethodRequired; - - public static final int METHODTYPE_UNKNOWN = -1; - public static final int METHODTYPE_FUNCTION = 1; - public static final int METHODTYPE_PROPERTYGET = 2; - public static final int METHODTYPE_PROPERTYPUT = 3; - public static final int METHODTYPE_PROPERTYPUTREF = 4; - - protected MethodItem(String line) throws IllegalFormatException { - parametersList = new Vector(); - extractData( line ); - } - - /** - * Extract information from a well formatted line - */ - protected void extractData( String line ) throws IllegalFormatException { - StringTokenizer st = new StringTokenizer( line, ";" ); - - try { - //Extract method type - methodType = computeMethodType( st.nextToken() ); - - //Extract return type - nativeReturnType = st.nextToken().trim(); - if( nativeReturnType.length() > 0 ) - returnType = computeVarType( nativeReturnType ); - else - returnType = ""; - - //Extract name - name = st.nextToken(); - - //Extract parameters - extractParameters( st.nextToken() ); - - //Computes if the return type is a standard type - computeCustomReturnType(); - - } catch( NoSuchElementException ns ) { - System.err.println("Seems that line " + line + " is not well " + - "formed, report to support."); - ns.printStackTrace(); - } - } - - protected void extractParameters( String parameters ) throws IllegalFormatException { - additionalMethodRequired = false; - - //Strip trailing and ending [] - if( !parameters.startsWith("[") || !parameters.endsWith("]") ) - throw new IllegalFormatException("Parameters format error : " - + parameters ); - - parameters = parameters.substring( 1, parameters.length()-1 ); - - StringTokenizer st = new StringTokenizer( parameters, "," ); - while( st.hasMoreTokens() ) { - String param = st.nextToken(); - - //Extract parameters data - StringTokenizer st1 = new StringTokenizer( param ); - String options = st1.nextToken("{}"); - String type = st1.nextToken(" "); - String name = st1.nextToken(); - - type = type.substring( 1 ).trim(); - - //Extract options - int direction = ParameterItem.DIRECTION_UNKNOWN; - boolean optional = false; - StringTokenizer st2 = new StringTokenizer( options, "-" ); - while( st2.hasMoreTokens() ) { - String option = st2.nextToken(); - if( option.equals("in") ) - direction = ParameterItem.DIRECTION_IN; - else if( option.equals("out") ) - direction = ParameterItem.DIRECTION_OUT; - else if( option.equals("retval") ) - direction = ParameterItem.DIRECTION_RETVAL; - else if( option.equals("optional") ) - optional = true; - } - - ParameterItem pi = new ParameterItem( name, - type, computeVarType( type ), direction, optional ); - - //This parameter is a Java base class - //if( pi.getObjectType() != pi.getType() ) - if( optional || direction == ParameterItem.DIRECTION_OUT) - additionalMethodRequired = true; - - parametersList.addElement( pi ); - } - - } - - public String getName() { - return name; - } - - public String getReturnType() { - return returnType; - } - - public int getMethodType() { - return methodType; - } - - public boolean isAdditionalMethodRequired() { - return additionalMethodRequired; - } - - protected void computeCustomReturnType() { - if( nativeReturnType.equals("VT_SAFEARRAY") ) { - customReturnType = false; - return; - } - - String[] types = { "void", "Object", "short", "int", "float", "double", - "long", "java.util.Date", "String", "Dispatch", - "boolean", "Variant", "byte" }; - - customReturnType = true; - if( returnType.trim().length() == 0 ) - customReturnType = false; - else - for( int i=0; ip_. - * @return a String which is the name of the parameter without any - * conflicts with Java-Keywords - */ - public String getJavaName() { - if ( ClassGenerator.checkForJavaKeywords(this.name) ) { - return "p_" + this.name; - } else { - return this.name; - } - } - - /** - * Returns the name for the parameter as it is used by the Variant-variable - * which is necessary for calls with out-parameters. - * @return a String which is the name of the Variant-variable of this parameter - */ - public String getVariantName() { - return "vnt_" + this.name; - } - - /** - * Returns the name for the put*Ref-method for this parameter as it is used - * by the Variant-variable which is necessary for calls with out-parameters. - * @return a String which is the name of the put*Ref-method of this parameter - */ - public String getVariantPutMethod() { - if (getObjectType().equals("java.util.Date")) { - return "putDateRef"; - } else { - return "put" + getObjectType() + "Ref"; - } - } - - /** - * Returns the name for the to*-method for this parameter as it is used - * by the Variant-variable which is necessary for calls with out-parameters. - * @return a String which is the name of the to*-method of this parameter - */ - public String getVariantGetMethod() { - if (getObjectType().equals("java.util.Date")) { - return "toJavaDate"; - } else { - return "to" + getObjectType(); - } - } - - /** - * Returns the type for the parameter as an array. - * @return a String which is the type of this parameter as an array - */ - public String getArrayType() { - return this.type + "[]"; - } - - /** - * Returns the type for this parameter. Also if non-basetypes are - * requested it returns ab basetye if it is a pure input parameter. - * @return a String which is the type of this parameter - */ - public String getType(boolean baseType) { - if ( baseType || (direction == DIRECTION_IN) ) { - return getType(); - } else { - return getArrayType(); - } - } - - public String getType() { - return type; - } - - private String getObjectType() { - return objectType; - } - - public String getNativeType() { - return nativeType; - } - - public int getDirection() { - return direction; - } - - public boolean isOptional() { - return optional; - } - - public boolean isObject() { - return object; - } - - public boolean isCustomType() { - return customType; - } - - - /** - * Return the method required to pass this parameter to the Dispatch - * call method. - */ - protected String getParameterCallingCode() { - String result = name; - String paramName = name; - - if( ClassGenerator.checkForJavaKeywords( name ) ) - paramName = "p_" + name; - - result = Jacobgen.getInstance().getExternalClass(paramName)==null ? - paramName : Jacobgen.getInstance().getExternalClass(paramName); - - if( nativeType.equals("VT_EMPTY") ) //Pending - result = ""; - else if( nativeType.equals("VT_NULL") ) //Pending - result = ""; - else if( nativeType.equals("VT_I2") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_I4") || nativeType.equals("VT_INT") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_R4") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_R8") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_CY") ) //Currency - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_DATE") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_BSTR") ) - result = paramName; - else if( nativeType.equals("VT_DISPATCH") ) - result = paramName; - else if( nativeType.equals("VT_ERROR") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_BOOL") ) - result = "new Variant(" + paramName + ")"; - else if( nativeType.equals("VT_HRESULT") ) - result = "new Variant(" + paramName + ")"; - - //For variant use class type - //else if( nativeType.equals("VT_VARIANT") ) - - //JACOB wrapper ADO.Field.getDataFormat() maps UNKNOWN as Variant. - //I hope it is correct - else if( nativeType.equals("VT_UNKNOWN") ) - result = paramName; - else if( nativeType.equals("VT_UI1") ) //Pending - result = "new Variant(" + paramName + ")"; - - //Simple Enums - if( Jacobgen.getInstance().isEnum(nativeType) ) - result = "new Variant(" + paramName + ")"; - - //RGB VB Internal type - if( nativeType.equals( "MsoRGBType" ) ) - result = "new Variant(" + paramName + ")"; - - return result; - } - - protected void computeCustomType() { - customType = true; - if( type.trim().length() == 0 ) - customType = false; - else - for( int i=0; i 0 ) { - buf = dll.queryInterface( argv[0] ); - - for( int i=0; i"); - } - -} diff --git a/jacobgen/unittest/README.txt b/jacobgen/unittest/README.txt deleted file mode 100644 index f8ff79d..0000000 --- a/jacobgen/unittest/README.txt +++ /dev/null @@ -1 +0,0 @@ -This file exists to make sure this directory hangs around until there are actual sample files to put in the unittest directory \ No newline at end of file