The R Project SVN R

Rev

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

Rev Author Line No. Line
7728 ripley 1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
69977 ripley 3
 *  Copyright (C) 2000-2016 The R Core Team.
7728 ripley 4
 *
71657 plummer 5
 *  This header file is free software; you can redistribute it and/or modify
12778 pd 6
 *  it under the terms of the GNU Lesser General Public License as published by
7
 *  the Free Software Foundation; either version 2.1 of the License, or
7728 ripley 8
 *  (at your option) any later version.
9
 *
71657 plummer 10
 *  This file is part of R. R is distributed under the terms of the
11
 *  GNU General Public License, either Version 2, June 1991 or Version 3,
12
 *  June 2007. See doc/COPYRIGHTS for details of the copyright status of R.
13
 *  
7728 ripley 14
 *  This program is distributed in the hope that it will be useful,
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12778 pd 17
 *  GNU Lesser General Public License for more details.
7728 ripley 18
 *
12778 pd 19
 *  You should have received a copy of the GNU Lesser General Public License
42308 ripley 20
 *  along with this program; if not, a copy is available at
68949 ripley 21
 *  https://www.R-project.org/Licenses/
7728 ripley 22
 */
23
 
24
#ifndef R_R_H
25
#define R_R_H
26
 
27
#ifndef USING_R
51839 ripley 28
# define USING_R
7728 ripley 29
#endif
30
 
70618 ligges 31
/* same as Rmath.h: needed for cospi etc */
71371 ripley 32
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
33
# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
34
#endif
71298 ripley 35
/* The C++ headers in Solaris Studio are strict C++98, and 100+ 
71473 ripley 36
   packages would fail because of not using e.g. std::floor 
71298 ripley 37
   or using C99 functions such as 
38
 
39
   erf exmp1 floorf fmin fminf fmax lgamma lround loglp round
40
   snprintf strcasecmp trunc
41
 
42
   We workaround the first, here and in Rmath.h.
43
 
44
   DO_NOT_USE_CXX_HEADERS is legacy, left as a last resort.
70320 ripley 45
*/
71371 ripley 46
#if defined(__cplusplus) && !defined(DO_NOT_USE_CXX_HEADERS)
47
# include <cstdlib>
48
# include <cstdio>
49
# include <climits>
50
# include <cmath>
51
# ifdef __SUNPRO_CC
71297 ripley 52
using namespace std;
71371 ripley 53
# endif
54
#else
55
# include <stdlib.h> /* Not used by R itself, but widely assumed in packages */
56
# include <stdio.h>  /* Used by ca 200 packages, but not in R itself */
57
# include <limits.h> /* for INT_MAX */
58
# include <math.h>
59
#endif 
69977 ripley 60
/* 
71267 ripley 61
   math.h is also included by R_ext/Arith.h, except in C++ code
62
   stddef.h (or cstddef) is included by R_ext/Memory.h
63
   string.h (or cstring) is included by R_ext/RS.h
69977 ripley 64
*/
71371 ripley 65
#if defined(__sun)
69977 ripley 66
/* Solaris' stdlib.h includes a header which defines these (and more) */
71371 ripley 67
# undef CS
68
# undef DO
69
# undef DS
70
# undef ES
71
# undef FS
72
# undef GS
73
# undef SO
74
# undef SS
42402 ripley 75
#endif
7728 ripley 76
 
71473 ripley 77
#ifdef NO_C_HEADERS
78
# warning "use of NO_C_HEADERS is defunct and will be ignored"
79
#endif
80
 
11497 hornik 81
#include <Rconfig.h>
19500 hornik 82
#include <R_ext/Arith.h>      /* R_FINITE, ISNAN, ... */
83
#include <R_ext/Boolean.h>    /* Rboolean type */
84
#include <R_ext/Complex.h>    /* Rcomplex type */
85
#include <R_ext/Constants.h>  /* PI, DOUBLE_EPS, etc */
86
#include <R_ext/Error.h>      /* error and warning */
87
#include <R_ext/Memory.h>     /* R_alloc and S_alloc */
88
#include <R_ext/Print.h>      /* Rprintf etc */
89
#include <R_ext/Random.h>     /* RNG interface */
90
#include <R_ext/Utils.h>      /* sort routines et al */
51845 ripley 91
#include <R_ext/RS.h>
92
/* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */
7728 ripley 93
 
94
 
95
typedef double Sfloat;
96
typedef int Sint;
10470 maechler 97
#define SINT_MAX INT_MAX
7728 ripley 98
#define SINT_MIN INT_MIN
99
 
42412 ripley 100
#ifdef __cplusplus
101
extern "C" {
102
#endif
103
 
37376 ripley 104
void R_FlushConsole(void);
105
/* always declared, but only usable under Win32 and Aqua */
106
void R_ProcessEvents(void);
64106 murdoch 107
#ifdef Win32
108
void R_WaitEvent(void);
109
#endif
37376 ripley 110
 
7728 ripley 111
#ifdef __cplusplus
112
}
113
#endif
114
 
115
#endif /* !R_R_H */