|
|
|
|
|
|
|
|
|
|
BASIC SERVER TASKS
Coding Domino server tasks in C: beyond Windows
By Ian Cherrill
This article is part three in a series on coding Domino server tasks in C. If you haven't read the first two parts, you might be a little lost with this one, so you should go back and check them out. For the first article in this series, visit http://www.dominopower.com/issues/issue200012/coding001.html, and for the second article, visit http://www.dominopower.com/issues/issue200101/coding0101001.html.
Last month I took you through the source code for ACLHelp, a Domino server task written in C that lets you use the server console to add yourself into the ACL of a database as a manager.
Of course, in Windows it's possible to run the Notes client on the server and attempt to get manager access to a database you lost access to by mistake. It's not recommended, but it can be done. In UNIX it's even more of a problem, as there is no UNIX Notes client. So, can we make ACLHelp run on other platforms?
Because there isn't any Windows-specific code in ACLHelp, moving it to another platform is fairly straightforward. But there are a couple of things to remember. You'll notice I haven't used the // type of comment, which was introduced in the C++ language. It's not actually part of the original C language, and although Visual C++ and the Linux gcc compiler will accept it, others such as the IBM compilers on AIX will not. So you must stick to the /* and */ method of commenting code. There's also an additional library to include, as ctype.h is required in most programs on UNIX platforms.
Fortunately, Lotus uses a couple of flags to make it easy for us to #ifdef and #endif any changes. There's a generic UNIX flag to allow us to include "ctype.h" and make any UNIX-specific changes such as swapping \ for / in pathnames. There's also a platform-specific flag such as AIX or Linux, for example. This lets us specify any changes that are only for that one platform like this:
#ifdef UNIX
#include <ctype.h>
#endif
|
That way, the ctype.h library is only included on UNIX platforms. Incidentally, although Linux isn't technically UNIX, Lotus always includes the UNIX flag in the makefile of Linux programs, so changes made for UNIX generally apply to Linux too.
The code we used last month is ready to be compiled onto AIX or Linux. In case you're wondering, yes, there's only one change required to the source code, and that's the inclusion of <ctype.h> in the header file we've already discussed. Most Lotus code is inherently cross-platform, and unless you're making calls to the Win32 API (Application Programming Interface) or using some of the fairly complex Rich Text functions, you'll find it all works much the same way anywhere. Even the most notorious difference between Windows and UNIX is handled correctly by the Lotus software as the Windows-style back-slash is translated within Notes to the UNIX forward-slash, at least for Notes databases.
[ Next ]
|
|
|
|
|
|
-- Advertisement --
AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.
Learn more about HELP Software products
|
-- Advertisement --
Virtual Meeting - Integrating Sharepoint With Lotus Notes: Strategic Coexistence
No more hassles accessing SharePoint documents from Notes! Mainsoft SharePoint Integrator combines SharePoint document sharing, collaboration, and record management capabilities with Notes emails. Preview version 1.5 during our October 7th Virtual Meeting. Learn to incorporate Notes emails and attachments into a MOSS-based record management site, without migrating to Outlook.
Register to attend today.
|
|
|
|
|
|
|
|
|