The R Project SVN R

Rev

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

Rev 8386 Rev 8422
Line 56... Line 56...
56
{
56
{
57
    REprintf("\n");
57
    REprintf("\n");
58
    jump_to_toplevel();
58
    jump_to_toplevel();
59
}
59
}
60
 
60
 
-
 
61
/* SIGUSR1: save and quit
-
 
62
   SIGUSR2: save and quit, don't run .Last or on.exit().
-
 
63
*/
-
 
64
void onsigusr1()
-
 
65
{
-
 
66
    RCNTXT *c;
-
 
67
    SEXP s, t;
-
 
68
    int nback=0;
-
 
69
 
-
 
70
    inError = 1;
-
 
71
 
-
 
72
    if( R_CollectWarnings ) {
-
 
73
	inError = 2;
-
 
74
	REprintf("In addition: ");
-
 
75
	PrintWarnings();
-
 
76
	inError = 1;
-
 
77
    }
-
 
78
 
-
 
79
 
-
 
80
    if (R_Inputfile != NULL)
-
 
81
	fclose(R_Inputfile);
-
 
82
    R_ResetConsole();
-
 
83
    R_FlushConsole();
-
 
84
    R_ClearerrConsole();
-
 
85
    R_ParseError = 0;
-
 
86
    vmaxset(NULL);
-
 
87
    if (R_GlobalContext->cend != NULL)
-
 
88
	(R_GlobalContext->cend) ();
-
 
89
    for (c = R_GlobalContext; c; c = c->nextcontext) {
-
 
90
	if (c->cloenv != R_NilValue && c->conexit != R_NilValue)
-
 
91
	    eval(c->conexit, c->cloenv);
-
 
92
	if (c->callflag == CTXT_RETURN || c->callflag == CTXT_GENERIC )
-
 
93
	    nback++;
-
 
94
	if (c->callflag == CTXT_RESTART) {
-
 
95
		inError=0;
-
 
96
		findcontext(CTXT_RESTART, c->cloenv, R_DollarSymbol);
-
 
97
	}
-
 
98
    }
-
 
99
	R_CleanUp(SA_SAVE, 2, 1); /* quit, save,  .Last, status=2 */
-
 
100
 
-
 
101
}
-
 
102
 
-
 
103
 
-
 
104
void onsigusr2()
-
 
105
{
-
 
106
    inError = 1;
-
 
107
    
-
 
108
    if( R_CollectWarnings ) {
-
 
109
	inError = 2;
-
 
110
	REprintf("In addition: ");
-
 
111
	PrintWarnings();
-
 
112
	inError = 1;
-
 
113
    }
-
 
114
    
-
 
115
    
-
 
116
    if (R_Inputfile != NULL)
-
 
117
	fclose(R_Inputfile);
-
 
118
    R_ResetConsole();
-
 
119
    R_FlushConsole();
-
 
120
    R_ClearerrConsole();
-
 
121
    R_ParseError = 0;
-
 
122
    vmaxset(NULL);
-
 
123
    R_CleanUp(SA_SAVE, 0, 0);
-
 
124
}
-
 
125
 
-
 
126
 
61
static void setupwarnings(void)
127
static void setupwarnings(void)
62
{
128
{
63
    R_Warnings = allocVector(VECSXP, 50);
129
    R_Warnings = allocVector(VECSXP, 50);
64
    setAttrib(R_Warnings, R_NamesSymbol, allocVector(STRSXP, 50));
130
    setAttrib(R_Warnings, R_NamesSymbol, allocVector(STRSXP, 50));
65
}
131
}