[DRE-commits] [ruby-pgplot] 02/06: Imported Upstream version 0.1.9
Youhei SASAKI
uwabami-guest at moszumanska.debian.org
Thu Aug 28 18:37:22 UTC 2014
This is an automated email from the git hooks/post-receive script.
uwabami-guest pushed a commit to branch master
in repository ruby-pgplot.
commit 40b3f37dacaf10a8dba394e1073e6d129c11e25f
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Fri Aug 29 02:02:16 2014 +0900
Imported Upstream version 0.1.9
Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
---
.gitignore | 18 ++++
FuncUsage | 6 ++
MANIFEST | 11 ++-
README | 107 ++++++++++++++++++++++
README.en | 99 --------------------
README.ja | 93 +++++++++----------
Rakefile | 16 ++++
pgdemo1.rb => demo/pgdemo1.rb | 0
pgdemo15.rb => demo/pgdemo15.rb | 0
pgdemo3.rb => demo/pgdemo3.rb | 0
pgdemo4.rb => demo/pgdemo4.rb | 0
pgdemo9.rb => demo/pgdemo9.rb | 0
doc/Makefile | 63 +++++++------
doc/index.rd | 18 ++--
doc/install.ja.rd | 126 +++++++++++++-------------
doc/method.ja.rd | 124 ++++++++++++-------------
doc/mkdoc.rb | 26 +++---
doc/myrd2html.rb | 42 +++++++++
doc/pgcont.png | Bin 0 -> 9448 bytes
doc/pghist.png | Bin 0 -> 3135 bytes
doc/pgimag.png | Bin 0 -> 49996 bytes
doc/pgline.png | Bin 0 -> 5453 bytes
doc/pgplot.png | Bin 0 -> 58823 bytes
doc/plot1.png | Bin 0 -> 3905 bytes
doc/rbpg-ind.rd | 171 -----------------------------------
doc/tutorial-01.ja.rd | 90 +++++++++---------
doc/up.sh | 17 ++++
ext/build_lib/Makefile | 29 ++++++
ext/build_lib/download.rb | 14 +++
ext/build_lib/drivers.rb | 24 +++++
ext/build_lib/makefile.rb | 54 +++++++++++
cogen.rb => ext/cogen.rb | 8 +-
depend => ext/depend | 0
ext/extconf-auto.rb | 72 +++++++++++++++
extconf.rb => ext/extconf.rb | 64 ++++++++++---
kwarg.c => ext/kwarg.c | 6 +-
rb_pgplot.c.in => ext/rb_pgplot.c.in | 78 ++++++++--------
ext/version.h | 1 +
pgplot.gemspec | 90 ++++++++++++++++++
test/pgcurs.rb | 2 +-
40 files changed, 879 insertions(+), 590 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2fb1147
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,18 @@
+ext/Makefile
+mkmf.log
+.config
+rb_pgplot.c
+*.o
+*.so
+lib*.a
+cpgplot.h
+*~
+*/*~
+*/*/*~
+InstalledFiles
+pkg
+build_pgplot
+.RUBYARCHDIR.time
+ext/build_lib/build
+ext/build_lib/drivers.conf
+ext/build_lib/pgplot*
diff --git a/FuncUsage b/FuncUsage
index 8693919..20a1d35 100644
--- a/FuncUsage
+++ b/FuncUsage
@@ -1,3 +1,9 @@
+Here is a brief overview of Ruby/PGPLOT methods whose argument handling differs
+from the underlying PGPLOT functions.
+
+Methods that have the same arguments as the underlying functions are NOT shown
+here.
+
stat = pgopen([device])
stat = pgbeg([device, [nxsub, [nysub]]])
diff --git a/MANIFEST b/MANIFEST
index 7138c3d..d9598b4 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,6 +1,6 @@
FuncUsage
MANIFEST
-README.en
+README
README.ja
cogen.rb
depend
@@ -12,6 +12,7 @@ pgdemo3.rb
pgdemo4.rb
pgdemo9.rb
rb_pgplot.c.in
+ruby-pgplot.gemspec
test/pgband.rb
test/pgcurs.rb
test/pggray.rb
@@ -27,13 +28,21 @@ doc/install.ja.rd
doc/method.ja.rd
doc/mkdoc.rb
doc/mkind.rb
+doc/myrd2html.rb
doc/pgcont.rd
+doc/pgcont.png
doc/pghist.rd
+doc/pghist.png
doc/pgimag.rd
+doc/pgimag.png
doc/pgline.rd
+doc/pgline.png
+doc/pgplot.png
+doc/plot1.png
doc/rbpg-ind.rd
doc/rbpg-ind.txt
doc/rbpg-relabel.rb
doc/rd2html-img-lib.rb
doc/trailer.html
doc/tutorial-01.ja.rd
+doc/up.sh
diff --git a/README b/README
new file mode 100644
index 0000000..87f9b10
--- /dev/null
+++ b/README
@@ -0,0 +1,107 @@
+= Ruby/PGPLOT
+
+Version 0.1.6 by Masahiro TANAKA 2012-02-18
+
+== Description
+
+* Ruby interface to PGPLOT.
+ It provides PGPLOT functions as a Ruby module.
+
+== Requirements
+
+* {PGPLOT ver 5.2.x}[http://astro.caltech.edu/~tjp/pgplot/]
+
+* Libraries which PGPLOT drivers use:
+
+ * X11 library
+ * PNG library
+ * {GrWin Graphics Library for MS-Windows
+ }[http://spdg1.sci.shizuoka.ac.jp/grwinlib/english/]
+
+* Ruby version 1.8.x/1.9.x/2.0.x
+
+* {NArray}[http://narray.rubyforge.org/] version 0.5.x/0.6.x
+
+== Installation
+
+* Install PGPLOT library
+
+ - FORTRAN77 compiler required for source-compile.
+ - C interface library (libcpgplot.a) is also required.
+ - On Ubuntu, the required PGPLOT files can be installed via this command:
+ $ sudo apt-get install pgplot5
+
+* Install Ruby, NArray
+
+* Install Ruby/PGPLOT
+
+ - To install via RubyGems (recommended!):
+ $ sudo gem install pgplot
+
+ - To install manually:
+
+ - extract distribution.
+
+ - compile and install by:
+
+ $ ruby extconf.rb [options (see below)]
+ $ make
+ $ make site-install
+ (or make install)
+
+ - Options for `ruby extconf.rb':
+ --with-pgplot-include=path : path to cpgplot.h
+ --with-pgplot-lib=path : path to PGPLOT libraries.
+ --with-grwin : for using GrWin (cygwin/mingw).
+
+ example:
+ ruby extconf.rb \
+ --with-pgplot-include=/usr/local/pgplot \
+ --with-pgplot-lib=/usr/local/pgplot
+
+== Usage
+
+* Environment variables for PGPLOT (csh)
+
+ setenv PGPLOT_DIR /usr/local/lib/pgplot/ # pgxwin_server, rgb.txt
+ setenv PGPLOT_FONT ${PGPLOT_DIR}/grfont.dat
+ setenv PGPLOT_DEV /xwin
+
+* To load the Ruby/PGPLOT extension;
+
+ require "pgplot"
+
+* Module name is 'Pgplot'. If you want to omit the module name;
+
+ include Pgplot
+
+* Pgplot module method names are lower case of corresponding
+ PGPLOT functions. To start plotting:
+
+ pgbeg('/xwin')
+
+ See PGPLOT manual for function usage.
+ Arguments are not always same as the FORTRAN PGPLOT.
+ {FuncUsage}[link:FuncUsage.html] file includes a list of functions with
+ different arguments.
+
+== Platforms tested
+
+* ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
+* ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
+* NArray 0.6.0.1
+* gcc/gfortran version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
+
+== License
+
+ This program is free software.
+ You can distribute/modify this program
+ under the same terms as Ruby itself.
+ NO WARRANTY.
+
+== Acknowledgment
+
+ M.T. thanks to Tim Pearson for developing the useful PGPLOT library
+ and giving me the permission to distribute the Ruby version of pgdemos.
+ M.T. also thanks to the developers of the Ruby language
+ for providing the wonderful language.
diff --git a/README.en b/README.en
deleted file mode 100644
index aabe867..0000000
--- a/README.en
+++ /dev/null
@@ -1,99 +0,0 @@
- Ruby/PGPLOT ver 0.1.3 by Masahiro TANAKA 2006-12-13
-
-= Description
-
- * Ruby interface to PGPLOT.
- It provides PGPLOT functions as a Ruby module.
-
-= Requirement
-
- * PGPLOT ver 5.2.x
- (http://astro.caltech.edu/~tjp/pgplot/)
- * Libraries which PGPLOT drivers use:
- ** X11 library
- ** PNG library
- ** GrWin Graphics Library for MS-Windows.
- (http://spdg1.sci.shizuoka.ac.jp/grwinlib/english/)
- * Ruby ver 1.8.x
- * NArray Extension library ver 0.5.9
- (http://www.ruby-lang.org/en/raa-list.rhtml?name=NArray)
-
-= Installation
-
- * install PGPLOT library
-
- - FORTRAN77 compiler required for source-compile.
- - C interface library (libcpgplot.a) is also required.
-
- * install Ruby, NArray
-
- * install Ruby/PGPLOT
-
- - extract distribution.
-
- - compile and install by:
-
- ruby extconf.rb [options (see below)]
- make
- make site-install
- (or make install)
-
- - Options for `ruby extconf.rb':
- --with-pgplot-include=path : path to cpgplot.h
- --with-pgplot-lib=path : path to PGPLOT libraries.
- --with-x11-dir=path : path to X11
- --with-grwin : for using GrWin (cygwin/mingw).
- --with-sunws : PGPLOT is compiled with Sun WorkShop f77.
- gfortran is assumed without this option.
-
- example:
- ruby extconf.rb --with-x11-dir=/usr/X11R6 \
- --with-pgplot-include=/usr/local/pgplot \
- --with-pgplot-lib=/usr/local/pgplot
-
-= Usage
-
- * Environment variables for PGPLOT (csh):
-
- setenv PGPLOT_DIR /usr/local/lib/pgplot/ # pgxwin_server, rgb.txt
- setenv PGPLOT_FONT ${PGPLOT_DIR}/grfont.dat
- setenv PGPLOT_DEV /xwin
-
- * To load the Ruby/PGPLOT extension;
-
- require "pgplot"
-
- * Module name is `Pgplot'. If you want to omit the module name;
-
- include Pgplot
-
- * Pgplot module method names are lower case of corresponding
- PGPLOT functions. To start plotting:
-
- pgbeg('/xwin')
-
- See PGPLOT manual for function usage.
- Arguments are not always same as the FORTRAN PGPLOT.
- "FuncUsage" file includes a list of functions with
- different arguments.
-
-= Platforms tested
-
- * Ruby 1.8.5 (2006-08-25) [i686-linux]
- * NArray 0.5.9
- * gcc/gfortran 4.1.1 20060525 (Red Hat 4.1.1-1)
-
-= License
-
- This program is free software.
- You can distribute/modify this program
- under the same terms as Ruby itself.
- NO WARRANTY.
-
-= Acknowledgment
-
- M.T. thanks to Tim Pearson for developing the useful PGPLOT library
- and giving me the permission to distribute the Ruby version of pgdemos.
- M.T. also thanks to the developers of the Ruby language
- for providing the wonderful language.
-
diff --git a/README.ja b/README.ja
index bae2a7c..0889e5a 100644
--- a/README.ja
+++ b/README.ja
@@ -1,90 +1,91 @@
- Ruby/PGPLOT ver 0.1.3 by Masahiro TANAKA 2006-12-13
+ Ruby/PGPLOT ver 0.1.6 by Masahiro TANAKA 2012-02-18
-= ����
+= 概要
- * PGPLOT��Ruby����Ȥ�����γ�ĥ�饤�֥�ꡣ
+ * PGPLOTをRubyから使うための拡張ライブラリ。
-= ɬ�פʤ��
+= 必要なもの
* PGPLOT ver 5.2.x
(http://astro.caltech.edu/~tjp/pgplot/)
- * PGPLOT�Υɥ饤�Ф��Ȥ��饤�֥�� (ɬ�פ˱�����):
- ** X11�饤�֥��
- ** PNG�饤�֥��
- ** GrWin����ե������饤�֥�� for MS-Windows (Cygwin�ǤΤ�ư���ǧ)
+ * PGPLOTのドライバが使うライブラリ (必要に応じて):
+ ** X11ライブラリ
+ ** PNGライブラリ
+ ** GrWinグラフィクスライブラリ for MS-Windows (Cygwinでのみ動作確認)
(http://spdg1.sci.shizuoka.ac.jp/grwinlib/)
- * Ruby ver 1.8.x
- * NArray ver 0.5.9
+ * Ruby ver 1.8.x/1.9.x
+ * NArray ver 0.5.x/0.6.x
(http://www.ruby-lang.org/en/raa-list.rhtml?name=NArray)
-= ���ȡ�����ˡ
+= インストール方法
- * PGPLOT �ȡ���
+ * PGPLOT をインストール
- - FORTRAN77��ɬ�פǤ� (gfortran�Ǥ�OK)��
- - C���쥤�ե������饤�֥��(cpgplot)���������ɬ�פ�����ޤ���
+ - FORTRAN77が必要です (gfortranでもOK)。
+ - C言語インタフェースライブラリ(cpgplot)を作成する必要があります。
- * Ruby, NArray �ȡ���
+ * Ruby, NArray をインストール
- * Ruby/PGPLOT �ȡ���
+ * Ruby/PGPLOT をインストール
- - ��������Ÿ��
+ - ソースを展開
- - ����ѥ��롦���ȡ���:
- ruby extconf.rb [���ץ����(��������)]
+ - コンパイル・インストール:
+ ruby extconf.rb [オプション(下記参照)]
make
make site-install
- (�ޤ��� make install)
+ (または make install)
- - ruby extconf.rb �Υ��ץ����:
- --with-pgplot-include=path : cpgplot.h�Υǥ��쥯�ȥꡣ
- --with-pgplot-lib=path : PGPLOT�饤�֥��Υǥ��쥯�ȥꡣ
- --with-x11-dir=path : X11��path
+ - ruby extconf.rb のオプション:
+ --with-pgplot-include=path : cpgplot.hのディレクトリ。
+ --with-pgplot-lib=path : PGPLOTライブラリのディレクトリ。
+ --with-x11-dir=path : X11のpath
--with-grwin : for using GrWin (cygwin/mingw).
- --with-sunws : PGPLOT��Sun WorkShop��f77��Ȥä�
- ����ѥ��뤷����硣���ꤷ�ʤ�����g77��
- ��:
+ --with-sunws : PGPLOTをSun WorkShopのf77を使って
+ コンパイルした場合。指定しない時はg77。
+ 例:
ruby extconf.rb --with-x11-dir=/usr/X11R6 \
--with-pgplot-include=/usr/local/pgplot \
--with-pgplot-lib=/usr/local/pgplot
-= ������ˡ
+= 使用方法
- * PGPLOT�δĶ��ѿ�����(csh)
+ * PGPLOTの環境変数設定(csh)
setenv PGPLOT_DIR /usr/local/lib/pgplot/ # pgxwin_server, rgb.txt
setenv PGPLOT_FONT ${PGPLOT_DIR}/grfont.dat
setenv PGPLOT_DEV /xwin
- * ��ĥ�饤�֥����ɤ���ˤ�:
+ * 拡張ライブラリをロードするには:
require "pgplot"
- * �⥸�塼��̾��`Pgplot'�Ǥ����⥸�塼��̾���ά�������Ȥ���:
+ * モジュール名は`Pgplot'です。モジュール名を省略したいときは:
include Pgplot
- * Pgplot�⥸�塼��Υ�åɤϡ�PGPLOT�δؿ��Ʊ��̾��(��ʸ��)�Ǥ���
- �ץ�åȤϤ���ˤ�:
+ * Pgplotモジュールのメソッドは、PGPLOTの関数と同じ名前(小文字)です。
+ プロットを開始するには:
pgbeg('/xwin')
- �ܺ٤� PGPLOT�Υޥ˥奢��Ȥ��Ʋ�������
- �����ɬ������FORTRAN�Ǥ�Ʊ���ǤϤ���ޤ���
- �����㤦�ؿ�Υꥹ�Ȥϡ�"FuncUsage"�Ȥ����ե�����ˤ���ޤ���
+ 詳細は PGPLOTのマニュアルを参照して下さい。
+ 引数は必ずしもFORTRAN版と同じではありません。
+ 引数が違う関数のリストは、"FuncUsage"というファイルにあります。
-= ư���ǧ
+= 動作確認
- * Ruby 1.8.5 (2006-08-25) [i686-linux]
- * NArray 0.5.9
- * gcc/gfortran 4.1.1 20060525 (Red Hat 4.1.1-1)
+ * ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
+ * ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
+ * NArray 0.6.0.1
+ * gcc/gfortran version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
-= ���۾��
+= 配布条件
- Ruby���Τ�Ʊ���Ǥ���
- ̵�ݾڤǤ���
+ Ruby本体と同じです。
+ 無保証です。
-= �ռ�
+= 謝辞
- PGPLOT��ȯ����Ruby��pgdemo�����۵��Ĥ��ä� Tim Pearson��
- �˴��դ��ޤ���Ruby��ȯ�˷Ȥ�ä����ͤ˴��դ��ޤ���
+ PGPLOTを開発し、Ruby版pgdemoの配布許可を下さった Tim Pearson氏
+ に感謝します。Ruby開発に携わった皆様に感謝します。
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..6a85f20
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,16 @@
+require 'rubygems'
+require 'rubygems/package_task'
+
+load './pgplot.gemspec'
+
+file 'ext/rb_pgplot.c' => ['ext/rb_pgplot.c.in', 'ext/cogen.rb'] do
+ require './ext/cogen.rb'
+ Dir.chdir('ext') do
+ cogen_pgplot
+ end
+end
+
+Gem::PackageTask.new(PGPLOT_GEMSPEC) do |pkg|
+ pkg.need_zip = true
+ pkg.need_tar = true
+end
diff --git a/pgdemo1.rb b/demo/pgdemo1.rb
similarity index 100%
rename from pgdemo1.rb
rename to demo/pgdemo1.rb
diff --git a/pgdemo15.rb b/demo/pgdemo15.rb
similarity index 100%
rename from pgdemo15.rb
rename to demo/pgdemo15.rb
diff --git a/pgdemo3.rb b/demo/pgdemo3.rb
similarity index 100%
rename from pgdemo3.rb
rename to demo/pgdemo3.rb
diff --git a/pgdemo4.rb b/demo/pgdemo4.rb
similarity index 100%
rename from pgdemo4.rb
rename to demo/pgdemo4.rb
diff --git a/pgdemo9.rb b/demo/pgdemo9.rb
similarity index 100%
rename from pgdemo9.rb
rename to demo/pgdemo9.rb
diff --git a/doc/Makefile b/doc/Makefile
index 14d5770..47e9c02 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,31 +1,48 @@
-.SUFFIXES: .ja.rd .html.ja .rd .html .rb $(SUFFIXES)
+.SUFFIXES: .rd .html .ja.rd .html.ja .rb $(SUFFIXES)
+
+rd2=ruby myrd2html.rb
-.ja.rd.html.ja:
- rd2 -r rd2html-img-lib.rb --html-lang=ja --out-code=jis --with-css=css.css $< > $@
.rd.html:
- rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $<
-.rb.html:
- rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $<
+ $(rd2) --lang=en --kw="Ruby,PGPLOT,NArray" $(opt) $< > $@
+
+.ja.rd.html.ja:
+ $(rd2) --lang=ja --kw="Ruby,PGPLOT,NArray" $(opt) $< > $@
-targets_en=index.html \
- pgline.html pgcont.html pgimag.html pghist.html \
- rbpg-ind.html
-# rbpgplot.html
-targets_ja=install.html.ja tutorial-01.html.ja method.html.ja
+all=index.html \
+ pgline.html \
+ pgcont.html \
+ pgimag.html \
+ pghist.html \
+ rbpgplot.html \
+ rbpg-ind.html \
+ install.html.ja \
+ tutorial-01.html.ja \
+ method.html.ja
-all: $(targets_en) $(targets_ja)
+all: $(all)
# Examples
+index.html: opt= --title="Ruby/PGPLOT"
+pgline.html: opt= --title="pgline : Line plot"
+pgcont.html: opt= --title="pgcont : Histogram plot"
+pgimag.html: opt= --title="pgimag : Contour plot"
+pghist.html: opt= --title="pghist : Image map"
+rbpgplot.html: opt= --title="Ruby/PGPLOT: Method Index and Description"
+rbpg-ind.html: opt= --title="Ruby/PGPLOT: Categorized Method Index"
+install.html.ja: opt= --title="Ruby/PGPLOT: Installation (ja)"
+tutorial-01.html.ja: opt= --title="Ruby/PGPLOT: Tutorial 01 (ja)"
+method.html.ja: opt= --title="Ruby/PGPLOT: Method Reference (ja)"
+
pgline.html: pgline.rd trailer.html
pgcont.html: pgcont.rd trailer.html
pgimag.html: pgimag.rd trailer.html
pghist.html: pgimag.rd trailer.html
-
-install.html.ja: trailer.html
+install.html.ja: trailer.html
tutorial-01.html.ja: tutorial-01.ja.rd trailer.html
# Method description
rbpgplot.html: mkdoc.rb
+ #ruby -Kn mkdoc.rb $(HOME)/2012/src/pgplot/src rbpgplot.html
ruby mkdoc.rb rbpgplot.html
# Method index categolized
@@ -34,20 +51,8 @@ rbpg-ind.rd: rbpg-ind.txt mkind.rb trailer.html
rbpg-ind.html: rbpg-ind.rd
-# Method description (obsolete)
-# rbpg-doc.html: rbpg-doc.in.html
-# rm -f $@
-# ruby -p rbpg-relabel.rb rbpg-doc.in.html > $@
-# rbpg-doc.in.html: rbpg-doc.rd
-# rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $?
-# rbpg-doc.rd: rbpg-mkdoc.rb
-# rm -f $@
-# ruby rbpg-mkdoc.rb $< > $@
-
-webdir=masa at rubyforge:/var/www/gforge-projects/pgplot/
-
-webup:
- scp -p css.css rbpgplot.html $(targets_en) $(targets_ja) *.png README.?? $(webdir)
+up:
+ sh up.sh
clean:
- rm -f $(targets_en) $(targets_ja)
+ rm -f *~ rbpg-ind.rd $(all)
diff --git a/doc/index.rd b/doc/index.rd
index 4d750fb..8bbcca6 100644
--- a/doc/index.rd
+++ b/doc/index.rd
@@ -1,19 +1,21 @@
=begin
= Ruby/PGPLOT
-# == Synopsis
-
A Ruby interface to the
((<PGPLOT|URL:http://astro.caltech.edu/~tjp/pgplot/>))
graphics library.
-((<NArray|URL:http://narray.rubyforge.org/>))
-is required.
-* ((<RubyForge project page|URL:http://rubyforge.org/projects/pgplot/>))
+* ((<Repository(GitHub)|URL:https://github.com/masa16/ruby-pgplot>))
+
+== Requirement
+
+* ((<PGPLOT Library|URL:http://www.astro.caltech.edu/~tjp/pgplot/>))
+* GNU FORTRAN compiler
+* ((<NArray|URL:http://narray.rubyforge.org/>)) version 0.5/0.6
== Download
-* ((<version 0.1.2|URL:http://rubyforge.org/frs/download.php/7826/rb_pgplot-0.1.2.tar.gz>))
+* ((<version 0.1.6|URL:https://github.com/masa16/ruby-pgplot/tarball/0.1.6>))
== Installation
@@ -21,13 +23,13 @@ is required.
* ((<in Japanese|URL:install.html.ja>))
* ((<original site|URL:http://www.astro.caltech.edu/~tjp/pgplot/install.html>))
* Install Ruby/PGPLOT
- * ((<in English|URL:README.en>))
+ * ((<in English|URL:README>))
* ((<in Japanese|URL:README.ja>))
== Examples
* ((<(({pgline})) : Line plot|URL:pgline.html>))
-* ((<(({pghist})) : Histgram plot|URL:pghist.html>))
+* ((<(({pghist})) : Histogram plot|URL:pghist.html>))
* ((<(({pgcont})) : Contour map|URL:pgcont.html>))
* ((<(({pgimag})) : Image map|URL:pgimag.html>))
diff --git a/doc/install.ja.rd b/doc/install.ja.rd
index 0bc7480..2aa97af 100644
--- a/doc/install.ja.rd
+++ b/doc/install.ja.rd
@@ -1,105 +1,105 @@
=begin
-= PGPLOT�Υ��ȡ���
+= PGPLOTのインストール
-PGPLOT�� configure ��Ȥ�ʤ��Τǥ��ȡ��뤬�㴳���ݤǤ���
-�ʲ��� Solaris��GCC �Ȥ����Ķ���PGPLOT��ѥ��롢
-���ȡ��뤹������������ޤ���
-¾��OS�Ǥ�UNIX�ʤ�ۤȤ��Ʊ���褦�ˤ��ƥ��ȡ���Ǥ���Ȼפ��ޤ���
-((<�ܲȤΥ��ȡ��������Υڡ���|URL:http://www.astro.caltech.edu/~tjp/pgplot/install.html>))
-�⤴����������
+PGPLOTは configure を使わないのでインストールが若干面倒です。
+以下は Solaris、GCC という環境でPGPLOTをコンパイル、
+インストールする手順を説明します。
+他のOSでもUNIXならほとんど同じようにしてインストールできると思います。
+((<本家のインストール説明のページ|URL:http://www.astro.caltech.edu/~tjp/pgplot/install.html>))
+もご覧下さい。
-=== PGPLOT�Υ��������Ѱ�
-((<PGPLOT������|URL:http://www.astro.caltech.edu/~tjp/pgplot/>))
-����
-((<������������|URL:ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz>))
-��������ɡ�Ÿ������pgplot�Υǥ��쥯�ȥ�˰�ư���ޤ���
+=== PGPLOTのソースを用意
+((<PGPLOTのサイト|URL:http://www.astro.caltech.edu/~tjp/pgplot/>))
+から
+((<ソースコード|URL:ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz>))
+をダウンロード、展開し、pgplotのディレクトリに移動します。
gunzip -c pgplot5.2.tar.gz | tar xvf -
cd pgplot
-=== ��ȥǥ��쥯�ȥ�����
-��ȥǥ��쥯�ȥ����ޤ��������Ǥ� build �Ȥ���̾���ˤ��ޤ���
+=== 作業ディレクトリを作成
+作業ディレクトリを作ります。ここでは build という名前にします。
mkdir build
cd build
-=== drivers.list���Խ�
-PGPLOT���������Ϥ���ɥ饤�Ф����ޤ���
-drivers.list �Ȥ����ե�����ԡ����ƥ��ǥ����dz�����
-�Ȥ������ɥ饤�ФιԤ�Ƭ�� ! ��ʸ���������ޤ���
+=== drivers.listを編集
+PGPLOTで描画を出力するドライバを選択します。
+drivers.list というファイルをコピーしてエディタで開き、
+使いたいドライバの行の頭の ! の文字を削除します。
cp ../drivers.list .
vi drivers.list
-�ɥ饤�ФϤ����ߤ�����Ǥ��ޤ�����UNIX�ʤ�
+ドライバはお好みで選択できますが、UNIXなら
PNG, PPM, Postscipt, XWD, XWINDOW, XSERVE, XTERM
-�����������Ǥ����Τ�����Ū�Ǥ��礦��
-PNG driver���Ȥ߹���ˤϡ�
-((<libpng|URL:http://www.libpng.org/pub/png/png.html>)) ��ɬ�פǤ���
-¾�ˤ⤿������Υɥ饤�Ф��ޤޤ�Ƥ��ޤ�����
-�ץ�ɥ饤�Ф���ˤϥ���ѥ���λ��˥��顼���Ф��Τ����ä��ꡢ
-GIF�ϥ饤���˰��óݤ��ä��ꤷ�ޤ���
-
-=== makefile ����
-���Υ��ޥ�ɤ� makefile ��������ޤ���
+あたりを選んでおくのが一般的でしょう。
+PNG driverを組み込むには、
+((<libpng|URL:http://www.libpng.org/pub/png/png.html>)) が必要です。
+他にもたくさんのドライバが含まれていますが、
+プリンタドライバの中にはコンパイルの時にエラーが出るものがあったり、
+GIFはライセンスに引っ掛かったりします。
+
+=== makefile 作成
+次のコマンドで makefile を作成します。
../makemake .. sol2 g77_gcc
-1���ܤΰ���ϥ������Τ���ǥ��쥯�ȥ�λ���Ǥ���
-�����Ǥϥ������ǥ��쥯�ȥ�β��ˤ���Τǡ�((%..%)) ����ꤷ�ޤ���
-2���ܤΰ����OS�μ���ǡ��������ǥ��쥯�ȥ�ˤ���
-((%sys_*%)) �Ȥ����ǥ��쥯�ȥ����� ((%*%)) ����ʬ����ꤷ�ޤ���
-3���ܤΰ���ϥ���ѥ���ʤɤ�����ǡ�sys_* �β��ˤ���
-((%*.conf%)) �Ȥ����ե������ ((%*%)) ����ʬ����ꤷ�ޤ���
-�⤷������ˤʤ���С��Ǥ����ʤ�Ĥ����Ӥޤ���
-
-makefile ����������顢���äȸ������꤬�������������å����ޤ���
-�����ǡ�PGPLOT ver 5.2.2 �� PNG driver��Ȥ���硢
-�Ǥ��Ф��줿 makefile �ϡ�
+1番目の引数はソースのあるディレクトリの指定です。
+ここではソースディレクトリの下にいるので、((%..%)) を指定します。
+2番目の引数はOSの種類で、ソースディレクトリにある
+((%sys_*%)) というディレクトリの中の ((%*%)) の部分を指定します。
+3番目の引数はコンパイラなどの設定で、sys_* の下にある
+((%*.conf%)) というファイルの ((%*%)) の部分を指定します。
+もしこの中になければ、最も近そうなやつを選びます。
+
+makefile を作成したら、ざっと見て設定が正しいかチェックします。
+ここで、PGPLOT ver 5.2.2 で PNG driverを使う場合、
+吐き出された makefile は、
pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h
-�Ȥ����ޤ�������ˤʤäƤ���Τǡ����ιԤ������ޤ���
+というまずい設定になっているので、この行を削除します。
-=== ����ѥ���
-makefile ���Խ������顢�饤�֥���ѥ��뤷�ޤ���
+=== コンパイル
+makefile を編集したら、ライブラリをコンパイルします。
make
make cpg
-=== ���ȡ���
-make install ���Ѱդ���Ƥ��ʤ��Τǡ���ư�ǥ��ԡ����ޤ���
-ɬ�פʤ� root �ˤʤäƤ���������
-�ޤ����ȡ�����Υǥ��쥯�ȥ��Ķ��ѿ�˥��åȤ��ޤ���
-csh�Ϥʤ顢
+=== インストール
+make install が用意されていないので、手動でコピーします。
+必要なら root になってください。
+まずインストール先のディレクトリを環境変数にセットします。
+csh系なら、
setenv PREFIX /usr/local
setenv PGPLOT_DIR ${PREFIX}/pgplot
-���ȡ�����ϼ�ͳ�����٤ޤ�����
-����ѥ�����˥ѥ����꤬ɬ�פˤʤ뤫�⤷��ޤ���
-����ɬ�פʥե�����ԡ����ޤ���
+インストール先は自由に選べますが、
+コンパイル時にパス指定が必要になるかもしれません。
+次に必要なファイルをコピーします。
cp -p libpgplot.a libpgplot.so* libcpgplot.a ${PREFIX}/lib
cp -p cpgplot.h ${PREFIX}/include
mkdir ${PGPLOT_DIR}
cp -p grfont.dat rgb.txt pgxwin_server ${PGPLOT_DIR}
-����ǥ��ȡ��뽪λ�Ǥ���
+これでインストール終了です。
-=== �ǥ�μ¹�
-����ѥ��뤬���ޤ����ä����ɤ����ǥ�ץ�������餻�Ƥߤޤ��礦��
-����ѥ��뤷���ǥ��쥯�ȥ�� pgdemo1 ���� pgdemo17 �ޤǤ� cpgdemo
-�Ȥ����¹ԥե����뤬�Ǥ��Ƥ���Ϥ��Ǥ���������¹ԤǤ����������
-����ѥ��뤵��Ƥ���Ϥ��Ǥ���
+=== デモの実行
+コンパイルがうまくいったかどうかデモプログラムを走らせてみましょう。
+コンパイルしたディレクトリに pgdemo1 から pgdemo17 までと cpgdemo
+という実行ファイルができているはずです。それらを実行できれば正しく
+コンパイルされているはずです。
-=== �桼������
-PGPLOT��Ȥ��桼���ϡ��Ķ��ѿ�ؼ������ꤷ�Ƥ����Ȥ褤�Ǥ��礦��
+=== ユーザ設定
+PGPLOTを使うユーザは、環境変数へ次の設定しておくとよいでしょう。
setenv PGPLOT_DIR /usr/local/pgplot
setenv PGPLOT_DEV /xwin
-PGPLOT_DIR �Ͼ�ǥ��ȡ��뤷���ǥ��쥯�ȥ��Ʊ����
-PGPLOT_DEV �ϥǥե���ȤΥǥХ����Ǥ���
-����¾�δĶ��ѿ���ä����ꤷ�ʤ��Ƥ⤤���Ȼפ��ޤ������ܤ�����
-((<����|URL:http://www.astro.caltech.edu/~tjp/pgplot/chapter1.html#ENV>))
-������������
+PGPLOT_DIR は上でインストールしたディレクトリと同じ、
+PGPLOT_DEV はデフォルトのデバイスです。
+その他の環境変数は特に設定しなくてもいいと思いますが、詳しくは
+((<ここ|URL:http://www.astro.caltech.edu/~tjp/pgplot/chapter1.html#ENV>))
+をご覧下さい。
<<< trailer
diff --git a/doc/method.ja.rd b/doc/method.ja.rd
index 161e563..46da15e 100644
--- a/doc/method.ja.rd
+++ b/doc/method.ja.rd
@@ -1,135 +1,135 @@
=begin
= module Pgplot
-== �⥸�塼���å�
+== モジュールメソッド
-=== ���
+=== 操作
--- pgopen([device])
-PGPLOT���å����Ϥ��롣����ͤȤ��ƥ��ơ��������֤���
+PGPLOTセッションを開始する。戻り値としてステータスを返す。
--- pgbeg([device, [nxsub, [nysub]]])
(obsolete)
-PGPLOT���å����Ϥ��롣����ͤȤ��ƥ��ơ��������֤���
+PGPLOTセッションを開始する。戻り値としてステータスを返す。
--- pgask( [true|false] )
--- pgenv( xmin,xmax,ymin,ymax [,just, axis] )
-=== �����ޡ���������
+=== 線・マーカの描画
--- pgline( xarray, yarray )
-xarray, yarray ��������������
-xarray, yarray �Ϥ��줾�� X, Y ��ɸ������
+xarray, yarray を結ぶ線を描く。
+xarray, yarray はそれぞれ X, Y 座標の配列。
--- pgpt( xarray, yarray [,symbol] )
-xarray, yarray �ΰ��֤ˡ�symbol �Υޡ�����������
+xarray, yarray の位置に、symbol のマーカを描く。
--- pgpnts( xarray, yarray, symarray )
-xarray, yarray �ΰ��֤ˡ��б����� symarray �Υޡ����줾��������
+xarray, yarray の位置に、対応する symarray のマーカをそれぞれ描く。
-=== �ҥ��ȥ����
+=== ヒストグラム
--- pgbin( xarray, yarray [,center] )
--- pghist( data, nbin [,range, flag] )
-=== ���顼�С�
+=== エラーバー
--- pgerrb( dir, x, y, err [,tlen] )
-���顼�С���������
-tlen ��ü���������С���Ĺ������ꡣ
-+ ��¦���顼�С�:
+エラーバーを描く。
+tlen に端点に描くバーの長さを指定。
++ 片側エラーバー:
* dir = 1 for +X (X to X+err)
* dir = 2 for +Y (Y to Y+err)
* dir = 3 for -X (X to X-err)
* dir = 4 for -Y (Y to Y-err)
-+ ξ¦���顼�С�:
++ 両側エラーバー:
* dir = 5 for +/-X (X-err to X+err)
* dir = 6 for +/-Y (Y-err to Y+err)
--- pgerrx( x1, x2, y [,tlen] )
-x1 ���� x2 �ޤǤ��֥��顼�С���������
-tlen ��ü���������С���Ĺ������ꡣ
+x1 から x2 までを結ぶエラーバーを描く。
+tlen に端点に描くバーの長さを指定。
--- pgerry( x, y1, y2 [,tlen] )
-y1 ���� y2 �ޤǤ��֥��顼�С���������
-tlen ��ü���������С���Ĺ������ꡣ
+y1 から y2 までを結ぶエラーバーを描く。
+tlen に端点に描くバーの長さを指定。
-=== ������
+=== 等高線
--- pgcont( map, cont [,tr] )
-map ��Ϳ�����������ޥåפ���������������
-cont �ˤ��������Υ�٥�ޤ��Ϥ��������Ϳ���롣
+map で与えた2次元マップの等高線を描く。
+cont には等高線のレベルまたはその配列を与える。
--- pgcons( map, cont [,tr] )
-PGCONT���®�����르�륺���������������ʡ�
+PGCONTより速いアルゴルズムで描くんだそうな。
--- pgconb( map, cont [,blank, tr] )
-blank��Ϳ�����ͤ��»�ͤȤ�����������������
+blankで与えた値を欠損値として等高線を描く。
--- pgconf( map, cont_range [,tr] )
-cont_range �� Range���饹���֥������Ȥ�Ϳ�����ϰϤΥ�٥���ɤ��٤���
+cont_range に Rangeクラスオブジェクトで与えた範囲のレベルを塗り潰す。
--- pgconl( map, cont, label [,intval, minint, tr] )
-�������˥�٥��Ĥ��롣
+等高線にラベルをつける。
-=== ����
+=== 画像
--- pgimag( array [,range, tr] )
-���顼��������� array (����������) �β�����������
+カラースケールで array (2次元配列) の画像を描く。
--- pgctab( l, r,g,b [,contra,bright] )
-pgimag �ǻ��Ѥ��륫�顼�ơ��֥�����ꤹ�롣
+pgimag で使用するカラーテーブルを設定する。
--- pggray( array [,range, tr] )
-���졼��������� array (����������) �β�����������
+グレースケールで array (2次元配列) の画像を描く。
--- pgpixl( array [,x1,x2,y1,y2] )
-array (����������) �β�����Ĺ������pixel 1��1�Ĥ�������
+array (2次元配列) の画像を、長方形のpixel 1つ1つで描く。
--- pgvect( x, y [,scale, pos, tr, blank] )
-�٥��ȥ���������
+ベクトル場を描く。
-=== ��ɸ��������
+=== 座標軸の描画
--- pgtick( x1, y1, x2, y2, v, [str], {"tickl", "tickr", "disp", "orient"} )
--- pgaxis( x1, y1, x2, y2, v1, v2,
{"opt", "step", "nsub", "tickl", "tickr", "frac", "disp", "orient"} )
-=== ������������
+=== カーソル入力
--- pgcurs([x,y])
-����å��ޤ��ϥ��������פΥ��٥�Ȥ�������롣
-x,y ����ꤹ��ȻϤ�ˤ��ΰ��֤˥���������ư���롣
-���٥�Ȥ���������
-�����������(WC)��ʸ���� PgCursor���饹�Υ������֤���
+クリックまたはキータイプのイベントを取得する。
+x,y を指定すると始めにその位置にカーソルを移動する。
+イベントを取得すると
+カーソル位置(WC)と文字を PgCursorクラスのインスタンスで返す。
--- pgband( mode, [ xref, yref, [x, y, [posn]]])
-����å��ޤ��ϥ��������פΥ��٥�Ȥ�������롣
-x,y ����ꤹ��ȻϤ�ˤ��ΰ��֤˥���������ư���롣
-xref, yref �ϥ������ΰ���(���)�ǡ���ά����ȸ��߰��֤Ȥʤ롣
-���٥�Ȥ���������
-�����������(WC)��ʸ���� PgCursor���饹�Υ������֤���
-mode�ˤ�ꥫ�������������������ˡ�����Ǥ��롣
- * mode=0 : ����ʤ���
- * mode=1 : �������ȥ��������������
- * mode=2 : �������ȥ���������гѤȤ���Ĺ������
- * mode=3 : �������ȥ���������֤��줾����̤룲�ܤο�ʿ����
- * mode=4 : �������ȥ���������֤��줾����̤룲�ܤο�ľ����
- * mode=5 : ����������֤��̤��ʿ����
- * mode=6 : ����������֤��̤��ľ����
- * mode=7 : ����������֤��̤뽽������
+クリックまたはキータイプのイベントを取得する。
+x,y を指定すると始めにその位置にカーソルを移動する。
+xref, yref はアンカー点の位置(後述)で、省略すると現在位置となる。
+イベントを取得すると
+カーソル位置(WC)と文字を PgCursorクラスのインスタンスで返す。
+modeによりカーソル入力中の描画方法を指定できる。
+ * mode=0 : 描画なし。
+ * mode=1 : アンカー点とカーソルを結ぶ線。
+ * mode=2 : アンカー点とカーソルを対角とする長方形。
+ * mode=3 : アンカー点とカーソル位置それぞれを通る2本の水平線。
+ * mode=4 : アンカー点とカーソル位置それぞれを通る2本の垂直線。
+ * mode=5 : カーソル位置を通る水平線。
+ * mode=6 : カーソル位置を通る垂直線。
+ * mode=7 : カーソル位置を通る十字線。
--- pgolin( x, y, [sym, [npt]] )
-�ޥ�����������Ǻ�ɸ��Ϣ³�������Ϥ��롣
-x,y �ˤϤ��餫���� NArray::SFLOAT ���������Ϳ���Ƥ�����
-�����إ���å��������֤˺�ɸ��Ͽ���Ƥ�����
-���ϤǤ���Ŀ�Ϥ�������Υ����������¤���롣
-������������Ϥ������ϡ��ޡ��� sym �����褵��롣
-npt ����ꤹ��ȡ����餫���� npt �Ĥ��������Ϥ���Ƥ���Ȥߤʤ���
-����ͤ����Ϥ������ο�
+マウスカーソルで座標を連続して入力する。
+x,y にはあらかじめ NArray::SFLOAT 型の配列を与えておき、
+そこへクリックした順番に座標を記録していく。
+入力できる個数はこの配列のサイズで制限される。
+カーソルで入力した点は、マーカ sym で描画される。
+npt を指定すると、あらかじめ npt 個の点が入力されているとみなす。
+戻り値は入力した点の数。
--- pgncur( x, y, [sym, [npt]] )
-x,y�˵�Ͽ�������֤� x �ξ�������Ǥ��뤳�Ȥ������pgolin ��Ʊ����
+x,yに記録される順番が x の小さい順であることを除き、pgolin と同じ。
--- pglcur( x, y, [npt] )
-���Ϥ�������������������뤳�Ȥ�����ơ�pgolin ��Ʊ����
+入力した点を結ぶ線が描かれることを除いて、pgolin と同じ。
-=== ���ơ��������֤�
+=== ステータスを返す
--- pgqinf(item)
value = pgqinf(item)
diff --git a/doc/mkdoc.rb b/doc/mkdoc.rb
index 622378d..3d249e0 100644
--- a/doc/mkdoc.rb
+++ b/doc/mkdoc.rb
@@ -38,7 +38,7 @@ whose arguments are modified from original PGPLOT subroutines.
def methoddoc(x)
s=''
x=[x] if String===x
- x.each{|line| s<<line}
+ x.each{|line| s << line}
@stream << s
end
def docbegin; end
@@ -64,7 +64,7 @@ class FormatterHTML < Formatter
def printhead
@stream <<'
<?xml version="1.0" ?>
-<!DOCTYPE html
+<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -98,7 +98,7 @@ h2 {
color: #444444;
border-width: 0 0 thin 7pt;
}
-pre {
+pre {
white-space: pre;
padding: 0.5em;
border-style: solid;
@@ -127,7 +127,7 @@ without his permission.
end
def printtrail
- print <<EOL
+ @stream << <<EOL
</body>
</html>
EOL
@@ -149,8 +149,8 @@ EOL
def methoddoc(x)
s=''
if String===x
- x = [x]
- end
+ x = [x]
+ end
line = x.shift
if line =~ /\(/
@@ -166,7 +166,7 @@ EOL
end
if !x.empty?
@stream << "<pre>\n--- Ruby notes ---\n"
- x.each{|i| @stream<<i}
+ x.each{|i| @stream << i}
@stream << "</pre>\n"
end
end
@@ -300,7 +300,8 @@ pgqvsz:0:1,1,1,1
@mergefunc.sort!
end
- def initialize(formatter)
+ def initialize(formatter, srcdir)
+ @srcdir = srcdir
autofunclist
manualfunclist
mergefunclist
@@ -373,12 +374,11 @@ pgqvsz:0:1,1,1,1
end
def doit
- dir='/home/masa/src/plot/pgplot/src/'
@head.printhead
- @mergefunc.each do |f|
+ @mergefunc.each do |f|
if name = f[/(pg\w+)/]
begin
- fin = open(dir+name+'.f')
+ fin = open(@srcdir+'/'+name+'.f')
rescue
fin = nil
end
@@ -394,7 +394,7 @@ pgqvsz:0:1,1,1,1
end
end
end
- @body << "\n\n"
+ #@body << "\n\n"
end
end
@tail.printtrail
@@ -410,4 +410,4 @@ end
#PgDoc.new(FormatterRD.new(File.open(ARGV[0],"w"))).doit
#PgDoc.new(FormatterHTML.new(File.open(ARGV[0],"w"))).doit
-File.open(ARGV[0],"w") << PgDoc.new(FormatterHTML).doit
+File.open(ARGV[1],"w") << PgDoc.new(FormatterHTML,ARGV[0]).doit
diff --git a/doc/myrd2html.rb b/doc/myrd2html.rb
new file mode 100644
index 0000000..134dc39
--- /dev/null
+++ b/doc/myrd2html.rb
@@ -0,0 +1,42 @@
+while /^--/ =~ ARGV[0]
+ a = ARGV.shift
+ case a
+ when /^--title=(.*)/
+ $title = $1
+ when /^--lang=(.*)/
+ $lang = $1
+ when /^--kw=(.*)/
+ $kw = $1
+ when /^--rt/
+ $rt = true
+ end
+end
+
+rdfile = ARGV.shift
+$date = File.mtime(rdfile).strftime("%b %d %Y")
+
+case $lang
+when 'ja'
+ rd2 = 'rd2 -r ./rd2html-img-lib.rb --html-lang=ja --with-css=./css.css --out-code=utf8'
+else
+ rd2 = 'rd2 -r ./rd2html-img-lib.rb --html-lang=en --with-css=./css.css'
+end
+
+rd2 << " --html-title='#{$title}'" if $title
+rd2 << " -r rd/rt-filter --with-part=RT:rt" if $rt
+
+IO.popen("#{rd2} #{rdfile}", "r") do |f|
+ until f.eof
+ s = f.readline
+ s.sub!(%r|</head>|io) do |x|
+ x = %|<meta name="Keywords" content="#{$kw}"/>\n| + x if $kw
+ x = %|<meta name="author" content="Masahiro Tanaka"/>\n| + x
+ x
+ end
+ s.sub!(%r|</body>|io) do |x|
+ x = %|<div>Last update: #{$date}</div>\n| + x if $date
+ x
+ end
+ puts s
+ end
+end
diff --git a/doc/pgcont.png b/doc/pgcont.png
new file mode 100644
index 0000000..93f356e
Binary files /dev/null and b/doc/pgcont.png differ
diff --git a/doc/pghist.png b/doc/pghist.png
new file mode 100644
index 0000000..6b97401
Binary files /dev/null and b/doc/pghist.png differ
diff --git a/doc/pgimag.png b/doc/pgimag.png
new file mode 100644
index 0000000..429225c
Binary files /dev/null and b/doc/pgimag.png differ
diff --git a/doc/pgline.png b/doc/pgline.png
new file mode 100644
index 0000000..30d2de7
Binary files /dev/null and b/doc/pgline.png differ
diff --git a/doc/pgplot.png b/doc/pgplot.png
new file mode 100644
index 0000000..0d4f640
Binary files /dev/null and b/doc/pgplot.png differ
diff --git a/doc/plot1.png b/doc/plot1.png
new file mode 100644
index 0000000..e0c1105
Binary files /dev/null and b/doc/plot1.png differ
diff --git a/doc/rbpg-ind.rd b/doc/rbpg-ind.rd
deleted file mode 100644
index 3adf11a..0000000
--- a/doc/rbpg-ind.rd
+++ /dev/null
@@ -1,171 +0,0 @@
-
-=begin
-= Ruby/PGPLOT categorized method index
-=== Drawing primitives
-
-* (({((<pgline|URL:rbpgplot.html#PGLINE>))})) -- draw a polyline (curve defined by line-segments)
-* (({((<pgpoly|URL:rbpgplot.html#PGPOLY>))})) -- draw a polygon, using fill-area attributes
-
-* (({((<pgpt1|URL:rbpgplot.html#PGPT1>))})) -- draw one graph marker
-* (({((<pgpt|URL:rbpgplot.html#PGPT>))})) -- draw several graph markers
-* (({((<pgpnts|URL:rbpgplot.html#PGPNTS>))})) -- draw several graph markers, not all the same
-
-* (({((<pgarro|URL:rbpgplot.html#PGARRO>))})) -- draw an arrow
-* (({((<pgcirc|URL:rbpgplot.html#PGCIRC>))})) -- draw a circle, using fill-area attributes
-* (({((<pgrect|URL:rbpgplot.html#PGRECT>))})) -- draw a rectangle, using fill-area attributes
-
-* (({((<pgmove|URL:rbpgplot.html#PGMOVE>))})) -- move pen (change current pen position)
-* (({((<pgdraw|URL:rbpgplot.html#PGDRAW>))})) -- draw a line from the current pen position to a point
-
-=== Axis
-* (({((<pgaxis|URL:rbpgplot.html#PGAXIS>))})) -- draw an axis
-* (({((<pgbox|URL:rbpgplot.html#PGBOX>))})) -- draw labeled frame around viewport
-* (({((<pgtick|URL:rbpgplot.html#PGTICK>))})) -- draw a single tick mark on an axis
-* (({((<pgtbox|URL:rbpgplot.html#PGTBOX>))})) -- draw frame and write (DD) HH MM SS.S labelling
-
-=== Text
-* (({((<pglab|URL:rbpgplot.html#PGLAB>))})) -- write labels for x-axis, y-axis, and top of plot
-
-* (({((<pgtext|URL:rbpgplot.html#PGTEXT>))})) -- write text (horizontal, left-justified)
-* (({((<pgmtxt|URL:rbpgplot.html#PGMTXT>))})) -- write text at position relative to viewport
-* (({((<pgptxt|URL:rbpgplot.html#PGPTXT>))})) -- write text at arbitrary position and angle
-
-* (({((<pgetxt|URL:rbpgplot.html#PGETXT>))})) -- erase text from graphics display
-* (({((<pgiden|URL:rbpgplot.html#PGIDEN>))})) -- write username, date, and time at bottom of plot
-* (({((<pglen|URL:rbpgplot.html#PGLEN>))})) -- find length of a string in a variety of units
-* (({((<pgqtxt|URL:rbpgplot.html#PGQTXT>))})) -- find bounding box of text string
-
-=== Histgram
-* (({((<pgbin|URL:rbpgplot.html#PGBIN>))})) -- histogram of binned data
-* (({((<pghist|URL:rbpgplot.html#PGHIST>))})) -- histogram of unbinned data
-
-=== Error bar
-* (({((<pgerr1|URL:rbpgplot.html#PGERR1>))})) -- horizontal or vertical error bar
-* (({((<pgerrb|URL:rbpgplot.html#PGERRB>))})) -- horizontal or vertical error bar
-* (({((<pgerrx|URL:rbpgplot.html#PGERRX>))})) -- horizontal error bar
-* (({((<pgerry|URL:rbpgplot.html#PGERRY>))})) -- vertical error bar
-
-=== 2D drawing
-* (({((<pgcont|URL:rbpgplot.html#PGCONT>))})) -- contour map of a 2D data array (contour-following)
-* (({((<pgcons|URL:rbpgplot.html#PGCONS>))})) -- contour map of a 2D data array (fast algorithm)
-* (({((<pgconb|URL:rbpgplot.html#PGCONB>))})) -- contour map of a 2D data array, with blanking
-* (({((<pgconf|URL:rbpgplot.html#PGCONF>))})) -- fill between two contours
-* (({((<pgconl|URL:rbpgplot.html#PGCONL>))})) -- label contour map of a 2D data array
-* (({((<pgconx|URL:rbpgplot.html#PGCONX>))})) -- contour map of a 2D data array (non rectangular) (not implemented in Ruby/PGPLOT)
-
-* (({((<pgimag|URL:rbpgplot.html#PGIMAG>))})) -- color image from a 2D data array
-* (({((<pgctab|URL:rbpgplot.html#PGCTAB>))})) -- install the color table to be used by ((<pgimag|URL:rbpgplot.html#PGIMAG>))
-* (({((<pggray|URL:rbpgplot.html#PGGRAY>))})) -- gray-scale map of a 2D data array
-* (({((<pgpixl|URL:rbpgplot.html#PGPIXL>))})) -- draw pixels
-
-* (({((<pgvect|URL:rbpgplot.html#PGVECT>))})) -- vector map of a 2D data array, with blanking
-
-* (({((<pgwedg|URL:rbpgplot.html#PGWEDG>))})) -- annotate an image plot with a wedge
-* (({((<pghi2d|URL:rbpgplot.html#PGHI2D>))})) -- cross-sections through a 2D data array
-
-=== Cursor
-* (({((<pgband|URL:rbpgplot.html#PGBAND>))})) -- read cursor position, with anchor
-* (({((<pgcurs|URL:rbpgplot.html#PGCURS>))})) -- read cursor position
-* (({((<pglcur|URL:rbpgplot.html#PGLCUR>))})) -- draw a line using the cursor
-* (({((<pgncur|URL:rbpgplot.html#PGNCUR>))})) -- mark a set of points using the cursor
-* (({((<pgolin|URL:rbpgplot.html#PGOLIN>))})) -- mark a set of points using the cursor
-
-=== Control
-* (({((<pgopen|URL:rbpgplot.html#PGOPEN>))})) -- open a graphics device
-* (({((<pgbeg|URL:rbpgplot.html#PGBEG>))})) -- open a graphics device
-* (({((<pgclos|URL:rbpgplot.html#PGCLOS>))})) -- close the selected graphics device
-* (({((<pgend|URL:rbpgplot.html#PGEND>))})) -- close all open graphics devices
-
-* (({((<pgenv|URL:rbpgplot.html#PGENV>))})) -- set window and viewport and draw labeled frame
-
-* (({((<pgask|URL:rbpgplot.html#PGASK>))})) -- control new page prompting
-* (({((<pgpage|URL:rbpgplot.html#PGPAGE>))})) -- advance to new page
-* (({((<pgeras|URL:rbpgplot.html#PGERAS>))})) -- erase all graphics from current page
-* (({((<pgbbuf|URL:rbpgplot.html#PGBBUF>))})) -- begin batch of output (buffer)
-* (({((<pgebuf|URL:rbpgplot.html#PGEBUF>))})) -- end batch of output (buffer)
-* (({((<pgpanl|URL:rbpgplot.html#PGPANL>))})) -- switch to a different panel on the view surface
-* (({((<pgpap|URL:rbpgplot.html#PGPAP>))})) -- change the size of the view surface
-* (({((<pgrnge|URL:rbpgplot.html#PGRNGE>))})) -- choose axis limits
-* (({((<pgsave|URL:rbpgplot.html#PGSAVE>))})) -- save PGPLOT attributes
-* (({((<pgunsa|URL:rbpgplot.html#PGUNSA>))})) -- restore PGPLOT attributes
-* (({((<pgscrl|URL:rbpgplot.html#PGSCRL>))})) -- scroll window
-* (({((<pgsubp|URL:rbpgplot.html#PGSUBP>))})) -- subdivide view surface into panels
-* (({((<pgupdt|URL:rbpgplot.html#PGUPDT>))})) -- update display
-
-=== Set attributes
-* (({((<pgsah|URL:rbpgplot.html#PGSAH>))})) -- set arrow-head style
-* (({((<pgscf|URL:rbpgplot.html#PGSCF>))})) -- set character font
-* (({((<pgsch|URL:rbpgplot.html#PGSCH>))})) -- set character height
-* (({((<pgsci|URL:rbpgplot.html#PGSCI>))})) -- set color index
-* (({((<pgscir|URL:rbpgplot.html#PGSCIR>))})) -- set color index range
-* (({((<pgsclp|URL:rbpgplot.html#PGSCLP>))})) -- enable or disable clipping at edge of viewport
-* (({((<pgscr|URL:rbpgplot.html#PGSCR>))})) -- set color representation
-* (({((<pgscrn|URL:rbpgplot.html#PGSCRN>))})) -- set color representation by name
-* (({((<pgsfs|URL:rbpgplot.html#PGSFS>))})) -- set fill-area style
-* (({((<pgshls|URL:rbpgplot.html#PGSHLS>))})) -- set color representation using HLS system
-* (({((<pgshs|URL:rbpgplot.html#PGSHS>))})) -- set hatching style
-* (({((<pgsitf|URL:rbpgplot.html#PGSITF>))})) -- set image transfer function
-* (({((<pgslct|URL:rbpgplot.html#PGSLCT>))})) -- select an open graphics device
-* (({((<pgsls|URL:rbpgplot.html#PGSLS>))})) -- set line style
-* (({((<pgslw|URL:rbpgplot.html#PGSLW>))})) -- set line width
-* (({((<pgstbg|URL:rbpgplot.html#PGSTBG>))})) -- set text background color index
-* (({((<pgsvp|URL:rbpgplot.html#PGSVP>))})) -- set viewport (normalized device coordinates)
-* (({((<pgswin|URL:rbpgplot.html#PGSWIN>))})) -- set window
-* (({((<pgvsiz|URL:rbpgplot.html#PGVSIZ>))})) -- set viewport (inches)
-* (({((<pgvstd|URL:rbpgplot.html#PGVSTD>))})) -- set standard (default) viewport
-* (({((<pgwnad|URL:rbpgplot.html#PGWNAD>))})) -- set window and adjust viewport to same aspect ratio
-
-=== Inquire attributes
-* (({((<pgldev|URL:rbpgplot.html#PGLDEV>))})) -- list available device types on standard output
-* (({((<pgqah|URL:rbpgplot.html#PGQAH>))})) -- inquire arrow-head style
-* (({((<pgqcf|URL:rbpgplot.html#PGQCF>))})) -- inquire character font
-* (({((<pgqch|URL:rbpgplot.html#PGQCH>))})) -- inquire character height
-* (({((<pgqci|URL:rbpgplot.html#PGQCI>))})) -- inquire color index
-* (({((<pgqcir|URL:rbpgplot.html#PGQCIR>))})) -- inquire color index range
-* (({((<pgqclp|URL:rbpgplot.html#PGQCLP>))})) -- inquire clipping status
-* (({((<pgqcol|URL:rbpgplot.html#PGQCOL>))})) -- inquire color capability
-* (({((<pgqcr|URL:rbpgplot.html#PGQCR>))})) -- inquire color representation
-* (({((<pgqcs|URL:rbpgplot.html#PGQCS>))})) -- inquire character height in a variety of units
-* (({((<pgqdt|URL:rbpgplot.html#PGQDT>))})) -- inquire name of nth available device type
-* (({((<pgqfs|URL:rbpgplot.html#PGQFS>))})) -- inquire fill-area style
-* (({((<pgqhs|URL:rbpgplot.html#PGQHS>))})) -- inquire hatching style
-* (({((<pgqid|URL:rbpgplot.html#PGQID>))})) -- inquire current device identifier
-* (({((<pgqinf|URL:rbpgplot.html#PGQINF>))})) -- inquire PGPLOT general information
-* (({((<pgqitf|URL:rbpgplot.html#PGQITF>))})) -- inquire image transfer function
-* (({((<pgqls|URL:rbpgplot.html#PGQLS>))})) -- inquire line style
-* (({((<pgqlw|URL:rbpgplot.html#PGQLW>))})) -- inquire line width
-* (({((<pgqndt|URL:rbpgplot.html#PGQNDT>))})) -- inquire number of available device types
-* (({((<pgqpos|URL:rbpgplot.html#PGQPOS>))})) -- inquire current pen position
-* (({((<pgqtbg|URL:rbpgplot.html#PGQTBG>))})) -- inquire text background color index
-* (({((<pgqvp|URL:rbpgplot.html#PGQVP>))})) -- inquire viewport size and position
-* (({((<pgqvsz|URL:rbpgplot.html#PGQVSZ>))})) -- inquire size of view surface
-* (({((<pgqwin|URL:rbpgplot.html#PGQWIN>))})) -- inquire window boundary coordinates
-
-==== Hereafter not implemented in Ruby/PGPLOT
-
-=== Utility
-* (({((<pgnumb|URL:rbpgplot.html#PGNUMB>))})) -- convert a number into a plottable character string
-* (({((<pgrnd|URL:rbpgplot.html#PGRND>))})) -- find the smallest `round' number greater than x
-
-=== Drawing function
-* (({((<pgfunt|URL:rbpgplot.html#PGFUNT>))})) -- function defined by X = F(T), Y = G(T)
-* (({((<pgfunx|URL:rbpgplot.html#PGFUNX>))})) -- function defined by Y = F(X)
-* (({((<pgfuny|URL:rbpgplot.html#PGFUNY>))})) -- function defined by X = F(Y)
-
-=== Alias
-* (({((<pgadvance|URL:rbpgplot.html#PGADVANCE>))})) -- non-standard alias for ((<pgpage|URL:rbpgplot.html#PGPAGE>))
-* (({((<pgbegin|URL:rbpgplot.html#PGBEGIN>))})) -- non-standard alias for ((<pgbeg|URL:rbpgplot.html#PGBEG>))
-* (({((<pgcurse|URL:rbpgplot.html#PGCURSE>))})) -- non-standard alias for ((<pgcurs|URL:rbpgplot.html#PGCURS>))
-* (({((<pglabel|URL:rbpgplot.html#PGLABEL>))})) -- non-standard alias for ((<pglab|URL:rbpgplot.html#PGLAB>))
-* (({((<pgmtext|URL:rbpgplot.html#PGMTEXT>))})) -- non-standard alias for ((<pgmtxt|URL:rbpgplot.html#PGMTXT>))
-* (({((<pgncurse|URL:rbpgplot.html#PGNCURSE>))})) -- non-standard alias for ((<pgncur|URL:rbpgplot.html#PGNCUR>))
-* (({((<pgpaper|URL:rbpgplot.html#PGPAPER>))})) -- non-standard alias for ((<pgpap|URL:rbpgplot.html#PGPAP>))
-* (({((<pgpoint|URL:rbpgplot.html#PGPOINT>))})) -- non-standard alias for ((<pgpt|URL:rbpgplot.html#PGPT>))
-* (({((<pgptext|URL:rbpgplot.html#PGPTEXT>))})) -- non-standard alias for ((<pgptxt|URL:rbpgplot.html#PGPTXT>))
-* (({((<pgvport|URL:rbpgplot.html#PGVPORT>))})) -- non-standard alias for ((<pgsvp|URL:rbpgplot.html#PGSVP>))
-* (({((<pgvsize|URL:rbpgplot.html#PGVSIZE>))})) -- non-standard alias for ((<pgvsiz|URL:rbpgplot.html#PGVSIZ>))
-* (({((<pgvstand|URL:rbpgplot.html#PGVSTAND>))})) -- non-standard alias for ((<pgvstd|URL:rbpgplot.html#PGVSTD>))
-* (({((<pgwindow|URL:rbpgplot.html#PGWINDOW>))})) -- non-standard alias for ((<pgswin|URL:rbpgplot.html#PGSWIN>))
-
-<<< trailer
-=end
diff --git a/doc/tutorial-01.ja.rd b/doc/tutorial-01.ja.rd
index 4b0f112..7613c5e 100644
--- a/doc/tutorial-01.ja.rd
+++ b/doc/tutorial-01.ja.rd
@@ -1,72 +1,72 @@
=begin
-= Ruby/PGPLOT Ƴ����
+= Ruby/PGPLOT 導入編
-== �ޤ�������դ�����
+== 折れ線グラフを描く
-Ruby/PGPLOT���ޤ�������դ������Ǿ��¤Υ�����ץȤϡ��ʲ��Τ褦�ˤʤ�ޤ���
+Ruby/PGPLOTで折れ線グラフを描く最小限のスクリプトは、以下のようになります。
require 'narray'
require 'pgplot'
include Pgplot
- pgopen # �ǥХ�����
- pgenv( 0, 5, 0, 5 ) # �Ȥ����������
- pgline( [1,2,3,4], [1,4,1,4] ) # �ޤ���������
+ pgopen # デバイスを開く
+ pgenv( 0, 5, 0, 5 ) # 枠の設定と描画
+ pgline( [1,2,3,4], [1,4,1,4] ) # 折れ線の描画
-�ʲ����Υ�����ץȤˤĤ��ƾܤ����������ޤ���
-1���ܡ�2���ܤdz�ĥ�饤�֥����ɤ��ޤ���
+以下このスクリプトについて詳しく説明します。
+1行目、2行目で拡張ライブラリをロードします。
-3���ܤǤ� Pgplot�⥸�塼��롼�ɤ��Ƥ��ޤ���
-����ʤ��� Pgplot�Υ�åɤ�Ƥ֤Ȥ���``Pgplot.pgopen'' �Ȥ����褦��
-�⥸�塼��̾���åɤ����˾�ά���ʤ��ǽʤ���Фʤ�ޤ���
-���롼�ɤ��뤫�ɤ����Ͼ��ˤ��ޤ���
-Pgplot�⥸�塼��Υ�å�̾��(���ΤȤ���)�� ``pg'' �ǻϤޤäƤ���Τǡ�
-����Ĥ����̾�����֤Ĥ����Ψ���㤤�Ȼפ��ޤ�����
-�μ¤�����ʤ饤�롼�ɤ��ʤ������褤���⤷��ޤ���
+3行目では Pgplotモジュールをインクルードしています。
+これをしないと Pgplotのメソッドを呼ぶとき、``Pgplot.pgopen'' というように
+モジュール名をメソッドの前に省略しないで書かなければなりません。
+インクルードするかどうかは場合によります。
+Pgplotモジュールのメソッド名は(今のところ)皆 ``pg'' で始まっているので、
+気をつければ名前がぶつかる確率は低いと思いますが、
+確実を期すならインクルードしない方がよいかもしれません。
-4���ܤ� pgopen �� PGPLOT �Υ���ե������ǥХ������ޤ���
-�����ǰ����ʤ��Ȼ��Ѥ���ǥХ�����ʹ���Ƥ��ޤ���
+4行目の pgopen で PGPLOT のグラフィクスデバイスを開きます。
+ここで引数を書かないと使用するデバイスを聞いてきます。
- Graphics device/type (? to see list, default /xwin):
+ Graphics device/type (? to see list, default /xwin):
-�ǥե���ȤΤޤޤ��ɤ����ñ�˥�������ޤ���
-�ǥե���ȤΥǥХ����ϴĶ��ѿ� PGPLOT_DEV �����ꤷ����ΤˤʤäƤ��ޤ���
-`?'�ȥ������Ǥ�����ȡ����ѤǤ���ǥХ����ΰ�����ɽ�������Τǡ�
-�����椫���̤ΥǥХ��������뤳�Ȥ�Ǥ��ޤ���
-�㤨�С�PNG�Ȥ��ƥե�����˽Ф������Ȥ��ϡ�
-``plot1.png/png'' �Τ褦�ˡ֥ե�����̾/�ǥХ���̾�פȤ����褦�˻��ꤷ�ޤ���
+デフォルトのままで良ければ単にリターンキーを押します。
+デフォルトのデバイスは環境変数 PGPLOT_DEV で設定したものになっています。
+`?'とリターンを打ち込むと、使用できるデバイスの一覧が表示されるので、
+その中から別のデバイスを選択することもできます。
+例えば、PNGとしてファイルに書き出したいときは、
+``plot1.png/png'' のように「ファイル名/デバイス名」というように指定します。
-5���ܤ�
+5行目の
pgenv( 0, 5, 0, 5 )
-�ˤ�ꡢ����դμ�����ꤷ���Ȥ����������褷�ޤ���
-����� x-min, x-max, y-min, y-max �ν�Ǥ���
-�����Ǥ�X����0����5��Y����0����5�ޤǤ��ϰϤ��Ȥ������ޤ���
-�ʹߤϤ��������ꤵ�줿��ɸ���Ȥ����褷�ޤ���
+により、グラフの軸を決定し、枠と目盛を描画します。
+引数は x-min, x-max, y-min, y-max の順です。
+ここではX軸が0から5、Y軸が0から5までの範囲の枠を描きます。
+以降はここで設定された座標をもとに描画します。
-�����Ƥ��褤�衢6���ܤ�
+そしていよいよ、6行目の
pgline( [1,2,3,4], [1,4,1,4] )
-�ǡ��ޤ�������դ������ޤ���
-����ˤ�����������X��ɸ��Y��ɸ�줾��������Ϥ��ޤ���
+で、折れ線グラフを描きます。
+引数には線を結ぶ点のX座標とY座標をそれぞれ配列で渡します。
-�����ޤ���������С����Τ褦�ʥ���դ�������Ƥ���Ϥ��Ǥ���
+ここまで成功すれば、このようなグラフが描かれているはずです。
<<< plot1.png
-�ʾ夬�ޤ�������դ������Τ˺����ɬ�פʥ�åɤǤ���
+以上が折れ線グラフを描くのに最低限必要なメソッドです。
-�Ȥ���ǡ����Υ�����ץȤˤϥǥХ������Ĥ����åɤ�����ޤ���
-C��FORTRAN�Ǥ�PGPLOT�Ǥ���С�
-�����ǺǸ�� pgend ��Ƥ�ǥǥХ������Ĥ���ɬ�פ�����ޤ���
-�������ʤ��ȡ��ǥХ����� Postscript �ʤɤΤȤ���
-��λ����������ʤ��Τǡ��Դ����ʥե����뤬�Ǥ��Ƥ��ޤ��ޤ���
-������ Ruby/PGPLOT�Ǥϡ�Ruby���ץ��λ����
-pgend ��ưŪ�˸Ƥ֤褦�ˤʤäƤ���Τǡ�
-ɬ������Ǹ�� pgend ��Ƥ�ɬ�פϤ���ޤ���
-������Ruby�μ¹������PGPLOT��λ�������Ȥ��Τ����
-Ruby�ǤǤ� pgend ��åɤ��Ѱդ��Ƥ���ޤ���
+ところで、このスクリプトにはデバイスを閉じるメソッドがありません。
+CかFORTRAN版のPGPLOTであれば、
+ここで最後に pgend を呼んでデバイスを閉じる必要があります。
+そうしないと、デバイスが Postscript などのとき、
+終了処理がされないので、不完全なファイルができてしまいます。
+しかし Ruby/PGPLOTでは、Rubyインタプリタ終了時に
+pgend を自動的に呼ぶようになっているので、
+必ずしも最後に pgend を呼ぶ必要はありません。
+ただしRubyの実行途中でPGPLOTを終了したいときのために
+Ruby版でも pgend メソッドは用意してあります。
-�ʲ�³��(���⤷��ʤ�)
+以下続く(かもしれない)
<<< trailer
=end
diff --git a/doc/up.sh b/doc/up.sh
new file mode 100644
index 0000000..256032b
--- /dev/null
+++ b/doc/up.sh
@@ -0,0 +1,17 @@
+sftp rubyforge <<EOF
+cd /var/www/gforge-projects/pgplot
+put index.html
+put pgcont.html
+put pghist.html
+put pgimag.html
+put pgline.html
+put rbpg-ind.html
+put rbpgplot.html
+put install.html.ja
+put method.html.ja
+put tutorial-01.html.ja
+put ../README
+put ../README.ja
+put *.png
+quit
+EOF
diff --git a/ext/build_lib/Makefile b/ext/build_lib/Makefile
new file mode 100644
index 0000000..85289d2
--- /dev/null
+++ b/ext/build_lib/Makefile
@@ -0,0 +1,29 @@
+pkg=pgplot5.2.tar.gz
+uri=ftp://ftp.astro.caltech.edu/pub/pgplot/$(pkg)
+sd=pgplot
+bd=build
+
+all: $(bd)/makefile
+ (cd $(bd); make all cpg)
+
+$(pkg):
+ ruby download.rb $(uri)
+
+$(sd)/drivers.list: $(pkg)
+ gunzip -c $(pkg) | tar xf -
+ touch $(sd)/drivers.list
+
+$(bd)/drivers.list: drivers.conf $(sd)/drivers.list
+ ruby drivers.rb $(sd) $(bd)
+
+$(bd)/makefile: $(bd)/drivers.list
+ ruby makefile.rb $(sd) $(bd)
+
+$(bd)/libpgplot.a: $(bd)/makefile
+ (cd $(bd); make libpgplot.a grfont.dat)
+
+$(bd)/pgxwin_server: $(bd)/makefile
+ (cd $(bd); make pgxwin_server)
+
+$(bd)/libcpgplot.a: $(bd)/libpgplot.a
+ (cd $(bd); make libcpgplot.a)
diff --git a/ext/build_lib/download.rb b/ext/build_lib/download.rb
new file mode 100644
index 0000000..f1e0a49
--- /dev/null
+++ b/ext/build_lib/download.rb
@@ -0,0 +1,14 @@
+require 'uri'
+require 'net/ftp'
+
+pkg_uri = ARGV[0] || "ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz"
+
+uri = URI.parse(pkg_uri)
+tar_file = File.basename(uri.path)
+
+Net::FTP.open(uri.host) do |ftp|
+ ftp.login
+ ftp.passive = true
+ puts "downloading #{tar_file} ..."
+ ftp.getbinaryfile(uri.path, tar_file, 1024)
+end
diff --git a/ext/build_lib/drivers.rb b/ext/build_lib/drivers.rb
new file mode 100644
index 0000000..76eefa1
--- /dev/null
+++ b/ext/build_lib/drivers.rb
@@ -0,0 +1,24 @@
+require 'fileutils'
+
+$src_dir = ARGV[0] || 'pgplot'
+$build_dir = ARGV[1] || 'build'
+
+FileUtils.rm_rf $build_dir
+Dir.mkdir $build_dir
+
+drivers = File.read('drivers.conf').split(/\s+/)
+
+File.open(File.join($build_dir,"drivers.list"),"w") do |w|
+ File.open(File.join($src_dir,"drivers.list"),"r") do |r|
+ r.each_line do |l|
+ l.chomp!
+ drivers.each do |d|
+ if /^!( #{d} .*)$/ =~ l
+ l = $1
+ break
+ end
+ end
+ w.puts l
+ end
+ end
+end
diff --git a/ext/build_lib/makefile.rb b/ext/build_lib/makefile.rb
new file mode 100644
index 0000000..cc89da9
--- /dev/null
+++ b/ext/build_lib/makefile.rb
@@ -0,0 +1,54 @@
+$src_dir = ARGV[0] || 'pgplot'
+$build_dir = ARGV[1] || 'build'
+
+case RUBY_PLATFORM
+when /-linux$/
+ os='linux'
+when /-cygwin$/
+ os='cygwin'
+when /-freebsd$/
+ os='freebsd'
+when /-bsd$/
+ os='bsd'
+when /sparc-solaris$/
+ os='sol2'
+when /x86-solaris$/
+ os='solx86'
+else
+ raise "RUBY_PLATFORM=#{RUBY_PLATFORM}: not supported"
+end
+puts "Platform = "+os
+
+
+def find_cmd(a)
+ a.each do |cmd|
+ if system("which #{cmd}")
+ return cmd
+ end
+ end
+ raise "No FORTRAN compiler found in: [#{a.join(' ')}]"
+end
+
+fc = find_cmd %w[gfortran g77]
+puts "FORTRAN compiler = "+fc
+puts
+
+Dir.chdir $build_dir do
+ cmd="../#{$src_dir}/makemake ../#{$src_dir} #{os} g77_gcc"
+ puts cmd+' ...'
+ s=system cmd
+ raise "failed: #{cmd}" if !s
+
+ File.rename "makefile", "makefile.orig"
+ File.open("makefile","w") do |w|
+ File.open("makefile.orig","r") do |r|
+ r.each_line do |l|
+ l.chomp!
+ l.sub!(/g77/,"gfortran") if fc=='gfortran'
+ if /^pndriv\.o : / !~ l
+ w.puts l
+ end
+ end
+ end
+ end
+end
diff --git a/cogen.rb b/ext/cogen.rb
similarity index 94%
rename from cogen.rb
rename to ext/cogen.rb
index d5d526a..aabbae4 100644
--- a/cogen.rb
+++ b/ext/cogen.rb
@@ -72,6 +72,7 @@ pgswin:1,1,1,1:
pgqch::1
pgqcf::0
pgqci::0
+pgqcs:0:1,1
pgqfs::0
pgqls::0
pgqlw::0
@@ -97,7 +98,7 @@ def pgfuncgen(name, inp, out)
ninp = inp.size
nout = out.size
# int->0, float->1
- val2 = ["NUM2INT","NUM2DBL","STR2CSTR"]
+ val2 = ["NUM2INT","NUM2DBL","StringValuePtr"]
type = ["int","float",nil]
conv = ["INT2NUM","rb_float_new",nil]
# Initialize Array
@@ -118,8 +119,11 @@ def pgfuncgen(name, inp, out)
retn = "Qtrue";
elsif nout>1 then
retn = "rb_ary_new3(#{nout},"+retn.join(",")+")"
+ else
+ retn = retn.join("")
end
+ vars = vars.join("")
prot = prot.join(",")
pass = pass.join(",")
@@ -151,4 +155,4 @@ def cogen_pgplot
end
end
-cogen_pgplot
+cogen_pgplot if $0 == __FILE__
diff --git a/depend b/ext/depend
similarity index 100%
rename from depend
rename to ext/depend
diff --git a/ext/extconf-auto.rb b/ext/extconf-auto.rb
new file mode 100644
index 0000000..64020d1
--- /dev/null
+++ b/ext/extconf-auto.rb
@@ -0,0 +1,72 @@
+# extconf.rb : Configure script for Ruby/PGPLOT
+#
+# Copyright (c) 2000,2001 Masahiro TANAKA <masa at ir.isas.ac.jp>
+#
+# This program is free software.
+# You can distribute/modify this program
+# under the same terms as Ruby itself.
+# NO WARRANTY.
+#
+# usage: ruby extconf.rb [configure options]
+
+# Narray is now Gem based, so require rubygems
+# so that we can use Gem class to find narray.
+
+load "./extconf.rb"
+
+exit if $have_pgplot
+exit unless %w[gfortran g77].any?{|cmd| system("which #{cmd}")}
+
+puts "enabling auto-build PGPLOT Library..."
+
+$subdir = 'build_lib'
+
+$CFLAGS = "-I#{$subdir}/build "+$CFLAGS
+$LDFLAGS = "-L#{$subdir}/build "+$LDFLAGS
+
+$libs = append_library($libs, "pgplot")
+$libs = append_library($libs, "cpgplot")
+$defs.push '-DPGPLOT_DIR=\\"$(PGPLOT_DIR)\\"'
+
+# Generate Makefile
+create_makefile("pgplot")
+
+# Append PGPLOT install task to Makefile
+if $makefile_created
+ puts "appending extra install tasks to Makefile"
+ File.open("Makefile","a") do |w|
+ w.print <<EOL
+
+PGPLOT_DIR = $(RUBYARCHDIR)/pgplot
+PGPLOT_BUILD = #{$subdir}/build
+
+$(PGPLOT_BUILD)/libcpgplot.a:
+ (cd #{$subdir}; make build/libcpgplot.a)
+$(PGPLOT_BUILD)/cpgplot.h: $(PGPLOT_BUILD)/libcpgplot.a
+rb_pgplot.o: $(PGPLOT_BUILD)/cpgplot.h
+$(DLLIB): $(PGPLOT_BUILD)/libcpgplot.a
+
+install: install-pgplot
+install-pgplot:
+ $(MAKEDIRS) $(PGPLOT_DIR)
+ $(INSTALL_DATA) $(PGPLOT_BUILD)/grfont.dat $(PGPLOT_DIR)
+ $(INSTALL_DATA) $(PGPLOT_BUILD)/rgb.txt $(PGPLOT_DIR)
+EOL
+ if $found_lib.include? "X11"
+ w.print <<EOL
+ $(INSTALL_PROG) $(PGPLOT_BUILD)/pgxwin_server $(PGPLOT_DIR)
+
+$(PGPLOT_BUILD)/pgxwin_server: $(PGPLOT_BUILD)/cpgplot.h
+ (cd #{$subdir}; make build/pgxwin_server)
+$(DLLIB): $(PGPLOT_BUILD)/pgxwin_server
+EOL
+ end
+ end
+
+ puts "creating #{$subdir}/drivers.conf"
+ File.open("#{$subdir}/drivers.conf","w") do |w|
+ w.puts "GIDRIV PPDRIV PSDRIV"
+ w.puts "PNDRIV" if $found_lib.include? "png"
+ w.puts "WDDRIV XWDRIV" if $found_lib.include? "X11"
+ end
+end
diff --git a/extconf.rb b/ext/extconf.rb
similarity index 59%
rename from extconf.rb
rename to ext/extconf.rb
index 3fabb54..f576b30 100644
--- a/extconf.rb
+++ b/ext/extconf.rb
@@ -9,6 +9,8 @@
#
# usage: ruby extconf.rb [configure options]
+# Narray is now Gem based, so require rubygems
+# so that we can use Gem class to find narray.
require "mkmf"
#$DEBUG = true
@@ -30,12 +32,36 @@ dir_config("pgplot")
# --with-opt-include=path
# --with-opt-lib=path
-# Check PGPLOT Header
-exit unless have_header("cpgplot.h")
+def find_dir_w_file(d,h)
+ g = Dir.glob(RbConfig.expand(d+"/"+h))
+ File.dirname(g.last) if g and !g.empty?
+end
+
+def find_dir_in_gemspec
+ begin
+ require 'rubygems'
+ if gemspec=Gem::Specification.find_by_path('narray')
+ return File.join(gemspec.full_gem_path, gemspec.require_path)
+ end
+ rescue
+ end
+ nil
+end
# Check NArray
-$CPPFLAGS = " -I#{CONFIG['sitearchdir']} "+$CPPFLAGS
+gems_dir="$(rubylibprefix)/gems/$(ruby_version)/gems/"
+narray_d="narray-0.[56].*"
+narray_h="narray.h"
+if narray_h_dir =
+ find_dir_in_gemspec ||
+ find_dir_w_file("../"+narray_d,narray_h) ||
+ find_dir_w_file(gems_dir+narray_d,narray_h) ||
+ find_dir_w_file(CONFIG['sitearchdir'],narray_h) ||
+ find_dir_w_file(CONFIG['archdir'],narray_h)
+ $CPPFLAGS = " -I#{narray_h_dir} " + $CPPFLAGS
+end
exit unless have_header("narray.h")
+
if RUBY_PLATFORM =~ /cygwin|mingw/
$LDFLAGS = " -L#{CONFIG['sitearchdir']} "+$LDFLAGS
exit unless have_library("narray","na_make_object")
@@ -73,23 +99,39 @@ if with_config("grwin")
end
exit unless have_library("GrWin", "GWinit")
end
-#
+
+$found_lib = []
+
# Check X11 Library
-have_library("X11", "XOpenDisplay")
+if have_library("X11", "XOpenDisplay")
+ $found_lib << 'X11'
+end
# Check PNG Library
libs_save = $libs
$libs = append_library($libs, "z")
-if !have_library("png","png_create_write_struct")
+if have_library("png","png_create_write_struct")
+ $found_lib << 'png'
+else
$libs = libs_save
end
-# Check PGPLOT Library
$libs = append_library($libs, "pgplot")
-exit unless find_library( "cpgplot", "cpgbeg", "/usr/lib",
- "/usr/local/lib", "/usr/local/pgplot" )
+$have_pgplot = false
+
+# Check PGPLOT Header
+if have_header("cpgplot.h")
+
+ # Check PGPLOT Library
+ if find_library("cpgplot","cpgbeg", "/usr/lib",
+ "/usr/local/lib", "/usr/local/pgplot" )
+ $have_pgplot = true
+ end
+end
$objs = %w(rb_pgplot.o kwarg.o)
-# Generate Makefile
-create_makefile("pgplot")
+if $have_pgplot
+ # Generate Makefile
+ create_makefile("pgplot")
+end
diff --git a/kwarg.c b/ext/kwarg.c
similarity index 91%
rename from kwarg.c
rename to ext/kwarg.c
index a03630c..5ab06c0 100644
--- a/kwarg.c
+++ b/ext/kwarg.c
@@ -18,7 +18,7 @@ kw_hash_i(i, tmp)
{
VALUE key;
- key = RARRAY(i)->ptr[0];
+ key = RARRAY_PTR(i)[0];
if (TYPE(key)==T_SYMBOL) {
key = rb_funcall(key, rb_intern("id2name"), 0);
} else
@@ -26,7 +26,7 @@ kw_hash_i(i, tmp)
rb_raise(rb_eArgError, "keywords must be String or Symbol");
}
- rb_hash_aset(tmp, key, RARRAY(i)->ptr[1]);
+ rb_hash_aset(tmp, key, RARRAY_PTR(i)[1]);
return Qnil;
}
@@ -71,7 +71,7 @@ rb_scan_kw_args(hash, va_alist)
if (rb_funcall(tmp, rb_intern("empty?"), 0)==Qfalse) {
val = rb_funcall(tmp, rb_intern("keys"), 0);
val = rb_funcall(val, rb_intern("join"), 1, rb_str_new2(","));
- rb_raise(rb_eArgError, "unknown keywords: %s",STR2CSTR(val));
+ rb_raise(rb_eArgError, "unknown keywords: %s",StringValuePtr(val));
}
va_end(vargs);
diff --git a/rb_pgplot.c.in b/ext/rb_pgplot.c.in
similarity index 96%
rename from rb_pgplot.c.in
rename to ext/rb_pgplot.c.in
index f9a8cfe..11d242c 100644
--- a/rb_pgplot.c.in
+++ b/ext/rb_pgplot.c.in
@@ -12,6 +12,7 @@
#include <cpgplot.h>
#include <ruby.h>
#include "narray.h"
+#include "version.h"
#define min(a,b) (((a)<(b))?(a):(b))
#define rb_pgplot_fltary(obj) na_cast_object(obj,NA_SFLOAT)
@@ -86,10 +87,10 @@ static VALUE
rb_pgplot_pgopen( int argc, VALUE *argv, VALUE self )
{
VALUE vdev;
- char *dev="?";
+ const char *dev="?";
rb_scan_args(argc,argv, "01", &vdev);
- if (vdev!=Qnil) dev = STR2CSTR(vdev);
+ if (vdev!=Qnil) dev = StringValuePtr(vdev);
return INT2NUM(cpgopen(dev));
}
@@ -101,10 +102,10 @@ static VALUE
{
VALUE vdev, vnxs, vnys;
int nxsub=1, nysub=1;
- char *dev="?";
+ const char *dev="?";
rb_scan_args(argc, argv, "03", &vdev,&vnxs,&vnys);
- if (vdev!=Qnil) dev = STR2CSTR(vdev);
+ if (vdev!=Qnil) dev = StringValuePtr(vdev);
if (vnxs!=Qnil) nxsub = NUM2INT(vnxs);
if (vnys!=Qnil) nysub = NUM2INT(vnys);
@@ -124,7 +125,7 @@ static VALUE
just: if just=1, the x and y axes is scaled equally,
otherwise scaled independently.
axis: controls of axes.
-*/
+*/
static VALUE
rb_pgplot_pgenv( int argc, VALUE *argv, VALUE self )
{
@@ -260,8 +261,8 @@ static VALUE
/* Data Range */
if (vrange!=Qnil) {
- range[0] = NUM2DBL(rb_ivar_get(vrange, id_beg));
- range[1] = NUM2DBL(rb_ivar_get(vrange, id_end));
+ range[0] = NUM2DBL(rb_funcall(vrange, id_beg, 0));
+ range[1] = NUM2DBL(rb_funcall(vrange, id_end, 0));
} else {
rb_pgplot_minmax(na_dat,range);
}
@@ -309,14 +310,14 @@ static void
/* PGERRB -- horizontal or vertical error bar
pgerrb, dir, x, y, err [,tlen]
- dir : direction to plot the error bar relative to the data point.
+ dir : direction to plot the error bar relative to the data point.
One-sided error bar:
DIR is 1 for +X (X to X+E);
2 for +Y (Y to Y+E);
3 for -X (X to X-E);
4 for -Y (Y to Y-E).
Two-sided error bar:
- DIR is 5 for +/-X (X-E to X+E);
+ DIR is 5 for +/-X (X-E to X+E);
6 for +/-Y (Y-E to Y+E).
x : world x-coordinates of the data.
y : world y-coordinates of the data.
@@ -383,8 +384,8 @@ static void
{
/* if Range class is set, extrant begin&end */
if (vrange!=Qnil) {
- range[0] = NUM2DBL(rb_ivar_get(vrange, id_beg));
- range[1] = NUM2DBL(rb_ivar_get(vrange, id_end));
+ range[0] = NUM2DBL(rb_funcall(vrange, id_beg, 0));
+ range[1] = NUM2DBL(rb_funcall(vrange, id_end, 0));
} else {
/* if Range is not set, search min&max of array */
rb_pgplot_minmax(na,range);
@@ -500,9 +501,9 @@ static VALUE
return Qtrue;
}
-/* PGCONL -- label contour map of a 2D data array
+/* PGCONL -- label contour map of a 2D data array
pgconl, map, cont, label [,intval, minint, tr]
- map : 2-D array of map data
+ map : 2-D array of map data
cont : contour level tobe labeld
label : label string
intval : spacing along the contour between labels, in grid cells.
@@ -531,7 +532,7 @@ static VALUE
/* Show Contour */
cpgconl( NA_PTR_FLT(na_map), NA_SHAPE0(na_map), NA_SHAPE1(na_map),
1, NA_SHAPE0(na_map), 1, NA_SHAPE1(na_map),
- NUM2DBL(vcnt), tr, STR2CSTR(vlab), intval, minint);
+ NUM2DBL(vcnt), tr, StringValuePtr(vlab), intval, minint);
return Qtrue;
}
@@ -624,7 +625,7 @@ static VALUE
else
cpggray( NA_PTR_FLT(na), NA_SHAPE0(na), NA_SHAPE1(na),
1, NA_SHAPE0(na), 1, NA_SHAPE1(na),
- range[0], range[1], tr );
+ range[0], range[1], tr );
return Qtrue;
}
@@ -774,7 +775,7 @@ static VALUE
int value_len=20;
char *item, *value;
- item = STR2CSTR(vitem);
+ item = StringValuePtr(vitem);
value = ALLOCA_N(char,value_len);
cpgqinf( item, value, &value_len );
@@ -819,7 +820,7 @@ static VALUE
VALUE vx,vy;
int i;
float xbox[4], ybox[4];
- char *txt = STR2CSTR(text);
+ char *txt = StringValuePtr(text);
cpgqtxt( NUM2DBL(x),NUM2DBL(y),NUM2DBL(ang),NUM2DBL(fjust),txt,
xbox, ybox );
@@ -903,7 +904,7 @@ static VALUE
rb_raise(ePgCursorError, "failure in getting cursor position");
return pgcursor_new( rb_float_new(x), rb_float_new(y),
- (ch==0) ? Qnil : rb_str_new(ch,1) );
+ (ch[0]==0) ? Qnil : rb_str_new(ch,1) );
}
/*
@@ -951,7 +952,7 @@ static VALUE
rb_raise(ePgCursorError, "failure in getting cursor position");
return pgcursor_new( rb_float_new(x), rb_float_new(y),
- (ch==0) ? Qnil : rb_str_new(ch,1) );
+ (ch[0]==0) ? Qnil : rb_str_new(ch,1) );
}
@@ -979,7 +980,7 @@ static VALUE
if (NA_TYPE(x)!=NA_SFLOAT || NA_TYPE(y)!=NA_SFLOAT)
rb_raise(rb_eArgError, "Array must NArray.sfloat");
- cpgolin( min(NA_TOTAL(x),NA_TOTAL(y)), &npt,
+ cpgolin( min(NA_TOTAL(x),NA_TOTAL(y)), &npt,
NA_PTR_FLT(x), NA_PTR_FLT(y), sym );
return INT2NUM(npt);
@@ -1009,7 +1010,7 @@ static VALUE
if (NA_TYPE(x)!=NA_SFLOAT || NA_TYPE(y)!=NA_SFLOAT)
rb_raise(rb_eArgError, "Array must NArray.sfloat");
- cpgncur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt,
+ cpgncur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt,
NA_PTR_FLT(x), NA_PTR_FLT(y), sym );
return INT2NUM(npt);
@@ -1037,7 +1038,7 @@ static VALUE
if (NA_TYPE(x)!=NA_SFLOAT || NA_TYPE(y)!=NA_SFLOAT)
rb_raise(rb_eArgError, "Array must NArray.sfloat");
- cpglcur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt,
+ cpglcur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt,
NA_PTR_FLT(x), NA_PTR_FLT(y) );
return INT2NUM(npt);
@@ -1058,7 +1059,7 @@ void rb_scan_kw_args __((VALUE, ...));
baseline parallel to the axis and reading in the same direction as
the axis (from point 1 to point 2). Current line and text attributes
are used.
-
+
Arguments:
X1, Y1 : world coordinates of one endpoint of the axis.
X2, Y2 : world coordinates of the other endpoint of the axis.
@@ -1080,7 +1081,7 @@ void rb_scan_kw_args __((VALUE, ...));
static VALUE
rb_pgplot_pgtick( int argc, VALUE *argv, VALUE self )
{
- char *str="";
+ const char *str="";
VALUE val=Qnil;
VALUE x1, y1, x2, y2, v, vstr;
VALUE tickl, tickr, disp, orient;
@@ -1088,14 +1089,14 @@ static VALUE
if (argc>0 && TYPE(argv[argc-1]) == T_HASH)
val = argv[--argc];
rb_scan_kw_args( val, "tickl", &tickl, "tickr", &tickr,
- "disp", &disp, "orient", &orient, 0);
+ "disp", &disp, "orient", &orient, (char *)0);
rb_scan_args(argc,argv, "51", &x1,&y1, &x2,&y2, &v, &vstr);
if (tickl ==Qnil) tickl = INT2FIX(0);
if (tickr ==Qnil) tickr = INT2FIX(0);
if (disp ==Qnil) disp = INT2FIX(1);
if (orient==Qnil) orient= INT2FIX(0);
- if (vstr !=Qnil) str = STR2CSTR(vstr);
+ if (vstr !=Qnil) str = StringValuePtr(vstr);
cpgtick( NUM2DBL(x1),NUM2DBL(y1),NUM2DBL(x2),NUM2DBL(y2),
NUM2DBL(v), NUM2DBL(tickl),NUM2DBL(tickr),
@@ -1114,25 +1115,25 @@ static VALUE
Draw a labelled graph axis from world-coordinate position (X1,Y1) to
(X2,Y2).
-
+
Normally, this routine draws a standard LINEAR axis with equal
subdivisions. The quantity described by the axis runs from V1 to V2;
- this may be, but need not be, the same as X or Y.
-
+ this may be, but need not be, the same as X or Y.
+
If the 'L' option is specified, the routine draws a LOGARITHMIC axis.
In this case, the quantity described by the axis runs from 10**V1 to
- 10**V2. A logarithmic axis always has major, labeled, tick marks
+ 10**V2. A logarithmic axis always has major, labeled, tick marks
spaced by one or more decades. If the major tick marks are spaced
by one decade (as specified by the STEP argument), then minor
tick marks are placed at 2, 3, .., 9 times each power of 10;
otherwise minor tick marks are spaced by one decade. If the axis
spans less than two decades, numeric labels are placed at 1, 2, and
5 times each power of ten.
-
+
If the axis spans less than one decade, or if it spans many decades,
it is preferable to use a linear axis labeled with the logarithm of
the quantity of interest.
-
+
Arguments:
x1, y1 : world coordinates of one endpoint of the axis.
x2, y2 : world coordinates of the other endpoint of the axis.
@@ -1171,7 +1172,7 @@ static VALUE
static VALUE
rb_pgplot_pgaxis( int argc, VALUE *argv, VALUE self )
{
- char *opt="";
+ const char *opt="";
float frac=0.5;
VALUE val=Qnil;
VALUE x1, y1, x2, y2, v1, v2;
@@ -1180,10 +1181,10 @@ static VALUE
if (argc>0 && TYPE(argv[argc-1]) == T_HASH)
val = argv[--argc];
- rb_scan_kw_args( val,
+ rb_scan_kw_args( val,
"opt",&vopt, "step",&step, "nsub",&nsub,
"tickl",&tickl, "tickr",&tickr,
- "frac",&vfrac, "disp",&disp, "orient",&orient, 0);
+ "frac",&vfrac, "disp",&disp, "orient",&orient, (char *)0);
rb_scan_args(argc,argv, "60", &x1,&y1, &x2,&y2, &v1,&v2);
if (step ==Qnil) step = INT2FIX(0);
@@ -1192,7 +1193,7 @@ static VALUE
if (tickr ==Qnil) tickr = INT2FIX(0);
if (disp ==Qnil) disp = INT2FIX(1);
if (orient==Qnil) orient= INT2FIX(0);
- if (vopt !=Qnil) opt = STR2CSTR(vopt);
+ if (vopt !=Qnil) opt = StringValuePtr(vopt);
if (vfrac !=Qnil) frac = NUM2DBL(vfrac);
cpgaxis( opt, NUM2DBL(x1),NUM2DBL(y1),NUM2DBL(x2),NUM2DBL(y2),
@@ -1205,11 +1206,16 @@ static VALUE
/*--- auto-generated funcs will be placed here ---*/
+void ruby_setenv(const char *name, const char *value);
void
Init_pgplot()
{
+#ifdef PGPLOT_DIR
+ ruby_setenv("PGPLOT_DIR",PGPLOT_DIR);
+#endif
mPgplot = rb_define_module("Pgplot");
+ rb_define_const(mPgplot, "VERSION", rb_str_new2(RUBY_PGPLOT_VERSION));
/* The C application programming interface */
rb_define_module_function(mPgplot, "pgopen", rb_pgplot_pgopen,-1);
diff --git a/ext/version.h b/ext/version.h
new file mode 100644
index 0000000..b412dca
--- /dev/null
+++ b/ext/version.h
@@ -0,0 +1 @@
+#define RUBY_PGPLOT_VERSION "0.1.9"
diff --git a/pgplot.gemspec b/pgplot.gemspec
new file mode 100644
index 0000000..d7b48ad
--- /dev/null
+++ b/pgplot.gemspec
@@ -0,0 +1,90 @@
+open("ext/version.h") do |f|
+ f.each_line do |l|
+ if /RUBY_PGPLOT_VERSION "([\d.]+)"/ =~ l
+ PKG_VERSION=$1
+ break
+ end
+ end
+end
+
+PGPLOT_GEMSPEC = Gem::Specification.new do |s|
+ s.name = "pgplot"
+ s.version = PKG_VERSION
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Masahiro Tanaka"]
+ s.date = Time.now.strftime("%F")
+ s.description = "PGPLOT wrapper for Ruby"
+ s.email = "masa16.tanaka at gmail.com"
+ s.extensions = ["ext/extconf-auto.rb"]
+ s.homepage = "http://pgplot.rubyforge.org/"
+ s.require_paths = ["."]
+ s.rubyforge_project = "pgplot"
+ s.rubygems_version = "2.0.0"
+ s.summary = "PGPLOT wrapper for Ruby. The PGPLOT library needs to be " \
+ "installed in advance using GNU FORTRAN compiler"
+ s.files = %w[
+ README
+ README.ja
+ FuncUsage
+ demo/pgdemo1.rb
+ demo/pgdemo15.rb
+ demo/pgdemo3.rb
+ demo/pgdemo4.rb
+ demo/pgdemo9.rb
+ ext/cogen.rb
+ ext/depend
+ ext/extconf.rb
+ ext/extconf-auto.rb
+ ext/kwarg.c
+ ext/rb_pgplot.c.in
+ ext/version.h
+ ext/build_lib/Makefile
+ ext/build_lib/download.rb
+ ext/build_lib/drivers.rb
+ ext/build_lib/makefile.rb
+ test/pgband.rb
+ test/pgcurs.rb
+ test/pggray.rb
+ test/pglcur.rb
+ test/pgline.rb
+ test/pgncur.rb
+ test/pgolin.rb
+ test/pgtick.rb
+ ]
+
+ s.add_dependency('narray', '>= 0.5.0')
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 2
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+
+ # Documentation TODO
+ s.rdoc_options = %w[
+ --title Ruby/PGPLOT
+ --main README
+ --exclude demo/
+ --exclude test/
+ --exclude pgplot/
+ --exclude ext/build_lib/
+ --exclude ext/Makefile
+ --exclude ext/build-pgplot.rb
+ --exclude ext/cogen.rb
+ --exclude ext/cpgplot.h
+ --exclude ext/depend
+ --exclude ext/extconf.rb
+ --exclude ext/extconf-auto.rb
+ --exclude ext/kwarg.c
+ --exclude ext/rb_pgplot.c.in
+ --exclude ext/version.h
+ --exclude .*\.o
+ --exclude pgplot\.so
+ ]
+ s.has_rdoc = true
+ s.extra_rdoc_files = %w[README README.ja FuncUsage ext/rb_pgplot.c]
+end
diff --git a/test/pgcurs.rb b/test/pgcurs.rb
index 7f4efec..d212cf1 100644
--- a/test/pgcurs.rb
+++ b/test/pgcurs.rb
@@ -10,5 +10,5 @@ c = PgCursor.new(0,0)
for mode in 0..7
puts 'Enter a key on the window:'
c = pgcurs(c.x, c.y)
- pgpt1(c.x, c.y, c.char[0])
+ pgpt1(c.x, c.y, c.char[0].ord)
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-pgplot.git
More information about the Pkg-ruby-extras-commits
mailing list