helper.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. ** 2004 May 22
  3. **
  4. ** The author disclaims copyright to this source code. In place of
  5. ** a legal notice, here is a blessing:
  6. **
  7. ** May you do good and not evil.
  8. ** May you find forgiveness for yourself and forgive others.
  9. ** May you share freely, never taking more than you give.
  10. **
  11. ******************************************************************************
  12. **
  13. ** Functions wrapping 'int64' and 'double' functions to pass values by reference.
  14. */
  15. #include <stdlib.h>
  16. #include "sqlite3.h"
  17. int sqlite3_bind_double_ref(sqlite3_stmt *stmt, int iCol, double *val)
  18. {
  19. return sqlite3_bind_double(stmt,iCol,*val);
  20. }
  21. int sqlite3_bind_int64_ref(sqlite3_stmt *stmt, int iCol, sqlite_int64 *val)
  22. {
  23. return sqlite3_bind_int64(stmt,iCol,*val);
  24. }
  25. void sqlite3_column_double_ref(sqlite3_stmt *stmt, int iCol, double *val)
  26. {
  27. *val = sqlite3_column_double(stmt,iCol);
  28. }
  29. void sqlite3_column_int64_ref(sqlite3_stmt *stmt, int iCol, sqlite_int64 *val)
  30. {
  31. *val = sqlite3_column_int64(stmt,iCol);
  32. }
  33. unsigned int sqlite3_strlen(char *ptr)
  34. {
  35. return strlen(ptr);
  36. }