Exemplo n.º 1
0
     //Version 2
     public     sqlite3_module(
      int iVersion,
      smdxCreateConnect xCreate,
      smdxCreateConnect xConnect,
      smdxBestIndex xBestIndex,
      smdxDisconnect xDisconnect,
      smdxDestroy xDestroy,
      smdxOpen xOpen,
      smdxClose xClose,
      smdxFilter xFilter,
      smdxNext xNext,
      smdxEof xEof,
      smdxColumn xColumn,
      smdxRowid xRowid,
      smdxUpdate xUpdate,
      smdxFunction xBegin,
      smdxFunction xSync,
      smdxFunction xCommit,
      smdxFunction xRollback,
      smdxFindFunction xFindFunction,
      smdxRename xRename,
 /* The methods above are in version 1 of the sqlite_module object. Those 
 ** below are for version 2 and greater. */
      smdxFunctionArg xSavepoint,
      smdxFunctionArg xRelease,
      smdxFunctionArg xRollbackTo
     )
     {
       this.iVersion = iVersion;
       this.xCreate = xCreate;
       this.xConnect = xConnect;
       this.xBestIndex = xBestIndex;
       this.xDisconnect = xDisconnect;
       this.xDestroy = xDestroy;
       this.xOpen = xOpen;
       this.xClose = xClose;
       this.xFilter = xFilter;
       this.xNext = xNext;
       this.xEof = xEof;
       this.xColumn = xColumn;
       this.xRowid = xRowid;
       this.xUpdate = xUpdate;
       this.xBegin = xBegin;
       this.xSync = xSync;
       this.xCommit = xCommit;
       this.xRollback = xRollback;
       this.xFindFunction = xFindFunction;
       this.xRename = xRename;
       this.xSavepoint = xSavepoint;
       this.xRelease = xRelease;
       this.xRollbackTo = xRollbackTo;
     }
Exemplo n.º 2
0
/*
** Clients invoke this routine to construct a new trace-vfs shim.
**
** Return SQLITE_OK on success.  
**
** SQLITE_NOMEM is returned in the case of a memory allocation error.
** SQLITE_NOTFOUND is returned if zOldVfsName does not exist.
*/
int vfstrace_register(
   string zTraceName,           /* Name of the newly constructed VFS */
   string zOldVfsName,          /* Name of the underlying VFS */
   smdxFunction xOut,//int (*xOut)(const char*,void),   /* Output routine.  ex: fputs */
   object pOutArg,                    /* 2nd argument to xOut.  ex: stderr */
   int makeDefault                   /* True to make the new VFS the default */
){
  sqlite3_vfs pNew;
  sqlite3_vfs pRoot;
  vfstrace_info pInfo;
  int nName;
  int nByte;

  Debugger.Break();//TODO
  //pRoot = sqlite3_vfs_find(zOldVfsName);
  //if( pRoot==null ) return SQLITE_NOTFOUND;
  //nName = strlen(zTraceName);
  ////nByte = sizeof(*pNew) + sizeof(*pInfo) + nName + 1;
  //pNew = new sqlite3_vfs();//sqlite3_malloc( nByte );
  ////if( pNew==0 ) return SQLITE_NOMEM;
  ////memset(pNew, 0, nByte);
  //pInfo = new vfstrace_info();//( vfstrace_info ) & pNew[1];
  //pNew.iVersion = pRoot.iVersion;
  //pNew.szOsFile = pRoot.szOsFile + sizeof(vfstrace_file);
  //pNew.mxPathname = pRoot.mxPathname;
  ////pNew.zName = (char)&pInfo[1];
  //pNew.zName = zTraceName;//memcpy( (char)&pInfo[1], zTraceName, nName + 1 );
  //pNew.pAppData = pInfo;
  //pNew.xOpen = vfstraceOpen;
  //pNew.xDelete = vfstraceDelete;
  //pNew.xAccess = vfstraceAccess;
  //pNew.xFullPathname = vfstraceFullPathname;
  //pNew.xDlOpen = pRoot.xDlOpen==null ? null : vfstraceDlOpen;
  //pNew.xDlError = pRoot.xDlError==null ? null : vfstraceDlError;
  //pNew.xDlSym = pRoot.xDlSym==null ? null : vfstraceDlSym;
  //pNew.xDlClose = pRoot.xDlClose==null ? null : vfstraceDlClose;
  //pNew.xRandomness = vfstraceRandomness;
  //pNew.xSleep = vfstraceSleep;
  //pNew.xCurrentTime = vfstraceCurrentTime;
  //pNew.xGetLastError = pRoot.xGetLastError == null ? (dxGetLastError)null : vfstraceGetLastError;
  //if( pNew.iVersion>=2 ){
  //  pNew.xCurrentTimeInt64 = pRoot.xCurrentTimeInt64==null ? null :
  //                                 vfstraceCurrentTimeInt64;
  //  if( pNew.iVersion>=3 ){
  //    pNew.xSetSystemCall = pRoot.xSetSystemCall==null ? (dxSetSystemCall)null : 
  //                                 vfstraceSetSystemCall;
  //    pNew.xGetSystemCall = pRoot.xGetSystemCall == null ? (dxGetSystemCall)null : 
  //                                 vfstraceGetSystemCall;
  //    pNew.xNextSystemCall = pRoot.xNextSystemCall == null ? (dxNextSystemCall)null : 
  //                                 vfstraceNextSystemCall;
  //  }
  //}
  //pInfo.pRootVfs = pRoot;
  //pInfo.xOut = xOut;
  //pInfo.pOutArg = pOutArg;
  //pInfo.zVfsName = pNew.zName;
  //pInfo.pTraceVfs = pNew;
  //vfstrace_printf(pInfo, "%s.enabled_for(\"%s\")\n",
  //     pInfo.zVfsName, pRoot.zName);
  //return sqlite3_vfs_register(pNew, makeDefault);
  return 0;
}
Exemplo n.º 3
0
 //Version 1
   public sqlite3_module(
    int iVersion,
    smdxCreateConnect xCreate,
    smdxCreateConnect xConnect,
    smdxBestIndex xBestIndex,
    smdxDisconnect xDisconnect,
    smdxDestroy xDestroy,
    smdxOpen xOpen,
    smdxClose xClose,
    smdxFilter xFilter,
    smdxNext xNext,
    smdxEof xEof,
    smdxColumn xColumn,
    smdxRowid xRowid,
    smdxUpdate xUpdate,
    smdxFunction xBegin,
    smdxFunction xSync,
    smdxFunction xCommit,
    smdxFunction xRollback,
    smdxFindFunction xFindFunction,
    smdxRename xRename )
   {
     this.iVersion = iVersion;
     this.xCreate = xCreate;
     this.xConnect = xConnect;
     this.xBestIndex = xBestIndex;
     this.xDisconnect = xDisconnect;
     this.xDestroy = xDestroy;
     this.xOpen = xOpen;
     this.xClose = xClose;
     this.xFilter = xFilter;
     this.xNext = xNext;
     this.xEof = xEof;
     this.xColumn = xColumn;
     this.xRowid = xRowid;
     this.xUpdate = xUpdate;
     this.xBegin = xBegin;
     this.xSync = xSync;
     this.xCommit = xCommit;
     this.xRollback = xRollback;
     this.xFindFunction = xFindFunction;
     this.xRename = xRename;
   }
Exemplo n.º 4
0
/*
** Clients invoke this routine to construct a new trace-vfs shim.
**
** Return SQLITE_OK on success.
**
** SQLITE_NOMEM is returned in the case of a memory allocation error.
** SQLITE_NOTFOUND is returned if zOldVfsName does not exist.
*/
        int vfstrace_register(
            string zTraceName,  /* Name of the newly constructed VFS */
            string zOldVfsName, /* Name of the underlying VFS */
            smdxFunction xOut,  //int (*xOut)(const char*,void),   /* Output routine.  ex: fputs */
            object pOutArg,     /* 2nd argument to xOut.  ex: stderr */
            int makeDefault     /* True to make the new VFS the default */
            )
        {
            sqlite3_vfs   pNew;
            sqlite3_vfs   pRoot;
            vfstrace_info pInfo;
            int           nName;
            int           nByte;

            Debugger.Break();//TODO
            //pRoot = sqlite3_vfs_find(zOldVfsName);
            //if( pRoot==null ) return SQLITE_NOTFOUND;
            //nName = strlen(zTraceName);
            ////nByte = sizeof(*pNew) + sizeof(*pInfo) + nName + 1;
            //pNew = new sqlite3_vfs();//sqlite3_malloc( nByte );
            ////if( pNew==0 ) return SQLITE_NOMEM;
            ////memset(pNew, 0, nByte);
            //pInfo = new vfstrace_info();//( vfstrace_info ) & pNew[1];
            //pNew.iVersion = pRoot.iVersion;
            //pNew.szOsFile = pRoot.szOsFile + sizeof(vfstrace_file);
            //pNew.mxPathname = pRoot.mxPathname;
            ////pNew.zName = (char)&pInfo[1];
            //pNew.zName = zTraceName;//memcpy( (char)&pInfo[1], zTraceName, nName + 1 );
            //pNew.pAppData = pInfo;
            //pNew.xOpen = vfstraceOpen;
            //pNew.xDelete = vfstraceDelete;
            //pNew.xAccess = vfstraceAccess;
            //pNew.xFullPathname = vfstraceFullPathname;
            //pNew.xDlOpen = pRoot.xDlOpen==null ? null : vfstraceDlOpen;
            //pNew.xDlError = pRoot.xDlError==null ? null : vfstraceDlError;
            //pNew.xDlSym = pRoot.xDlSym==null ? null : vfstraceDlSym;
            //pNew.xDlClose = pRoot.xDlClose==null ? null : vfstraceDlClose;
            //pNew.xRandomness = vfstraceRandomness;
            //pNew.xSleep = vfstraceSleep;
            //pNew.xCurrentTime = vfstraceCurrentTime;
            //pNew.xGetLastError = pRoot.xGetLastError == null ? (dxGetLastError)null : vfstraceGetLastError;
            //if( pNew.iVersion>=2 ){
            //  pNew.xCurrentTimeInt64 = pRoot.xCurrentTimeInt64==null ? null :
            //                                 vfstraceCurrentTimeInt64;
            //  if( pNew.iVersion>=3 ){
            //    pNew.xSetSystemCall = pRoot.xSetSystemCall==null ? (dxSetSystemCall)null :
            //                                 vfstraceSetSystemCall;
            //    pNew.xGetSystemCall = pRoot.xGetSystemCall == null ? (dxGetSystemCall)null :
            //                                 vfstraceGetSystemCall;
            //    pNew.xNextSystemCall = pRoot.xNextSystemCall == null ? (dxNextSystemCall)null :
            //                                 vfstraceNextSystemCall;
            //  }
            //}
            //pInfo.pRootVfs = pRoot;
            //pInfo.xOut = xOut;
            //pInfo.pOutArg = pOutArg;
            //pInfo.zVfsName = pNew.zName;
            //pInfo.pTraceVfs = pNew;
            //vfstrace_printf(pInfo, "%s.enabled_for(\"%s\")\n",
            //     pInfo.zVfsName, pRoot.zName);
            //return sqlite3_vfs_register(pNew, makeDefault);
            return(0);
        }