C
CPA Study Group
Is it possible to write a C Preprocessor macro which changes the case
of a string. This will save me time by not having to use awk of write
my own preprocessor. Here is a sample code which I want to work
---------
#ifdef LOWER
#define NORMAL(x) MKLOWER(x)
#else
#define NORMAL(x) MKUPPER(x)
#endif
extern void NORMAL(Foo)(int x,int y);
extern void NORMAL(Bar)(int x,int y);
extern void NORMAL(Baz)(int x,int y);
....
NORMAL(Foo)(5,6);
NORMAL(Bar)(5,7);
NORMAL(Baz)(7,8);
--------
Basically I want to call the external function "foo" or "FOO" depending
on the preprocessor directive. If all I was worried about was just foo,
I could #define Foo as foo or FOO depending on LOWER. But in my case I
will have to do the #defines for Foo, Bar and Baz (in my application I
will have about 30-40 functions).
Basically is there a string version of toupper()?
- Murali
of a string. This will save me time by not having to use awk of write
my own preprocessor. Here is a sample code which I want to work
---------
#ifdef LOWER
#define NORMAL(x) MKLOWER(x)
#else
#define NORMAL(x) MKUPPER(x)
#endif
extern void NORMAL(Foo)(int x,int y);
extern void NORMAL(Bar)(int x,int y);
extern void NORMAL(Baz)(int x,int y);
....
NORMAL(Foo)(5,6);
NORMAL(Bar)(5,7);
NORMAL(Baz)(7,8);
--------
Basically I want to call the external function "foo" or "FOO" depending
on the preprocessor directive. If all I was worried about was just foo,
I could #define Foo as foo or FOO depending on LOWER. But in my case I
will have to do the #defines for Foo, Bar and Baz (in my application I
will have about 30-40 functions).
Basically is there a string version of toupper()?
- Murali