Hi All,
I am stuck trying to decide on 2 courses of action - one
of which involves changes to loads of files (I wish to avoid
doing this if possible).
Currently, I have this C-function:
int DEBUG(char* xstr, int somelevel)
{
// pseudo-pseudo-code follows
if ( somelevel < 10 )
print xstr;
return 0;
}
char* fs(const char* fmt, ...);
And they are used as follows (as an example):
DEBUG( fs("%s%s", "-----", "====="), 25 );
I aim to deprecate the use of fs() - as you will see the call to
fs() is wasted its output isn't being printed. I aim to shove down
that responsibility to DEBUG itself.
My Question:
Is it possible to do use C-processor macros to define fs() to
_become_ nothing, and call my new DEBUG with the follow prototype:
int NEW_DEBUG(int somelevel, const char* fmt, ...); ??
That is:
#define fs(msg,...) ?????? // leaves me with just "msg,..."
#define DEBUG(const char*, ... , level) NEW_DEBUG(level, const
char*, ????)
(Please note: I have used incorrect CPP syntax as I am trying
to get an idea across only [and also 'cos I don't know howto])
Is the above idea possible - or I should go ahead and do the
hundreds
of lines of changes ?
Thanks in advance.
Regards,
Rajnish
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug