tecscde 0.6.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 (237) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rubocop.yml +125 -0
  4. data/.rubocop_todo.yml +188 -0
  5. data/CHANGELOG.md +3 -0
  6. data/Gemfile +6 -0
  7. data/LICENSE +46 -0
  8. data/LICENSE.ja +32 -0
  9. data/README.ja.md +200 -0
  10. data/README.md +35 -0
  11. data/Rakefile +27 -0
  12. data/bin/tecscde +64 -0
  13. data/glade/tecscde-cell-property.glade +205 -0
  14. data/glade/tecscde-celltype-property.glade +172 -0
  15. data/glade/tecscde-celltype.glade +414 -0
  16. data/glade/tecscde-export.glade +161 -0
  17. data/glade/test-cell-plugin.rb +51 -0
  18. data/glade/test-cell-property.rb +35 -0
  19. data/glade/test-export.rb +35 -0
  20. data/glade/test-palette.rb +26 -0
  21. data/lib/tcflow.rb +148 -0
  22. data/lib/tecscde.rb +65 -0
  23. data/lib/tecscde/NewCell.png +0 -0
  24. data/lib/tecscde/SelectArrow.png +0 -0
  25. data/lib/tecscde/attr_tree_view.rb +253 -0
  26. data/lib/tecscde/cell_plugin_dialog.glade +294 -0
  27. data/lib/tecscde/cell_plugin_dialog.rb +89 -0
  28. data/lib/tecscde/celltype_tree_view.rb +105 -0
  29. data/lib/tecscde/change_set_control.rb +35 -0
  30. data/lib/tecscde/change_set_control/change_set.rb +32 -0
  31. data/lib/tecscde/change_set_control/change_set_manager.rb +62 -0
  32. data/lib/tecscde/command.rb +35 -0
  33. data/lib/tecscde/control.rb +491 -0
  34. data/lib/tecscde/highlighted_objects.rb +180 -0
  35. data/lib/tecscde/logger.rb +74 -0
  36. data/lib/tecscde/main_view_and_model.rb +80 -0
  37. data/lib/tecscde/palette.glade +553 -0
  38. data/lib/tecscde/palette.rb +174 -0
  39. data/lib/tecscde/preferences.glade +117 -0
  40. data/lib/tecscde/preferences.rb +44 -0
  41. data/lib/tecscde/tecs_model.rb +1137 -0
  42. data/lib/tecscde/tecs_model/hbar.rb +68 -0
  43. data/lib/tecscde/tecs_model/tm_c_port.rb +122 -0
  44. data/lib/tecscde/tecs_model/tm_c_port_array.rb +98 -0
  45. data/lib/tecscde/tecs_model/tm_cell.rb +496 -0
  46. data/lib/tecscde/tecs_model/tm_e_port.rb +126 -0
  47. data/lib/tecscde/tecs_model/tm_e_port_array.rb +78 -0
  48. data/lib/tecscde/tecs_model/tm_join.rb +293 -0
  49. data/lib/tecscde/tecs_model/tm_join_bar.rb +146 -0
  50. data/lib/tecscde/tecs_model/tm_port.rb +238 -0
  51. data/lib/tecscde/tecs_model/tm_port_array.rb +246 -0
  52. data/lib/tecscde/tecs_model/tm_region.rb +107 -0
  53. data/lib/tecscde/tecs_model/tm_uneditable.rb +68 -0
  54. data/lib/tecscde/tecs_model/vbar.rb +68 -0
  55. data/lib/tecscde/templates/_cell_info.cde.erb +15 -0
  56. data/lib/tecscde/templates/_join_info.cde.erb +28 -0
  57. data/lib/tecscde/templates/main.cde.erb +49 -0
  58. data/lib/tecscde/tm_object.rb +91 -0
  59. data/lib/tecscde/version.rb +4 -0
  60. data/lib/tecscde/view.rb +58 -0
  61. data/lib/tecscde/view/cairo_matrix.rb +90 -0
  62. data/lib/tecscde/view/canvas.rb +59 -0
  63. data/lib/tecscde/view/constants.rb +114 -0
  64. data/lib/tecscde/view/main_view.rb +1245 -0
  65. data/lib/tecsflow.rb +475 -0
  66. data/lib/tecsflow/C_parser.tab.rb +2471 -0
  67. data/lib/tecsflow/C_parser.y.rb +1087 -0
  68. data/lib/tecsflow/classes.rb +421 -0
  69. data/lib/tecsgen.rb +581 -0
  70. data/lib/tecsgen/core/C_parser.tab.rb +2477 -0
  71. data/lib/tecsgen/core/C_parser.y +1032 -0
  72. data/lib/tecsgen/core/bnf-deb.tab.rb +5193 -0
  73. data/lib/tecsgen/core/bnf.tab.rb +5193 -0
  74. data/lib/tecsgen/core/bnf.y +2211 -0
  75. data/lib/tecsgen/core/componentobj.rb +7901 -0
  76. data/lib/tecsgen/core/ctypes.rb +226 -0
  77. data/lib/tecsgen/core/expression.rb +1031 -0
  78. data/lib/tecsgen/core/gen_xml.rb +374 -0
  79. data/lib/tecsgen/core/generate.rb +5206 -0
  80. data/lib/tecsgen/core/location.rb +116 -0
  81. data/lib/tecsgen/core/messages.rb +101 -0
  82. data/lib/tecsgen/core/optimize.rb +456 -0
  83. data/lib/tecsgen/core/plugin.rb +332 -0
  84. data/lib/tecsgen/core/pluginModule.rb +165 -0
  85. data/lib/tecsgen/core/syntaxobj.rb +1234 -0
  86. data/lib/tecsgen/core/tecs_lang.rb +306 -0
  87. data/lib/tecsgen/core/tecsgen.rb +453 -0
  88. data/lib/tecsgen/core/tecsinfo.rb +860 -0
  89. data/lib/tecsgen/core/tool_info.rb +258 -0
  90. data/lib/tecsgen/core/types.rb +1632 -0
  91. data/lib/tecsgen/core/unjoin_plugin.rb +218 -0
  92. data/lib/tecsgen/core/value.rb +650 -0
  93. data/lib/tecsgen/messages/messages_console_en_US.rb +1171 -0
  94. data/lib/tecsgen/messages/messages_console_ja_JP.rb +1171 -0
  95. data/lib/tecsgen/messages/messages_file_en_US.rb +334 -0
  96. data/lib/tecsgen/messages/messages_file_ja_JP.rb +163 -0
  97. data/lib/tecsgen/plugin/ATK1AlarmPlugin.rb +196 -0
  98. data/lib/tecsgen/plugin/ATK1DelayTaskPlugin.rb +106 -0
  99. data/lib/tecsgen/plugin/ATK1EventPlugin.rb +147 -0
  100. data/lib/tecsgen/plugin/ATK1ISRPlugin.rb +174 -0
  101. data/lib/tecsgen/plugin/ATK1KernelPlugin.rb +287 -0
  102. data/lib/tecsgen/plugin/ATK1ResourcePlugin.rb +124 -0
  103. data/lib/tecsgen/plugin/ATK1TaskPlugin.rb +220 -0
  104. data/lib/tecsgen/plugin/C2TECSBridgePlugin.rb +210 -0
  105. data/lib/tecsgen/plugin/CellPlugin.rb +61 -0
  106. data/lib/tecsgen/plugin/CelltypePlugin.rb +72 -0
  107. data/lib/tecsgen/plugin/CompositePlugin.rb +66 -0
  108. data/lib/tecsgen/plugin/DomainPlugin.rb +89 -0
  109. data/lib/tecsgen/plugin/HRP2AlarmHandlerPlugin.rb +76 -0
  110. data/lib/tecsgen/plugin/HRP2Cache.rb +1 -0
  111. data/lib/tecsgen/plugin/HRP2CyclicHandlerPlugin.rb +75 -0
  112. data/lib/tecsgen/plugin/HRP2DataqueuePlugin.rb +68 -0
  113. data/lib/tecsgen/plugin/HRP2EventflagPlugin.rb +68 -0
  114. data/lib/tecsgen/plugin/HRP2FixedSizeMemoryPoolPlugin.rb +68 -0
  115. data/lib/tecsgen/plugin/HRP2HandlerPlugin.rb +117 -0
  116. data/lib/tecsgen/plugin/HRP2KernelObjectPlugin.rb +372 -0
  117. data/lib/tecsgen/plugin/HRP2ObjectPlugin.rb +94 -0
  118. data/lib/tecsgen/plugin/HRP2Plugin.rb +140 -0
  119. data/lib/tecsgen/plugin/HRP2PostHook.rb +111 -0
  120. data/lib/tecsgen/plugin/HRP2PriorityDataqueuePlugin.rb +66 -0
  121. data/lib/tecsgen/plugin/HRP2RPCPlugin.rb +319 -0
  122. data/lib/tecsgen/plugin/HRP2SVCPlugin.rb +473 -0
  123. data/lib/tecsgen/plugin/HRP2SemaphorePlugin.rb +67 -0
  124. data/lib/tecsgen/plugin/HRP2TaskPlugin.rb +200 -0
  125. data/lib/tecsgen/plugin/HRPHandlerPlugin.rb +125 -0
  126. data/lib/tecsgen/plugin/HRPKernelObjectManager.rb +72 -0
  127. data/lib/tecsgen/plugin/HRPKernelObjectPlugin.rb +333 -0
  128. data/lib/tecsgen/plugin/HRPObjectPlugin.rb +93 -0
  129. data/lib/tecsgen/plugin/HRPPlugin.rb +356 -0
  130. data/lib/tecsgen/plugin/HRPRPCPlugin.rb +407 -0
  131. data/lib/tecsgen/plugin/HRPSVCPlugin.rb +859 -0
  132. data/lib/tecsgen/plugin/HRPTaskPlugin.rb +107 -0
  133. data/lib/tecsgen/plugin/Mruby2CBridgePlugin.rb +86 -0
  134. data/lib/tecsgen/plugin/MrubyBridgeCellPlugin.rb +264 -0
  135. data/lib/tecsgen/plugin/MrubyBridgeCelltypePlugin.rb +293 -0
  136. data/lib/tecsgen/plugin/MrubyBridgeCompositePlugin.rb +49 -0
  137. data/lib/tecsgen/plugin/MrubyBridgePlugin.rb +67 -0
  138. data/lib/tecsgen/plugin/MrubyBridgeSignaturePlugin.rb +1307 -0
  139. data/lib/tecsgen/plugin/MrubyInfoBridgePlugin.rb +14 -0
  140. data/lib/tecsgen/plugin/MrubyInfoBridgeSignaturePlugin.rb +994 -0
  141. data/lib/tecsgen/plugin/MultiPlugin.rb +57 -0
  142. data/lib/tecsgen/plugin/NotifierPlugin.rb +1217 -0
  143. data/lib/tecsgen/plugin/OpaqueMarshalerPlugin.rb +81 -0
  144. data/lib/tecsgen/plugin/OpaqueRPCPlugin.rb +323 -0
  145. data/lib/tecsgen/plugin/RPCPlugin.rb +266 -0
  146. data/lib/tecsgen/plugin/RepeatCellPlugin.rb +166 -0
  147. data/lib/tecsgen/plugin/RepeatJoinPlugin.rb +130 -0
  148. data/lib/tecsgen/plugin/SharedOpaqueRPCPlugin.rb +357 -0
  149. data/lib/tecsgen/plugin/SharedRPCPlugin.rb +329 -0
  150. data/lib/tecsgen/plugin/SignaturePlugin.rb +77 -0
  151. data/lib/tecsgen/plugin/TECS2CBridgePlugin.rb +178 -0
  152. data/lib/tecsgen/plugin/TECSInfoPlugin.rb +280 -0
  153. data/lib/tecsgen/plugin/ThroughPlugin.rb +333 -0
  154. data/lib/tecsgen/plugin/TracePlugin.rb +484 -0
  155. data/lib/tecsgen/plugin/lib/GenHRP2Marshaler.rb +761 -0
  156. data/lib/tecsgen/plugin/lib/GenOpaqueMarshaler.rb +1107 -0
  157. data/lib/tecsgen/plugin/lib/GenParamCopy.rb +365 -0
  158. data/lib/tecsgen/plugin/lib/GenTransparentMarshaler.rb +683 -0
  159. data/lib/tecsgen/plugin/lib/MrubyBridgeCelltypePluginModule.rb +283 -0
  160. data/lib/tecsgen/plugin/lib/MrubyBridgeSignaturePluginModule.rb +277 -0
  161. data/lib/tecsgen/version.rb +6 -0
  162. data/samples/FigureSamples/active/active.cde +104 -0
  163. data/samples/FigureSamples/active/active.cdl +20 -0
  164. data/samples/FigureSamples/active/active.pdf +0 -0
  165. data/samples/FigureSamples/active/active.png +0 -0
  166. data/samples/FigureSamples/active/gen/tmp_C_src.c +36 -0
  167. data/samples/FigureSamples/active/gen/tmp_cygwin_tecs.h +1908 -0
  168. data/samples/FigureSamples/active/gen/tmp_plugin_post_code.cdl +0 -0
  169. data/samples/FigureSamples/allocator/allocator-internal.png +0 -0
  170. data/samples/FigureSamples/allocator/allocator.cde +171 -0
  171. data/samples/FigureSamples/allocator/allocator.cdl +58 -0
  172. data/samples/FigureSamples/allocator/allocator.png +0 -0
  173. data/samples/FigureSamples/basic/Makefile +87 -0
  174. data/samples/FigureSamples/basic/SimpleSample-trace.cdl +50 -0
  175. data/samples/FigureSamples/basic/SimpleSample.cde +91 -0
  176. data/samples/FigureSamples/basic/SimpleSample.cdl +47 -0
  177. data/samples/FigureSamples/basic/basic.cde +93 -0
  178. data/samples/FigureSamples/basic/basic.cdl +46 -0
  179. data/samples/FigureSamples/basic/basic.png +0 -0
  180. data/samples/FigureSamples/callback/callback.cde +130 -0
  181. data/samples/FigureSamples/callback/callback.cdl +29 -0
  182. data/samples/FigureSamples/callback/callback.png +0 -0
  183. data/samples/FigureSamples/carray/carray.cde +144 -0
  184. data/samples/FigureSamples/carray/carray.cdl +38 -0
  185. data/samples/FigureSamples/carray/carray.png +0 -0
  186. data/samples/FigureSamples/cearray/cearray.cde +314 -0
  187. data/samples/FigureSamples/cearray/cearray.cdl +60 -0
  188. data/samples/FigureSamples/cearray/cearray.png +0 -0
  189. data/samples/FigureSamples/composite/composite-internal.png +0 -0
  190. data/samples/FigureSamples/composite/composite.cde +216 -0
  191. data/samples/FigureSamples/composite/composite.cdl +95 -0
  192. data/samples/FigureSamples/composite/composite.png +0 -0
  193. data/samples/FigureSamples/earray/earray.cde +142 -0
  194. data/samples/FigureSamples/earray/earray.cdl +38 -0
  195. data/samples/FigureSamples/earray/earray.png +0 -0
  196. data/samples/FigureSamples/join/Makefile +87 -0
  197. data/samples/FigureSamples/join/join.cde +132 -0
  198. data/samples/FigureSamples/join/join.cdl +40 -0
  199. data/samples/FigureSamples/join/join.png +0 -0
  200. data/samples/FigureSamples/relay/Makefile +99 -0
  201. data/samples/FigureSamples/relay/relay-internal.png +0 -0
  202. data/samples/FigureSamples/relay/relay.cde +284 -0
  203. data/samples/FigureSamples/relay/relay.cdl +52 -0
  204. data/samples/FigureSamples/relay/relay.png +0 -0
  205. data/samples/FigureSamples/rpc/Makefile +123 -0
  206. data/samples/FigureSamples/rpc/rpc-expand.png +0 -0
  207. data/samples/FigureSamples/rpc/rpc.cde +245 -0
  208. data/samples/FigureSamples/rpc/rpc.png +0 -0
  209. data/samples/FigureSamples/rpc/rpc_sample.cdl +53 -0
  210. data/samples/SimpleSample/Makefile +25 -0
  211. data/samples/SimpleSample/SimpleSample/Makefile +86 -0
  212. data/samples/SimpleSample/SimpleSample/Makefile-trace +91 -0
  213. data/samples/SimpleSample/SimpleSample/README.txt +106 -0
  214. data/samples/SimpleSample/SimpleSample/SimpleSample-trace.cdl +50 -0
  215. data/samples/SimpleSample/SimpleSample/SimpleSample.cdl +45 -0
  216. data/samples/SimpleSample/SimpleSample/src/tSample.c +77 -0
  217. data/samples/SimpleSample/SimpleSample/src/tSimple.c +48 -0
  218. data/samples/SimpleSample/SimpleSample/src/tecs-types.h +27 -0
  219. data/samples/SimpleSample/SimpleSampleOpaqueRPC/Makefile +51 -0
  220. data/samples/SimpleSample/SimpleSampleOpaqueRPC/Makefile-trace +91 -0
  221. data/samples/SimpleSample/SimpleSampleOpaqueRPC/README.txt +106 -0
  222. data/samples/SimpleSample/SimpleSampleOpaqueRPC/SimpleSample-trace.cdl +80 -0
  223. data/samples/SimpleSample/SimpleSampleOpaqueRPC/SimpleSample.cdl +77 -0
  224. data/samples/SimpleSample/SimpleSampleOpaqueRPC/rSample/Makefile +112 -0
  225. data/samples/SimpleSample/SimpleSampleOpaqueRPC/rSimple/Makefile +109 -0
  226. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tSample.c +80 -0
  227. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tSimple.c +47 -0
  228. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tTaskMain.c +66 -0
  229. data/samples/SimpleSample/SimpleSampleOpaqueRPC/src/tecs-types.h +27 -0
  230. data/samples/SimpleSample/SimpleSampleTransparentRPC/Makefile +125 -0
  231. data/samples/SimpleSample/SimpleSampleTransparentRPC/Makefile-trace +130 -0
  232. data/samples/SimpleSample/SimpleSampleTransparentRPC/SimpleSample-trace.cdl +54 -0
  233. data/samples/SimpleSample/SimpleSampleTransparentRPC/SimpleSample.cdl +53 -0
  234. data/samples/SimpleSample/SimpleSampleTransparentRPC/src/tSample.c +80 -0
  235. data/samples/SimpleSample/SimpleSampleTransparentRPC/src/tSimple.c +54 -0
  236. data/tecscde.gemspec +41 -0
  237. metadata +353 -0
@@ -0,0 +1,761 @@
1
+ #
2
+ # TECS Generator
3
+ # Generator for TOPPERS Embedded Component System
4
+ #
5
+ # Copyright (C) 2008-2014 by TOPPERS Project
6
+ #--
7
+ # 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
8
+ # ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
9
+ # 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
10
+ # (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
11
+ # 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
12
+ # スコード中に含まれていること.
13
+ # (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
14
+ # 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
15
+ # 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
16
+ # の無保証規定を掲載すること.
17
+ # (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
18
+ # 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
19
+ # と.
20
+ # (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
21
+ # 作権表示,この利用条件および下記の無保証規定を掲載すること.
22
+ # (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
23
+ # 報告すること.
24
+ # (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
25
+ # 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
26
+ # また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
27
+ # 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
28
+ # 免責すること.
29
+ #
30
+ # 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
31
+ # よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
32
+ # に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
33
+ # アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
34
+ # の責任を負わない.
35
+ #
36
+ # $Id: GenHRP2Marshaler.rb 2952 2018-05-07 10:19:07Z okuma-top $
37
+ #++
38
+
39
+ # プラグインオプション用変数
40
+ # @task_priority:: Integer
41
+ # @channelCelltype:: String
42
+ # @channelCellName:: String
43
+ # @PPAllocatorSize:: Integer
44
+ module GenTransparentMarshaler
45
+
46
+ # プラグイン引数名と Proc
47
+ RPCPluginArgProc = {
48
+ "taskPriority" => Proc.new {|obj, rhs| obj.set_taskPriority rhs },
49
+ "channelCelltype" => Proc.new {|obj, rhs| obj.set_channelCelltype rhs },
50
+ "TDRCelltype" => Proc.new {|obj, rhs| obj.set_TDRCelltype rhs },
51
+ "channelCell" => Proc.new {|obj, rhs| obj.set_channelCellName rhs },
52
+ "PPAllocatorSize" => Proc.new {|obj, rhs| obj.set_PPAllocatorSize rhs },
53
+ }
54
+
55
+ #=== プラグイン引数 taskPriority のチェック
56
+ def set_taskPriority(rhs)
57
+ @task_priority = rhs
58
+ end
59
+
60
+ #=== プラグイン引数 channelCelltype のチェック
61
+ def set_channelCelltype(rhs)
62
+ @channelCelltype = rhs.to_sym
63
+ # path = [ "::", @channelCelltype ]
64
+ # obj = Namespace.find( path )
65
+ nsp = NamespacePath.analyze(@channelCelltype.to_s)
66
+ obj = Namespace.find(nsp)
67
+ if !obj.instance_of?(Celltype) && !obj.instance_of?(CompositeCelltype)
68
+ cdl_error("RPCPlugin: channeclCelltype '#{rhs}' not celltype or not found")
69
+ end
70
+ end
71
+
72
+ #=== プラグイン引数 TDRCelltype のチェック
73
+ def set_TDRCelltype(rhs)
74
+ @TDRCelltype = rhs.to_sym
75
+ # path = [ "::", @TDRCelltype ]
76
+ # obj = Namespace.find( path )
77
+ nsp = NamespacePath.analyze(@TDRCelltype.to_s)
78
+ obj = Namespace.find(nsp)
79
+ if !obj.instance_of?(Celltype) && !obj.instance_of?(CompositeCelltype)
80
+ cdl_error("RPCPlugin: TDRCelltype '#{rhs}' not celltype or not found")
81
+ end
82
+ end
83
+
84
+ #=== プラグイン引数 channelCellName のチェック
85
+ def set_channelCellName(rhs)
86
+ @channelCellName = rhs
87
+ if @channelCellName =~ /\A[a-zA-Z_]\w*/
88
+ # OK
89
+ else
90
+ cdl_error("RPCPlugin: channeclCellName '#{rhs}' unsuitable for identifier")
91
+ end
92
+ end
93
+
94
+ #=== プラグイン引数 PPAllocatorSize のチェック
95
+ def set_PPAllocatorSize(rhs)
96
+ @PPAllocatorSize = rhs
97
+ end
98
+
99
+ #=== marshaler のセルタイプ名を設定する
100
+ def initialize_transparent_marshaler(cell_name)
101
+ @task_priority = 8
102
+ @channelCelltype = "tDataqueueOWChannel"
103
+ @TDRCelltype = "tTDR"
104
+ @channelCellName = "#{cell_name}_Channel"
105
+ @PPAllocatorSize = nil
106
+
107
+ @marshaler_celltype_name = "tMarshaler_#{@signature.get_name}"
108
+ @unmarshaler_celltype_name = "tUnmarshaler_#{@signature.get_name}"
109
+ @marshaler_celltype_file_name = "#{$gen}/#{@marshaler_celltype_name}.cdl"
110
+ end
111
+
112
+ def gen_marshaler_celltype
113
+ if @PPAllocatorSize
114
+ alloc_call_port = " call sPPAllocator cPPAllocator;\n"
115
+ else
116
+ alloc_call_port = ""
117
+ end
118
+
119
+ f = CFile.open(@marshaler_celltype_file_name, "w")
120
+ # 同じ内容を二度書く可能性あり (AppFile は不可)
121
+
122
+ # modified by ishikawa
123
+ f.print <<EOT
124
+
125
+ celltype #{@marshaler_celltype_name} {
126
+ entry #{@signature.get_name} eClientEntry;
127
+ call sEventflag cEventflag;
128
+ call sSemaphore cSemaphore;
129
+ call sMessageBuffer cMessageBuffer;
130
+ //[optional]
131
+ // call sSemaphore cLockChannel; // this port is eliminated by optimize
132
+ };
133
+ celltype #{@unmarshaler_celltype_name} {
134
+ call #{@signature.get_name} cServerCall;
135
+ call sEventflag cEventflag;
136
+ call sSemaphore cSemaphore;
137
+ call sMessageBuffer cMessageBuffer;
138
+ entry sTaskBody eUnmarshalAndCallFunction;
139
+ #{alloc_call_port}
140
+ FACTORY{
141
+ write("$ct$_factory.h", "#include <t_syslog.h>");
142
+ };
143
+ };
144
+ EOT
145
+ f.close
146
+ end
147
+
148
+ #=== 受け口関数の本体コードを生成(頭部と末尾は別途出力)
149
+ # ct_name:: Symbol (through プラグインで生成された) セルタイプ名 .Symbol として送られてくる(らしい)
150
+ def gen_ep_func_body(file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params)
151
+ # unmarshaler クラスか?
152
+ if ct_name == @unmarshaler_celltype_name.to_sym
153
+ gen_ep_func_body_unmarshal(file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params)
154
+ else
155
+ gen_ep_func_body_marshal(file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params)
156
+ end
157
+ end
158
+
159
+ #=== marshal コードの生成
160
+ def gen_ep_func_body_marshal(file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params)
161
+ b_void = false
162
+ b_ret_er = false
163
+
164
+ # 関数の戻り値の元の型を得る(typedef されている場合)
165
+ type = func_type.get_type.get_original_type
166
+
167
+ # 戻り値記憶用の変数を出力(void 型の関数では出力しない)
168
+ if !type.is_a?(VoidType)
169
+ if func_type.get_type.is_a?(DefinedType) && (func_type.get_type.get_type_str == "ER" || func_type.get_type.get_type_str == "ER_INT")
170
+ file.print(" #{func_type.get_type.get_type_str} retval_ = E_OK;\n")
171
+ b_ret_er = true
172
+ else
173
+ file.print(" #{func_type.get_type.get_type_str} retval_;\n")
174
+ end
175
+ else
176
+ b_void = true
177
+ end
178
+
179
+ file.print(" ER ercd_;\n")
180
+ file.print(" FLGPTN flgptn;\n")
181
+
182
+ # 呼び先の signature を取り出す
183
+ signature = @signature
184
+
185
+ # 関数 ID (整数値)
186
+ func_id = signature.get_id_from_func_name(func_name)
187
+ file.print(" int16_t func_id_ = #{func_id}; /* id of #{func_name}: #{func_id} */\n")
188
+
189
+ file.print(" uint8_t msg[256];\n")
190
+
191
+ # シングルトンでないか?
192
+ if !b_singleton
193
+
194
+ # singleton でなければ p_cellcb 取得コードを出力
195
+ file.print <<EOT
196
+ #{ct_name}_CB *p_cellcb;
197
+
198
+ if( VALID_IDX( idx ) ){
199
+ p_cellcb = GET_CELLCB(idx);
200
+ EOT
201
+
202
+ # エラーを返すか?
203
+ if b_ret_er
204
+ file.print <<EOT
205
+ }else{
206
+ return ERCD( E_RPC, E_ID );
207
+ }
208
+ EOT
209
+ else
210
+ file.print <<EOT
211
+ }else{
212
+ /* エラー処理コードをここに記述 */
213
+ }
214
+ EOT
215
+ end
216
+ end
217
+
218
+ # channel lock コード
219
+ file.print <<EOT
220
+ ///* Channel Lock */
221
+ //if( is_cLockChannel_joined() )
222
+ // cLockChannel_wait();
223
+
224
+ EOT
225
+
226
+ =begin
227
+ # SOP を送信
228
+ file.print " /* SOPの送出 */\n"
229
+ file.print " if( ( ercd_ = cTDR_sendSOP( true ) ) != E_OK )\n"
230
+ file.print " goto error_reset;\n"
231
+ =end
232
+
233
+ # func_id を送信
234
+ file.print " /* 関数 id の送出 */\n"
235
+ =begin
236
+ file.print " if( ( ercd_ = cTDR_putInt16( func_id_ ) ) != E_OK )\n"
237
+ file.print " goto error_reset;\n"
238
+ =end
239
+ file.print " *((int16_t *)(&msg[0])) = func_id_;\n"
240
+
241
+ # p "celltype_name, sig_name, func_name, func_global_name"
242
+ # p "#{ct_name}, #{sig_name}, #{func_name}, #{func_global_name}"
243
+
244
+ b_get = false # marshal なら put
245
+ b_marshal = true # marshal
246
+
247
+ # in 方向の入出力を出力
248
+ @index = 2
249
+ file.print " /* 入力引数送出 */\n"
250
+ print_params(params, file, 1, b_marshal, b_get, true, func_type.is_oneway?)
251
+ print_params(params, file, 1, b_marshal, b_get, false, func_type.is_oneway?)
252
+ =begin
253
+ if ! b_void && ! func_type.is_oneway? then
254
+ ret_ptr_type = PtrType.new( func_type.get_type )
255
+ print_param_nc( "retval_", ret_ptr_type, file, 1, :RETURN, "&", nil, b_get )
256
+ end
257
+ =end
258
+
259
+ file.print " /* EOPの送出(パケットの掃きだし) */\n"
260
+ if !func_type.is_oneway?
261
+ b_continue = "true"
262
+ else
263
+ b_continue = "false"
264
+ end
265
+ =begin
266
+ file.print " if( (ercd_=cTDR_sendEOP(#{b_continue})) != E_OK )\n"
267
+ file.print " goto error_reset;\n\n"
268
+ =end
269
+ file.print " if( (ercd_=cMessageBuffer_send(msg, #{@index})) != E_OK )\n"
270
+ file.print " goto error_reset;\n\n"
271
+
272
+ file.print " cSemaphore_signal();\n\n"
273
+
274
+ if !func_type.is_oneway?
275
+ file.print <<EOT
276
+ if( (ercd_=cEventflag_wait( 0x01, TWF_ANDW, &flgptn )) != E_OK ){
277
+ ercd_ = ERCD(E_RPC,ercd_);
278
+ goto error_reset;
279
+ }
280
+ if( (ercd_=cEventflag_clear( 0x00 ) ) != E_OK ){
281
+ ercd_ = ERCD(E_RPC,ercd_);
282
+ goto error_reset;
283
+ }
284
+ EOT
285
+ end # ! func_type.is_oneway?
286
+
287
+ file.print <<EOT
288
+ ///* Channel Lock */
289
+ //if( is_cLockChannel_joined() )
290
+ // cLockChannel_signal();
291
+ EOT
292
+
293
+ if b_void == false
294
+ # 呼び元に戻り値をリターン
295
+ file.print(" cMessageBuffer_receive(&retval_);\n")
296
+ file.print(" return retval_;\n")
297
+ else
298
+ file.print(" return;\n")
299
+ end
300
+
301
+ file.print <<EOT
302
+
303
+ error_reset:
304
+ #if 0
305
+ if( ercd_ != ERCD( E_RPC, E_RESET ) )
306
+ (void)cTDR_reset();
307
+ #endif
308
+ EOT
309
+
310
+ # channel lock コード
311
+ file.print <<EOT
312
+ ///* Channel Lock */
313
+ //if( is_cLockChannel_joined() )
314
+ // cLockChannel_signal();
315
+
316
+ EOT
317
+
318
+ if b_ret_er != false
319
+ # 呼び元に戻り値をリターン
320
+ file.print(" return ercd_;\n")
321
+ else
322
+ file.print(" return;\n")
323
+ end
324
+ end
325
+
326
+ #=== unmarshal コードの生成
327
+ def gen_ep_func_body_unmarshal(file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params)
328
+ # b_ret_er = true
329
+ b_ret_er = false
330
+
331
+ # func_id を得るコードを生成
332
+ file.print <<EOT
333
+
334
+ int16_t func_id_;
335
+ ER ercd_;
336
+
337
+ #{ct_name}_CB *p_cellcb;
338
+
339
+ if( VALID_IDX( idx ) ){
340
+ p_cellcb = GET_CELLCB(idx);
341
+ EOT
342
+
343
+ if b_ret_er
344
+ file.print <<EOT
345
+ }else{
346
+ return ERCD( E_RPC, E_ID );
347
+ }
348
+ EOT
349
+ else
350
+ file.print <<EOT
351
+ }else{
352
+ /* エラー処理コードをここに記述 */
353
+ }
354
+ EOT
355
+ end
356
+
357
+ file.print <<EOT
358
+
359
+ cSemaphore_wait();
360
+
361
+ #if 0
362
+ /* SOPのチェック */
363
+ if( (ercd_=cTDR_receiveSOP( false )) != E_OK )
364
+ goto error_reset;
365
+ /* func_id の取得 */
366
+ if( (ercd_=cTDR_getInt16( &func_id_ )) != E_OK )
367
+ goto error_reset;
368
+ #endif
369
+
370
+ if( (ercd_ = cMessageBuffer_receive(msg) < 0 ) )
371
+ goto error_reset;
372
+ func_id_ = ((int16_t *)msg)[0];
373
+
374
+ #ifdef RPC_DEBUG
375
+ syslog(LOG_INFO, "unmarshaler task: func_id: %d", func_id_ );
376
+ #endif
377
+ switch( func_id_ ){
378
+ EOT
379
+
380
+ # 呼び先の signature を取り出す
381
+ # port = @celltype.find( @next_cell_port_name )
382
+ # signature = port.get_signature
383
+ signature = @signature
384
+
385
+ # through の signature に含まれる すべての関数について
386
+ signature.get_function_head_array.each {|f|
387
+ f_name = f.get_name
388
+ f_type = f.get_declarator.get_type
389
+ id = signature.get_id_from_func_name(f_name)
390
+
391
+ # 関数は返り値を持つか?
392
+ if f_type.get_type.is_a?(VoidType)
393
+ b_void = true
394
+ else
395
+ b_void = false
396
+ end
397
+
398
+ # パケットの終わりをチェック(未受け取りのデータが残っていないかチェック)
399
+ file.print " case #{id}: /*** #{f_name} ***/ \n"
400
+ file.print " if( tTransparentUnmarshaler_#{@signature.get_name}_#{f_name}() != E_OK )\n"
401
+ file.print " goto error_reset;\n"
402
+ file.print " break;\n"
403
+
404
+ } #
405
+
406
+ if @PPAllocatorSize
407
+ ppallocator_dealloc_str = " /* PPAllocator のすべてを解放 */\n cPPAllocator_dealloc_all();"
408
+ else
409
+ ppallocator_dealloc_str = ""
410
+ end
411
+
412
+
413
+ file.print <<EOT
414
+ default:
415
+ #if 0 // deleted by ishikawa: tSysLogが未実装
416
+ syslog(LOG_INFO, "unmarshaler task: ERROR: unknown func_id: %d", func_id_ );
417
+ #endif /* 0 */
418
+ break;
419
+ };
420
+ #{ppallocator_dealloc_str}
421
+ return;
422
+
423
+ error_reset:
424
+ #if 0
425
+ if( ercd_ != ERCD( E_RPC, E_RESET ) )
426
+ (void)cTDR_reset();
427
+ #else
428
+ return ercd_;
429
+ #endif
430
+ #{ppallocator_dealloc_str}
431
+ EOT
432
+ end
433
+
434
+ # IN b_marshal, b_get
435
+ # b_marshal = true && b_get == false : マーシャラで入力引数送出
436
+ # b_marshal = true && b_get == true : マーシャラで出力引数受取
437
+ # b_marshal = false && b_get == true : アンマーシャラで入力引数受取
438
+ # b_marshal = false && b_get == get : アンマーシャラで出力引数送出
439
+ def print_params(params, file, nest, b_marshal, b_get, b_referenced, b_oneway = false)
440
+ params.each{|param|
441
+ # p "#{param.get_name}: b_marshal: #{b_marshal} b_get: #{b_get}"
442
+ if !(b_referenced == param.is_referenced?)
443
+ next
444
+ end
445
+
446
+ dir = param.get_direction
447
+ type = param.get_type
448
+ if b_oneway && dir == :IN && type.get_original_type.is_a?(PtrType) || type.get_original_type.is_a?(ArrayType)
449
+ # oneway, in, PtrType の場合コピー
450
+ alloc_cp = "cPPAllocator_alloc"
451
+ alloc_cp_extra = nil
452
+ print_param(param.get_name, type, file, nest, dir, nil, nil, b_get, alloc_cp, alloc_cp_extra)
453
+ else
454
+ if b_get == false && b_marshal == true || b_get == true && b_marshal == false
455
+ case dir
456
+ # when :IN, :INOUT, :SEND
457
+ when :IN, :INOUT, :OUT, :SEND, :RECEIVE
458
+ print_param_nc(param.get_name, type, file, nest, b_marshal, nil, nil, b_get)
459
+ end
460
+ else
461
+ # case dir
462
+ # when :OUT, :INOUT, :RECEIVE
463
+ # when :RECEIVE
464
+ # print_param_nc( param.get_name, type, file, nest, b_marshal, nil, nil, b_get )
465
+ # end
466
+ end
467
+ end
468
+ }
469
+ end
470
+
471
+ #=== コピーしない引数渡しコードの出力
472
+ def print_param_nc(name, type, file, nest, b_marshal, outer, outer2, b_get)
473
+ indent = " " * (nest + 1)
474
+
475
+ case type
476
+ when DefinedType
477
+ print_param_nc(name, type.get_type, file, nest, b_marshal, outer, outer2, b_get)
478
+ when BoolType, IntType, FloatType, PtrType, ArrayType
479
+ case type
480
+ when BoolType
481
+ type_str = "Int8"
482
+ cast_str = "int8_t"
483
+ when IntType
484
+ bit_size = type.get_bit_size
485
+ case type.get_sign
486
+ when :UNSIGNED
487
+ signC = "U"
488
+ sign = "u"
489
+ when :SIGNED
490
+ if bit_size == -1 || bit_size == -11
491
+ # signed char の場合、signed を指定する
492
+ signC = "S"
493
+ sign = "s"
494
+ else
495
+ signC = ""
496
+ sign = ""
497
+ end
498
+ else
499
+ signC = ""
500
+ sign = ""
501
+ end
502
+
503
+ # p "pn:: #{name} #{bit_size} #{type.get_type_str}"
504
+ case bit_size
505
+ when -1, -11 # -1: char_t, -11: char
506
+ type_str = "#{signC}Char"
507
+ cast_str = "#{sign}char_t"
508
+ when -2
509
+ type_str = "#{signC}Short"
510
+ cast_str = "#{sign}short_t"
511
+ when -3
512
+ type_str = "#{signC}Int"
513
+ cast_str = "#{sign}int_t"
514
+ when -4
515
+ type_str = "#{signC}Long"
516
+ cast_str = "#{sign}long_t"
517
+ when -5
518
+ type_str = "Intptr"
519
+ cast_str = "intptr_t"
520
+ when 8, 16, 32, 64, 128
521
+ type_str = "#{signC}Int#{bit_size}"
522
+ cast_str = "#{sign}int#{bit_size}_t"
523
+ else
524
+ raise "unknown bit_size '#{bit_size}' for int type "
525
+ end
526
+
527
+ when FloatType
528
+ bit_size = type.get_bit_size
529
+ if bit_size == 32
530
+ type_str = "Float32"
531
+ cast_str = "float32_t"
532
+ else
533
+ type_str = "Double64"
534
+ cast_str = "double64_t"
535
+ end
536
+
537
+ when PtrType
538
+ type_str = "Intptr"
539
+ cast_str = "intptr_t"
540
+ when ArrayType
541
+ type_str = "Intptr"
542
+ cast_str = "intptr_t"
543
+ end
544
+
545
+ if type.get_type_str == cast_str
546
+ cast_str = ""
547
+ else
548
+ cast_str = "(" + cast_str + ")"
549
+ end
550
+
551
+ if b_get
552
+ cast_str.gsub!(/\)$/, "*)")
553
+ file.print " " * nest
554
+ =begin
555
+ file.print "if( ( ercd_ = cTDR_get#{type_str}( #{cast_str}&(#{outer}#{name}#{outer2}) ) ) != E_OK )\n"
556
+ file.print " " * nest
557
+ file.print " goto error_reset;\n"
558
+ =end
559
+ file.print "#{name} = *((#{type.get_type_str} *)(&msg[#{@index}]));\n"
560
+ if bit_size.nil?
561
+ raise "HRP2 RPC supports only specified bit_size"
562
+ else
563
+ case bit_size
564
+ when 8, 16, 32, 64, 128
565
+ else
566
+ raise "HRP2 RPC supports only specified bit_size"
567
+ end
568
+ end
569
+ @index += bit_size / 8
570
+ else
571
+ file.print " " * nest
572
+ =begin
573
+ file.print "if( ( ercd_ = cTDR_put#{type_str}( #{cast_str}#{outer}#{name}#{outer2} ) ) != E_OK )\n"
574
+ file.print " " * nest
575
+ file.print " goto error_reset;\n"
576
+ =end
577
+ file.print "*((#{type.get_type_str} *)(&msg[#{@index}])) = #{name};\n"
578
+ if bit_size.nil?
579
+ raise "HRP2 RPC supports only specified bit_size"
580
+ else
581
+ case bit_size
582
+ when 8, 16, 32, 64, 128
583
+ else
584
+ raise "HRP2 RPC supports only specified bit_size"
585
+ end
586
+ end
587
+ @index += bit_size / 8
588
+ end
589
+
590
+ when StructType
591
+ members_decl = type.get_members_decl
592
+ members_decl.get_items.each {|m|
593
+ if m.is_referenced?
594
+ print_param_nc(m.get_name, m.get_type, file, nest, b_marshal, "#{outer}#{name}#{outer2}.", nil, b_get)
595
+ end
596
+ }
597
+ members_decl.get_items.each {|m|
598
+ if !m.is_referenced?
599
+ print_param_nc(m.get_name, m.get_type, file, nest, b_marshal, "#{outer}#{name}#{outer2}.", nil, b_get)
600
+ end
601
+ }
602
+
603
+ when VoidType
604
+ when EnumType # mikan EnumType
605
+ when FuncType # mikan FuncType
606
+ end
607
+ end
608
+
609
+ #=== PREAMBLE 部のコード生成
610
+ # アンマーシャラセルタイプの場合、アンマーシャラ関数のプロトタイプ宣言を生成
611
+ def gen_preamble(file, b_singleton, ct_name, global_name)
612
+ if ct_name != @unmarshaler_celltype_name.to_sym
613
+ return
614
+ end
615
+
616
+ file.print "/* アンマーシャラ関数のプロトタイプ宣言 */\n"
617
+ # signature に含まれる すべての関数について
618
+ @signature.get_function_head_array.each {|f|
619
+ f_name = f.get_name
620
+ f_type = f.get_declarator.get_type
621
+ id = @signature.get_id_from_func_name(f_name)
622
+ file.print "static ER tTransparentUnmarshaler_#{@signature.get_name}_#{f_name}();\t/* func_id: #{id} */\n"
623
+ }
624
+ file.print "\n"
625
+ file.print "static uint8_t msg[256];\n"
626
+ file.print "\n"
627
+ end
628
+
629
+ #=== POSTAMBLE 部のコード生成
630
+ # アンマーシャラセルタイプの場合、アンマーシャラ関数の生成
631
+ def gen_postamble(file, b_singleton, ct_name, global_name)
632
+ if ct_name != @unmarshaler_celltype_name.to_sym
633
+ return
634
+ end
635
+
636
+ file.print "\n/*** アンマーシャラ関数 ***/\n\n"
637
+ @signature.get_function_head_array.each {|f|
638
+ f_name = f.get_name
639
+ f_type = f.get_declarator.get_type
640
+ id = @signature.get_id_from_func_name(f_name)
641
+
642
+ # 関数は返り値を持つか?
643
+ if f_type.get_type.is_a?(VoidType)
644
+ b_void = true
645
+ else
646
+ b_void = false
647
+ end
648
+
649
+ file.print <<EOT
650
+ /*
651
+ * name: #{f_name}
652
+ * func_id: #{id}
653
+ */
654
+ EOT
655
+ file.print "static ER\n"
656
+ file.print "tTransparentUnmarshaler_#{@signature.get_name}_#{f_name}()\n"
657
+ file.print "{\n"
658
+ file.print " ER ercd_;\n"
659
+
660
+ # 引数を受取る変数の定義
661
+ param_list = f.get_declarator.get_type.get_paramlist.get_items
662
+ # FuncHead-> Decl-> FuncType->ParamList
663
+ param_list.each{|par|
664
+ name = par.get_name
665
+ type = par.get_type
666
+ if type.is_a? ArrayType
667
+ type = type.get_type
668
+ aster = "(*"
669
+ aster2 = ")"
670
+ else
671
+ aster = ""
672
+ aster2 = ""
673
+ end
674
+
675
+ type_str = type.get_type_str.gsub(/\bconst\b */, "") # "const" を外す
676
+
677
+ file.printf(" %-12s %s%s%s%s;\n", type_str, aster, name, aster2, type.get_type_str_post)
678
+ }
679
+
680
+ # 戻り値を受け取る変数の定義
681
+ if !b_void
682
+ if f.is_oneway?
683
+ retval_ptr = "" # oneway の場合、受け取るが捨てられる
684
+ else
685
+ # =begin ishikawa modified
686
+ # retval_ptr = "*"
687
+ retval_ptr = ""
688
+ # =end ishikawa modified
689
+ end
690
+ file.printf(" %-12s #{retval_ptr}retval_%s;\n", f_type.get_type.get_type_str, f_type.get_type.get_type_str_post)
691
+ end
692
+
693
+ # in 方向の入出力を入力
694
+ file.print "\n /* 入力引数受取 */\n"
695
+ b_get = true # unmarshal では get
696
+ b_marshal = false
697
+ @index = 2
698
+ print_params(param_list, file, 1, b_marshal, b_get, true, f.is_oneway?)
699
+ print_params(param_list, file, 1, b_marshal, b_get, false, f.is_oneway?)
700
+ =begin
701
+ if ! b_void && ! f.is_oneway? then
702
+ ret_ptr_type = PtrType.new( f_type.get_type )
703
+ print_param_nc( "retval_", ret_ptr_type, file, 2, :RETURN, nil, nil, b_get )
704
+ end
705
+ =end
706
+ # パケットの受信完了
707
+ # mikan 本当は、対象関数を呼出す後に実施したい.呼出しパケットの使用終わりを宣言する目的として
708
+ file.print " /* パケット終わりをチェック */\n"
709
+ if !f.is_oneway?
710
+ b_continue = "true"
711
+ else
712
+ b_continue = "false"
713
+ end
714
+ =begin
715
+ file.print " if( (ercd_=cTDR_receiveEOP(#{b_continue})) != E_OK )\n"
716
+ file.print " goto error_reset;\n\n"
717
+ =end
718
+ # 対象関数を呼出す
719
+ file.print " /* 対象関数の呼出し */\n"
720
+ if b_void
721
+ file.print(" cServerCall_#{f_name}(")
722
+ else
723
+ file.print(" #{retval_ptr}retval_ = cServerCall_#{f_name}(")
724
+ end
725
+
726
+ delim = " "
727
+ param_list.each{|par|
728
+ file.print delim
729
+ delim = ", "
730
+ file.print par.get_name.to_s
731
+ }
732
+ file.print(" );\n")
733
+
734
+ # 戻り値、出力引数の受取コードの生成
735
+
736
+ if !b_void && !f.is_oneway?
737
+ file.print " if( (ercd_ = cMessageBuffer_send(&retval_, sizeof(#{f_type.get_type.get_type_str})) != E_OK ) )\n"
738
+ file.print " goto error_reset;\n"
739
+
740
+ end
741
+ # oneway の場合出力、戻り値が無く、受取を待たない(非同期な呼出し)
742
+ if !f.is_oneway?
743
+ file.print <<EOT
744
+ /* 関数処理の終了を通知 */
745
+ if( ( ercd_ = cEventflag_set( 0x01 ) ) != E_OK ){
746
+ goto error_reset;
747
+ }
748
+ EOT
749
+ end # ! f.is_oneway?
750
+ file.print <<EOT
751
+ return E_OK;
752
+ error_reset:
753
+ return ercd_;
754
+ }
755
+
756
+ EOT
757
+
758
+ }
759
+ end
760
+
761
+ end