* adadecode.c (ostrcpy): New function. (__gnat_decode): Use ostrcpy of strcpy. (has_prefix): Set first parameter a const. (has_suffix): Set first parameter a const. Update copyright notice. Fix source name in header. Removes a trailing space. PR ada/12014. * exp_disp.adb: Remove the test against being in No_Run_Time_Mode before generating a call to Register_Tag. It is redundant with the test against the availability of the function Register_Tag. * g-catiio.adb: (Month_Name): Correct spelling of February * make.adb: (Mains): New package (Initialize): Call Mains.Delete (Gnatmake): Check that each main on the command line is a source of a project file and, if there are several mains, each of them is a source of the same project file. (Gnatmake): When a foreign language is specified in attribute Languages, no main is specified on the command line and attribute Mains is not empty, only build the Ada main. If there is no Ada main, just compile the Ada sources and their closure. (Gnatmake): If a main is specified on the command line with directory information, check that the source exists and, if it does, that the path is the actual path of a source of a project. * prj-env.adb: (File_Name_Of_Library_Unit_Body): New Boolean parameter Full_Path. When Full_Path is True, return the full path instead of the simple file name. (Project_Of): New function * prj-env.ads: (File_Name_Of_Library_Unit_Body): New Boolean parameter Full_Path, defaulted to False. (Project_Of): New function * Makefile.generic: Ensure objects of main project are always checked and rebuilt if needed. Set CC to gcc by default. Prepare new handling of link by creating a global archive (not activated yet). * adadecode.h, atree.h, elists.h, nlists.h, raise.h, stringt.h: Update copyright notice. Remove trailing blanks. Fix source name in header. * sem_ch12.adb: Minor reformatting * sem_ch3.adb: Minor reformatting (including new function return style throughout) * sem_ch3.ads: Minor reformatting (including new function return style throughout) * Make-lang.in: Makefile automatically updated From-SVN: r72893
99 lines
3.6 KiB
C
99 lines
3.6 KiB
C
/****************************************************************************
|
|
* *
|
|
* GNAT COMPILER COMPONENTS *
|
|
* *
|
|
* E L I S T S *
|
|
* *
|
|
* C Header File *
|
|
* *
|
|
* Copyright (C) 1992-2003 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- *
|
|
* 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. *
|
|
* *
|
|
* GNAT was originally developed by the GNAT team at New York University. *
|
|
* Extensive contributions were provided by Ada Core Technologies Inc. *
|
|
* *
|
|
****************************************************************************/
|
|
|
|
/* This is the C header corresponding to the Ada package specification for
|
|
Elists. It also contains the implementations of inlined functions from the
|
|
package body for Elists. It was generated manually from elists.ads and
|
|
elists.adb and must be kept synchronized with changes in these files.
|
|
|
|
Note that only routines for reading the tree are included, since the
|
|
tree transformer is not supposed to modify the tree in any way. */
|
|
|
|
/* The following are the structures used to hold element lists */
|
|
|
|
struct Elist_Header
|
|
{
|
|
Elmt_Id first;
|
|
Elmt_Id last;
|
|
};
|
|
|
|
struct Elmt_Item
|
|
{
|
|
Node_Id node;
|
|
Int next;
|
|
};
|
|
|
|
/* The element list headers and element descriptors themselves are stored in
|
|
two arrays. The pointers to these arrays are passed as a parameter to the
|
|
tree transformer procedure and stored in the global variables Elists_Ptr
|
|
and Elmts_Ptr. */
|
|
|
|
extern struct Elist_Header *Elists_Ptr;
|
|
extern struct Elmt_Item *Elmts_Ptr;
|
|
|
|
/* Element List Access Functions: */
|
|
|
|
static Node_Id Node (Elmt_Id);
|
|
static Elmt_Id First_Elmt (Elist_Id);
|
|
static Elmt_Id Last_Elmt (Elist_Id);
|
|
static Elmt_Id Next_Elmt (Elmt_Id);
|
|
static Boolean Is_Empty_Elmt_List (Elist_Id);
|
|
|
|
INLINE Node_Id
|
|
Node (Elmt_Id Elmt)
|
|
{
|
|
return Elmts_Ptr[Elmt - First_Elmt_Id].node;
|
|
}
|
|
|
|
INLINE Elmt_Id
|
|
First_Elmt (Elist_Id List)
|
|
{
|
|
return Elists_Ptr[List - First_Elist_Id].first;
|
|
}
|
|
|
|
INLINE Elmt_Id
|
|
Last_Elmt (Elist_Id List)
|
|
{
|
|
return Elists_Ptr[List - First_Elist_Id].last;
|
|
}
|
|
|
|
INLINE Elmt_Id
|
|
Next_Elmt (Elmt_Id Node)
|
|
{
|
|
Int N = Elmts_Ptr[Node - First_Elmt_Id].next;
|
|
|
|
if (IN (N, Elist_Range))
|
|
return No_Elmt;
|
|
else
|
|
return N;
|
|
}
|
|
|
|
INLINE Boolean
|
|
Is_Empty_Elmt_List (Elist_Id Id)
|
|
{
|
|
return Elists_Ptr[Id - First_Elist_Id].first == No_Elmt;
|
|
}
|