|
rpm-build |
858c0f |
#!/usr/local/bin/clisp -C
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
;;; Creation of gnulib's uninames.h from the UnicodeData.txt table.
|
|
rpm-build |
858c0f |
;;; Bruno Haible 2000-12-28
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
(defparameter add-comments nil)
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
(defstruct unicode-char
|
|
rpm-build |
858c0f |
(index nil :type integer)
|
|
rpm-build |
858c0f |
(name nil :type string)
|
|
rpm-build |
858c0f |
word-indices
|
|
rpm-build |
858c0f |
word-indices-index
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
(defstruct range
|
|
rpm-build |
858c0f |
(index nil :type integer)
|
|
rpm-build |
858c0f |
(start-code nil :type integer)
|
|
rpm-build |
858c0f |
(end-code nil :type integer)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
(defstruct word-list
|
|
rpm-build |
858c0f |
(hashed nil :type hash-table)
|
|
rpm-build |
858c0f |
(sorted nil :type list)
|
|
rpm-build |
858c0f |
size ; number of characters total
|
|
rpm-build |
858c0f |
length ; number of words
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
(defun main (inputfile outputfile aliasfile)
|
|
rpm-build |
858c0f |
(declare (type string inputfile outputfile aliasfile))
|
|
rpm-build |
858c0f |
#+UNICODE (setq *default-file-encoding* charset:utf-8)
|
|
rpm-build |
858c0f |
(let ((all-chars '())
|
|
rpm-build |
858c0f |
(all-chars-hashed (make-hash-table :test #'equal))
|
|
rpm-build |
858c0f |
(all-aliases '())
|
|
rpm-build |
858c0f |
all-chars-and-aliases
|
|
rpm-build |
858c0f |
(all-ranges '())
|
|
rpm-build |
858c0f |
(name-index 0)
|
|
rpm-build |
858c0f |
range)
|
|
rpm-build |
858c0f |
;; Read all characters and names from the input file.
|
|
rpm-build |
858c0f |
(with-open-file (istream inputfile :direction :input)
|
|
rpm-build |
858c0f |
(loop
|
|
rpm-build |
858c0f |
(let ((line (read-line istream nil nil)))
|
|
rpm-build |
858c0f |
(unless line (return))
|
|
rpm-build |
858c0f |
(let* ((i1 (position #\; line))
|
|
rpm-build |
858c0f |
(i2 (position #\; line :start (1+ i1)))
|
|
rpm-build |
858c0f |
(code-string (subseq line 0 i1))
|
|
rpm-build |
858c0f |
(code (parse-integer code-string :radix 16))
|
|
rpm-build |
858c0f |
(name-string (subseq line (1+ i1) i2)))
|
|
rpm-build |
858c0f |
; Ignore characters whose name starts with "<".
|
|
rpm-build |
858c0f |
(unless (eql (char name-string 0) #\<)
|
|
rpm-build |
858c0f |
; Also ignore Hangul syllables; they are treated specially.
|
|
rpm-build |
858c0f |
(unless (<= #xAC00 code #xD7A3)
|
|
rpm-build |
858c0f |
; Also ignore CJK compatibility ideographs; they are treated
|
|
rpm-build |
858c0f |
; specially as well.
|
|
rpm-build |
858c0f |
(unless (or (<= #xF900 code #xFA2D) (<= #xFA30 code #xFA6A)
|
|
rpm-build |
858c0f |
(<= #xFA70 code #xFAD9) (<= #x2F800 code #x2FA1D))
|
|
rpm-build |
858c0f |
;; Also ignore variationselectors; they are treated
|
|
rpm-build |
858c0f |
;; specially as well.
|
|
rpm-build |
858c0f |
(unless (or (<= #xFE00 code #xFE0F) (<= #xE0100 code #xE01EF))
|
|
rpm-build |
858c0f |
(push (make-unicode-char :index name-index
|
|
rpm-build |
858c0f |
:name name-string)
|
|
rpm-build |
858c0f |
all-chars)
|
|
rpm-build |
858c0f |
(setf (gethash code all-chars-hashed) (car all-chars))
|
|
rpm-build |
858c0f |
;; Update the contiguous range, or start a new range.
|
|
rpm-build |
858c0f |
(if (and range (= (1+ (range-end-code range)) code))
|
|
rpm-build |
858c0f |
(setf (range-end-code range) code)
|
|
rpm-build |
858c0f |
(progn
|
|
rpm-build |
858c0f |
(when range
|
|
rpm-build |
858c0f |
(push range all-ranges))
|
|
rpm-build |
858c0f |
(setq range (make-range :index name-index
|
|
rpm-build |
858c0f |
:start-code code
|
|
rpm-build |
858c0f |
:end-code code))))
|
|
rpm-build |
858c0f |
(incf name-index)
|
|
rpm-build |
858c0f |
(setq last-code code)
|
|
rpm-build |
858c0f |
) ) ) )
|
|
rpm-build |
858c0f |
) ) ) )
|
|
rpm-build |
858c0f |
(setq all-chars (nreverse all-chars))
|
|
rpm-build |
858c0f |
(if range
|
|
rpm-build |
858c0f |
(push range all-ranges))
|
|
rpm-build |
858c0f |
(setq all-ranges (nreverse all-ranges))
|
|
rpm-build |
858c0f |
(when aliasfile
|
|
rpm-build |
858c0f |
;; Read all characters and names from the alias file.
|
|
rpm-build |
858c0f |
(with-open-file (istream aliasfile :direction :input)
|
|
rpm-build |
858c0f |
(loop
|
|
rpm-build |
858c0f |
(let ((line (read-line istream nil nil)))
|
|
rpm-build |
858c0f |
(unless line (return))
|
|
rpm-build |
858c0f |
(let* ((i1 (position #\; line))
|
|
rpm-build |
858c0f |
(i2 (position #\; line :start (1+ i1)))
|
|
rpm-build |
858c0f |
(code-string (subseq line 0 i1))
|
|
rpm-build |
858c0f |
(code (parse-integer code-string :radix 16))
|
|
rpm-build |
858c0f |
(name-string (subseq line (1+ i1) i2))
|
|
rpm-build |
858c0f |
(uc (gethash code all-chars-hashed)))
|
|
rpm-build |
858c0f |
(when uc
|
|
rpm-build |
858c0f |
(push (make-unicode-char :index (unicode-char-index uc)
|
|
rpm-build |
858c0f |
:name name-string)
|
|
rpm-build |
858c0f |
all-aliases)
|
|
rpm-build |
858c0f |
) ) ) ) ) )
|
|
rpm-build |
858c0f |
(setq all-aliases (nreverse all-aliases)
|
|
rpm-build |
858c0f |
all-chars-and-aliases (append all-chars all-aliases))
|
|
rpm-build |
858c0f |
;; Split into words.
|
|
rpm-build |
858c0f |
(let ((words-by-length (make-array 0 :adjustable t)))
|
|
rpm-build |
858c0f |
(dolist (name (list* "HANGUL SYLLABLE" "CJK COMPATIBILITY" "VARIATION"
|
|
rpm-build |
858c0f |
(mapcar #'unicode-char-name all-chars-and-aliases)))
|
|
rpm-build |
858c0f |
(let ((i1 0))
|
|
rpm-build |
858c0f |
(loop
|
|
rpm-build |
858c0f |
(when (>= i1 (length name)) (return))
|
|
rpm-build |
858c0f |
(let ((i2 (or (position #\Space name :start i1) (length name))))
|
|
rpm-build |
858c0f |
(let* ((word (subseq name i1 i2))
|
|
rpm-build |
858c0f |
(len (length word)))
|
|
rpm-build |
858c0f |
(when (>= len (length words-by-length))
|
|
rpm-build |
858c0f |
(adjust-array words-by-length (1+ len))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(unless (aref words-by-length len)
|
|
rpm-build |
858c0f |
(setf (aref words-by-length len)
|
|
rpm-build |
858c0f |
(make-word-list
|
|
rpm-build |
858c0f |
:hashed (make-hash-table :test #'equal)
|
|
rpm-build |
858c0f |
:sorted '()
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(unless (gethash word (word-list-hashed word-list))
|
|
rpm-build |
858c0f |
(setf (gethash word (word-list-hashed word-list)) t)
|
|
rpm-build |
858c0f |
(push word (word-list-sorted word-list))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(setq i1 (1+ i2))
|
|
rpm-build |
858c0f |
) ) ) )
|
|
rpm-build |
858c0f |
;; Sort the word lists.
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(unless (aref words-by-length len)
|
|
rpm-build |
858c0f |
(setf (aref words-by-length len)
|
|
rpm-build |
858c0f |
(make-word-list
|
|
rpm-build |
858c0f |
:hashed (make-hash-table :test #'equal)
|
|
rpm-build |
858c0f |
:sorted '()
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(setf (word-list-sorted word-list)
|
|
rpm-build |
858c0f |
(sort (word-list-sorted word-list) #'string<)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(setf (word-list-size word-list)
|
|
rpm-build |
858c0f |
(reduce #'+ (mapcar #'length (word-list-sorted word-list)))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(setf (word-list-length word-list)
|
|
rpm-build |
858c0f |
(length (word-list-sorted word-list))
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
;; Output the tables.
|
|
rpm-build |
858c0f |
(with-open-file (ostream outputfile :direction :output
|
|
rpm-build |
858c0f |
#+UNICODE :external-format #+UNICODE charset:ascii)
|
|
rpm-build |
858c0f |
(format ostream "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */~%")
|
|
rpm-build |
858c0f |
(format ostream "/*~%")
|
|
rpm-build |
858c0f |
(format ostream " * ~A~%" (file-namestring outputfile))
|
|
rpm-build |
858c0f |
(format ostream " *~%")
|
|
rpm-build |
858c0f |
(format ostream " * Unicode character name table.~%")
|
|
rpm-build |
858c0f |
(format ostream " * Generated automatically by the gen-uninames utility.~%")
|
|
rpm-build |
858c0f |
(format ostream " */~%")
|
|
rpm-build |
858c0f |
(format ostream "~%")
|
|
rpm-build |
858c0f |
(format ostream "static const char unicode_name_words[~D] = {~%"
|
|
rpm-build |
858c0f |
(let ((sum 0))
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(incf sum (word-list-size word-list))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
sum
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(dolist (word (word-list-sorted word-list))
|
|
rpm-build |
858c0f |
(format ostream " ~{ '~C',~}~%" (coerce word 'list))
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
(format ostream "#define UNICODE_CHARNAME_NUM_WORDS ~D~%"
|
|
rpm-build |
858c0f |
(let ((sum 0))
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(incf sum (word-list-length word-list))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
sum
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
#| ; Redundant data
|
|
rpm-build |
858c0f |
(format ostream "static const uint16_t unicode_name_word_offsets[~D] = {~%"
|
|
rpm-build |
858c0f |
(let ((sum 0))
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(incf sum (word-list-length word-list))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
sum
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(when (word-list-sorted word-list)
|
|
rpm-build |
858c0f |
(format ostream " ")
|
|
rpm-build |
858c0f |
(do ((l (word-list-sorted word-list) (cdr l))
|
|
rpm-build |
858c0f |
(offset 0 (+ offset (length (car l)))))
|
|
rpm-build |
858c0f |
((endp l))
|
|
rpm-build |
858c0f |
(format ostream "~<~% ~0,79:; ~D,~>" offset)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "~%")
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
|#
|
|
rpm-build |
858c0f |
(format ostream "static const struct { uint32_t extra_offset; uint16_t ind_offset; } unicode_name_by_length[~D] = {~%"
|
|
rpm-build |
858c0f |
(1+ (length words-by-length))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(let ((extra-offset 0)
|
|
rpm-build |
858c0f |
(ind-offset 0))
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(format ostream " { ~D, ~D },~%" extra-offset ind-offset)
|
|
rpm-build |
858c0f |
(incf extra-offset (word-list-size word-list))
|
|
rpm-build |
858c0f |
(incf ind-offset (word-list-length word-list))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
(format ostream " { ~D, ~D }~%" extra-offset ind-offset)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
(let ((ind-offset 0))
|
|
rpm-build |
858c0f |
(dotimes (len (length words-by-length))
|
|
rpm-build |
858c0f |
(let ((word-list (aref words-by-length len)))
|
|
rpm-build |
858c0f |
(dolist (word (word-list-sorted word-list))
|
|
rpm-build |
858c0f |
(setf (gethash word (word-list-hashed word-list)) ind-offset)
|
|
rpm-build |
858c0f |
(incf ind-offset)
|
|
rpm-build |
858c0f |
) ) ) )
|
|
rpm-build |
858c0f |
(dolist (word '("HANGUL" "SYLLABLE" "CJK" "COMPATIBILITY" "VARIATION"))
|
|
rpm-build |
858c0f |
(format ostream "#define UNICODE_CHARNAME_WORD_~A ~D~%" word
|
|
rpm-build |
858c0f |
(gethash word (word-list-hashed (aref words-by-length (length word))))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
;; Compute the word-indices for every unicode-char.
|
|
rpm-build |
858c0f |
(dolist (uc all-chars-and-aliases)
|
|
rpm-build |
858c0f |
(let ((name (unicode-char-name uc))
|
|
rpm-build |
858c0f |
(indices '()))
|
|
rpm-build |
858c0f |
(let ((i1 0))
|
|
rpm-build |
858c0f |
(loop
|
|
rpm-build |
858c0f |
(when (>= i1 (length name)) (return))
|
|
rpm-build |
858c0f |
(let ((i2 (or (position #\Space name :start i1) (length name))))
|
|
rpm-build |
858c0f |
(let* ((word (subseq name i1 i2))
|
|
rpm-build |
858c0f |
(len (length word)))
|
|
rpm-build |
858c0f |
(push (gethash word (word-list-hashed (aref words-by-length len)))
|
|
rpm-build |
858c0f |
indices
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(setq i1 (1+ i2))
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
(setf (unicode-char-word-indices uc)
|
|
rpm-build |
858c0f |
(coerce (nreverse indices) 'vector)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
;; Sort the list of unicode-chars by word-indices.
|
|
rpm-build |
858c0f |
(setq all-chars-and-aliases
|
|
rpm-build |
858c0f |
(sort all-chars-and-aliases
|
|
rpm-build |
858c0f |
(lambda (vec1 vec2)
|
|
rpm-build |
858c0f |
(let ((len1 (length vec1))
|
|
rpm-build |
858c0f |
(len2 (length vec2)))
|
|
rpm-build |
858c0f |
(do ((i 0 (1+ i)))
|
|
rpm-build |
858c0f |
(nil)
|
|
rpm-build |
858c0f |
(if (< i len2)
|
|
rpm-build |
858c0f |
(if (< i len1)
|
|
rpm-build |
858c0f |
(cond ((< (aref vec1 i) (aref vec2 i)) (return t))
|
|
rpm-build |
858c0f |
((> (aref vec1 i) (aref vec2 i)) (return nil))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(return t)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(return nil)
|
|
rpm-build |
858c0f |
) ) ) )
|
|
rpm-build |
858c0f |
:key #'unicode-char-word-indices
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
;; Output the word-indices.
|
|
rpm-build |
858c0f |
(format ostream "static const uint16_t unicode_names[~D] = {~%"
|
|
rpm-build |
858c0f |
(reduce #'+ (mapcar (lambda (uc) (length (unicode-char-word-indices uc))) all-chars-and-aliases))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(let ((i 0))
|
|
rpm-build |
858c0f |
(dolist (uc all-chars-and-aliases)
|
|
rpm-build |
858c0f |
(format ostream " ~{ ~D,~}"
|
|
rpm-build |
858c0f |
(maplist (lambda (r) (+ (* 2 (car r)) (if (cdr r) 1 0)))
|
|
rpm-build |
858c0f |
(coerce (unicode-char-word-indices uc) 'list)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(when add-comments
|
|
rpm-build |
858c0f |
(format ostream "~40T/* ~A */" (unicode-char-name uc))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "~%")
|
|
rpm-build |
858c0f |
(setf (unicode-char-word-indices-index uc) i)
|
|
rpm-build |
858c0f |
(incf i (length (unicode-char-word-indices uc)))
|
|
rpm-build |
858c0f |
) )
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
(format ostream "static const struct { uint16_t index; uint32_t name:24; }~%")
|
|
rpm-build |
858c0f |
(format ostream "#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)~%__attribute__((__packed__))~%#endif~%")
|
|
rpm-build |
858c0f |
(format ostream "unicode_name_to_index[~D] = {~%"
|
|
rpm-build |
858c0f |
(length all-chars-and-aliases)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(dolist (uc all-chars-and-aliases)
|
|
rpm-build |
858c0f |
(format ostream " { 0x~4,'0X, ~D },"
|
|
rpm-build |
858c0f |
(unicode-char-index uc)
|
|
rpm-build |
858c0f |
(unicode-char-word-indices-index uc)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(when add-comments
|
|
rpm-build |
858c0f |
(format ostream "~21T/* ~A */" (unicode-char-name uc))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "~%")
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
(format ostream "static const struct { uint16_t index; uint32_t name:24; }~%")
|
|
rpm-build |
858c0f |
(format ostream "#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)~%__attribute__((__packed__))~%#endif~%")
|
|
rpm-build |
858c0f |
(format ostream "unicode_index_to_name[~D] = {~%"
|
|
rpm-build |
858c0f |
(length all-chars)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(dolist (uc (sort (copy-list all-chars) #'< :key #'unicode-char-index))
|
|
rpm-build |
858c0f |
(format ostream " { 0x~4,'0X, ~D },"
|
|
rpm-build |
858c0f |
(unicode-char-index uc)
|
|
rpm-build |
858c0f |
(unicode-char-word-indices-index uc)
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(when add-comments
|
|
rpm-build |
858c0f |
(format ostream "~21T/* ~A */" (unicode-char-name uc))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "~%")
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
(format ostream "#define UNICODE_CHARNAME_MAX_LENGTH ~D~%"
|
|
rpm-build |
858c0f |
(reduce #'max (mapcar (lambda (uc) (length (unicode-char-name uc))) all-chars-and-aliases))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "#define UNICODE_CHARNAME_MAX_WORDS ~D~%"
|
|
rpm-build |
858c0f |
(reduce #'max (mapcar (lambda (uc) (length (unicode-char-word-indices uc))) all-chars-and-aliases))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "static const struct { uint16_t index; uint32_t gap; uint16_t length; } unicode_ranges[~D] = {~%"
|
|
rpm-build |
858c0f |
(length all-ranges))
|
|
rpm-build |
858c0f |
(dolist (range all-ranges)
|
|
rpm-build |
858c0f |
(format ostream " { ~D, ~D, ~D },~%"
|
|
rpm-build |
858c0f |
(range-index range)
|
|
rpm-build |
858c0f |
(- (range-start-code range) (range-index range))
|
|
rpm-build |
858c0f |
(1+ (- (range-end-code range) (range-start-code range))))
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
(format ostream "};~%")
|
|
rpm-build |
858c0f |
)
|
|
rpm-build |
858c0f |
) ) )
|
|
rpm-build |
858c0f |
|
|
rpm-build |
858c0f |
(main (first *args*) (second *args*) (third *args*))
|