The R Project SVN R

Rev

Rev 22931 | Rev 31569 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 r 1
/*
2429 maechler 2
 *  R : A Computer Language for Statistical Data Analysis
2 r 3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
22923 ripley 4
 *  Copyright (C) 1997-2003   The R Development Core Team.
2 r 5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
5458 ripley 18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
2 r 19
 */
20
 
21
#ifndef PRINT_H_
22
#define PRINT_H_
23
 
19500 hornik 24
#include <R_ext/PrtUtil.h>
2467 maechler 25
#include "Defn.h"
2 r 26
 
7758 ripley 27
#define formatFactor        Rf_formatFactor
7754 ripley 28
#define formatString        Rf_formatString
29
#define EncodeFactor        Rf_EncodeFactor
30
#define EncodeElement       Rf_EncodeElement
31
#define printArray          Rf_printArray
32
#define printMatrix         Rf_printMatrix
33
#define printNamedVector    Rf_printNamedVector
34
#define printVector         Rf_printVector
35
 
4619 maechler 36
typedef struct {
37
    int width;
38
    int na_width;
18958 ripley 39
    int na_width_noquote;
4619 maechler 40
    int digits;
24179 ripley 41
    int scipen;
4619 maechler 42
    int gap;
43
    int quote;
44
    int right;
45
    SEXP na_string;
18958 ripley 46
    SEXP na_string_noquote;
4619 maechler 47
} R_print_par_t;
48
extern R_print_par_t R_print;
2 r 49
 
50
/* Computation of printing formats */
7758 ripley 51
void formatFactor(int *, int, int *, SEXP, int);
2 r 52
void formatString(SEXP*, int, int*, int);
53
 
54
/* Formating of values */
55
char *EncodeFactor(int, int, int, SEXP);
56
char *EncodeElement(SEXP, int, int);
57
 
58
/* Printing */
59
void MatrixColumnLabel(SEXP, int, int);
1026 ihaka 60
void RightMatrixColumnLabel(SEXP, int, int);
2 r 61
void LeftMatrixColumnLabel(SEXP, int, int);
4710 pd 62
void MatrixRowLabel(SEXP, int, int, int);
2 r 63
 
22923 ripley 64
/* In Rinternals.h (and MUST be there):
2467 maechler 65
   CustomPrintValue,  PrintValue, PrintValueRec */
1820 ihaka 66
void printArray(SEXP, SEXP, int, SEXP);
4710 pd 67
void printMatrix(SEXP, int, SEXP, int, int, SEXP, SEXP, char*, char*);
4732 pd 68
void printNamedVector(SEXP, SEXP, int, char*);
2 r 69
void printVector(SEXP, int, int);
10882 maechler 70
 
71
/* Utilities for S compatibility and debuggging */
72
int F77_SYMBOL(dblepr0)(char *, int *, double *, int *);
73
int F77_SYMBOL(intpr0) (char *, int *, int *, int *);
74
int F77_SYMBOL(realpr0)(char *, int *, float *, int *);
75
void R_PV(SEXP s);
76
 
4711 pd 77
/* Offset for rowlabels if there are named dimnames */
8552 maechler 78
#define R_MIN_LBLOFF 2
2 r 79
 
8552 maechler 80
#define R_MIN_WIDTH_OPT		10
11103 ripley 81
#define R_MAX_WIDTH_OPT		10000
8552 maechler 82
#define R_MIN_DIGITS_OPT	1
83
#define R_MAX_DIGITS_OPT	22
84
 
2 r 85
#endif