CXXR (C++ R)
PrtUtil.h
1 /*CXXR $Id: PrtUtil.h 1348 2013-02-25 17:49:03Z arr $
2  *CXXR
3  *CXXR This file is part of CXXR, a project to refactor the R interpreter
4  *CXXR into C++. It may consist in whole or in part of program code and
5  *CXXR documentation taken from the R project itself, incorporated into
6  *CXXR CXXR (and possibly MODIFIED) under the terms of the GNU General Public
7  *CXXR Licence.
8  *CXXR
9  *CXXR CXXR is Copyright (C) 2008-13 Andrew R. Runnalls, subject to such other
10  *CXXR copyrights and copyright restrictions as may be stated below.
11  *CXXR
12  *CXXR CXXR is not part of the R project, and bugs and other issues should
13  *CXXR not be reported via r-bugs or other R project channels; instead refer
14  *CXXR to the CXXR website.
15  *CXXR */
16 
17 /*
18  * R : A Computer Language for Statistical Data Analysis
19  * Copyright (C) 1998-2009 The R Core Team
20  *
21  * This program is free software; you can redistribute it and/or modify
22  * it under the terms of the GNU Lesser General Public License as published by
23  * the Free Software Foundation; either version 2.1 of the License, or
24  * (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29  * GNU Lesser General Public License for more details.
30  *
31  * You should have received a copy of the GNU Lesser General Public License
32  * along with this program; if not, a copy is available at
33  * http://www.r-project.org/Licenses/
34  */
35 
36 /*
37  * Generally useful print utilities *NOT* relying on R internals (from Defn.h)
38  *
39  * (not useful anymore; use R_print struct with SEXP) --> Print.h
40  */
41 #ifndef PRTUTIL_H_
42 #define PRTUTIL_H_
43 
44 #include <R_ext/Complex.h>
45 #include <R_ext/Print.h>
46 
47 #define formatLogical Rf_formatLogical
48 #define formatInteger Rf_formatInteger
49 #define formatReal Rf_formatReal
50 #define formatComplex Rf_formatComplex
51 #define EncodeLogical Rf_EncodeLogical
52 #define EncodeInteger Rf_EncodeInteger
53 #define EncodeReal Rf_EncodeReal
54 #define EncodeComplex Rf_EncodeComplex
55 #define VectorIndex Rf_VectorIndex
56 #define printIntegerVector Rf_printIntegerVector
57 #define printRealVector Rf_printRealVector
58 #define printComplexVector Rf_printComplexVector
59 /* #define dropTrailing0 Rf_dropTrailing0 */
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /* Computation of printing formats */
66 void formatLogical(int *, int, int *);
67 void formatInteger(int *, int, int *);
68 void formatReal(double *, int, int *, int *, int *, int);
69 void formatComplex(Rcomplex *, int, int *, int *, int *, int *, int *, int *, int);
70 
71 /* Formating of values */
72 const char *EncodeLogical(int, int);
73 const char *EncodeInteger(int, int);
74 const char *EncodeReal(double, int, int, int, char);
75 const char *EncodeComplex(Rcomplex, int, int, int, int, int, int, char);
76 /* const char* dropTrailing0(const char *, char); */
77 
78 /* Printing */
79 void VectorIndex(int, int);
80 
81 void printLogicalVector(int *, int, int);
82 void printIntegerVector(int *, int, int);
83 void printRealVector (double *, int, int);
84 void printComplexVector(Rcomplex *,int, int);
85 
86 /* char *Rsprintf(char*, ...); */
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* PRTUTIL_H_ */