Search DominoPower's 11,320 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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.


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > Access Control (7 articles)
   Forcing immediate indexes to actually update immediately
   Enabling and disabling the single login setting in Notes 6
   Coding Domino server tasks in C: the adventure continues
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Home > Microsoft Technologies > Visual C (2 articles)
   Coding Domino server tasks in C: the adventure continues
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
Enabling DAOS on a database - new recommendation
Need your opinion on some new policy settings for Mail
Sometimes IBM Lotus Domino HTTP RPC Agents aren't the answer...
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


Learn more at www.integra4notes.com.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login