1 | /*
|
---|
2 | * Copyright (C) 2008-2017 by TOPPERS Project
|
---|
3 | *
|
---|
4 | * ä¸è¨èä½æ¨©è
|
---|
5 | ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
6 | * ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
7 | * å¤ã»åé
|
---|
8 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
9 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
10 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
11 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
12 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
13 | * ç¨ã§ããå½¢ã§åé
|
---|
14 | å¸ããå ´åã«ã¯ï¼åé
|
---|
15 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
16 | * è
|
---|
17 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
18 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
19 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
20 | * ç¨ã§ããªãå½¢ã§åé
|
---|
21 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
22 | * ã¨ï¼
|
---|
23 | * (a) åé
|
---|
24 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
25 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
26 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
27 | * (b) åé
|
---|
28 | å¸ã®å½¢æ
|
---|
29 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
30 | * å ±åãããã¨ï¼
|
---|
31 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
32 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
33 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
34 | 責ãããã¨ï¼
|
---|
35 | * ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
36 | * ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
|
---|
37 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
38 | * å
|
---|
39 | 責ãããã¨ï¼
|
---|
40 | *
|
---|
41 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
42 | ã
|
---|
43 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
44 | * ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
45 | * ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ã
|
---|
46 | * ã®è²¬ä»»ãè² ããªãï¼
|
---|
47 | *
|
---|
48 | * @(#) $Id$
|
---|
49 | */
|
---|
50 |
|
---|
51 | /* #[<PREAMBLE>]#
|
---|
52 | * #[<...>]# ãã #[</...>]# ã§å²ã¾ããã³ã¡ã³ãã¯ç·¨éããªãã§ãã ãã
|
---|
53 | * tecsmerge ã«ãããã¼ã¸ã«ä½¿ç¨ããã¾ã
|
---|
54 | *
|
---|
55 | * å±æ§ã¢ã¯ã»ã¹ãã¯ã #_CAAM_#
|
---|
56 | * name_len int32_t ATTR_name_len
|
---|
57 | * path_len int32_t ATTR_path_len
|
---|
58 | * name1 char_t* VAR_name1
|
---|
59 | * name2 char_t* VAR_name2
|
---|
60 | * path char_t* VAR_path
|
---|
61 | *
|
---|
62 | * å¼ã³å£é¢æ° #_TCPF_#
|
---|
63 | * call port: cNamespaceInfo signature: nTECSInfo_sNamespaceInfo context:task
|
---|
64 | * ER cNamespaceInfo_getName( char_t* name, int_t max_len );
|
---|
65 | * uint16_t cNamespaceInfo_getNameLength( );
|
---|
66 | * uint32_t cNamespaceInfo_getNNamespace( );
|
---|
67 | * ER cNamespaceInfo_getNamespaceInfo( uint32_t ith, Descriptor( nTECSInfo_sNamespaceInfo )* des );
|
---|
68 | * uint32_t cNamespaceInfo_getNSignature( );
|
---|
69 | * ER cNamespaceInfo_getSignatureInfo( uint32_t ith, Descriptor( nTECSInfo_sSignatureInfo )* des );
|
---|
70 | * uint32_t cNamespaceInfo_getNCelltype( );
|
---|
71 | * ER cNamespaceInfo_getCelltypeInfo( uint32_t ith, Descriptor( nTECSInfo_sCelltypeInfo )* des );
|
---|
72 | * [ref_desc]
|
---|
73 | * Descriptor( nTECSInfo_sNamespaceInfo ) cNamespaceInfo_refer_to_descriptor();
|
---|
74 | * Descriptor( nTECSInfo_sNamespaceInfo ) cNamespaceInfo_ref_desc() (same as above; abbreviated version);
|
---|
75 | * call port: cRegionInfo signature: nTECSInfo_sRegionInfo context:task
|
---|
76 | * ER cRegionInfo_getName( char_t* name, int_t max_len );
|
---|
77 | * uint16_t cRegionInfo_getNameLength( );
|
---|
78 | * uint32_t cRegionInfo_getNCell( );
|
---|
79 | * ER cRegionInfo_getCellInfo( uint32_t ith, Descriptor( nTECSInfo_sCellInfo )* des );
|
---|
80 | * uint32_t cRegionInfo_getNRegion( );
|
---|
81 | * ER cRegionInfo_getRegionInfo( uint32_t ith, Descriptor( nTECSInfo_sRegionInfo )* des );
|
---|
82 | * [ref_desc]
|
---|
83 | * Descriptor( nTECSInfo_sRegionInfo ) cRegionInfo_refer_to_descriptor();
|
---|
84 | * Descriptor( nTECSInfo_sRegionInfo ) cRegionInfo_ref_desc() (same as above; abbreviated version);
|
---|
85 | * call port: cNamespaceInfoTemp signature: nTECSInfo_sNamespaceInfo context:task optional:true
|
---|
86 | * bool_t is_cNamespaceInfoTemp_joined() check if joined
|
---|
87 | * ER cNamespaceInfoTemp_getName( char_t* name, int_t max_len );
|
---|
88 | * uint16_t cNamespaceInfoTemp_getNameLength( );
|
---|
89 | * uint32_t cNamespaceInfoTemp_getNNamespace( );
|
---|
90 | * ER cNamespaceInfoTemp_getNamespaceInfo( uint32_t ith, Descriptor( nTECSInfo_sNamespaceInfo )* des );
|
---|
91 | * uint32_t cNamespaceInfoTemp_getNSignature( );
|
---|
92 | * ER cNamespaceInfoTemp_getSignatureInfo( uint32_t ith, Descriptor( nTECSInfo_sSignatureInfo )* des );
|
---|
93 | * uint32_t cNamespaceInfoTemp_getNCelltype( );
|
---|
94 | * ER cNamespaceInfoTemp_getCelltypeInfo( uint32_t ith, Descriptor( nTECSInfo_sCelltypeInfo )* des );
|
---|
95 | * [dynamic, optional]
|
---|
96 | * void cNamespaceInfoTemp_set_descriptor( Descriptor( nTECSInfo_sNamespaceInfo ) desc );
|
---|
97 | * void cNamespaceInfoTemp_unjoin( );
|
---|
98 | * call port: cRegionInfoTemp signature: nTECSInfo_sRegionInfo context:task optional:true
|
---|
99 | * bool_t is_cRegionInfoTemp_joined() check if joined
|
---|
100 | * ER cRegionInfoTemp_getName( char_t* name, int_t max_len );
|
---|
101 | * uint16_t cRegionInfoTemp_getNameLength( );
|
---|
102 | * uint32_t cRegionInfoTemp_getNCell( );
|
---|
103 | * ER cRegionInfoTemp_getCellInfo( uint32_t ith, Descriptor( nTECSInfo_sCellInfo )* des );
|
---|
104 | * uint32_t cRegionInfoTemp_getNRegion( );
|
---|
105 | * ER cRegionInfoTemp_getRegionInfo( uint32_t ith, Descriptor( nTECSInfo_sRegionInfo )* des );
|
---|
106 | * [dynamic, optional]
|
---|
107 | * void cRegionInfoTemp_set_descriptor( Descriptor( nTECSInfo_sRegionInfo ) desc );
|
---|
108 | * void cRegionInfoTemp_unjoin( );
|
---|
109 | * call port: cCelltypeInfoTemp signature: nTECSInfo_sCelltypeInfo context:task optional:true
|
---|
110 | * bool_t is_cCelltypeInfoTemp_joined() check if joined
|
---|
111 | * ER cCelltypeInfoTemp_getName( char_t* name, int_t max_len );
|
---|
112 | * uint16_t cCelltypeInfoTemp_getNameLength( );
|
---|
113 | * uint32_t cCelltypeInfoTemp_getNAttr( );
|
---|
114 | * ER cCelltypeInfoTemp_getAttrInfo( uint32_t ith, Descriptor( nTECSInfo_sVarDeclInfo )* desc );
|
---|
115 | * uint32_t cCelltypeInfoTemp_getNVar( );
|
---|
116 | * ER cCelltypeInfoTemp_getVarInfo( uint32_t ith, Descriptor( nTECSInfo_sVarDeclInfo )* desc );
|
---|
117 | * uint32_t cCelltypeInfoTemp_getNCall( );
|
---|
118 | * ER cCelltypeInfoTemp_getCallInfo( uint32_t ith, Descriptor( nTECSInfo_sCallInfo )* desc );
|
---|
119 | * uint32_t cCelltypeInfoTemp_getNEntry( );
|
---|
120 | * ER cCelltypeInfoTemp_getEntryInfo( uint32_t ith, Descriptor( nTECSInfo_sEntryInfo )* desc );
|
---|
121 | * bool_t cCelltypeInfoTemp_isSingleton( );
|
---|
122 | * bool_t cCelltypeInfoTemp_isIDX_is_ID( );
|
---|
123 | * uint32_t cCelltypeInfoTemp_sizeOfCB( );
|
---|
124 | * uint32_t cCelltypeInfoTemp_sizeOfINIB( );
|
---|
125 | * [dynamic, optional]
|
---|
126 | * void cCelltypeInfoTemp_set_descriptor( Descriptor( nTECSInfo_sCelltypeInfo ) desc );
|
---|
127 | * void cCelltypeInfoTemp_unjoin( );
|
---|
128 | * call port: cCellInfoTemp signature: nTECSInfo_sCellInfo context:task optional:true
|
---|
129 | * bool_t is_cCellInfoTemp_joined() check if joined
|
---|
130 | * ER cCellInfoTemp_getName( char_t* name, int_t max_len );
|
---|
131 | * uint16_t cCellInfoTemp_getNameLength( );
|
---|
132 | * uint32_t cCellInfoTemp_getNRawEntryDescriptorInfo( );
|
---|
133 | * ER cCellInfoTemp_getRawEntryDescriptorInfo( int_t index, Descriptor( nTECSInfo_sRawEntryDescriptorInfo )* desc );
|
---|
134 | * void cCellInfoTemp_getCelltypeInfo( Descriptor( nTECSInfo_sCelltypeInfo )* desc );
|
---|
135 | * void cCellInfoTemp_getCBP( void** cbp );
|
---|
136 | * void cCellInfoTemp_getINIBP( void** inibp );
|
---|
137 | * [dynamic, optional]
|
---|
138 | * void cCellInfoTemp_set_descriptor( Descriptor( nTECSInfo_sCellInfo ) desc );
|
---|
139 | * void cCellInfoTemp_unjoin( );
|
---|
140 | * call port: cEntryInfoTemp signature: nTECSInfo_sEntryInfo context:task optional:true
|
---|
141 | * bool_t is_cEntryInfoTemp_joined() check if joined
|
---|
142 | * ER cEntryInfoTemp_getName( char_t* name, int_t max_len );
|
---|
143 | * uint16_t cEntryInfoTemp_getNameLength( );
|
---|
144 | * void cEntryInfoTemp_getSignatureInfo( Descriptor( nTECSInfo_sSignatureInfo )* desc );
|
---|
145 | * uint32_t cEntryInfoTemp_getArraySize( );
|
---|
146 | * bool_t cEntryInfoTemp_isInline( );
|
---|
147 | * [dynamic, optional]
|
---|
148 | * void cEntryInfoTemp_set_descriptor( Descriptor( nTECSInfo_sEntryInfo ) desc );
|
---|
149 | * void cEntryInfoTemp_unjoin( );
|
---|
150 | *
|
---|
151 | * #[</PREAMBLE>]# */
|
---|
152 |
|
---|
153 | /* Put prototype declaration and/or variale definition here #_PAC_# */
|
---|
154 | #include <string.h>
|
---|
155 | #include "nTECSInfo_tTECSInfoSub_tecsgen.h"
|
---|
156 |
|
---|
157 | #ifndef E_OK
|
---|
158 | #define E_OK 0 /* success */
|
---|
159 | #define E_ID (-18) /* illegal ID */
|
---|
160 | #endif
|
---|
161 |
|
---|
162 | static ER
|
---|
163 | separate_basename( const char_t **namespace_path, char_t **basename );
|
---|
164 |
|
---|
165 |
|
---|
166 | /*
|
---|
167 | * VAR_name1 ⦠å¼æ°ã¨ãã¦æ¸¡ããããã®ãã³ãã¼ããããã ããéä¸ã® '::' ã '\0' ã«æ¸ãæãããã¨ã¯ããã
|
---|
168 | * VAR_name2 ⦠é½åº¦ä¸æ¸ããã¦ä½¿ç¨ãã
|
---|
169 | */
|
---|
170 |
|
---|
171 | /* entry port function #_TEPF_# */
|
---|
172 | /* #[<ENTRY_PORT>]# eTECSInfo
|
---|
173 | * entry port: eTECSInfo
|
---|
174 | * signature: nTECSInfo_sTECSInfo
|
---|
175 | * context: task
|
---|
176 | * #[</ENTRY_PORT>]# */
|
---|
177 |
|
---|
178 | /* #[<ENTRY_FUNC>]# eTECSInfo_findNamespace
|
---|
179 | * name: eTECSInfo_findNamespace
|
---|
180 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findNamespace
|
---|
181 | * oneway: false
|
---|
182 | * #[</ENTRY_FUNC>]# */
|
---|
183 | ER
|
---|
184 | eTECSInfo_findNamespace(const char_t* namespace_path, Descriptor( nTECSInfo_sNamespaceInfo )* nsDesc)
|
---|
185 | {
|
---|
186 | const char_t *p = namespace_path;
|
---|
187 | char_t *p2;
|
---|
188 | Descriptor( nTECSInfo_sNamespaceInfo ) desc, desc2;
|
---|
189 | int i;
|
---|
190 | int n;
|
---|
191 |
|
---|
192 | if( p[ 0 ] == ':' && p[ 1 ] == ':' ){
|
---|
193 | p += 2;
|
---|
194 | }
|
---|
195 | desc = cNamespaceInfo_refer_to_descriptor(); // root name space
|
---|
196 | while( *p != '\0' ){
|
---|
197 | p2 = VAR_name1;
|
---|
198 | for( i = 0; i < ATTR_name_len; i++ ){
|
---|
199 | if( *p == '\0' || *p == ':' ){
|
---|
200 | *p2 = '\0';
|
---|
201 | break;
|
---|
202 | }
|
---|
203 | *p2++ = *p++;
|
---|
204 | }
|
---|
205 | if( i == ATTR_name_len )
|
---|
206 | return E_NORES;
|
---|
207 |
|
---|
208 | desc2 = desc;
|
---|
209 | cNamespaceInfoTemp_set_descriptor( desc2 );
|
---|
210 | n = cNamespaceInfoTemp_getNNamespace( );
|
---|
211 | for( i = 0; i < n; i++ ){
|
---|
212 | cNamespaceInfoTemp_set_descriptor( desc2 );
|
---|
213 | cNamespaceInfoTemp_getNamespaceInfo( i, &desc );
|
---|
214 | cNamespaceInfoTemp_set_descriptor( desc );
|
---|
215 | cNamespaceInfoTemp_getName( VAR_name2, ATTR_name_len );
|
---|
216 | if( strcmp( VAR_name1, VAR_name2 ) == 0 )
|
---|
217 | break;
|
---|
218 | }
|
---|
219 | if( i == n )
|
---|
220 | return E_NOID;
|
---|
221 |
|
---|
222 | if( p[ 0 ] == ':' ){
|
---|
223 | if( p[ 1 ] == ':' )
|
---|
224 | p += 2;
|
---|
225 | else
|
---|
226 | return E_OBJ;
|
---|
227 | }
|
---|
228 | }
|
---|
229 | *nsDesc = desc;
|
---|
230 | return E_OK;
|
---|
231 | }
|
---|
232 |
|
---|
233 | /* #[<ENTRY_FUNC>]# eTECSInfo_findRegion
|
---|
234 | * name: eTECSInfo_findRegion
|
---|
235 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findRegion
|
---|
236 | * oneway: false
|
---|
237 | * #[</ENTRY_FUNC>]# */
|
---|
238 | ER
|
---|
239 | eTECSInfo_findRegion(const char_t* namespace_path, Descriptor( nTECSInfo_sRegionInfo )* regionDesc)
|
---|
240 | {
|
---|
241 | const char_t *p = namespace_path;
|
---|
242 | char_t *p2;
|
---|
243 | Descriptor( nTECSInfo_sRegionInfo ) desc, desc2;
|
---|
244 | int i;
|
---|
245 | int n;
|
---|
246 |
|
---|
247 | if( p[ 0 ] == ':' && p[ 1 ] == ':' ){
|
---|
248 | p += 2;
|
---|
249 | }
|
---|
250 | desc = cRegionInfo_refer_to_descriptor();
|
---|
251 | while( *p != '\0' ){
|
---|
252 | p2 = VAR_name1;
|
---|
253 | for( i = 0; i < ATTR_name_len; i++ ){
|
---|
254 | if( *p == '\0' || *p == ':' ){
|
---|
255 | *p2 = '\0';
|
---|
256 | break;
|
---|
257 | }
|
---|
258 | *p2++ = *p++;
|
---|
259 | }
|
---|
260 | if( i == ATTR_name_len )
|
---|
261 | return E_NORES;
|
---|
262 |
|
---|
263 | desc2 = desc;
|
---|
264 | cRegionInfoTemp_set_descriptor( desc2 );
|
---|
265 | n = cRegionInfoTemp_getNRegion( );
|
---|
266 | for( i = 0; i < n; i++ ){
|
---|
267 | // syslog_3( LOG_NOTICE, "tTECSInfo.eTECSInfo.findRegion 2 %s i=%d n=%d", VAR_name1, i, n );
|
---|
268 | cRegionInfoTemp_set_descriptor( desc2 );
|
---|
269 | cRegionInfoTemp_getRegionInfo( i, &desc );
|
---|
270 | cRegionInfoTemp_set_descriptor( desc );
|
---|
271 | cRegionInfoTemp_getName( VAR_name2, ATTR_name_len );
|
---|
272 | if( strcmp( VAR_name1, VAR_name2 ) == 0 )
|
---|
273 | break;
|
---|
274 | }
|
---|
275 | if( i == n )
|
---|
276 | return E_NOID;
|
---|
277 |
|
---|
278 | if( p[ 0 ] == ':' ){
|
---|
279 | if( p[ 1 ] == ':' )
|
---|
280 | p += 2;
|
---|
281 | else
|
---|
282 | return E_OBJ;
|
---|
283 | }
|
---|
284 | }
|
---|
285 | *regionDesc = desc;
|
---|
286 | return E_OK;
|
---|
287 | }
|
---|
288 |
|
---|
289 | /* #[<ENTRY_FUNC>]# eTECSInfo_findSignature
|
---|
290 | * name: eTECSInfo_findSignature
|
---|
291 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findSignature
|
---|
292 | * oneway: false
|
---|
293 | * #[</ENTRY_FUNC>]# */
|
---|
294 | ER
|
---|
295 | eTECSInfo_findSignature(const char_t* namespace_path, Descriptor( nTECSInfo_sSignatureInfo )* signatureDesc)
|
---|
296 | {
|
---|
297 | Descriptor( nTECSInfo_sNamespaceInfo ) nsDesc;
|
---|
298 | Descriptor( nTECSInfo_sSignatureInfo ) desc;
|
---|
299 | ER ercd;
|
---|
300 | char_t *pname;
|
---|
301 | int i, n;
|
---|
302 |
|
---|
303 | ercd = separate_basename( &namespace_path, &pname );
|
---|
304 | if( ercd != E_OK )
|
---|
305 | return ercd;
|
---|
306 |
|
---|
307 | ercd = eTECSInfo_findNamespace( namespace_path, &nsDesc);
|
---|
308 | if( ercd != E_OK )
|
---|
309 | return ercd;
|
---|
310 |
|
---|
311 | // syslog_0( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 4" );
|
---|
312 | cNamespaceInfoTemp_set_descriptor( nsDesc );
|
---|
313 | n = cNamespaceInfoTemp_getNSignature( );
|
---|
314 | for( i = 0; i < n; i++ ){
|
---|
315 | cNamespaceInfoTemp_getSignatureInfo( i, &desc );
|
---|
316 | cSignatureInfoTemp_set_descriptor( desc );
|
---|
317 | cSignatureInfoTemp_getName( VAR_name1, ATTR_name_len );
|
---|
318 | if( strcmp( pname, VAR_name1 ) == 0 )
|
---|
319 | break;
|
---|
320 | }
|
---|
321 | // syslog_0( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 5" );
|
---|
322 | if( i == n )
|
---|
323 | return E_NOEXS;
|
---|
324 |
|
---|
325 | *signatureDesc = desc;
|
---|
326 | return E_OK;
|
---|
327 | }
|
---|
328 |
|
---|
329 | /* #[<ENTRY_FUNC>]# eTECSInfo_findCelltype
|
---|
330 | * name: eTECSInfo_findCelltype
|
---|
331 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findCelltype
|
---|
332 | * oneway: false
|
---|
333 | * #[</ENTRY_FUNC>]# */
|
---|
334 | ER
|
---|
335 | eTECSInfo_findCelltype(const char_t* namespace_path, Descriptor( nTECSInfo_sCelltypeInfo )* celltypeDesc)
|
---|
336 | {
|
---|
337 | return E_NOSPT;
|
---|
338 | }
|
---|
339 |
|
---|
340 | /* #[<ENTRY_FUNC>]# eTECSInfo_findCell
|
---|
341 | * name: eTECSInfo_findCell
|
---|
342 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findCell
|
---|
343 | * oneway: false
|
---|
344 | * #[</ENTRY_FUNC>]# */
|
---|
345 | ER
|
---|
346 | eTECSInfo_findCell(const char_t* namespace_path, Descriptor( nTECSInfo_sCellInfo )* cellDesc)
|
---|
347 | {
|
---|
348 | char_t *p, *pname;
|
---|
349 | Descriptor( nTECSInfo_sRegionInfo ) RegionDesc;
|
---|
350 | Descriptor( nTECSInfo_sCellInfo ) desc;
|
---|
351 | int i, n, len;
|
---|
352 | ER ercd;
|
---|
353 |
|
---|
354 | #if 0
|
---|
355 | // syslog_0( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 1" );
|
---|
356 | len = strnlen( namespace_path, ATTR_path_len );
|
---|
357 | if( len >= ATTR_path_len ){
|
---|
358 | return E_NOMEM;
|
---|
359 | }
|
---|
360 | if( VAR_path != namespace_path ) // findRawEntryDescriptorInfo ããå¼ã°ããæãVAR_path ã«å
|
---|
361 | ¥ã£ã¦ããã®ã§ã³ãã¼ä¸è¦
|
---|
362 | strcpy( VAR_path, namespace_path );
|
---|
363 | p = &VAR_path[ len - 1 ];
|
---|
364 | while( p > VAR_path ){
|
---|
365 | if( *p == ':' )
|
---|
366 | break;
|
---|
367 | p--;
|
---|
368 | }
|
---|
369 | if( *p == ':' ){
|
---|
370 | p--;
|
---|
371 | if( p < VAR_path || *p != ':' )
|
---|
372 | return E_PAR; // :: ã§ã¯ãªãã: ã§ãã£ã
|
---|
373 | if( p == VAR_path ){
|
---|
374 | namespace_path = "::";
|
---|
375 | }
|
---|
376 | else{
|
---|
377 | *p = '\0';
|
---|
378 | namespace_path = VAR_path;
|
---|
379 | }
|
---|
380 | pname = &p[2];
|
---|
381 | }
|
---|
382 | else{
|
---|
383 | namespace_path = "::";
|
---|
384 | pname = VAR_path;
|
---|
385 | }
|
---|
386 | #endif
|
---|
387 | ercd = separate_basename( &namespace_path, &pname );
|
---|
388 | if( ercd != E_OK )
|
---|
389 | return ercd;
|
---|
390 |
|
---|
391 | // syslog_2( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 2 %s %s", namespace_path, pname );
|
---|
392 |
|
---|
393 | // syslog_0( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 3" );
|
---|
394 | ercd = eTECSInfo_findRegion( namespace_path, &RegionDesc);
|
---|
395 | if( ercd != E_OK )
|
---|
396 | return ercd;
|
---|
397 |
|
---|
398 | // syslog_0( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 4" );
|
---|
399 | cRegionInfoTemp_set_descriptor( RegionDesc );
|
---|
400 | n = cRegionInfoTemp_getNCell( );
|
---|
401 | for( i = 0; i < n; i++ ){
|
---|
402 | cRegionInfoTemp_getCellInfo( i, &desc );
|
---|
403 | cCellInfoTemp_set_descriptor( desc );
|
---|
404 | cCellInfoTemp_getName( VAR_name1, ATTR_name_len );
|
---|
405 | if( strcmp( pname, VAR_name1 ) == 0 )
|
---|
406 | break;
|
---|
407 | }
|
---|
408 | // syslog_0( LOG_NOTICE, "tTECSInfo.eTECSInfo.findCell 5" );
|
---|
409 | if( i == n )
|
---|
410 | return E_NOEXS;
|
---|
411 |
|
---|
412 | *cellDesc = desc;
|
---|
413 | return E_OK;
|
---|
414 | }
|
---|
415 |
|
---|
416 | /* #[<ENTRY_FUNC>]# eTECSInfo_findRawEntryDescriptor
|
---|
417 | * name: eTECSInfo_findRawEntryDescriptor
|
---|
418 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findRawEntryDescriptor
|
---|
419 | * oneway: false
|
---|
420 | * #[</ENTRY_FUNC>]# */
|
---|
421 | ER
|
---|
422 | eTECSInfo_findRawEntryDescriptor(const char_t* namespace_path, int_t ith, Descriptor( nTECSInfo_sRawEntryDescriptorInfo )* rawEntryDescDesc, Descriptor( nTECSInfo_sEntryInfo )* entryDesc)
|
---|
423 | {
|
---|
424 | int_t len;
|
---|
425 | Descriptor( nTECSInfo_sCelltypeInfo ) celltypeDesc;
|
---|
426 | Descriptor( nTECSInfo_sCellInfo ) cellDesc;
|
---|
427 | Descriptor( nTECSInfo_sEntryInfo ) entDesc;
|
---|
428 | char_t *p;
|
---|
429 | int_t i, n;
|
---|
430 | ER ercd;
|
---|
431 |
|
---|
432 | len = strnlen( namespace_path, ATTR_path_len );
|
---|
433 | if( len >= ATTR_path_len ){
|
---|
434 | return E_NOMEM;
|
---|
435 | }
|
---|
436 | strcpy( VAR_path, namespace_path );
|
---|
437 | p = &VAR_path[len-1];
|
---|
438 | while( *p != '.' && p != &VAR_path[0] )
|
---|
439 | p--;
|
---|
440 | if( *p != '.' )
|
---|
441 | return E_PAR; // '.' ãè¦ã¤ãããªã
|
---|
442 | *p = '\0';
|
---|
443 | ercd = eTECSInfo_findCell( VAR_path, &cellDesc);
|
---|
444 | if( ercd != E_OK )
|
---|
445 | return ercd;
|
---|
446 | cCellInfoTemp_set_descriptor( cellDesc );
|
---|
447 | cCellInfoTemp_getCelltypeInfo( &celltypeDesc );
|
---|
448 | cCelltypeInfoTemp_set_descriptor( celltypeDesc );
|
---|
449 | n = cCelltypeInfoTemp_getNEntry();
|
---|
450 | p += 1;
|
---|
451 | //syslog_1( LOG_NOTICE, "tTECSInfo.eTECSInfo.findRawEntryDescriptor 4 n_entry=%d", n );
|
---|
452 | // dly_tsk( 10000 );
|
---|
453 | for( i = 0; i < n; i++ ){
|
---|
454 | ercd = cCelltypeInfoTemp_getEntryInfo( i, &entDesc ); // ã¨ã©ã¼ã¯ã¿ãªã
|
---|
455 | //syslog_2( LOG_NOTICE, "tTECSInfo.eTECSInfo.findRawEntryDescriptor 5 ercd=%d entDesc=%x", ercd, entDesc.vdes );
|
---|
456 | cEntryInfoTemp_set_descriptor( entDesc );
|
---|
457 | ercd = cEntryInfoTemp_getName( VAR_name1, ATTR_name_len );
|
---|
458 | //dly_tsk( 5 );
|
---|
459 | //syslog_4( LOG_NOTICE, "tTECSInfo.eTECSInfo.findRawEntryDescriptor 6 ercd=%d entDesc=%x nm=%s p=%s", ercd, entDesc.vdes, VAR_name1, p );
|
---|
460 | //dly_tsk( 5 );
|
---|
461 | if( ercd != E_OK )
|
---|
462 | return ercd;
|
---|
463 | if( strcmp( VAR_name1, p ) == 0 )
|
---|
464 | break;
|
---|
465 | }
|
---|
466 | if( i != n ){
|
---|
467 | cCellInfoTemp_getRawEntryDescriptorInfo( ith, rawEntryDescDesc );
|
---|
468 | *entryDesc = entDesc;
|
---|
469 | }
|
---|
470 | else{
|
---|
471 | ercd = E_NOEXS;
|
---|
472 | }
|
---|
473 | return ercd;
|
---|
474 | }
|
---|
475 |
|
---|
476 | /* #[<ENTRY_FUNC>]# eTECSInfo_findRawEntryDescriptor_unsafe
|
---|
477 | * name: eTECSInfo_findRawEntryDescriptor_unsafe
|
---|
478 | * global_name: nTECSInfo_tTECSInfoSub_eTECSInfo_findRawEntryDescriptor_unsafe
|
---|
479 | * oneway: false
|
---|
480 | * #[</ENTRY_FUNC>]# */
|
---|
481 | ER
|
---|
482 | eTECSInfo_findRawEntryDescriptor_unsafe(const char_t* namespace_path, void** rawDesc)
|
---|
483 | {
|
---|
484 | ER ercd;
|
---|
485 | Descriptor( nTECSInfo_sRawEntryDescriptorInfo ) rawEntryDescDesc;
|
---|
486 | Descriptor( nTECSInfo_sEntryInfo ) entryDesc;
|
---|
487 | ercd = eTECSInfo_findRawEntryDescriptor(namespace_path, 0, &rawEntryDescDesc, &entryDesc);
|
---|
488 | if( ercd != E_OK )
|
---|
489 | return ercd;
|
---|
490 | cRawEntryDescriptorInfoTemp_set_descriptor( rawEntryDescDesc );
|
---|
491 | ercd = cRawEntryDescriptorInfoTemp_getRawDescriptor( 0, rawDesc );
|
---|
492 | return ercd;
|
---|
493 | }
|
---|
494 |
|
---|
495 | /* #[<POSTAMBLE>]#
|
---|
496 | * ããããä¸ã«éåãå£é¢æ°ãæ¸ãã¾ã
|
---|
497 | * #[</POSTAMBLE>]#*/
|
---|
498 |
|
---|
499 | /*
|
---|
500 | * namespace_path ã VAR_path ã¸ã³ãã¼ãããã£ã¬ã¯ããªãã¹é¨ã¨ãªãã¸ã§ã¯ãåé¨ã«åå²ãã
|
---|
501 | * namespace_path "::namespace::subnamespace::object_name"
|
---|
502 | * VAR_path "::namespace::subnamespace\0:object_name" ä¸çªå³ã® '::' ã '\0:' ã«ç½®ãæãã
|
---|
503 | * basename "object_name" ã¸ã®ãã¤ã³ã¿ãè¿ã
|
---|
504 | */
|
---|
505 | static ER
|
---|
506 | separate_basename( const char_t **namespace_path, char_t **basename )
|
---|
507 | {
|
---|
508 | int i, len;
|
---|
509 | char_t *p;
|
---|
510 | static const char_t *root_namespacepath = "::";
|
---|
511 |
|
---|
512 | len = strnlen( *namespace_path, ATTR_path_len );
|
---|
513 | if( len >= ATTR_path_len ){
|
---|
514 | return E_NOMEM;
|
---|
515 | }
|
---|
516 | if( VAR_path != *namespace_path ) // findRawEntryDescriptorInfo ããå¼ã°ããæãVAR_path ã«å
|
---|
517 | ¥ã£ã¦ããã®ã§ã³ãã¼ä¸è¦
|
---|
518 | strcpy( VAR_path, *namespace_path );
|
---|
519 | p = &VAR_path[ len - 1 ];
|
---|
520 | while( p > VAR_path ){
|
---|
521 | if( *p == ':' )
|
---|
522 | break;
|
---|
523 | p--;
|
---|
524 | }
|
---|
525 | if( *p == ':' ){
|
---|
526 | p--;
|
---|
527 | if( p < VAR_path || *p != ':' )
|
---|
528 | return E_PAR; // :: ã§ã¯ãªãã: ã§ãã£ã
|
---|
529 | if( p == VAR_path ){
|
---|
530 | *namespace_path = root_namespacepath;
|
---|
531 | }
|
---|
532 | else{
|
---|
533 | *p = '\0';
|
---|
534 | *namespace_path = VAR_path;
|
---|
535 | }
|
---|
536 | *basename = &p[2];
|
---|
537 | }
|
---|
538 | else{
|
---|
539 | *namespace_path = root_namespacepath;
|
---|
540 | *basename = VAR_path;
|
---|
541 | }
|
---|
542 | return E_OK;
|
---|
543 | }
|
---|