The R Project SVN R

Rev

Rev 60822 | Rev 61771 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 60822 Rev 61766
Line 269... Line 269...
269
	strcat(buf, " [... truncated]");
269
	strcat(buf, " [... truncated]");
270
    if (c && (c->callflag & CTXT_BUILTIN)) c = c->nextcontext;
270
    if (c && (c->callflag & CTXT_BUILTIN)) c = c->nextcontext;
271
    warningcall(c ? c->call : R_NilValue, "%s", buf);
271
    warningcall(c ? c->call : R_NilValue, "%s", buf);
272
}
272
}
273
 
273
 
274
/* temporary hook to allow experimenting with alternate warning mechanisms */
-
 
275
static void (*R_WarningHook)(SEXP, char *) = NULL;
-
 
276
 
-
 
277
/* declarations for internal condition handling */
274
/* declarations for internal condition handling */
278
 
275
 
279
static void vsignalError(SEXP call, const char *format, va_list ap);
276
static void vsignalError(SEXP call, const char *format, va_list ap);
280
static void vsignalWarning(SEXP call, const char *format, va_list ap);
277
static void vsignalWarning(SEXP call, const char *format, va_list ap);
281
static void invokeRestart(SEXP, SEXP);
278
static void invokeRestart(SEXP, SEXP);
Line 1238... Line 1235...
1238
    Rvsnprintf(buf, BUFSIZE, _(WarningDB[i].format), ap);
1235
    Rvsnprintf(buf, BUFSIZE, _(WarningDB[i].format), ap);
1239
    va_end(ap);
1236
    va_end(ap);
1240
    warningcall(call, "%s", buf);
1237
    warningcall(call, "%s", buf);
1241
}
1238
}
1242
 
1239
 
1243
 
1240
#ifdef UNUSED
1244
/* Temporary hooks to allow experimenting with alternate error and
1241
/* temporary hook to allow experimenting with alternate warning mechanisms */
1245
   warning mechanisms.  They are not in the header files for now, but
-
 
1246
   the following snippet can serve as a header file: */
-
 
1247
 
-
 
1248
void R_ReturnOrRestart(SEXP val, SEXP env, Rboolean restart);
-
 
1249
void R_PrintDeferredWarnings(void);
-
 
1250
void R_SetErrmessage(const char *s);
-
 
1251
void R_SetErrorHook(void (*hook)(SEXP, char *));
-
 
1252
void R_SetWarningHook(void (*hook)(SEXP, char *));
1242
static void (*R_WarningHook)(SEXP, char *) = NULL;
1253
void R_JumpToToplevel(Rboolean restart);
-
 
1254
 
-
 
1255
 
1243
 
1256
void R_SetWarningHook(void (*hook)(SEXP, char *))
1244
void R_SetWarningHook(void (*hook)(SEXP, char *))
1257
{
1245
{
1258
    R_WarningHook = hook;
1246
    R_WarningHook = hook;
1259
}
1247
}
Line 1299... Line 1287...
1299
 
1287
 
1300
    R_ToplevelContext = R_GlobalContext = c;
1288
    R_ToplevelContext = R_GlobalContext = c;
1301
    R_restore_globals(R_GlobalContext);
1289
    R_restore_globals(R_GlobalContext);
1302
    LONGJMP(c->cjmpbuf, CTXT_TOPLEVEL);
1290
    LONGJMP(c->cjmpbuf, CTXT_TOPLEVEL);
1303
}
1291
}
-
 
1292
#endif
1304
 
1293
 
1305
void R_SetErrmessage(const char *s)
1294
static void R_SetErrmessage(const char *s)
1306
{
1295
{
1307
    strncpy(errbuf, s, sizeof(errbuf));
1296
    strncpy(errbuf, s, sizeof(errbuf));
1308
    errbuf[sizeof(errbuf) - 1] = 0;
1297
    errbuf[sizeof(errbuf) - 1] = 0;
1309
}
1298
}
1310
 
1299
 
1311
void R_PrintDeferredWarnings(void)
1300
static void R_PrintDeferredWarnings(void)
1312
{
1301
{
1313
    if( R_ShowErrorMessages && R_CollectWarnings ) {
1302
    if( R_ShowErrorMessages && R_CollectWarnings ) {
1314
	REprintf(_("In addition: "));
1303
	REprintf(_("In addition: "));
1315
	PrintWarnings();
1304
	PrintWarnings();
1316
    }
1305
    }
1317
}
1306
}
1318
 
1307
 
-
 
1308
attribute_hidden
1319
SEXP R_GetTraceback(int skip)
1309
SEXP R_GetTraceback(int skip)
1320
{
1310
{
1321
    int nback = 0, ns;
1311
    int nback = 0, ns;
1322
    RCNTXT *c;
1312
    RCNTXT *c;
1323
    SEXP s, t;
1313
    SEXP s, t;