1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
9 * Copyright (C) 1992-2006, 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 typedef long OS_Time
; /* Type corresponding to GNAT.OS_Lib.OS_Time */
44 extern int __gnat_max_path_len
;
45 extern void __gnat_to_gm_time (OS_Time
*, int *,
49 extern int __gnat_get_maximum_file_name_length (void);
50 extern int __gnat_get_switches_case_sensitive (void);
51 extern int __gnat_get_file_names_case_sensitive (void);
52 extern char __gnat_get_default_identifier_character_set (void);
53 extern void __gnat_get_current_dir (char *, int *);
54 extern void __gnat_get_object_suffix_ptr (int *,
56 extern void __gnat_get_executable_suffix_ptr (int *,
58 extern void __gnat_get_debuggable_suffix_ptr (int *,
60 extern int __gnat_readlink (char *, char *,
62 extern int __gnat_symlink (char *, char *);
63 extern int __gnat_try_lock (char *, char *);
64 extern int __gnat_open_new (char *, int);
65 extern int __gnat_open_new_temp (char *, int);
66 extern int __gnat_mkdir (char *);
67 extern int __gnat_stat (char *,
69 extern int __gnat_open_read (char *, int);
70 extern int __gnat_open_rw (char *, int);
71 extern int __gnat_open_create (char *, int);
72 extern int __gnat_create_output_file (char *);
73 extern int __gnat_open_append (char *, int);
74 extern long __gnat_file_length (int);
75 extern long __gnat_named_file_length (char *);
76 extern void __gnat_tmp_name (char *);
77 extern DIR *__gnat_opendir (char *);
78 extern char *__gnat_readdir (DIR *, char *, int *);
79 extern int __gnat_closedir (DIR *);
80 extern int __gnat_readdir_is_thread_safe (void);
82 extern OS_Time
__gnat_file_time_name (char *);
83 extern OS_Time
__gnat_file_time_fd (int);
84 /* return -1 in case of error */
86 extern void __gnat_set_file_time_name (char *, time_t);
88 extern int __gnat_dup (int);
89 extern int __gnat_dup2 (int, int);
90 extern int __gnat_file_exists (char *);
91 extern int __gnat_is_regular_file (char *);
92 extern int __gnat_is_absolute_path (char *,int);
93 extern int __gnat_is_directory (char *);
94 extern int __gnat_is_writable_file (char *);
95 extern int __gnat_is_readable_file (char *name
);
96 extern void __gnat_set_readonly (char *name
);
97 extern void __gnat_set_writable (char *name
);
98 extern void __gnat_set_executable (char *name
);
99 extern int __gnat_is_symbolic_link (char *name
);
100 extern int __gnat_portable_spawn (char *[]);
101 extern int __gnat_portable_no_block_spawn (char *[]);
102 extern int __gnat_portable_wait (int *);
103 extern char *__gnat_locate_exec (char *, char *);
104 extern char *__gnat_locate_exec_on_path (char *);
105 extern char *__gnat_locate_regular_file (char *, char *);
106 extern void __gnat_maybe_glob_args (int *, char ***);
107 extern void __gnat_os_exit (int);
108 extern char *__gnat_get_libraries_from_registry (void);
109 extern int __gnat_to_canonical_file_list_init (char *, int);
110 extern char *__gnat_to_canonical_file_list_next (void);
111 extern void __gnat_to_canonical_file_list_free (void);
112 extern char *__gnat_to_canonical_dir_spec (char *, int);
113 extern char *__gnat_to_canonical_file_spec (char *);
114 extern char *__gnat_to_host_dir_spec (char *, int);
115 extern char *__gnat_to_host_file_spec (char *);
116 extern char *__gnat_to_canonical_path_spec (char *);
117 extern void __gnat_adjust_os_resource_limits (void);
118 extern void convert_addresses (void *, int,
120 extern int __gnat_copy_attribs (char *, char *, int);
121 extern int __gnat_feof (FILE *);
122 extern int __gnat_ferror (FILE *);
123 extern int __gnat_fileno (FILE *);
124 extern int __gnat_is_regular_file_fd (int);
125 extern FILE *__gnat_constant_stderr (void);
126 extern FILE *__gnat_constant_stdin (void);
127 extern FILE *__gnat_constant_stdout (void);
128 extern char *__gnat_full_name (char *, char *);
130 extern int __gnat_arg_count (void);
131 extern int __gnat_len_arg (int);
132 extern void __gnat_fill_arg (char *, int);
133 extern int __gnat_env_count (void);
134 extern int __gnat_len_env (int);
135 extern void __gnat_fill_env (char *, int);
137 /* Routines for interface to scanf and printf functions for integer values */
139 extern int get_int (void);
140 extern void put_int (int);
141 extern void put_int_stderr (int);
142 extern int get_char (void);
143 extern void put_char (int);
144 extern void put_char_stderr (int);
145 extern char *mktemp (char *);
147 extern void __gnat_set_exit_status (int);
149 extern int __gnat_expect_fork (void);
150 extern void __gnat_expect_portable_execvp (char *, char *[]);
151 extern int __gnat_pipe (int *);
152 extern int __gnat_expect_poll (int *, int, int, int *);
153 extern void __gnat_set_binary_mode (int);
154 extern void __gnat_set_text_mode (int);
155 extern char *__gnat_ttyname (int);
156 extern int __gnat_lseek (int, long, int);
157 extern int __gnat_set_close_on_exec (int, int);
158 extern int __gnat_dup (int);
159 extern int __gnat_dup2 (int, int);
162 extern void __gnat_plist_init (void);
166 /* Portable definition of strdup, which is not available on all systems. */
167 #define xstrdup(S) strcpy ((char *) malloc (strlen (S) + 1), S)
170 /* This function returns the version of GCC being used. Here it's GCC 3. */
171 extern int get_gcc_version (void);
173 extern int __gnat_binder_supports_auto_init (void);
174 extern int __gnat_sals_init_using_constructors (void);