python-on-a-chip online compiler

Dependencies:   mbed TSI

Embed: (wiki syntax)

« Back to documentation index

module.c File Reference

module.c File Reference

Module Object Type. More...

Go to the source code of this file.

Functions

PmReturn_t mod_new (pPmObj_t pco, pPmObj_t *pmod)
 Creates a Module Obj for the given Code Obj.
PmReturn_t mod_import (pPmObj_t pstr, pPmObj_t *pmod)
 Imports a module of the given name.

Detailed Description

Module Object Type.

Module object type operations.

Definition in file module.c.


Function Documentation

PmReturn_t mod_import ( pPmObj_t  pstr,
pPmObj_t pmod 
)

Imports a module of the given name.

Searches for an image with a matching name. A code obj is created for the code image. A module obj is created for the code obj.

Parameters:
pstrString obj containing name of code obj to load.
pmodReturn by reference; ptr to imported module
Returns:
Return status

Definition at line 72 of file module.c.

PmReturn_t mod_new ( pPmObj_t  pco,
pPmObj_t pmod 
)

Creates a Module Obj for the given Code Obj.

Use a func struct to represent the Module obj because the module's construction code must execute later, but set the type to OBJ_TYPE_MOD so that it is not otherwise callable.

Parameters:
pcoPtr to code obj
pmodReturn by reference; ptr to new module obj
Returns:
Return status

Definition at line 25 of file module.c.