From 19e0c84dbf13ca794c3be500082110f5b19c82b2 Mon Sep 17 00:00:00 2001 From: timm Date: Thu, 25 Jun 1998 21:39:35 +0000 Subject: [PATCH] added trace facility --- cmd/dialup/win/aswplugn/include/plugin.h | 1 + cmd/dialup/win/aswplugn/src/winplugn.cpp | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cmd/dialup/win/aswplugn/include/plugin.h b/cmd/dialup/win/aswplugn/include/plugin.h index 56aa714af557..da56be94bda3 100644 --- a/cmd/dialup/win/aswplugn/include/plugin.h +++ b/cmd/dialup/win/aswplugn/include/plugin.h @@ -197,5 +197,6 @@ void SizeofRASNT40(); // ini WinNT RAS sizes #endif // WIN32 void SizeofRAS(); // init Win95 & Win3.1 RAS sizes +void trace( const char* traceStatement ); #endif // _INC_PLUGIN_H_ diff --git a/cmd/dialup/win/aswplugn/src/winplugn.cpp b/cmd/dialup/win/aswplugn/src/winplugn.cpp index 2dff7bc3c8ce..9ae5bdce73ba 100644 --- a/cmd/dialup/win/aswplugn/src/winplugn.cpp +++ b/cmd/dialup/win/aswplugn/src/winplugn.cpp @@ -88,7 +88,6 @@ HINSTANCE DLLinstance = NULL; JRIGlobalRef g_globalRefReg = NULL; - //******************************************************************************** // // NPP_Initialize @@ -106,7 +105,8 @@ NPError NPP_Initialize(void) //register_java_lang_String(env); //Not necessary? } - + trace( "initialized plug-in" ); + #ifdef WIN32 // ******************* WIN32 *********************** // gets the OS version // note: we need another way to check for win31 @@ -627,6 +627,22 @@ native_netscape_npasw_SetupPlugin_SECURE_0005fCheckEnvironment(JRIEnv* env, return (TRUE); } +void trace( const char* traceStatement ) +{ + if ( !env ) + return; + + java_lang_Class* self = (java_lang_Class*)NPP_GetJavaClass(); + if ( !self ) + return; + + java_lang_String* traceString = JRI_NewStringPlatform( env, traceStatement, + strlen( traceStatement), NULL, 0 ); + + netscape_npasw_SetupPlugin_debug( env, self, traceString ); +} + + /******************************************************************************* * Native Methods: * These are the signatures of the native methods which you must implement.