OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [ada/] [adaint.h] - Blame information for rev 820

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 706 jeremybenn
/****************************************************************************
2
 *                                                                          *
3
 *                         GNAT COMPILER COMPONENTS                         *
4
 *                                                                          *
5
 *                               A D A I N T                                *
6
 *                                                                          *
7
 *                              C Header File                               *
8
 *                                                                          *
9
 *          Copyright (C) 1992-2011, Free Software Foundation, Inc.         *
10
 *                                                                          *
11
 * GNAT is free software;  you can  redistribute it  and/or modify it under *
12
 * terms of the  GNU General Public License as published  by the Free Soft- *
13
 * ware  Foundation;  either version 3,  or (at your option) any later ver- *
14
 * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
15
 * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
16
 * or FITNESS FOR A PARTICULAR PURPOSE.                                     *
17
 *                                                                          *
18
 * As a special exception under Section 7 of GPL version 3, you are granted *
19
 * additional permissions described in the GCC Runtime Library Exception,   *
20
 * version 3.1, as published by the Free Software Foundation.               *
21
 *                                                                          *
22
 * You should have received a copy of the GNU General Public License and    *
23
 * a copy of the GCC Runtime Library Exception along with this program;     *
24
 * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    *
25
 * <http://www.gnu.org/licenses/>.                                          *
26
 *                                                                          *
27
 * GNAT was originally developed  by the GNAT team at  New York University. *
28
 * Extensive contributions were provided by Ada Core Technologies Inc.      *
29
 *                                                                          *
30
 ****************************************************************************/
31
 
32
#ifdef __cplusplus
33
extern "C" {
34
#endif
35
 
36
#include <sys/stat.h>
37
#include <stdio.h>
38
 
39
#ifdef _WIN32
40
#include "mingw32.h"
41
#endif
42
 
43
#include <dirent.h>
44
 
45
/*  Constants used for the form parameter encoding values  */
46
#define Encoding_UTF8 0         /* UTF-8 */
47
#define Encoding_8bits 1        /* Standard 8bits, CP_ACP on Windows. */
48
#define Encoding_Unspecified 2  /* Based on GNAT_CODE_PAGE env variable. */
49
 
50
/* Large file support. It is unclear what portable mechanism we can use to
51
   determine at compile time what support the system offers for large files.
52
   For now we just list the platforms we have manually tested. */
53
 
54
#if defined (__GLIBC__) || defined (sun)  || (defined (__sgi) && defined(_LFAPI))
55
#define GNAT_FOPEN fopen64
56
#define GNAT_STAT stat64
57
#define GNAT_FSTAT fstat64
58
#define GNAT_LSTAT lstat64
59
#define GNAT_STRUCT_STAT struct stat64
60
#else
61
#define GNAT_FOPEN fopen
62
#define GNAT_STAT stat
63
#define GNAT_FSTAT fstat
64
#define GNAT_LSTAT lstat
65
#define GNAT_STRUCT_STAT struct stat
66
#endif
67
 
68
/* Type corresponding to GNAT.OS_Lib.OS_Time */
69
#if defined (_WIN64)
70
typedef long long OS_Time;
71
#else
72
typedef long OS_Time;
73
#endif
74
 
75
/* A lazy cache for the attributes of a file. On some systems, a single call to
76
   stat() will give all this information, so it is better than doing a system
77
   call every time. On other systems this require several system calls.
78
*/
79
 
80
struct file_attributes {
81
  unsigned char exists;
82
 
83
  unsigned char writable;
84
  unsigned char readable;
85
  unsigned char executable;
86
 
87
  unsigned char symbolic_link;
88
  unsigned char regular;
89
  unsigned char directory;
90
 
91
  OS_Time timestamp;
92
  long file_length;
93
};
94
/* WARNING: changing the size here might require changing the constant
95
 * File_Attributes_Size in osint.ads (which should be big enough to
96
 * fit the above struct on any system)
97
 */
98
 
99
extern int    __gnat_max_path_len;
100
extern OS_Time __gnat_current_time                 (void);
101
extern void   __gnat_current_time_string           (char *);
102
extern void   __gnat_to_gm_time                    (OS_Time *, int *, int *,
103
                                                    int *, int *,
104
                                                    int *, int *);
105
extern int    __gnat_get_maximum_file_name_length  (void);
106
extern int    __gnat_get_switches_case_sensitive   (void);
107
extern int    __gnat_get_file_names_case_sensitive (void);
108
extern int    __gnat_get_env_vars_case_sensitive   (void);
109
extern char   __gnat_get_default_identifier_character_set (void);
110
extern void   __gnat_get_current_dir               (char *, int *);
111
extern void   __gnat_get_object_suffix_ptr         (int *,
112
                                                    const char **);
113
extern void   __gnat_get_executable_suffix_ptr     (int *,
114
                                                    const char **);
115
extern void   __gnat_get_debuggable_suffix_ptr     (int *,
116
                                                    const char **);
117
extern int    __gnat_readlink                      (char *, char *,
118
                                                    size_t);
119
extern int    __gnat_symlink                       (char *, char *);
120
extern int    __gnat_try_lock                      (char *, char *);
121
extern int    __gnat_open_new                      (char *, int);
122
extern int    __gnat_open_new_temp                 (char *, int);
123
extern int    __gnat_mkdir                         (char *);
124
extern int    __gnat_stat                          (char *,
125
                                                    GNAT_STRUCT_STAT *);
126
extern int    __gnat_unlink                        (char *);
127
extern int    __gnat_rename                        (char *, char *);
128
extern int    __gnat_chdir                         (char *);
129
extern int    __gnat_rmdir                         (char *);
130
 
131
extern FILE  *__gnat_fopen                         (char *, char *, int);
132
extern FILE  *__gnat_freopen                       (char *, char *, FILE *,
133
                                                    int);
134
extern int    __gnat_open_read                     (char *, int);
135
extern int    __gnat_open_rw                       (char *, int);
136
extern int    __gnat_open_create                   (char *, int);
137
extern int    __gnat_create_output_file            (char *);
138
extern int    __gnat_create_output_file_new        (char *);
139
 
140
extern int    __gnat_open_append                   (char *, int);
141
extern long   __gnat_file_length                   (int);
142
extern long   __gnat_named_file_length             (char *);
143
extern void   __gnat_tmp_name                      (char *);
144
extern DIR   *__gnat_opendir                       (char *);
145
extern char  *__gnat_readdir                       (DIR *, char *, int *);
146
extern int    __gnat_closedir                      (DIR *);
147
extern int    __gnat_readdir_is_thread_safe        (void);
148
 
149
extern OS_Time __gnat_file_time_name                (char *);
150
extern OS_Time __gnat_file_time_fd                  (int);
151
/* return -1 in case of error */
152
 
153
extern void   __gnat_set_file_time_name            (char *, time_t);
154
 
155
extern int    __gnat_dup                                    (int);
156
extern int    __gnat_dup2                                   (int, int);
157
extern int    __gnat_file_exists                         (char *);
158
extern int    __gnat_is_regular_file         (char *);
159
extern int    __gnat_is_absolute_path        (char *,int);
160
extern int    __gnat_is_directory                     (char *);
161
extern int    __gnat_is_writable_file              (char *);
162
extern int    __gnat_is_readable_file              (char *name);
163
extern int    __gnat_is_executable_file      (char *name);
164
 
165
extern void __gnat_reset_attributes (struct file_attributes* attr);
166
extern long   __gnat_file_length_attr        (int, char *, struct file_attributes *);
167
extern OS_Time __gnat_file_time_name_attr    (char *, struct file_attributes *);
168
extern OS_Time __gnat_file_time_fd_attr      (int,    struct file_attributes *);
169
extern int    __gnat_file_exists_attr        (char *, struct file_attributes *);
170
extern int    __gnat_is_regular_file_attr    (char *, struct file_attributes *);
171
extern int    __gnat_is_directory_attr       (char *, struct file_attributes *);
172
extern int    __gnat_is_readable_file_attr   (char *, struct file_attributes *);
173
extern int    __gnat_is_writable_file_attr   (char *, struct file_attributes *);
174
extern int    __gnat_is_executable_file_attr (char *, struct file_attributes *);
175
extern int    __gnat_is_symbolic_link_attr   (char *, struct file_attributes *);
176
 
177
extern void   __gnat_set_non_writable              (char *name);
178
extern void   __gnat_set_writable                  (char *name);
179
extern void   __gnat_set_executable                (char *name);
180
extern void   __gnat_set_readable                  (char *name);
181
extern void   __gnat_set_non_readable              (char *name);
182
extern int    __gnat_is_symbolic_link              (char *name);
183
extern int    __gnat_portable_spawn                (char *[]);
184
extern int    __gnat_portable_no_block_spawn       (char *[]);
185
extern int    __gnat_portable_wait                 (int *);
186
extern char  *__gnat_locate_exec                   (char *, char *);
187
extern char  *__gnat_locate_exec_on_path           (char *);
188
extern char  *__gnat_locate_regular_file           (char *, char *);
189
extern void   __gnat_maybe_glob_args               (int *, char ***);
190
extern void   __gnat_os_exit                       (int);
191
extern char  *__gnat_get_libraries_from_registry   (void);
192
extern int    __gnat_to_canonical_file_list_init   (char *, int);
193
extern char  *__gnat_to_canonical_file_list_next   (void);
194
extern void   __gnat_to_canonical_file_list_free   (void);
195
extern char  *__gnat_to_canonical_dir_spec         (char *, int);
196
extern char  *__gnat_to_canonical_file_spec        (char *);
197
extern char  *__gnat_to_host_dir_spec              (char *, int);
198
extern char  *__gnat_to_host_file_spec             (char *);
199
extern char  *__gnat_to_canonical_path_spec        (char *);
200
extern void   __gnat_adjust_os_resource_limits     (void);
201
extern void   convert_addresses                    (const char *, void *, int,
202
                                                    void *, int *);
203
extern int    __gnat_copy_attribs                  (char *, char *, int);
204
extern int    __gnat_feof                          (FILE *);
205
extern int    __gnat_ferror                        (FILE *);
206
extern int    __gnat_fileno                        (FILE *);
207
extern int    __gnat_is_regular_file_fd            (int);
208
extern FILE  *__gnat_constant_stderr               (void);
209
extern FILE  *__gnat_constant_stdin                (void);
210
extern FILE  *__gnat_constant_stdout               (void);
211
extern char  *__gnat_full_name                     (char *, char *);
212
 
213
extern int    __gnat_arg_count                     (void);
214
extern int    __gnat_len_arg                       (int);
215
extern void   __gnat_fill_arg                      (char *, int);
216
extern int    __gnat_env_count                     (void);
217
extern int    __gnat_len_env                       (int);
218
extern void   __gnat_fill_env                      (char *, int);
219
 
220
/* Routines for interface to scanf and printf functions for integer values */
221
 
222
extern int    get_int                              (void);
223
extern void   put_int                              (int);
224
extern void   put_int_stderr                       (int);
225
extern int    get_char                             (void);
226
extern void   put_char                             (int);
227
extern void   put_char_stderr                      (int);
228
extern char  *mktemp                               (char *);
229
 
230
extern void   __gnat_set_exit_status               (int);
231
 
232
extern int    __gnat_expect_fork                   (void);
233
extern void   __gnat_expect_portable_execvp        (char *, char *[]);
234
extern int    __gnat_pipe                          (int *);
235
extern int    __gnat_expect_poll                   (int *, int, int, int *);
236
extern void   __gnat_set_binary_mode               (int);
237
extern void   __gnat_set_text_mode                 (int);
238
extern char  *__gnat_ttyname                       (int);
239
extern int    __gnat_lseek                         (int, long, int);
240
extern int    __gnat_set_close_on_exec             (int, int);
241
extern int    __gnat_dup                           (int);
242
extern int    __gnat_dup2                          (int, int);
243
 
244
extern int    __gnat_number_of_cpus                (void);
245
 
246
extern void   __gnat_os_filename                   (char *, char *, char *,
247
                                                    int *, char *, int *);
248
 
249
extern char * __gnat_locate_executable_file        (char *, char *);
250
extern char * __gnat_locate_file_with_predicate    (char *, char *,
251
                                                    int (*)(char*));
252
 
253
#if defined (linux)
254
extern void   *__gnat_lwp_self                     (void);
255
 
256
/* Routines for interface to required CPU set primitives */
257
 
258
#include <sched.h>
259
 
260
extern cpu_set_t *__gnat_cpu_alloc                 (size_t);
261
extern size_t __gnat_cpu_alloc_size                (size_t);
262
extern void   __gnat_cpu_free                  (cpu_set_t *);
263
extern void   __gnat_cpu_zero                      (size_t, cpu_set_t *);
264
extern void   __gnat_cpu_set                       (int, size_t, cpu_set_t *);
265
#endif
266
 
267
#if defined (_WIN32)
268
/* Interface to delete a handle from internally maintained list of child
269
   process handles on Windows */
270
extern void
271
__gnat_win32_remove_handle (HANDLE h, int pid);
272
#endif
273
 
274
#ifdef IN_RTS
275
/* Portable definition of strdup, which is not available on all systems.  */
276
#define xstrdup(S)  strcpy ((char *) malloc (strlen (S) + 1), S)
277
#endif
278
 
279
/* This function returns the version of GCC being used.  Here it's GCC 3.  */
280
extern int    get_gcc_version                      (void);
281
 
282
extern int    __gnat_binder_supports_auto_init     (void);
283
extern int    __gnat_sals_init_using_constructors  (void);
284
 
285
#ifdef __cplusplus
286
}
287
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.