Function: c-forward-decl-arglist

c-forward-decl-arglist is a byte-compiled function defined in cc-engine.el.gz.

Signature

(c-forward-decl-arglist NOT-TOP ID-IN-PARENS &optional LIMIT)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-engine.el.gz
(defun c-forward-decl-arglist (not-top id-in-parens &optional limit)
  ;; Point is at an open parenthesis, assumed to be the arglist of a function
  ;; declaration.  Move over this arglist and following syntactic whitespace,
  ;; and return non-nil.  If the construct isn't such an arglist, leave point
  ;; unmoved and return nil.
  ;;
  ;; Note that point is assumed to be at a place where an arglist is expected.
  ;; Only for C++, where there are other possibilities, is any actual
  ;; processing done.  Otherwise, t is simply returned.
  (let ((here (point)) got-type)
    (if	(or
	 (not (c-major-mode-is 'c++-mode))
	 (and
	  (or (not not-top)
	      id-in-parens		; Id is in parens, etc.
	      (save-excursion
		(forward-char)
		(c-forward-syntactic-ws limit)
		(looking-at "[*&]")))
	  (save-excursion
	    (let (c-last-identifier-range)
	      (forward-char)
	      (c-forward-syntactic-ws limit)
	      (catch 'is-function
		(while
		    ;; Go forward one argument at each iteration.
		    (progn
		      (while
			  (cond
			   ((looking-at c-decl-hangon-key)
			    (c-forward-keyword-clause 1))
			   ((looking-at
			     c-noise-macro-with-parens-name-re)
			    (c-forward-noise-clause))))
		      (when (eq (char-after) ?\))
			(forward-char)
			(c-forward-syntactic-ws limit)
			(throw 'is-function t))
		      (setq got-type (c-forward-type))
		      (cond
		       ((null got-type)
			(throw 'is-function nil))
		       ((not (eq got-type 'maybe))
			(throw 'is-function t)))
		      (c-forward-declarator limit t t)
		      (eq (char-after) ?,))
		  (forward-char)
		  (c-forward-syntactic-ws))
		t)))))
	(and (c-go-list-forward (point) limit)
	     (progn (c-forward-syntactic-ws limit) t))
      (goto-char here)
      nil)))