develooper Front page | perl.perl5.porters | Postings from November 2008

Perl_get_* in util.c

Thread Next
From:
Nicholas Clark
Date:
November 26, 2008 09:31
Subject:
Perl_get_* in util.c
Message ID:
20081126173131.GW49335@plum.flirble.org
There are these functions at the end of util.c

ApPR	|char**	|get_op_descs
ApPR	|char**	|get_op_names
pPR	|const char*	|get_no_modify
pPR	|U32*	|get_opargs
ApPR	|PPADDR_t*|get_ppaddr


2 are not public, 3 are. As far as I can tell, they simply aren't needed -
all they do is return a value that is already public accessible via a global
variable:

char **
Perl_get_op_names(pTHX)
{
    PERL_UNUSED_CONTEXT;
    return (char **)PL_op_name;
}

char **
Perl_get_op_descs(pTHX)
{
    PERL_UNUSED_CONTEXT;
    return (char **)PL_op_desc;
}

const char *
Perl_get_no_modify(pTHX)
{
    PERL_UNUSED_CONTEXT;
    return PL_no_modify;
}

U32 *
Perl_get_opargs(pTHX)
{
    PERL_UNUSED_CONTEXT;
    return (U32 *)PL_opargs;
}

PPADDR_t*
Perl_get_ppaddr(pTHX)
{
    dVAR;
    PERL_UNUSED_CONTEXT;
    return (PPADDR_t*)PL_ppaddr;
}

Finding where they were added involves quite a bit of digging:

http://public.activestate.com/cgi-bin/perlbrowse/b;p=15,0///depot/asperl/util.c@1080

Perl_get_no_modify() and Perl_get_opargs() appear in change 908:

Change 908 by gsar@aatma on 1998/05/01 19:21:02

	[asperl] add AS patch#20 (exposes more global constants)

Perl_get_op_descs() and Perl_fget_op_names() appear (and were first used) in
change 342:

Change 342 by nick@camel on 1997/12/01 04:01:57

	Builds and passes all tests with gcc on Win32 - phew!


Perl_get_ppaddr() appears in change 3553, was used then in perl.h for
#define PL_ppaddr (*get_ppaddr())
(but isn't now)

Change 3553 by gsar@sparc26 on 1999/06/27 14:28:49

	somewhat untested PERL_OBJECT cleanups (C++isms mostly
	gone from the public API); PERL_OBJECT builds again on
	windows
	
	TODO: namespace-clean the typedefs in iperlsys.h and
	elsewhere; remove C++ remnants from public headers



So I wondered - can they go?

Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About