static void tracemsg( tsd_t *TSD ) { streng *message; const streng *msg; msg = errortext( TSD, 0, 3, 0, 0 ); message = Str_makeTSD( 12 + Str_len( msg ) ); Str_catstrTSD( message, " +++ " ); Str_catTSD( message, msg ); printout( TSD, message ); Free_stringTSD( message ); }
g_error prerror(g_error e) { if (!iserror(e)) return e; #ifdef CONFIG_TEXT fprintf(stderr, "*** ERROR ("); switch (errtype(e)) { case PG_ERRT_MEMORY: fprintf(stderr, "MEMORY"); break; case PG_ERRT_IO: fprintf(stderr, "IO"); break; case PG_ERRT_NETWORK: fprintf(stderr, "NETWORK"); break; case PG_ERRT_BADPARAM: fprintf(stderr, "BADPARAM"); break; case PG_ERRT_HANDLE: fprintf(stderr, "HANDLE"); break; case PG_ERRT_INTERNAL: fprintf(stderr, "INTERNAL"); break; case PG_ERRT_BUSY: fprintf(stderr, "BUSY"); break; case PG_ERRT_FILEFMT: fprintf(stderr, "FILEFMT"); break; default: fprintf(stderr, "UNKNOWN"); } fprintf(stderr, ") : %s\n",errortext(e)); #else puts(errortext(e)); #endif return e; }