Nnotes.dll equivalent on Linux OS?

Hello,

I have the following piece of code in the script library of the domReg.nsf database from the Lotus Sandbox:

’ NAMELookup and OSMemFree are used in EnsureUserInNAB.

’ NOTE: if you are running this app on a platform other than

’ Windows 32 Intel, then you will have to change the name of the

’ dll in these two declarations. Look in your Notes executable

’ directory for *notes.dll to see what it is called, or for the proper

’ form of shared library on your platform.

Declare Sub NAMELookup Lib “nnotes.dll” _

(Byval serverName As Integer, _

Byval flags As Integer, _

Byval numNameSpaces As Integer, _

Byval nameSpaces As String, _

Byval numNames As Integer, _

Byval names As String, _

Byval numItems As Integer, _

Byval items As String, _

rethBuffer As Long _

)

Declare Sub OSMemFree Lib “nnotes.dll” (Byval hBuffer As Long)

At least someone commented this thing well! I’m running on a Linux server at prominic.net (they are to be recommended, I’ve been with them for years. They have good support too!).

Now, as the comments say , the nnotes.dll must have a different name on the Linux box.

Can anyone tell me what the name of the respective file is in Linux?

Thanks in advance.

Marcus

Subject: Cross platform calling C-API from Lotus Script Example for Win32, Linux, AIX, Solaris and Mac including international characters (LMBCS)

I wrote this a while ago. It supports international character sets using the right LMBCS declares on Win32, Linux and Unix.

It’s interesting that different platforms have different size of handles. Some are Long and others are Integer. See declares for details.

(ldd@nashcom.de)

REM W32 Declares

Declare Function W32_NSFRemoteConsole Lib “NNOTES.DLL” Alias “NSFRemoteConsole” (Byval server As Lmbcs String, Byval cmd As Lmbcs String, ret As Long) As Integer

Declare Function W32_OSLockObject Lib “NNOTES.DLL” Alias “OSLockObject” (Byval handle As Long) As Lmbcs String

Declare Sub W32_OSUnlockObject Lib “NNOTES.DLL” Alias “OSUnlockObject” (Byval handle As Long)

Declare Sub W32_OSMemFree Lib “NNOTES.DLL” Alias “OSMemFree” (Byval handle As Long)

Declare Function W32_OSLoadString Lib “NNOTES.DLL” Alias “OSLoadString” (Byval hModule As Long, Byval stringCode As Integer, _

Byval retBuffer As Lmbcs String, Byval bufferLen As Integer) As Integer

REM MAC Declares

Declare Function MAC_NSFRemoteConsole Lib “NotesLib” Alias “NSFRemoteConsole” (Byval server As Lmbcs String, Byval cmd As Lmbcs String, ret As Integer) As Integer

Declare Function MAC_OSLockObject Lib “NotesLib” Alias “OSLockObject” (Byval handle As Integer) As Lmbcs String

Declare Sub MAC_OSUnlockObject Lib “NotesLib” Alias “OSUnlockObject” (Byval handle As Integer)

Declare Sub MAC_OSMemFree Lib “NotesLib” Alias “OSMemFree” (Byval handle As Integer)

Declare Function MAC_OSLoadString Lib “NotesLib” Alias “OSLoadString” (Byval hModule As Integer, Byval stringCode As Integer, _

Byval retBuffer As Lmbcs String, Byval bufferLen As Integer) As Integer

REM Linux Declares

Declare Function LINUX_NSFRemoteConsole Lib “libnotes.so” Alias “NSFRemoteConsole” (Byval server As Lmbcs String, Byval cmd As Lmbcs String, ret As Long) As Integer

Declare Function LINUX_OSLockObject Lib “libnotes.so” Alias “OSLockObject” (Byval handle As Long) As Lmbcs String

Declare Sub LINUX_OSUnlockObject Lib “libnotes.so” Alias “OSUnlockObject” (Byval handle As Long)

Declare Sub LINUX_OSMemFree Lib “libnotes.so” Alias “OSMemFree” (Byval handle As Long)

Declare Function LINUX_OSLoadString Lib “libnotes.so” Alias “OSLoadString” (Byval hModule As Long, Byval stringCode As Integer, _

Byval retBuffer As Lmbcs String, Byval bufferLen As Integer) As Integer

REM AIX Declares

Declare Function AIX_NSFRemoteConsole Lib “libnotes_r.a” Alias “NSFRemoteConsole” (Byval server As Lmbcs String, Byval cmd As Lmbcs String, ret As Integer) As Integer

Declare Function AIX_OSLockObject Lib “libnotes_r.a” Alias “OSLockObject” (Byval handle As Integer) As Lmbcs String

Declare Sub AIX_OSUnlockObject Lib “libnotes_r.a” Alias “OSUnlockObject” (Byval handle As Integer)

Declare Sub AIX_OSMemFree Lib “libnotes_r.a” Alias “OSMemFree” (Byval handle As Integer)

Declare Function AIX_OSLoadString Lib “libnotes_r.a” Alias “OSLoadString” (Byval hModule As Integer, Byval stringCode As Integer, _

Byval retBuffer As Lmbcs String, Byval bufferLen As Integer) As Integer

REM Solaris Declares

Declare Function SOLARIS_NSFRemoteConsole Lib “libnotes.so” Alias “NSFRemoteConsole” (Byval server As Lmbcs String, Byval cmd As Lmbcs String, ret As Integer) As Integer

Declare Function SOLARIS_OSLockObject Lib “libnotes.so” Alias “OSLockObject” (Byval handle As Integer) As Lmbcs String

Declare Sub SOLARIS_OSUnlockObject Lib “libnotes.so” Alias “OSUnlockObject” (Byval handle As Integer)

Declare Sub SOLARIS_OSMemFree Lib “libnotes.so” Alias “OSMemFree” (Byval handle As Integer)

Declare Function SOLARIS_OSLoadString Lib “libnotes.so” Alias “OSLoadString” (Byval hModule As Integer, Byval stringCode As Integer, _

Byval retBuffer As Lmbcs String, Byval bufferLen As Integer) As Integer

Class RemoteConsole

Public IsError As Variant

Private rc As Integer

Private Long_hBuffer As Long

Private Integer_hBuffer As Integer

Private Server As String

Private Command As String

Private Result As String



Sub New (InputServer As String)

	If InputServer = "" Then

		Me.IsError = True

	Else

		Me.Server = InputServer

		Me.IsError = False

	End If

End Sub



Function get_platform () As String

	

	Dim tmp_platform As Variant

	Dim lower_platform As String

	tmp_platform = Evaluate(|@Implode(@Platform([Specific]);" ")|)

	

	lower_platform = Lcase(Cstr(tmp_platform(0)))

	

	REM Messagebox Cstr(tmp_platform(0))

	

	If (Instr (lower_platform, "aix")) Then

		get_platform = "aix"

	Elseif (Instr (lower_platform, "solaris")) Then

		get_platform = "solaris"

	Elseif (Instr (lower_platform, "linux")) Then

		get_platform = "linux"

	Elseif (Instr (lower_platform, "win")) Then

		get_platform = "w32"

	Elseif (Instr (lower_platform, "mac")) Then

		get_platform = "mac"

	Else	

		Messagebox "Unsupported Platform : >" +  lower_platform + "<"

		get_platform = ""

	End If

End Function



Function Execute (InputCommand As String) As String

	

	Dim StrLen As Integer	

	Dim errorStr As String * 1024

	

	Dim Session As New NotesSession

	Dim platform As String

	

	platform =  get_platform

	

	REM Messagebox session.platform

	REM Messagebox platform

	

	If Me.Server = "" Then 

		Me.Execute = "No server specified"

		Me.IsError = True

		Exit Function

	End If          

	

	If InputCommand = "" Then

		Me.Execute = "No command specified"

		Me.IsError = True

		Exit Function

	End If

	

	Me.command = InputCommand + Chr (0)

	Me.server = Me.server + Chr(0)

	

	Select Case platform

	Case "w32"

		Me.rc = W32_NSFRemoteConsole (Me.Server, Me.Command, Long_hBuffer)

	Case "mac"

		Me.rc = MAC_NSFRemoteConsole (Me.Server, Me.Command, Integer_hBuffer)

	Case "linux"

		Me.rc = LINUX_NSFRemoteConsole (Me.Server, Me.Command, Long_hBuffer)

	Case "aix"

		Me.rc = AIX_NSFRemoteConsole (Me.Server, Me.Command, Integer_hBuffer)		

	Case "solaris"

		Me.rc = SOLARIS_NSFRemoteConsole (Me.Server, Me.Command, Integer_hBuffer)		

	Case Else

		Exit Function

	End Select

	

	If (Me.rc <> 0) Then

		Me.IsError = True

		

		Select Case platform

		Case "w32"

			StrLen = w32_OSLoadString(0&, Me.rc, errorStr , Len(errorStr) - 1)

		Case "mac"

			StrLen = MAC_OSLoadString(0&, Me.rc, errorStr , Len(errorStr) - 1)

		Case "linux"

			StrLen = LINUX_OSLoadString(0&, Me.rc, errorStr , Len(errorStr) - 1)

		Case "aix"

			StrLen = AIX_OSLoadString(0&, Me.rc, errorStr , Len(errorStr) - 1)

		Case "solaris"

			StrLen = SOLARIS_OSLoadString(0&, Me.rc, errorStr , Len(errorStr) - 1)

		Case Else

			Exit Function

		End Select

		

		If (StrLen = 0 ) Then

			errorStr = ""

		End If

		Me.Result= "Error: [" & Cstr (rc) & "] " + errorStr

	Else

		

		Select Case platform

		Case "w32"

			Me.Result = W32_OsLockObject (Long_hBuffer) + Chr (0)

			Call W32_OSUnlockObject (Long_hBuffer)

			Call W32_OsMemFree (Long_hBuffer)

		Case "mac"

			Me.Result = MAC_OsLockObject (Integer_hBuffer) + Chr (0)

			Call MAC_OSUnlockObject (Integer_hBuffer)

			Call MAC_OsMemFree (Integer_hBuffer)

		Case "linux"

			Me.Result = LINUX_OsLockObject (Long_hBuffer) + Chr (0)

			Call LINUX_OSUnlockObject (Long_hBuffer)

			Call LINUX_OsMemFree (Long_hBuffer)

		Case "aix"

			Me.Result = AIX_OsLockObject (Integer_hBuffer) + Chr (0)

			Call AIX_OSUnlockObject (Integer_hBuffer)

			Call AIX_OsMemFree (Integer_hBuffer)

		Case "solaris"

			Me.Result = SOLARIS_OsLockObject (Integer_hBuffer) + Chr (0)

			Call SOLARIS_OSUnlockObject (Integer_hBuffer)

			Call SOLARIS_OsMemFree (Integer_hBuffer)

		Case Else

			Exit Function

		End Select

		

		Me.IsError = False

	End If

	Me.Execute = Me.Result

End Function

End Class

Subject: a good one, my favourite approach also:-)

Subject: nnotes.dll equivalent on Linux OS??

Linux, Solaris and ZSeries: libnotes.soAIX: libnotes_r.a

I Series: libnotes

Subject: nnotes.dll equivalent on Linux OS??

The first letter (or first two letters, on some) indicate the platform the DLL was compiled for. I don’t know the code letter for Linux offhand, but you should see a whack of executables in the program directory all starting with the same letter. Anywhere you’ve got a reference to an n-process, you should be able to replace the “n” (which, BTW, is for Windows) with the code letter for whatever plaform you’re running.

Subject: RE: nnotes.dll equivalent on Linux OS??

Except that in UNIX, what you have is not a DLL at all, but rather a LIB, so the file you are looking for would most likely be libnotes_r.a or possibly libnotes.so