internal commit_hook_info(delegate_commit func, object v) { _func = func; _user_data = v; _h = GCHandle.Alloc(this); }
void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) { if (_commit_hook != null) { // TODO maybe turn off the hook here, for now _commit_hook.free(); _commit_hook = null; } if (func != null) { _commit_hook = new commit_hook_info(func, v); SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_commit(commit_hook_bridge)).ToInt64(), _commit_hook.ptr.ToInt64()); } else { SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64()); } }
internal void free() { _func = null; _user_data = null; _h.Free(); }
void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) { throw new Exception(GRIPE); }
public commit_hook_info(delegate_commit func, object v) { _func = func; _user_data = v; }
static public void sqlite3_commit_hook(sqlite3 db, delegate_commit f, object v) { _imp.sqlite3_commit_hook(db.ptr, f, v); }
void ISQLite3Provider.sqlite3_commit_hook (IntPtr db, delegate_commit func, object v) { var info = hooks.getOrCreateFor (db); if (info.commit != null) { // TODO maybe turn off the hook here, for now info.commit.free (); info.commit = null; } if (func != null) { info.commit = new commit_hook_info (func, v); NativeMethods.sqlite3_commit_hook (db, commit_hook_bridge, info.commit.ptr); } else { NativeMethods.sqlite3_commit_hook (db, null, IntPtr.Zero); } }
static public void sqlite3_commit_hook(sqlite3 db, delegate_commit f, object v) { _imp.sqlite3_commit_hook(db.ptr, f, v); }
public static void commit_hook(this sqlite3 db, delegate_commit f, object v) { raw.sqlite3_commit_hook(db, f, v); }
internal void free() { _func = null; _user_data = null; _h.Free(); }
internal commit_hook_info(delegate_commit func, object v) { _func = func; _user_data = v; _h = GCHandle.Alloc(this); }
public void sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) => throw new NotImplementedException();
void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) { if (_commit_hook != null) { // TODO maybe turn off the hook here, for now _commit_hook.free(); _commit_hook = null; } if (func != null) { _commit_hook = new commit_hook_info(func, v); NativeMethods.sqlite3_commit_hook(db, commit_hook_bridge, _commit_hook.ptr); } else { NativeMethods.sqlite3_commit_hook(db, null, IntPtr.Zero); } }
void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) { var info = hooks.getOrCreateFor(db); if (info.commit != null) { // TODO maybe turn off the hook here, for now info.commit.free(); info.commit = null; } if (func != null) { info.commit = new commit_hook_info(func, v); SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(commit_hook_bridge).ToInt64(), info.commit.ptr.ToInt64()); } else { SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64()); } }
void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) { throw new Exception(GRIPE); }
void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) { if (_commit_hook != null) { // TODO maybe turn off the hook here, for now _commit_hook.free(); _commit_hook = null; } if (func != null) { _commit_hook = new commit_hook_info(func, v); SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_commit(commit_hook_bridge)).ToInt64(), _commit_hook.ptr.ToInt64()); } else { SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64()); } }