3 extern ficlSystem
*ficlSystemGlobal
;
6 * f i c l C a l l b a c k T e x t O u t
7 * Feeds text to the vm's output callback
10 ficlCallbackTextOut(ficlCallback
*callback
, char *text
)
12 ficlOutputFunction textOut
= NULL
;
14 if (callback
!= NULL
) {
15 if (callback
->textOut
!= NULL
)
16 textOut
= callback
->textOut
;
17 else if ((callback
->system
!= NULL
) &&
18 (callback
!= &(callback
->system
->callback
))) {
19 ficlCallbackTextOut(&(callback
->system
->callback
),
25 if ((textOut
== NULL
) && (ficlSystemGlobal
!= NULL
)) {
26 callback
= &(ficlSystemGlobal
->callback
);
27 textOut
= callback
->textOut
;
31 textOut
= ficlCallbackDefaultTextOut
;
33 (textOut
)(callback
, text
);
37 * f i c l C a l l b a c k E r r o r O u t
38 * Feeds text to the vm's error output callback
41 ficlCallbackErrorOut(ficlCallback
*callback
, char *text
)
43 ficlOutputFunction errorOut
= NULL
;
45 if (callback
!= NULL
) {
46 if (callback
->errorOut
!= NULL
)
47 errorOut
= callback
->errorOut
;
48 else if ((callback
->system
!= NULL
) &&
49 (callback
!= &(callback
->system
->callback
))) {
50 ficlCallbackErrorOut(&(callback
->system
->callback
),
56 if ((errorOut
== NULL
) && (ficlSystemGlobal
!= NULL
)) {
57 callback
= &(ficlSystemGlobal
->callback
);
58 errorOut
= callback
->errorOut
;
61 if (errorOut
== NULL
) {
62 ficlCallbackTextOut(callback
, text
);
66 (errorOut
)(callback
, text
);