On Fri, 25 Nov 2005 17:55:16 +0000 (UTC) "Henrik Grubbstr_m (Lysator) @ Pike (-) developers forum" 10353@lyskom.lysator.liu.se wrote:
I have a couple modules that are just plain CMODs, with no pike stub at all. Is there a way to put a couple of add_string_constant() calls into the PIKE_MODULE_INIT{} section that is generated from a CMOD? I tried just making an INIT{} section in the module outside of the classes, but that didn't work.
Which version of Pike?
7.6.50.
From a somewhat recent precompile.pike:
- AUTOMATIC ALLOCATION AND DEALLOCATION OF CONSTANT STRINGS
- You can use the syntax MK_STRING("my string") to refer to
- a struct pike_string with the content "my string", or the
- syntax MK_STRING_SVALUE("my string") for the same, but a
- full svalue. Note that this syntax can not be used in macros.
I'm not quite sure how this works. If I want to set the constant __version to be "1.1", how do I do that?
Adam