Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
0x17 committed Nov 14, 2023
2 parents bda6265 + 97059de commit 0474ee8
Show file tree
Hide file tree
Showing 19 changed files with 733 additions and 1,126 deletions.
9 changes: 7 additions & 2 deletions changelog.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
- 7.9.1:
- First open source technical release of GDX eXPert-level API.
- 7.10.1:
- First open source release of GDX eXPert-level API. Compatible with GAMS 45.
- Added gdxAllowBogusDomains to get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomainSets).
- Added script to automatically generate C-wrapper from API definition YAML file.
- Added boolean property gdxMapAcronymsToNaN (disabled by default) that maps all acronym values to special value "Not a Number" (NaN).
- Removed XCode project file for unit test suite as it is not maintained anymore.
- >
Entries for property setters and getters in main header and wrappers are now automatically generated from API
definition YAML via Jinja2 templates and not handwritten.
436 changes: 0 additions & 436 deletions gdxtest.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

This file was deleted.

85 changes: 0 additions & 85 deletions gdxtest.xcodeproj/xcshareddata/xcschemes/gdxtest.xcscheme

This file was deleted.

36 changes: 24 additions & 12 deletions generated/cwrap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ int gdxFree( TGXFileRec_t **pgdx );
int gdxCreate( TGXFileRec_t **pgdx, char *errBuf, int bufSize );
int gdxCreateD( TGXFileRec_t **pgdx, const char *sysDir, char *msgBuf, int msgBufLen );
void gdxDestroy( TGXFileRec_t **pgx );
int gdxStoreDomainSets( TGXFileRec_t *pgdx );
void gdxStoreDomainSetsSet( TGXFileRec_t *pgdx, int x );
int gdxAllowBogusDomains (TGXFileRec_t *pgdx);
void gdxAllowBogusDomainsSet (TGXFileRec_t *pgdx, int x);
int gdxStoreDomainSets( TGXFileRec_t *pgdx);
void gdxStoreDomainSetsSet( TGXFileRec_t *pgdx, int flag);
int gdxAllowBogusDomains( TGXFileRec_t *pgdx);
void gdxAllowBogusDomainsSet( TGXFileRec_t *pgdx, int flag);
int gdxMapAcronymsToNaN( TGXFileRec_t *pgdx);
void gdxMapAcronymsToNaNSet( TGXFileRec_t *pgdx, int flag);
void setCallByRef( TGXFileRec_t *TGXFile, const char *FuncName, int cbrValue );
// PROTOTYPES END

Expand Down Expand Up @@ -658,24 +660,34 @@ GDX_INLINE int gdxRenameUEL( TGXFileRec_t *pgx, const char *OldName, const char
}


GDX_INLINE int gdxStoreDomainSets( TGXFileRec_t *TGXFile )
GDX_INLINE int gdxStoreDomainSets( TGXFileRec_t *pgx)
{
return reinterpret_cast<gdx::TGXFileObj *>( TGXFile )->gdxStoreDomainSets();
return reinterpret_cast<gdx::TGXFileObj *>( pgx )->gdxStoreDomainSets();
}

GDX_INLINE void gdxStoreDomainSetsSet( TGXFileRec_t *TGXFile, int x )
GDX_INLINE void gdxStoreDomainSetsSet( TGXFileRec_t *pgx, int flag)
{
reinterpret_cast<gdx::TGXFileObj *>( TGXFile )->gdxStoreDomainSetsSet( x );
reinterpret_cast<gdx::TGXFileObj *>( pgx )->gdxStoreDomainSetsSet( flag );
}

GDX_INLINE int gdxAllowBogusDomains( TGXFileRec_t *TGXFile )
GDX_INLINE int gdxAllowBogusDomains( TGXFileRec_t *pgx)
{
return reinterpret_cast<gdx::TGXFileObj *>( TGXFile )->gdxAllowBogusDomains();
return reinterpret_cast<gdx::TGXFileObj *>( pgx )->gdxAllowBogusDomains();
}

GDX_INLINE void gdxAllowBogusDomainsSet( TGXFileRec_t *TGXFile, int x )
GDX_INLINE void gdxAllowBogusDomainsSet( TGXFileRec_t *pgx, int flag)
{
reinterpret_cast<gdx::TGXFileObj *>( TGXFile )->gdxAllowBogusDomainsSet( x );
reinterpret_cast<gdx::TGXFileObj *>( pgx )->gdxAllowBogusDomainsSet( flag );
}

GDX_INLINE int gdxMapAcronymsToNaN( TGXFileRec_t *pgx)
{
return reinterpret_cast<gdx::TGXFileObj *>( pgx )->gdxMapAcronymsToNaN();
}

GDX_INLINE void gdxMapAcronymsToNaNSet( TGXFileRec_t *pgx, int flag)
{
reinterpret_cast<gdx::TGXFileObj *>( pgx )->gdxMapAcronymsToNaNSet( flag );
}

GDX_INLINE int gdxFree( TGXFileRec_t **TGXFile )
Expand Down
23 changes: 23 additions & 0 deletions generated/gdxcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,27 @@ void GDX_CALLCONV d_gdxAllowBogusDomainsSet (gdxHandle_t pgdx,const int x)
printNoReturn(gdxAllowBogusDomainsSet,1)
}

/** Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
* @param pgdx gdx object handle
*/
int GDX_CALLCONV d_gdxMapAcronymsToNaN (gdxHandle_t pgdx)
{
int d_s[]={15};
GAMS_UNUSED(pgdx)
printAndReturn(gdxMapAcronymsToNaN,0,int )
}

/** Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
* @param pgdx gdx object handle
*/
void GDX_CALLCONV d_gdxMapAcronymsToNaNSet (gdxHandle_t pgdx,const int x)
{
int d_s[]={0,15};
GAMS_UNUSED(pgdx)
GAMS_UNUSED(x)
printNoReturn(gdxMapAcronymsToNaNSet,1)
}


/** return dirName on success, NULL on failure */
static char *
Expand Down Expand Up @@ -1857,6 +1878,8 @@ XLibraryLoad (const char *dllName, char *errBuf, int errBufSize)
{int s[]={0,15}; CheckAndLoad(gdxStoreDomainSetsSet,1,"C__"); }
{int s[]={15}; CheckAndLoad(gdxAllowBogusDomains,0,"C__"); }
{int s[]={0,15}; CheckAndLoad(gdxAllowBogusDomainsSet,1,"C__"); }
{int s[]={15}; CheckAndLoad(gdxMapAcronymsToNaN,0,"C__"); }
{int s[]={0,15}; CheckAndLoad(gdxMapAcronymsToNaNSet,1,"C__"); }

return 0;

Expand Down
12 changes: 12 additions & 0 deletions generated/gdxcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ int GDX_CALLCONV d_gdxStoreDomainSets (gdxHandle_t pgdx);
void GDX_CALLCONV d_gdxStoreDomainSetsSet (gdxHandle_t pgdx, const int x);
int GDX_CALLCONV d_gdxAllowBogusDomains (gdxHandle_t pgdx);
void GDX_CALLCONV d_gdxAllowBogusDomainsSet (gdxHandle_t pgdx, const int x);
int GDX_CALLCONV d_gdxMapAcronymsToNaN (gdxHandle_t pgdx);
void GDX_CALLCONV d_gdxMapAcronymsToNaNSet (gdxHandle_t pgdx, const int x);


typedef int (GDX_CALLCONV *gdxAcronymAdd_t) (gdxHandle_t pgdx, const char *AName, const char *Txt, int AIndx);
Expand Down Expand Up @@ -1155,6 +1157,16 @@ GDX_FUNCPTR(gdxAllowBogusDomains);
typedef void (GDX_CALLCONV *gdxAllowBogusDomainsSet_t) (gdxHandle_t pgdx, const int x);
GDX_FUNCPTR(gdxAllowBogusDomainsSet);

typedef int (GDX_CALLCONV *gdxMapAcronymsToNaN_t) (gdxHandle_t pgdx);
/** Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
*
* @param pgdx gdx object handle
*/
GDX_FUNCPTR(gdxMapAcronymsToNaN);

typedef void (GDX_CALLCONV *gdxMapAcronymsToNaNSet_t) (gdxHandle_t pgdx, const int x);
GDX_FUNCPTR(gdxMapAcronymsToNaNSet);

#if defined(__cplusplus)
}
#endif
Expand Down
24 changes: 24 additions & 0 deletions generated/gdxcclib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
#define C__gdxStoreDomainSetsSet c__gdxstoredomainsetsset
#define C__gdxAllowBogusDomains c__gdxallowbogusdomains
#define C__gdxAllowBogusDomainsSet c__gdxallowbogusdomainsset
#define C__gdxMapAcronymsToNaN c__gdxmapacronymstonan
#define C__gdxMapAcronymsToNaNSet c__gdxmapacronymstonanset


/* declarations shut up compiler warnings */
Expand Down Expand Up @@ -882,6 +884,16 @@ GDX_API int GDX_CALLCONV C__XCheck(const char *funcn, int ClNrArg, int Clsign[],
DLLsign[0] = 0; DLLsign[1] = 15;
return CheckSign(funcn,1,ClNrArg,DLLsign,Clsign,Msg);
}
else if(!strcmp(funcn,"gdxMapAcronymsToNaN"))
{
DLLsign[0] = 15;
return CheckSign(funcn,0,ClNrArg,DLLsign,Clsign,Msg);
}
else if(!strcmp(funcn,"gdxMapAcronymsToNaNSet"))
{
DLLsign[0] = 0; DLLsign[1] = 15;
return CheckSign(funcn,1,ClNrArg,DLLsign,Clsign,Msg);
}
else
{
sprintf(Msg,"gdxcclib: %s cannot be found in library.",funcn);
Expand Down Expand Up @@ -2123,5 +2135,17 @@ GDX_API void GDX_CALLCONV C__gdxAllowBogusDomainsSet(TGXFileRec_t *TGXFile, int
gdxAllowBogusDomainsSet(TGXFile,x);
}

GDX_API int GDX_CALLCONV C__gdxMapAcronymsToNaN(TGXFileRec_t *TGXFile);
GDX_API int GDX_CALLCONV C__gdxMapAcronymsToNaN(TGXFileRec_t *TGXFile)
{
return gdxMapAcronymsToNaN(TGXFile);
}

GDX_API void GDX_CALLCONV C__gdxMapAcronymsToNaNSet(TGXFileRec_t *TGXFile, int x);
GDX_API void GDX_CALLCONV C__gdxMapAcronymsToNaNSet(TGXFileRec_t *TGXFile, int x)
{
gdxMapAcronymsToNaNSet(TGXFile,x);
}

#endif

Loading

0 comments on commit 0474ee8

Please sign in to comment.