RAPI
|
00001 /* 00002 * R : A Computer Language for Statistical Data Analysis 00003 * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka 00004 * Copyright (C) 1997--2016 The R Core Team. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public License 00017 * along with this program; if not, a copy is available at 00018 * https://www.R-project.org/Licenses/ 00019 * 00020 * Much of this is from Doug Bates. 00021 */ 00022 00023 /* 00024 This is a legacy header and no longer documented. 00025 Code using it should be converted to use R.h 00026 */ 00027 00028 /* This header includes C headers and so is not safe for inclusion 00029 from C++: use R.h instead. */ 00030 00031 #ifndef R_S_H 00032 #define R_S_H 00033 00034 #ifndef USING_R 00035 # define USING_R 00036 /* is this a good idea? - conflicts with many versions of f2c.h */ 00037 # define longint int 00038 #endif 00039 00040 #ifdef __cplusplus 00041 # error S.h can not be used from C++ code: use R.h instead 00042 #endif 00043 00044 #include <stddef.h> 00045 #include <stdlib.h> 00046 #include <stdio.h> 00047 #include <limits.h> 00048 #include <float.h> 00049 #include <math.h> 00050 00051 #include <Rconfig.h> 00052 #include <R_ext/Constants.h> 00053 #include <R_ext/Memory.h> /* S_alloc */ 00054 00055 /* subset of those in Random.h */ 00056 extern void seed_in(long *); 00057 extern void seed_out(long *); 00058 extern double unif_rand(void); 00059 extern double norm_rand(void); 00060 00061 /* Macros for S/R Compatibility */ 00062 00063 #include <R_ext/RS.h> 00064 /* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */ 00065 00066 /* S4 uses macros equivalent to */ 00067 #define Salloc(n,t) (t*)S_alloc(n, sizeof(t)) 00068 #define Srealloc(p,n,old,t) (t*)S_realloc(p,n,old,sizeof(t)) 00069 00070 /* S's complex is different, and is a define to S_complex now */ 00071 typedef struct { 00072 double re; 00073 double im; 00074 } S_complex; 00075 00076 #ifdef S_OLD_COMPLEX 00077 # define complex S_complex 00078 #endif 00079 00080 #ifndef NO_CALL_R 00081 /* Not quite full compatibility: beware! */ 00082 /* void call_R(char*, long, void**, char**, long*, char**, long, char**);*/ 00083 #define call_S call_R 00084 #endif 00085 00086 #endif /* !R_S_H */