[Pyrex] Pyrex questions

Tom Kobialka u3356514 at anu.edu.au
Wed Jun 2 02:27:25 CEST 2004


Hi

Simon Burton wrote:
> On Tue, 01 Jun 2004 16:56:06 +1000
> Tom Kobialka <u3356514 at anu.edu.au> wrote:
> 
> 
>>Hi Simon,
> 
> My fault - I'm not sure what you are meaning by "encapsulate".
> I'm guessing you want to call functions in this C program from python.
> But you also want to call your grav library from python ?
> This is often called "wrapping" :)
> 
  Yes, that's what I want to do.

> 
>>  I am encapsulating a small C program that makes use of a very specific 
>>   gravitational wave frame library. I want to call the routines in the 
>>library from my C program. Do I have to encapsulate the library in Pyrex 
>>in order to call it from my encapsulated C program? Reading through the 
>>Pyrex documentation I get the feeling that I will. This library is  of a 
>>reasonable size and i'm not looking forward to encapsulating it. Could I 
>>get away with only encapsulating the routines that my program calls? If 
>>so, do I need to take into account other routines that these routines 
>>may call?
> 
> 
> You only need to write definitions (etc.) for the functions you will be calling.
> 
> 
>>  I have read through the Pyrex doco and it doesn't seem to mention C 
>>routines and procedures such as atoi, malloc, opendir (dirent.h), 
>>casting or nesting i.e monkey = (char *) malloc(strlen(banana) + 
>>strlen(paddlepop->chocolate)) which a large proportion of my code 
>>involves. 
> 
> 
> Yes, you can use these functions from pyrex code too (just write definitions for them).
> 

  Ok, great. I'm looking for some examples of definitions.


> Oh, hey, you are just around the corner from me, maybe I should just come over!! haha ..
> 
> Simon.
> 

Cheers

Tom





More information about the Pyrex mailing list