From: Jarkko Hietaniemi Date: Wed, 1 May 2002 01:17:53 +0000 (+0000) Subject: Remove sv_setpviv{_,mg}; regen perlapi. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=641d418146aca42ab6c180be32ab9f32e3d6ea46;p=p5sagit%2Fp5-mst-13.2.git Remove sv_setpviv{_,mg}; regen perlapi. p4raw-id: //depot/perl@16290 --- diff --git a/embed.fnc b/embed.fnc index b9dbcb2..48c8090 100644 --- a/embed.fnc +++ b/embed.fnc @@ -762,7 +762,6 @@ Apd |void |sv_reset |char* s|HV* stash Afpd |void |sv_setpvf |SV* sv|const char* pat|... Ap |void |sv_vsetpvf |SV* sv|const char* pat|va_list* args Apd |void |sv_setiv |SV* sv|IV num -Apd |void |sv_setpviv |SV* sv|IV num Apd |void |sv_setuv |SV* sv|UV num Apd |void |sv_setnv |SV* sv|NV num Apd |SV* |sv_setref_iv |SV* rv|const char* classname|IV iv @@ -877,7 +876,6 @@ Apd |void |sv_catsv_mg |SV *dstr|SV *sstr Afpd |void |sv_setpvf_mg |SV *sv|const char* pat|... Ap |void |sv_vsetpvf_mg |SV* sv|const char* pat|va_list* args Apd |void |sv_setiv_mg |SV *sv|IV i -Apd |void |sv_setpviv_mg |SV *sv|IV iv Apd |void |sv_setuv_mg |SV *sv|UV u Apd |void |sv_setnv_mg |SV *sv|NV num Apd |void |sv_setpv_mg |SV *sv|const char *ptr diff --git a/embed.h b/embed.h index f5b6a40..3fa08a9 100644 --- a/embed.h +++ b/embed.h @@ -725,7 +725,6 @@ #define sv_setpvf Perl_sv_setpvf #define sv_vsetpvf Perl_sv_vsetpvf #define sv_setiv Perl_sv_setiv -#define sv_setpviv Perl_sv_setpviv #define sv_setuv Perl_sv_setuv #define sv_setnv Perl_sv_setnv #define sv_setref_iv Perl_sv_setref_iv @@ -831,7 +830,6 @@ #define sv_setpvf_mg Perl_sv_setpvf_mg #define sv_vsetpvf_mg Perl_sv_vsetpvf_mg #define sv_setiv_mg Perl_sv_setiv_mg -#define sv_setpviv_mg Perl_sv_setpviv_mg #define sv_setuv_mg Perl_sv_setuv_mg #define sv_setnv_mg Perl_sv_setnv_mg #define sv_setpv_mg Perl_sv_setpv_mg @@ -2287,7 +2285,6 @@ #define sv_reset(a,b) Perl_sv_reset(aTHX_ a,b) #define sv_vsetpvf(a,b,c) Perl_sv_vsetpvf(aTHX_ a,b,c) #define sv_setiv(a,b) Perl_sv_setiv(aTHX_ a,b) -#define sv_setpviv(a,b) Perl_sv_setpviv(aTHX_ a,b) #define sv_setuv(a,b) Perl_sv_setuv(aTHX_ a,b) #define sv_setnv(a,b) Perl_sv_setnv(aTHX_ a,b) #define sv_setref_iv(a,b,c) Perl_sv_setref_iv(aTHX_ a,b,c) @@ -2389,7 +2386,6 @@ #define sv_catsv_mg(a,b) Perl_sv_catsv_mg(aTHX_ a,b) #define sv_vsetpvf_mg(a,b,c) Perl_sv_vsetpvf_mg(aTHX_ a,b,c) #define sv_setiv_mg(a,b) Perl_sv_setiv_mg(aTHX_ a,b) -#define sv_setpviv_mg(a,b) Perl_sv_setpviv_mg(aTHX_ a,b) #define sv_setuv_mg(a,b) Perl_sv_setuv_mg(aTHX_ a,b) #define sv_setnv_mg(a,b) Perl_sv_setnv_mg(aTHX_ a,b) #define sv_setpv_mg(a,b) Perl_sv_setpv_mg(aTHX_ a,b) diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 94f26eb..affe329 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -297,6 +297,8 @@ Sort an array. Here is an example: sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale); +See lib/sort.pm for details about controlling the sorting algorithm. + void sortsv(SV ** array, size_t num_elts, SVCOMPARE_t cmp) =for hackers @@ -1098,6 +1100,7 @@ NOTE: Before version 5.004_65, C used to return the number of hash buckets that happen to be in use. If you still need that esoteric value, you can get it through the macro C. + I32 hv_iterinit(HV* tb) =for hackers @@ -1128,6 +1131,14 @@ Found in file hv.c Returns entries from a hash iterator. See C. +You may call C or C on the hash entry that the +iterator currently points to, without losing your place or invalidating your +iterator. Note that in this case the current entry is deleted from the hash +with your iterator holding the last reference to it. Your iterator is flagged +to free the entry on the next call to C, so you must not discard +your iterator immediately else the entry will leak - call C to +trigger the resource deallocation. + HE* hv_iternext(HV* tb) =for hackers @@ -1143,6 +1154,26 @@ operation. =for hackers Found in file hv.c +=item hv_iternext_flags + +Returns entries from a hash iterator. See C and C. +The C value will normally be zero; if HV_ITERNEXT_WANTPLACEHOLDERS is +set the placeholders keys (for restricted hashes) will be returned in addition +to normal keys. By default placeholders are automatically skipped over. +Currently a placeholder is implemented with a value that is literally +<&Perl_sv_undef> (a regular C value is a normal read-write SV for which +C is false). Note that the implementation of placeholders and +restricted hashes may change, and the implementation currently is +insufficiently abstracted for any change to be tidy. + +NOTE: this function is experimental and may change or be +removed without notice. + + HE* hv_iternext_flags(HV* tb, I32 flags) + +=for hackers +Found in file hv.c + =item hv_iterval Returns the value from the current position of the hash iterator. See @@ -1486,30 +1517,34 @@ Found in file handy.h =item savepv -Copy a string to a safe spot. This does not use an SV. +Perl's version of C. Returns a pointer to a newly allocated +string which is a duplicate of C. The size of the string is +determined by C. The memory allocated for the new string can +be freed with the C function. - char* savepv(const char* sv) + char* savepv(const char* pv) =for hackers Found in file util.c =item savepvn -Copy a string to a safe spot. The C indicates number of bytes to -copy. If pointer is NULL allocate space for a string of size specified. -This does not use an SV. +Perl's version of what C would be if it existed. Returns a +pointer to a newly allocated string which is a duplicate of the first +C bytes from C. The memory allocated for the new string can be +freed with the C function. - char* savepvn(const char* sv, I32 len) + char* savepvn(const char* pv, I32 len) =for hackers Found in file util.c =item savesharedpv -Copy a string to a safe spot in memory shared between threads. -This does not use an SV. +A version of C which allocates the duplicate string in memory +which is shared between threads. - char* savesharedpv(const char* sv) + char* savesharedpv(const char* pv) =for hackers Found in file util.c @@ -4067,25 +4102,6 @@ Like C, but also handles 'set' magic. =for hackers Found in file sv.c -=item sv_setpviv - -Copies an integer into the given SV, also updating its string value. -Does not handle 'set' magic. See C. - - void sv_setpviv(SV* sv, IV num) - -=for hackers -Found in file sv.c - -=item sv_setpviv_mg - -Like C, but also handles 'set' magic. - - void sv_setpviv_mg(SV *sv, IV iv) - -=for hackers -Found in file sv.c - =item sv_setpvn Copies a string into an SV. The C parameter indicates the number of @@ -4200,7 +4216,6 @@ You probably want to use one of the assortment of wrappers, such as C, C, C and C. - void sv_setsv(SV* dsv, SV* ssv) =for hackers @@ -4544,9 +4559,9 @@ Found in file utf8.c =item is_utf8_char Tests if some arbitrary number of bytes begins in a valid UTF-8 -character. Note that an INVARIANT (i.e. ASCII) character is a valid UTF-8 character. -The actual number of bytes in the UTF-8 character will be returned if -it is valid, otherwise 0. +character. Note that an INVARIANT (i.e. ASCII) character is a valid +UTF-8 character. The actual number of bytes in the UTF-8 character +will be returned if it is valid, otherwise 0. STRLEN is_utf8_char(U8 *p) diff --git a/proto.h b/proto.h index 7ac1454..aafb94f 100644 --- a/proto.h +++ b/proto.h @@ -799,7 +799,6 @@ PERL_CALLCONV void Perl_sv_setpvf(pTHX_ SV* sv, const char* pat, ...) ; PERL_CALLCONV void Perl_sv_vsetpvf(pTHX_ SV* sv, const char* pat, va_list* args); PERL_CALLCONV void Perl_sv_setiv(pTHX_ SV* sv, IV num); -PERL_CALLCONV void Perl_sv_setpviv(pTHX_ SV* sv, IV num); PERL_CALLCONV void Perl_sv_setuv(pTHX_ SV* sv, UV num); PERL_CALLCONV void Perl_sv_setnv(pTHX_ SV* sv, NV num); PERL_CALLCONV SV* Perl_sv_setref_iv(pTHX_ SV* rv, const char* classname, IV iv); @@ -922,7 +921,6 @@ PERL_CALLCONV void Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...) ; PERL_CALLCONV void Perl_sv_vsetpvf_mg(pTHX_ SV* sv, const char* pat, va_list* args); PERL_CALLCONV void Perl_sv_setiv_mg(pTHX_ SV *sv, IV i); -PERL_CALLCONV void Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv); PERL_CALLCONV void Perl_sv_setuv_mg(pTHX_ SV *sv, UV u); PERL_CALLCONV void Perl_sv_setnv_mg(pTHX_ SV *sv, NV num); PERL_CALLCONV void Perl_sv_setpv_mg(pTHX_ SV *sv, const char *ptr); diff --git a/sv.c b/sv.c index cc65ab2..0350bae 100644 --- a/sv.c +++ b/sv.c @@ -7420,44 +7420,6 @@ Perl_sv_tainted(pTHX_ SV *sv) return FALSE; } -/* -=for apidoc sv_setpviv - -Copies an integer into the given SV, also updating its string value. -Does not handle 'set' magic. See C. - -=cut -*/ - -void -Perl_sv_setpviv(pTHX_ SV *sv, IV iv) -{ - char buf[TYPE_CHARS(UV)]; - char *ebuf; - char *ptr = uiv_2buf(buf, iv, 0, 0, &ebuf); - - sv_setpvn(sv, ptr, ebuf - ptr); -} - -/* -=for apidoc sv_setpviv_mg - -Like C, but also handles 'set' magic. - -=cut -*/ - -void -Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv) -{ - char buf[TYPE_CHARS(UV)]; - char *ebuf; - char *ptr = uiv_2buf(buf, iv, 0, 0, &ebuf); - - sv_setpvn(sv, ptr, ebuf - ptr); - SvSETMAGIC(sv); -} - #if defined(PERL_IMPLICIT_CONTEXT) /* pTHX_ magic can't cope with varargs, so this is a no-context