Ejemplo n.º 1
0
/*
** Read data from the file.
*/
        static int jrnlRead(
            sqlite3_file *pJfd, /* The journal file from which to read */
            void *zBuf,         /* Put the results here */
            int iAmt,           /* Number of bytes to read */
            sqlite_int64 iOfst  /* Begin reading at this offset */
            )
        {
            int          rc = SQLITE_OK;
            JournalFile *p  = (JournalFile )pJfd;

            if (p->pReal)
            {
                rc = sqlite3OsRead(p->pReal, zBuf, iAmt, iOfst);
            }
            else if ((iAmt + iOfst) > p->iSize)
            {
                rc = SQLITE_IOERR_SHORT_READ;
            }
            else
            {
                memcpy(zBuf, &p->zBuf[iOfst], iAmt);
            }
            return(rc);
        }
Ejemplo n.º 2
0
 // int xOpenDelegate(sqlite3_vfs* vfs, IntPtr zName, sqlite3_file* file, int flags, ref int pOutFlags);
 public static ResultCode Open(sqlite3_vfs *vfs, IntPtr zName, sqlite3_file *file, int flags, ref int pOutFlags)
 {
     return(ResultCode.OK);
 }