1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
11 * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
13 * GNAT is free software; you can redistribute it and/or modify it under *
14 * terms of the GNU General Public License as published by the Free Soft- *
15 * ware Foundation; either version 2, or (at your option) any later ver- *
16 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
17 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
19 * for more details. You should have received a copy of the GNU General *
20 * Public License distributed with GNAT; see file COPYING. If not, write *
21 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
22 * MA 02111-1307, USA. *
24 * As a special exception, if you link this file with other files to *
25 * produce an executable, this file does not by itself cause the resulting *
26 * executable to be covered by the GNU General Public License. This except- *
27 * ion does not however invalidate any other reasons why the executable *
28 * file might be covered by the GNU Public License. *
30 * GNAT was originally developed by the GNAT team at New York University. *
31 * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
33 ****************************************************************************/
37 extern void __gnat_to_gm_time PARAMS ((time_t *, int *,
41 extern int __gnat_get_maximum_file_name_length PARAMS ((void));
42 extern char __gnat_get_switch_character PARAMS ((void));
43 extern int __gnat_get_switches_case_sensitive PARAMS ((void));
44 extern int __gnat_get_file_names_case_sensitive PARAMS ((void));
45 extern char __gnat_get_default_identifier_character_set PARAMS ((void));
46 extern void __gnat_get_current_dir PARAMS ((char *, int *));
47 extern void __gnat_get_object_suffix_ptr PARAMS ((int *,
49 extern void __gnat_get_executable_suffix_ptr PARAMS ((int *,
51 extern void __gnat_get_debuggable_suffix_ptr PARAMS ((int *,
53 extern int __gnat_readlink PARAMS ((char *, char *,
55 extern int __gnat_symlink PARAMS ((char *, char *));
56 extern int __gnat_try_lock PARAMS ((char *, char *));
57 extern int __gnat_open_new PARAMS ((char *, int));
58 extern int __gnat_open_new_temp PARAMS ((char *, int));
59 extern int __gnat_mkdir PARAMS ((char *));
60 extern int __gnat_stat PARAMS ((char *,
62 extern int __gnat_open_read PARAMS ((char *, int));
63 extern int __gnat_open_rw PARAMS ((char *, int));
64 extern int __gnat_open_create PARAMS ((char *, int));
65 extern int __gnat_open_append PARAMS ((char *, int));
66 extern long __gnat_file_length PARAMS ((int));
67 extern void __gnat_tmp_name PARAMS ((char *));
68 extern char *__gnat_readdir PARAMS ((DIR *, char *));
69 extern int __gnat_readdir_is_thread_safe PARAMS ((void));
70 extern time_t __gnat_file_time_name PARAMS ((char *));
71 extern time_t __gnat_file_time_fd PARAMS ((int));
72 extern void __gnat_set_file_time_name PARAMS ((char *, time_t));
73 extern void __gnat_get_env_value_ptr PARAMS ((char *, int *,
75 extern int __gnat_file_exists PARAMS ((char *));
76 extern int __gnat_is_regular_file PARAMS ((char *));
77 extern int __gnat_is_absolute_path PARAMS ((char *));
78 extern int __gnat_is_directory PARAMS ((char *));
79 extern int __gnat_is_writable_file PARAMS ((char *));
80 extern int __gnat_portable_spawn PARAMS ((char *[]));
81 extern int __gnat_portable_no_block_spawn PARAMS ((char *[]));
82 extern int __gnat_portable_wait PARAMS ((int *));
83 extern char *__gnat_locate_exec PARAMS ((char *, char *));
84 extern char *__gnat_locate_exec_on_path PARAMS ((char *));
85 extern char *__gnat_locate_regular_file PARAMS ((char *, char *));
86 extern void __gnat_maybe_glob_args PARAMS ((int *, char ***));
87 extern void __gnat_os_exit PARAMS ((int));
88 extern void __gnat_set_env_value PARAMS ((char *, char *));
89 extern char *__gnat_get_libraries_from_registry PARAMS ((void));
90 extern int __gnat_to_canonical_file_list_init PARAMS ((char *, int));
91 extern char *__gnat_to_canonical_file_list_next PARAMS ((void));
92 extern void __gnat_to_canonical_file_list_free PARAMS ((void));
93 extern char *__gnat_to_canonical_dir_spec PARAMS ((char *, int));
94 extern char *__gnat_to_canonical_file_spec PARAMS ((char *));
95 extern char *__gnat_to_host_dir_spec PARAMS ((char *, int));
96 extern char *__gnat_to_host_file_spec PARAMS ((char *));
97 extern char *__gnat_to_canonical_path_spec PARAMS ((char *));
98 extern void __gnat_adjust_os_resource_limits PARAMS ((void));
100 extern int __gnat_feof PARAMS ((FILE *));
101 extern int __gnat_ferror PARAMS ((FILE *));
102 extern int __gnat_fileno PARAMS ((FILE *));
103 extern int __gnat_is_regular_file_fd PARAMS ((int));
104 extern FILE *__gnat_constant_stderr PARAMS ((void));
105 extern FILE *__gnat_constant_stdin PARAMS ((void));
106 extern FILE *__gnat_constant_stdout PARAMS ((void));
107 extern char *__gnat_full_name PARAMS ((char *, char *));
109 extern int __gnat_arg_count PARAMS ((void));
110 extern int __gnat_len_arg PARAMS ((int));
111 extern void __gnat_fill_arg PARAMS ((char *, int));
112 extern int __gnat_env_count PARAMS ((void));
113 extern int __gnat_len_env PARAMS ((int));
114 extern void __gnat_fill_env PARAMS ((char *, int));
116 /* Routines for interface to scanf and printf functions for integer values */
118 extern int get_int PARAMS ((void));
119 extern void put_int PARAMS ((int));
120 extern void put_int_stderr PARAMS ((int));
121 extern int get_char PARAMS ((void));
122 extern void put_char PARAMS ((int));
123 extern void put_char_stderr PARAMS ((int));
124 extern char *mktemp PARAMS ((char *));
126 extern void __gnat_set_exit_status PARAMS ((int));
128 extern int __gnat_expect_fork PARAMS ((void));
129 extern void __gnat_expect_portable_execvp PARAMS ((char *, char *[]));
130 extern int __gnat_pipe PARAMS ((int *));
131 extern int __gnat_expect_poll PARAMS ((int *, int, int,
133 extern void __gnat_set_binary_mode PARAMS ((int));
134 extern void __gnat_set_text_mode PARAMS ((int));
135 extern char *__gnat_ttyname PARAMS ((int));
138 /* Portable definition of strdup, which is not available on all systems. */
139 #define xstrdup(S) strcpy ((char *) malloc (strlen (S) + 1), S)