2009/4/1 Johannes Schlüter <johan...@schlueters.de>: > Hi, > > On Wed, 2009-04-01 at 14:24 +0100, Paul Biggar wrote: >> > Moreover, in your example in the wiki you don't include how you would do >> > parameter parsing. Or do you rely on the code generator to look at the C >> > functions signatures and figure out by itself what to do? (actually there >> > is >> > some ambiguity, AFAIR, and thus guessing cannot be done reliably) >> >> That is exactly right. (I'll make this clearer in the RFC). I can't >> think of any cases where guess cannot be done reliably. If you can >> give me an example, I'll try and address it. > > Well, take your example: > > void Y(char *, int) > > Is the second parameter the length of the string or something > independent? Is the char* changed? And who is going to free it?
Good points. I had initially thought that there should be some simple declarative DSL, and later thought 'why can't it be a header file in the simple case'. I guess this is why. I think that to handle more complex cases we need the kind of information which makes it straightforward to easily generate code to make a seamless interface between C and the engine API. The only case I had thought of was to somehow mangle structs/pointers into resources. But I suppose we need lengths for strings. I expect (many?) more of these cases will come up. (Of course, this is why I recommended a SoC project to try it) Thanks for the comments, I'll update the RFC. Paul -- Paul Biggar paul.big...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php