}
GV *
-gv_fetchfile(char *name)
+gv_fetchfile(const char *name)
{
dTHR;
char smallbuf[256];
}
void
-gv_init(GV *gv, HV *stash, char *name, STRLEN len, int multi)
+gv_init(GV *gv, HV *stash, const char *name, STRLEN len, int multi)
{
dTHR;
register GP *gp;
}
GV *
-gv_fetchmeth(HV *stash, char *name, STRLEN len, I32 level)
+gv_fetchmeth(HV *stash, const char *name, STRLEN len, I32 level)
{
AV* av;
GV* topgv;
}
GV *
-gv_fetchmethod(HV *stash, char *name)
+gv_fetchmethod(HV *stash, const char *name)
{
return gv_fetchmethod_autoload(stash, name, TRUE);
}
GV *
-gv_fetchmethod_autoload(HV *stash, char *name, I32 autoload)
+gv_fetchmethod_autoload(HV *stash, const char *name, I32 autoload)
{
dTHR;
- register char *nend;
- char *nsplit = 0;
+ register const char *nend;
+ const char *nsplit = 0;
GV* gv;
for (nend = name; *nend; nend++) {
nsplit = ++nend;
}
if (nsplit) {
- char *origname = name;
+ const char *origname = name;
name = nsplit + 1;
if (*nsplit == ':')
--nsplit;
}
GV*
-gv_autoload4(HV *stash, char *name, STRLEN len, I32 method)
+gv_autoload4(HV *stash, const char *name, STRLEN len, I32 method)
{
dTHR;
static char autoload[] = "AUTOLOAD";
}
HV*
-gv_stashpv(char *name, I32 create)
+gv_stashpv(const char *name, I32 create)
{
return gv_stashpvn(name, strlen(name), create);
}
HV*
-gv_stashpvn(char *name, U32 namelen, I32 create)
+gv_stashpvn(const char *name, U32 namelen, I32 create)
{
char smallbuf[256];
char *tmpbuf;
GV *
-gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
+gv_fetchpv(const char *nambeg, I32 add, I32 sv_type)
{
dTHR;
- register char *name = nambeg;
+ register const char *name = nambeg;
register GV *gv = 0;
GV**gvp;
I32 len;
- register char *namend;
+ register const char *namend;
HV *stash = 0;
U32 add_gvflags = 0;
}
void
-gv_fullname3(SV *sv, GV *gv, char *prefix)
+gv_fullname3(SV *sv, GV *gv, const char *prefix)
{
HV *hv = GvSTASH(gv);
if (!hv) {
}
void
-gv_efullname3(SV *sv, GV *gv, char *prefix)
+gv_efullname3(SV *sv, GV *gv, const char *prefix)
{
GV *egv = GvEGV(gv);
if (!egv)
static void hsplit _((HV *hv));
static void hfreeentries _((HV *hv));
static void more_he _((void));
+static HEK *save_hek _((const char *str, I32 len, U32 hash));
#endif
#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
}
STATIC HEK *
-save_hek(char *str, I32 len, U32 hash)
+save_hek(const char *str, I32 len, U32 hash)
{
char *k;
register HEK *hek;
* contains an SV* */
SV**
-hv_fetch(HV *hv, char *key, U32 klen, I32 lval)
+hv_fetch(HV *hv, const char *key, U32 klen, I32 lval)
{
register XPVHV* xhv;
register U32 hash;
}
SV**
-hv_store(HV *hv, char *key, U32 klen, SV *val, register U32 hash)
+hv_store(HV *hv, const char *key, U32 klen, SV *val, register U32 hash)
{
register XPVHV* xhv;
register I32 i;
}
SV *
-hv_delete(HV *hv, char *key, U32 klen, I32 flags)
+hv_delete(HV *hv, const char *key, U32 klen, I32 flags)
{
register XPVHV* xhv;
register I32 i;
}
bool
-hv_exists(HV *hv, char *key, U32 klen)
+hv_exists(HV *hv, const char *key, U32 klen)
{
register XPVHV* xhv;
register U32 hash;
}
char*
-sharepvn(char *sv, I32 len, U32 hash)
+sharepvn(const char *sv, I32 len, U32 hash)
{
return HEK_KEY(share_hek(sv, len, hash));
}
* len and hash must both be valid for str.
*/
void
-unsharepvn(char *str, I32 len, U32 hash)
+unsharepvn(const char *str, I32 len, U32 hash)
{
register XPVHV* xhv;
register HE *entry;
* len and hash must both be valid for str.
*/
HEK *
-share_hek(char *str, I32 len, register U32 hash)
+share_hek(const char *str, I32 len, register U32 hash)
{
register XPVHV* xhv;
register HE *entry;
#define PERL_HASH(hash,str,len) \
STMT_START { \
- register char *s_PeRlHaSh = str; \
+ register const char *s_PeRlHaSh = str; \
register I32 i_PeRlHaSh = len; \
register U32 hash_PeRlHaSh = 0; \
while (i_PeRlHaSh--) \
}
int
-mg_copy(SV *sv, SV *nsv, char *key, I32 klen)
+mg_copy(SV *sv, SV *nsv, const char *key, I32 klen)
{
int count = 0;
MAGIC* mg;
#ifdef USE_THREADS
/* find_threadsv is not reentrant */
PADOFFSET
-find_threadsv(char *name)
+find_threadsv(const char *name)
{
dTHR;
char *p;
}
SV*
-perl_get_sv(char *name, I32 create)
+perl_get_sv(const char *name, I32 create)
{
GV *gv;
#ifdef USE_THREADS
}
AV*
-perl_get_av(char *name, I32 create)
+perl_get_av(const char *name, I32 create)
{
GV* gv = gv_fetchpv(name, create, SVt_PVAV);
if (create)
}
HV*
-perl_get_hv(char *name, I32 create)
+perl_get_hv(const char *name, I32 create)
{
GV* gv = gv_fetchpv(name, create, SVt_PVHV);
if (create)
}
CV*
-perl_get_cv(char *name, I32 create)
+perl_get_cv(const char *name, I32 create)
{
GV* gv = gv_fetchpv(name, create, SVt_PVCV);
/* XXX unsafe for threads if eval_owner isn't held */
/* Be sure to refetch the stack pointer after calling these routines. */
I32
-perl_call_argv(char *sub_name, I32 flags, register char **argv)
+perl_call_argv(const char *sub_name, I32 flags, register char **argv)
/* See G_* flags in cop.h */
/* null terminated arg list */
}
I32
-perl_call_pv(char *sub_name, I32 flags)
+perl_call_pv(const char *sub_name, I32 flags)
/* name of the subroutine */
/* See G_* flags in cop.h */
{
}
I32
-perl_call_method(char *methname, I32 flags)
+perl_call_method(const char *methname, I32 flags)
/* name of the subroutine */
/* See G_* flags in cop.h */
{
}
SV*
-perl_eval_pv(char *p, I32 croak_on_error)
+perl_eval_pv(const char *p, I32 croak_on_error)
{
dSP;
SV* sv = newSVpv(p, 0);
/* Require a module. */
void
-perl_require_pv(char *pv)
+perl_require_pv(const char *pv)
{
SV* sv;
dSP;
SV* newSViv(IV);
SV* newSVnv(double);
- SV* newSVpv(char*, int);
- SV* newSVpvn(char*, int);
+ SV* newSVpv(const char*, int);
+ SV* newSVpvn(const char*, int);
SV* newSVpvf(const char*, ...);
SV* newSVsv(SV*);
void sv_setiv(SV*, IV);
void sv_setuv(SV*, UV);
void sv_setnv(SV*, double);
- void sv_setpv(SV*, char*);
- void sv_setpvn(SV*, char*, int)
+ void sv_setpv(SV*, const char*);
+ void sv_setpvn(SV*, const char*, int)
void sv_setpvf(SV*, const char*, ...);
void sv_setpvfn(SV*, const char*, STRLEN, va_list *, SV **, I32, bool);
void sv_setsv(SV*, SV*);
If you want to append something to the end of string stored in an C<SV*>,
you can use the following functions:
- void sv_catpv(SV*, char*);
- void sv_catpvn(SV*, char*, int);
+ void sv_catpv(SV*, const char*);
+ void sv_catpvn(SV*, const char*, int);
void sv_catpvf(SV*, const char*, ...);
void sv_catpvfn(SV*, const char*, STRLEN, va_list *, SV **, I32, bool);
void sv_catsv(SV*, SV*);
Once the HV has been created, the following operations are possible on HVs:
- SV** hv_store(HV*, char* key, U32 klen, SV* val, U32 hash);
- SV** hv_fetch(HV*, char* key, U32 klen, I32 lval);
+ SV** hv_store(HV*, const char* key, U32 klen, SV* val, U32 hash);
+ SV** hv_fetch(HV*, const char* key, U32 klen, I32 lval);
The C<klen> parameter is the length of the key being passed in (Note that
you cannot pass 0 in as a value of C<klen> to tell Perl to measure the
These two functions check if a hash table entry exists, and deletes it.
- bool hv_exists(HV*, char* key, U32 klen);
- SV* hv_delete(HV*, char* key, U32 klen, I32 flags);
+ bool hv_exists(HV*, const char* key, U32 klen);
+ SV* hv_delete(HV*, const char* key, U32 klen, I32 flags);
If C<flags> does not include the C<G_DISCARD> flag then C<hv_delete> will
create and return a mortal copy of the deleted value.
point to. If C<classname> is non-null, the SV is blessed into the specified
class. SV is returned.
- SV* newSVrv(SV* rv, char* classname);
+ SV* newSVrv(SV* rv, const char* classname);
Copies integer or double into an SV whose reference is C<rv>. SV is blessed
if C<classname> is non-null.
- SV* sv_setref_iv(SV* rv, char* classname, IV iv);
- SV* sv_setref_nv(SV* rv, char* classname, NV iv);
+ SV* sv_setref_iv(SV* rv, const char* classname, IV iv);
+ SV* sv_setref_nv(SV* rv, const char* classname, NV iv);
Copies the pointer value (I<the address, not the string!>) into an SV whose
reference is rv. SV is blessed if C<classname> is non-null.
- SV* sv_setref_pv(SV* rv, char* classname, PV iv);
+ SV* sv_setref_pv(SV* rv, const char* classname, PV iv);
Copies string into an SV whose reference is C<rv>. Set length to 0 to let
Perl calculate the string length. SV is blessed if C<classname> is non-null.
- SV* sv_setref_pvn(SV* rv, char* classname, PV iv, int length);
+ SV* sv_setref_pvn(SV* rv, const char* classname, PV iv, int length);
Tests whether the SV is blessed into the specified class. It does not
check inheritance relationships.
- int sv_isa(SV* sv, char* name);
+ int sv_isa(SV* sv, const char* name);
Tests whether the SV is a reference to a blessed object.
a reference to a blessed object or a string containing a class name. This
is the function implementing the C<UNIVERSAL::isa> functionality.
- bool sv_derived_from(SV* sv, char* name);
+ bool sv_derived_from(SV* sv, const char* name);
To check if you've got an object derived from a specific class you have
to write:
To get the stash pointer for a particular package, use the function:
- HV* gv_stashpv(char* name, I32 create)
+ HV* gv_stashpv(const char* name, I32 create)
HV* gv_stashsv(SV*, I32 create)
The first function takes a literal string, the second uses the string stored
Perl adds magic to an SV using the sv_magic function:
- void sv_magic(SV* sv, SV* obj, int how, char* name, I32 namlen);
+ void sv_magic(SV* sv, SV* obj, int how, const char* name, I32 namlen);
The C<sv> argument is a pointer to the SV that is to acquire a new magical
feature.
If the SV does not have that magical feature, C<NULL> is returned. Also,
if the SV is not of type SVt_PVMG, Perl may core dump.
- int mg_copy(SV* sv, SV* nsv, char* key, STRLEN klen);
+ int mg_copy(SV* sv, SV* nsv, const char* key, STRLEN klen);
This routine checks to see what types of magic C<sv> has. If the mg_type
field is an uppercase letter, then the mg_obj is copied to C<nsv>, but
within a C program. These four are:
I32 perl_call_sv(SV*, I32);
- I32 perl_call_pv(char*, I32);
- I32 perl_call_method(char*, I32);
- I32 perl_call_argv(char*, I32, register char**);
+ I32 perl_call_pv(const char*, I32);
+ I32 perl_call_method(const char*, I32);
+ I32 perl_call_argv(const char*, I32, register char**);
The routine most often used is C<perl_call_sv>. The C<SV*> argument
contains either the name of the Perl subroutine to be called, or a
you should not use the GV directly; instead, you should use the
method's CV, which can be obtained from the GV with the C<GvCV> macro.
- GV* gv_fetchmeth (HV* stash, char* name, STRLEN len, I32 level)
+ GV* gv_fetchmeth (HV* stash, const char* name, STRLEN len, I32 level)
=item gv_fetchmethod
The warning against passing the GV returned by C<gv_fetchmeth> to
C<perl_call_sv> apply equally to these functions.
- GV* gv_fetchmethod (HV* stash, char* name)
- GV* gv_fetchmethod_autoload (HV* stash, char* name, I32 autoload)
+ GV* gv_fetchmethod (HV* stash, const char* name)
+ GV* gv_fetchmethod_autoload (HV* stash, const char* name, I32 autoload)
=item G_VOID
then the package will be created if it does not already exist. If C<create>
is not set and the package does not exist then NULL is returned.
- HV* gv_stashpv (char* name, I32 create)
+ HV* gv_stashpv (const char* name, I32 create)
=item gv_stashsv
C<flags> value will normally be zero; if set to G_DISCARD then NULL will be
returned.
- SV* hv_delete (HV* tb, char* key, U32 klen, I32 flags)
+ SV* hv_delete (HV* tb, const char* key, U32 klen, I32 flags)
=item hv_delete_ent
Returns a boolean indicating whether the specified hash key exists. The
C<klen> is the length of the key.
- bool hv_exists (HV* tb, char* key, U32 klen)
+ bool hv_exists (HV* tb, const char* key, U32 klen)
=item hv_exists_ent
See L<Understanding the Magic of Tied Hashes and Arrays> for more
information on how to use this function on tied hashes.
- SV** hv_fetch (HV* tb, char* key, U32 klen, I32 lval)
+ SV** hv_fetch (HV* tb, const char* key, U32 klen, I32 lval)
=item hv_fetch_ent
See L<Understanding the Magic of Tied Hashes and Arrays> for more
information on how to use this function on tied hashes.
- SV** hv_store (HV* tb, char* key, U32 klen, SV* val, U32 hash)
+ SV** hv_store (HV* tb, const char* key, U32 klen, SV* val, U32 hash)
=item hv_store_ent
Copies the magic from one SV to another. See C<sv_magic>.
- int mg_copy (SV *, SV *, char *, STRLEN)
+ int mg_copy (SV *, SV *, const char *, STRLEN)
=item mg_find
Creates a new SV and copies a string into it. The reference count for the
SV is set to 1. If C<len> is zero then Perl will compute the length.
- SV* newSVpv (char* s, STRLEN len)
+ SV* newSVpv (const char* s, STRLEN len)
=item newSVpvf
SV is set to 1. If C<len> is zero then Perl will create a zero length
string.
- SV* newSVpvn (char* s, STRLEN len)
+ SV* newSVpvn (const char* s, STRLEN len)
=item newSVrv
be blessed in the specified package. The new SV is returned and its
reference count is 1.
- SV* newSVrv (SV* rv, char* classname)
+ SV* newSVrv (SV* rv, const char* classname)
=item newSVsv
Performs a callback to the specified Perl sub. See L<perlcall>.
- I32 perl_call_argv (char* subname, I32 flags, char** argv)
+ I32 perl_call_argv (const char* subname, I32 flags, char** argv)
=item perl_call_method
Performs a callback to the specified Perl method. The blessed object must
be on the stack. See L<perlcall>.
- I32 perl_call_method (char* methname, I32 flags)
+ I32 perl_call_method (const char* methname, I32 flags)
=item perl_call_pv
Performs a callback to the specified Perl sub. See L<perlcall>.
- I32 perl_call_pv (char* subname, I32 flags)
+ I32 perl_call_pv (const char* subname, I32 flags)
=item perl_call_sv
Tells Perl to C<eval> the given string and return an SV* result.
- SV* perl_eval_pv (char* p, I32 croak_on_error)
+ SV* perl_eval_pv (const char* p, I32 croak_on_error)
=item perl_free
Perl variable does not exist then it will be created. If C<create> is not
set and the variable does not exist then NULL is returned.
- AV* perl_get_av (char* name, I32 create)
+ AV* perl_get_av (const char* name, I32 create)
=item perl_get_cv
variable does not exist then it will be created. If C<create> is not
set and the variable does not exist then NULL is returned.
- CV* perl_get_cv (char* name, I32 create)
+ CV* perl_get_cv (const char* name, I32 create)
=item perl_get_hv
variable does not exist then it will be created. If C<create> is not
set and the variable does not exist then NULL is returned.
- HV* perl_get_hv (char* name, I32 create)
+ HV* perl_get_hv (const char* name, I32 create)
=item perl_get_sv
Perl variable does not exist then it will be created. If C<create> is not
set and the variable does not exist then NULL is returned.
- SV* perl_get_sv (char* name, I32 create)
+ SV* perl_get_sv (const char* name, I32 create)
=item perl_parse
Tells Perl to C<require> a module.
- void perl_require_pv (char* pv)
+ void perl_require_pv (const char* pv)
=item perl_run
Copy a string to a safe spot. This does not use an SV.
- char* savepv (char* sv)
+ char* savepv (const char* sv)
=item savepvn
Copy a string to a safe spot. The C<len> indicates number of bytes to
copy. This does not use an SV.
- char* savepvn (char* sv, I32 len)
+ char* savepvn (const char* sv, I32 len)
=item SAVETMPS
Concatenates the string onto the end of the string which is in the SV.
Handles 'get' magic, but not 'set' magic. See C<sv_catpv_mg>.
- void sv_catpv (SV* sv, char* ptr)
+ void sv_catpv (SV* sv, const char* ptr)
=item sv_catpv_mg
Like C<sv_catpv>, but also handles 'set' magic.
- void sv_catpvn (SV* sv, char* ptr)
+ void sv_catpvn (SV* sv, const char* ptr)
=item sv_catpvn
C<len> indicates number of bytes to copy. Handles 'get' magic, but not
'set' magic. See C<sv_catpvn_mg>.
- void sv_catpvn (SV* sv, char* ptr, STRLEN len)
+ void sv_catpvn (SV* sv, const char* ptr, STRLEN len)
=item sv_catpvn_mg
Like C<sv_catpvn>, but also handles 'set' magic.
- void sv_catpvn_mg (SV* sv, char* ptr, STRLEN len)
+ void sv_catpvn_mg (SV* sv, const char* ptr, STRLEN len)
=item sv_catpvf
somewhere inside the string buffer. The C<ptr> becomes the first
character of the adjusted string.
- void sv_chop(SV* sv, char *ptr)
+ void sv_chop(SV* sv, const char *ptr)
=item sv_cmp
Set the length of the string which is in the SV. See C<SvCUR>.
- void SvCUR_set (SV* sv, int val )
+ void SvCUR_set (SV* sv, int val)
=item sv_dec
=item sv_derived_from
-Returns a boolean indicating whether the SV is a subclass of the
-specified class.
-
- int sv_derived_from(SV* sv, char* class)
-
-=item sv_derived_from
-
Returns a boolean indicating whether the SV is derived from the specified
class. This is the function that implements C<UNIVERSAL::isa>. It works
for class names as well as for objects.
- bool sv_derived_from _((SV* sv, char* name));
+ bool sv_derived_from _((SV* sv, const char* name));
=item SvEND
Invokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates
its argument more than once.
- void SvGETMAGIC( SV *sv )
+ void SvGETMAGIC(SV *sv)
=item SvGROW
trailing NUL character). Calls C<sv_grow> to perform the expansion if
necessary. Returns a pointer to the character buffer.
- char* SvGROW( SV* sv, STRLEN len )
+ char* SvGROW(SV* sv, STRLEN len)
=item sv_grow
Adds magic to an SV.
- void sv_magic (SV* sv, SV* obj, int how, char* name, I32 namlen)
+ void sv_magic (SV* sv, SV* obj, int how, const char* name, I32 namlen)
=item sv_mortalcopy
Copies a string into an SV. The string must be null-terminated.
Does not handle 'set' magic. See C<sv_setpv_mg>.
- void sv_setpv (SV* sv, char* ptr)
+ void sv_setpv (SV* sv, const char* ptr)
=item sv_setpv_mg
Like C<sv_setpv>, but also handles 'set' magic.
- void sv_setpv_mg (SV* sv, char* ptr)
+ void sv_setpv_mg (SV* sv, const char* ptr)
=item sv_setpviv
Copies a string into an SV. The C<len> parameter indicates the number of
bytes to be copied. Does not handle 'set' magic. See C<sv_setpvn_mg>.
- void sv_setpvn (SV* sv, char* ptr, STRLEN len)
+ void sv_setpvn (SV* sv, const char* ptr, STRLEN len)
=item sv_setpvn_mg
Like C<sv_setpvn>, but also handles 'set' magic.
- void sv_setpvn_mg (SV* sv, char* ptr, STRLEN len)
+ void sv_setpvn_mg (SV* sv, const char* ptr, STRLEN len)
=item sv_setpvf
VIRTUAL char* fbm_instr _((unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags));
VIRTUAL char* find_script _((char *scriptname, bool dosearch, char **search_ext, I32 flags));
#ifdef USE_THREADS
-VIRTUAL PADOFFSET find_threadsv _((char *name));
+VIRTUAL PADOFFSET find_threadsv _((const char *name));
#endif
VIRTUAL OP* force_list _((OP* arg));
VIRTUAL OP* fold_constants _((OP* arg));
VIRTUAL GV* gv_AVadd _((GV* gv));
VIRTUAL GV* gv_HVadd _((GV* gv));
VIRTUAL GV* gv_IOadd _((GV* gv));
-VIRTUAL GV* gv_autoload4 _((HV* stash, char* name, STRLEN len, I32 method));
+VIRTUAL GV* gv_autoload4 _((HV* stash, const char* name, STRLEN len, I32 method));
VIRTUAL void gv_check _((HV* stash));
VIRTUAL void gv_efullname _((SV* sv, GV* gv));
-VIRTUAL void gv_efullname3 _((SV* sv, GV* gv, char* prefix));
-VIRTUAL GV* gv_fetchfile _((char* name));
-VIRTUAL GV* gv_fetchmeth _((HV* stash, char* name, STRLEN len, I32 level));
-VIRTUAL GV* gv_fetchmethod _((HV* stash, char* name));
-VIRTUAL GV* gv_fetchmethod_autoload _((HV* stash, char* name, I32 autoload));
-VIRTUAL GV* gv_fetchpv _((char* name, I32 add, I32 sv_type));
+VIRTUAL void gv_efullname3 _((SV* sv, GV* gv, const char* prefix));
+VIRTUAL GV* gv_fetchfile _((const char* name));
+VIRTUAL GV* gv_fetchmeth _((HV* stash, const char* name, STRLEN len, I32 level));
+VIRTUAL GV* gv_fetchmethod _((HV* stash, const char* name));
+VIRTUAL GV* gv_fetchmethod_autoload _((HV* stash, const char* name, I32 autoload));
+VIRTUAL GV* gv_fetchpv _((const char* name, I32 add, I32 sv_type));
VIRTUAL void gv_fullname _((SV* sv, GV* gv));
-VIRTUAL void gv_fullname3 _((SV* sv, GV* gv, char* prefix));
-VIRTUAL void gv_init _((GV* gv, HV* stash, char* name, STRLEN len, int multi));
-VIRTUAL HV* gv_stashpv _((char* name, I32 create));
-VIRTUAL HV* gv_stashpvn _((char* name, U32 namelen, I32 create));
+VIRTUAL void gv_fullname3 _((SV* sv, GV* gv, const char* prefix));
+VIRTUAL void gv_init _((GV* gv, HV* stash, const char* name, STRLEN len, int multi));
+VIRTUAL HV* gv_stashpv _((const char* name, I32 create));
+VIRTUAL HV* gv_stashpvn _((const char* name, U32 namelen, I32 create));
VIRTUAL HV* gv_stashsv _((SV* sv, I32 create));
VIRTUAL void hv_clear _((HV* tb));
VIRTUAL void hv_delayfree_ent _((HV* hv, HE* entry));
-VIRTUAL SV* hv_delete _((HV* tb, char* key, U32 klen, I32 flags));
+VIRTUAL SV* hv_delete _((HV* tb, const char* key, U32 klen, I32 flags));
VIRTUAL SV* hv_delete_ent _((HV* tb, SV* key, I32 flags, U32 hash));
-VIRTUAL bool hv_exists _((HV* tb, char* key, U32 klen));
+VIRTUAL bool hv_exists _((HV* tb, const char* key, U32 klen));
VIRTUAL bool hv_exists_ent _((HV* tb, SV* key, U32 hash));
-VIRTUAL SV** hv_fetch _((HV* tb, char* key, U32 klen, I32 lval));
+VIRTUAL SV** hv_fetch _((HV* tb, const char* key, U32 klen, I32 lval));
VIRTUAL HE* hv_fetch_ent _((HV* tb, SV* key, I32 lval, U32 hash));
VIRTUAL void hv_free_ent _((HV* hv, HE* entry));
VIRTUAL I32 hv_iterinit _((HV* tb));
VIRTUAL SV* hv_iterval _((HV* tb, HE* entry));
VIRTUAL void hv_ksplit _((HV* hv, IV newmax));
VIRTUAL void hv_magic _((HV* hv, GV* gv, int how));
-VIRTUAL SV** hv_store _((HV* tb, char* key, U32 klen, SV* val, U32 hash));
+VIRTUAL SV** hv_store _((HV* tb, const char* key, U32 klen, SV* val, U32 hash));
VIRTUAL HE* hv_store_ent _((HV* tb, SV* key, SV* val, U32 hash));
VIRTUAL void hv_undef _((HV* tb));
-VIRTUAL I32 ibcmp _((char* a, char* b, I32 len));
-VIRTUAL I32 ibcmp_locale _((char* a, char* b, I32 len));
+VIRTUAL I32 ibcmp _((const char* a, const char* b, I32 len));
+VIRTUAL I32 ibcmp_locale _((const char* a, const char* b, I32 len));
VIRTUAL I32 ingroup _((I32 testgid, I32 effective));
VIRTUAL void init_stacks _((ARGSproto));
VIRTUAL U32 intro_my _((void));
-VIRTUAL char* instr _((char* big, char* little));
+VIRTUAL char* instr _((const char* big, const char* little));
VIRTUAL bool io_close _((IO* io));
VIRTUAL OP* invert _((OP* cmd));
VIRTUAL bool is_uni_alnum _((U32 c));
#endif
VIRTUAL char* mess _((const char* pat, va_list* args));
VIRTUAL int mg_clear _((SV* sv));
-VIRTUAL int mg_copy _((SV* sv, SV* nsv, char* key, I32 klen));
+VIRTUAL int mg_copy _((SV* sv, SV* nsv, const char* key, I32 klen));
VIRTUAL MAGIC* mg_find _((SV* sv, int type));
VIRTUAL int mg_free _((SV* sv));
VIRTUAL int mg_get _((SV* sv));
VIRTUAL char* moreswitches _((char* s));
VIRTUAL OP* my _((OP* o));
#if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY)
-VIRTUAL char* my_bcopy _((char* from, char* to, I32 len));
+VIRTUAL char* my_bcopy _((const char* from, char* to, I32 len));
#endif
#if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
char* my_bzero _((char* loc, I32 len));
VIRTUAL void my_failure_exit _((void)) __attribute__((noreturn));
VIRTUAL I32 my_lstat _((ARGSproto));
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-VIRTUAL I32 my_memcmp _((char* s1, char* s2, I32 len));
+VIRTUAL I32 my_memcmp _((const char* s1, const char* s2, I32 len));
#endif
#if !defined(HAS_MEMSET)
VIRTUAL void* my_memset _((char* loc, I32 ch, I32 len));
VIRTUAL OP* newSVOP _((I32 type, I32 flags, SV* sv));
VIRTUAL SV* newSViv _((IV i));
VIRTUAL SV* newSVnv _((double n));
-VIRTUAL SV* newSVpv _((char* s, STRLEN len));
-VIRTUAL SV* newSVpvn _((char *s, STRLEN len));
+VIRTUAL SV* newSVpv _((const char* s, STRLEN len));
+VIRTUAL SV* newSVpvn _((const char *s, STRLEN len));
VIRTUAL SV* newSVpvf _((const char* pat, ...));
-VIRTUAL SV* newSVrv _((SV* rv, char* classname));
+VIRTUAL SV* newSVrv _((SV* rv, const char* classname));
VIRTUAL SV* newSVsv _((SV* old));
VIRTUAL OP* newUNOP _((I32 type, I32 flags, OP* first));
VIRTUAL OP* newWHILEOP _((I32 flags, I32 debuggable, LOOP* loop,
#endif
VIRTUAL PERL_SI * new_stackinfo _((I32 stitems, I32 cxitems));
VIRTUAL PerlIO* nextargv _((GV* gv));
-VIRTUAL char* ninstr _((char* big, char* bigend, char* little, char* lend));
+VIRTUAL char* ninstr _((const char* big, const char* bigend, const char* little, const char* lend));
VIRTUAL OP* oopsCV _((OP* o));
VIRTUAL void op_free _((OP* arg));
VIRTUAL void package _((OP* o));
#else
void perl_atexit _((void(*fn)(void *), void*));
#endif
-VIRTUAL I32 perl_call_argv _((char* sub_name, I32 flags, char** argv));
-VIRTUAL I32 perl_call_method _((char* methname, I32 flags));
-VIRTUAL I32 perl_call_pv _((char* sub_name, I32 flags));
+VIRTUAL I32 perl_call_argv _((const char* sub_name, I32 flags, char** argv));
+VIRTUAL I32 perl_call_method _((const char* methname, I32 flags));
+VIRTUAL I32 perl_call_pv _((const char* sub_name, I32 flags));
VIRTUAL I32 perl_call_sv _((SV* sv, I32 flags));
#ifdef PERL_OBJECT
VIRTUAL void perl_construct _((void));
void perl_construct _((PerlInterpreter* sv_interp));
void perl_destruct _((PerlInterpreter* sv_interp));
#endif
-VIRTUAL SV* perl_eval_pv _((char* p, I32 croak_on_error));
+VIRTUAL SV* perl_eval_pv _((const char* p, I32 croak_on_error));
VIRTUAL I32 perl_eval_sv _((SV* sv, I32 flags));
#ifdef PERL_OBJECT
VIRTUAL void perl_free _((void));
#else
void perl_free _((PerlInterpreter* sv_interp));
#endif
-VIRTUAL SV* perl_get_sv _((char* name, I32 create));
-VIRTUAL AV* perl_get_av _((char* name, I32 create));
-VIRTUAL HV* perl_get_hv _((char* name, I32 create));
-VIRTUAL CV* perl_get_cv _((char* name, I32 create));
+VIRTUAL SV* perl_get_sv _((const char* name, I32 create));
+VIRTUAL AV* perl_get_av _((const char* name, I32 create));
+VIRTUAL HV* perl_get_hv _((const char* name, I32 create));
+VIRTUAL CV* perl_get_cv _((const char* name, I32 create));
VIRTUAL int perl_init_i18nl10n _((int printwarn));
VIRTUAL int perl_init_i18nl14n _((int printwarn));
-VIRTUAL void perl_new_collate _((char* newcoll));
-VIRTUAL void perl_new_ctype _((char* newctype));
-VIRTUAL void perl_new_numeric _((char* newcoll));
+VIRTUAL void perl_new_collate _((const char* newcoll));
+VIRTUAL void perl_new_ctype _((const char* newctype));
+VIRTUAL void perl_new_numeric _((const char* newcoll));
VIRTUAL void perl_set_numeric_local _((void));
VIRTUAL void perl_set_numeric_standard _((void));
#ifdef PERL_OBJECT
#else
int perl_parse _((PerlInterpreter* sv_interp, void(*xsinit)(void), int argc, char** argv, char** env));
#endif
-VIRTUAL void perl_require_pv _((char* pv));
+VIRTUAL void perl_require_pv _((const char* pv));
#define perl_requirepv perl_require_pv
#ifdef PERL_OBJECT
VIRTUAL int perl_run _((void));
void* data, U32 flags));
VIRTUAL regnode* regnext _((regnode* p));
VIRTUAL void regprop _((SV* sv, regnode* o));
-VIRTUAL void repeatcpy _((char* to, char* from, I32 len, I32 count));
-VIRTUAL char* rninstr _((char* big, char* bigend, char* little, char* lend));
+VIRTUAL void repeatcpy _((char* to, const char* from, I32 len, I32 count));
+VIRTUAL char* rninstr _((const char* big, const char* bigend, const char* little, const char* lend));
VIRTUAL Sighandler_t rsignal _((int i, Sighandler_t t));
VIRTUAL int rsignal_restore _((int i, Sigsave_t* t));
VIRTUAL int rsignal_save _((int i, Sighandler_t t1, Sigsave_t* t2));
#ifndef HAS_RENAME
VIRTUAL I32 same_dirent _((char* a, char* b));
#endif
-VIRTUAL char* savepv _((char* sv));
-VIRTUAL char* savepvn _((char* sv, I32 len));
+VIRTUAL char* savepv _((const char* sv));
+VIRTUAL char* savepvn _((const char* sv, I32 len));
VIRTUAL void savestack_grow _((void));
VIRTUAL void save_aelem _((AV* av, I32 idx, SV **sptr));
VIRTUAL I32 save_alloc _((I32 size, I32 pad));
VIRTUAL I32 setenv_getix _((char* nam));
#endif
VIRTUAL void setdefout _((GV* gv));
-VIRTUAL char* sharepvn _((char* sv, I32 len, U32 hash));
-VIRTUAL HEK* share_hek _((char* sv, I32 len, U32 hash));
+VIRTUAL char* sharepvn _((const char* sv, I32 len, U32 hash));
+VIRTUAL HEK* share_hek _((const char* sv, I32 len, U32 hash));
VIRTUAL Signal_t sighandler _((int sig));
VIRTUAL SV** stack_grow _((SV** sp, SV**p, int n));
VIRTUAL I32 start_subparse _((I32 is_format, U32 flags));
VIRTUAL int sv_backoff _((SV* sv));
VIRTUAL SV* sv_bless _((SV* sv, HV* stash));
VIRTUAL void sv_catpvf _((SV* sv, const char* pat, ...));
-VIRTUAL void sv_catpv _((SV* sv, char* ptr));
-VIRTUAL void sv_catpvn _((SV* sv, char* ptr, STRLEN len));
+VIRTUAL void sv_catpv _((SV* sv, const char* ptr));
+VIRTUAL void sv_catpvn _((SV* sv, const char* ptr, STRLEN len));
VIRTUAL void sv_catsv _((SV* dsv, SV* ssv));
VIRTUAL void sv_chop _((SV* sv, char* ptr));
VIRTUAL void sv_clean_all _((void));
VIRTUAL OP* sv_compile_2op _((SV* sv, OP** startp, char* code, AV** avp));
VIRTUAL void sv_dec _((SV* sv));
VIRTUAL void sv_dump _((SV* sv));
-VIRTUAL bool sv_derived_from _((SV* sv, char* name));
+VIRTUAL bool sv_derived_from _((SV* sv, const char* name));
VIRTUAL I32 sv_eq _((SV* sv1, SV* sv2));
VIRTUAL void sv_free _((SV* sv));
VIRTUAL void sv_free_arenas _((void));
VIRTUAL char* sv_grow _((SV* sv, STRLEN newlen));
VIRTUAL void sv_inc _((SV* sv));
VIRTUAL void sv_insert _((SV* bigsv, STRLEN offset, STRLEN len, char* little, STRLEN littlelen));
-VIRTUAL int sv_isa _((SV* sv, char* name));
+VIRTUAL int sv_isa _((SV* sv, const char* name));
VIRTUAL int sv_isobject _((SV* sv));
VIRTUAL STRLEN sv_len _((SV* sv));
VIRTUAL STRLEN sv_len_utf8 _((SV* sv));
-VIRTUAL void sv_magic _((SV* sv, SV* obj, int how, char* name, I32 namlen));
+VIRTUAL void sv_magic _((SV* sv, SV* obj, int how, const char* name, I32 namlen));
VIRTUAL SV* sv_mortalcopy _((SV* oldsv));
VIRTUAL SV* sv_newmortal _((void));
VIRTUAL SV* sv_newref _((SV* sv));
VIRTUAL void sv_setpviv _((SV* sv, IV num));
VIRTUAL void sv_setuv _((SV* sv, UV num));
VIRTUAL void sv_setnv _((SV* sv, double num));
-VIRTUAL SV* sv_setref_iv _((SV* rv, char* classname, IV iv));
-VIRTUAL SV* sv_setref_nv _((SV* rv, char* classname, double nv));
-VIRTUAL SV* sv_setref_pv _((SV* rv, char* classname, void* pv));
-VIRTUAL SV* sv_setref_pvn _((SV* rv, char* classname, char* pv, I32 n));
+VIRTUAL SV* sv_setref_iv _((SV* rv, const char* classname, IV iv));
+VIRTUAL SV* sv_setref_nv _((SV* rv, const char* classname, double nv));
+VIRTUAL SV* sv_setref_pv _((SV* rv, const char* classname, void* pv));
+VIRTUAL SV* sv_setref_pvn _((SV* rv, const char* classname, char* pv, I32 n));
VIRTUAL void sv_setpv _((SV* sv, const char* ptr));
VIRTUAL void sv_setpvn _((SV* sv, const char* ptr, STRLEN len));
VIRTUAL void sv_setsv _((SV* dsv, SV* ssv));
#ifdef USE_THREADS
VIRTUAL void unlock_condpair _((void* svv));
#endif
-VIRTUAL void unsharepvn _((char* sv, I32 len, U32 hash));
+VIRTUAL void unsharepvn _((const char* sv, I32 len, U32 hash));
VIRTUAL void unshare_hek _((HEK* hek));
VIRTUAL void utilize _((int aver, I32 floor, OP* version, OP* id, OP* arg));
VIRTUAL U8* utf16_to_utf8 _((U16* p, U8 *d, I32 bytelen));
void more_he _((void));
HE* new_he _((void));
void del_he _((HE *p));
-HEK *save_hek _((char *str, I32 len, U32 hash));
+HEK *save_hek _((const char *str, I32 len, U32 hash));
SV *mess_alloc _((void));
void gv_init_sv _((GV *gv, I32 sv_type));
SV *save_scalar_at _((SV **sptr));
I32 win32_textfilter _((int idx, SV *sv, int maxlen));
#endif
char* incl_perldb _((void));
-SV *isa_lookup _((HV *stash, char *name, int len, int level));
+SV *isa_lookup _((HV *stash, const char *name, int len, int level));
CV *get_db_sub _((SV **svp, CV *cv));
I32 list_assignment _((OP *o));
void bad_type _((I32 n, char *t, char *name, OP *kid));
#endif /* INDIRECT_BGET_MACROS */
VIRTUAL void sv_catpvf_mg _((SV *sv, const char* pat, ...));
-VIRTUAL void sv_catpv_mg _((SV *sv, char *ptr));
-VIRTUAL void sv_catpvn_mg _((SV *sv, char *ptr, STRLEN len));
+VIRTUAL void sv_catpv_mg _((SV *sv, const char *ptr));
+VIRTUAL void sv_catpvn_mg _((SV *sv, const char *ptr, STRLEN len));
VIRTUAL void sv_catsv_mg _((SV *dstr, SV *sstr));
VIRTUAL void sv_setpvf_mg _((SV *sv, const char* pat, ...));
VIRTUAL void sv_setiv_mg _((SV *sv, IV i));
}
void
-sv_catpvn(register SV *sv, register char *ptr, register STRLEN len)
+sv_catpvn(register SV *sv, register const char *ptr, register STRLEN len)
{
STRLEN tlen;
char *junk;
}
void
-sv_catpvn_mg(register SV *sv, register char *ptr, register STRLEN len)
+sv_catpvn_mg(register SV *sv, register const char *ptr, register STRLEN len)
{
sv_catpvn(sv,ptr,len);
SvSETMAGIC(sv);
}
void
-sv_catpv(register SV *sv, register char *ptr)
+sv_catpv(register SV *sv, register const char *ptr)
{
register STRLEN len;
STRLEN tlen;
}
void
-sv_catpv_mg(register SV *sv, register char *ptr)
+sv_catpv_mg(register SV *sv, register const char *ptr)
{
sv_catpv(sv,ptr);
SvSETMAGIC(sv);
/* name is assumed to contain an SV* if (name && namelen == HEf_SVKEY) */
void
-sv_magic(register SV *sv, SV *obj, int how, char *name, I32 namlen)
+sv_magic(register SV *sv, SV *obj, int how, const char *name, I32 namlen)
{
MAGIC* mg;
}
SV *
-newSVpv(char *s, STRLEN len)
+newSVpv(const char *s, STRLEN len)
{
register SV *sv;
}
SV *
-newSVpvn(char *s, STRLEN len)
+newSVpvn(const char *s, STRLEN len)
{
register SV *sv;
}
int
-sv_isa(SV *sv, char *name)
+sv_isa(SV *sv, const char *name)
{
if (!sv)
return 0;
}
SV*
-newSVrv(SV *rv, char *classname)
+newSVrv(SV *rv, const char *classname)
{
dTHR;
SV *sv;
}
SV*
-sv_setref_pv(SV *rv, char *classname, void *pv)
+sv_setref_pv(SV *rv, const char *classname, void *pv)
{
if (!pv) {
sv_setsv(rv, &PL_sv_undef);
}
SV*
-sv_setref_iv(SV *rv, char *classname, IV iv)
+sv_setref_iv(SV *rv, const char *classname, IV iv)
{
sv_setiv(newSVrv(rv,classname), iv);
return rv;
}
SV*
-sv_setref_nv(SV *rv, char *classname, double nv)
+sv_setref_nv(SV *rv, const char *classname, double nv)
{
sv_setnv(newSVrv(rv,classname), nv);
return rv;
}
SV*
-sv_setref_pvn(SV *rv, char *classname, char *pv, I32 n)
+sv_setref_pvn(SV *rv, const char *classname, char *pv, I32 n)
{
sv_setpvn(newSVrv(rv,classname), pv, n);
return rv;
*/
STATIC SV *
-isa_lookup(HV *stash, char *name, int len, int level)
+isa_lookup(HV *stash, const char *name, int len, int level)
{
AV* av;
GV* gv;
}
bool
-sv_derived_from(SV *sv, char *name)
+sv_derived_from(SV *sv, const char *name)
{
SV *rv;
char *type;
/* This routine was donated by Corey Satten. */
char *
-instr(register char *big, register char *little)
+instr(register const char *big, register const char *little)
{
- register char *s, *x;
+ register const char *s, *x;
register I32 first;
if (!little)
- return big;
+ return (char*)big;
first = *little++;
if (!first)
- return big;
+ return (char*)big;
while (*big) {
if (*big++ != first)
continue;
}
}
if (!*s)
- return big-1;
+ return (char*)(big-1);
}
return Nullch;
}
/* same as instr but allow embedded nulls */
char *
-ninstr(register char *big, register char *bigend, char *little, char *lend)
+ninstr(register const char *big, register const char *bigend, const char *little, const char *lend)
{
- register char *s, *x;
+ register const char *s, *x;
register I32 first = *little;
- register char *littleend = lend;
+ register const char *littleend = lend;
if (!first && little >= littleend)
- return big;
+ return (char*)big;
if (bigend - big < littleend - little)
return Nullch;
bigend -= littleend - little++;
}
}
if (s >= littleend)
- return big-1;
+ return (char*)(big-1);
}
return Nullch;
}
/* reverse of the above--find last substring */
char *
-rninstr(register char *big, char *bigend, char *little, char *lend)
+rninstr(register const char *big, const char *bigend, const char *little, const char *lend)
{
- register char *bigbeg;
- register char *s, *x;
+ register const char *bigbeg;
+ register const char *s, *x;
register I32 first = *little;
- register char *littleend = lend;
+ register const char *littleend = lend;
if (!first && little >= littleend)
- return bigend;
+ return (char*)bigend;
bigbeg = big;
big = bigend - (littleend - little++);
while (big >= bigbeg) {
}
}
if (s >= littleend)
- return big+1;
+ return (char*)(big+1);
}
return Nullch;
}
* Set up for a new ctype locale.
*/
void
-perl_new_ctype(char *newctype)
+perl_new_ctype(const char *newctype)
{
#ifdef USE_LOCALE_CTYPE
* Set up for a new collation locale.
*/
void
-perl_new_collate(char *newcoll)
+perl_new_collate(const char *newcoll)
{
#ifdef USE_LOCALE_COLLATE
* Set up for a new numeric locale.
*/
void
-perl_new_numeric(char *newnum)
+perl_new_numeric(const char *newnum)
{
#ifdef USE_LOCALE_NUMERIC
}
I32
-ibcmp(char *s1, char *s2, register I32 len)
+ibcmp(const char *s1, const char *s2, register I32 len)
{
register U8 *a = (U8 *)s1;
register U8 *b = (U8 *)s2;
}
I32
-ibcmp_locale(char *s1, char *s2, register I32 len)
+ibcmp_locale(const char *s1, const char *s2, register I32 len)
{
register U8 *a = (U8 *)s1;
register U8 *b = (U8 *)s2;
/* copy a string to a safe spot */
char *
-savepv(char *sv)
+savepv(const char *sv)
{
register char *newaddr;
/* same thing but with a known length */
char *
-savepvn(char *sv, register I32 len)
+savepvn(const char *sv, register I32 len)
{
register char *newaddr;
#if !defined(HAS_BCOPY) || !defined(HAS_SAFE_BCOPY)
char *
-my_bcopy(register char *from,register char *to,register I32 len)
+my_bcopy(register const char *from,register char *to,register I32 len)
{
char *retval = to;
#ifndef HAS_MEMSET
void *
-my_memset(loc,ch,len)
-register char *loc;
-register I32 ch;
-register I32 len;
+my_memset(register char *loc, register I32 ch, register I32 len)
{
char *retval = loc;
#if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
char *
-my_bzero(loc,len)
-register char *loc;
-register I32 len;
+my_bzero(register char *loc, register I32 len)
{
char *retval = loc;
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
I32
-my_memcmp(s1,s2,len)
-char *s1;
-char *s2;
-register I32 len;
+my_memcmp(const char *s1, const char *s2, register I32 len)
{
register U8 *a = (U8 *)s1;
register U8 *b = (U8 *)s2;
#else
int
#endif
-vsprintf(dest, pat, args)
-char *dest;
-const char *pat;
-char *args;
+vsprintf(char *dest, const char *pat, char *args)
{
FILE fakebuf;
#endif
void
-repeatcpy(register char *to, register char *from, I32 len, register I32 count)
+repeatcpy(register char *to, register const char *from, I32 len, register I32 count)
{
register I32 todo;
- register char *frombase = from;
+ register const char *frombase = from;
if (len == 1) {
- register char c = *from;
+ register const char c = *from;
while (count-- > 0)
*to++ = c;
return;