1 /* error handling common to all routines. */
2 /* Copyright (c) 1992, 1995 John E. Davis
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Perl Artistic License.
23 void (*SLang_Error_Routine
)(char *);
24 void (*SLang_Exit_Error_Hook
)(char *);
25 volatile int SLang_Error
= 0;
26 char *SLang_Error_Message
;
27 volatile int SLKeyBoard_Quit
= 0;
29 void SLang_doerror (char *error
)
36 str
= "Slang/Midnight Commander unknown error";
38 g_snprintf(err
, sizeof (err
), "S-Lang Error: %s", str
);
40 if (SLang_Error_Routine
== NULL
)
43 fputs("\r\n", stderr
);
46 (*SLang_Error_Routine
)(err
);
51 void SLang_exit_error (char *s
)
53 if (SLang_Exit_Error_Hook
!= NULL
)
55 (*SLang_Exit_Error_Hook
) (s
);
57 if (s
!= NULL
) fprintf (stderr
, "%s\n", s
);