Function: semantic-c-dereference-typedef

semantic-c-dereference-typedef is a byte-compiled function defined in c.el.gz.

Signature

(semantic-c-dereference-typedef TYPE SCOPE &optional TYPE-DECLARATION)

Documentation

If TYPE is a typedef, get TYPE's type by name or tag, and return.

SCOPE is not used, and TYPE-DECLARATION is used only if TYPE is not a typedef.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/bovine/c.el.gz
(defun semantic-c-dereference-typedef (type _scope &optional type-declaration)
  "If TYPE is a typedef, get TYPE's type by name or tag, and return.
SCOPE is not used, and TYPE-DECLARATION is used only if TYPE is not a typedef."
  (if (and (eq (semantic-tag-class type) 'type)
           (string= (semantic-tag-type type) "typedef"))
      (let ((dt (semantic-tag-get-attribute type :typedef)))
        (cond ((and (semantic-tag-p dt)
                    (not (semantic-tag-prototype-p dt)))
	       ;; In this case, DT was declared directly.  We need
	       ;; to clone DT and apply a filename to it.
	       (let* ((fname (semantic-tag-file-name type))
		      (def (semantic-tag-copy dt nil fname)))
		 (list def def)))
              ((stringp dt) (list dt (semantic-tag dt 'type)))
              ((consp dt) (list (car dt) dt))))

    (list type type-declaration)))