Function: c-in-function-trailer-p

c-in-function-trailer-p is a byte-compiled function defined in cc-cmds.el.gz.

Signature

(c-in-function-trailer-p &optional LIM)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
;; Movement (etc.) by defuns.
(defun c-in-function-trailer-p (&optional lim)
  ;; Return non-nil if point is between the closing brace and the semicolon of
  ;; a brace construct which needs a semicolon, e.g. within the "variables"
  ;; portion of a declaration like "struct foo {...} bar ;".
  ;;
  ;; Return the position of the main declaration.  Otherwise, return nil.
  ;; Point is assumed to be at the top level and outside of any macro or
  ;; literal.
  ;;
  ;; If LIM is non-nil, it is the bound on a the backward search for the
  ;; beginning of the declaration.
  ;;
  ;; This function might do hidden buffer changes.
  (and c-opt-block-decls-with-vars-key
       (save-excursion
	 (c-syntactic-skip-backward "^;}" lim)
	 (let ((eo-block (point))
	       bod)
	   (and (eq (char-before) ?\})
		(memq (car (c-beginning-of-decl-1 lim)) '(same previous))
		(setq bod (point))
		;; Look for struct or union or ...  If we find one, it might
		;; be the return type of a function, or the like.  Exclude
		;; this case.
		(c-syntactic-re-search-forward
		 (concat "[;=([{]\\|\\("
			 c-opt-block-decls-with-vars-key
			 "\\)")
		 eo-block t t t)
		(match-beginning 1)	; Is there a "struct" etc., somewhere?
		(not (eq (char-before) ?_))
		(c-syntactic-re-search-forward "[;=([{]" eo-block t t t)
		(eq (char-before) ?\{)
		;; Exclude the entire "struct {...}" being the type of a
		;; function being declared.
		(not
		 (and
		  (c-go-up-list-forward)
		  (eq (char-before) ?})
		  (progn (c-forward-syntactic-ws)
			 (c-syntactic-re-search-forward
			  "[;=([{]" nil t t t))
		  (eq (char-before) ?\()))
		bod)))))