The R Project SVN R

Rev

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

Rev 6192 Rev 6292
Line 1879... Line 1879...
1879
 
1879
 
1880
    checkArity(op, args);
1880
    checkArity(op, args);
1881
    device = asInteger(CAR(args));
1881
    device = asInteger(CAR(args));
1882
    if(device < 1 || device > NumDevices())
1882
    if(device < 1 || device > NumDevices())
1883
	errorcall(call, "invalid device number");
1883
	errorcall(call, "invalid device number");
1884
    dd = GetDevice(device);
1884
    dd = GetDevice(device - 1);
1885
    if(!dd) errorcall(call, "invalid device");
1885
    if(!dd) errorcall(call, "invalid device");
1886
    filename = CADR(args);
1886
    filename = CADR(args);
1887
    if (!isString(filename) || LENGTH(filename) != 1)
1887
    if (!isString(filename) || LENGTH(filename) != 1)
1888
	errorcall(call, "invalid filename argument");
1888
	errorcall(call, "invalid filename argument");
1889
    fn = CHAR(STRING(filename)[0]);
1889
    fn = CHAR(STRING(filename)[0]);
1890
    fixslash(fn);
1890
    fixslash(fn);
1891
    type = CADDR(args);
1891
    type = CADDR(args);
1892
    if (!isString(type) || LENGTH(type) != 1)
1892
    if (!isString(type) || LENGTH(type) != 1)
1893
	errorcall(call, "invalid filename argument");
1893
	errorcall(call, "invalid filename argument");
1894
    tp = CHAR(STRING(type)[0]);
1894
    tp = CHAR(STRING(type)[0]);
1895
    Rprintf("device %d fn %s tp %s\n", device, fn, tp);
-
 
1896
 
1895
 
1897
    if(!strcmp(tp, "gif")) {
1896
    if(!strcmp(tp, "gif")) {
1898
	SaveAsGif(dd, fn);
1897
	SaveAsGif(dd, fn);
1899
    } else if (!strcmp(tp, "wmf")) {
1898
    } else if (!strcmp(tp, "wmf")) {
1900
	sprintf(display, "win.metafile:%s", fn);
1899
	sprintf(display, "win.metafile:%s", fn);