2 /* ###--------------------------------------------------------------### */
3 /* file : beh_namewrap.c */
5 /* authors : Anthony LESTER */
6 /* description : figure level function */
7 /* ###--------------------------------------------------------------### */
13 /*------------------------------------------------------------------
14 IDENT : beh_wrapAtomExpr
15 ------------------------------------------------------------------
16 FUNCTION : rajoute un prefix et/ou suffix a chaque atome
18 ------------------------------------------------------------------*/
20 beh_wrapAtomExpr (chain_list
*expr
, char *(*wrapFunc
)(char *))
24 if (isBitStr(VALUE_ATOM(expr
))) return;
25 VALUE_ATOM(expr
) = wrapFunc(VALUE_ATOM(expr
));
29 while ((expr
= CDR (expr
)))
30 beh_wrapAtomExpr (CAR (expr
), wrapFunc
);
35 beh_namewrap(befig_list
*ptbefig
, char *(*wrapFunc
)(char *))
46 bevectpor_list
*ptbevectpor
;
47 bevectaux_list
*ptbevectaux
;
48 bevectout_list
*ptbevectout
;
49 bevectbux_list
*ptbevectbux
;
50 bevectbus_list
*ptbevectbus
;
51 bevectreg_list
*ptbevectreg
;
52 vectbiabl_list
*ptvectbiabl
;
54 ptbefig
->NAME
= wrapFunc(ptbefig
->NAME
);
55 for (ptbepor
= ptbefig
->BEPOR
; ptbepor
; ptbepor
= ptbepor
->NEXT
) {
56 ptbepor
->NAME
= wrapFunc(ptbepor
->NAME
);
58 for (ptberin
= ptbefig
->BERIN
; ptberin
; ptberin
= ptberin
->NEXT
) {
59 ptberin
->NAME
= wrapFunc(ptberin
->NAME
);
61 for (ptbemsg
= ptbefig
->BEMSG
; ptbemsg
; ptbemsg
= ptbemsg
->NEXT
) {
62 beh_wrapAtomExpr(ptbemsg
->ABL
, wrapFunc
);
64 for (ptbeaux
= ptbefig
->BEAUX
; ptbeaux
; ptbeaux
= ptbeaux
->NEXT
) {
65 ptbeaux
->NAME
= wrapFunc(ptbeaux
->NAME
);
66 beh_wrapAtomExpr(ptbeaux
->ABL
, wrapFunc
);
68 for (ptbeout
= ptbefig
->BEOUT
; ptbeout
; ptbeout
= ptbeout
->NEXT
) {
69 ptbeout
->NAME
= wrapFunc(ptbeout
->NAME
);
70 beh_wrapAtomExpr(ptbeout
->ABL
, wrapFunc
);
72 for (ptbebux
= ptbefig
->BEBUX
; ptbebux
; ptbebux
= ptbebux
->NEXT
) {
73 ptbebux
->NAME
= wrapFunc(ptbebux
->NAME
);
74 for (ptbiabl
= ptbebux
->BIABL
; ptbiabl
; ptbiabl
= ptbiabl
->NEXT
) {
75 if (ptbiabl
->CNDABL
) beh_wrapAtomExpr(ptbiabl
->CNDABL
, wrapFunc
);
76 if (ptbiabl
->VALABL
) beh_wrapAtomExpr(ptbiabl
->VALABL
, wrapFunc
);
79 for (ptbebus
= ptbefig
->BEBUS
; ptbebus
; ptbebus
= ptbebus
->NEXT
) {
80 ptbebus
->NAME
= wrapFunc(ptbebus
->NAME
);
81 for (ptbiabl
= ptbebus
->BIABL
; ptbiabl
; ptbiabl
= ptbiabl
->NEXT
) {
82 if (ptbiabl
->CNDABL
) beh_wrapAtomExpr(ptbiabl
->CNDABL
, wrapFunc
);
83 if (ptbiabl
->VALABL
) beh_wrapAtomExpr(ptbiabl
->VALABL
, wrapFunc
);
86 for (ptbereg
= ptbefig
->BEREG
; ptbereg
; ptbereg
= ptbereg
->NEXT
) {
87 ptbereg
->NAME
= wrapFunc(ptbereg
->NAME
);
88 for (ptbiabl
= ptbereg
->BIABL
; ptbiabl
; ptbiabl
= ptbiabl
->NEXT
) {
89 if (ptbiabl
->CNDABL
) beh_wrapAtomExpr(ptbiabl
->CNDABL
, wrapFunc
);
90 if (ptbiabl
->VALABL
) beh_wrapAtomExpr(ptbiabl
->VALABL
, wrapFunc
);
93 for (ptbevectpor
= ptbefig
->BEVECTPOR
; ptbevectpor
; ptbevectpor
= ptbevectpor
->NEXT
) {
94 ptbevectpor
->NAME
= wrapFunc(ptbevectpor
->NAME
);
96 for (ptbevectaux
= ptbefig
->BEVECTAUX
; ptbevectaux
; ptbevectaux
= ptbevectaux
->NEXT
) {
97 ptbevectaux
->NAME
= wrapFunc(ptbevectaux
->NAME
);
98 beh_wrapAtomExpr(ptbevectaux
->ABL
, wrapFunc
);
100 for (ptbevectout
= ptbefig
->BEVECTOUT
; ptbevectout
; ptbevectout
= ptbevectout
->NEXT
) {
101 ptbevectout
->NAME
= wrapFunc(ptbevectout
->NAME
);
102 beh_wrapAtomExpr(ptbevectout
->ABL
, wrapFunc
);
104 for (ptbevectbux
= ptbefig
->BEVECTBUX
; ptbevectbux
; ptbevectbux
= ptbevectbux
->NEXT
) {
105 ptbevectbux
->NAME
= wrapFunc(ptbevectbux
->NAME
);
106 for (ptvectbiabl
= ptbevectbux
->VECTBIABL
; ptvectbiabl
; ptvectbiabl
= ptvectbiabl
->NEXT
) {
107 for (ptbiabl
= ptvectbiabl
->BIABL
; ptbiabl
; ptbiabl
= ptbiabl
->NEXT
) {
108 if (ptbiabl
->CNDABL
) beh_wrapAtomExpr(ptbiabl
->CNDABL
, wrapFunc
);
109 if (ptbiabl
->VALABL
) beh_wrapAtomExpr(ptbiabl
->VALABL
, wrapFunc
);
113 for (ptbevectbus
= ptbefig
->BEVECTBUS
; ptbevectbus
; ptbevectbus
= ptbevectbus
->NEXT
) {
114 ptbevectbus
->NAME
= wrapFunc(ptbevectbus
->NAME
);
115 for (ptvectbiabl
= ptbevectbus
->VECTBIABL
; ptvectbiabl
; ptvectbiabl
= ptvectbiabl
->NEXT
) {
116 for (ptbiabl
= ptvectbiabl
->BIABL
; ptbiabl
; ptbiabl
= ptbiabl
->NEXT
) {
117 if (ptbiabl
->CNDABL
) beh_wrapAtomExpr(ptbiabl
->CNDABL
, wrapFunc
);
118 if (ptbiabl
->VALABL
) beh_wrapAtomExpr(ptbiabl
->VALABL
, wrapFunc
);
122 for (ptbevectreg
= ptbefig
->BEVECTREG
; ptbevectreg
; ptbevectreg
= ptbevectreg
->NEXT
) {
123 ptbevectreg
->NAME
= wrapFunc(ptbevectreg
->NAME
);
124 for (ptvectbiabl
= ptbevectreg
->VECTBIABL
; ptvectbiabl
; ptvectbiabl
= ptvectbiabl
->NEXT
) {
125 for (ptbiabl
= ptvectbiabl
->BIABL
; ptbiabl
; ptbiabl
= ptbiabl
->NEXT
) {
126 if (ptbiabl
->CNDABL
) beh_wrapAtomExpr(ptbiabl
->CNDABL
, wrapFunc
);
127 if (ptbiabl
->VALABL
) beh_wrapAtomExpr(ptbiabl
->VALABL
, wrapFunc
);