Cirrus Logic CS485 Dokumentacja Strona 53

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 319
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 52
Error Handling
3-17
3
Example 3-4 A Simple Error Handler
IPLStatus ownError(IPLStatus status, const char *func,
const char *context, const char *file, int line);
{
fprintf(stderr, "IPL Library error: %s, ", iplErrorStr(status));
fprintf(stderr, "function %s, ", func ? func : "<unknown>");
if (line > 0) fprintf(stderr, "line %d, ", line);
if (file != NULL) fprintf(stderr, "file %s, ", file);
if (context) fprintf(stderr, "context %s\n", context);
IplSetErrStatus(status);
exit(1);
}
main () {
extern IPLErrorCallBack ownError;
/* Redirect errors to your own error handler */
iplRedirectError( ownError);
/* Redirect errors back to the default error handler */
iplRedirectError(NULL);
}
Przeglądanie stron 52
1 2 ... 48 49 50 51 52 53 54 55 56 57 58 ... 318 319

Komentarze do niniejszej Instrukcji

Brak uwag