Comparar commits

...

522 Commits

Autor SHA1 Mensagem Data
Dan Rollo f88d243071 Merge pull request #143 from bhamail/master
Release 3.5.0 - dist jars and doc links
2012-10-18 18:53:11 -07:00
Dan Rollo feb7b88279 Release 3.5.0 - Update README.md, commit and push. 2012-10-18 21:33:40 -04:00
Dan Rollo 070b47e825 Release 3.5.0 - Run ant dist target. Commit and push generated jar files in dist. Includes new jna-min.jar. 2012-10-18 21:25:14 -04:00
Dan Rollo c1289c07be Merge pull request #141 from bhamail/master
typo
2012-10-15 09:12:47 -07:00
Dan Rollo e68fd9dfaf doc typo 2012-10-15 12:00:35 -04:00
twall f23a4bf9d5 Merge pull request #139 from trespasserw/patch-1
Diagnostic for temp jnidispatch file creation
2012-10-13 06:05:36 -07:00
Roman Shevchenko b769daec0c Diagnostic for temp jnidispatch file creation
Nesting underlying exception will provide more insight
on what may caused an error.
2012-10-11 14:38:59 +03:00
Daniel Doubrovkine (dB.) 4e36f71f3a Merge pull request #137 from danwi/registry_get_empty_values
Add issue #135 to CHANGES.md
2012-10-08 08:32:02 -07:00
Daniel Wiklund 25db8ccfa7 Add issue #135 to CHANGES.md 2012-10-08 16:56:44 +02:00
Daniel Doubrovkine (dB.) 5c2923c0af Merge pull request #136 from danwi/registry_get_empty_values
Add fix for issue #135 in Advapi32Util (reading empty values)
2012-10-08 07:33:25 -07:00
Daniel Wiklund 018ad7f2c0 Add fix for issue #135 in Advapi32Util (reading empty values)
With this fix it is possible to read values from registry of the following
types even when the size of the value is 0:

REG_SZ
REG_EXPAND_SZ
REG_MULTI_SZ
REG_NONE
REG_BINARY (fixed by earlier committer)

Advapi32UtilTest updated with unit test triggering the bug.
2012-10-08 16:16:30 +02:00
Timothy Wall c1a7fd7267 Merge branch 'master' of github.com:twall/jna 2012-10-06 11:49:59 -04:00
Timothy Wall 3c086de42c add 'min' jar to dist 2012-10-06 11:49:09 -04:00
Timothy Wall b48390fc1e note platforms where test fails 2012-10-06 10:30:50 -04:00
Timothy Wall 136fe02333 Merge branch 'master' of github.com:twall/jna 2012-10-06 09:01:54 -04:00
Timothy Wall 5f9d100b2d attach native thread as daemon to avoid tests hanging on exit 2012-10-06 09:01:30 -04:00
twall 176f3f32d4 Update www/FrequentlyAskedQuestions.md 2012-10-06 09:47:27 -03:00
twall 2667202a3f Move native long != Java long to top of list 2012-10-06 09:46:50 -03:00
Timothy Wall 245eb88b40 fix #128, use 16-bit mask for upper/lower parts of DWORD 2012-10-06 00:49:17 -04:00
Timothy Wall d51479c357 update changes, fixes #113, fixes #114 2012-10-06 00:44:07 -04:00
Timothy Wall 7a583b1aaa apply PR #114, support for gnu/kfreebsd 2012-10-06 00:38:56 -04:00
Timothy Wall eaff9bd176 fixes #129 2012-10-05 06:58:14 -04:00
Timothy Wall da4d941906 add dlopen mods to changelog 2012-10-05 05:48:30 -04:00
Dan Rollo ed94e60da3 Merge pull request #132 from bhamail/maven-cleanup
note maven changes
2012-10-04 19:24:38 -07:00
Dan Rollo 2fe6c956b4 note maven changes 2012-10-04 22:22:45 -04:00
Timothy Wall 559c7d7f13 add library open options 2012-10-04 21:58:28 -04:00
Timothy Wall 6b7f2eeadb catch all AWT loading errors 2012-10-02 07:26:58 -04:00
Dan Rollo 7bda1b3d0e Merge pull request #131 from bhamail/maven-cleanup
Maven cleanup
2012-10-01 17:10:45 -07:00
Dan Rollo d516b01c75 Add note about settings.xml location. 2012-10-01 20:07:45 -04:00
Dan Rollo 08c579f0cb Add note about settings.xml location. 2012-10-01 20:06:33 -04:00
Timothy Wall c231069066 fix typos 2012-09-29 11:26:17 -04:00
Timothy Wall ec16947808 update w32ce-arm build, native 2012-09-29 09:13:39 -04:00
Dan Rollo 2d61573175 Merge pull request #126 from bhamail/maven-cleanup
Maven cleanup
2012-09-27 15:06:49 -07:00
Dan Rollo 507c065c0e fix typo 2012-09-27 17:47:18 -04:00
Dan Rollo cf6b6299e0 Keep pom-platform.xml version tag in since automatically (same as pom.xml version tag). Update release docs to match. Add a note that 'deploy' target only works for SNAPSHOT. 2012-09-27 17:45:31 -04:00
Dan Rollo 862a746170 Update maven release step links. 2012-09-27 15:02:00 -04:00
Dan Rollo 14717ce21f Update maven release steps. 2012-09-27 14:59:06 -04:00
Dan Rollo 72aade4f8f fix typo 2012-09-27 14:52:35 -04:00
Dan Rollo fbf75539f9 fix typo 2012-09-27 14:51:45 -04:00
Dan Rollo 879402d020 md format cleanup 2012-09-27 14:49:15 -04:00
Dan Rollo 7296f2213d Add step in release process to update the pom <version> values to match the version (jna.version) in build.xml. 2012-09-27 14:44:25 -04:00
Dan Rollo fb243c6cf5 Add reference to java.net maven repo docs. 2012-09-27 13:50:47 -04:00
Dan Rollo 20d1a720ce Add slash to urls, to match doc's examples. 2012-09-27 13:50:22 -04:00
Dan Rollo ea12e0755b settings.xml example 2012-09-26 22:37:48 -04:00
Dan Rollo 83cc22a24c settings.xml example 2012-09-26 22:36:44 -04:00
Dan Rollo c795c80439 Go back to using java.net maven repo. Add settings.xml example. 2012-09-26 22:31:36 -04:00
Dan Rollo edab625da6 Change deploy snapshot target to include platform jar. 2012-09-26 11:33:36 -04:00
Dan Rollo 9f9240391b Add failonerror=true to mvn calls so ant build will fail if mvn goal fails. 2012-09-25 21:11:10 -04:00
Dan Rollo 4fbbc6b42a comment cleanup 2012-09-25 21:01:45 -04:00
Dan Rollo cdbc379608 comment cleanup 2012-09-25 20:59:38 -04:00
Dan Rollo bfeac30452 Add warning about quiet mvn failures. 2012-09-25 20:54:08 -04:00
Dan Rollo 2e7d188afa Add warning about quiet mvn failures. 2012-09-25 20:53:39 -04:00
Dan Rollo d291bd52cd Extract maven-gpg-plugin version to common property. Add 'useagent' so will be prompted for gpg passphrase. 2012-09-25 20:45:47 -04:00
Dan Rollo d8e8fd09a6 Remove obsolete maven artifact files. 2012-09-25 19:55:52 -04:00
Dan Rollo d66471e4c0 Restore 'depends' to maven targets - some jars are not banked in 'dist'. Make maven artifact jar names more consistent. Only include files (src, javadoc) for the specific project (jna or platform). 2012-09-25 19:49:54 -04:00
Dan Rollo bb7d364f45 Update maven repo URL's to use sonatype for publishing to central repo. Remove 'depends' from maven deploy and stage tasks - will use what is in 'dist' folder. 2012-09-25 17:19:34 -04:00
Dan Rollo f9f8474e7f Add maven ant tasks jar to lib dir for use in deploying maven artifacts. Update maven repo URL's to use sonatype for publishing to central repo. Remove 'depends' from maven deploy and stage tasks - will use what is in 'dist' folder. 2012-09-25 17:05:47 -04:00
Dan Rollo e2cac3a280 Remove unused tags, add dependency to jna 2012-09-25 12:45:51 -04:00
Dan Rollo d6b5c2c797 Remove unused tags 2012-09-25 12:00:36 -04:00
twall c0e51cb47f Update www/DirectMapping.md 2012-09-25 11:57:04 -03:00
twall 03f054b474 Update www/DirectMapping.md 2012-09-25 11:56:18 -03:00
twall 511676e0e9 Update www/GettingStarted.md 2012-09-25 08:11:06 -03:00
twall 94ac8af162 Update www/GettingStarted.md 2012-09-25 08:08:43 -03:00
twall a814936bd7 Note direct mapping and link 2012-09-25 08:06:52 -03:00
twall e42b2ca09d Link directly to examples 2012-09-25 08:02:43 -03:00
Timothy Wall 7be159d0c2 update solarix/intel natives 2012-09-24 19:33:02 -04:00
Timothy Wall c53c384096 update sunos natives 2012-09-24 23:46:00 +02:00
dblock 6a52c22a02 Moved some hanging docs into www. 2012-09-24 09:09:53 -04:00
Daniel Doubrovkine 6f30debd34 Minor prettifications to CHANGES. 2012-09-23 18:43:24 -04:00
Timothy Wall d400921e17 Merge branch 'master' of github.com:twall/jna 2012-09-23 17:30:28 -04:00
Timothy Wall e95b37e5de update android-arm native 2012-09-23 17:29:51 -04:00
Timothy Wall b9cc27c1ad update win32-x86 native 2012-09-23 15:14:11 -04:00
Timothy Wall c8852f7c44 update win32-x86 native 2012-09-23 14:44:22 -04:00
Timothy Wall 18b0700337 obsolete outdated native jars, update darwin 2012-09-23 14:08:04 -04:00
Timothy Wall 8d535e72c7 update win32-amd64 native 2012-09-23 12:43:56 -04:00
Timothy Wall 2f51fc68cb fix file perms 2012-09-23 09:28:00 -04:00
Timothy Wall 1f1972bf0e remove msvc90 dependency, spurious '-g' flags in libffi, fix compiler warnings against dlmalloc.c 2012-09-23 08:37:30 -04:00
Timothy Wall e91fbd35c2 tweaks for win32-amd64 build 2012-09-23 02:24:52 -04:00
Timothy Wall f46c5ffc2b w32 tweaks 2012-09-22 22:40:33 -04:00
Timothy Wall a9f90b508a fix build on w32 2012-09-22 21:03:29 -04:00
Timothy Wall 7dd96c6978 fix build on win32 2012-09-22 20:45:03 -04:00
Timothy Wall 0c888d992b accommodate makefile variable overrides from ant or environment 2012-09-22 19:58:14 -04:00
Timothy Wall 14da21e9f9 Merge branch 'master' of github.com:twall/jna 2012-09-22 17:06:20 -04:00
Timothy Wall 019e861539 merge android branch 2012-09-22 17:05:24 -04:00
Kristian Rosenvold 79d208096b o Added first (untested) verison of how to publish to maven central 2012-09-22 11:32:47 +02:00
Timothy Wall 28c4c5fef5 merge from upstream 2012-09-21 06:57:14 -04:00
Timothy Wall 5e211134d5 merge from master 2012-09-21 06:55:08 -04:00
Timothy Wall 310e829d70 note changes 2012-09-21 00:29:29 -04:00
Timothy Wall 3d0040a183 check more thoroughly for unanticipated exceptions 2012-09-20 23:57:20 -04:00
Timothy Wall bbb0501f76 properly propagate exceptions through native code 2012-09-20 23:41:03 -04:00
Timothy Wall 641b7aa3ad fix crash on win64 2012-09-20 22:45:22 -04:00
Timothy Wall 1572b12f75 merge from master 2012-09-20 17:37:25 -04:00
Timothy Wall 689ddc493f android doesn't support shlib jar unpack; place in a convenient location instead 2012-09-20 17:28:33 -04:00
Timothy Wall cb05293c11 clean up thread termination handling 2012-09-20 16:19:25 -04:00
Timothy Wall d5e2ee902d update change log 2012-09-20 15:59:14 -04:00
Timothy Wall b9995b2ad0 w32 thread auto-cleanup 2012-09-20 15:02:07 -04:00
Timothy Wall bd243519df w32 implementation 2012-09-20 13:52:34 -04:00
Timothy Wall f11614bc27 simplified thread-local destructor (pthreads) 2012-09-20 13:17:47 -04:00
Timothy Wall 58a5185c20 auto-cleanup of attached callback threads 2012-09-20 08:41:57 -04:00
Timothy Wall e92ff82c19 update android instructions 2012-09-20 07:21:36 -04:00
Timothy Wall c4c07d7878 fixes issue #121 2012-09-20 01:17:55 -04:00
Timothy Wall e07ed3082d clean up some var usage 2012-09-20 01:14:09 -04:00
Timothy Wall 5728822dad tweak formatting 2012-09-19 13:49:32 -04:00
Timothy Wall fd13022f7c don't copy out-of-date.jar to dist, copy native jars *only* directly from lib/native 2012-09-19 11:23:39 -04:00
Timothy Wall 296eaec0e6 perform cross-builds into dedicated build directory 2012-09-19 10:28:45 -04:00
Timothy Wall 8b8672214c add android native jar 2012-09-19 10:08:04 -04:00
Timothy Wall 2f662bcf6d remove obsolete setFieldOrder references 2012-09-19 10:03:39 -04:00
Timothy Wall 35f12b7027 merge from master 2012-09-19 09:51:01 -04:00
Timothy Wall 719fab1ad2 fix main class reference 2012-09-18 22:38:44 -04:00
Timothy Wall 67ffdd5168 pushed wrong versions of demo jars 2012-09-18 22:32:34 -04:00
Timothy Wall afc3fe3687 update demos to include full native libs 2012-09-18 22:27:14 -04:00
Timothy Wall 14dbeda4ed fix broken demo jars 2012-09-18 22:24:28 -04:00
Timothy Wall f5ee066cc0 demos must be in same directory as jna.jar to run properly 2012-09-18 20:43:43 -04:00
Timothy Wall ad65bcccfb avoid spurious errors when common osx frameworks don't actually exist 2012-09-18 20:36:05 -04:00
Timothy Wall fab66d7d49 search additional OSX paths 2012-09-18 18:49:40 -04:00
Timothy Wall d78c38e4e2 update changelog 2012-09-19 00:14:22 +02:00
Timothy Wall 21cecef8ef fix crash with native mapped callback args 2012-09-18 21:58:39 +02:00
Timothy Wall 3e8511fbc6 Merge branch 'master' of github.com:twall/jna 2012-09-18 09:34:58 -04:00
Timothy Wall 21863e190d use upstream libffi as subtree instead of separate local copy 2012-09-18 09:28:54 -04:00
Timothy Wall fb84300563 Merge libffi as native/libffi 2012-09-18 09:06:50 -04:00
Timothy Wall a8de00b8e5 fix MSVC dll callbacks build (mingw64 required) 2012-09-17 07:23:01 -04:00
Timothy Wall 5fd52be589 add missing file 2012-09-16 15:47:12 -04:00
Timothy Wall 6335fef0b1 fix build for MSVC express 10 2012-09-16 13:24:35 -04:00
Daniel Doubrovkine 3455742d89 The javadoc and src-mvn.zip should be ignored; out-of-date.jar is used to wipe all the native binaries when there's an incompatible JNI change. 2012-09-15 22:08:25 -04:00
Timothy Wall 6ba364f64f Merge branch 'master' of github.com:twall/jna into dll-callback 2012-09-15 21:58:55 -04:00
Daniel Doubrovkine 164da6cf1c Minor updates to CHANGES. 2012-09-15 21:28:33 -04:00
Daniel Doubrovkine 1b6bc6342e Re-added missing declaration. 2012-09-15 21:26:54 -04:00
Daniel Doubrovkine bde74fdccf Merged 3.5.0 from master. 2012-09-15 21:15:47 -04:00
Timothy Wall 6dd612162d synch with master 2012-09-15 17:58:44 -04:00
Timothy Wall 2ff4d20fad require structure field order 2012-09-15 17:52:01 -04:00
unknown fbcd02ae6e Merge branch 'master' of github.com:twall/jna into netapi32-fixes 2012-09-15 09:31:01 -04:00
Timothy Wall 6de51cdf5a move field validation out of layout derivation 2012-09-14 21:10:48 -04:00
unknown e97b1df6ee Merge branch 'master' of github.com:twall/jna into netapi32-fixes 2012-09-14 07:53:37 -04:00
Timothy Wall 65d68b8d70 avoid using deprecated setTypeMapper 2012-09-14 07:00:55 -04:00
Daniel Doubrovkine f915ec7e05 Merge branch 'master' of github.com:twall/jna into netapi32-fixes 2012-09-08 20:39:06 -04:00
Timothy Wall 44b4bc0cac fix gcc version check, avoid deprecated function in structure test 2012-09-08 16:27:08 -04:00
Daniel Doubrovkine 2a6ac9a20d Fixed ANT build and package name. 2012-09-08 16:22:52 -04:00
Daniel Doubrovkine 076298e343 Merged from master. 2012-09-08 16:11:47 -04:00
Timothy Wall 1c3ab0f80f fix javadoc errors 2012-09-08 16:04:27 -04:00
Timothy Wall a0ae2836d9 merge from upstream 2012-09-08 15:02:25 -04:00
Timothy Wall 2309762aca fix broken Structure.setFieldOrder issue 2012-09-08 11:07:05 -04:00
Daniel Doubrovkine e4d89f7087 Fixed typos. 2012-09-08 08:42:36 -04:00
Daniel Doubrovkine 44c41b6faf Fix: Netapi32Test broken. 2012-09-08 08:41:57 -04:00
Daniel Doubrovkine 8003de03ec Fix: w32keyhook package to make Eclipse happy. 2012-09-08 08:40:58 -04:00
twall c5ae6a3cbb Merge pull request #117 from phailwhale22/master
Closes issue #116
2012-09-07 16:34:22 -07:00
twall 4581cb2f61 Avoid invalid 3.4.2 build 2012-09-07 20:32:46 -03:00
phailwhale22 804795c5f8 fix for issue #116 (continued yet again)
I'm failing hard... ok to merge? Indentation was fixed and I removed the
try block.
2012-09-07 18:26:30 -04:00
phailwhale22 c2c1f81ea5 fix for issue #116 (continued)
Some stuff that was missing from my previous commit. Sorry for the
hurdles, this is my first time contributing to a project. Updated the
appropriate unit test and CHANGES.md for version 3.4.3.
2012-09-04 19:00:17 -04:00
phailwhale22 14481ee346 fix for issue #116 2012-09-04 18:07:13 -04:00
Timothy Wall aea387ce02 fix failing tests in StructureTest (avoid returning self when sharing memory) 2012-08-22 16:38:21 -04:00
Timothy Wall 4ddad49369 save function field offsets instead of actual function pointers, which may change 2012-08-21 21:43:17 -04:00
Timothy Wall 224f18fef4 fix file perms 2012-08-21 19:29:43 -04:00
Timothy Wall 2390543445 add dll callbacks, tests, explicit flags for dlopen 2012-08-21 19:28:40 -04:00
Timothy Wall 473d48b39b fix up Netapi32Test to match DS_DOMAIN_TRUSTS changes elsewhere; I vaguely recall db saying something about removing a related test entirely for duplication of effort, perhaps this was missed checking in? 2012-08-11 22:27:44 -04:00
Timothy Wall a947dfdac5 address issue #84 2012-08-11 18:03:27 -04:00
Timothy Wall a064b2a0e1 add android link 2012-07-17 07:38:50 -04:00
Timothy Wall 3755747fda update notes 2012-07-12 08:45:48 -04:00
Timothy Wall 57ded8d803 android tweaks 2012-07-09 07:39:10 -04:00
Timothy Wall aa5fc9b3d8 tweak resource path for android 2012-07-09 07:14:54 -04:00
Timothy Wall afb3a7cc84 fix path to strip 2012-07-06 17:25:00 -04:00
Timothy Wall 76f7b189fa add closures patch from auris 2012-05-22 08:13:17 -04:00
Nicolas Lelong d330f19292 iOS build fixes. 2012-05-05 09:37:02 -04:00
Timothy Wall b14ccb8eab update jna.jar 2012-05-04 07:28:06 -04:00
Timothy Wall d873f6f6be add android binary 2012-05-04 07:27:25 -04:00
Timothy Wall 7f0d465e98 set all structure fields, add android as a recognized platform 2012-05-04 07:24:00 -04:00
Timothy Wall 9889489355 successful compilation/link of android 2012-05-03 08:09:54 -04:00
Anthony Green 09b23cfc1d Update README with Blackfin/uClinux support 2012-04-27 08:29:48 -04:00
Anthony Green 213ed15c70 Add blackfin supprt from Alexandre Keunecke. 2012-04-27 01:34:15 -04:00
Anthony Green ff3d76fd42 3.0.11 2012-04-11 23:16:48 -04:00
Anthony Green 7e0a412c4f Update files to ship 2012-04-11 22:47:44 -04:00
Zachary Waldowski 39e6a58604 More mac/ios build improvements 2012-04-11 22:39:46 -04:00
Anthony Green 853cc722a1 Fix typo for darwin targets 2012-04-10 06:33:33 -04:00
Anthony Green 3f5023068c mend 2012-04-06 20:34:51 -04:00
Mike Lewis ebb8e89456 Build iOS library with xcode 2012-04-06 20:02:08 -04:00
Anthony Green a098b44f4c Reapply missing testsuite changes for arm 2012-04-06 17:04:35 -04:00
Anthony Green 10d1e51393 Update to rc4. Upgrade autoconf version. 2012-04-06 11:58:33 -04:00
Anthony Green 9bcc884276 Fix Linux/x32 reference in README 2012-04-06 11:53:07 -04:00
Anthony Green a044a56b1c Linux/x32 libtool fix 2012-04-06 10:39:10 -04:00
Anthony Green 59bb61a366 Update libtool version, README, tests dists 2012-04-06 08:26:14 -04:00
Anthony Green f2981454cb Revert debug code changes 2012-04-05 15:45:19 -04:00
Zachary Waldowski 39dccddb60 Fix building with Clang for Darwin (OS X 10.6+ and iOS
4.0+)
2012-04-05 12:32:41 -04:00
Peter Rosin 3afaa9a34a Fix return_uc.c test case on windows. 2012-04-03 07:40:31 -04:00
Anthony Green 65f40c35a2 Repair ppc build regression. 2012-04-03 07:35:59 -04:00
Peter Rosin 0a1ab12a8d Various MSVC-related changes. 2012-03-30 08:14:08 -04:00
Anthony Green e1539266e6 ARM VFP fix for old toolchains 2012-03-30 00:40:18 -04:00
Anthony Green 7c5e60b5f4 Rebase on fixed GCC sources 2012-03-29 08:48:22 -04:00
Anthony Green e72ed5eeaa Fix vararg float test 2012-03-21 09:52:28 -04:00
Anthony Green bd78c9c331 More cygwin fixes 2012-03-21 08:09:30 -04:00
Anthony Green 84d3253f86 Rebase post GCC merge 2012-03-19 23:07:35 -04:00
Anthony Green 964c5b93f8 abi check fixes and Linux/x32 support 2012-03-03 14:46:20 -05:00
Anthony Green 6c194233a5 Add -no-undefined for both 32- and 64-bit x86
windows-like hosts.
2012-03-03 14:17:54 -05:00
Anthony Green 8360bf1cd0 Ensure that users don't include ffitarget.h directly 2012-02-23 07:01:13 -05:00
Anthony Green d578b89619 Fix ABI check regression 2012-02-15 00:18:18 -05:00
Anthony Green dee20f8e45 Rebased from gcc 2012-02-10 13:06:46 -05:00
Anthony Green 4130e1972d Refresh autoconf-archive m4 scripts 2012-02-03 13:18:27 -06:00
Anthony Green 1ff9c604bb Rebase from GCC 2012-02-01 16:34:30 -06:00
Anthony Green 211060eb8f Alpha fix 2012-01-23 14:24:01 -05:00
Anthony Green 78d9c638ba mend 2012-01-23 14:17:24 -05:00
Anthony Green afaf338160 mend 2012-01-23 14:17:13 -05:00
Anthony Green 9e9c4aeb77 Add Amiga support 2012-01-23 14:11:23 -05:00
Anthony Green 8efc0b1f40 Unlikely fixes 2012-01-23 13:47:38 -05:00
Anthony Green 1df51398ae mend 2012-01-23 13:43:59 -05:00
Anthony Green cd2277cc79 mend 2012-01-23 13:43:38 -05:00
Anthony Green 164e6fe04b m68k fixes 2012-01-23 12:41:06 -05:00
Anthony Green c365ee7577 Refresh 2012-01-23 11:13:18 -05:00
Anthony Green f22c38bbd9 Update variadic patch 2011-11-18 15:13:41 -05:00
Anthony Green 03e9ee321a Fix cls_double_va.c and update docs 2011-11-18 15:13:00 -05:00
Anthony Green 95f31151ec Rerun automake 2011-11-12 23:46:05 -05:00
Anthony Green 198ed1ef85 Update version number 2011-11-12 23:45:20 -05:00
Anthony Green 4f17e1f142 Fix last patch 2011-11-12 17:22:24 -05:00
Anthony Green ff9454da44 Add David Gilbert's variadic function call support 2011-11-12 17:18:51 -05:00
Anthony Green ea14ae85e8 clean up 2011-11-12 16:36:59 -05:00
Anthony Green 52891f8a93 Add powerpc soft float support 2011-11-12 16:35:55 -05:00
Anthony Green c8f1bde8e2 Remove junk file 2011-11-12 16:21:02 -05:00
Anthony Green 6a6e7f862f Fix kfreebsd 2011-11-12 16:20:42 -05:00
Anthony Green d52fbed05c Add missing ChangeLog entry 2011-11-12 16:13:41 -05:00
Anthony Green 322052ce65 Fix arm wince alignment issue 2011-11-12 16:11:49 -05:00
Anthony Green af18df2bc2 Remove use of ppc string instructions 2011-11-12 15:52:08 -05:00
Anthony Green 236c939132 Fix darwin11 build problem 2011-11-12 07:37:40 -05:00
Anthony Green c411f140f3 Fix ax_enable_builddir macro on BSD systems 2011-11-12 07:32:36 -05:00
Anthony Green 3d56106b07 Rebase 2011-11-12 07:20:24 -05:00
Anthony Green 8c01954c50 Build assembly files with debug info 2011-09-06 14:26:32 -04:00
Anthony Green fed646a207 Regenerate configury with missing m4 macros 2011-09-06 09:50:20 -04:00
Anthony Green d76441cf71 Update list of supported OpenBSD systems 2011-08-24 10:14:23 -04:00
Anthony Green ee6696fdf4 3.0.11-rc1. soname bump. 2011-08-23 12:30:29 -04:00
Anthony Green c6265c36a9 Version 3.0.10 2011-08-23 10:31:33 -04:00
Anthony Green cc5e41bf32 Fix use of autoconf macros 2011-08-22 16:34:24 -04:00
Anthony Green 049d8386ff Many new patches 2011-08-22 14:50:10 -04:00
Anthony Green 3b7efa4e74 Revert remove-debug-code patch temporarily (for ARM Fedora release) 2011-08-15 13:25:13 -04:00
Anthony Green d992ac54a2 Refresh from GCC 2011-07-29 17:32:53 -04:00
Anthony Green 2d3fb36420 Fix darwin EH 2011-03-30 16:54:42 -04:00
Anthony Green 30ff28e1d8 Fix permissions 2011-02-28 15:36:23 -05:00
Anthony Green 09f8f310f4 More AIX fixes. rc9. 2011-02-28 15:36:07 -05:00
Anthony Green 53d7b16564 Merge branch 'master' of https://github.com/landonf/libffi-ios 2011-02-28 15:23:31 -05:00
Anthony Green 18dd85d6cb rc8. fix last patch. 2011-02-25 16:23:04 -05:00
Anthony Green 74ee6ea8b4 rc7. More AIX fixes. 2011-02-25 15:52:14 -05:00
Anthony Green 2541679dbd Fix ppc32 bug 2011-02-25 15:09:13 -05:00
Anthony Green cbb062cc35 Another non-GCC configury fix 2011-02-17 20:39:21 -05:00
Anthony Green 8cf8878425 Fix ax_cc_maxopt.m4 2011-02-15 15:19:49 -05:00
Anthony Green 24b72070c0 Fix warning and msvcc patches 2011-02-14 15:30:57 -05:00
Anthony Green d72c49e556 Add missing msvcc.sh 2011-02-13 11:41:05 -05:00
Landon Fuller 3000dc237f Merge remote branch 'upstream/master' 2011-02-13 08:55:53 -05:00
Anthony Green 1fbf9dc44f Fix bad_abi test. rc5. 2011-02-13 08:06:39 -05:00
Anthony Green 90af15ef5c iOS fixes 2011-02-12 12:29:36 -05:00
Landon Fuller 55e4a5aa15 Add support for building a full armv6/armv7/i386 universal iOS library 2011-02-12 12:13:46 -05:00
Landon Fuller a0c80f279b Update my e-mail address. 2011-02-12 11:43:49 -05:00
Landon Fuller 8195e0e11d Fix symbol prefixes on Darwin. 2011-02-12 11:27:00 -05:00
Landon Fuller 56b3f8cef0 Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
This re-integrates commit da2773e02a.
2011-02-12 11:14:54 -05:00
Landon Fuller 28a00f61ff Apple assembler support; fixed most gas/ELF-isms. 2011-02-12 11:01:48 -05:00
Landon Fuller 7f2ea33a80 Replace RETLDM macro.
The macro is incompatible with Apple's assembler; switch to
a simple inline version.
2011-02-12 10:39:18 -05:00
Landon Fuller 92ff23e77f Switch to the current iOS 4.2 SDK. 2011-02-12 10:24:49 -05:00
Landon Fuller 58fb8ca2df Merge remote branch 'upstream/master' 2011-02-12 10:23:19 -05:00
Landon Fuller cc3fbd975c Merge branch 'master' of github.com:landonf/libffi-ios 2011-02-12 10:21:02 -05:00
Landon Fuller e449a43bbe Allow specification of the minimum supported iOS version. 2011-02-12 10:20:42 -05:00
Anthony Green 71c792f51b rc4 2011-02-12 09:33:11 -05:00
Anthony Green 7c7c9f3272 ungccify parts of the build 2011-02-12 09:29:29 -05:00
Anthony Green ed62e48b95 Fix permissions 2011-02-11 12:23:58 -05:00
Anthony Green 17d9e9e68d Use newer autotools. Only build debug.c when --enable-debug. 2011-02-11 12:23:20 -05:00
Anthony Green 6972a4ffda Fix xlc build on AIX 2011-02-11 07:32:51 -05:00
Anthony Green 1833aa0fb9 sparc ABI test fix. 2011-02-11 07:11:04 -05:00
Anthony Green f1fb139b4e Fix tests 2011-02-09 18:30:02 -05:00
Anthony Green 5cb470331d Fix permissions 2011-02-09 15:23:06 -05:00
Anthony Green 269deef6db rc3 2011-02-09 15:22:23 -05:00
Anthony Green 42695e7250 Fix IRIX support 2011-02-09 15:12:35 -05:00
Anthony Green a6e56b97f6 Add powerpc64-*-darwin* support 2011-02-09 15:00:42 -05:00
Anthony Green 747d6c32d4 Add Interix support 2011-02-09 14:56:23 -05:00
Anthony Green eab6e41cde Remove README.markdown form libffi-ios 2011-02-09 10:15:02 -05:00
Anthony Green 69dbe845f4 Fix xfails 2011-02-09 07:38:43 -05:00
Anthony Green f498318c07 Update README for iOS again 2011-02-09 06:26:46 -05:00
Anthony Green 630b9c0ac4 Update to rc2 2011-02-09 06:24:23 -05:00
Anthony Green 0cad4386fa Add ChangeLog entry. Fix copyright headers. 2011-02-09 06:11:46 -05:00
Anthony Green 09cb76f264 Add missing change 2011-02-08 20:39:51 -05:00
Anthony Green 2e3a48ccdd Fix make dist 2011-02-08 20:37:26 -05:00
Anthony Green 5e4814d992 fix permissions 2011-02-08 19:46:28 -05:00
Anthony Green 5c0cc6f153 3.0.10rc1 2011-02-08 19:45:59 -05:00
Anthony Green 857fe3de46 Clean ups 2011-02-08 19:39:20 -05:00
Anthony Green e2214f8adb Update README 2011-02-08 19:22:56 -05:00
Anthony Green 1106229a57 Add iOS support 2011-02-08 19:20:09 -05:00
Anthony Green bc9d0be295 3.0.10rc0 changes 2011-02-08 17:04:26 -05:00
Anthony Green 3b836249fe Rebase from GCC 2011-02-08 14:28:59 -05:00
Anthony Green a26e394061 copyright updates patch 2011-02-08 13:56:12 -05:00
Anthony Green b8099539f0 Fix msvcc.sh botch 2011-02-08 13:50:43 -05:00
Anthony Green dc411e8f99 Fix HP-UX build 2011-02-08 10:49:29 -05:00
Anthony Green 404585d134 Fix sparc v8 aggregate type returns for sun's compiler 2011-02-08 10:44:36 -05:00
Anthony Green 19ce713188 grammar fix 2011-02-08 10:34:23 -05:00
Anthony Green 89284fe55f Fix AIX build with IBM XLC 2011-02-08 10:19:19 -05:00
Anthony Green ba022c338a fix win64-underscore patch 2011-02-08 10:12:48 -05:00
Anthony Green 097e5f3924 x86 pcrel test part 2 2011-02-08 10:11:00 -05:00
Anthony Green ed2c518d96 x86 pcrel test 2011-02-08 10:10:07 -05:00
Anthony Green 0e5843995f Refresh from GCC 2011-02-08 07:52:40 -05:00
Anthony Green 5b9cd52784 win64-underscore patch 2010-11-22 15:19:57 -05:00
Anthony Green 2db72615b5 Rebase 2010-11-21 10:50:56 -05:00
Landon Fuller f6ab3edc23 Include the license header in the generated output. 2010-10-27 19:34:51 -04:00
Landon Fuller cef6194628 Add missing copyright/license header. 2010-10-27 14:01:01 -04:00
Landon Fuller 53f387b203 Minor README fix. 2010-09-19 19:57:17 -07:00
Landon Fuller 4fbcb5b5fb Minor README fix. 2010-09-19 19:50:37 -07:00
Landon Fuller 8e7652ef6a Add a libffi-ios-specific github README. 2010-09-19 19:49:39 -07:00
Landon Fuller 83038cf24a Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM.
This provides working closure support on iOS/ARM devices where
PROT_WRITE|PROT_EXEC is not permitted. The code passes basic
smoke tests, but requires further review.
2010-09-19 14:36:45 -07:00
Landon Fuller b00ff3e98f Rename the generated symbol 2010-09-19 14:22:26 -07:00
Landon Fuller da2773e02a Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer. 2010-09-19 14:21:37 -07:00
Landon Fuller 01d71b7bed Regenerated the autoconf script 2010-09-19 14:21:14 -07:00
Landon Fuller 19afda0069 Enable AC_SUBST for FFI_EXEC_TRAMPOLINE_TABLE 2010-09-19 14:20:52 -07:00
Landon Fuller 9e1196444e Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation.
This implements support for re-mapping a shared table of executable
trampolines directly in front of a writable configuration page, working
around PROT_WRITE restrictions for sandboxed applications on Apple's
iOS.

This implementation is for testing purposes; a proper allocator is still
necessary, and ARM-specific code needs to be moved out of
src/closures.c.
2010-09-19 10:43:06 -07:00
Landon Fuller f38364b399 Fix symbol prefix for ffi_closure_SYSV_inner on Darwin. 2010-09-19 10:42:36 -07:00
Landon Fuller 36849e7716 Whitespace/comment fixes. 2010-09-19 09:35:04 -07:00
Landon Fuller b764162526 Fix the script name (build-iphone.sh -> build-ios.sh) 2010-09-19 09:04:34 -07:00
Landon Fuller a3d9aa8501 Update the autogenerated autoconf/automake files. 2010-09-19 09:03:52 -07:00
Landon Fuller c71480eaf8 Update automake/autoconf to conditionally build src/arm/trampoline.S if FFI_EXEC_TRAMPOLINE_TABLE is enabled. 2010-09-19 09:02:05 -07:00
Landon Fuller 9af9291b73 Add the trampoline table generated by gentramp.sh 2010-09-19 08:52:33 -07:00
Landon Fuller 68ce0c383e Add a shell script that generates the ARM trampoline page.
This generates a page of 340 trampolines, aligned within one page. The
trampolines use pc-relative addressing to reference config data
(context, jump address) from a page placed directly prior to the
trampoline page. This can be used on systems -- such as iOS -- that do not
support writable, executable memory by remapping the executable page
containing the trampolines directly above a newly allocated writable
config page.
2010-09-19 08:38:19 -07:00
Landon Fuller 75af086be8 Update autoconf files 2010-09-18 18:12:19 -07:00
Landon Fuller 1ac92cca9b Add autoconf check for W^X platforms that require a trampoline table.
This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for
arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is
not permitted for sandboxed binaries.
2010-09-18 18:08:14 -07:00
Landon Fuller be72fbab29 Use the correct host triple for arm/darwin 2010-09-18 18:02:25 -07:00
Landon Fuller 70150bdf45 Add missing UNWIND entry; disables .pad on non-EABI targets. 2010-09-18 16:38:03 -07:00
Landon Fuller 6b452bafae Apple assembler support; fixed most gas/ELF-isms. 2010-09-18 16:21:32 -07:00
Landon Fuller 8ddac835b6 Fix placement of the __APPLE__ macro. 2010-09-18 15:38:06 -07:00
Landon Fuller 69043d0293 Work-around libffi's FP ABI detection.
On iOS, we must use the AAPCS floating point return value calling
conventions. libffi's ARM implementation will only use these conventions
if __SOFTFP__ is defined, which is not the case when GCC's
-mfloat-abi defaults to 'softfp' instead of 'soft'. To work around this
we manually define __SOFTFP__ for Apple platforms in the ARM-specific
sysv.S.

See also:
  http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iPhoneOSABIReference/Introduction/Introduction.html
  http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf
2010-09-18 15:32:08 -07:00
Landon Fuller a82e6c354e Add a stub iOS build script to drive autoconf 2010-09-18 14:44:24 -07:00
Anthony Green 84e8de6e9f Restore execute permissions 2010-08-06 01:35:12 -04:00
Anthony Green 3aeecc9eb1 Fix win64-struct-args patch 2010-08-05 15:19:00 -04:00
Anthony Green 00d0b59cd1 Fix debug build for windows 2010-08-05 14:56:53 -04:00
Anthony Green bda487e870 Don't use -safeseh with ml64 2010-08-05 09:02:41 -04:00
Anthony Green c1d28ba8d5 stdcall-x86-closure-fix 2010-08-05 08:48:16 -04:00
Anthony Green 5feacad4a5 define generic symbols carefully 2010-08-05 08:30:04 -04:00
Anthony Green 10ea848900 don't copy win64 struct args 2010-08-05 08:24:27 -04:00
Anthony Green d14178be4c FFI_LAST_ABI fix 2010-07-23 09:14:00 -04:00
Anthony Green 3f5b1375ab rebase 2010-07-12 14:39:18 -04:00
Anthony Green eaf444eabc Fix selinux test 2010-07-10 08:59:09 -04:00
Anthony Green 6309741522 Micharl Kohler's spelling fixes 2010-05-05 20:14:56 -04:00
Anthony Green 9dc9a293f3 Rebase to latest GCC sources 2010-04-13 10:33:52 -04:00
Anthony Green f2c2a4fce9 Remove warnings and add OS/2 support 2010-04-13 10:19:28 -04:00
Anthony Green c0b69e57d5 Dan Witte's windows build fixes. 2010-03-30 08:30:22 -04:00
Anthony Green 59a259f4d3 Remove junk file 2010-03-15 05:57:51 -04:00
Anthony Green 3de1eb36d3 fix-comments patch 2010-03-15 05:57:24 -04:00
Anthony Green c3813b6d7f Rebuild Makefiles with automake 1.11.1 for CVE-2009-4029. 2010-01-26 16:48:56 -05:00
Anthony Green 8d27f68baa Mention recent changes in README 2010-01-15 11:35:37 -05:00
Anthony Green ff3cd68b8c Add msvc.sh wrapper 2010-01-15 11:27:24 -05:00
Anthony Green cadeba6cb5 Microsoft Visual C port 2010-01-15 10:46:51 -05:00
Anthony Green 0739e7dc00 Add x86 Sun Studio compiler support 2010-01-15 09:48:33 -05:00
Anthony Green edfdfd2e85 Add closure example doc 2010-01-13 02:56:19 -05:00
Anthony Green 7b7a42f221 Rebase from GCC 2010-01-12 09:14:14 -05:00
Anthony Green 4b18d1f73d Add x86-64 MingW to README 2010-01-01 10:24:27 -05:00
Anthony Green c3042afaf3 Reset quilt patches post 3.0.9 merge with GCC 2010-01-01 08:08:02 -05:00
Anthony Green b0304e9679 Update version 2009-12-31 11:32:40 -05:00
Anthony Green 2e7e03d014 Final updates before 3.0.9 2009-12-31 07:43:22 -05:00
Anthony Green aea706c528 really 3.0.9rc12 2009-12-29 10:09:31 -05:00
Anthony Green 0cfe60e9d1 3.0.9rc12 2009-12-29 10:06:04 -05:00
Anthony Green 14e2e92e86 3.0.9rc11 2009-12-27 21:03:33 -05:00
Anthony Green 884402787b HPUX support and avr32 test fixes. 2009-12-26 12:57:23 -05:00
Anthony Green 01c78756af 3.0.9rc9 2009-12-26 10:05:18 -05:00
Anthony Green 7086846465 Remove xfails for mips and arm 2009-12-26 09:58:03 -05:00
Anthony Green 838d4ad920 Remove a bunch of xfails. 2009-12-26 09:57:27 -05:00
Anthony Green 7e37eaaf77 Fix huge_struct for solaris 2009-12-26 07:46:50 -05:00
Anthony Green 07cc7a3719 3.0.9rc8 2009-12-26 07:23:04 -05:00
Anthony Green 2b9be16ffa 3.0.9rc8 2009-12-26 07:04:45 -05:00
Anthony Green 9458d88f67 Rebase from GCC 2009-12-26 07:02:27 -05:00
Anthony Green 6a34124175 Add Andreas Schwab's powerpc fix 2009-12-26 06:51:33 -05:00
Anthony Green 39c8792ece 3.0.9rc7 2009-12-25 21:52:28 -05:00
Anthony Green 1d04af52e3 Updated some mips XFAILs 2009-12-25 09:50:36 -05:00
Anthony Green 26e9509c9b Clean up ChangeLog.libffi for older patches. 2009-12-25 02:19:23 -05:00
Anthony Green 9c157d3215 Clean up undefine_AC_ARG_VAR_PRECIOUS patch. 2009-12-25 02:15:40 -05:00
Anthony Green d22de05b0b Fix patches 2009-12-25 02:04:23 -05:00
Anthony Green 1fe3dc7c20 Add windows support patch. 2009-12-25 01:39:00 -05:00
Anthony Green f7c0bc613a 3.0.9rc6 2009-12-25 01:22:11 -05:00
Anthony Green c7fa2da826 3.0.9rc6 2009-12-24 07:22:44 -05:00
Anthony Green da11bece0f Release 3.0.9rc5 2009-12-24 05:34:46 -05:00
Anthony Green e3399b11ed Update README 2009-12-24 01:09:32 -05:00
Anthony Green 115ab36fce Update missing changes for 3.0.9r4. 2009-12-24 00:22:00 -05:00
Anthony Green f8c7a245bf Switch to quilt. Rebase to latest GCC. 2009-12-23 23:46:22 -05:00
Anthony Green ce806772f0 Merge branch 'master' of git@github.com:atgreen/libffi 2009-10-05 00:41:35 -04:00
Anthony Green dcc1f6b4f1 More clean up. 2009-10-05 00:29:33 -04:00
Anthony Green 2829f5941a Clean up 2009-10-05 00:28:03 -04:00
Anthony Green cd98813de5 From Jens Rehsack. Fix for 64-bit AIX. 2009-10-05 00:25:29 -04:00
Anthony Green e4a91de766 From Abdulaziz Ghuloum. Adds special case for Snow Leopard. 2009-10-05 00:16:17 -04:00
Anthony Green 3425a763bc Fix detection of free/openbsd. From Alexis Ballier. 2009-10-04 23:57:29 -04:00
Anthony Green 2340e7a777 AVR support 2009-10-04 23:53:17 -04:00
Anthony Green 5cbe2058c1 Initial stand-alone patch. 2009-10-04 23:53:11 -04:00
Anthony Green c6dddbd02b Initial commit 2009-10-04 08:11:33 -04:00
Anthony Green 5ffc0c3748 Update version to 3.0.9rc1. Add more useful things to .gitignore. 2009-10-04 07:58:22 -04:00
Anthony Green bd29f83ee9 Add .gitignore 2009-09-29 12:07:26 -04:00
Anthony Green 9474f853f8 Remove old CVSROOT files. 2009-09-29 11:13:02 -04:00
twall 0c25275ec2 Apply Dave Korn's cygwin/GCC changes 2009-08-19 12:57:34 +00:00
aph 39228c27ed 2009-06-16 Wim Lewis <wiml@hhhh.org>
* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
	supposed to be callee-saved.
	* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
	return buffer for odd-size structs.
2009-06-16 18:00:47 +00:00
aph 5e93cc704d 2009-06-16 Andreas Tobler <a.tobler@schweiz.org>
PR libffi/40444
	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
	allow_stack_execute for Darwin.
2009-06-16 17:41:47 +00:00
aph b509af8959 2009-06-16 Andrew Haley <aph@redhat.com>
* configure.ac (TARGETDIR): Add missing blank lines.
	* configure: Regenerate.
2009-06-16 16:17:52 +00:00
aph d57e96dc56 2009-06-16 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/cls_align_sint64.c,
        testsuite/libffi.call/cls_align_uint64.c,
        testsuite/libffi.call/cls_longdouble_va.c,
        testsuite/libffi.call/cls_ulonglong.c,
        testsuite/libffi.call/return_ll1.c,
        testsuite/libffi.call/stret_medium2.c: Fix printf format
        specifiers.
        * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
        * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
        * testsuite/libffi.call/ffitest.h,
        testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
2009-06-16 09:59:02 +00:00
aph b01d6d1982 2009-06-16 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
	* testsuite/libffi.call/err_bad_abi.c: Likewise.
2009-06-16 09:44:54 +00:00
aph 35b6ded138 2009-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
* testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
        * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
        * testsuite/libffi.call/err_bad_typedef.c: Likewise.
2009-06-12 15:29:20 +00:00
aph acc46605f2 2009-06-12 Andrew Haley <aph@redhat.com>
* ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
        testsuite/libffi.call/cls_align_uint64.c,
        testsuite/libffi.call/cls_ulonglong.c,
        testsuite/libffi.call/return_ll1.c,
        testsuite/libffi.call/stret_medium2.c: Fix printf format
        specifiers.
        testsuite/libffi.special/unwindtest.cc: include stdint.h.
2009-06-12 14:21:28 +00:00
twall 16d1996ed0 update changelog 2009-06-11 14:27:42 +00:00
twall 92a515c33e use ffi_closure_alloc instead of stack-based closure 2009-06-11 14:27:28 +00:00
twall e4363160ba remove unused extern 2009-06-11 14:26:23 +00:00
twall 1dc2781d2b remove not-yet-applied changelog entries 2009-06-11 11:36:16 +00:00
twall bb27735fe6 add win64 support 2009-06-10 10:42:36 +00:00
aph b2a54c100c 2009-06-08 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/err_bad_abi.c: Add xfails.
	* testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
	* testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
	* testsuite/libffi.call/err_bad_typedef.c: Add xfails.

	* testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
	* testsuite/libffi.call/stret_medium.c: Likewise.
	* testsuite/libffi.call/stret_large2.c: Likewise.
	* testsuite/libffi.call/stret_large.c:  Likewise.
2009-06-08 16:50:49 +00:00
aph 25723e7141 2009-06-05 Andrew Haley <aph@redhat.com>
* src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc.
2009-06-05 13:03:40 +00:00
aph 70758199c7 2009-06-04 Andrew Haley <aph@redhat.com>
* src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
2009-06-04 16:29:58 +00:00
aph e8bb12563f 2009-06-04 Andrew Haley <aph@redhat.com>
* src/mips/o32.S,
	src/mips/n32.S: Fix licence formatting.
2009-06-04 14:59:18 +00:00
aph d66a8e32c3 2009-06-04 Andrew Haley <aph@redhat.com>
* src/x86/darwin.S: Fix licence formatting.
	src/x86/win32.S: Likewise.
	src/sh64/sysv.S: Likewise.
	src/sh/sysv.S: Likewise.
2009-06-04 14:43:40 +00:00
aph 7c3b7fd6b5 2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh64/ffi.c: Remove lint directives.  Was missing from merge
	of Andreas Tobler's patch from 2006-04-22.
2009-06-04 14:39:20 +00:00
aph 1a2f93a8b3 2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
        2007-03-07.
2009-06-04 10:45:51 +00:00
aph 944c95cf7a 2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
* src/x86/win32.S (_ffi_closure_STDCALL):  New function.
       (.eh_frame):  Add FDE for it.

2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>

       * configure.ac:  Also check if assembler supports pc-relative
       relocs on X86_WIN32 targets.
       * configure:  Regenerate.
       * src/x86/win32.S (ffi_prep_args):  Declare extern, not global.
       (_ffi_call_SYSV):  Add missing function type symbol .def and
       add EH markup labels.
       (_ffi_call_STDCALL):  Likewise.
       (_ffi_closure_SYSV):  Likewise.
       (_ffi_closure_raw_SYSV):  Likewise.
       (.eh_frame):  Add hand-crafted EH data.

2008-11-21  Eric Botcazou  <ebotcazou@adacore.com>

       * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
       signed/unsigned int8/16 return values.
       * src/sparc/v8.S (ffi_call_v8): Likewise.
       (ffi_closure_v8): Likewise.

2008-03-26  Kaz Kojima  <kkojima@gcc.gnu.org>

       * src/sh/sysv.S: Add .note.GNU-stack on Linux.
       * src/sh64/sysv.S: Likewise.

2008-03-26  Daniel Jacobowitz  <dan@debian.org>

       * src/arm/sysv.S: Fix ARM comment marker.
2009-06-03 17:42:56 +00:00
twall 00fa972430 properly glob-match 2008-12-27 16:59:05 +00:00
twall f5179e6794 Mark XFAIL on longdouble tests for x86_64/mingw 2008-12-26 19:06:28 +00:00
twall 80e2b5a749 clean up tests for win64 use 2008-12-22 15:21:15 +00:00
green 7063d9996f Version 3.0.8 with x86-solaris support 2008-12-19 16:13:46 +00:00
green bdfeb13f0d Bump to 3.0.7 2008-12-19 15:47:44 +00:00
green 69205de17d Many test fixes (failures due to excessive compiler warnings). 2008-07-24 18:03:48 +00:00
green 260d513fea Version 3.0.6. sh/sh64 fixes. 2008-07-17 13:13:52 +00:00
green 3704031875 Rev 3.0.5. 2008-04-03 18:57:57 +00:00
green 8406f5f48f 3.0.5 2008-04-03 18:57:34 +00:00
green 23a9e73212 2008-03-04 Anthony Green <green@redhat.com>
Blake Chaffin
            hos@tamanegi.org

        * testsuite/libffi.call/cls_align_longdouble_split2.c
          testsuite/libffi.call/cls_align_longdouble_split.c
          testsuite/libffi.call/cls_dbls_struct.c
          testsuite/libffi.call/cls_double_va.c
          testsuite/libffi.call/cls_longdouble.c
          testsuite/libffi.call/cls_longdouble_va.c
          testsuite/libffi.call/cls_pointer.c
          testsuite/libffi.call/cls_pointer_stack.c
          testsuite/libffi.call/err_bad_abi.c
          testsuite/libffi.call/err_bad_typedef.c
          testsuite/libffi.call/huge_struct.c
          testsuite/libffi.call/stret_large2.c
          testsuite/libffi.call/stret_large.c
          testsuite/libffi.call/stret_medium2.c
          testsuite/libffi.call/stret_medium.c: New tests from Apple.
2008-03-05 00:07:02 +00:00
green 429e37d3ad clicky 2008-02-28 04:50:19 +00:00
green 51e79c4283 getclicky 2008-02-28 04:47:35 +00:00
green affcab04e2 2008-02-26 Jakub Jelinek <jakub@redhat.com>
Anthony Green  <green@redhat.com>

        * src/alpha/osf.S: Add .note.GNU-stack on Linux.
        * src/s390/sysv.S: Likewise.
        * src/powerpc/linux64.S: Likewise.
        * src/powerpc/linux64_closure.S: Likewise.
        * src/powerpc/ppc_closure.S: Likewise.
        * src/powerpc/sysv.S: Likewise.
        * src/x86/unix64.S: Likewise.
        * src/x86/sysv.S: Likewise.
        * src/sparc/v8.S: Likewise.
        * src/sparc/v9.S: Likewise.
        * src/m68k/sysv.S: Likewise.
        * src/ia64/unix.S: Likewise.
        * src/arm/sysv.S: Likewise.
2008-02-26 19:01:53 +00:00
green 59689d5522 2008-02-26 Anthony Green <green@redhat.com>
Thomas Heller  <theller@ctypes.org>

        * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
        comment.
2008-02-26 17:40:51 +00:00
green b13c84cf46 2008-02-26 Anthony Green <green@redhat.org>
Thomas Heller <theller@ctypes.org>

        * include/ffi.h.in: Change void (*)() to void (*)(void).
2008-02-26 17:38:15 +00:00
green 265289f679 2008-02-26 Anthony Green <green@spindazzle.org>
* src/alpha/ffi.c: Change void (*)() to void (*)(void).
        src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
        src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
        src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
        src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
        src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
        src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,>         src/x86/ffi64.c: Ditto.
2008-02-26 17:34:36 +00:00
green fb5036cd6d fix date 2008-02-24 17:25:25 +00:00
green 40bec108e7 New release 2008-02-24 17:25:02 +00:00
green b922048fa8 2008-02-24 Anthony Green <green@spindazzle.org>
* configure.ac: Accept openbsd*, not just openbsd.
        Bump version to 3.0.4.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.
2008-02-24 17:24:00 +00:00
green affca4b92d sync readme with web page. 2008-02-22 21:53:29 +00:00
green 3e53d8752e New release 2008-02-22 21:52:38 +00:00
green 4d92f6c8e7 2008-02-22 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.3.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.  Clean up test docs.
2008-02-22 21:49:46 +00:00
green 0e185fa11a Update configure script. 2008-02-22 21:43:18 +00:00
green f73986bd21 2008-02-22 Bjoern Koenig <bkoenig@alpha-tierchen.de>
Andreas Tobler  <a.tobler@schweiz.org>

        * configure.ac: Add amd64-*-freebsd* target.
        * configure: Regenerate.
2008-02-22 21:40:53 +00:00
green 0208f68fe5 2008-02-22 Thomas Heller <theller@ctypes.org>
* configure.ac: Add x86 OpenBSD support.
        * configure: Rebuilt.
2008-02-22 21:15:44 +00:00
green 01adb0e638 Fix README. 2008-02-21 16:17:26 +00:00
green 1edd456322 3.0.2 2008-02-21 13:39:01 +00:00
green c9b5428008 add missing file 2008-02-21 13:36:43 +00:00
green d5fa5633d5 2008-02-21 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.2.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.

2008-02-21  Björn König <bkoenig@alpha-tierchen.de>

        * src/x86/freebsd.S: New file.
        * configure.ac: Add x86 FreeBSD support.
        * Makefile.am: Ditto.
2008-02-21 13:36:19 +00:00
green ac35bfc6fc Updated 2008-02-16 01:03:56 +00:00
green f7942975fe 2008-02-15 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.1.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.

2008-02-15  David Daney  <ddaney@avtrex.com>

        * src/mips/ffi.c: Remove extra '>' from include directive.
        (ffi_prep_closure_loc): Use clear_location instead of tramp.
2008-02-16 01:02:00 +00:00
green 59aa6bb1bf Add more platforms. 2008-02-15 20:52:26 +00:00
green 45a45ab990 3.0 notes 2008-02-15 19:16:36 +00:00
green 4db74cbea8 Update 2008-02-15 19:10:26 +00:00
green c3e1101ffa 2008-02-15 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.0,
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.

2008-02-15  David Daney  <ddaney@avtrex.com>

        * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
        Define (conditionally), and use it to include cachectl.h.
        (ffi_prep_closure_loc): Fix cache flushing.
        * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
2008-02-15 18:43:40 +00:00
green 7e0cc12e92 New release 2008-02-15 15:51:03 +00:00
green 2d7dc885ec * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
Update dates and remove all references to ffi_prep_closure.
        * configure.ac: Bump version to 2.99.9.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
2008-02-15 15:30:26 +00:00
green a0525f03ee New release. 2008-02-15 15:14:30 +00:00
green 2b30dfb314 * man/ffi_prep_closure.3: Delete.
* man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
        (man_MANS): Ditto.
        * man/Makefile.in: Rebuilt.
        * configure.ac: Bump version to 2.99.8.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
2008-02-15 15:12:43 +00:00
green bf41e64840 Update. 2008-02-15 01:56:50 +00:00
green 4d39ddee67 * configure.ac: Bump version to 2.99.7.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * include/ffi.h.in LICENSE src/debug.c src/closures.c
          src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
          src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
          src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
          src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
          src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
          src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
          src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
          src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
          src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
          src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
          src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
          src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
          src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
          src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
          src/arm/ffitarget.h src/prep_cif.c: Update license text.
2008-02-15 01:24:06 +00:00
green d58b032b41 New release 2008-02-15 00:59:25 +00:00
green 91e5478df6 Update supported platforms. Bump version. 2008-02-15 00:50:30 +00:00
green bd0768f877 * configure.ac: Bump version to 2.99.5.
* configure: Rebuilt.
        * Makefile.am (EXTRA_DIST): Add darwin64.S
        * Makefile.in: Rebuilt.
        * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
        * LICENSE: Update WARRANTY.
2008-02-15 00:45:33 +00:00
green 49d345f767 update license reference 2008-02-14 23:43:27 +00:00
green 12ac48fc79 Update WARRANTY 2008-02-14 23:42:08 +00:00
green 6b91c41da8 fix tarball reference 2008-02-14 23:38:27 +00:00
green 2b59579e35 First update in 5 years! 2008-02-14 23:35:58 +00:00
green 6cbdf3f3a3 Fix .pc file bug and bump version 2008-02-14 22:44:06 +00:00
green 1d1dc81104 Add man files and info file. Update README. Tag as 2.99.3. 2008-02-14 22:03:37 +00:00
tromey f045a2367f Move entry from ChangeLog to ChangeLog.libffi 2008-02-14 20:46:57 +00:00
tromey 6257f07d1a * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
* mdate-sh, texinfo.tex: New files.
	* Makefile.am (info_TEXINFOS): New variable.
	* doc/libffi.texi: New file.
	* doc/version.texi: Likewise.
2008-02-14 20:33:17 +00:00
green 4232af563c * Makefile.am (AM_CFLAGS): Don't compile with -D.
(lib_LTLIBRARIES): Define.
        (toolexeclib_LIBRARIES): Undefine.
        * Makefile.in: Rebuilt.
        * configure.ac: Reset version to 2.99.1.
        * configure.in: Rebuilt.
2008-02-14 16:19:21 +00:00
green 961543615c Fix typo. 2008-02-14 15:57:40 +00:00
green aeb0abab87 * libffi.pc.in: Usse @PACKAGE_NAME@ and @PACKAGE_VERSION@.
* configure.ac: Reset version to 2.99.1.
        * configure.in: Rebuilt.
        * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
        * Makefile.in: Rebuilt.
        * LICENSE: Update copyright notice.
2008-02-14 15:54:27 +00:00
green 77fe243556 Fix make dist again 2008-02-14 15:37:00 +00:00
green d4970cf452 Fix make dist 2008-02-14 15:18:56 +00:00
green f0b1462f2d Use pkgconfig. Increment libtool CURRENT version. 2008-02-14 15:01:41 +00:00
green 27e52f33ba Fix header installs when using DESTDIR. 2008-02-03 13:59:48 +00:00
twall fadab28eb6 update changelog 2008-02-03 12:32:22 +00:00
twall b5e44c8dfa offset from code base address, not data base address 2008-02-03 01:12:32 +00:00
green f359848d1a Fix header installs. 2008-02-01 21:29:43 +00:00
green c30df49e15 Revert my broken changes to twall's patch. 2008-02-01 21:13:55 +00:00
green 675561bb9a Fix make dist . 2008-01-31 13:44:25 +00:00
green abc0bbf381 Add Tim Wall's x86 windows patch. 2008-01-31 11:58:57 +00:00
green e332366d15 Add HJ's -fomit-frame-pointer struct return fix 2008-01-30 13:21:02 +00:00
green d420424039 Clean up for new automake. 2008-01-30 12:42:34 +00:00
green f4932dd020 Fixes to run testsuite 2008-01-30 12:40:25 +00:00
green 085520ddc8 New files from gcc tree. 2008-01-29 15:16:43 +00:00
green 77175b3f72 Latest gcc svn sources 2008-01-29 15:15:20 +00:00
green 2544e45a0b Install ffitarget.h in $prefix/include. 2008-01-29 14:28:13 +00:00
green 6002211b1c Add new files. 2008-01-29 12:30:10 +00:00
green ccabd2b16b Merge from gcc 2008-01-29 12:28:15 +00:00
tromey e680ecfbfc Pulled in libffi from gcc trunk.
Fixed build and install for standalone use.
2006-12-24 23:12:15 +00:00
root e7ba089659 sourcware.org 2006-06-04 23:22:24 +00:00
root 0cd4aa24e2 Add LockDir 2004-05-30 01:51:57 +00:00
green 5826120fbd Add link to Gianni's web site. 2003-11-04 06:09:08 +00:00
jsm 220aa4b27d Newer, better, increased from before! (list of acceptable anon usernames) 2003-01-21 08:07:42 +00:00
green 1c3adc892c Fixed Cygnus references. 2002-12-06 01:28:03 +00:00
green 4af66bb62f Testsuite fixes. 2001-10-21 19:18:42 +00:00
green 5435965f90 * include/ffi_common.h: Delete, after moving contents to...
* include/ffi_private.h: Subsume contents of ffi_common.h.
        * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h.
        * include/Makefile.in: Rebuilt.
        * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c,
        ia64/ffi.c: Include ffi_private.h, not ffi_common.h.
        * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h.
        * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include
        ffi_common.h.
        * debug.c: Include ffi_private.h instead of ffi_common.h.

        * mips/ffi.c (calc_n32_struct_flags): Make static.
        (FIX_ARGP): Remove call to debugging routine ffi_stop_here.

        * mips/n32.S: Include ffi_private.h.
        * mips/o32.S: Include ffi_private.h.
2001-04-23 00:32:03 +00:00
green 6fdb7de0fe * README: Update some comments.
* Makefile.am (SUBDIRS): Add include so ffi.h gets installed.
        * Makefile.in: Rebuilt.

        * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__.
        * types.c: Ditto.
        * prep_cif.c (ffi_prep_cif): Ditto.

        * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S:
        Include ffi_private.h.

        * include/ffi_private.h (FFI_TYPE_LAST): Define.
2001-04-22 19:38:34 +00:00
green bc7144b01b Moved files from old home 2001-04-22 18:28:36 +00:00
green e57279831e These are dead. 2001-04-22 18:23:47 +00:00
green 7247436b5f All these files live somewhere else now. 2001-04-22 18:22:43 +00:00
green a8b0d40ff9 Many changes. Not quite there yet. 2001-04-22 18:17:14 +00:00
green f893d22733 Moved m68k files 2001-04-22 18:13:22 +00:00
green 688ddfeced New, target indepentent, header 2001-04-22 18:12:33 +00:00
green f9e40776d4 Many changes. 2001-04-22 18:11:57 +00:00
green 8c1d2eb47f Many changes 2001-04-22 18:10:47 +00:00
green 1359dfc658 Moved ia64 files 2001-04-22 18:10:20 +00:00
green 6e2de5eee3 Moved arm files 2001-04-22 18:08:11 +00:00
green 8807355af3 Many many updates. Merge from gcc and then some. 2001-04-09 00:58:38 +00:00
green f7e9f91ade Mnay fixes. 2000-04-17 03:32:37 +00:00
green c4860de618 Merge from libgcj. Merged patches from net. See ChangeLog for details. 2000-04-17 03:18:46 +00:00
jsm c578b58314 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
	Deleted; generic versions now used for all repositories.

	* CVSROOT/commitinfo, CVSROOT/loginfo:  Change pathnames to
	generic versions.

        * CVSROOT/checkoutlist:  Don't try to check out the removed
        files any longer.
1999-10-09 20:18:16 +00:00
jsm acdb200512 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
	Deleted; generic versions now used for all repositories.

	* CVSROOT/commitinfo, CVSROOT/loginfo:  Change pathnames to
	generic versions.

        * CVSROOT/checkoutlist:  Don't try to check out the removed
        files any longer.
1999-10-09 20:18:15 +00:00
green e75be655ce New configury 1999-08-08 13:16:41 +00:00
green d6669a0dd5 * include/ffi.h.in: Try to work around messy header problem
with PACKAGE and VERSION.

	* configure: Rebuilt.
	* configure.in: Change version to 2.00-beta.

        * fficonfig.h.in: Rebuilt.
	* acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.

	* src/x86/ffi.c (ffi_raw_call): Rename.
1999-08-08 13:05:12 +00:00
green 4819d52b00 New file for Kresten's closure work 1999-08-04 18:02:34 +00:00
green 2dbf801eb4 Kresten's closure work. Initial checkin. 1999-08-04 18:00:05 +00:00
green d170961701 * configure.in: Add x86 and powerpc BeOS configurations.
From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
1999-07-08 14:36:52 +00:00
jsm c7747d9769 1999-05-12 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Add links to libffi* mail list archives.
1999-05-12 23:32:16 +00:00
green dd2aa9a8de * configure.in: Add warning about this being beta code.
Remove src/Makefile.am from the picture.
	* configure: Rebuilt.
	* Makefile.am: Move logic from src/Makefile.am.  Add changes
	to support libffi as a target library.
	* Makefile.in: Rebuilt.
	* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
	Upgraded to new autoconf, automake, libtool.
	* README: Tweaks.
	* LICENSE: Update copyright date.
	* src/Makefile.am, src/Makefile.in: Removed.
1999-05-06 05:34:36 +00:00
green 4e9452abed Updated to new automake, libtool, autoconf - nothing works :-) 1999-05-05 22:06:13 +00:00
jsm 6d3b2bddaf 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Missed a reference to libffi-discuss@cygnus.com.  Fixed.
1999-04-26 15:55:28 +00:00
jsm ebc6a9c28a 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Change links to ftp directory to point to sourceware
        directory.
        Change mailing list subscription forms to point to sourceware lists.
1999-04-26 15:53:29 +00:00
jsm 78ffc52a8b Standard sourceware setup. 1999-04-18 01:33:21 +00:00
jsm b4d77e827d Small typeo. (I wouldn't bother except that it made the sentence hard
for me to parse on a casual read.)
1998-11-30 11:11:25 +00:00
jsm bfb73f08fd A few cleanups. Most notably, point to the correct subscribe cgi-bin
script.
1998-11-30 10:44:55 +00:00
green af8b7f037c * index.html: Reformatted and updated to reflect hosting on
sourceware.cygnus.com (new mailing lists, etc).
1998-11-30 06:20:05 +00:00
green 334f0b0609 initial snapshot of documentation 1998-11-29 16:56:12 +00:00
green 3ab5cb4a1d Initial revision 1998-11-29 16:56:10 +00:00
green d2a9eb5a8b This commit was generated by cvs2svn to compensate for changes in r7, which
included commits to RCS files with non-trunk default branches.
1998-11-29 16:48:16 +00:00
green bc75c54bd3 Import of v1 code. 1998-11-29 16:48:16 +00:00
jsm d3782ec816 Send commit messages to mailing lists. 1998-11-20 20:18:00 +00:00
jsm 8d8d3843c4 initial checkin 1998-10-01 22:08:36 +00:00
jsm 49634f3bf2 Add standard setup. 1998-10-01 22:08:35 +00:00
jsm c64a84c769 Add readers and standard modules file. 1998-10-01 22:08:34 +00:00
jsm 9813273b07 initial checkin 1998-10-01 22:08:33 +00:00
579 arquivos alterados com 275898 adições e 4496 exclusões
+2
Ver Arquivo
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="jna/build.eclipse/test-classes" path="contrib/platform/test"/>
<classpathentry kind="src" path="contrib/platform/src"/>
<classpathentry kind="src" output="build.eclipse/test-classes" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+7
Ver Arquivo
@@ -8,3 +8,10 @@ bin
contrib/ntservice/dist
contrib/platform/dist
doc
*~
**/*~
dist/*.asc
dist/*-sources.jar
dist/*-javadoc.jar
dist/src-mvn.zip
dist/out-of-date.jar
+29 -4
Ver Arquivo
@@ -1,14 +1,39 @@
Release 3.5.0
=============
Features
--------
* `Structure.getFieldOrder()` supersedes `Structure.setFieldOrder()` and is now required - [@twall](https://github.com/twall).
* Search `~/Library/Frameworks` and `/Library/Frameworks` on OSX - [@shaneholloway](https://github.com/shaneholloway).
* Automatic cleanup of native threads (based on suggestions from neil smith) - [@twall](https://github.com/twall).
* Add `android-arm` target - [@ochafik](https://github.com/ochafik), [@twall](https://github.com/twall).
* Add `jna.tmpdir` to override temporary JNA storage location - [@twall](https://github.com/twall).
* Add `EXTRA_MAKE_OPTS` ant property to override make variables - [@twall](https://github.com/twall).
* Add `Library.OPTION_OPEN_FLAGS` to customize dlopen behavior - [@twall](https://github.com/twall).
* [#113](https://github.com/twall/jna/issues/113), [#114](https://github.com/twall/jna/issues/114): Add support for GNU/kFreeBSD and debian multi-arch distros - [@twall](https://github.com/twall).
Bug Fixes
---------
* Fix `Advapi32Util.registryGetValues()` tried to allocate memory for a zero-length `REG_BINARY` value - [@phailwhale22](https://github.com/phailwhale22).
* Fix crash in direct mode callbacks with certain type conversions - [@twall](https://github.com/twall).
* More thoroughly propagate unexpected exceptions generated in jnidispatch - [@twall](https://github.com/twall).
* Cleanup maven poms and publishing to central repo - [@bhamail](https://github.com/bhamail).
* [#129](https://github.com/twall/jna/issues/129): Allow `Memory` field in structure - [@twall](https://github.com/twall).
* Preserve `PointerType` fields on `Structure.read()` if unchanged - [@twall](https://github.com/twall).
* [#128](https://github.com/twall/jna/issues/128): Fix masking extracting DWORD upper and lower WORD values - [@twall](https://github.com/twall).
* [#135](https://github.com/twall/jna/issues/135): Fix for `Advapi32Util.registryGetValues()` when reading zero length values - [@danwi](https://github.com/danwi).
Release 3.4.2
=============
Features
--------
* Add `platform.win32.Kernel32.GetEnvironmentVariable` and `platform.win32.Kernel32Util.getEnvironmentVaraible` - [@dblock](https://github.com/dblock).
* Add `platform.win32.Kernel32.GetEnvironmentVariable` and `platform.win32.Kernel32Util.getEnvironmentVariable` - [@dblock](https://github.com/dblock).
* Moved `Kernel32.dll` function definitions from `WinNT.java` into `Kernel32.java` - [@dblock](https://github.com/dblock).
* Provide `toPointer()` methods on all `_PTR` types (platform win32) - [@twall](https://github.com/twall).
* Provide ant -Dskip-native to skip platform native build.
* Provide ant -Dheadless=true to run unit tests headless.
* Added windows dev environment instructions.
* Provide `ant -Dskip-native` to skip platform native build - [@twall](https://github.com/twall).
* Provide `ant -Dheadless=true` to run unit tests headless - [@twall](https://github.com/twall).
* Added Windows dev environment instructions - [@twall](https://github.com/twall).
Bug Fixes
---------
+29 -27
Ver Arquivo
@@ -3,7 +3,7 @@
Java Native Access (JNA)
========================
The definitive JNA reference (including an overview and usage details) is in the [JavaDoc](http://twall.github.com/jna/3.4.2/javadoc/). Please read the [overview](http://twall.github.com/jna/3.4.2/javadoc/overview-summary.html#overview_description).
The definitive JNA reference (including an overview and usage details) is in the [JavaDoc](http://twall.github.com/jna/3.5.0/javadoc/). Please read the [overview](http://twall.github.com/jna/3.5.0/javadoc/overview-summary.html#overview_description).
JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.
@@ -18,15 +18,10 @@ JNA includes a platform library with many native functions already mapped as wel
Download
========
Version 3.4.2
Version 3.5.0
* [jna.jar](jna/blob/3.4.2/dist/jna.jar?raw=true)
* [platform.jar](jna/blob/3.4.2/dist/platform.jar?raw=true)
Version 3.4.1
* [jna.jar](jna/blob/3.4.1/dist/jna.jar?raw=true)
* [platform.jar](jna/blob/3.4.1/dist/platform.jar?raw=true)
* [jna.jar](jna/blob/3.5.0/dist/jna.jar?raw=true)
* [platform.jar](jna/blob/3.5.0/dist/platform.jar?raw=true)
Features
========
@@ -42,7 +37,7 @@ Features
* Nested structures and arrays
* Wide (wchar_t-based) strings
* Native long support (32- or 64-bit as appropriate)
* Demo applications
* [Demo applications/examples](https://github.com/twall/jna/tree/master/contrib)
* Supported on 1.4 or later JVMs, including JavaME (earlier VMs may work with stubbed NIO support)
* Customizable marshalling/unmarshalling (argument and return value conversions)
* Customizable mapping from Java method to native function name, and customizable invocation to simulate C preprocessor function macros
@@ -73,31 +68,39 @@ For commercial support, please contact twalljava [at] java [dot] net.
Using the Library
=================
* [Getting Started](jna/tree/master/www/GettingStarted.md)
* [Mapping between Java and Native](jna/tree/master/www/Mappings.md)
* [Using Pointers and Arrays](jna/tree/master/www/PointersAndArrays.md)
* [Using Structures and Unions](jna/tree/master/www/StructuresAndUnions.md)
* [Using By-Reference Arguments](jna/tree/master/www/ByRefArguments.md)
* [Customization of Type Mapping](jna/tree/master/www/CustomMappings.md)
* [Callbacks/Function Pointers/Closures](jna/tree/master/www/CallbacksAndClosures.md)
* [Dynamically Typed Languages (JRuby/Jython)](jna/tree/master/www/DynamicallyTypedLanguages.md)
* [Platform Library](jna/tree/master/www/PlatformLibrary.md)
* [Direct Method Mapping](jna/tree/master/www/DirectMapping.md) (Optimization)
* [Frequently Asked Questions (FAQ)](jna/tree/master/www/FrequentlyAskedQuestions.md)
* [Setting up a Windows Development Environment](jna/tree/master/www/WindowsDevelopmentEnvironment.md)
* [Avoiding Crashes](http://twall.github.com/jna/3.4.2/javadoc/overview-summary.html#crash-protection)
* [Getting Started](https://github.com/twall/jna/blob/master/www/GettingStarted.md)
* [Mapping between Java and Native](https://github.com/twall/jna/blob/master/www/Mappings.md)
* [Using Pointers and Arrays](https://github.com/twall/jna/blob/master/www/PointersAndArrays.md)
* [Using Structures and Unions](https://github.com/twall/jna/blob/master/www/StructuresAndUnions.md)
* [Using By-Reference Arguments](https://github.com/twall/jna/blob/master/www/ByRefArguments.md)
* [Customization of Type Mapping](https://github.com/twall/jna/blob/master/www/CustomMappings.md)
* [Callbacks/Function Pointers/Closures](https://github.com/twall/jna/blob/master/www/CallbacksAndClosures.md)
* [Dynamically Typed Languages (JRuby/Jython)](https://github.com/twall/jna/blob/master/www/DynamicallyTypedLanguages.md)
* [Platform Library](https://github.com/twall/jna/blob/master/www/PlatformLibrary.md)
* [Direct Method Mapping](https://github.com/twall/jna/blob/master/www/DirectMapping.md) (Optimization)
* [Frequently Asked Questions (FAQ)](https://github.com/twall/jna/blob/master/www/FrequentlyAskedQuestions.md)
* [Avoiding Crashes](http://twall.github.com/jna/3.5.0/javadoc/overview-summary.html#crash-protection)
Primary Documentation (JavaDoc)
===============================
The definitive JNA reference is in the [JavaDoc](http://twall.github.com/jna/3.4.2/javadoc/).
The definitive JNA reference is in the [JavaDoc](http://twall.github.com/jna/3.5.0/javadoc/).
Developers
==========
* [Contributing to JNA](https://github.com/twall/jna/blob/master/www/Contributing.md).
* [Setting up a Windows Development Environment](https://github.com/twall/jna/blob/master/www/WindowsDevelopmentEnvironment.md)
* [Setting up an Android Development Environment](https://github.com/twall/jna/blob/master/www/AndroidDevelopmentEnvironment.md)
* [Releasing JNA](https://github.com/twall/jna/blob/master/www/ReleasingJNA.md)
* [Publishing to Maven Central](https://github.com/twall/jna/blob/master/www/PublishingToMavenCentral.md)
Contributing
============
You're encouraged to contribute to JNA. Fork the code from [github.com/twall/jna](https://github.com/twall/jna) and submit pull requests.
You're encouraged to contribute to JNA. Fork the code from [https://github.com/twall/jna](https://github.com/twall/jna) and submit pull requests.
For more informationon setting up a development environment see [Contributing to JNA](jna/tree/master/www/Contributing.md).
For more information on setting up a development environment see [Contributing to JNA](https://github.com/twall/jna/blob/master/www/Contributing.md).
If you are interested in paid support, feel free to say so on the [jna-users mailing list](http://groups.google.com/group/jna-users). Most simple questions will be answered on the list, but more complicated work, new features or target platforms can be negotiated with any of the JNA developers (this is how several of JNA's features came into being). You may even encounter other users with the same need and be able to cost share the new development.
@@ -107,4 +110,3 @@ License
This library is provided under the LGPL, version 2.1 or later. Alternative license arrangements are negotiable.
*NOTE: Oracle is not sponsoring this project, even though the package name (com.sun.jna) might imply otherwise.*
+287 -220
Ver Arquivo
@@ -9,7 +9,8 @@
support it).
Cross-compile by specifying -Dos.prefix={name-arch} to ant
(cross-compile currently only configured/tested on w32ce-arm)
(cross-compile currently only configured/tested on w32ce-arm and
android-arm)
Use -Dskip-native to skip building native parts.
Use -Dheadless to run tests headless
@@ -28,6 +29,7 @@
<!-- (all build-related props should go in -dynamic-properties) -->
<property name="name" value="jna"/>
<property name="jar" value="${name}.jar"/>
<property name="minjar" value="${name}-min.jar"/>
<property name="testjar" value="${name}-test.jar"/>
<property name="debug" value="true"/>
<property name="debug.native" value="false"/>
@@ -49,17 +51,17 @@
<buildnumber/>
<!-- JNA library release version -->
<property name="jna.major" value="3"/>
<property name="jna.minor" value="4"/>
<property name="jna.revision" value="2"/>
<property name="jna.minor" value="5"/>
<property name="jna.revision" value="0"/>
<property name="jna.build" value="${build.number}"/>
<property name="jna.version" value="${jna.major}.${jna.minor}.${jna.revision}"/>
<!-- jnidispatch library release version -->
<property name="jni.major" value="3"/>
<property name="jni.minor" value="4"/>
<property name="jni.minor" value="5"/>
<property name="jni.revision" value="0"/>
<property name="jni.build" value="${build.number}"/>
<property name="jni.version" value="${jni.major}.${jni.minor}.${jni.revision}"/>
<property name="jni.md5" value="4c69bcf40b30785215211b5a5dad211e"/>
<property name="jni.md5" value="60417f69d77e4d8d693b43391a4a5b91"/>
<property name="spec.title" value="Java Native Access (JNA)"/>
<property name="spec.vendor" value="${vendor}"/>
<property name="spec.version" value="${jna.major}"/>
@@ -73,31 +75,32 @@
<condition property="test.compatibility" value="1.4">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<condition property="tests.exclude-patterns" value="**/VarArgsTest.java,**/AnnotatedLibraryTest.java,**/WebStartTest.java,**/PointerBufferTest.java,**/HeadlessLoadLibraryTest.java,**/StructureBufferFieldTest.java,**/PerformanceTest.java,**/*BufferArgumentsMarshalTest.java">
<condition property="tests.exclude-patterns" value="**/VarArgsTest.java,**/AnnotatedLibraryTest.java,**/WebStartTest.java,**/PointerBufferTest.java,**/HeadlessLoadLibraryTest.java,**/StructureBufferFieldTest.java,**/PerformanceTest.java,**/*BufferArgumentsMarshalTest.java" else="**/wince/*.java">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<property name="test.compatibility" value="1.5"/>
<property name="dist-jar" value="${dist}/jna.jar"/>
<property name="dist-jar" value="${dist}/${jar}"/>
<!-- Maven -->
<!-- define Maven coordinates -->
<property name="groupId" value="net.java.dev.jna" />
<property name="artifactId" value="jna" />
<property name="version" value="${jna.major}.${jna.minor}.${jna.revision}" />
<property name="maven-javadoc-jar" value="${dist}/${artifactId}-${version}-javadoc.jar" />
<property name="maven-sources-jar" value="${dist}/src-mvn.zip" />
<property name="maven-javadoc-jar" value="${dist}/${artifactId}-${jna.version}-javadoc.jar" />
<property name="maven-sources-jar" value="${dist}/${artifactId}-${jna.version}-sources.jar" />
<property name="platform-jar" value="${dist}/platform.jar"/>
<property name="platform-javadoc-jar" value="${dist}/platforms-javadoc.jar" />
<property name="platform-sources-jar" value="${dist}/platforms-sources.jar" />
<property name="platform-javadoc-jar" value="${dist}/platform-${jna.version}-javadoc.jar" />
<property name="platform-sources-jar" value="${dist}/platform-${jna.version}-sources.jar" />
<property name="pom" value="pom-jna.xml" />
<property name="pom-platform" value="pom-platform.xml" />
<!-- defined maven snapshots and staging repository id and url -->
<property name="maven-snapshots-repository-id" value="snapshots.java.net" />
<property name="maven-snapshots-repository-url" value="https://maven.java.net/content/repositories/snapshots" />
<property name="maven-snapshots-repository-url" value="https://maven.java.net/content/repositories/snapshots/" />
<property name="maven-staging-repository-id" value="staging.java.net" />
<property name="maven-staging-repository-url" value="https://maven.java.net/service/local/staging/deploy/maven2" />
<property name="maven-staging-repository-url" value="https://maven.java.net/service/local/staging/deploy/maven2/" />
<!-- Miscellaneous -->
<property name="build.compiler.emacs" value="true"/>
@@ -113,6 +116,11 @@
<replaceregexp match="(&lt;version&gt;).*(&lt;/version&gt;)"
replace="\1${jna.version}\2"
file="${pom}"/>
<replaceregexp match="(&lt;version&gt;).*(&lt;/version&gt;)"
replace="\1${jna.version}\2"
file="${pom-platform}"/>
<replaceregexp match='VERSION = ".*";'
replace='VERSION = "${jna.version}";'
file="src/com/sun/jna/Native.java"/>
@@ -123,16 +131,26 @@
<condition property="jar.omitted" value="**/*jnidispatch*" else="jnilib-included">
<isset property="omit-jnilib"/>
</condition>
<condition property="cross-compile" value="true">
<isset property="os.prefix"/>
</condition>
<!-- Keep cross-compiled natives separate from normal builds -->
<condition property="native.subdir" value="native-${os.prefix}" else="native">
<isset property="cross-compile"/>
</condition>
<condition property="vm.arch" value="-d64" else="">
<or>
<equals arg1="${sun.arch.data.model}" arg2="64" trim="true"/>
<equals arg1="${com.ibm.vm.bitmode}" arg2="64" trim="true"/>
<os arch="x86_64"/>
<os arch="amd64"/>
<os arch="sparcv9"/>
<os arch="ppc64"/>
<os arch="ia64"/>
</or>
<and>
<not><equals arg1="${os.prefix}" arg2="android-arm" trim="true"/></not>
<or>
<equals arg1="${sun.arch.data.model}" arg2="64" trim="true"/>
<equals arg1="${com.ibm.vm.bitmode}" arg2="64" trim="true"/>
<os arch="x86_64"/>
<os arch="amd64"/>
<os arch="sparcv9"/>
<os arch="ppc64"/>
<os arch="ia64"/>
</or>
</and>
</condition>
<condition property="ld.preload" value="LD_PRELOAD_64" else="LD_PRELOAD">
<and>
@@ -195,7 +213,7 @@
<not><equals arg1="${libjsig}" arg2=""/></not>
</condition>
<property name="native.jar" value="${os.prefix}.jar"/>
<property name="build.native" location="${build}/native"/>
<property name="build.native" location="${build}/${native.subdir}"/>
<property name="md5.file" location="${build.native}/jni.checksum"/>
<mkdir dir="${build}"/>
@@ -211,6 +229,10 @@
<echo>java.home=${java.home}</echo>
<echo>java.library.path=${java.library.path}</echo>
<echo>os.prefix=${os.prefix}</echo>
<echo>os.name=${os.name}</echo>
<echo>os.arch=${os.arch}</echo>
<echo>build=${build}</echo>
<echo>build.native=${build.native}</echo>
</target>
@@ -251,6 +273,7 @@
<uptodate property="-jar" targetfile="${build}/${jar}">
<srcfiles dir="${classes}">
<patternset id="jar-compiled">
<include name="lib/armeabi/*"/>
<include name="com/sun/jna/*"/>
<include name="com/sun/jna/**/*"/>
</patternset>
@@ -259,7 +282,10 @@
</target>
<target name="jar" depends="-setup,native,:jar" unless="-jar"
description="Build primary jar">
<jar jarfile="${build}/${jar}">
<!-- Bundle native components with primary jar to facilitate
easy distribution to common platforms.
-->
<jar jarfile="${build}/${jar}" duplicate="preserve">
<manifest>
<attribute name="Main-Class" value="com.sun.jna.Native"/>
<attribute name="Manifest-Version" value="1.0"/>
@@ -269,11 +295,134 @@
<attribute name="Specification-Title" value="${spec.title}"/>
<attribute name="Specification-Vendor" value="${spec.vendor}"/>
<attribute name="Specification-Version" value="${spec.version}"/>
<!--
OSGi Bundle attributes
See http://www.osgi.org/Specifications/Reference
-->
<attribute name="Bundle-Category" value="jni"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="jna"/>
<attribute name="Bundle-Description" value="JNA Library"/>
<attribute name="Bundle-SymbolicName" value="com.sun.jna"/>
<attribute name="Bundle-Version" value="${spec.version}"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/>
<attribute name="Bundle-Vendor" value="${vendor}"/>
<attribute name="Bundle-ActivationPolicy" value="lazy"/>
<attribute name="Export-Package" value="com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32"/>
<!-- Note that no terminal "*" is included in this list,
which will force failure on unsupported platforms.
-->
<attribute name="Bundle-NativeCode"
value="
com/sun/jna/win32-x86/jnidispatch.dll;
processor=x86;osname=win32,
com/sun/jna/win32-amd64/jnidispatch.dll;
processor=x86-64;osname=win32,
com/sun/jna/w32ce-arm/jnidispatch.dll;
processor=arm;osname=wince,
com/sun/jna/sunos-x86/libjnidispatch.so;
processor=x86;osname=sunos,
com/sun/jna/sunos-amd64/libjnidispatch.so;
processor=x86-64;osname=sunos,
com/sun/jna/sunos-sparc/libjnidispatch.so;
processor=sparc;osname=sunos,
com/sun/jna/sunos-sparcv9/libjnidispatch.so;
processor=sparcv9;osname=sunos,
com/sun/jna/aix-ppc/libjnidispatch.a;
processor=ppc;osname=aix,
com/sun/jna/aix-ppc64/libjnidispatch.a;
processor=ppc64;osname=aix,
com/sun/jna/linux-ppc/libjnidispatch.so;
processor=ppc;osname=linux,
com/sun/jna/linux-ppc64/libjnidispatch.so;
processor=ppc64;osname=linux,
com/sun/jna/linux-i386/libjnidispatch.so;
processor=x86;osname=linux,
com/sun/jna/linux-amd64/libjnidispatch.so;
processor=x86-64;osname=linux,
com/sun/jna/linux-arm/libjnidispatch.so;
processor=arm;osname=linux,
com/sun/jna/linux-ia64/libjnidispatch.so;
processor=ia64;osname=linux,
com/sun/jna/openbsd-i386/libjnidispatch.so;
processor=x86;osname=openbsd,
com/sun/jna/freebsd-i386/libjnidispatch.so;
processor=x86;osname=freebsd,
com/sun/jna/freebsd-amd64/libjnidispatch.so;
processor=x86-64;osname=freebsd,
com/sun/jna/darwin/libjnidispatch.jnilib;
osname=macos
"/>
</manifest>
<fileset dir="${classes}" excludes="${jar.omitted}">
<patternset refid="jar-compiled"/>
</fileset>
<zipfileset src="${lib.native}/win32-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-x86"/>
<zipfileset src="${lib.native}/aix-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/aix-ppc"/>
<zipfileset src="${lib.native}/aix-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/aix-ppc64"/>
<zipfileset src="${lib.native}/darwin.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin"/>
<zipfileset src="${lib.native}/linux-i386.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-i386"/>
<zipfileset src="${lib.native}/linux-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-amd64"/>
<zipfileset src="${lib.native}/linux-arm.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-arm"/>
<zipfileset src="${lib.native}/linux-ia64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ia64"/>
<zipfileset src="${lib.native}/linux-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc"/>
<zipfileset src="${lib.native}/linux-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc64"/>
<zipfileset src="${lib.native}/sunos-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-x86"/>
<zipfileset src="${lib.native}/sunos-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-amd64"/>
<zipfileset src="${lib.native}/sunos-sparc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-sparc"/>
<zipfileset src="${lib.native}/sunos-sparcv9.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-sparcv9"/>
<zipfileset src="${lib.native}/freebsd-i386.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/freebsd-i386"/>
<zipfileset src="${lib.native}/freebsd-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/freebsd-amd64"/>
<zipfileset src="${lib.native}/openbsd-i386.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/openbsd-i386"/>
<zipfileset src="${lib.native}/win32-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-amd64"/>
<zipfileset src="${lib.native}/w32ce-arm.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/w32ce-arm"/>
</jar>
<zip zipfile="${build}/${minjar}">
<zipfileset src="${build}/${jar}" excludes="**/*jnidispatch*"/>
</zip>
</target>
<target name="platform-jar" depends="jar">
@@ -287,8 +436,7 @@
</subant>
<!-- Sources package as required by maven -->
<zip zipfile="${platform-sources-jar}">
<zipfileset dir="${src}" includes="**/*.java,**/*.html,**/*.png"/>
<zipfileset dir="${contrib}/platform" includes="**/*.java"/>
<zipfileset dir="${contrib}/platform/src" />
</zip>
<jar jarfile="${platform-javadoc-jar}">
<fileset dir="${javadoc}" />
@@ -308,6 +456,7 @@
<javah classpath="${classes}" destdir="${build.native}" force="yes">
<class name="com.sun.jna.Function"/>
<class name="com.sun.jna.Native"/>
<class name="com.sun.jna.win32.DLLCallback"/>
</javah>
<condition property="grep" value="/usr/sfw/bin/ggrep">
<os name="SunOS"/>
@@ -367,6 +516,7 @@
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-amd64.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-sparc.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/sunos-sparcv9.jar" overwrite="true"/>
<copy file="${lib.native}/out-of-date.jar" tofile="${lib.native}/android-arm.jar" overwrite="true"/>
<delete failOnError="false" includeEmptyDirs="true">
<fileset dir="${build.native}" includes="*.o,*jnidispatch*"/>
</delete>
@@ -412,11 +562,19 @@
replace="CHECKSUM=${jni.md5} ${comment}"
file="native/Makefile" byline="true"/>
<!-- Handle cross-compilation -->
<condition property="make.OS" value="OS=w32ce" else="IGNORE=">
<condition property="make.OS" value="OS=w32ce">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<condition property="make.OS" value="OS=android">
<equals arg1="${os.prefix}" arg2="android-arm"/>
</condition>
<property name="make.OS" value="IGNORE="/>
<!-- Ensure Makefile ARCH property properly set -->
<condition property="ARCH" value="arm">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<condition property="ARCH" value="arm">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
<equals arg1="${os.prefix}" arg2="android-arm"/>
</condition>
<condition property="ARCH" value="ppc">
<equals arg1="${os.prefix}" arg2="aix-ppc"/>
@@ -438,19 +596,28 @@
</condition>
<condition property="make.SDKROOT"
value="SDKROOT=/Developer/SDKs/MacOSX10.6.sdk">
<available file="/Developer/SDKs/MacOSX10.6.sdk"/>
<and>
<equals arg1="${os.prefix}" arg2="darwin" trim="true"/>
<available file="/Developer/SDKs/MacOSX10.6.sdk"/>
</and>
</condition>
<condition property="make.SDKROOT"
value="SDKROOT=/Developer/SDKs/MacOSX10.5.sdk">
<available file="/Developer/SDKs/MacOSX10.5.sdk"/>
<and>
<equals arg1="${os.prefix}" arg2="darwin" trim="true"/>
<available file="/Developer/SDKs/MacOSX10.5.sdk"/>
</and>
</condition>
<condition property="make.SDKROOT"
value="SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk" else="IGNORE=">
<available file="/Developer/SDKs/MacOSX10.4u.sdk"/>
<and>
<equals arg1="${os.prefix}" arg2="darwin" trim="true"/>
<available file="/Developer/SDKs/MacOSX10.4u.sdk"/>
</and>
</condition>
<!-- Windows' drive letters and spaces in absolute paths wreak havoc on
make -->
<condition property="make.BUILD" value="BUILD=../${build}/native" else="BUILD=${build.native}">
<condition property="make.BUILD" value="BUILD=../${build}/${native.subdir}" else="BUILD=${build.native}">
<os family="windows"/>
</condition>
<condition property="make.PATH" value="PATH=/opt/csw/bin:/usr/sfw/bin:/usr/bin:/usr/ccs/bin" else="IGNORE=">
@@ -470,6 +637,14 @@
<os name="AIX"/>
</or>
</condition>
<!-- Allow explicit override of make variables -->
<condition property="make.OPTS" value="${EXTRA_MAKE_OPTS}" else="IGNORE=">
<isset property="EXTRA_MAKE_OPTS"/>
</condition>
<!-- Native resource path within jna.jar -->
<condition property="native.path" value="lib/armeabi" else="com/sun/jna/${os.prefix}">
<equals arg1="${os.prefix}" arg2="android-arm"/>
</condition>
<!-- Default make program -->
<property name="make" value="make"/>
@@ -486,16 +661,17 @@
<arg value="${make.ARCH}"/>
<arg value="${make.PATH}"/>
<arg value="${make.OS}"/>
<arg line="${make.OPTS}"/>
<arg value="JNA_JNI_VERSION=${jni.version}"/>
<arg value="CHECKSUM=${jni.md5}"/>
</exec>
<mkdir dir="${classes}/com/sun/jna/${os.prefix}"/>
<copy todir="${classes}/com/sun/jna/${os.prefix}">
<mkdir dir="${classes}/${native.path}"/>
<copy todir="${classes}/${native.path}">
<fileset dir="${build.native}"
includes="jnidispatch.dll,libjnidispatch.*"/>
</copy>
<mkdir dir="${eclipse.classes}/com/sun/jna/${os.prefix}"/>
<copy todir="${eclipse.classes}/com/sun/jna/${os.prefix}"
<mkdir dir="${eclipse.classes}/${native.path}"/>
<copy todir="${eclipse.classes}/${native.path}"
failonerror="false">
<fileset dir="${build.native}"
includes="jnidispatch.dll,libjnidispatch.*"/>
@@ -541,31 +717,38 @@
<fileset dir="${build.native}" includes="*jnidispatch.*"/>
</jar>
<signjar alias="jna" keystore="jna.keystore" storepass="jnadev" lazy="true">
<fileset dir="${build}/jws" includes="jna.jar,jna-test.jar,junit.jar,jnidispatch.jar,clover.jar"/>
<fileset dir="${build}/jws" includes="${jar},${testjar},junit.jar,jnidispatch.jar,clover.jar"/>
</signjar>
</target>
<target name="android-test-setup" depends="compile-tests"
description="Configure tests for running on an Android emulator">
<!-- 'shared' should be the path to a folder mounted as the mobile
device/simulator storage card. -->
<property name="shared" value="shared"/>
</target>
<target name="wince-test-setup" depends="compile-tests"
description="Configure tests for running on a Windows Mobile device">
description="Configure tests for running on the WM emulator">
<!-- 'shared' should be the path to a folder mounted as the mobile
device/simulator storage card. -->
<property name="shared" value="shared"/>
<!-- w32ce arm testing -->
<jar jarfile="${shared}/test.jar">
<zipfileset src="${build}/jna.jar"/>
<zipfileset src="${build}/jna-test.jar"/>
<zipfileset src="${build}/${jar}"/>
<zipfileset src="${build}/${testjar}"/>
</jar>
<copy todir="${shared}" file="${build}/jna.jar"/>
<copy todir="${shared}" file="${build}/native/jnidispatch.dll"/>
<copy todir="${shared}" file="${build}/native/testlib.dll"/>
<copy todir="${shared}" file="${build}/native/testlib2.dll"/>
<copy todir="${shared}" file="${build}/${jar}"/>
<copy todir="${shared}" file="${build.native}/jnidispatch.dll"/>
<copy todir="${shared}" file="${build.native}/testlib.dll"/>
<copy todir="${shared}" file="${build.native}/testlib2.dll"/>
<copy todir="${shared}" file="w32ce-test.lnk"/>
<chmod file="${shared}/*.dll" perm="+x"/>
</target>
<!-- When running tests from an IDE, be sure to set jna.library.path -->
<!-- to where the test library (testlib) is found. -->
<target name="test" depends="jar,compile-tests"
<target name="test" depends="jar,compile-tests" unless="cross-compile"
description="Run all unit tests">
<property name="test.fork" value="yes"/>
<property name="reports.junit" location="${reports}/junit"/>
@@ -595,10 +778,15 @@
<property name="tests.platform" value=""/>
<property name="tests.exclude" value=""/>
<property name="tests.exclude-patterns" value=""/>
<property name="headless" value="false"/>
<condition property="java.awt.headless" value="true">
<isset property="headless"/>
</condition>
<propertyset id="headless">
<propertyref prefix="java.awt.headless"/>
</propertyset>
<junit fork="${test.fork}" failureproperty="testfailure" tempdir="${build}">
<!-- optionally run headless -->
<sysproperty key="java.awt.headless" value="${headless}"/>
<syspropertyset refid="headless"/>
<!-- avoid VM conflicts with JNA protected mode -->
<env key="${ld.preload.name}" file="${libjsig}"/>
<sysproperty key="jna.library.path" file="${build.native}"/>
@@ -712,149 +900,11 @@
<target name="dist" depends="jar,javadoc,contrib-jars,compile-tests,native"
description="Build distribution files">
<copy todir="${dist}">
<fileset dir="${build}">
<include name="${native.jar}"/>
</fileset>
<fileset dir="${build}" includes="${jar},${minjar}"/>
<fileset dir="${contrib}/platform/dist" includes="platform.jar"/>
<fileset dir="${lib.native}">
<include name="*.jar"/>
</fileset>
</copy>
<jar jarfile="${dist-jar}" duplicate="preserve">
<manifest>
<attribute name="Main-Class" value="com.sun.jna.Native"/>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Title" value="${impl.title}"/>
<attribute name="Implementation-Vendor" value="${vendor}"/>
<attribute name="Implementation-Version" value="${impl.version}"/>
<attribute name="Specification-Title" value="${spec.title}"/>
<attribute name="Specification-Vendor" value="${spec.vendor}"/>
<attribute name="Specification-Version" value="${spec.version}"/>
<!--
OSGi Bundle attributes
See http://www.osgi.org/Specifications/Reference
-->
<attribute name="Bundle-Category" value="jni"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="jna"/>
<attribute name="Bundle-Description" value="JNA Library"/>
<attribute name="Bundle-SymbolicName" value="com.sun.jna"/>
<attribute name="Bundle-Version" value="${spec.version}"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/>
<attribute name="Bundle-Vendor" value="${vendor}"/>
<attribute name="Bundle-ActivationPolicy" value="lazy"/>
<attribute name="Export-Package" value="com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32"/>
<!-- Note that no terminal "*" is included in this list,
which will force failure on unsupported platforms.
-->
<attribute name="Bundle-NativeCode"
value="
com/sun/jna/win32-x86/jnidispatch.dll;
processor=x86;osname=win32,
com/sun/jna/win32-amd64/jnidispatch.dll;
processor=x86-64;osname=win32,
com/sun/jna/w32ce-arm/jnidispatch.dll;
processor=arm;osname=wince,
com/sun/jna/sunos-x86/libjnidispatch.so;
processor=x86;osname=sunos,
com/sun/jna/sunos-amd64/libjnidispatch.so;
processor=x86-64;osname=sunos,
com/sun/jna/sunos-sparc/libjnidispatch.so;
processor=sparc;osname=sunos,
com/sun/jna/sunos-sparcv9/libjnidispatch.so;
processor=sparcv9;osname=sunos,
com/sun/jna/aix-ppc/libjnidispatch.a;
processor=ppc;osname=aix,
com/sun/jna/aix-ppc64/libjnidispatch.a;
processor=ppc64;osname=aix,
com/sun/jna/linux-ppc/libjnidispatch.so;
processor=ppc;osname=linux,
com/sun/jna/linux-ppc64/libjnidispatch.so;
processor=ppc64;osname=linux,
com/sun/jna/linux-i386/libjnidispatch.so;
processor=x86;osname=linux,
com/sun/jna/linux-amd64/libjnidispatch.so;
processor=x86-64;osname=linux,
com/sun/jna/linux-arm/libjnidispatch.so;
processor=arm;osname=linux,
com/sun/jna/linux-ia64/libjnidispatch.so;
processor=ia64;osname=linux,
com/sun/jna/openbsd-i386/libjnidispatch.so;
processor=x86;osname=openbsd,
com/sun/jna/freebsd-i386/libjnidispatch.so;
processor=x86;osname=freebsd,
com/sun/jna/freebsd-amd64/libjnidispatch.so;
processor=x86-64;osname=freebsd,
com/sun/jna/darwin/libjnidispatch.jnilib;
osname=macos
"/>
</manifest>
<zipfileset src="${build}/${jar}"/>
<zipfileset src="${lib.native}/win32-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-x86"/>
<zipfileset src="${lib.native}/aix-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/aix-ppc"/>
<zipfileset src="${lib.native}/aix-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/aix-ppc64"/>
<zipfileset src="${lib.native}/darwin.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/darwin"/>
<zipfileset src="${lib.native}/linux-i386.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-i386"/>
<zipfileset src="${lib.native}/linux-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-amd64"/>
<zipfileset src="${lib.native}/linux-arm.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-arm"/>
<zipfileset src="${lib.native}/linux-ia64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ia64"/>
<zipfileset src="${lib.native}/linux-ppc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc"/>
<zipfileset src="${lib.native}/linux-ppc64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/linux-ppc64"/>
<zipfileset src="${lib.native}/sunos-x86.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-x86"/>
<zipfileset src="${lib.native}/sunos-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-amd64"/>
<zipfileset src="${lib.native}/sunos-sparc.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-sparc"/>
<zipfileset src="${lib.native}/sunos-sparcv9.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/sunos-sparcv9"/>
<zipfileset src="${lib.native}/freebsd-i386.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/freebsd-i386"/>
<zipfileset src="${lib.native}/freebsd-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/freebsd-amd64"/>
<zipfileset src="${lib.native}/openbsd-i386.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/openbsd-i386"/>
<zipfileset src="${lib.native}/win32-amd64.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/win32-amd64"/>
<zipfileset src="${lib.native}/w32ce-arm.jar"
includes="*jnidispatch*"
prefix="com/sun/jna/w32ce-arm"/>
</jar>
<copy todir="${dist}">
<fileset dir="${contrib}/platform/dist">
<include name="platform.jar" />
<exclude name="out-of-date.jar"/>
</fileset>
</copy>
<copy todir="${dist}/jnacontrib" flatten="true">
@@ -887,8 +937,7 @@ osname=macos
</zip>
<!-- Sources package as required by maven -->
<zip zipfile="${maven-sources-jar}">
<zipfileset dir="${src}" includes="**/*.java,**/*.html,**/*.png"/>
<zipfileset dir="${contrib}/platform" includes="**/*.java"/>
<zipfileset dir="${src}" />
</zip>
</target>
@@ -906,79 +955,97 @@ osname=macos
</subant>
</target>
<target name="deploy" depends="dist,platform-jar" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<!-- NOTE: The 'deploy' target works only if the version (jna.version in build.xml) ends in '-SNAPSHOT'. -->
<target name="deploy" depends="dist" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file"/>
<arg value="-Durl=${maven-snapshots-repository-url}"/>
<arg value="-DrepositoryId=${maven-snapshots-repository-id}"/>
<arg value="-DpomFile=${pom}"/>
<arg value="-Dfile=${dist-jar}"/>
</artifact:mvn>
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file"/>
<arg value="-Durl=${maven-snapshots-repository-url}"/>
<arg value="-DrepositoryId=${maven-snapshots-repository-id}"/>
<arg value="-DpomFile=${pom-platform}"/>
<arg value="-Dfile=${platform-jar}"/>
</artifact:mvn>
</target>
<!-- before this, update project version (both build.xml and ${pom}) from SNAPSHOT to RELEASE -->
<property name="version-maven-gpg-plugin" value="1.4"/>
<target name="stage" depends="dist" description="deploy release version to Maven staging repository">
<!-- sign and deploy the main artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/>
<!-- sign and deploy the jna artifact -->
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:${version-maven-gpg-plugin}:sign-and-deploy-file"/>
<arg value="-Durl=${maven-staging-repository-url}"/>
<arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<arg value="-DpomFile=${pom}"/>
<arg value="-Dfile=${dist-jar}"/>
<arg value="-Pgpg"/>
<arg value="-Dgpg.useagent=true"/>
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/>
<!-- sign and deploy the jna sources artifact -->
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:${version-maven-gpg-plugin}:sign-and-deploy-file"/>
<arg value="-Durl=${maven-staging-repository-url}"/>
<arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<arg value="-DpomFile=${pom}"/>
<arg value="-Dfile=${maven-sources-jar}"/>
<arg value="-Dclassifier=sources"/>
<arg value="-Pgpg"/>
<arg value="-Dgpg.useagent=true"/>
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/>
<!-- sign and deploy the jna javadoc artifact -->
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:${version-maven-gpg-plugin}:sign-and-deploy-file"/>
<arg value="-Durl=${maven-staging-repository-url}"/>
<arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<arg value="-DpomFile=${pom}"/>
<arg value="-Dfile=${maven-javadoc-jar}"/>
<arg value="-Dclassifier=javadoc"/>
<arg value="-Pgpg"/>
<arg value="-Dgpg.useagent=true"/>
</artifact:mvn>
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/>
<!-- sign and deploy the platform artifact -->
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:${version-maven-gpg-plugin}:sign-and-deploy-file"/>
<arg value="-Durl=${maven-staging-repository-url}"/>
<arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<arg value="-DpomFile=pom-platform.xml"/>
<arg value="-DpomFile=${pom-platform}"/>
<arg value="-Dfile=${platform-jar}"/>
<arg value="-Pgpg"/>
<arg value="-Dgpg.useagent=true"/>
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/>
<!-- sign and deploy the platform sources artifact -->
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:${version-maven-gpg-plugin}:sign-and-deploy-file"/>
<arg value="-Durl=${maven-staging-repository-url}"/>
<arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<arg value="-DpomFile=pom-platform.xml"/>
<arg value="-DpomFile=${pom-platform}"/>
<arg value="-Dfile=${platform-sources-jar}"/>
<arg value="-Dclassifier=sources"/>
<arg value="-Pgpg"/>
<arg value="-Dgpg.useagent=true"/>
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file"/>
<!-- sign and deploy the platform javadoc artifact -->
<artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:${version-maven-gpg-plugin}:sign-and-deploy-file"/>
<arg value="-Durl=${maven-staging-repository-url}"/>
<arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<arg value="-DpomFile=pom-platform.xml"/>
<arg value="-DpomFile=${pom-platform}"/>
<arg value="-Dfile=${platform-javadoc-jar}"/>
<arg value="-Dclassifier=javadoc"/>
<arg value="-Pgpg"/>
<arg value="-Dgpg.useagent=true"/>
</artifact:mvn>
</target>
+7 -14
Ver Arquivo
@@ -8,7 +8,6 @@
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-alphamask.jar"/>
<property name="file.reference.jna.build" location="../../build"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.AlphaMaskDemo" />
@@ -37,7 +36,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -45,29 +43,24 @@
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes/com">
<exclude name="**/*.java"/>
</fileset>
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
+8 -13
Ver Arquivo
@@ -8,7 +8,6 @@
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloonmanager.jar"/>
<property name="file.reference.jna.build" location="../../build"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.BalloonManagerDemo" />
@@ -37,7 +36,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -45,29 +43,26 @@
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes/com">
<exclude name="**/*.java"/>
</fileset>
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
+8 -13
Ver Arquivo
@@ -8,7 +8,6 @@
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloontips.jar"/>
<property name="file.reference.jna.build" location="../../build"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.FilteredTextField" />
@@ -37,7 +36,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -45,29 +43,26 @@
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes/com">
<exclude name="**/*.java"/>
</fileset>
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
+8 -13
Ver Arquivo
@@ -8,7 +8,6 @@
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-dnd.jar"/>
<property name="file.reference.jna.build" location="../../build"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.GhostedDragImageDemo" />
@@ -37,7 +36,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -45,29 +43,26 @@
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes/com">
<exclude name="**/*.java"/>
</fileset>
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
+175 -191
Ver Arquivo
@@ -9,204 +9,188 @@
package jnacontrib.jna;
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.*;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
*
*
* @author TB
*/
public interface Advapi32 extends StdCallLibrary {
Advapi32 INSTANCE = (Advapi32) Native.loadLibrary("Advapi32", Advapi32.class,
W32APIOptions.UNICODE_OPTIONS);
/*
SC_HANDLE WINAPI OpenSCManager(
LPCTSTR lpMachineName,
LPCTSTR lpDatabaseName,
DWORD dwDesiredAccess
);*/
public Pointer OpenSCManager(String lpMachineName, WString lpDatabaseName, int dwDesiredAccess);
/*
BOOL WINAPI CloseServiceHandle(
SC_HANDLE hSCObject
);*/
public boolean CloseServiceHandle(Pointer hSCObject);
/*
SC_HANDLE WINAPI OpenService(
SC_HANDLE hSCManager,
LPCTSTR lpServiceName,
DWORD dwDesiredAccess
);*/
public Pointer OpenService(Pointer hSCManager, String lpServiceName, int dwDesiredAccess);
/*
BOOL WINAPI StartService(
SC_HANDLE hService,
DWORD dwNumServiceArgs,
LPCTSTR* lpServiceArgVectors
);*/
public boolean StartService(Pointer hService, int dwNumServiceArgs, char[] lpServiceArgVectors);
/*
BOOL WINAPI ControlService(
SC_HANDLE hService,
DWORD dwControl,
LPSERVICE_STATUS lpServiceStatus
);*/
public boolean ControlService(Pointer hService, int dwControl, SERVICE_STATUS lpServiceStatus);
/*
BOOL WINAPI StartServiceCtrlDispatcher(
const SERVICE_TABLE_ENTRY* lpServiceTable
);*/
public boolean StartServiceCtrlDispatcher(Structure[] lpServiceTable);
/*
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandler(
LPCTSTR lpServiceName,
LPHANDLER_FUNCTION lpHandlerProc
);*/
public Pointer RegisterServiceCtrlHandler(String lpServiceName, Handler lpHandlerProc);
/*
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerEx(
LPCTSTR lpServiceName,
LPHANDLER_FUNCTION_EX lpHandlerProc,
LPVOID lpContext
);*/
public Pointer RegisterServiceCtrlHandlerEx(String lpServiceName, HandlerEx lpHandlerProc, Pointer lpContext);
/*
BOOL WINAPI SetServiceStatus(
SERVICE_STATUS_HANDLE hServiceStatus,
LPSERVICE_STATUS lpServiceStatus
);*/
public boolean SetServiceStatus(Pointer hServiceStatus, SERVICE_STATUS lpServiceStatus);
/*
SC_HANDLE WINAPI CreateService(
SC_HANDLE hSCManager,
LPCTSTR lpServiceName,
LPCTSTR lpDisplayName,
DWORD dwDesiredAccess,
DWORD dwServiceType,
DWORD dwStartType,
DWORD dwErrorControl,
LPCTSTR lpBinaryPathName,
LPCTSTR lpLoadOrderGroup,
LPDWORD lpdwTagId,
LPCTSTR lpDependencies,
LPCTSTR lpServiceStartName,
LPCTSTR lpPassword
);*/
public Pointer CreateService(Pointer hSCManager, String lpServiceName, String lpDisplayName,
int dwDesiredAccess, int dwServiceType, int dwStartType, int dwErrorControl,
String lpBinaryPathName, String lpLoadOrderGroup, IntByReference lpdwTagId,
String lpDependencies, String lpServiceStartName, String lpPassword);
/*
BOOL WINAPI DeleteService(
SC_HANDLE hService
);*/
public boolean DeleteService(Pointer hService);
/*
BOOL WINAPI ChangeServiceConfig2(
SC_HANDLE hService,
DWORD dwInfoLevel,
LPVOID lpInfo
);*/
public boolean ChangeServiceConfig2(Pointer hService, int dwInfoLevel, ChangeServiceConfig2Info lpInfo);
/*
LONG WINAPI RegEnumValue(
HKEY hKey,
DWORD dwIndex,
LPTSTR lpValueName,
LPDWORD lpcchValueName,
LPDWORD lpReserved,
LPDWORD lpType,
LPBYTE lpData,
LPDWORD lpcbData
);*/
public int RegEnumValue(int hKey, int dwIndex, char[] lpValueName, IntByReference lpcchValueName, IntByReference reserved,
IntByReference lpType, byte[] lpData, IntByReference lpcbData);
public interface Advapi32 extends StdCallLibrary {
Advapi32 INSTANCE = (Advapi32) Native.loadLibrary("Advapi32",
Advapi32.class, W32APIOptions.UNICODE_OPTIONS);
interface SERVICE_MAIN_FUNCTION extends StdCallCallback {
/*
VOID WINAPI ServiceMain(
DWORD dwArgc,
LPTSTR* lpszArgv
);*/
public void callback(int dwArgc, Pointer lpszArgv);
}
* SC_HANDLE WINAPI OpenSCManager( LPCTSTR lpMachineName, LPCTSTR
* lpDatabaseName, DWORD dwDesiredAccess );
*/
public Pointer OpenSCManager(String lpMachineName, WString lpDatabaseName,
int dwDesiredAccess);
interface Handler extends StdCallCallback {
/*
VOID WINAPI Handler(
DWORD fdwControl
);*/
public void callback(int fdwControl);
}
interface HandlerEx extends StdCallCallback {
* BOOL WINAPI CloseServiceHandle( SC_HANDLE hSCObject );
*/
public boolean CloseServiceHandle(Pointer hSCObject);
/*
DWORD WINAPI HandlerEx(
DWORD dwControl,
DWORD dwEventType,
LPVOID lpEventData,
LPVOID lpContext
);*/
public int callback(int dwControl, int dwEventType, Pointer lpEventData, Pointer lpContext);
}
/*
typedef struct _SERVICE_STATUS {
DWORD dwServiceType;
DWORD dwCurrentState;
DWORD dwControlsAccepted;
DWORD dwWin32ExitCode;
DWORD dwServiceSpecificExitCode;
DWORD dwCheckPoint;
DWORD dwWaitHint;
} SERVICE_STATUS,
*LPSERVICE_STATUS;*/
public static class SERVICE_STATUS extends Structure {
public int dwServiceType;
public int dwCurrentState;
public int dwControlsAccepted;
public int dwWin32ExitCode;
public int dwServiceSpecificExitCode;
public int dwCheckPoint;
public int dwWaitHint;
}
/*
typedef struct _SERVICE_TABLE_ENTRY {
LPTSTR lpServiceName;
LPSERVICE_MAIN_FUNCTION lpServiceProc;
} SERVICE_TABLE_ENTRY,
*LPSERVICE_TABLE_ENTRY;*/
public static class SERVICE_TABLE_ENTRY extends Structure {
public String lpServiceName;
public SERVICE_MAIN_FUNCTION lpServiceProc;
}
public static class ChangeServiceConfig2Info extends Structure {
}
/*
typedef struct _SERVICE_DESCRIPTION {
LPTSTR lpDescription;
} SERVICE_DESCRIPTION,
*LPSERVICE_DESCRIPTION;*/
public static class SERVICE_DESCRIPTION extends ChangeServiceConfig2Info {
public String lpDescription;
}
* SC_HANDLE WINAPI OpenService( SC_HANDLE hSCManager, LPCTSTR
* lpServiceName, DWORD dwDesiredAccess );
*/
public Pointer OpenService(Pointer hSCManager, String lpServiceName,
int dwDesiredAccess);
/*
* BOOL WINAPI StartService( SC_HANDLE hService, DWORD dwNumServiceArgs,
* LPCTSTR* lpServiceArgVectors );
*/
public boolean StartService(Pointer hService, int dwNumServiceArgs,
char[] lpServiceArgVectors);
/*
* BOOL WINAPI ControlService( SC_HANDLE hService, DWORD dwControl,
* LPSERVICE_STATUS lpServiceStatus );
*/
public boolean ControlService(Pointer hService, int dwControl,
SERVICE_STATUS lpServiceStatus);
/*
* BOOL WINAPI StartServiceCtrlDispatcher( const SERVICE_TABLE_ENTRY*
* lpServiceTable );
*/
public boolean StartServiceCtrlDispatcher(Structure[] lpServiceTable);
/*
* SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandler( LPCTSTR
* lpServiceName, LPHANDLER_FUNCTION lpHandlerProc );
*/
public Pointer RegisterServiceCtrlHandler(String lpServiceName,
Handler lpHandlerProc);
/*
* SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerEx( LPCTSTR
* lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext );
*/
public Pointer RegisterServiceCtrlHandlerEx(String lpServiceName,
HandlerEx lpHandlerProc, Pointer lpContext);
/*
* BOOL WINAPI SetServiceStatus( SERVICE_STATUS_HANDLE hServiceStatus,
* LPSERVICE_STATUS lpServiceStatus );
*/
public boolean SetServiceStatus(Pointer hServiceStatus,
SERVICE_STATUS lpServiceStatus);
/*
* SC_HANDLE WINAPI CreateService( SC_HANDLE hSCManager, LPCTSTR
* lpServiceName, LPCTSTR lpDisplayName, DWORD dwDesiredAccess, DWORD
* dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCTSTR
* lpBinaryPathName, LPCTSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCTSTR
* lpDependencies, LPCTSTR lpServiceStartName, LPCTSTR lpPassword );
*/
public Pointer CreateService(Pointer hSCManager, String lpServiceName,
String lpDisplayName, int dwDesiredAccess, int dwServiceType,
int dwStartType, int dwErrorControl, String lpBinaryPathName,
String lpLoadOrderGroup, IntByReference lpdwTagId,
String lpDependencies, String lpServiceStartName, String lpPassword);
/*
* BOOL WINAPI DeleteService( SC_HANDLE hService );
*/
public boolean DeleteService(Pointer hService);
/*
* BOOL WINAPI ChangeServiceConfig2( SC_HANDLE hService, DWORD dwInfoLevel,
* LPVOID lpInfo );
*/
public boolean ChangeServiceConfig2(Pointer hService, int dwInfoLevel,
ChangeServiceConfig2Info lpInfo);
/*
* LONG WINAPI RegEnumValue( HKEY hKey, DWORD dwIndex, LPTSTR lpValueName,
* LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE
* lpData, LPDWORD lpcbData );
*/
public int RegEnumValue(int hKey, int dwIndex, char[] lpValueName,
IntByReference lpcchValueName, IntByReference reserved,
IntByReference lpType, byte[] lpData, IntByReference lpcbData);
interface SERVICE_MAIN_FUNCTION extends StdCallCallback {
/*
* VOID WINAPI ServiceMain( DWORD dwArgc, LPTSTR* lpszArgv );
*/
public void callback(int dwArgc, Pointer lpszArgv);
}
interface Handler extends StdCallCallback {
/*
* VOID WINAPI Handler( DWORD fdwControl );
*/
public void callback(int fdwControl);
}
interface HandlerEx extends StdCallCallback {
/*
* DWORD WINAPI HandlerEx( DWORD dwControl, DWORD dwEventType, LPVOID
* lpEventData, LPVOID lpContext );
*/
public int callback(int dwControl, int dwEventType,
Pointer lpEventData, Pointer lpContext);
}
/*
* typedef struct _SERVICE_STATUS { DWORD dwServiceType; DWORD
* dwCurrentState; DWORD dwControlsAccepted; DWORD dwWin32ExitCode; DWORD
* dwServiceSpecificExitCode; DWORD dwCheckPoint; DWORD dwWaitHint; }
* SERVICE_STATUS,LPSERVICE_STATUS;
*/
public static class SERVICE_STATUS extends Structure {
public int dwServiceType;
public int dwCurrentState;
public int dwControlsAccepted;
public int dwWin32ExitCode;
public int dwServiceSpecificExitCode;
public int dwCheckPoint;
public int dwWaitHint;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwServiceType", "dwCurrentState", "dwControlsAccepted", "dwWin32ExitCode", "dwServiceSpecificExitCode", "dwCheckPoint", "dwWaitHint" });
}
}
/*
* typedef struct _SERVICE_TABLE_ENTRY { LPTSTR lpServiceName;
* LPSERVICE_MAIN_FUNCTION lpServiceProc; } SERVICE_TABLE_ENTRY,
* LPSERVICE_TABLE_ENTRY;
*/
public static class SERVICE_TABLE_ENTRY extends Structure {
public String lpServiceName;
public SERVICE_MAIN_FUNCTION lpServiceProc;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lpServiceName", "lpServiceProc" });
}
}
public static abstract class ChangeServiceConfig2Info extends Structure {
}
/*
* typedef struct _SERVICE_DESCRIPTION { LPTSTR lpDescription; }
* SERVICE_DESCRIPTION,LPSERVICE_DESCRIPTION;
*/
public static class SERVICE_DESCRIPTION extends ChangeServiceConfig2Info {
public String lpDescription;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lpDescription" });
}
}
}
@@ -17,14 +17,16 @@
package com.sun.jna.platform.mac;
import java.nio.IntBuffer;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Callback;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.PointerByReference;
import java.nio.IntBuffer;
/**
* Author: Denis Tulskiy
* Date: 7/25/11
@@ -70,7 +72,8 @@ public interface Carbon {
public class EventTypeSpec extends Structure {
public int eventClass;
public int eventKind;
{ setFieldOrder(new String[] { "eventClass", "eventKind" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "eventClass", "eventKind" }); }
}
public static class EventHotKeyID extends Structure {
@@ -78,7 +81,8 @@ public interface Carbon {
public int id;
public static class ByValue extends EventHotKeyID implements Structure.ByValue { }
{ setFieldOrder(new String[] { "signature", "id" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "signature", "id" }); }
}
public static interface EventHandlerProcPtr extends Callback {
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.unix;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Callback;
import com.sun.jna.FromNativeContext;
import com.sun.jna.Library;
@@ -277,7 +280,9 @@ public interface X11 extends Library {
public short green, greenMask;
public short blue, blueMask;
public short alpha, alphaMask;
{ setFieldOrder(new String[] { "red", "redMask", "green", "greenMask", "blue", "blueMask", "alpha", "alphaMask" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "red", "redMask", "green", "greenMask", "blue", "blueMask", "alpha", "alphaMask" });
}
}
class PictFormat extends NativeLong {
private static final long serialVersionUID = 1L;
@@ -290,7 +295,9 @@ public interface X11 extends Library {
public int depth;
public XRenderDirectFormat direct;
public Colormap colormap;
{ setFieldOrder(new String[] { "id", "type", "depth", "direct", "colormap" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "id", "type", "depth", "direct", "colormap" });
}
}
int PictTypeIndexed = 0x0;
int PictTypeDirect = 0x1;
@@ -339,14 +346,18 @@ public interface X11 extends Library {
class XInputClassInfoByReference extends Structure implements Structure.ByReference {
public byte input_class;
public byte event_type_base;
{ setFieldOrder(new String[] { "input_class", "event_type_base" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "input_class", "event_type_base" });
}
}
class XDeviceByReference extends Structure implements Structure.ByReference {
public XID device_id;
public int num_classes;
public XInputClassInfoByReference classes;
{ setFieldOrder(new String[] { "device_id", "num_classes", "classes" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "device_id", "num_classes", "classes" });
}
}
X11 INSTANCE = (X11)Native.loadLibrary("X11", X11.class);
@@ -374,7 +385,9 @@ public interface X11 extends Library {
public int icon_x, icon_y;
public Pixmap icon_mask;
public XID window_group;
{ setFieldOrder(new String[] { "flags", "input", "initial_state", "icon_pixmap", "icon_window", "icon_x", "icon_y", "icon_mask", "window_group" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "flags", "input", "initial_state", "icon_pixmap", "icon_window", "icon_x", "icon_y", "icon_mask", "window_group" });
}
}
/*
@@ -390,7 +403,9 @@ public interface X11 extends Library {
public Atom encoding;
public int format;
public NativeLong nitems;
{ setFieldOrder(new String[] { "value", "encoding", "format", "nitems" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "value", "encoding", "format", "nitems" });
}
}
/*
@@ -419,12 +434,14 @@ public interface X11 extends Library {
public static class Aspect extends Structure {
public int x; // numerator
public int y; // denominator
{ setFieldOrder(new String[] { "x", "y" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y" }); }
}
public Aspect min_aspect, max_aspect;
public int base_width, base_height;
public int win_gravity;
{ setFieldOrder(new String[] { "flags", "x", "y", "width", "height", "min_width", "min_height", "max_width", "max_height", "width_inc", "height_inc", "min_aspect", "max_aspect", "base_width", "base_height", "win_gravity" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "flags", "x", "y", "width", "height", "min_width", "min_height", "max_width", "max_height", "width_inc", "height_inc", "min_aspect", "max_aspect", "base_width", "base_height", "win_gravity" }); }
}
/*
@@ -478,7 +495,9 @@ public interface X11 extends Library {
public NativeLong do_not_propagate_mask;
public boolean override_redirect;
public Screen screen;
{ setFieldOrder(new String[] { "x", "y", "width", "height", "border_width", "depth", "visual", "root", "c_class", "bit_gravity", "win_gravity", "backing_store", "backing_planes", "backing_pixel", "save_under", "colormap", "map_installed", "map_state", "all_event_masks", "your_event_mask", "do_not_propagate_mask", "override_redirect", "screen" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y", "width", "height", "border_width", "depth", "visual", "root", "c_class", "bit_gravity", "win_gravity", "backing_store", "backing_planes", "backing_pixel", "save_under", "colormap", "map_installed", "map_state", "all_event_masks", "your_event_mask", "do_not_propagate_mask", "override_redirect", "screen" });
}
}
/*
@@ -516,7 +535,9 @@ public interface X11 extends Library {
public boolean override_redirect;
public Colormap colormap;
public Cursor cursor;
{ setFieldOrder(new String[] { "background_pixmap", "background_pixel", "border_pixmap", "border_pixel", "bit_gravity", "win_gravity", "backing_store", "backing_planes", "backing_pixel", "save_under", "event_mask", "do_not_propagate_mask", "override_redirect", "colormap", "cursor" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "background_pixmap", "background_pixel", "border_pixmap", "border_pixel", "bit_gravity", "win_gravity", "backing_store", "backing_planes", "backing_pixel", "save_under", "event_mask", "do_not_propagate_mask", "override_redirect", "colormap", "cursor" });
}
}
int XK_0 = 0x30;
@@ -559,25 +580,31 @@ public interface X11 extends Library {
public NativeLong blue_mask;
public int colormap_size;
public int bits_per_rgb;
{ setFieldOrder(new String[] { "visual", "visualid", "screen", "depth", "c_class", "red_mask", "green_mask", "blue_mask", "colormap_size", "bits_per_rgb" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "visual", "visualid", "screen", "depth", "c_class", "red_mask", "green_mask", "blue_mask", "colormap_size", "bits_per_rgb" });
}
}
class XPoint extends Structure {
public short x, y;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y" });
}
public XPoint() { this((short)0, (short)0); }
public XPoint(short x, short y) {
this.x = x;
this.y = y;
setFieldOrder(new String[] { "x", "y" });
}
}
class XRectangle extends Structure {
public short x, y;
public short width, height;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y", "width", "height" });
}
public XRectangle() { this((short)0, (short)0, (short)0, (short)0); }
public XRectangle(short x, short y, short width, short height) {
this.x = x; this.y = y;
this.width = width; this.height = height;
setFieldOrder(new String[] { "x", "y", "width", "height" });
}
}
@@ -718,7 +745,9 @@ public interface X11 extends Library {
public Pixmap clip_mask; /* bitmap clipping; other calls for rects */
public int dash_offset; /* patterned/dashed line information */
public byte dashes;
{ setFieldOrder(new String[] { "function", "plane_mask", "foreground", "background", "line_width", "line_style", "cap_style", "join_style", "fill_style", "fill_rule", "arc_mode", "tile", "stipple", "ts_x_origin", "ts_y_origin", "font", "subwindow_mode", "graphics_exposures", "clip_x_origin", "clip_y_origin", "clip_mask", "dash_offset", "dashes" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "function", "plane_mask", "foreground", "background", "line_width", "line_style", "cap_style", "join_style", "fill_style", "fill_rule", "arc_mode", "tile", "stipple", "ts_x_origin", "ts_y_origin", "font", "subwindow_mode", "graphics_exposures", "clip_x_origin", "clip_y_origin", "clip_mask", "dash_offset", "dashes" });
}
}
GC XCreateGC(Display display, Drawable drawable, NativeLong mask, XGCValues values);
int XSetFillRule(Display display, GC gc, int fill_rule);
@@ -1344,7 +1373,9 @@ public interface X11 extends Library {
public int send_event; // true if this came from a SendEvent request
public Display display; // Display the event was read from
public Window window; // window on which event was requested in event mask
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" });
}
}
class XKeyEvent extends Structure {
@@ -1361,7 +1392,9 @@ public interface X11 extends Library {
public int state; // key or button mask
public int keycode; // detail
public int same_screen; // same screen flag
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "keycode", "same_screen" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "keycode", "same_screen" });
}
}
class XButtonEvent extends Structure {
@@ -1378,7 +1411,9 @@ public interface X11 extends Library {
public int state; // key or button mask
public int button; // detail
public int same_screen; // same screen flag
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "button", "same_screen" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "button", "same_screen" });
}
}
class XButtonPressedEvent extends XButtonEvent {
@@ -1396,7 +1431,9 @@ public interface X11 extends Library {
public Atom message_type;
public int format;
public Data data;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "message_type", "format", "data" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "message_type", "format", "data" });
}
public static class Data extends Union {
public byte b[] = new byte[20];
@@ -1419,7 +1456,9 @@ public interface X11 extends Library {
public int state; // key or button mask
public byte is_hint; // detail
public int same_screen; // same screen flag
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "is_hint", "same_screen" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "is_hint", "same_screen" });
}
}
class XPointerMovedEvent extends XMotionEvent {
@@ -1445,7 +1484,9 @@ public interface X11 extends Library {
public int same_screen; // same screen flag
public int focus; // boolean focus
public int state; // key or button mask
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "mode", "detail", "same_screen", "focus", "state" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "mode", "detail", "same_screen", "focus", "state" });
}
}
class XEnterWindowEvent extends XCrossingEvent {
@@ -1467,7 +1508,9 @@ public interface X11 extends Library {
* NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
* NotifyPointerRoot, NotifyDetailNone
*/
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "mode", "detail" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "mode", "detail" });
}
}
class XFocusInEvent extends XFocusChangeEvent {
@@ -1485,7 +1528,9 @@ public interface X11 extends Library {
public int x, y;
public int width, height;
public int count; // if non-zero, at least this many more
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "count" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "count" });
}
}
class XGraphicsExposeEvent extends Structure {
@@ -1499,7 +1544,9 @@ public interface X11 extends Library {
public int count; // if non-zero, at least this many more
public int major_code; // core is CopyArea or CopyPlane
public int minor_code; // not defined in the core
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "drawable", "x", "y", "width", "height", "count", "major_code", "minor_code" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "drawable", "x", "y", "width", "height", "count", "major_code", "minor_code" });
}
}
class XNoExposeEvent extends Structure {
@@ -1510,7 +1557,9 @@ public interface X11 extends Library {
public Drawable drawable;
public int major_code; // core is CopyArea or CopyPlane
public int minor_code; // not defined in the core
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "drawable", "major_code", "minor_code" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "drawable", "major_code", "minor_code" });
}
}
class XVisibilityEvent extends Structure {
@@ -1520,7 +1569,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window window;
public int state; // Visibility state
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "state" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "state" });
}
}
class XCreateWindowEvent extends Structure {
@@ -1534,7 +1585,9 @@ public interface X11 extends Library {
public int width, height; // size of window
public int border_width; // border width
public int override_redirect; // creation should be overridden
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "parent", "window", "x", "y", "width", "height", "border_width", "override_redirect" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "parent", "window", "x", "y", "width", "height", "border_width", "override_redirect" });
}
}
class XDestroyWindowEvent extends Structure {
@@ -1544,7 +1597,8 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window event;
public Window window;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" }); }
}
class XUnmapEvent extends Structure {
@@ -1555,7 +1609,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int from_configure;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "from_configure" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "from_configure" });
}
}
class XMapEvent extends Structure {
@@ -1566,7 +1622,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int override_redirect; // boolean, is override set...
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "override_redirect" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "override_redirect" });
}
}
class XMapRequestEvent extends Structure {
@@ -1576,7 +1634,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window parent;
public Window window;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" });
}
}
class XReparentEvent extends Structure {
@@ -1589,7 +1649,9 @@ public interface X11 extends Library {
public Window parent;
public int x, y;
public int override_redirect;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "override_redirect" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "override_redirect" });
}
}
class XConfigureEvent extends Structure {
@@ -1604,7 +1666,9 @@ public interface X11 extends Library {
public int border_width;
public Window above;
public int override_redirect;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "border_width", "above", "override_redirect" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "border_width", "above", "override_redirect" });
}
}
class XGravityEvent extends Structure {
@@ -1615,7 +1679,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int x, y;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "x", "y" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y" });
}
}
class XResizeRequestEvent extends Structure {
@@ -1625,7 +1691,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window window;
public int width, height;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "width", "height" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "width", "height" });
}
}
class XConfigureRequestEvent extends Structure {
@@ -1641,7 +1709,9 @@ public interface X11 extends Library {
public Window above;
public int detail; // Above, Below, TopIf, BottomIf, Opposite
public NativeLong value_mask;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "above", "detail", "value_mask" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "above", "detail", "value_mask" });
}
}
class XCirculateEvent extends Structure {
@@ -1652,7 +1722,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int place; // PlaceOnTop, PlaceOnBottom
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "event", "window", "place" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "event", "window", "place" });
}
}
class XCirculateRequestEvent extends Structure {
@@ -1663,7 +1735,9 @@ public interface X11 extends Library {
public Window parent;
public Window window;
public int place; // PlaceOnTop, PlaceOnBottom
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "parent", "window", "place" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "parent", "window", "place" });
}
}
class XPropertyEvent extends Structure {
@@ -1675,7 +1749,9 @@ public interface X11 extends Library {
public Atom atom;
public NativeLong time;
public int state; // NewValue, Deleted
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "atom", "time", "state" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "atom", "time", "state" });
}
}
class XSelectionClearEvent extends Structure {
@@ -1686,7 +1762,9 @@ public interface X11 extends Library {
public Window window;
public Atom selection;
public NativeLong time;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "selection", "time" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "selection", "time" });
}
}
class XSelectionRequestEvent extends Structure {
@@ -1700,7 +1778,9 @@ public interface X11 extends Library {
public Atom target;
public Atom property;
public NativeLong time;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "owner", "requestor", "selection", "target", "property", "time" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "owner", "requestor", "selection", "target", "property", "time" });
}
}
class XSelectionEvent extends Structure {
@@ -1713,7 +1793,9 @@ public interface X11 extends Library {
public Atom target;
public Atom property; // ATOM or None
public NativeLong time;
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "requestor", "selection", "target", "property", "time" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "requestor", "selection", "target", "property", "time" });
}
}
class XColormapEvent extends Structure {
@@ -1725,7 +1807,9 @@ public interface X11 extends Library {
public Colormap colormap; // COLORMAP or None
public int c_new; // C++
public int state; // ColormapInstalled, ColormapUninstalled
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "colormap", "c_new", "state" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "colormap", "c_new", "state" });
}
}
class XMappingEvent extends Structure {
@@ -1737,7 +1821,9 @@ public interface X11 extends Library {
public int request; // one of MappingModifier, MappingKeyboard, MappingPointer
public int first_keycode; // first keycode
public int count; // defines range of change w. first_keycode*/
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "request", "first_keycode", "count" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "request", "first_keycode", "count" });
}
}
class XErrorEvent extends Structure {
@@ -1748,7 +1834,9 @@ public interface X11 extends Library {
public byte request_code; // Major op-code of failed request
public byte minor_code; // Minor op-code of failed request
public XID resourceid; // resource id
{ setFieldOrder(new String[] { "type", "display", "serial", "error_code", "request_code", "minor_code", "resourceid" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "display", "serial", "error_code", "request_code", "minor_code", "resourceid" });
}
}
// generated on EnterWindow and FocusIn when KeyMapState selected
@@ -1759,7 +1847,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window window;
public byte key_vector[] = new byte[32];
{ setFieldOrder(new String[] { "type", "serial", "send_event", "display", "window", "key_vector" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "key_vector" });
}
}
int XSelectInput(Display display, Window window, NativeLong eventMask);
@@ -1904,7 +1994,9 @@ public interface X11 extends Library {
class XModifierKeymapRef extends Structure implements Structure.ByReference{
public int max_keypermod; /* The server's max # of keys per modifier */
public Pointer modifiermap; /* An 8 by max_keypermod array of modifiers */
{ setFieldOrder(new String[] { "max_keypermod", "modifiermap" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "max_keypermod", "modifiermap" });
}
}
class XKeyboardControlRef extends Structure implements Structure.ByReference {
@@ -1925,7 +2017,9 @@ public interface X11 extends Library {
/** AutoRepeatModeOff, AutoRepeatModeOn, AutoRepeatModeDefault. */
public int auto_repeat_mode;
{ setFieldOrder(new String[] { "key_click_percent", "bell_percent", "bell_pitch", "bell_duration", "led", "led_mode", "key", "auto_repeat_mode" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "key_click_percent", "bell_percent", "bell_pitch", "bell_duration", "led", "led_mode", "key", "auto_repeat_mode" });
}
public String toString() {
return "XKeyboardControlByReference{" +
@@ -1957,7 +2051,9 @@ public interface X11 extends Library {
/** Bit vector. Each bit set to 1 indicates that auto-repeat is enabled for the corresponding key. The vector is represented as 32 bytes. Byte N (from 0) contains the bits for keys 8N to 8N + 7 with the least significant bit in the byte representing key 8N. */
public byte auto_repeats[] = new byte[32];
{ setFieldOrder(new String[] { "key_click_percent", "bell_percent", "bell_pitch", "bell_duration", "led_mask", "global_auto_repeat", "auto_repeats" }); }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "key_click_percent", "bell_percent", "bell_pitch", "bell_duration", "led_mask", "global_auto_repeat", "auto_repeats" });
}
public String toString() {
return "XKeyboardStateByReference{" +
@@ -1261,7 +1261,32 @@ public abstract class Advapi32Util {
}
String nameString = Native.toString(name);
if(lpcbData.getValue() == 0) {
switch (lpType.getValue()) {
case WinNT.REG_BINARY: {
keyValues.put(nameString, new byte[0]);
break;
}
case WinNT.REG_SZ:
case WinNT.REG_EXPAND_SZ: {
keyValues.put(nameString, new char[0]);
break;
}
case WinNT.REG_MULTI_SZ: {
keyValues.put(nameString, new String[0]);
break;
}
case WinNT.REG_NONE: {
keyValues.put(nameString, null);
break;
}
default:
throw new RuntimeException("Unsupported empty type: " + lpType.getValue());
}
continue;
}
Memory byteData = new Memory(lpcbData.getValue());
byteData.write(0, data, 0, lpcbData.getValue());
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
@@ -100,6 +103,10 @@ public interface DsGetDC extends StdCallLibrary {
* subnet that the computer is in with a valid site.
*/
public WString ClientSiteName;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "DomainControllerName", "DomainControllerAddress", "DomainGuid", "DomainName", "DnsForestName", "Flags", "DcSiteName", "ClientSiteName"});
}
}
/**
@@ -112,6 +119,10 @@ public interface DsGetDC extends StdCallLibrary {
}
public DOMAIN_CONTROLLER_INFO.ByReference dci;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dci" });
}
}
/**
@@ -156,7 +167,6 @@ public interface DsGetDC extends StdCallLibrary {
public static class DS_DOMAIN_TRUSTS extends Structure {
public static class ByReference extends DS_DOMAIN_TRUSTS implements Structure.ByReference {
}
/**
@@ -194,6 +204,10 @@ public interface DsGetDC extends StdCallLibrary {
* Contains the GUID of the domain represented by this structure.
*/
public GUID DomainGuid;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "NetbiosDomainName", "DnsDomainName", "Flags", "ParentIndex", "TrustType", "TrustAttributes", "DomainSid", "DomainGuid" });
}
public DS_DOMAIN_TRUSTS() {
}
@@ -202,26 +216,4 @@ public interface DsGetDC extends StdCallLibrary {
super(p);
}
};
/**
* A pointer to an array of DS_DOMAIN_TRUSTS.
*/
public static class PDS_DOMAIN_TRUSTS extends Structure {
public static class ByReference extends PDS_DOMAIN_TRUSTS implements Structure.ByReference {
}
public DS_DOMAIN_TRUSTS.ByReference t;
/**
* Returns domain trusts.
* @param count
* Number of domain trusts.
* @return
* An array of domain trusts.
*/
public DS_DOMAIN_TRUSTS[] getTrusts(int count) {
return (DS_DOMAIN_TRUSTS[]) t.toArray(count);
}
}
}
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
@@ -89,5 +92,9 @@ public interface Guid {
public short Data2;
public short Data3;
public byte[] Data4 = new byte[8];
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Data1", "Data2", "Data3", "Data4" });
}
}
}
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
@@ -36,6 +39,10 @@ public interface LMAccess extends StdCallLibrary {
}
public WString lgrui0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lgrui0_name" });
}
}
public static class LOCALGROUP_INFO_1 extends Structure {
@@ -50,6 +57,9 @@ public interface LMAccess extends StdCallLibrary {
public WString lgrui1_name;
public WString lgrui1_comment;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lgrui1_name", "lgrui1_comment" });
}
}
//
@@ -80,6 +90,9 @@ public interface LMAccess extends StdCallLibrary {
* Pointer to a Unicode string that specifies the name of the user account.
*/
public WString usri0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri0_name" });
}
}
/**
@@ -136,6 +149,10 @@ public interface LMAccess extends StdCallLibrary {
* logon script file.
*/
public WString usri1_script_path;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri1_name", "usri1_password", "usri1_password_age", "usri1_priv", "usri1_home_dir", "usri1_comment", "usri1_flags", "usri1_script_path" });
}
}
/**
@@ -206,7 +223,11 @@ public interface LMAccess extends StdCallLibrary {
* A pointer to a SID structure that contains the security identifier (SID)
* that uniquely identifies the user. The NetUserAdd and NetUserSetInfo functions ignore this member.
*/
public PSID.ByReference usri23_user_sid;
public PSID.ByReference usri23_user_sid;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri23_name", "usri23_full_name", "usri23_comment", "usri23_flags", "usri23_user_sid" });
}
}
/**
@@ -226,6 +247,10 @@ public interface LMAccess extends StdCallLibrary {
* Pointer to a null-terminated Unicode character string that specifies a name.
*/
public WString grui0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grui0_name" });
}
}
/**
@@ -245,6 +270,10 @@ public interface LMAccess extends StdCallLibrary {
* Pointer to a Unicode string specifying the name of a local group to which the user belongs.
*/
public WString lgrui0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lgrui0_name" });
}
}
/**
@@ -267,6 +296,10 @@ public interface LMAccess extends StdCallLibrary {
* the name of the global group.
*/
public WString grpi0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi0_name" });
}
}
/**
@@ -294,6 +327,10 @@ public interface LMAccess extends StdCallLibrary {
* string. The comment can contain MAXCOMMENTSZ characters.
*/
public WString grpi1_comment;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi1_name", "grpi1_comment" });
}
}
/**
@@ -331,6 +368,10 @@ public interface LMAccess extends StdCallLibrary {
* and SE_GROUP_ENABLED_BY_DEFAULT.
*/
public int grpi2_attributes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi2_name", "grpi2_comment", "grpi2_group_id", "grpi2_attributes" });
}
}
/**
@@ -368,6 +409,10 @@ public interface LMAccess extends StdCallLibrary {
* SE_GROUP_ENABLED_BY_DEFAULT.
*/
public int grpi3_attributes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi3_name", "grpi3_comment", "grpi3_group_id", "grpi3_attributes" });
}
}
//
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
@@ -52,6 +55,10 @@ public interface NTSecApi extends StdCallLibrary {
*/
public Pointer Buffer;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Length", "MaximumLength", "Buffer" });
}
/**
* String representation of the buffer.
* @return
@@ -97,11 +104,18 @@ public interface NTSecApi extends StdCallLibrary {
public PSID.ByReference Sid;
public LSA_UNICODE_STRING DnsName;
public LSA_UNICODE_STRING NetbiosName;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Sid", "DnsName", "NetbiosName" });
}
}
public static class LSA_FOREST_TRUST_BINARY_DATA extends Structure {
public int Length;
public Pointer Buffer;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Length", "Buffer" });
}
}
public static class LSA_FOREST_TRUST_RECORD extends Structure {
@@ -145,6 +159,10 @@ public interface NTSecApi extends StdCallLibrary {
*/
public UNION u;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Flags", "ForestTrustType", "Time", "u" });
}
public void read() {
super.read();
@@ -170,7 +188,11 @@ public interface NTSecApi extends StdCallLibrary {
}
public LSA_FOREST_TRUST_RECORD.ByReference tr;
public LSA_FOREST_TRUST_RECORD.ByReference tr;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "tr" });
}
}
public static class LSA_FOREST_TRUST_INFORMATION extends Structure {
@@ -190,6 +212,10 @@ public interface NTSecApi extends StdCallLibrary {
*/
public PLSA_FOREST_TRUST_RECORD.ByReference Entries;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "RecordCount", "Entries" });
}
/**
* Get an array of LSA_FOREST_TRUST_RECORD entries.
* @return
@@ -209,6 +235,10 @@ public interface NTSecApi extends StdCallLibrary {
}
public LSA_FOREST_TRUST_INFORMATION.ByReference fti;
public LSA_FOREST_TRUST_INFORMATION.ByReference fti;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "fti" });
}
}
}
@@ -16,7 +16,6 @@ import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.DsGetDC.PDOMAIN_CONTROLLER_INFO;
import com.sun.jna.platform.win32.DsGetDC.PDS_DOMAIN_TRUSTS;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.NTSecApi.PLSA_FOREST_TRUST_INFORMATION;
import com.sun.jna.ptr.IntByReference;
@@ -616,34 +616,34 @@ public abstract class Netapi32Util {
* An array of domain trusts.
*/
public static DomainTrust[] getDomainTrusts(String serverName) {
IntByReference domainCount = new IntByReference();
IntByReference domainTrustCount = new IntByReference();
PointerByReference domainsPointerRef = new PointerByReference();
int rc = Netapi32.INSTANCE.DsEnumerateDomainTrusts(serverName,
DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainCount);
DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainTrustCount);
if(W32Errors.NO_ERROR != rc) {
throw new Win32Exception(rc);
}
try {
DS_DOMAIN_TRUSTS domains = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue());
int domainCountValue = domainCount.getValue();
ArrayList<DomainTrust> trusts = new ArrayList<DomainTrust>(domainCountValue);
for(DS_DOMAIN_TRUSTS trust : (DS_DOMAIN_TRUSTS[]) domains.toArray(new DS_DOMAIN_TRUSTS[domainCountValue])) {
DS_DOMAIN_TRUSTS domainTrustRefs = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue());
DS_DOMAIN_TRUSTS[] domainTrusts = (DS_DOMAIN_TRUSTS[]) domainTrustRefs.toArray(new DS_DOMAIN_TRUSTS[domainTrustCount.getValue()]);
ArrayList<DomainTrust> trusts = new ArrayList<DomainTrust>(domainTrustCount.getValue());
for(DS_DOMAIN_TRUSTS domainTrust : domainTrusts) {
DomainTrust t = new DomainTrust();
if (trust.DnsDomainName != null) {
t.DnsDomainName = trust.DnsDomainName.toString();
if (domainTrust.DnsDomainName != null) {
t.DnsDomainName = domainTrust.DnsDomainName.toString();
}
if (trust.NetbiosDomainName != null) {
t.NetbiosDomainName = trust.NetbiosDomainName.toString();
if (domainTrust.NetbiosDomainName != null) {
t.NetbiosDomainName = domainTrust.NetbiosDomainName.toString();
}
t.DomainSid = trust.DomainSid;
if (trust.DomainSid != null) {
t.DomainSidString = Advapi32Util.convertSidToStringSid(trust.DomainSid);
t.DomainSid = domainTrust.DomainSid;
if (domainTrust.DomainSid != null) {
t.DomainSidString = Advapi32Util.convertSidToStringSid(domainTrust.DomainSid);
}
t.DomainGuid = trust.DomainGuid;
if (trust.DomainGuid != null) {
t.DomainGuidString = Ole32Util.getStringFromGUID(trust.DomainGuid);
t.DomainGuid = domainTrust.DomainGuid;
if (domainTrust.DomainGuid != null) {
t.DomainGuidString = Ole32Util.getStringFromGUID(domainTrust.DomainGuid);
}
t.flags = trust.Flags;
t.flags = domainTrust.Flags;
trusts.add(t);
}
return trusts.toArray(new DomainTrust[0]);
@@ -10,6 +10,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
@@ -282,6 +285,10 @@ public interface SetupApi extends StdCallLibrary {
* Reserved. Do not use.
*/
public Pointer Reserved;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "InterfaceClassGuid", "Flags", "Reserved" });
}
}
/**
@@ -330,5 +337,9 @@ public interface SetupApi extends StdCallLibrary {
* Reserved. For internal use only.
*/
public Pointer Reserved;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "InterfaceClassGuid", "DevInst", "Reserved" });
}
}
}
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
@@ -98,6 +101,10 @@ public interface ShellAPI extends StdCallLibrary {
* A pointer to the title of a progress dialog box. This is a null-terminated string.
*/
public WString lpszProgressTitle;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "hwnd", "wFunc", "pFrom", "pTo", "fFlags", "fAnyOperationsAborted", "pNameMappings", "lpszProgressTitle" });
}
/** Use this to encode <code>pFrom/pTo</code> paths. */
public String encodePaths(String[] paths) {
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
@@ -136,17 +139,18 @@ public interface Sspi extends StdCallLibrary {
public static class SecHandle extends Structure {
public Pointer dwLower;
public Pointer dwUpper;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwLower", "dwUpper" });
}
public static class ByReference extends SecHandle implements Structure.ByReference {
}
/**
* An empty SecHandle.
*/
public SecHandle() {
dwLower = null;
dwUpper = null;
}
/**
@@ -165,16 +169,18 @@ public interface Sspi extends StdCallLibrary {
public static class PSecHandle extends Structure {
public static class ByReference extends PSecHandle implements Structure.ByReference {
}
/**
* The first entry in an array of SecPkgInfo structures.
*/
public SecHandle.ByReference secHandle;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "secHandle" });
}
public PSecHandle() {
}
public PSecHandle(SecHandle h) {
@@ -209,7 +215,6 @@ public interface Sspi extends StdCallLibrary {
* Create a SECBUFFER_EMPTY SecBuffer.
*/
public ByReference() {
}
/**
@@ -245,19 +250,20 @@ public interface Sspi extends StdCallLibrary {
* Bit flags that indicate the type of buffer. Must be one of the values of
* the SecBufferType enumeration.
*/
public int BufferType;
public int BufferType = SECBUFFER_EMPTY;
/**
* A pointer to a buffer.
*/
public Pointer pvBuffer;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbBuffer", "BufferType", "pvBuffer" });
}
/**
* Create a new SECBUFFER_EMPTY buffer.
*/
public SecBuffer() {
cbBuffer = 0;
pvBuffer = null;
BufferType = SECBUFFER_EMPTY;
}
/**
@@ -271,7 +277,6 @@ public interface Sspi extends StdCallLibrary {
cbBuffer = size;
pvBuffer = new Memory(size);
BufferType = type;
allocateMemory();
}
/**
@@ -286,7 +291,6 @@ public interface Sspi extends StdCallLibrary {
pvBuffer = new Memory(token.length);
pvBuffer.write(0, token, 0, token.length);
BufferType = type;
allocateMemory();
}
/**
@@ -295,7 +299,7 @@ public interface Sspi extends StdCallLibrary {
* Raw buffer bytes.
*/
public byte[] getBytes() {
return pvBuffer.getByteArray(0, cbBuffer);
return pvBuffer == null ? null : pvBuffer.getByteArray(0, cbBuffer);
}
}
@@ -314,6 +318,10 @@ public interface Sspi extends StdCallLibrary {
*/
public SecBuffer.ByReference[] pBuffers;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "ulVersion", "cBuffers", "pBuffers" });
}
/**
* Create a new SecBufferDesc with one SECBUFFER_EMPTY buffer.
*/
@@ -370,13 +378,15 @@ public interface Sspi extends StdCallLibrary {
public static class SECURITY_INTEGER extends Structure {
public int dwLower;
public int dwUpper;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwLower", "dwUpper" });
}
/**
* An security integer of 0.
*/
public SECURITY_INTEGER() {
dwLower = 0;
dwUpper = 0;
}
}
@@ -384,7 +394,6 @@ public interface Sspi extends StdCallLibrary {
* A timestamp.
*/
public static class TimeStamp extends SECURITY_INTEGER {
}
/**
@@ -401,8 +410,11 @@ public interface Sspi extends StdCallLibrary {
*/
public SecPkgInfo.ByReference pPkgInfo;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "pPkgInfo" });
}
public PSecPkgInfo() {
}
/**
@@ -423,7 +435,6 @@ public interface Sspi extends StdCallLibrary {
* A reference pointer to a SecPkgInfo structure.
*/
public static class ByReference extends SecPkgInfo implements Structure.ByReference {
}
/**
@@ -433,7 +444,7 @@ public interface Sspi extends StdCallLibrary {
/**
* Specifies the version of the package protocol. Must be 1.
*/
public short wVersion;
public short wVersion = 1;
/**
* Specifies a DCE RPC identifier, if appropriate. If the package does not implement one of
* the DCE registered security systems, the reserved value SECPKG_ID_NONE is used.
@@ -453,14 +464,14 @@ public interface Sspi extends StdCallLibrary {
*/
public WString Comment;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "fCapabilities", "wVersion", "wRPCID", "cbMaxToken", "Name", "Comment" });
}
/**
* Create a new package info.
*/
public SecPkgInfo() {
fCapabilities = 0;
wVersion = 1;
wRPCID = 0;
cbMaxToken = 0;
}
}
}
@@ -10,6 +10,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.win32.StdCallLibrary;
@@ -135,5 +138,9 @@ public interface Tlhelp32 extends StdCallLibrary {
* retrieve the full path of the executable file for a 64-bit process.
*/
public char[] szExeFile = new char[WinDef.MAX_PATH];
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwSize", "cntUsage", "th32ProcessID", "th32DefaultHeapID", "th32ModuleID", "cntThreads", "th32ParentProcessID", "pcPriClassBase", "dwFlags", "szExeFile" });
}
}
}
@@ -10,6 +10,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.win32.StdCallLibrary;
@@ -113,5 +116,9 @@ public interface VerRsrc extends StdCallLibrary {
* The least significant 32 bits of the file's 64-bit binary creation date and time stamp.
*/
public WinDef.DWORD dwFileDateLS;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwSignature", "dwStrucVersion", "dwFileVersionMS", "dwFileVersionLS", "dwProductVersionMS", "dwProductVersionLS", "dwFileFlagsMask", "dwFileFlags", "dwFileOS", "dwFileType", "dwFileSubtype", "dwFileDateMS", "dwFileDateLS" });
}
}
}
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
@@ -61,6 +64,10 @@ public interface Wdm extends StdCallLibrary {
* The string is not null-terminated.
*/
public char[] Name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "LastWriteTime", "TitleIndex", "NameLength", "Name" });
}
/**
* Name of the key.
* @return String.
@@ -12,7 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
@@ -169,7 +171,11 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
*/
public static class FILETIME extends Structure {
public int dwLowDateTime;
public int dwHighDateTime;
public int dwHighDateTime;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwLowDateTime", "dwHighDateTime" });
}
public static class ByReference extends FILETIME implements Structure.ByReference {
public ByReference() {
@@ -292,6 +298,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
public short wSecond;
// The millisecond. The valid values for this member are 0 through 999.
public short wMilliseconds;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "wYear", "wMonth", "wDayOfWeek", "wDay", "wHour", "wMinute", "wSecond", "wMilliseconds" });
}
}
/**
@@ -380,6 +390,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
public int Offset;
public int OffsetHigh;
public HANDLE hEvent;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Internal", "InternalHigh", "Offset", "OffsetHigh", "hEvent" });
}
}
int INFINITE = 0xFFFFFFFF;
@@ -412,6 +426,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
* Reserved for future use.
*/
public WORD wReserved;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "wProcessorArchitecture", "wReserved" });
}
}
/** Unnamed inner union. */
@@ -482,6 +500,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
* Architecture-dependent processor revision.
*/
public WORD wProcessorRevision;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "processorArchitecture", "dwPageSize", "lpMinimumApplicationAddress", "lpMaximumApplicationAddress", "dwActiveProcessorMask", "dwNumberOfProcessors", "dwProcessorType", "dwAllocationGranularity", "wProcessorLevel", "wProcessorRevision"});
}
}
/**
@@ -531,6 +553,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
*/
public DWORDLONG ullAvailExtendedVirtual;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwLength", "dwMemoryLoad", "ullTotalPhys", "ullAvailPhys", "ullTotalPageFile", "ullAvailPageFile", "ullTotalVirtual", "ullAvailVirtual", "ullAvailExtendedVirtual" });
}
public MEMORYSTATUSEX() {
dwLength = new DWORD(size());
}
@@ -560,6 +586,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
*/
public boolean bInheritHandle;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwLength", "lpSecurityDescriptor", "bInheritHandle" });
}
public SECURITY_ATTRIBUTES() {
dwLength = new DWORD(size());
}
@@ -732,6 +762,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
*/
public HANDLE hStdError;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cb", "lpReserved", "lpDesktop", "lpTitle", "dwX", "dwY", "dwXSize", "dwYSize", "dwXCountChars", "dwYCountChars", "dwFillAttribute", "dwFlags", "wShowWindow", "cbReserved2", "lpReserved2", "hStdInput", "hStdOutput", "hStdError" });
}
public STARTUPINFO() {
cb = new DWORD(size());
}
@@ -773,6 +807,10 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD {
* identifier may be reused.
*/
public DWORD dwThreadId;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "hProcess", "hThread", "dwProcessId", "dwThreadId" });
}
public static class ByReference extends PROCESS_INFORMATION implements Structure.ByReference {
public ByReference() {
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
@@ -59,6 +62,9 @@ public interface WinCrypt extends StdCallLibrary {
*/
public Pointer pbData;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbData", "pbData" });
}
/**
* Get byte data.
* @return
@@ -100,6 +106,10 @@ public interface WinCrypt extends StdCallLibrary {
* A string containing the text of a prompt to be displayed.
*/
public String szPrompt;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "dwPromptFlags", "hwndApp", "szPrompt" });
}
}
//
@@ -13,6 +13,8 @@
package com.sun.jna.platform.win32;
import java.awt.Rectangle;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.IntegerType;
import com.sun.jna.Native;
@@ -63,7 +65,7 @@ public interface WinDef extends StdCallLibrary {
* Low WORD.
*/
public WORD getLow() {
return new WORD(longValue() & 0xFF);
return new WORD(longValue() & 0xFFFF);
}
/**
@@ -72,7 +74,7 @@ public interface WinDef extends StdCallLibrary {
* High WORD.
*/
public WORD getHigh() {
return new WORD((longValue() >> 16) & 0xFF);
return new WORD((longValue() >> 16) & 0xFFFF);
}
}
@@ -323,6 +325,10 @@ public interface WinDef extends StdCallLibrary {
public int right;
public int bottom;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "left", "top", "right", "bottom" });
}
public Rectangle toRectangle() {
return new Rectangle(left, top, right-left, bottom-top);
}
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.WinDef.RECT;
import com.sun.jna.win32.StdCallLibrary;
@@ -30,11 +33,20 @@ public interface WinGDI extends StdCallLibrary {
public int nCount;
public int nRgnSize;
public RECT rcBound;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwSize", "iType", "nCount", "nRgnSize", "rcBound" });
}
}
public class RGNDATA extends Structure {
public RGNDATAHEADER rdh;
public byte[] Buffer;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "rdh", "Buffer" });
}
public RGNDATA(int bufferSize) {
Buffer = new byte[bufferSize];
allocateMemory();
@@ -74,6 +86,9 @@ public interface WinGDI extends StdCallLibrary {
public int biYPelsPerMeter;
public int biClrUsed;
public int biClrImportant;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "biSize", "biWidth", "biHeight", "biPlanes", "biBitCount", "biCompression", "biSizeImage", "biXPelsPerMeter", "biYPelsPerMeter", "biClrUsed", "biClrImportant" });
}
}
public class RGBQUAD extends Structure {
@@ -81,11 +96,17 @@ public interface WinGDI extends StdCallLibrary {
public byte rgbGreen;
public byte rgbRed;
public byte rgbReserved = 0;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "rgbBlue", "rgbGreen", "rgbRed", "rgbReserved" });
}
}
public class BITMAPINFO extends Structure {
public BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER();
public RGBQUAD[] bmiColors = new RGBQUAD[1];
protected List getFieldOrder() {
return Arrays.asList(new String[] { "bmiHeader", "bmiColors" });
}
public BITMAPINFO() { this(1); }
public BITMAPINFO(int size) {
bmiColors = new RGBQUAD[size];
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.Union;
@@ -63,6 +66,10 @@ public interface WinUser extends StdCallLibrary, WinDef {
public HWND hwndMoveSize;
public HWND hwndCaret;
public RECT rcCaret;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "flags", "hwndActive", "hwndFocus", "hwndCapture", "hwndMenuOwner", "hwndMoveSize", "hwndCaret", "rcCaret" });
}
}
public class WINDOWINFO extends Structure {
@@ -76,6 +83,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
public int cyWindowBorders;
public short atomWindowType;
public short wCreatorVersion;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "rcWindow", "rcClient", "dwStyle", "dwExStyle", "dwWindowStatus", "cxWindowBorders", "cyWindowBorders", "atomWindowType", "wCreatorVersion" });
}
}
int GWL_EXSTYLE = -20;
@@ -112,6 +122,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
this.x = x;
this.y = y;
}
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y" });
}
}
public class MSG extends Structure {
@@ -121,6 +134,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
public LPARAM lParam;
public int time;
public POINT pt;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "hWnd", "message", "wParam", "lParam", "time", "pt" });
}
}
public class FLASHWINFO extends Structure {
@@ -129,6 +145,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
public int dwFlags;
public int uCount;
public int dwTimeout;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "hWnd", "dwFlags", "uCount", "dwTimeout" });
}
}
public interface WNDENUMPROC extends StdCallCallback {
@@ -148,6 +167,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
this.cx = w;
this.cy = h;
}
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cx", "cy" });
}
}
int AC_SRC_OVER = 0x00;
@@ -160,6 +182,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
public byte BlendFlags = 0; // only valid value
public byte SourceConstantAlpha;
public byte AlphaFormat;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "BlendOp", "BlendFlags", "SourceConstantAlpha", "AlphaFormat"});
}
}
int VK_SHIFT = 16;
@@ -259,6 +284,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
public int flags;
public int time;
public ULONG_PTR dwExtraInfo;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "vkCode", "scanCode", "flags", "time", "dwExtraInfo" });
}
}
int SM_CXSCREEN = 0;
@@ -485,6 +513,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
public WinDef.DWORD uMsg;
public WinDef.WORD wParamL;
public WinDef.WORD wParamH;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "uMsg", "wParamL", "wParamH" });
}
}
/**
@@ -516,7 +547,10 @@ public interface WinUser extends StdCallLibrary, WinDef {
public WinDef.DWORD type;
public INPUT_UNION input = new INPUT_UNION();
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "input" });
}
public static class INPUT_UNION extends Union {
public INPUT_UNION() {
@@ -604,6 +638,10 @@ public interface WinUser extends StdCallLibrary, WinDef {
* information.
*/
public BaseTSD.ULONG_PTR dwExtraInfo;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "wVk", "wScan", "dwFlags", "time", "dwExtraInfo" });
}
}
/**
@@ -634,6 +672,10 @@ public interface WinUser extends StdCallLibrary, WinDef {
public WinDef.DWORD dwFlags;
public WinDef.DWORD time;
public BaseTSD.ULONG_PTR dwExtraInfo;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dx", "dy", "mouseData", "dwFlags", "time", "dwExtraInfo" });
}
}
/**
@@ -644,5 +686,9 @@ public interface WinUser extends StdCallLibrary, WinDef {
// Tick count of when the last input event was received.
public int dwTime;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "cbSize", "dwTime" });
}
}
}
@@ -10,6 +10,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.win32.StdCallLibrary;
@@ -61,5 +64,9 @@ public interface Winioctl extends StdCallLibrary {
* The partition number of the device, if the device can be partitioned. Otherwise, this member is -1.
*/
public int PartitionNumber;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "DeviceType", "DeviceNumber", "PartitionNumber" });
}
}
}
@@ -12,6 +12,9 @@
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
@@ -86,9 +89,12 @@ public interface Winspool extends StdCallLibrary {
public String pDescription;
public String pName;
public String pComment;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Flags", "pDescription", "pName", "pComment" });
}
public PRINTER_INFO_1() {
}
public PRINTER_INFO_1(int size) {
@@ -100,9 +106,12 @@ public interface Winspool extends StdCallLibrary {
public String pPrinterName;
public String pServerName;
public DWORD Attributes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "pPrinterName", "pServerName", "Attributes" });
}
public PRINTER_INFO_4() {
}
public PRINTER_INFO_4(int size) {
@@ -13,6 +13,9 @@
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.WinNT.HANDLE;
@@ -97,6 +100,10 @@ public interface Winsvc extends StdCallLibrary {
*/
public int dwWaitHint;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwServiceType", "dwCurrentState", "dwControlsAccepted", "dwWin32ExitCode", "dwServiceSpecificExitCode", "dwCheckPoint", "dwWaitHint" });
}
public SERVICE_STATUS() {
super();
}
@@ -181,6 +188,10 @@ public interface Winsvc extends StdCallLibrary {
*/
public int dwServiceFlags;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwServiceType", "dwCurrentState", "dwControlsAccepted", "dwWin32ExitCode", "dwServiceSpecificExitCode", "dwCheckPoint", "dwWaitHint", "dwProcessId", "dwServiceFlags" });
}
public SERVICE_STATUS_PROCESS() {
}
@@ -732,7 +732,10 @@ public class Advapi32Test extends TestCase {
assertTrue(Advapi32.INSTANCE.CloseServiceHandle(handle));
assertNull(Advapi32.INSTANCE.OpenSCManager("invalidMachineName", null, Winsvc.SC_MANAGER_CONNECT));
assertEquals(W32Errors.RPC_S_SERVER_UNAVAILABLE, Kernel32.INSTANCE.GetLastError());
int err = Kernel32.INSTANCE.GetLastError();
assertTrue("Unexpected error in OpenSCManager: " + err,
err == W32Errors.RPC_S_SERVER_UNAVAILABLE
|| err == W32Errors.RPC_S_INVALID_NET_ADDR);
assertNull(Advapi32.INSTANCE.OpenSCManager(null, "invalidDatabase", Winsvc.SC_MANAGER_CONNECT));
assertEquals(W32Errors.ERROR_INVALID_NAME, Kernel32.INSTANCE.GetLastError());
@@ -26,6 +26,8 @@ import com.sun.jna.platform.win32.WinNT.HANDLEByReference;
import com.sun.jna.platform.win32.WinNT.PSID;
import com.sun.jna.platform.win32.WinNT.SID_NAME_USE;
import com.sun.jna.platform.win32.WinNT.WELL_KNOWN_SID_TYPE;
import com.sun.jna.platform.win32.WinReg.HKEY;
import com.sun.jna.platform.win32.WinReg.HKEYByReference;
/**
* @author dblock[at]dblock[dot]org
@@ -296,8 +298,9 @@ public class Advapi32UtilTest extends TestCase {
Advapi32Util.registrySetStringArray(WinReg.HKEY_CURRENT_USER, "Software\\JNA", "StringArray", stringsWritten);
String[] emptyArray = new String[0];
Advapi32Util.registrySetStringArray(WinReg.HKEY_CURRENT_USER, "Software\\JNA", "EmptyStringArray", emptyArray);
Advapi32Util.registrySetBinaryValue(WinReg.HKEY_CURRENT_USER, "Software\\JNA", "EmptyBinary", new byte[0]);
TreeMap<String, Object> values = Advapi32Util.registryGetValues(WinReg.HKEY_CURRENT_USER, "Software\\JNA");
assertEquals(6, values.keySet().size());
assertEquals(7, values.keySet().size());
assertEquals("FourtyTwo" + uu, values.get("42" + uu));
assertEquals(42, values.get("FourtyTwo" + uu));
assertEquals("%TEMP%", values.get("ExpandableString"));
@@ -315,6 +318,46 @@ public class Advapi32UtilTest extends TestCase {
assertEquals(0, stringsRead.length);
Advapi32Util.registryDeleteKey(WinReg.HKEY_CURRENT_USER, "Software", "JNA");
}
public void testRegistryGetEmptyValues() {
HKEY root = WinReg.HKEY_CURRENT_USER;
String keyPath = "Software\\JNA";
Advapi32Util.registryCreateKey(root, "Software", "JNA");
doTestRegistryGetEmptyValues(root, keyPath, WinNT.REG_BINARY);
doTestRegistryGetEmptyValues(root, keyPath, WinNT.REG_EXPAND_SZ);
doTestRegistryGetEmptyValues(root, keyPath, WinNT.REG_MULTI_SZ);
doTestRegistryGetEmptyValues(root, keyPath, WinNT.REG_NONE);
doTestRegistryGetEmptyValues(root, keyPath, WinNT.REG_SZ);
Advapi32Util.registryDeleteKey(root, "Software", "JNA");
}
private void doTestRegistryGetEmptyValues(HKEY root, String keyPath, int valueType) {
String valueName = "EmptyValue";
registrySetEmptyValue(root, keyPath, valueName, valueType);
Map<String, Object> values = Advapi32Util.registryGetValues(root, keyPath);
assertEquals(1, values.size());
assertTrue(values.containsKey(valueName));
}
private static void registrySetEmptyValue(HKEY root, String keyPath, String name, final int valueType) {
HKEYByReference phkKey = new HKEYByReference();
int rc = Advapi32.INSTANCE.RegOpenKeyEx(root, keyPath, 0, WinNT.KEY_READ | WinNT.KEY_WRITE, phkKey);
if (rc != W32Errors.ERROR_SUCCESS) {
throw new Win32Exception(rc);
}
try {
char[] data = new char[0];
rc = Advapi32.INSTANCE.RegSetValueEx(phkKey.getValue(), name, 0, valueType, data, 0);
if (rc != W32Errors.ERROR_SUCCESS) {
throw new Win32Exception(rc);
}
} finally {
rc = Advapi32.INSTANCE.RegCloseKey(phkKey.getValue());
if (rc != W32Errors.ERROR_SUCCESS) {
throw new Win32Exception(rc);
}
}
}
public void testIsWellKnownSid() {
String everyoneString = "S-1-1-0";
@@ -10,14 +10,13 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
package com.sun.jna.platform.win32;
import junit.framework.TestCase;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.DsGetDC.DS_DOMAIN_TRUSTS;
import com.sun.jna.platform.win32.DsGetDC.PDOMAIN_CONTROLLER_INFO;
import com.sun.jna.platform.win32.DsGetDC.PDS_DOMAIN_TRUSTS;
import com.sun.jna.platform.win32.LMAccess.GROUP_INFO_2;
import com.sun.jna.platform.win32.LMAccess.GROUP_USERS_INFO_0;
import com.sun.jna.platform.win32.LMAccess.LOCALGROUP_USERS_INFO_0;
@@ -234,23 +233,24 @@ public class Netapi32Test extends TestCase {
if (Netapi32Util.getJoinStatus() != LMJoin.NETSETUP_JOIN_STATUS.NetSetupDomainName)
return;
IntByReference domainCount = new IntByReference();
PDS_DOMAIN_TRUSTS.ByReference domains = new PDS_DOMAIN_TRUSTS.ByReference();
assertEquals(W32Errors.NO_ERROR, Netapi32.INSTANCE.DsEnumerateDomainTrusts(
null, DsGetDC.DS_DOMAIN_VALID_FLAGS, domains, domainCount));
IntByReference domainTrustCount = new IntByReference();
PointerByReference domainsPointerRef = new PointerByReference();
assertEquals(W32Errors.NO_ERROR, Netapi32.INSTANCE.DsEnumerateDomainTrusts(null,
DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainTrustCount));
assertTrue(domainTrustCount.getValue() >= 0);
assertTrue(domainCount.getValue() >= 0);
DS_DOMAIN_TRUSTS[] trusts = domains.getTrusts(domainCount.getValue());
for(DS_DOMAIN_TRUSTS trust : trusts) {
assertTrue(trust.NetbiosDomainName.length() > 0);
DS_DOMAIN_TRUSTS domainTrustRefs = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue());
DS_DOMAIN_TRUSTS[] domainTrusts = (DS_DOMAIN_TRUSTS[]) domainTrustRefs.toArray(new DS_DOMAIN_TRUSTS[domainTrustCount.getValue()]);
for(DS_DOMAIN_TRUSTS trust : domainTrusts) {
assertTrue(trust.DnsDomainName.length() > 0);
assertTrue(Advapi32.INSTANCE.IsValidSid(trust.DomainSid));
assertTrue(Advapi32Util.convertSidToStringSid(trust.DomainSid).startsWith("S-"));
assertTrue(Ole32Util.getStringFromGUID(trust.DomainGuid).startsWith("{"));
}
assertEquals(W32Errors.ERROR_SUCCESS, Netapi32.INSTANCE.NetApiBufferFree(
domains.getPointer()));
assertEquals(W32Errors.ERROR_SUCCESS, Netapi32.INSTANCE.NetApiBufferFree(domainTrustRefs.getPointer()));
}
}
@@ -25,9 +25,12 @@ public class VersionTest extends TestCase {
public void testGetFileVersion() {
String systemRoot = System.getenv("SystemRoot");
File notepad = new File(systemRoot + "\\write.exe");
File file = new File(systemRoot + "\\regedit.exe");
if (!file.exists()) {
fail("Can't obtain file version, file " + file + " is missing");
}
int size = Version.INSTANCE.GetFileVersionInfoSize(notepad.getAbsolutePath(), null);
int size = Version.INSTANCE.GetFileVersionInfoSize(file.getAbsolutePath(), null);
assertTrue(size > 0);
Pointer buffer = Kernel32.INSTANCE.LocalAlloc(WinBase.LMEM_ZEROINIT, size);
@@ -35,7 +38,7 @@ public class VersionTest extends TestCase {
try
{
assertTrue(Version.INSTANCE.GetFileVersionInfo(notepad.getAbsolutePath(), 0, size, buffer));
assertTrue(Version.INSTANCE.GetFileVersionInfo(file.getAbsolutePath(), 0, size, buffer));
IntByReference outputSize = new IntByReference();
PointerByReference pointer = new PointerByReference();
+8 -13
Ver Arquivo
@@ -8,7 +8,6 @@
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-shapedwindow.jar"/>
<property name="file.reference.jna.build" location="../../build"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.ShapedWindowDemo" />
@@ -37,7 +36,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -45,29 +43,26 @@
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes/com">
<exclude name="**/*.java"/>
</fileset>
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
+15 -16
Ver Arquivo
@@ -2,15 +2,14 @@
<project name="jnacontrib.w32keyhook" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.w32keyhook.</description>
<!-- Locations -->
<property name="src" location="src"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="jna-dist" location="../../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-w32keyhook.jar"/>
<property name="file.reference.jna.build" location="../../build"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="KeyHook" />
<property name="main-class" value="com.sun.jna.contrib.demo.KeyHook" />
<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
@@ -37,7 +36,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -45,25 +43,26 @@
<path refid="classpath"/>
</classpath>
</javac>
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes" />
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes" />
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes" />
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}" />
</jar>
</target>
</project>
@@ -1,67 +1,82 @@
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinUser;
import com.sun.jna.platform.win32.WinDef.HMODULE;
import com.sun.jna.platform.win32.WinDef.LRESULT;
import com.sun.jna.platform.win32.WinDef.WPARAM;
import com.sun.jna.platform.win32.WinUser.HHOOK;
import com.sun.jna.platform.win32.WinUser.KBDLLHOOKSTRUCT;
import com.sun.jna.platform.win32.WinUser.LowLevelKeyboardProc;
import com.sun.jna.platform.win32.WinUser.MSG;
/** Sample implementation of a low-level keyboard hook on W32. */
public class KeyHook {
private static volatile boolean quit;
private static HHOOK hhk;
private static LowLevelKeyboardProc keyboardHook;
public static void main(String[] args) {
final User32 lib = User32.INSTANCE;
HMODULE hMod = Kernel32.INSTANCE.GetModuleHandle(null);
keyboardHook = new LowLevelKeyboardProc() {
public LRESULT callback(int nCode, WPARAM wParam, KBDLLHOOKSTRUCT info) {
if (nCode >= 0) {
switch(wParam.intValue()) {
case WinUser.WM_KEYUP:
case WinUser.WM_KEYDOWN:
case WinUser.WM_SYSKEYUP:
case WinUser.WM_SYSKEYDOWN:
System.err.println("in callback, key=" + info.vkCode);
if (info.vkCode == 81) {
quit = true;
}
}
}
return lib.CallNextHookEx(hhk, nCode, wParam, info.getPointer());
}
};
hhk = lib.SetWindowsHookEx(WinUser.WH_KEYBOARD_LL, keyboardHook, hMod, 0);
System.out.println("Keyboard hook installed, type anywhere, 'q' to quit");
new Thread() {
public void run() {
while (!quit) {
try { Thread.sleep(10); } catch(Exception e) { }
}
System.err.println("unhook and exit");
lib.UnhookWindowsHookEx(hhk);
System.exit(0);
}
}.start();
// This bit never returns from GetMessage
int result;
MSG msg = new MSG();
while ((result = lib.GetMessage(msg, null, 0, 0)) != 0) {
if (result == -1) {
System.err.println("error in get message");
break;
}
else {
System.err.println("got message");
lib.TranslateMessage(msg);
lib.DispatchMessage(msg);
}
}
lib.UnhookWindowsHookEx(hhk);
}
/* Copyright (c) 2007 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.contrib.demo;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinUser;
import com.sun.jna.platform.win32.WinDef.HMODULE;
import com.sun.jna.platform.win32.WinDef.LRESULT;
import com.sun.jna.platform.win32.WinDef.WPARAM;
import com.sun.jna.platform.win32.WinUser.HHOOK;
import com.sun.jna.platform.win32.WinUser.KBDLLHOOKSTRUCT;
import com.sun.jna.platform.win32.WinUser.LowLevelKeyboardProc;
import com.sun.jna.platform.win32.WinUser.MSG;
/** Sample implementation of a low-level keyboard hook on W32. */
public class KeyHook {
private static volatile boolean quit;
private static HHOOK hhk;
private static LowLevelKeyboardProc keyboardHook;
public static void main(String[] args) {
final User32 lib = User32.INSTANCE;
HMODULE hMod = Kernel32.INSTANCE.GetModuleHandle(null);
keyboardHook = new LowLevelKeyboardProc() {
public LRESULT callback(int nCode, WPARAM wParam, KBDLLHOOKSTRUCT info) {
if (nCode >= 0) {
switch(wParam.intValue()) {
case WinUser.WM_KEYUP:
case WinUser.WM_KEYDOWN:
case WinUser.WM_SYSKEYUP:
case WinUser.WM_SYSKEYDOWN:
System.err.println("in callback, key=" + info.vkCode);
if (info.vkCode == 81) {
quit = true;
}
}
}
return lib.CallNextHookEx(hhk, nCode, wParam, info.getPointer());
}
};
hhk = lib.SetWindowsHookEx(WinUser.WH_KEYBOARD_LL, keyboardHook, hMod, 0);
System.out.println("Keyboard hook installed, type anywhere, 'q' to quit");
new Thread() {
public void run() {
while (!quit) {
try { Thread.sleep(10); } catch(Exception e) { }
}
System.err.println("unhook and exit");
lib.UnhookWindowsHookEx(hhk);
System.exit(0);
}
}.start();
// This bit never returns from GetMessage
int result;
MSG msg = new MSG();
while ((result = lib.GetMessage(msg, null, 0, 0)) != 0) {
if (result == -1) {
System.err.println("error in get message");
break;
}
else {
System.err.println("got message");
lib.TranslateMessage(msg);
lib.DispatchMessage(msg);
}
}
lib.UnhookWindowsHookEx(hhk);
}
}
+13 -17
Ver Arquivo
@@ -6,9 +6,9 @@
<property name="build" location="build"/>
<property name="jna-src" location="../../src"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-x11.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
@@ -45,7 +45,6 @@
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
@@ -53,29 +52,26 @@
<path refid="classpath"/>
</classpath>
</javac>
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
<!-- platform -->
<fileset dir="../platform/build/classes">
<exclude name="**/*.java"/>
</fileset>
<!-- jna -->
<fileset dir="${file.reference.jna.build}/classes/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="jnacontrib.x11.demos.XDesktopDemo"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
BIN
Ver Arquivo
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
+54 -18
Ver Arquivo
@@ -16,14 +16,21 @@
# Solaris (i386/amd64/sparc/sparcv9)
# AIX (ppc/ppc64)
# FreeBSD/OpenBSD/NetBSD (i386/amd64)
# Android (arm)
#
# Built, but with outstanding bugs (not necessarily within JNA):
#
# Linux (ppc64/ia64)
#
# The w32ce build requires cegcc and phoneME for cross-compilation; if these
# tools are available on the path than "ant -Dos.prefix=w32ce-arm" should
# tools are available on the path then "ant -Dos.prefix=w32ce-arm" should
# result in a proper build.
#
# The android build requires the android SDK+NDK for cross-compilation;
# make the tools available on the path and compile with
# "ant -Dos.prefix=android-arm". Put the NDK tools in the path and adjust
# NDK_PLATFORM below or set it in your environment.
#
# Systems which support POSIX signals may be able to support VM crash
# protection simply by defining HAVE_PROTECTION. This option has been only
@@ -39,8 +46,8 @@ OS=$(shell uname | sed -e 's/CYGWIN.*/win32/g' \
-e 's/AIX.*/aix/g' \
-e 's/Linux.*/linux/g')
JNA_JNI_VERSION=3.4.0 # auto-generated by ant
CHECKSUM=4c69bcf40b30785215211b5a5dad211e # auto-generated by ant
JNA_JNI_VERSION=3.5.0 # auto-generated by ant
CHECKSUM=60417f69d77e4d8d693b43391a4a5b91 # auto-generated by ant
JAVA_INCLUDES=-I"$(JAVA_HOME)/include" \
-I"$(JAVA_HOME)/include/$(OS)"
@@ -50,6 +57,7 @@ JAVAH=$(BUILD)
INSTALLDIR=../build/$(OS)
JNIDISPATCH_OBJS=$(BUILD)/dispatch.o $(BUILD)/callback.o $(EXTRAOBJS)
RSRC=$(BUILD)/rsrc.o
DLLCB=$(BUILD)/dll-callback.o
ifneq ($(DYNAMIC_LIBFFI),true)
FFI_SRC=$(shell pwd)/libffi
FFI_BUILD=$(BUILD)/libffi
@@ -96,6 +104,25 @@ endif
STRIP=strip -x
# end defaults
# Android build (cross-compile) requires the android SDK+NDK.
# Ensure the following tools are in your path and adjust NDK_PLATFORM as needed
ifeq ($(OS),android)
CC=arm-linux-androideabi-gcc
CPP=arm-linux-androideabi-cpp
LD=arm-linux-androideabi-gcc
RANLIB=arm-linux-androideabi-ranlib
STRIP=arm-linux-androideabi-strip -x
CDEFINES=-DNO_JAWT -DNO_WEAK_GLOBALS -DFFI_MMAP_EXEC_WRIT=1 -DFFI_MMAP_EXEC_SELINUX=0
COPT+=-fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -march=armv5te -mtune=xscale -msoft-float
NDK_PLATFORM?=/Developer/Applications/android-ndk-r7c/platforms/android-14
JAVA_INCLUDES=
CINCLUDES+=-I"$(NDK_PLATFORM)/arch-arm/usr/include" # -I/usr/include
LIBS=-nostdlib -L"$(NDK_PLATFORM)/arch-arm/usr/lib/" -lgcc -lc -ldl -lm
LDFLAGS+=-Wl,-shared,-Bsymbolic
FFI_ENV=CPP="$(CPP)" CC="$(CC)" CFLAGS="$(COPT) $(CDEBUG) $(CINCLUDES)" CPPFLAGS="$(CDEFINES) $(CINCLUDES)" LIBS="$(LIBS)" RANLIB="$(RANLIB)"
FFI_CONFIG=--enable-static --disable-shared --with-pic=yes --host=arm-linux-eabi
endif
# W32CE build requires cegcc cross-compiler and phoneME JavaME implementation
# cegcc: http://sf.net/projects/cegcc
# phoneme: http://davy.preuveneers.net/
@@ -121,7 +148,7 @@ endif
ifeq ($(OS),win32)
ARCH=$(shell uname -m | sed 's/i.86/i386/g')
CDEFINES=-DHAVE_PROTECTION -DPSAPI_VERSION=1
CDEFINES=-DHAVE_PROTECTION -DPSAPI_VERSION=1 -DFFI_BUILDING
LIBS=-lpsapi
WINDRES=windres
EXTRAOBJS=$(RSRC)
@@ -129,10 +156,11 @@ STRIP=@echo
LIBPFX=
LIBSFX=.dll
ifneq ($(ARCH),amd64)
ifeq ($(CC),gcc)
# -mno-cygwin is only available on GCC 3; GCC 4 requires an explicit mingw
# installation
GCC_VERSION = $(shell gcc --version | sed -n 's/.*\([34]\)[0-9.]*.*/\1/p')
GCC_VERSION = $(shell gcc --version | sed -n 's/.*(GCC) \([0-9]\)\.[0-9.]*.*/\1/p')
ifeq ($(GCC_VERSION),3)
NOCYGWIN=-mno-cygwin
else
@@ -142,17 +170,21 @@ CC += $(NOCYGWIN)
LD += $(NOCYGWIN) -Wl,--add-stdcall-alias
endif
ifeq ($(ARCH),amd64)
else
# Uncomment to enable MINGW64 cross compiler; ensure mingw32-gcc is in PATH
# Should build properly as of 111121, but lacks SEH, so MSVC build is preferred
#MINGW=x86_64-w64-mingw32-gcc
# Set CC to $(MINGW) to enable mingw64 cross compiler; ensure $(MINGW) is in
# PATH. Should build properly as of 111121, but lacks SEH, so MSVC build is
# preferred
MINGW_PREFIX?=x86_64-w64-mingw32-
MINGW=$(MINGW_PREFIX)gcc
# Still need windres from mingw distribution
WINDRES=x86_64-w64-mingw32-windres
WINDRES=$(MINGW_PREFIX)windres
# To build entirely with mingw64, uncomment this line
#CC=$(MINGW)
ifneq ($(MINGW),)
ifeq ($(CC),$(MINGW))
# No SEH under mingw64
CDEFINES=-DPSAPI_VERSION=1
CC = $(MINGW)
LD = $(CC)
LDFLAGS=-o $@ -shared
LIBS= -lmingwex -lpsapi -lkernel32 -lmsvcrt
@@ -165,8 +197,9 @@ LD=$(FFI_SRC)/../ld.sh -m64
COPT=
LIBS=psapi.lib
ARSFX=.lib
FFI_CONFIG+=--host=x86_64-pc-mingw32 && rm -f include/ffitarget.h && cp $(FFI_SRC)/include/*.h $(FFI_SRC)/src/x86/ffitarget.h include
FFI_ENV+=LD="$(LD) cpp=$(CPP)"
FFI_CONFIG+=--host=x86_64-w64-mingw32 && rm -f include/ffitarget.h && cp $(FFI_SRC)/include/*.h $(FFI_SRC)/src/x86/ffitarget.h include
FFI_ENV+=LD="$(LD)" CPP="$(CPP)"
EXTRAOBJS+=$(DLLCB)
endif
endif
endif
@@ -206,7 +239,7 @@ ifeq ($(OS),aix)
LIBSFX=.a
PCFLAGS+=-fPIC
CDEFINES+=-DHAVE_PROTECTION -DNO_JAWT -Wall -D_AIX -DPOWERPC_AIX
COPT+=-D_AIX -DPOWERPC_AIX -mxl-compat -g
COPT+=-D_AIX -DPOWERPC_AIX -mxl-compat
LDFLAGS+=-Wl,-lc128,-lc,-lm,-lpthread
FFI_ENV+=AR_FLAGS="-X32_64 cru"
STRIP=echo strip -X32_64
@@ -284,7 +317,7 @@ endif
# Unfortunately, we have to use different libffi include files depending on
# the target, so we can't do a simple universal build on darwin. Do
# separate builds, then merge the results.
$(BUILD)/%.o : %.c dispatch.h $(FFI_LIB)
$(BUILD)/%.o : %.c dispatch.h protect.h $(FFI_LIB)
@mkdir -p $(BUILD)
ifneq ($(SDKROOT),)
$(CC) -arch $(ARCH) $(CFLAGS) -c $< -o $@.$(ARCH)
@@ -302,6 +335,9 @@ install:
mkdir $(INSTALLDIR)
cp $(LIBRARY) $(INSTALLDIR)
$(DLLCB): dll-callback.c
$(MINGW) -DDEFINE_CALLBACKS -c $< $(COUT)
$(RSRC): $(BUILD)/jnidispatch.rc
$(WINDRES) -i $< -o $@ \
|| (echo > $@.c && $(CC) $(CFLAGS) -c $@.c $(COUT))
@@ -319,10 +355,10 @@ else
TESTDEP=$(TESTLIB)
endif
$(TESTLIB2): $(BUILD)/testlib2.o
$(LD) $(LDFLAGS) $< $(TESTDEP)
$(LD) $(LDFLAGS) $< $(TESTDEP) $(LIBS)
ifneq ($(DYNAMIC_LIBFFI),true)
$(FFI_LIB):
$(FFI_LIB):
@mkdir -p $(FFI_BUILD)
@if [ ! -f $(FFI_BUILD)/Makefile ]; then \
echo "Configuring libffi ($(ARCH))"; \
+12 -2
Ver Arquivo
@@ -1,3 +1,13 @@
--- libffi notes ---
All JNA customizations to date have been merged to upstream libffi. This
source tree has been synched to http://github.com/atgreen/libffi.
The libffi subdirectory is managed as a subtree. Use subtree merging
to update from upstream, e.g.
$ git pull -s subtree libffi master (or other branch, if necessary)
The libffi subdirectory was originally mapped as follows:
$ git remote add -f libffi git@github.com:atgreen/libffi.git
$ git merge -s ours --no-commit libffi/master
$ git read-tree --prefix=native/libffi -u libffi/master
$ git commit -m "Merge libffi as subtree"
+178 -33
Ver Arquivo
@@ -12,6 +12,7 @@
* Lesser General Public License for more details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
@@ -30,14 +31,54 @@
extern "C" {
#endif
static void callback_dispatch(ffi_cif*, void*, void**, void*);
#if defined(_WIN32) && !defined(_WIN32_WCE)
#include "com_sun_jna_win32_DLLCallback.h"
#ifdef _WIN64
#ifdef _MSC_VER
/* See dll-callback.c (compiled with mingw64) for actual definitions; no
inline asm support for MSVC and no RIP-relative instructions allowed in
ML64.
*/
#define ASMFN(X) extern void asmfn ## X ()
#else
#include "dll-callback.c"
#endif
#else /* _WIN64 */
#ifdef _MSC_VER
// FIXME is "PROC NEAR" correct?
#define ASMFN(X) extern void asmfn ## X(); \
__asm asmfn ## X PROC NEAR \
__asm jmp fn[X]
#else
#define ASMFN(X) extern void asmfn ## X (); asm(".globl _asmfn" #X "\n\
_asmfn" #X ":\n\
jmp *(_fn+4*" #X ")")
#endif
#endif /* _WIN64 */
// Allocatable trampoline targets
#define DLL_FPTRS com_sun_jna_win32_DLLCallback_DLL_FPTRS
void (*fn[DLL_FPTRS])();
ASMFN(0);ASMFN(1);ASMFN(2);ASMFN(3);ASMFN(4);ASMFN(5);ASMFN(6);ASMFN(7);
ASMFN(8);ASMFN(9);ASMFN(10);ASMFN(11);ASMFN(12);ASMFN(13);ASMFN(14);ASMFN(15);
static void * const dll_fptrs[] = {
&asmfn0, &asmfn1, &asmfn2, &asmfn3, &asmfn4, &asmfn5, &asmfn6, &asmfn7,
&asmfn8, &asmfn9, &asmfn10, &asmfn11, &asmfn12, &asmfn13, &asmfn14, &asmfn15,
};
#endif /* _WIN32 && !_WIN32_WCE */
static void callback_dispatch(ffi_cif*, void*, void**, void*);
static jclass classObject;
callback*
create_callback(JNIEnv* env, jobject obj, jobject method,
jobjectArray param_types, jclass return_type,
callconv_t calling_convention, jboolean direct) {
callconv_t calling_convention, jint options) {
jboolean direct = options & CB_OPTION_DIRECT;
jboolean in_dll = options & CB_OPTION_IN_DLL;
callback* cb;
ffi_abi abi = FFI_DEFAULT_ABI;
ffi_abi java_abi = FFI_DEFAULT_ABI;
@@ -60,6 +101,7 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
cb = (callback *)malloc(sizeof(callback));
cb->closure = ffi_closure_alloc(sizeof(ffi_closure), &cb->x_closure);
cb->saved_x_closure = cb->x_closure;
cb->object = (*env)->NewWeakGlobalRef(env, obj);
cb->methodID = (*env)->FromReflectedMethod(env, method);
@@ -81,6 +123,9 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
cb->arg_classes[i] = (*env)->NewWeakGlobalRef(env, cls);
cvt = 1;
}
else {
cb->arg_classes[i] = NULL;
}
jtype = get_jtype(env, cls);
if (jtype == -1) {
@@ -91,6 +136,9 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
}
cb->arg_jtypes[i] = (char)jtype;
cb->java_arg_types[i+3] = cb->arg_types[i] = get_ffi_type(env, cls, cb->arg_jtypes[i]);
if (!cb->java_arg_types[i+3]) {
goto failure_cleanup;
}
if (cb->flags[i] == CVT_NATIVE_MAPPED
|| cb->flags[i] == CVT_POINTER_TYPE
|| cb->flags[i] == CVT_INTEGER_TYPE) {
@@ -106,6 +154,9 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
cb->arg_jtypes[i] = (char)jtype;
cb->java_arg_types[i+3] = &ffi_type_pointer;
cb->arg_types[i] = get_ffi_type(env, ncls, cb->arg_jtypes[i]);
if (!cb->arg_types[i]) {
goto failure_cleanup;
}
}
if (cb->arg_types[i]->type == FFI_TYPE_FLOAT) {
@@ -138,6 +189,7 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
if (calling_convention == CALLCONV_STDCALL) {
abi = FFI_STDCALL;
}
// Calling into Java on win32 *always* uses stdcall
java_abi = FFI_STDCALL;
#endif // _WIN32
@@ -166,21 +218,39 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
rtype = '*';
}
switch(rtype) {
case 'V': cb->fptr = (*env)->CallVoidMethod; break;
case 'Z': cb->fptr = (*env)->CallBooleanMethod; break;
case 'B': cb->fptr = (*env)->CallByteMethod; break;
case 'S': cb->fptr = (*env)->CallShortMethod; break;
case 'C': cb->fptr = (*env)->CallCharMethod; break;
case 'I': cb->fptr = (*env)->CallIntMethod; break;
case 'J': cb->fptr = (*env)->CallLongMethod; break;
case 'F': cb->fptr = (*env)->CallFloatMethod; break;
case 'D': cb->fptr = (*env)->CallDoubleMethod; break;
default: cb->fptr = (*env)->CallObjectMethod; break;
#define OFFSETOF(ENV,METHOD) ((size_t)((char *)&(*(ENV))->METHOD - (char *)(*(ENV))))
case 'V': cb->fptr_offset = OFFSETOF(env, CallVoidMethod); break;
case 'Z': cb->fptr_offset = OFFSETOF(env, CallBooleanMethod); break;
case 'B': cb->fptr_offset = OFFSETOF(env, CallByteMethod); break;
case 'S': cb->fptr_offset = OFFSETOF(env, CallShortMethod); break;
case 'C': cb->fptr_offset = OFFSETOF(env, CallCharMethod); break;
case 'I': cb->fptr_offset = OFFSETOF(env, CallIntMethod); break;
case 'J': cb->fptr_offset = OFFSETOF(env, CallLongMethod); break;
case 'F': cb->fptr_offset = OFFSETOF(env, CallFloatMethod); break;
case 'D': cb->fptr_offset = OFFSETOF(env, CallDoubleMethod); break;
default: cb->fptr_offset = OFFSETOF(env, CallObjectMethod); break;
}
status = ffi_prep_cif(&cb->java_cif, java_abi, argc+3, java_ffi_rtype, cb->java_arg_types);
if (!ffi_error(env, "callback setup (2)", status)) {
ffi_prep_closure_loc(cb->closure, &cb->cif, callback_dispatch, cb,
cb->x_closure);
#ifdef DLL_FPTRS
// Find an available function pointer and assign it
if (in_dll) {
for (i=0;i < DLL_FPTRS;i++) {
if (fn[i] == NULL) {
fn[i] = cb->x_closure;
cb->x_closure = dll_fptrs[i];
break;
}
}
if (i == DLL_FPTRS) {
throw_type = EOutOfMemory;
throw_msg = "No more DLL callback slots available";
goto failure_cleanup;
}
}
#endif
return cb;
}
}
@@ -195,20 +265,31 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
}
void
free_callback(JNIEnv* env, callback *cb) {
int i;
(*env)->DeleteWeakGlobalRef(env, cb->object);
ffi_closure_free(cb->closure);
free(cb->arg_types);
if (cb->arg_classes) {
unsigned i;
for (i=0;i < cb->cif.nargs;i++) {
(*env)->DeleteWeakGlobalRef(env, cb->arg_classes[i]);
if (cb->arg_classes[i]) {
(*env)->DeleteWeakGlobalRef(env, cb->arg_classes[i]);
}
}
free(cb->arg_classes);
}
free(cb->java_arg_types);
if (cb->flags)
if (cb->flags) {
free(cb->flags);
}
free(cb->arg_jtypes);
#ifdef DLL_FPTRS
for (i=0;i < DLL_FPTRS;i++) {
if (fn[i] == cb->saved_x_closure) {
fn[i] = NULL;
}
}
#endif
free(cb);
}
@@ -269,36 +350,32 @@ callback_invoke(JNIEnv* env, callback *cb, ffi_cif* cif, void *resp, void **cbar
case CVT_INTEGER_TYPE:
case CVT_POINTER_TYPE:
case CVT_NATIVE_MAPPED:
*((void **)args[i+3]) = fromNative(env, cb->arg_classes[i], cif->arg_types[i], args[i+3], JNI_FALSE);
// Make sure we have space enough for the new argument
args[i+3] = alloca(sizeof(void *));
*((void **)args[i+3]) = fromNative(env, cb->arg_classes[i], cif->arg_types[i], cbargs[i], JNI_FALSE);
break;
case CVT_POINTER:
*((void **)args[i+3]) = newJavaPointer(env, *(void **)args[i+3]);
*((void **)args[i+3]) = newJavaPointer(env, *(void **)cbargs[i]);
break;
case CVT_STRING:
*((void **)args[i+3]) = newJavaString(env, *(void **)args[i+3], JNI_FALSE);
*((void **)args[i+3]) = newJavaString(env, *(void **)cbargs[i], JNI_FALSE);
break;
case CVT_WSTRING:
*((void **)args[i+3]) = newJavaWString(env, *(void **)args[i+3]);
*((void **)args[i+3]) = newJavaWString(env, *(void **)cbargs[i]);
break;
case CVT_STRUCTURE:
*((void **)args[i+3]) = newJavaStructure(env, *(void **)args[i+3], cb->arg_classes[i], JNI_FALSE);
*((void **)args[i+3]) = newJavaStructure(env, *(void **)cbargs[i], cb->arg_classes[i], JNI_FALSE);
break;
case CVT_STRUCTURE_BYVAL:
{
void *ptr = args[i+3];
args[i+3] = alloca(sizeof(void *));
*((void **)args[i+3]) = newJavaStructure(env, ptr, cb->arg_classes[i], JNI_TRUE);
}
args[i+3] = alloca(sizeof(void *));
*((void **)args[i+3]) = newJavaStructure(env, cbargs[i], cb->arg_classes[i], JNI_TRUE);
break;
case CVT_CALLBACK:
*((void **)args[i+3]) = newJavaCallback(env, *(void **)args[i+3], cb->arg_classes[i]);
*((void **)args[i+3]) = newJavaCallback(env, *(void **)cbargs[i], cb->arg_classes[i]);
break;
case CVT_FLOAT:
{
void *ptr = alloca(sizeof(double));
*(double *)ptr = *(float*)args[i+3];
args[i+3] = ptr;
}
args[i+3] = alloca(sizeof(double));
*((double *)args[i+3]) = *(float*)cbargs[i];
break;
}
}
@@ -310,15 +387,18 @@ callback_invoke(JNIEnv* env, callback *cb, ffi_cif* cif, void *resp, void **cbar
else if (cb->cif.rtype->size > cif->rtype->size) {
resp = alloca(cb->cif.rtype->size);
}
ffi_call(&cb->java_cif, FFI_FN(cb->fptr), resp, args);
#define FPTR(ENV,OFFSET) (*(void **)((char *)(*(ENV)) + OFFSET))
#define JNI_FN(X) ((void (*)(void))(X))
ffi_call(&cb->java_cif, JNI_FN(FPTR(env, cb->fptr_offset)), resp, args);
if ((*env)->ExceptionCheck(env)) {
jthrowable throwable = (*env)->ExceptionOccurred(env);
(*env)->ExceptionClear(env);
if (!handle_exception(env, self, throwable)) {
fprintf(stderr, "JNA: error handling callback exception, continuing\n");
}
if (cif->rtype->type != FFI_TYPE_VOID)
if (cif->rtype->type != FFI_TYPE_VOID) {
memset(oldresp, 0, cif->rtype->size);
}
}
else switch(cb->rflag) {
case CVT_INTEGER_TYPE:
@@ -360,7 +440,7 @@ callback_invoke(JNIEnv* env, callback *cb, ffi_cif* cif, void *resp, void **cbar
if (cb->flags) {
for (i=0;i < cif->nargs;i++) {
if (cb->flags[i] == CVT_STRUCTURE) {
writeStructure(env, *(void **)args[i+3]);
writeStructure(env, *(void **)cbargs[i]);
}
}
}
@@ -391,6 +471,67 @@ callback_invoke(JNIEnv* env, callback *cb, ffi_cif* cif, void *resp, void **cbar
}
}
// Handle automatic thread cleanup
static void detach_thread(void* data) {
if (data != NULL) {
JavaVM* jvm = (JavaVM *)data;
(*jvm)->DetachCurrentThread(jvm);
}
}
#ifdef _WIN32
static DWORD dwTlsIndex;
BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
dwTlsIndex = TlsAlloc();
if (dwTlsIndex == TLS_OUT_OF_INDEXES) {
return FALSE;
}
break;
case DLL_PROCESS_DETACH:
TlsFree(dwTlsIndex);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH: {
detach_thread(TlsGetValue(dwTlsIndex));
break;
}
default:
break;
}
return TRUE;
}
#else
#include <pthread.h>
static pthread_key_t key;
static void make_key() {
pthread_key_create(&key, detach_thread);
}
#endif
/** Set up to detach the thread when it exits, or clear any handlers if the
argument is NULL.
*/
static void
jvm_detach_on_exit(JavaVM* jvm) {
#ifdef _WIN32
TlsSetValue(dwTlsIndex, (void *)jvm);
#else
static pthread_once_t key_once = PTHREAD_ONCE_INIT;
pthread_once(&key_once, make_key);
if (!jvm || pthread_getspecific(key) == NULL) {
pthread_setspecific(key, jvm);
}
#endif
}
static void
callback_dispatch(ffi_cif* cif, void* resp, void** cbargs, void* user_data) {
callback* cb = ((callback *)user_data);
@@ -453,6 +594,10 @@ callback_dispatch(ffi_cif* cif, void* resp, void** cbargs, void* user_data) {
if (detach) {
(*jvm)->DetachCurrentThread(jvm);
jvm_detach_on_exit(NULL);
}
else if (!was_attached) {
jvm_detach_on_exit(jvm);
}
}
+26 -10
Ver Arquivo
@@ -6,12 +6,13 @@
#
nowarn="/wd4127 /wd4820 /wd4706 /wd4100 /wd4255 /wd4668"
args="/nologo /EHac /W3 /LD $nowarn" # /WX
args="/nologo /EHac /W3 $nowarn" # /WX
#md="/MD"
cl="cl"
ml="ml"
if [ -z "$INCLUDE" -o -z "$LIB" ]; then
if [ -z "$INCLUDE" -a -z "$Include" -o -z "$LIB" -a -z "$Lib" ]; then
exit "INCLUDE and LIB must be set for CL.EXE to function properly"
fi
@@ -35,18 +36,26 @@ do
shift 1
;;
-m32)
if echo $PATH | grep x64_amd64; then
if echo $PATH | grep amd64 >& /dev/null; then
echo "Wrong CL.EXE in path; use 32-bit version"
exit 1
fi
if echo $LIB | grep amd64 >& /dev/null; then
echo "Wrong paths in LIB; use 32-bit version"
exit 1
fi
ml=ml
shift 1
;;
-m64)
if ! echo $PATH | grep x64_amd64; then
if ! echo $PATH | grep amd64 >& /dev/null; then
echo "Wrong CL.EXE in path; use 64-bit version"
exit 1
fi
if ! echo $LIB | grep amd64 >& /dev/null; then
echo "Wrong paths in LIB; use 64-bit version"
exit 1
fi
ml=ml64
shift 1
;;
@@ -57,7 +66,7 @@ do
-g)
# using /RTC1 instead of /GZ
args="$args /Od /D_DEBUG /RTC1 /Zi"
md=/MDd
# md=/MDd
shift 1
;;
-c)
@@ -66,6 +75,10 @@ do
single=/c
shift 1
;;
-shared)
args="$args /LD"
shift 1
;;
-D*=*)
name="$(echo $1|sed 's/-D\([^=][^=]*\)=.*/\1/g')"
value="$(echo $1|sed 's/-D[^=][^=]*=//g')"
@@ -119,6 +132,9 @@ do
file=$(cygpath -m "$2")
outdir=$(dirname "$file")
base=$(basename "$file"|sed 's/\.[^.]*//g')
if [ -n "$assembly" ]; then
target="$file"
fi
if [ -n "$single" ]; then
output="/Fo$file"
else
@@ -134,8 +150,8 @@ do
*.S)
file=$(cygpath -m "$1")
src=$(echo $file|sed -e 's/.S$/.asm/g' -e 's%\\%/%g')
echo "$cl /EP $includes $defines \"$file\" > \"$src\""
"$cl" /nologo /EP $includes $defines "$file" > "$src" || exit $?
echo "$cl /nologo /EP $includes $defines \"$file\" > \"$src\""
eval "$cl /nologo /EP $includes $defines \"$file\"" > "$src" || exit $?
md=""
cl="$ml"
output=$(echo $output | sed 's%/F[dpa][^ ]*%%g')
@@ -161,12 +177,12 @@ do
done
args="$md $args"
echo "$cl $args (INCLUDE=$INCLUDE LIB=$LIB)"
eval "\"$cl\" $args"
echo "$cl $args"
eval "$cl $args"
result=$?
# @#!%@!# ml64 broken output
if [ -n "$assembly" ]; then
mv $src $outdir
mv *.obj $outdir
mv *.obj $target
fi
exit $result
+78 -43
Ver Arquivo
@@ -2,7 +2,7 @@
* @(#)dispatch.c 1.9 98/03/22
*
* Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2007-2011 Timothy Wall. All Rights Reserved.
* Copyright (c) 2007-2012 Timothy Wall. All Rights Reserved.
* Copyright (c) 2007 Wayne Meissner. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
@@ -16,11 +16,6 @@
* Lesser General Public License for more details.
*/
/*
* JNI native methods supporting the infrastructure for shared
* dispatchers.
*/
#if defined(_WIN32)
#ifdef _MSC_VER
#pragma warning( disable : 4201 ) /* nameless struct/union (jni_md.h) */
@@ -42,13 +37,13 @@
*/
#ifdef _WIN32_WCE
#include <tlhelp32.h>
#define LOAD_OPTS 0 /* altered search path unsupported on CE */
#define DEFAULT_LOAD_OPTS 0 /* altered search path unsupported on CE */
#undef GetProcAddress
#define GetProcAddress GetProcAddressA
#else
#define LOAD_OPTS LOAD_WITH_ALTERED_SEARCH_PATH
#define DEFAULT_LOAD_OPTS LOAD_WITH_ALTERED_SEARCH_PATH
#endif
#define LOAD_LIBRARY(NAME) (NAME ? LoadLibraryExW(NAME, NULL, LOAD_OPTS) : GetModuleHandleW(NULL))
#define LOAD_LIBRARY(NAME,OPTS) (NAME ? LoadLibraryExW(NAME, NULL, OPTS) : GetModuleHandleW(NULL))
#define LOAD_ERROR(BUF,LEN) w32_format_error(GetLastError(), BUF, LEN)
#define STR_ERROR(CODE,BUF,LEN) w32_format_error(CODE, BUF, LEN)
#define FREE_LIBRARY(HANDLE) (((HANDLE)==GetModuleHandleW(NULL) || FreeLibrary(HANDLE))?0:-1)
@@ -64,7 +59,8 @@
#else
#define NAME2CSTR(ENV,JSTR) newCString(ENV,JSTR)
#endif
#define LOAD_LIBRARY(NAME) dlopen(NAME, RTLD_LAZY|RTLD_GLOBAL)
#define DEFAULT_LOAD_OPTS (RTLD_LAZY|RTLD_GLOBAL)
#define LOAD_LIBRARY(NAME,OPTS) dlopen(NAME, OPTS)
#define LOAD_ERROR(BUF,LEN) (snprintf(BUF, LEN, "%s", dlerror()), BUF)
#define STR_ERROR(CODE,BUF,LEN) (strerror_r(CODE, BUF, LEN), BUF)
#define FREE_LIBRARY(HANDLE) dlclose(HANDLE)
@@ -76,7 +72,8 @@
#ifdef _AIX
#pragma alloca
#undef LOAD_LIBRARY
#define LOAD_LIBRARY(NAME) dlopen(NAME, RTLD_MEMBER| RTLD_LAZY | RTLD_GLOBAL)
#define DEFAULT_LOAD_OPTS (RTLD_MEMBER| RTLD_LAZY | RTLD_GLOBAL)
#define LOAD_LIBRARY(NAME,OPTS) dlopen(NAME, OPTS)
#endif
#include <stdlib.h>
@@ -91,6 +88,15 @@
#include "dispatch.h"
/* Native memory fault protection */
#ifdef HAVE_PROTECTION
#define PROTECT is_protected()
#endif
#include "protect.h"
#define ON_ERROR() throwByName(env, EError, "Invalid memory access")
#define PSTART() PROTECTED_START()
#define PEND() PROTECTED_END(ON_ERROR())
#ifdef HAVE_PROTECTION
static int _protect;
#undef PROTECT
@@ -98,7 +104,7 @@ static int _protect;
#endif
#ifdef __cplusplus
extern "C"
extern "C" {
#endif
#ifdef _WIN32
@@ -624,7 +630,6 @@ getChars(JNIEnv* env, wchar_t* volatile dst, jcharArray chars, volatile jint off
static void
setChars(JNIEnv* env, wchar_t* src, jcharArray chars, volatile jint off, volatile jint len) {
jchar* buf = (jchar*)src;
int malloced = 0;
PSTART();
if (sizeof(jchar) == sizeof(wchar_t)) {
@@ -826,13 +831,17 @@ newJavaStructure(JNIEnv *env, void *data, jclass type, jboolean new_memory)
volatile jobject obj = (*env)->CallStaticObjectMethod(env, classStructure, MID_Structure_newInstance, type);
if (obj != NULL) {
ffi_type* rtype = getStructureType(env, obj);
if (new_memory) {
MEMCPY(getStructureAddress(env, obj), data, rtype->size);
if (rtype) {
if (new_memory) {
MEMCPY(getStructureAddress(env, obj), data, rtype->size);
}
else {
(*env)->CallVoidMethod(env, obj, MID_Structure_useMemory, newJavaPointer(env, data));
}
if (!(*env)->ExceptionCheck(env)) {
(*env)->CallVoidMethod(env, obj, MID_Structure_read);
}
}
else {
(*env)->CallVoidMethod(env, obj, MID_Structure_useMemory, newJavaPointer(env, data));
}
(*env)->CallVoidMethod(env, obj, MID_Structure_read);
}
else {
fprintf(stderr, "JNA: failed to create structure\n");
@@ -860,7 +869,9 @@ getNativeString(JNIEnv* env, jstring s, jboolean wide) {
jobject ptr = (*env)->CallStaticObjectMethod(env, classCallbackReference,
MID_CallbackReference_getNativeString,
s, wide);
return getNativeAddress(env, ptr);
if (!(*env)->ExceptionCheck(env)) {
return getNativeAddress(env, ptr);
}
}
return NULL;
}
@@ -975,7 +986,9 @@ void *
getStructureAddress(JNIEnv *env, jobject obj) {
if (obj != NULL) {
jobject ptr = (*env)->GetObjectField(env, obj, FID_Structure_memory);
return getNativeAddress(env, ptr);
if (!(*env)->ExceptionCheck(env)) {
return getNativeAddress(env, ptr);
}
}
return NULL;
}
@@ -991,7 +1004,9 @@ void *
getCallbackAddress(JNIEnv *env, jobject obj) {
if (obj != NULL) {
jobject ptr = (*env)->CallStaticObjectMethod(env, classCallbackReference, MID_CallbackReference_getFunctionPointer, obj, JNI_TRUE);
return getNativeAddress(env, ptr);
if (!(*env)->ExceptionCheck(env)) {
return getNativeAddress(env, ptr);
}
}
return NULL;
}
@@ -1041,7 +1056,9 @@ void
toNative(JNIEnv* env, jobject obj, void* valuep, size_t size, jboolean promote) {
if (obj != NULL) {
jobject arg = (*env)->CallObjectMethod(env, obj, MID_NativeMapped_toNative);
extract_value(env, arg, valuep, size, promote);
if (!(*env)->ExceptionCheck(env)) {
extract_value(env, arg, valuep, size, promote);
}
}
else {
MEMSET(valuep, 0, size);
@@ -1052,7 +1069,9 @@ static void
toNativeTypeMapped(JNIEnv* env, jobject obj, void* valuep, size_t size, jobject to_native) {
if (obj != NULL) {
jobject arg = (*env)->CallStaticObjectMethod(env, classNative, MID_Native_toNativeTypeMapped, to_native, obj);
extract_value(env, arg, valuep, size, JNI_FALSE);
if (!(*env)->ExceptionCheck(env)) {
extract_value(env, arg, valuep, size, JNI_FALSE);
}
}
else {
MEMSET(valuep, 0, size);
@@ -1063,12 +1082,16 @@ static void
fromNativeTypeMapped(JNIEnv* env, jobject from_native, void* resp, ffi_type* type, jclass javaClass, void* result) {
int jtype = get_jtype_from_ffi_type(type);
jobject value = new_object(env, (char)jtype, resp, JNI_TRUE);
jobject obj = (*env)->CallStaticObjectMethod(env, classNative,
MID_Native_fromNativeTypeMapped,
from_native, value, javaClass);
// Must extract primitive types
if (type->type != FFI_TYPE_POINTER) {
extract_value(env, obj, result, type->size, JNI_TRUE);
if (!(*env)->ExceptionCheck(env)) {
jobject obj = (*env)->CallStaticObjectMethod(env, classNative,
MID_Native_fromNativeTypeMapped,
from_native, value, javaClass);
if (!(*env)->ExceptionCheck(env)) {
// Must extract primitive types
if (type->type != FFI_TYPE_POINTER) {
extract_value(env, obj, result, type->size, JNI_TRUE);
}
}
}
}
@@ -1076,9 +1099,12 @@ jobject
fromNative(JNIEnv* env, jclass javaClass, ffi_type* type, void* resp, jboolean promote) {
int jtype = get_jtype_from_ffi_type(type);
jobject value = new_object(env, (char)jtype, resp, promote);
return (*env)->CallStaticObjectMethod(env, classNative,
MID_Native_fromNative,
javaClass, value);
if (!(*env)->ExceptionCheck(env)) {
return (*env)->CallStaticObjectMethod(env, classNative,
MID_Native_fromNative,
javaClass, value);
}
return NULL;
}
@@ -1087,7 +1113,9 @@ getStructureType(JNIEnv *env, jobject obj) {
jlong typeInfo = (*env)->GetLongField(env, obj, FID_Structure_typeInfo);
if (!typeInfo) {
(*env)->CallObjectMethod(env, obj, MID_Structure_getTypeInfo);
typeInfo = (*env)->GetLongField(env, obj, FID_Structure_typeInfo);
if (!(*env)->ExceptionCheck(env)) {
typeInfo = (*env)->GetLongField(env, obj, FID_Structure_typeInfo);
}
}
return (ffi_type*)L2A(typeInfo);
}
@@ -1513,7 +1541,10 @@ get_ffi_type(JNIEnv* env, jclass cls, char jtype) {
case 's': {
jobject s = (*env)->CallStaticObjectMethod(env, classStructure,
MID_Structure_newInstance, cls);
return getStructureType(env, s);
if (s) {
return getStructureType(env, s);
}
return NULL;
}
case '*':
default:
@@ -1686,6 +1717,9 @@ method_handler(ffi_cif* cif, void* volatile resp, void** argp, void *cdata) {
break;
}
}
if ((*env)->ExceptionCheck(env)) {
goto cleanup;
}
}
if (data->rflag == CVT_NATIVE_MAPPED) {
@@ -1759,7 +1793,7 @@ method_handler(ffi_cif* cif, void* volatile resp, void** argp, void *cdata) {
for (i=0;i < data->cif.nargs;i++) {
switch(data->flags[i]) {
case CVT_STRUCTURE:
if (objects[i]) {
if (objects[i] && !(*env)->ExceptionCheck(env)) {
(*env)->CallVoidMethod(env, objects[i], MID_Structure_read);
}
break;
@@ -1960,9 +1994,10 @@ Java_com_sun_jna_Native_createNativeCallback(JNIEnv *env,
jobjectArray param_types,
jclass return_type,
jint call_conv,
jboolean direct) {
jint options) {
callback* cb =
create_callback(env, obj, method, param_types, return_type, call_conv, direct);
create_callback(env, obj, method, param_types, return_type,
call_conv, options);
return A2L(cb);
}
@@ -1977,10 +2012,10 @@ Java_com_sun_jna_Native_freeNativeCallback(JNIEnv *env,
/*
* Class: Native
* Method: open
* Signature: (Ljava/lang/String;)J
* Signature: (Ljava/lang/String;I)J
*/
JNIEXPORT jlong JNICALL
Java_com_sun_jna_Native_open(JNIEnv *env, jclass UNUSED(cls), jstring lib){
Java_com_sun_jna_Native_open(JNIEnv *env, jclass UNUSED(cls), jstring lib, jint flags){
/* dlopen on Unix allows NULL to mean "current process" */
const STRTYPE libname = NULL;
void *handle = NULL;
@@ -1991,7 +2026,7 @@ Java_com_sun_jna_Native_open(JNIEnv *env, jclass UNUSED(cls), jstring lib){
}
}
handle = (void *)LOAD_LIBRARY(libname);
handle = (void *)LOAD_LIBRARY(libname, flags != -1 ? flags : DEFAULT_LOAD_OPTS);
if (!handle) {
char buf[1024];
throwByName(env, EUnsatisfiedLink, LOAD_ERROR(buf, sizeof(buf)));
@@ -2814,7 +2849,7 @@ Java_com_sun_jna_Native_getWindowHandle0(JNIEnv *env, jclass UNUSED(classp), job
#undef JAWT_NAME
#define JAWT_NAME path
#endif
if ((jawt_handle = LOAD_LIBRARY(JAWT_NAME)) == NULL) {
if ((jawt_handle = LOAD_LIBRARY(JAWT_NAME, DEFAULT_LOAD_OPTS)) == NULL) {
char msg[1024];
throwByName(env, EUnsatisfiedLink, LOAD_ERROR(msg, sizeof(msg)));
return -1;
@@ -2949,8 +2984,8 @@ Java_com_sun_jna_Native_getPreserveLastError(JNIEnv *UNUSED(env), jclass UNUSED(
JNIEXPORT void JNICALL
Java_com_sun_jna_Native_setLastError(JNIEnv *env, jclass UNUSED(classp), jint code) {
SET_LAST_ERROR(code);
update_last_error(env, code);
SET_LAST_ERROR(code);
}
JNIEXPORT jstring JNICALL
+11 -2
Ver Arquivo
@@ -46,6 +46,9 @@
extern "C" {
#endif
#define CB_OPTION_DIRECT com_sun_jna_Native_CB_OPTION_DIRECT
#define CB_OPTION_IN_DLL com_sun_jna_Native_CB_OPTION_IN_DLL
/* These are the calling conventions an invocation can handle. */
typedef enum _callconv {
CALLCONV_C = com_sun_jna_Function_C_CONVENTION,
@@ -107,7 +110,8 @@ typedef struct _callback {
jmethodID methodID;
char* arg_jtypes;
jboolean direct;
void* fptr;
size_t fptr_offset;
void* saved_x_closure;
} callback;
#if defined(SOLARIS2) || defined(__GNUC__)
@@ -167,7 +171,7 @@ extern const char* jnidispatch_callback_init(JNIEnv*);
extern void jnidispatch_callback_dispose(JNIEnv*);
extern callback* create_callback(JNIEnv*, jobject, jobject,
jobjectArray, jclass,
callconv_t, jboolean);
callconv_t, jint);
extern void free_callback(JNIEnv*, callback*);
extern void extract_value(JNIEnv*, jobject, void*, size_t, jboolean);
extern jobject new_object(JNIEnv*, char, void*, jboolean);
@@ -200,6 +204,11 @@ extern jobject initializeThread(callback*,AttachOptions*);
extern int lastError();
extern void setLastError(int err);
#ifdef NO_WEAK_GLOBALS
#define NewWeakGlobalRef NewGlobalRef
#define DeleteWeakGlobalRef DeleteGlobalRef
#endif
/* Native memory fault protection */
#ifdef HAVE_PROTECTION
#define PROTECT is_protected()
+24
Ver Arquivo
@@ -0,0 +1,24 @@
/* Copyright (c) 2007-2012 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p/>
* This library 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
* Lesser General Public License for more details.
*/
/* Must use mingw64 to compile this assembly code. ml64 can't generate the
RIP-relative jumps we need.
*/
#define ASMFN(X) extern void asmfn ## X (); asm(".globl asmfn" #X "\n\
asmfn" #X ":\n\
jmp *fn+8*" #X "(%rip)")
#ifdef DEFINE_CALLBACKS
extern void (*fn[])();
ASMFN(0);ASMFN(1);ASMFN(2);ASMFN(3);ASMFN(4);ASMFN(5);ASMFN(6);ASMFN(7);
ASMFN(8);ASMFN(9);ASMFN(10);ASMFN(11);ASMFN(12);ASMFN(13);ASMFN(14);ASMFN(15);
#endif /* DEFINE_CALLBACKS */
+11 -3
Ver Arquivo
@@ -5,7 +5,7 @@
#args="/pdbtype:sept"
args="/nologo /opt:REF /incremental:no /subsystem:console /nodefaultlib:msvcrtd"
if [ -z "$LIB" ]; then
if [ -z "$LIB" -a "$Lib" ]; then
exit "LIB must be set for LINK.EXE to function properly"
fi
@@ -15,17 +15,25 @@ do
case $1
in
-m32)
if echo $PATH | grep x64_amd64; then
if echo $PATH | grep amd64; then
echo "Wrong LINK.EXE in path; use 32-bit version"
exit 1
fi
if echo $LIB | grep amd64; then
echo "Wrong paths in LIB; use 32-bit version"
exit 1
fi
shift 1
;;
-m64)
if ! echo $PATH | grep x64_amd64; then
if ! echo $PATH | grep amd64; then
echo "Wrong LINK.EXE in path; use 64-bit version"
exit 1
fi
if ! echo $LIB | grep amd64; then
echo "Wrong paths in LIB; use 64-bit version"
exit 1
fi
shift 1
;;
-g)
+23
Ver Arquivo
@@ -0,0 +1,23 @@
.libs
.deps
*.o
*.lo
.dirstamp
*.la
Makefile
config.log
config.status
*~
fficonfig.h
include/ffi.h
include/ffitarget.h
libffi.pc
libtool
stamp-h1
libffi*gz
autom4te.cache
libffi.xcodeproj/xcuserdata
libffi.xcodeproj/project.xcworkspace
ios/
osx/
build_*/
+1
Ver Arquivo
@@ -0,0 +1 @@
2
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
@@ -0,0 +1,457 @@
/* -----------------------------------------------------------------*-C-*-
libffi @VERSION@ - Copyright (c) 2011 Anthony Green
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the ``Software''), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
/* -------------------------------------------------------------------
The basic API is described in the README file.
The raw API is designed to bypass some of the argument packing
and unpacking on architectures for which it can be avoided.
The closure API allows interpreted functions to be packaged up
inside a C function pointer, so that they can be called as C functions,
with no understanding on the client side that they are interpreted.
It can also be used in other cases in which it is necessary to package
up a user specified parameter and a function pointer as a single
function pointer.
The closure API must be implemented in order to get its functionality,
e.g. for use by gij. Routines are provided to emulate the raw API
if the underlying platform doesn't allow faster implementation.
More details on the raw and cloure API can be found in:
http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
and
http://gcc.gnu.org/ml/java/1999-q3/msg00174.html
-------------------------------------------------------------------- */
#ifndef LIBFFI_H
#define LIBFFI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Specify which architecture libffi is configured for. */
#ifndef @TARGET@
#define @TARGET@
#endif
/* ---- System configuration information --------------------------------- */
#include <ffitarget.h>
#ifndef LIBFFI_ASM
#ifdef _MSC_VER
#define __attribute__(X)
#endif
#include <stddef.h>
#include <limits.h>
/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example).
But we can find it either under the correct ANSI name, or under GNU
C's internal name. */
#define FFI_64_BIT_MAX 9223372036854775807
#ifdef LONG_LONG_MAX
# define FFI_LONG_LONG_MAX LONG_LONG_MAX
#else
# ifdef LLONG_MAX
# define FFI_LONG_LONG_MAX LLONG_MAX
# ifdef _AIX52 /* or newer has C99 LLONG_MAX */
# undef FFI_64_BIT_MAX
# define FFI_64_BIT_MAX 9223372036854775807LL
# endif /* _AIX52 or newer */
# else
# ifdef __GNUC__
# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
# endif
# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */
# ifndef __PPC64__
# if defined (__IBMC__) || defined (__IBMCPP__)
# define FFI_LONG_LONG_MAX LONGLONG_MAX
# endif
# endif /* __PPC64__ */
# undef FFI_64_BIT_MAX
# define FFI_64_BIT_MAX 9223372036854775807LL
# endif
# endif
#endif
/* The closure code assumes that this works on pointers, i.e. a size_t */
/* can hold a pointer. */
typedef struct _ffi_type
{
size_t size;
unsigned short alignment;
unsigned short type;
struct _ffi_type **elements;
} ffi_type;
#ifndef LIBFFI_HIDE_BASIC_TYPES
#if SCHAR_MAX == 127
# define ffi_type_uchar ffi_type_uint8
# define ffi_type_schar ffi_type_sint8
#else
#error "char size not supported"
#endif
#if SHRT_MAX == 32767
# define ffi_type_ushort ffi_type_uint16
# define ffi_type_sshort ffi_type_sint16
#elif SHRT_MAX == 2147483647
# define ffi_type_ushort ffi_type_uint32
# define ffi_type_sshort ffi_type_sint32
#else
#error "short size not supported"
#endif
#if INT_MAX == 32767
# define ffi_type_uint ffi_type_uint16
# define ffi_type_sint ffi_type_sint16
#elif INT_MAX == 2147483647
# define ffi_type_uint ffi_type_uint32
# define ffi_type_sint ffi_type_sint32
#elif INT_MAX == 9223372036854775807
# define ffi_type_uint ffi_type_uint64
# define ffi_type_sint ffi_type_sint64
#else
#error "int size not supported"
#endif
#if LONG_MAX == 2147483647
# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX
#error "no 64-bit data type supported"
# endif
#elif LONG_MAX != FFI_64_BIT_MAX
#error "long size not supported"
#endif
#if LONG_MAX == 2147483647
# define ffi_type_ulong ffi_type_uint32
# define ffi_type_slong ffi_type_sint32
#elif LONG_MAX == FFI_64_BIT_MAX
# define ffi_type_ulong ffi_type_uint64
# define ffi_type_slong ffi_type_sint64
#else
#error "long size not supported"
#endif
/* Need minimal decorations for DLLs to works on Windows. */
/* GCC has autoimport and autoexport. Rely on Libtool to */
/* help MSVC export from a DLL, but always declare data */
/* to be imported for MSVC clients. This costs an extra */
/* indirection for MSVC clients using the static version */
/* of the library, but don't worry about that. Besides, */
/* as a workaround, they can define FFI_BUILDING if they */
/* *know* they are going to link with the static library. */
#if defined _MSC_VER && !defined FFI_BUILDING
#define FFI_EXTERN extern __declspec(dllimport)
#else
#define FFI_EXTERN extern
#endif
/* These are defined in types.c */
FFI_EXTERN ffi_type ffi_type_void;
FFI_EXTERN ffi_type ffi_type_uint8;
FFI_EXTERN ffi_type ffi_type_sint8;
FFI_EXTERN ffi_type ffi_type_uint16;
FFI_EXTERN ffi_type ffi_type_sint16;
FFI_EXTERN ffi_type ffi_type_uint32;
FFI_EXTERN ffi_type ffi_type_sint32;
FFI_EXTERN ffi_type ffi_type_uint64;
FFI_EXTERN ffi_type ffi_type_sint64;
FFI_EXTERN ffi_type ffi_type_float;
FFI_EXTERN ffi_type ffi_type_double;
FFI_EXTERN ffi_type ffi_type_pointer;
#if @HAVE_LONG_DOUBLE@
FFI_EXTERN ffi_type ffi_type_longdouble;
#else
#define ffi_type_longdouble ffi_type_double
#endif
#endif /* LIBFFI_HIDE_BASIC_TYPES */
typedef enum {
FFI_OK = 0,
FFI_BAD_TYPEDEF,
FFI_BAD_ABI
} ffi_status;
typedef unsigned FFI_TYPE;
typedef struct {
ffi_abi abi;
unsigned nargs;
ffi_type **arg_types;
ffi_type *rtype;
unsigned bytes;
unsigned flags;
#ifdef FFI_EXTRA_CIF_FIELDS
FFI_EXTRA_CIF_FIELDS;
#endif
} ffi_cif;
/* Used internally, but overridden by some architectures */
ffi_status ffi_prep_cif_core(ffi_cif *cif,
ffi_abi abi,
unsigned int isvariadic,
unsigned int nfixedargs,
unsigned int ntotalargs,
ffi_type *rtype,
ffi_type **atypes);
/* ---- Definitions for the raw API -------------------------------------- */
#ifndef FFI_SIZEOF_ARG
# if LONG_MAX == 2147483647
# define FFI_SIZEOF_ARG 4
# elif LONG_MAX == FFI_64_BIT_MAX
# define FFI_SIZEOF_ARG 8
# endif
#endif
#ifndef FFI_SIZEOF_JAVA_RAW
# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG
#endif
typedef union {
ffi_sarg sint;
ffi_arg uint;
float flt;
char data[FFI_SIZEOF_ARG];
void* ptr;
} ffi_raw;
#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8
/* This is a special case for mips64/n32 ABI (and perhaps others) where
sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */
typedef union {
signed int sint;
unsigned int uint;
float flt;
char data[FFI_SIZEOF_JAVA_RAW];
void* ptr;
} ffi_java_raw;
#else
typedef ffi_raw ffi_java_raw;
#endif
void ffi_raw_call (ffi_cif *cif,
void (*fn)(void),
void *rvalue,
ffi_raw *avalue);
void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
size_t ffi_raw_size (ffi_cif *cif);
/* This is analogous to the raw API, except it uses Java parameter */
/* packing, even on 64-bit machines. I.e. on 64-bit machines */
/* longs and doubles are followed by an empty 64-bit word. */
void ffi_java_raw_call (ffi_cif *cif,
void (*fn)(void),
void *rvalue,
ffi_java_raw *avalue);
void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
size_t ffi_java_raw_size (ffi_cif *cif);
/* ---- Definitions for closures ----------------------------------------- */
#if FFI_CLOSURES
#ifdef _MSC_VER
__declspec(align(8))
#endif
typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
void *user_data;
#ifdef __GNUC__
} ffi_closure __attribute__((aligned (8)));
#else
} ffi_closure;
# ifdef __sgi
# pragma pack 0
# endif
#endif
void *ffi_closure_alloc (size_t size, void **code);
void ffi_closure_free (void *);
ffi_status
ffi_prep_closure (ffi_closure*,
ffi_cif *,
void (*fun)(ffi_cif*,void*,void**,void*),
void *user_data);
ffi_status
ffi_prep_closure_loc (ffi_closure*,
ffi_cif *,
void (*fun)(ffi_cif*,void*,void**,void*),
void *user_data,
void*codeloc);
#ifdef __sgi
# pragma pack 8
#endif
typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif *cif;
#if !FFI_NATIVE_RAW_API
/* if this is enabled, then a raw closure has the same layout
as a regular closure. We use this to install an intermediate
handler to do the transaltion, void** -> ffi_raw*. */
void (*translate_args)(ffi_cif*,void*,void**,void*);
void *this_closure;
#endif
void (*fun)(ffi_cif*,void*,ffi_raw*,void*);
void *user_data;
} ffi_raw_closure;
typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif *cif;
#if !FFI_NATIVE_RAW_API
/* if this is enabled, then a raw closure has the same layout
as a regular closure. We use this to install an intermediate
handler to do the transaltion, void** -> ffi_raw*. */
void (*translate_args)(ffi_cif*,void*,void**,void*);
void *this_closure;
#endif
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*);
void *user_data;
} ffi_java_raw_closure;
ffi_status
ffi_prep_raw_closure (ffi_raw_closure*,
ffi_cif *cif,
void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
void *user_data);
ffi_status
ffi_prep_raw_closure_loc (ffi_raw_closure*,
ffi_cif *cif,
void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
void *user_data,
void *codeloc);
ffi_status
ffi_prep_java_raw_closure (ffi_java_raw_closure*,
ffi_cif *cif,
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
void *user_data);
ffi_status
ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
ffi_cif *cif,
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
void *user_data,
void *codeloc);
#endif /* FFI_CLOSURES */
/* ---- Public interface definition -------------------------------------- */
ffi_status ffi_prep_cif(ffi_cif *cif,
ffi_abi abi,
unsigned int nargs,
ffi_type *rtype,
ffi_type **atypes);
ffi_status ffi_prep_cif_var(ffi_cif *cif,
ffi_abi abi,
unsigned int nfixedargs,
unsigned int ntotalargs,
ffi_type *rtype,
ffi_type **atypes);
void ffi_call(ffi_cif *cif,
void (*fn)(void),
void *rvalue,
void **avalue);
/* Useful for eliminating compiler warnings */
#define FFI_FN(f) ((void (*)(void))f)
/* ---- Definitions shared with assembly code ---------------------------- */
#endif
/* If these change, update src/mips/ffitarget.h. */
#define FFI_TYPE_VOID 0
#define FFI_TYPE_INT 1
#define FFI_TYPE_FLOAT 2
#define FFI_TYPE_DOUBLE 3
#if @HAVE_LONG_DOUBLE@
#define FFI_TYPE_LONGDOUBLE 4
#else
#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
#endif
#define FFI_TYPE_UINT8 5
#define FFI_TYPE_SINT8 6
#define FFI_TYPE_UINT16 7
#define FFI_TYPE_SINT16 8
#define FFI_TYPE_UINT32 9
#define FFI_TYPE_SINT32 10
#define FFI_TYPE_UINT64 11
#define FFI_TYPE_SINT64 12
#define FFI_TYPE_STRUCT 13
#define FFI_TYPE_POINTER 14
/* This should always refer to the last type code (for sanity checks) */
#define FFI_TYPE_LAST FFI_TYPE_POINTER
#ifdef __cplusplus
}
#endif
#endif
+505
Ver Arquivo
@@ -0,0 +1,505 @@
/* -----------------------------------------------------------------------
sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
Copyright (c) 2011 Plausible Labs Cooperative, Inc.
ARM Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
``Software''), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h>
#ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h>
#else
#ifdef __USER_LABEL_PREFIX__
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
/* Use the right prefix for global labels. */
#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
#else
#define CNAME(x) x
#endif
#ifdef __APPLE__
#define ENTRY(x) .globl CNAME(x); CNAME(x):
#else
#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
#endif /* __APPLE__ */
#endif
#ifdef __ELF__
#define LSYM(x) .x
#else
#define LSYM(x) x
#endif
/* Use the SOFTFP return value ABI on Mac OS X, as per the iOS ABI
Function Call Guide */
#ifdef __APPLE__
#define __SOFTFP__
#endif
/* We need a better way of testing for this, but for now, this is all
we can do. */
@ This selects the minimum architecture level required.
#define __ARM_ARCH__ 3
#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
# undef __ARM_ARCH__
# define __ARM_ARCH__ 4
#endif
#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
|| defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
|| defined(__ARM_ARCH_5TEJ__)
# undef __ARM_ARCH__
# define __ARM_ARCH__ 5
#endif
#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
|| defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
|| defined(__ARM_ARCH_6M__)
# undef __ARM_ARCH__
# define __ARM_ARCH__ 6
#endif
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
|| defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7EM__)
# undef __ARM_ARCH__
# define __ARM_ARCH__ 7
#endif
#if __ARM_ARCH__ >= 5
# define call_reg(x) blx x
#elif defined (__ARM_ARCH_4T__)
# define call_reg(x) mov lr, pc ; bx x
# if defined(__thumb__) || defined(__THUMB_INTERWORK__)
# define __INTERWORKING__
# endif
#else
# define call_reg(x) mov lr, pc ; mov pc, x
#endif
/* Conditionally compile unwinder directives. */
#ifdef __ARM_EABI__
#define UNWIND
#else
#define UNWIND @
#endif
#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
.macro ARM_FUNC_START name
.text
.align 0
.thumb
.thumb_func
#ifdef __APPLE__
ENTRY($0)
#else
ENTRY(\name)
#endif
bx pc
nop
.arm
UNWIND .fnstart
/* A hook to tell gdb that we've switched to ARM mode. Also used to call
directly from other local arm routines. */
#ifdef __APPLE__
_L__$0:
#else
_L__\name:
#endif
.endm
#else
.macro ARM_FUNC_START name
.text
.align 0
.arm
#ifdef __APPLE__
ENTRY($0)
#else
ENTRY(\name)
#endif
UNWIND .fnstart
.endm
#endif
.macro RETLDM regs=, cond=, dirn=ia
#if defined (__INTERWORKING__)
.ifc "\regs",""
ldr\cond lr, [sp], #4
.else
ldm\cond\dirn sp!, {\regs, lr}
.endif
bx\cond lr
#else
.ifc "\regs",""
ldr\cond pc, [sp], #4
.else
ldm\cond\dirn sp!, {\regs, pc}
.endif
#endif
.endm
@ r0: ffi_prep_args
@ r1: &ecif
@ r2: cif->bytes
@ r3: fig->flags
@ sp+0: ecif.rvalue
@ This assumes we are using gas.
ARM_FUNC_START ffi_call_SYSV
@ Save registers
stmfd sp!, {r0-r3, fp, lr}
UNWIND .save {r0-r3, fp, lr}
mov fp, sp
UNWIND .setfp fp, sp
@ Make room for all of the new args.
sub sp, fp, r2
@ Place all of the ffi_prep_args in position
mov r0, sp
@ r1 already set
@ Call ffi_prep_args(stack, &ecif)
bl ffi_prep_args
@ move first 4 parameters in registers
ldmia sp, {r0-r3}
@ and adjust stack
sub lr, fp, sp @ cif->bytes == fp - sp
ldr ip, [fp] @ load fn() in advance
cmp lr, #16
movhs lr, #16
add sp, sp, lr
@ call (fn) (...)
call_reg(ip)
@ Remove the space we pushed for the args
mov sp, fp
@ Load r2 with the pointer to storage for the return value
ldr r2, [sp, #24]
@ Load r3 with the return type code
ldr r3, [sp, #12]
@ If the return value pointer is NULL, assume no return value.
cmp r2, #0
beq LSYM(Lepilogue)
@ return INT
cmp r3, #FFI_TYPE_INT
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
cmpne r3, #FFI_TYPE_FLOAT
#endif
streq r0, [r2]
beq LSYM(Lepilogue)
@ return INT64
cmp r3, #FFI_TYPE_SINT64
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
cmpne r3, #FFI_TYPE_DOUBLE
#endif
stmeqia r2, {r0, r1}
#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
beq LSYM(Lepilogue)
@ return FLOAT
cmp r3, #FFI_TYPE_FLOAT
stfeqs f0, [r2]
beq LSYM(Lepilogue)
@ return DOUBLE or LONGDOUBLE
cmp r3, #FFI_TYPE_DOUBLE
stfeqd f0, [r2]
#endif
LSYM(Lepilogue):
#if defined (__INTERWORKING__)
ldmia sp!, {r0-r3,fp, lr}
bx lr
#else
ldmia sp!, {r0-r3,fp, pc}
#endif
.ffi_call_SYSV_end:
UNWIND .fnend
#ifdef __ELF__
.size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
#endif
/*
unsigned int FFI_HIDDEN
ffi_closure_SYSV_inner (closure, respp, args)
ffi_closure *closure;
void **respp;
void *args;
*/
ARM_FUNC_START ffi_closure_SYSV
UNWIND .pad #16
add ip, sp, #16
stmfd sp!, {ip, lr}
UNWIND .save {r0, lr}
add r2, sp, #8
UNWIND .pad #16
sub sp, sp, #16
str sp, [sp, #8]
add r1, sp, #8
bl CNAME(ffi_closure_SYSV_inner)
cmp r0, #FFI_TYPE_INT
beq .Lretint
cmp r0, #FFI_TYPE_FLOAT
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretint
#else
beq .Lretfloat
#endif
cmp r0, #FFI_TYPE_DOUBLE
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretlonglong
#else
beq .Lretdouble
#endif
cmp r0, #FFI_TYPE_LONGDOUBLE
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
beq .Lretlonglong
#else
beq .Lretlongdouble
#endif
cmp r0, #FFI_TYPE_SINT64
beq .Lretlonglong
.Lclosure_epilogue:
add sp, sp, #16
ldmfd sp, {sp, pc}
.Lretint:
ldr r0, [sp]
b .Lclosure_epilogue
.Lretlonglong:
ldr r0, [sp]
ldr r1, [sp, #4]
b .Lclosure_epilogue
#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
.Lretfloat:
ldfs f0, [sp]
b .Lclosure_epilogue
.Lretdouble:
ldfd f0, [sp]
b .Lclosure_epilogue
.Lretlongdouble:
ldfd f0, [sp]
b .Lclosure_epilogue
#endif
.ffi_closure_SYSV_end:
UNWIND .fnend
#ifdef __ELF__
.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
#endif
/* Below are VFP hard-float ABI call and closure implementations.
Add VFP FPU directive here. This is only compiled into the library
under EABI. */
#ifdef __ARM_EABI__
.fpu vfp
@ r0: fn
@ r1: &ecif
@ r2: cif->bytes
@ r3: fig->flags
@ sp+0: ecif.rvalue
ARM_FUNC_START ffi_call_VFP
@ Save registers
stmfd sp!, {r0-r3, fp, lr}
UNWIND .save {r0-r3, fp, lr}
mov fp, sp
UNWIND .setfp fp, sp
@ Make room for all of the new args.
sub sp, sp, r2
@ Make room for loading VFP args
sub sp, sp, #64
@ Place all of the ffi_prep_args in position
mov r0, sp
@ r1 already set
sub r2, fp, #64 @ VFP scratch space
@ Call ffi_prep_args(stack, &ecif, vfp_space)
bl ffi_prep_args
@ Load VFP register args if needed
cmp r0, #0
beq LSYM(Lbase_args)
@ Load only d0 if possible
cmp r0, #3
sub ip, fp, #64
flddle d0, [ip]
fldmiadgt ip, {d0-d7}
LSYM(Lbase_args):
@ move first 4 parameters in registers
ldmia sp, {r0-r3}
@ and adjust stack
sub lr, ip, sp @ cif->bytes == (fp - 64) - sp
ldr ip, [fp] @ load fn() in advance
cmp lr, #16
movhs lr, #16
add sp, sp, lr
@ call (fn) (...)
call_reg(ip)
@ Remove the space we pushed for the args
mov sp, fp
@ Load r2 with the pointer to storage for
@ the return value
ldr r2, [sp, #24]
@ Load r3 with the return type code
ldr r3, [sp, #12]
@ If the return value pointer is NULL,
@ assume no return value.
cmp r2, #0
beq LSYM(Lepilogue_vfp)
cmp r3, #FFI_TYPE_INT
streq r0, [r2]
beq LSYM(Lepilogue_vfp)
cmp r3, #FFI_TYPE_SINT64
stmeqia r2, {r0, r1}
beq LSYM(Lepilogue_vfp)
cmp r3, #FFI_TYPE_FLOAT
fstseq s0, [r2]
beq LSYM(Lepilogue_vfp)
cmp r3, #FFI_TYPE_DOUBLE
fstdeq d0, [r2]
beq LSYM(Lepilogue_vfp)
cmp r3, #FFI_TYPE_STRUCT_VFP_FLOAT
cmpne r3, #FFI_TYPE_STRUCT_VFP_DOUBLE
fstmiadeq r2, {d0-d3}
LSYM(Lepilogue_vfp):
RETLDM "r0-r3,fp"
.ffi_call_VFP_end:
UNWIND .fnend
.size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
ARM_FUNC_START ffi_closure_VFP
fstmfdd sp!, {d0-d7}
@ r0-r3, then d0-d7
UNWIND .pad #80
add ip, sp, #80
stmfd sp!, {ip, lr}
UNWIND .save {r0, lr}
add r2, sp, #72
add r3, sp, #8
UNWIND .pad #72
sub sp, sp, #72
str sp, [sp, #64]
add r1, sp, #64
bl ffi_closure_SYSV_inner
cmp r0, #FFI_TYPE_INT
beq .Lretint_vfp
cmp r0, #FFI_TYPE_FLOAT
beq .Lretfloat_vfp
cmp r0, #FFI_TYPE_DOUBLE
cmpne r0, #FFI_TYPE_LONGDOUBLE
beq .Lretdouble_vfp
cmp r0, #FFI_TYPE_SINT64
beq .Lretlonglong_vfp
cmp r0, #FFI_TYPE_STRUCT_VFP_FLOAT
beq .Lretfloat_struct_vfp
cmp r0, #FFI_TYPE_STRUCT_VFP_DOUBLE
beq .Lretdouble_struct_vfp
.Lclosure_epilogue_vfp:
add sp, sp, #72
ldmfd sp, {sp, pc}
.Lretfloat_vfp:
flds s0, [sp]
b .Lclosure_epilogue_vfp
.Lretdouble_vfp:
fldd d0, [sp]
b .Lclosure_epilogue_vfp
.Lretint_vfp:
ldr r0, [sp]
b .Lclosure_epilogue_vfp
.Lretlonglong_vfp:
ldmia sp, {r0, r1}
b .Lclosure_epilogue_vfp
.Lretfloat_struct_vfp:
fldmiad sp, {d0-d1}
b .Lclosure_epilogue_vfp
.Lretdouble_struct_vfp:
fldmiad sp, {d0-d3}
b .Lclosure_epilogue_vfp
.ffi_closure_VFP_end:
UNWIND .fnend
.size CNAME(ffi_closure_VFP),.ffi_closure_VFP_end-CNAME(ffi_closure_VFP)
#endif
ENTRY(ffi_arm_trampoline)
stmfd sp!, {r0-r3}
ldr r0, [pc]
ldr pc, [pc]
#if defined __ELF__ && defined __linux__
.section .note.GNU-stack,"",%progbits
#endif
+841
Ver Arquivo
@@ -0,0 +1,841 @@
/* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc.
Copyright (c) 2002 Ranjit Mathew
Copyright (c) 2002 Bo Thorsen
Copyright (c) 2002 Roger Sayle
Copyright (C) 2008, 2010 Free Software Foundation, Inc.
x86 Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
``Software''), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#if !defined(__x86_64__) || defined(_WIN64)
#ifdef _WIN64
#include <windows.h>
#endif
#include <ffi.h>
#include <ffi_common.h>
#include <stdlib.h>
/* ffi_prep_args is called by the assembly routine once stack space
has been allocated for the function's arguments */
void ffi_prep_args(char *stack, extended_cif *ecif)
{
register unsigned int i;
register void **p_argv;
register char *argp;
register ffi_type **p_arg;
#ifdef X86_WIN32
size_t p_stack_args[2];
void *p_stack_data[2];
char *argp2 = stack;
int stack_args_count = 0;
int cabi = ecif->cif->abi;
#endif
argp = stack;
if ((ecif->cif->flags == FFI_TYPE_STRUCT
|| ecif->cif->flags == FFI_TYPE_MS_STRUCT)
#ifdef X86_WIN64
&& (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2
&& ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8)
#endif
)
{
*(void **) argp = ecif->rvalue;
#ifdef X86_WIN32
/* For fastcall/thiscall this is first register-passed
argument. */
if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
{
p_stack_args[stack_args_count] = sizeof (void*);
p_stack_data[stack_args_count] = argp;
++stack_args_count;
}
#endif
argp += sizeof(void*);
}
p_argv = ecif->avalue;
for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
i != 0;
i--, p_arg++)
{
size_t z;
/* Align if necessary */
if ((sizeof(void*) - 1) & (size_t) argp)
argp = (char *) ALIGN(argp, sizeof(void*));
z = (*p_arg)->size;
#ifdef X86_WIN64
if (z > sizeof(ffi_arg)
|| ((*p_arg)->type == FFI_TYPE_STRUCT
&& (z != 1 && z != 2 && z != 4 && z != 8))
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
|| ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
#endif
)
{
z = sizeof(ffi_arg);
*(void **)argp = *p_argv;
}
else if ((*p_arg)->type == FFI_TYPE_FLOAT)
{
memcpy(argp, *p_argv, z);
}
else
#endif
if (z < sizeof(ffi_arg))
{
z = sizeof(ffi_arg);
switch ((*p_arg)->type)
{
case FFI_TYPE_SINT8:
*(ffi_sarg *) argp = (ffi_sarg)*(SINT8 *)(* p_argv);
break;
case FFI_TYPE_UINT8:
*(ffi_arg *) argp = (ffi_arg)*(UINT8 *)(* p_argv);
break;
case FFI_TYPE_SINT16:
*(ffi_sarg *) argp = (ffi_sarg)*(SINT16 *)(* p_argv);
break;
case FFI_TYPE_UINT16:
*(ffi_arg *) argp = (ffi_arg)*(UINT16 *)(* p_argv);
break;
case FFI_TYPE_SINT32:
*(ffi_sarg *) argp = (ffi_sarg)*(SINT32 *)(* p_argv);
break;
case FFI_TYPE_UINT32:
*(ffi_arg *) argp = (ffi_arg)*(UINT32 *)(* p_argv);
break;
case FFI_TYPE_STRUCT:
*(ffi_arg *) argp = *(ffi_arg *)(* p_argv);
break;
default:
FFI_ASSERT(0);
}
}
else
{
memcpy(argp, *p_argv, z);
}
#ifdef X86_WIN32
/* For thiscall/fastcall convention register-passed arguments
are the first two none-floating-point arguments with a size
smaller or equal to sizeof (void*). */
if ((cabi == FFI_THISCALL && stack_args_count < 1)
|| (cabi == FFI_FASTCALL && stack_args_count < 2))
{
if (z <= 4
&& ((*p_arg)->type != FFI_TYPE_FLOAT
&& (*p_arg)->type != FFI_TYPE_STRUCT))
{
p_stack_args[stack_args_count] = z;
p_stack_data[stack_args_count] = argp;
++stack_args_count;
}
}
#endif
p_argv++;
#ifdef X86_WIN64
argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
#else
argp += z;
#endif
}
#ifdef X86_WIN32
/* We need to move the register-passed arguments for thiscall/fastcall
on top of stack, so that those can be moved to registers ecx/edx by
call-handler. */
if (stack_args_count > 0)
{
size_t zz = (p_stack_args[0] + 3) & ~3;
char *h;
/* Move first argument to top-stack position. */
if (p_stack_data[0] != argp2)
{
h = alloca (zz + 1);
memcpy (h, p_stack_data[0], zz);
memmove (argp2 + zz, argp2,
(size_t) ((char *) p_stack_data[0] - (char*)argp2));
memcpy (argp2, h, zz);
}
argp2 += zz;
--stack_args_count;
if (zz > 4)
stack_args_count = 0;
/* If we have a second argument, then move it on top
after the first one. */
if (stack_args_count > 0 && p_stack_data[1] != argp2)
{
zz = p_stack_args[1];
zz = (zz + 3) & ~3;
h = alloca (zz + 1);
h = alloca (zz + 1);
memcpy (h, p_stack_data[1], zz);
memmove (argp2 + zz, argp2, (size_t) ((char*) p_stack_data[1] - (char*)argp2));
memcpy (argp2, h, zz);
}
}
#endif
return;
}
/* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
{
unsigned int i;
ffi_type **ptr;
/* Set the return type flag */
switch (cif->rtype->type)
{
case FFI_TYPE_VOID:
case FFI_TYPE_UINT8:
case FFI_TYPE_UINT16:
case FFI_TYPE_SINT8:
case FFI_TYPE_SINT16:
#ifdef X86_WIN64
case FFI_TYPE_UINT32:
case FFI_TYPE_SINT32:
#endif
case FFI_TYPE_SINT64:
case FFI_TYPE_FLOAT:
case FFI_TYPE_DOUBLE:
#ifndef X86_WIN64
#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
case FFI_TYPE_LONGDOUBLE:
#endif
#endif
cif->flags = (unsigned) cif->rtype->type;
break;
case FFI_TYPE_UINT64:
#ifdef X86_WIN64
case FFI_TYPE_POINTER:
#endif
cif->flags = FFI_TYPE_SINT64;
break;
case FFI_TYPE_STRUCT:
#ifndef X86
if (cif->rtype->size == 1)
{
cif->flags = FFI_TYPE_SMALL_STRUCT_1B; /* same as char size */
}
else if (cif->rtype->size == 2)
{
cif->flags = FFI_TYPE_SMALL_STRUCT_2B; /* same as short size */
}
else if (cif->rtype->size == 4)
{
#ifdef X86_WIN64
cif->flags = FFI_TYPE_SMALL_STRUCT_4B;
#else
cif->flags = FFI_TYPE_INT; /* same as int type */
#endif
}
else if (cif->rtype->size == 8)
{
cif->flags = FFI_TYPE_SINT64; /* same as int64 type */
}
else
#endif
{
if (cif->abi == FFI_MS_CDECL)
cif->flags = FFI_TYPE_MS_STRUCT;
else
cif->flags = FFI_TYPE_STRUCT;
/* allocate space for return value pointer */
cif->bytes += ALIGN(sizeof(void*), FFI_SIZEOF_ARG);
}
break;
default:
#ifdef X86_WIN64
cif->flags = FFI_TYPE_SINT64;
break;
case FFI_TYPE_INT:
cif->flags = FFI_TYPE_SINT32;
#else
cif->flags = FFI_TYPE_INT;
#endif
break;
}
for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
{
if (((*ptr)->alignment - 1) & cif->bytes)
cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
}
#ifdef X86_WIN64
/* ensure space for storing four registers */
cif->bytes += 4 * sizeof(ffi_arg);
#endif
#ifdef X86_DARWIN
cif->bytes = (cif->bytes + 15) & ~0xF;
#endif
return FFI_OK;
}
#ifdef X86_WIN64
extern int
ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
unsigned, unsigned, unsigned *, void (*fn)(void));
#elif defined(X86_WIN32)
extern void
ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *,
unsigned, unsigned, unsigned, unsigned *, void (*fn)(void));
#else
extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
unsigned, unsigned, unsigned *, void (*fn)(void));
#endif
void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
extended_cif ecif;
ecif.cif = cif;
ecif.avalue = avalue;
/* If the return value is a struct and we don't have a return */
/* value address then we need to make one */
#ifdef X86_WIN64
if (rvalue == NULL
&& cif->flags == FFI_TYPE_STRUCT
&& cif->rtype->size != 1 && cif->rtype->size != 2
&& cif->rtype->size != 4 && cif->rtype->size != 8)
{
ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
}
#else
if (rvalue == NULL
&& (cif->flags == FFI_TYPE_STRUCT
|| cif->flags == FFI_TYPE_MS_STRUCT))
{
ecif.rvalue = alloca(cif->rtype->size);
}
#endif
else
ecif.rvalue = rvalue;
switch (cif->abi)
{
#ifdef X86_WIN64
case FFI_WIN64:
ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
cif->flags, ecif.rvalue, fn);
break;
#elif defined(X86_WIN32)
case FFI_SYSV:
case FFI_STDCALL:
case FFI_MS_CDECL:
ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
ecif.rvalue, fn);
break;
case FFI_THISCALL:
case FFI_FASTCALL:
{
unsigned int abi = cif->abi;
unsigned int i, passed_regs = 0;
if (cif->flags == FFI_TYPE_STRUCT)
++passed_regs;
for (i=0; i < cif->nargs && passed_regs < 2;i++)
{
size_t sz;
if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
|| cif->arg_types[i]->type == FFI_TYPE_STRUCT)
continue;
sz = (cif->arg_types[i]->size + 3) & ~3;
if (sz == 0 || sz > 4)
continue;
++passed_regs;
}
if (passed_regs < 2 && abi == FFI_FASTCALL)
abi = FFI_THISCALL;
if (passed_regs < 1 && abi == FFI_THISCALL)
abi = FFI_STDCALL;
ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags,
ecif.rvalue, fn);
}
break;
#else
case FFI_SYSV:
ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
fn);
break;
#endif
default:
FFI_ASSERT(0);
break;
}
}
/** private members **/
/* The following __attribute__((regparm(1))) decorations will have no effect
on MSVC - standard cdecl convention applies. */
static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
void** args, ffi_cif* cif);
void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *)
__attribute__ ((regparm(1)));
unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *)
__attribute__ ((regparm(1)));
void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *)
__attribute__ ((regparm(1)));
#ifdef X86_WIN32
void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *)
__attribute__ ((regparm(1)));
void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *)
__attribute__ ((regparm(1)));
void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *)
__attribute__ ((regparm(1)));
#endif
#ifdef X86_WIN64
void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
#endif
/* This function is jumped to by the trampoline */
#ifdef X86_WIN64
void * FFI_HIDDEN
ffi_closure_win64_inner (ffi_closure *closure, void *args) {
ffi_cif *cif;
void **arg_area;
void *result;
void *resp = &result;
cif = closure->cif;
arg_area = (void**) alloca (cif->nargs * sizeof (void*));
/* this call will initialize ARG_AREA, such that each
* element in that array points to the corresponding
* value on the stack; and if the function returns
* a structure, it will change RESP to point to the
* structure return address. */
ffi_prep_incoming_args_SYSV(args, &resp, arg_area, cif);
(closure->fun) (cif, resp, arg_area, closure->user_data);
/* The result is returned in rax. This does the right thing for
result types except for floats; we have to 'mov xmm0, rax' in the
caller to correct this.
TODO: structure sizes of 3 5 6 7 are returned by reference, too!!!
*/
return cif->rtype->size > sizeof(void *) ? resp : *(void **)resp;
}
#else
unsigned int FFI_HIDDEN __attribute__ ((regparm(1)))
ffi_closure_SYSV_inner (ffi_closure *closure, void **respp, void *args)
{
/* our various things... */
ffi_cif *cif;
void **arg_area;
cif = closure->cif;
arg_area = (void**) alloca (cif->nargs * sizeof (void*));
/* this call will initialize ARG_AREA, such that each
* element in that array points to the corresponding
* value on the stack; and if the function returns
* a structure, it will change RESP to point to the
* structure return address. */
ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
(closure->fun) (cif, *respp, arg_area, closure->user_data);
return cif->flags;
}
#endif /* !X86_WIN64 */
static void
ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
ffi_cif *cif)
{
register unsigned int i;
register void **p_argv;
register char *argp;
register ffi_type **p_arg;
argp = stack;
#ifdef X86_WIN64
if (cif->rtype->size > sizeof(ffi_arg)
|| (cif->flags == FFI_TYPE_STRUCT
&& (cif->rtype->size != 1 && cif->rtype->size != 2
&& cif->rtype->size != 4 && cif->rtype->size != 8))) {
*rvalue = *(void **) argp;
argp += sizeof(void *);
}
#else
if ( cif->flags == FFI_TYPE_STRUCT
|| cif->flags == FFI_TYPE_MS_STRUCT ) {
*rvalue = *(void **) argp;
argp += sizeof(void *);
}
#endif
p_argv = avalue;
for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
{
size_t z;
/* Align if necessary */
if ((sizeof(void*) - 1) & (size_t) argp) {
argp = (char *) ALIGN(argp, sizeof(void*));
}
#ifdef X86_WIN64
if ((*p_arg)->size > sizeof(ffi_arg)
|| ((*p_arg)->type == FFI_TYPE_STRUCT
&& ((*p_arg)->size != 1 && (*p_arg)->size != 2
&& (*p_arg)->size != 4 && (*p_arg)->size != 8)))
{
z = sizeof(void *);
*p_argv = *(void **)argp;
}
else
#endif
{
z = (*p_arg)->size;
/* because we're little endian, this is what it turns into. */
*p_argv = (void*) argp;
}
p_argv++;
#ifdef X86_WIN64
argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
#else
argp += z;
#endif
}
return;
}
#define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
void* __fun = (void*)(FUN); \
void* __ctx = (void*)(CTX); \
*(unsigned char*) &__tramp[0] = 0x41; \
*(unsigned char*) &__tramp[1] = 0xbb; \
*(unsigned int*) &__tramp[2] = MASK; /* mov $mask, %r11 */ \
*(unsigned char*) &__tramp[6] = 0x48; \
*(unsigned char*) &__tramp[7] = 0xb8; \
*(void**) &__tramp[8] = __ctx; /* mov __ctx, %rax */ \
*(unsigned char *) &__tramp[16] = 0x49; \
*(unsigned char *) &__tramp[17] = 0xba; \
*(void**) &__tramp[18] = __fun; /* mov __fun, %r10 */ \
*(unsigned char *) &__tramp[26] = 0x41; \
*(unsigned char *) &__tramp[27] = 0xff; \
*(unsigned char *) &__tramp[28] = 0xe2; /* jmp %r10 */ \
}
/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */
#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
unsigned int __fun = (unsigned int)(FUN); \
unsigned int __ctx = (unsigned int)(CTX); \
unsigned int __dis = __fun - (__ctx + 10); \
*(unsigned char*) &__tramp[0] = 0xb8; \
*(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
*(unsigned char *) &__tramp[5] = 0xe9; \
*(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \
}
#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
unsigned int __fun = (unsigned int)(FUN); \
unsigned int __ctx = (unsigned int)(CTX); \
unsigned int __dis = __fun - (__ctx + 49); \
unsigned short __size = (unsigned short)(SIZE); \
*(unsigned int *) &__tramp[0] = 0x8324048b; /* mov (%esp), %eax */ \
*(unsigned int *) &__tramp[4] = 0x4c890cec; /* sub $12, %esp */ \
*(unsigned int *) &__tramp[8] = 0x04890424; /* mov %ecx, 4(%esp) */ \
*(unsigned char*) &__tramp[12] = 0x24; /* mov %eax, (%esp) */ \
*(unsigned char*) &__tramp[13] = 0xb8; \
*(unsigned int *) &__tramp[14] = __size; /* mov __size, %eax */ \
*(unsigned int *) &__tramp[18] = 0x08244c8d; /* lea 8(%esp), %ecx */ \
*(unsigned int *) &__tramp[22] = 0x4802e8c1; /* shr $2, %eax ; dec %eax */ \
*(unsigned short*) &__tramp[26] = 0x0b74; /* jz 1f */ \
*(unsigned int *) &__tramp[28] = 0x8908518b; /* 2b: mov 8(%ecx), %edx */ \
*(unsigned int *) &__tramp[32] = 0x04c18311; /* mov %edx, (%ecx) ; add $4, %ecx */ \
*(unsigned char*) &__tramp[36] = 0x48; /* dec %eax */ \
*(unsigned short*) &__tramp[37] = 0xf575; /* jnz 2b ; 1f: */ \
*(unsigned char*) &__tramp[39] = 0xb8; \
*(unsigned int*) &__tramp[40] = __ctx; /* movl __ctx, %eax */ \
*(unsigned char *) &__tramp[44] = 0xe8; \
*(unsigned int*) &__tramp[45] = __dis; /* call __fun */ \
*(unsigned char*) &__tramp[49] = 0xc2; /* ret */ \
*(unsigned short*) &__tramp[50] = (__size + 8); /* ret (__size + 8) */ \
}
#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE) \
{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
unsigned int __fun = (unsigned int)(FUN); \
unsigned int __ctx = (unsigned int)(CTX); \
unsigned int __dis = __fun - (__ctx + 10); \
unsigned short __size = (unsigned short)(SIZE); \
*(unsigned char*) &__tramp[0] = 0xb8; \
*(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
*(unsigned char *) &__tramp[5] = 0xe8; \
*(unsigned int*) &__tramp[6] = __dis; /* call __fun */ \
*(unsigned char *) &__tramp[10] = 0xc2; \
*(unsigned short*) &__tramp[11] = __size; /* ret __size */ \
}
/* the cif must already be prep'ed */
ffi_status
ffi_prep_closure_loc (ffi_closure* closure,
ffi_cif* cif,
void (*fun)(ffi_cif*,void*,void**,void*),
void *user_data,
void *codeloc)
{
#ifdef X86_WIN64
#define ISFLOAT(IDX) (cif->arg_types[IDX]->type == FFI_TYPE_FLOAT || cif->arg_types[IDX]->type == FFI_TYPE_DOUBLE)
#define FLAG(IDX) (cif->nargs>(IDX)&&ISFLOAT(IDX)?(1<<(IDX)):0)
if (cif->abi == FFI_WIN64)
{
int mask = FLAG(0)|FLAG(1)|FLAG(2)|FLAG(3);
FFI_INIT_TRAMPOLINE_WIN64 (&closure->tramp[0],
&ffi_closure_win64,
codeloc, mask);
/* make sure we can execute here */
}
#else
if (cif->abi == FFI_SYSV)
{
FFI_INIT_TRAMPOLINE (&closure->tramp[0],
&ffi_closure_SYSV,
(void*)codeloc);
}
#ifdef X86_WIN32
else if (cif->abi == FFI_THISCALL)
{
FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0],
&ffi_closure_THISCALL,
(void*)codeloc,
cif->bytes);
}
else if (cif->abi == FFI_STDCALL)
{
FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
&ffi_closure_STDCALL,
(void*)codeloc, cif->bytes);
}
else if (cif->abi == FFI_MS_CDECL)
{
FFI_INIT_TRAMPOLINE (&closure->tramp[0],
&ffi_closure_SYSV,
(void*)codeloc);
}
#endif /* X86_WIN32 */
#endif /* !X86_WIN64 */
else
{
return FFI_BAD_ABI;
}
closure->cif = cif;
closure->user_data = user_data;
closure->fun = fun;
return FFI_OK;
}
/* ------- Native raw API support -------------------------------- */
#if !FFI_NO_RAW_API
ffi_status
ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
ffi_cif* cif,
void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
void *user_data,
void *codeloc)
{
int i;
if (cif->abi != FFI_SYSV) {
#ifdef X86_WIN32
if (cif->abi != FFI_THISCALL)
#endif
return FFI_BAD_ABI;
}
/* we currently don't support certain kinds of arguments for raw
closures. This should be implemented by a separate assembly
language routine, since it would require argument processing,
something we don't do now for performance. */
for (i = cif->nargs-1; i >= 0; i--)
{
FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT);
FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE);
}
#ifdef X86_WIN32
if (cif->abi == FFI_SYSV)
{
#endif
FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV,
codeloc);
#ifdef X86_WIN32
}
else if (cif->abi == FFI_THISCALL)
{
FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL,
codeloc, cif->bytes);
}
#endif
closure->cif = cif;
closure->user_data = user_data;
closure->fun = fun;
return FFI_OK;
}
static void
ffi_prep_args_raw(char *stack, extended_cif *ecif)
{
memcpy (stack, ecif->avalue, ecif->cif->bytes);
}
/* we borrow this routine from libffi (it must be changed, though, to
* actually call the function passed in the first argument. as of
* libffi-1.20, this is not the case.)
*/
void
ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
{
extended_cif ecif;
void **avalue = (void **)fake_avalue;
ecif.cif = cif;
ecif.avalue = avalue;
/* If the return value is a struct and we don't have a return */
/* value address then we need to make one */
if (rvalue == NULL
&& (cif->flags == FFI_TYPE_STRUCT
|| cif->flags == FFI_TYPE_MS_STRUCT))
{
ecif.rvalue = alloca(cif->rtype->size);
}
else
ecif.rvalue = rvalue;
switch (cif->abi)
{
#ifdef X86_WIN32
case FFI_SYSV:
case FFI_STDCALL:
case FFI_MS_CDECL:
ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
ecif.rvalue, fn);
break;
case FFI_THISCALL:
case FFI_FASTCALL:
{
unsigned int abi = cif->abi;
unsigned int i, passed_regs = 0;
if (cif->flags == FFI_TYPE_STRUCT)
++passed_regs;
for (i=0; i < cif->nargs && passed_regs < 2;i++)
{
size_t sz;
if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
|| cif->arg_types[i]->type == FFI_TYPE_STRUCT)
continue;
sz = (cif->arg_types[i]->size + 3) & ~3;
if (sz == 0 || sz > 4)
continue;
++passed_regs;
}
if (passed_regs < 2 && abi == FFI_FASTCALL)
cif->abi = abi = FFI_THISCALL;
if (passed_regs < 1 && abi == FFI_THISCALL)
cif->abi = abi = FFI_STDCALL;
ffi_call_win32(ffi_prep_args_raw, &ecif, abi, cif->bytes, cif->flags,
ecif.rvalue, fn);
}
break;
#else
case FFI_SYSV:
ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
ecif.rvalue, fn);
break;
#endif
default:
FFI_ASSERT(0);
break;
}
}
#endif
#endif /* !__x86_64__ || X86_WIN64 */
+21
Ver Arquivo
@@ -0,0 +1,21 @@
stand-alone
aix-fix
mint
win32
win32_tests
vararg_float_test_fix
vfp-eabi
msvc-changes
win32-return-sign
apple-fixes
dist-tests
icc128
x32libtool
arm-test-fix
xcode
darwin-missing-semi
xcode-improvements
update-disty
v3_0_11
bfin
ios-fix
@@ -0,0 +1,64 @@
/* Area: ffi_call, closure_call
Purpose: Test doubles passed in variable argument lists.
Limitations: none.
PR: none.
Originator: Blake Chaffin 6/6/2007 */
/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
/* { dg-output "" { xfail avr32*-*-* } } */
/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
/* { dg-skip-if "" arm*-*-* { "-mfloat-abi=hard" } { "" } } */
#include "ffitest.h"
static void
cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp,
void** args, void* userdata __UNUSED__)
{
char* format = *(char**)args[0];
double doubleValue = *(double*)args[1];
*(ffi_arg*)resp = printf(format, doubleValue);
}
int main (void)
{
ffi_cif cif;
void *code;
ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
void* args[3];
ffi_type* arg_types[3];
char* format = "%.1f\n";
double doubleArg = 7;
ffi_arg res = 0;
arg_types[0] = &ffi_type_pointer;
arg_types[1] = &ffi_type_double;
arg_types[2] = NULL;
/* This printf call is variadic */
CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
arg_types) == FFI_OK);
args[0] = &format;
args[1] = &doubleArg;
args[2] = NULL;
ffi_call(&cif, FFI_FN(printf), &res, args);
// { dg-output "7.0" }
printf("res: %d\n", (int) res);
// { dg-output "\nres: 4" }
/* The call to cls_double_va_fn is static, so have to use a normal prep_cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint, arg_types) == FFI_OK);
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, code) == FFI_OK);
res = ((int(*)(char*, double))(code))(format, doubleArg);
// { dg-output "\n7.0" }
printf("res: %d\n", (int) res);
// { dg-output "\nres: 4" }
exit(0);
}

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais