Extension Modules in C

Skip Montanaro skip at pobox.com
Thu Mar 28 11:37:40 EST 2002


    Michael> Some of the functions have parameters that are both input and
    Michael> output.... Does Python support this notion of a passed
    Michael> parameter being modified?

Nope.  You'll have to adjust your call interface to return the modified values.

    Michael>   int GetSomeInfo(char **Title, int *count, int *size);

    Michael> where it would be called as follows:

    Michael>   int isOk, count, size;
    Michael>   isOk = GetSomeInfo(NULL, &count, &size);

Your wrapper would probably return a tuple containing the modified values of
count and size if the method succeeded, and raise an exception or return an
empty tuple if not.  (The latter case is problematic.  I'd raise an
exception.)

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list