CXXR (C++ R) API
RStartup.h
1 /*CXXR $Id: RStartup.h 1348 2013-02-25 17:49:03Z arr $
2  *CXXR
3  *CXXR This file is part of CXXR, a project to refactor the R interpreter
4  *CXXR into C++. It may consist in whole or in part of program code and
5  *CXXR documentation taken from the R project itself, incorporated into
6  *CXXR CXXR (and possibly MODIFIED) under the terms of the GNU General Public
7  *CXXR Licence.
8  *CXXR
9  *CXXR CXXR is Copyright (C) 2008-13 Andrew R. Runnalls, subject to such other
10  *CXXR copyrights and copyright restrictions as may be stated below.
11  *CXXR
12  *CXXR CXXR is not part of the R project, and bugs and other issues should
13  *CXXR not be reported via r-bugs or other R project channels; instead refer
14  *CXXR to the CXXR website.
15  *CXXR */
16 
17 /*
18  * R : A Computer Language for Statistical Data Analysis
19  * Copyright (C) 1999-2010 The R Core Team
20  *
21  * This program is free software; you can redistribute it and/or modify
22  * it under the terms of the GNU General Public License as published by
23  * the Free Software Foundation; either version 2 of the License, or
24  * (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29  * GNU General Public License for more details.
30  *
31  * You should have received a copy of the GNU General Public License
32  * along with this program; if not, a copy is available at
33  * http://www.r-project.org/Licenses/
34  */
35 
36 #ifndef R_EXT_RSTARTUP_H_
37 #define R_EXT_RSTARTUP_H_
38 
39 #include <R_ext/Boolean.h> /* TRUE/FALSE */
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #ifdef Win32
46 typedef int (*blah1) (const char *, char *, int, int);
47 typedef void (*blah2) (const char *, int);
48 typedef void (*blah3) (void);
49 typedef void (*blah4) (const char *);
50 /* Return value here is expected to be 1 for Yes, -1 for No and 0 for Cancel:
51  symbolic constants in graphapp.h */
52 typedef int (*blah5) (const char *);
53 typedef void (*blah6) (int);
54 typedef void (*blah7) (const char *, int, int);
55 typedef enum {RGui, RTerm, LinkDLL} UImode;
56 #endif
57 
58 /* Startup Actions */
59 typedef enum {
60  SA_NORESTORE,/* = 0 */
61  SA_RESTORE,
62  SA_DEFAULT,/* was === SA_RESTORE */
63  SA_NOSAVE,
64  SA_SAVE,
65  SA_SAVEASK,
66  SA_SUICIDE
67 } SA_TYPE;
68 
69 typedef struct
70 {
71  Rboolean R_Quiet;
72  Rboolean R_Slave;
73  Rboolean R_Interactive;
74  Rboolean R_Verbose;
75  Rboolean LoadSiteFile;
76  Rboolean LoadInitFile;
77  Rboolean DebugInitFile;
78  SA_TYPE RestoreAction;
79  SA_TYPE SaveAction;
80  size_t vsize;
81  size_t max_vsize;
82  size_t ppsize;
83  int NoRenviron;
84 
85 #ifdef Win32
86  char *rhome; /* R_HOME */
87  char *home; /* HOME */
88  blah1 ReadConsole;
89  blah2 WriteConsole;
90  blah3 CallBack;
91  blah4 ShowMessage;
92  blah5 YesNoCancel;
93  blah6 Busy;
94  UImode CharacterMode;
95  blah7 WriteConsoleEx; /* used only if WriteConsole is NULL */
96 #endif
97 } structRstart;
98 
99 typedef structRstart *Rstart;
100 
101 void R_DefParams(Rstart);
102 void R_SetParams(Rstart);
103 void R_SetWin32(Rstart);
104 void R_SizeFromEnv(Rstart);
105 void R_common_command_line(int *, char **, Rstart);
106 
107 void R_set_command_line_arguments(int argc, char **argv);
108 
109 void setup_Rmainloop(void);
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif