| 31538 |
ripley |
1 |
/*
|
|
|
2 |
* R : A Computer Language for Statistical Data Analysis
|
|
|
3 |
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
|
| 89780 |
luke |
4 |
* Copyright (C) 1998--2026 The R Core Team.
|
| 31538 |
ripley |
5 |
*
|
|
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
|
8 |
* the Free Software Foundation; either version 2 of the License, or
|
|
|
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
|
|
|
14 |
* GNU General Public License for more details.
|
|
|
15 |
*
|
|
|
16 |
* You should have received a copy of the GNU General Public License
|
| 42308 |
ripley |
17 |
* along with this program; if not, a copy is available at
|
| 68949 |
ripley |
18 |
* https://www.R-project.org/Licenses/
|
| 31538 |
ripley |
19 |
*/
|
|
|
20 |
|
| 60253 |
ripley |
21 |
/* This header file is to provide hooks for alternative front-ends,
|
|
|
22 |
e.g. GUIs such as GNOME and Cocoa. It is only used on Unix-alikes.
|
|
|
23 |
All entries here should be documented in doc/manual/R-exts.texi.
|
|
|
24 |
|
|
|
25 |
It should not be included by package sources unless they are
|
|
|
26 |
providing such a front-end.
|
| 71864 |
ripley |
27 |
|
| 71879 |
ripley |
28 |
If CSTACK_DEFNS is defined, also define HAVE_UINTPTR_T (if true)
|
|
|
29 |
before including this, perhaps by including Rconfig.h from C code
|
|
|
30 |
(for C++ you need to test the C++ compiler in use).
|
| 37831 |
ripley |
31 |
*/
|
| 31538 |
ripley |
32 |
|
|
|
33 |
#ifndef RINTERFACE_H_
|
|
|
34 |
#define RINTERFACE_H_
|
|
|
35 |
|
| 87075 |
kalibera |
36 |
#ifdef CSTACK_DEFNS
|
|
|
37 |
/* duplicating older Defn.h.
|
|
|
38 |
Note: this is never used when including Rinterface.h from R itself
|
|
|
39 |
*/
|
|
|
40 |
# if !defined(HAVE_UINTPTR_T) && !defined(uintptr_t)
|
|
|
41 |
typedef unsigned long uintptr_t;
|
|
|
42 |
# else
|
|
|
43 |
# ifndef __cplusplus
|
|
|
44 |
# include <stdint.h>
|
|
|
45 |
# elif __cplusplus >= 201103L
|
|
|
46 |
# include <cstdint>
|
|
|
47 |
# endif
|
|
|
48 |
# endif
|
|
|
49 |
#endif
|
| 71379 |
ripley |
50 |
|
| 31542 |
ripley |
51 |
#ifdef __cplusplus
|
| 71864 |
ripley |
52 |
/* we do not support DO_NOT_USE_CXX_HEADERS in this file */
|
| 71371 |
ripley |
53 |
# include <cstdio>
|
| 51836 |
ripley |
54 |
#else
|
| 71371 |
ripley |
55 |
# include <stdio.h>
|
| 31542 |
ripley |
56 |
#endif
|
|
|
57 |
|
| 87075 |
kalibera |
58 |
#include <R_ext/Boolean.h>
|
|
|
59 |
|
|
|
60 |
#ifdef R_INTERFACE_PTRS
|
|
|
61 |
# include <Rinternals.h> // for SEXP
|
|
|
62 |
#endif
|
| 89780 |
luke |
63 |
#include <R_ext/RStartup.h> // for SA_TYPE
|
| 87075 |
kalibera |
64 |
|
|
|
65 |
#ifdef __cplusplus
|
|
|
66 |
extern "C" {
|
|
|
67 |
#endif
|
|
|
68 |
|
| 85652 |
kalibera |
69 |
// See R_ext/Error.h
|
| 83513 |
ripley |
70 |
#if defined NORET
|
| 83529 |
ripley |
71 |
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202301L)
|
| 83513 |
ripley |
72 |
# define NORET [[noreturn]]
|
|
|
73 |
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201102L
|
|
|
74 |
# define NORET _Noreturn
|
|
|
75 |
#elif defined(__GNUC__) && __GNUC__ >= 3
|
| 70041 |
ripley |
76 |
# define NORET __attribute__((noreturn))
|
| 67181 |
luke |
77 |
#else
|
| 70041 |
ripley |
78 |
# define NORET
|
| 67181 |
luke |
79 |
#endif
|
|
|
80 |
|
| 31538 |
ripley |
81 |
/* from Defn.h */
|
|
|
82 |
/* this duplication will be removed in due course */
|
|
|
83 |
|
|
|
84 |
extern Rboolean R_Interactive; /* TRUE during interactive use*/
|
| 77228 |
maechler |
85 |
extern Rboolean R_NoEcho; /* do not echo R code */
|
| 31538 |
ripley |
86 |
|
|
|
87 |
extern void R_RestoreGlobalEnv(void);
|
|
|
88 |
extern void R_RestoreGlobalEnvFromFile(const char *, Rboolean);
|
|
|
89 |
extern void R_SaveGlobalEnv(void);
|
|
|
90 |
extern void R_SaveGlobalEnvToFile(const char *);
|
|
|
91 |
extern void R_FlushConsole(void);
|
|
|
92 |
extern void R_ClearerrConsole(void);
|
| 83455 |
ripley |
93 |
NORET extern void R_Suicide(const char *);
|
| 89780 |
luke |
94 |
NORET extern void R_CleanUp(SA_TYPE, int, int);
|
| 41862 |
ripley |
95 |
extern char *R_HomeDir(void);
|
| 89780 |
luke |
96 |
extern void R_Busy(int);
|
|
|
97 |
extern int R_ReadConsole(const char *, unsigned char *, int, int);
|
|
|
98 |
extern void R_WriteConsole(const char *, int);
|
|
|
99 |
extern void R_WriteConsoleEx(const char *, int, int);
|
|
|
100 |
extern void R_ResetConsole(void);
|
|
|
101 |
extern int R_EditFiles(int, const char **, const char **, const char *);
|
| 31538 |
ripley |
102 |
extern int R_DirtyImage; /* Current image dirty */
|
| 41862 |
ripley |
103 |
extern char *R_GUIType;
|
| 44195 |
ripley |
104 |
extern void R_setupHistory(void);
|
| 41862 |
ripley |
105 |
extern char *R_HistoryFile; /* Name of the history file */
|
| 31538 |
ripley |
106 |
extern int R_HistorySize; /* Size of the history file */
|
|
|
107 |
extern int R_RestoreHistory; /* restore the history file? */
|
| 41862 |
ripley |
108 |
extern char *R_Home; /* Root of the R tree */
|
| 31538 |
ripley |
109 |
|
|
|
110 |
# define jump_to_toplevel Rf_jump_to_toplevel
|
|
|
111 |
# define mainloop Rf_mainloop
|
|
|
112 |
# define onintr Rf_onintr
|
| 70852 |
luke |
113 |
# define onintrNoResume Rf_onintrNoResume
|
| 83455 |
ripley |
114 |
NORET void jump_to_toplevel(void);
|
| 31538 |
ripley |
115 |
void mainloop(void);
|
| 44195 |
ripley |
116 |
void onintr(void);
|
| 70852 |
luke |
117 |
void onintrNoResume(void);
|
| 31538 |
ripley |
118 |
#ifndef DEFN_H_
|
|
|
119 |
extern void* R_GlobalContext; /* Need opaque pointer type for export */
|
|
|
120 |
#endif
|
|
|
121 |
|
| 44195 |
ripley |
122 |
void process_site_Renviron(void);
|
|
|
123 |
void process_system_Renviron(void);
|
|
|
124 |
void process_user_Renviron(void);
|
| 31538 |
ripley |
125 |
|
| 71373 |
ripley |
126 |
#ifdef __cplusplus
|
|
|
127 |
extern std::FILE * R_Consolefile;
|
|
|
128 |
extern std::FILE * R_Outputfile;
|
|
|
129 |
#else
|
| 31540 |
ripley |
130 |
extern FILE * R_Consolefile;
|
|
|
131 |
extern FILE * R_Outputfile;
|
| 71373 |
ripley |
132 |
#endif
|
| 31538 |
ripley |
133 |
|
| 68232 |
maechler |
134 |
/* in ../unix/sys-unix.c */
|
| 31538 |
ripley |
135 |
void R_setStartTime(void);
|
|
|
136 |
void fpu_setup(Rboolean);
|
|
|
137 |
|
| 68232 |
maechler |
138 |
/* in ../unix/system.c */
|
|
|
139 |
extern int R_running_as_main_program;
|
| 66120 |
ripley |
140 |
|
| 37873 |
ripley |
141 |
#ifdef CSTACK_DEFNS
|
| 71879 |
ripley |
142 |
/* duplicating older Defn.h.
|
|
|
143 |
Note: this is never used when including Rinterface.h from R itself
|
|
|
144 |
*/
|
| 37831 |
ripley |
145 |
|
|
|
146 |
extern uintptr_t R_CStackLimit; /* C stack limit */
|
|
|
147 |
extern uintptr_t R_CStackStart; /* Initial stack address */
|
| 37873 |
ripley |
148 |
#endif
|
| 37831 |
ripley |
149 |
|
| 31538 |
ripley |
150 |
/* formerly in src/unix/devUI.h */
|
|
|
151 |
|
|
|
152 |
#ifdef R_INTERFACE_PTRS
|
|
|
153 |
|
|
|
154 |
#ifdef __SYSTEM__
|
|
|
155 |
# define extern
|
|
|
156 |
#endif
|
|
|
157 |
|
| 89724 |
luke |
158 |
#ifdef HAVE_AQUA
|
|
|
159 |
extern int (*ptr_CocoaSystem)(const char*);
|
|
|
160 |
#endif
|
|
|
161 |
|
| 43767 |
ripley |
162 |
extern void (*ptr_R_Suicide)(const char *);
|
|
|
163 |
extern void (*ptr_R_ShowMessage)(const char *);
|
|
|
164 |
extern int (*ptr_R_ReadConsole)(const char *, unsigned char *, int, int);
|
|
|
165 |
extern void (*ptr_R_WriteConsole)(const char *, int);
|
|
|
166 |
extern void (*ptr_R_WriteConsoleEx)(const char *, int, int);
|
| 44195 |
ripley |
167 |
extern void (*ptr_R_ResetConsole)(void);
|
|
|
168 |
extern void (*ptr_R_FlushConsole)(void);
|
|
|
169 |
extern void (*ptr_R_ClearerrConsole)(void);
|
| 31538 |
ripley |
170 |
extern void (*ptr_R_Busy)(int);
|
|
|
171 |
extern void (*ptr_R_CleanUp)(SA_TYPE, int, int);
|
| 43767 |
ripley |
172 |
extern int (*ptr_R_ShowFiles)(int, const char **, const char **,
|
|
|
173 |
const char *, Rboolean, const char *);
|
| 31538 |
ripley |
174 |
extern int (*ptr_R_ChooseFile)(int, char *, int);
|
| 43767 |
ripley |
175 |
extern int (*ptr_R_EditFile)(const char *);
|
| 31538 |
ripley |
176 |
extern void (*ptr_R_loadhistory)(SEXP, SEXP, SEXP, SEXP);
|
|
|
177 |
extern void (*ptr_R_savehistory)(SEXP, SEXP, SEXP, SEXP);
|
| 37572 |
murdoch |
178 |
extern void (*ptr_R_addhistory)(SEXP, SEXP, SEXP, SEXP);
|
| 35328 |
ripley |
179 |
|
| 61285 |
ripley |
180 |
// added in 3.0.0
|
| 41807 |
rgentlem |
181 |
extern int (*ptr_R_EditFiles)(int, const char **, const char **, const char *);
|
| 60685 |
ripley |
182 |
// naming follows earlier versions in R.app
|
|
|
183 |
extern SEXP (*ptr_do_selectlist)(SEXP, SEXP, SEXP, SEXP);
|
|
|
184 |
extern SEXP (*ptr_do_dataentry)(SEXP, SEXP, SEXP, SEXP);
|
|
|
185 |
extern SEXP (*ptr_do_dataviewer)(SEXP, SEXP, SEXP, SEXP);
|
| 82754 |
ripley |
186 |
extern void (*ptr_R_ProcessEvents)(void);
|
| 37831 |
ripley |
187 |
|
| 60685 |
ripley |
188 |
|
| 61760 |
ripley |
189 |
/* These two are not used by R itself, but are used by the tcltk package */
|
| 44195 |
ripley |
190 |
extern int (*R_timeout_handler)(void);
|
| 31538 |
ripley |
191 |
extern long R_timeout_val;
|
|
|
192 |
|
| 38854 |
ripley |
193 |
#endif /* R_INTERFACE_PTRS */
|
| 31538 |
ripley |
194 |
|
|
|
195 |
#ifdef __SYSTEM__
|
|
|
196 |
# undef extern
|
|
|
197 |
#endif
|
|
|
198 |
|
| 37951 |
ripley |
199 |
extern int R_SignalHandlers;
|
|
|
200 |
|
| 31542 |
ripley |
201 |
#ifdef __cplusplus
|
|
|
202 |
}
|
|
|
203 |
#endif
|
|
|
204 |
|
| 31538 |
ripley |
205 |
#endif /* RINTERFACE_H_ */
|