00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef LIBLOOKDB_LOOKDBINTERFACE_H
00019 #define LIBLOOKDB_LOOKDBINTERFACE_H
00020
00021
00022
00044 #ifndef DOXYGEN
00045 #ifdef WIN32
00046 #if defined(LOOKDBLIBRARY_BUILD) || defined(LOOKDBINTERFACE_BUILD)
00047 #define LOOKDBINTERFACE_DLL __declspec(dllexport)
00048 #else
00049 #define LOOKDBINTERFACE_DLL __declspec(dllimport)
00050 #endif
00051 #else
00052 #define LOOKDBINTERFACE_DLL
00053 #endif
00054
00055
00056 #define INVALID_PASSWORD_ERROR 1
00057 #endif
00058
00059
00060
00061 #define DB_TYPE_ERROR -1
00062 #define DB_UNKNOWN 0
00063 #define DB_INGRES 1
00064 #define DB_SQL_SERVER 2
00065 #define DB_ORACLE 3
00066 #define DB_POSTGRES 4
00067
00087 #ifndef DOXYGEN
00088
00089 #define LOOK_DBC long
00090 #define LOOK_STMT long
00091 #define LOOK_SQLDA long
00092 #define LOOK_SQLCOL long
00093 #define LOOK_TYPE int
00094 #endif
00095
00096
00097 #define LOOK_CHAR 0
00098 #define LOOK_INTEGER 1
00099 #define LOOK_FLOAT 2
00100 #define LOOK_MONEY 3
00101 #define LOOK_VARCHAR 4
00102 #define LOOK_DATE 5
00103 #define LOOK_LONGVARCHAR 6
00104 #define LOOK_NUMERIC 7
00105 #define LOOK_RAWDATA 8
00106 #define LOOK_LONGRAWDATA 9
00107
00139 #ifndef DOXYGEN
00140
00141
00142 #ifndef BOOLEAN
00143 #define BOOLEAN short int
00144 #endif
00145
00146 #ifdef TRUE
00147 #if (TRUE == 0)
00148 #undef TRUE
00149 #define TRUE 1
00150 #endif
00151 #else
00152 #define TRUE 1
00153 #endif
00154
00155 #ifdef FALSE
00156 #if (FALSE != 0)
00157 #undef FALSE
00158 #define FALSE 0
00159 #endif
00160 #else
00161 #define FALSE 0
00162 #endif
00163 #endif
00164
00165 #include <stddef.h>
00166
00167 #ifdef __cplusplus
00168 extern "C" {
00169 #endif
00170 LOOKDBINTERFACE_DLL int lookdbabf( );
00171 LOOKDBINTERFACE_DLL LOOK_DBC lookDbConnect (const char *theDatabaseName,
00172 const char *theUser, const char *thePassword,
00173 int isAutoCommit );
00174 LOOKDBINTERFACE_DLL void lookDbDisconnect (LOOK_DBC theSession);
00175 LOOKDBINTERFACE_DLL LOOK_STMT lookDbPrepare (LOOK_DBC theSession, const char *theStatement);
00176 LOOKDBINTERFACE_DLL BOOLEAN lookDbExecute (LOOK_STMT theStmt, int* theRowsAffected );
00177 LOOKDBINTERFACE_DLL BOOLEAN lookDbDescribe (LOOK_STMT theStmt);
00178 LOOKDBINTERFACE_DLL BOOLEAN lookDbOpenCursor (LOOK_STMT theStmt);
00179 LOOKDBINTERFACE_DLL BOOLEAN lookDbFetchCursor (LOOK_STMT theStmt);
00180 LOOKDBINTERFACE_DLL void lookDbCloseCursor (LOOK_STMT theStmt);
00181 LOOKDBINTERFACE_DLL void lookDbDestroyStatement( LOOK_STMT theStmt );
00182 LOOKDBINTERFACE_DLL BOOLEAN lookDbCommit (LOOK_DBC theSession);
00183 LOOKDBINTERFACE_DLL BOOLEAN lookDbRollback (LOOK_DBC theSession);
00184 LOOKDBINTERFACE_DLL BOOLEAN lookDbSetActiveSession (LOOK_DBC theSession);
00185
00186 LOOKDBINTERFACE_DLL void lookDsPutInteger (LOOK_STMT theStmt, int theIndex, int theValue);
00187 LOOKDBINTERFACE_DLL void lookDsPutFloat (LOOK_STMT theStmt, int theIndex, double theValue);
00188 LOOKDBINTERFACE_DLL void lookDsPutString (LOOK_STMT theStmt, int theIndex,
00189 const char *theValue, size_t theLength);
00190 LOOKDBINTERFACE_DLL void lookDsPutLongString (LOOK_STMT theStmt, int theIndex,
00191 const char *theValue, size_t theLength);
00192 LOOKDBINTERFACE_DLL void lookDsPutLongRawData (LOOK_STMT theStmt, int theIndex,
00193 const char *theValue, size_t theLength);
00194 LOOKDBINTERFACE_DLL void lookDsPutRawData (LOOK_STMT theStmt, int theIndex,
00195 const char *theValue, size_t theLength);
00196 LOOKDBINTERFACE_DLL void lookDsPutNULLInteger (LOOK_STMT theStmt, int theIndex);
00197 LOOKDBINTERFACE_DLL void lookDsPutNULLFloat (LOOK_STMT theStmt, int theIndex);
00198 LOOKDBINTERFACE_DLL void lookDsPutNULLString (LOOK_STMT theStmt, int theIndex);
00199 LOOKDBINTERFACE_DLL void lookDsPutNULLLongString (LOOK_STMT theStmt, int theIndex);
00200 LOOKDBINTERFACE_DLL void lookDsPutNULLLongRawData (LOOK_STMT theStmt, int theIndex);
00201 LOOKDBINTERFACE_DLL void lookDsPutNULLRawData (LOOK_STMT theStmt, int theIndex);
00202 LOOKDBINTERFACE_DLL int lookDsColCount(LOOK_STMT theStmt);
00203 LOOKDBINTERFACE_DLL BOOLEAN lookDsHasResults(LOOK_STMT theStmt);
00204 LOOKDBINTERFACE_DLL int lookDsParameterCount(LOOK_STMT theStmt);
00205 LOOKDBINTERFACE_DLL void lookDsSetParameterCount(LOOK_STMT theStmt, int theCount);
00206
00207
00208 LOOKDBINTERFACE_DLL char *lookDcFieldName(LOOK_STMT theStmt, int theIndex);
00209
00210 LOOKDBINTERFACE_DLL BOOLEAN lookDcNullable(LOOK_STMT theStmt, int theIndex);
00211 LOOKDBINTERFACE_DLL BOOLEAN lookDcIsNull(LOOK_STMT theStmt, int theIndex);
00212 LOOKDBINTERFACE_DLL LOOK_TYPE lookDcType(LOOK_STMT theStmt, int theIndex);
00213 LOOKDBINTERFACE_DLL char *lookDcValue(LOOK_STMT theStmt, int theIndex);
00214 LOOKDBINTERFACE_DLL int lookDcPrecision(LOOK_STMT theStmt, int theIndex);
00215
00216 LOOKDBINTERFACE_DLL const char* lookDbGetLastError( long* theErrorNumber );
00217
00218 LOOKDBINTERFACE_DLL int lookDbGetDatabaseType( LOOK_DBC theSession );
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 LOOKDBINTERFACE_DLL BOOLEAN lookDbSetInterfaceLibrary( const char* theLibraryName );
00230
00231 #ifdef __cplusplus
00232 }
00233 #endif
00234
00235 #define lookDcValueAs(T,DC,X) *((T*)lookDcValue(DC,X))
00236
00237
00242 #endif