nyctergatis.com

Contact

Projects
Sysquake Remote Live
NME
PDF
Hike
Sudoku
GifBuilder
jpeglib for Palm OS
MySQL Client
Cross-GCC for Mac OS
NMEPluginRot13.c
Go to the documentation of this file.
00001 
00008 /* License: new BSD license (see NME.h) */
00009 
00010 #include "NMEPluginRot13.h"
00011 
00012 NMEErr NMEPluginRot13(NMEConstText name, NMEInt nameLen,
00013         NMEConstText data, NMEInt dataLen,
00014         NMEContext *context,
00015         void *userData)
00016 {
00017     NMEInt i;
00018     NMEChar c;
00019     (void)name;
00020     (void)nameLen;
00021     (void)userData;
00022     
00023     for (i = 0; i < dataLen; i++)
00024     {
00025         c = (data[i] | 32) >= 'a' && (data[i] | 32) <= 'm'
00026                 ? data[i] + 13
00027                 : (data[i] | 32) >= 'n' && (data[i] | 32) <= 'z'
00028                 ? data[i] - 13
00029                 : data[i];
00030         if (!NMEAddString(&c, 1, '\0', context))
00031             return kNMEErrNotEnoughMemory;
00032     }
00033     
00034     return kNMEErrOk;
00035 }
Generated by Doxygen.
Copyright 2007-2013, Yves Piguet.
All rights reserved.