Skip to content

Commit

Permalink
update from trunk
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/branches/R-conn@11626 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Dec 1, 2000
1 parent 161d42f commit 6c05ede
Show file tree
Hide file tree
Showing 40 changed files with 429 additions and 177 deletions.
6 changes: 4 additions & 2 deletions src/main/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Makedeps: Makefile $(DEPENDS)
R: Makefile
@$(MAKE) Makedeps
@$(MAKE) $(Rexecbin_PROGRAMS)
@@WANT_R_SHLIBS_TRUE@$(MAKE) $(Rexeclib_LTLIBRARIES)
@@WANT_R_SHLIB_TRUE@$(MAKE) $(Rexeclib_LTLIBRARIES)
@(cd ../unix && $(MAKE) DLLs)

../include/config.h ../include/Rversion.h:
Expand All @@ -129,6 +129,7 @@ $(top_builddir)/etc/R.exp: $(OBJECTS) $(RLIBS)
$(RLIBS):
(cd $(@D); $(MAKE) $(@F))

libR: $(libR_la)
$(libR_la): $(libR_la_OBJECTS) $(libR_la_DEPENDENCIES)
$(SHLIB_LINK) -o $@ $(libR_la_LDFLAGS) $(libR_la_OBJECTS) `ls ../appl/*.lo ../nmath/*.lo ../unix/*.lo` $(libR_la_LIBADD) $(LIBS)
## FIXME: Not sure if we want to do this ...
Expand Down Expand Up @@ -157,7 +158,8 @@ installdirs:
mostlyclean: clean
clean:
@-rm -rf .libs _libs
@-rm -f *core Makedeps *.d *.o *.lo *.la *.$(SHLIB_EXT)
@-rm -f *core Makedeps *.d *.o *.lo *.la *.$(SHLIB_EXT) \
${Rexecbin_PROGRAMS}
distclean: clean
@-rm -f Makefile
maintainer-clean: distclean
Expand Down
4 changes: 3 additions & 1 deletion src/main/arithmetic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#endif

#include "Defn.h" /*-> Arith.h */
#include "R_ext/Mathlib.h"
#define MATHLIB_PRIVATE
#include <Rmath.h>
#undef MATHLIB_PRIVATE
#include "R_ext/Applic.h" /* machar */
#include "arithmetic.h"

Expand Down
4 changes: 2 additions & 2 deletions src/main/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <config.h>
#endif

#include "Defn.h"
#include "R_ext/Mathlib.h"
#include <Defn.h>
#include <Rmath.h>

/* "GetRowNames" and "GetColNames" are utility routines which */
/* locate and return the row names and column names from the */
Expand Down
4 changes: 2 additions & 2 deletions src/main/attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <config.h>
#endif

#include "Defn.h"
#include "R_ext/Mathlib.h"
#include <Defn.h>
#include <Rmath.h>

static void checkNames(SEXP, SEXP);
static SEXP installAttrib(SEXP, SEXP, SEXP);
Expand Down
4 changes: 2 additions & 2 deletions src/main/bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include <config.h>
#endif

#include "Defn.h"
#include "R_ext/Mathlib.h"/* imax2 */
#include <Defn.h>
#include <Rmath.h>/* imax2 */

#define LIST_ASSIGN(x) {SET_VECTOR_ELT(ans_ptr, ans_length, x); ans_length++;}

Expand Down
4 changes: 2 additions & 2 deletions src/main/builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void cat_newline(SEXP labels, int *width, int lablen, int ntot)
if (labels != R_NilValue) {
Rprintf("%s ", EncodeString(CHAR(STRING_ELT(labels, ntot % lablen)),
1, 0, Rprt_adj_left));
*width += Rstrlen(CHAR(STRING_ELT(labels, ntot % lablen))) + 1;
*width += Rstrlen(CHAR(STRING_ELT(labels, ntot % lablen)), 0) + 1;
}
}

Expand All @@ -165,7 +165,7 @@ static void cat_sepwidth(SEXP sep, int *width, int ntot)
if (sep == R_NilValue || LENGTH(sep) == 0)
*width = 0;
else
*width = Rstrlen(CHAR(STRING_ELT(sep, ntot % LENGTH(sep))));
*width = Rstrlen(CHAR(STRING_ELT(sep, ntot % LENGTH(sep))), 0);
}

static void cat_printsep(SEXP sep, int ntot)
Expand Down
20 changes: 14 additions & 6 deletions src/main/character.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,23 @@ SEXP do_strsplit(SEXP call, SEXP op, SEXP args, SEXP env)
{
SEXP s, t, tok, x;
int i, j, len, tlen, ntok;
int extended_opt, eflags;
char *pt = NULL, *split = "", *bufp;
regex_t reg;
regmatch_t regmatch[1];

checkArity(op, args);
x = CAR(args);
tok = CADR(args);
if (!isString(x) || !isString(tok))
extended_opt = asLogical(CADDR(args));

if(!isString(x) || !isString(tok))
errorcall_return(call,"non-character argument in strsplit()");
if(extended_opt == NA_INTEGER) extended_opt = 1;

eflags = 0;
if(extended_opt) eflags = eflags | REG_EXTENDED;

len = LENGTH(x);
tlen = LENGTH(tok);
PROTECT(s = allocVector(VECSXP, len));
Expand All @@ -179,10 +187,10 @@ SEXP do_strsplit(SEXP call, SEXP op, SEXP args, SEXP env)
everything before the start of the match, which may be
the empty string (not a ``token'' in the strict sense).
*/
if(regcomp(&reg, split, 0))
if(regcomp(&reg, split, eflags))
errorcall(call, "invalid split pattern");
bufp = buff;
while(regexec(&reg, bufp, 1, regmatch, 0) == 0) {
while(regexec(&reg, bufp, 1, regmatch, eflags) == 0) {
/* Empty matches get the next char, so move by one. */
bufp += MAX(regmatch[0].rm_eo, 1);
ntok++;
Expand All @@ -195,9 +203,9 @@ SEXP do_strsplit(SEXP call, SEXP op, SEXP args, SEXP env)
PROTECT(t = allocVector(STRSXP, ntok + 1));
/* and fill with the splits */
bufp = buff;
pt = (char *) realloc(pt, (strlen(buff)+1)*sizeof(char));
pt = (char *) realloc(pt, (strlen(buff)+1) * sizeof(char));
for(j = 0; j < ntok; j++) {
regexec(&reg, bufp, 1, regmatch, 0);
regexec(&reg, bufp, 1, regmatch, eflags);
if(regmatch[0].rm_eo > 0) {
/* Match was non-empty. */
if(regmatch[0].rm_so > 0)
Expand All @@ -209,7 +217,7 @@ SEXP do_strsplit(SEXP call, SEXP op, SEXP args, SEXP env)
/* Match was empty. */
pt[0] = *bufp;
pt[1] = '\0';
buff++;
bufp++;
}
SET_STRING_ELT(t, j, mkChar(pt));
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/coerce.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <config.h>
#endif

#include "Defn.h"/*-- Maybe modularize into own Coerce.h ..*/
#include "R_ext/Mathlib.h"
#include "Print.h"
#include <Defn.h> /*-- Maybe modularize into own Coerce.h ..*/
#include <Rmath.h>
#include <Print.h>


/* This section of code handles type conversion for elements */
Expand Down Expand Up @@ -1249,6 +1249,7 @@ SEXP do_is(SEXP call, SEXP op, SEXP args, SEXP rho)
case DOTSXP:
case ANYSXP:
case EXPRSXP:
case EXTPTRSXP:
LOGICAL(ans)[0] = 1;
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions src/main/colors.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <config.h>
#endif

#include "Defn.h"
#include "Graphics.h"
#include "R_ext/Mathlib.h"
#include <Defn.h>
#include <Graphics.h>
#include <Rmath.h>

unsigned int char2col(char *s)
{
Expand Down
6 changes: 3 additions & 3 deletions src/main/complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <config.h>
#endif

#include "Defn.h" /* -> ../include/R_ext/Complex.h */
#include "R_ext/Mathlib.h"
#include "R_ext/Applic.h" /* R_cpoly */
#include <Defn.h> /* -> ../include/R_ext/Complex.h */
#include <Rmath.h>
#include <R_ext/Applic.h> /* R_cpoly */

#include "arithmetic.h" /* complex_* */

Expand Down
4 changes: 2 additions & 2 deletions src/main/cov.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <config.h>
#endif

#include "Defn.h"
#include "R_ext/Mathlib.h"
#include <Defn.h>
#include <Rmath.h>

#define COV_PAIRWISE_BODY \
xx = &x[i * n]; \
Expand Down
4 changes: 4 additions & 0 deletions src/main/deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ static void deparse2buff(SEXP s)
vector2buff(s);
attr2(s);
break;
case EXTPTRSXP:
sprintf(tpb, "<pointer: %p>\n", R_ExternalPtrAddr(s));
print2buff(tpb);
break;
default:
UNIMPLEMENTED("deparse2buff");
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include <config.h>
#endif

#include "Defn.h"
#include "R_ext/Mathlib.h"
#include "Graphics.h"
#include "Devices.h"
#include <Defn.h>
#include <Rmath.h>
#include <Graphics.h>
#include <Devices.h>

/* Return a non-relocatable copy of a string */

Expand Down
6 changes: 3 additions & 3 deletions src/main/dotcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <string.h>
#include <stdlib.h>

#include "Defn.h"
#include "Graphics.h"
#include "R_ext/Mathlib.h"
#include <Defn.h>
#include <Rmath.h>
#include <Devices.h>

#ifndef max
#define max(a, b) ((a > b)?(a):(b))
Expand Down
1 change: 1 addition & 0 deletions src/main/duplicate.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ SEXP duplicate(SEXP s)
case ENVSXP:
case SPECIALSXP:
case BUILTINSXP:
case EXTPTRSXP:
return s;
case CLOSXP:
PROTECT(s);
Expand Down
4 changes: 3 additions & 1 deletion src/main/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ void error(const char *format, ...)

/* Unwind the call stack in an orderly fashion */
/* calling the code installed by on.exit along the way */
/* and finally longjmping to the top repl loop */
/* and finally longjmping to the innermost TOPLEVEL context */

void jump_to_toplevel()
{
Expand Down Expand Up @@ -387,6 +387,8 @@ void jump_to_toplevel()
inError=0;
findcontext(CTXT_RESTART, c->cloenv, R_DollarSymbol);
}
if (c->callflag == CTXT_TOPLEVEL)
break;
}
if ( !R_Interactive && !haveHandler && inError ) {
REprintf("Execution halted\n");
Expand Down
1 change: 1 addition & 0 deletions src/main/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ SEXP eval(SEXP e, SEXP rho)
case ENVSXP:
case CLOSXP:
case VECSXP:
case EXTPTRSXP:
#ifndef OLD
case EXPRSXP:
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/main/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
#include <config.h>
#endif

#include "Defn.h"
#include "R_ext/Mathlib.h"
#include "Print.h"
#include <Defn.h>
#include <Rmath.h>
#include <Print.h>


void formatString(SEXP *x, int n, int *fieldwidth, int quote)
Expand All @@ -52,7 +52,7 @@ void formatString(SEXP *x, int n, int *fieldwidth, int quote)
if (CHAR(x[i]) == NULL)
naflag = 1;
else {
l = Rstrlen(CHAR(x[i]));
l = Rstrlen(CHAR(x[i]), quote);
if (l > xmax)
xmax = l;
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@
* quick hack by Ross Ihaka designed to give a superset of the
* functionality in the AT&T Bell Laboratories GRZ library.
*
* NOTE : ./plotmath.c has partly similary functionality for "math graphics"
* NOTE : ./plotmath.c has partly similar functionality for "math graphics"
~~~~~~~~~~~
*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "Defn.h"
#include "Graphics.h"
#include "Devices.h" /* KillAllDevices */
#include "R_ext/Mathlib.h" /* eg. fmax2() */
#include "R_ext/Applic.h" /* pretty0() */
#include <Defn.h>
#include <Graphics.h>
#include <Devices.h> /* KillAllDevices */
#include <Rmath.h> /* eg. fmax2() */
#include <R_ext/Applic.h> /* pretty0() */

#include <string.h>
#include <stdlib.h>

static char HexDigits[] = "0123456789ABCDEF";


/*--->> Documentation now in ../include/R_ext/Graphics.h "API" ----- */
/*--->> Documentation now in ../include/Rgraphics.h "API" ----- */

/*-------------------------------------------------------------------
*
Expand Down Expand Up @@ -4977,7 +4977,7 @@ typedef struct {
unsigned int pattern;
} LineTYPE;

/* LTY_... integer patterns are in ../include/R_ext/Graphics.h ! */
/* LTY_... integer patterns are in ../include/Rgraphics.h ! */
static LineTYPE linetype[] = {
{ "blank", LTY_BLANK },/* 0 */
{ "solid", LTY_SOLID },/* 1 */
Expand Down
Loading

0 comments on commit 6c05ede

Please sign in to comment.