+;;;--------------------------------------------------------------------------
+;;; Output types.
+
+(defvar *output-types* nil
+ "List of known output types.")
+
+(export 'declare-output-type)
+(defun declare-output-type (reason pathname)
+ "Record that REASON is a valid user-level output type.
+
+ The output file name will be constructed by merging the module's pathname
+ with PATHNAME."
+ (setf (get reason 'output-type) pathname))
+
+(export 'output-type-pathname)
+(defun output-type-pathname (reason)
+ "Return the PATHNAME template for the output type REASON.
+
+ Report an error if there is no such output type."
+ (or (get reason 'output-type)
+ (error "Unknown output type `~(~A~)'" reason)))
+
+(define-clear-the-decks reset-output-types
+ "Clear out the registered output types."
+ (dolist (reason *output-types*) (remprop reason 'output-type))
+ (setf *output-types* nil)
+ (declare-output-type :c (make-pathname :type "C" :case :common))
+ (declare-output-type :h (make-pathname :type "H" :case :common)))
+