mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
before removing selected-output string/file methods
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8637 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
3313c79322
commit
babe09d64c
25
R/R.cpp
25
R/R.cpp
@ -143,14 +143,20 @@ setOutputFileOn(SEXP value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SEXP
|
SEXP
|
||||||
setSelectedOutputFileOn(SEXP value)
|
setSelectedOutputFileOn(SEXP nuser, SEXP value)
|
||||||
{
|
{
|
||||||
SEXP ans = R_NilValue;
|
SEXP ans = R_NilValue;
|
||||||
// check args
|
// check args
|
||||||
|
if (!isInteger(nuser) || length(nuser) != 1) {
|
||||||
|
error("nuser must be a single integer\n");
|
||||||
|
}
|
||||||
if (!isLogical(value) || length(value) != 1) {
|
if (!isLogical(value) || length(value) != 1) {
|
||||||
error("value must either be \"TRUE\" or \"FALSE\"\n");
|
error("value must either be \"TRUE\" or \"FALSE\"\n");
|
||||||
}
|
}
|
||||||
|
int save = R::singleton().GetCurrentSelectedOutputUserNumber();
|
||||||
|
R::singleton().SetCurrentSelectedOutputUserNumber(INTEGER(nuser)[0]);
|
||||||
R::singleton().SetSelectedOutputFileOn(LOGICAL(value)[0]);
|
R::singleton().SetSelectedOutputFileOn(LOGICAL(value)[0]);
|
||||||
|
R::singleton().SetCurrentSelectedOutputUserNumber(save);
|
||||||
return(ans);
|
return(ans);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +219,6 @@ setSelectedOutputStringOn(SEXP nuser, SEXP value)
|
|||||||
if (!isLogical(value) || length(value) != 1) {
|
if (!isLogical(value) || length(value) != 1) {
|
||||||
error("SetSelectedOutputStringOn:value must either be \"TRUE\" or \"FALSE\"\n");
|
error("SetSelectedOutputStringOn:value must either be \"TRUE\" or \"FALSE\"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int save = R::singleton().GetCurrentSelectedOutputUserNumber();
|
int save = R::singleton().GetCurrentSelectedOutputUserNumber();
|
||||||
R::singleton().SetCurrentSelectedOutputUserNumber(INTEGER(nuser)[0]);
|
R::singleton().SetCurrentSelectedOutputUserNumber(INTEGER(nuser)[0]);
|
||||||
R::singleton().SetSelectedOutputStringOn(LOGICAL(value)[0]);
|
R::singleton().SetSelectedOutputStringOn(LOGICAL(value)[0]);
|
||||||
@ -282,17 +287,21 @@ setOutputFileName(SEXP filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SEXP
|
SEXP
|
||||||
setSelectedOutputFileName(SEXP filename)
|
setSelectedOutputFileName(SEXP nuser, SEXP filename)
|
||||||
{
|
{
|
||||||
const char* name;
|
|
||||||
SEXP ans = R_NilValue;
|
SEXP ans = R_NilValue;
|
||||||
// check args
|
// check args
|
||||||
|
if (!isInteger(nuser) || length(nuser) != 1) {
|
||||||
|
error("SetSelectedOutputFileName:nuser must be a single integer\n");
|
||||||
|
}
|
||||||
if (!isString(filename) || length(filename) != 1) {
|
if (!isString(filename) || length(filename) != 1) {
|
||||||
error("SetSelectedOutputFileName:filename is not a single string\n");
|
error("SetSelectedOutputFileName:filename is not a single string\n");
|
||||||
}
|
}
|
||||||
|
int save = R::singleton().GetCurrentSelectedOutputUserNumber();
|
||||||
name = CHAR(STRING_ELT(filename, 0));
|
const char* name = CHAR(STRING_ELT(filename, 0));
|
||||||
|
R::singleton().SetCurrentSelectedOutputUserNumber(INTEGER(nuser)[0]);
|
||||||
R::singleton().SetSelectedOutputFileName(name);
|
R::singleton().SetSelectedOutputFileName(name);
|
||||||
|
R::singleton().SetCurrentSelectedOutputUserNumber(save);
|
||||||
return(ans);
|
return(ans);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -937,7 +946,7 @@ getSelOutLst(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SEXP
|
SEXP
|
||||||
getErrorStrings()
|
getErrorStrings(void)
|
||||||
{
|
{
|
||||||
SEXP ans = R_NilValue;
|
SEXP ans = R_NilValue;
|
||||||
const char* cstr = R::singleton().GetErrorString();
|
const char* cstr = R::singleton().GetErrorString();
|
||||||
@ -961,7 +970,7 @@ getErrorStrings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SEXP
|
SEXP
|
||||||
getVersionString()
|
getVersionString(void)
|
||||||
{
|
{
|
||||||
SEXP ans = R_NilValue;
|
SEXP ans = R_NilValue;
|
||||||
PROTECT(ans = allocVector(STRSXP, 1));
|
PROTECT(ans = allocVector(STRSXP, 1));
|
||||||
|
|||||||
@ -481,7 +481,7 @@ function(value)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
##' TODO
|
##'
|
||||||
##'
|
##'
|
||||||
##' %% ~~ A concise (1-5 lines) description of what the function does. ~~
|
##' %% ~~ A concise (1-5 lines) description of what the function does. ~~
|
||||||
##'
|
##'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user