commit a235ae5dae463afa16f62f48bf62f896efa80b68 Author: Sven Gothel Date: Fri Aug 18 14:35:20 2023 +0200 Bump: 2.5.0 Release commit 8850b3d7f82ca5f1f828192407574581abd82ef9 Author: Sven Gothel Date: Mon Aug 14 04:27:37 2023 +0200 doc/GlueGen_Mapping.md: Fix GlueGen Manual read consideration ... commit 9250960f107cebbb4e6d3a55009b330f101453ea Author: Sven Gothel Date: Mon Aug 14 04:24:32 2023 +0200 Bug 1449: Fix link style in manual refs .. commit fd623305d90a88fd01dea3dccf6b9fe76b19703f Author: Sven Gothel Date: Mon Aug 14 04:22:25 2023 +0200 Bug 1449: Convert manual/index.html to `gfm` (GitHub-Flavored Markdown) using markdown -> manual/index.md and add conversion recipes + make/scripts/md2html_update.sh Noyte: Additionally edited 'doc/misc/macos_nativelib_dependencies.md` to include `Use explicit OpenJDK/Temurin JDK `java` executable path` as a workaround to pass `DYLD_LIBRARY_PATH` to `/usr/bin/java`. commit 9b825a445c3d2646546306c1815f498406e2f8c3 Author: Féry Mathieu (Mathius) Date: Sun Aug 13 23:27:46 2023 +0200 feat(manual): Update configuration documentation. Add following configuration : * CustomJNICode * ExtendedInterfaceSymbolsIgnore * ExtendedInterfaceSymbolsOnly * ExtendedImplementationSymbolsIgnore * ExtendedImplementationSymbolsOnly * ExtendedIntfAndImplSymbolsIgnore * ExtendedIntfAndImplSymbolsOnly * MaxOneElement * ParentClass * ReturnsStringOnly Update following configuration : * Extends commit 96632c220a25866ae3e2091d5d5f2bee0f631b63 Author: Sven Gothel Date: Sat Aug 12 16:20:46 2023 +0200 Bump JCPP: Use Unix '/' file separator in #line output for UNIFIED_OUTPUT commit b3dd6410aad591ddaec4eddfb8d894893368a54a Author: Sven Gothel Date: Thu Aug 10 11:08:58 2023 +0200 GlueGen: 'from expression' -> 'with expression' commit a7e62d106b1ba89d0973e5ccb00982e8ae8df9e4 Author: Sven Gothel Date: Thu Aug 10 11:01:55 2023 +0200 Bug 1450: TestCParser: Enable test10_cc() w/o JCPP commit 2ae7f2ea923aab662a0c273578456216bc8cd633 Author: Sven Gothel Date: Thu Aug 10 10:59:03 2023 +0200 Bug 1450: Add test snippets covering the issues: test2.h for Bindingtest2, TestJCPP and new TestCParser commit c30f0db4b785f21288f9cc5f7fd65393781d93c3 Author: Sven Gothel Date: Thu Aug 10 10:55:35 2023 +0200 Bug 1450: Be more verbose w/ JavaEmitter comment lines for enums and defines, include native expression commit 5b6e6af3932ece0c656cf4438100f4e213ea91b6 Author: Sven Gothel Date: Thu Aug 10 10:53:31 2023 +0200 Bug 1450: Widen ConstantDefinition.isConstantExpression() to include 'patternCPPOperand' i.e. all supported operands used for constant-expression of define macros. commit f8752c59945205b717c4b21ceeb4044ae9a0e9df Author: Sven Gothel Date: Thu Aug 10 10:47:22 2023 +0200 Bug 1450: Fix 'Number' rule, i.e. only consume positive numbers as `additiveExpr` and `unaryExpr` consume the '-' operator n GlueGen commit 10032c0115f2794a254cffc2a1cd5e48ca8ff0b8 in branch JOGL_2_SANDBOX Ken hacked in consuming a '-' prefix to have negative numbers covered by 'Number'. This is wrong, as it breaks deduction of `additiveExpr` and 'unaryExpr' rules, which want to consume '-' and '+'. The latter is used to completely resolve constant expressions starting from the 'constExpr' rule. See ISO 9899:202x Programming Language - C https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2596.pdf commit b5ec911572aa0c07228fcb02976a8e848cc90391 Author: Sven Gothel Date: Thu Aug 10 10:39:47 2023 +0200 ANTLR Syntax: Add debugging facility for GnuCParser.g and StdCParser.g commit 07c57a0d36c375f55e93f0caf7dd57e7c0afe271 Author: Sven Gothel Date: Tue Aug 8 22:31:23 2023 +0200 TestJCPP: Add recursive-include test and include a header file starting with '-' and in a subdir containing a '-' commit 239b00c26cc3f24b7d9e334de8ac1bee849e05b1 Author: Sven Gothel Date: Tue Aug 8 15:08:14 2023 +0200 Drop PCPP, GlueGen exclusively uses JCPP; Adopt test case Test{P->J}CPP commit 4c5f3d8e589016e17ac3f1aad6a5c26bc21efe2f Author: Sven Gothel Date: Tue Aug 8 14:33:56 2023 +0200 Bump jcpp (merged w/ jcpp upstream v1.4.14) and adopt to changes commit 496df9c41332a0d606017f0df5ba08b02af0c992 Author: Mathieu Féry Date: Tue Aug 8 11:31:46 2023 +0200 feat(generation): Fix generic parsing inside JavaParser.g to allow parsing of java callback implementation commit 4ab62d5121afec50dcb975fcfabefd838861da28 Author: Mathieu Féry Date: Tue Aug 8 11:33:29 2023 +0200 feat(generation): Fix CodeGenUtils.emitJavaHeaders When both classExtended and interfaces are specified for given class space missing between classExtended and implements keyword commit 0e6d18c6b6d46b54e679ce0c44613e21e58245f2 Author: Sven Gothel Date: Sat Aug 5 06:27:16 2023 +0200 JavaCallback: Add Mathieu Féry's detailed git comment regarding 2abb40b0ca9a6a06bdbe3e66b4235301ed15c693; Updated GlueGen_Mapping.md Original comment of commit 2abb40b0ca9a6a06bdbe3e66b4235301ed15c693 wip(test_case): Example of test case for issue related of 927bbc7160a812bb29c0e7120d4a3009bfb13bbf Revised comment taken from unmerged updated branch f6de3646acf0fdadf55708fd8a1c42fbd8663bc5 wip(test_case): Example of test case for issue related of 927bbc7160a812bb29c0e7120d4a3009bfb13bbf Some short summary of modifications : * Add tests with each emitters for test2, but tests are shared and run for each emitters * Update JavaParser.g to allow parsing of bindings generated after test2 processing * Add basic management of generic type (But not yet retrieved inside classTypeSpec args) * Add basic management of annotations (with or w/o parameter(s)) (Retrieved in statement, classes and interfaces but not used) * Align lexer constants in JavaParser.g * Update JavaParser.g to allow fetching all inner classes and inner interfaces to allow excluding by ExtendedInterfaceSymbolsIgnore * Modify JavaConfiguration::requiresJavaCallbackCode because all callback need to force generation not only callback without user param * Functions not generated w/o JavaConfiguration::requiresJavaCallbackCode : * SetLogCallBack12a * SetLogCallBack12b * MessageCallback11b * alBufferCallback0 commit 9555288019afaf7f1b9eb73e02fe0d899d633292 Author: Sven Gothel Date: Sat Aug 5 05:46:28 2023 +0200 Minor cleanup (includes, spacing) commit 287780236de7e3cea7ba826a76f720cf4501e4c0 Author: Sven Gothel Date: Sat Aug 5 05:18:59 2023 +0200 Add notes `Loading a MacOS Native Library's Dependencies` and use absolute path in unit test script for library-path commit 05a931d587feb3116892f5b146b3a4bb2867e923 Author: Sven Gothel Date: Sat Aug 5 03:21:37 2023 +0200 Cleanup unit test class names (pt3): Try to start w/ 'Test', remove intermediate 'Test' for supporting, non-test classes commit 0d3c2b630e06045013250547b3d0cb1bd9f99386 Author: Sven Gothel Date: Sat Aug 5 03:16:06 2023 +0200 Cleanup unit test class names (pt2): Try to start w/ 'Test', remove intermediate 'Test' for supporting, non-test classes commit 177ee444d1b86e6412f636d5f4e8f0695d418246 Author: Sven Gothel Date: Sat Aug 5 03:15:09 2023 +0200 Cleanup unit test class names: Try to start w/ 'Test', remove intermediate 'Test' for supporting, non-test classes commit f0da1ec6f5ac68de4c1ede1fd54a71b656fe5d75 Author: Sven Gothel Date: Sat Aug 5 02:24:17 2023 +0200 JavaConfiguration.requiresJavaCallbackCode() shall return true for all JavaCallback cases no just non-userParam case Additional body code for JavaCallback is required for methods it. commit 2e8b69496221f242fee762140418008a9a862d3d Author: Sven Gothel Date: Sat Aug 5 02:23:05 2023 +0200 GlueGen Code Unit Tests using a statically linked tool library do not need to load the tool library dynamically, hence dropped. Just ensure GlueGen itself is initializes via Platform.initSingleton() in common BaseClass commit 94c68465331b10f548727483437a3f3b575ee287 Author: Sven Gothel Date: Sat Aug 5 02:21:03 2023 +0200 WIP JavaCallback Tests: Fix Test4p2JavaCallback.chapter__TestLoadLibrary() issue loadBindingtest2p2() not loadBindingtest2p1() commit fbd065be8a5f36455a335c20549d729537f5d4b0 Author: Sven Gothel Date: Sat Aug 5 02:14:02 2023 +0200 WIP JavaCallback Tests: Fix typo in 'CustomJavaCode' Java class target name commit 06318d44c94c494fe6862ac8cf97fca799d05800 Author: Sven Gothel Date: Sat Aug 5 02:13:27 2023 +0200 WIP JavaCallback Tests: Fix: test2-CustomJavaImplCode.java.stub must be 'IncludeAs' for both implementations, Bindingtest2p1Impl and Bindingtest2p2Impl commit e52b7022e31022b92f4aaf5fb2e9457d767682c8 Author: Sven Gothel Date: Sat Aug 5 02:12:22 2023 +0200 WIP JavaCallback Tests: Fix: Link library Bindingtest2p1 against library test2 not test1 commit 8b4d36e543a14c404c73942840f15a4d81d83990 Author: Sven Gothel Date: Sat Aug 5 02:10:45 2023 +0200 WIP JavaCallback Tests: Rename test2-gluegen.cfg -> test2-if.cfg commit 4a8f15d29120e7744eca75f6d99bae6a7431749e Author: Sven Gothel Date: Fri Aug 4 20:02:23 2023 +0200 Revert "JavaCallback: Remove non-UserParam JavaConfiguration.requiresJavaCallbackCode()" This reverts commit 927bbc7160a812bb29c0e7120d4a3009bfb13bbf. commit 2abb40b0ca9a6a06bdbe3e66b4235301ed15c693 Author: Mathieu Féry Date: Fri Aug 4 19:37:14 2023 +0200 wip(test_case): Example of test case for issue related of 927bbc7160a812bb29c0e7120d4a3009bfb13bbf Almost done commit 9b0335ea91c39469b586b4005dfae35d4b2cc84b Author: Sven Gothel Date: Fri Aug 4 11:56:46 2023 +0200 doc/GlueGen_Mapping.md: Shorten UserParamIndex '<0' to disable 'UserParam' and produce html page commit 927bbc7160a812bb29c0e7120d4a3009bfb13bbf Author: Sven Gothel Date: Fri Aug 4 11:46:23 2023 +0200 JavaCallback: Remove non-UserParam JavaConfiguration.requiresJavaCallbackCode() Method was encapsulated in commit d4e8ecc3b4f68b86d95ec951971a0fea20217988 and questioned whether it is required. The non-userParam callback case adds no additional code requirements. Both, callback with and without userParam shares same code path and the respective native static fields. Only that the non-userParam code path adds additional native static fields, but all code sections are produced in both cases. Passed all unit tests. commit 3ad38748d7ef50a3631506eabcd3ae3417faa84d Author: Sven Gothel Date: Fri Aug 4 11:13:33 2023 +0200 JavaCallbackEmitter.emitJavaKeyClass(): Use directBufferAddress for compound types in equals and hashCode, i.e. use memory identity Use case is having a compound-type as userParam, which also acts as key, see MessageCallback13, Test4JavaCallback.chapter13(). The Java compound instance is re-created using the actual identical native memory (address), which has been stored or passed in the native toolkit. commit 1250d960d8bf2ee9ab8726a18a837115d6930815 Author: Sven Gothel Date: Fri Aug 4 11:03:48 2023 +0200 JavaEmitter.bindFunction(): Add JavaCallback userParam non-void case (i.e. 'String') Use case: String type as userParam, barely tested and not useful. However, let's pass through all cases in our code. Added LOG INFO for mapped types. commit 97b574914f7f961458f6668495c2fef70b910549 Author: Sven Gothel Date: Fri Aug 4 11:00:11 2023 +0200 CMethodBindingEmitter.emitBodyPassCArguments(): Either pass STRING_CHARS_PREFIX or javaCallbackEmitter.emitCOptArgumentSuffix(..) We only produce one variant in code. Use case: String type as userParam (barely tested and not useful) commit b08c61935daa0191f4ec59c6998bc56dae18e54d Author: Mathieu Féry Date: Fri Aug 4 10:50:10 2023 +0200 feat(callbackGenerator): Prevent generation of CallBack interface if setter related isn't present commit 3e249796e7b42033072aeda438d987601939db44 Author: Sven Gothel Date: Fri Aug 4 00:18:08 2023 +0200 Fix & Enhance Test4JavaCallback for non-userParam chapter12*: Fix ad-hoc compound equals and add chapter12b for additional parameter with different order - ad-hoc compound equals must compare value, since native code creates a new class instance from native struct - Add additional case with addition callback argument for further validation commit d4e8ecc3b4f68b86d95ec951971a0fea20217988 Author: Sven Gothel Date: Fri Aug 4 00:14:42 2023 +0200 JavaEmitter: Encapsulate 'needsJavaCallbackCode' query in JavaConfiguration. TBD: Is this even required? - needsIntermediateOperation -> needsJavaCallbackCode - Use JavaConfiguration.requiresJavaCallbackCode(..) TBD: Is this even required? As far as I see, the non-userParam callback case adds no additional code requirements. Both, callback with and without userParam shares same code path and the respective native static fields. Only that the non-userParam code path adds additional native static fields, but all code sections are produced in both cases. commit 88941c41dbb134984fd0857db9ea0729d9306bbb Author: Sven Gothel Date: Fri Aug 4 00:09:58 2023 +0200 JavaCallbackEmitter.emitCAdditionalCode(): Use `info.cbFuncBinding` locally and passed 'jcbFuncCMethodEmitter' only to invoke CMethodBindingEmitter.emitBodyMapCToJNIType(..) Passed 'jcbFuncCMethodEmitter' only used to access CMethodBindingEmitter.emitBodyMapCToJNIType(int, boolean), a non-ideal hack! (FIXME) General processing shall use the local `info.cbFuncBinding`. commit e729d53c8384757b6a5ada2491c7cd4ad07c8bfe Author: Sven Gothel Date: Fri Aug 4 00:07:36 2023 +0200 JavaCallbackEmitter.emitJavaCallbackBodyPassJavaArguments(): Drop redundant arg 'MethodBinding jcbFuncCMethodBinding', use local 'info.cbFuncBinding' Since emitJavaCallbackBodyPassJavaArguments() is private now, only use case is to handle info.cbFuncBinding and we can drop the redundant argument. Similar to cleanup commit e9a2294b3f18bb4c4f38347ccf347058cb4642b3 commit e9a2294b3f18bb4c4f38347ccf347058cb4642b3 Author: Sven Gothel Date: Thu Aug 3 23:57:54 2023 +0200 JavaCallbackEmitter.emitCSetFuncPreCall(): Drop redundant arg 'CMethodBindingEmitter jcbFuncCMethodEmitter', use local 'info.cbFuncBinding' Was added in commit ad69716fda64b517c33ed847c4b215ea398aac99 'callback without userData', while adding ad-hoc compound conversion. commit a51c63b8b054eec3393d4c340cf3cefe561a01b1 Author: Sven Gothel Date: Thu Aug 3 23:35:49 2023 +0200 JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode, emitJavaCallbackBodyPassJavaArguments}(): Fix exclusion of ad-hoc compound conversion for userParam Passed CMethodBindingEmitter denotes the callback-function, including the binding. The new iteration to handle the ad-hoc compound conversion, introduced in commit ad69716fda64b517c33ed847c4b215ea398aac99 'callback without userData', iterates over the callback-function argument list. Hence it shall only exclude the ad-hoc compound conversion if index != info.cbFuncUserParamIdx. Dropping the addition exclusion 'i != info.setFuncUserParamIdx'. commit 711533cef82cab317662e84f1d1719bdbeca4253 Author: Sven Gothel Date: Thu Aug 3 21:23:28 2023 +0200 JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode, emitJavaCallbackBodyPassJavaArguments}(): Use capitalized sub-string 'baseArgName' for (static) callback related entities commit 910ce385d5e56eeb1fd7f81678042f19f76b1870 Author: Sven Gothel Date: Thu Aug 3 21:18:36 2023 +0200 JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode}(): Group 'userParamDefined' case (cleanup) commit 1e78cc429f148aa200ae487bacb6d4a9b6b7c8d9 Author: Sven Gothel Date: Thu Aug 3 21:16:24 2023 +0200 CMethodBindingEmitter.emitBodyMapCToJNIType(..): Add proper intendation to NIO ByteBuffer generation (isNIOBuffer || isCompoundTypeWrapper) commit 9bf13be7d8a144be18dd313e8ed7658f25b9c1d0 Author: Mathieu Féry Date: Thu Aug 3 13:30:20 2023 +0200 feat(arrayAccessor): Allow to use ReturnedArrayLength with getter associated with field with name in PascalCase or camelCase commit 165e3b87b2d3abbb83e9fe5421ac63931b41c793 Author: Mathieu Féry Date: Tue Aug 1 18:35:54 2023 +0200 doc/GlueGen_Mapping.md: Add some documentation with JavaCallback without userData commit ad69716fda64b517c33ed847c4b215ea398aac99 Author: Mathieu Féry Date: Mon Jul 31 17:25:41 2023 +0200 feat(callbackGenerator): Add basic management of callback without userData commit 380969bbf0b7746ab245b7d7d177243092fb2c34 Author: Mathieu Féry Date: Mon Jul 31 17:22:54 2023 +0200 feat(generation): Add setter generation for not constant and not opaque compound attribute commit fe21c87b24842d67df686b7c48fa36ed65a9afc9 Author: Sven Gothel Date: Mon Jul 10 21:03:28 2023 +0200 doc/GlueGen_Mapping.md: Using 'UserParamClass' .. grammar (3 commits for 1 discount today) Cough cough .. should have reviewed the whole thing once. Must be the summer distraction causing premature commits. Sorry about that :) commit a03df850033d11386471534840a83bbac81304df Author: Sven Gothel Date: Mon Jul 10 20:51:35 2023 +0200 doc/GlueGen_Mapping.md: Typos 'UserParam' -> 'UserParamClass' (2 more occassions) commit 60277196f721875a4114e065fdf1ba24521811be Author: Sven Gothel Date: Mon Jul 10 20:47:14 2023 +0200 doc/GlueGen_Mapping.md: Typos 'UserParam' -> 'UserParamClass' commit 0ea6688e41c31b0e2c8dba73582c935562885b44 Author: Sven Gothel Date: Mon Jul 10 16:39:36 2023 +0200 GlueGen JavaCallback: Add optional custom 'Callback-UserParamClass` for non-compound `UserParam` types to have more clarity in resulting API commit 63ed5f7676bc46ee03db1a6d27c5ce86fcf6a597 Author: Sven Gothel Date: Sat Jul 8 02:08:44 2023 +0200 Manual: Fix ArgumentIsPascalString commit 701311d6fc507b1e21681dd60c6851fbc50c2304 Author: Sven Gothel Date: Sat Jul 8 01:43:47 2023 +0200 GlueGen JavaCallback: Add capability to have UserParam as (part of) key Resolves use case where UserParam reflects e.g. a context (AL_SOFT_events) and will be (part of) the key mapping. Implementation required an additional userParamID -> userParam mapping for default Object/ID usage. Added 2 test cases. commit 4267e223e33acdc098cc5b4371765f8e31b96eff Author: Sven Gothel Date: Thu Jul 6 11:42:06 2023 +0200 GlueGen JavaCallback Doc: Remove reasoning (avoiding ambiguity) to CallbackFunction parameter index commit 3ed3e9887c459169b807165c9df2ae2bc2990a31 Author: Sven Gothel Date: Thu Jul 6 10:35:30 2023 +0200 GlueGen JavaCallback: Remove ambiguity: Config JavaCallbackDef/JavaCallbackKey: Always define both parameter indices; emitJavaStaticCallback(): Use cbFuncBinding and cbFuncKeyIndices from callback parameter to build key commit 5b867d0f90a43a02e1fbd03fb1ed588a391806eb Author: Sven Gothel Date: Wed Jul 5 11:41:26 2023 +0200 GlueGen JavaCallback: Fix `staticCBClazz*` initial setup (only), using a NewGlobalRef() for jclass (not required for static jmethodID) Also use a longer jclass argument name 'clazz' -> 'staticCBClazz' to avoid potential collisions commit 56d3cbcf7a6a6f83706962dd24846906fa2bb420 Author: Sven Gothel Date: Wed Jul 5 11:32:56 2023 +0200 Manual: Refine `ArgumentIsPascalString` commit 5ceca8550b82591a6a2661a26d3e0d5e6e3e15ff Author: Sven Gothel Date: Wed Jul 5 10:21:48 2023 +0200 GlueGen: Add 'PascalString' string semantics (length + value-ptr), added prelim code for JavaCallback use-case emitBodyMapCToJNIType() It is common in toolkit APIs that a string might not be passed as a 'nul' terminated (EOS) C string, but as a Pascal string with a given length argument. A C string is specied as ArgumentIsString alEventCallbackInject 3 while allowing multiple indices .. A Pascal string can be specified as ArgumentIsPascalString ALEVENTPROCSOFT 3 4 while allowing multiple indice-tuples for length and value .. The tuple consist of the length agrument-index first (usually an int) followed by the value argument-index (usually a 'char*'). +++ CMethodBindingEmitter.emitBodyMapCToJNIType(), where PascalString is implemented, is currently being used for - JNI return statement (no PascalString impact possible) - JavaCallback C type -> JNI type, PascalString impacting commit ae4c2c3e59ed92caa6f0e18360b7236e50899bf6 Author: Sven Gothel Date: Wed Jul 5 10:04:16 2023 +0200 GlueGen JavaCallback/LibraryOnLoad: Always include the `libraryBasename` agnostic 'emitJNIEnvDecl()' (declaration) in JNI code; Detach the thread from the JVM if newly attach in callback! commit 0c4067379e5e12617b9a4530e607ca34762b54e3 Author: Sven Gothel Date: Tue Jul 4 12:49:55 2023 +0200 doc/GlueGen_Mapping.md: Quote `void*` correctly .. commit 8cc90ef6a61b9686cc287bf34a3fcba924276c01 Author: Sven Gothel Date: Tue Jul 4 12:22:51 2023 +0200 GlueGen JavaType.appendDescriptor(..): Fix regression: Must return a vanilla descriptor ('/' not '_') i.e. non JNI method-name descriptor to avoid double conversion commit a599b852a041ba3d80b43981589ac1390979dac2 Author: Sven Gothel Date: Tue Jul 4 11:36:29 2023 +0200 GlueGen JavaCallback: Revised: Static Java callback dispatcher, dropping native heap, support Struct UserParam ... Implementation now generates a static Java callback dispatcher for each defined SetCallbackFunction, which gets invoked by the generated native static counterpart with all arguments required. The static callback utilizes its own synchronization for thread-safety and fetches the required data set stored at SetCallbackFunction to dispatch the call to the users' CallbackFunction. In case the callback has been removed already, the static callback simply bails out quietly. The native code does not create, release or manage heap memory and therefore is considered safe. +++ Further Struct Type UserParam are now supported including Heterogeneous UserParam mapping (read GlueGen_Mapping.*). +++ Cleaned up code by extracting all JavaCallback emitter code into JavaCallbackEmitter class in one place, leaving JavaMethodbindingEmitter and CMethodbindingEmitter mostly in their original stage (non-convoluted). In this regard, I had to refactor a few function, i.e. moving CMethodbindingEmitter.getJNIMangledArg(..) into JavaType.appendDescriptor(..) and JavaType.appendJNIDescriptor(..) while reusing the toJNIMethodDescriptor(..) conversion. Test4JavaCallback covers and passes all cases. commit 6d53b4b1dd07006e7af0e540b2c2e6ee6e1746d5 Author: Sven Gothel Date: Sun Jul 2 14:26:04 2023 +0200 GlueGen JavaCallback: Unify native 'T_JavaCallbackGlueData' typedef struct commit 9b9aa128d92e9512cb00559e99dce9c8de726ed7 Author: Sven Gothel Date: Sun Jul 2 13:54:16 2023 +0200 GlueGen JavaCallback: CMethodBindingEmitter: Check, describe & clear exception if occurring - we must assume async off-thread source in general Covered by unit tests now commit 88346aae69cc12c7f6932152697a854039517aa7 Author: Sven Gothel Date: Sun Jul 2 13:52:55 2023 +0200 GlueGen JavaCallback: CMethodBindingEmitter: Check lockObj for NULL before GetObjectRefType(), avoid certain (older) Hotspot issues commit 3ee4a042aee86657128b834dad553baf83834612 Author: Sven Gothel Date: Sun Jul 2 13:52:07 2023 +0200 CMethodBindingEmitter JavaCallback: Use a friendly readable basename for errors commit e999ece8b0cd2ec440314f9a4c20812c694991ae Author: Sven Gothel Date: Sun Jul 2 05:34:13 2023 +0200 GlueGen Struct [18]: Drop redundant 'static get*ElemCount() { return 1 }` for: isPrimitive && !isPointer && staticElemCount && maxOneElement commit 1caceb4e72b2e99c5c458d37ebced0c51fe6bb70 Author: Sven Gothel Date: Sun Jul 2 05:32:44 2023 +0200 GlueGen JavaCallback: Native Callback: Reduce 'look-ahead' of read-after-free to critical lockObj only commit 98dca8cd3cffd3f9dc1c920bbe8e6349877447b7 Author: Sven Gothel Date: Sun Jul 2 03:58:20 2023 +0200 GlueGen JavaCallback: Document native callback use-after-free potential (caught), zero-mem @ release commit 760fb65d1d65fcac927e28de442f3b9bfd3d58f0 Author: Sven Gothel Date: Sun Jul 2 00:19:01 2023 +0200 doc/GlueGen_Mapping.md: Typo commit be2d31199f95ddbfa02530a021c8ab9611018f27 Author: Sven Gothel Date: Sun Jul 2 00:17:02 2023 +0200 GlueGen JavaCallback: Emphasize all methods are thread-safe commit 679ce37046c3c68b97e56fb70ea7b316e9dba3ad Author: Sven Gothel Date: Sun Jul 2 00:12:58 2023 +0200 GlueGen JavaCallback: Native callback: Check ObjectRef validity and synchronize (MonitorEnter/Exit) with same Object of Java impl. -> thread safe commit df0895828e957d97f38510da36eade7a60691d96 Author: Sven Gothel Date: Sat Jul 1 19:23:14 2023 +0200 GlueGen JavaCallback: Use `SetCallback-KeyClass` if manually specified, even if no keys are defined! commit 8766fcfdce4dd864fe6764b063a0f9a4b17327c1 Author: Sven Gothel Date: Sat Jul 1 18:57:37 2023 +0200 GlueGen JavaCallback: Only produce default 'Key' class if keys are used, expose 'Key' to public and use it. Expose release*() and get*Keys() methods Further we use a dedicated lock Object used in the Java implementation. TODO: Native static callback dispatch code shall - (also) acquire the lock - handle case where the data has been released already to render this solution thread-safe and data-race free commit 6200b9122a90ef8c2af8b9205b4b1c90b1aa5074 Author: Sven Gothel Date: Sat Jul 1 11:45:31 2023 +0200 GlueGen JavaCallback: Release the associated data (natively) only after the actual toolkit setCallback call .. to avoid a potential race condition commit dd5829a4fed25fbad766361b87c65076ef596ded Author: Sven Gothel Date: Sat Jul 1 02:50:18 2023 +0200 GlueGen Intro: Add section about its comprehensive runtime library, shorten the JNI_OnLoad section commit a73c992290930e617c78241bae9fe20cb18a01a9 Author: Sven Gothel Date: Fri Jun 30 11:36:33 2023 +0200 GlueGen JavaCallback: Resolve key mapping of callback and associated resources via 'JavaCallbackKey' config and custom `SetCallback-KeyClass` Updated unit test and doc accordingly. Unit tests handle OpenAL's AL_SOFT_callback_buffer and AL_SOFT_events. Tested global scope (no key, default) and 1 key (default) and 1 key (custom class). Added more query functions, which all only take the `SetCallbackFunction` key arguments as specified. Cleaned up JavaCallback* config class field naminig scheme. Added 'synchronized (..Map) { }' block in crucial `SetCallbackFunction`, rendering implementation thread safe. commit b35d62425311ec50e6c80b07372bc411aa287bb4 Author: Sven Gothel Date: Fri Jun 30 09:41:21 2023 +0200 GlueGen FunctionType/MethodBinding: get*ParameterList(): Use a more flexible way via a ParameterConsumer visitor, also usable for other iterative parameter generator commit ad79dae90b94d0875416278e9dcedfc08a1de578 Author: Sven Gothel Date: Thu Jun 29 23:33:03 2023 +0200 Eclipse classpath commit e898caec411fc2f313aabc188a22099e26664080 Author: Sven Gothel Date: Thu Jun 29 04:50:50 2023 +0200 Test4JavaCallback: Just rename myUserParam -> myUserParam01 for future tests.. commit 4e9d0edc3810d36ffe1660e6ac17d1dc547ea7d7 Author: Sven Gothel Date: Thu Jun 29 04:48:42 2023 +0200 GlueGen JavaCallback: Set-Callback: Ensure a previously mapped 'userParam' instance is released before binding new one; Add test changing callback function. commit 0298341f71f43f4011a40e955bd5e99cbd798597 Author: Sven Gothel Date: Thu Jun 29 04:16:23 2023 +0200 README.md: Fix links commit d5304ac167fc406f682730c40fef2c880a44672e Author: Sven Gothel Date: Thu Jun 29 04:10:44 2023 +0200 Doc intro: Fix LibraryOnLoad using generic LibraryBasename commit dc5061e2d31f01a875b27e722835e2e8cfa67c88 Author: Sven Gothel Date: Thu Jun 29 04:07:45 2023 +0200 Doc: www/index.html: Fix JOGL UML link commit fb86a3c6f68f3788b02a8e8209a697f50c25dc19 Author: Sven Gothel Date: Thu Jun 29 04:05:29 2023 +0200 Doc: Align GlueGen_Mapping.md intro w/ README.md and www/index.html commit 6591f1fef419841660311bbb554aeda7b267c9a7 Author: Sven Gothel Date: Thu Jun 29 03:50:12 2023 +0200 GlueGen JavaCallback: 1st Working Draft: Changed 'JavaCallbackDef' config, added code generation incl. native to Java dispatch and resource management Tested via Test4JavaCallback.java (using test2.[hc]). Please read the GlueGen_Mapping.md as well as Test4JavaCallback.java . +++ Some implementation details: JavaConfiguration maps JavaCallbackDef to JavaCallback set-function and maintains a list. JavaCallbackDef itself holds all configured details. JavaConfiguration also maps JavaCallbackInfo to JavaCallback set-function. JavaCallbackInfo itself holds all compile time information, as produced by JavaEmitter.beginFunctions(..). This extends JavaCallbackDef and avoid repetetive computation for the callback-function-type and its MethodBinding, parameter indices for the callback interface and userParam, etc. CMethodBindingEmitter: Native callback to Java dispatch - The JavaCallback setter function creates a native 'UserParam' struct instance, which holds the callback-interface-jobject, its callback-jmethodID and the userParam-jobject for invocation of the actual JavaCallback interface method. - To produce the C-Type -> JNI-Type conversion, An internal CMethodBindingEmitter instance for the native-callback function binding is created inside the CMethodBindingEmitter of the callback setter method. It is being used to map the types to JNI within the generated native callback function, passed to the actual JavaCallback method. JavaMethodBindingEmitter: Native callback to Java dispatch - The JavaCallbacl setter passes the callback-interface-object, the userParam-object and the callback-method-signature (to have the native method retrieve the jmethodID). - It receives the native pointer of the native `UserParam` struct instance, which gets mapped to the userParam-object. (*TODO: Refine ownership + release*). commit 1d66739e09899cb90888c8fe34aba339511aa656 Author: Sven Gothel Date: Thu Jun 29 03:05:00 2023 +0200 GlueGen ProcAddressCMethodBindingEmitter.jniMangle() override: Only add additional params if produced name containes '__', i.e. JNI mangled parameter commit a83dad9963b394ac3e7bb193c6da7d9a5004a40e Author: Sven Gothel Date: Thu Jun 29 03:03:30 2023 +0200 GlueGen FunctionType: Factor out getParameterList(..) from toString(..) and drop 'void' and use typedef-name; MethodBinding: Add getCParameterList(..) and getJavaParameterList(..) for general usage similar to FunctionType.getParameterList() commit 809a7f84fcada7fbde8b7d0c226b78492fbfc616 Author: Sven Gothel Date: Thu Jun 29 02:35:01 2023 +0200 GlueGen CMethodBindingEmitter: Refactor emitBodyReturnResult() -> emitBodyMapCToJNIType(): Reuse to converting any C-type argument to java JNI type (i.e. native callback to JavaCallback) commit a1b107dd3fbe2070a1e667d8d7702912b0af7071 Author: Sven Gothel Date: Thu Jun 29 02:24:58 2023 +0200 GlueGen: Move [de]captializeString(..) JavaEmitter -> static in CodeGenUtils commit ce542531f4cb6fe2bf37f3926ea869722e5acf7d Author: Sven Gothel Date: Thu Jun 29 02:18:18 2023 +0200 GlueGen LibraryOnLoad Config: Generate `JNI_OnLoad(..)` for dynamic and `JNI_OnLoad_(..)` for static libraries and `JVMUtil_GetJNIEnv(..)` to resolve the `JNIEnv*` as used by JavaCallback commit 9f69f8b60b9fdc80076e20f303252ddd35b97ccf Author: Sven Gothel Date: Thu Jun 29 02:11:00 2023 +0200 GlueGen doc/GlueGen_Mapping.md: Mentiond OO-Style API mapping and add section for it commit 9be1305636daa633a7219e102b22a4ffcf277690 Author: Sven Gothel Date: Thu Jun 29 02:06:00 2023 +0200 GlueGen Struct [17]: Handle void pointers, i.e. `void*`, within a struct as `Opaque` configured pointer-types .. includes cross-ref'ed doc and unit test commit 58712fb3a386ca6327b71218bab6e4b218da36a8 Author: Sven Gothel Date: Mon Jun 26 11:18:52 2023 +0200 GlueGen JavaCallback: Add JavaCallback.methodSignature to JNI arg-list and pass value at invocation, allowing to find the jmethodID of callback commit 4d884db4e08ce9911871d3bdcf378041cde584fd Author: Sven Gothel Date: Mon Jun 26 11:17:22 2023 +0200 GlueGen JavaCallback: Move JavaCallback into JavaConfiguration, accessible across *Emitter (needed for CMethodEmitter as well); Add JavaCallback.methodSignature to be passed to native function later on to find the callback jmethodID commit 68911f778039bbf08b5afbffd536b4cdacd33032 Author: Sven Gothel Date: Mon Jun 26 04:09:19 2023 +0200 GlueGen JavaCallback: Expose getJNIMethodDescriptor() for JNI mangled method names, used in CMethodBindingEmitter; Use JavaCallback's function-pointer-type capital-name as simple-class-name and its FQN for JNI resolution. commit 93c63bd880b6bc8a85a0057112b5065b312af1db Author: Sven Gothel Date: Mon Jun 26 03:14:59 2023 +0200 GlueGen JavaCallback: Use new JavaType nature 'named-class', denoting the generated callback interface mapping the callback function. This passes the jobject for the callback function/interface and the userParam (from 'void*') down to the native implementation. TODO: Add specific native implementation for JavaCallback, wrapping the jobject's into a native struct as user-param and a universal C-function as the native callback to dispatch the call to the java method with known arguments. commit 90b86c62270c494d2422dabc2879e59e063b535c Author: Sven Gothel Date: Mon Jun 26 03:11:09 2023 +0200 GlueGen JavaType: Add new nature 'String clazzName': Future (not yet generated or existing) Class objects (existing at runtime) New nature can be queried via isNamedClass(). Cleaned up equals() and completed hashValue() etc. Ctor validation ensures exactly one nature is set! commit ed49b01838f3c07fa7a997b1f758ce2c983f49f7 Author: Sven Gothel Date: Sun Jun 25 08:03:53 2023 +0200 GlueGen JavaCallback: Add more related documentation commit 5a130ab0c6db44225692e362e41e7b45481f9392 Author: Sven Gothel Date: Sun Jun 25 08:03:23 2023 +0200 GlueGen JavaCallback: Add preliminary implementation (WIP): Produces proper interfaces, TODO implementation Note: JavaCallbackDef is commented out on test2.cfg example, since implementation is missing. commit 7caf66ccae2dea53b82fb6552cb9144d4146259f Author: Sven Gothel Date: Sun Jun 25 08:01:30 2023 +0200 GlueGen JavaConfiguration: Add List stringArguments(final AliasedSymbol symbol) commit 15ed242971142e0726e60271172266515533e1f4 Author: Sven Gothel Date: Sun Jun 25 08:01:00 2023 +0200 GlueGen JavaConfiguration: Add 'JavaCallbackDef [user-param-idx]' Define a JavaCallback, enacted on a function-pointer argument `T2_CallbackFunc` and a user-param `void*` for Java Object mapping Example: JavaCallbackDef T2_CallbackFunc 2 commit b9bddbd7a75e7fa9812fdcc455a0c4857c3e9990 Author: Sven Gothel Date: Sun Jun 25 07:52:53 2023 +0200 GlueGen FunctionSymbol: Simplify ctor reusing main-ctor; Be always reachable via type(def)name, ctor: addAliasedName( type.getCName() ) commit c54c5699c752fcf2cee19ef9dc21cd4acb5aa6cd Author: Sven Gothel Date: Sun Jun 25 07:51:24 2023 +0200 GlueGen Add JavaType.forObjectClass() commit d55eab966968dfff6eac0db0445a0dbfbfb96240 Author: Sven Gothel Date: Sun Jun 25 07:46:31 2023 +0200 GlueGen FunctionType: Expose toString(..) w/ 'isPointer' argument commit 42a1f8c8bdb34242f422d24c4ad1d67a1e7ffd25 Author: Sven Gothel Date: Sun Jun 25 07:45:56 2023 +0200 GlueGen: Fix Type.getSignature(..): Test for isFunctionPointer() to elaborate on FunctionType as getTargetType() only retruns a function-ptr and no more a function-type. commit fd1c691c2e11e1dcfc6f84143e5152c5cd14b45b Author: Sven Gothel Date: Sun Jun 25 07:43:50 2023 +0200 JavaEmitter.generateArrayGetterSetterCode(): Place elemCountExpr null check where it could occur -> non-opaque, non-primitive array case commit 069c5f69d22c8979728149a51a089b52712cac5c Author: Sven Gothel Date: Sun Jun 25 07:41:41 2023 +0200 GlueGen: Add JavaEmitter(JavaConfiguration) ctor commit 12ed5d03a26997c185474e992ad93ec99ec3baa1 Author: Sven Gothel Date: Sun Jun 25 07:40:38 2023 +0200 GlueGen Fix ProcAddressCMethodBindingEmitter.jniMangle(..) override: Use renamed {jniMangle->getJNIMangledArg}(..) commit 7a4a0aea28729eabf1d44f58b0cfa4255f160992 Author: Sven Gothel Date: Sun Jun 25 07:37:53 2023 +0200 GlueGen: Rename GlueEmitter.getConfig{uration->}() and drop JavaEmitter.getConfig(), cleaning up API usage commit 69d9f10bb1c99cba53869f2b019d5227446622e2 Author: Sven Gothel Date: Sun Jun 25 07:32:42 2023 +0200 GlueGen: Expose CMethodBindingEmitter.getJNIMangledArgs() as a public static to be reusable commit 23f4c6347ea24cf619dba573e83790e73d81d5ad Author: Sven Gothel Date: Fri Jun 23 07:09:24 2023 +0200 GlueGen Struct [16]: Add support for pointer-pointer and function-pointer values See documentation and unit test test2.h, Test2FuncPtr.java and Test3PtrStorage.java commit 829d69ca42d2022790b136a5f689c34919a7c775 Author: Sven Gothel Date: Fri Jun 23 06:34:46 2023 +0200 GlueGen: JavaConfiguration.promoteTypeInfo(): Fix primitive pointerDepth, i.e. only pass numPointersStripped w/o adding info.pointerDepth() commit 10842e888d1367475019f33bc651671453b31bd2 Author: Sven Gothel Date: Fri Jun 23 06:33:36 2023 +0200 GlueGen: JavaConfiguration.typeInfo(..): Clarify DEBUG_TYPE_INFO output commit 9e61409658358834c2ba26c69c3efcbb5755c128 Author: Sven Gothel Date: Fri Jun 23 06:31:56 2023 +0200 GlueGen: Type: Have get{Base,Target}Type() stop at isFunctionPointer(), enhance API doc; Add getArrayBaseOrPointerTargetType() and getTargetFunction() Added getArrayBaseOrPointerTargetType() returns getBaseType() for arrays or getTargetType() for pointer, i.e. stops traversing if an elementType is a pointer and returns the elementType as target-type. This resolves 'int* intPtrArray[10]', but also simplifies all cases of 'int** intPtrPtr' and 'int intPtr[10]' etc. Since get{Base,Target}Type() returns the functionPointer, getTargetFunction() allows to retrieve the actual target function type. commit f90a42bd693ab9d451902e69ad86359fae2510dc Author: Sven Gothel Date: Fri Jun 23 06:18:37 2023 +0200 GlueGen: Type, JavaType: Align getSignature(..) output commit 3f50232fae03c65d7d84a6ca1e2a7b83cefde6ae Author: Sven Gothel Date: Fri Jun 23 06:17:31 2023 +0200 NIO NativeBuffer, {Element,Pointer}Buffer: Add limit, clear and flip; Arrange wrap/deref arguments equal; Add equal set of absolute get/set methods Completing API to simplify usage by generated code. All absolute get/set method check arguments itself and against limit(), allow to drop checks in generated code (size). commit df5b63babeec8a9de0ab22a917bbd6c192a2ac0f Author: Sven Gothel Date: Fri Jun 23 06:12:51 2023 +0200 GlueGen Test: Test2 -> Test2FuncPtr commit 10433928d69e58dc6a6b99e9c0a9b0a2669db56a Author: Sven Gothel Date: Wed Jun 21 05:51:38 2023 +0200 JavaEmitter.typeToJavaTypeImpl(): Add targetType in GlueGenException and remove '"' in message commit 3d6003fcada35d91c0d865ad0f4edb1da3ed8b8d Author: Sven Gothel Date: Tue Jun 20 20:31:02 2023 +0200 GlueGen junit test2.h: Add an anonymous struct pointer w/ opaque long config commit 65e9c14e1566d5bfa88435d460c699c2a8fd23b7 Author: Sven Gothel Date: Tue Jun 20 11:24:12 2023 +0200 GlueGen Struct [15b]: FunctionPointer: Drop isNull() -> use get() commit b9dc722d689760bf85628edd8766dc6cd2360c8e Author: Sven Gothel Date: Tue Jun 20 04:02:12 2023 +0200 GlueGen Struct [15]: Add FunctionPointer getter and setter support w/ documentation commit f7f554208c024280f1929df79bdbb83c758b8b49 Author: Sven Gothel Date: Tue Jun 20 03:58:42 2023 +0200 doc/GlueGen_Mapping.md: Place `Struct Setter Pseudo-Code` above 'Signature Table' and add a brief signature to mapping description to the former commit 32db4ef66cacc4a6f01bd6b36f8cda96acb7ed38 Author: Sven Gothel Date: Mon Jun 19 15:18:42 2023 +0200 GlueGen Type: Use virt getTargetType() for ArrayType dropping getElementType(); Rename getBase{Elem ->}Type() to align with getTargetType() commit 49e5000347543559867a45f1d1b330b6086d7a32 Author: Sven Gothel Date: Sun Jun 18 22:16:37 2023 +0200 Doc: Manual: Adding disclaimer being slightly outdated and hint to GlueGen_Mapping document commit f783788e21f40a4a429221dad416a79586429eb4 Author: Sven Gothel Date: Sun Jun 18 22:06:08 2023 +0200 www/index.html: Copy Documentation section into main text for visibility commit b08c609647f6280ddcd1329c40da1fe23d34c4e6 Author: Sven Gothel Date: Sun Jun 18 22:02:34 2023 +0200 GlueGen Struct [14]: Update doc/GlueGen_Mapping.md Completing a few cases and fix some signatures in table commit b939d0e0555b0fe0e3609d6d867941b9aacf0e6f Author: Sven Gothel Date: Sun Jun 18 19:55:28 2023 +0200 CPP Enable Pragma Once: Remove cli '--enablePragmaOnce' option as it is enabled by default commit fd8ebf543ecc16233c0027c5a38701c11be548c7 Author: Féry Mathieu (Mathius) Date: Sun Jun 18 07:01:30 2023 +0200 fix(cli): Fix disablePragmaOnce option Option set enablePragmaOnce to true instead false commit 6aec5c5274d0ffb6662fdc53671b58df23850d89 Author: Sven Gothel Date: Sun Jun 18 05:29:14 2023 +0200 CustomJNICode: Add missing (separated) test1p1-CustomJNICode.c.stub commit 195bf966e4946ee9e80cd7aec68685218ad7a777 Author: Sven Gothel Date: Sun Jun 18 05:27:41 2023 +0200 CustomJNICode: Fix/complete commit d7bc10d7ff0e3a30d74c4e4c439230f3983bcfb4: Add emitCustomJNICode(..) for JavaEmitter.endFunctions() not just structs and fix the JNI-c stub code commit 7825c4c053e0755e5dc0aa20127914887efa75e4 Author: Sven Gothel Date: Sun Jun 18 04:33:54 2023 +0200 CPP Enable Pragma Once: Default is 'true', since usually all compiler and APIs do support this feature commit 1159dadbdca861e4a6dd47e9da3ccb47ec15f4a3 Author: Sven Gothel Date: Sun Jun 18 04:32:58 2023 +0200 CPP Enable Pragma Once: Add GlueGen.run(..) debug output w/ all paramter commit 6f7bbc15ff19640396ade377a1b2c508e67f98da Author: Sven Gothel Date: Sun Jun 18 04:31:49 2023 +0200 CPP Enable Pragma Once: Use default jcpp branch as its merged now commit 9dd35877f28f5d3dce5e1817edd33bb8f6dbbe36 Author: Sven Gothel Date: Sun Jun 18 03:43:32 2023 +0200 Bring back produced html5 standalone files, having fixed pandoc usage. See my pandoc-buttondown git repo Latest config fixed creation of standalone html5 files. commit 601399a1b7c9c66866716a8629098698dea49f38 Author: Sven Gothel Date: Sun Jun 18 03:40:54 2023 +0200 GlueGen Struct [13]: Adopt GlueGen_Mapping.md to changes, added `Struct Java Signature Examples` w/ Java API Doc snippets commit 4761c936ab5e09fe7ae19522bacf3889fc300fc9 Author: Sven Gothel Date: Sun Jun 18 03:39:24 2023 +0200 GlueGen Struct [9b]: Add unit test for fixed 'void*' regression commit eec3f21c3597ff9bf9760a06e00dd341214ea90d See impact to T2_InitializeOptions struct fields: - 'void* Reserved1' shall be ignored (*this is the regression fix*) - 'void* Reserved2' will be taked due to config 'Opaque long T2_InitializeOptions.Reserved2' - 'T2_CustomFunc CustomFunc2' will produce a member function call as previously commit 187c097055dc691a2ee65bed1c06c089aaf5cb59 Author: Sven Gothel Date: Sun Jun 18 03:35:43 2023 +0200 GlueGen Struct [12]: Throw InternalError(..) for produced code-path where Ownership.Native _and_ native memory potentially gets replaced commit 2837fad810b66ace8d841c8a67577db442883c78 Author: Sven Gothel Date: Sun Jun 18 03:34:54 2023 +0200 GlueGen Struct [11]: Formalize Ownership (enum) and elaborate generated Java API-Doc commit 5a19d4fb868f7459dc81ee7e82e1040f79a87544 Author: Sven Gothel Date: Sun Jun 18 03:31:19 2023 +0200 GlueGen Struct [10]: Don't skip primitive w/ platform dependent sized type in struct (like 'int') .. We already support platform dependent sizes like pointer etc, no reason to drop e.g. 'int'. Note: 'int' is also always 32bit of size within our current set of supported platforms, e.g. MachineDataInfo. Further fix and clarify primCElemFixedSize and primElemSizeExpr, only to be true and set if isPrimitive. commit eec3f21c3597ff9bf9760a06e00dd341214ea90d Author: Sven Gothel Date: Sun Jun 18 03:26:11 2023 +0200 GlueGen Struct [9]: Fix regression which added a pointer referencing type 'void', i.e. exclude if !baseCElemType.hasSize() // like 'void*' -> 'void' commit 0e90617503c71eedba05b604d4b35ca2d14928ec Author: Sven Gothel Date: Sun Jun 18 03:23:23 2023 +0200 Type: Add hasSize(), change getSignature(..) for const: isConstTypedef() -> "typedef", isConstRaw() -> "native" commit 99574c6adb0aad760162fea744606345fc564472 Author: Sven Gothel Date: Sun Jun 18 03:22:25 2023 +0200 JavaType: Add getSignature(..) like Type commit 42bd110d9ec63594cc028f3ee8a459424b1d2ae0 Author: Sven Gothel Date: Sat Jun 17 07:07:52 2023 +0200 Drop .md -> .html generated docs (ugly), use our cgit md -> html via refined pandoc styles Would need to fix my standalone pandoc setup to produce proper standalone docs. commit f364dd017e548d1b61b0b01ecd4ab2dbe4924d76 Author: Sven Gothel Date: Sat Jun 17 07:03:05 2023 +0200 doc/GlueGen_Mapping.md: Remove note regarding shrinking array, resolved commit 6e8d3491863f21283edfd8aa0116599248fdc6fe Author: Sven Gothel Date: Sat Jun 17 06:59:19 2023 +0200 doc/JogAmpMacOSVersions.html: Replaced w/ standalone html5 w/ header (utf8) commit a0abee0deb699fc97fc1146200c9057de15798d6 Author: Sven Gothel Date: Sat Jun 17 06:58:51 2023 +0200 GlueGen Struct [8]: Revised setter (resolved shrinking array, using 'subset' flag), added (detailed) JavaDoc in generated code Revised setter: A) int32_t val[10] -> setter for a subset change only, as-is with args[src, srcPos, destPos, length] - no new memory, reuse only - no special action to be performed B) int32_t* val -> setter with toggle 'subset' with args[subset, src, srcPos, destPos, length], - replace memory w/ 'subset==false' where it also may copy 'destPos' gap from old -> new - reuse memory w/ 'subset==true', where destPos+length <= elementCount C) const int32_t* val -> setter to replace referenced memory only args[src, srcPos, length] - always replaces memory, no copy of a gap (no destPos) Hence: - case (A) stays as is - case (B) will be revised and argument 'boolean subset' added - case (C) will be revised (simplified) and argument 'destPos' removed commit 8b1db2e6cce3289ed043f85660505551b11e3374 Author: Sven Gothel Date: Sat Jun 17 05:23:04 2023 +0200 ElementBuffer: Add absolute get/put multi-element with full srcElemPos, destElemPos, elementCount argument set and use it for the single absolute get/put methods. commit 106a552817e6da2845052b48ebbfc14cf05edbd5 Author: Sven Gothel Date: Fri Jun 16 17:56:01 2023 +0200 GlueGen Struct [7]: Keep struct class non-final (revert), but ensure methods are final. Drop useless 'final' of 'static final'. commit d7bc10d7ff0e3a30d74c4e4c439230f3983bcfb4 Author: Mathieu Féry Date: Thu Jun 15 18:03:13 2023 +0200 feat(jni): Add directive for dedicated JNI Code with CustomJNICode commit 8d3e22e8c54bca8e84ea94566f47b8f24cc24b60 Author: Mathieu Féry Date: Thu Jun 15 15:43:40 2023 +0200 feat(constants): Add supports of ~ inside ConstantDefinition commit c0a5b3fcc4a2d7f5c30f95e9b387c8a2e02b4f6f Author: Mathieu Féry Date: Thu Jun 15 18:31:34 2023 +0200 feat(translationUnit): Improve logs in case of failure inside translationUnit commit e1d5b49ecd9b180b6a80ad4d0ab63e0807682621 Author: Mathieu Féry Date: Fri Jun 16 10:34:20 2023 +0200 feat(CompoundType): Improve error log on CompoundType.addField and CompoundType.setBodyParsed when body is already parsed commit 738c15d654f67ec8aeccec2b46f5a0804c793491 Author: Mathieu Féry Date: Thu Jun 15 19:18:34 2023 +0200 feat(feature): Enable pragma once management commit d98d25f26a8231c746f8e461a6d932182376cd0b Author: Mathieu Féry Date: Thu Jun 15 18:19:05 2023 +0200 feat(cli): Add --preserveGeneratedCPP option inside GlueGen commit 88309192b450e09ba16e9d72adac178c4ce47dc3 Author: Sven Gothel Date: Fri Jun 16 05:32:07 2023 +0200 GlueGen Struct [6]: Simplify adding 'private ElementBuffer _eb*' memory buffer cache once @ 'releaseVal(..)' code creation commit fdccf16290c7b742337d3f7ab66e4b85660ca781 Author: Sven Gothel Date: Fri Jun 16 05:30:05 2023 +0200 Buffers.copyNativeToDirectByteBuffer(): Remove unused var commit 8b127c4c1dd26fcb1756805ddb83729203161f78 Author: Sven Gothel Date: Fri Jun 16 02:16:20 2023 +0200 GlueGen Struct [5]: Revised Struct Mapping + Documentation GlueGen Revised Struct Mapping (esp pointer to array or single element), Struct String Charset, .. and Documentation - Documentation: - Added README.md Let's have a proper face for the git repo - Added doc/GlueGen_Mapping.md (and its html conversion doc/GlueGen_Mapping.html) Created a new document covering application and implementation details suitable for users/devs. - Added doc/JogAmpMacOSVersions.md conversion to doc/JogAmpMacOSVersions.html - Updated www/index.html - Use *CodeUnit instead of PrintWriter, representing a Java or C code unit covering a set of functions and structs. The CCodeUnit also handles common code shared by its unit across functions etc. - Dropping 'static initializer', as its no more required due to simplified `JVMUtil_NewDirectByteBufferCopy()` variant. - Revised Struct Mapping: - Pure Java implementation to map primitive and struct fields within a struct by utilizing ElementBuffer. Only 'Function Pointer' fields within a struct require native code. Exposes `static boolean usesNativeCode()` to query whether native code is used/required. - Transparent native memory address API Expose `long getDirectBufferAddress()` and `static TK_Struct derefPointer(long addr)`, allowing to - pass the native struct-pointer with native code - reconstruct the struct from a native struct-pointer - have a fully functional `TK_Struct.derefPointer(struct.getDirectBufferAddress())` cycle. - Add 'boolean isNull() to query whether a pointer (array) is NULL - *Changed* array get/set method for more flexibility alike `System.arraycopy(src, srcPos, dest, destPos, len)`, where 'src' is being dropped for the getter and 'dest' is being dropped for the setter as both objects are reflected by the struct instance. - *Changed* `getArrayLength()` -> `getElemCount()` for clarity - Considering all ConstElemCount values with config 'ReturnedArrayLength ' to be owned by native code -> NativeOwnership -> Not changing the underlying memory region! JavaOwnership is considered for all pointer-arrays not of NativeOwnership. Hence any setter on a NativeOwnership pointer-array will fail with non-matching elem-count. - Add 'release()' for JavaOwnership pointer-arrays, allowing to release the Java owned native memory incl. null-ing pointer and setElemCount(0). - Support setter for 'const *' w/ JavaOwnership, i.e. pointer to const value of a primitive or struct, setter and getter using pointer to array or single element in general. - Added Config `ImmutableAccess symbol` to disable all setter for whole struct or a field - Added Config `MaxOneElement symbol` to restrict a pointer to maximum one element and unset initial value (zero elements) - Added Config `ReturnsStringOnly symbol` to restrict mapping only to a Java String, dropping the ByteBuffer variant for 'char' - String mapping default is UTF-8 and can be read and set via [get|set]Charset(..) per class. - Dynamic string length retrieval in case no `ReturnedArrayLength` has been configured has changed from `strlen()` to `strnlen(aptr, max_len)` to be on the safe site. The maximum length default is 8192 bytes and can be read and set via [get|set]MaxStrnlen(..) per class. FIXME: strnlen(..) using EOS byte non-functional for non 8-bit codecs like UTF-8, US-ASCII. This is due to e.g. UTF-16 doesn't use an EOS byte, but interprets it as part of a code point. - TODO: Perhaps a few more unit tests - TODO: Allow plain 'int' to be mapped in structs IFF their size is same for all MachineDescriptions used. Currently this is the case -> 4 bytes like int32_t. commit aeadfab9572e4b441b1bc1f0708cf4c72dfe181e Author: Sven Gothel Date: Fri Jun 16 01:16:55 2023 +0200 GlueGen Struct [4]: JavaConfiguration Change: Drop 'ManualStaticInitCall', 'ForceStaticInitCode'; Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess' Drop 'ManualStaticInitCall', 'ForceStaticInitCode': With new CCodeUnit's `JVMUtil_NewDirectByteBufferCopy(..)` implementation and generalized Buffers' methods, no specific init code is required anymore. Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess': - 'ReturnsStringOnly' only String getter, drop ByteBuffer/byte[] - 'MaxOneElement' only one element maximum for pointer reference - 'ImmutableAccess' strict read-only, also reduces generated code a lot commit 0a9105dd3ebbcf4b98664e50333334bff677031c Author: Sven Gothel Date: Fri Jun 16 01:10:46 2023 +0200 GlueGen Struct [3]: Adopt to CodeUnit Abstraction (replacing plain PrintWriter...) commit f1678c4ac8b85c85d11b737d08dcfe31b388e021 Author: Sven Gothel Date: Fri Jun 16 00:59:29 2023 +0200 GlueGen Struct [2]: Add CodeUnit: Representing a generated C or Java file, covering multiple FunctionEmitter allowing to unify output, decoration and dynamic helper code injection per unit - Handles file open and have public ctor emitAutogeneratedWarning(..), being self-contained - Includes `JVMUtil_NewDirectByteBufferCopy(..)` implementation in CCodeUnit, may be injected if required in customCode via emitHeader(..) commit 03c548d96e5c81d0fc39503fe3042cf03e0a75e2 Author: Sven Gothel Date: Fri Jun 16 00:43:11 2023 +0200 GlueGen Struct [1]: Enhance com.jogamp.common.nio.* to serve a most native-free-code Struct-Code generation Recfactored all NIO buffer utils to Buffers, i.e. buffer <-> address, memcpy, strnlen, etc Buffers: - Added copyNativeToDirectByteBuffer(..), allowing to copy a native memory slice into a direct buffer. - Added typeNameToBufferClass(String) and sizeOfBufferElem(Class) - Completed slize2(..) buffer-mapping methods - Exposure of safe getDirectByteBuffer(..) w/ null-check (package private) Added NativeBuffer.storeDirectAddress(..), allowing to write the array address into a native buffer (struct, etc), allowing to referencing the ElementBuffer (linear array of elements) and PointerBuffer (array of pointer). Hint: This can be read via PointerBuffer.wrap(..).get(0) Added ElementBuffer (a NativeBuffer) mapping an array of elements, completing native abstraction next to PointerBuffer (array of pointer). ElementBuffer can dereference an existing element-array by native address via ElementBuffer.derefPointer(..). Views of its content can be directly accessed via ElementBuffer.slice(..). +++ These utilities and buffer abstractions will allow to reuse code and simplify the GlueGen struct get/set implementations and help to reduce native code injection. commit 6489e38ae8d86b1a80336c20774fc9b82313cef3 Author: Tom G. Christensen Date: Thu May 25 08:52:45 2023 +0200 glibc-compat-symbols.h: skip versioning on PPC64/PPC64LE commit 6a74d16a805a4204093972bb91361b2aa633065c Author: Sven Gothel Date: Tue May 23 01:37:01 2023 +0200 AudioSink: Drop getMaxSupportedChannels(), use getNativeFormat(), getPreferredFormat() and isSupported(); Add setChannelLimit() impacting Add setChannelLimit() impacting getPreferredFormat() and isSupported(), i.e. to limit channels for e.g. JOAL/OpenAL spatial 3D sound usage. getNativeFormat() shall be unaffected. getMaxSupportedChannels() is redudandant -> getPreferredFormat() commit c04726720a57f8db42f2621ad58ff3bd42006c63 Author: Sven Gothel Date: Tue May 23 01:34:28 2023 +0200 AudioSink: Refine context locking where supported, have a more usable universal API interface commit 742cf0cd053f968cbf291ed367d4568c12d8bde2 Author: Sven Gothel Date: Sun May 21 16:44:17 2023 +0200 AudioFormat/AudioSink: Use float in seconds for duration to avoid losing precision when dealing with stats, averages etc commit 5c33470aea6b30c81681992567d7c92e100bdab3 Author: Sven Gothel Date: Sun May 21 13:05:29 2023 +0200 AudioSink: Add getAvgFrameDuration(); API-Doc: Default*: 'frame' -> AudioFrame; init(): Use getAvgFrameDuration() for queue growth and limit. This change renders buffer dequeueing, growth and limit sticking w/ [ms] values while getAvgFrameDuration() assists frame count determination. getAvgFrameDuration() is calculated when buffer is fully filled (queuedBytes / queuedFrames), i.e. a proper representation to be used to dequeue in duration range as well as for growth. This further decouples the frameDuration{->Hint} parameter in init(), as it is now only used for the initial buffer count (and latency adjustment). commit 325e5ed234a5e15f8f94eaa72dba6dbb619d490a Author: Sven Gothel Date: Sun May 21 09:19:12 2023 +0200 AudioSink: Enhance description re 'AudioFrame' and 'frameDuration' also using enqueueData() -> 1 AudioFrame commit e96f9b0c05b9fd5e47f55c2079271d6969a27a80 Author: Sven Gothel Date: Sat May 20 14:31:39 2023 +0200 JarUtil.getRelativeOf(): Make'cutOffInclSubDir' optional, i.e. ignore if null in case no sub-directory is desired commit 7f8dcc310cfb8b3eb1e026ce9aeb73471e223d8a Author: Sven Gothel Date: Sat May 20 07:40:05 2023 +0200 AudioSink.init(): Detail 'frameDuration' intend and impact of underlying JOAL/OpenAL implementation commit efa6fe4f5746aeae49c3a01dbe243be88309f7bc Author: Sven Gothel Date: Sat May 20 04:15:05 2023 +0200 Add AudioSink.getSourceCount(), refine Audio* API doc commit ae301d0f1288b31841e91be8d63a2ab024c2158f Author: Sven Gothel Date: Fri May 19 07:48:37 2023 +0200 AudioSink: Add latency query, init(..) frameDuration in ms shall be int, fix API doc commit b7e6bee3deba4d79cab7d4d82288cf632907faf8 Author: Sven Gothel Date: Fri May 19 07:47:19 2023 +0200 AudioFormat: Fix rounding/int-truncate errors, all millisecond params use type int commit 2b339721a4d6dd4f3af129a4654375b15c7ea340 Author: Sven Gothel Date: Thu May 18 03:49:00 2023 +0200 Place AudioFormat in its own file outside AudioSink, JOAL's ALAudioSink has moved to com.jogamp.openal.util.ALAudioSink (public) commit 37977b4fe48cdc6be6f8e4938b5c79371d527a5d Author: Sven Gothel Date: Wed May 17 16:26:56 2023 +0200 AudioSink: Add exclusive locking allowing implementations to short-cut for less management overhead (-> OpenAL + Synthesizer) commit 270172bcbd91f96d4a38a3d73e23d744f57a25b8 Author: Sven Gothel Date: Wed May 17 08:05:38 2023 +0200 Promote common av (audio/video) classes (AudioSink, ..) from JOGL to GlueGen for cross module usage in JOAL, JOGL, ... Supply AudioSink: NullAudioSink and JavaSoundAudioSink by GlueGen, ALAudioSink is supplied via JOAL. commit 9301bf1854d91405319801b62c268e2ca09406e6 Author: Sven Gothel Date: Mon May 15 07:08:20 2023 +0200 doc/JogAmpMacOSVersions.md: Fix 'Build node 12.6.5' row (11 -> 12) commit 99d14e9d70ab183f3d2b7f4fde7d0de8e8928a4b Author: Sven Gothel Date: Mon May 8 19:27:32 2023 +0200 GlueGen 7z File Layout: Have *-java-src.zip inside jar folder This is restricted to the 7z archive only for now, not yet producing artifacts in a jar folder as joal, jogl and jocl. This is due to sub-projects referencing gluegen jar files. A compromise. commit 803d7540429836227f9f496742a059717c156250 Author: Sven Gothel Date: Sat May 6 18:24:43 2023 +0200 doc/JogAmpMacOSVersions.md 4th round (...) For some reason the pandoc -> html works well, but integration w/ cgit css requires - newline before the list - sometimes loses the list depth and makes it flat commit 5c8bac04b9175c9f0987642f9b72d3384b01334b Author: Sven Gothel Date: Sat May 6 18:21:48 2023 +0200 doc/JogAmpMacOSVersions.md: 3rd times a charm (space and list depth) commit 573bc43f88554fbb9e600dbcd65f78eb259a70ef Author: Sven Gothel Date: Sat May 6 18:18:08 2023 +0200 doc/JogAmpMacOSVersions.md: Spaces (and 2nd attempt to fix the list depth in .. Build Setup .. commit 3409fd54cc7d56a95864afe1c9f720a1457d1394 Author: Sven Gothel Date: Sat May 6 18:03:07 2023 +0200 doc/JogAmpMacOSVersions.md Fix markdown list commit 3c2a0c1cfd66e0d812997db4836c69379e1e8476 Author: Sven Gothel Date: Sat May 6 17:34:59 2023 +0200 MacOS: Using 'Minimum Deployment Target' 10.7 (Lion) and documenting MacOS versions Note that starting with Xcode 14.3, the upcoming 'Minimum Deployment Target' is 10.13 (High Sierra). However, we are still using Xcode 14.2 and hence 10.7 is still supported. Note that I upped the 'Minimum Deployment Target' (again) from 10.5 to 10.7 to align with JOAL/openal-soft, i.e. a guaranteed common denominator. You may still try to use 10.5. Note lowest tested MacOS version (from myself) is 10.13.6 w/ x86_64) (High Sierra). commit c0027eb10c20e41bdcbb2aff3ecb00c5b6351f31 Author: Sven Gothel Date: Thu May 4 23:19:43 2023 +0200 Roll back MacOS Min Version Requirement to 10.5 from 11.0 (macosx-version-min) MacOSX compiler configuration. 2023-05-04 Actively supported architectures are 'x86_64' and 'arm64'. XCode 14.2 on a MacOS 12.6.5 x86_64 (mac-mini) machine is capable to produce fat-lipo code for MacOS >= 10.5 for 'x86_64' and 'arm64'. The MacOS SDK 11.3 has been re-added from a previous XCode installation. However, alternative source is . Only for using C++ and hence the C++ STL, the minimum version is 10.7 due to clang++ libc++. This is currently the case for JOAL's bundled openal-soft, as well as for JOGL's optional oculusvr-sdk (disabled). commit 69f72ff942f8c4dfb990a9d816a18867e220854b Author: Sven Gothel Date: Thu May 4 17:28:36 2023 +0200 HowToBuild: MacOS: Detail cmake commandline installation and mention 7-Zip commit 704cadb26e1b98e613a4faea94d9b8d7e308d1ea Author: Sven Gothel Date: Thu May 4 01:50:10 2023 +0200 HowToBuild: Windows: We use MinGW64 w/ 'posix threads' instead of 'win32 threads', allowing C++ std::mutex etc to be used (openal-soft) commit b32e378ec80488c5ffbd0d9bb356217e6db0245f Author: Sven Gothel Date: Thu May 4 01:04:53 2023 +0200 IOUtil.copyStreamChunk2ByteBuffer(..): Added new method to copy a chunk (segment) of the input stream (skipBytes, byteCount) This method is inspired by Bug 1280, , 'copy only needed bytes' for JOAL's com.jogamp.openal.util.WAVData.loadFromStream(..). This method is a revised version of the proposed IOHelpers.copyFromStream2ByteBuffer(..), see commit 6e67a7b54af82aa4e4ec28f50ff08a26f9d80627 Author: Sven Gothel Date: Thu May 4 00:49:57 2023 +0200 IOUtil.copyStream2Byte{Array|Buffer}(..): API Doc: Clarify that the complete stream is copied. commit 69d22df0a6132dbf8b88fd04090c0bc81129237f Author: Sven Gothel Date: Thu May 4 00:48:15 2023 +0200 IOUtil.copyStream2{File|Stream)(..): Drop unused and misleading 'totalNumBytes' argument, since we have no user-feedback callback passed. commit 6545ab42048dfda5f6cb72ce272a331078cd200e Author: Sven Gothel Date: Tue Mar 7 01:16:30 2023 +0100 Clock: Use Clock.currentNanos() instead of System.nanoTime() commit 1842451b0e49ac1899ed3ab3515021a6077aff92 Author: Sven Gothel Date: Tue Mar 7 01:02:19 2023 +0100 Clock: Consider return code on failed native clock_gettime(..) call; Add Win32 clock_gettime() implementation. Consider return code on failed native clock_gettime(..) call - Return Instant.EPOCH for all Instant variations (essentially 0) - Return 0 for all 'long' variations (ms, ns) Add Win32 clock_gettime() implementation. - Source: https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-libraries/winpthreads/src/clock.c - Public Domain within mingw-w64, included here to simplify linkage. - Tested on Win10 64bit w/ TestTextRendererNEWT00, all values are OK commit b773048aee7ebfb00b7ae7b45ef9f49e88ebc5a4 Author: Sven Gothel Date: Mon Mar 6 22:28:47 2023 +0100 Clock: Rename currentTimeNanos() -> currentNanos() as it represents the duration since module startup and not time. commit 0836295b52aaad1dce10a31a13cb544802d7de03 Author: Sven Gothel Date: Mon Mar 6 22:16:58 2023 +0100 Fix Clock for performance counter: Add currentTimeNanos() since module startup, retrievable via getMonotonicStartupTime(). (performance) Settings two long fields in getMonotonicTime() and creating Instant and using Duration for high-frequency counter is too expensive. currentTimeNanos() subtracts the startup time from the current monotonic time and returns the resulting duration in nanoseconds, which lasts for 292 years since module startup. This satisfies performance counter requirements. commit a26445909b3677a8c2de669992a13de2053fa821 Author: Sven Gothel Date: Mon Mar 6 10:50:39 2023 +0100 Add PerfCounterCtrl, a simple performance counter controller commit 717bc406e96fbff30cf02adad019cf9daa14e59c Author: Sven Gothel Date: Mon Mar 6 10:28:32 2023 +0100 Add Clock, implementing proper monotonic and wallclock time using Instant (sec + nsec), currentTimeMillis() is also monotonic now, reused by Platform. Dropped Platform.currentTimeMicros() Clock and its implementation was copied from jaulibs, a spin-off from Direct-BT. The implementation uses `clock_gettime(CLOCK_MONOTONIC, &t)` and is considered safe and high-performant as it avoids a kernel call via VDSO (GNU/Linux). commit 69b748925038b7d44fa6318536642b426e3d3e38 Author: Sven Gothel Date: Mon Mar 6 02:10:23 2023 +0100 Buffers: Add put[34][bsifd](..) and array-put variants for flexibility/performance. Notable: The array-put is slower than small range single-puts, e.g. put3i(..). commit 2ac520f23c27ca63116c55440597baaa6f23094b Author: Sven Gothel Date: Wed Feb 1 19:05:28 2023 +0100 Next JogAmp Release to be 2.5.0, mark w/ developer RC + timestamp tag commit 953f594a00094362e0ed56553b16aecbee2b92f2 Author: Andreas Schwab Date: Sun Feb 6 22:17:18 2022 +0100 Add support for riscv64 architecture