Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / include / R_ext / RS.h @ 2486

History | View | Annotate | Download (3.1 kB)

1 2486 sjacqu01
/*
2 2486 sjacqu01
 *  R : A Computer Language for Statistical Data Analysis
3 2486 sjacqu01
 *  Copyright (C) 1999-2007 The R Core Team.
4 2486 sjacqu01
 *
5 2486 sjacqu01
 *  This program is free software; you can redistribute it and/or modify
6 2486 sjacqu01
 *  it under the terms of the GNU Lesser General Public License as published by
7 2486 sjacqu01
 *  the Free Software Foundation; either version 2.1 of the License, or
8 2486 sjacqu01
 *  (at your option) any later version.
9 2486 sjacqu01
 *
10 2486 sjacqu01
 *  This program is distributed in the hope that it will be useful,
11 2486 sjacqu01
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 2486 sjacqu01
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 2486 sjacqu01
 *  GNU Lesser General Public License for more details.
14 2486 sjacqu01
 *
15 2486 sjacqu01
 *  You should have received a copy of the GNU Lesser General Public License
16 2486 sjacqu01
 *  along with this program; if not, a copy is available at
17 2486 sjacqu01
 *  http://www.r-project.org/Licenses/
18 2486 sjacqu01
 */
19 2486 sjacqu01
20 2486 sjacqu01
/* Included by R.h: API */
21 2486 sjacqu01
22 2486 sjacqu01
#ifndef R_RS_H
23 2486 sjacqu01
#define R_RS_H
24 2486 sjacqu01
25 2486 sjacqu01
#ifndef NO_C_HEADERS
26 2486 sjacqu01
# include <string.h>                /* for memcpy, memset */
27 2486 sjacqu01
#endif
28 2486 sjacqu01
29 2486 sjacqu01
#include <Rconfig.h>                /* for F77_APPEND_UNDERSCORE */
30 2486 sjacqu01
31 2486 sjacqu01
#ifdef  __cplusplus
32 2486 sjacqu01
extern "C" {
33 2486 sjacqu01
#endif
34 2486 sjacqu01
35 2486 sjacqu01
/* S Like Error Handling */
36 2486 sjacqu01
37 2486 sjacqu01
#include <R_ext/Error.h>        /* for error and warning */
38 2486 sjacqu01
39 2486 sjacqu01
#ifndef STRICT_R_HEADERS
40 2486 sjacqu01
41 2486 sjacqu01
#define R_PROBLEM_BUFSIZE        4096
42 2486 sjacqu01
/* Parentheses added for FC4 with gcc4 and -D_FORTIFY_SOURCE=2 */
43 2486 sjacqu01
#define PROBLEM                        {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
44 2486 sjacqu01
#define MESSAGE                 {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
45 2486 sjacqu01
#define ERROR                        ),error(R_problem_buf);}
46 2486 sjacqu01
#define RECOVER(x)                ),error(R_problem_buf);}
47 2486 sjacqu01
#define WARNING(x)                ),warning(R_problem_buf);}
48 2486 sjacqu01
#define LOCAL_EVALUATOR                /**/
49 2486 sjacqu01
#define NULL_ENTRY                /**/
50 2486 sjacqu01
#define WARN                        WARNING(NULL)
51 2486 sjacqu01
52 2486 sjacqu01
#endif
53 2486 sjacqu01
54 2486 sjacqu01
/* S Like Memory Management */
55 2486 sjacqu01
56 2486 sjacqu01
extern void *R_chk_calloc(size_t, size_t);
57 2486 sjacqu01
extern void *R_chk_realloc(void *, size_t);
58 2486 sjacqu01
extern void R_chk_free(void *);
59 2486 sjacqu01
60 2486 sjacqu01
#ifndef STRICT_R_HEADERS
61 2486 sjacqu01
/* S-PLUS 3.x but not 5.x NULLs the pointer in the following */
62 2486 sjacqu01
#define Calloc(n, t)   (t *) R_chk_calloc( (size_t) (n), sizeof(t) )
63 2486 sjacqu01
#define Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (size_t)((n) * sizeof(t)) )
64 2486 sjacqu01
#define Free(p)        (R_chk_free( (void *)(p) ), (p) = NULL)
65 2486 sjacqu01
#endif
66 2486 sjacqu01
#define R_Calloc(n, t)   (t *) R_chk_calloc( (size_t) (n), sizeof(t) )
67 2486 sjacqu01
#define R_Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (size_t)((n) * sizeof(t)) )
68 2486 sjacqu01
#define R_Free(p)      (R_chk_free( (void *)(p) ), (p) = NULL)
69 2486 sjacqu01
70 2486 sjacqu01
#define Memcpy(p,q,n)  memcpy( p, q, (size_t)(n) * sizeof(*p) )
71 2486 sjacqu01
72 2486 sjacqu01
/* added for 3.0.0 */
73 2486 sjacqu01
#define Memzero(p,n)  memset(p, 0, (size_t)(n) * sizeof(*p))
74 2486 sjacqu01
75 2486 sjacqu01
#define CallocCharBuf(n) (char *) R_chk_calloc((size_t) ((n)+1), sizeof(char))
76 2486 sjacqu01
77 2486 sjacqu01
/* S Like Fortran Interface */
78 2486 sjacqu01
/* These may not be adequate everywhere. Convex had _ prepending common
79 2486 sjacqu01
   blocks, and some compilers may need to specify Fortran linkage */
80 2486 sjacqu01
81 2486 sjacqu01
#ifdef HAVE_F77_UNDERSCORE
82 2486 sjacqu01
# define F77_CALL(x)        x ## _
83 2486 sjacqu01
#else
84 2486 sjacqu01
# define F77_CALL(x)        x
85 2486 sjacqu01
#endif
86 2486 sjacqu01
#define F77_NAME(x)    F77_CALL(x)
87 2486 sjacqu01
#define F77_SUB(x)     F77_CALL(x)
88 2486 sjacqu01
#define F77_COM(x)     F77_CALL(x)
89 2486 sjacqu01
#define F77_COMDECL(x) F77_CALL(x)
90 2486 sjacqu01
91 2486 sjacqu01
#ifndef NO_CALL_R
92 2486 sjacqu01
void        call_R(char*, long, void**, char**, long*, char**, long, char**);
93 2486 sjacqu01
#endif
94 2486 sjacqu01
95 2486 sjacqu01
#ifdef  __cplusplus
96 2486 sjacqu01
}
97 2486 sjacqu01
#endif
98 2486 sjacqu01
99 2486 sjacqu01
#endif /* R_RS_H */