pyToC.c File Reference

This file provides a set of functions to ease calling C functions from Python. More...

#include "pyToC.h"
#include <limits.h>

Go to the source code of this file.

Defines

#define __FILE_ID__   0x71

Functions

PmReturn_t getInt32 (pPmObj_t ppo, int32_t *pi32_val)
PmReturn_t getFloat (pPmObj_t ppo, float *pf_val)
PmReturn_t getUint32 (pPmObj_t ppo, uint32_t *pu32_val)
PmReturn_t getRangedInt (pPmObj_t ppo, int32_t i32_min, int32_t i32_max, int32_t *pi32_val)
PmReturn_t getUint16 (pPmObj_t ppo, uint16_t *pu16_val)
PmReturn_t getInt16 (pPmObj_t ppo, int16_t *pi16_val)
PmReturn_t getBool (pPmObj_t ppo, bool_t *pb_bool)


Detailed Description

This file provides a set of functions to ease calling C functions from Python.

Definition in file pyToC.c.


Function Documentation

PmReturn_t getBool ( pPmObj_t  ppo,
bool_t pb_bool 
)

Get a boolean value from a Python object. Raises errors as necessary.

Parameters:
ppo A Python object.
pb_bool Pointer to resulting boolean value extracted.
Returns:
Standard Python return value.

Definition at line 100 of file pyToC.c.

PmReturn_t getFloat ( pPmObj_t  ppo,
float *  pf_val 
)

Get a floating-point value from a Python object. Raises errors as necessary.

Parameters:
ppo A Python object.
pf_val Pointer to resulting floating-point value extracted.
Returns:
Standard Python return value.

Definition at line 28 of file pyToC.c.

PmReturn_t getInt16 ( pPmObj_t  ppo,
int16_t pi16_val 
)

Get an signed, 16-bit value from a Python object. Raises errors as necessary.

Parameters:
ppo A Python object.
pi16_val Pointer to resulting int16 value extracted.
Returns:
Standard Python return value.

Definition at line 89 of file pyToC.c.

PmReturn_t getInt32 ( pPmObj_t  ppo,
int32_t pi32_val 
)

Get a signed, 32-bit value from a Python object. Raises errors as necessary.

Parameters:
ppo A Python object.
pi32_val Pointer to resulting int32 value extracted.
Returns:
Standard Python return value.

Definition at line 13 of file pyToC.c.

PmReturn_t getRangedInt ( pPmObj_t  ppo,
int32_t  i32_min,
int32_t  i32_max,
int32_t pi32_val 
)

Get an integer from a Python object, requiring that the integer lie winin a minimum and minimum value. Raises errors as necessary.

Parameters:
ppo A Python object.
i32_min Minimum allowable value.
i32_max Maximum allowable value.
pi32_val Pointer to resulting int32 value extracted.
Returns:
Standard Python return value.

Definition at line 60 of file pyToC.c.

PmReturn_t getUint16 ( pPmObj_t  ppo,
uint16_t pu16_val 
)

Get an unsigned, 16-bit value from a Python object. Raises errors as necessary.

Parameters:
ppo A Python object.
pu16_val Pointer to resulting uint16 value extracted.
Returns:
Standard Python return value.

Definition at line 78 of file pyToC.c.

PmReturn_t getUint32 ( pPmObj_t  ppo,
uint32_t pu32_val 
)

Get an unsigned, 32-bit value from a Python object. Raises errors as necessary.

Parameters:
ppo A Python object.
pu32_val Pointer to resulting int32 value extracted.
Returns:
Standard Python return value.

Definition at line 43 of file pyToC.c.


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