The R Project SVN R

Rev

Rev 61469 | Rev 67181 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31538 ripley 1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
59039 ripley 4
 *  Copyright (C) 1998--2006  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
18
 *  http://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.
37831 ripley 27
*/
31538 ripley 28
 
29
#ifndef RINTERFACE_H_
30
#define RINTERFACE_H_
31
 
31542 ripley 32
#ifdef __cplusplus
51836 ripley 33
#include <cstdio>
31542 ripley 34
extern "C" {
51836 ripley 35
#else
36
#include <stdio.h>
31542 ripley 37
#endif
38
 
31538 ripley 39
#include <R_ext/Boolean.h>
40
#include <R_ext/RStartup.h>
41
 
42
/* from Defn.h */
43
/* this duplication will be removed in due course */
44
 
45
extern Rboolean R_Interactive;	/* TRUE during interactive use*/
46
extern Rboolean	R_Slave;	/* Run as a slave process */
47
 
48
extern void R_RestoreGlobalEnv(void);
49
extern void R_RestoreGlobalEnvFromFile(const char *, Rboolean);
50
extern void R_SaveGlobalEnv(void);
51
extern void R_SaveGlobalEnvToFile(const char *);
52
extern void R_FlushConsole(void);
53
extern void R_ClearerrConsole(void);
43767 ripley 54
extern void R_Suicide(const char *);
41862 ripley 55
extern char *R_HomeDir(void);
31538 ripley 56
extern int R_DirtyImage;	/* Current image dirty */
41862 ripley 57
extern char *R_GUIType;
44195 ripley 58
extern void R_setupHistory(void);
41862 ripley 59
extern char *R_HistoryFile;	/* Name of the history file */
31538 ripley 60
extern int R_HistorySize;	/* Size of the history file */
61
extern int R_RestoreHistory;	/* restore the history file? */
41862 ripley 62
extern char *R_Home;		    /* Root of the R tree */
31538 ripley 63
 
64
# define jump_to_toplevel	Rf_jump_to_toplevel
65
# define mainloop		Rf_mainloop
66
# define onintr			Rf_onintr
67
void jump_to_toplevel(void);
68
void mainloop(void);
44195 ripley 69
void onintr(void);
31538 ripley 70
#ifndef DEFN_H_
71
extern void* R_GlobalContext;    /* Need opaque pointer type for export */
72
#endif
73
 
44195 ripley 74
void process_site_Renviron(void);
75
void process_system_Renviron(void);
76
void process_user_Renviron(void);
31538 ripley 77
 
31540 ripley 78
extern FILE * R_Consolefile;
79
extern FILE * R_Outputfile;
31538 ripley 80
 
31540 ripley 81
 
31538 ripley 82
/* in sys-unix.c */
83
void R_setStartTime(void);
84
void fpu_setup(Rboolean);
85
 
37873 ripley 86
#ifdef CSTACK_DEFNS
37831 ripley 87
/* duplicating Defn.h */
88
#if !defined(HAVE_UINTPTR_T) && !defined(uintptr_t)
89
 typedef unsigned long uintptr_t;
90
#endif
91
 
92
extern uintptr_t R_CStackLimit;	/* C stack limit */
93
extern uintptr_t R_CStackStart;	/* Initial stack address */
37873 ripley 94
#endif
37831 ripley 95
 
31538 ripley 96
/* formerly in src/unix/devUI.h */
97
 
98
#ifdef R_INTERFACE_PTRS
99
#include <Rinternals.h>
100
 
101
#ifdef __SYSTEM__
102
# define extern
103
#endif
104
 
43767 ripley 105
extern void (*ptr_R_Suicide)(const char *);
106
extern void (*ptr_R_ShowMessage)(const char *);
107
extern int  (*ptr_R_ReadConsole)(const char *, unsigned char *, int, int);
108
extern void (*ptr_R_WriteConsole)(const char *, int);
109
extern void (*ptr_R_WriteConsoleEx)(const char *, int, int);
44195 ripley 110
extern void (*ptr_R_ResetConsole)(void);
111
extern void (*ptr_R_FlushConsole)(void);
112
extern void (*ptr_R_ClearerrConsole)(void);
31538 ripley 113
extern void (*ptr_R_Busy)(int);
114
extern void (*ptr_R_CleanUp)(SA_TYPE, int, int);
43767 ripley 115
extern int  (*ptr_R_ShowFiles)(int, const char **, const char **,
116
			       const char *, Rboolean, const char *);
31538 ripley 117
extern int  (*ptr_R_ChooseFile)(int, char *, int);
43767 ripley 118
extern int  (*ptr_R_EditFile)(const char *);
31538 ripley 119
extern void (*ptr_R_loadhistory)(SEXP, SEXP, SEXP, SEXP);
120
extern void (*ptr_R_savehistory)(SEXP, SEXP, SEXP, SEXP);
37572 murdoch 121
extern void (*ptr_R_addhistory)(SEXP, SEXP, SEXP, SEXP);
35328 ripley 122
 
61285 ripley 123
// added in 3.0.0
41807 rgentlem 124
extern int  (*ptr_R_EditFiles)(int, const char **, const char **, const char *);
60685 ripley 125
// naming follows earlier versions in R.app
126
extern SEXP (*ptr_do_selectlist)(SEXP, SEXP, SEXP, SEXP);
127
extern SEXP (*ptr_do_dataentry)(SEXP, SEXP, SEXP, SEXP);
128
extern SEXP (*ptr_do_dataviewer)(SEXP, SEXP, SEXP, SEXP);
61469 ripley 129
extern void (*ptr_R_ProcessEvents)();
37831 ripley 130
 
60685 ripley 131
 
61760 ripley 132
/* These two are not used by R itself, but are used by the tcltk package */
44195 ripley 133
extern int  (*R_timeout_handler)(void);
31538 ripley 134
extern long R_timeout_val;
135
 
38854 ripley 136
#endif /* R_INTERFACE_PTRS */
31538 ripley 137
 
138
#ifdef __SYSTEM__
139
# undef extern
140
#endif
141
 
37951 ripley 142
extern int R_SignalHandlers;
143
 
31542 ripley 144
#ifdef __cplusplus
145
}
146
#endif
147
 
31538 ripley 148
#endif /* RINTERFACE_H_ */