#ifndef __cxPyramid_API_H_ #define __cxPyramid_API_H_ #ifdef __cplusplus "C" { #endif #include <stdio.h> #if defined(__sun) || defined(WIN32) cxConnection* cxConnectionAlloc( signed long ElementsLength, signed long ConnectionsLength ); signed long* cxConnectionConnectionsArrayGet( cxConnection *src, cxErrorCode *ec ); long cxConnectionConnectionsArrayLen( cxConnection *src, cxErrorCode *ec ); void cxConnectionConnectionsArrayRem( cxConnection *src, signed long* *val, cxErrorCode *ec ); void cxConnectionConnectionsArraySet( cxConnection *src, signed long* val, cxErrorCode *ec ); signed long cxConnectionConnectionsLengthGet( cxConnection *src, cxErrorCode *ec ); void cxConnectionConnectionsLengthSet( cxConnection *src, signed long val, cxErrorCode *ec ); cxConnection* cxConnectionCopy( cxConnection *src ); cxConnection* cxConnectionDup( cxConnection *src ); signed long* cxConnectionElementsArrayGet( cxConnection *src, cxErrorCode *ec ); long cxConnectionElementsArrayLen( cxConnection *src, cxErrorCode *ec ); void cxConnectionElementsArrayRem( cxConnection *src, signed long* *val, cxErrorCode *ec ); void cxConnectionElementsArraySet( cxConnection *src, signed long* val, cxErrorCode *ec ); signed long cxConnectionElementsLengthGet( cxConnection *src, cxErrorCode *ec ); void cxConnectionElementsLengthSet( cxConnection *src, signed long val, cxErrorCode *ec ); signed long cxConnectionNumElementsGet( cxConnection *src, cxErrorCode *ec ); void cxConnectionNumElementsSet( cxConnection *src, signed long val, cxErrorCode *ec ); cxConnection* cxConnectionRead( FILE *fd ); void cxConnectionWrite( FILE *fd, int mode, cxConnection *src ); cxPyramid* cxPyramidAlloc( signed long NumLevels, cxCompressType CompressionType, signed long NumberIndices ); cxLattice* cxPyramidBaseLatticeGet( cxPyramid *src, cxErrorCode *ec ); void cxPyramidBaseLatticeSet( cxPyramid *src, cxLattice* val, cxErrorCode *ec ); void* cxPyramidCompressionIndexAlloc( cxPyramid *src ); void* cxPyramidCompressionIndexGet( cxPyramid *src, cxErrorCode *ec ); long cxPyramidCompressionIndexLen( cxPyramid *src, cxErrorCode *ec ); void cxPyramidCompressionIndexRem( cxPyramid *src, void *val, cxErrorCode *ec ); void cxPyramidCompressionIndexSet( cxPyramid *src, void *member, cxErrorCode *ec ); cxPrimType cxPyramidCompressionIndexType( cxPyramid *src, cxErrorCode *ec ); cxCompressType cxPyramidCompressionTypeGet( cxPyramid *src, cxErrorCode *ec ); void cxPyramidCompressionTypeSet( cxPyramid *src, cxCompressType val, cxErrorCode *ec ); cxPyramid* cxPyramidCopy( cxPyramid *src ); cxPyramidDictionary* cxPyramidDictionaryAlloc( signed long NumEntries ); cxPyramidDictionary* cxPyramidDictionaryCopy( cxPyramidDictionary *src ); cxPyramidDictionary* cxPyramidDictionaryDup( cxPyramidDictionary *src ); cxPyramidDictionary* cxPyramidDictionaryGet( cxPyramid *src, cxErrorCode *ec ); signed long cxPyramidDictionaryNumDimsGet( cxPyramidDictionary *src, cxErrorCode *ec ); void cxPyramidDictionaryNumDimsSet( cxPyramidDictionary *src, signed long val, cxErrorCode *ec ); signed long cxPyramidDictionaryNumEntriesGet( cxPyramidDictionary *src, cxErrorCode *ec ); void cxPyramidDictionaryNumEntriesSet( cxPyramidDictionary *src, signed long val, cxErrorCode *ec ); cxPyramidDictionary* cxPyramidDictionaryRead( FILE *fd ); void cxPyramidDictionarySet( cxPyramid *src, cxPyramidDictionary* val, cxErrorCode *ec ); cxPyramid** cxPyramidDictionaryTableGet( cxPyramidDictionary *src, cxErrorCode *ec ); long cxPyramidDictionaryTableLen( cxPyramidDictionary *src, cxErrorCode *ec ); void cxPyramidDictionaryTableRem( cxPyramidDictionary *src, cxPyramid** *val, cxErrorCode *ec ); void cxPyramidDictionaryTableSet( cxPyramidDictionary *src, cxPyramid** val, cxErrorCode *ec ); void cxPyramidDictionaryWrite( FILE *fd, int mode, cxPyramidDictionary *src ); cxPyramid* cxPyramidDup( cxPyramid *src ); cxConnection* cxPyramidLayerConnectionGet( cxPyramid *src, long layerInd, cxErrorCode *ec ); void cxPyramidLayerConnectionSet( cxPyramid *src, cxConnection* val, long layerInd, cxErrorCode *ec ); cxLattice* cxPyramidLayerLatticeGet( cxPyramid *src, long layerInd, cxErrorCode *ec ); void cxPyramidLayerLatticeSet( cxPyramid *src, cxLattice* val, long layerInd, cxErrorCode *ec ); signed long cxPyramidNumLevelsGet( cxPyramid *src, cxErrorCode *ec ); void cxPyramidNumLevelsSet( cxPyramid *src, signed long val, cxErrorCode *ec ); signed long cxPyramidNumberIndicesGet( cxPyramid *src, cxErrorCode *ec ); void cxPyramidNumberIndicesSet( cxPyramid *src, signed long val, cxErrorCode *ec ); cxPyramid* cxPyramidRead( FILE *fd ); void cxPyramidWrite( FILE *fd, int mode, cxPyramid *src ); long cxPyramidlayerLen( cxPyramid *src, cxErrorCode *ec ); void cxPyramidlayerRem( cxPyramid *src, cxPyramidLayer* *val, cxErrorCode *ec );
#ifndef __cxPyramid_API_H_ #define __cxPyramid_API_H_ #ifdef __cplusplus "C" { #endif #include <stdio.h> #if defined(__sun) || defined(WIN32) integer function cxConnectionAlloc( ElementsLength, ConnectionsLength ) integer function cxConnectionConnectionsArrayGet( src, ec ) integer function cxConnectionConnectionsArrayLen( src, ec ) subroutine cxConnectionConnectionsArrayRem( src, val, ec ) subroutine cxConnectionConnectionsArraySet( src, val, ec ) integer function cxConnectionConnectionsLengthGet( src, ec ) subroutine cxConnectionConnectionsLengthSet( src, val, ec ) integer function cxConnectionCopy( src ) integer function cxConnectionDup( src ) integer function cxConnectionElementsArrayGet( src, ec ) integer function cxConnectionElementsArrayLen( src, ec ) subroutine cxConnectionElementsArrayRem( src, val, ec ) subroutine cxConnectionElementsArraySet( src, val, ec ) integer function cxConnectionElementsLengthGet( src, ec ) subroutine cxConnectionElementsLengthSet( src, val, ec ) integer function cxConnectionNumElementsGet( src, ec ) subroutine cxConnectionNumElementsSet( src, val, ec ) integer function cxConnectionRead( fd ) subroutine cxConnectionWrite( fd, mode, src ) integer function cxPyramidAlloc( NumLevels, CompressionType, NumberIndices ) integer function cxPyramidBaseLatticeGet( src, ec ) subroutine cxPyramidBaseLatticeSet( src, val, ec ) integer function cxPyramidCompressionIndexAlloc( src ) integer function cxPyramidCompressionIndexGet( src, ec ) integer function cxPyramidCompressionIndexLen( src, ec ) subroutine cxPyramidCompressionIndexRem( src, val, ec ) subroutine cxPyramidCompressionIndexSet( src, member, ec ) integer function cxPyramidCompressionIndexType( src, ec ) integer function cxPyramidCompressionTypeGet( src, ec ) subroutine cxPyramidCompressionTypeSet( src, val, ec ) integer function cxPyramidCopy( src ) integer function cxPyramidDictionaryAlloc( NumEntries ) integer function cxPyramidDictionaryCopy( src ) integer function cxPyramidDictionaryDup( src ) integer function cxPyramidDictionaryGet( src, ec ) integer function cxPyramidDictionaryNumDimsGet( src, ec ) subroutine cxPyramidDictionaryNumDimsSet( src, val, ec ) integer function cxPyramidDictionaryNumEntriesGet( src, ec ) subroutine cxPyramidDictionaryNumEntriesSet( src, val, ec ) integer function cxPyramidDictionaryRead( fd ) subroutine cxPyramidDictionarySet( src, val, ec ) integer function cxPyramidDictionaryTableGet( src, ec ) integer function cxPyramidDictionaryTableLen( src, ec ) subroutine cxPyramidDictionaryTableRem( src, val, ec ) subroutine cxPyramidDictionaryTableSet( src, val, ec ) subroutine cxPyramidDictionaryWrite( fd, mode, src ) integer function cxPyramidDup( src ) integer function cxPyramidLayerConnectionGet( src, layerInd, ec ) subroutine cxPyramidLayerConnectionSet( src, val, layerInd, ec ) integer function cxPyramidLayerLatticeGet( src, layerInd, ec ) subroutine cxPyramidLayerLatticeSet( src, val, layerInd, ec ) integer function cxPyramidNumLevelsGet( src, ec ) subroutine cxPyramidNumLevelsSet( src, val, ec ) integer function cxPyramidNumberIndicesGet( src, ec ) subroutine cxPyramidNumberIndicesSet( src, val, ec ) integer function cxPyramidRead( fd ) subroutine cxPyramidWrite( fd, mode, src ) integer function cxPyramidlayerLen( src, ec ) subroutine cxPyramidlayerRem( src, val, ec )
For example, assuming that the cxPyramid.t file exists, you would take the following steps:
echo cxPyramid > TYPES cxmkmf makeNow your automatically generated code will reside in cxPyramid.api.c.
Note that this process will create several files in the local directory, so it is often helpful to use a separate directory for types, just as modules are developed in their own directories.
signed long* cxConnectionConnectionsArrayGet( cxConnection *src, cxErrorCode *ec ); signed long cxConnectionConnectionsLengthGet( cxConnection *src, cxErrorCode *ec ); signed long* cxConnectionElementsArrayGet( cxConnection *src, cxErrorCode *ec ); signed long cxConnectionElementsLengthGet( cxConnection *src, cxErrorCode *ec ); signed long cxConnectionNumElementsGet( cxConnection *src, cxErrorCode *ec ); cxLattice* cxPyramidBaseLatticeGet( cxPyramid *src, cxErrorCode *ec ); void* cxPyramidCompressionIndexGet( cxPyramid *src, cxErrorCode *ec ); cxCompressType cxPyramidCompressionTypeGet( cxPyramid *src, cxErrorCode *ec ); cxPyramidDictionary* cxPyramidDictionaryGet( cxPyramid *src, cxErrorCode *ec ); signed long cxPyramidDictionaryNumDimsGet( cxPyramidDictionary *src, cxErrorCode *ec ); signed long cxPyramidDictionaryNumEntriesGet( cxPyramidDictionary *src, cxErrorCode *ec ); cxPyramid** cxPyramidDictionaryTableGet( cxPyramidDictionary *src, cxErrorCode *ec ); cxConnection* cxPyramidLayerConnectionGet( cxPyramid *src, long layerInd, cxErrorCode *ec ); cxLattice* cxPyramidLayerLatticeGet( cxPyramid *src, long layerInd, cxErrorCode *ec ); signed long cxPyramidNumLevelsGet( cxPyramid *src, cxErrorCode *ec ); signed long cxPyramidNumberIndicesGet( cxPyramid *src, cxErrorCode *ec );
integer function cxConnectionConnectionsArrayGet( src, ec ) integer function cxConnectionConnectionsLengthGet( src, ec ) integer function cxConnectionElementsArrayGet( src, ec ) integer function cxConnectionElementsLengthGet( src, ec ) integer function cxConnectionNumElementsGet( src, ec ) integer function cxPyramidBaseLatticeGet( src, ec ) integer function cxPyramidCompressionIndexGet( src, ec ) integer function cxPyramidCompressionTypeGet( src, ec ) integer function cxPyramidDictionaryGet( src, ec ) integer function cxPyramidDictionaryNumDimsGet( src, ec ) integer function cxPyramidDictionaryNumEntriesGet( src, ec ) integer function cxPyramidDictionaryTableGet( src, ec ) integer function cxPyramidLayerConnectionGet( src, layerInd, ec ) integer function cxPyramidLayerLatticeGet( src, layerInd, ec ) integer function cxPyramidNumLevelsGet( src, ec ) integer function cxPyramidNumberIndicesGet( src, ec )
void cxConnectionConnectionsArraySet( cxConnection *src, signed long* val, cxErrorCode *ec ); void cxConnectionConnectionsLengthSet( cxConnection *src, signed long val, cxErrorCode *ec ); void cxConnectionElementsArraySet( cxConnection *src, signed long* val, cxErrorCode *ec ); void cxConnectionElementsLengthSet( cxConnection *src, signed long val, cxErrorCode *ec ); void cxConnectionNumElementsSet( cxConnection *src, signed long val, cxErrorCode *ec ); void cxPyramidBaseLatticeSet( cxPyramid *src, cxLattice* val, cxErrorCode *ec ); void cxPyramidCompressionIndexSet( cxPyramid *src, void *member, cxErrorCode *ec ); void cxPyramidCompressionTypeSet( cxPyramid *src, cxCompressType val, cxErrorCode *ec ); void cxPyramidDictionaryNumDimsSet( cxPyramidDictionary *src, signed long val, cxErrorCode *ec ); void cxPyramidDictionaryNumEntriesSet( cxPyramidDictionary *src, signed long val, cxErrorCode *ec ); void cxPyramidDictionarySet( cxPyramid *src, cxPyramidDictionary* val, cxErrorCode *ec ); void cxPyramidDictionaryTableSet( cxPyramidDictionary *src, cxPyramid** val, cxErrorCode *ec ); void cxPyramidLayerConnectionSet( cxPyramid *src, cxConnection* val, long layerInd, cxErrorCode *ec ); void cxPyramidLayerLatticeSet( cxPyramid *src, cxLattice* val, long layerInd, cxErrorCode *ec ); void cxPyramidNumLevelsSet( cxPyramid *src, signed long val, cxErrorCode *ec ); void cxPyramidNumberIndicesSet( cxPyramid *src, signed long val, cxErrorCode *ec );
subroutine cxConnectionConnectionsArraySet( src, val, ec ) subroutine cxConnectionConnectionsLengthSet( src, val, ec ) subroutine cxConnectionElementsArraySet( src, val, ec ) subroutine cxConnectionElementsLengthSet( src, val, ec ) subroutine cxConnectionNumElementsSet( src, val, ec ) subroutine cxPyramidBaseLatticeSet( src, val, ec ) subroutine cxPyramidCompressionIndexSet( src, member, ec ) subroutine cxPyramidCompressionTypeSet( src, val, ec ) subroutine cxPyramidDictionaryNumDimsSet( src, val, ec ) subroutine cxPyramidDictionaryNumEntriesSet( src, val, ec ) subroutine cxPyramidDictionarySet( src, val, ec ) subroutine cxPyramidDictionaryTableSet( src, val, ec ) subroutine cxPyramidLayerConnectionSet( src, val, layerInd, ec ) subroutine cxPyramidLayerLatticeSet( src, val, layerInd, ec ) subroutine cxPyramidNumLevelsSet( src, val, ec ) subroutine cxPyramidNumberIndicesSet( src, val, ec )
cxPrimType cxPyramidCompressionIndexType( cxPyramid *src, cxErrorCode *ec );
integer function cxPyramidCompressionIndexType( src, ec )
long cxConnectionConnectionsArrayLen( cxConnection *src, cxErrorCode *ec ); long cxConnectionElementsArrayLen( cxConnection *src, cxErrorCode *ec ); long cxPyramidCompressionIndexLen( cxPyramid *src, cxErrorCode *ec ); long cxPyramidDictionaryTableLen( cxPyramidDictionary *src, cxErrorCode *ec ); long cxPyramidlayerLen( cxPyramid *src, cxErrorCode *ec );
integer function cxConnectionConnectionsArrayLen( src, ec ) integer function cxConnectionElementsArrayLen( src, ec ) integer function cxPyramidCompressionIndexLen( src, ec ) integer function cxPyramidDictionaryTableLen( src, ec ) integer function cxPyramidlayerLen( src, ec )
cxConnection* cxConnectionDup( cxConnection *src ); cxPyramidDictionary* cxPyramidDictionaryDup( cxPyramidDictionary *src ); cxPyramid* cxPyramidDup( cxPyramid *src );
integer function cxConnectionDup( src ) integer function cxPyramidDictionaryDup( src ) integer function cxPyramidDup( src )
cxConnection* cxConnectionCopy( cxConnection *src ); cxPyramid* cxPyramidCopy( cxPyramid *src ); cxPyramidDictionary* cxPyramidDictionaryCopy( cxPyramidDictionary *src );
integer function cxConnectionCopy( src ) integer function cxPyramidCopy( src ) integer function cxPyramidDictionaryCopy( src )
cxConnection* cxConnectionAlloc( signed long ElementsLength, signed long ConnectionsLength ); cxPyramid* cxPyramidAlloc( signed long NumLevels, cxCompressType CompressionType, signed long NumberIndices ); void* cxPyramidCompressionIndexAlloc( cxPyramid *src ); cxPyramidDictionary* cxPyramidDictionaryAlloc( signed long NumEntries );
integer function cxConnectionAlloc( ElementsLength, ConnectionsLength ) integer function cxPyramidAlloc( NumLevels, CompressionType, NumberIndices ) integer function cxPyramidCompressionIndexAlloc( src ) integer function cxPyramidDictionaryAlloc( NumEntries )There are two types of allocation routines, those that allocate an array and those that allocate a reference-counted structure.
void cxConnectionConnectionsArrayRem( cxConnection *src, signed long* *val, cxErrorCode *ec ); void cxConnectionElementsArrayRem( cxConnection *src, signed long* *val, cxErrorCode *ec ); void cxPyramidCompressionIndexRem( cxPyramid *src, void *val, cxErrorCode *ec ); void cxPyramidDictionaryTableRem( cxPyramidDictionary *src, cxPyramid** *val, cxErrorCode *ec ); void cxPyramidlayerRem( cxPyramid *src, cxPyramidLayer* *val, cxErrorCode *ec );
cxConnection* cxConnectionRead( FILE *fd ); cxPyramidDictionary* cxPyramidDictionaryRead( FILE *fd ); cxPyramid* cxPyramidRead( FILE *fd );
integer function cxConnectionRead( fd ) integer function cxPyramidDictionaryRead( fd ) integer function cxPyramidRead( fd )
void cxConnectionWrite( FILE *fd, int mode, cxConnection *src ); void cxPyramidDictionaryWrite( FILE *fd, int mode, cxPyramidDictionary *src ); void cxPyramidWrite( FILE *fd, int mode, cxPyramid *src );
subroutine cxConnectionWrite( fd, mode, src ) subroutine cxPyramidDictionaryWrite( fd, mode, src ) subroutine cxPyramidWrite( fd, mode, src )
pragma "version 2.0" #include <cx/cxLattice.t> shared root typedef struct cxPyramid { cxLattice baseLattice "Base Lattice"; long count "Num Levels"; cxPyramidLayer layer[count]; cxPyramidReference ref; } cxPyramid; typedef struct { closed cxConnection relation "Layer %d Connection"; closed cxLattice nextLattice "Layer %d Lattice"; } cxPyramidLayer; shared typedef struct { long numElements "Num Elements"; long elemArrayLen "Elements Length"; long numConnections "Connections Length"; long elements[elemArrayLen] "Elements Array"; long connections[numConnections] "Connections Array"; } cxConnection; typedef enum { cx_compress_none, cx_compress_unique, cx_compress_multiple } cxCompressType; shared typedef struct { long nDim "Num Dims"; long numEntries "Num Entries"; closed struct cxPyramid table[numEntries] "Table"; } cxPyramidDictionary; typedef struct { cxCompressType compressType "Compression Type"; switch (compressType) { case cx_compress_multiple: long numIndices "Number Indices"; long indices[numIndices] "Compression Index"; case cx_compress_unique: long index "Compression Index"; } r; cxPyramidDictionary dictionary "Dictionary"; } cxPyramidReference;