Set the prototype of a function in the form of a C-style function declaration.

        :param str c_decl: The C-style declaration of the function.
        :return:           A tuple of (function name, function prototype)
        :rtype:            tuple
507766
def set_c_prototype(self, c_decl):
        

        parsed = parse_file(c_decl)
        parsed_decl = parsed[0]
        if not parsed_decl:
            raise ValueError('Cannot parse the function prototype.')
        func_name, func_proto = next(iter(parsed_decl.items()))

        self.set_prototype(func_name, func_proto)

        return func_name, func_proto
681264
def find_first_declaration(
        declarations,
        decl_type=None,
        name=None,
        parent=None,
        recursive=True,
        fullname=None):
    

    decl_matcher = algorithm.match_declaration_t(
        decl_type=decl_type,
        name=name,
        fullname=fullname,
        parent=parent)
    if recursive:
        decls = make_flatten(declarations)
    else:
        decls = declarations
    for decl in decls:
        if decl_matcher(decl):
            return decl
    return None
331830
def prototype(self, name, argtypes, restype=None):
        """"""
        function = self.function(name)
        function.argtypes = argtypes
        if restype:
            function.restype = restype
266669
def function_type(self):
        """"""
        return cpptypes.free_function_type_t(
            return_type=self.return_type,
            arguments_types=[
                arg.decl_type for arg in self.arguments])
576370
def prepare_function_symbol(self, symbol_name, basic_addr=None):
        
        if basic_addr is None:
            basic_addr = self.project.loader.extern_object.get_pseudo_addr(symbol_name)
        return basic_addr, basic_addr
1151366
def create_function_f_c(self):
        """"""
        return ca.Function(
            'f_c',
            [self.t, self.x, self.y, self.m, self.p, self.ng, self.nu],
            [self.f_c],
            ['t', 'x', 'y', 'm', 'p', 'ng', 'nu'], ['c'], self.func_opt)
894782
def class_declaration(self, type_):
        

        utils.loggers.queries_engine.debug(
            "Container traits: searching class declaration for %s", type_)

        cls_declaration = self.get_container_or_none(type_)
        if not cls_declaration:
            raise TypeError(
                'Type "%s" is not instantiation of std::%s' %
                (type_.decl_string, self.name()))
        return cls_declaration
847949
def declare_func(self, id_, lineno, type_=None):
        
        if not self.check_class(id_, 'function', lineno):
            entry = self.get_entry(id_)  # Must not exist or have _class = None or Function and declared = False
            an = 'an' if entry.class_.lower()[0] in 'aeio' else 'a'
            syntax_error(lineno, "'%s' already declared as %s %s at %i" % (id_, an, entry.class_, entry.lineno))
            return None

        entry = self.get_entry(id_)  # Must not exist or have _class = None or Function and declared = False
        if entry is not None:
            if entry.declared and not entry.forwarded:
                syntax_error(lineno, "Duplicate function name '%s', previously defined at %i" % (id_, entry.lineno))
                return None

            if entry.class_ != CLASS.unknown and entry.callable is False:  # HINT: Must use is False here.
                syntax_error_not_array_nor_func(lineno, id_)
                return None

            if id_[-1] in DEPRECATED_SUFFIXES and entry.type_ != self.basic_types[SUFFIX_TYPE[id_[-1]]]:
                syntax_error_func_type_mismatch(lineno, entry)

            if entry.token == 'VAR':  # This was a function used in advance
                symbols.VAR.to_function(entry, lineno=lineno)
            entry.mangled = '%s_%s' % (self.mangle, entry.name)  # HINT: mangle for nexted scopes
        else:
            entry = self.declare(id_, lineno, symbols.FUNCTION(id_, lineno, type_=type_))

        if entry.forwarded:
            entry.forwared = False  # No longer forwarded
            old_type = entry.type_  # Remembers the old type
            if entry.type_ is not None:
                if entry.type_ != old_type:
                    syntax_error_func_type_mismatch(lineno, entry)
            else:
                entry.type_ = old_type
        else:
            entry.params_size = 0  # Size of parameters

        entry.locals_size = 0  # Size of local variables
        return entry
53687
function insertDecl(decl, i, newDecl) {
  var next = decl.next()
  var declAfter
  if (
    next &&
    next.type === 'comment' &&
    next.raws.before.indexOf('\n') === -1
  ) {
    declAfter = next
  } else {
    declAfter = decl
  }
  declAfter.after(newDecl)
}
150183
def set_window_focus_callback(window, cbfun):
    
    window_addr = ctypes.cast(ctypes.pointer(window),
                              ctypes.POINTER(ctypes.c_long)).contents.value
    if window_addr in _window_focus_callback_repository:
        previous_callback = _window_focus_callback_repository[window_addr]
    else:
        previous_callback = None
    if cbfun is None:
        cbfun = 0
    c_cbfun = _GLFWwindowfocusfun(cbfun)
    _window_focus_callback_repository[window_addr] = (cbfun, c_cbfun)
    cbfun = c_cbfun
    _glfw.glfwSetWindowFocusCallback(window, cbfun)
    if previous_callback is not None and previous_callback[0] != 0:
        return previous_callback[0]
1210874
def is_declaration(self):
        
        if not (self.is_global or self.is_function):
            raise ValueError('expected global or function value, got %s'
                             % (self._kind,))
        return ffi.lib.LLVMPY_IsDeclaration(self)
1350827
def log_decl_method(func):
    """"""
    from functools import wraps

    @wraps(func)
    def with_logging(*args, **kwargs):
        self = args[0]
        decl = args[2]
        log(DEBUG, u"    {}: {} {}".format(
            self.state['current_step'], decl.name,
            serialize(decl.value).strip()).encode('utf-8'))
        return func(*args, **kwargs)
    return with_logging
116728
function (f, proto) {
        function Ctor() {}
        Ctor.prototype = proto
        f.prototype = new Ctor()
        f.prototype.constructor = Ctor
        return f
    }
702998
def descr_prototype(self, buf):
        
        state = "define" if self.blocks else "declare"
        ret = self.return_value
        args = ", ".join(str(a) for a in self.args)
        name = self.get_reference()
        attrs = self.attributes
        if any(self.args):
            vararg = ', ...' if self.ftype.var_arg else ''
        else:
            vararg = '...' if self.ftype.var_arg else ''
        linkage = self.linkage
        cconv = self.calling_convention
        prefix = " ".join(str(x) for x in [state, linkage, cconv, ret] if x)
        metadata = self._stringify_metadata()
        prototype = "{prefix} {name}({args}{vararg}) {attrs}{metadata}\n".format(
            prefix=prefix, name=name, args=args, vararg=vararg,
            attrs=attrs, metadata=metadata)
        buf.append(prototype)
1257029
def p_type_def_1(t):
    """"""
    # declarations is a type_info
    d = t[2]
    lineno = t.lineno(1)
    sortno = t.lineno(3) + 0.5
    if d.type == 'void':
        global error_occurred
        error_occurred = True
        print(
            u"ERROR - can't use void in typedef at line {0:d}".format(lineno))
        return
    d.lineno = lineno
    if id_unique(d.id, d.type, lineno):
        if d.type == 'enum':
            info = d.create_enum(lineno, sortno)
        elif d.type == 'struct':
            info = d.create_struct(lineno, sortno)
        elif d.type == 'union':
            info = d.create_union(lineno, sortno)
        else:
            info = d
        name_dict[d.id] = info
1072894
function(f,c){
  var fn=f;
  var cn=c;
  return function(){
    fn.apply(cn,Array.prototype.slice.call(arguments));
  };
}
448495
def STRUCT_DECL(self, cursor, num=None):
        
        return self._record_decl(cursor, typedesc.Structure, num)