rice 1.0.0

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 (166) hide show
  1. data/COPYING +23 -0
  2. data/Doxyfile +1253 -0
  3. data/Makefile.am +26 -0
  4. data/Makefile.in +736 -0
  5. data/README +881 -0
  6. data/README.mingw +8 -0
  7. data/bootstrap +8 -0
  8. data/config.guess +1535 -0
  9. data/config.sub +1644 -0
  10. data/configure +7310 -0
  11. data/configure.ac +48 -0
  12. data/depcomp +584 -0
  13. data/doxygen.ac +314 -0
  14. data/doxygen.am +186 -0
  15. data/install-sh +507 -0
  16. data/missing +367 -0
  17. data/post-autoconf.rb +22 -0
  18. data/post-automake.rb +28 -0
  19. data/rice/Address_Registration_Guard.hpp +7 -0
  20. data/rice/Address_Registration_Guard.ipp +34 -0
  21. data/rice/Address_Registration_Guard_defn.hpp +65 -0
  22. data/rice/Allocation_Strategies.hpp +37 -0
  23. data/rice/Array.hpp +220 -0
  24. data/rice/Array.ipp +262 -0
  25. data/rice/Builtin_Object.hpp +8 -0
  26. data/rice/Builtin_Object.ipp +50 -0
  27. data/rice/Builtin_Object_defn.hpp +51 -0
  28. data/rice/Class.cpp +57 -0
  29. data/rice/Class.hpp +8 -0
  30. data/rice/Class.ipp +4 -0
  31. data/rice/Class_defn.hpp +83 -0
  32. data/rice/Constructor.hpp +189 -0
  33. data/rice/Critical_Guard.hpp +34 -0
  34. data/rice/Critical_Guard.ipp +20 -0
  35. data/rice/Data_Object.hpp +127 -0
  36. data/rice/Data_Object.ipp +129 -0
  37. data/rice/Data_Type.cpp +21 -0
  38. data/rice/Data_Type.hpp +8 -0
  39. data/rice/Data_Type.ipp +227 -0
  40. data/rice/Data_Type_defn.hpp +219 -0
  41. data/rice/Data_Type_fwd.hpp +12 -0
  42. data/rice/Enum.hpp +118 -0
  43. data/rice/Enum.ipp +246 -0
  44. data/rice/Exception.cpp +59 -0
  45. data/rice/Exception.hpp +69 -0
  46. data/rice/Exception_Base.hpp +30 -0
  47. data/rice/Exception_Base.ipp +11 -0
  48. data/rice/Hash.hpp +206 -0
  49. data/rice/Hash.ipp +336 -0
  50. data/rice/Identifier.cpp +8 -0
  51. data/rice/Identifier.hpp +50 -0
  52. data/rice/Identifier.ipp +33 -0
  53. data/rice/Jump_Tag.hpp +24 -0
  54. data/rice/Makefile.am +112 -0
  55. data/rice/Makefile.in +675 -0
  56. data/rice/Module.cpp +75 -0
  57. data/rice/Module.hpp +8 -0
  58. data/rice/Module.ipp +6 -0
  59. data/rice/Module_defn.hpp +87 -0
  60. data/rice/Module_impl.hpp +237 -0
  61. data/rice/Module_impl.ipp +302 -0
  62. data/rice/Object.cpp +153 -0
  63. data/rice/Object.hpp +8 -0
  64. data/rice/Object.ipp +19 -0
  65. data/rice/Object_defn.hpp +183 -0
  66. data/rice/Require_Guard.hpp +21 -0
  67. data/rice/String.cpp +93 -0
  68. data/rice/String.hpp +88 -0
  69. data/rice/Struct.cpp +117 -0
  70. data/rice/Struct.hpp +162 -0
  71. data/rice/Struct.ipp +26 -0
  72. data/rice/Symbol.cpp +25 -0
  73. data/rice/Symbol.hpp +66 -0
  74. data/rice/Symbol.ipp +44 -0
  75. data/rice/VM.cpp +79 -0
  76. data/rice/VM.hpp +27 -0
  77. data/rice/config.hpp +23 -0
  78. data/rice/config.hpp.in +22 -0
  79. data/rice/detail/Auto_Function_Wrapper.hpp +719 -0
  80. data/rice/detail/Auto_Function_Wrapper.ipp +1354 -0
  81. data/rice/detail/Auto_Member_Function_Wrapper.hpp +685 -0
  82. data/rice/detail/Auto_Member_Function_Wrapper.ipp +1435 -0
  83. data/rice/detail/Caster.hpp +61 -0
  84. data/rice/detail/Exception_Handler.hpp +118 -0
  85. data/rice/detail/Iterator_Definer.hpp +98 -0
  86. data/rice/detail/Not_Copyable.hpp +25 -0
  87. data/rice/detail/Wrapped_Function.hpp +33 -0
  88. data/rice/detail/check_ruby_type.cpp +21 -0
  89. data/rice/detail/check_ruby_type.hpp +23 -0
  90. data/rice/detail/creation_funcs.hpp +45 -0
  91. data/rice/detail/creation_funcs.ipp +62 -0
  92. data/rice/detail/default_allocation_func.hpp +23 -0
  93. data/rice/detail/default_allocation_func.ipp +11 -0
  94. data/rice/detail/define_method_and_auto_wrap.hpp +27 -0
  95. data/rice/detail/define_method_and_auto_wrap.ipp +20 -0
  96. data/rice/detail/env.hpp +13 -0
  97. data/rice/detail/from_ruby.hpp +43 -0
  98. data/rice/detail/from_ruby.ipp +74 -0
  99. data/rice/detail/method_data.cpp +105 -0
  100. data/rice/detail/method_data.hpp +33 -0
  101. data/rice/detail/node.hpp +13 -0
  102. data/rice/detail/object_call.hpp +85 -0
  103. data/rice/detail/object_call.ipp +147 -0
  104. data/rice/detail/protect.cpp +27 -0
  105. data/rice/detail/protect.hpp +34 -0
  106. data/rice/detail/remove_const.hpp +21 -0
  107. data/rice/detail/ruby.hpp +85 -0
  108. data/rice/detail/rubysig.hpp +13 -0
  109. data/rice/detail/st.hpp +56 -0
  110. data/rice/detail/to_ruby.hpp +16 -0
  111. data/rice/detail/to_ruby.ipp +10 -0
  112. data/rice/detail/win32.hpp +16 -0
  113. data/rice/detail/wrap_function.hpp +288 -0
  114. data/rice/detail/wrap_function.ipp +473 -0
  115. data/rice/generate_code.rb +1092 -0
  116. data/rice/global_function.hpp +16 -0
  117. data/rice/global_function.ipp +11 -0
  118. data/rice/protect.hpp +91 -0
  119. data/rice/protect.ipp +803 -0
  120. data/rice/ruby_try_catch.hpp +86 -0
  121. data/rice/to_from_ruby.hpp +8 -0
  122. data/rice/to_from_ruby.ipp +299 -0
  123. data/rice/to_from_ruby_defn.hpp +71 -0
  124. data/ruby.ac +105 -0
  125. data/ruby/Makefile.am +1 -0
  126. data/ruby/Makefile.in +493 -0
  127. data/ruby/lib/Makefile.am +3 -0
  128. data/ruby/lib/Makefile.in +369 -0
  129. data/ruby/lib/mkmf-rice.rb.in +199 -0
  130. data/sample/Makefile.am +47 -0
  131. data/sample/Makefile.in +375 -0
  132. data/sample/enum/extconf.rb +3 -0
  133. data/sample/enum/sample_enum.cpp +54 -0
  134. data/sample/enum/test.rb +8 -0
  135. data/sample/inheritance/animals.cpp +98 -0
  136. data/sample/inheritance/extconf.rb +3 -0
  137. data/sample/inheritance/test.rb +7 -0
  138. data/sample/map/extconf.rb +3 -0
  139. data/sample/map/map.cpp +81 -0
  140. data/sample/map/test.rb +7 -0
  141. data/test/Makefile.am +44 -0
  142. data/test/Makefile.in +575 -0
  143. data/test/test_Address_Registration_Guard.cpp +43 -0
  144. data/test/test_Allocation_Strategies.cpp +77 -0
  145. data/test/test_Array.cpp +241 -0
  146. data/test/test_Builtin_Object.cpp +72 -0
  147. data/test/test_Class.cpp +350 -0
  148. data/test/test_Constructor.cpp +30 -0
  149. data/test/test_Critical_Guard.cpp +47 -0
  150. data/test/test_Data_Object.cpp +235 -0
  151. data/test/test_Enum.cpp +162 -0
  152. data/test/test_Exception.cpp +46 -0
  153. data/test/test_Hash.cpp +195 -0
  154. data/test/test_Identifier.cpp +70 -0
  155. data/test/test_Jump_Tag.cpp +17 -0
  156. data/test/test_Module.cpp +253 -0
  157. data/test/test_Object.cpp +148 -0
  158. data/test/test_String.cpp +94 -0
  159. data/test/test_Struct.cpp +192 -0
  160. data/test/test_Symbol.cpp +63 -0
  161. data/test/test_To_From_Ruby.cpp +281 -0
  162. data/test/test_VM.cpp +26 -0
  163. data/test/test_rice.rb +30 -0
  164. data/test/unittest.cpp +136 -0
  165. data/test/unittest.hpp +292 -0
  166. metadata +209 -0
@@ -0,0 +1,47 @@
1
+ RUBY_EXTCONF_OPTIONS = -I../../ruby/lib
2
+ EXTCONF_OPTIONS = --with-cppflags="-I../.." --with-ldflags="-L../../rice"
3
+
4
+ EXTRA_DIST = \
5
+ enum/extconf.rb \
6
+ enum/sample_enum.cpp \
7
+ enum/test.rb \
8
+ map/extconf.rb \
9
+ map/map.cpp \
10
+ map/test.rb \
11
+ inheritance/extconf.rb \
12
+ inheritance/animals.cpp \
13
+ inheritance/test.rb
14
+
15
+ enum/Makefile: enum/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
16
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C enum extconf.rb $(EXTCONF_OPTIONS)
17
+
18
+ map/Makefile: map/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
19
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C map extconf.rb $(EXTCONF_OPTIONS)
20
+
21
+ inheritance/Makefile: inheritance/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
22
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C inheritance extconf.rb $(EXTCONF_OPTIONS)
23
+
24
+ all: enum/Makefile map/Makefile inheritance/Makefile all_extensions
25
+
26
+ all_extensions:
27
+ @for sample in $(RICE_SAMPLES); \
28
+ do \
29
+ $(MAKE) -C $${sample} all; \
30
+ done
31
+
32
+ clean: enum/Makefile map/Makefile inheritance/Makefile clean_extensions
33
+
34
+ clean_extensions:
35
+ @for sample in $(RICE_SAMPLES); \
36
+ do \
37
+ $(MAKE) -C $${sample} clean; \
38
+ done
39
+
40
+ distclean: enum/Makefile map/Makefile inheritance/Makefile distclean_extensions
41
+
42
+ distclean_extensions:
43
+ @for sample in $(RICE_SAMPLES);
44
+ do \
45
+ $(MAKE) -C $${sample} distclean; \
46
+ done
47
+
@@ -0,0 +1,375 @@
1
+ # Makefile.in generated by automake 1.10 from Makefile.am.
2
+ # @configure_input@
3
+
4
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
+ # 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6
+ # This Makefile.in is free software; the Free Software Foundation
7
+ # gives unlimited permission to copy and/or distribute it,
8
+ # with or without modifications, as long as this notice is preserved.
9
+
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
+ # PARTICULAR PURPOSE.
14
+
15
+ @SET_MAKE@
16
+ VPATH = @srcdir@
17
+ pkgdatadir = $(datadir)/@PACKAGE@
18
+ pkglibdir = $(libdir)/@PACKAGE@
19
+ pkgincludedir = $(includedir)/@PACKAGE@
20
+ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
21
+ install_sh_DATA = $(install_sh) -c -m 644
22
+ install_sh_PROGRAM = $(install_sh) -c
23
+ install_sh_SCRIPT = $(install_sh) -c
24
+ INSTALL_HEADER = $(INSTALL_DATA)
25
+ transform = $(program_transform_name)
26
+ NORMAL_INSTALL = :
27
+ PRE_INSTALL = :
28
+ POST_INSTALL = :
29
+ NORMAL_UNINSTALL = :
30
+ PRE_UNINSTALL = :
31
+ POST_UNINSTALL = :
32
+ build_triplet = @build@
33
+ host_triplet = @host@
34
+ subdir = sample
35
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
36
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
37
+ am__aclocal_m4_deps = $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
38
+ $(top_srcdir)/configure.ac
39
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
40
+ $(ACLOCAL_M4)
41
+ mkinstalldirs = $(install_sh) -d
42
+ CONFIG_HEADER = $(top_builddir)/rice/config.hpp
43
+ CONFIG_CLEAN_FILES =
44
+ SOURCES =
45
+ DIST_SOURCES =
46
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
47
+ ACLOCAL = @ACLOCAL@
48
+ AMTAR = @AMTAR@
49
+ AUTOCONF = @AUTOCONF@
50
+ AUTOHEADER = @AUTOHEADER@
51
+ AUTOMAKE = @AUTOMAKE@
52
+ AWK = @AWK@
53
+ CPPFLAGS = @CPPFLAGS@
54
+ CXX = @CXX@
55
+ CXXDEPMODE = @CXXDEPMODE@
56
+ CXXFLAGS = @CXXFLAGS@
57
+ CYGPATH_W = @CYGPATH_W@
58
+ DEFS = @DEFS@
59
+ DEPDIR = @DEPDIR@
60
+ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@
61
+ DX_CONFIG = @DX_CONFIG@
62
+ DX_DOCDIR = @DX_DOCDIR@
63
+ DX_DOT = @DX_DOT@
64
+ DX_DOXYGEN = @DX_DOXYGEN@
65
+ DX_DVIPS = @DX_DVIPS@
66
+ DX_EGREP = @DX_EGREP@
67
+ DX_ENV = @DX_ENV@
68
+ DX_FLAG_chi = @DX_FLAG_chi@
69
+ DX_FLAG_chm = @DX_FLAG_chm@
70
+ DX_FLAG_doc = @DX_FLAG_doc@
71
+ DX_FLAG_dot = @DX_FLAG_dot@
72
+ DX_FLAG_html = @DX_FLAG_html@
73
+ DX_FLAG_man = @DX_FLAG_man@
74
+ DX_FLAG_pdf = @DX_FLAG_pdf@
75
+ DX_FLAG_ps = @DX_FLAG_ps@
76
+ DX_FLAG_rtf = @DX_FLAG_rtf@
77
+ DX_FLAG_xml = @DX_FLAG_xml@
78
+ DX_HHC = @DX_HHC@
79
+ DX_LATEX = @DX_LATEX@
80
+ DX_MAKEINDEX = @DX_MAKEINDEX@
81
+ DX_PDFLATEX = @DX_PDFLATEX@
82
+ DX_PERL = @DX_PERL@
83
+ DX_PROJECT = @DX_PROJECT@
84
+ ECHO_C = @ECHO_C@
85
+ ECHO_N = @ECHO_N@
86
+ ECHO_T = @ECHO_T@
87
+ EXEEXT = @EXEEXT@
88
+ INSTALL = @INSTALL@
89
+ INSTALL_DATA = @INSTALL_DATA@
90
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
91
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
92
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
93
+ LDFLAGS = @LDFLAGS@
94
+ LIBOBJS = @LIBOBJS@
95
+ LIBS = @LIBS@
96
+ LTLIBOBJS = @LTLIBOBJS@
97
+ MAKEINFO = @MAKEINFO@
98
+ MKDIR_P = @MKDIR_P@
99
+ OBJEXT = @OBJEXT@
100
+ PACKAGE = @PACKAGE@
101
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
102
+ PACKAGE_NAME = @PACKAGE_NAME@
103
+ PACKAGE_STRING = @PACKAGE_STRING@
104
+ PACKAGE_TARNAME = @PACKAGE_TARNAME@
105
+ PACKAGE_VERSION = @PACKAGE_VERSION@
106
+ PATH_SEPARATOR = @PATH_SEPARATOR@
107
+ RANLIB = @RANLIB@
108
+ RICE_CPPFLAGS = @RICE_CPPFLAGS@
109
+ RICE_LDFLAGS = @RICE_LDFLAGS@
110
+ RICE_SAMPLES = @RICE_SAMPLES@
111
+ RICE_USING_MINGW32 = @RICE_USING_MINGW32@
112
+ RUBY = @RUBY@
113
+ RUBY_CPPFLAGS = @RUBY_CPPFLAGS@
114
+ RUBY_LDFLAGS = @RUBY_LDFLAGS@
115
+ RUBY_LIBRUBYARG = @RUBY_LIBRUBYARG@
116
+ RUBY_LIBRUBYARG_STATIC = @RUBY_LIBRUBYARG_STATIC@
117
+ RUBY_LIBS = @RUBY_LIBS@
118
+ RUBY_SITELIBDIR = @RUBY_SITELIBDIR@
119
+ SET_MAKE = @SET_MAKE@
120
+ SHELL = @SHELL@
121
+ STRIP = @STRIP@
122
+ VERSION = @VERSION@
123
+ abs_builddir = @abs_builddir@
124
+ abs_srcdir = @abs_srcdir@
125
+ abs_top_builddir = @abs_top_builddir@
126
+ abs_top_srcdir = @abs_top_srcdir@
127
+ ac_ct_CXX = @ac_ct_CXX@
128
+ am__include = @am__include@
129
+ am__leading_dot = @am__leading_dot@
130
+ am__quote = @am__quote@
131
+ am__tar = @am__tar@
132
+ am__untar = @am__untar@
133
+ bindir = @bindir@
134
+ build = @build@
135
+ build_alias = @build_alias@
136
+ build_cpu = @build_cpu@
137
+ build_os = @build_os@
138
+ build_vendor = @build_vendor@
139
+ builddir = @builddir@
140
+ datadir = @datadir@
141
+ datarootdir = @datarootdir@
142
+ docdir = @docdir@
143
+ dvidir = @dvidir@
144
+ exec_prefix = @exec_prefix@
145
+ host = @host@
146
+ host_alias = @host_alias@
147
+ host_cpu = @host_cpu@
148
+ host_os = @host_os@
149
+ host_vendor = @host_vendor@
150
+ htmldir = @htmldir@
151
+ includedir = @includedir@
152
+ infodir = @infodir@
153
+ install_sh = @install_sh@
154
+ libdir = @libdir@
155
+ libexecdir = @libexecdir@
156
+ localedir = @localedir@
157
+ localstatedir = @localstatedir@
158
+ mandir = @mandir@
159
+ mkdir_p = @mkdir_p@
160
+ oldincludedir = @oldincludedir@
161
+ pdfdir = @pdfdir@
162
+ prefix = @prefix@
163
+ program_transform_name = @program_transform_name@
164
+ psdir = @psdir@
165
+ sbindir = @sbindir@
166
+ sharedstatedir = @sharedstatedir@
167
+ srcdir = @srcdir@
168
+ sysconfdir = @sysconfdir@
169
+ target_alias = @target_alias@
170
+ top_builddir = @top_builddir@
171
+ top_srcdir = @top_srcdir@
172
+ RUBY_EXTCONF_OPTIONS = -I../../ruby/lib
173
+ EXTCONF_OPTIONS = --with-cppflags="-I../.." --with-ldflags="-L../../rice"
174
+ EXTRA_DIST = \
175
+ enum/extconf.rb \
176
+ enum/sample_enum.cpp \
177
+ enum/test.rb \
178
+ map/extconf.rb \
179
+ map/map.cpp \
180
+ map/test.rb \
181
+ inheritance/extconf.rb \
182
+ inheritance/animals.cpp \
183
+ inheritance/test.rb
184
+
185
+ all: all-am
186
+
187
+ .SUFFIXES:
188
+ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
189
+ @for dep in $?; do \
190
+ case '$(am__configure_deps)' in \
191
+ *$$dep*) \
192
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
193
+ && exit 0; \
194
+ exit 1;; \
195
+ esac; \
196
+ done; \
197
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sample/Makefile'; \
198
+ cd $(top_srcdir) && \
199
+ $(AUTOMAKE) --gnu sample/Makefile
200
+ .PRECIOUS: Makefile
201
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
202
+ @case '$?' in \
203
+ *config.status*) \
204
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
205
+ *) \
206
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
207
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
208
+ esac;
209
+
210
+ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
211
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
212
+
213
+ $(top_srcdir)/configure: $(am__configure_deps)
214
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
215
+ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
216
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
217
+ tags: TAGS
218
+ TAGS:
219
+
220
+ ctags: CTAGS
221
+ CTAGS:
222
+
223
+
224
+ distdir: $(DISTFILES)
225
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
226
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
227
+ list='$(DISTFILES)'; \
228
+ dist_files=`for file in $$list; do echo $$file; done | \
229
+ sed -e "s|^$$srcdirstrip/||;t" \
230
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
231
+ case $$dist_files in \
232
+ */*) eval $(MKDIR_P) `echo "$$dist_files" | \
233
+ sed '/\//!d;s|^|"$(distdir)"/|;s,/[^/]*$$,,' | \
234
+ sort -u` ;; \
235
+ esac; \
236
+ for file in $$dist_files; do \
237
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
238
+ if test -d $$d/$$file; then \
239
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
240
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
241
+ cp -pR $(srcdir)/$$file "$(distdir)"$$dir || exit 1; \
242
+ fi; \
243
+ cp -pR $$d/$$file "$(distdir)"$$dir || exit 1; \
244
+ else \
245
+ test -f "$(distdir)"/$$file \
246
+ || cp -p $$d/$$file "$(distdir)"/$$file \
247
+ || exit 1; \
248
+ fi; \
249
+ done
250
+ check-am: all-am
251
+ check: check-am
252
+ all-am: Makefile
253
+ installdirs:
254
+ install: install-am
255
+ install-exec: install-exec-am
256
+ install-data: install-data-am
257
+ uninstall: uninstall-am
258
+
259
+ install-am: all-am
260
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
261
+
262
+ installcheck: installcheck-am
263
+ install-strip:
264
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
265
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
266
+ `test -z '$(STRIP)' || \
267
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
268
+ mostlyclean-generic:
269
+
270
+ clean-generic:
271
+
272
+ distclean-generic:
273
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
274
+
275
+ maintainer-clean-generic:
276
+ @echo "This command is intended for maintainers to use"
277
+ @echo "it deletes files that may require special tools to rebuild."
278
+ clean-am: clean-generic mostlyclean-am
279
+
280
+ distclean-am: clean-am distclean-generic
281
+
282
+ dvi: dvi-am
283
+
284
+ dvi-am:
285
+
286
+ html: html-am
287
+
288
+ info: info-am
289
+
290
+ info-am:
291
+
292
+ install-data-am:
293
+
294
+ install-dvi: install-dvi-am
295
+
296
+ install-exec-am:
297
+
298
+ install-html: install-html-am
299
+
300
+ install-info: install-info-am
301
+
302
+ install-man:
303
+
304
+ install-pdf: install-pdf-am
305
+
306
+ install-ps: install-ps-am
307
+
308
+ installcheck-am:
309
+
310
+ maintainer-clean: maintainer-clean-am
311
+ -rm -f Makefile
312
+ maintainer-clean-am: distclean-am maintainer-clean-generic
313
+
314
+ mostlyclean: mostlyclean-am
315
+
316
+ mostlyclean-am: mostlyclean-generic
317
+
318
+ pdf: pdf-am
319
+
320
+ pdf-am:
321
+
322
+ ps: ps-am
323
+
324
+ ps-am:
325
+
326
+ uninstall-am:
327
+
328
+ .MAKE: install-am install-strip
329
+
330
+ .PHONY: all all-am check check-am clean clean-generic distclean \
331
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
332
+ install install-am install-data install-data-am install-dvi \
333
+ install-dvi-am install-exec install-exec-am install-html \
334
+ install-html-am install-info install-info-am install-man \
335
+ install-pdf install-pdf-am install-ps install-ps-am \
336
+ install-strip installcheck installcheck-am installdirs \
337
+ maintainer-clean maintainer-clean-generic mostlyclean \
338
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
339
+
340
+
341
+ enum/Makefile: enum/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
342
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C enum extconf.rb $(EXTCONF_OPTIONS)
343
+
344
+ map/Makefile: map/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
345
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C map extconf.rb $(EXTCONF_OPTIONS)
346
+
347
+ inheritance/Makefile: inheritance/extconf.rb ../config.status ../ruby/lib/mkmf-rice.rb
348
+ @RUBY@ $(RUBY_EXTCONF_OPTIONS) -C inheritance extconf.rb $(EXTCONF_OPTIONS)
349
+
350
+ all: enum/Makefile map/Makefile inheritance/Makefile all_extensions
351
+
352
+ all_extensions:
353
+ @for sample in $(RICE_SAMPLES); \
354
+ do \
355
+ $(MAKE) -C $${sample} all; \
356
+ done
357
+
358
+ clean: enum/Makefile map/Makefile inheritance/Makefile clean_extensions
359
+
360
+ clean_extensions:
361
+ @for sample in $(RICE_SAMPLES); \
362
+ do \
363
+ $(MAKE) -C $${sample} clean; \
364
+ done
365
+
366
+ distclean: enum/Makefile map/Makefile inheritance/Makefile distclean_extensions
367
+
368
+ distclean_extensions:
369
+ @for sample in $(RICE_SAMPLES);
370
+ do \
371
+ $(MAKE) -C $${sample} distclean; \
372
+ done
373
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
374
+ # Otherwise a system limit (for SysV at least) may be exceeded.
375
+ .NOEXPORT:
@@ -0,0 +1,3 @@
1
+ require 'mkmf-rice'
2
+ create_makefile('sample_enum')
3
+
@@ -0,0 +1,54 @@
1
+ #include "rice/Enum.hpp"
2
+ #include "rice/ruby_try_catch.hpp"
3
+
4
+ using namespace Rice;
5
+
6
+ namespace
7
+ {
8
+
9
+ enum Sample_Enum
10
+ {
11
+ SE_FOO = 1,
12
+ SE_BAR = 42,
13
+ SE_BAZ = 100,
14
+ };
15
+
16
+ Rice::Enum<Sample_Enum> sample_enum_type;
17
+
18
+ char const * description(Sample_Enum e)
19
+ {
20
+ switch(e)
21
+ {
22
+ case SE_FOO: return "Fairly Ordinary Object";
23
+ case SE_BAR: return "Beginner's All-purpose Ratchet";
24
+ case SE_BAZ: return "Better than A Zebra";
25
+ }
26
+ return "???";
27
+ }
28
+
29
+ } // namespace
30
+
31
+ template<>
32
+ Sample_Enum from_ruby<Sample_Enum>(Object x)
33
+ {
34
+ Data_Object<Sample_Enum> d(x, sample_enum_type);
35
+ return *d;
36
+ }
37
+
38
+ extern "C"
39
+ void Init_sample_enum()
40
+ {
41
+ RUBY_TRY
42
+ {
43
+ sample_enum_type =
44
+ define_enum<Sample_Enum>("Sample_Enum")
45
+ .define_value("FOO", SE_FOO)
46
+ .define_value("BAR", SE_BAR)
47
+ .define_value("BAZ", SE_BAZ);
48
+
49
+ sample_enum_type
50
+ .define_method("description", description);
51
+ }
52
+ RUBY_CATCH
53
+ }
54
+