tioga 1.4 → 1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Tioga_README +177 -139
- data/split/Dtable/dtable.c +3 -0
- data/split/Dtable/namespace.h +7 -3
- data/split/Dtable/symbols.h +2 -2
- data/split/Dvector/dvector.c +3 -2
- data/split/Dvector/namespace.h +7 -3
- data/split/Dvector/symbols.h +2 -2
- data/split/Flate/flate.c +2 -1
- data/split/Flate/namespace.h +7 -3
- data/split/Flate/symbols.h +2 -2
- data/split/Function/extconf.rb +1 -1
- data/split/Function/function.c +38 -6
- data/split/Function/joint_qsort.c +1 -2
- data/split/Function/namespace.h +7 -3
- data/split/Function/symbols.h +2 -2
- data/split/Tioga/axes.c +4 -5
- data/split/Tioga/figures.c +1 -0
- data/split/Tioga/figures.h +5 -3
- data/split/Tioga/lib/Arcs_and_Circles.rb +1 -1
- data/split/Tioga/lib/ColorConstants.rb +9 -9
- data/split/Tioga/lib/Creating_Paths.rb +1 -1
- data/split/Tioga/lib/FigMkr.rb +25 -23
- data/split/Tioga/lib/FigureConstants.rb +2 -2
- data/split/Tioga/lib/Figures_and_Plots.rb +6 -6
- data/split/Tioga/lib/Images.rb +2 -2
- data/split/Tioga/lib/MarkerConstants.rb +3 -3
- data/split/Tioga/lib/Markers.rb +6 -6
- data/split/Tioga/lib/Page_Frame_Bounds.rb +1 -1
- data/split/Tioga/lib/Rectangles.rb +1 -1
- data/split/Tioga/lib/Shading.rb +2 -2
- data/split/Tioga/lib/Special_Paths.rb +5 -5
- data/split/Tioga/lib/Strokes.rb +2 -2
- data/split/Tioga/lib/TeX_Text.rb +5 -5
- data/split/Tioga/lib/TexPreamble.rb +116 -116
- data/split/Tioga/lib/Transparency.rb +2 -2
- data/split/Tioga/lib/Using_Paths.rb +1 -1
- data/split/Tioga/lib/X_and_Y_Axes.rb +19 -15
- data/split/Tioga/lib/irb_tioga.rb +36 -11
- data/split/Tioga/lib/maker.rb +201 -0
- data/split/Tioga/lib/tioga_ui_cmds.rb +6 -2
- data/split/Tioga/namespace.h +7 -3
- data/split/Tioga/pdfcoords.c +20 -2
- data/split/Tioga/pdfs.h +1 -1
- data/split/Tioga/symbols.h +2 -2
- data/split/extconf.rb +7 -5
- data/split/namespace.h +7 -3
- data/split/symbols.c +1 -9
- data/split/symbols.h +2 -2
- metadata +19 -23
- data/split/Dtable/symbols.c +0 -92
- data/split/Dvector/symbols.c +0 -92
- data/split/Flate/symbols.c +0 -92
- data/split/Function/symbols.c +0 -92
- data/split/Tioga/symbols.c +0 -92
data/split/Function/symbols.c
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2006 Vincent Fourmond
|
|
3
|
-
|
|
4
|
-
Symbols is free software; you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU General Library Public License as published
|
|
6
|
-
by the Free Software Foundation; either version 2 of the License, or
|
|
7
|
-
(at your option) any later version.
|
|
8
|
-
|
|
9
|
-
Symbols is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Library General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Library General Public License
|
|
15
|
-
along with Dvector; if not, write to the Free Software
|
|
16
|
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/* Simple code for sharing C symbols across different Ruby libraries */
|
|
21
|
-
|
|
22
|
-
#include <ruby.h>
|
|
23
|
-
#include <intern.h>
|
|
24
|
-
|
|
25
|
-
#include <namespace.h>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* MV stands for Module Variable */
|
|
29
|
-
#define MV_SYMBOLS "@_exported_C_symbols"
|
|
30
|
-
/* modified to use instance variables instead of global class variables:
|
|
31
|
-
this way, children don't overwrite the parent's export table
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/* makes sure that the hash is registered for the given
|
|
36
|
-
module and returns it */
|
|
37
|
-
static VALUE get_symbol_hash(VALUE module)
|
|
38
|
-
{
|
|
39
|
-
VALUE hash;
|
|
40
|
-
ID mv_id = rb_intern(MV_SYMBOLS);
|
|
41
|
-
if(RTEST(rb_ivar_defined(module, mv_id)))
|
|
42
|
-
{
|
|
43
|
-
hash = rb_ivar_get(module, mv_id);
|
|
44
|
-
Check_Type(hash, T_HASH);
|
|
45
|
-
return hash;
|
|
46
|
-
}
|
|
47
|
-
else
|
|
48
|
-
{
|
|
49
|
-
/* module variable uninitialized, we need to make sure it's here */
|
|
50
|
-
hash = rb_hash_new();
|
|
51
|
-
rb_ivar_set(module, mv_id, hash);
|
|
52
|
-
return hash;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/* registers a symbol in the given module. This one is the internal
|
|
57
|
-
function */
|
|
58
|
-
PRIVATE void rb_export_symbol(VALUE module, const char * symbol_name,
|
|
59
|
-
void * symbol)
|
|
60
|
-
{
|
|
61
|
-
VALUE hash = get_symbol_hash(module);
|
|
62
|
-
rb_hash_aset(hash, rb_str_new2(symbol_name),LONG2NUM((long) symbol));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
PRIVATE void * rb_import_symbol_no_raise(VALUE module,
|
|
66
|
-
const char * symbol_name)
|
|
67
|
-
{
|
|
68
|
-
VALUE hash = rb_iv_get(module, MV_SYMBOLS);
|
|
69
|
-
if(TYPE(hash) != T_HASH)
|
|
70
|
-
return NULL; /* doesn't fail, but the importing module
|
|
71
|
-
should definitely check the return value. Beware
|
|
72
|
-
of segfaults ! */
|
|
73
|
-
VALUE symbol = rb_hash_aref(hash, rb_str_new2(symbol_name));
|
|
74
|
-
|
|
75
|
-
if(TYPE(symbol) == T_FIXNUM || TYPE(symbol) == T_BIGNUM)
|
|
76
|
-
return (void *) NUM2LONG(symbol);
|
|
77
|
-
return NULL;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/* same as before, but raises something is the return value is NULL,
|
|
81
|
-
which is probably best as a default behavior*/
|
|
82
|
-
PRIVATE void * rb_import_symbol(VALUE module, const char * symbol_name)
|
|
83
|
-
{
|
|
84
|
-
void * symbol = rb_import_symbol_no_raise(module, symbol_name);
|
|
85
|
-
if(symbol)
|
|
86
|
-
return symbol;
|
|
87
|
-
/* we get the name of the module: */
|
|
88
|
-
VALUE module_name = rb_funcall(module, rb_intern("to_s"), 0);
|
|
89
|
-
rb_raise(rb_eRuntimeError, "The symbol %s was not found in "
|
|
90
|
-
"module %s", symbol_name,
|
|
91
|
-
rb_string_value_cstr(&module_name));
|
|
92
|
-
}
|
data/split/Tioga/symbols.c
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2006 Vincent Fourmond
|
|
3
|
-
|
|
4
|
-
Symbols is free software; you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU General Library Public License as published
|
|
6
|
-
by the Free Software Foundation; either version 2 of the License, or
|
|
7
|
-
(at your option) any later version.
|
|
8
|
-
|
|
9
|
-
Symbols is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Library General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Library General Public License
|
|
15
|
-
along with Dvector; if not, write to the Free Software
|
|
16
|
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/* Simple code for sharing C symbols across different Ruby libraries */
|
|
21
|
-
|
|
22
|
-
#include <ruby.h>
|
|
23
|
-
#include <intern.h>
|
|
24
|
-
|
|
25
|
-
#include <namespace.h>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* MV stands for Module Variable */
|
|
29
|
-
#define MV_SYMBOLS "@_exported_C_symbols"
|
|
30
|
-
/* modified to use instance variables instead of global class variables:
|
|
31
|
-
this way, children don't overwrite the parent's export table
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/* makes sure that the hash is registered for the given
|
|
36
|
-
module and returns it */
|
|
37
|
-
static VALUE get_symbol_hash(VALUE module)
|
|
38
|
-
{
|
|
39
|
-
VALUE hash;
|
|
40
|
-
ID mv_id = rb_intern(MV_SYMBOLS);
|
|
41
|
-
if(RTEST(rb_ivar_defined(module, mv_id)))
|
|
42
|
-
{
|
|
43
|
-
hash = rb_ivar_get(module, mv_id);
|
|
44
|
-
Check_Type(hash, T_HASH);
|
|
45
|
-
return hash;
|
|
46
|
-
}
|
|
47
|
-
else
|
|
48
|
-
{
|
|
49
|
-
/* module variable uninitialized, we need to make sure it's here */
|
|
50
|
-
hash = rb_hash_new();
|
|
51
|
-
rb_ivar_set(module, mv_id, hash);
|
|
52
|
-
return hash;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/* registers a symbol in the given module. This one is the internal
|
|
57
|
-
function */
|
|
58
|
-
PRIVATE void rb_export_symbol(VALUE module, const char * symbol_name,
|
|
59
|
-
void * symbol)
|
|
60
|
-
{
|
|
61
|
-
VALUE hash = get_symbol_hash(module);
|
|
62
|
-
rb_hash_aset(hash, rb_str_new2(symbol_name),LONG2NUM((long) symbol));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
PRIVATE void * rb_import_symbol_no_raise(VALUE module,
|
|
66
|
-
const char * symbol_name)
|
|
67
|
-
{
|
|
68
|
-
VALUE hash = rb_iv_get(module, MV_SYMBOLS);
|
|
69
|
-
if(TYPE(hash) != T_HASH)
|
|
70
|
-
return NULL; /* doesn't fail, but the importing module
|
|
71
|
-
should definitely check the return value. Beware
|
|
72
|
-
of segfaults ! */
|
|
73
|
-
VALUE symbol = rb_hash_aref(hash, rb_str_new2(symbol_name));
|
|
74
|
-
|
|
75
|
-
if(TYPE(symbol) == T_FIXNUM || TYPE(symbol) == T_BIGNUM)
|
|
76
|
-
return (void *) NUM2LONG(symbol);
|
|
77
|
-
return NULL;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/* same as before, but raises something is the return value is NULL,
|
|
81
|
-
which is probably best as a default behavior*/
|
|
82
|
-
PRIVATE void * rb_import_symbol(VALUE module, const char * symbol_name)
|
|
83
|
-
{
|
|
84
|
-
void * symbol = rb_import_symbol_no_raise(module, symbol_name);
|
|
85
|
-
if(symbol)
|
|
86
|
-
return symbol;
|
|
87
|
-
/* we get the name of the module: */
|
|
88
|
-
VALUE module_name = rb_funcall(module, rb_intern("to_s"), 0);
|
|
89
|
-
rb_raise(rb_eRuntimeError, "The symbol %s was not found in "
|
|
90
|
-
"module %s", symbol_name,
|
|
91
|
-
rb_string_value_cstr(&module_name));
|
|
92
|
-
}
|