global.h File Reference

VM Globals. More...

Go to the source code of this file.

Classes

struct  PmVmGlobal_s

Defines

#define PM_PBUILTINS   (pPmObj_t)(gVmGlobal.builtins)
#define PM_NONE   (pPmObj_t)(gVmGlobal.pnone)
#define PM_FALSE   (pPmObj_t)(gVmGlobal.pfalse)
#define PM_TRUE   (pPmObj_t)(gVmGlobal.ptrue)
#define PM_ZERO   (pPmObj_t)(gVmGlobal.pzero)
#define PM_ONE   (pPmObj_t)(gVmGlobal.pone)
#define PM_NEGONE   (pPmObj_t)(gVmGlobal.pnegone)
#define PM_CODE_STR   (pPmObj_t)(gVmGlobal.pcodeStr)

Typedefs

typedef struct PmVmGlobal_s PmVmGlobal_t
typedef struct PmVmGlobal_spPmVmGlobal_t

Functions

PmReturn_t global_init (void)
PmReturn_t global_setBuiltins (pPmFunc_t pmod)
PmReturn_t global_loadBuiltins (void)

Variables

volatile PmVmGlobal_t gVmGlobal


Detailed Description

VM Globals.

VM globals header.


Define Documentation

#define PM_CODE_STR   (pPmObj_t)(gVmGlobal.pcodeStr)

The global string "code"

#define PM_FALSE   (pPmObj_t)(gVmGlobal.pfalse)

The global False object

#define PM_NEGONE   (pPmObj_t)(gVmGlobal.pnegone)

The global integer -1 object

#define PM_NONE   (pPmObj_t)(gVmGlobal.pnone)

The global None object

#define PM_ONE   (pPmObj_t)(gVmGlobal.pone)

The global integer 1 object

#define PM_PBUILTINS   (pPmObj_t)(gVmGlobal.builtins)

The global root PmGlobals Dict object

#define PM_TRUE   (pPmObj_t)(gVmGlobal.ptrue)

The global True object

#define PM_ZERO   (pPmObj_t)(gVmGlobal.pzero)

The global integer 0 object


Typedef Documentation

typedef struct PmVmGlobal_s PmVmGlobal_t

This struct contains ALL of PyMite's globals


Function Documentation

PmReturn_t global_init ( void   ) 

Initializes the global struct

Returns:
Return status

PmReturn_t global_loadBuiltins ( void   ) 

Loads the "__bt" module and sets the builtins dict (PM_PBUILTINS) to point to __bt's attributes dict. Creates "None" = None entry in builtins.

When run, there should not be any other threads in the interpreter thread list yet.

Returns:
Return status

PmReturn_t global_setBuiltins ( pPmFunc_t  pmod  ) 

Sets the builtins dict into the given module's attrs.

If not yet done, loads the "__bt" module via global_loadBuiltins(). Restrictions described in that functions documentation apply.

Parameters:
pmod Module whose attrs receive builtins
Returns:
Return status


Variable Documentation

Most PyMite globals all in one convenient place


Generated on Wed Feb 24 13:37:02 2010 for Python-on-a-chip by  doxygen 1.5.9