18using System.Runtime.InteropServices;
38 internal struct Sq3Call {
61 public Sq3Call(IntPtr rt, Sq3LiteExecIF val) {
69 public Sq3Call(IntPtr rt, Sq3LiteExecV2IF val) {
78 private static Int32 Sq3LiteExecCall (IntPtr callV1, Int32 num, IntPtr vals, IntPtr cols)
80 Sq3Call data = (Sq3Call)GCHandle.FromIntPtr(callV1).Target;
84 var valsO =
new String[num];
85 var colsO =
new String[num];
87 IntPtr[] valsP =
new IntPtr[num];
88 Marshal.Copy(vals,valsP,0,num);
89 IntPtr[] colsP =
new IntPtr[num];
90 Marshal.Copy(cols,colsP,0,num);
92 for (
int i=0; i<num; i++) {
93 valsO[i] = Marshal.PtrToStringAnsi(valsP[i]);
94 colsO[i] = Marshal.PtrToStringAnsi(colsP[i]);
99 if (data.call1 !=
null) {
100 data.call1(valsO,colsO);
101 }
else if (data.if1 !=
null) {
102 data.if1.Sq3LiteExec(valsO,colsO);
106 }
catch (Exception ex) {
107 IntPtr cstr = Marshal.StringToHGlobalAnsi(
"Sq3LiteExecCall");
109 Marshal.FreeHGlobal(cstr);
117 private static MkErrorE Sq3LiteExecV2Call(IntPtr
mkrt, IntPtr callV2, IntPtr vals, IntPtr cols)
119 Sq3Call data = (Sq3Call)GCHandle.FromIntPtr(callV2).Target;
126 if (data.call2 !=
null) {
127 data.call2(valsO,colsO);
128 }
else if (data.if2 !=
null) {
129 data.if2.Sq3LiteExecV2(valsO,colsO);
133 }
catch (Exception ex) {
134 IntPtr cstr = Marshal.StringToHGlobalAnsi(
"Sq3LiteExecV2Call");
136 Marshal.FreeHGlobal(cstr);
static MkBufferListC MkBufferListC_ObjNew(IntPtr hdl)
static IntPtr Catch(IntPtr mkrt, IntPtr expobj, Exception exception, IntPtr callfunc)
static unsafe MkErrorE CsRuntimeErrorGetCode(IntPtr mkrt)
Sq3LiteC - the class known as sq3lite or Lite defined by Sq3LiteS …
delegate void Sq3LiteExecV2CCB(MkBufferListC vals, MkBufferListC cols)
delegate void Sq3LiteExecCCB(string[] vals, string[] cols)
implements the cssq3lite API object: public version from LcConfigIncludeF as method
void Sq3LiteExec(string[] vals, string[] cols)
void Sq3LiteExecV2(MkBufferListC vals, MkBufferListC cols)