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.
Files changed (54) hide show
  1. data/Tioga_README +177 -139
  2. data/split/Dtable/dtable.c +3 -0
  3. data/split/Dtable/namespace.h +7 -3
  4. data/split/Dtable/symbols.h +2 -2
  5. data/split/Dvector/dvector.c +3 -2
  6. data/split/Dvector/namespace.h +7 -3
  7. data/split/Dvector/symbols.h +2 -2
  8. data/split/Flate/flate.c +2 -1
  9. data/split/Flate/namespace.h +7 -3
  10. data/split/Flate/symbols.h +2 -2
  11. data/split/Function/extconf.rb +1 -1
  12. data/split/Function/function.c +38 -6
  13. data/split/Function/joint_qsort.c +1 -2
  14. data/split/Function/namespace.h +7 -3
  15. data/split/Function/symbols.h +2 -2
  16. data/split/Tioga/axes.c +4 -5
  17. data/split/Tioga/figures.c +1 -0
  18. data/split/Tioga/figures.h +5 -3
  19. data/split/Tioga/lib/Arcs_and_Circles.rb +1 -1
  20. data/split/Tioga/lib/ColorConstants.rb +9 -9
  21. data/split/Tioga/lib/Creating_Paths.rb +1 -1
  22. data/split/Tioga/lib/FigMkr.rb +25 -23
  23. data/split/Tioga/lib/FigureConstants.rb +2 -2
  24. data/split/Tioga/lib/Figures_and_Plots.rb +6 -6
  25. data/split/Tioga/lib/Images.rb +2 -2
  26. data/split/Tioga/lib/MarkerConstants.rb +3 -3
  27. data/split/Tioga/lib/Markers.rb +6 -6
  28. data/split/Tioga/lib/Page_Frame_Bounds.rb +1 -1
  29. data/split/Tioga/lib/Rectangles.rb +1 -1
  30. data/split/Tioga/lib/Shading.rb +2 -2
  31. data/split/Tioga/lib/Special_Paths.rb +5 -5
  32. data/split/Tioga/lib/Strokes.rb +2 -2
  33. data/split/Tioga/lib/TeX_Text.rb +5 -5
  34. data/split/Tioga/lib/TexPreamble.rb +116 -116
  35. data/split/Tioga/lib/Transparency.rb +2 -2
  36. data/split/Tioga/lib/Using_Paths.rb +1 -1
  37. data/split/Tioga/lib/X_and_Y_Axes.rb +19 -15
  38. data/split/Tioga/lib/irb_tioga.rb +36 -11
  39. data/split/Tioga/lib/maker.rb +201 -0
  40. data/split/Tioga/lib/tioga_ui_cmds.rb +6 -2
  41. data/split/Tioga/namespace.h +7 -3
  42. data/split/Tioga/pdfcoords.c +20 -2
  43. data/split/Tioga/pdfs.h +1 -1
  44. data/split/Tioga/symbols.h +2 -2
  45. data/split/extconf.rb +7 -5
  46. data/split/namespace.h +7 -3
  47. data/split/symbols.c +1 -9
  48. data/split/symbols.h +2 -2
  49. metadata +19 -23
  50. data/split/Dtable/symbols.c +0 -92
  51. data/split/Dvector/symbols.c +0 -92
  52. data/split/Flate/symbols.c +0 -92
  53. data/split/Function/symbols.c +0 -92
  54. data/split/Tioga/symbols.c +0 -92
@@ -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
- }
@@ -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
- }