-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRinterface.h
More file actions
167 lines (138 loc) · 4.94 KB
/
Rinterface.h
File metadata and controls
167 lines (138 loc) · 4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
* R : A Computer Language for Statistical Data Analysis
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
* Copyright (C) 1998--2016 The R Core Team.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, a copy is available at
* https://www.R-project.org/Licenses/
*/
/* This header file is to provide hooks for alternative front-ends,
e.g. GUIs such as GNOME and Cocoa. It is only used on Unix-alikes.
All entries here should be documented in doc/manual/R-exts.texi.
It should not be included by package sources unless they are
providing such a front-end.
*/
#ifndef RINTERFACE_H_
#define RINTERFACE_H_
// Support for NO_C_HEADERS added in R 3.3.0
#ifdef __cplusplus
# ifndef NO_C_HEADERS
# include <cstdio>
# ifdef __SUNPRO_CC
using std::FILE;
# endif
# endif
extern "C" {
#else
# ifndef NO_C_HEADERS
# include <stdio.h>
#endif
#endif
#if defined(__GNUC__) && __GNUC__ >= 3
# define NORET __attribute__((noreturn))
#else
# define NORET
#endif
#include <R_ext/Boolean.h>
#include <R_ext/RStartup.h>
/* from Defn.h */
/* this duplication will be removed in due course */
extern Rboolean R_Interactive; /* TRUE during interactive use*/
extern Rboolean R_Slave; /* Run as a slave process */
extern void R_RestoreGlobalEnv(void);
extern void R_RestoreGlobalEnvFromFile(const char * name, Rboolean quiet);
extern void R_SaveGlobalEnv(void);
extern void R_SaveGlobalEnvToFile(const char * name);
extern void R_FlushConsole(void);
extern void R_ClearerrConsole(void);
extern void R_Suicide(const char *);
extern char *R_HomeDir(void);
extern int R_DirtyImage; /* Current image dirty */
extern char *R_GUIType;
extern void R_setupHistory(void);
extern char *R_HistoryFile; /* Name of the history file */
extern int R_HistorySize; /* Size of the history file */
extern int R_RestoreHistory; /* restore the history file? */
extern char *R_Home; /* Root of the R tree */
# define jump_to_toplevel Rf_jump_to_toplevel
# define mainloop Rf_mainloop
# define onintr Rf_onintr
# define onintrNoResume Rf_onintrNoResume
void NORET jump_to_toplevel(void);
void mainloop(void);
void onintr(void);
void onintrNoResume(void);
#ifndef DEFN_H_
extern void* R_GlobalContext; /* Need opaque pointer type for export */
#endif
void process_site_Renviron(void);
void process_system_Renviron(void);
void process_user_Renviron(void);
extern FILE * R_Consolefile;
extern FILE * R_Outputfile;
/* in ../unix/sys-unix.c */
void R_setStartTime(void);
void fpu_setup(Rboolean);
/* in ../unix/system.c */
extern int R_running_as_main_program;
#ifdef CSTACK_DEFNS
/* duplicating Defn.h */
#if !defined(HAVE_UINTPTR_T) && !defined(uintptr_t)
typedef unsigned long uintptr_t;
#endif
extern uintptr_t R_CStackLimit; /* C stack limit */
extern uintptr_t R_CStackStart; /* Initial stack address */
#endif
/* formerly in src/unix/devUI.h */
#ifdef R_INTERFACE_PTRS
#include <Rinternals.h>
#ifdef __SYSTEM__
# define extern
#endif
extern void (*ptr_R_Suicide)(const char *);
extern void (*ptr_R_ShowMessage)(const char *);
extern int (*ptr_R_ReadConsole)(const char *, unsigned char *, int, int);
extern void (*ptr_R_WriteConsole)(const char *, int);
extern void (*ptr_R_WriteConsoleEx)(const char *, int, int);
extern void (*ptr_R_ResetConsole)(void);
extern void (*ptr_R_FlushConsole)(void);
extern void (*ptr_R_ClearerrConsole)(void);
extern void (*ptr_R_Busy)(int);
extern void (*ptr_R_CleanUp)(SA_TYPE, int, int);
extern int (*ptr_R_ShowFiles)(int, const char **, const char **,
const char *, Rboolean, const char *);
extern int (*ptr_R_ChooseFile)(int, char *, int);
extern int (*ptr_R_EditFile)(const char *);
extern void (*ptr_R_loadhistory)(SEXP, SEXP, SEXP, SEXP);
extern void (*ptr_R_savehistory)(SEXP, SEXP, SEXP, SEXP);
extern void (*ptr_R_addhistory)(SEXP, SEXP, SEXP, SEXP);
// added in 3.0.0
extern int (*ptr_R_EditFiles)(int, const char **, const char **, const char *);
// naming follows earlier versions in R.app
extern SEXP (*ptr_do_selectlist)(SEXP, SEXP, SEXP, SEXP);
extern SEXP (*ptr_do_dataentry)(SEXP, SEXP, SEXP, SEXP);
extern SEXP (*ptr_do_dataviewer)(SEXP, SEXP, SEXP, SEXP);
extern void (*ptr_R_ProcessEvents)();
/* These two are not used by R itself, but are used by the tcltk package */
extern int (*R_timeout_handler)(void);
extern long R_timeout_val;
#endif /* R_INTERFACE_PTRS */
#ifdef __SYSTEM__
# undef extern
#endif
extern int R_SignalHandlers;
#ifdef __cplusplus
}
#endif
#endif /* RINTERFACE_H_ */