Skip to content

Commit db0126a

Browse files
Versoin 1.3.0
1 parent b11a83f commit db0126a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3276
-991
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ debug
1313
.vscode
1414

1515
*_headers
16+
*_component
1617

1718
Examples/*.xml

Build/build.bat

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo off
2+
set startingDir="%CD%"
3+
set basepath="%~dp0"
4+
5+
cd %basepath%\..\Source
6+
set Sources=actutils.go automaticcomponenttoolkit.go buildbindingcdynamic.go buildbindingcpp.go buildbindinggo.go buildbindingnode.go buildbindingpascal.go buildbindingpython.go buildimplementationcpp.go buildimplementationpascal.go componentdefinition.go componentdiff.go languagewriter.go languagec.go languagepascal.go
7+
set GOARCH=amd64
8+
9+
set GOOS=windows
10+
echo "Build act.exe"
11+
go build -o ..\act.exe %Sources%
12+
13+
set GOOS=linux
14+
echo "Build act.linux"
15+
go build -o ..\act.linux %Sources%
16+
17+
set GOOS=darwin
18+
echo "Build act.darwin"
19+
go build -o ..\act.darwin %Sources%
20+
21+
cd %startingDir%

Build/build.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
startingpath="$(pwd)"
4+
basepath="$(cd "$(dirname "$0")" && pwd)"
5+
cd "$basepath/../Source"
6+
7+
Sources="actutils.go automaticcomponenttoolkit.go buildbindingcdynamic.go buildbindingcpp.go buildbindinggo.go buildbindingnode.go buildbindingpascal.go buildbindingpython.go buildimplementationcpp.go buildimplementationpascal.go componentdefinition.go componentdiff.go languagewriter.go languagec.go languagepascal.go"
8+
GOARCH="amd64"
9+
10+
echo "Build act.exe"
11+
GOOS="windows"
12+
go build -o ../act.exe $Sources
13+
14+
echo "Build act.linux"
15+
GOOS="linux"
16+
go build -o ../act.linux $Sources
17+
18+
echo "Build act.darwin"
19+
GOOS="darwin"
20+
go build -o ../act.darwin $Sources
21+
22+
cd "$startingpath"

CONTRIBUTING.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributor's Guide
2+
The Automatic Component Toolkit is an open source project.
3+
4+
Contributions are welcome and we are looking for people that can improve existing language bindings or create new bindings or implementation stubs.
5+
6+
You can also contribute by reporting bugs in the [Issue tracker](https://git.autodesk.com/netfabb/AutomaticComponentToolkit/issues), helping review pull requests, participate in discussions about issues and more.
7+
8+
## Filing issues
9+
1. When filing an issue to report errors or problems, make sure to answer these five questions:
10+
1. Which version of ACT are you using?
11+
Run <br/>`act.* -v`<br/> to print ACT's version.
12+
2. Which operating system, programming language(s) and development tools (compiler/interpreter) are you using?
13+
3. What did you do?
14+
4. What did you expect to see?
15+
5. What did you see instead?
16+
17+
2. When contributing to this repository, please first discuss the change you wish to make via issue with the [maintainers](#maintainers) of this repository. This way, we can ensure that there is no overlap between contributions or internal development work.
18+
19+
## Submitting a pull request
20+
When ready to contribute, fork this repository and submit a pull request that references the issue it resolves. Be sure to include a clear and detailed description of the changes you've made so that we can verify them and eventually merge.
21+
22+
__NOTE__ _Before your code can be accepted into the project you must also sign the Contributor License Agreement (CLA). Please contact Martin Weismann [email protected] for a copy of the CLA._
23+
24+
25+
## Maintainers
26+
Maintainers are responsible for responding to pull requests and issues, as well as guiding the direction of the project.
27+
28+
We currently have two maintainers:
29+
- Alexander Oster [email protected]
30+
- Martin Weismann [email protected]
31+
32+
If you've established yourself as an impactful contributor to the project, and are willing take on the extra work, we'd love to have your help maintaining it! Email the current maintainers for details.

Documentation/IDL.md

+2
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ For now, please look the up in the [ACT.xsd](../Source/ACT.xsd).
311311
TODO: add all simple types here.
312312

313313
### 17.1 Type
314+
ST_Type `string` denotes a null-terminated string. If a component requires arbitrary strings that can contain null-characters, on should use the type `basicarray` of class `uint8`.
315+
314316
### 17.2 ScalarType
315317
### 17.3 ComposedType
316318
### 17.4 Name

Examples/Primes/LibPrimes_component/Bindings/C/libprimes.h

+22-11
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.2.4.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface
1111
12-
Interface version: 1.2.0
12+
Interface version: 1.3.0
1313
1414
*/
1515

1616
#ifndef __LIBPRIMES_HEADER
1717
#define __LIBPRIMES_HEADER
1818

19-
#ifdef __LIBPRIMES_DLL
19+
#ifdef __LIBPRIMES_EXPORTS
2020
#ifdef WIN32
2121
#define LIBPRIMES_DECLSPEC __declspec (dllexport)
2222
#else // WIN32
2323
#define LIBPRIMES_DECLSPEC __attribute__((visibility("default")))
2424
#endif // WIN32
25-
#else // __LIBPRIMES_DLL
25+
#else // __LIBPRIMES_EXPORTS
2626
#define LIBPRIMES_DECLSPEC
27-
#endif // __LIBPRIMES_DLL
27+
#endif // __LIBPRIMES_EXPORTS
2828

2929
#include "libprimes_types.h"
3030

@@ -41,7 +41,7 @@ extern "C" {
4141
* @param[out] pValue - The current value of this Calculator
4242
* @return error code or 0 (success)
4343
*/
44-
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_calculator_getvalue (LibPrimes_Calculator pCalculator, unsigned long long * pValue);
44+
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_calculator_getvalue (LibPrimes_Calculator pCalculator, LibPrimes_uint64 * pValue);
4545

4646
/**
4747
* Sets the value to be factorized
@@ -50,7 +50,7 @@ LIBPRIMES_DECLSPEC LibPrimesResult libprimes_calculator_getvalue (LibPrimes_Calc
5050
* @param[in] nValue - The value to be factorized
5151
* @return error code or 0 (success)
5252
*/
53-
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_calculator_setvalue (LibPrimes_Calculator pCalculator, unsigned long long nValue);
53+
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_calculator_setvalue (LibPrimes_Calculator pCalculator, LibPrimes_uint64 nValue);
5454

5555
/**
5656
* Sets the progress callback function
@@ -74,15 +74,26 @@ LIBPRIMES_DECLSPEC LibPrimesResult libprimes_calculator_calculate (LibPrimes_Cal
7474
**************************************************************************************************************************/
7575

7676
/**
77-
* Returns the prime factors of this number (without multiplicity)
77+
* Returns the prime factors of this number (with multiplicity)
7878
*
7979
* @param[in] pFactorizationCalculator - FactorizationCalculator instance.
8080
* @param[in] nPrimeFactorsBufferSize - Number of elements in buffer
8181
* @param[out] pPrimeFactorsNeededCount - will be filled with the count of the written elements, or needed buffer size.
8282
* @param[out] pPrimeFactorsBuffer - PrimeFactor buffer of The prime factors of this number
8383
* @return error code or 0 (success)
8484
*/
85-
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_factorizationcalculator_getprimefactors (LibPrimes_FactorizationCalculator pFactorizationCalculator, const unsigned int nPrimeFactorsBufferSize, unsigned int * pPrimeFactorsNeededCount, sLibPrimesPrimeFactor * pPrimeFactorsBuffer);
85+
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_factorizationcalculator_getprimefactors (LibPrimes_FactorizationCalculator pFactorizationCalculator, const LibPrimes_uint64 nPrimeFactorsBufferSize, LibPrimes_uint64* pPrimeFactorsNeededCount, sLibPrimesPrimeFactor * pPrimeFactorsBuffer);
86+
87+
/**
88+
* Checks, whether a list of prime factors (with multiplicity) is the prime factor decomposistion of the calculator's value
89+
*
90+
* @param[in] pFactorizationCalculator - FactorizationCalculator instance.
91+
* @param[in] nPrimeFactorsBufferSize - Number of elements in buffer
92+
* @param[in] pPrimeFactorsBuffer - PrimeFactor buffer of
93+
* @param[out] pAreEqual - Do the prime factors decompose this calculator's value
94+
* @return error code or 0 (success)
95+
*/
96+
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_factorizationcalculator_checkprimefactors (LibPrimes_FactorizationCalculator pFactorizationCalculator, LibPrimes_uint64 nPrimeFactorsBufferSize, const sLibPrimesPrimeFactor * pPrimeFactorsBuffer, bool * pAreEqual);
8697

8798
/*************************************************************************************************************************
8899
Class definition for SieveCalculator
@@ -97,7 +108,7 @@ LIBPRIMES_DECLSPEC LibPrimesResult libprimes_factorizationcalculator_getprimefac
97108
* @param[out] pPrimesBuffer - uint64 buffer of The primes lower or equal to the sieve's value
98109
* @return error code or 0 (success)
99110
*/
100-
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_sievecalculator_getprimes (LibPrimes_SieveCalculator pSieveCalculator, const unsigned int nPrimesBufferSize, unsigned int * pPrimesNeededCount, unsigned long long * pPrimesBuffer);
111+
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_sievecalculator_getprimes (LibPrimes_SieveCalculator pSieveCalculator, const LibPrimes_uint64 nPrimesBufferSize, LibPrimes_uint64* pPrimesNeededCount, LibPrimes_uint64 * pPrimesBuffer);
101112

102113
/*************************************************************************************************************************
103114
Global functions
@@ -135,7 +146,7 @@ LIBPRIMES_DECLSPEC LibPrimesResult libprimes_releaseinstance (LibPrimes_BaseClas
135146
* @param[out] pMicro - returns the micro version of the library
136147
* @return error code or 0 (success)
137148
*/
138-
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_getlibraryversion (unsigned int * pMajor, unsigned int * pMinor, unsigned int * pMicro);
149+
LIBPRIMES_DECLSPEC LibPrimesResult libprimes_getlibraryversion (LibPrimes_uint32 * pMajor, LibPrimes_uint32 * pMinor, LibPrimes_uint32 * pMicro);
139150

140151
/**
141152
* Handles Library Journaling

Examples/Primes/LibPrimes_component/Bindings/C/libprimes_types.h

+40-7
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,64 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.2.4.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
88
99
Abstract: This is an autogenerated plain C Header file with basic types in
1010
order to allow an easy use of Prime Numbers Interface
1111
12-
Interface version: 1.2.0
12+
Interface version: 1.3.0
1313
1414
*/
1515

1616
#ifndef __LIBPRIMES_TYPES_HEADER
1717
#define __LIBPRIMES_TYPES_HEADER
1818

19+
/*************************************************************************************************************************
20+
Scalar types definition
21+
**************************************************************************************************************************/
22+
23+
#ifdef LIBPRIMES_USELEGACYINTEGERTYPES
24+
25+
typedef unsigned char LibPrimes_uint8;
26+
typedef unsigned short LibPrimes_uint16 ;
27+
typedef unsigned int LibPrimes_uint32;
28+
typedef unsigned long long LibPrimes_uint64;
29+
typedef char LibPrimes_int8;
30+
typedef short LibPrimes_int16;
31+
typedef int LibPrimes_int32;
32+
typedef long long LibPrimes_int64;
33+
34+
#else // LIBPRIMES_USELEGACYINTEGERTYPES
35+
36+
#include <stdint.h>
37+
38+
typedef uint8_t LibPrimes_uint8;
39+
typedef uint16_t LibPrimes_uint16;
40+
typedef uint32_t LibPrimes_uint32;
41+
typedef uint64_t LibPrimes_uint64;
42+
typedef int8_t LibPrimes_int8;
43+
typedef int16_t LibPrimes_int16;
44+
typedef int32_t LibPrimes_int32;
45+
typedef int64_t LibPrimes_int64 ;
46+
47+
#endif // LIBPRIMES_USELEGACYINTEGERTYPES
48+
49+
typedef float LibPrimes_single;
50+
typedef double LibPrimes_double;
51+
1952
/*************************************************************************************************************************
2053
General type definitions
2154
**************************************************************************************************************************/
2255

23-
typedef int LibPrimesResult;
56+
typedef LibPrimes_int32 LibPrimesResult;
2457
typedef void * LibPrimesHandle;
2558

2659
/*************************************************************************************************************************
2760
Version for LibPrimes
2861
**************************************************************************************************************************/
2962

3063
#define LIBPRIMES_VERSION_MAJOR 1
31-
#define LIBPRIMES_VERSION_MINOR 2
64+
#define LIBPRIMES_VERSION_MINOR 3
3265
#define LIBPRIMES_VERSION_MICRO 0
3366

3467
/*************************************************************************************************************************
@@ -62,8 +95,8 @@ typedef LibPrimesHandle LibPrimes_SieveCalculator;
6295
#pragma pack (1)
6396

6497
typedef struct {
65-
unsigned long long m_Prime;
66-
unsigned int m_Multiplicity;
98+
LibPrimes_uint64 m_Prime;
99+
LibPrimes_uint32 m_Multiplicity;
67100
} sLibPrimesPrimeFactor;
68101

69102
#pragma pack ()
@@ -78,6 +111,6 @@ typedef struct {
78111
* @param[in] fProgressPercentage - How far has the calculation progressed?
79112
* @param[out] pShouldAbort - Should the calculation be aborted?
80113
*/
81-
typedef void(*LibPrimesProgressCallback)(float, bool*);
114+
typedef void(*LibPrimesProgressCallback)(LibPrimes_single, bool*);
82115

83116
#endif // __LIBPRIMES_TYPES_HEADER

Examples/Primes/LibPrimes_component/Bindings/CDynamic/libprimes_dynamic.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Copyright (C) 2018 Automatic Component Toolkit Developers
44
55
All rights reserved.
66
7-
This file has been generated by the Automatic Component Toolkit (ACT) version 1.2.4.
7+
This file has been generated by the Automatic Component Toolkit (ACT) version 1.3.0.
88
99
Abstract: This is an autogenerated plain C Header file in order to allow an easy
1010
use of Prime Numbers Interface
1111
12-
Interface version: 1.2.0
12+
Interface version: 1.3.0
1313
1414
*/
1515

@@ -32,6 +32,7 @@ LibPrimesResult InitLibPrimesWrapperTable (sLibPrimesDynamicWrapperTable * pWrap
3232
pWrapperTable->m_Calculator_SetProgressCallback = nullptr;
3333
pWrapperTable->m_Calculator_Calculate = nullptr;
3434
pWrapperTable->m_FactorizationCalculator_GetPrimeFactors = nullptr;
35+
pWrapperTable->m_FactorizationCalculator_CheckPrimeFactors = nullptr;
3536
pWrapperTable->m_SieveCalculator_GetPrimes = nullptr;
3637
pWrapperTable->m_CreateFactorizationCalculator = nullptr;
3738
pWrapperTable->m_CreateSieveCalculator = nullptr;
@@ -123,6 +124,15 @@ LibPrimesResult LoadLibPrimesWrapperTable (sLibPrimesDynamicWrapperTable * pWrap
123124
if (pWrapperTable->m_FactorizationCalculator_GetPrimeFactors == nullptr)
124125
return LIBPRIMES_ERROR_COULDNOTFINDLIBRARYEXPORT;
125126

127+
#ifdef WIN32
128+
pWrapperTable->m_FactorizationCalculator_CheckPrimeFactors = (PLibPrimesFactorizationCalculator_CheckPrimeFactorsPtr) GetProcAddress (hLibrary, "libprimes_factorizationcalculator_checkprimefactors");
129+
#else // WIN32
130+
pWrapperTable->m_FactorizationCalculator_CheckPrimeFactors = (PLibPrimesFactorizationCalculator_CheckPrimeFactorsPtr) dlsym (hLibrary, "libprimes_factorizationcalculator_checkprimefactors");
131+
dlerror();
132+
#endif // WIN32
133+
if (pWrapperTable->m_FactorizationCalculator_CheckPrimeFactors == nullptr)
134+
return LIBPRIMES_ERROR_COULDNOTFINDLIBRARYEXPORT;
135+
126136
#ifdef WIN32
127137
pWrapperTable->m_SieveCalculator_GetPrimes = (PLibPrimesSieveCalculator_GetPrimesPtr) GetProcAddress (hLibrary, "libprimes_sievecalculator_getprimes");
128138
#else // WIN32

0 commit comments

Comments
 (0)