func.py

Go to the documentation of this file.
00001 # This file is Copyright 2009, 2010 Dean Hall.
00002 #
00003 # This file is part of the Python-on-a-Chip program.
00004 # Python-on-a-Chip is free software: you can redistribute it and/or modify
00005 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
00006 # 
00007 # Python-on-a-Chip is distributed in the hope that it will be useful,
00008 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00010 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
00011 # is seen in the file COPYING in this directory.
00012 
00013 ## @file
00014 #  @copybrief func
00015 
00016 ## @package func
00017 #  @brief Provides PyMite's func module.
00018 
00019 
00020 ##
00021 # Returns the names tuple of the function/module object
00022 #
00023 def co_names(f):
00024     """__NATIVE__
00025     PmReturn_t retval = PM_RET_OK;
00026     pPmObj_t pfunc;
00027 
00028     /* If wrong number of args, raise TypeError */
00029     if (NATIVE_GET_NUM_ARGS() != 1)
00030     {
00031         PM_RAISE(retval, PM_RET_EX_TYPE);
00032         return retval;
00033     }
00034 
00035     pfunc = NATIVE_GET_LOCAL(0);
00036     NATIVE_SET_TOS((pPmObj_t)((pPmFunc_t)pfunc)->f_co->co_names);
00037 
00038     return retval;
00039     """
00040     pass
00041 
00042 
00043 ##
00044 # Returns the constants tuple of the function/module object
00045 #
00046 def co_consts(f):
00047     """__NATIVE__
00048     PmReturn_t retval = PM_RET_OK;
00049     pPmObj_t pfunc;
00050 
00051     /* If wrong number of args, raise TypeError */
00052     if (NATIVE_GET_NUM_ARGS() != 1)
00053     {
00054         PM_RAISE(retval, PM_RET_EX_TYPE);
00055         return retval;
00056     }
00057 
00058     pfunc = NATIVE_GET_LOCAL(0);
00059     NATIVE_SET_TOS((pPmObj_t)((pPmFunc_t)pfunc)->f_co->co_consts);
00060 
00061     return retval;
00062     """
00063     pass
00064 
00065 
00066 # :mode=c:

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