1 | /*
|
---|
2 | * Copyright (C) 2008-2017 by TOPPERS Project
|
---|
3 | *
|
---|
4 | * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
5 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
6 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
7 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
8 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
9 | * スコード中に含まれていること.
|
---|
10 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
11 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
12 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
13 | * の無保証規定を掲載すること.
|
---|
14 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
15 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
16 | * と.
|
---|
17 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
18 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
19 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
20 | * 報告すること.
|
---|
21 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
22 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
23 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
24 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
25 | * 免責すること.
|
---|
26 | *
|
---|
27 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
28 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
29 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
30 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
31 | * の責任を負わない.
|
---|
32 | *
|
---|
33 | * @(#) $Id$
|
---|
34 | */
|
---|
35 |
|
---|
36 | /* #[<PREAMBLE>]#
|
---|
37 | * #[<...>]# から #[</...>]# で囲まれたコメントは編集しないでください
|
---|
38 | * tecsmerge によるマージに使用されます
|
---|
39 | *
|
---|
40 | * 属性アクセスマクロ #_CAAM_#
|
---|
41 | * name char_t* ATTR_name
|
---|
42 | * cbp void* ATTR_cbp
|
---|
43 | * inibp void* ATTR_inibp
|
---|
44 | *
|
---|
45 | * 呼び口関数 #_TCPF_#
|
---|
46 | * call port: cCelltypeInfo signature: nTECSInfo_sCelltypeInfo context:task
|
---|
47 | * ER cCelltypeInfo_getName( char_t* name, int_t max_len );
|
---|
48 | * uint16_t cCelltypeInfo_getNameLength( );
|
---|
49 | * uint32_t cCelltypeInfo_getNAttr( );
|
---|
50 | * ER cCelltypeInfo_getAttrInfo( uint32_t ith, Descriptor( nTECSInfo_sVarDeclInfo )* desc );
|
---|
51 | * uint32_t cCelltypeInfo_getNVar( );
|
---|
52 | * ER cCelltypeInfo_getVarInfo( uint32_t ith, Descriptor( nTECSInfo_sVarDeclInfo )* desc );
|
---|
53 | * uint32_t cCelltypeInfo_getNCall( );
|
---|
54 | * ER cCelltypeInfo_getCallInfo( uint32_t ith, Descriptor( nTECSInfo_sCallInfo )* desc );
|
---|
55 | * uint32_t cCelltypeInfo_getNEntry( );
|
---|
56 | * ER cCelltypeInfo_getEntryInfo( uint32_t ith, Descriptor( nTECSInfo_sEntryInfo )* desc );
|
---|
57 | * bool_t cCelltypeInfo_isSingleton( );
|
---|
58 | * bool_t cCelltypeInfo_isIDX_is_ID( );
|
---|
59 | * uint32_t cCelltypeInfo_sizeOfCB( );
|
---|
60 | * uint32_t cCelltypeInfo_sizeOfINIB( );
|
---|
61 | * [ref_desc]
|
---|
62 | * Descriptor( nTECSInfo_sCelltypeInfo ) cCelltypeInfo_refer_to_descriptor();
|
---|
63 | * Descriptor( nTECSInfo_sCelltypeInfo ) cCelltypeInfo_ref_desc() (same as above; abbreviated version);
|
---|
64 | * call port: cRawEntryDescriptor signature: nTECSInfo_sRawEntryDescriptorInfo context:task optional:true
|
---|
65 | * bool_t is_cRawEntryDescriptor_joined(int subscript) check if joined
|
---|
66 | * uint16_t cRawEntryDescriptor_getNRawEntryDescriptorInfo( subscript );
|
---|
67 | * ER cRawEntryDescriptor_getRawDescriptor( subscript, const char_t* signatureName, int_t ith, void** rawDesc );
|
---|
68 | * subscript: 0...(NCP_cRawEntryDescriptor-1)
|
---|
69 | * [ref_desc]
|
---|
70 | * Descriptor( nTECSInfo_sRawEntryDescriptorInfo ) cRawEntryDescriptor_refer_to_descriptor( int_t subscript );
|
---|
71 | * Descriptor( nTECSInfo_sRawEntryDescriptorInfo ) cRawEntryDescriptor_ref_desc( int_t subscript ) (same as above; abbreviated version);
|
---|
72 | *
|
---|
73 | * #[</PREAMBLE>]# */
|
---|
74 |
|
---|
75 | /* Put prototype declaration and/or variale definition here #_PAC_# */
|
---|
76 | #include <string.h>
|
---|
77 | #include "nTECSInfo_tCellInfo_tecsgen.h"
|
---|
78 |
|
---|
79 | #ifndef E_OK
|
---|
80 | #define E_OK 0 /* success */
|
---|
81 | #define E_ID (-18) /* illegal ID */
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | /* entry port function #_TEPF_# */
|
---|
85 | /* #[<ENTRY_PORT>]# eCellInfo
|
---|
86 | * entry port: eCellInfo
|
---|
87 | * signature: nTECSInfo_sCellInfo
|
---|
88 | * context: task
|
---|
89 | * #[</ENTRY_PORT>]# */
|
---|
90 |
|
---|
91 | /* #[<ENTRY_FUNC>]# eCellInfo_getName
|
---|
92 | * name: eCellInfo_getName
|
---|
93 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getName
|
---|
94 | * oneway: false
|
---|
95 | * #[</ENTRY_FUNC>]# */
|
---|
96 | ER
|
---|
97 | eCellInfo_getName(CELLIDX idx, char_t* name, int_t max_len)
|
---|
98 | {
|
---|
99 | ER ercd = E_OK;
|
---|
100 | CELLCB *p_cellcb;
|
---|
101 | if (VALID_IDX(idx)) {
|
---|
102 | p_cellcb = GET_CELLCB(idx);
|
---|
103 | }
|
---|
104 | else {
|
---|
105 | return(E_ID);
|
---|
106 | } /* end if VALID_IDX(idx) */
|
---|
107 |
|
---|
108 | /* Put statements here #_TEFB_# */
|
---|
109 | name[ max_len - 1 ] = '\0';
|
---|
110 | strncpy( name, ATTR_name, max_len );
|
---|
111 | if( name[ max_len - 1 ] ){
|
---|
112 | name[ max_len - 1 ] = '\0';
|
---|
113 | ercd = E_NOMEM;
|
---|
114 | }
|
---|
115 |
|
---|
116 | return(ercd);
|
---|
117 | }
|
---|
118 |
|
---|
119 | /* #[<ENTRY_FUNC>]# eCellInfo_getNameLength
|
---|
120 | * name: eCellInfo_getNameLength
|
---|
121 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getNameLength
|
---|
122 | * oneway: false
|
---|
123 | * #[</ENTRY_FUNC>]# */
|
---|
124 | uint16_t
|
---|
125 | eCellInfo_getNameLength(CELLIDX idx)
|
---|
126 | {
|
---|
127 | CELLCB *p_cellcb;
|
---|
128 | if (VALID_IDX(idx)) {
|
---|
129 | p_cellcb = GET_CELLCB(idx);
|
---|
130 | }
|
---|
131 | else {
|
---|
132 | /* エラー処理コードをここに記述します */
|
---|
133 | } /* end if VALID_IDX(idx) */
|
---|
134 |
|
---|
135 | /* ここに処理本体を記述します #_TEFB_# */
|
---|
136 | return strlen( ATTR_name ) + 1;
|
---|
137 | }
|
---|
138 |
|
---|
139 | /* #[<ENTRY_FUNC>]# eCellInfo_getNRawEntryDescriptorInfo
|
---|
140 | * name: eCellInfo_getNRawEntryDescriptorInfo
|
---|
141 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getNRawEntryDescriptorInfo
|
---|
142 | * oneway: false
|
---|
143 | * #[</ENTRY_FUNC>]# */
|
---|
144 | uint32_t
|
---|
145 | eCellInfo_getNRawEntryDescriptorInfo(CELLIDX idx)
|
---|
146 | {
|
---|
147 | CELLCB *p_cellcb;
|
---|
148 | if (VALID_IDX(idx)) {
|
---|
149 | p_cellcb = GET_CELLCB(idx);
|
---|
150 | }
|
---|
151 | else {
|
---|
152 | /* エラー処理コードをここに記述します */
|
---|
153 | } /* end if VALID_IDX(idx) */
|
---|
154 |
|
---|
155 | /* ここに処理本体を記述します #_TEFB_# */
|
---|
156 | return NCP_cRawEntryDescriptor;
|
---|
157 | }
|
---|
158 |
|
---|
159 | /* #[<ENTRY_FUNC>]# eCellInfo_getRawEntryDescriptorInfo
|
---|
160 | * name: eCellInfo_getRawEntryDescriptorInfo
|
---|
161 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getRawEntryDescriptorInfo
|
---|
162 | * oneway: false
|
---|
163 | * #[</ENTRY_FUNC>]# */
|
---|
164 | ER
|
---|
165 | eCellInfo_getRawEntryDescriptorInfo(CELLIDX idx, int_t index, Descriptor( nTECSInfo_sRawEntryDescriptorInfo )* desc)
|
---|
166 | {
|
---|
167 | CELLCB *p_cellcb;
|
---|
168 | ER ercd = E_OK;
|
---|
169 | if (VALID_IDX(idx)) {
|
---|
170 | p_cellcb = GET_CELLCB(idx);
|
---|
171 | }
|
---|
172 | else {
|
---|
173 | /* エラー処理コードをここに記述します */
|
---|
174 | } /* end if VALID_IDX(idx) */
|
---|
175 |
|
---|
176 | /* ここに処理本体を記述します #_TEFB_# */
|
---|
177 | if( 0 <= index && index < NCP_cRawEntryDescriptor ){
|
---|
178 | if( is_cRawEntryDescriptor_joined( index ) )
|
---|
179 | *desc = cRawEntryDescriptor_refer_to_descriptor( index );
|
---|
180 | else
|
---|
181 | ercd = E_NOEXS;
|
---|
182 | }
|
---|
183 | else
|
---|
184 | ercd = E_ID;
|
---|
185 |
|
---|
186 | return ercd;
|
---|
187 | }
|
---|
188 |
|
---|
189 | /* #[<ENTRY_FUNC>]# eCellInfo_getCelltypeInfo
|
---|
190 | * name: eCellInfo_getCelltypeInfo
|
---|
191 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getCelltypeInfo
|
---|
192 | * oneway: false
|
---|
193 | * #[</ENTRY_FUNC>]# */
|
---|
194 | void
|
---|
195 | eCellInfo_getCelltypeInfo(CELLIDX idx, Descriptor( nTECSInfo_sCelltypeInfo )* desc)
|
---|
196 | {
|
---|
197 | CELLCB *p_cellcb;
|
---|
198 | if (VALID_IDX(idx)) {
|
---|
199 | p_cellcb = GET_CELLCB(idx);
|
---|
200 | }
|
---|
201 | else {
|
---|
202 | /* Write error processing code here */
|
---|
203 | } /* end if VALID_IDX(idx) */
|
---|
204 |
|
---|
205 | /* Put statements here #_TEFB_# */
|
---|
206 | *desc = cCelltypeInfo_refer_to_descriptor();
|
---|
207 | }
|
---|
208 |
|
---|
209 | /* #[<ENTRY_FUNC>]# eCellInfo_getCBP
|
---|
210 | * name: eCellInfo_getCBP
|
---|
211 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getCBP
|
---|
212 | * oneway: false
|
---|
213 | * #[</ENTRY_FUNC>]# */
|
---|
214 | void
|
---|
215 | eCellInfo_getCBP(CELLIDX idx, void** cbp)
|
---|
216 | {
|
---|
217 | CELLCB *p_cellcb;
|
---|
218 | if (VALID_IDX(idx)) {
|
---|
219 | p_cellcb = GET_CELLCB(idx);
|
---|
220 | }
|
---|
221 | else {
|
---|
222 | /* Write error processing code here */
|
---|
223 | } /* end if VALID_IDX(idx) */
|
---|
224 |
|
---|
225 | /* Put statements here #_TEFB_# */
|
---|
226 | *cbp = ATTR_cbp;
|
---|
227 | }
|
---|
228 |
|
---|
229 | /* #[<ENTRY_FUNC>]# eCellInfo_getINIBP
|
---|
230 | * name: eCellInfo_getINIBP
|
---|
231 | * global_name: nTECSInfo_tCellInfo_eCellInfo_getINIBP
|
---|
232 | * oneway: false
|
---|
233 | * #[</ENTRY_FUNC>]# */
|
---|
234 | void
|
---|
235 | eCellInfo_getINIBP(CELLIDX idx, void** inibp)
|
---|
236 | {
|
---|
237 | CELLCB *p_cellcb;
|
---|
238 | if (VALID_IDX(idx)) {
|
---|
239 | p_cellcb = GET_CELLCB(idx);
|
---|
240 | }
|
---|
241 | else {
|
---|
242 | /* Write error processing code here */
|
---|
243 | } /* end if VALID_IDX(idx) */
|
---|
244 |
|
---|
245 | /* Put statements here #_TEFB_# */
|
---|
246 | *inibp = ATTR_inibp;
|
---|
247 | }
|
---|
248 |
|
---|
249 | /* #[<POSTAMBLE>]#
|
---|
250 | * これより下に非受け口関数を書きます
|
---|
251 | * #[</POSTAMBLE>]#*/
|
---|