public extern static bool dsn_register_app_role(string type_name, dsn_app_create create, dsn_app_start start, dsn_app_destroy destroy);
public static bool dsn_register_app_role_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy) { dsn_app_start start2 = (IntPtr app_context, int argc, IntPtr argv) => { var args = CopyCStringArrayToManaged(argv, argc); return start(app_context, args); }; return dsn_register_app_role(type_name, create, start2, destroy); }
public static bool dsn_register_app_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy) { dsn_app_start start2 = (app_context, argc, argv) => { var args = CopyCStringArrayToManaged(argv, argc); return(start(app_context, args)); }; var app = new dsn_app { mask = DSN_APP_MASK_DEFAULT, type_name = type_name, layer1 = { create = Marshal.GetFunctionPointerForDelegate(create), start = Marshal.GetFunctionPointerForDelegate(start2), destroy = Marshal.GetFunctionPointerForDelegate(destroy) } }; return(dsn_register_app(app)); }
public static bool dsn_register_app_role_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy) { dsn_app_start start2 = (IntPtr app_context, int argc, IntPtr argv) => { var args = CopyCStringArrayToManaged(argv, argc); return(start(app_context, args)); }; return(dsn_register_app_role(type_name, create, start2, destroy)); }
public static bool dsn_register_app_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy) { dsn_app_start start2 = (app_context, argc, argv) => { var args = CopyCStringArrayToManaged(argv, argc); return start(app_context, args); }; var app = new dsn_app { mask = DSN_APP_MASK_DEFAULT, type_name = type_name, layer1 = { create = Marshal.GetFunctionPointerForDelegate(create), start = Marshal.GetFunctionPointerForDelegate(start2), destroy = Marshal.GetFunctionPointerForDelegate(destroy) } }; return dsn_register_app(app); }