1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 2001 Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 ------------------------------------------------------------------------------
28 -- This package contains the low level, operating system routines used only
29 -- in the GNAT binder for command line processing and file input output.
33 procedure Record_Time_From_Last_Bind
;
34 -- Trigger the computing of the time from the last bind of the same
37 function More_Lib_Files
return Boolean;
38 -- Indicates whether more library information files remain to be processed.
39 -- Returns False right away if no source files, or if all source files
40 -- have been processed.
42 function Next_Main_Lib_File
return File_Name_Type
;
43 -- This function returns the name of the next library info file specified
44 -- on the command line. It is an error to call Next_Main_Lib_File if no
45 -- more library information files exist (i.e. Next_Main_Lib_File may be
46 -- called only if a previous call to More_Lib_Files returned True). This
47 -- name is the simple name, excluding any directory information.
49 function Time_From_Last_Bind
return Nat
;
50 -- This function give an approximate number of minute from the last bind.
51 -- It bases its computation on file stamp and therefore does gibe not
52 -- any meaningful result before the new output binder file is written.
53 -- So it returns Nat'last if:
55 -- - it is the first bind of this specific program
56 -- - Record_Time_From_Last_Bind was not Called first
57 -- - Close_Binder_Output was not called first
59 -- otherwise it returns the number of minutes from the last bind. The
60 -- computation does not try to be completely accurate and in particular
61 -- does not take leap years into account.
67 -- These routines are used by the binder to generate the C source file
68 -- containing the binder output. The format of this file is described
69 -- in the package Bindfmt.
71 procedure Create_Binder_Output
72 (Output_File_Name
: String;
75 -- Creates the binder output file. Typ is one of
77 -- 'c' create output file for case of generating C
78 -- 'b' create body file for case of generating Ada
79 -- 's' create spec file for case of generating Ada
81 -- If Output_File_Name is null, then a default name is used based on
82 -- the name of the most recently accessed main source file name. If
83 -- Output_File_Name is non-null then it is the full path name of the
84 -- file to be output (in the case of Ada, it must have an extension
85 -- of adb, and the spec file is created by changing the last character
86 -- from b to s. On return, Bfile also contains the Name_Id for the
87 -- generated file name.
89 procedure Write_Binder_Info
(Info
: String);
90 -- Writes the contents of the referenced string to the binder output file
91 -- created by a previous call to Create_Binder_Output. Info represents a
92 -- single line in the file, but does not contain any line termination
93 -- characters. The implementation of Write_Binder_Info is responsible
94 -- for adding necessary end of line and end of file control characters
95 -- as required by the operating system.
97 procedure Close_Binder_Output
;
98 -- Closes the file created by Create_Binder_Output, flushing any
99 -- buffers etc from writes by Write_Binder_Info.