Hi,
Just another difference... Before (7.4), just using add_function() in pike_module_init() was enough to make it constant (i.e. visible through indices() and accessible by Module.func()). In 7.5, however, it is not the case - so anything that is added with add_function() is not visible (and not accessible). Is it right - so add_function_constant() should be used (I just want to make minimum changes to existing modules, while migrating to 7.5). Regards, /Al
If you have a module, it doesn't matter if it's constant? It should be visible anyway.
/ Mirar
Previous text:
2004-02-27 23:04: Subject: More 7.4/7.5 differences (C modules)
Hi,
Just another difference... Before (7.4), just using add_function() in pike_module_init() was enough to make it constant (i.e. visible through indices() and accessible by Module.func()).
In 7.5, however, it is not the case - so anything that is added with add_function() is not visible (and not accessible). Is it right - so add_function_constant() should be used (I just want to make minimum changes to existing modules, while migrating to 7.5).
Regards, /Al
/ Brevbäraren
On Sat, Feb 28, 2004 at 08:00:02AM +0100, Mirar @ Pike developers forum wrote:
If you have a module, it doesn't matter if it's constant? It should be visible anyway.
It is not. Not in 7.5. Same code, same module, just recompiled with 7.5 headers, and running under 7.5 binary. All functions which were visible in 7.4 - now gone in 7.5 (only classes are visible). And, as I mentioned before, using add_function_constant() makes it visible... I tried ID_PUBLIC, but it didn't help.
Regards, /Al
It sounds to me like the problem is that you're getting a program instead of an object (module)...
/ Mirar
Previous text:
2004-02-28 08:59: Subject: Re: More 7.4/7.5 differences (C modules)
On Sat, Feb 28, 2004 at 08:00:02AM +0100, Mirar @ Pike developers forum wrote:
If you have a module, it doesn't matter if it's constant? It should be visible anyway.
It is not. Not in 7.5. Same code, same module, just recompiled with 7.5 headers, and running under 7.5 binary. All functions which were visible in 7.4 - now gone in 7.5 (only classes are visible). And, as I mentioned before, using add_function_constant() makes it visible... I tried ID_PUBLIC, but it didn't help.
Regards, /Al
/ Brevbäraren
On Sat, Feb 28, 2004 at 09:50:01AM +0100, Mirar @ Pike developers forum wrote:
It sounds to me like the problem is that you're getting a program instead of an object (module)...
Well.. I am confused... :)
If I've the following:
void pike_module_init(void) { ADD_FUNCTION("tester", f_tester, tFunc(tString,tVoid), 0); }
Code compiles, then I try to call indices(Module) - should I see this function in result? I guess - yes, at least I see - in 7.4. But in 7.5 I see nothing. And I can't call Module.tester() - it is not defined.
I don't understand - why, because I looked into Gz module - it is exactly the same way, but I see functions in indices()...
What I am doing wrong? :)
Regards, /Al
If you do typeof(Module) what do you get? "object" or "function"?
Is there a __module_value involved?
/ Mirar
Previous text:
2004-02-28 10:05: Subject: Re: More 7.4/7.5 differences (C modules)
On Sat, Feb 28, 2004 at 09:50:01AM +0100, Mirar @ Pike developers forum wrote:
It sounds to me like the problem is that you're getting a program instead of an object (module)...
Well.. I am confused... :)
If I've the following:
void pike_module_init(void) { ADD_FUNCTION("tester", f_tester, tFunc(tString,tVoid), 0); }
Code compiles, then I try to call indices(Module) - should I see this function in result? I guess - yes, at least I see - in 7.4. But in 7.5 I see nothing. And I can't call Module.tester() - it is not defined.
I don't understand - why, because I looked into Gz module - it is exactly the same way, but I see functions in indices()...
What I am doing wrong? :)
Regards, /Al
/ Brevbäraren
On Sat, Feb 28, 2004 at 10:20:02AM +0100, Mirar @ Pike developers forum wrote:
If you do typeof(Module) what do you get? "object" or "function"?
In 7.5:
Result: function( : object(is 65698))
Is there a __module_value involved?
No, it is not. It seems that it should, though... But what is strange, it is not involved in 7.4 too, but typeof gives:
Result: object(is 65679)
Is something changed in 7.5 concerning modules? That's exactly my question... :)
Regards, /Al
Hmm. That's funny. Did something change in the build system I didn't notice? Obviously it doesn't come out as an object, but as a program...
So far, it doesn't look different then for instance Image, and that gives an object (module).
/ Mirar
Previous text:
2004-02-28 10:27: Subject: Re: More 7.4/7.5 differences (C modules)
On Sat, Feb 28, 2004 at 10:20:02AM +0100, Mirar @ Pike developers forum wrote:
If you do typeof(Module) what do you get? "object" or "function"?
In 7.5:
Result: function( : object(is 65698))
Is there a __module_value involved?
No, it is not. It seems that it should, though... But what is strange, it is not involved in 7.4 too, but typeof gives:
Result: object(is 65679)
Is something changed in 7.5 concerning modules? That's exactly my question... :)
Regards, /Al
/ Brevbäraren
In 7.5, do you have a .pmod that inherits your module, so you can get at it? (You might want to use pike -x module if you do not already do so, to get such oddities done for you without your own intervention.)
/ Johan Sundström (Achtung Liebe!)
Previous text:
2004-02-28 10:05: Subject: Re: More 7.4/7.5 differences (C modules)
On Sat, Feb 28, 2004 at 09:50:01AM +0100, Mirar @ Pike developers forum wrote:
It sounds to me like the problem is that you're getting a program instead of an object (module)...
Well.. I am confused... :)
If I've the following:
void pike_module_init(void) { ADD_FUNCTION("tester", f_tester, tFunc(tString,tVoid), 0); }
Code compiles, then I try to call indices(Module) - should I see this function in result? I guess - yes, at least I see - in 7.4. But in 7.5 I see nothing. And I can't call Module.tester() - it is not defined.
I don't understand - why, because I looked into Gz module - it is exactly the same way, but I see functions in indices()...
What I am doing wrong? :)
Regards, /Al
/ Brevbäraren
On Sat, Feb 28, 2004 at 10:25:03AM +0100, Johan Sundström (Achtung Liebe!) @ Pike (-) developers forum wrote:
In 7.5, do you have a .pmod that inherits your module, so you can get at it?
Yes, when I use .pmod and inherit .so - everything is OK. But I want to use pure C module, without any .pmod (like I did it before), and it seems that I've to change something. But I don't know - what :)
I want it to work in the same way in 7.4 and 7.5 - if possible, with minimal changes (surrounded by ifdefs?).
C modules interface isn't well documented (only very basics), so it is not really clear how to do some (advanced?) things...
(You might want to use pike -x module if you do not already do so, to get such oddities done for you without your own intervention.)
Hmm... It is supposed to build a module? How to use this tool? What is required?
Regards, /Al
Yes, when I use .pmod and inherit .so - everything is OK. But I want to use pure C module, without any .pmod (like I did it before), and it seems that I've to change something. But I don't know - what :)
I think the answer to that is "Pike 7.5", though I have not understood why myself yet.
/ Johan Sundström (Achtung Liebe!)
Previous text:
2004-02-28 18:55: Subject: Re: More 7.4/7.5 differences (C modules)
On Sat, Feb 28, 2004 at 10:25:03AM +0100, Johan Sundström (Achtung Liebe!) @ Pike (-) developers forum wrote:
In 7.5, do you have a .pmod that inherits your module, so you can get at it?
Yes, when I use .pmod and inherit .so - everything is OK. But I want to use pure C module, without any .pmod (like I did it before), and it seems that I've to change something. But I don't know - what :)
I want it to work in the same way in 7.4 and 7.5 - if possible, with minimal changes (surrounded by ifdefs?).
C modules interface isn't well documented (only very basics), so it is not really clear how to do some (advanced?) things...
(You might want to use pike -x module if you do not already do so, to get such oddities done for you without your own intervention.)
Hmm... It is supposed to build a module? How to use this tool? What is required?
Regards, /Al
/ Brevbäraren
pike-devel@lists.lysator.liu.se