name,begintitle,endtitle,argname ctype,rctype,maxnofargs,nofoptargs,returncptr
(rout, um)
| 715 | |
| 716 | |
| 717 | def cb_routsign2map(rout, um): |
| 718 | """ |
| 719 | name,begintitle,endtitle,argname |
| 720 | ctype,rctype,maxnofargs,nofoptargs,returncptr |
| 721 | """ |
| 722 | ret = {'name': 'cb_%s_in_%s' % (rout['name'], um), |
| 723 | 'returncptr': ''} |
| 724 | if isintent_callback(rout): |
| 725 | if '_' in rout['name']: |
| 726 | F_FUNC = 'F_FUNC_US' |
| 727 | else: |
| 728 | F_FUNC = 'F_FUNC' |
| 729 | ret['callbackname'] = '%s(%s,%s)' \ |
| 730 | % (F_FUNC, |
| 731 | rout['name'].lower(), |
| 732 | rout['name'].upper(), |
| 733 | ) |
| 734 | ret['static'] = 'extern' |
| 735 | else: |
| 736 | ret['callbackname'] = ret['name'] |
| 737 | ret['static'] = 'static' |
| 738 | ret['argname'] = rout['name'] |
| 739 | ret['begintitle'] = gentitle(ret['name']) |
| 740 | ret['endtitle'] = gentitle('end of %s' % ret['name']) |
| 741 | ret['ctype'] = getctype(rout) |
| 742 | ret['rctype'] = 'void' |
| 743 | if ret['ctype'] == 'string': |
| 744 | ret['rctype'] = 'void' |
| 745 | else: |
| 746 | ret['rctype'] = ret['ctype'] |
| 747 | if ret['rctype'] != 'void': |
| 748 | if iscomplexfunction(rout): |
| 749 | ret['returncptr'] = """ |
| 750 | #ifdef F2PY_CB_RETURNCOMPLEX |
| 751 | return_value= |
| 752 | #endif |
| 753 | """ |
| 754 | else: |
| 755 | ret['returncptr'] = 'return_value=' |
| 756 | if ret['ctype'] in cformat_map: |
| 757 | ret['showvalueformat'] = '%s' % (cformat_map[ret['ctype']]) |
| 758 | if isstringfunction(rout): |
| 759 | ret['strlength'] = getstrlength(rout) |
| 760 | if isfunction(rout): |
| 761 | if 'result' in rout: |
| 762 | a = rout['result'] |
| 763 | else: |
| 764 | a = rout['name'] |
| 765 | if hasnote(rout['vars'][a]): |
| 766 | ret['note'] = rout['vars'][a]['note'] |
| 767 | rout['vars'][a]['note'] = ['See elsewhere.'] |
| 768 | ret['rname'] = a |
| 769 | ret['pydocsign'], ret['pydocsignout'] = getpydocsign(a, rout) |
| 770 | if iscomplexfunction(rout): |
| 771 | ret['rctype'] = """ |
| 772 | #ifdef F2PY_CB_RETURNCOMPLEX |
| 773 | #ctype# |
| 774 | #else |
nothing calls this directly
no test coverage detected