--- /dev/null
+#
+# Makefile for TOMOYO-tools.
+#
+
+PACKAGE = tomoyo
+API = 1.14
+RELEASE = 3
+
+FLIM_API= 1.14
+
+TAR = tar
+RM = /bin/rm -f
+CP = /bin/cp -p
+
+EMACS = emacs
+XEMACS = xemacs
+FLAGS = -batch -q -no-site-file -l TOMOYO-MK
+
+PREFIX = NONE
+LISPDIR = NONE
+PACKAGEDIR = NONE
+VERSION_SPECIFIC_LISPDIR = NONE
+
+GOMI = *.elc
+
+VERSION = $(API).$(RELEASE)
+ARC_DIR = /home/tomo/public_html/comp/emacsen/lisp/tomoyo/tomoyo-$(API)-for-flim-$(FLIM_API)
+
+
+elc: package
+
+install-elc: install-package
+
+install: install-elc
+
+
+package:
+ $(XEMACS) $(FLAGS) -f compile-tomoyo-package $(PACKAGEDIR)
+
+install-package: package
+ $(XEMACS) $(FLAGS) -f install-tomoyo-package $(PACKAGEDIR)
+
+
+clean:
+ -$(RM) $(GOMI)
+
+
+tar:
+ cvs commit
+ sh -c 'cvs tag -R $(PACKAGE)-`echo $(VERSION) | tr . _`; \
+ cd /tmp; \
+ cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root \
+ export -d $(PACKAGE)-$(VERSION) \
+ -r $(PACKAGE)-`echo $(VERSION) | tr . _` \
+ tomoyo'
+ $(RM) /tmp/$(PACKAGE)-$(VERSION)/ftp.in
+ cd /tmp; $(TAR) cvzf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
+ cd /tmp; $(RM) -r $(PACKAGE)-$(VERSION)
+ sed "s/VERSION/$(VERSION)/" < ftp.in | sed "s/API/$(API)/" \
+ | sed "s/PACKAGE/$(PACKAGE)/" \
+ | sed "s/FLIM_API/$(FLIM_API)/" > ftp
+
+release:
+ -$(RM) $(ARC_DIR)/$(PACKAGE)-$(VERSION).tar.gz
+ mv /tmp/$(PACKAGE)-$(VERSION).tar.gz $(ARC_DIR)
--- /dev/null
+;;; -*-Emacs-Lisp-*-
+
+;; TOMOYO-CFG: installation setting about TOMOYO.
+
+;;; Code:
+
+(require 'install)
+
+
+;;; @ Please specify prefix of install directory.
+;;;
+
+;; Please specify TOMOYO prefix [optional]
+(setq TOMOYO_PREFIX "tomoyo-tools")
+
+
+\f
+
+;;; @ optional settings
+;;;
+
+(defvar PACKAGEDIR
+ (if (boundp 'early-packages)
+ (let ((dirs (append (if early-package-load-path
+ early-packages)
+ (if late-package-load-path
+ late-packages)
+ (if last-package-load-path
+ last-packages)))
+ dir)
+ (while (not (file-exists-p
+ (setq dir (car dirs))))
+ (setq dirs (cdr dirs)))
+ dir)))
+
+;;; TOMOYO-CFG ends here
--- /dev/null
+;;; -*-Emacs-Lisp-*-
+
+;; TOMOYO-ELS: list of TOMOYO modules to install
+
+;;; Code:
+
+(setq tomoyo-modules-to-compile
+ '(csv idc-util))
+
+(setq tomoyo-modules-not-to-compile nil)
+
+(setq tomoyo-modules (append tomoyo-modules-to-compile
+ tomoyo-modules-not-to-compile))
+
+;;; TOMOYO-ELS ends here
--- /dev/null
+;;; -*-Emacs-Lisp-*-
+
+;; TOMOYO-MK: installer for TOMOYO.
+
+;;; Code:
+
+(defun config-tomoyo-package ()
+ (let (package-dir)
+ (and (setq package-dir (car command-line-args-left))
+ (or (string= "NONE" package-dir)
+ (defvar PACKAGEDIR package-dir)
+ ))
+ (setq command-line-args-left (cdr command-line-args-left))
+ (load-file "TOMOYO-CFG")
+ (load-file "TOMOYO-ELS")
+
+ (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))
+ ))
+
+(defun compile-tomoyo-package ()
+ (config-tomoyo-package)
+
+ (setq autoload-package-name "tomoyo")
+ (add-to-list 'command-line-args-left ".")
+ (batch-update-directory)
+
+ (add-to-list 'command-line-args-left ".")
+ (Custom-make-dependencies)
+
+ (compile-elisp-modules (append tomoyo-modules-to-compile
+ '(auto-autoloads custom-load))
+ ".")
+ )
+
+(defun install-tomoyo-package ()
+ (config-tomoyo-package)
+ (install-elisp-modules (append tomoyo-modules
+ '(auto-autoloads custom-load))
+ "./"
+ (expand-file-name TOMOYO_PREFIX
+ (expand-file-name "lisp"
+ PACKAGEDIR)))
+ (delete-file "./auto-autoloads.el")
+ (delete-file "./custom-load.el")
+ )
+
+;;; TOMOYO-MK ends here
--- /dev/null
+;;; csv.el --- Parser and utility for CSV (Comma Separated Value).
+
+;; Copyright (C) 2001 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+;; Keywords: CSV, table, database
+
+;; This file is a part of Tomoyo Utilities.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(defun csv-parse-quoted-string (string)
+ (let ((len (length string))
+ (i 1))
+ (when (and (>= len 2)
+ (eq (aref string 0) ?\"))
+ (setq len (1- len))
+ (while (and (< i len)
+ (not (eq (aref string i) ?\")))
+ (setq i (1+ i)))
+ (when (eq (aref string i) ?\")
+ (cons (substring string 1 i)
+ (substring string (1+ i)))))))
+
+(defun csv-parse-atom (string)
+ (let ((len (length string))
+ (i 0))
+ (if (= len 0)
+ '("")
+ (when (not (eq (aref string 0) ?\"))
+ (while (and (< i len)
+ (not (eq (aref string i) ?,))
+ (not (eq (aref string i) ?\")))
+ (setq i (1+ i)))
+ (cons (substring string 0 i)
+ (substring string i))))))
+
+(defun csv-parse-separator (string)
+ (let ((len (length string)))
+ (when (and (>= len 1)
+ (eq (aref string 0) ?,))
+ (cons (substring string 0 1)
+ (substring string 1)))))
+
+(defun csv-parse-string* (string)
+ (let (ret dest)
+ (while (and string
+ (prog1
+ (setq ret (or (csv-parse-quoted-string string)
+ (csv-parse-atom string)))
+ (setq string (cdr ret)))
+ (setq dest (cons (car ret) dest))
+ (setq ret (csv-parse-separator string)))
+ (setq string (cdr ret)))
+ (cons (nreverse dest)
+ (if (> (length string) 0)
+ string))))
+
+(defun csv-parse-string (string)
+ (let (ret dest)
+ (while (and string
+ (prog1
+ (setq ret (or (csv-parse-quoted-string string)
+ (csv-parse-atom string)))
+ (setq string (cdr ret)))
+ (setq dest (cons (car ret) dest))
+ (setq ret (csv-parse-separator string)))
+ (setq string (cdr ret)))
+ (if (> (length string) 0)
+ nil
+ (nreverse dest))))
+
+
+;;; @ End.
+;;;
+
+(provide 'csv)
+
+;;; csv.el ends here
--- /dev/null
+;;; idc-util.el --- Utilities about ideographic-structure property
+
+;; Copyright (C) 2001 MORIOKA Tomohiko
+
+;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+;; Keywords: ideographic-structure, UTF-2000, database
+
+;; This file is a part of Tomoyo Utilities.
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(defun ideographic-structure-convert-to-ucs (structure)
+ (let (dest cell ucs ret)
+ (while structure
+ (setq cell (car structure))
+ (setq dest
+ (cons
+ (cond ((characterp cell)
+ (if (or (get-char-attribute cell 'ucs)
+ (null
+ (setq ucs
+ (or (get-char-attribute cell '=>ucs)
+ (get-char-attribute cell '->ucs)))))
+ cell
+ (decode-char 'ucs ucs)))
+ ((and (consp cell)
+ (symbolp (car cell)))
+ cell)
+ ((setq ret (find-char cell))
+ (if (or (get-char-attribute ret 'ucs)
+ (null
+ (setq ucs
+ (or (get-char-attribute ret '=>ucs)
+ (get-char-attribute ret '->ucs)))))
+ cell
+ (decode-char 'ucs ucs)))
+ ((setq ret (assq 'ideographic-structure cell))
+ (put-alist 'ideographic-structure
+ (ideographic-structure-convert-to-ucs
+ (cdr ret))
+ (copy-alist cell)))
+ (t cell))
+ dest))
+ (setq structure (cdr structure)))
+ (nreverse dest)))
+
+(defvar morohashi-char-replace-alist
+ (list
+ (cons (decode-char 'chinese-big5-cdp #x8B42)
+ (decode-char 'chinese-big5-cdp #x8B42))
+ (cons (decode-char 'chinese-big5-cdp #x8AFC)
+ (decode-char 'chinese-big5-cdp #x8AFC))
+ (cons (decode-char 'ucs #x2EBE)
+ (decode-char 'ucs #x2EBF))
+ (cons (decode-char 'ucs #x5922)
+ (decode-char 'ideograph-daikanwa 05802))
+ (cons (decode-char 'ucs #x656C)
+ (decode-char 'ideograph-daikanwa 13303))
+ (cons (decode-char 'ucs #x8449)
+ (decode-char 'ideograph-daikanwa 31387))
+ (cons (decode-char 'ucs #x2EA4)
+ (decode-char 'ucs #x722B))
+ (cons (decode-char 'ucs #x5151)
+ (decode-char 'ideograph-daikanwa 01356))
+ (cons (decode-char 'ucs #x544A)
+ (decode-char 'ideograph-daikanwa 03381))
+ (cons (decode-char 'ucs #x5F66)
+ (decode-char 'ideograph-daikanwa 09980))
+ (cons (decode-char 'ucs #x8005)
+ (decode-char 'ideograph-daikanwa 28853))
+ (cons (decode-char 'ucs #x82E5)
+ (decode-char 'ideograph-daikanwa 30796))
+ (cons (decode-char 'ucs #x82F1)
+ (decode-char 'ideograph-daikanwa 30808))
+ (cons (decode-char 'ucs #x9063)
+ (decode-char 'ideograph-daikanwa 39052))
+ (cons (decode-char 'ucs #x4EA0)
+ (decode-char 'chinese-big5-cdp #x8B42))
+ (cons (decode-char 'ucs #x5154)
+ (decode-char 'ideograph-daikanwa 01368))
+ (cons (decode-char 'ucs #x53CA)
+ (decode-char 'ideograph-daikanwa 03118))
+ (cons (decode-char 'ucs #x5468)
+ (decode-char 'ideograph-daikanwa 03441))
+ (cons (decode-char 'ucs #x5C1A)
+ (decode-char 'ucs #x5C19))
+ (cons (decode-char 'ucs #x5D29)
+ (decode-char 'ideograph-daikanwa 08212))
+ (cons (decode-char 'ucs #x670B)
+ (decode-char 'ideograph-daikanwa 14340))
+ (cons (decode-char 'ucs #x7FBD)
+ (decode-char 'ideograph-daikanwa 28614))
+ (cons (decode-char 'ucs #x8096)
+ (decode-char 'ideograph-daikanwa 29263))
+ (cons (decode-char 'ucs #x8981)
+ (decode-char 'ideograph-daikanwa 34768))
+ (cons (decode-char 'ucs #x8AF8)
+ (decode-char 'ideograph-daikanwa 35743))
+ (cons (decode-char 'ucs #x9023)
+ (decode-char 'ideograph-daikanwa 38902))
+ (cons (decode-char 'ucs #x9752)
+ (decode-char 'ucs #x9751))
+ ))
+
+(defun ideographic-structure-convert-to-daikanwa (structure)
+ (let (dest cell morohashi ret)
+ (while structure
+ (setq cell (car structure))
+ (setq dest
+ (cons
+ (cond ((characterp cell)
+ (cond ((setq ret
+ (assq cell morohashi-char-replace-alist))
+ (cdr ret))
+ ((get-char-attribute cell 'ideograph-daikanwa)
+ cell)
+ ((setq morohashi
+ (get-char-attribute
+ cell 'morohashi-daikanwa))
+ (cond ((null (cdr (cdr morohashi)))
+ cell)
+ ((= (nth 1 morohashi) 0)
+ (decode-char 'ideograph-daikanwa
+ (car morohashi)))
+ (t
+ (setq morohashi (list (car morohashi)
+ (nth 1 morohashi)))
+ (or (map-char-attribute
+ (lambda (char val)
+ (if (equal morohashi val)
+ char))
+ 'morohashi-daikanwa)
+ cell))))
+ (t
+ cell)))
+ ((and (consp cell)
+ (symbolp (car cell)))
+ cell)
+ ((setq ret (find-char cell))
+ (if (or (get-char-attribute ret 'ideograph-daikanwa)
+ (null
+ (setq morohashi
+ (get-char-attribute
+ ret 'morohashi-daikanwa)))
+ (null (cdr (cdr morohashi))))
+ cell
+ (if (= (nth 1 morohashi) 0)
+ (decode-char 'ideograph-daikanwa (car morohashi))
+ cell)))
+ ((setq ret (assq 'ideographic-structure cell))
+ (put-alist 'ideographic-structure
+ (ideographic-structure-convert-to-daikanwa
+ (cdr ret))
+ (copy-alist cell)))
+ (t cell))
+ dest))
+ (setq structure (cdr structure)))
+ (nreverse dest)))
+
+
+;;; @ End.
+;;;
+
+(provide 'idc-util)
+
+;;; idc-util.el ends here