+++ /dev/null
-#include "sqlite3.h"
-#include "sqliteManager.h"
-
- INLINE int SqliteManager_open(sqlite3 **pDb,LPCWSTR fileName,int flags,const char* zVfs){
-
- int rc;
- char fileNameMB[_MAX_PATH];
-
- WideToMB(CP_UTF8,fileName,fileNameMB,sizeof(fileNameMB));
-
- rc = sqlite3_open_v2( fileNameMB,pDb, flags, zVfs);
-
- if ( SQLITE_OK != rc ) {
- SqliteManager_close(pDb);
- }
-
- return rc;
-
-}
-
-INLINE VOID SqliteManager_close(sqlite3 **pDb){
-
- sqlite3_stmt *stmt = (sqlite3_stmt*)NULL, *next = (sqlite3_stmt*)NULL;
-
- if (sqlite3_close( *pDb ) != SQLITE_OK ) { /* \83f\81[\83^\83x\81[\83X\82ð\90³\8fí\82É\83N\83\8d\81[\83Y\82Å\82«\82È\82¯\82ê\82Î\88È\89º\82ð\8eÀ\8ds */
-
- /*** \8ec\82è\82Ì\90Ý\92è\8dÏ\82Ý\83v\83\8a\83y\83A\81[\83h\83X\83e\81[\83g\83\81\83\93\83g\82Ésqlite3_finalize\82ð\8eÀ\8ds ***/
- stmt = sqlite3_next_stmt( *pDb, next ); /* \8dÅ\8f\89\82Ì\83v\83\8a\83y\83A\81[\83h\83X\83e\81[\83g\83\81\83\93\83g */
- while( NULL != stmt ) {
- next = sqlite3_next_stmt( *pDb, stmt ); /* \8e\9f\82Ì\83v\83\8a\83y\83A\81[\83h\83X\83e\81[\83g\83\81\83\93\83g */
- sqlite3_finalize( stmt ); /* \83\81\83\82\83\8a\97Ì\88æ\82ð\8aJ\95ú */
-
- stmt = next;
- }
- sqlite3_close( *pDb ); /* \83f\81[\83^\83x\81[\83X\82ð\83N\83\8d\81[\83Y */
- }
-
- *pDb = (sqlite3*)NULL;
-
-}
-
- INLINE int SqliteManager_prepare(sqlite3 *db, const void *sql, int bytes,sqlite3_stmt **stmt, const void **tail){
-
- int rc;
- if((rc = sqlite3_prepare16_v2( db, sql, bytes, stmt,tail)) != SQLITE_OK){
-
- sqlite3_finalize(*stmt);
- *stmt = (sqlite3_stmt*)NULL;
-
- }
-
-
- return rc;
-
-}
\ No newline at end of file