/*
 * rbcDecls.h --
 *
 *  Declarations of functions in the platform independent public RBC API.
 *
 */

#ifndef _RBCDECLS
#define _RBCDECLS

/* Note: RBCAPI defined on compile line when building RBC */
#ifdef RBCAPI
#   undef TCL_STORAGE_CLASS
#   define TCL_STORAGE_CLASS DLLEXPORT
#else
#   define RBCAPI extern
#   undef USE_RBCAPI_STUBS
#   define USE_RBCAPI_STUBS 1
#endif

typedef struct Rbc_Vector_s Rbc_Vector;

const char *Rbc_InitStubs(Tcl_Interp *interp, const char *version, int exact);

/*
 * WARNING: The below contents of this file is automatically generated by the
 * genStubs.tcl script. Any modifications to the function declarations
 * below should be made in the rbc.decls script.
 */

/* !BEGIN!: Do not edit below this line. */

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Exported function declarations:
 */

/* 0 */
RBCAPI int		Rbc_CreateVector(Tcl_Interp *interp, const char *vecName,
				int size, Rbc_Vector **vecPtrPtr);
/* 1 */
RBCAPI int		Rbc_GetVector(Tcl_Interp *interp, const char *vecName,
				Rbc_Vector **vecPtrPtr);
/* 2 */
RBCAPI int		Rbc_ResizeVector(Rbc_Vector *vecPtr, int nValues);
/* 3 */
RBCAPI char *		Rbc_NameOfVector(Rbc_Vector *vecPtr);
/* 4 */
RBCAPI int		Rbc_ResetVector(Rbc_Vector *vecPtr, double *dataArr,
				int nValues, int arraySize,
				Tcl_FreeProc *freeProc);
/* 5 */
RBCAPI double *		Rbc_VectorData(Rbc_Vector *v);
/* 6 */
RBCAPI int		Rbc_VectorLength(Rbc_Vector *v);
/* 7 */
RBCAPI int		Rbc_VectorSize(Rbc_Vector *v);
/* 8 */
RBCAPI int		Rbc_VectorDirty(Rbc_Vector *v);
/* 9 */
RBCAPI int		Rbc_VectorExists2(Tcl_Interp *ip, const char *name);
/* 10 */
RBCAPI void		Rbc_FreeVector(Rbc_Vector *v);

typedef struct RbcStubs {
    int magic;
    void *hooks;

    int (*rbc_CreateVector) (Tcl_Interp *interp, const char *vecName, int size, Rbc_Vector **vecPtrPtr); /* 0 */
    int (*rbc_GetVector) (Tcl_Interp *interp, const char *vecName, Rbc_Vector **vecPtrPtr); /* 1 */
    int (*rbc_ResizeVector) (Rbc_Vector *vecPtr, int nValues); /* 2 */
    char * (*rbc_NameOfVector) (Rbc_Vector *vecPtr); /* 3 */
    int (*rbc_ResetVector) (Rbc_Vector *vecPtr, double *dataArr, int nValues, int arraySize, Tcl_FreeProc *freeProc); /* 4 */
    double * (*rbc_VectorData) (Rbc_Vector *v); /* 5 */
    int (*rbc_VectorLength) (Rbc_Vector *v); /* 6 */
    int (*rbc_VectorSize) (Rbc_Vector *v); /* 7 */
    int (*rbc_VectorDirty) (Rbc_Vector *v); /* 8 */
    int (*rbc_VectorExists2) (Tcl_Interp *ip, const char *name); /* 9 */
    void (*rbc_FreeVector) (Rbc_Vector *v); /* 10 */
} RbcStubs;

extern const RbcStubs *rbcStubsPtr;

#ifdef __cplusplus
}
#endif

#if defined(USE_RBC_STUBS)

/*
 * Inline function declarations:
 */

#define Rbc_CreateVector \
	(rbcStubsPtr->rbc_CreateVector) /* 0 */
#define Rbc_GetVector \
	(rbcStubsPtr->rbc_GetVector) /* 1 */
#define Rbc_ResizeVector \
	(rbcStubsPtr->rbc_ResizeVector) /* 2 */
#define Rbc_NameOfVector \
	(rbcStubsPtr->rbc_NameOfVector) /* 3 */
#define Rbc_ResetVector \
	(rbcStubsPtr->rbc_ResetVector) /* 4 */
#define Rbc_VectorData \
	(rbcStubsPtr->rbc_VectorData) /* 5 */
#define Rbc_VectorLength \
	(rbcStubsPtr->rbc_VectorLength) /* 6 */
#define Rbc_VectorSize \
	(rbcStubsPtr->rbc_VectorSize) /* 7 */
#define Rbc_VectorDirty \
	(rbcStubsPtr->rbc_VectorDirty) /* 8 */
#define Rbc_VectorExists2 \
	(rbcStubsPtr->rbc_VectorExists2) /* 9 */
#define Rbc_FreeVector \
	(rbcStubsPtr->rbc_FreeVector) /* 10 */

#endif /* defined(USE_RBC_STUBS) */

/* !END!: Do not edit above this line. */

#endif
