source: dev/BasicCompiler_Common/Subroutine.cpp@ 37

Last change on this file since 37 was 31, checked in by dai_9181, 18 years ago

_System_LocalThis(見えないThisポインタパラメータ)を通常のパラメータ保有領域ではなく、リアルパラメータ保有領域に移動した。
メソッドとグローバル関数のオーバーロードに対応(DLL関数オーバーロードには未対応)。

File size: 30.9 KB
Line 
1#include "../BasicCompiler_Common/common.h"
2
3#ifdef _AMD64_
4#include "../BasicCompiler64/opcode.h"
5#else
6#include "../BasicCompiler32/opcode.h"
7#endif
8
9//コンパイル中の関数情報
10SUBINFO *pCompilingSubInfo;
11
12int GetCallProcName(char *buffer,char *name){
13 int i2,i3,IsStr=0;
14
15 for(i2=0;;i2++){
16 if(buffer[i2]=='\"') IsStr^=1;
17 if(IsDBCSLeadByte(buffer[i2])){
18 name[i2]=buffer[i2];
19 i2++;
20 name[i2]=buffer[i2];
21 continue;
22 }
23 if(buffer[i2]=='['&&IsStr==0){
24 i3=GetStringInBracket(name+i2,buffer+i2);
25 i2+=i3-1;
26 continue;
27 }
28 if(buffer[i2]=='('&&IsStr==0){
29 name[i2]=0;
30 break;
31 }
32 if(buffer[i2]=='='&&IsStr==0){
33 name[i2]=0;
34 break;
35 }
36
37 name[i2]=buffer[i2];
38 if(buffer[i2]=='\0') break;
39 }
40 return i2;
41}
42
43int GetProc(char *name,void **ppInfo){
44
45 //ユーザー定義関数
46 *ppInfo=(void *)GetSubHash(name);
47 if(*ppInfo) return PROC_DEFAULT;
48
49 //DLL関数
50 *ppInfo=(void *)GetDeclareHash(name);
51 if(*ppInfo) return PROC_DLL;
52
53 //コンパイラ埋め込み型
54 *ppInfo=(void *)(_int64)GetFunctionFromName(name);
55 if(*ppInfo) return PROC_BUILTIN;
56
57 //関数ポインタ
58 int type;
59 LONG_PTR lpIndex;
60 type=GetVarType(name,&lpIndex,0);
61 if(type==DEF_PTR_PROC) return PROC_PTR;
62
63 return 0;
64}
65
66void SplitObjectName(char *name,char *ObjectName,int *pRefType){
67 int i4;
68 for(i4=lstrlen(name)-1;i4>=0;i4--){
69 if(name[i4]=='.'||(name[i4]==1&&name[i4+1]==ESC_PSMEM))
70 break;
71 }
72 if(i4==-1) ObjectName[0]=0;
73 else{
74 //参照タイプを判別
75 if(name[i4]=='.') *pRefType=DEF_OBJECT;
76 else *pRefType=DEF_PTR_OBJECT;
77
78 if(i4==0) GetWithName(ObjectName);
79 else{
80 memcpy(ObjectName,name,i4);
81 ObjectName[i4]=0;
82 }
83 }
84}
85bool SplitMemberName( const char *desc, char *object, char *member ){
86 int i;
87 for(i=lstrlen(desc)-1;i>=0;i--){
88 if(desc[i]=='.'||(desc[i]==1&&desc[i+1]==ESC_PSMEM))
89 break;
90 }
91 if(i==-1) return false;
92 else{
93 if(desc[i]=='.')
94 lstrcpy(member,desc+i+1);
95 else
96 lstrcpy(member,desc+i+2);
97
98 if( object ){
99 lstrcpy( object, desc );
100 object[i]=0;
101 }
102 }
103
104 return true;
105}
106int GetReturnTypeOfProc(int idProc,void *pInfo,char *name,char *Parameter,LONG_PTR *plpRetIndex){
107 int ret_type;
108
109 if(idProc==PROC_DEFAULT){
110 /////////////////////
111 // ユーザー定義関数
112 /////////////////////
113
114 SUBINFO *psi;
115 psi=(SUBINFO *)pInfo;
116
117 //GetSubHash内でエラー提示が行われた場合
118 if(psi==(SUBINFO *)-1) return -1;
119
120
121 //オブジェクト名を取得
122 char ObjectName[VN_SIZE];
123 int RefType;
124 SplitObjectName(name,ObjectName,&RefType);
125
126
127 ////////////////////////
128 // オーバーロードを解決
129 ////////////////////////
130
131 SUBINFO **ppsi;
132 int num;
133 ppsi=GetOverloadSubHash(name,&num);
134 if(num){
135 //オーバーロードを解決
136 psi=OverloadSolutionWithStrParam(name,ppsi,num,Parameter,ObjectName,NULL);
137 HeapDefaultFree(ppsi);
138
139 if(!psi) return 0;
140 }
141
142
143 ret_type=psi->ReturnType;
144 *plpRetIndex=psi->u.ReturnIndex;
145 }
146 else if(idProc==PROC_DLL){
147 /////////////////////////
148 // DLL関数
149 /////////////////////////
150 DECLAREINFO *pdi;
151 pdi=(DECLAREINFO *)pInfo;
152
153 ret_type=pdi->ReturnType;
154 *plpRetIndex=pdi->u.ReturnIndex;
155 }
156 else if(idProc==PROC_BUILTIN){
157 /////////////////////////
158 // 組み込み関数
159 /////////////////////////
160 int FuncId;
161 FuncId=(int)(_int64)pInfo;
162
163 ret_type=GetFunctionType(FuncId);
164 *plpRetIndex=-1;
165 }
166 else if(idProc==PROC_PTR){
167 /////////////////
168 // 関数ポインタ
169 /////////////////
170
171 LONG_PTR lpIndex;
172 GetVarType(name,&lpIndex,0);
173
174 extern PROCPTRINFO *pProcPtrInfo;
175 ret_type=pProcPtrInfo[lpIndex].ReturnType;
176 *plpRetIndex=pProcPtrInfo[lpIndex].u.ReturnIndex;
177 }
178
179 return ret_type;
180}
181BOOL GetReturnTypeOfPropertyMethod(char *variable,char *RightSide,TYPEINFO *pRetTypeInfo){
182 //プロパティ用のメソッドを呼び出す
183
184 //配列要素を取得
185 char VarName[VN_SIZE],ArrayElements[VN_SIZE];
186 GetArrayElement(variable,VarName,ArrayElements);
187
188 //オブジェクト名を取得
189 char ObjectName[VN_SIZE];
190 int RefType;
191 SplitObjectName(VarName,ObjectName,&RefType);
192
193 //オーバーロード用の関数リストを作成
194 SUBINFO **ppsi;
195 int num;
196 ppsi=GetOverloadSubHash(VarName,&num);
197 if(num==0){
198 return 0;
199 }
200
201 //パラメータを整備
202 char *Parameter;
203 Parameter=(char *)HeapAlloc(hHeap,0,lstrlen(ArrayElements)+lstrlen(RightSide)+32);
204 lstrcpy(Parameter,ArrayElements);
205 if(RightSide){
206 if(Parameter[0]&&RightSide[0]) lstrcat(Parameter,",");
207 lstrcat(Parameter,RightSide);
208 }
209
210 //オーバーロードを解決
211 SUBINFO *psi;
212 psi=OverloadSolutionWithStrParam(VarName,ppsi,num,Parameter,ObjectName,NULL);
213 HeapDefaultFree(ppsi);
214
215 if(psi){
216 if(pRetTypeInfo){
217 pRetTypeInfo->type=psi->ReturnType;
218 pRetTypeInfo->u.lpIndex=psi->u.ReturnIndex;
219 }
220 }
221
222 return 1;
223}
224
225void AddDeclareData(char *buffer,int NowLine){
226 extern HANDLE hHeap;
227 int i,i2,i3,i4,sw,IsFunction;
228 char temporary[VN_SIZE];
229
230 i=0;
231
232 DWORD dwType;
233 BOOL bCdecl=0;
234
235 //Static/Dynamic
236 if(buffer[i]==ESC_STATIC){
237 dwType=DECLARE_STATIC;
238 i++;
239 }
240 else dwType=DECLARE_DYNAMIC;
241
242 //Sub/Function
243 if(buffer[i]==ESC_SUB) IsFunction=0;
244 else if(buffer[i]==ESC_FUNCTION) IsFunction=1;
245 else{
246 SetError(1,NULL,NowLine);
247 return;
248 }
249 i++;
250
251 //プロシージャ名
252 for(i2=0;;i++,i2++){
253 if(buffer[i]==1&&buffer[i+1]==ESC_CDECL){
254 bCdecl=1;
255
256 i+=2;
257 temporary[i2]=0;
258 break;
259 }
260 if(buffer[i]==','){
261 temporary[i2]=0;
262 break;
263 }
264 if(buffer[i]=='\0'){
265 SetError(1,NULL,NowLine);
266 return;
267 }
268 temporary[i2]=buffer[i];
269 }
270
271 //ユーザー定義関数との重複チェック
272 if(GetSubHash(temporary)){
273 SetError(15,temporary,NowLine);
274 return;
275 }
276
277
278 /////////////////////////////////
279 // 格納位置を計算してpciにセット
280 /////////////////////////////////
281
282 //ハッシュ値を取得
283 int key;
284 key=hash_default(temporary);
285
286 extern DECLAREINFO **ppDeclareHash;
287 DECLAREINFO *pdi;
288 if(ppDeclareHash[key]){
289 pdi=ppDeclareHash[key];
290 while(1){
291 if(lstrcmpi(pdi->name,temporary)==0){
292 //重複エラー
293 SetError(15,temporary,NowLine);
294 return;
295 }
296
297 if(pdi->pNextData==0){
298 pdi->pNextData=(DECLAREINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(DECLAREINFO));
299 break;
300 }
301 pdi=pdi->pNextData;
302 }
303 pdi=pdi->pNextData;
304 }
305 else{
306 ppDeclareHash[key]=(DECLAREINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(DECLAREINFO));
307 pdi=ppDeclareHash[key];
308 }
309
310 pdi->dwType=dwType;
311 pdi->bCdecl=bCdecl;
312
313 pdi->name=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
314 lstrcpy(pdi->name,temporary);
315 i++;
316
317 //ライブラリ
318 if(buffer[i]!='\"'){
319 SetError(1,NULL,NowLine);
320 return;
321 }
322 for(i++,i2=0;;i++,i2++){
323 if(buffer[i]=='\"'){
324 temporary[i2]=0;
325 break;
326 }
327 if(buffer[i]=='\0'){
328 SetError(1,NULL,NowLine);
329 return;
330 }
331 temporary[i2]=buffer[i];
332 }
333 CharUpper(temporary);
334 if(!strstr(temporary,".")){
335 if(pdi->dwType==DECLARE_STATIC) lstrcat(temporary,".LIB");
336 else{
337 lstrcat(temporary,".DLL");
338 if(lstrlen(temporary)>=16){
339 SetError(7,NULL,NowLine);
340 return;
341 }
342 }
343 }
344 pdi->file=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
345 lstrcpy(pdi->file,temporary);
346 i++;
347
348 if(buffer[i]==','){
349 i++;
350 if(buffer[i]!='\"'){
351 SetError(1,NULL,NowLine);
352 return;
353 }
354 for(i++,i2=0;;i++,i2++){
355 if(buffer[i]=='\"'){
356 temporary[i2]=0;
357 break;
358 }
359 if(buffer[i]=='\0'){
360 SetError(1,NULL,NowLine);
361 return;
362 }
363 temporary[i2]=buffer[i];
364 }
365 pdi->alias=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
366 lstrcpy(pdi->alias,temporary);
367 i++;
368 }
369 else{
370 pdi->alias=(char *)HeapAlloc(hHeap,0,lstrlen(pdi->name)+1);
371 lstrcpy(pdi->alias,pdi->name);
372 }
373
374 //パラメータの始めのカッコ
375 if(buffer[i]!='('){
376 SetError(1,NULL,NowLine);
377 return;
378 }
379 i++;
380
381 pdi->pParmInfo=(PARAMETER_INFO *)HeapAlloc(hHeap,0,1);
382
383 //各パラメータ
384 for(i3=0;;i3++){
385 if(buffer[i]==')') break;
386
387 pdi->pParmInfo=(PARAMETER_INFO *)HeapReAlloc(hHeap,0,pdi->pParmInfo,(i3+1)*sizeof(PARAMETER_INFO));
388
389 //ByVal
390 if(buffer[i]==1&&buffer[i+1]==ESC_BYVAL){
391 pdi->pParmInfo[i3].bByVal=1;
392 i+=2;
393 }
394 else if(buffer[i]==1&&buffer[i+1]==ESC_BYREF){
395 pdi->pParmInfo[i3].bByVal=0;
396 i+=2;
397 }
398 else pdi->pParmInfo[i3].bByVal=1;
399
400 //変数名は無視(temporaryの変数名は型宣言文字判断のため)
401 sw=0;
402 for(i2=0;;i++,i2++){
403 if(buffer[i]=='('){
404 if(!sw) sw=1;
405
406 i4=GetStringInPare(temporary+i2,buffer+i);
407 i2+=i4-1;
408 i+=i4-1;
409 continue;
410 }
411 if(buffer[i]=='['){
412 if(!sw) sw=1;
413
414 i4=GetStringInBracket(temporary+i2,buffer+i);
415 i2+=i4-1;
416 i+=i4-1;
417 continue;
418 }
419 if(!IsVariableChar(buffer[i])){
420 temporary[i2]=0;
421 break;
422 }
423 temporary[i2]=buffer[i];
424 }
425 if(lstrcmp(temporary,"...")==0) pdi->pParmInfo[i3].type=DEF_ELLIPSE;
426 else{
427 //型
428 if(buffer[i]==1&&buffer[i+1]==ESC_AS){
429 i+=2;
430 for(i2=0;;i++,i2++){
431 if(!(IsVariableChar(buffer[i])||buffer[i]=='*')){
432 temporary[i2]=0;
433 break;
434 }
435 temporary[i2]=buffer[i];
436 }
437 pdi->pParmInfo[i3].type=GetTypeFixed(temporary,&pdi->pParmInfo[i3].u.index);
438 }
439 else{
440 pdi->pParmInfo[i3].type=GetTypeFromSimpleName(temporary);
441 SetError(-103,temporary,NowLine);
442 }
443
444 if(sw){
445 //配列ポインタを引き渡すとき
446 pdi->pParmInfo[i3].type=GetPtrType(pdi->pParmInfo[i3].type,pdi->pParmInfo[i3].u.index);
447 }
448 }
449
450 //名前はダミー(使用しないため)
451 pdi->pParmInfo[i3].name="";
452
453 //構造体の場合はエラーチェック
454 if(pdi->pParmInfo[i3].type==-1) SetError(3,temporary,NowLine);
455 if(pdi->pParmInfo[i3].type==DEF_OBJECT){
456 if(pdi->pParmInfo[i3].bByVal) pdi->pParmInfo[i3].type=DEF_LONG;//SetError(28,temporary,NowLine);
457 }
458
459 //構造体アドレスの空白部
460 while(buffer[i]==' ') i++;
461
462 if(buffer[i]==','){
463 i++;
464 continue;
465 }
466 else if(buffer[i]==')') continue;
467 else{
468 SetError(1,NULL,NowLine);
469 break;
470 }
471 }
472 pdi->ParmNum=i3;
473
474 //戻り値
475 i++;
476 if(buffer[i]==1&&buffer[i+1]==ESC_AS){
477 if(IsFunction==0) SetError(1,NULL,NowLine);
478 i+=2;
479 pdi->ReturnType=GetTypeFixed(buffer+i,&pdi->u.ReturnIndex);
480 if(pdi->ReturnType==-1) SetError(3,buffer+i,NowLine);
481 if(pdi->ReturnType==DEF_OBJECT) SetError(40,NULL,NowLine);
482 }
483 else if(buffer[i]) SetError(1,NULL,NowLine);
484 else pdi->ReturnType=-1;
485
486 pdi->pos=NowLine;
487}
488
489BOOL CompareParameter(PARAMETER_INFO *ppi1,int pi_num1,PARAMETER_INFO *ppi2,int pi_num2){
490 if(pi_num1!=pi_num2) return 1;
491
492 int i;
493 for(i=0;i<pi_num1;i++){
494 if(ppi1[i].type!=ppi2[i].type){
495
496 if(ppi1[i].bByVal==0&&ppi1[i].type==DEF_ANY&&
497 ppi2[i].bByVal==1&&IsPtrType(ppi2[i].type)||
498 ppi1[i].bByVal==1&&IsPtrType(ppi1[i].type)&&
499 ppi2[i].bByVal==0&&ppi2[i].type==DEF_ANY){
500 /* ByRef var As Any
501
502 var As VoidPtr
503 は同等
504 */
505 continue;
506 }
507
508 return 1;
509 }
510 else{
511 if(NATURAL_TYPE(ppi1[i].type)==DEF_OBJECT){
512 if(ppi1[i].u.index!=ppi2[i].u.index) return 1;
513 }
514 }
515 }
516
517 return 0;
518}
519SUBINFO *AddSubData(char *buffer,int NowLine,BOOL bVirtual,CClass *pobj_c,BOOL bStatic){
520 int i,i2,i3,sw;
521 DWORD dwType;
522 char temporary[8192],temp2[VN_SIZE];
523
524 i=1;
525 if(buffer[i]==ESC_SUB) dwType=SUBTYPE_SUB;
526 else if(buffer[i]==ESC_FUNCTION) dwType=SUBTYPE_FUNCTION;
527 else if(buffer[i]==ESC_MACRO) dwType=SUBTYPE_MACRO;
528
529 i++;
530
531 BOOL bExport=0,bCdecl=0;
532 while(1){
533 if(buffer[i]==1&&buffer[i+1]==ESC_EXPORT&&bExport==0){
534 bExport=1;
535
536 i+=2;
537 }
538 else if(buffer[i]==1&&buffer[i+1]==ESC_CDECL&&bCdecl==0){
539 bCdecl=1;
540
541 i+=2;
542 }
543 else break;
544 }
545
546 i2=0;
547 if(buffer[i]==1&&buffer[i+1]==ESC_OPERATOR){
548 if(!pobj_c){
549 SetError(126,NULL,NowLine);
550 return 0;
551 }
552
553 //オペレータの場合
554 temporary[i2++]=buffer[i++];
555 temporary[i2++]=buffer[i++];
556
557 int iCalcId;
558 if(buffer[i]=='='&&buffer[i+1]=='='){
559 iCalcId=CALC_EQUAL;
560 i3=2;
561 }
562 else if(buffer[i]=='='){
563 iCalcId=CALC_SUBSITUATION;
564 i3=1;
565 }
566 else if(buffer[i]=='('){
567 iCalcId=CALC_AS;
568 i3=0;
569 }
570 else if(buffer[i]=='['&&buffer[i+1]==']'&&buffer[i+2]=='='){
571 iCalcId=CALC_ARRAY_SET;
572 i3=3;
573 }
574 else if(buffer[i]=='['&&buffer[i+1]==']'){
575 iCalcId=CALC_ARRAY_GET;
576 i3=2;
577 }
578 else{
579 iCalcId=GetCalcId(buffer+i,&i3);
580 i3++;
581 }
582 if(!iCalcId){
583 SetError(1,NULL,NowLine);
584 return 0;
585 }
586 temporary[i2++]=iCalcId;
587 temporary[i2]=0;
588
589 i+=i3;
590 }
591 else{
592 if(pobj_c){
593 //クラスメンバの場合、デストラクタには~が付くことを考慮
594 if(buffer[i]=='~'){
595 temporary[i2]='~';
596 i++;
597 i2++;
598 }
599 }
600
601 for(;;i++,i2++){
602 if(!IsVariableChar(buffer[i])){
603 temporary[i2]=0;
604 break;
605 }
606 temporary[i2]=buffer[i];
607 }
608 }
609
610 if(dwType==SUBTYPE_MACRO){
611 //大文字に変換
612 CharUpper(temporary);
613
614 //マクロ関数の場合は名前リストに追加
615 extern char **ppMacroNames;
616 extern int MacroNum;
617 ppMacroNames=(char **)HeapReAlloc(hHeap,0,ppMacroNames,(MacroNum+1)*sizeof(char *));
618 ppMacroNames[MacroNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
619 lstrcpy(ppMacroNames[MacroNum],temporary);
620 MacroNum++;
621 }
622
623 if(!pobj_c){
624 //クラスメンバ以外の場合のみ
625 //重複チェック
626
627 if(GetDeclareHash(temporary)){
628 SetError(15,temporary,NowLine);
629 return 0;
630 }
631 }
632
633 extern int SubNum;
634 SubNum++;
635
636 SUBINFO *psi;
637 psi=(SUBINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(SUBINFO));
638
639 //クラス名
640 psi->pobj_ParentClass=pobj_c;
641
642 //ID
643 static int id_base=0;
644 psi->id=(id_base++);
645
646 //関数名
647 psi->name=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
648 lstrcpy(psi->name,temporary);
649
650 //ソースコードの位置
651 psi->address=NowLine;
652
653 psi->bExport=bExport;
654 psi->bCdecl=bCdecl;
655 psi->bVirtual=bVirtual;
656 if(bExport) psi->bUse=1;
657 else psi->bUse=0;
658 psi->bCompile=0;
659 psi->bSystem=0;
660
661 psi->dwType=dwType;
662
663
664 if(psi->dwType==SUBTYPE_FUNCTION){
665 ///////////////////
666 // 戻り値を取得
667 ///////////////////
668
669 if(pobj_c){
670 if(lstrcmp(psi->name,pobj_c->name)==0||
671 psi->name[0]=='~'){
672 //クラスのコンストラクタ、デストラクタがFunction定義の場合はエラーをだす
673 SetError(115,NULL,NowLine);
674 }
675 }
676
677
678 i2=lstrlen(buffer)-2;
679
680 int sw_as=0;
681 for(;i2>0;i2--){
682 if(buffer[i2]==')') break;
683 if(buffer[i2]==1&&buffer[i2+1]==ESC_AS){
684 i2+=2;
685 i3=0;
686 while(buffer[i2]=='*') temporary[i3++]=buffer[i2++];
687 for(;;i2++,i3++){
688 if(!IsVariableChar(buffer[i2])){
689 temporary[i3]=0;
690 break;
691 }
692 temporary[i3]=buffer[i2];
693 }
694 psi->ReturnType=GetTypeFixed(temporary,&psi->u.ReturnIndex);
695 if(psi->ReturnType==-1) SetError(3,temporary,NowLine);
696
697 sw_as=1;
698 break;
699 }
700 }
701
702 if(!sw_as){
703 SetError(-104,psi->name,NowLine);
704
705 psi->ReturnType=DEF_DOUBLE;
706 }
707 }
708 else{
709 //戻り値なしのSub定義
710 psi->ReturnType=-1;
711 psi->u.ReturnIndex=-1;
712 }
713
714
715
716 psi->pParmInfo=(PARAMETER_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(PARAMETER_INFO)*2);
717 psi->ParmNum=0;
718
719 //パラメータ
720 if(buffer[i]!='('){
721 SetError(1,NULL,NowLine);
722 return 0;
723 }
724 i++;
725 if(buffer[i]!=')'&&pobj_c){
726 //クラスのメンバ関数の場合のみ、デストラクタにパラメータがある場合にエラーをだす
727 if(psi->name[0]=='~'){
728 SetError(114,NULL,NowLine);
729 i=JumpStringInPare(buffer,i);
730 }
731 }
732 while(1){
733 if(buffer[i]==')') break;
734
735 psi->pParmInfo=(PARAMETER_INFO *)HeapReAlloc(hHeap,0,psi->pParmInfo,(psi->ParmNum+1)*sizeof(PARAMETER_INFO));
736
737 //ByVal
738 if(buffer[i]==1&&buffer[i+1]==ESC_BYVAL){
739 psi->pParmInfo[psi->ParmNum].bByVal=1;
740 i+=2;
741 }
742 else if(buffer[i]==1&&buffer[i+1]==ESC_BYREF){
743 psi->pParmInfo[psi->ParmNum].bByVal=0;
744 i+=2;
745 }
746 else psi->pParmInfo[psi->ParmNum].bByVal=1;
747
748 //パラメータ名
749 sw=0;
750 for(i2=0;;i++,i2++){
751 if(buffer[i]=='('){
752 if(!sw) sw=1;
753
754 i3=GetStringInPare(temporary+i2,buffer+i);
755 i2+=i3-1;
756 i+=i3-1;
757 continue;
758 }
759 if(buffer[i]=='['){
760 if(!sw) sw=1;
761
762 i3=GetStringInBracket(temporary+i2,buffer+i);
763 i2+=i3-1;
764 i+=i3-1;
765 continue;
766 }
767 if(!IsVariableChar(buffer[i])){
768 temporary[i2]=0;
769 break;
770 }
771 temporary[i2]=buffer[i];
772 }
773 if(sw){
774 //配列パラメータ
775 if(psi->pParmInfo[psi->ParmNum].bByVal) SetError(29,NULL,NowLine);
776 psi->pParmInfo[psi->ParmNum].bArray=1;
777
778 if((temporary[i2-2]=='('&&temporary[i2-1]==')')||
779 (temporary[i2-2]=='['&&temporary[i2-1]==']')){
780 psi->pParmInfo[psi->ParmNum].SubScripts[0]=LONG_MAX;
781 psi->pParmInfo[psi->ParmNum].SubScripts[1]=-1;
782
783 temporary[i2-2]=0;
784 }
785 else{
786 GetArrange(temporary,temp2,psi->pParmInfo[psi->ParmNum].SubScripts);
787 lstrcpy(temporary,temp2);
788 }
789
790 i2=lstrlen(temporary);
791 }
792 else{
793 psi->pParmInfo[psi->ParmNum].bArray=0;
794 psi->pParmInfo[psi->ParmNum].SubScripts[0]=-1;
795 }
796 psi->pParmInfo[psi->ParmNum].name=(char *)HeapAlloc(hHeap,0,i2+1);
797 lstrcpy(psi->pParmInfo[psi->ParmNum].name,temporary);
798
799 //型
800 if(buffer[i]==1&&buffer[i+1]==ESC_AS){
801 i+=2;
802
803 i2=0;
804 while(buffer[i]=='*'){
805 temporary[i2]=buffer[i];
806 i++;
807 i2++;
808 }
809 for(;;i++,i2++){
810 if(!IsVariableChar(buffer[i])){
811 if(buffer[i]==1&&(buffer[i+1]==ESC_FUNCTION||buffer[i+1]==ESC_SUB)){
812 temporary[i2++]=buffer[i++];
813 temporary[i2]=buffer[i];
814 continue;
815 }
816 temporary[i2]=0;
817 break;
818 }
819 temporary[i2]=buffer[i];
820 }
821
822 psi->pParmInfo[psi->ParmNum].type=
823 GetTypeFixed(temporary,&psi->pParmInfo[psi->ParmNum].u.index);
824
825 if(temporary[0]=='*'&&
826 temporary[1]==1&&
827 (temporary[2]==ESC_FUNCTION||temporary[2]==ESC_SUB)){
828 if(buffer[i]!='('){
829 SetError(10,temporary,NowLine);
830 return 0;
831 }
832 i3=GetStringInPare(temporary+i2,buffer+i);
833 i+=i3;
834 i2+=i3;
835
836 if(temporary[2]==ESC_FUNCTION&&buffer[i]==1&&buffer[i+1]==ESC_AS){
837 temporary[i2++]=buffer[i++];
838 temporary[i2++]=buffer[i++];
839 for(;;i++,i2++){
840 if(!IsVariableChar(buffer[i])){
841 temporary[i2]=0;
842 break;
843 }
844 temporary[i2]=buffer[i];
845 }
846 }
847 }
848 else{
849 //TypeDefをする前のベース型を取得
850 GetOriginalTypeName(temporary);
851 }
852
853 if(psi->pParmInfo[psi->ParmNum].type==-1){
854 SetError(3,temporary,NowLine);
855 psi->pParmInfo[psi->ParmNum].type=DEF_PTR_VOID;
856 }
857
858 /*未完成(構造体パラメータを値参照として渡してよいものか!?)
859 if(psi->pParmInfo[psi->ParmNum].type==DEF_OBJECT){
860 if(psi->pParmInfo[psi->ParmNum].bByVal) SetError(28,temporary,NowLine);
861 }*/
862 }
863 else{
864 psi->pParmInfo[psi->ParmNum].type=GetTypeFromSimpleName(temporary);
865 SetError(-103,temporary,NowLine);
866 }
867
868 if(psi->pParmInfo[psi->ParmNum].type==DEF_PTR_PROC){
869 //関数ポインタの場合
870 psi->pParmInfo[psi->ParmNum].u.index=AddProcPtrInfo(temporary+3,temporary[2]);
871 }
872
873 //パラメータの数を更新
874 psi->ParmNum++;
875
876 if(buffer[i]==','){
877 i++;
878 continue;
879 }
880 else if(buffer[i]==')') continue;
881 else{
882 SetError(1,NULL,NowLine);
883 return 0;
884 }
885 }
886 psi->SecondParmNum=psi->ParmNum;
887 i++;
888 if(buffer[i]=='('){
889 i++;
890 while(1){
891 if(buffer[i]==')') break;
892
893 psi->pParmInfo=(PARAMETER_INFO *)HeapReAlloc(hHeap,0,psi->pParmInfo,(psi->ParmNum+1)*sizeof(PARAMETER_INFO));
894
895 //ByVal
896 if(buffer[i]==1&&buffer[i+1]==ESC_BYVAL){
897 psi->pParmInfo[psi->ParmNum].bByVal=1;
898 i+=2;
899 }
900 else if(buffer[i]==1&&buffer[i+1]==ESC_BYREF){
901 psi->pParmInfo[psi->ParmNum].bByVal=0;
902 i+=2;
903 }
904 else psi->pParmInfo[psi->ParmNum].bByVal=1;
905
906 //パラメータ名
907 sw=0;
908 for(i2=0;;i++,i2++){
909 if(buffer[i]=='('){
910 if(!sw) sw=1;
911
912 i3=GetStringInPare(temporary+i2,buffer+i);
913 i2+=i3-1;
914 i+=i3-1;
915 continue;
916 }
917 if(buffer[i]=='['){
918 if(!sw) sw=1;
919
920 i3=GetStringInBracket(temporary+i2,buffer+i);
921 i2+=i3-1;
922 i+=i3-1;
923 continue;
924 }
925 if(!IsVariableChar(buffer[i])){
926 temporary[i2]=0;
927 break;
928 }
929 temporary[i2]=buffer[i];
930 }
931 if(sw){
932 //配列パラメータ
933 if(psi->pParmInfo[psi->ParmNum].bByVal) SetError(29,NULL,NowLine);
934 psi->pParmInfo[psi->ParmNum].bArray=1;
935
936 if((temporary[i2-2]=='('&&temporary[i2-1]==')')||
937 (temporary[i2-2]=='['&&temporary[i2-1]==']')){
938 psi->pParmInfo[psi->ParmNum].SubScripts[0]=LONG_MAX;
939 psi->pParmInfo[psi->ParmNum].SubScripts[1]=-1;
940
941 temporary[i2-2]=0;
942 }
943 else{
944 GetArrange(temporary,temp2,psi->pParmInfo[psi->ParmNum].SubScripts);
945 lstrcpy(temporary,temp2);
946 }
947
948 i2=lstrlen(temporary);
949 }
950 else{
951 psi->pParmInfo[psi->ParmNum].bArray=0;
952 psi->pParmInfo[psi->ParmNum].SubScripts[0]=-1;
953 }
954 psi->pParmInfo[psi->ParmNum].name=(char *)HeapAlloc(hHeap,0,i2+1);
955 lstrcpy(psi->pParmInfo[psi->ParmNum].name,temporary);
956
957 //型
958 if(buffer[i]==1&&buffer[i+1]==ESC_AS){
959 i+=2;
960 i2=0;
961 while(buffer[i]=='*'){
962 temporary[i2]=buffer[i];
963 i++;
964 i2++;
965 }
966 for(;;i++,i2++){
967 if(!IsVariableChar(buffer[i])){
968 temporary[i2]=0;
969 break;
970 }
971 temporary[i2]=buffer[i];
972 }
973 psi->pParmInfo[psi->ParmNum].type=
974 GetTypeFixed(temporary,&psi->pParmInfo[psi->ParmNum].u.index);
975 if(psi->pParmInfo[psi->ParmNum].type==-1) SetError(3,temporary,NowLine);
976 }
977 else{
978 psi->pParmInfo[psi->ParmNum].type=GetTypeFromSimpleName(temporary);
979 SetError(-103,temporary,NowLine);
980 }
981
982 psi->ParmNum++;
983
984 if(buffer[i]==','){
985 i++;
986 continue;
987 }
988 else if(buffer[i]==')') continue;
989 else{
990 SetError(1,NULL,NowLine);
991 return 0;
992 }
993 }
994 i++;
995 }
996
997 //リアルパラメータ領域を取得(_System_LocalThis、_System_ReturnValueを考慮して2つだけ多く確保する)
998 psi->pRealParmInfo=(PARAMETER_INFO *)HeapAlloc(hHeap,0,(psi->ParmNum+2)*sizeof(PARAMETER_INFO));
999 psi->RealParmNum=0;
1000
1001 if(pobj_c&&bStatic==0){
1002 i = psi->RealParmNum;
1003
1004 //オブジェクトメンバの場合は、第一パラメータを_System_LocalThis引き渡し用として利用
1005 psi->pRealParmInfo[i].name = "_System_LocalThis";
1006 psi->pRealParmInfo[i].type=DEF_PTR_VOID;
1007 psi->pRealParmInfo[i].u.index=-1;
1008 psi->pRealParmInfo[i].bByVal=1;
1009 psi->pRealParmInfo[i].bArray=0;
1010 psi->pRealParmInfo[i].SubScripts[0]=-1;
1011
1012 psi->RealParmNum++;
1013 }
1014
1015 if(psi->ReturnType==DEF_OBJECT){
1016 i = psi->RealParmNum;
1017
1018 //実体オブジェクトを戻り値として持つ場合
1019 //※第一パラメータ(Thisポインタありの場合は第二パラメータ)を戻り値用の参照宣言にする
1020
1021 if(psi->name[0]==1&&psi->name[1]==ESC_OPERATOR)
1022 psi->pRealParmInfo[i].name="_System_ReturnValue";
1023 else psi->pRealParmInfo[i].name=psi->name;
1024 psi->pRealParmInfo[i].type=DEF_OBJECT;
1025 psi->pRealParmInfo[i].u.index=psi->u.ReturnIndex;
1026 psi->pRealParmInfo[i].bByVal=0;
1027 psi->pRealParmInfo[i].bArray=0;
1028 psi->pRealParmInfo[i].SubScripts[0]=-1;
1029
1030 psi->RealParmNum++;
1031 }
1032
1033 //パラメータをコピー
1034 for( i = 0; i < psi->ParmNum; i++, psi->RealParmNum++ ){
1035 psi->pRealParmInfo[psi->RealParmNum]=psi->pParmInfo[i];
1036 }
1037
1038
1039 /////////////////////////////////
1040 // ハッシュデータに追加
1041 /////////////////////////////////
1042
1043 int key;
1044 key=hash_default(psi->name);
1045
1046 extern SUBINFO **ppSubHash;
1047 if(ppSubHash[key]){
1048 SUBINFO *psi2;
1049 psi2=ppSubHash[key];
1050 while(1){
1051 if(pobj_c==psi2->pobj_ParentClass){
1052 //重複エラーチェックを行う
1053 if(lstrcmp(psi2->name,psi->name)==0){
1054 if(CompareParameter(psi2->pParmInfo,psi2->ParmNum,psi->pParmInfo,psi->ParmNum)==0){
1055 SetError(15,psi->name,NowLine);
1056 return 0;
1057 }
1058 }
1059 }
1060
1061 if(psi2->pNextData==0) break;
1062 psi2=psi2->pNextData;
1063 }
1064 psi2->pNextData=psi;
1065 }
1066 else{
1067 ppSubHash[key]=psi;
1068 }
1069
1070 return psi;
1071}
1072
1073void GetSubInfo(void){ //サブルーチン情報を取得
1074 extern HANDLE hHeap;
1075 extern char *basbuf;
1076 int i,i2,i3;
1077 char temporary[8192];
1078
1079 //Declare(DLL関数)情報を初期化
1080 extern DECLAREINFO **ppDeclareHash;
1081 ppDeclareHash=(DECLAREINFO **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(DECLAREINFO *));
1082
1083 //サブルーチン(ユーザー定義)情報を初期化
1084 extern SUBINFO **ppSubHash;
1085 extern int SubNum;
1086 ppSubHash=(SUBINFO **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(SUBINFO *));
1087 SubNum=0;
1088
1089 //マクロ関数の名前リストを初期化
1090 extern char **ppMacroNames;
1091 extern int MacroNum;
1092 ppMacroNames=(char **)HeapAlloc(hHeap,0,1);
1093 MacroNum=0;
1094
1095 i=-1;
1096 while(1){
1097 i++;
1098
1099 if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_INTERFACE)){
1100 /* Class ~ End Class
1101 Interface ~ End Interface
1102 を飛び越す */
1103 i3=GetEndXXXCommand(basbuf[i+1]);
1104 for(i+=2,i2=0;;i++,i2++){
1105 if(basbuf[i]=='\0') break;
1106 if(basbuf[i]==1&&basbuf[i+1]==(char)i3){
1107 i++;
1108 break;
1109 }
1110 }
1111 if(basbuf[i]=='\0') break;
1112 continue;
1113 }
1114
1115 if(basbuf[i]==1&&basbuf[i+1]==ESC_DECLARE){
1116 for(i+=2,i2=0;;i2++,i++){
1117 if(basbuf[i]=='\n'){
1118 temporary[i2]=0;
1119 break;
1120 }
1121 temporary[i2]=basbuf[i];
1122 if(basbuf[i]=='\0') break;
1123 }
1124 AddDeclareData(temporary,i);
1125
1126 continue;
1127 }
1128 if(basbuf[i]==1&&(basbuf[i+1]==ESC_SUB||basbuf[i+1]==ESC_FUNCTION||basbuf[i+1]==ESC_MACRO)){
1129 for(i2=0;;i2++,i++){
1130 if(IsCommandDelimitation(basbuf[i])){
1131 temporary[i2]=0;
1132 break;
1133 }
1134 temporary[i2]=basbuf[i];
1135 if(basbuf[i]=='\0') break;
1136 }
1137 AddSubData(temporary,i,0,0);
1138
1139 continue;
1140 }
1141
1142 //次の行
1143 for(;;i++){
1144 if(IsCommandDelimitation(basbuf[i])) break;
1145 }
1146 if(basbuf[i]=='\0') break;
1147 }
1148
1149 ////////////
1150 // 特殊関数
1151 ////////////
1152
1153 sprintf(temporary,"%c%c_allrem()",1,ESC_SUB);
1154 AddSubData(temporary,0,0,0);
1155
1156 sprintf(temporary,"%c%c_aullrem()",1,ESC_SUB);
1157 AddSubData(temporary,0,0,0);
1158
1159 sprintf(temporary,"%c%c_allmul()",1,ESC_SUB);
1160 AddSubData(temporary,0,0,0);
1161
1162 sprintf(temporary,"%c%c_alldiv()",1,ESC_SUB);
1163 AddSubData(temporary,0,0,0);
1164
1165 sprintf(temporary,"%c%c_aulldiv()",1,ESC_SUB);
1166 AddSubData(temporary,0,0,0);
1167
1168 sprintf(temporary,"%c%c_allshl()",1,ESC_SUB);
1169 AddSubData(temporary,0,0,0);
1170
1171 sprintf(temporary,"%c%c_allshr()",1,ESC_SUB);
1172 AddSubData(temporary,0,0,0);
1173
1174 sprintf(temporary,"%c%c_aullshr()",1,ESC_SUB);
1175 AddSubData(temporary,0,0,0);
1176
1177 sprintf(temporary,"%c%c_System_InitStaticLocalVariables()",1,ESC_SUB);
1178 AddSubData(temporary,0,0,0);
1179}
1180void Delete_si(SUBINFO *psi){
1181 int i2;
1182
1183 for(i2=0;i2<psi->ParmNum;i2++){
1184 HeapDefaultFree(psi->pParmInfo[i2].name);
1185 }
1186 HeapDefaultFree(psi->pRealParmInfo);
1187 if(psi->pParmInfo) HeapDefaultFree(psi->pParmInfo);
1188 psi->pRealParmInfo=0;
1189 psi->pParmInfo=0;
1190
1191 if(psi->pNextData) Delete_si(psi->pNextData);
1192
1193 HeapDefaultFree(psi->name);
1194 HeapDefaultFree(psi);
1195}
1196void DeleteSubInfo(SUBINFO **ppSubHash,char **ppMacroNames,int MacroNum){ //サブルーチン情報のメモリ解放
1197 int i;
1198 for(i=0;i<MAX_HASH;i++){
1199 if(!ppSubHash[i]) continue;
1200
1201 Delete_si(ppSubHash[i]);
1202 }
1203 HeapDefaultFree(ppSubHash);
1204
1205 //マクロの名前リスト
1206 if(ppMacroNames){
1207 for(i=0;i<MacroNum;i++){
1208 HeapDefaultFree(ppMacroNames[i]);
1209 }
1210 HeapDefaultFree(ppMacroNames);
1211 }
1212}
1213void Delete_di(DECLAREINFO *pdi){
1214 if(pdi->pParmInfo) HeapDefaultFree(pdi->pParmInfo);
1215
1216 HeapDefaultFree(pdi->name);
1217 if(pdi->file) HeapDefaultFree(pdi->file);
1218 if(pdi->alias) HeapDefaultFree(pdi->alias);
1219
1220 if(pdi->pNextData) Delete_di(pdi->pNextData);
1221
1222 HeapDefaultFree(pdi);
1223}
1224void DeleteDeclareInfo(void){
1225 //DLL情報を解放
1226 extern DECLAREINFO **ppDeclareHash;
1227 int i;
1228 for(i=0;i<MAX_HASH;i++){
1229 if(!ppDeclareHash[i]) continue;
1230
1231 Delete_di(ppDeclareHash[i]);
1232 }
1233 HeapDefaultFree(ppDeclareHash);
1234}
1235
1236
1237
1238///////////////////////
1239// 関数ポインタの管理
1240///////////////////////
1241
1242int AddProcPtrInfo(char *buffer,DWORD dwProcType){
1243 extern HANDLE hHeap;
1244 extern int cp;
1245 extern PROCPTRINFO *pProcPtrInfo;
1246 extern int ProcPtrInfoNum;
1247 int i,i2,i3,sw;
1248 PROCPTRINFO *pi;
1249 char temporary[VN_SIZE],temp2[VN_SIZE];
1250
1251 pProcPtrInfo=(PROCPTRINFO *)HeapReAlloc(hHeap,0,pProcPtrInfo,(ProcPtrInfoNum+1)*sizeof(PROCPTRINFO));
1252 pi=&pProcPtrInfo[ProcPtrInfoNum];
1253 ProcPtrInfoNum++;
1254
1255 pi->pParmInfo=(PARAMETER_INFO *)HeapAlloc(hHeap,0,1);
1256 pi->ParmNum=0;
1257
1258 //buffer[0]は'('となっている
1259 i=1;
1260
1261 while(1){
1262 if(buffer[i]==')') break;
1263
1264 pi->pParmInfo=(PARAMETER_INFO *)HeapReAlloc(hHeap,0,pi->pParmInfo,(pi->ParmNum+1)*sizeof(PARAMETER_INFO));
1265
1266 //ByVal
1267 if(buffer[i]==1&&buffer[i+1]==ESC_BYVAL){
1268 pi->pParmInfo[pi->ParmNum].bByVal=1;
1269 i+=2;
1270 }
1271 else if(buffer[i]==1&&buffer[i+1]==ESC_BYREF){
1272 pi->pParmInfo[pi->ParmNum].bByVal=0;
1273 i+=2;
1274 }
1275 else pi->pParmInfo[pi->ParmNum].bByVal=1;
1276
1277 //パラメータ名
1278 sw=0;
1279 for(i2=0;;i++,i2++){
1280 if(buffer[i]=='('){
1281 if(!sw) sw=1;
1282
1283 i3=GetStringInPare(temporary+i2,buffer+i);
1284 i2+=i3-1;
1285 i+=i3-1;
1286 continue;
1287 }
1288 if(buffer[i]=='['){
1289 if(!sw) sw=1;
1290
1291 i3=GetStringInBracket(temporary+i2,buffer+i);
1292 i2+=i3-1;
1293 i+=i3-1;
1294 continue;
1295 }
1296 if(!IsVariableChar(buffer[i])){
1297 temporary[i2]=0;
1298 break;
1299 }
1300 temporary[i2]=buffer[i];
1301 }
1302 pi->pParmInfo[pi->ParmNum].name=0;
1303
1304 if(sw){
1305 //配列パラメータ
1306 if(pi->pParmInfo[pi->ParmNum].bByVal) SetError(29,NULL,cp);
1307 pi->pParmInfo[pi->ParmNum].bArray=1;
1308
1309 if((temporary[i2-2]=='('&&temporary[i2-1]==')')||
1310 (temporary[i2-2]=='['&&temporary[i2-1]==']')){
1311 pi->pParmInfo[pi->ParmNum].SubScripts[0]=LONG_MAX;
1312 pi->pParmInfo[pi->ParmNum].SubScripts[1]=-1;
1313
1314 temporary[i2-2]=0;
1315 }
1316 else{
1317 GetArrange(temporary,temp2,pi->pParmInfo[pi->ParmNum].SubScripts);
1318 lstrcpy(temporary,temp2);
1319 }
1320
1321 i2=lstrlen(temporary);
1322 }
1323 else{
1324 pi->pParmInfo[pi->ParmNum].bArray=0;
1325 pi->pParmInfo[pi->ParmNum].SubScripts[0]=-1;
1326 }
1327
1328 //型
1329 if(buffer[i]==1&&buffer[i+1]==ESC_AS){
1330 i+=2;
1331
1332 i2=0;
1333 while(buffer[i]=='*'){
1334 temporary[i2]=buffer[i];
1335 i++;
1336 i2++;
1337 }
1338 for(;;i++,i2++){
1339 if(!IsVariableChar(buffer[i])){
1340 temporary[i2]=0;
1341 break;
1342 }
1343 temporary[i2]=buffer[i];
1344 }
1345
1346 pi->pParmInfo[pi->ParmNum].type=
1347 GetTypeFixed(temporary,&pi->pParmInfo[pi->ParmNum].u.index);
1348 if(pi->pParmInfo[pi->ParmNum].type==-1){
1349 SetError(3,temporary,cp);
1350 pi->pParmInfo[pi->ParmNum].type=DEF_PTR_VOID;
1351 }
1352 if(pi->pParmInfo[pi->ParmNum].type==DEF_OBJECT){
1353 if(pi->pParmInfo[pi->ParmNum].bByVal) SetError(28,temporary,cp);
1354 }
1355 }
1356 else{
1357 pi->pParmInfo[pi->ParmNum].type=GetTypeFromSimpleName(temporary);
1358 SetError(-103,temporary,cp);
1359 }
1360
1361 pi->ParmNum++;
1362
1363 if(buffer[i]==','){
1364 i++;
1365 continue;
1366 }
1367 else if(buffer[i]==')') continue;
1368 else{
1369 SetError(1,NULL,cp);
1370 return 0;
1371 }
1372 }
1373 i++;
1374
1375 //戻り値
1376 if(dwProcType==ESC_FUNCTION){
1377 if(buffer[i]==1&&buffer[i+1]==ESC_AS){
1378 i+=2;
1379 i2=0;
1380 if(buffer[i]=='*') temporary[i2++]=buffer[i++];
1381 for(;;i++,i2++){
1382 if(!IsVariableChar(buffer[i])){
1383 temporary[i2]=0;
1384 break;
1385 }
1386 temporary[i2]=buffer[i];
1387 }
1388 pi->ReturnType=GetTypeFixed(temporary,&pi->u.ReturnIndex);
1389 if(pi->ReturnType==-1) SetError(3,temporary,cp);
1390 if(pi->ReturnType==DEF_OBJECT) SetError(40,NULL,cp);
1391 }
1392 else pi->ReturnType=DEF_DOUBLE;
1393 }
1394 else pi->ReturnType=-1;
1395
1396 return ProcPtrInfoNum-1;
1397}
1398void DeleteProcPtrInfo(void){
1399 extern PROCPTRINFO *pProcPtrInfo;
1400 extern int ProcPtrInfoNum;
1401 int i;
1402
1403 for(i=0;i<ProcPtrInfoNum;i++){
1404 HeapDefaultFree(pProcPtrInfo[i].pParmInfo);
1405 }
1406
1407 HeapDefaultFree(pProcPtrInfo);
1408}
Note: See TracBrowser for help on using the repository browser.