Andreas Schwab (1): Add support for riscv64 architecture Féry Mathieu (Mathius) (2): fix(cli): Fix disablePragmaOnce option feat(manual): Update configuration documentation. Mathieu Féry (14): feat(cli): Add --preserveGeneratedCPP option inside GlueGen feat(feature): Enable pragma once management feat(CompoundType): Improve error log on CompoundType.addField and CompoundType.setBodyParsed when body is already parsed feat(translationUnit): Improve logs in case of failure inside translationUnit feat(constants): Add supports of ~ inside ConstantDefinition feat(jni): Add directive for dedicated JNI Code with CustomJNICode feat(generation): Add setter generation for not constant and not opaque compound attribute feat(callbackGenerator): Add basic management of callback without userData doc/GlueGen_Mapping.md: Add some documentation with JavaCallback without userData feat(arrayAccessor): Allow to use ReturnedArrayLength with getter associated with field with name in PascalCase or camelCase feat(callbackGenerator): Prevent generation of CallBack interface if setter related isn't present wip(test_case): Example of test case for issue related of 927bbc7160a812bb29c0e7120d4a3009bfb13bbf feat(generation): Fix CodeGenUtils.emitJavaHeaders feat(generation): Fix generic parsing inside JavaParser.g to allow parsing of java callback implementation Sven Gothel (185): Next JogAmp Release to be 2.5.0, mark w/ developer RC + timestamp tag Buffers: Add put[34][bsifd](..) and array-put variants for flexibility/performance. Add Clock, implementing proper monotonic and wallclock time using Instant (sec + nsec), currentTimeMillis() is also monotonic now, reused by Platform. Dropped Platform.currentTimeMicros() Add PerfCounterCtrl, a simple performance counter controller Fix Clock for performance counter: Add currentTimeNanos() since module startup, retrievable via getMonotonicStartupTime(). (performance) Clock: Rename currentTimeNanos() -> currentNanos() as it represents the duration since module startup and not time. Clock: Consider return code on failed native clock_gettime(..) call; Add Win32 clock_gettime() implementation. Clock: Use Clock.currentNanos() instead of System.nanoTime() IOUtil.copyStream2{File|Stream)(..): Drop unused and misleading 'totalNumBytes' argument, since we have no user-feedback callback passed. IOUtil.copyStream2Byte{Array|Buffer}(..): API Doc: Clarify that the complete stream is copied. IOUtil.copyStreamChunk2ByteBuffer(..): Added new method to copy a chunk (segment) of the input stream (skipBytes, byteCount) HowToBuild: Windows: We use MinGW64 w/ 'posix threads' instead of 'win32 threads', allowing C++ std::mutex etc to be used (openal-soft) HowToBuild: MacOS: Detail cmake commandline installation and mention 7-Zip Roll back MacOS Min Version Requirement to 10.5 from 11.0 (macosx-version-min) MacOS: Using 'Minimum Deployment Target' 10.7 (Lion) and documenting MacOS versions doc/JogAmpMacOSVersions.md Fix markdown list doc/JogAmpMacOSVersions.md: Spaces (and 2nd attempt to fix the list depth in .. Build Setup .. doc/JogAmpMacOSVersions.md: 3rd times a charm (space and list depth) doc/JogAmpMacOSVersions.md 4th round (...) GlueGen 7z File Layout: Have *-java-src.zip inside jar folder doc/JogAmpMacOSVersions.md: Fix 'Build node 12.6.5' row (11 -> 12) Promote common av (audio/video) classes (AudioSink, ..) from JOGL to GlueGen for cross module usage in JOAL, JOGL, ... AudioSink: Add exclusive locking allowing implementations to short-cut for less management overhead (-> OpenAL + Synthesizer) Place AudioFormat in its own file outside AudioSink, JOAL's ALAudioSink has moved to com.jogamp.openal.util.ALAudioSink (public) AudioFormat: Fix rounding/int-truncate errors, all millisecond params use type int AudioSink: Add latency query, init(..) frameDuration in ms shall be int, fix API doc Add AudioSink.getSourceCount(), refine Audio* API doc AudioSink.init(): Detail 'frameDuration' intend and impact of underlying JOAL/OpenAL implementation JarUtil.getRelativeOf(): Make'cutOffInclSubDir' optional, i.e. ignore if null in case no sub-directory is desired AudioSink: Enhance description re 'AudioFrame' and 'frameDuration' also using enqueueData() -> 1 AudioFrame AudioSink: Add getAvgFrameDuration(); API-Doc: Default*: 'frame' -> AudioFrame; init(): Use getAvgFrameDuration() for queue growth and limit. AudioFormat/AudioSink: Use float in seconds for duration to avoid losing precision when dealing with stats, averages etc AudioSink: Refine context locking where supported, have a more usable universal API interface AudioSink: Drop getMaxSupportedChannels(), use getNativeFormat(), getPreferredFormat() and isSupported(); Add setChannelLimit() impacting GlueGen Struct [1]: Enhance com.jogamp.common.nio.* to serve a most native-free-code Struct-Code generation 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 GlueGen Struct [3]: Adopt to CodeUnit Abstraction (replacing plain PrintWriter...) GlueGen Struct [4]: JavaConfiguration Change: Drop 'ManualStaticInitCall', 'ForceStaticInitCode'; Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess' GlueGen Struct [5]: Revised Struct Mapping + Documentation Buffers.copyNativeToDirectByteBuffer(): Remove unused var GlueGen Struct [6]: Simplify adding 'private ElementBuffer _eb*' memory buffer cache once @ 'releaseVal(..)' code creation GlueGen Struct [7]: Keep struct class non-final (revert), but ensure methods are final. Drop useless 'final' of 'static final'. ElementBuffer: Add absolute get/put multi-element with full srcElemPos, destElemPos, elementCount argument set and use it for the single absolute get/put methods. GlueGen Struct [8]: Revised setter (resolved shrinking array, using 'subset' flag), added (detailed) JavaDoc in generated code doc/JogAmpMacOSVersions.html: Replaced w/ standalone html5 w/ header (utf8) doc/GlueGen_Mapping.md: Remove note regarding shrinking array, resolved Drop .md -> .html generated docs (ugly), use our cgit md -> html via refined pandoc styles JavaType: Add getSignature(..) like Type Type: Add hasSize(), change getSignature(..) for const: isConstTypedef() -> "typedef", isConstRaw() -> "native" GlueGen Struct [9]: Fix regression which added a pointer referencing type 'void', i.e. exclude if !baseCElemType.hasSize() // like 'void*' -> 'void' GlueGen Struct [10]: Don't skip primitive w/ platform dependent sized type in struct (like 'int') .. GlueGen Struct [11]: Formalize Ownership (enum) and elaborate generated Java API-Doc GlueGen Struct [12]: Throw InternalError(..) for produced code-path where Ownership.Native _and_ native memory potentially gets replaced GlueGen Struct [9b]: Add unit test for fixed 'void*' regression commit eec3f21c3597ff9bf9760a06e00dd341214ea90d GlueGen Struct [13]: Adopt GlueGen_Mapping.md to changes, added `Struct Java Signature Examples` w/ Java API Doc snippets Bring back produced html5 standalone files, having fixed pandoc usage. CPP Enable Pragma Once: Use default jcpp branch as its merged now CPP Enable Pragma Once: Add GlueGen.run(..) debug output w/ all paramter CPP Enable Pragma Once: Default is 'true', since usually all compiler and APIs do support this feature CustomJNICode: Fix/complete commit d7bc10d7ff0e3a30d74c4e4c439230f3983bcfb4: Add emitCustomJNICode(..) for JavaEmitter.endFunctions() not just structs and fix the JNI-c stub code CustomJNICode: Add missing (separated) test1p1-CustomJNICode.c.stub CPP Enable Pragma Once: Remove cli '--enablePragmaOnce' option as it is enabled by default GlueGen Struct [14]: Update doc/GlueGen_Mapping.md www/index.html: Copy Documentation section into main text for visibility Doc: Manual: Adding disclaimer being slightly outdated and hint to GlueGen_Mapping document GlueGen Type: Use virt getTargetType() for ArrayType dropping getElementType(); Rename getBase{Elem ->}Type() to align with getTargetType() doc/GlueGen_Mapping.md: Place `Struct Setter Pseudo-Code` above 'Signature Table' and add a brief signature to mapping description to the former GlueGen Struct [15]: Add FunctionPointer getter and setter support w/ documentation GlueGen Struct [15b]: FunctionPointer: Drop isNull() -> use get() GlueGen junit test2.h: Add an anonymous struct pointer w/ opaque long config JavaEmitter.typeToJavaTypeImpl(): Add targetType in GlueGenException and remove '"' in message GlueGen Test: Test2 -> Test2FuncPtr NIO NativeBuffer, {Element,Pointer}Buffer: Add limit, clear and flip; Arrange wrap/deref arguments equal; Add equal set of absolute get/set methods GlueGen: Type, JavaType: Align getSignature(..) output GlueGen: Type: Have get{Base,Target}Type() stop at isFunctionPointer(), enhance API doc; Add getArrayBaseOrPointerTargetType() and getTargetFunction() GlueGen: JavaConfiguration.typeInfo(..): Clarify DEBUG_TYPE_INFO output GlueGen: JavaConfiguration.promoteTypeInfo(): Fix primitive pointerDepth, i.e. only pass numPointersStripped w/o adding info.pointerDepth() GlueGen Struct [16]: Add support for pointer-pointer and function-pointer values GlueGen: Expose CMethodBindingEmitter.getJNIMangledArgs() as a public static to be reusable GlueGen: Rename GlueEmitter.getConfig{uration->}() and drop JavaEmitter.getConfig(), cleaning up API usage GlueGen Fix ProcAddressCMethodBindingEmitter.jniMangle(..) override: Use renamed {jniMangle->getJNIMangledArg}(..) GlueGen: Add JavaEmitter(JavaConfiguration) ctor JavaEmitter.generateArrayGetterSetterCode(): Place elemCountExpr null check where it could occur -> non-opaque, non-primitive array case GlueGen: Fix Type.getSignature(..): Test for isFunctionPointer() to elaborate on FunctionType as getTargetType() only retruns a function-ptr and no more a function-type. GlueGen FunctionType: Expose toString(..) w/ 'isPointer' argument GlueGen Add JavaType.forObjectClass() GlueGen FunctionSymbol: Simplify ctor reusing main-ctor; Be always reachable via type(def)name, ctor: addAliasedName( type.getCName() ) GlueGen JavaConfiguration: Add 'JavaCallbackDef [user-param-idx]' GlueGen JavaConfiguration: Add List stringArguments(final AliasedSymbol symbol) GlueGen JavaCallback: Add preliminary implementation (WIP): Produces proper interfaces, TODO implementation GlueGen JavaCallback: Add more related documentation GlueGen JavaType: Add new nature 'String clazzName': Future (not yet generated or existing) Class objects (existing at runtime) GlueGen JavaCallback: Use new JavaType nature 'named-class', denoting the generated callback interface mapping the callback function. 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. 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 GlueGen JavaCallback: Add JavaCallback.methodSignature to JNI arg-list and pass value at invocation, allowing to find the jmethodID of callback GlueGen Struct [17]: Handle void pointers, i.e. `void*`, within a struct as `Opaque` configured pointer-types GlueGen doc/GlueGen_Mapping.md: Mentiond OO-Style API mapping and add section for it 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 GlueGen: Move [de]captializeString(..) JavaEmitter -> static in CodeGenUtils GlueGen CMethodBindingEmitter: Refactor emitBodyReturnResult() -> emitBodyMapCToJNIType(): Reuse to converting any C-type argument to java JNI type (i.e. native callback to JavaCallback) 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() GlueGen ProcAddressCMethodBindingEmitter.jniMangle() override: Only add additional params if produced name containes '__', i.e. JNI mangled parameter GlueGen JavaCallback: 1st Working Draft: Changed 'JavaCallbackDef' config, added code generation incl. native to Java dispatch and resource management Doc: Align GlueGen_Mapping.md intro w/ README.md and www/index.html Doc: www/index.html: Fix JOGL UML link Doc intro: Fix LibraryOnLoad using generic LibraryBasename README.md: Fix links GlueGen JavaCallback: Set-Callback: Ensure a previously mapped 'userParam' instance is released before binding new one; Add test changing callback function. Test4JavaCallback: Just rename myUserParam -> myUserParam01 for future tests.. Eclipse classpath GlueGen FunctionType/MethodBinding: get*ParameterList(): Use a more flexible way via a ParameterConsumer visitor, also usable for other iterative parameter generator GlueGen JavaCallback: Resolve key mapping of callback and associated resources via 'JavaCallbackKey' config and custom `SetCallback-KeyClass` GlueGen Intro: Add section about its comprehensive runtime library, shorten the JNI_OnLoad section GlueGen JavaCallback: Release the associated data (natively) only after the actual toolkit setCallback call GlueGen JavaCallback: Only produce default 'Key' class if keys are used, expose 'Key' to public and use it. Expose release*() and get*Keys() methods GlueGen JavaCallback: Use `SetCallback-KeyClass` if manually specified, even if no keys are defined! GlueGen JavaCallback: Native callback: Check ObjectRef validity and synchronize (MonitorEnter/Exit) with same Object of Java impl. -> thread safe GlueGen JavaCallback: Emphasize all methods are thread-safe doc/GlueGen_Mapping.md: Typo GlueGen JavaCallback: Document native callback use-after-free potential (caught), zero-mem @ release GlueGen JavaCallback: Native Callback: Reduce 'look-ahead' of read-after-free to critical lockObj only GlueGen Struct [18]: Drop redundant 'static get*ElemCount() { return 1 }` for: isPrimitive && !isPointer && staticElemCount && maxOneElement CMethodBindingEmitter JavaCallback: Use a friendly readable basename for errors GlueGen JavaCallback: CMethodBindingEmitter: Check lockObj for NULL before GetObjectRefType(), avoid certain (older) Hotspot issues GlueGen JavaCallback: CMethodBindingEmitter: Check, describe & clear exception if occurring - we must assume async off-thread source in general GlueGen JavaCallback: Unify native 'T_JavaCallbackGlueData' typedef struct GlueGen JavaCallback: Revised: Static Java callback dispatcher, dropping native heap, support Struct UserParam ... GlueGen JavaType.appendDescriptor(..): Fix regression: Must return a vanilla descriptor ('/' not '_') i.e. non JNI method-name descriptor to avoid double conversion doc/GlueGen_Mapping.md: Quote `void*` correctly .. GlueGen JavaCallback/LibraryOnLoad: Always include the `libraryBasename` agnostic 'emitJNIEnvDecl()' (declaration) in JNI code; Detach the thread from the JVM if newly attach in callback! GlueGen: Add 'PascalString' string semantics (length + value-ptr), added prelim code for JavaCallback use-case emitBodyMapCToJNIType() Manual: Refine `ArgumentIsPascalString` GlueGen JavaCallback: Fix `staticCBClazz*` initial setup (only), using a NewGlobalRef() for jclass (not required for static jmethodID) GlueGen JavaCallback: Remove ambiguity: Config JavaCallbackDef/JavaCallbackKey: Always define both parameter indices; emitJavaStaticCallback(): Use cbFuncBinding and cbFuncKeyIndices from callback parameter to build key GlueGen JavaCallback Doc: Remove reasoning (avoiding ambiguity) to CallbackFunction parameter index GlueGen JavaCallback: Add capability to have UserParam as (part of) key Manual: Fix ArgumentIsPascalString GlueGen JavaCallback: Add optional custom 'Callback-UserParamClass` for non-compound `UserParam` types to have more clarity in resulting API doc/GlueGen_Mapping.md: Typos 'UserParam' -> 'UserParamClass' doc/GlueGen_Mapping.md: Typos 'UserParam' -> 'UserParamClass' (2 more occassions) doc/GlueGen_Mapping.md: Using 'UserParamClass' .. grammar (3 commits for 1 discount today) CMethodBindingEmitter.emitBodyMapCToJNIType(..): Add proper intendation to NIO ByteBuffer generation (isNIOBuffer || isCompoundTypeWrapper) JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode}(): Group 'userParamDefined' case (cleanup) JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode, emitJavaCallbackBodyPassJavaArguments}(): Use capitalized sub-string 'baseArgName' for (static) callback related entities JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode, emitJavaCallbackBodyPassJavaArguments}(): Fix exclusion of ad-hoc compound conversion for userParam JavaCallbackEmitter.emitCSetFuncPreCall(): Drop redundant arg 'CMethodBindingEmitter jcbFuncCMethodEmitter', use local 'info.cbFuncBinding' JavaCallbackEmitter.emitJavaCallbackBodyPassJavaArguments(): Drop redundant arg 'MethodBinding jcbFuncCMethodBinding', use local 'info.cbFuncBinding' JavaCallbackEmitter.emitCAdditionalCode(): Use `info.cbFuncBinding` locally and passed 'jcbFuncCMethodEmitter' only to invoke CMethodBindingEmitter.emitBodyMapCToJNIType(..) JavaEmitter: Encapsulate 'needsJavaCallbackCode' query in JavaConfiguration. TBD: Is this even required? Fix & Enhance Test4JavaCallback for non-userParam chapter12*: Fix ad-hoc compound equals and add chapter12b for additional parameter with different order CMethodBindingEmitter.emitBodyPassCArguments(): Either pass STRING_CHARS_PREFIX or javaCallbackEmitter.emitCOptArgumentSuffix(..) JavaEmitter.bindFunction(): Add JavaCallback userParam non-void case (i.e. 'String') JavaCallbackEmitter.emitJavaKeyClass(): Use directBufferAddress for compound types in equals and hashCode, i.e. use memory identity JavaCallback: Remove non-UserParam JavaConfiguration.requiresJavaCallbackCode() doc/GlueGen_Mapping.md: Shorten UserParamIndex '<0' to disable 'UserParam' and produce html page Revert "JavaCallback: Remove non-UserParam JavaConfiguration.requiresJavaCallbackCode()" WIP JavaCallback Tests: Rename test2-gluegen.cfg -> test2-if.cfg WIP JavaCallback Tests: Fix: Link library Bindingtest2p1 against library test2 not test1 WIP JavaCallback Tests: Fix: test2-CustomJavaImplCode.java.stub must be 'IncludeAs' for both implementations, Bindingtest2p1Impl and Bindingtest2p2Impl WIP JavaCallback Tests: Fix typo in 'CustomJavaCode' Java class target name WIP JavaCallback Tests: Fix Test4p2JavaCallback.chapter__TestLoadLibrary() issue loadBindingtest2p2() not loadBindingtest2p1() GlueGen Code Unit Tests using a statically linked tool library do not need to load the tool library dynamically, hence dropped. JavaConfiguration.requiresJavaCallbackCode() shall return true for all JavaCallback cases no just non-userParam case Cleanup unit test class names: Try to start w/ 'Test', remove intermediate 'Test' for supporting, non-test classes Cleanup unit test class names (pt2): Try to start w/ 'Test', remove intermediate 'Test' for supporting, non-test classes Cleanup unit test class names (pt3): Try to start w/ 'Test', remove intermediate 'Test' for supporting, non-test classes Add notes `Loading a MacOS Native Library's Dependencies` and use absolute path in unit test script for library-path Minor cleanup (includes, spacing) JavaCallback: Add Mathieu Féry's detailed git comment regarding 2abb40b0ca9a6a06bdbe3e66b4235301ed15c693; Updated GlueGen_Mapping.md Bump jcpp (merged w/ jcpp upstream v1.4.14) and adopt to changes Drop PCPP, GlueGen exclusively uses JCPP; Adopt test case Test{P->J}CPP TestJCPP: Add recursive-include test and include a header file starting with '-' and in a subdir containing a '-' ANTLR Syntax: Add debugging facility for GnuCParser.g and StdCParser.g Bug 1450: Fix 'Number' rule, i.e. only consume positive numbers as `additiveExpr` and `unaryExpr` consume the '-' operator Bug 1450: Widen ConstantDefinition.isConstantExpression() to include 'patternCPPOperand' Bug 1450: Be more verbose w/ JavaEmitter comment lines for enums and defines, include native expression Bug 1450: Add test snippets covering the issues: test2.h for Bindingtest2, TestJCPP and new TestCParser Bug 1450: TestCParser: Enable test10_cc() w/o JCPP GlueGen: 'from expression' -> 'with expression' Bump JCPP: Use Unix '/' file separator in #line output for UNIFIED_OUTPUT 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 Bug 1449: Fix link style in manual refs .. doc/GlueGen_Mapping.md: Fix GlueGen Manual read consideration ... Bump: 2.5.0 Release Tom G. Christensen (1): glibc-compat-symbols.h: skip versioning on PPC64/PPC64LE