'Generate code common to all the _generate_* methods.'

def _get_common(self, signum, sig):

    tab = ('    ' * 4)
    (func_name, incodes, outcodes, retcode, header) = sig
    incodes = incodes.replace('i', 'l')
    outcodes = outcodes.replace('i', 'l')
    retcode = retcode.replace('i', 'l')
    if header.endswith('h'):
        c = True
    else:
        c = False
    if header.endswith('++'):
        cpp = True
    else:
        cpp = False
    intypes = list(map((lambda x: CY_TYPES[x]), incodes))
    outtypes = list(map((lambda x: CY_TYPES[x]), outcodes))
    retcode = re.sub('\\*.*', '', retcode)
    if (not retcode):
        retcode = 'v'
    rettype = CY_TYPES[retcode]
    if cpp:
        func_name = 'scipy.special._ufuncs_cxx._export_{}'.format(func_name)
        func_name = '(<{}(*)({})    nogil>{})'.format(rettype, ',    '.join((intypes + outtypes)), func_name)
    else:
        func_name = self.cython_func_name(func_name, specialized=True)
    if (signum == 0):
        adverb = 'if'
    else:
        adverb = 'elif'
    cond = self._get_conditional(self.intypes, incodes, adverb)
    if cond:
        lines = [(tab + cond)]
        sp = (2 * tab)
    else:
        lines = []
        sp = tab
    return (func_name, incodes, outcodes, retcode, intypes, outtypes, rettype, c, lines, sp)
