The R Project SVN R

Rev

Rev 61091 | Rev 66087 | 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
59039 ripley 4
 *  Copyright (C) 1997-2003   The R 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
42308 ripley 17
 *  along with this program; if not, a copy is available at
18
 *  http://www.r-project.org/Licenses/
2 r 19
 */
20
 
21
#ifndef PRINT_H_
22
#define PRINT_H_
23
 
60252 ripley 24
#include "Defn.h"
19500 hornik 25
#include <R_ext/PrtUtil.h>
60252 ripley 26
#include <R_ext/Print.h>
2 r 27
 
29902 ripley 28
#define formatRaw           Rf_formatRaw
7754 ripley 29
#define formatString        Rf_formatString
30
#define EncodeElement       Rf_EncodeElement
45639 maechler 31
#define EncodeEnvironment   Rf_EncodeEnvironment
7754 ripley 32
#define printArray          Rf_printArray
33
#define printMatrix         Rf_printMatrix
34
#define printNamedVector    Rf_printNamedVector
35
#define printVector         Rf_printVector
36
 
4619 maechler 37
typedef struct {
38
    int width;
39
    int na_width;
18958 ripley 40
    int na_width_noquote;
4619 maechler 41
    int digits;
24179 ripley 42
    int scipen;
4619 maechler 43
    int gap;
44
    int quote;
45
    int right;
38915 maechler 46
    int max;
4619 maechler 47
    SEXP na_string;
18958 ripley 48
    SEXP na_string_noquote;
39996 murdoch 49
    int useSource;
61091 ripley 50
    int cutoff; // for deparsed language objects
4619 maechler 51
} R_print_par_t;
52
extern R_print_par_t R_print;
2 r 53
 
54
/* Computation of printing formats */
60241 ripley 55
void formatRaw(Rbyte *, R_xlen_t, int *);
56
void formatString(SEXP*, R_xlen_t, int*, int);
2 r 57
 
58
/* Formating of values */
41861 ripley 59
const char *EncodeElement(SEXP, int, int, char);
45639 maechler 60
const char *EncodeEnvironment(SEXP);
2 r 61
 
62
 
22923 ripley 63
/* In Rinternals.h (and MUST be there):
2467 maechler 64
   CustomPrintValue,  PrintValue, PrintValueRec */
31569 pd 65
void printArray(SEXP, SEXP, int, int, SEXP);
41784 ripley 66
void printMatrix(SEXP, int, SEXP, int, int, SEXP, SEXP,
67
		 const char*, const char*);
68
void printNamedVector(SEXP, SEXP, int, const char*);
2 r 69
void printVector(SEXP, int, int);
61771 ripley 70
// void PrintClosure(SEXP, Rboolean);
71
// void PrintLanguage(SEXP, Rboolean);
10882 maechler 72
 
73
/* Utilities for S compatibility and debuggging */
41861 ripley 74
int F77_SYMBOL(dblepr0)(const char *, int *, double *, int *);
75
int F77_SYMBOL(intpr0) (const char *, int *, int *, int *);
76
int F77_SYMBOL(realpr0)(const char *, int *, float *, int *);
10882 maechler 77
void R_PV(SEXP s);
78
 
4711 pd 79
/* Offset for rowlabels if there are named dimnames */
8552 maechler 80
#define R_MIN_LBLOFF 2
2 r 81
 
8552 maechler 82
#define R_MIN_WIDTH_OPT		10
11103 ripley 83
#define R_MAX_WIDTH_OPT		10000
8552 maechler 84
#define R_MIN_DIGITS_OPT	1
85
#define R_MAX_DIGITS_OPT	22
86
 
2 r 87
#endif