i-cstrea.ads: (fopen): Add encoding parameter.
[official-gcc.git] / gcc / ada / s-crtl-vms64.ads
blobc221d05a3a8e04dd6c36dac1bea4b84dc9503ead
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- S Y S T E M . C R T L --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2004-2006, 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 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. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This package provides the low level interface to the C Run Time Library
35 -- on 64 bit VMS. Note that routines that allocate memory remain 32bit.
37 with System.Parameters;
39 package System.CRTL is
40 pragma Preelaborate;
42 subtype chars is System.Address;
43 -- Pointer to null-terminated array of characters
45 subtype DIRs is System.Address;
46 -- Corresponds to the C type DIR*
48 subtype FILEs is System.Address;
49 -- Corresponds to the C type FILE*
51 subtype int is Integer;
53 type long is range -(2 ** (System.Parameters.long_bits - 1))
54 .. +(2 ** (System.Parameters.long_bits - 1)) - 1;
56 subtype off_t is Integer;
58 type size_t is mod 2 ** Standard'Address_Size;
60 type Filename_Encoding is (UTF8, ASCII_8bits);
61 for Filename_Encoding use (UTF8 => 0, ASCII_8bits => 1);
62 pragma Convention (C, Filename_Encoding);
63 -- Describes the filename's encoding
65 function atoi (A : System.Address) return Integer;
66 pragma Import (C, atoi, "decc$atoi");
68 procedure clearerr (stream : FILEs);
69 pragma Import (C, clearerr, "decc$clearerr");
71 function dup (handle : int) return int;
72 pragma Import (C, dup, "decc$dup");
74 function dup2 (from, to : int) return int;
75 pragma Import (C, dup2, "decc$dup2");
77 function fclose (stream : FILEs) return int;
78 pragma Import (C, fclose, "decc$fclose");
80 function fdopen (handle : int; mode : chars) return FILEs;
81 pragma Import (C, fdopen, "decc$fdopen");
83 function fflush (stream : FILEs) return int;
84 pragma Import (C, fflush, "decc$fflush");
86 function fgetc (stream : FILEs) return int;
87 pragma Import (C, fgetc, "decc$fgetc");
89 function fgets (strng : chars; n : int; stream : FILEs) return chars;
90 pragma Import (C, fgets, "decc$_fgets64");
92 function fopen
93 (filename : chars;
94 mode : chars;
95 encoding : Filename_Encoding := UTF8) return FILEs;
96 pragma Import (C, fopen, "__gnat_fopen");
98 function fputc (C : int; stream : FILEs) return int;
99 pragma Import (C, fputc, "decc$fputc");
101 function fputs (Strng : chars; Stream : FILEs) return int;
102 pragma Import (C, fputs, "decc$fputs");
104 procedure free (Ptr : System.Address);
105 pragma Import (C, free, "decc$free");
107 function freopen
108 (filename : chars;
109 mode : chars;
110 stream : FILEs;
111 encoding : Filename_Encoding := UTF8)
112 return FILEs;
113 pragma Import (C, freopen, "__gnat_freopen");
115 function fseek
116 (stream : FILEs;
117 offset : long;
118 origin : int)
119 return int;
120 pragma Import (C, fseek, "decc$fseek");
122 function ftell (stream : FILEs) return long;
123 pragma Import (C, ftell, "decc$ftell");
125 function getenv (S : String) return System.Address;
126 pragma Import (C, getenv, "decc$getenv");
128 function isatty (handle : int) return int;
129 pragma Import (C, isatty, "decc$isatty");
131 function lseek (fd : int; offset : off_t; direction : int) return off_t;
132 pragma Import (C, lseek, "decc$lseek");
134 function malloc (Size : size_t) return System.Address;
135 pragma Import (C, malloc, "decc$malloc");
137 procedure memcpy (S1 : System.Address; S2 : System.Address; N : size_t);
138 pragma Import (C, memcpy, "decc$_memcpy64");
140 procedure memmove (S1 : System.Address; S2 : System.Address; N : size_t);
141 pragma Import (C, memmove, "decc$_memmove64");
143 procedure mktemp (template : chars);
144 pragma Import (C, mktemp, "decc$_mktemp64");
146 function pclose (stream : System.Address) return int;
147 pragma Import (C, pclose, "decc$pclose");
149 function popen (command, mode : System.Address) return System.Address;
150 pragma Import (C, popen, "decc$popen");
152 function read (fd : int; buffer : chars; nbytes : int) return int;
153 pragma Import (C, read, "decc$read");
155 function realloc
156 (Ptr : System.Address; Size : size_t) return System.Address;
157 pragma Import (C, realloc, "decc$realloc");
159 procedure rewind (stream : FILEs);
160 pragma Import (C, rewind, "decc$rewind");
162 procedure rmdir (dir_name : String);
163 pragma Import (C, rmdir, "decc$rmdir");
165 function setvbuf
166 (stream : FILEs;
167 buffer : chars;
168 mode : int;
169 size : size_t)
170 return int;
171 pragma Import (C, setvbuf, "decc$setvbuf");
173 procedure tmpnam (string : chars);
174 pragma Import (C, tmpnam, "decc$_tmpnam64");
176 function tmpfile return FILEs;
177 pragma Import (C, tmpfile, "decc$tmpfile");
179 function ungetc (c : int; stream : FILEs) return int;
180 pragma Import (C, ungetc, "decc$ungetc");
182 function unlink (filename : chars) return int;
183 pragma Import (C, unlink, "decc$unlink");
185 function write (fd : int; buffer : chars; nbytes : int) return int;
186 pragma Import (C, write, "decc$write");
188 end System.CRTL;