From: handa Date: Thu, 24 Jul 2003 13:07:08 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: XML-base~118 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cce6d2787df1b2fcbeb916b3e37a0096549f3775;p=m17n%2Fm17n-docs.git *** empty log message *** --- diff --git a/Makefile.am b/Makefile.am index d9cab2c..fe9797d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,45 +26,75 @@ pkgdata_DATA = \ usr/html/index.html \ - usr/man3m/m17nIntro.3m \ - usr/latex/m17n-lib.dvi usr/latex/m17n-lib.ps + usr/latex/m17n-lib.dvi usr/latex/m17n-lib.ps \ + man/man1/m17nconfig.1 \ + man/man3/m17nIntro.3m17n \ + man/man5/m17nDatabaseFormat.5 pkgdatadir = $(datadir)/m17n-lib -EXTRA_DIST = usr/html usr/man3m usr/latex/m17n-lib.dvi usr/latex/m17n-lib.ps +EXTRA_DIST = usr/html usr/latex/m17n-lib.dvi usr/latex/m17n-lib.ps \ + man/man1 man/man3 man/man5 install-pkgdataDATA: $(pkgdata_DATA) - $(mkinstalldirs) $(pkgdatadir)/html $(mandir)/man3m + $(mkinstalldirs) $(pkgdatadir)/html + $(mkinstalldirs) $(mandir)/man1 $(mandir)/man3 $(mandir)/man5 $(INSTALL_DATA) usr/latex/m17n-lib.dvi $(pkgdatadir)/m17n-lib.dvi $(INSTALL_DATA) usr/latex/m17n-lib.ps $(pkgdatadir)/m17n-lib.ps cd usr/html; \ for f in *.html; do $(INSTALL_DATA) $$f $(pkgdatadir)/html/$$f; done - cd usr/man3m; \ - for f in *.3m; do $(INSTALL_DATA) $$f $(mandir)/man3m/$$f; done + cd usr/html; \ + for f in *.png; do $(INSTALL_DATA) $$f $(pkgdatadir)/html/$$f; done + cd man/man1; \ + for f in *.1; do $(INSTALL_DATA) $$f $(mandir)/man1/$$f; done + cd man/man3; \ + for f in *.3m17n; do $(INSTALL_DATA) $$f $(mandir)/man3/$$f; done + cd man/man5; \ + for f in *.5; do $(INSTALL_DATA) $$f $(mandir)/man5/$$f; done # # The followings are for maintainers only. # if MAINTAINER_MODE -SRCFILES = $(shell echo @M17NLIB@/src/*.[ch] @M17NLIB@/example/README.txt) - PROJECT_NAME_EN = "The M17N Library" PROJECT_NAME_JA = "M17N ¿¸À¸ì¥é¥¤¥Ö¥é¥ê" PROJECT_VERSION = @PACKAGE_VERSION@ DOXYGEN = doxygen -usr-html html-usr: usr/html/index.html usr/html/parrot.gif -ja-html html-ja: ja/html/index.html ja/html/parrot.gif -dev-html html-dev: dev/html/index.html dev/html/parrot.gif +SRC_MAN1 = \ + data/m17n-config.txt \ + data/mconv.txt \ + data/mview.txt \ + data/mdate.txt \ + data/mdump.txt \ + data/medit.txt + +SRC_MAN3 = \ + @M17NLIB@/src/m17n-core.h \ + @M17NLIB@/src/m17n.h \ + @M17NLIB@/src/m17n-gui.h \ + @M17NLIB@/src/m17n-X.h \ + @M17NLIB@/src/m17n-err.h \ + @M17NLIB@/src + +SRC_MAN5 = \ + data/dbformat.txt + +SRC_ALL = \ + data/mainpage.txt ${SRC_MAN3} ${SRC_MAN1} ${SRC_MAN5} + +usr-html html-usr: usr/html/index.html usr/html/parrot.png +ja-html html-ja: ja/html/index.html ja/html/parrot.png +dev-html html-dev: dev/html/index.html dev/html/parrot.png usr-latex latex-usr: usr/latex/m17n-lib.ps ja-latex latex-ja: ja/latex/m17n-lib.ps dev-latex latex-dev: dev/latex/m17n-lib.ps -usr-man man-usr: usr/man3m/m17nIntro.3m -ja-man man-ja: ja/man3m/m17nIntro.3m +usr-man man-usr: man/man1/m17n-config.1 man/man3/m17nIntro.3m17n man/man5/m17nDatabaseFormat.5 +ja-man man-ja: ja/man3/m17nIntro.3m usr: html-usr latex-usr man-usr ja: html-ja latex-ja @@ -72,7 +102,7 @@ dev: html-dev latex-dev doxyfile-html: doxyfile sed -e 's|%PROJECT_NUMBER%|@PACKAGE_VERSION@|' \ - -e 's|%M17NLIB%|@M17NLIB@|' \ + -e 's|%INPUT%|${SRC_ALL}|' \ -e 's|%GENERATE_HTML%|YES|' \ -e 's|%GENERATE_LATEX%|NO|' \ -e 's|%GENERATE_MAN%|NO|' \ @@ -98,7 +128,7 @@ doxyfile-html.ja: doxyfile-html doxyfile-latex: doxyfile sed -e 's|%PROJECT_NUMBER%|@PACKAGE_VERSION@|' \ - -e 's|%M17NLIB%|@M17NLIB@|' \ + -e 's|%INPUT%|${SRC_ALL}|' \ -e 's|%GENERATE_HTML%|NO|' \ -e 's|%GENERATE_LATEX%|YES|' \ -e 's|%GENERATE_MAN%|NO|' \ @@ -122,32 +152,59 @@ doxyfile-latex.ja: doxyfile-latex -e 's/%OUTPUT_LANGUAGE%/Japanese/' \ < $< >$@ -doxyfile-man: doxyfile +doxyfile-man1: doxyfile + sed -e 's|%PROJECT_NUMBER%|@PACKAGE_VERSION@|' \ + -e 's|%INPUT%|${SRC_MAN1}|' \ + -e 's|%GENERATE_HTML%|NO|' \ + -e 's|%GENERATE_LATEX%|NO|' \ + -e 's|%GENERATE_MAN%|YES|' \ + -e 's|%MAN_EXTENSION%|.1|' \ + < $< >$@ + +doxyfile-man3: doxyfile + sed -e 's|%PROJECT_NUMBER%|@PACKAGE_VERSION@|' \ + -e 's|%INPUT%|${SRC_MAN3}|' \ + -e 's|%GENERATE_HTML%|NO|' \ + -e 's|%GENERATE_LATEX%|NO|' \ + -e 's|%GENERATE_MAN%|YES|' \ + -e 's|%MAN_EXTENSION%|.3m17n|' \ + < $< >$@ + +doxyfile-man5: doxyfile sed -e 's|%PROJECT_NUMBER%|@PACKAGE_VERSION@|' \ - -e 's|%M17NLIB%|@M17NLIB@|' \ + -e 's|%INPUT%|${SRC_MAN5}|' \ -e 's|%GENERATE_HTML%|NO|' \ -e 's|%GENERATE_LATEX%|NO|' \ -e 's|%GENERATE_MAN%|YES|' \ + -e 's|%MAN_EXTENSION%|.5|' \ < $< >$@ -doxyfile-man.usr: doxyfile-man +doxyfile-man%.usr: doxyfile-man% sed -e 's|%PROJECT_NAME%|${PROJECT_NAME_EN}|' \ -e 's/%USR_JA_DEV%/usr/g' \ -e 's/%OUTPUT_LANGUAGE%/English/' \ < $< >$@ -%/html/index.html: doxyfile-html.% ${SRCFILES} \ +data/mainpage.txt: + +data/dbformat.txt: + +data/m17n-config.txt: @M17NLIB@/m17n-config.in + sed -n -e '/BEG-DOXYGEN/,/END-DOXYGEN/ p' < $< > $@ + +data/%.txt: @M17NLIB@/example/%.c + sed -n -e '/BEG-DOXYGEN/,/END-DOXYGEN/ p' < $< > $@ + +%/html/index.html: doxyfile-html.% ${SRC_ALL} \ header.html footer.html \ - data-%/mainpage.txt data-%/dbformat.txt \ utils/%_filter.rb m17n-lib.css rm -rf `dirname $@` ${DOXYGEN} $< -%/html/parrot.gif: parrot.gif +%/html/parrot.png: parrot.png cp $< $@ -%/latex/refman.tex: doxyfile-latex.% ${SRCFILES} data-%/mainpage.txt data-%/dbformat.txt \ - utils/%_filter.rb +%/latex/refman.tex: doxyfile-latex.% ${SRC_ALL} utils/%_filter.rb rm -rf `dirname $@` ${DOXYGEN} $< @@ -164,11 +221,21 @@ doxyfile-man.usr: doxyfile-man %/latex/m17n-lib.pdf: %/latex/m17n-lib.tex data-%/m17n-lib.sty utils/latex.sh utils/latex.sh `dirname $@` pdflatex -%/man/man3/m17nIntro.3m: doxyfile-man.% ${SRCFILES} utils/%_filter.rb +%/man/man1/m17n-config.1: doxyfile-man1.% ${SRC_MAN1} utils/%_filter.rb + rm -rf `dirname $@` + ${DOXYGEN} $< + +%/man/man3/m17nIntro.3m17n: doxyfile-man3.% ${SRC_MAN3} utils/%_filter.rb + rm -rf `dirname $@` + ${DOXYGEN} $< + +%/man/man5/m17nDatabaseFormat.5: doxyfile-man5.% ${SRC_MAN5} utils/%_filter.rb rm -rf `dirname $@` ${DOXYGEN} $< -usr/man3m/%.3m: usr/man/man3/%.3m sample.c utils/mkman.rb +sample/man3/SampleGroup.3: sample.c + [ -d sample ] || mkdir sample + [ -d sample/man3 ] || mkdir sample/man3 -${DOXYGEN} -g doxytemp echo "INPUT = sample.c" >> doxytemp echo "GENERATE_LATEX = NO" >> doxytemp @@ -177,10 +244,22 @@ usr/man3m/%.3m: usr/man/man3/%.3m sample.c utils/mkman.rb echo "MAN_OUTPUT = sample" >> doxytemp echo "OPTIMIZE_OUTPUT_FOR_C = yes" >> doxytemp ${DOXYGEN} doxytemp - [ -d usr/man3m ] || mkdir -p usr/man3m - rm -rf usr/man3m/index.* - ruby utils/mkman.rb usr - rm -rf doxytemp sample + rm -rf doxytemp + +man/man1/%: usr/man/man1/% sample/man3/SampleGroup.3 utils/mkman.rb + $(mkinstalldirs) man/man1 + rm -rf doxywork man/man1/* + ruby utils/mkman.rb 1 usr/man/man1 man/man1 + +man/man3/%: usr/man/man3/% sample/man3/SampleGroup.3 utils/mkman.rb + $(mkinstalldirs) man/man3 + rm -rf doxywork usr/man3/* + ruby utils/mkman.rb 3m17n usr/man/man3 man/man3 + +man/man5/%: usr/man/man5/% sample/man3/SampleGroup.3 utils/mkman.rb + $(mkinstalldirs) man/man5 + rm -rf doxywork usr/man5/* + ruby utils/mkman.rb 5 usr/man/man5 man/man5 ja/man3m/%.3m: ja/man/man3/%.3m sample-ja.c utils/mkman.rb -${DOXYGEN} -g doxytemp @@ -203,12 +282,12 @@ clean-local: WEBDIR = /project/web/extra/m17n-lib/m17n-docs -web: $(pkgdata_DATA) +web: usr-html [ -d ${WEBDIR} ] || mkdir ${WEBDIR} [ -f ${distdir}.tar.gz ] || make dist cp ${distdir}.tar.gz ${WEBDIR} cp usr/html/* ${WEBDIR} -.PRECIOUS: %/latex/m17n-lib.tex %/man/man3/m17nIntro.3m +.PRECIOUS: %/latex/m17n-lib.tex %/man/man3/m17nIntro.3m ${SRC_ALL} endif diff --git a/data-usr/im.txt b/data-usr/im.txt index 99a4292..c1b5dc6 100644 --- a/data-usr/im.txt +++ b/data-usr/im.txt @@ -1,4 +1,4 @@ -INPUT-METDHO ::= +INPUT-METHOD ::= '(' TITLE MAP-LIST MODULE-LIST ? STATE-LIST ')' TITLE ::= diff --git a/data-usr/m17n-lib.sty b/data-usr/m17n-lib.sty index 2a3ccb0..bc06fbf 100644 --- a/data-usr/m17n-lib.sty +++ b/data-usr/m17n-lib.sty @@ -1,25 +1,4 @@ \ProvidesPackage{m17n-lib} -%% Copyright (C) 2003 -*- coding: euc-jp; -*- -%% National Institute of Advanced Industrial Science and Technology (AIST) -%% Registration Number H15PRO112 - -%% This file is part of the m17n library. - -%% The m17n library 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. - -%% The m17n library 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 the m17n library; see the file COPYING. If not, write to -%% the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -%% Boston, MA 02111-1307, USA. - %% Don't leave the space for marginal notes. \setlength{\textwidth}{\paperwidth} \addtolength{\textwidth}{-2in} @@ -80,3 +59,7 @@ Boston, MA 02111-1307, USA. %% Run the above hook before printing TOC. \let\origtableofcontents\tableofcontents \def\tableofcontents{\m17nhook\origtableofcontents\clearpage} + +%% Add Index section to the table of contents. +\let\origprintindex\printindex +\def\printindex{\addcontentsline{toc}{section}{Index}\origprintindex} diff --git a/data-usr/mainpage.txt b/data-usr/mainpage.txt index b45ff77..902a3b3 100644 --- a/data-usr/mainpage.txt +++ b/data-usr/mainpage.txt @@ -47,8 +47,8 @@ system. @section usage How to use it? Just include in your program, and link it with the m17n -library by -lm17n. See the documentation of the module \link -m17nIntro Introduction \endlink for the detail. +library by -lm17n. See @ref m17nIntro @latexonly +(P.\pageref{group__m17nIntro}) @endlatexonly for the detail. @section contact Contact us: diff --git a/data/dbformat.txt b/data/dbformat.txt new file mode 100644 index 0000000..04cb4d0 --- /dev/null +++ b/data/dbformat.txt @@ -0,0 +1,260 @@ +/***@page m17nDatabaseFormat Data format of the m17n database + +@section dbformat General format + +The mdatabase_load () function returns the data specified by tags in +the form of plist if the first tag is not @c Mchartable nor @c +Mcharset. The keys of the returned plist are limited to +Minteger, Msymbol, Mtext, and +Mplist. The type of the value is unambiguously determined by +the corresponding key. If the key is Minteger, the value is +an integer. If the key is Msymbol, the value is a symbol. +And so on. + +A number of expressions are possible to represent a plist. For +instance, we can use the form (K1:V1, K2:V2, ..., Kn:Vn) to +represent a plist whose first property key and value are K1 and V1, +second key and value are K2 and V2, and so on. However, we can use a +simpler expression here because the types of plists used in the m17n +database are fairly restricted. + +Hereafter, we use an expression, which is similar to S-expression, to +represent a plist. (Actually, the default database loader of the m17n +library is designed to read data files written in this expression.) + +The expression consists of one or more elements. Each element +represents a property, i.e. a single element of a plist. + +Elements are separated by one or more whitespaces, i.e. a space +(code 32), a tab (code 9), or a newline (code 10). Comments begin +with a semicolon (;) and extend to the end of the line. + +The key and the value of each property are determined based on the +type of the element as explained below. + + + +EXAMPLE + +Here is an example of plist that is written in the expression +explained above. + +@verbatim +abc 123 (pqr 0xff) "m\"text" (_\\_ ("string" xyz) -456) +@endverbatim + +It represents the following plist: + +@verbatim +(Msymbol:abc, + Minteger:123, + Mplist:(Msymbol:pqr, + Minteger:255), + Mtext:m"text, + Mplist:(Msymbol:_\_, + Mplist:(Mtext:string, + Msymbol:xyz), + Minteger:-456)) +@endverbatim + +@section fontenc Font Encoding + +The m17n library loads information about the encoding of each font +form the m17n database by the tags \. The plist +format of the data is as follows: + +@verbatim +FONT-ENCODING ::= + PER-FONT-INFO * + +PER-FONT-INFO ::= + '(' FONT-SPEC ENCODING ')' + +FONT-SPEC ::= + '(' + [ FOUNDRY FAMILY [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ] ] ] ] ] REGISTRY + ')' +@endverbatim + +@c FOUNDRY to @c REGISTRY are symbols specifying the corresponding +XLFD font name fields. Omitted symbols are regarded as @c nil, and +@c nil means a wild card. For instance, this @c FONT-SPEC: + +@verbatim + (nil alice0\ lao iso8859-1) +@endverbatim + +should be applied to all fonts whose family is "alice0 lao", and +registry is "iso8859-1". + +@c ENCODING is a symbol representing a charset. A font matching @c +FONT-SPEC supports all characters of the charset, and a character code +is mapped to the corresponding glyph code of the font by this charset. + + +@section fontsize Font Resizing + +In some case, a font contains incorrect information about its size +(typically in the case of a hacked TrueType font), which results in a +bad text layout when such a font is used in combination with the other +fonts. To overcome this problem, the m17n library loads information +about font-size correction from the m17n database by the tags \. The plist format of the data is as follows: + +@verbatim +FONT-RESIZE ::= + PER-FONT-INFO * + +PER-FONT-INFO ::= + '(' FONT-SPEC RESIZE-RATIO ')' + +FONT-SPEC ::= + '(' + [ FOUNDRY FAMILY [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ] ] ] ] ] REGISTRY + ')' +@endverbatim + +The meanings of @c FOUNDRY to @c REGISTRY are the same as @e Font @e +Encoding. @c RESIZE-RATIO is an integer number specifying by +percentage how much the font-size must be adjusted. For instance, +this @c PER-FONT-INFO: + +@verbatim + ((devanagari-cdac) 150) +@endverbatim + +means that, to use a font of registry "devanagari-cdac" with a +specific size, we have to open an 1.5 times bigger one. + +@section fontset Fontset + +The m17n library loads a fontset definition from the m17n database by +the tags \. The plist format of the data is +as follows: + +@verbatim +FONTSET ::= + PER-SCRIPT * PER-CHARSET * FALLBACK * + +PER-SCRIPT ::= + '(' SCRIPT PER-LANGUAGE + ')' + +PER-LANGUAGE ::= + '(' LANGUAGE FONT-SPEC-ELEMENT + ')' + +PER-CHARSET ::= + '(' CHARSET FONT-SPEC-ELEMENT + ')' + +FALLBACK ::= + FONT-SPEC-ELEMENT + +FONT-SPEC-ELEMENT ::= + '(' FONT-SPEC [ FLT-NAME ] ')' + +FONT-SPEC ::= + '(' + [ FOUNDRY FAMILY [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ] ] ] ] ] REGISTRY + ')' +@endverbatim + +@c SCRIPT is a symbol of script name (e.g. latin, han) or @c nil. @c +LANGUAGE is a two-letter symbol of language name code defined by ISO +639 (e.g. ja, zh) or @c nil. The meanings of @c FOUNDRY to @c +REGISTRY are the same as @e Font @e Encoding. @c FLT-NAME is a name +of @ref flt. + +For instance, this @c PER_SCRIPT: + +@verbatim +(han + (ja + ((jisx0208.1983-0))) + (zh + ((gb2312.1980-0))) + (nil + ((big5-0)))) +@endverbatim + +instructs the rendering engine to use a font of registry +"jisx0208.1983-0" for a "han" character that has @c Mlanguage text +propert "ja" if the character is in the repertories of such fonts. +Otherwise, try a font of registry "gb2312.1980-0" or "big5-0". If a +"han" character does not have @c Mlangauge text property, try all +three fonts. + +@section flt Font Layout Table + +Usually, the rendering engine converts character codes of into glyph +codes one by one by consulting information about encoding of each +selected font. But, for rendering a text that requires complicated +layouting (e.g. Thai and Indic), such an one to one conversion is not +sufficient. In addition, some glyphs must be shifted 2-dimensionally +on the screen. For such a case, a font layout table (FLT in short) +must be used. + +A FLT can contain the information equivarent to OpenType Layout Table +(CMAP, GSUB, and GPOS) in addition to the information about how to +extract a grapheme cluster and how to re-order characters. + +The m17n library loads a FLT from the m17n database by the tags +\. The plist format of the data is as +follows: + +@verbinclude flt.txt + +@section im Input Method + +@verbinclude im.txt + +*/ + +//// diff --git a/data/mainpage.txt b/data/mainpage.txt new file mode 100644 index 0000000..902a3b3 --- /dev/null +++ b/data/mainpage.txt @@ -0,0 +1,67 @@ +/***@mainpage The M17N Library Documentation + +@section what What is the m17n library? + +The @e m17n @e library is a multilingual text processing library for +the C language. + +
    + +
  • It is a free and open source software. + +
  • It is for any GNU/Linux and Unix applications/libraries. + +
  • It realizes multilingualization of many aspects of +applications/libraries. + +
+ +The word "m17n" is an abbreviation of "multilingualization". + +The m17n library provides following facilities to handle +multilingual text. + +
    + +
  • @e M-text: A data structure for a multilingual text. It is +basically a string but with attributes called text property, and +is designed to substitute for the C string. It is the most important +object of the m17n library. + +
  • Functions for creating and processing M-texts. + +
  • Functions for converting M-texts from/to strings encoded in +various existing formats. + +
  • A huge character space, which contains all the Unicode +characters and more non-Unicode characters. + +
  • @e Chartable: A data structure that contains per-character +information efficiently. + +
  • Functions for inputting and displaying M-text on a window +system. + +
+ +@section usage How to use it? + +Just include in your program, and link it with the m17n +library by -lm17n. See @ref m17nIntro @latexonly +(P.\pageref{group__m17nIntro}) @endlatexonly for the detail. + +@section contact Contact us: + +Global IT Security Group\n +National Information Technology Research Institute\n +Institute of Advanced Industrial Science and Technology + +Web: http://www.m17n.org/m17n-lib/ + +Bug report: m17n-lib-bug@m17n.org + +Mailing list (English): m17n-lib@m17n.org + +Mailing list (Japanese): m17n-lib-ja@m17n.org +*/ +//// diff --git a/doxyfile b/doxyfile index 3bcace2..044dcf8 100644 --- a/doxyfile +++ b/doxyfile @@ -308,15 +308,7 @@ WARN_LOGFILE = warning # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = "data-%USR_JA_DEV%/mainpage.txt" -INPUT += "%M17NLIB%/src/m17n-core.h" -INPUT += "%M17NLIB%/src/m17n.h" -INPUT += "%M17NLIB%/src/m17n-gui.h" -INPUT += "%M17NLIB%/src/m17n-X.h" -INPUT += "%M17NLIB%/src/m17n-err.h" -INPUT += "%M17NLIB%/src/" -INPUT += "data-%USR_JA_DEV%/dbformat.txt" -INPUT += "%M17NLIB%/example/README.txt" +INPUT = %INPUT% # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -609,7 +601,7 @@ MAN_OUTPUT = # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) -MAN_EXTENSION = .3m +MAN_EXTENSION = %MAN_EXTENSION% # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity diff --git a/parrot.gif b/parrot.gif deleted file mode 100755 index b07e3bf..0000000 Binary files a/parrot.gif and /dev/null differ diff --git a/parrot.png b/parrot.png new file mode 100644 index 0000000..d740fa0 Binary files /dev/null and b/parrot.png differ diff --git a/utils/mkman.rb b/utils/mkman.rb index 5cf667d..f695ff1 100644 --- a/utils/mkman.rb +++ b/utils/mkman.rb @@ -1,25 +1,23 @@ #! /usr/local/bin/ruby +# Usage: mkman.rb SRCDIR DSTDIR + #¼Â¹Ô¤¹¤ë¤È/tmp/doxyman¤ò¤Ä¤«¤Ã¤Æ¥Õ¥¡¥¤¥ë¤òʬ¤±¡¢ #¤â¤È¤Îdirectory¤Ë¤«¤­¤Ê¤ª¤¹¡£ # see also ¤ÎÃæ¿È¤ò woman ¸þ¤±¤Ë½ñ¤­´¹¤¨¤ë¡£ -usr_or_ja=$*[0] +$manext="."+$*[0] # # Setting up directory names. # $currentdir = Dir.pwd+"/" +$srcdir=$currentdir+$*[1]+"/" +$dstdir=$currentdir+$*[2]+"/" $doxywork = $currentdir+"doxywork/" -$srcman3 = $currentdir+usr_or_ja+"/man/man3/" -if usr_or_ja == "usr" - $dstman3m = $currentdir+"/usr/man3m/" -else - $dstman3m = $currentdir+"/ja/man3m/" -end $sampledir="sample/man3/" - $headfile = $currentdir+"manhead" + headbuf = open($headfile, "r").readlines # @@ -87,7 +85,7 @@ def writedocumentation(buf, text, index) def datastructure(struct) - text = open(struct.concat(".3m"),"r").readlines + text = open(struct.concat($manext),"r").readlines buf = [] @@ -172,7 +170,7 @@ def documentfunc2 (dstart, title, func_text, short_text) #short_text¤Î´Ø¿ô̾¤Î£²¹Ô¸å¤¬brief¡£ brief = short_text[short_text.index(short_text.find{|i| i.index(ffname)}) + 2] #´Ø¿ô¤´¤È¤Î¥Õ¥¡¥¤¥ë¤òºî¤ë¡£ - file = open($doxywork+fname+".3m", "w") + file = open($doxywork+fname+$manext, "w") file.puts("@function") #¥Ø¥Ã¥À /^\.TH \"([^"]*)\"\s/ =~ title @@ -402,7 +400,7 @@ end Dir.mkdir $doxywork unless FileTest.directory? $doxywork -Dir.chdir($srcman3) +Dir.chdir($srcdir) Dir.open(".").each{|filename| @@ -454,7 +452,7 @@ Dir.open(".").each{|filename| #############################rewriting files -Dir.chdir($dstman3m) +Dir.chdir($dstdir) Dir.open(".").each{|f| File.delete(f) if FileTest.file?(f)} @@ -477,7 +475,7 @@ unless FileTest.directory? filename else buf = orewrite(text) end - filetowrite = open($dstman3m+filename,"w") + filetowrite = open($dstdir+filename,"w") filetowrite.puts(headbuf) filetowrite.puts(buf) filetowrite.flush