Function: c-define-lang-constant
c-define-lang-constant is a byte-compiled function defined in
cc-defs.el.gz.
Signature
(c-define-lang-constant NAME BINDINGS &optional PRE-FILES)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-defs.el.gz
(defun c-define-lang-constant (name bindings &optional pre-files)
;; Used by `c-lang-defconst'.
(let* ((sym (intern (symbol-name name) c-lang-constants))
(source (get sym 'source))
(file (intern
(or (c-get-current-file)
(error "`c-lang-defconst' must be used in a file"))))
(elem (assq file source)))
;;(when (cdr-safe elem)
;; (message "Language constant %s redefined in %S" name file))
;; Note that the order in the source alist is relevant. Like how
;; `c-lang-defconst' reverses the bindings, this reverses the
;; order between files so that the last to evaluate comes first.
(unless elem
(while pre-files
(unless (assq (car pre-files) source)
(setq source (cons (list (car pre-files)) source)))
(setq pre-files (cdr pre-files)))
(put sym 'source (cons (setq elem (list file)) source)))
(setcdr elem bindings)
;; Bind the symbol as a variable, or clear any earlier evaluated
;; value it has.
(set sym nil)
;; Clear the evaluated values that depend on this source.
(let ((agenda (get sym 'dependents))
(visited (make-vector 101 0))
ptr)
(while agenda
(setq sym (car agenda)
agenda (cdr agenda))
(intern (symbol-name sym) visited)
(set sym nil)
(setq ptr (get sym 'dependents))
(while ptr
(setq sym (car ptr)
ptr (cdr ptr))
(unless (intern-soft (symbol-name sym) visited)
(setq agenda (cons sym agenda))))))
name))