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.

Definition in file global.h.


Define Documentation

#define PM_CODE_STR   (pPmObj_t)(gVmGlobal.pcodeStr)

The global string "code"

Definition at line 50 of file global.h.

#define PM_FALSE   (pPmObj_t)(gVmGlobal.pfalse)

The global False object

Definition at line 35 of file global.h.

#define PM_NEGONE   (pPmObj_t)(gVmGlobal.pnegone)

The global integer -1 object

Definition at line 47 of file global.h.

#define PM_NONE   (pPmObj_t)(gVmGlobal.pnone)

The global None object

Definition at line 32 of file global.h.

#define PM_ONE   (pPmObj_t)(gVmGlobal.pone)

The global integer 1 object

Definition at line 44 of file global.h.

#define PM_PBUILTINS   (pPmObj_t)(gVmGlobal.builtins)

The global root PmGlobals Dict object

Definition at line 29 of file global.h.

#define PM_TRUE   (pPmObj_t)(gVmGlobal.ptrue)

The global True object

Definition at line 38 of file global.h.

#define PM_ZERO   (pPmObj_t)(gVmGlobal.pzero)

The global integer 0 object

Definition at line 41 of file global.h.


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

Definition at line 42 of file global.c.

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

Definition at line 209 of file global.c.

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

Definition at line 183 of file global.c.


Variable Documentation

Most PyMite globals all in one convenient place

Definition at line 38 of file global.c.


Generated on Mon Oct 18 07:40:49 2010 for Python-on-a-chip by  doxygen 1.5.9