Example #1
0
        /*
        ** Advance the cursor to the next row.
        */
        static int intarrayNext(sqlite3_vtab_cursor cur)
        {
            intarray_cursor pCur = (intarray_cursor)cur;

            pCur.i++;
            return(SQLITE_OK);
        }
Example #2
0
        static int intarrayEof(sqlite3_vtab_cursor cur)
        {
            intarray_cursor pCur  = (intarray_cursor)cur;
            intarray_vtab   pVtab = (intarray_vtab)cur.pVtab;

            return(pCur.i >= pVtab.pContent.n ? 1 : 0);
        }
Example #3
0
        /*
        ** Retrieve the current rowid.
        */
        static int intarrayRowid(sqlite3_vtab_cursor cur, out sqlite_int64 pRowid)
        {
            intarray_cursor pCur = (intarray_cursor)cur;

            pRowid = pCur.i;
            return(SQLITE_OK);
        }
Example #4
0
        /*
        ** Reset a intarray table cursor.
        */
        static int intarrayFilter(
            sqlite3_vtab_cursor pVtabCursor,
            int idxNum, string idxStr,
            int argc, sqlite3_value[] argv
            )
        {
            intarray_cursor pCur = (intarray_cursor)pVtabCursor;

            pCur.i = 0;
            return(SQLITE_OK);
        }
Example #5
0
        /*
        ** Retrieve a column of data.
        */
        static int intarrayColumn(sqlite3_vtab_cursor cur, sqlite3_context ctx, int i)
        {
            intarray_cursor pCur  = (intarray_cursor)cur;
            intarray_vtab   pVtab = (intarray_vtab)cur.pVtab;

            if (pCur.i >= 0 && pCur.i < pVtab.pContent.n)
            {
                sqlite3_result_int64(ctx, pVtab.pContent.a[pCur.i]);
            }
            return(SQLITE_OK);
        }
Example #6
0
        /*
        ** Open a new cursor on the intarray table.
        */
        static int intarrayOpen(sqlite3_vtab pVTab, out sqlite3_vtab_cursor ppCursor)
        {
            int             rc   = SQLITE_NOMEM;
            intarray_cursor pCur = new intarray_cursor();//

            //pCur = sqlite3_malloc(sizeof(intarray_cursor));
            //if ( pCur != null )
            {
                //memset(pCur, 0, sizeof(intarray_cursor));
                ppCursor = (sqlite3_vtab_cursor)pCur;
                rc       = SQLITE_OK;
            }
            return(rc);
        }
Example #7
0
 /*
 ** Open a new cursor on the intarray table.
 */
 static int intarrayOpen( sqlite3_vtab pVTab, out sqlite3_vtab_cursor ppCursor )
 {
   int rc = SQLITE_NOMEM;
   intarray_cursor pCur = new intarray_cursor();//
   //pCur = sqlite3_malloc(sizeof(intarray_cursor));
   //if ( pCur != null )
   {
     //memset(pCur, 0, sizeof(intarray_cursor));
     ppCursor = (sqlite3_vtab_cursor)pCur;
     rc = SQLITE_OK;
   }
   return rc;
 }