Discussion:
embedding?
(too old to reply)
ben
2011-12-23 05:13:28 UTC
Permalink
I'm trying to embed perl in a pam module and have a few questions. Is
this a good place to ask? If not where is?

thanks,
ben
--
Ben Hildred
Estimator
Applied Plastic Coatings, Inc.
5000 Tabor St.
Wheat Ridge, CO 80033
303 424 9200
F: 303 424 8800
***@appliedplastic.com
http://appliedplastic.com
Shlomi Fish
2011-12-23 07:26:58 UTC
Permalink
Hi Ben,

On Thu, 22 Dec 2011 22:13:28 -0700
Post by ben
I'm trying to embed perl in a pam module and have a few questions. Is
this a good place to ask? If not where is?
I think here would be a good place.

Regards,

Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
What Makes Software Apps High Quality - http://shlom.in/sw-quality

Deletionists delete Wikipedia articles that they consider lame.

Chuck Norris deletes Deletionists whom he considers lame.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
ben
2011-12-23 20:24:29 UTC
Permalink
Post by Shlomi Fish
Hi Ben,
On Thu, 22 Dec 2011 22:13:28 -0700
Post by ben
I'm trying to embed perl in a pam module and have a few questions. Is
this a good place to ask? If not where is?
I think here would be a good place.
Regards,
Shlomi Fish
OK, I'm a little fragmented here, but it matches my mental process: when
solving puzzles, start with the edges.

I noticed when searching through perlapi, that there are functions for
memory management (newx and friends), and as my C is a bit rusty I think
I remember that you don't want to mix memory management functions. Is
this still true? What do you do if the library you are linking against
uses malloc? What do you do if you need to allocate memory before the
interpreter starts? Specifically a struct containing *myperl?

The library I'm linking against uses something like typedef struct {...}
*handle;. these handles are needed to be passed to function calls being
made from perl. there is decent documentation for using typemap to
convert a blessed scalar ref to void*, but is sv_setref_pvn the best way
to get the pointer in a scalar in a perlcall environment? In my
experiments it seems that sv_setref_pvn requires an existing but empty
scalar for it's first argument. Is this correct?

The documentation concerning PERL_SYS_INIT3 seems to indicate that it
requires access to the main function's actual parameters. Why? What
happens if you fake it? As I'm trying to use published APIs to embed
perl in another environment I don't have access to the main function.
Any Gotchas? Recommendations? (It seems to work with my substitutions,
but I haven't done much testing yet.)

Sorry for the brain dump, and thanks for your patience and help.
ben
--
Ben Hildred
Estimator
Applied Plastic Coatings, Inc.
5000 Tabor St.
Wheat Ridge, CO 80033
303 424 9200
F: 303 424 8800
***@appliedplastic.com
http://appliedplastic.com
Loading...