//------------------------------------------------------------------------- // This is the one and only entry point called when Postgres loads the language handler DLL // At this point there is no way to report problems, so avoid any exceptions. Just store things for later use. public static int Entry(string arg) { // Leave these here commented out if ever needed //Debugger.Launch(); //pg_elog(ElogLevel.NOTICE, $"Entry: '{arg}'"); _initial_arg = arg; // These are the (static) callback functions. Look up an instance and call it... ConnectCallback cncb = (h, o) => GetInstance(h).Connect(o); TypeCheckCallback tccb = (h, f, n, a, r) => GetInstance(h).TypeCheck(f, a, r); InvokeCallback ivcb = (h, f, n, a, r) => GetInstance(h).Invoke(f, a, r); GetMessageCallback gmcb = (h) => GetInstance(h).GetMessage(); // call back with the real entry points for later use return(plandl_init_callback(cncb, tccb, ivcb, gmcb)); }
public static extern int plandl_init_callback(ConnectCallback cncb, TypeCheckCallback tccb, InvokeCallback ivcb, GetMessageCallback gmcb);