The R Project SVN R

Rev

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

Rev 68947 Rev 69366
Line 35... Line 35...
35
#include "Defn.h"
35
#include "Defn.h"
36
#include "Print.h"
36
#include "Print.h"
37
 
37
 
38
#include <stdlib.h> /* for div() */
38
#include <stdlib.h> /* for div() */
39
 
39
 
40
/* FIXME: sort out encodings */
-
 
41
/* We need display width of a string */
40
/* We need display width of a string.
-
 
41
   Used only for row/column names found by GetMatrixDimnames,
-
 
42
   so in native encoding.  (NULL ones from do_prmatrix are skipped.)
-
 
43
*/
42
int Rstrwid(const char *str, int slen, int enc, int quote);  /* from printutils.c */
44
int Rstrwid(const char *str, int slen, int enc, int quote);  /* from printutils.c */
43
#define strwidth(x) Rstrwid(x, (int) strlen(x), CE_NATIVE, 0)
45
#define strwidth(x) Rstrwid(x, (int) strlen(x), CE_NATIVE, 0)
44
 
46
 
45
/* ceil_DIV(a,b) :=  ceil(a / b)  in _int_ arithmetic : */
47
/* ceil_DIV(a,b) :=  ceil(a / b)  in _int_ arithmetic : */
46
static R_INLINE
48
static R_INLINE
Line 310... Line 312...
310
 
312
 
311
    _PRINT_MATRIX_( , STD_ColumnLabels,
313
    _PRINT_MATRIX_( , STD_ColumnLabels,
312
		   Rprintf("%*s%s", w[j]-2, "", EncodeRaw(x[i + j * r], "")) );
314
		   Rprintf("%*s%s", w[j]-2, "", EncodeRaw(x[i + j * r], "")) );
313
}
315
}
314
 
316
 
-
 
317
/* rm and cn are found by GetMatrixDimnames so in native encoding */
315
attribute_hidden
318
attribute_hidden
316
void printMatrix(SEXP x, int offset, SEXP dim, int quote, int right,
319
void printMatrix(SEXP x, int offset, SEXP dim, int quote, int right,
317
		 SEXP rl, SEXP cl, const char *rn, const char *cn)
320
		 SEXP rl, SEXP cl, const char *rn, const char *cn)
318
{
321
{
319
/* 'rl' and 'cl' are dimnames(.)[[1]] and dimnames(.)[[2]]  whereas
322
/* 'rl' and 'cl' are dimnames(.)[[1]] and dimnames(.)[[2]]  whereas