77724cdd7947e73e4e000edf1ab9185c09621dba
1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
9 * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
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 2, 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. See the GNU General Public License *
17 * for more details. You should have received a copy of the GNU General *
18 * Public License distributed with GNAT; see file COPYING. If not, write *
19 * to the Free Software Foundation, 51 Franklin Street, Fifth Floor, *
20 * Boston, MA 02110-1301, USA. *
22 * As a special exception, if you link this file with other files to *
23 * produce an executable, this file does not by itself cause the resulting *
24 * executable to be covered by the GNU General Public License. This except- *
25 * ion does not however invalidate any other reasons why the executable *
26 * file might be covered by the GNU Public License. *
28 * GNAT was originally developed by the GNAT team at New York University. *
29 * Extensive contributions were provided by Ada Core Technologies Inc. *
31 ****************************************************************************/
42 /* Constants used for the form parameter encoding values */
43 #define Encoding_UTF8 0
44 #define Encoding_8bits 1
46 typedef long OS_Time
; /* Type corresponding to GNAT.OS_Lib.OS_Time */
48 extern int __gnat_max_path_len
;
49 extern OS_Time
__gnat_current_time (void);
50 extern void __gnat_to_gm_time (OS_Time
*, int *, int *,
53 extern int __gnat_get_maximum_file_name_length (void);
54 extern int __gnat_get_switches_case_sensitive (void);
55 extern int __gnat_get_file_names_case_sensitive (void);
56 extern char __gnat_get_default_identifier_character_set (void);
57 extern void __gnat_get_current_dir (char *, int *);
58 extern void __gnat_get_object_suffix_ptr (int *,
60 extern void __gnat_get_executable_suffix_ptr (int *,
62 extern void __gnat_get_debuggable_suffix_ptr (int *,
64 extern int __gnat_readlink (char *, char *,
66 extern int __gnat_symlink (char *, char *);
67 extern int __gnat_try_lock (char *, char *);
68 extern int __gnat_open_new (char *, int);
69 extern int __gnat_open_new_temp (char *, int);
70 extern int __gnat_mkdir (char *);
71 extern int __gnat_stat (char *,
73 extern FILE *__gnat_fopen (char *, char *, int);
74 extern FILE *__gnat_freopen (char *, char *, FILE *,
76 extern int __gnat_open_read (char *, int);
77 extern int __gnat_open_rw (char *, int);
78 extern int __gnat_open_create (char *, int);
79 extern int __gnat_create_output_file (char *);
80 extern int __gnat_open_append (char *, int);
81 extern long __gnat_file_length (int);
82 extern long __gnat_named_file_length (char *);
83 extern void __gnat_tmp_name (char *);
84 extern DIR *__gnat_opendir (char *);
85 extern char *__gnat_readdir (DIR *, char *, int *);
86 extern int __gnat_closedir (DIR *);
87 extern int __gnat_readdir_is_thread_safe (void);
89 extern OS_Time
__gnat_file_time_name (char *);
90 extern OS_Time
__gnat_file_time_fd (int);
91 /* return -1 in case of error */
93 extern void __gnat_set_file_time_name (char *, time_t);
95 extern int __gnat_dup (int);
96 extern int __gnat_dup2 (int, int);
97 extern int __gnat_file_exists (char *);
98 extern int __gnat_is_regular_file (char *);
99 extern int __gnat_is_absolute_path (char *,int);
100 extern int __gnat_is_directory (char *);
101 extern int __gnat_is_writable_file (char *);
102 extern int __gnat_is_readable_file (char *name
);
103 extern void __gnat_set_readonly (char *name
);
104 extern void __gnat_set_writable (char *name
);
105 extern void __gnat_set_executable (char *name
);
106 extern int __gnat_is_symbolic_link (char *name
);
107 extern int __gnat_portable_spawn (char *[]);
108 extern int __gnat_portable_no_block_spawn (char *[]);
109 extern int __gnat_portable_wait (int *);
110 extern char *__gnat_locate_exec (char *, char *);
111 extern char *__gnat_locate_exec_on_path (char *);
112 extern char *__gnat_locate_regular_file (char *, char *);
113 extern void __gnat_maybe_glob_args (int *, char ***);
114 extern void __gnat_os_exit (int);
115 extern char *__gnat_get_libraries_from_registry (void);
116 extern int __gnat_to_canonical_file_list_init (char *, int);
117 extern char *__gnat_to_canonical_file_list_next (void);
118 extern void __gnat_to_canonical_file_list_free (void);
119 extern char *__gnat_to_canonical_dir_spec (char *, int);
120 extern char *__gnat_to_canonical_file_spec (char *);
121 extern char *__gnat_to_host_dir_spec (char *, int);
122 extern char *__gnat_to_host_file_spec (char *);
123 extern char *__gnat_to_canonical_path_spec (char *);
124 extern void __gnat_adjust_os_resource_limits (void);
125 extern void convert_addresses (const char *, void *, int,
127 extern int __gnat_copy_attribs (char *, char *, int);
128 extern int __gnat_feof (FILE *);
129 extern int __gnat_ferror (FILE *);
130 extern int __gnat_fileno (FILE *);
131 extern int __gnat_is_regular_file_fd (int);
132 extern FILE *__gnat_constant_stderr (void);
133 extern FILE *__gnat_constant_stdin (void);
134 extern FILE *__gnat_constant_stdout (void);
135 extern char *__gnat_full_name (char *, char *);
137 extern int __gnat_arg_count (void);
138 extern int __gnat_len_arg (int);
139 extern void __gnat_fill_arg (char *, int);
140 extern int __gnat_env_count (void);
141 extern int __gnat_len_env (int);
142 extern void __gnat_fill_env (char *, int);
144 /* Routines for interface to scanf and printf functions for integer values */
146 extern int get_int (void);
147 extern void put_int (int);
148 extern void put_int_stderr (int);
149 extern int get_char (void);
150 extern void put_char (int);
151 extern void put_char_stderr (int);
152 extern char *mktemp (char *);
154 extern void __gnat_set_exit_status (int);
156 extern int __gnat_expect_fork (void);
157 extern void __gnat_expect_portable_execvp (char *, char *[]);
158 extern int __gnat_pipe (int *);
159 extern int __gnat_expect_poll (int *, int, int, int *);
160 extern void __gnat_set_binary_mode (int);
161 extern void __gnat_set_text_mode (int);
162 extern char *__gnat_ttyname (int);
163 extern int __gnat_lseek (int, long, int);
164 extern int __gnat_set_close_on_exec (int, int);
165 extern int __gnat_dup (int);
166 extern int __gnat_dup2 (int, int);
168 extern void __gnat_os_filename (char *, char *, char *,
169 int *, char *, int *);
171 #if defined (__MINGW32__) && !defined (RTX)
172 extern void __gnat_plist_init (void);
176 /* Portable definition of strdup, which is not available on all systems. */
177 #define xstrdup(S) strcpy ((char *) malloc (strlen (S) + 1), S)
180 /* This function returns the version of GCC being used. Here it's GCC 3. */
181 extern int get_gcc_version (void);
183 extern int __gnat_binder_supports_auto_init (void);
184 extern int __gnat_sals_init_using_constructors (void);