Exemple #1
0
 static public void sqlite3_result_zeroblob(sqlite3_context context, int n)
 {
     _imp.sqlite3_result_zeroblob(context.ptr, n);
 }
Exemple #2
0
 static public void sqlite3_result_error_nomem(sqlite3_context context)
 {
     _imp.sqlite3_result_error_nomem(context.ptr);
 }
Exemple #3
0
 static public void sqlite3_result_text(sqlite3_context context, string val)
 {
     _imp.sqlite3_result_text(context.ptr, val);
 }
Exemple #4
0
 static public void sqlite3_result_int(sqlite3_context context, int val)
 {
     _imp.sqlite3_result_int(context.ptr, val);
 }
Exemple #5
0
        private static void sum_plus_count_final(sqlite3_context ctx, object user_data)
        {
            if (ctx.state == null)
            {
                ctx.state = new my_state();
            }
            my_state st = ctx.state as my_state;

            ctx.result_int64(st.sum + st.count);
        }
Exemple #6
0
 static public void sqlite3_result_null(sqlite3_context context)
 {
     _imp.sqlite3_result_null(context.ptr);
 }
Exemple #7
0
 static public void sqlite3_result_zeroblob(sqlite3_context context, int n)
 {
     _imp.sqlite3_result_zeroblob(context.ptr, n);
 }
Exemple #8
0
 private static void concat(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     string r = "";
     foreach (sqlite3_value v in args)
     {
         r += v.value_text();
     }
     ctx.result_text(r);
 }
Exemple #9
0
 static public void sqlite3_result_int(sqlite3_context context, int val)
 {
     _imp.sqlite3_result_int(context.ptr, val);
 }
Exemple #10
0
 static public void sqlite3_result_int64(sqlite3_context context, long val)
 {
     _imp.sqlite3_result_int64(context.ptr, val);
 }
Exemple #11
0
 static public void sqlite3_result_double(sqlite3_context context, double val)
 {
     _imp.sqlite3_result_double(context.ptr, val);
 }
Exemple #12
0
 static public void sqlite3_result_text(sqlite3_context context, string val)
 {
     _imp.sqlite3_result_text(context.ptr, val);
 }
Exemple #13
0
 static public void sqlite3_result_blob(sqlite3_context context, byte[] val)
 {
     _imp.sqlite3_result_blob(context.ptr, val);
 }
Exemple #14
0
 static public void sqlite3_result_null(sqlite3_context context)
 {
     _imp.sqlite3_result_null(context.ptr);
 }
Exemple #15
0
        // TODO sqlite3_result_value

        static public void sqlite3_result_error_toobig(sqlite3_context context)
        {
            _imp.sqlite3_result_error_toobig(context.ptr);
        }
Exemple #16
0
 private static void len_as_blobs(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     int r = 0;
     foreach (sqlite3_value v in args)
     {
         if (v.value_type() != raw.SQLITE_NULL)
         {
             Assert.AreEqual(v.value_blob().Length, v.value_bytes());
             r += v.value_blob().Length;
         }
     }
     ctx.result_int(r);
 }
Exemple #17
0
 static public void sqlite3_result_error_nomem(sqlite3_context context)
 {
     _imp.sqlite3_result_error_nomem(context.ptr);
 }
Exemple #18
0
        private static void sum_plus_count_step(sqlite3_context ctx, object user_data, sqlite3_value[] args)
        {
            Assert.AreEqual(args.Length, 1);

            if (ctx.state == null)
            {
                ctx.state = new my_state();
            }
            my_state st = ctx.state as my_state;

            st.sum += args[0].value_int64();
            st.count++;
        }
Exemple #19
0
 static public void sqlite3_result_error_code(sqlite3_context context, int code)
 {
     _imp.sqlite3_result_error_code(context.ptr, code);
 }
Exemple #20
0
 // probably unnecessary since we pass user_data back as one of the
 // params to xFunc, xStep, and xFinal.
 static public object sqlite3_user_data(sqlite3_context context)
 {
     return context.user_data;
 }
Exemple #21
0
 private static void cube(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     Assert.AreEqual(args.Length, 1);
     long x = args[0].value_int64();
     Assert.AreEqual(x, val);
     ctx.result_int64(x * x * x);
 }
Exemple #22
0
 static public void sqlite3_result_blob(sqlite3_context context, byte[] val)
 {
     _imp.sqlite3_result_blob(context.ptr, val);
 }
Exemple #23
0
 private static void makeblob(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     byte[] b = new byte[args[0].value_int()];
     for (int i=0; i<b.Length; i++)
     {
         b[i] = (byte) (i % 256);
     }
     ctx.result_blob(b);
 }
Exemple #24
0
 static public void sqlite3_result_double(sqlite3_context context, double val)
 {
     _imp.sqlite3_result_double(context.ptr, val);
 }
Exemple #25
0
 private static void mean(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     double d = 0;
     foreach (sqlite3_value v in args)
     {
         d += v.value_double();
     }
     ctx.result_double(d / args.Length);
 }
Exemple #26
0
 static public void sqlite3_result_int64(sqlite3_context context, long val)
 {
     _imp.sqlite3_result_int64(context.ptr, val);
 }
Exemple #27
0
 private static void count_args(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     ctx.result_int(args.Length);
 }
Exemple #28
0
        // TODO sqlite3_result_value

        static public void sqlite3_result_error_toobig(sqlite3_context context)
        {
            _imp.sqlite3_result_error_toobig(context.ptr);
        }
Exemple #29
0
 private static void count_nulls(sqlite3_context ctx, object user_data, sqlite3_value[] args)
 {
     int r = 0;
     foreach (sqlite3_value v in args)
     {
         if (v.value_type() == raw.SQLITE_NULL)
         {
             r++;
         }
     }
     ctx.result_int(r);
 }
Exemple #30
0
 static public void sqlite3_result_error_code(sqlite3_context context, int code)
 {
     _imp.sqlite3_result_error_code(context.ptr, code);
 }
Exemple #31
0
 // probably unnecessary since we pass user_data back as one of the
 // params to xFunc, xStep, and xFinal.
 static public object sqlite3_user_data(sqlite3_context context)
 {
     return(context.user_data);
 }