The R Project SVN R

Rev

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

Rev Author Line No. Line
5306 ripley 1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
71379 ripley 3
 *  Copyright (C) 1999-2016  The R Core Team
5306 ripley 4
 *
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
42308 ripley 16
 *  along with this program; if not, a copy is available at
68949 ripley 17
 *  https://www.R-project.org/Licenses/
5306 ripley 18
 */
19
 
60253 ripley 20
/*
21
  C functions to be called from alternative front-ends.
22
 
23
  Part of the API for such front-ends but not for packages.
24
*/
25
 
34748 ripley 26
#ifndef R_EXT_RSTARTUP_H_
27
#define R_EXT_RSTARTUP_H_
11139 maechler 28
 
71379 ripley 29
#if defined(__cplusplus) && !defined(DO_NOT_USE_CXX_HEADERS)
30
# include <cstddef>
31
# define R_SIZE_T std::size_t
32
#else
33
# include <stddef.h> /* for size_t */
34
# define R_SIZE_T size_t
35
#endif
36
 
42411 ripley 37
#include <R_ext/Boolean.h>	/* TRUE/FALSE */
38
 
31542 ripley 39
#ifdef __cplusplus
40
extern "C" {
41
#endif
42
 
5306 ripley 43
#ifdef Win32
43767 ripley 44
typedef int (*blah1) (const char *, char *, int, int);
45
typedef void (*blah2) (const char *, int);
44197 ripley 46
typedef void (*blah3) (void);
43767 ripley 47
typedef void (*blah4) (const char *);
38875 ripley 48
/* Return value here is expected to be 1 for Yes, -1 for No and 0 for Cancel:
49
   symbolic constants in graphapp.h */
43767 ripley 50
typedef int (*blah5) (const char *);
5306 ripley 51
typedef void (*blah6) (int);
43767 ripley 52
typedef void (*blah7) (const char *, int, int);
5306 ripley 53
typedef enum {RGui, RTerm, LinkDLL} UImode;
54
#endif
55
 
11139 maechler 56
/* Startup Actions */
57
typedef enum {
58
    SA_NORESTORE,/* = 0 */
59
    SA_RESTORE,
11661 maechler 60
    SA_DEFAULT,/* was === SA_RESTORE */
11139 maechler 61
    SA_NOSAVE,
62
    SA_SAVE,
63
    SA_SAVEASK,
64
    SA_SUICIDE
65
} SA_TYPE;
66
 
5306 ripley 67
typedef struct
68
{
12976 pd 69
    Rboolean R_Quiet;
77228 maechler 70
    Rboolean R_NoEcho;
12976 pd 71
    Rboolean R_Interactive;
72
    Rboolean R_Verbose;
73
    Rboolean LoadSiteFile;
74
    Rboolean LoadInitFile;
75
    Rboolean DebugInitFile;
76
    SA_TYPE RestoreAction;
77
    SA_TYPE SaveAction;
71379 ripley 78
    R_SIZE_T vsize;
79
    R_SIZE_T nsize;
80
    R_SIZE_T max_vsize;
81
    R_SIZE_T max_nsize;
82
    R_SIZE_T ppsize;
11533 ripley 83
    int NoRenviron;
5646 duncan 84
 
5306 ripley 85
#ifdef Win32
86
    char *rhome;               /* R_HOME */
87
    char *home;                /* HOME  */
88
    blah1 ReadConsole;
89
    blah2 WriteConsole;
90
    blah3 CallBack;
31698 ripley 91
    blah4 ShowMessage;
92
    blah5 YesNoCancel;
93
    blah6 Busy;
5306 ripley 94
    UImode CharacterMode;
40812 urbaneks 95
    blah7 WriteConsoleEx; /* used only if WriteConsole is NULL */
5306 ripley 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
 
29748 ripley 107
void R_set_command_line_arguments(int argc, char **argv);
10688 maechler 108
 
60253 ripley 109
void setup_Rmainloop(void); // also in Rembedded.h
11139 maechler 110
 
31542 ripley 111
#ifdef __cplusplus
112
}
11139 maechler 113
#endif
31542 ripley 114
 
115
#endif