1 /* 2 * R : A Computer Language for Statistical Data Analysis 3 * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka 4 * Copyright (C) 1997--2016 The R Core Team. 5 * 6 * This header file is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as published by 8 * the Free Software Foundation; either version 2.1 of the License, or 9 * (at your option) any later version. 10 * 11 * This file is part of R. R is distributed under the terms of the 12 * GNU General Public License, either Version 2, June 1991 or Version 3, 13 * June 2007. See doc/COPYRIGHTS for details of the copyright status of R. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public License 21 * along with this program; if not, a copy is available at 22 * https://www.R-project.org/Licenses/ 23 * 24 * Much of this is from Doug Bates. 25 */ 26 27 /* 28 This is a legacy header and no longer documented. 29 Code using it should be converted to use R.h 30 */ 31 32 /* This header includes C headers and so is not safe for inclusion 33 from C++: use R.h instead. */ 34 35 #ifndef R_S_H 36 #define R_S_H 37 38 #ifndef USING_R 39 # define USING_R 40 /* is this a good idea? - conflicts with many versions of f2c.h */ 41 # define longint int 42 #endif 43 44 #ifdef __cplusplus 45 # error S.h can not be used from C++ code: use R.h instead 46 #endif 47 48 #include <stddef.h> 49 #include <stdlib.h> 50 #include <stdio.h> 51 #include <limits.h> 52 #include <float.h> 53 #include <math.h> 54 55 #include <Rconfig.h> 56 #include <R_ext/Constants.h> 57 #include <R_ext/Memory.h> /* S_alloc */ 58 59 /* subset of those in Random.h */ 60 extern void seed_in(long *); 61 extern void seed_out(long *); 62 extern double unif_rand(void); 63 extern double norm_rand(void); 64 65 /* Macros for S/R Compatibility */ 66 67 #include <R_ext/RS.h> 68 /* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */ 69 70 /* S4 uses macros equivalent to */ 71 #define Salloc(n,t) (t*)S_alloc(n, sizeof(t)) 72 #define Srealloc(p,n,old,t) (t*)S_realloc(p,n,old,sizeof(t)) 73 74 /* S's complex is different, and is a define to S_complex now */ 75 typedef struct { 76 double re; 77 double im; 78 } S_complex; 79 80 #ifdef S_OLD_COMPLEX 81 # define complex S_complex 82 #endif 83 84 #ifndef NO_CALL_R 85 /* Not quite full compatibility: beware! */ 86 /* void call_R(char*, long, void**, char**, long*, char**, long, char**);*/ 87 #define call_S call_R 88 #endif 89 90 #endif /* !R_S_H */ 91