OT: Add an optional Prefix to function names...
| From: | Bram Heerink | Date: | Sun, 03 Jan 1999 10:31:03 +0000 |
| Subject: | OT: Add an optional Prefix to function names... | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3201@lists.php.net to get a copy of this message | ||
I want to optional change function names...
So Let's define PREFIX as imap_
then I want the net_* functions to be imap_net_open
You can use the ## preprocessor directive to alter somewhat
#define net_open(PREFIX) PREFIX ## net_open
Then
net_open(imap_)(Args) is translated in imap_net_open
But I want the prefix to be optional, but if you define PREFIX the
preprocessor wants PREFIX_net_open() and that is not what I want.
Is there a trick to do that?
How can I define (optional, if PREFIX is defined) funtions with the PREFIX
prefixed?
Bram
......... Escape the 'Gates' of Hell
`:::' ....... ...... Nederlandse
::: * `::. ::' Linux
::: .:: .:.::. .:: .:: `::. :' Gebruikersgroep
::: :: :: :: :: :: :::.
::: .::. .:: ::. `::::. .:' ::. http://www.nllgg.nl
...:::.....................::' .::::..
disable crashes & enable power; install linux
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net