Changeset cffi,3 for cffi/src/odbc/odbc-ff-interface.lisp
- Timestamp:
- 12/07/2007 02:13:22 PM (19 years ago)
- revision id:
- svn-v3-trunk1:1c22b0a8-4d0b-0410-a296-af6a2e6f35e3:plain-odbc%2Ftrunk:8
- File:
-
- 1 edited
-
cffi/src/odbc/odbc-ff-interface.lisp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cffi/src/odbc/odbc-ff-interface.lisp
r1 r3 18 18 (load-foreign-library :odbc) 19 19 20 (defctype string-ptr :pointer) 21 22 23 24 ;;;; dso- 25 26 (defctype sql-small-int :int16) 27 (defctype sql-u-small-int :uint16) 28 (defctype sql-integer :int32) 29 (defctype sql-u-integer :uint32) 30 (defctype sql-pointer :pointer) 31 (defctype sql-len sql-integer) 32 (defctype sql-u-len sql-u-integer) 33 (defctype sql-return sql-small-int) 34 35 (defctype *sql-small-int :pointer) 36 (defctype *sql-integer :pointer) 37 (defctype *sql-len :pointer) 38 (defctype *sql-u-len :pointer) 39 20 40 (defctype sql-handle :pointer) 21 (defctype *sql-handle :pointer) 22 (defctype RETCODE :short) 23 (defctype *short :pointer) 24 (defctype *sdword :pointer) 25 (defctype *sword :pointer) 26 (defctype *ulong :pointer) 27 28 29 (defctype string-ptr :pointer) 30 31 32 33 (defcfun "SQLAllocEnv" retcode (penv *sql-handle)) 34 35 (defcfun "SQLAllocConnect" retcode 36 (henv sql-handle) ; HENV henv 37 (*phdbc *sql-handle)) ; HDBC FAR *phdbc 38 39 (defcfun "SQLConnect" retcode 40 (hdbc sql-handle) ; HDBC hdbc 41 (*szDSN string-ptr) ; UCHAR FAR *szDSN 42 (cbDSN :short) ; SWORD cbDSN 43 (*szUID string-ptr) ; UCHAR FAR *szUID 44 (cbUID :short) ; SWORD cbUID 45 (*szAuthStr string-ptr) ; UCHAR FAR *szAuthStr 46 (cbAuthStr :short) ; SWORD cbAuthStr 47 ) 41 (defctype sql-h-env sql-handle) 42 (defctype sql-h-dbc sql-handle) 43 (defctype sql-h-stmt sql-handle) 44 (defctype sql-h-wnd :pointer) 45 46 (defctype *sql-h-env :pointer) 47 (defctype *sql-h-dbc :pointer) 48 (defctype *sql-h-stmt :pointer) 49 50 (defmacro defsqlfun (name (&rest args)) 51 `(defcfun ,name sql-return ,@args)) 52 53 ;;;; -dso 54 55 56 57 (defsqlfun "SQLAllocEnv" 58 ((penv *sql-h-env))) 59 60 (defsqlfun "SQLAllocConnect" 61 ((henv sql-h-env) ; HENV henv 62 (*phdbc *sql-h-dbc))) ; HDBC FAR *phdbc 63 64 (defsqlfun "SQLDriverConnect" 65 ((hdbc sql-h-dbc) ; HDBC hdbc 66 (hwnd sql-h-wnd) ; SQLHWND hwnd 67 ;(*szConnStrIn string-ptr) ; UCHAR FAR *szConnStrIn 68 (*szConnStrIn string-ptr) ; UCHAR FAR *szConnStrIn 69 (cbConnStrIn sql-small-int) ; SWORD cbConnStrIn 70 ;(*szConnStrOut string-ptr) ; UCHAR FAR *szConnStrOut 71 (*szConnStrOut string-ptr) ; UCHAR FAR *szConnStrOut 72 (cbConnStrOutMax sql-small-int) ; SWORD cbConnStrOutMaxw 73 (*pcbConnStrOut *sql-small-int) ; SWORD FAR *pcbConnStrOut 74 (fDriverCompletion :unsigned-short))) ; UWORD fDriverCompletion 75 76 (defsqlfun "SQLDisconnect" 77 ((hdbc sql-h-dbc))) ; HDBC hdbc 78 79 (defsqlfun "SQLAllocStmt" 80 ((hdbc sql-h-dbc) ; HDBC hdbc 81 (*phstmt *sql-h-stmt))) ; HSTMT FAR *phstmt 82 83 84 85 (defsqlfun "SQLGetInfo" 86 ((hdbc sql-h-dbc) ; HDBC hdbc 87 (fInfoType sql-u-small-int) ; UWORD fInfoType 88 (rgbInfoValue sql-pointer) ; PTR rgbInfoValue 89 (cbInfoValueMax sql-small-int) ; SWORD cbInfoValueMax 90 (*pcbInfoValue *sql-small-int))) ; SWORD FAR *pcbInfoValue 91 92 93 (defsqlfun ("SQLGetInfo" SQLGetInfo-Str) 94 ((hdbc sql-h-dbc) ; HDBC hdbc 95 (fInfoType sql-u-small-int) ; UWORD fInfoType 96 (rgbInfoValue string-ptr) ; PTR rgbInfoValue 97 (cbInfoValueMax sql-small-int) ; SWORD cbInfoValueMax 98 (*pcbInfoValue *sql-small-int))) ; SWORD FAR *pcbInfoValue 99 100 101 (defsqlfun "SQLPrepare" 102 ((hstmt sql-h-stmt) ; HSTMT hstmt 103 (*szSqlStr string-ptr) ; UCHAR FAR *szSqlStr 104 (cbSqlStr sql-integer))) ; SDWORD cbSqlStr 105 106 107 108 (defsqlfun "SQLExecute" 109 ((hstmt sql-h-stmt))) ; HSTMT hstmt 110 111 112 (defsqlfun "SQLExecDirect" 113 ((hstmt sql-h-stmt) ; HSTMT hstmt 114 (*szSqlStr string-ptr) ; UCHAR FAR *szSqlStr 115 (cbSqlStr sql-integer))) ; SDWORD cbSqlStr 116 117 118 119 (defsqlfun "SQLFreeStmt" 120 ((hstmt sql-h-stmt) ; HSTMT hstmt 121 (fOption sql-u-small-int))) ; UWORD fOption 122 123 124 125 (defsqlfun "SQLError" 126 ((henv sql-h-env) ; HENV henv 127 (hdbc sql-h-dbc) ; HDBC hdbc 128 (hstmt sql-h-stmt) ; HSTMT hstmt 129 ; (*szSqlState string-ptr) ; UCHAR FAR *szSqlState 130 (*szSqlState string-ptr) ; UCHAR FAR *szSqlState 131 (*pfNativeError *sql-integer) ; SDWORD FAR *pfNativeError 132 ; (*szErrorMsg string-ptr) ; UCHAR FAR *szErrorMsg 133 (*szErrorMsg string-ptr) ; UCHAR FAR *szErrorMsg 134 (cbErrorMsgMax sql-small-int) ; SWORD cbErrorMsgMax 135 (*pcbErrorMsg *sql-small-int))) ; SWORD FAR *pcbErrorMsg 136 137 138 139 (defsqlfun "SQLNumResultCols" 140 ((hstmt sql-h-stmt) ; HSTMT hstmt 141 (*pccol *sql-small-int))) ; SWORD FAR *pccol 142 143 144 (defsqlfun "SQLRowCount" 145 ((hstmt sql-h-stmt) ; HSTMT hstmt 146 (*pcrow *sql-len))) ; SDWORD FAR *pcrow 147 148 149 (defsqlfun "SQLDescribeCol" 150 ((hstmt sql-h-stmt) ; HSTMT hstmt 151 (icol sql-u-small-int) ; UWORD icol 152 (*szColName string-ptr) ; UCHAR FAR *szColName 153 (cbColNameMax sql-small-int) ; SWORD cbColNameMax 154 (*pcbColName *sql-small-int) ; SWORD FAR *pcbColName 155 (*pfSqlType *sql-small-int) ; SWORD FAR *pfSqlType 156 (*pcbColDef *sql-u-len) ; UDWORD FAR *pcbColDef 157 (*pibScale *sql-small-int) ; SWORD FAR *pibScale 158 (*pfNullable *sql-small-int))) ; SWORD FAR *pfNullable 159 160 161 (defsqlfun "SQLBindCol" 162 ((hstmt sql-h-stmt) ; HSTMT hstmt 163 (icol sql-u-small-int) ; UWORD icol 164 (fCType sql-small-int) ; SWORD fCType 165 (rgbValue sql-pointer) ; PTR rgbValue 166 (cbValueMax sql-len) ; SDWORD cbValueMax 167 (*pcbValue *sql-len))) ; SDWORD FAR *pcbValue 168 48 169 49 (defcfun "SQLDriverConnect" retcode 50 (hdbc sql-handle) ; HDBC hdbc 51 (hwnd sql-handle) ; SQLHWND hwnd 52 ;(*szConnStrIn string-ptr) ; UCHAR FAR *szConnStrIn 53 (*szConnStrIn string-ptr) ; UCHAR FAR *szConnStrIn 54 (cbConnStrIn :short) ; SWORD cbConnStrIn 55 ;(*szConnStrOut string-ptr) ; UCHAR FAR *szConnStrOut 56 (*szConnStrOut string-ptr) ; UCHAR FAR *szConnStrOut 57 (cbConnStrOutMax :short) ; SWORD cbConnStrOutMaxw 58 (*pcbConnStrOut *short) ; SWORD FAR *pcbConnStrOut 59 (fDriverCompletion :unsigned-short) ; UWORD fDriverCompletion 60 ) 61 62 (defcfun "SQLDisconnect" retcode 63 (hdbc sql-handle)) ; HDBC hdbc 64 65 (defcfun "SQLAllocStmt" retcode 66 (hdbc sql-handle) ; HDBC hdbc 67 (*phstmt *sql-handle)) ; HSTMT FAR *phstmt 68 69 70 71 (defcfun "SQLGetInfo" retcode 72 (hdbc sql-handle) ; HDBC hdbc 73 (fInfoType :short) ; UWORD fInfoType 74 (rgbInfoValue :pointer) ; PTR rgbInfoValue 75 (cbInfoValueMax :short) ; SWORD cbInfoValueMax 76 (*pcbInfoValue :pointer) ; SWORD FAR *pcbInfoValue 77 ) 78 79 (defcfun ("SQLGetInfo" SQLGetInfo-Str) retcode 80 (hdbc sql-handle) ; HDBC hdbc 81 (fInfoType :short) ; UWORD fInfoType 82 (rgbInfoValue string-ptr) ; PTR rgbInfoValue 83 (cbInfoValueMax :short) ; SWORD cbInfoValueMax 84 (*pcbInfoValue :pointer) ; SWORD FAR *pcbInfoValue 85 ) 86 87 88 (defcfun "SQLPrepare" retcode 89 (hstmt sql-handle) ; HSTMT hstmt 90 (*szSqlStr string-ptr) ; UCHAR FAR *szSqlStr 91 (cbSqlStr :long) ; SDWORD cbSqlStr 92 ) 93 94 95 (defcfun "SQLExecute" retcode 96 (hstmt sql-handle) ; HSTMT hstmt 97 ) 98 99 100 (defcfun "SQLExecDirect" retcode 101 (hstmt sql-handle) ; HSTMT hstmt 102 (*szSqlStr string-ptr) ; UCHAR FAR *szSqlStr 103 (cbSqlStr :long) ; SDWORD cbSqlStr 104 ) 105 106 107 (defcfun "SQLFreeStmt" retcode 108 (hstmt sql-handle) ; HSTMT hstmt 109 (fOption :short)) ; UWORD fOption 110 111 112 (defcfun "SQLCancel" retcode 113 (hstmt sql-handle) ; HSTMT hstmt 114 ) 115 116 117 (defcfun "SQLError" retcode 118 (henv sql-handle) ; HENV henv 119 (hdbc sql-handle) ; HDBC hdbc 120 (hstmt sql-handle) ; HSTMT hstmt 121 ; (*szSqlState string-ptr) ; UCHAR FAR *szSqlState 122 (*szSqlState string-ptr) ; UCHAR FAR *szSqlState 123 (*pfNativeError *SDWORD) ; SDWORD FAR *pfNativeError 124 ; (*szErrorMsg string-ptr) ; UCHAR FAR *szErrorMsg 125 (*szErrorMsg string-ptr) ; UCHAR FAR *szErrorMsg 126 (cbErrorMsgMax :short) ; SWORD cbErrorMsgMax 127 (*pcbErrorMsg *short)) ; SWORD FAR *pcbErrorMsg 128 129 130 131 (defcfun "SQLNumResultCols" retcode 132 (hstmt sql-handle) ; HSTMT hstmt 133 (*pccol :pointer) ; SWORD FAR *pccol 134 ) 135 136 137 (defcfun "SQLRowCount" retcode 138 (hstmt sql-handle) ; HSTMT hstmt 139 (*pcrow *sdword) ; SDWORD FAR *pcrow 140 ) 141 142 143 (defcfun "SQLDescribeCol" retcode 144 (hstmt sql-handle) ; HSTMT hstmt 145 (icol :short) ; UWORD icol 146 (*szColName string-ptr) ; UCHAR FAR *szColName 147 (cbColNameMax :short) ; SWORD cbColNameMax 148 (*pcbColName *short) ; SWORD FAR *pcbColName 149 (*pfSqlType *short) ; SWORD FAR *pfSqlType 150 (*pcbColDef *ulong) ; UDWORD FAR *pcbColDef 151 (*pibScale *short) ; SWORD FAR *pibScale 152 (*pfNullable *short) ; SWORD FAR *pfNullable 153 ) 154 155 156 (defcfun "SQLColAttributes" retcode 157 (hstmt sql-handle) ; HSTMT hstmt 158 (icol :short) ; UWORD icol 159 (fDescType :short) ; UWORD fDescType 160 (rgbDesc :pointer) ; PTR rgbDesc 161 (cbDescMax :short) ; SWORD cbDescMax 162 (*pcbDesc *sword) ; SWORD FAR *pcbDesc 163 (*pfDesc *sdword) ; SDWORD FAR *pfDesc 164 ) 165 166 167 (defcfun "SQLColumns" retcode 168 (hstmt sql-handle) ; HSTMT hstmt 169 (*szTableQualifier string-ptr) ; UCHAR FAR *szTableQualifier 170 (cbTableQualifier :short) ; SWORD cbTableQualifier 171 (*szTableOwner string-ptr) ; UCHAR FAR *szTableOwner 172 (cbTableOwner :short) ; SWORD cbTableOwner 173 (*szTableName string-ptr) ; UCHAR FAR *szTableName 174 (cbTableName :short) ; SWORD cbTableName 175 (*szColumnName string-ptr) ; UCHAR FAR *szColumnName 176 (cbColumnName :short) ; SWORD cbColumnName 177 ) 178 179 180 (defcfun "SQLBindCol" retcode 181 (hstmt sql-handle) ; HSTMT hstmt 182 (icol :short) ; UWORD icol 183 (fCType :short) ; SWORD fCType 184 (rgbValue :pointer) ; PTR rgbValue 185 (cbValueMax :long) ; SDWORD cbValueMax 186 (*pcbValue *sdword) ; SDWORD FAR *pcbValue 187 ) 188 189 190 (defcfun "SQLFetch" retcode 191 (hstmt sql-handle) ; HSTMT hstmt 192 ) 193 194 195 (defcfun "SQLTransact" retcode 196 (henv sql-handle) ; HENV henv 197 (hdbc sql-handle) ; HDBC hdbc 198 (fType :short) ; UWORD fType ($SQL_COMMIT or $SQL_ROLLBACK) 199 ) 200 201 202 ;; ODBC 2.0 203 (defcfun "SQLDescribeParam" retcode 204 (hstmt sql-handle) ; HSTMT hstmt 205 (ipar :short) ; UWORD ipar 206 (*pfSqlType *sword) ; SWORD FAR *pfSqlType 207 (*pcbColDef *ulong) ; UDWORD FAR *pcbColDef 208 (*pibScale *sword) ; SWORD FAR *pibScale 209 (*pfNullable *sword) ; SWORD FAR *pfNullable 210 ) 211 212 213 ;; ODBC 2.0 214 (defcfun "SQLBindParameter" retcode 215 (hstmt sql-handle) ; HSTMT hstmt 216 (ipar :short) ; UWORD ipar 217 (fParamType :short) ; SWORD fParamType 218 (fCType :short) ; SWORD fCType 219 (fSqlType :short) ; SWORD fSqlType 220 (cbColDef :ulong) ; UDWORD cbColDef 221 (ibScale :short) ; SWORD ibScale 222 (rgbValue :pointer) ; PTR rgbValue 223 (cbValueMax :long) ; SDWORD cbValueMax 224 (*pcbValue *sdword) ; SDWORD FAR *pcbValue 225 ) 226 227 228 ;; level 1 229 (defcfun "SQLGetData" retcode 230 (hstmt sql-handle) ; HSTMT hstmt 231 (icol :short) ; UWORD icol 232 (fCType :short) ; SWORD fCType 233 (rgbValue :pointer) ; PTR rgbValue 234 (cbValueMax :long) ; SDWORD cbValueMax 235 (*pcbValue *sdword) ; SDWORD FAR *pcbValue 236 ) 237 238 239 (defcfun "SQLParamData" retcode 240 (hstmt sql-handle) ; HSTMT hstmt 241 (*prgbValue :pointer) ; PTR FAR *prgbValue 242 ) 243 244 245 (defcfun "SQLPutData" retcode 246 (hstmt sql-handle) ; HSTMT hstmt 247 (rgbValue :pointer) ; PTR rgbValue 248 (cbValue :long) ; SDWORD cbValue 249 ) 250 251 252 (defcfun "SQLGetConnectOption" retcode 253 (hdbc sql-handle) ; HDBC hdbc 254 (fOption :short) ; UWORD fOption 255 (pvParam :pointer) ; PTR pvParam 256 ) 257 258 259 (defcfun "SQLSetConnectOption" retcode 260 (hdbc sql-handle) ; HDBC hdbc 261 (fOption :short) ; UWORD fOption 262 (vParam :ulong) ; UDWORD vParam 263 ) 170 (defsqlfun "SQLFetch" 171 ((hstmt sql-h-stmt))) ; HSTMT hstmt 172 173 174 (defsqlfun "SQLTransact" 175 ((henv sql-h-env) ; HENV henv 176 (hdbc sql-h-dbc) ; HDBC hdbc 177 (fType sql-u-small-int))) ; UWORD fType ($SQL_COMMIT or $SQL_ROLLBACK) 178 179 180 ;; ODBC 2.0 181 (defsqlfun "SQLBindParameter" 182 ((hstmt sql-h-stmt) ; HSTMT hstmt 183 (ipar sql-u-small-int) ; UWORD ipar 184 (fParamType sql-small-int) ; SWORD fParamType 185 (fCType sql-small-int) ; SWORD fCType 186 (fSqlType sql-small-int) ; SWORD fSqlType 187 (cbColDef sql-u-len) ; UDWORD cbColDef 188 (ibScale sql-small-int) ; SWORD ibScale 189 (rgbValue sql-pointer) ; PTR rgbValue 190 (cbValueMax sql-len) ; SDWORD cbValueMax 191 (*pcbValue *sql-len))) ; SDWORD FAR *pcbValue 192 193 194 ;; level 1 195 (defsqlfun "SQLGetData" 196 ((hstmt sql-h-stmt) ; HSTMT hstmt 197 (icol sql-u-small-int) ; UWORD icol 198 (fCType sql-small-int) ; SWORD fCType 199 (rgbValue sql-pointer) ; PTR rgbValue 200 (cbValueMax sql-len) ; SDWORD cbValueMax 201 (*pcbValue *sql-len))) ; SDWORD FAR *pcbValue 202 203 204 (defsqlfun "SQLParamData" 205 ((hstmt sql-h-stmt) ; HSTMT hstmt 206 (*prgbValue sql-pointer))) ; PTR FAR *prgbValue 207 208 209 (defsqlfun "SQLPutData" 210 ((hstmt sql-h-stmt) ; HSTMT hstmt 211 (rgbValue sql-pointer) ; PTR rgbValue 212 (cbValue sql-len))) ; SDWORD cbValue 213 214 215 (defsqlfun "SQLSetConnectOption" 216 ((hdbc sql-h-dbc) ; HDBC hdbc 217 (fOption sql-u-small-int) ; UWORD fOption 218 (vParam sql-u-len))) ; UDWORD vParam 264 219 265 220 … … 277 232 ; driver-specific value, the value in ValuePtr may be a signed integer. 278 233 279 (defcfun ("SQLSetConnectAttr" SQLSetConnectAttr_long) retcode 280 (hdbc sql-handle) ; HDBC hdbc 281 (fOption :short) ; UWORD fOption 282 (pvParam :long) ; UDWORD vParam 283 (stringlength :long) 284 ) 285 286 287 (defcfun ("SQLSetConnectAttr" SQLSetConnectAttr_string) retcode 288 (hdbc sql-handle) ; HDBC hdbc 289 (fOption :short) ; UWORD fOption 290 (pvParam string-ptr) ; UDWORD vParam 291 (stringlength :long) 292 ) 293 294 295 296 (defcfun "SQLSetPos" retcode 297 (hstmt sql-handle) ; HSTMT hstmt 298 (irow :short) ; UWORD irow 299 (fOption :short) ; UWORD fOption 300 (fLock :short) ; UWORD fLock 301 ) 302 303 304 ; level 2 305 (defcfun "SQLExtendedFetch" retcode 306 (hstmt sql-handle) ; HSTMT hstmt 307 (fFetchType :short) ; UWORD fFetchType 308 (irow :long) ; SDWORD irow 309 (*pcrow :pointer) ; UDWORD FAR *pcrow 310 (*rgfRowStatus :pointer) ; UWORD FAR *rgfRowStatus 311 ) 312 313 (defcfun "SQLDataSources" retcode 314 (henv sql-handle) ; HENV henv 315 (fDirection :short) 316 (*szDSN string-ptr) ; UCHAR FAR *szDSN 317 (cbDSNMax :short) ; SWORD cbDSNMax 318 (*pcbDSN *sword) ; SWORD *pcbDSN 319 (*szDescription string-ptr) ; UCHAR *szDescription 320 (cbDescriptionMax :short) ; SWORD cbDescriptionMax 321 (*pcbDescription *sword) ; SWORD *pcbDescription 322 ) 323 324 325 (defcfun "SQLFreeEnv" retcode 326 (henv sql-handle) ; HSTMT hstmt 327 ) 328 329 330 (defcfun "SQLMoreResults" retcode 331 (hstmt sql-handle)) 234 (defsqlfun ("SQLSetConnectAttr" SQLSetConnectAttr_long) 235 ((hdbc sql-h-dbc) ; HDBC hdbc 236 ;; TODO: The new def of fOption doesn't seem compatible with the 237 ;; original, but matches my headers. 238 (fOption sql-integer) ; UWORD fOption 239 (pvParam sql-integer) ; UDWORD vParam 240 (stringlength sql-integer))) 241 242 243 (defsqlfun ("SQLSetConnectAttr" SQLSetConnectAttr_string) 244 ((hdbc sql-handle) ; HDBC hdbc 245 (fOption sql-integer) ; UWORD fOption 246 (pvParam string-ptr) ; UDWORD vParam 247 (stringlength sql-integer))) 248 249 250 ;; level 2 251 (defsqlfun "SQLMoreResults" 252 ((hstmt sql-h-stmt))) 332 253 333 254 334 255 ;;; foreign type definitions 335 256 336 (defcstruct sql-c-time ""337 (hour :short)338 (minute :short)339 (second :short))340 341 (defcstruct sql-c-date ""342 (year :short)343 (month :short)344 (day :short))345 346 (defcstruct sql-c-timestamp ""347 (year :short)348 (month :short)349 (day :short)350 (hour :short)351 (minute :short)352 (second :short)353 (fraction :long))257 (defcstruct sql-c-time "" 258 (hour sql-u-small-int) 259 (minute sql-u-small-int) 260 (second sql-u-small-int)) 261 262 (defcstruct sql-c-date "" 263 (year sql-small-int) 264 (month sql-u-small-int) 265 (day sql-u-small-int)) 266 267 (defcstruct sql-c-timestamp "" 268 (year sql-small-int) 269 (month sql-u-small-int) 270 (day sql-u-small-int) 271 (hour sql-u-small-int) 272 (minute sql-u-small-int) 273 (second sql-u-small-int) 274 (fraction sql-u-integer)) 354 275 355 276 (defun %put-sql-c-date (adr %year %month %day) … … 358 279 (setf (foreign-slot-value adr 'sql-c-date 'day) %day)) 359 280 360 361 (defun %put-sql-c-timestamp (adr %year %month %day %hour %minute %second %fraction) 281 282 (defun %put-sql-c-timestamp (adr %year %month %day %hour %minute %second 283 %fraction) 362 284 (setf (foreign-slot-value adr 'sql-c-timestamp 'second) %second) 363 285 (setf (foreign-slot-value adr 'sql-c-timestamp 'minute) %minute) … … 366 288 (setf (foreign-slot-value adr 'sql-c-timestamp 'month) %month) 367 289 (setf (foreign-slot-value adr 'sql-c-timestamp 'year) %year) 368 (setf (foreign-slot-value adr 'sql-c-timestamp 'fraction) %fraction) 369 ) 290 (setf (foreign-slot-value adr 'sql-c-timestamp 'fraction) %fraction)) 370 291 371 292 (defun timestamp-to-universal-time (adr) 372 (with-foreign-slots 293 (with-foreign-slots 373 294 ((year month day hour minute second fraction) adr sql-c-timestamp) 374 295 (values … … 379 300 day 380 301 month 381 year )302 year) 382 303 fraction))) 383 304 384 305 385 306 (defun date-to-universal-time (adr) 386 (with-foreign-slots 307 (with-foreign-slots 387 308 ((year month day) adr sql-c-date) 388 309 (encode-universal-time 389 0 0 0390 day391 month392 year)))393 394 395 (defmacro %sql-len-data-at-exec (length) 310 0 0 0 311 day 312 month 313 year))) 314 315 316 (defmacro %sql-len-data-at-exec (length) 396 317 `(- $SQL_LEN_DATA_AT_EXEC_OFFSET ,length))
Note: See TracChangeset
for help on using the changeset viewer.
