MCPcopy Create free account
hub / github.com/numpy/numpy / getcallprotoargument

Function getcallprotoargument

numpy/f2py/auxfuncs.py:677–713  ·  view source on GitHub ↗
(rout, cb_map={})

Source from the content-addressed store, hash-verified

675
676
677def getcallprotoargument(rout, cb_map={}):
678 r = getmultilineblock(rout, 'callprotoargument', comment=0)
679 if r:
680 return r
681 if hascallstatement(rout):
682 outmess(
683 'warning: callstatement is defined without callprotoargument\n')
684 return
685 from .capi_maps import getctype
686 arg_types, arg_types2 = [], []
687 if l_and(isstringfunction, l_not(isfunction_wrap))(rout):
688 arg_types.extend(['char*', 'size_t'])
689 for n in rout['args']:
690 var = rout['vars'][n]
691 if isintent_callback(var):
692 continue
693 if n in cb_map:
694 ctype = cb_map[n] + '_typedef'
695 else:
696 ctype = getctype(var)
697 if l_and(isintent_c, l_or(isscalar, iscomplex))(var):
698 pass
699 elif isstring(var):
700 pass
701 else:
702 if not isattr_value(var):
703 ctype = ctype + '*'
704 if ((isstring(var)
705 or isarrayofstrings(var) # obsolete?
706 or isstringarray(var))):
707 arg_types2.append('size_t')
708 arg_types.append(ctype)
709
710 proto_args = ','.join(arg_types + arg_types2)
711 if not proto_args:
712 proto_args = 'void'
713 return proto_args
714
715
716def getusercode(rout):

Callers 1

routsign2mapFunction · 0.85

Calls 13

getmultilineblockFunction · 0.85
hascallstatementFunction · 0.85
l_andFunction · 0.85
l_notFunction · 0.85
isintent_callbackFunction · 0.85
getctypeFunction · 0.85
l_orFunction · 0.85
isstringFunction · 0.85
isattr_valueFunction · 0.85
isarrayofstringsFunction · 0.85
isstringarrayFunction · 0.85
outmessFunction · 0.70

Tested by

no test coverage detected