* *
* C Header File *
* *
- * Copyright (C) 1992-2004 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2009, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
- * ware Foundation; either version 2, or (at your option) any later ver- *
+ * ware Foundation; either version 3, or (at your option) any later ver- *
* sion. GNAT is distributed in the hope that it will be useful, but WITH- *
* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
- * for more details. You should have received a copy of the GNU General *
- * Public License distributed with GNAT; see file COPYING. If not, write *
- * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
- * MA 02111-1307, USA. *
+ * or FITNESS FOR A PARTICULAR PURPOSE. *
* *
- * As a special exception, if you link this file with other files to *
- * produce an executable, this file does not by itself cause the resulting *
- * executable to be covered by the GNU General Public License. This except- *
- * ion does not however invalidate any other reasons why the executable *
- * file might be covered by the GNU Public License. *
+ * As a special exception under Section 7 of GPL version 3, you are granted *
+ * additional permissions described in the GCC Runtime Library Exception, *
+ * version 3.1, as published by the Free Software Foundation. *
+ * *
+ * You should have received a copy of the GNU General Public License and *
+ * a copy of the GCC Runtime Library Exception along with this program; *
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see *
+ * <http://www.gnu.org/licenses/>. *
* *
* GNAT was originally developed by the GNAT team at New York University. *
* Extensive contributions were provided by Ada Core Technologies Inc. *
* *
****************************************************************************/
+#include <sys/stat.h>
#include <stdio.h>
+
+#ifdef _WIN32
+#include "mingw32.h"
+#endif
+
#include <dirent.h>
-typedef long OS_Time; /* Type corresponding to GNAT.OS_Lib.OS_Time */
+/* Constants used for the form parameter encoding values */
+#define Encoding_UTF8 0 /* UTF-8 */
+#define Encoding_8bits 1 /* Standard 8bits, CP_ACP on Windows. */
+#define Encoding_Unspecified 2 /* Based on GNAT_CODE_PAGE env variable. */
+
+/* Large file support. It is unclear what portable mechanism we can use to
+ determine at compile time what support the system offers for large files.
+ For now we just list the platforms we have manually tested. */
+
+#if defined (__GLIBC__) || defined (sun) || defined (__sgi)
+#define GNAT_FOPEN fopen64
+#define GNAT_STAT stat64
+#define GNAT_FSTAT fstat64
+#define GNAT_LSTAT lstat64
+#define GNAT_STRUCT_STAT struct stat64
+#else
+#define GNAT_FOPEN fopen
+#define GNAT_STAT stat
+#define GNAT_FSTAT fstat
+#define GNAT_LSTAT lstat
+#define GNAT_STRUCT_STAT struct stat
+#endif
+
+/* Type corresponding to GNAT.OS_Lib.OS_Time */
+#if defined (_WIN64)
+typedef long long OS_Time;
+#else
+typedef long OS_Time;
+#endif
extern int __gnat_max_path_len;
-extern void __gnat_to_gm_time (OS_Time *, int *,
- int *, int *,
- int *, int *,
- int *);
+extern OS_Time __gnat_current_time (void);
+extern void __gnat_current_time_string (char *);
+extern void __gnat_to_gm_time (OS_Time *, int *, int *,
+ int *, int *,
+ int *, int *);
extern int __gnat_get_maximum_file_name_length (void);
extern int __gnat_get_switches_case_sensitive (void);
extern int __gnat_get_file_names_case_sensitive (void);
extern int __gnat_open_new_temp (char *, int);
extern int __gnat_mkdir (char *);
extern int __gnat_stat (char *,
- struct stat *);
+ GNAT_STRUCT_STAT *);
+extern int __gnat_unlink (char *);
+extern int __gnat_rename (char *, char *);
+extern int __gnat_chdir (char *);
+extern int __gnat_rmdir (char *);
+
+extern FILE *__gnat_fopen (char *, char *, int);
+extern FILE *__gnat_freopen (char *, char *, FILE *,
+ int);
extern int __gnat_open_read (char *, int);
extern int __gnat_open_rw (char *, int);
extern int __gnat_open_create (char *, int);
extern long __gnat_file_length (int);
extern long __gnat_named_file_length (char *);
extern void __gnat_tmp_name (char *);
-extern char *__gnat_readdir (DIR *, char *);
+extern DIR *__gnat_opendir (char *);
+extern char *__gnat_readdir (DIR *, char *, int *);
+extern int __gnat_closedir (DIR *);
extern int __gnat_readdir_is_thread_safe (void);
extern OS_Time __gnat_file_time_name (char *);
/* return -1 in case of error */
extern void __gnat_set_file_time_name (char *, time_t);
-extern void __gnat_get_env_value_ptr (char *, int *,
- char **);
+
extern int __gnat_dup (int);
extern int __gnat_dup2 (int, int);
extern int __gnat_file_exists (char *);
extern int __gnat_is_directory (char *);
extern int __gnat_is_writable_file (char *);
extern int __gnat_is_readable_file (char *name);
-extern void __gnat_set_readonly (char *name);
+extern int __gnat_is_executable_file (char *name);
+extern void __gnat_set_non_writable (char *name);
extern void __gnat_set_writable (char *name);
extern void __gnat_set_executable (char *name);
+extern void __gnat_set_readable (char *name);
+extern void __gnat_set_non_readable (char *name);
extern int __gnat_is_symbolic_link (char *name);
extern int __gnat_portable_spawn (char *[]);
extern int __gnat_portable_no_block_spawn (char *[]);
extern int __gnat_portable_wait (int *);
-extern int __gnat_waitpid (int);
extern char *__gnat_locate_exec (char *, char *);
extern char *__gnat_locate_exec_on_path (char *);
extern char *__gnat_locate_regular_file (char *, char *);
extern void __gnat_maybe_glob_args (int *, char ***);
extern void __gnat_os_exit (int);
-extern void __gnat_set_env_value (char *, char *);
extern char *__gnat_get_libraries_from_registry (void);
extern int __gnat_to_canonical_file_list_init (char *, int);
extern char *__gnat_to_canonical_file_list_next (void);
extern char *__gnat_to_host_file_spec (char *);
extern char *__gnat_to_canonical_path_spec (char *);
extern void __gnat_adjust_os_resource_limits (void);
-extern void convert_addresses (void *, int,
+extern void convert_addresses (const char *, void *, int,
void *, int *);
extern int __gnat_copy_attribs (char *, char *, int);
extern int __gnat_feof (FILE *);
extern void __gnat_set_text_mode (int);
extern char *__gnat_ttyname (int);
extern int __gnat_lseek (int, long, int);
+extern int __gnat_set_close_on_exec (int, int);
extern int __gnat_dup (int);
extern int __gnat_dup2 (int, int);
-#ifdef __MINGW32__
-extern void __gnat_plist_init (void);
+extern void __gnat_os_filename (char *, char *, char *,
+ int *, char *, int *);
+#if defined (linux)
+extern void *__gnat_lwp_self (void);
+#endif
+
+#if defined (_WIN32)
+/* Interface to delete a handle from internally maintained list of child
+ process handles on Windows */
+extern void
+__gnat_win32_remove_handle (HANDLE h, int pid);
#endif
#ifdef IN_RTS
#endif
/* This function returns the version of GCC being used. Here it's GCC 3. */
-extern int get_gcc_version (void);
+extern int get_gcc_version (void);
-/* This function offers a hook for libgnarl to set the
- locking subprograms for libgcc_eh. */
-extern void __gnatlib_install_locks (void (*) (void),
- void (*) (void));
+extern int __gnat_binder_supports_auto_init (void);
+extern int __gnat_sals_init_using_constructors (void);