Skip to content

Commit

Permalink
Header: use uint32_t for most flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
PMeira committed Mar 19, 2024
1 parent 790268c commit f6d9611
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
8 changes: 6 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@

# Versions 0.14.x

## Version 0.14.4 (dev, next release)
## Version 0.14.4 (2024-03-18)

- Alt/Obj,Batch: adjust checks for new elements. Refactored some other internal code to simplify this kind of check.
Minor release, relevant changes only in the Alt API, i.e. no need to upgrade if you don't use it.

- Alt/Obj, Batch: adjust checks for new elements. Refactored some other internal code to simplify this kind of check.
- ReduceAlgs: Very minor code clean-up.
- Header: Where possible, use uint32_t for bit sets (flags, options).

## Version 0.14.3 (2024-03-13)

Expand Down
66 changes: 33 additions & 33 deletions include/dss_capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ extern "C" {
(API Extension)
*/
DSS_CAPI_DLL const char* Circuit_Save(const char* dirOrFilePath, int32_t saveFlags);
DSS_CAPI_DLL const char* Circuit_Save(const char* dirOrFilePath, uint32_t saveFlags);

/*
EXPERIMENTAL: Loads a full circuit from a JSON-encoded string. The data must
Expand Down Expand Up @@ -7656,7 +7656,7 @@ extern "C" {
DSS_CAPI_DLL void** Obj_GetListPointer(const void* ctx, int32_t ClsIdx);
DSS_CAPI_DLL void* Obj_GetHandleByName(const void* ctx, int32_t ClsIdx, const char* Name);
DSS_CAPI_DLL void* Obj_GetHandleByIdx(const void* ctx, int32_t ClsIdx, int32_t Idx);
DSS_CAPI_DLL uint16_t Obj_PropertySideEffects(void *obj, int32_t Index, int32_t PreviousInt, int32_t setterFlags);
DSS_CAPI_DLL uint16_t Obj_PropertySideEffects(void *obj, int32_t Index, int32_t PreviousInt, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_BeginEdit(void *obj);
DSS_CAPI_DLL void Obj_EndEdit(void *obj, int32_t NumChanges);
DSS_CAPI_DLL int32_t Obj_GetNumProperties(void *obj);
Expand All @@ -7673,7 +7673,7 @@ extern "C" {
(API Extension)
*/
DSS_CAPI_DLL const char* Obj_ToJSON(void *obj, int32_t options);
DSS_CAPI_DLL const char* Obj_ToJSON(void *obj, uint32_t options);

/*!
Returns the data (as a list) of the elements in a batch as a JSON-encoded string.
Expand All @@ -7685,7 +7685,7 @@ extern "C" {
(API Extension)
*/
DSS_CAPI_DLL const char* Batch_ToJSON(void** batch, int32_t batchSize, int32_t options);
DSS_CAPI_DLL const char* Batch_ToJSON(void** batch, int32_t batchSize, uint32_t options);

/*!
Returns the object name (direct access, no copy is done, no disposal required by the user; read only!)
Expand Down Expand Up @@ -7747,16 +7747,16 @@ extern "C" {
DSS_CAPI_DLL void Obj_GetStringArray(char*** ResultPtr, int32_t* ResultDims, void *obj, int32_t Index);
DSS_CAPI_DLL void Obj_GetObjectArray(void*** ResultPtr, int32_t* ResultDims, void *obj, int32_t Index);

DSS_CAPI_DLL void Obj_SetAsString(void *obj, int32_t Index, const char* Value, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetFloat64(void *obj, int32_t Index, double Value, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetInt32(void *obj, int32_t Index, int32_t Value, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetString(void *obj, int32_t Index, const char* Value, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetObject(void *obj, int32_t Index, void* Value, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetAsString(void *obj, int32_t Index, const char* Value, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetFloat64(void *obj, int32_t Index, double Value, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetInt32(void *obj, int32_t Index, int32_t Value, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetString(void *obj, int32_t Index, const char* Value, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetObject(void *obj, int32_t Index, void* Value, uint32_t setterFlags);

DSS_CAPI_DLL void Obj_SetFloat64Array(void *obj, int32_t Index, double* Value, int32_t ValueCount, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetInt32Array(void *obj, int32_t Index, int32_t* Value, int32_t ValueCount, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetStringArray(void *obj, int32_t Index, const char** Value, int32_t ValueCount, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetObjectArray(void *obj, int32_t Index, void **Value, int32_t ValueCount, int32_t setterFlags);
DSS_CAPI_DLL void Obj_SetFloat64Array(void *obj, int32_t Index, double* Value, int32_t ValueCount, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetInt32Array(void *obj, int32_t Index, int32_t* Value, int32_t ValueCount, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetStringArray(void *obj, int32_t Index, const char** Value, int32_t ValueCount, uint32_t setterFlags);
DSS_CAPI_DLL void Obj_SetObjectArray(void *obj, int32_t Index, void **Value, int32_t ValueCount, uint32_t setterFlags);

DSS_CAPI_DLL double Obj_CktElement_MaxCurrent(void *obj, int32_t terminalIdx);
DSS_CAPI_DLL void Obj_Circuit_Set_ActiveCktElement(void *obj);
Expand Down Expand Up @@ -7786,25 +7786,25 @@ extern "C" {
DSS_CAPI_DLL void Batch_GetObject(void*** ResultPtr, int32_t* ResultDims, void** batch, int32_t batchSize, int32_t Index);

// DSS_CAPI_DLL void Batch_SetAsString(void** batch, int32_t batchSize, int32_t Index, const char* Value);
DSS_CAPI_DLL void Batch_Float64(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, double Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, int32_t Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetString(void** batch, int32_t batchSize, int32_t Index, const char* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObject(void** batch, int32_t batchSize, int32_t Index, const void *Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Float64Array(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, double* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32Array(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, int32_t* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Float64(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, double Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, int32_t Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetString(void** batch, int32_t batchSize, int32_t Index, const char* Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObject(void** batch, int32_t batchSize, int32_t Index, const void *Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_Float64Array(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, double* Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32Array(void** batch, int32_t batchSize, int32_t Index, int32_t Operation, int32_t* Value, uint32_t setterFlags);

/*!
DEPRECATED: use `Batch_Float64Array` with `Operation=BatchOperation_Set` instead
*/
DSS_CAPI_DLL void Batch_SetFloat64Array(void** batch, int32_t batchSize, int32_t Index, double* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetFloat64Array(void** batch, int32_t batchSize, int32_t Index, double* Value, uint32_t setterFlags);

/*!
DEPRECATED: use `Batch_Int32Array` with `Operation=BatchOperation_Set` instead
*/
DSS_CAPI_DLL void Batch_SetInt32Array(void** batch, int32_t batchSize, int32_t Index, int32_t* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetInt32Array(void** batch, int32_t batchSize, int32_t Index, int32_t* Value, uint32_t setterFlags);

DSS_CAPI_DLL void Batch_SetStringArray(void** batch, int32_t batchSize, int32_t Index, const char** Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObjectArray(void** batch, int32_t batchSize, int32_t Index, const void** Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetStringArray(void** batch, int32_t batchSize, int32_t Index, const char** Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObjectArray(void** batch, int32_t batchSize, int32_t Index, const void** Value, uint32_t setterFlags);

DSS_CAPI_DLL void Batch_CreateFromNewS(const void* ctx, void*** ResultPtr, int32_t* ResultDims, const char* clsname, const char** names, int32_t count, altdss_bool_t BeginEdit);
DSS_CAPI_DLL void Batch_CreateByClassS(const void* ctx, void*** ResultPtr, int32_t* ResultDims, const char* clsname);
Expand All @@ -7821,24 +7821,24 @@ extern "C" {
DSS_CAPI_DLL void Batch_GetObjectS(void*** ResultPtr, int32_t* ResultDims, void** batch, int32_t batchSize, const char* Name);

// DSS_CAPI_DLL void Batch_SetAsStringS(void** batch, int32_t batchSize, const char* Name, const char* Value);
DSS_CAPI_DLL void Batch_Float64S(void** batch, int32_t batchSize, const char* Name, int32_t Operation, double Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32S(void** batch, int32_t batchSize, const char* Name, int32_t Operation, int32_t Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetStringS(void** batch, int32_t batchSize, const char* Name, const char* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObjectS(void** batch, int32_t batchSize, const char* Name, const void* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Float64S(void** batch, int32_t batchSize, const char* Name, int32_t Operation, double Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32S(void** batch, int32_t batchSize, const char* Name, int32_t Operation, int32_t Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetStringS(void** batch, int32_t batchSize, const char* Name, const char* Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObjectS(void** batch, int32_t batchSize, const char* Name, const void* Value, uint32_t setterFlags);

DSS_CAPI_DLL void Batch_Float64ArrayS(void** batch, int32_t batchSize, const char* Name, int32_t Operation, double* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Float64ArrayS(void** batch, int32_t batchSize, const char* Name, int32_t Operation, double* Value, uint32_t setterFlags);
/*!
DEPRECATED: use `Batch_Int32ArrayS` with `Operation=BatchOperation_Set` instead
*/
DSS_CAPI_DLL void Batch_SetFloat64ArrayS(void** batch, int32_t batchSize, const char* Name, double* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetFloat64ArrayS(void** batch, int32_t batchSize, const char* Name, double* Value, uint32_t setterFlags);

DSS_CAPI_DLL void Batch_Int32ArrayS(void** batch, int32_t batchSize, const char* Name, int32_t Operation, int32_t* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_Int32ArrayS(void** batch, int32_t batchSize, const char* Name, int32_t Operation, int32_t* Value, uint32_t setterFlags);
/*!
DEPRECATED: use `Batch_Int32ArrayS` with `Operation=BatchOperation_Set` instead
*/
DSS_CAPI_DLL void Batch_SetInt32ArrayS(void** batch, int32_t batchSize, const char* Name, int32_t* Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetStringArrayS(void** batch, int32_t batchSize, const char* Name, const char** Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObjectArrayS(void** batch, int32_t batchSize, const char* Name, const void** Value, int32_t setterFlags);
DSS_CAPI_DLL void Batch_SetInt32ArrayS(void** batch, int32_t batchSize, const char* Name, int32_t* Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetStringArrayS(void** batch, int32_t batchSize, const char* Name, const char** Value, uint32_t setterFlags);
DSS_CAPI_DLL void Batch_SetObjectArrayS(void** batch, int32_t batchSize, const char* Name, const void** Value, uint32_t setterFlags);

/*!
`DSS_BeginPascalThread` can be used to start a new thread from the Pascal side.
Expand Down
2 changes: 1 addition & 1 deletion include/dss_capi_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ extern "C" {
(API Extension)
*/
DSS_CAPI_DLL const char* ctx_Circuit_Save(const void* ctx, const char* dirOrFilePath, int32_t saveFlags);
DSS_CAPI_DLL const char* ctx_Circuit_Save(const void* ctx, const char* dirOrFilePath, uint32_t saveFlags);

/*
EXPERIMENTAL: Loads a full circuit from a JSON-encoded string. The data must
Expand Down

0 comments on commit f6d9611

Please sign in to comment.