The R Project SVN R

Rev

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

Rev 50880 Rev 51056
Line 103... Line 103...
103
 
103
 
104
/* The guts of adding information about a specific graphics
104
/* The guts of adding information about a specific graphics
105
 * system to a specific device.
105
 * system to a specific device.
106
 */
106
 */
107
static void registerOne(pGEDevDesc dd, int systemNumber, GEcallback cb) {
107
static void registerOne(pGEDevDesc dd, int systemNumber, GEcallback cb) {
-
 
108
    SEXP result;
108
    dd->gesd[systemNumber] =
109
    dd->gesd[systemNumber] =
109
	(GESystemDesc*) calloc(1, sizeof(GESystemDesc));
110
	(GESystemDesc*) calloc(1, sizeof(GESystemDesc));
110
    if (dd->gesd[systemNumber] == NULL)
111
    if (dd->gesd[systemNumber] == NULL)
111
	error(_("unable to allocate memory (in GEregister)"));
112
	error(_("unable to allocate memory (in GEregister)"));
112
    cb(GE_InitState, dd, R_NilValue);
113
    result = cb(GE_InitState, dd, R_NilValue);
-
 
114
    if (isNull(result)) {
-
 
115
        /* tidy up */
-
 
116
        free(dd->gesd[systemNumber]);
-
 
117
	error(_("unable to allocate memory (in GEregister)"));
-
 
118
    } else {
113
    dd->gesd[systemNumber]->callback = cb;
119
        dd->gesd[systemNumber]->callback = cb;
-
 
120
    }
114
}
121
}
115
 
122
 
116
/* Store the graphics system state and callback information
123
/* Store the graphics system state and callback information
117
 * for a specified device.
124
 * for a specified device.
118
 * This is called when a new device is created.
125
 * This is called when a new device is created.