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.
22 void (*SLang_Error_Routine
)(char *);
23 void (*SLang_Exit_Error_Hook
)(char *);
24 volatile int SLang_Error
= 0;
25 char *SLang_Error_Message
;
26 volatile int SLKeyBoard_Quit
= 0;
28 void SLang_doerror (char *error
)
35 str
= "Slang/Midnight Commander unknown error";
37 g_snprintf(err
, sizeof (err
), "S-Lang Error: %s", str
);
39 if (SLang_Error_Routine
== NULL
)
42 fputs("\r\n", stderr
);
45 (*SLang_Error_Routine
)(err
);
50 void SLang_exit_error (char *s
)
52 if (SLang_Exit_Error_Hook
!= NULL
)
54 (*SLang_Exit_Error_Hook
) (s
);
56 if (s
!= NULL
) fprintf (stderr
, "%s\n", s
);