The R Project SVN R

Rev

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

Rev 72261 Rev 72959
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 2004-2007  The R Foundation
3
 *  Copyright (C) 2004-2007  The R Foundation
4
 *  Copyright (C) 2013-2015  The R Core Team
4
 *  Copyright (C) 2013-2017  The R Core Team
5
 *
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
9
 *  (at your option) any later version.
Line 54... Line 54...
54
    pDevDesc dd;
54
    pDevDesc dd;
55
 
55
 
56
    checkArity(op, args);
56
    checkArity(op, args);
57
 
57
 
58
    devnum = INTEGER(CAR(args))[0] - 1;
58
    devnum = INTEGER(CAR(args))[0] - 1;
59
    if(devnum < 1 || devnum > R_MaxDevices)
59
    if(devnum < 1 || devnum >= R_MaxDevices)
60
	error(_("invalid graphical device number"));
60
	error(_("invalid graphical device number"));
61
 
61
 
62
    gdd = GEgetDevice(devnum);
62
    gdd = GEgetDevice(devnum);
63
    if(!gdd) errorcall(call, _("invalid device"));
63
    if(!gdd) errorcall(call, _("invalid device"));
64
    dd = gdd->dev;
64
    dd = gdd->dev;
Line 96... Line 96...
96
 
96
 
97
    devnum = INTEGER(CAR(args))[0];
97
    devnum = INTEGER(CAR(args))[0];
98
    if(devnum == NA_INTEGER)
98
    if(devnum == NA_INTEGER)
99
	error(_("invalid graphical device number"));
99
	error(_("invalid graphical device number"));
100
    devnum--;
100
    devnum--;
101
    if(devnum < 1 || devnum > R_MaxDevices)
101
    if(devnum < 1 || devnum >= R_MaxDevices)
102
	error(_("invalid graphical device number"));
102
	error(_("invalid graphical device number"));
103
 
103
 
104
    gdd = GEgetDevice(devnum);
104
    gdd = GEgetDevice(devnum);
105
    if(!gdd) errorcall(call, _("invalid device"));
105
    if(!gdd) errorcall(call, _("invalid device"));
106
    return gdd->dev->eventEnv;
106
    return gdd->dev->eventEnv;