/*
Copyright (C) 2008, The Perl Foundation.
$Id: /mirror/trunk/languages/pipp/src/pmc/php.pmc 33307 2008-11-27T20:12:54.229612Z bernhard  $

=head1 NAME

src/pmc/php.pmc - Php native runtime

=head1 DESCRIPTION

This singleton PMC holds some static methods.

=head2 Methods

=over 4

=cut

*/

#include "php_private.h"

INTVAL dynpmc_PhpArray;
INTVAL dynpmc_PhpBoolean;
INTVAL dynpmc_PhpFloat;
INTVAL dynpmc_PhpInteger;
INTVAL dynpmc_PhpString;
INTVAL dynpmc_PhpNull;

static PMC * Php_PMC;


pmclass Php
    singleton
    dynpmc
    group php_group {

/*
* Class initialization.
*/
    void class_init() {
        Php_PMC = NULL;

        if (pass) {
            dynpmc_PhpArray = pmc_type(INTERP,
              const_string(INTERP, "PhpArray"));
            dynpmc_PhpBoolean = pmc_type(INTERP,
              const_string(INTERP, "PhpBoolean"));
            dynpmc_PhpFloat = pmc_type(INTERP,
              const_string(INTERP, "PhpFloat"));
            dynpmc_PhpInteger = pmc_type(INTERP,
              const_string(INTERP, "PhpInteger"));
            dynpmc_PhpString = pmc_type(INTERP,
              const_string(INTERP, "PhpString"));
            dynpmc_PhpNull = pmc_type(INTERP,
              const_string(INTERP, "PhpNull"));
        }
    }

/*

=item C<void* get_pointer()>

=item C<void set_pointer(void *ptr)>

These two functions are part of the singleton creation interface. For more
information see F<src/pmc.c>.

=cut

*/
    void* get_pointer() {
        return Php_PMC;
    }

    void set_pointer(void *ptr) {
        Php_PMC = (PMC *)ptr;
    }

}

/*

=back

=head1 AUTHORS

Francois Perrad

=cut

*/

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
