'Transform a C (or C++) signature into RST nodes.'

def parse_signature(self, sig, signode):

    m = c_funcptr_sig_re.match(sig)
    if (m is None):
        m = c_sig_re.match(sig)
    if (m is None):
        raise ValueError('no    match')
    (rettype, name, arglist, const) = m.groups()
    signode += addnodes.desc_type('', '')
    self._parse_type(signode[(-1)], rettype)
    try:
        (classname, funcname) = name.split('::', 1)
        classname += '::'
        signode += addnodes.desc_addname(classname, classname)
        signode += addnodes.desc_name(funcname, funcname)
    except ValueError:
        signode += addnodes.desc_name(name, name)
    m = c_funcptr_name_re.match(name)
    if m:
        name = m.group(1)
    if (not arglist):
        if (self.desctype == 'cfunction'):
            signode += addnodes.desc_parameterlist()
        if const:
            signode += addnodes.desc_addname(const, const)
        return name
    paramlist = addnodes.desc_parameterlist()
    arglist = arglist.replace('`', '').replace('\\    ', '')
    args = arglist.split(',')
    for arg in args:
        arg = arg.strip()
        param = addnodes.desc_parameter('', '', noemph=True)
        try:
            (ctype, argname) = arg.rsplit('    ', 1)
        except ValueError:
            self._parse_type(param, arg)
        else:
            self._parse_type(param, ctype)
            param += nodes.emphasis(('    ' + argname), ('    ' + argname))
        paramlist += param
    signode += paramlist
    if const:
        signode += addnodes.desc_addname(const, const)
    return name
