On 2001-04-04 01:01:04, [EMAIL PROTECTED] wrote:
> 
> struct passwd *                                 T_PTROBJ
> 
> 
> So, based on what I have read, doing this:
> 
> $pwd = vauth_getpw($arg1, $arg2);
> 
> print $pwd->pw_name, "\n";
> 
> should print the value of the pw_name

Declaring something as T_PTROBJ doesn't generate accessor functions for
you [1]. You must write the necessary XS functions yourself, and put
them in the passwdPtr package (or whichever package your T_PTROBJ is
blessed into).

For example, you could do something like:

    char *
    pw_name(self)
        struct passwd * self
        CODE:
            RETVAL = self->pw_name;

[1] I read that SWIG does this automatically. Has anyone tried that? Is
    it as nice as it sounds?

- ams

Reply via email to