The R Project SVN R

Rev

Rev 42308 | Rev 51845 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42308 Rev 51840
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
4
 *  Copyright (C) 1997--2003 The R Development Core Team.
4
 *  Copyright (C) 1997--2010 The R Development Core Team.
5
 *
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
6
 *  This program 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
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
8
 *  the Free Software Foundation; either version 2.1 of the License, or
9
 *  (at your option) any later version.
9
 *  (at your option) any later version.
Line 36... Line 36...
36
#include <stddef.h>
36
#include <stddef.h>
37
#include <stdlib.h>
37
#include <stdlib.h>
38
#include <stdio.h>
38
#include <stdio.h>
39
#include <limits.h>
39
#include <limits.h>
40
#include <float.h>
40
#include <float.h>
41
# include <math.h>
41
#include <math.h>
42
 
42
 
43
#include <Rconfig.h>
43
#include <Rconfig.h>
44
#include <R_ext/Constants.h>
44
#include <R_ext/Constants.h>
45
#include <R_ext/Memory.h>	/* S_alloc */
45
#include <R_ext/Memory.h>	/* S_alloc */
46
 
46
 
Line 51... Line 51...
51
extern double norm_rand(void);
51
extern double norm_rand(void);
52
 
52
 
53
/* Macros for S/R Compatibility */
53
/* Macros for S/R Compatibility */
54
 
54
 
55
#include <R_ext/RS.h>
55
#include <R_ext/RS.h>
56
/* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */
56
/* for Calloc, Realloc, Free, Memcpy, F77_xxxx */
57
 
57
 
58
/* S4 uses macros equivalent to */
58
/* S4 uses macros equivalent to */
59
#define Salloc(n,t) (t*)S_alloc(n, sizeof(t))
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))
60
#define Srealloc(p,n,old,t) (t*)S_realloc(p,n,old,sizeof(t))
61
 
61
 
Line 67... Line 67...
67
 
67
 
68
#ifdef S_OLD_COMPLEX
68
#ifdef S_OLD_COMPLEX
69
# define complex S_complex
69
# define complex S_complex
70
#endif
70
#endif
71
 
71
 
-
 
72
 
-
 
73
 
72
/* Not quite full compatibility: beware! */
74
/* Not quite full compatibility: beware! */
73
/* void	call_R(char*, long, void**, char**, long*, char**, long, char**);*/
75
/* void	call_R(char*, long, void**, char**, long*, char**, long, char**);*/
74
#define call_S call_R
76
#define call_S call_R
75
 
77
 
-
 
78
/* S Like Error Handling */
-
 
79
 
-
 
80
#include <R_ext/Error.h>	/* for error and warning */
-
 
81
 
-
 
82
#define R_PROBLEM_BUFSIZE	4096
-
 
83
/* Parentheses added for FC4 with gcc4 and -D_FORTIFY_SOURCE=2 */
-
 
84
#define PROBLEM			{char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
-
 
85
#define MESSAGE                 {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
-
 
86
#define ERROR			),error(R_problem_buf);}
-
 
87
#define RECOVER(x)		),error(R_problem_buf);}
-
 
88
#define WARNING(x)		),warning(R_problem_buf);}
-
 
89
#define LOCAL_EVALUATOR		/**/
-
 
90
#define NULL_ENTRY		/**/
-
 
91
#define WARN			WARNING(NULL)
76
 
92
 
77
#ifdef __cplusplus
93
#ifdef __cplusplus
78
}
94
}
79
#endif
95
#endif
80
 
96