numpy.f2py.cb_rules (version <module 'numpy.f2py.__version__' from '/usr/lib/python2.6/dist-packages/numpy/f2py/__version__.pyc'>)
index
/usr/lib/python2.6/dist-packages/numpy/f2py/cb_rules.py

Build call-back mechanism for f2py2e.
 
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
 
NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
$Date: 2005/07/20 11:27:58 $
Pearu Peterson

 
Modules
       
numpy.f2py.__version__
numpy.f2py.capi_maps
numpy.f2py.cfuncs
pprint
sys
types

 
Functions
       
buildcallback(rout, um)
buildcallbacks(m)
errmess = write(...)
write(str) -> None.  Write string str to file.
 
Note that due to buffering, flush() or close() may be needed before
the file on disk reflects the data written.

 
Data
        __file__ = '/usr/lib/python2.6/dist-packages/numpy/f2py/cb_rules.pyc'
__name__ = 'numpy.f2py.cb_rules'
__package__ = 'numpy.f2py'
cb_arg_rules = [{'depend': '', 'docsign': {<function <lambda> at 0x4f69b18>: '#varname#,'}, 'docsignopt': {<function <lambda> at 0x4f69c08>: '#varname#,'}, 'docstropt': {<function <lambda> at 0x4f69578>: '\t\t#pydocsign#'}, 'docstrout': {<function isintent_out at 0x4f47d70>: '\t\t#pydocsignout#'}, 'docstrreq': {<function <lambda> at 0x4f69668>: '\t\t#pydocsign#'}, 'latexdocstropt': {<function <lambda> at 0x4f69758>: [r'\item[]{{}\verb@#pydocsign#@{}}', {<function hasnote at 0x4f48410>: '--- #note#'}]}, 'latexdocstrout': {<function isintent_out at 0x4f47d70>: [r'\item[]{{}\verb@#pydocsignout#@{}}', {<function <lambda> at 0x4f69938>: '--- #note#', <function <lambda> at 0x4f69a28>: '--- See above.'}]}, 'latexdocstrreq': {<function <lambda> at 0x4f69848>: [r'\item[]{{}\verb@#pydocsign#@{}}', {<function hasnote at 0x4f48410>: '--- #note#'}]}}, {'args': {<function <lambda> at 0x4f69cf8>: '#ctype# #varname#', <function <lambda> at 0x4f69ed8>: '#ctype# *#varname#_cb_capi', <function isstring at 0x4fe3500>: '#ctype# #varname#', <function isarray at 0x4fe36e0>: '#ctype# *#varname#'}, 'args_nm': {<function <lambda> at 0x4f6b050>: '#varname#', <function <lambda> at 0x4f6b230>: '#varname#_cb_capi', <function isstring at 0x4fe3500>: '#varname#', <function isarray at 0x4fe36e0>: '#varname#'}, 'args_td': {<function <lambda> at 0x4f6b320>: '#ctype#', <function <lambda> at 0x4f6b500>: '#ctype# *', <function isstring at 0x4fe3500>: '#ctype#', <function isarray at 0x4fe36e0>: '#ctype# *'}, 'strarglens': {<function isstring at 0x4fe3500>: ',int #varname#_cb_len'}, 'strarglens_nm': {<function isstring at 0x4fe3500>: ',#varname#_cb_len'}, 'strarglens_td': {<function isstring at 0x4fe3500>: ',int'}}, {'_check': <function isscalar at 0x4fe3758>, 'decl': {<function <lambda> at 0x4f6b5f0>: '\t#ctype# #varname#=(*#varname#_cb_capi);'}, 'error': {<function <lambda> at 0x4f6b6e0>: ''}, 'frompyobj': [{<function debugcapi at 0x4fe3410>: '\tCFUNCSMESS("cb:Getting #varname#->");'}, {<function isintent_out at 0x4f47d70>: '\tif (capi_j>capi_i)\n\t\tGETSCALARFROMPYTUPLE(capi_...e# of call-back function #name# to C #ctype#\\n");'}, {<function <lambda> at 0x4f6b9b0>: '\tfprintf(stderr,"#showvalueformat#.\\n",#varname#);'}, {<function <lambda> at 0x4f6bd70>: '\tfprintf(stderr,"#showvalueformat#.\\n",*#varname#_cb_capi);'}, {<function <lambda> at 0x4f6bf50>: '\tfprintf(stderr,"#showvalueformat#.\\n",(#varname#).r,(#varname#).i);'}, {<function <lambda> at 0x4f6c2a8>: '\tfprintf(stderr,"#showvalueformat#.\\n",(*#varname#_cb_capi).r,(*#varname#_cb_capi).i);'}], 'need': [{<function isintent_out at 0x4f47d70>: ['#ctype#_from_pyobj', 'GETSCALARFROMPYTUPLE']}, {<function debugcapi at 0x4fe3410>: 'CFUNCSMESS'}]}, {'_check': <function <lambda> at 0x4f6c398>, '_optional': '', 'need': [{<function isintent_in at 0x4f47c80>: 'pyobj_from_#ctype#1'}, {<function isintent_inout at 0x4f47cf8>: 'pyarr_from_p_#ctype#1'}, {<function iscomplex at 0x4fe37d0>: '#ctype#'}], 'pyobjfrom': [{<function isintent_in at 0x4f47c80>: '\tif (#name#_nofargs>capi_i)\n\t\tif (PyTuple_SetIte...obj_from_#ctype#1(#varname#)))\n\t\t\tgoto capi_fail;'}, {<function isintent_inout at 0x4f47cf8>: '\tif (#name#_nofargs>capi_i)\n\t\tif (PyTuple_SetIte..._#ctype#1(#varname#_cb_capi)))\n\t\t\tgoto capi_fail;'}]}, {'_check': <function <lambda> at 0x4f6c488>, 'frompyobj': [{<function debugcapi at 0x4fe3410>: '\tCFUNCSMESS("cb:Getting #varname#->\\"");'}, '\tif (capi_j>capi_i)\n\t\tGETSTRFROMPYTUPLE(capi_return,capi_i++,#varname#,#varname#_cb_len);', {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#showvalueformat#\\":%d:.\\n",#varname#,#varname#_cb_len);'}], 'need': ['#ctype#', 'GETSTRFROMPYTUPLE', {<function debugcapi at 0x4fe3410>: 'CFUNCSMESS'}, 'string.h']}, {'_check': <function <lambda> at 0x4f6c578>, '_optional': '', 'need': [{<function isintent_in at 0x4f47c80>: 'pyobj_from_#ctype#1'}, {<function isintent_inout at 0x4f47cf8>: 'pyarr_from_p_#ctype#1'}], 'pyobjfrom': [{<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"debug-capi:cb:#varname#=\\"#showvalueformat#\\":%d:\\n",#varname#,#varname#_cb_len);'}, {<function isintent_in at 0x4f47c80>: '\tif (#name#_nofargs>capi_i)\n\t\tif (PyTuple_SetIte...obj_from_#ctype#1(#varname#)))\n\t\t\tgoto capi_fail;'}, {<function isintent_inout at 0x4f47cf8>: '\tif (#name#_nofargs>capi_i) {\n\t\tint #varname#_cb...rname#,#varname#_cb_dims)))\n\t\t\tgoto capi_fail;\n\t}'}]}, {'_check': <function isarray at 0x4fe36e0>, '_depend': '', 'decl': '\tnpy_intp #varname#_Dims[#rank#] = {#rank*[-1]#};', 'setdims': '\t#cbsetdims#;'}, {'_check': <function <lambda> at 0x4f6c848>, '_optional': '', 'pyobjfrom': [{<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"debug-capi:cb:#varname#\\n");'}, {<function isintent_c at 0x4f47ed8>: '\tif (#name#_nofargs>capi_i) {\n\t\tPyArrayObject *t...; /*XXX: Hmm, what will destroy this array??? */\n', <function <lambda> at 0x4f6c668>: '\tif (#name#_nofargs>capi_i) {\n\t\tPyArrayObject *t...; /*XXX: Hmm, what will destroy this array??? */\n'}, '\n\t\tif (tmp_arr==NULL)\n\t\t\tgoto capi_fail;\n\t\tif (P...pi_i++,(PyObject *)tmp_arr))\n\t\t\tgoto capi_fail;\n}']}, {'_check': <function <lambda> at 0x4f6c938>, 'frompyobj': [{<function debugcapi at 0x4fe3410>: '\tCFUNCSMESS("cb:Getting #varname#->");'}, '\tif (capi_j>capi_i) {\n\t\tPyArrayObject *rv_cb_arr...yobj(#atype#,#varname#_Dims,#rank#,F2PY_INTENT_IN', {<function isintent_c at 0x4f47ed8>: '|F2PY_INTENT_C'}, ',capi_tmp);\n\t\tif (rv_cb_arr == NULL) {\n\t\t\tfprint...ct *)rv_cb_arr) {\n\t\t\tPy_DECREF(rv_cb_arr);\n\t\t}\n\t}', {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"<-.\\n");'}], 'need': ['MEMCOPY', {<function iscomplexarray at 0x4fe3de8>: '#ctype#'}]}, {'_check': <function isintent_out at 0x4f47d70>, 'docreturn': '#varname#,'}]
cb_map = {}
cb_rout_rules = [{'args': [], 'args_nm': [], 'args_td': [], 'decl': '/*decl*/', 'docreturn': '', 'docsign': '', 'docsignopt': '', 'docstrcbs': '\tCall-back functions:', 'docstropt': '\tOptional arguments:', 'docstrout': '\tReturn objects:', ...}, {'_check': <function <lambda> at 0x4f69488>, 'decl': '\t#ctype# return_value;', 'frompyobj': [{<function debugcapi at 0x4fe3410>: '\tCFUNCSMESS("cb:Getting return_value->");'}, '\tif (capi_j>capi_i)\n\t\tGETSCALARFROMPYTUPLE(capi_...ue of call-back function #name# to C #ctype#\\n");', {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#showvalueformat#.\\n",return_value);'}], 'need': ['#ctype#_from_pyobj', {<function debugcapi at 0x4fe3410>: 'CFUNCSMESS'}, 'GETSCALARFROMPYTUPLE'], 'return': '\treturn return_value;'}, {'_check': <function isstringfunction at 0x4f47938>, 'args': '#ctype# return_value,int return_value_len', 'args_nm': 'return_value,&return_value_len', 'args_td': '#ctype# ,int', 'frompyobj': [{<function debugcapi at 0x4fe3410>: '\tCFUNCSMESS("cb:Getting return_value->\\"");'}, '\tif (capi_j>capi_i)\n\t\tGETSTRFROMPYTUPLE(capi_return,capi_i++,return_value,return_value_len);', {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"#showvalueformat#\\".\\n",return_value);'}], 'need': ['#ctype#_from_pyobj', {<function debugcapi at 0x4fe3410>: 'CFUNCSMESS'}, 'string.h', 'GETSTRFROMPYTUPLE'], 'pyobjfrom': {<function debugcapi at 0x4fe3410>: '\tfprintf(stderr,"debug-capi:cb:#name#:%d:\\n",return_value_len);'}, 'return': 'return;'}, {'_check': <function iscomplexfunction at 0x4f47848>, 'decl': '\n#ifdef F2PY_CB_RETURNCOMPLEX\n\t#ctype# return_value;\n#endif\n', 'frompyobj': [{<function debugcapi at 0x4fe3410>: '\tCFUNCSMESS("cb:Getting return_value->");'}, '\tif (capi_j>capi_i)\n#ifdef F2PY_CB_RETURNCOMPLEX...ll-back function #name# to C #ctype#\\n");\n#endif\n', {<function debugcapi at 0x4fe3410>: '\n#ifdef F2PY_CB_RETURNCOMPLEX\n\tfprintf(stderr,"#...n",(*return_value).r,(*return_value).i);\n#endif\n\n'}], 'need': ['#ctype#_from_pyobj', {<function debugcapi at 0x4fe3410>: 'CFUNCSMESS'}, 'string.h', 'GETSCALARFROMPYTUPLE', '#ctype#'], 'optargs': '\n#ifndef F2PY_CB_RETURNCOMPLEX\n#ctype# *return_value\n#endif\n', 'optargs_nm': '\n#ifndef F2PY_CB_RETURNCOMPLEX\nreturn_value\n#endif\n', 'optargs_td': '\n#ifndef F2PY_CB_RETURNCOMPLEX\n#ctype# *\n#endif\n', 'return': '\n#ifdef F2PY_CB_RETURNCOMPLEX\n\treturn return_value;\n#else\n\treturn;\n#endif\n'}, {'_check': <function isfunction at 0x4f47500>, 'docreturn': '#rname#,', 'docstrout': '\t\t#pydocsignout#', 'latexdocstrout': [r'\item[]{{}\verb@#pydocsignout#@{}}', {<function hasnote at 0x4f48410>: '--- #note#'}]}, {'_check': <function issubroutine at 0x4f475f0>, 'return': 'return;'}]
cb_routine_rules = {'body': '\n#begintitle#\nPyObject *#name#_capi = NULL;/*was...uf,-1);\ncapi_return_pt:\n\t;\n#return#\n}\n#endtitle#\n', 'cbtypedefs': 'typedef #rctype#(*#name#_typedef)(#optargs_td##args_td##strarglens_td##noargs#);', 'docstr': '\tdef #argname#(#docsignature#): return #docreturn#\\n\\\n#docstrsigns#', 'docstrshort': 'def #argname#(#docsignature#): return #docreturn#', 'latexdocstr': '\n{{}\\verb@def #argname#(#latexdocsignature#): return #docreturn#@{}}\n#routnote#\n\n#latexdocstrsigns#', 'maxnofargs': '#maxnofargs#', 'need': ['setjmp.h', 'CFUNCSMESS'], 'nofoptargs': '#nofoptargs#'}
debugoptions = []
f2py_version = '2'
isintent_dict = {<function isoptional at 0x4f47b18>: 'OPTIONAL', <function isintent_in at 0x4f47c80>: 'INTENT_IN', <function isintent_inout at 0x4f47cf8>: 'INTENT_INOUT', <function isintent_out at 0x4f47d70>: 'INTENT_OUT', <function isintent_hide at 0x4f47de8>: 'INTENT_HIDE', <function isintent_c at 0x4f47ed8>: 'INTENT_C', <function isintent_cache at 0x4f47f50>: 'INTENT_CACHE', <function isintent_inplace at 0x4f481b8>: 'INTENT_INPLACE'}
options = {}
wrapfuncs = 1