The R Project SVN R

Rev

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

Rev 62583 Rev 63181
Line 151... Line 151...
151
 
151
 
152
/* utils::loadRconsole */
152
/* utils::loadRconsole */
153
SEXP in_loadRconsole(SEXP sfile)
153
SEXP in_loadRconsole(SEXP sfile)
154
{
154
{
155
    struct structGUI gui;
155
    struct structGUI gui;
-
 
156
    const void *vmax = vmaxget();
156
 
157
 
157
    if (!isString(sfile) || LENGTH(sfile) < 1)
158
    if (!isString(sfile) || LENGTH(sfile) < 1)
158
	error(_("invalid '%s' argument"), "file");
159
	error(_("invalid '%s' argument"), "file");
159
    getActive(&gui);  /* Will get defaults if there's no active console */
160
    getActive(&gui);  /* Will get defaults if there's no active console */
160
    if (loadRconsole(&gui, translateChar(STRING_ELT(sfile, 0)))) applyGUI(&gui);
161
    if (loadRconsole(&gui, translateChar(STRING_ELT(sfile, 0)))) applyGUI(&gui);
161
    if (strlen(gui.warning)) warning(gui.warning);
162
    if (strlen(gui.warning)) warning(gui.warning);
-
 
163
    vmaxset(vmax);
162
    return R_NilValue;
164
    return R_NilValue;
163
}
165
}
164
 
166
 
165
#include <lmcons.h>
167
#include <lmcons.h>
166
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
168
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
Line 520... Line 522...
520
    SEXP ans, el;
522
    SEXP ans, el;
521
    int i, n = LENGTH(paths);
523
    int i, n = LENGTH(paths);
522
    char tmp[MAX_PATH];
524
    char tmp[MAX_PATH];
523
    wchar_t wtmp[32768];
525
    wchar_t wtmp[32768];
524
    DWORD res;
526
    DWORD res;
-
 
527
    const void *vmax = vmaxget();
525
 
528
 
526
    if(!isString(paths)) error(_("'path' must be a character vector"));
529
    if(!isString(paths)) error(_("'path' must be a character vector"));
527
 
530
 
528
    PROTECT(ans = allocVector(STRSXP, n));
531
    PROTECT(ans = allocVector(STRSXP, n));
529
    for (i = 0; i < n; i++) {
532
    for (i = 0; i < n; i++) {
Line 546... Line 549...
546
	    R_fixbackslash(tmp);
549
	    R_fixbackslash(tmp);
547
	    SET_STRING_ELT(ans, i, mkChar(tmp));
550
	    SET_STRING_ELT(ans, i, mkChar(tmp));
548
	}
551
	}
549
    }
552
    }
550
    UNPROTECT(1);
553
    UNPROTECT(1);
-
 
554
    vmaxset(vmax);
551
    return ans;
555
    return ans;
552
}
556
}
553
    
557
    
554
#include "devWindows.h"
558
#include "devWindows.h"
555
#include <Startup.h>
559
#include <Startup.h>