├── .github
└── workflows
│ └── javacpp.yml
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
├── platform
├── pom.xml
└── src
│ └── main
│ └── assembly
│ ├── bin.xml
│ └── src.xml
├── pom.xml
└── src
├── it
└── osgi
│ ├── pom.xml
│ ├── src
│ └── main
│ │ ├── c
│ │ └── calc.h
│ │ └── java
│ │ └── org
│ │ └── bytedeco
│ │ └── javacpp
│ │ └── test
│ │ └── osgi
│ │ ├── Calc.java
│ │ └── JavaCPPOsgiTest.java
│ └── test.bndrun
├── main
├── assembly
│ ├── bin.xml
│ └── src.xml
├── java
│ └── org
│ │ └── bytedeco
│ │ └── javacpp
│ │ ├── BoolPointer.java
│ │ ├── BooleanPointer.java
│ │ ├── BytePointer.java
│ │ ├── CLongPointer.java
│ │ ├── CharPointer.java
│ │ ├── ClassProperties.java
│ │ ├── DoublePointer.java
│ │ ├── FloatPointer.java
│ │ ├── FunctionPointer.java
│ │ ├── IntPointer.java
│ │ ├── LoadEnabled.java
│ │ ├── Loader.java
│ │ ├── LongPointer.java
│ │ ├── Pointer.java
│ │ ├── PointerPointer.java
│ │ ├── PointerScope.java
│ │ ├── ShortPointer.java
│ │ ├── SizeTPointer.java
│ │ ├── annotation
│ │ ├── Adapter.java
│ │ ├── Allocator.java
│ │ ├── ArrayAllocator.java
│ │ ├── AsUtf16.java
│ │ ├── ByPtr.java
│ │ ├── ByPtrPtr.java
│ │ ├── ByPtrRef.java
│ │ ├── ByRef.java
│ │ ├── ByVal.java
│ │ ├── Cast.java
│ │ ├── Const.java
│ │ ├── Convention.java
│ │ ├── CriticalRegion.java
│ │ ├── Function.java
│ │ ├── Index.java
│ │ ├── MemberGetter.java
│ │ ├── MemberSetter.java
│ │ ├── Name.java
│ │ ├── Namespace.java
│ │ ├── NoDeallocator.java
│ │ ├── NoException.java
│ │ ├── NoOffset.java
│ │ ├── Opaque.java
│ │ ├── Optional.java
│ │ ├── Platform.java
│ │ ├── Properties.java
│ │ ├── Raw.java
│ │ ├── SharedPtr.java
│ │ ├── StdBasicString.java
│ │ ├── StdMove.java
│ │ ├── StdString.java
│ │ ├── StdU16String.java
│ │ ├── StdU32String.java
│ │ ├── StdVector.java
│ │ ├── StdWString.java
│ │ ├── UniquePtr.java
│ │ ├── ValueGetter.java
│ │ ├── ValueSetter.java
│ │ ├── Virtual.java
│ │ └── package-info.java
│ │ ├── chrono
│ │ ├── HighResolutionClock.java
│ │ ├── HighResolutionDuration.java
│ │ ├── HighResolutionTime.java
│ │ ├── Hours.java
│ │ ├── Microseconds.java
│ │ ├── Milliseconds.java
│ │ ├── Minutes.java
│ │ ├── Nanoseconds.java
│ │ ├── Seconds.java
│ │ ├── SecondsDouble.java
│ │ ├── SecondsFloat.java
│ │ ├── SteadyClock.java
│ │ ├── SteadyDuration.java
│ │ ├── SteadyTime.java
│ │ ├── SystemClock.java
│ │ ├── SystemDuration.java
│ │ └── SystemTime.java
│ │ ├── global
│ │ └── chrono.java
│ │ ├── indexer
│ │ ├── Bfloat16ArrayIndexer.java
│ │ ├── Bfloat16BufferIndexer.java
│ │ ├── Bfloat16Indexer.java
│ │ ├── Bfloat16RawIndexer.java
│ │ ├── BooleanArrayIndexer.java
│ │ ├── BooleanBufferIndexer.java
│ │ ├── BooleanIndexer.java
│ │ ├── BooleanRawIndexer.java
│ │ ├── ByteArrayIndexer.java
│ │ ├── ByteBufferIndexer.java
│ │ ├── ByteIndexer.java
│ │ ├── ByteRawIndexer.java
│ │ ├── CharArrayIndexer.java
│ │ ├── CharBufferIndexer.java
│ │ ├── CharIndexer.java
│ │ ├── CharRawIndexer.java
│ │ ├── DoubleArrayIndexer.java
│ │ ├── DoubleBufferIndexer.java
│ │ ├── DoubleIndexer.java
│ │ ├── DoubleRawIndexer.java
│ │ ├── FloatArrayIndexer.java
│ │ ├── FloatBufferIndexer.java
│ │ ├── FloatIndexer.java
│ │ ├── FloatRawIndexer.java
│ │ ├── HalfArrayIndexer.java
│ │ ├── HalfBufferIndexer.java
│ │ ├── HalfIndexer.java
│ │ ├── HalfRawIndexer.java
│ │ ├── HyperslabIndex.java
│ │ ├── Index.java
│ │ ├── Indexable.java
│ │ ├── Indexer.java
│ │ ├── IntArrayIndexer.java
│ │ ├── IntBufferIndexer.java
│ │ ├── IntIndexer.java
│ │ ├── IntRawIndexer.java
│ │ ├── LongArrayIndexer.java
│ │ ├── LongBufferIndexer.java
│ │ ├── LongIndexer.java
│ │ ├── LongRawIndexer.java
│ │ ├── OneIndex.java
│ │ ├── Raw.java
│ │ ├── ReverseUnsafeRaw.java
│ │ ├── ShortArrayIndexer.java
│ │ ├── ShortBufferIndexer.java
│ │ ├── ShortIndexer.java
│ │ ├── ShortRawIndexer.java
│ │ ├── StrideIndex.java
│ │ ├── UByteArrayIndexer.java
│ │ ├── UByteBufferIndexer.java
│ │ ├── UByteIndexer.java
│ │ ├── UByteRawIndexer.java
│ │ ├── UIntArrayIndexer.java
│ │ ├── UIntBufferIndexer.java
│ │ ├── UIntIndexer.java
│ │ ├── UIntRawIndexer.java
│ │ ├── ULongArrayIndexer.java
│ │ ├── ULongBufferIndexer.java
│ │ ├── ULongIndexer.java
│ │ ├── ULongRawIndexer.java
│ │ ├── UShortArrayIndexer.java
│ │ ├── UShortBufferIndexer.java
│ │ ├── UShortIndexer.java
│ │ ├── UShortRawIndexer.java
│ │ ├── UnsafeRaw.java
│ │ └── package-info.java
│ │ ├── package-info.java
│ │ ├── presets
│ │ ├── chrono.java
│ │ ├── javacpp.java
│ │ └── package-info.java
│ │ └── tools
│ │ ├── AdapterInformation.java
│ │ ├── Attribute.java
│ │ ├── BuildEnabled.java
│ │ ├── BuildMojo.java
│ │ ├── Builder.java
│ │ ├── CacheMojo.java
│ │ ├── ClassFilter.java
│ │ ├── ClassScanner.java
│ │ ├── ClearMojo.java
│ │ ├── CommandExecutor.java
│ │ ├── Context.java
│ │ ├── Declaration.java
│ │ ├── DeclarationList.java
│ │ ├── Declarator.java
│ │ ├── DocTag.java
│ │ ├── EncodingFileWriter.java
│ │ ├── Generator.java
│ │ ├── IndexedSet.java
│ │ ├── Info.java
│ │ ├── InfoMap.java
│ │ ├── InfoMapper.java
│ │ ├── Logger.java
│ │ ├── MethodInformation.java
│ │ ├── Parameters.java
│ │ ├── ParseMojo.java
│ │ ├── Parser.java
│ │ ├── ParserException.java
│ │ ├── PointerBufferPoolMXBean.java
│ │ ├── Slf4jLogger.java
│ │ ├── TemplateMap.java
│ │ ├── Templates.java
│ │ ├── Token.java
│ │ ├── TokenIndexer.java
│ │ ├── Tokenizer.java
│ │ ├── Type.java
│ │ ├── UserClassLoader.java
│ │ └── package-info.java
├── java9
│ └── module-info.java
└── resources
│ └── org
│ └── bytedeco
│ └── javacpp
│ └── properties
│ ├── android-arm-clang.properties
│ ├── android-arm-gcc.properties
│ ├── android-arm.properties
│ ├── android-arm64-clang.properties
│ ├── android-arm64-gcc.properties
│ ├── android-arm64.properties
│ ├── android-x86-clang.properties
│ ├── android-x86-gcc.properties
│ ├── android-x86.properties
│ ├── android-x86_64-clang.properties
│ ├── android-x86_64-gcc.properties
│ ├── android-x86_64.properties
│ ├── generic.properties
│ ├── ios-arm.properties
│ ├── ios-arm64.properties
│ ├── ios-x86.properties
│ ├── ios-x86_64.properties
│ ├── linux-arm.properties
│ ├── linux-arm64.properties
│ ├── linux-armhf.properties
│ ├── linux-mips64el.properties
│ ├── linux-ppc64.properties
│ ├── linux-ppc64le-cuda.properties
│ ├── linux-ppc64le.properties
│ ├── linux-riscv64.properties
│ ├── linux-x86-cuda.properties
│ ├── linux-x86.properties
│ ├── linux-x86_64-cuda.properties
│ ├── linux-x86_64.properties
│ ├── macosx-arm.properties
│ ├── macosx-arm64.properties
│ ├── macosx-x86-cuda.properties
│ ├── macosx-x86.properties
│ ├── macosx-x86_64-cuda.properties
│ ├── macosx-x86_64.properties
│ ├── windows-x86-cuda.properties
│ ├── windows-x86-mingw.properties
│ ├── windows-x86.properties
│ ├── windows-x86_64-cuda.properties
│ ├── windows-x86_64-mingw.properties
│ └── windows-x86_64.properties
└── test
├── java
└── org
│ └── bytedeco
│ └── javacpp
│ ├── AdapterTest.java
│ ├── BufferTest.java
│ ├── BuilderTest.java
│ ├── EnumTest.java
│ ├── IndexerTest.java
│ ├── PointerTest.java
│ ├── ThreadTest.java
│ └── indexer
│ └── HyperslabIndexTest.java
└── resources
└── org
└── bytedeco
└── javacpp
├── AdapterTest.h
├── BufferTest.h
├── EnumTest.h
└── ThreadTest.h
/.github/workflows/javacpp.yml:
--------------------------------------------------------------------------------
1 | name: javacpp
2 | on: [push, pull_request, workflow_dispatch]
3 | env:
4 | CI_DEPLOY_MODULE: .
5 | CI_DEPLOY_OPTIONS: -Dmaven.javadoc.skip -Dmaven.test.skip -Dinvoker.skip
6 | CI_DEPLOY_PLATFORM: ${{ github.job }}
7 | CI_DEPLOY_SETTINGS: ${{ secrets.CI_DEPLOY_SETTINGS }}
8 | CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
9 | CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
10 | STAGING_REPOSITORY: ${{ secrets.STAGING_REPOSITORY }}
11 | jobs:
12 | # android-arm:
13 | # runs-on: ubuntu-22.04
14 | # steps:
15 | # - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
16 | android-arm64:
17 | runs-on: ubuntu-22.04
18 | steps:
19 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
20 | # android-x86:
21 | # runs-on: ubuntu-22.04
22 | # steps:
23 | # - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
24 | android-x86_64:
25 | runs-on: ubuntu-22.04
26 | steps:
27 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
28 | ios-arm64:
29 | runs-on: macos-14
30 | steps:
31 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
32 | ios-x86_64:
33 | runs-on: macos-13
34 | steps:
35 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
36 | # linux-armhf:
37 | # runs-on: ubuntu-22.04
38 | # steps:
39 | # - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
40 | linux-arm64:
41 | runs-on: ubuntu-22.04
42 | steps:
43 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
44 | linux-ppc64le:
45 | runs-on: ubuntu-22.04
46 | steps:
47 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
48 | linux-riscv64:
49 | runs-on: ubuntu-22.04
50 | steps:
51 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
52 | # linux-x86:
53 | # runs-on: ubuntu-22.04
54 | # steps:
55 | # - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
56 | linux-x86_64:
57 | runs-on: ubuntu-22.04
58 | env:
59 | CI_DEPLOY_OPTIONS: "" # to not skip tests
60 | steps:
61 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-ubuntu@actions
62 | macosx-arm64:
63 | runs-on: macos-14
64 | steps:
65 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
66 | macosx-x86_64:
67 | runs-on: macos-13
68 | env:
69 | CI_DEPLOY_OPTIONS: "" # to not skip tests
70 | steps:
71 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
72 | # windows-x86:
73 | # runs-on: windows-2022
74 | # steps:
75 | # - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
76 | windows-x86_64:
77 | runs-on: windows-2022
78 | env:
79 | CI_DEPLOY_OPTIONS: "" # to not skip tests
80 | steps:
81 | - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
82 | redeploy:
83 | # needs: [android-arm, android-arm64, android-x86, android-x86_64, ios-arm64, ios-x86_64, linux-armhf, linux-arm64, linux-ppc64le, linux-x86, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86, windows-x86_64]
84 | needs: [android-arm64, android-x86_64, ios-arm64, ios-x86_64, linux-arm64, linux-ppc64le, linux-riscv64, linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64]
85 | runs-on: ubuntu-22.04
86 | steps:
87 | - uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions
88 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /platform/target/
3 |
4 | # Mac
5 | .DS_Store
6 |
7 | # Eclipse
8 | .classpath
9 | .project
10 | .settings
11 | .factorypath
12 |
13 | # IntelliJ
14 | *.iml
15 | .idea
16 |
--------------------------------------------------------------------------------
/platform/src/main/assembly/bin.xml:
--------------------------------------------------------------------------------
1 |
3 | ${project.version}-bin
4 |
5 | zip
6 |
7 | ${project.artifactId}-${project.version}-bin
8 |
9 |
10 | ${project.basedir}/..
11 | /
12 |
13 | CHANGELOG*
14 | README*
15 | LICENSE*
16 | NOTICE*
17 |
18 |
19 |
20 | ${project.build.directory}
21 | /
22 |
23 | *.jar
24 |
25 |
26 | *-javadoc.jar
27 | *-sources.jar
28 |
29 | 0644
30 |
31 |
32 | ${project.build.directory}/site
33 | docs
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/platform/src/main/assembly/src.xml:
--------------------------------------------------------------------------------
1 |
3 | ${project.version}-src
4 |
5 | zip
6 |
7 | ${project.artifactId}-${project.version}
8 |
9 |
10 | ${project.basedir}/..
11 |
12 | CHANGELOG*
13 | README*
14 | LICENSE*
15 | NOTICE*
16 | pom.xml
17 |
18 | true
19 |
20 |
21 |
22 | ${project.basedir}/../src
23 | true
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/it/osgi/src/main/c/calc.h:
--------------------------------------------------------------------------------
1 |
2 | struct IntValue {
3 | int value;
4 | };
5 |
6 | inline int add(int a, int b) {
7 | return a + b;
8 | }
9 |
--------------------------------------------------------------------------------
/src/it/osgi/src/main/java/org/bytedeco/javacpp/test/osgi/Calc.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.test.osgi;
2 |
3 | import org.bytedeco.javacpp.Loader;
4 | import org.bytedeco.javacpp.Pointer;
5 | import org.bytedeco.javacpp.annotation.Platform;
6 |
7 | @Platform(include = "calc.h")
8 | public class Calc {
9 |
10 | static {
11 | // This line should be sufficient, but it
12 | // may not be if the JVM does not allow us
13 | // to load it with the right class loader
14 | //
15 | Loader.load();
16 |
17 | // This is what we need to happen in the scope
18 | // of the bundle containing the native code,
19 | // not the JavaCPP bundle. Note that the call
20 | // to the Loader is just to force a wiring to
21 | // the JavaCPP package needed by the JNI code
22 | //
23 | //Loader.getPlatform();
24 | //
25 | //System.loadLibrary("jniCalc");
26 | }
27 |
28 | private Calc() {}
29 |
30 | static class IntValue extends Pointer {
31 | IntValue(Pointer p) { super(p); }
32 | IntValue() { allocate(); }
33 | native void allocate();
34 |
35 | native int value(); native IntValue value(int setter);
36 | }
37 |
38 | public static native int add(int a, int b);
39 | }
40 |
--------------------------------------------------------------------------------
/src/it/osgi/src/main/java/org/bytedeco/javacpp/test/osgi/JavaCPPOsgiTest.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.test.osgi;
2 |
3 | import static org.junit.Assert.assertEquals;
4 |
5 | import org.junit.Test;
6 |
7 | public class JavaCPPOsgiTest {
8 |
9 | @Test
10 | public void testJavaCPP() {
11 | assertEquals(3, Calc.add(1, 2));
12 |
13 | Calc.IntValue v = new Calc.IntValue().value(4);
14 | assertEquals(4, v.value());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/it/osgi/test.bndrun:
--------------------------------------------------------------------------------
1 | -runrequires: bnd.identity;id='javacpp-tests-osgi'
2 | -runfw: org.apache.felix.framework;version='[7.0.5,7.0.5]'
3 | -runee: JavaSE-1.8
4 | -runbundles: \
5 | org.bytedeco.javacpp;version='0.0.0',\
6 | org.bytedeco.javacpp.${os.name}-${os.arch};version='0.0.0',\
7 | javacpp-tests-osgi;version='0.0.0',\
8 | org.apache.servicemix.bundles.junit;version='[4.13.2,4.13.3)',\
9 | slf4j.api;version='[1.7.36,1.7.37)',\
10 | slf4j.simple;version='[1.7.36,1.7.37)'
11 |
--------------------------------------------------------------------------------
/src/main/assembly/bin.xml:
--------------------------------------------------------------------------------
1 |
3 | ${project.version}-bin
4 |
5 | zip
6 |
7 | ${project.artifactId}-${project.version}-bin
8 |
9 |
10 | ${project.basedir}
11 | /
12 |
13 | CHANGELOG*
14 | README*
15 | LICENSE*
16 | NOTICE*
17 |
18 |
19 |
20 | ${project.build.directory}
21 | /
22 |
23 | *.jar
24 |
25 |
26 | *-javadoc.jar
27 | *-sources.jar
28 |
29 | 0644
30 |
31 |
32 | ${project.build.directory}/site
33 | docs
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/main/assembly/src.xml:
--------------------------------------------------------------------------------
1 |
3 | ${project.version}-src
4 |
5 | zip
6 |
7 | ${project.artifactId}-${project.version}
8 |
9 |
10 | ${project.basedir}
11 |
12 | CHANGELOG*
13 | README*
14 | LICENSE*
15 | NOTICE*
16 | pom.xml
17 |
18 | true
19 |
20 |
21 |
22 | ${project.basedir}/src
23 | true
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/FunctionPointer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011-2017 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp;
24 |
25 | import org.bytedeco.javacpp.annotation.ByPtr;
26 | import org.bytedeco.javacpp.annotation.ByRef;
27 | import org.bytedeco.javacpp.annotation.ByVal;
28 | import org.bytedeco.javacpp.annotation.ValueSetter;
29 | import org.bytedeco.javacpp.tools.Generator;
30 |
31 | /**
32 | * All peer classes to function pointers must derive from FunctionPointer.
33 | * Defining a subclass lets {@link Generator} create a native function type.
34 | * A C++ function object gets instantiated for each call to {@code allocate()}
35 | * as well. That function object can be accessed by annotating any method
36 | * parameter with {@link ByVal} or {@link ByRef}. By default, an actual
37 | * function pointer gets passed {@link ByPtr}.
38 | *
39 | * To use FunctionPointer, subclass and add a native method named {@code call()}
40 | * or {@code apply()}, along with its return type and parameters, as well as the
41 | * usual {@code native void allocate()} method to support explicit allocation,
42 | * which is typically a requirement for callback functions. We can implement a
43 | * callback in Java by further subclassing and overriding {@code call/apply()}.
44 | *
45 | * If you have an address to a native function, it is also possible to call it
46 | * by defining a {@link ValueSetter} method with a single {@link Pointer} parameter,
47 | * along with {@code native} declarations for {@code allocate()} and {@code call()}.
48 | * After allocating the object and setting the value, we can be call it from Java.
49 | *
50 | * @see Generator
51 | *
52 | * @author Samuel Audet
53 | */
54 | public abstract class FunctionPointer extends Pointer {
55 | protected FunctionPointer() { }
56 | protected FunctionPointer(Pointer p) { super(p); }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/LoadEnabled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | package org.bytedeco.javacpp;
23 |
24 | import org.bytedeco.javacpp.annotation.Properties;
25 | import org.osgi.annotation.versioning.ConsumerType;
26 |
27 | /**
28 | * Classes implementing this interface can access and modify the {@link ClassProperties}
29 | * produced from their {@link Properties} when {@link Loader#load(Class)} gets called on them.
30 | *
31 | * Note that this interface is intended to be implemented by users of JavaCPP and so is marked
32 | * as a {@link ConsumerType} interface. Adding methods will be considered a breaking change.
33 | *
34 | * @see Loader
35 | *
36 | * @author Samuel Audet
37 | */
38 | @ConsumerType
39 | public interface LoadEnabled {
40 | void init(ClassProperties properties);
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Allocator.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.FunctionPointer;
9 | import org.bytedeco.javacpp.Pointer;
10 | import org.bytedeco.javacpp.tools.Generator;
11 |
12 | /**
13 | * An annotation indicating that a method should behave like an allocator.
14 | * However, methods with signature {@code native void allocate(...)} are recognized
15 | * as allocators even without annotation. This behavior can be changed by annotating
16 | * the method with the {@link Function} annotation. An allocator must have no
17 | * return values, but can have parameters corresponding to the ones found on the
18 | * native C++ constructors.
19 | *
20 | * In a nutshell, an allocator uses the C++ {@code new} operator along with all
21 | * the given arguments, and initializes the {@link Pointer#address} as well as
22 | * the {@link Pointer#deallocator} with {@code NativeDeallocator}, based on the
23 | * {@code delete} operator, if not additionally annotated with {@link NoDeallocator}.
24 | *
25 | * Can also be used on classes to set the {@link #max} value for enclosed function pointers.
26 | *
27 | * @see Pointer#init(long, long, long, long)
28 | * @see Generator
29 | *
30 | * @author Samuel Audet
31 | */
32 | @Documented @Retention(RetentionPolicy.RUNTIME)
33 | @Target({ElementType.TYPE, ElementType.METHOD})
34 | public @interface Allocator {
35 | /** The maximum number of instances that can be allocated in the case of a {@link FunctionPointer} subclass.
36 | * Does not affect the underlying function object or other {@link Pointer} which have no such allocation limits. */
37 | int max() default 10;
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ArrayAllocator.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * An annotation indicating that a method should behave like an array allocator.
13 | * However, methods with signature {@code native void allocateArray(int)} are
14 | * recognized as array allocators even without annotation. This behavior can be
15 | * changed by annotating the method with the {@link Function} annotation.
16 | *
17 | * In a nutshell, an array allocator uses the C++ {@code new[]} operator, and
18 | * initializes the {@link Pointer#address} as well as the {@link Pointer#deallocator}
19 | * with {@code NativeDeallocator}, based on the {@code delete[]} operator, if
20 | * not additionally annotated with {@link NoDeallocator}.
21 | *
22 | * @see Pointer#init(long, long, long, long)
23 | * @see Generator
24 | *
25 | * @author Samuel Audet
26 | */
27 | @Documented @Retention(RetentionPolicy.RUNTIME)
28 | @Target({ElementType.METHOD})
29 | public @interface ArrayAllocator { }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/AsUtf16.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import org.bytedeco.javacpp.tools.Generator;
4 |
5 | import java.lang.annotation.*;
6 |
7 | /**
8 | * Indicates that {@link java.lang.String} should be mapped to array of UTF-16
9 | * code units ({@code char16_t*}) instead of byte array ({@code const char*}).
10 | *
11 | * @see Generator
12 | *
13 | * @author Alexey Rochev
14 | */
15 |
16 | @Documented @Retention(RetentionPolicy.RUNTIME)
17 | @Target({ElementType.METHOD, ElementType.PARAMETER})
18 | public @interface AsUtf16 { }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ByPtr.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * Indicates that an argument should get passed or returned by pointer. By default,
13 | * all {@link Pointer} and array arguments get passed by pointer. Since it is
14 | * not used for any other purposes at the moment, this annotation has no effect.
15 | *
16 | * @see Generator
17 | *
18 | * @author Samuel Audet
19 | */
20 | @Documented @Retention(RetentionPolicy.RUNTIME)
21 | @Target({ElementType.METHOD, ElementType.PARAMETER})
22 | public @interface ByPtr { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ByPtrPtr.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.PointerPointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * Indicates that an argument gets passed or returned by a pointer to a pointer.
13 | * This is usually used as a shortcut for the more versatile {@link PointerPointer}
14 | * peer class, but where the latter is not needed because the argument is not an array.
15 | *
16 | * @see Generator
17 | *
18 | * @author Samuel Audet
19 | */
20 | @Documented @Retention(RetentionPolicy.RUNTIME)
21 | @Target({ElementType.METHOD, ElementType.PARAMETER})
22 | public @interface ByPtrPtr { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ByPtrRef.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Indicates that an argument gets passed or returned by a reference to a pointer.
12 | * In C++, such a beast looks like {@code *&}, usually to output pointers via parameters.
13 | *
14 | * @see Generator
15 | *
16 | * @author Samuel Audet
17 | */
18 | @Documented @Retention(RetentionPolicy.RUNTIME)
19 | @Target({ElementType.METHOD, ElementType.PARAMETER})
20 | public @interface ByPtrRef { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ByRef.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.FunctionPointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * Indicates that an argument gets passed or returned by reference. When used
13 | * alongside {@link FunctionPointer}, the {@link Generator} passes the underlying
14 | * C++ function object (aka functor) instead of a function pointer.
15 | *
16 | * @see Generator
17 | *
18 | * @author Samuel Audet
19 | */
20 | @Documented @Retention(RetentionPolicy.RUNTIME)
21 | @Target({ElementType.METHOD, ElementType.PARAMETER})
22 | public @interface ByRef {
23 | /** When true indicates that the argument actually needs to be an rvalue reference (aka movable value). */
24 | boolean value() default false;
25 | /** A C++ expression to use when null is passed. By default {@link NullPointerException} is thrown. */
26 | String nullValue() default "";
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ByVal.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.FunctionPointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * Indicates that an argument gets passed or returned by value. When used
13 | * alongside {@link FunctionPointer}, the {@link Generator} passes the underlying
14 | * C++ function object (aka functor) instead of a function pointer.
15 | *
16 | * @see Generator
17 | *
18 | * @author Samuel Audet
19 | */
20 | @Documented @Retention(RetentionPolicy.RUNTIME)
21 | @Target({ElementType.METHOD, ElementType.PARAMETER})
22 | public @interface ByVal {
23 | /** A C++ expression to use when null is passed. By default {@link NullPointerException} is thrown. */
24 | String nullValue() default "";
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Cast.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Indicates a type cast required on the argument to satisfy the native compiler.
12 | * When used with {@link Adapter} a second cast can also be specified making it
13 | * possible to apply a cast to both the argument and the adapter, in this order.
14 | * A third "precast" can also be specified, which gets applied before the second one,
15 | but also on return values passed to adapters.
16 | *
17 | * At the moment, {@link Generator} makes use of the simple C-style cast. If one
18 | * requires a different kind of type conversion, such as the {@code dynamic_cast}
19 | * operator, those can be accessed as if they were functions (with the {@link Name}
20 | * annotation to specify the type) because they have the same syntax.
21 | *
22 | * @see Generator
23 | *
24 | * @author Samuel Audet
25 | */
26 | @Documented @Retention(RetentionPolicy.RUNTIME)
27 | @Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
28 | public @interface Cast {
29 | String[] value();
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Const.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.FunctionPointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * A shortcut annotation to {@link Cast} that simply adds {@code const} to the parameter type, function, or class.
13 | *
14 | *
ArrayElements} methods.
10 | * However these methods copy the underlying data. With this annotation, the generated
11 | * code will always call the {@code Get/ReleasePrimitiveArrayCritical} methods instead.
12 | *
13 | * @see Generator
14 | *
15 | */
16 | @Documented @Retention(RetentionPolicy.RUNTIME)
17 | @Target({ElementType.TYPE, ElementType.METHOD})
18 | public @interface CriticalRegion { }
19 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Function.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Overrides the detection of allocators, getters, and setters. Indicates to the
12 | * {@link Generator} that we wish the method to call the corresponding C++ function.
13 | *
14 | * @see Allocator
15 | * @see ArrayAllocator
16 | * @see MemberGetter
17 | * @see MemberSetter
18 | * @see ValueSetter
19 | * @see ValueGetter
20 | * @see Generator
21 | *
22 | * @author Samuel Audet
23 | */
24 | @Documented @Retention(RetentionPolicy.RUNTIME)
25 | @Target({ElementType.METHOD})
26 | public @interface Function { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Index.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Allows using method arguments to call {@code operator[]} in some circumstances.
12 | * For example, a call like {@code (*this)[i].foo(str)} could be accomplished with
13 | * {@code @Index native void foo(int i, String str)}.
14 | *
15 | * @see Generator
16 | *
17 | * @author Samuel Audet
18 | */
19 | @Documented @Retention(RetentionPolicy.RUNTIME)
20 | @Target({ElementType.METHOD})
21 | public @interface Index {
22 | /** The number of indices spread over the parameters, for multidimensional access. */
23 | int value() default 1;
24 | /** The name of a function to call instead of {@code operator[]}, for example, "at". */
25 | String function() default "";
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/MemberGetter.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * An annotation indicating that a method should behave like a member getter.
12 | * However, a pair of methods with the same name, where the return value type of
13 | * the one short by a parameter equals the type of the extra parameter of the other,
14 | * whose return value type is {@code void} or of the enclosing class, are recognized
15 | * as a member getter/setter pair even without annotation. This behavior can be
16 | * changed by annotating the methods with the {@link Function} annotation.
17 | *
18 | * A member getter either needs to return a value or accept a primitive array
19 | * as argument. The value returned is assumed to come from a member variable,
20 | * but anything that follows the same syntax as member variable access could
21 | * potential work with this annotation. For getters with a return value, all
22 | * arguments are considered as indices to access a member array.
23 | *
24 | * @see Generator
25 | *
26 | * @author Samuel Audet
27 | */
28 | @Documented @Retention(RetentionPolicy.RUNTIME)
29 | @Target({ElementType.METHOD})
30 | public @interface MemberGetter { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/MemberSetter.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * An annotation indicating that a method should behave like a member setter.
12 | * However, a pair of methods with the same name, where the return value type of
13 | * the one short by a parameter equals the type of the extra parameter of the other,
14 | * whose return value type is {@code void} or of the enclosing class, are recognized
15 | * as a member getter/setter pair even without annotation. This behavior can be
16 | * changed by annotating the methods with the {@link Function} annotation.
17 | *
18 | * A member setter must return no value, or an object of its own {@link Class},
19 | * while its number of parameters must be greater than 0. The assigned value is
20 | * assumed to be a member variable, but anything that follows the same syntax as
21 | * the assignment of a member variable could potentially work with this annotation.
22 | * All but the last argument are considered as indices to access a member array.
23 | *
24 | * @see Generator
25 | *
26 | * @author Samuel Audet
27 | */
28 | @Documented @Retention(RetentionPolicy.RUNTIME)
29 | @Target({ElementType.METHOD})
30 | public @interface MemberSetter { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Name.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Names the identifier of a native C++ struct, class, union, function, variable,
12 | * operator, macro, etc. Without this annotation, {@link Generator} guesses the
13 | * native name based on the name of the Java peer. However, it may sometimes be
14 | * impossible to use the same name in Java, for example, in the case of overloaded
15 | * operators or to specify template arguments, while other times we may need to
16 | * access by name, for example, a callback pointer or function object, from C++.
17 | * For all those cases, we require this annotation.
18 | *
19 | * @see Generator
20 | *
21 | * @author Samuel Audet
22 | */
23 | @Documented @Retention(RetentionPolicy.RUNTIME)
24 | @Target({ElementType.TYPE, ElementType.METHOD})
25 | public @interface Name {
26 | /** The second element gets used as a suffix to work around arrays of anonymous struct or union. */
27 | String[] value();
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Namespace.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Encloses the scope of a Java class inside the scope of the given C++ namespace.
12 | * The namespace also gets nested when applied to nested Java classes, but the
13 | * annotation accepts as well a string of nested namespaces with the help of the
14 | * usual "::" separator, while one that starts with "::" resets the namespace to
15 | * the global scope.
16 | *
17 | * This annotation can also be applied in a more Java-like fashion on each method.
18 | * Further, a namespace annotation with an empty value can be used to indicate
19 | * that the identifier does not support namespaces (such as macros).
20 | *
21 | * @see Generator
22 | *
23 | * @author Samuel Audet
24 | */
25 | @Documented @Retention(RetentionPolicy.RUNTIME)
26 | @Target({ElementType.TYPE, ElementType.METHOD})
27 | public @interface Namespace {
28 | String value() default "";
29 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/NoDeallocator.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * By default, all allocators attach a deallocator to the peer object on creation.
12 | * This way, the deallocator automatically gets called during garbage collection.
13 | * Since an allocator uses the {@code new} (or for arrays the {@code new[]})
14 | * operator, the deallocator produced uses the {@code delete} (or {@code delete[]})
15 | * operator. However, if that operator is not accessible, or the native library
16 | * does not use that operator for object deallocation, we may apply this annotation
17 | * to an allocator method to prevent it from using these operators.
18 | *
19 | * @see Allocator
20 | * @see ArrayAllocator
21 | * @see Generator
22 | *
23 | * @author Samuel Audet
24 | */
25 | @Documented @Retention(RetentionPolicy.RUNTIME)
26 | @Target({ElementType.TYPE, ElementType.METHOD})
27 | public @interface NoDeallocator { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/NoException.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * By default, {@link Generator} assumes all native functions may throw exceptions.
12 | * This way, any C++ exception thrown from a function gets caught and translated
13 | * into a {@link RuntimeException}. However, this adds some overhead and requires
14 | * additional support from the compiler. Annotating a class or a method with this
15 | * annotation indicates that none of the enclosed functions can throw exceptions,
16 | * and need not be included in a {@code try{ ... }} block.
17 | *
18 | * @see Generator
19 | *
20 | * @author Samuel Audet
21 | */
22 | @Documented @Retention(RetentionPolicy.RUNTIME)
23 | @Target({ElementType.TYPE, ElementType.METHOD})
24 | public @interface NoException {
25 | /** On override, indicates whether to use the C++ noexcept specifier or not. */
26 | boolean value() default false;
27 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/NoOffset.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Loader;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * By default, {@link Generator} applies {@code offsetof()} to all member variables.
13 | * For each value returned {@link Loader#putMemberOffset(String, String, int)}
14 | * gets called, allowing to query efficiently those values from Java at a later
15 | * point by calling {@link Loader#offsetof(Class, String)}. However, this is
16 | * only guaranteed to work on plain old data (POD) {@code struct}. To prevent
17 | * the C++ compiler from complaining in other cases, we can add this annotation
18 | * to the peer class declaration.
19 | *
20 | * @see Generator
21 | *
22 | * @author Samuel Audet
23 | */
24 | @Documented @Retention(RetentionPolicy.RUNTIME)
25 | @Target({ElementType.TYPE, ElementType.METHOD})
26 | public @interface NoOffset { }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Opaque.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * This annotation must be used for native types that get declared but not defined.
13 | * Such types do not work with the {@code sizeof()} operator and their pointers
14 | * do not support arithmetic, so for peer classes thus annotated, {@link Generator}
15 | * then also ignores the {@link Pointer#position} value.
16 | *
17 | * @see Generator
18 | *
19 | * @author Samuel Audet
20 | */
21 | @Documented @Retention(RetentionPolicy.RUNTIME)
22 | @Target({ElementType.TYPE})
23 | public @interface Opaque { }
24 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Optional.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * A shorthand for {@code @Adapter("OptionalAdapter")}.
13 | * We can also define the {@code OPTIONAL_NAMESPACE} macro
14 | * to something like {@code boost} instead of the default {@code std}.
15 | *
16 | * @see Adapter
17 | * @see Generator
18 | *
19 | * @author Samuel Audet
20 | */
21 | @Documented @Retention(RetentionPolicy.RUNTIME)
22 | @Target({ElementType.METHOD, ElementType.PARAMETER})
23 | @Adapter("OptionalAdapter")
24 | public @interface Optional {
25 | /** The template type of {@code OptionalAdapter}. If not specified, it is
26 | * inferred from the value type of the {@link Pointer} or Java array. */
27 | String value() default "";
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Properties.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Loader;
9 | import org.bytedeco.javacpp.tools.Builder;
10 | import org.bytedeco.javacpp.tools.Generator;
11 | import org.bytedeco.javacpp.tools.Parser;
12 |
13 | /**
14 | * Makes it possible to define more than one set of properties for each platform.
15 | * The effective set of properties are taken from all {@link Platform} values in
16 | * this annotation, but priority is given to values found later in the list, making
17 | * it possible to define a default set of properties as the first value of the array,
18 | * and specializing a smaller set of properties for each platform, subsequently.
19 | *
20 | * A class with this annotation gets recognized as top-level enclosing class by
21 | * {@link Loader#getEnclosingClass(Class)}, with the same implications as with
22 | * the {@link Platform} annotation.
23 | *
24 | * Additionally, it is possible to inherit properties from another class also
25 | * annotated with this annotation, and specialize further for the current class.
26 | *
27 | * @see Builder
28 | * @see Generator
29 | * @see Loader
30 | * @see Parser
31 | *
32 | * @author Samuel Audet
33 | */
34 | @Documented @Retention(RetentionPolicy.RUNTIME)
35 | @Target({ElementType.TYPE})
36 | public @interface Properties {
37 | /** A list of classes from which to inherit properties. */
38 | Class[] inherit() default {};
39 | /** A list of platform names to be used as default for {@link #value()}. */
40 | String[] names() default {};
41 | /** A list of properties for different platforms. */
42 | Platform[] value() default {};
43 | /** The target Java source code file of the {@link Parser}, unless {@link #global()} is set,
44 | in which case this specifies the target Java package. */
45 | String target() default "";
46 | /** The name of a class where to output any global declarations that are not in classes.
47 | If left empty, considers the {@link #target()} as a class where to put everything. */
48 | String global() default "";
49 | /** An optional helper class the {@link Parser} should use as base for the global class.
50 | Defaults to the class where this annotation was found. */
51 | String helper() default "";
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Raw.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import java.nio.Buffer;
9 | import org.bytedeco.javacpp.Pointer;
10 | import org.bytedeco.javacpp.tools.Generator;
11 |
12 | /**
13 | * Allows passing and returning Java objects with native functions and raw JNI types.
14 | * By default, only descendents of {@link Pointer}, direct NIO {@link Buffer},
15 | * {@link String}, primitive types, and their arrays are allowed as arguments to
16 | * native functions. We can use this annotation to tell the {@link Generator}
17 | * that we wish to manipulate the actual raw JNI objects in C++.
18 | *
19 | * @see Generator
20 | *
21 | * @author Samuel Audet
22 | */
23 | @Documented @Retention(RetentionPolicy.RUNTIME)
24 | @Target({ElementType.METHOD, ElementType.PARAMETER})
25 | public @interface Raw {
26 | /** If {@code true}, passes the {@code JNIEnv*} as first argument to the native function. */
27 | boolean withEnv() default false;
28 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/SharedPtr.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * A shorthand for {@code @Adapter("SharedPtrAdapter")}.
13 | * We can also define the {@code SHARED_PTR_NAMESPACE} macro
14 | * to something like {@code boost} instead of the default {@code std}.
15 | *
16 | * @see Adapter
17 | * @see Generator
18 | *
19 | * @author Samuel Audet
20 | */
21 | @Documented @Retention(RetentionPolicy.RUNTIME)
22 | @Target({ElementType.METHOD, ElementType.PARAMETER})
23 | @Adapter("SharedPtrAdapter")
24 | public @interface SharedPtr {
25 | /** The template type of {@code SharedPtrAdapter}. If not specified, it is
26 | * inferred from the value type of the {@link Pointer} or Java array. */
27 | String value() default "";
28 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdBasicString.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 |
5 | import java.lang.annotation.Documented;
6 | import java.lang.annotation.ElementType;
7 | import java.lang.annotation.Retention;
8 | import java.lang.annotation.RetentionPolicy;
9 | import java.lang.annotation.Target;
10 |
11 | @Documented
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target({ElementType.METHOD, ElementType.PARAMETER})
14 | @Adapter("BasicStringAdapter")
15 | public @interface StdBasicString {
16 | /** The template type of {@code BasicStringAdapter}. If not specified, it is
17 | * inferred from the value type of the {@link Pointer} or Java array. */
18 | String value() default "";
19 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdMove.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * A shorthand for {@code @Adapter("MoveAdapter")}.
13 | *
14 | * @see Adapter
15 | * @see Generator
16 | *
17 | * @author Samuel Audet
18 | */
19 | @Documented @Retention(RetentionPolicy.RUNTIME)
20 | @Target({ElementType.METHOD, ElementType.PARAMETER})
21 | @Adapter("MoveAdapter")
22 | public @interface StdMove {
23 | /** The template type of {@code MoveAdapter}. If not specified, it is
24 | * inferred from the value type of the {@link Pointer} or Java array. */
25 | String value() default "";
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdString.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * A shorthand for {@code @Cast("std::string&") @Adapter("StringAdapter")}.
12 | *
13 | * @see Adapter
14 | * @see Generator
15 | *
16 | * @author Samuel Audet
17 | */
18 | @Documented @Retention(RetentionPolicy.RUNTIME)
19 | @Target({ElementType.METHOD, ElementType.PARAMETER})
20 | @Cast({"std::basic_string", "&"}) @Adapter("StringAdapter")
21 | public @interface StdString {
22 | String value() default "char";
23 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdU16String.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Documented
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Target({ElementType.METHOD, ElementType.PARAMETER})
12 | @Adapter("BasicStringAdapter")
13 | public @interface StdU16String {
14 | String value() default "char16_t";
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdU32String.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Documented
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Target({ElementType.METHOD, ElementType.PARAMETER})
12 | @Adapter("BasicStringAdapter")
13 | public @interface StdU32String {
14 | String value() default "int, char32_t";
15 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdVector.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * A shorthand for {@code @Adapter("VectorAdapter")}.
13 | *
14 | * @see Adapter
15 | * @see Generator
16 | *
17 | * @author Samuel Audet
18 | */
19 | @Documented @Retention(RetentionPolicy.RUNTIME)
20 | @Target({ElementType.METHOD, ElementType.PARAMETER})
21 | @Adapter("VectorAdapter")
22 | public @interface StdVector {
23 | /** The template type of {@code VectorAdapter}. If not specified, it is
24 | * inferred from the value type of the {@link Pointer} or Java array. */
25 | String value() default "";
26 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/StdWString.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * A shorthand for {@code @Cast("std::wstring&") @Adapter("StringAdapter")}.
12 | *
13 | * @see Adapter
14 | * @see Generator
15 | *
16 | * @author Samuel Audet
17 | */
18 | @Documented @Retention(RetentionPolicy.RUNTIME)
19 | @Target({ElementType.METHOD, ElementType.PARAMETER})
20 | @Cast({"std::basic_string", "&"}) @Adapter("StringAdapter")
21 | public @interface StdWString {
22 | String value() default "wchar_t";
23 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/UniquePtr.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.Pointer;
9 | import org.bytedeco.javacpp.tools.Generator;
10 |
11 | /**
12 | * A shorthand for {@code @Adapter("UniquePtrAdapter")}.
13 | * We can also define the {@code UNIQUE_PTR_NAMESPACE} macro
14 | * to something like {@code boost::movelib} instead of the default {@code std}.
15 | *
16 | * @see Adapter
17 | * @see Generator
18 | *
19 | * @author Samuel Audet
20 | */
21 | @Documented @Retention(RetentionPolicy.RUNTIME)
22 | @Target({ElementType.METHOD, ElementType.PARAMETER})
23 | @Adapter("UniquePtrAdapter")
24 | public @interface UniquePtr {
25 | /** The template type of {@code UniquePtrAdapter}. If not specified, it is
26 | * inferred from the value type of the {@link Pointer} or Java array. */
27 | String value() default "";
28 | }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ValueGetter.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * An annotation indicating that a method should behave like a value getter.
12 | * However, a pair of methods named {@code get()} and {@code put()}, where the
13 | * number of parameters are either equal, in the case of arrays, or differs by one
14 | * where the type of the extra parameter is the same as the return value of the other,
15 | * and the remaining return value types are {@code void} or of the enclosing class,
16 | * are recognized as a value getter/setter pair even without annotation. This behavior
17 | * can be changed by annotating the methods with the {@link Function} annotation.
18 | *
19 | * A value getter either needs to return a value or accept a primitive array
20 | * as argument. The value returned is assumed to come from pointer dereference,
21 | * but anything that follows the same syntax as pointer dereferencing could
22 | * potential work with this annotation. For getters with a return value, all
23 | * arguments are considered as indices to access a value array.
24 | *
25 | * @see Generator
26 | *
27 | * @author Samuel Audet
28 | */
29 | @Documented @Retention(RetentionPolicy.RUNTIME)
30 | @Target({ElementType.METHOD})
31 | public @interface ValueGetter { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/ValueSetter.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * An annotation indicating that a method should behave like a value setter.
12 | * However, a pair of methods named {@code get()} and {@code put()}, where the
13 | * number of parameters are either equal, in the case of arrays, or differs by one
14 | * where the type of the extra parameter is the same as the return value of the other,
15 | * and the remaining return value types are {@code void} or of the enclosing class,
16 | * are recognized as a value getter/setter pair even without annotation. This behavior
17 | * can be changed by annotating the methods with the {@link Function} annotation.
18 | *
19 | * A value setter must return no value, or an object of its own {@link Class}, while
20 | * its number of parameters must be greater than 0. The assigned value is assumed
21 | * to come from pointer dereference, but anything that follows the same syntax as the
22 | * assignment of a dereferenced pointer could potentially work with this annotation.
23 | * All but the last argument are considered as indices to access a value array.
24 | *
25 | * @see Generator
26 | *
27 | * @author Samuel Audet
28 | */
29 | @Documented @Retention(RetentionPolicy.RUNTIME)
30 | @Target({ElementType.METHOD})
31 | public @interface ValueSetter { }
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/Virtual.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.annotation;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 | import org.bytedeco.javacpp.tools.Generator;
9 |
10 | /**
11 | * Indicates that a method maps to a virtual function in C++.
12 | * This allows a user to override that function in Java.
13 | *
14 | * @see Generator
15 | *
16 | * @author Samuel Audet
17 | */
18 | @Documented @Retention(RetentionPolicy.RUNTIME)
19 | @Target({ElementType.METHOD})
20 | public @interface Virtual {
21 | /** Pure (abstract) or not. */
22 | boolean value() default false;
23 | boolean subclasses() default true;
24 | String method() default "";
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/annotation/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains all the annotation classes used by JavaCPP.
3 | */
4 | @org.osgi.annotation.bundle.Export
5 | package org.bytedeco.javacpp.annotation;
6 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/HighResolutionClock.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.ByVal;
5 | import org.bytedeco.javacpp.annotation.MemberGetter;
6 | import org.bytedeco.javacpp.annotation.Name;
7 | import org.bytedeco.javacpp.annotation.Properties;
8 |
9 | @Name("std::chrono::high_resolution_clock") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
10 | public class HighResolutionClock extends Pointer {
11 | static public native @ByVal HighResolutionTime now();
12 | static public native @MemberGetter boolean is_steady();
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/HighResolutionDuration.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::high_resolution_clock::duration") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class HighResolutionDuration extends Pointer {
8 | public HighResolutionDuration() { allocate(); }
9 | private native void allocate();
10 | public HighResolutionDuration(long r) { allocate(r); }
11 | private native void allocate(long r);
12 |
13 | public native @Name("operator=") @ByRef HighResolutionDuration put(@Const @ByRef HighResolutionDuration other);
14 | public native @Name("operator-") @ByVal HighResolutionDuration negate();
15 | public native @Name("operator++") @ByRef HighResolutionDuration increment();
16 | public native @Name("operator--") @ByRef HighResolutionDuration decrement();
17 | public native @Name("operator+=") @ByRef HighResolutionDuration addPut(@Const @ByRef HighResolutionDuration d);
18 | public native @Name("operator-=") @ByRef HighResolutionDuration subtractPut(@Const @ByRef HighResolutionDuration d);
19 | public native @Name("operator*=") @ByRef HighResolutionDuration multiplyPut(@Const @ByRef long rhs);
20 | public native @Name("operator%=") @ByRef HighResolutionDuration modPut(@Const @ByRef long rhs);
21 | public native @Name("operator%=") @ByRef HighResolutionDuration modPut(@Const @ByRef HighResolutionDuration rhs);
22 |
23 | public native long count();
24 | static public native @ByVal @Name("zero") HighResolutionDuration zero_();
25 | static public native @ByVal HighResolutionDuration min();
26 | static public native @ByVal HighResolutionDuration max();
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/HighResolutionTime.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::time_point") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class HighResolutionTime extends Pointer {
8 | public HighResolutionTime() { allocate(); }
9 | private native void allocate();
10 |
11 | public HighResolutionTime(HighResolutionDuration d) { allocate(d); }
12 | private native void allocate(@Const @ByRef HighResolutionDuration d);
13 |
14 | public native @ByVal HighResolutionTime time_since_epoch();
15 |
16 | public native @Name("operator +=") @ByRef HighResolutionTime addPut(@Const @ByRef HighResolutionDuration d);
17 | public native @Name("operator -=") @ByRef HighResolutionTime subtractPut(@Const @ByRef HighResolutionDuration d);
18 | static public native @ByVal HighResolutionTime min();
19 | static public native @ByVal HighResolutionTime max();
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/Hours.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::hours") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class Hours extends Pointer {
8 | public Hours() { allocate(); }
9 | private native void allocate();
10 | public Hours(long r) { allocate(r); }
11 | private native void allocate(long r);
12 |
13 | public native @Name("operator=") @ByRef Hours put(@Const @ByRef Hours other);
14 | public native @Name("operator-") @ByVal Hours negate();
15 | public native @Name("operator++") @ByRef Hours increment();
16 | public native @Name("operator--") @ByRef Hours decrement();
17 | public native @Name("operator+=") @ByRef Hours addPut(@Const @ByRef Hours d);
18 | public native @Name("operator-=") @ByRef Hours subtractPut(@Const @ByRef Hours d);
19 | public native @Name("operator*=") @ByRef Hours multiplyPut(@Const @ByRef int rhs);
20 | public native @Name("operator%=") @ByRef Hours modPut(@Const @ByRef int rhs);
21 | public native @Name("operator%=") @ByRef Hours modPut(@Const @ByRef Hours rhs);
22 |
23 | public native int count();
24 | static public native @ByVal @Name("zero") Hours zero_();
25 | static public native @ByVal Hours min();
26 | static public native @ByVal Hours max();
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/Microseconds.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::microseconds") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class Microseconds extends Pointer {
8 | public Microseconds() { allocate(); }
9 | private native void allocate();
10 | public Microseconds(long r) { allocate(r); }
11 | private native void allocate(long r);
12 |
13 | public Microseconds(Milliseconds d) { allocate(d); }
14 | private native void allocate(@Const @ByRef Milliseconds d);
15 | public Microseconds(Seconds d) { allocate(d); }
16 | private native void allocate(@Const @ByRef Seconds d);
17 | public Microseconds(Minutes d) { allocate(d); }
18 | private native void allocate(@Const @ByRef Minutes d);
19 | public Microseconds(Hours d) { allocate(d); }
20 | private native void allocate(@Const @ByRef Hours d);
21 |
22 | public native @Name("operator=") @ByRef Microseconds put(@Const @ByRef Microseconds other);
23 | public native @Name("operator-") @ByVal Microseconds negate();
24 | public native @Name("operator++") @ByRef Microseconds increment();
25 | public native @Name("operator--") @ByRef Microseconds decrement();
26 | public native @Name("operator+=") @ByRef Microseconds addPut(@Const @ByRef Microseconds d);
27 | public native @Name("operator-=") @ByRef Microseconds subtractPut(@Const @ByRef Microseconds d);
28 | public native @Name("operator*=") @ByRef Microseconds multiplyPut(@Const @ByRef long rhs);
29 | public native @Name("operator%=") @ByRef Microseconds modPut(@Const @ByRef long rhs);
30 | public native @Name("operator%=") @ByRef Microseconds modPut(@Const @ByRef Microseconds rhs);
31 |
32 | public native long count();
33 | static public native @ByVal @Name("zero") Microseconds zero_();
34 | static public native @ByVal Microseconds min();
35 | static public native @ByVal Microseconds max();
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/Milliseconds.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::milliseconds") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class Milliseconds extends Pointer {
8 | public Milliseconds() { allocate(); }
9 | private native void allocate();
10 | public Milliseconds(long r) { allocate(r); }
11 | private native void allocate(long r);
12 | public Milliseconds(Seconds d) { allocate(d); }
13 | private native void allocate(@Const @ByRef Seconds d);
14 | public Milliseconds(Minutes d) { allocate(d); }
15 | private native void allocate(@Const @ByRef Minutes d);
16 | public Milliseconds(Hours d) { allocate(d); }
17 | private native void allocate(@Const @ByRef Hours d);
18 |
19 | public native @Name("operator=") @ByRef Milliseconds put(@Const @ByRef Milliseconds other);
20 | public native @Name("operator-") @ByVal Milliseconds negate();
21 | public native @Name("operator++") @ByRef Milliseconds increment();
22 | public native @Name("operator--") @ByRef Milliseconds decrement();
23 | public native @Name("operator+=") @ByRef Milliseconds addPut(@Const @ByRef Milliseconds d);
24 | public native @Name("operator-=") @ByRef Milliseconds subtractPut(@Const @ByRef Milliseconds d);
25 | public native @Name("operator*=") @ByRef Milliseconds multiplyPut(@Const @ByRef long rhs);
26 | public native @Name("operator%=") @ByRef Milliseconds modPut(@Const @ByRef long rhs);
27 | public native @Name("operator%=") @ByRef Milliseconds modPut(@Const @ByRef Milliseconds rhs);
28 |
29 | public native long count();
30 | static public native @ByVal @Name("zero") Milliseconds zero_();
31 | static public native @ByVal Milliseconds min();
32 | static public native @ByVal Milliseconds max();
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/Minutes.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::minutes") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class Minutes extends Pointer {
8 | public Minutes() { allocate(); }
9 | private native void allocate();
10 | public Minutes(long r) { allocate(r); }
11 | private native void allocate(long r);
12 | public Minutes(Hours d) { allocate(d); }
13 | private native void allocate(@Const @ByRef Hours d);
14 |
15 | public native @Name("operator=") @ByRef Minutes put(@Const @ByRef Minutes other);
16 | public native @Name("operator-") @ByVal Minutes negate();
17 | public native @Name("operator++") @ByRef Minutes increment();
18 | public native @Name("operator--") @ByRef Minutes decrement();
19 | public native @Name("operator+=") @ByRef Minutes addPut(@Const @ByRef Minutes d);
20 | public native @Name("operator-=") @ByRef Minutes subtractPut(@Const @ByRef Minutes d);
21 | public native @Name("operator*=") @ByRef Minutes multiplyPut(@Const @ByRef int rhs);
22 | public native @Name("operator%=") @ByRef Minutes modPut(@Const @ByRef int rhs);
23 | public native @Name("operator%=") @ByRef Minutes modPut(@Const @ByRef Minutes rhs);
24 |
25 | public native int count();
26 | static public native @ByVal @Name("zero") Minutes zero_();
27 | static public native @ByVal Minutes min();
28 | static public native @ByVal Minutes max();
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/Nanoseconds.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::nanoseconds") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class Nanoseconds extends Pointer {
8 | public Nanoseconds() { allocate(); }
9 | private native void allocate();
10 | public Nanoseconds(long r) { allocate(r); }
11 | private native void allocate(long r);
12 | public Nanoseconds(Microseconds d) { allocate(d); }
13 | private native void allocate(@Const @ByRef Microseconds d);
14 | public Nanoseconds(Milliseconds d) { allocate(d); }
15 | private native void allocate(@Const @ByRef Milliseconds d);
16 | public Nanoseconds(Seconds d) { allocate(d); }
17 | private native void allocate(@Const @ByRef Seconds d);
18 | public Nanoseconds(Minutes d) { allocate(d); }
19 | private native void allocate(@Const @ByRef Minutes d);
20 | public Nanoseconds(Hours d) { allocate(d); }
21 | private native void allocate(@Const @ByRef Hours d);
22 | public Nanoseconds(SystemDuration d) { super((Pointer)null); allocate(d); };
23 | private native void allocate(@Const @ByRef SystemDuration d);
24 | public Nanoseconds(HighResolutionDuration d) { super((Pointer)null); allocate(d); };
25 | private native void allocate(@Const @ByRef HighResolutionDuration d);
26 | public Nanoseconds(SteadyDuration d) { super((Pointer)null); allocate(d); };
27 | private native void allocate(@Const @ByRef SteadyDuration d);
28 |
29 | public native @Name("operator=") @ByRef Nanoseconds put(@Const @ByRef Nanoseconds other);
30 | public native @Name("operator-") @ByVal Nanoseconds negate();
31 | public native @Name("operator++") @ByRef Nanoseconds increment();
32 | public native @Name("operator--") @ByRef Nanoseconds decrement();
33 | public native @Name("operator+=") @ByRef Nanoseconds addPut(@Const @ByRef Nanoseconds d);
34 | public native @Name("operator-=") @ByRef Nanoseconds subtractPut(@Const @ByRef Nanoseconds d);
35 | public native @Name("operator*=") @ByRef Nanoseconds multiplyPut(@Const @ByRef long rhs);
36 | public native @Name("operator%=") @ByRef Nanoseconds modPut(@Const @ByRef long rhs);
37 | public native @Name("operator%=") @ByRef Nanoseconds modPut(@Const @ByRef Nanoseconds rhs);
38 |
39 | public native long count();
40 | static public native @ByVal @Name("zero") Nanoseconds zero_();
41 | static public native @ByVal Nanoseconds min();
42 | static public native @ByVal Nanoseconds max();
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/Seconds.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::seconds") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class Seconds extends Pointer {
8 | public Seconds() { allocate(); }
9 | private native void allocate();
10 | public Seconds(long r) { allocate(r); }
11 | private native void allocate(long r);
12 | public Seconds(Minutes d) { allocate(d); }
13 | private native void allocate(@Const @ByRef Minutes d);
14 | public Seconds(Hours d) { allocate(d); }
15 | private native void allocate(@Const @ByRef Hours d);
16 |
17 | public native @Name("operator=") @ByRef Seconds put(@Const @ByRef Seconds other);
18 | public native @Name("operator-") @ByVal Seconds negate();
19 | public native @Name("operator++") @ByRef Seconds increment();
20 | public native @Name("operator--") @ByRef Seconds decrement();
21 | public native @Name("operator+=") @ByRef Seconds addPut(@Const @ByRef Seconds d);
22 | public native @Name("operator-=") @ByRef Seconds subtractPut(@Const @ByRef Seconds d);
23 | public native @Name("operator*=") @ByRef Seconds multiplyPut(@Const @ByRef long rhs);
24 | public native @Name("operator%=") @ByRef Seconds modPut(@Const @ByRef long rhs);
25 | public native @Name("operator%=") @ByRef Seconds modPut(@Const @ByRef Seconds rhs);
26 |
27 | public native long count();
28 | static public native @ByVal @Name("zero") Seconds zero_();
29 | static public native @ByVal Seconds min();
30 | static public native @ByVal Seconds max();
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SecondsDouble.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::duration") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SecondsDouble extends Pointer {
8 | public SecondsDouble() { allocate(); }
9 | private native void allocate();
10 | public SecondsDouble(double r) { allocate(r); }
11 | private native void allocate(double r);
12 | public SecondsDouble(Nanoseconds d) { allocate(d); }
13 | private native void allocate(@Const @ByRef Nanoseconds d);
14 | public SecondsDouble(Seconds d) { allocate(d); }
15 | private native void allocate(@Const @ByRef Seconds d);
16 |
17 | public native @Name("operator=") @ByRef SecondsDouble put(@Const @ByRef SecondsDouble other);
18 | public native @Name("operator-") @ByVal SecondsDouble negate();
19 | public native @Name("operator++") @ByRef SecondsDouble increment();
20 | public native @Name("operator--") @ByRef SecondsDouble decrement();
21 | public native @Name("operator+=") @ByRef SecondsDouble addPut(@Const @ByRef SecondsDouble d);
22 | public native @Name("operator-=") @ByRef SecondsDouble subtractPut(@Const @ByRef SecondsDouble d);
23 | public native @Name("operator*=") @ByRef SecondsDouble multiplyPut(@Const @ByRef double rhs);
24 |
25 | public native double count();
26 | static public native @ByVal @Name("zero") SecondsDouble zero_();
27 | static public native @ByVal SecondsDouble min();
28 | static public native @ByVal SecondsDouble max();
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SecondsFloat.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::duration") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SecondsFloat extends Pointer {
8 | public SecondsFloat() { allocate(); }
9 | private native void allocate();
10 | public SecondsFloat(float r) { allocate(r); }
11 | private native void allocate(float r);
12 | public SecondsFloat(Nanoseconds d) { allocate(d); }
13 | private native void allocate(@Const @ByRef Nanoseconds d);
14 | public SecondsFloat(Seconds d) { allocate(d); }
15 | private native void allocate(@Const @ByRef Seconds d);
16 |
17 | public native @Name("operator=") @ByRef SecondsFloat put(@Const @ByRef SecondsFloat other);
18 | public native @Name("operator-") @ByVal SecondsFloat negate();
19 | public native @Name("operator++") @ByRef SecondsFloat increment();
20 | public native @Name("operator--") @ByRef SecondsFloat decrement();
21 | public native @Name("operator+=") @ByRef SecondsFloat addPut(@Const @ByRef SecondsFloat d);
22 | public native @Name("operator-=") @ByRef SecondsFloat subtractPut(@Const @ByRef SecondsFloat d);
23 | public native @Name("operator*=") @ByRef SecondsFloat multiplyPut(@Const @ByRef float rhs);
24 |
25 | public native float count();
26 | static public native @ByVal @Name("zero") SecondsFloat zero_();
27 | static public native @ByVal SecondsFloat min();
28 | static public native @ByVal SecondsFloat max();
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SteadyClock.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.ByVal;
5 | import org.bytedeco.javacpp.annotation.Name;
6 | import org.bytedeco.javacpp.annotation.Properties;
7 |
8 | @Name("std::chrono::steady_clock") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
9 | public class SteadyClock extends Pointer {
10 | static public native @ByVal SteadyTime now();
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SteadyDuration.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::steady_clock::duration") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SteadyDuration extends Pointer {
8 | public SteadyDuration() { allocate(); }
9 | private native void allocate();
10 | public SteadyDuration(long r) { allocate(r); }
11 | private native void allocate(long r);
12 |
13 | public native @Name("operator=") @ByRef SteadyDuration put(@Const @ByRef SteadyDuration other);
14 | public native @Name("operator-") @ByVal SteadyDuration negate();
15 | public native @Name("operator++") @ByRef SteadyDuration increment();
16 | public native @Name("operator--") @ByRef SteadyDuration decrement();
17 | public native @Name("operator+=") @ByRef SteadyDuration addPut(@Const @ByRef SteadyDuration d);
18 | public native @Name("operator-=") @ByRef SteadyDuration subtractPut(@Const @ByRef SteadyDuration d);
19 | public native @Name("operator*=") @ByRef SteadyDuration multiplyPut(@Const @ByRef long rhs);
20 | public native @Name("operator%=") @ByRef SteadyDuration modPut(@Const @ByRef long rhs);
21 | public native @Name("operator%=") @ByRef SteadyDuration modPut(@Const @ByRef SteadyDuration rhs);
22 |
23 | public native long count();
24 | static public native @ByVal @Name("zero") SteadyDuration zero_();
25 | static public native @ByVal SteadyDuration min();
26 | static public native @ByVal SteadyDuration max();}
27 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SteadyTime.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::time_point") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SteadyTime extends Pointer {
8 | public SteadyTime() { allocate(); }
9 | private native void allocate();
10 |
11 | public SteadyTime(SteadyDuration d) { allocate(d); }
12 | private native void allocate(@Const @ByRef SteadyDuration d);
13 |
14 | public native @ByVal SteadyDuration time_since_epoch();
15 |
16 | public native @Name("operator +=") @ByRef SteadyTime addPut(@Const @ByRef SteadyDuration d);
17 | public native @Name("operator -=") @ByRef SteadyTime subtractPut(@Const @ByRef SteadyDuration d);
18 | static public native @ByVal SteadyTime min();
19 | static public native @ByVal SteadyTime max();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SystemClock.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::system_clock") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SystemClock extends Pointer {
8 | static public native @ByVal SystemTime now();
9 | static public native @Cast("time_t") long to_time_t(@Const @ByRef SystemTime t);
10 | static public native @ByVal SystemTime from_time_t(@Cast("time_t") long t);
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SystemDuration.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::system_clock::duration") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SystemDuration extends Pointer {
8 | public SystemDuration() { allocate(); }
9 | private native void allocate();
10 | public SystemDuration(long r) { allocate(r); }
11 | private native void allocate(long r);
12 |
13 | public native @Name("operator=") @ByRef SystemDuration put(@Const @ByRef SystemDuration other);
14 | public native @Name("operator-") @ByVal SystemDuration negate();
15 | public native @Name("operator++") @ByRef SystemDuration increment();
16 | public native @Name("operator--") @ByRef SystemDuration decrement();
17 | public native @Name("operator+=") @ByRef SystemDuration addPut(@Const @ByRef SystemDuration d);
18 | public native @Name("operator-=") @ByRef SystemDuration subtractPut(@Const @ByRef SystemDuration d);
19 | public native @Name("operator*=") @ByRef SystemDuration multiplyPut(@Const @ByRef long rhs);
20 | public native @Name("operator%=") @ByRef SystemDuration modPut(@Const @ByRef long rhs);
21 | public native @Name("operator%=") @ByRef SystemDuration modPut(@Const @ByRef SystemDuration rhs);
22 |
23 | public native long count();
24 | static public native @ByVal @Name("zero") SystemDuration zero_();
25 | static public native @ByVal SystemDuration min();
26 | static public native @ByVal SystemDuration max();
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/chrono/SystemTime.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.chrono;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 | import org.bytedeco.javacpp.annotation.*;
5 |
6 | @Name("std::chrono::time_point") @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
7 | public class SystemTime extends Pointer {
8 | public SystemTime() { allocate(); }
9 | private native void allocate();
10 |
11 | public SystemTime(SystemDuration d) { allocate(d); }
12 | private native void allocate(@Const @ByRef SystemDuration d);
13 |
14 | public native @ByVal SystemDuration time_since_epoch();
15 |
16 | public native @Name("operator +=") @ByRef SystemTime addPut(@Const @ByRef SystemDuration d);
17 | public native @Name("operator -=") @ByRef SystemTime subtractPut(@Const @ByRef SystemDuration d);
18 | static public native @ByVal SystemTime min();
19 | static public native @ByVal SystemTime max();
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/global/chrono.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.global;
2 |
3 | import org.bytedeco.javacpp.annotation.Properties;
4 |
5 | @Properties(inherit = org.bytedeco.javacpp.presets.chrono.class)
6 | public class chrono {
7 | }
8 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/indexer/Indexable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.indexer;
24 |
25 | /**
26 | * An interface implemented to let users access data classes via an {@link Indexer}.
27 | * The class implementing this interface can choose the type (byte, short, etc.) of
28 | * the indexer, and whether it is array-based or direct. The {@link Indexer#release()}
29 | * method should also be overridden to copy back any data written in the case of
30 | * non-direct indexers.
31 | *
32 | * @author Samuel Audet
33 | */
34 | public interface Indexable {
35 | /**
36 | * Factory method called by the user to get an indexer to access the data.
37 | * Eventually, {@link Indexer#release()} should be called to have changes
38 | * reflected in the underlying data.
39 | *
40 | * @param the type of the returned object
41 | * @param direct a hint for the implementation, leaving the choice up to the user, since
42 | * buffers are slower than arrays on Android, but not with OpenJDK, for example
43 | * @return a concrete {@link Indexer}
44 | * @throws NullPointerException when there is no data
45 | */
46 | I createIndexer(boolean direct);
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/indexer/OneIndex.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Matteo Di Giovinazzo, Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.indexer;
24 |
25 | /**
26 | * An Index that supports only one size (a single dimension).
27 | *
28 | * @author Matteo Di Giovinazzo
29 | */
30 | public class OneIndex extends Index {
31 |
32 | /** Constructor to set the {@link #sizes}. */
33 | public OneIndex(long size) {
34 | super(size);
35 | }
36 |
37 | /** Returns {@code i}. */
38 | @Override public long index(long i) {
39 | return i;
40 | }
41 |
42 | /** Throws {@code new UnsupportedOperationException()}. */
43 | @Override public long index(long i, long j) {
44 | throw new UnsupportedOperationException();
45 | }
46 |
47 | /** Throws {@code new UnsupportedOperationException()}. */
48 | @Override public long index(long i, long j, long k) {
49 | throw new UnsupportedOperationException();
50 | }
51 |
52 | /** Returns {@code indices[0]} if {@code indices.length == 1} or throws {@code new UnsupportedOperationException()}. */
53 | @Override public long index(long... indices) {
54 | if (indices.length == 1) {
55 | return indices[0];
56 | }
57 | throw new UnsupportedOperationException();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/indexer/Raw.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016-2018 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | package org.bytedeco.javacpp.indexer;
23 |
24 | /**
25 | * The raw memory interface supporting long indexing.
26 | *
27 | * @author Samuel Audet
28 | */
29 | abstract class Raw {
30 |
31 | static final Raw INSTANCE;
32 | static {
33 | if (UnsafeRaw.isAvailable()) {
34 | INSTANCE = new UnsafeRaw();
35 | } else {
36 | INSTANCE = null;
37 | }
38 | }
39 | /** Returns {@link UnsafeRaw} if {@code UnsafeRaw.isAvailable()} or null otherwise. */
40 | static Raw getInstance() {
41 | return INSTANCE;
42 | }
43 |
44 | abstract byte getByte(long address);
45 | abstract void putByte(long address, byte b);
46 | abstract short getShort(long address);
47 | abstract void putShort(long address, short s);
48 | abstract int getInt(long address);
49 | abstract void putInt(long address, int i);
50 | abstract long getLong(long address);
51 | abstract void putLong(long address, long l);
52 | abstract float getFloat(long address);
53 | abstract void putFloat(long address, float f);
54 | abstract double getDouble(long address);
55 | abstract void putDouble(long address, double d);
56 | abstract char getChar(long address);
57 | abstract void putChar(long address, char c);
58 | abstract boolean getBoolean(long address);
59 | abstract void putBoolean(long address, boolean b);
60 |
61 | abstract byte getByte(byte[] array, long offset);
62 | abstract void putByte(byte[] array, long offset, byte b);
63 | abstract short getShort(byte[] array, long offset);
64 | abstract void putShort(byte[] array, long offset, short s);
65 | abstract int getInt(byte[] array, long offset);
66 | abstract void putInt(byte[] array, long offset, int i);
67 | abstract long getLong(byte[] array, long offset);
68 | abstract void putLong(byte[] array, long offset, long l);
69 | abstract float getFloat(byte[] array, long offset);
70 | abstract void putFloat(byte[] array, long offset, float f);
71 | abstract double getDouble(byte[] array, long offset);
72 | abstract void putDouble(byte[] array, long offset, double d);
73 | abstract char getChar(byte[] array, long offset);
74 | abstract void putChar(byte[] array, long offset, char c);
75 | abstract boolean getBoolean(byte[] array, long offset);
76 | abstract void putBoolean(byte[] array, long offset, boolean b);
77 | }
78 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/indexer/StrideIndex.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Matteo Di Giovinazzo, Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.indexer;
24 |
25 | /**
26 | * An Index that computes a linear index from given array sizes and strides.
27 | *
28 | * @author Matteo Di Giovinazzo
29 | */
30 | public class StrideIndex extends Index {
31 |
32 | /**
33 | * Returns default (row-major contiguous) strides for the given sizes.
34 | */
35 | public static long[] defaultStrides(long... sizes) {
36 | long[] strides = new long[sizes.length];
37 | strides[sizes.length - 1] = 1;
38 | for (int i = sizes.length - 2; i >= 0; i--) {
39 | strides[i] = strides[i + 1] * sizes[i + 1];
40 | }
41 | return strides;
42 | }
43 |
44 | /**
45 | * The number of elements to skip to reach the next element in a given dimension.
46 | * {@code strides[i] > strides[i + 1] && strides[strides.length - 1] == 1} preferred.
47 | */
48 | protected final long[] strides;
49 |
50 | /** Calls {@code StrideIndex(sizes, defaultStrides(sizes))}. */
51 | public StrideIndex(long... sizes) {
52 | this(sizes, defaultStrides(sizes));
53 | }
54 |
55 | /** Constructor to set the {@link #sizes} and {@link #strides}. */
56 | public StrideIndex(long[] sizes, long[] strides) {
57 | super(sizes);
58 | this.strides = strides;
59 | }
60 |
61 | /** Returns {@link #strides}. */
62 | public long[] strides() {
63 | return strides;
64 | }
65 |
66 | /** Returns {@code i * strides[0]}. */
67 | @Override public long index(long i) {
68 | return i * strides[0];
69 | }
70 |
71 | /** Returns {@code i * strides[0] + j * strides[1]}. */
72 | @Override public long index(long i, long j) {
73 | return i * strides[0] + j * strides[1];
74 | }
75 |
76 | /** Returns {@code i * strides[0] + j * strides[1] + k * strides[2]}. */
77 | @Override public long index(long i, long j, long k) {
78 | return i * strides[0] + j * strides[1] + k * strides[2];
79 | }
80 |
81 | /**
82 | * Computes the linear index as the dot product of indices and strides.
83 | *
84 | * @param indices of each dimension
85 | * @return index to access array or buffer
86 | */
87 | @Override public long index(long... indices) {
88 | long index = 0;
89 | for (int i = 0; i < indices.length && i < strides.length; i++) {
90 | index += indices[i] * strides[i];
91 | }
92 | return index;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/indexer/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes for multidimensional access of arrays and buffers.
3 | */
4 | @org.osgi.annotation.bundle.Export
5 | package org.bytedeco.javacpp.indexer;
6 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains the main set of classes for JavaCPP at runtime.
3 | */
4 | @org.osgi.annotation.bundle.Export
5 | package org.bytedeco.javacpp;
6 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/presets/chrono.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.presets;
2 |
3 | import org.bytedeco.javacpp.annotation.Platform;
4 | import org.bytedeco.javacpp.annotation.Properties;
5 | import org.bytedeco.javacpp.tools.Info;
6 | import org.bytedeco.javacpp.tools.InfoMap;
7 | import org.bytedeco.javacpp.tools.InfoMapper;
8 |
9 | @Properties(
10 | inherit = javacpp.class,
11 | target = "org.bytedeco.javacpp.chrono",
12 | global = "org.bytedeco.javacpp.global.chrono"
13 | )
14 | public class chrono implements InfoMapper {
15 | @Override public void map(InfoMap infoMap) {
16 | infoMap
17 | .put(new Info("std::chrono::high_resolution_clock").pointerTypes("HighResolutionClock"))
18 | .put(new Info("std::chrono::steady_clock").pointerTypes("SteadyClock"))
19 | .put(new Info("std::chrono::system_clock").pointerTypes("SystemClock"))
20 |
21 | .put(new Info("std::chrono::time_point").pointerTypes("HighResolutionTime"))
22 | .put(new Info("std::chrono::time_point").pointerTypes("SteadyTime"))
23 | .put(new Info("std::chrono::time_point").pointerTypes("SystemTime"))
24 |
25 | .put(new Info("std::chrono::high_resolution_clock::duration").pointerTypes("HighResolutionDuration"))
26 | .put(new Info("std::chrono::steady_clock::duration").pointerTypes("SteadyDuration"))
27 | .put(new Info("std::chrono::system_clock::duration").pointerTypes("SystemDuration"))
28 |
29 | .put(new Info("std::chrono::hours").pointerTypes("Hours"))
30 | .put(new Info("std::chrono::minutes").pointerTypes("Minutes"))
31 | .put(new Info("std::chrono::seconds", "std::chrono::duration", "std::chrono::duration >", "std::chrono::duration >").pointerTypes("Seconds"))
32 | .put(new Info("std::chrono::milliseconds", "std::chrono::duration", "std::chrono::duration >").pointerTypes("Milliseconds"))
33 | .put(new Info("std::chrono::microseconds", "std::chrono::duration", "std::chrono::duration >").pointerTypes("Microseconds"))
34 | .put(new Info("std::chrono::nanoseconds", "std::chrono::duration", "std::chrono::duration >").pointerTypes("Nanoseconds"))
35 |
36 | .put(new Info("std::chrono::duration", "std::chrono::duration >", "std::chrono::duration >").pointerTypes("SecondsFloat"))
37 | .put(new Info("std::chrono::duration", "std::chrono::duration >", "std::chrono::duration >").pointerTypes("SecondsDouble"))
38 | ;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/presets/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains base presets which can be inherited.
3 | */
4 | @org.osgi.annotation.bundle.Export
5 | package org.bytedeco.javacpp.presets;
6 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/AdapterInformation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | class AdapterInformation {
30 | String name;
31 | int argc;
32 | String cast, cast2;
33 | boolean constant;
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Attribute.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | class Attribute {
30 | boolean annotation = false;
31 | String cppName = "", javaName = "", arguments = "";
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/BuildEnabled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | package org.bytedeco.javacpp.tools;
23 |
24 | import java.util.Properties;
25 |
26 | import org.osgi.annotation.versioning.ConsumerType;
27 |
28 | /**
29 | * Classes implementing {@link InfoMapper} can additionally implement this interface
30 | * to receive the logger, properties, and encoding associated with the current build session.
31 | *
32 | * Note that this interface is intended to be implemented by users of JavaCPP and so is marked
33 | * as a {@link ConsumerType} interface. Adding methods will be considered a breaking change.
34 | *
35 | * @see Parser
36 | *
37 | * @author Samuel Audet
38 | */
39 | @ConsumerType
40 | public interface BuildEnabled {
41 | void init(Logger logger, Properties properties, String encoding);
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/ClassFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | * An interface used by {@link ClassScanner} to determine which classes to load.
27 | *
28 | * @author Samuel Audet
29 | */
30 | public interface ClassFilter {
31 | boolean keep(String filename, byte[] data);
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/ClearMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import java.io.IOException;
26 | import org.apache.maven.plugin.AbstractMojo;
27 | import org.apache.maven.plugin.MojoExecutionException;
28 | import org.apache.maven.plugins.annotations.LifecyclePhase;
29 | import org.apache.maven.plugins.annotations.Mojo;
30 | import org.bytedeco.javacpp.Loader;
31 |
32 | /**
33 | * A Maven Mojo to call {@link Loader#clearCacheDir()}.
34 | *
35 | * @author Samuel Audet
36 | */
37 | @Mojo(name = "clear", defaultPhase = LifecyclePhase.NONE, requiresProject = false)
38 | public class ClearMojo extends AbstractMojo {
39 | @Override public void execute() throws MojoExecutionException {
40 | try {
41 | Loader.clearCacheDir();
42 | } catch (IOException e) {
43 | throw new MojoExecutionException(e.toString());
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import java.io.File;
26 | import java.io.IOException;
27 | import java.util.List;
28 | import java.util.Map;
29 | import org.bytedeco.javacpp.Loader;
30 |
31 | /**
32 | * A wrapper for ProcessBuilder that can be overridden easily for frameworks like Gradle that don't support it well.
33 | *
34 | * @author Samuel Audet
35 | */
36 | public class CommandExecutor {
37 | final Logger logger;
38 |
39 | public CommandExecutor(Logger logger) {
40 | this.logger = logger;
41 | }
42 |
43 | /**
44 | * Executes a command with {@link ProcessBuilder}, but also logs the call
45 | * and redirects its input and output to our process.
46 | *
47 | * @param command to have {@link ProcessBuilder} execute
48 | * @param workingDirectory to pass to {@link ProcessBuilder#directory()}
49 | * @param environmentVariables to put in {@link ProcessBuilder#environment()}
50 | * @return the exit value of the command
51 | * @throws IOException
52 | * @throws InterruptedException
53 | */
54 | public int executeCommand(List command, File workingDirectory,
55 | Map environmentVariables) throws IOException, InterruptedException {
56 | String platform = Loader.getPlatform();
57 | boolean windows = platform.startsWith("windows");
58 | for (int i = 0; i < command.size(); i++) {
59 | String arg = command.get(i);
60 | if (arg == null) {
61 | arg = "";
62 | }
63 | if (arg.trim().isEmpty() && windows) {
64 | // seems to be the only way to pass empty arguments on Windows?
65 | arg = "\"\"";
66 | }
67 | command.set(i, arg);
68 | }
69 |
70 | String text = "";
71 | for (String s : command) {
72 | boolean hasSpaces = s.indexOf(" ") > 0 || s.isEmpty();
73 | if (hasSpaces) {
74 | text += windows ? "\"" : "'";
75 | }
76 | text += s;
77 | if (hasSpaces) {
78 | text += windows ? "\"" : "'";
79 | }
80 | text += " ";
81 | }
82 | logger.info(text);
83 |
84 | ProcessBuilder pb = new ProcessBuilder(command);
85 | if (workingDirectory != null) {
86 | pb.directory(workingDirectory);
87 | }
88 | if (environmentVariables != null) {
89 | for (Map.Entry e : environmentVariables.entrySet()) {
90 | if (e.getKey() != null && e.getValue() != null) {
91 | pb.environment().put(e.getKey(), e.getValue());
92 | }
93 | }
94 | }
95 | return pb.inheritIO().start().waitFor();
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Declaration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014-2018 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | class Declaration {
30 | Type type = null;
31 | Declarator declarator = null;
32 | boolean abstractMember = false, constMember = false, inaccessible = false,
33 | incomplete = false, function = false, variable = false, comment = false, custom = false;
34 | String signature = "", text = "";
35 |
36 | public String toString() {
37 | return text;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Declarator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | class Declarator {
30 | Type type = null;
31 | Parameters parameters = null;
32 | Declaration definition = null;
33 | int infoNumber = 0, indices = 0, indirections = 0;
34 | boolean constPointer = false, operator = false, reference = false, rvalue = false;
35 | String cppName = "", javaName = "", signature = "";
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/DocTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 Samuel Audet, Hervé Guillemet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import java.util.regex.Pattern;
26 |
27 | /**
28 | * Documentation tags, where we keep only the ones that could be compatible between Javadoc and Doxygen.
29 | *
30 | * @author Hervé Guillemet
31 | */
32 | class DocTag {
33 | static String[][] docTagsStr = {
34 | // Doxygen escape of \ and @
35 | { "\\\\", "\\\\" },
36 | { "@", "{@literal @}" },
37 |
38 | // Translate Doxygen-LaTeX formula into pre-formatted inline or block
39 | // containing correct LaTeX code.
40 | // @ will not display correctly in the case of blocks.
41 | // Let's bet they won't appear frequently in formula.
42 | {"(?s)f\\[(.*?)[@\\\\]f\\]", "{@code \\\\[$1\\\\]}
"},
43 | {"(?s)f\\{([^\\}]*)\\}\\s*\\{(.*?)[@\\\\]f\\}", "{@code \\\\begin{$1}$2\\\\end{$1}}
"},
44 | {"(?s)f\\$(.*?)[@\\\\]f\\$", "{@code $1}"},
45 |
46 | { "authors?\\b", "@author" },
47 | { "deprecated\\b", "@deprecated" },
48 | { "(?:exception|throws?)\\b", "@throws" },
49 | // Doxygen allows the definition of multiple params with a single
50 | // \param, separated by ,. JavaDoc doesn't. Treat ,identifier as part
51 | // of the description for now.
52 | { "param\\s*(\\[[a-z,\\s]+\\])\\s+([a-zA-Z\\$_]+)", "@param $2 $1" },
53 | { "param\\b", "@param" },
54 | { "(?:returns?|result)\\b", "@return" },
55 | { "(?:see|sa)\\b", "@see" },
56 | { "since\\b", "@since" },
57 | { "version\\b", "@version" }
58 | /* "code", "docRoot", "inheritDoc", "link", "linkplain", "literal", "serial", "serialData", "serialField", "value" */
59 | };
60 | static DocTag[] docTags = new DocTag[docTagsStr.length];
61 | static {
62 | for (int i=0; i extends LinkedHashMap implements Iterable {
33 | public int index(E e) {
34 | Integer i = get(e);
35 | if (i == null) {
36 | put(e, i = size());
37 | }
38 | return i;
39 | }
40 |
41 | @Override public Iterator iterator() {
42 | return keySet().iterator();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/InfoMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import org.bytedeco.javacpp.annotation.Properties;
26 | import org.osgi.annotation.versioning.ConsumerType;
27 |
28 | /**
29 | * An interface to define a kind of configuration file entirely written in Java.
30 | * A class implementing this interface can be passed to the {@link Parser}, which
31 | * will create an instance of the class before calling the {@link #map(InfoMap)}
32 | * method, to be filled in with {@link Info} objects defined by the user.
33 | *
34 | * A class further annotated with {@link Properties#target()} gets detected by
35 | * the {@link Builder}, which then delegates it to the {@link Parser}.
36 | *
37 | * Note that this interface is intended to be implemented by users of JavaCPP and so is marked
38 | * as a {@link ConsumerType} interface. Adding methods will be considered a breaking change.
39 | *
40 | * @author Samuel Audet
41 | */
42 | @ConsumerType
43 | public interface InfoMapper {
44 | void map(InfoMap infoMap);
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Logger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014-2015 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | * A simple but extensible logging interface that dumps messages to the "standard" output streams by default.
27 | *
28 | * @author Samuel Audet
29 | */
30 | public class Logger {
31 | /** If the "org.bytedeco.javacpp.logger" system property is set to "slf4j",
32 | * returns new {@link Slf4jLogger#Slf4jLogger(Class)}, else returns new {@link #Logger()}. */
33 | public static Logger create(Class cls) {
34 | String s = System.getProperty("org.bytedeco.javacpp.logger", "").toLowerCase();
35 | if (s.equals("slf4j") || s.equals("slf4jlogger")) {
36 | return new Slf4jLogger(cls);
37 | } else {
38 | return new Logger();
39 | }
40 | }
41 |
42 | static boolean debug = false;
43 | static {
44 | String s = System.getProperty("org.bytedeco.javacpp.logger.debug", "false").toLowerCase();
45 | debug = s.equals("true") || s.equals("t") || s.equals("");
46 | }
47 |
48 | /** Returns the "org.bytedeco.javacpp.logger.debug" system property. */
49 | public boolean isDebugEnabled() { return debug; }
50 | /** Returns true. */
51 | public boolean isInfoEnabled() { return true; }
52 | /** Returns true. */
53 | public boolean isWarnEnabled() { return true; }
54 | /** Returns true. */
55 | public boolean isErrorEnabled() { return true; }
56 |
57 | /** Calls {@code System.err.println("Debug: " + s)}. */
58 | public void debug(String s) { System.err.println("Debug: " + s); }
59 | /** Calls {@code System.err.println("Info: " + s)}. */
60 | public void info(String s) { System.err.println("Info: " + s); }
61 | /** Calls {@code System.err.println("Warning: " + s)}. */
62 | public void warn(String s) { System.err.println("Warning: " + s); }
63 | /** Calls {@code System.err.println("Error: " + s)}. */
64 | public void error(String s) { System.err.println("Error: " + s); }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/MethodInformation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import java.lang.annotation.Annotation;
26 | import java.lang.reflect.Method;
27 |
28 | /**
29 | *
30 | * @author Samuel Audet
31 | */
32 | public class MethodInformation {
33 | Class> cls;
34 | Method method;
35 | Annotation[] annotations;
36 | int modifiers;
37 | Class> returnType;
38 | String name, memberName[];
39 | int allocatorMax, dim;
40 | boolean[] parameterRaw;
41 | Class>[] parameterTypes;
42 | Annotation[][] parameterAnnotations;
43 | boolean criticalRegion, returnRaw, withEnv, overloaded, noOffset, deallocator, allocator, arrayAllocator,
44 | bufferGetter, valueGetter, valueSetter, memberGetter, memberSetter, noReturnGetter;
45 | Method pairedMethod;
46 | Class> throwsException;
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Parameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | class Parameters {
30 | Declarator[] declarators = null;
31 | int infoNumber = 0;
32 | String list = "", signature = "", names = "";
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/ParseMojo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import org.apache.maven.plugin.MojoExecutionException;
26 | import org.apache.maven.plugins.annotations.LifecyclePhase;
27 | import org.apache.maven.plugins.annotations.Mojo;
28 |
29 | /**
30 | * A {@link BuildMojo} that always forces {@link BuildMojo#generate} to false,
31 | * with the goal of parsing header files instead.
32 | *
33 | * @author Samuel Audet
34 | */
35 | @Mojo(name = "parse", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
36 | public class ParseMojo extends BuildMojo {
37 | @Override public void execute() throws MojoExecutionException {
38 | generate = false;
39 | super.execute();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/ParserException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | public class ParserException extends Exception {
30 | public ParserException(String message) { super(message); }
31 | public ParserException(String message, Throwable cause) { super(message, cause); }
32 | public ParserException(Throwable cause) { super(cause); }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/PointerBufferPoolMXBean.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp.tools;
2 |
3 | import org.bytedeco.javacpp.Pointer;
4 |
5 | import javax.management.*;
6 | import java.lang.management.BufferPoolMXBean;
7 | import java.lang.management.ManagementFactory;
8 |
9 | public class PointerBufferPoolMXBean implements BufferPoolMXBean {
10 |
11 | private static final Logger LOGGER = Logger.create(PointerBufferPoolMXBean.class);
12 | private static final String JAVACPP_MXBEAN_NAME = "javacpp";
13 | private static final ObjectName OBJECT_NAME;
14 |
15 | static {
16 | ObjectName objectName = null;
17 | try {
18 | objectName = new ObjectName("java.nio:type=BufferPool,name=" + JAVACPP_MXBEAN_NAME);
19 | } catch (MalformedObjectNameException e) {
20 | LOGGER.warn("Could not create OBJECT_NAME for " + JAVACPP_MXBEAN_NAME);
21 | }
22 | OBJECT_NAME = objectName;
23 | }
24 |
25 | @Override
26 | public String getName() {
27 | return JAVACPP_MXBEAN_NAME;
28 | }
29 |
30 | @Override
31 | public ObjectName getObjectName() {
32 | return OBJECT_NAME;
33 | }
34 |
35 | @Override
36 | public long getCount() {
37 | return Pointer.totalCount();
38 | }
39 |
40 | @Override
41 | public long getTotalCapacity() {
42 | return Pointer.maxPhysicalBytes();
43 | }
44 |
45 | @Override
46 | public long getMemoryUsed() {
47 | return Pointer.totalBytes();
48 | }
49 |
50 | public static void register() {
51 | if (OBJECT_NAME != null) {
52 | try {
53 | ManagementFactory.getPlatformMBeanServer().registerMBean(new PointerBufferPoolMXBean(), OBJECT_NAME);
54 | } catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
55 | LOGGER.warn("Could not register " + JAVACPP_MXBEAN_NAME + " BufferPoolMXBean");
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Slf4jLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | * A logger that delegates messages to SLF4J.
27 | *
28 | * @author Samuel Audet
29 | */
30 | public class Slf4jLogger extends org.bytedeco.javacpp.tools.Logger {
31 | final org.slf4j.Logger logger;
32 |
33 | /** Calls {@link org.slf4j.LoggerFactory#getLogger(Class)}. */
34 | public Slf4jLogger(Class cls) {
35 | logger = org.slf4j.LoggerFactory.getLogger(cls);
36 | }
37 |
38 | /** Returns {@link org.slf4j.Logger#isDebugEnabled()}. */
39 | @Override public boolean isDebugEnabled() { return logger.isDebugEnabled(); }
40 | /** Returns {@link org.slf4j.Logger#isInfoEnabled()}. */
41 | @Override public boolean isInfoEnabled() { return logger.isInfoEnabled(); }
42 | /** Returns {@link org.slf4j.Logger#isWarnEnabled()}. */
43 | @Override public boolean isWarnEnabled() { return logger.isWarnEnabled(); }
44 | /** Returns {@link org.slf4j.Logger#isErrorEnabled()}. */
45 | @Override public boolean isErrorEnabled() { return logger.isErrorEnabled(); }
46 |
47 | /** Calls {@link org.slf4j.Logger#debug(String)}. */
48 | @Override public void debug(String s) { logger.debug(s); }
49 | /** Calls {@link org.slf4j.Logger#info(String)}. */
50 | @Override public void info(String s) { logger.info(s); }
51 | /** Calls {@link org.slf4j.Logger#warn(String)}. */
52 | @Override public void warn(String s) { logger.warn(s); }
53 | /** Calls {@link org.slf4j.Logger#error(String)}. */
54 | @Override public void error(String s) { logger.error(s); }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/TemplateMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import java.util.LinkedHashMap;
26 | import java.util.Map;
27 |
28 | /**
29 | *
30 | * @author Samuel Audet
31 | */
32 | class TemplateMap extends LinkedHashMap {
33 | TemplateMap(TemplateMap parent) {
34 | this.parent = parent;
35 | }
36 | Type type = null;
37 | Declarator declarator = null;
38 | TemplateMap parent = null;
39 | boolean variadic = false;
40 |
41 | String getName() {
42 | return type != null ? type.cppName : declarator != null ? declarator.cppName : null;
43 | }
44 |
45 | boolean empty() {
46 | for (Type t : values()) {
47 | if (t != null) {
48 | return false;
49 | }
50 | }
51 | return true;
52 | }
53 |
54 | boolean full() {
55 | for (Type t : values()) {
56 | if (t == null) {
57 | return false;
58 | }
59 | }
60 | return true;
61 | }
62 |
63 | Type get(String key) {
64 | Type value = super.get(key);
65 | if (value == null && parent != null) {
66 | return parent.get(key);
67 | } else {
68 | return value;
69 | }
70 | }
71 |
72 | @Override
73 | public String toString() {
74 | String s = "<";
75 | for (Map.Entry e : entrySet()) {
76 | if (s.length() > 1) {
77 | s += ",";
78 | }
79 | Type t = e.getValue();
80 | s += t != null ? t.cppName : e.getKey();
81 | }
82 | if (s.endsWith(">")) {
83 | s += " ";
84 | }
85 | return s + ">";
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/Type.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014-2015 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | /**
26 | *
27 | * @author Samuel Audet
28 | */
29 | class Type {
30 | Type() { }
31 | Type(String name) { cppName = javaName = name; }
32 |
33 | int indirections = 0;
34 | boolean anonymous = false, constExpr = false, constPointer = false, constValue = false, constructor = false,
35 | destructor = false, operator = false, simple = false, staticMember = false, using = false,
36 | reference = false, rvalue = false, value = false, friend = false, typedef = false, virtual = false;
37 | String annotations = "", cppName = "", javaName = "", javaNames[] = null;
38 | Type[] arguments = null;
39 | Attribute[] attributes = null;
40 |
41 | @Override public boolean equals(Object obj) {
42 | if (obj == this) {
43 | return true;
44 | } else if (obj == null) {
45 | return false;
46 | } else if (obj.getClass() == getClass()) {
47 | Type other = (Type)obj;
48 | return cppName.equals(other.cppName) && javaName.equals(other.javaName);
49 | } else {
50 | return false;
51 | }
52 | }
53 |
54 | @Override public int hashCode() {
55 | return cppName.hashCode() ^ javaName.hashCode();
56 | }
57 |
58 | String signature() {
59 | String sig = "";
60 | for (char c : javaName.substring(javaName.lastIndexOf(' ') + 1).toCharArray()) {
61 | sig += Character.isJavaIdentifierPart(c) ? c : '_';
62 | }
63 | return sig;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/UserClassLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Samuel Audet
3 | *
4 | * Licensed either under the Apache License, Version 2.0, or (at your option)
5 | * under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation (subject to the "Classpath" exception),
7 | * either version 2, or any later version (collectively, the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | * http://www.gnu.org/licenses/
13 | * http://www.gnu.org/software/classpath/license.html
14 | *
15 | * or as provided in the LICENSE.txt file that accompanied this code.
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 |
23 | package org.bytedeco.javacpp.tools;
24 |
25 | import java.io.File;
26 | import java.net.MalformedURLException;
27 | import java.net.URL;
28 | import java.net.URLClassLoader;
29 | import java.util.ArrayList;
30 | import java.util.Arrays;
31 | import java.util.List;
32 |
33 | /**
34 | * An extension of {@link URLClassLoader} that keeps a list of paths in memory.
35 | * Adds {@code System.getProperty("user.dir")} as default path if none are added.
36 | */
37 | class UserClassLoader extends URLClassLoader {
38 | private List paths = new ArrayList();
39 | public UserClassLoader() {
40 | super(new URL[0]);
41 | }
42 | public UserClassLoader(ClassLoader parent) {
43 | super(new URL[0], parent);
44 | }
45 | public void addPaths(String ... paths) {
46 | if (paths == null) {
47 | return;
48 | }
49 | for (String path : paths) {
50 | File f = new File(path);
51 | if (f.getName().equals("*")) {
52 | File[] files = f.getParentFile().listFiles();
53 | String[] jars = new String[files.length];
54 | int n = 0;
55 | for (File file : files) {
56 | String p = file.getPath();
57 | if (p.endsWith(".jar") || p.endsWith(".JAR")) {
58 | jars[n++] = p;
59 | }
60 | }
61 | addPaths(Arrays.copyOf(jars, n));
62 | continue;
63 | }
64 | if (this.paths.contains(path) || !f.exists()) {
65 | continue;
66 | }
67 | this.paths.add(path);
68 | try {
69 | addURL(f.toURI().toURL());
70 | } catch (MalformedURLException e) {
71 | throw new RuntimeException(e);
72 | }
73 | }
74 | }
75 | public String[] getPaths() {
76 | if (paths.isEmpty()) {
77 | addPaths(System.getProperty("user.dir"));
78 | }
79 | return paths.toArray(new String[paths.size()]);
80 | }
81 | @Override protected Class> findClass(String name)
82 | throws ClassNotFoundException {
83 | if (paths.isEmpty()) {
84 | addPaths(System.getProperty("user.dir"));
85 | }
86 | return super.findClass(name);
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/java/org/bytedeco/javacpp/tools/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes used at build time by JavaCPP.
3 | */
4 | @org.osgi.annotation.bundle.Export(
5 | attribute="exclude:=\"BuildMojo,ParseMojo,CacheMojo\"")
6 | package org.bytedeco.javacpp.tools;
7 |
--------------------------------------------------------------------------------
/src/main/java9/module-info.java:
--------------------------------------------------------------------------------
1 | module org.bytedeco.javacpp {
2 | requires jdk.unsupported;
3 | exports org.bytedeco.javacpp;
4 | exports org.bytedeco.javacpp.annotation;
5 | exports org.bytedeco.javacpp.chrono;
6 | exports org.bytedeco.javacpp.global;
7 | exports org.bytedeco.javacpp.indexer;
8 | exports org.bytedeco.javacpp.tools;
9 | exports org.bytedeco.javacpp.presets;
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-arm-clang.properties:
--------------------------------------------------------------------------------
1 | platform=android-arm
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-21/arch-arm/
7 | platform.toolchain.prefix=-gcc-toolchain\u0020
8 | platform.toolchain=toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/
9 | platform.includepath.prefix=-I
10 | platform.includepath=sources/cxx-stl/llvm-libc++/include/:sources/cxx-stl/llvm-libc++abi/include/:sources/android/support/include/:sysroot/usr/include/:sysroot/usr/include/arm-linux-androideabi/
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-mfpu=vfpv3-d16 -O3 -s -Wl,--fix-cortex-a8
19 | platform.compiler.fastfpu=-mfpu=neon -ffast-math -Wl,--fix-cortex-a8
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=21 -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -target armv7-none-linux-androideabi -march=armv7-a -mfloat-abi=softfp -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:android_support#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/armeabi-v7a/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-arm-gcc.properties:
--------------------------------------------------------------------------------
1 | platform=android-arm
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-14/arch-arm/
7 | platform.includepath.prefix=-I
8 | platform.includepath=sources/cxx-stl/gnu-libstdc++/4.9/include/:sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include/:sysroot/usr/include/:sysroot/usr/include/arm-linux-androideabi/
9 | platform.compiler=toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -funswitch-loops -finline-limit=300 -O3 -s
17 | platform.compiler.fastfpu=-march=armv7-a -mfloat-abi=softfp -mfpu=neon -ffast-math -Wl,--fix-cortex-a8
18 | platform.compiler.hardfpu=-march=armv7-a -mhard-float -mfpu=neon -ffast-math -D_NDK_MATH_NO_SOFTFP=1 -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -lm_hard -O3 -s
19 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
20 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
21 | platform.compiler.nowarnings=-w
22 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=14 -DANDROID -ffunction-sections -funwind-tables -fstack-protector -Wall -Wno-attributes -nodefaultlibs -fPIC -shared -Wl,--no-undefined -z text -o\u0020
23 | platform.compiler.output2=-Wl,-soname,
24 | platform.linkpath.prefix=-L
25 | platform.linkpath=sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/
26 | platform.link.prefix=-l
27 | platform.link.suffix=
28 | platform.link=c#:m#:dl#:gcc#:gnustl_static#:log#
29 | platform.framework.prefix=-F
30 | platform.framework.suffix=
31 | platform.framework=
32 | platform.executable.prefix=
33 | platform.executable.suffix=
34 | platform.library.path=lib/armeabi-v7a/
35 | platform.library.prefix=lib
36 | platform.library.suffix=.so
37 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-arm.properties:
--------------------------------------------------------------------------------
1 | platform=android-arm
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=
6 | platform.sysroot=
7 | platform.toolchain.prefix=
8 | platform.toolchain=
9 | platform.includepath.prefix=-I
10 | platform.includepath=
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-mfpu=vfpv3-d16 -O3 -s -Wl,--fix-cortex-a8
19 | platform.compiler.fastfpu=-mfpu=neon -ffast-math -Wl,--fix-cortex-a8
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -march=armv7-a -mfloat-abi=softfp -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:android_support#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/armeabi-v7a/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-arm64-clang.properties:
--------------------------------------------------------------------------------
1 | platform=android-arm64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-21/arch-arm64/
7 | platform.toolchain.prefix=-gcc-toolchain\u0020
8 | platform.toolchain=toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/
9 | platform.includepath.prefix=-I
10 | platform.includepath=sources/cxx-stl/llvm-libc++/include/:sources/cxx-stl/llvm-libc++abi/include/:sources/android/support/include/:sysroot/usr/include/:sysroot/usr/include/aarch64-linux-android/
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-O3 -s
19 | platform.compiler.fastfpu=-ffast-math
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=21 -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -target aarch64-none-linux-android -march=armv8-a -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=sources/cxx-stl/llvm-libc++/libs/arm64-v8a/
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/arm64-v8a/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-arm64-gcc.properties:
--------------------------------------------------------------------------------
1 | platform=android-arm64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-21/arch-arm64/
7 | platform.includepath.prefix=-I
8 | platform.includepath=sources/cxx-stl/gnu-libstdc++/4.9/include/:sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include/:sysroot/usr/include/:sysroot/usr/include/aarch64-linux-android/
9 | platform.compiler=toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-funswitch-loops -finline-limit=300 -O3 -s
17 | platform.compiler.fastfpu=-ffast-math
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=21 -DANDROID -ffunction-sections -funwind-tables -fstack-protector -Wall -Wno-attributes -nodefaultlibs -fPIC -shared -Wl,--no-undefined -z text -o\u0020
22 | platform.compiler.output2=-Wl,-soname,
23 | platform.linkpath.prefix=-L
24 | platform.linkpath=sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/
25 | platform.link.prefix=-l
26 | platform.link.suffix=
27 | platform.link=c#:m#:dl#:gcc#:gnustl_static#:log#
28 | platform.framework.prefix=-F
29 | platform.framework.suffix=
30 | platform.framework=
31 | platform.executable.prefix=
32 | platform.executable.suffix=
33 | platform.library.path=lib/arm64-v8a/
34 | platform.library.prefix=lib
35 | platform.library.suffix=.so
36 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-arm64.properties:
--------------------------------------------------------------------------------
1 | platform=android-arm64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=
6 | platform.sysroot=
7 | platform.toolchain.prefix=
8 | platform.toolchain=
9 | platform.includepath.prefix=-I
10 | platform.includepath=
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-O3 -s
19 | platform.compiler.fastfpu=-ffast-math
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -march=armv8-a -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/arm64-v8a/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-x86-clang.properties:
--------------------------------------------------------------------------------
1 | platform=android-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-21/arch-x86/
7 | platform.toolchain.prefix=-gcc-toolchain\u0020
8 | platform.toolchain=toolchains/x86-4.9/prebuilt/linux-x86_64/
9 | platform.includepath.prefix=-I
10 | platform.includepath=sources/cxx-stl/llvm-libc++/include/:sources/cxx-stl/llvm-libc++abi/include/:sources/android/support/include/:sysroot/usr/include/:sysroot/usr/include/i686-linux-android/
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-O3 -s
19 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=21 -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -target i686-none-linux-android -march=i686 -mtune=atom -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=sources/cxx-stl/llvm-libc++/libs/x86/
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:android_support#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/x86/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-x86-gcc.properties:
--------------------------------------------------------------------------------
1 | platform=android-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-14/arch-x86/
7 | platform.includepath.prefix=-I
8 | platform.includepath=sources/cxx-stl/gnu-libstdc++/4.9/include/:sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include/:sysroot/usr/include/:sysroot/usr/include/i686-linux-android/
9 | platform.compiler=toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-g++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-funswitch-loops -finline-limit=300 -O3 -s
17 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=14 -DANDROID -ffunction-sections -funwind-tables -fstack-protector -Wall -Wno-attributes -nodefaultlibs -fPIC -shared -Wl,--no-undefined -z text -o\u0020
22 | platform.compiler.output2=-Wl,-soname,
23 | platform.linkpath.prefix=-L
24 | platform.linkpath=sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/
25 | platform.link.prefix=-l
26 | platform.link.suffix=
27 | platform.link=c#:m#:dl#:gcc#:gnustl_static#:log#
28 | platform.framework.prefix=-F
29 | platform.framework.suffix=
30 | platform.framework=
31 | platform.executable.prefix=
32 | platform.executable.suffix=
33 | platform.library.path=lib/x86/
34 | platform.library.prefix=lib
35 | platform.library.suffix=.so
36 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-x86.properties:
--------------------------------------------------------------------------------
1 | platform=android-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=
6 | platform.sysroot=
7 | platform.toolchain.prefix=
8 | platform.toolchain=
9 | platform.includepath.prefix=-I
10 | platform.includepath=
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android21-clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-O3 -s
19 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -march=i686 -mtune=atom -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:android_support#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/x86/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-x86_64-clang.properties:
--------------------------------------------------------------------------------
1 | platform=android-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-21/arch-x86_64/
7 | platform.toolchain.prefix=-gcc-toolchain\u0020
8 | platform.toolchain=toolchains/x86_64-4.9/prebuilt/linux-x86_64/
9 | platform.includepath.prefix=-I
10 | platform.includepath=sources/cxx-stl/llvm-libc++/include/:sources/cxx-stl/llvm-libc++abi/include/:sources/android/support/include/:sysroot/usr/include/:sysroot/usr/include/x86_64-linux-android/
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-O3 -s
19 | platform.compiler.fastfpu=-msse3 -ffast-math
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=21 -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -target x86_64-none-linux-android -march=x86-64 -mtune=atom -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=sources/cxx-stl/llvm-libc++/libs/x86_64/
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/x86_64/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-x86_64-gcc.properties:
--------------------------------------------------------------------------------
1 | platform=android-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=--sysroot=
6 | platform.sysroot=platforms/android-21/arch-x86_64/
7 | platform.includepath.prefix=-I
8 | platform.includepath=sources/cxx-stl/gnu-libstdc++/4.9/include/:sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/include/:sysroot/usr/include/:sysroot/usr/include/x86_64-linux-android/
9 | platform.compiler=toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-g++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-funswitch-loops -finline-limit=300 -O3 -s
17 | platform.compiler.fastfpu=-msse3 -ffast-math
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-Wl,-rpath,lib/ -D__ANDROID_API__=21 -DANDROID -ffunction-sections -funwind-tables -fstack-protector -Wall -Wno-attributes -nodefaultlibs -fPIC -shared -Wl,--no-undefined -z text -o\u0020
22 | platform.compiler.output2=-Wl,-soname,
23 | platform.linkpath.prefix=-L
24 | platform.linkpath=sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/
25 | platform.link.prefix=-l
26 | platform.link.suffix=
27 | platform.link=c#:m#:dl#:gcc#:gnustl_static#:log#
28 | platform.framework.prefix=-F
29 | platform.framework.suffix=
30 | platform.framework=
31 | platform.executable.prefix=
32 | platform.executable.suffix=
33 | platform.library.path=lib/x86_64/
34 | platform.library.prefix=lib
35 | platform.library.suffix=.so
36 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/android-x86_64.properties:
--------------------------------------------------------------------------------
1 | platform=android-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.root=../android/android-ndk/
5 | platform.sysroot.prefix=
6 | platform.sysroot=
7 | platform.toolchain.prefix=
8 | platform.toolchain=
9 | platform.includepath.prefix=-I
10 | platform.includepath=
11 | platform.compiler=toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android21-clang++
12 | platform.compiler.cpp98=-std=c++98
13 | platform.compiler.cpp03=-std=c++03
14 | platform.compiler.cpp11=-std=c++11
15 | platform.compiler.cpp14=-std=c++14
16 | platform.compiler.cpp17=-std=c++17
17 | platform.compiler.debug=-O0 -g
18 | platform.compiler.default=-O3 -s
19 | platform.compiler.fastfpu=-msse3 -ffast-math
20 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
21 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
22 | platform.compiler.nowarnings=-w
23 | platform.compiler.output=-DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -march=x86-64 -mtune=atom -Wall -nostdlib++ -fPIC -shared -Wl,--no-undefined -z text -o\u0020
24 | platform.compiler.output2=-Wl,-soname,
25 | platform.linkpath.prefix=-L
26 | platform.linkpath=
27 | platform.link.prefix=-l
28 | platform.link.suffix=
29 | platform.link=c#:m#:dl#:c++abi#:c++_static#:log#
30 | platform.framework.prefix=-F
31 | platform.framework.suffix=
32 | platform.framework=
33 | platform.executable.prefix=
34 | platform.executable.suffix=
35 | platform.library.path=lib/x86_64/
36 | platform.library.prefix=lib
37 | platform.library.suffix=.so
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/generic.properties:
--------------------------------------------------------------------------------
1 | #platform=
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-O3
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=
16 | platform.compiler.noexceptions=
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-R
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/ios-arm.properties:
--------------------------------------------------------------------------------
1 | platform=ios-arm
2 | platform.path.separator=:
3 | platform.source.suffix=.mm
4 | platform.root=
5 | platform.sysroot.prefix=-isysroot\u0020
6 | platform.sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/
7 | platform.includepath.prefix=-I
8 | platform.includepath=
9 | platform.compiler=clang++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-O3
17 | platform.compiler.fastfpu=-ffast-math
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-arch armv7 -stdlib=libc++ -Wall -fPIC -pthread -miphoneos-version-min=5.0 -c -o\u0020
22 | platform.linkpath.prefix=-L
23 | platform.linkpath=
24 | platform.link.prefix=-l
25 | platform.link.suffix=
26 | platform.link=
27 | platform.framework.prefix=-framework\u0020
28 | platform.framework.suffix=
29 | platform.framework=
30 | platform.executable.prefix=
31 | platform.executable.suffix=
32 | platform.library.prefix=
33 | platform.library.suffix=.o:.a
34 | platform.library.static=true
35 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/ios-arm64.properties:
--------------------------------------------------------------------------------
1 | platform=ios-arm64
2 | platform.path.separator=:
3 | platform.source.suffix=.mm
4 | platform.root=
5 | platform.sysroot.prefix=-isysroot\u0020
6 | platform.sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/
7 | platform.includepath.prefix=-I
8 | platform.includepath=
9 | platform.compiler=clang++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-O3
17 | platform.compiler.fastfpu=-ffast-math
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-arch arm64 -stdlib=libc++ -Wall -fPIC -pthread -miphoneos-version-min=5.0 -c -o\u0020
22 | platform.linkpath.prefix=-L
23 | platform.linkpath=
24 | platform.link.prefix=-l
25 | platform.link.suffix=
26 | platform.link=
27 | platform.framework.prefix=-framework\u0020
28 | platform.framework.suffix=
29 | platform.framework=
30 | platform.executable.prefix=
31 | platform.executable.suffix=
32 | platform.library.prefix=
33 | platform.library.suffix=.o:.a
34 | platform.library.static=true
35 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/ios-x86.properties:
--------------------------------------------------------------------------------
1 | platform=ios-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.mm
4 | platform.root=
5 | platform.sysroot.prefix=-isysroot\u0020
6 | platform.sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/
7 | platform.includepath.prefix=-I
8 | platform.includepath=
9 | platform.compiler=clang++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-O3
17 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-arch i686 -stdlib=libc++ -Wall -fPIC -pthread -mios-simulator-version-min=5.0 -c -o\u0020
22 | platform.linkpath.prefix=-L
23 | platform.linkpath=
24 | platform.link.prefix=-l
25 | platform.link.suffix=
26 | platform.link=
27 | platform.framework.prefix=-framework\u0020
28 | platform.framework.suffix=
29 | platform.framework=
30 | platform.executable.prefix=
31 | platform.executable.suffix=
32 | platform.library.prefix=
33 | platform.library.suffix=.o:.a
34 | platform.library.static=true
35 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/ios-x86_64.properties:
--------------------------------------------------------------------------------
1 | platform=ios-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.mm
4 | platform.root=
5 | platform.sysroot.prefix=-isysroot\u0020
6 | platform.sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/
7 | platform.includepath.prefix=-I
8 | platform.includepath=
9 | platform.compiler=clang++
10 | platform.compiler.cpp98=-std=c++98
11 | platform.compiler.cpp03=-std=c++03
12 | platform.compiler.cpp11=-std=c++11
13 | platform.compiler.cpp14=-std=c++14
14 | platform.compiler.cpp17=-std=c++17
15 | platform.compiler.debug=-O0 -g
16 | platform.compiler.default=-O3
17 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
18 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
19 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
20 | platform.compiler.nowarnings=-w
21 | platform.compiler.output=-arch x86_64 -stdlib=libc++ -Wall -fPIC -pthread -mios-simulator-version-min=5.0 -c -o\u0020
22 | platform.linkpath.prefix=-L
23 | platform.linkpath=
24 | platform.link.prefix=-l
25 | platform.link.suffix=
26 | platform.link=
27 | platform.framework.prefix=-framework\u0020
28 | platform.framework.suffix=
29 | platform.framework=
30 | platform.executable.prefix=
31 | platform.executable.suffix=
32 | platform.library.prefix=
33 | platform.library.suffix=.o:.a
34 | platform.library.static=true
35 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-arm.properties:
--------------------------------------------------------------------------------
1 | platform=linux-arm
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=armv5te -O3 -s
14 | platform.compiler.fastfpu=-march=armv7-a -mfpu=neon -ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-arm64.properties:
--------------------------------------------------------------------------------
1 | platform=linux-arm64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-O3 -s
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-armhf.properties:
--------------------------------------------------------------------------------
1 | platform=linux-armhf
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-O3 -s
14 | platform.compiler.fastfpu=-march=armv7-a -mfpu=neon -mfloat-abi=hard -ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-mips64el.properties:
--------------------------------------------------------------------------------
1 | platform=linux-mips64el
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=mips64 -mabi=64 -O3 -s
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-ppc64.properties:
--------------------------------------------------------------------------------
1 | platform=linux-ppc64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-mcpu=power8 -m64 -O3 -s
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-ppc64le-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=linux-ppc64le
2 | platform.path.separator=:
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=-O0,-g
13 | platform.compiler.default=-Xcompiler=-mcpu=power8,-m64,-O3 -Xlinker=-s
14 | platform.compiler.fastfpu=-Xcompiler=-ffast-math
15 | platform.compiler.nodeprecated=-Xcompiler=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-Xcompiler=-fno-exceptions,-fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xlinker=-rpath,$ORIGIN/ -Xlinker=-z,noexecstack -Xlinker=-Bsymbolic -Xptxas=-v -Xcompiler=-Wall,-fPIC,-pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Xlinker=-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-Xcompiler=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-ppc64le.properties:
--------------------------------------------------------------------------------
1 | platform=linux-ppc64le
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-mcpu=power8 -m64 -O3 -s
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-riscv64.properties:
--------------------------------------------------------------------------------
1 | platform=linux-riscv64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=riscv64-linux-gnu-g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=rv64gc -mabi=lp64d -O3 -s
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-x86-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=linux-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=-O0,-g
13 | platform.compiler.default=-Xcompiler=-march=i686,-m32,-O3 -Xlinker=-s
14 | platform.compiler.fastfpu=-Xcompiler=-msse3,-ffast-math,-mfpmath=sse
15 | platform.compiler.nodeprecated=-Xcompiler=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-Xcompiler=-fno-exceptions,-fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xlinker,-rpath,$ORIGIN/ -Xlinker=-z,noexecstack -Xlinker=-Bsymbolic -Xptxas=-v -Xcompiler=-Wall,-fPIC,-pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Xlinker=-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-Xcompiler=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-x86.properties:
--------------------------------------------------------------------------------
1 | platform=linux-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=i686 -m32 -O3 -s
14 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-x86_64-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=linux-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=-O0,-g
13 | platform.compiler.default=-Xcompiler=-march=x86-64,-m64,-O3 -Xlinker=-s
14 | platform.compiler.fastfpu=-Xcompiler=-msse3,-ffast-math
15 | platform.compiler.nodeprecated=-Xcompiler=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-Xcompiler=-fno-exceptions,-fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xlinker=-rpath,$ORIGIN/ -Xlinker=-z,noexecstack -Xlinker=-Bsymbolic -Xptxas=-v -Xcompiler=-Wall,-fPIC,-pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Xlinker=-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-Xcompiler=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/linux-x86_64.properties:
--------------------------------------------------------------------------------
1 | platform=linux-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=x86-64 -m64 -O3 -s
14 | platform.compiler.fastfpu=-msse3 -ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.framework.prefix=-F
26 | platform.framework.suffix=
27 | platform.framework=
28 | platform.executable.prefix=
29 | platform.executable.suffix=
30 | platform.library.prefix=lib
31 | platform.library.suffix=.so
32 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/macosx-arm.properties:
--------------------------------------------------------------------------------
1 | platform=macosx-arm
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=clang++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-O3
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-arch armv7 -Wl,-rpath,@loader_path/. -Wall -fPIC -pthread -dynamiclib -undefined dynamic_lookup -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.frameworkpath.prefix=-F
26 | platform.framework.prefix=-framework\u0020
27 | platform.framework.suffix=
28 | platform.framework=
29 | platform.executable.prefix=
30 | platform.executable.suffix=
31 | platform.library.prefix=lib
32 | platform.library.suffix=.dylib:.so
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/macosx-arm64.properties:
--------------------------------------------------------------------------------
1 | platform=macosx-arm64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=clang++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-O3
14 | platform.compiler.fastfpu=-ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-arch arm64 -Wl,-rpath,@loader_path/. -Wall -fPIC -pthread -dynamiclib -undefined dynamic_lookup -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.frameworkpath.prefix=-F
26 | platform.framework.prefix=-framework\u0020
27 | platform.framework.suffix=
28 | platform.framework=
29 | platform.executable.prefix=
30 | platform.executable.suffix=
31 | platform.library.prefix=lib
32 | platform.library.suffix=.dylib:.so
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/macosx-x86-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=macosx-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=-O0,-g
13 | platform.compiler.default=-Xcompiler=-march=i686,-m32,-O3
14 | platform.compiler.fastfpu=-Xcompiler=-msse3,-ffast-math,-mfpmath=sse
15 | platform.compiler.nodeprecated=-Xcompiler=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-Xcompiler=-fno-exceptions,-fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xlinker=-rpath,@loader_path/.,-undefined,dynamic_lookup -Xptxas=-v -Xcompiler=-Wall,-fPIC,-pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Xlinker=-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.frameworkpath.prefix=-Xlinker=-F
26 | platform.framework.prefix=-Xlinker=-framework,
27 | platform.framework.suffix=
28 | platform.framework=
29 | platform.executable.prefix=
30 | platform.executable.suffix=
31 | platform.library.prefix=lib
32 | platform.library.suffix=.dylib:.so
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/macosx-x86.properties:
--------------------------------------------------------------------------------
1 | platform=macosx-x86
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=clang++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=i686 -m32 -O3
14 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-arch i686 -Wl,-rpath,@loader_path/. -Wall -fPIC -pthread -dynamiclib -undefined dynamic_lookup -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.frameworkpath.prefix=-F
26 | platform.framework.prefix=-framework\u0020
27 | platform.framework.suffix=
28 | platform.framework=
29 | platform.executable.prefix=
30 | platform.executable.suffix=
31 | platform.library.prefix=lib
32 | platform.library.suffix=.dylib:.so
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/macosx-x86_64-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=macosx-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=-O0,-g
13 | platform.compiler.default=-Xcompiler=-march=x86-64,-m64,-O3
14 | platform.compiler.fastfpu=-Xcompiler=-msse3,-ffast-math
15 | platform.compiler.nodeprecated=-Xcompiler=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-Xcompiler=-fno-exceptions,-fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xlinker=-rpath,@loader_path/.,-undefined,dynamic_lookup -Xptxas=-v -Xcompiler=-Wall,-fPIC,-pthread -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Xlinker=-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.frameworkpath.prefix=-Xlinker=-F
26 | platform.framework.prefix=-Xlinker=-framework,
27 | platform.framework.suffix=
28 | platform.framework=
29 | platform.executable.prefix=
30 | platform.executable.suffix=
31 | platform.library.prefix=lib
32 | platform.library.suffix=.dylib:.so
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/macosx-x86_64.properties:
--------------------------------------------------------------------------------
1 | platform=macosx-x86_64
2 | platform.path.separator=:
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=clang++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=x86-64 -m64 -O3
14 | platform.compiler.fastfpu=-msse3 -ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-arch x86_64 -Wl,-rpath,@loader_path/. -Wall -fPIC -pthread -dynamiclib -undefined dynamic_lookup -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath.prefix2=-Wl,-rpath,
21 | platform.linkpath=
22 | platform.link.prefix=-l
23 | platform.link.suffix=
24 | platform.link=
25 | platform.frameworkpath.prefix=-F
26 | platform.framework.prefix=-framework\u0020
27 | platform.framework.suffix=
28 | platform.framework=
29 | platform.executable.prefix=
30 | platform.executable.suffix=
31 | platform.library.prefix=lib
32 | platform.library.suffix=.dylib:.so
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/windows-x86-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=windows-x86
2 | platform.path.separator=;
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=/Od,/EHsc,/MDd,/LDd
13 | platform.compiler.default=-Xcompiler=/Oi,/O2,/EHsc,/Gy,/GL,/MD,/LD
14 | platform.compiler.fastfpu=-Xcompiler=/arch:SSE2,/fp:fast
15 | platform.compiler.nodeprecated=-Xcompiler=/wd4996
16 | platform.compiler.noexceptions=-Xcompiler=/EHs-c-,/GR-
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xptxas=-v -Xcompiler=/W3 -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath=
21 | platform.link.prefix=
22 | platform.link.suffix=.lib
23 | platform.link=psapi#
24 | platform.executable.prefix=
25 | platform.executable.suffix=.exe
26 | platform.library.prefix=
27 | platform.library.suffix=.dll
28 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/windows-x86-mingw.properties:
--------------------------------------------------------------------------------
1 | platform=windows-x86
2 | platform.path.separator=;
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=i686 -m32 -O3 -s
14 | platform.compiler.fastfpu=-msse3 -ffast-math -mfpmath=sse
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-D_JNI_IMPLEMENTATION_ -Wl,--kill-at -Wall -fPIC -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath=
21 | platform.link.prefix=-l
22 | platform.link.suffix=
23 | platform.link=psapi#
24 | platform.framework.prefix=-F
25 | platform.framework.suffix=
26 | platform.framework=
27 | platform.executable.prefix=
28 | platform.executable.suffix=.exe
29 | platform.library.prefix=
30 | platform.library.suffix=.dll
31 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/windows-x86.properties:
--------------------------------------------------------------------------------
1 | platform=windows-x86
2 | platform.path.separator=;
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=/I
5 | platform.includepath=
6 | platform.compiler=cl
7 | platform.compiler.cpp98=
8 | platform.compiler.cpp03=
9 | platform.compiler.cpp11=
10 | platform.compiler.cpp14=/std:c++14 /Zc:__cplusplus
11 | platform.compiler.cpp17=/std:c++17 /Zc:__cplusplus
12 | platform.compiler.debug=/Od /EHsc /MDd /LDd
13 | platform.compiler.default=/Oi /O2 /EHsc /Gy /GL /MD /LD
14 | platform.compiler.fastfpu=/arch:SSE2 /fp:fast
15 | platform.compiler.nodeprecated=/wd4996
16 | platform.compiler.noexceptions=/EHs-c- /GR-
17 | platform.compiler.nowarnings=/w
18 | platform.compiler.output=/W3 /link /OUT:
19 | platform.linkpath.prefix=/LIBPATH:
20 | platform.linkpath=
21 | platform.link.prefix=
22 | platform.link.suffix=.lib
23 | platform.link=psapi#
24 | platform.executable.prefix=
25 | platform.executable.suffix=.exe
26 | platform.library.prefix=
27 | platform.library.suffix=.dll
28 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/windows-x86_64-cuda.properties:
--------------------------------------------------------------------------------
1 | platform=windows-x86_64
2 | platform.path.separator=;
3 | platform.source.suffix=.cu
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=nvcc
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-Xcompiler=/Od,/EHsc,/MDd,/LDd
13 | platform.compiler.default=-Xcompiler=/Oi,/O2,/EHsc,/Gy,/GL,/MD,/LD
14 | platform.compiler.fastfpu=-Xcompiler=/fp:fast
15 | platform.compiler.nodeprecated=-Xcompiler=/wd4996
16 | platform.compiler.noexceptions=-Xcompiler=/EHs-c-,/GR-
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-Xptxas=-v -Xcompiler=/W3 -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath=
21 | platform.link.prefix=
22 | platform.link.suffix=.lib
23 | platform.link=psapi#
24 | platform.executable.prefix=
25 | platform.executable.suffix=.exe
26 | platform.library.prefix=
27 | platform.library.suffix=.dll
28 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/windows-x86_64-mingw.properties:
--------------------------------------------------------------------------------
1 | platform=windows-x86_64
2 | platform.path.separator=;
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=-I
5 | platform.includepath=
6 | platform.compiler=g++
7 | platform.compiler.cpp98=-std=c++98
8 | platform.compiler.cpp03=-std=c++03
9 | platform.compiler.cpp11=-std=c++11
10 | platform.compiler.cpp14=-std=c++14
11 | platform.compiler.cpp17=-std=c++17
12 | platform.compiler.debug=-O0 -g
13 | platform.compiler.default=-march=x86-64 -m64 -O3 -s
14 | platform.compiler.fastfpu=-msse3 -ffast-math
15 | platform.compiler.nodeprecated=-Wno-deprecated-declarations
16 | platform.compiler.noexceptions=-fno-exceptions -fno-rtti
17 | platform.compiler.nowarnings=-w
18 | platform.compiler.output=-D_JNI_IMPLEMENTATION_ -Wl,--kill-at -Wall -fPIC -shared -o\u0020
19 | platform.linkpath.prefix=-L
20 | platform.linkpath=
21 | platform.link.prefix=-l
22 | platform.link.suffix=
23 | platform.link=psapi#
24 | platform.framework.prefix=-F
25 | platform.framework.suffix=
26 | platform.framework=
27 | platform.executable.prefix=
28 | platform.executable.suffix=.exe
29 | platform.library.prefix=
30 | platform.library.suffix=.dll
31 |
--------------------------------------------------------------------------------
/src/main/resources/org/bytedeco/javacpp/properties/windows-x86_64.properties:
--------------------------------------------------------------------------------
1 | platform=windows-x86_64
2 | platform.path.separator=;
3 | platform.source.suffix=.cpp
4 | platform.includepath.prefix=/I
5 | platform.includepath=
6 | platform.compiler=cl
7 | platform.compiler.cpp98=
8 | platform.compiler.cpp03=
9 | platform.compiler.cpp11=
10 | platform.compiler.cpp14=/std:c++14 /Zc:__cplusplus
11 | platform.compiler.cpp17=/std:c++17 /Zc:__cplusplus
12 | platform.compiler.debug=/Od /EHsc /MDd /LDd
13 | platform.compiler.default=/Oi /O2 /EHsc /Gy /GL /MD /LD
14 | platform.compiler.fastfpu=/fp:fast
15 | platform.compiler.nodeprecated=/wd4996
16 | platform.compiler.noexceptions=/EHs-c- /GR-
17 | platform.compiler.nowarnings=/w
18 | platform.compiler.output=/W3 /link /OUT:
19 | platform.linkpath.prefix=/LIBPATH:
20 | platform.linkpath=
21 | platform.link.prefix=
22 | platform.link.suffix=.lib
23 | platform.link=psapi#
24 | platform.executable.prefix=
25 | platform.executable.suffix=.exe
26 | platform.library.prefix=
27 | platform.library.suffix=.dll
28 |
--------------------------------------------------------------------------------
/src/test/java/org/bytedeco/javacpp/ThreadTest.java:
--------------------------------------------------------------------------------
1 | package org.bytedeco.javacpp;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import java.io.File;
6 | import java.util.ArrayList;
7 | import java.util.List;
8 | import java.util.concurrent.atomic.AtomicInteger;
9 | import java.util.concurrent.atomic.AtomicReference;
10 |
11 | import org.bytedeco.javacpp.annotation.Platform;
12 | import org.bytedeco.javacpp.annotation.Virtual;
13 | import org.bytedeco.javacpp.tools.Builder;
14 | import org.junit.BeforeClass;
15 | import org.junit.Test;
16 |
17 | /**
18 | * This test case verifies that threads attached from the native layer are
19 | * configured as daemons and can remain attached when the appropriate property
20 | * is specified.
21 | *
22 | * You would want this behavior when you have a callback that is called with a
23 | * high frequency.
24 | *
25 | * @author Dan Avila
26 | *
27 | */
28 | @Platform(compiler = "cpp11", include = "ThreadTest.h")
29 | public class ThreadTest {
30 | public static class Callback extends Pointer {
31 | /** Default native constructor. */
32 | public Callback() { super((Pointer) null); allocate(); }
33 | /** Native array allocator. Access with {@link Pointer#position(long)}. */
34 | public Callback(long size){ super((Pointer) null); allocateArray(size); }
35 | /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
36 | public Callback(Pointer p) { super(p); }
37 |
38 | private native void allocate();
39 | private native void allocateArray(long size);
40 |
41 | @Override public Callback position(long position) {
42 | return (Callback)super.position(position);
43 | }
44 |
45 | @Override public Callback getPointer(long i) {
46 | return new Callback((Pointer)this).offsetAddress(i);
47 | }
48 |
49 | @Virtual(true) public native void callback(int value);
50 | }
51 |
52 | static native void run(Callback callback, int count);
53 |
54 | @BeforeClass public static void setUpClass() throws Exception {
55 | System.out.println("Builder");
56 | Class c = ThreadTest.class;
57 | Builder builder = new Builder().classesOrPackages(c.getName());
58 | File[] outputFiles = builder.build();
59 |
60 | System.out.println("Loader");
61 | Loader.load(c);
62 | }
63 |
64 | @Test public void testJNIThreadAttachFromNativeCallbacks() {
65 | final int count = 10;
66 | final List callbackValueRefs = new ArrayList<>();
67 | final List threadRefs = new ArrayList<>();
68 |
69 | Callback callback = new Callback() {
70 | @Override public void callback(int value) {
71 | System.out.println("Callback from " + Thread.currentThread());
72 | callbackValueRefs.add(Integer.valueOf(value));
73 | threadRefs.add(Thread.currentThread());
74 | }
75 | };
76 |
77 | run(callback, count);
78 |
79 | assertEquals(callbackValueRefs.size(), count);
80 | assertEquals(threadRefs.size(), count);
81 |
82 | for (int i = 0; i < count; i++) {
83 | int value = callbackValueRefs.get(i);
84 | Thread callbackThread = threadRefs.get(i);
85 |
86 | assertEquals("Callback was not called", i + 1, value);
87 |
88 | assertNotEquals("Callback thread is not main", Thread.currentThread(), callbackThread);
89 | assertTrue("Callback thread is daemon", callbackThread.isDaemon());
90 | }
91 |
92 | for (int i = 1; i < count; i++) {
93 | Thread cbThread1 = threadRefs.get(i - 1);
94 | Thread cbThread2 = threadRefs.get(i);
95 |
96 | assertEquals(cbThread1, cbThread2);
97 | }
98 |
99 | // thread should be automatically detached upon completion
100 | assertFalse(threadRefs.get(0).isAlive());
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/src/test/resources/org/bytedeco/javacpp/AdapterTest.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | std::string testStdString(std::string str) {
8 | return str;
9 | }
10 |
11 | std::wstring testStdWString(std::wstring str) {
12 | return str;
13 | }
14 |
15 | std::string testStdString2(std::string str) {
16 | return str;
17 | }
18 |
19 | std::wstring testStdWString2(std::wstring str) {
20 | return str;
21 | }
22 |
23 | std::u16string testStdU16String(std::u16string str) {
24 | return str;
25 | }
26 |
27 | std::u32string testStdU32String(std::u32string str) {
28 | return str;
29 | }
30 |
31 | char *testCharString(const char *str) {
32 | return strdup(str);
33 | // memory leak...
34 | }
35 |
36 | const char16_t *testShortString(const char16_t *str) {
37 | return str;
38 | }
39 |
40 | char16_t *testShortString(char16_t *str) {
41 | return str;
42 | }
43 |
44 | int *testIntString(int *str) {
45 | return str;
46 | }
47 |
48 | const std::string& getConstStdString() {
49 | static std::string test("test");
50 | return test;
51 | }
52 |
53 | const std::string& getConstStdString2() {
54 | return getConstStdString();
55 | }
56 |
57 | int constructorCount = 0;
58 | int destructorCount = 0;
59 |
60 | struct SharedData {
61 | int data;
62 | SharedData(int data) : data(data) {
63 | constructorCount++;
64 | }
65 | ~SharedData() {
66 | destructorCount++;
67 | }
68 | };
69 |
70 | std::shared_ptr createSharedData() {
71 | return std::shared_ptr(new SharedData(42));
72 | }
73 |
74 | std::shared_ptr sharedData;
75 | void storeSharedData(std::shared_ptr s) {
76 | sharedData = s;
77 | sharedData->data = 13;
78 | }
79 |
80 | int useCount() {
81 | return sharedData.use_count();
82 | }
83 |
84 | int useCount(std::shared_ptr& s) {
85 | return s.use_count();
86 | }
87 |
88 | std::shared_ptr fetchSharedData() {
89 | std::shared_ptr s = sharedData;
90 | sharedData.reset();
91 | return s;
92 | }
93 |
94 | struct UniqueData {
95 | int data;
96 | UniqueData(int data) : data(data) { }
97 | };
98 |
99 | std::unique_ptr createUniqueData() {
100 | return std::unique_ptr(new UniqueData(5));
101 | }
102 |
103 | void createUniqueData(std::unique_ptr *u) {
104 | u->reset(new UniqueData(42));
105 | }
106 |
107 | std::unique_ptr uniqueData(new UniqueData(13));
108 | void storeUniqueData(const std::unique_ptr* u) {
109 | uniqueData->data = (*u)->data;
110 | }
111 |
112 | const std::unique_ptr* fetchUniqueData() {
113 | return &uniqueData;
114 | }
115 |
116 | std::vector testStdVectorByVal(std::vector v) {
117 | return v;
118 | }
119 |
120 | const std::vector& testStdVectorByRef(std::vector& v) {
121 | return v;
122 | }
123 |
124 | std::vector* testStdVectorByPtr(std::vector* v) {
125 | return v;
126 | }
127 |
128 | std::vector testStdVectorConstPointer(std::vector v) {
129 | return v;
130 | }
131 |
132 | struct MovedData {
133 | int data;
134 | MovedData(int data) : data(data) { }
135 | };
136 |
137 | MovedData movedData(13);
138 | MovedData&& getMovedData() {
139 | return std::move(movedData);
140 | }
141 |
142 | void putMovedData(MovedData&& m) {
143 | movedData = m;
144 | }
145 |
146 | std::optional testOptionalInt(std::optional o) {
147 | return o;
148 | }
149 |
150 | int testCallback(std::function)> f, std::shared_ptr s) {
151 | return f(s);
152 | }
153 |
154 | int testCallback(std::function)> f, std::unique_ptr u) {
155 | return f(std::move(u));
156 | }
157 |
--------------------------------------------------------------------------------
/src/test/resources/org/bytedeco/javacpp/BufferTest.h:
--------------------------------------------------------------------------------
1 | signed char *bufferCallback(signed char *(*f)(signed char *buffer)) {
2 | static signed char value[] = {12};
3 | return f(value);
4 | }
5 |
6 | signed char getByte(signed char *buffer) {
7 | return buffer[0];
8 | }
9 |
10 | void putByte(signed char *buffer, signed char value) {
11 | buffer[0] = value;
12 | }
13 |
14 | short getShort(short *buffer) {
15 | return buffer[0];
16 | }
17 |
18 | void putShort(short *buffer, short value) {
19 | buffer[0] = value;
20 | }
21 |
22 | int getInt(int *buffer) {
23 | return buffer[0];
24 | }
25 |
26 | void putInt(int *buffer, int value) {
27 | buffer[0] = value;
28 | }
29 |
30 | long long getLong(long long *buffer) {
31 | return buffer[0];
32 | }
33 |
34 | void putLong(long long *buffer, long long value) {
35 | buffer[0] = value;
36 | }
37 |
38 | float getFloat(float *buffer) {
39 | return buffer[0];
40 | }
41 |
42 | void putFloat(float *buffer, float value) {
43 | buffer[0] = value;
44 | }
45 |
46 | double getDouble(double *buffer) {
47 | return buffer[0];
48 | }
49 |
50 | void putDouble(double *buffer, double value) {
51 | buffer[0] = value;
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/src/test/resources/org/bytedeco/javacpp/EnumTest.h:
--------------------------------------------------------------------------------
1 | enum class BoolEnum : bool {
2 | BOOL_ENUM = 1
3 | };
4 |
5 | enum class CharEnum : char {
6 | CHAR_ENUM = 42
7 | };
8 |
9 | enum class ShortEnum : short {
10 | SHORT_ENUM = 654
11 | };
12 |
13 | enum /* no class */ IntEnum : int {
14 | INT_ENUM = 987
15 | };
16 |
17 | enum /* no class */ LongEnum : long long {
18 | LONG_ENUM = 121110
19 | };
20 |
21 | BoolEnum Char2Bool(CharEnum e) {
22 | return (BoolEnum)e;
23 | }
24 |
25 | ShortEnum Char2Short(CharEnum e) {
26 | return (ShortEnum)e;
27 | }
28 |
29 | LongEnum Int2Long(IntEnum e) {
30 | return (LongEnum)e;
31 | }
32 |
33 | LongEnum enumCallback(LongEnum (*f)(CharEnum e)) {
34 | return f(CharEnum::CHAR_ENUM);
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/resources/org/bytedeco/javacpp/ThreadTest.h:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | class Callback {
4 | public:
5 | virtual void callback(int value) = 0;
6 | };
7 |
8 | static void doIt(Callback* callback, int value) {
9 | for(int i = 1; i <= value; i++) {
10 | callback->callback(i);
11 | }
12 | }
13 |
14 | static void run(Callback* callback, int count) {
15 | std::thread thread(doIt, callback, count);
16 |
17 | thread.join();
18 | }
19 |
--------------------------------------------------------------------------------