Search DominoPower's 10,675 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 (47 articles)
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
   Integrating a Notes Connector database with Google Enterprise Search
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
What to look for in a Domino-based document management solution
Understanding Domino.doc end-of-life options
When the debugger won't debug hidden code that isn't hidden
What to do if the LotusScript debugger won't single-step over code
Top 10 ways to launch and build a Lotus consulting practice (with a little help from the Beatles)
Troubleshooting an OpenSuse Notes install
Incident report: denial of service attack against ConnectedPhotographer.com
Latest Lotus Headlines
SnTT - Enabling ALL the bells and whistles!
Tivoli Data protection causes Domino to crash
Fun when running DB2 CLP scripts
Introducing Flippr, the easy way to admin Quickr
DXL and fake security
Using search forms in IBM Workplace Collaborative Learning 2.7
Schmidt, Freed, and Gering on the OVF Toolkit
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Eight steps to successful and reliable home backups
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Can Outlook run when it's not running (and other mysteries)?
-- Advertisement --

PDF Conversion for Lotus Notes
Convert Lotus Notes documents to PDF for sharing, archiving or web printing.

  • 1-step PDF: As easy as clicking a Lotus Notes toolbar icon
  • Archive email folders or views as a self-contained PDF
  • Convert any document collection into a PDF file
  • Produce print-quality output from Web applications
  • Client side or Server side conversion
  • Doesn't require any DLL files
  • LotusScript API for developers


Ready to learn more?
-- Advertisement --

Good Practices... Better Practices... Teamstudio.
Implementing good practices in your Notes environment doesn't have to be complicated.

Teamstudio provides software and services for efficient Notes development and simple, secure administrator control. Our new website also provides users with a library of resources to help, including:

  • Ready-to-implement policies for good practice development and deployment in Lotus Notes
  • On-demand webinars on topics ranging from tips for better coding, to securing your applications, managing agents, and streamlining your application deployment process
  • Free utilities for download to help you more more efficiently tackle several specific tasks in Notes development
Visit our library of white papers to help you take on difficult issues in your Notes environment.

Drop by our new website and take a look!
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2009, ZATZ Publishing. All rights reserved worldwide.
Editor's Login