The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
429 ihaka 1
/*
2426 maechler 2
 *  R : A Computer Language for Statistical Data Analysis
429 ihaka 3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
22931 ripley 4
 *  Copyright (C) 1997--2003 The R Development Core Team.
429 ihaka 5
 *
6
 *  This program is free software; you can redistribute it and/or modify
12778 pd 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
429 ihaka 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
12778 pd 14
 *  GNU Lesser General Public License for more details.
429 ihaka 15
 *
12778 pd 16
 *  You should have received a copy of the GNU Lesser General Public License
429 ihaka 17
 *  along with this program; if not, write to the Free Software
5458 ripley 18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
441 ihaka 19
 *
20
 *  Much of this is from Doug Bates.
429 ihaka 21
 */
22
 
23
#ifndef R_S_H
24
#define R_S_H
25
 
26
#ifndef USING_R
11497 hornik 27
# define USING_R
7731 ripley 28
/* is this a good idea? - conflicts with many versions of f2c.h */
11497 hornik 29
# define longint int
429 ihaka 30
#endif
31
 
32
#ifdef __cplusplus
33
extern "C" {
34
#endif
35
 
36
#include <stddef.h>
37
#include <stdlib.h>
38
#include <stdio.h>
39
#include <limits.h>
40
#include <float.h>
11497 hornik 41
# include <math.h>
429 ihaka 42
 
11497 hornik 43
#include <Rconfig.h>
19500 hornik 44
#include <R_ext/Constants.h>
45
#include <R_ext/Memory.h>	/* S_alloc */
7731 ripley 46
 
47
/* subset of those in Random.h */
2426 maechler 48
extern void seed_in(long *);
49
extern void seed_out(long *);
50
extern double unif_rand(void);
51
extern double norm_rand(void);
1195 hornik 52
 
4895 ihaka 53
/* Macros for S/R Compatibility */
429 ihaka 54
 
19500 hornik 55
#include <R_ext/RS.h>
7731 ripley 56
/* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */
4850 ihaka 57
 
28146 ripley 58
/* S4 uses macros equivalent to */
59
#define Salloc(n,t) (t*)S_alloc(n, sizeof(t))
60
#define Srealloc(p,n,old,t) (t*)S_realloc(p,n,old,sizeof(t))
61
 
7731 ripley 62
/* S's complex is different, and is a define to S_complex now */
63
typedef struct {
64
	double re;
65
	double im;
66
} S_complex;
429 ihaka 67
 
7731 ripley 68
#ifdef S_OLD_COMPLEX
11497 hornik 69
# define complex S_complex
2816 pd 70
#endif
71
 
7731 ripley 72
/* Not quite full compatibility: beware! */
73
/* void	call_R(char*, long, void**, char**, long*, char**, long, char**);*/
74
#define call_S call_R
429 ihaka 75
 
1831 pd 76
 
429 ihaka 77
#ifdef __cplusplus
78
}
79
#endif
80
 
81
#endif /* !R_S_H */