diff options
author | Stas Bekman <stas@stason.org> | 2003-03-10 23:35:52 +1100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-03-10 05:18:02 +0000 |
commit | 2307c6d0ffdaa48a896531d5bc3bf64c2dee420d (patch) | |
tree | f8f0f5796c4f922e600d38b1fb8af9dd3b94ed66 /pod/perlguts.pod | |
parent | 3c1e9986a4f0cb9d4e7a03af421826eb692ac840 (diff) | |
download | perl-2307c6d0ffdaa48a896531d5bc3bf64c2dee420d.tar.gz |
Bunch of doc patches from Stas; plus regen.
Subject: [doc patch] perl.c's pod api entry
Date: Mon, 10 Mar 2003 12:35:52 +1100
Message-ID: <3E6BEBF8.80402@stason.org>
Subject: Re: [patch] perlguts.pod
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:38:57 +1100
Message-ID: <3E6BECB1.7050009@stason.org>
Subject: Re: [PATCH ext/DynaLoader/DynaLoader_pm.PL] doc fix: s/dl_loadflags/dl_load_flags/
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:41:46 +1100
Message-ID: <3E6BED5A.801@stason.org>
Subject: Re: [patch] perlapi.pod fix
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:43:33 +1100
Message-ID: <3E6BEDC5.6010405@stason.org>
Subject: Re: [docs patch] replace gets() with fgets() in example
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 12:45:41 +1100
Message-ID: <3E6BEE45.9030901@stason.org>
Subject: [doc patch] perlrun.pod
From: Stas Bekman <stas@stason.org>
Date: Mon, 10 Mar 2003 14:49:59 +1100
Message-ID: <3E6C0B67.4050606@stason.org>
p4raw-id: //depot/perl@18873
Diffstat (limited to 'pod/perlguts.pod')
-rw-r--r-- | pod/perlguts.pod | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 61e93d78ba..83ed068604 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1799,7 +1799,7 @@ A public function (i.e. part of the internal API, but not necessarily sanctioned for use in extensions) begins like this: void - Perl_sv_setsv(pTHX_ SV* dsv, SV* ssv) + Perl_sv_setiv(pTHX_ SV* dsv, IV num) C<pTHX_> is one of a number of macros (in perl.h) that hide the details of the interpreter's context. THX stands for "thread", "this", @@ -1818,19 +1818,19 @@ macro without the trailing underscore is used when there are no additional explicit arguments. When a core function calls another, it must pass the context. This -is normally hidden via macros. Consider C<sv_setsv>. It expands into +is normally hidden via macros. Consider C<sv_setiv>. It expands into something like this: - ifdef PERL_IMPLICIT_CONTEXT - define sv_setsv(a,b) Perl_sv_setsv(aTHX_ a, b) + #ifdef PERL_IMPLICIT_CONTEXT + #define sv_setiv(a,b) Perl_sv_setiv(aTHX_ a, b) /* can't do this for vararg functions, see below */ - else - define sv_setsv Perl_sv_setsv - endif + #else + #define sv_setiv Perl_sv_setiv + #endif This works well, and means that XS authors can gleefully write: - sv_setsv(foo, bar); + sv_setiv(foo, bar); and still have it work under all the modes Perl could have been compiled with. @@ -1874,16 +1874,16 @@ with extensions: whenever XSUB.h is #included, it redefines the aTHX and aTHX_ macros to call a function that will return the context. Thus, something like: - sv_setsv(asv, bsv); + sv_setiv(sv, num); in your extension will translate to this when PERL_IMPLICIT_CONTEXT is in effect: - Perl_sv_setsv(Perl_get_context(), asv, bsv); + Perl_sv_setiv(Perl_get_context(), sv, num); or to this otherwise: - Perl_sv_setsv(asv, bsv); + Perl_sv_setiv(sv, num); You have to do nothing new in your extension to get this; since the Perl library provides Perl_get_context(), it will all just |