From: Steve Peters Date: Sun, 8 May 2005 20:49:17 +0000 (-0500) Subject: Sv_*set() doc's and extra const's for the SvPVX_const() tasks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=672994ceae26eaea7b543577cbf4ae1bf28d2934;hp=3d42dc86375a150e698f9a14ae6be7a37e2ed575;p=p5sagit%2Fp5-mst-13.2.git Sv_*set() doc's and extra const's for the SvPVX_const() tasks Message-ID: <20050509014917.GA24132@mccoy.peters.homeunix.org> p4raw-id: //depot/perl@24422 --- diff --git a/embed.fnc b/embed.fnc index 4d99050..1873e63 100644 --- a/embed.fnc +++ b/embed.fnc @@ -362,7 +362,7 @@ Ap |bool |is_utf8_punct |NN const U8 *p Ap |bool |is_utf8_xdigit |NN const U8 *p Ap |bool |is_utf8_mark |NN const U8 *p p |OP* |jmaybe |NN OP* arg -p |I32 |keyword |NN char* d|I32 len +p |I32 |keyword |NN const char* d|I32 len Ap |void |leave_scope |I32 base p |void |lex_end p |void |lex_start |SV* line diff --git a/perl_keyword.pl b/perl_keyword.pl index 02d5df4..bb8bc74 100644 --- a/perl_keyword.pl +++ b/perl_keyword.pl @@ -52,7 +52,7 @@ print <. +Set the current length of the string which is in the SV. See C. void SvCUR_set(SV* sv, STRLEN len) @@ -3215,6 +3215,15 @@ Like C but doesn't process magic. =for hackers Found in file sv.h +=item SvIV_set + +Set the value of the IV pointer in sv to val. + + void SvIV_set(SV* sv, IV val) + +=for hackers +Found in file sv.h + =item SvLEN Returns the size of the string buffer in the SV, not including any part @@ -3225,6 +3234,24 @@ attributable to C. See C. =for hackers Found in file sv.h +=item SvLEN_set + +Set the actual length of the string which is in the SV. + + void SvLEN_set(SV* sv, STRLEN len) + +=for hackers +Found in file sv.h + +=item SvMAGIC_set + +Set the value of the MAGIC pointer in sv to val. + + void SvMAGIC_set(SV* sv, MAGIC* val) + +=for hackers +Found in file sv.h + =item SvNIOK Returns a boolean indicating whether the SV contains a number, integer or @@ -3330,6 +3357,15 @@ sv only once. Use the more efficient C otherwise. =for hackers Found in file sv.h +=item SvNV_set + +Set the value of the IV pointer in sv to val. + + void SvNV_set(SV* sv, NV val) + +=for hackers +Found in file sv.h + =item SvOK Returns a boolean indicating whether the value is an SV. It also tells @@ -3581,6 +3617,15 @@ Like C but doesn't process magic. =for hackers Found in file sv.h +=item SvPV_set + +Set the value of the PV pointer in sv to val. + + void SvPV_set(SV* sv, char* val) + +=for hackers +Found in file sv.h + =item SvREFCNT Returns the value of the object's reference count. @@ -3644,6 +3689,15 @@ Dereferences an RV to return the SV. =for hackers Found in file sv.h +=item SvRV_set + +Set the value of the RV pointer in sv to val. + + void SvRV_set(SV* sv, SV* val) + +=for hackers +Found in file sv.h + =item SvSTASH Returns the stash of the SV. @@ -3653,6 +3707,15 @@ Returns the stash of the SV. =for hackers Found in file sv.h +=item SvSTASH_set + +Set the value of the STASH pointer in sv to val. + + void SvSTASH_set(SV* sv, STASH* val) + +=for hackers +Found in file sv.h + =item SvTAINT Taints an SV if tainting is enabled. @@ -3800,6 +3863,15 @@ Like C but doesn't process magic. =for hackers Found in file sv.h +=item SvUV_set + +Set the value of the PV pointer in sv to val. + + void SvUV_set(SV* sv, UV val) + +=for hackers +Found in file sv.h + =item SvVOK Returns a boolean indicating whether the SV contains a v-string. diff --git a/proto.h b/proto.h index 89bc5a1..968422f 100644 --- a/proto.h +++ b/proto.h @@ -393,7 +393,7 @@ PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ const U8 *p) __attribute__((nonnull(pTHX_1))); PERL_CALLCONV OP* Perl_jmaybe(pTHX_ OP* arg) __attribute__((nonnull(pTHX_1))); -PERL_CALLCONV I32 Perl_keyword(pTHX_ char* d, I32 len) +PERL_CALLCONV I32 Perl_keyword(pTHX_ const char* d, I32 len) __attribute__((nonnull(pTHX_1))); PERL_CALLCONV void Perl_leave_scope(pTHX_ I32 base); PERL_CALLCONV void Perl_lex_end(pTHX); diff --git a/sv.h b/sv.h index 869cd42..8b1a5d2 100644 --- a/sv.h +++ b/sv.h @@ -535,8 +535,32 @@ See C. Access the character as *(SvEND(sv)). =for apidoc Am|HV*|SvSTASH|SV* sv Returns the stash of the SV. +=for apidoc Am|void|SvIV_set|SV* sv|IV val +Set the value of the IV pointer in sv to val. + +=for apidoc Am|void|SvNV_set|SV* sv|NV val +Set the value of the IV pointer in sv to val. + +=for apidoc Am|void|SvPV_set|SV* sv|char* val +Set the value of the PV pointer in sv to val. + +=for apidoc Am|void|SvUV_set|SV* sv|UV val +Set the value of the PV pointer in sv to val. + +=for apidoc Am|void|SvRV_set|SV* sv|SV* val +Set the value of the RV pointer in sv to val. + +=for apidoc Am|void|SvMAGIC_set|SV* sv|MAGIC* val +Set the value of the MAGIC pointer in sv to val. + +=for apidoc Am|void|SvSTASH_set|SV* sv|STASH* val +Set the value of the STASH pointer in sv to val. + =for apidoc Am|void|SvCUR_set|SV* sv|STRLEN len -Set the length of the string which is in the SV. See C. +Set the current length of the string which is in the SV. See C. + +=for apidoc Am|void|SvLEN_set|SV* sv|STRLEN len +Set the actual length of the string which is in the SV. =cut */ @@ -854,6 +878,8 @@ in gv.h: */ } \ } STMT_END +#define SvPVX_const(sv) ((const char*)SvPVX(sv)) + #define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare #define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful #define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous diff --git a/toke.c b/toke.c index aeb0595..a50f625 100644 --- a/toke.c +++ b/toke.c @@ -5595,7 +5595,7 @@ S_pending_ident(pTHX) */ I32 -Perl_keyword (pTHX_ char *name, I32 len) +Perl_keyword (pTHX_ const char *name, I32 len) { switch (len) {