python-on-a-chip online compiler

Dependencies:   mbed TSI

Embed: (wiki syntax)

« Back to documentation index

func.h File Reference

func.h File Reference

Function Object Type. More...

Go to the source code of this file.

Data Structures

struct  PmFunc_s
 Function obj. More...

Typedefs

typedef struct PmFunc_s PmFunc_t
 Function obj.

Functions

PmReturn_t func_new (pPmObj_t pco, pPmObj_t pglobals, pPmObj_t *r_pfunc)
 Creates a Function Obj for the given Code Obj.

Detailed Description

Function Object Type.

Function object type header.

Definition in file func.h.


Typedef Documentation

typedef struct PmFunc_s PmFunc_t

Function obj.

A function is like an instance of a code obj. Contains ptr to its code obj and has its own attributes dict.

The first (__main__) module that is executed has a function obj created for it to execute the bytecode which builds the module.


Function Documentation

PmReturn_t func_new ( pPmObj_t  pco,
pPmObj_t  pglobals,
pPmObj_t r_pfunc 
)

Creates a Function Obj for the given Code Obj.

Allocate space for a Func obj and fill the fields.

Parameters:
pcoptr to code obj
pglobalsptr to globals dict (from containing func/module)
r_pfuncReturn by reference; pointer to new function
Returns:
Return status

Definition at line 25 of file func.c.