This commit is contained in:
Ludovic Jacomme 2002-03-29 17:43:39 +00:00
parent 4a56cf6149
commit 73610c5e24
868 changed files with 238219 additions and 0 deletions

View File

@ -0,0 +1 @@
SUBDIRS = src man1

View File

@ -0,0 +1,48 @@
dnl
/*
dnl This file is part of the Alliance CAD System
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
dnl Universite Pierre et Marie Curie
dnl
dnl Home page : http://www-asim.lip6.fr/alliance/
dnl E-mail support : mailto:alliance-support@asim.lip6.fr
dnl
dnl This library is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU Library General Public License as published
dnl by the Free Software Foundation; either version 2 of the License, or (at
dnl your option) any later version.
dnl
dnl Alliance VLSI CAD System is distributed in the hope that it will be
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Purpose : Auto stuffing Alliance
dnl Almost ten years since I wrote this stuff, I just can't
dnl believe it
dnl Date : 01/02/2002
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
dnl $Id: configure.in,v 1.1 2002/03/29 17:39:32 ludo Exp $
dnl
dnl
AC_INIT(src/vrd.h)
AM_INIT_AUTOMAKE(vrd, 3.4)
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LEX
AC_HEADER_STDC
AC_C_CONST
AC_PROG_RANLIB
AM_ALLIANCE
AC_OUTPUT([
Makefile
src/Makefile
man1/Makefile
])

View File

@ -0,0 +1,2 @@
man_MANS = druc.1
EXTRA_DIST = $(man_MANS)

View File

@ -0,0 +1,519 @@
.\" $Id: druc.1,v 1.1 2002/03/29 17:39:32 ludo Exp $
.\" @(#)Labo.l 1.2 93/12/08 UPMC; Author: Patrick RENNAUD
.pl -.4
.TH DRUC 1 "October 1, 1997" "ASIM/LIP6" "CAO\-VLSI Reference Manual"
.SH NAME
DRuC - Design Rule Checker
.so man1/alc_origin.1
.SH SYNOPSIS
.TP
\fBdruc\fP \<\fIroot_name\fP\>
.br
.br
.br
.br
.SH DESCRIPTION
.br
\fBDRuC\fP is a general parametrized VLSI design rule checker.
.br
This tool replace the \fBVERSATIL\fP tool that is not anymore supported.
.br
This manual presents the layout rules for tle \fBALLIANCE\fP symbolic layout approach.
The rules are described in a technology file defined by the environment variable \fB RDS_TECHNO_NAME\fP (see bellow).
.br
The root cell and all the instanciated cells (except the intanciated libraries cells) must be in the current directory.
.br
The default mode of \fBDRuC\fP is (currently) full flat:
it first flatten all the hierarchy in order to obtain a flat, rectangle level description.
.br
.fi
.ft R
.bp
\fBO: LAYER NAME.\fP
.br
This section explicits the layer name used in the following rules.
.br
.br
.nf
.ie t \{\
.ft CR \}
.el \{\
.ft B\}
- NWELL : N well
.br
- NTIE : N well polarisation
.br
- PTIE : P substrat polarisation
.br
- NDIF : N diffusion
.br
- PDIF : P diffusion
.br
- GATE : transistor gate
.br
- POLY : polysilicon wire
.br
- ALU1 : first level of metal
.br
- ALU2 : second level of metal
.br
- CONT : contact between ALU1 and POLY or DIFF
.br
- VIA : contact between ALU1 and ALU2
.br
.fi
.ft R
.bp
\fBI: LAYER WIDTH.\fP
.br
This class of rules deals with the width limits of a layer.
and the conditions for equipotentiality between
two overlapping or abutting segments.
.br
.br
.nf
.ie t \{\
.ft CR \}
.el \{\
.ft B\}
rule 1 :
the minimum width for a segment of NWELL is 4
corresponding error codes are : 100 101
.br
rule 2 :
the minimum width for a segment of NTIE is 2
corresponding error code is : 119
.br
rule 3 :
the minimum width for a segment of PTIE is 2
corresponding error codes are : 122 123
.br
rule 4 :
the minimum width for a segment of NDIF is 2
corresponding error codes are : 140 141
.br
rule 5 :
the minimum width for a segment of PDIF is 2
corresponding error codes are : 165 166
.br
rule 6 :
the minimum width for a segment of GATE is 1
corresponding error codes are : 234 235
.br
rule 7 :
the minimum width for a segment of POLY is 1
corresponding error codes are : 234 235
.br
rule 8 :
the minimum width for a segment of ALU1 is 1
corresponding error codes are : 238 239
.br
rule 9 :
the minimum width for a segment of ALU2 is 2
corresponding error codes are : 242 243
.br
rule 10 :
the width of a CONT must be equal to 1
corresponding error codes are : 246 247
.br
rule 11 :
the width of a VIA must be equal to 1
corresponding error codes are : 261 262
.br
.fi
.ft R
.bp
\fBII: FORBIDDEN OVERLAP\fP
.br
This class of rules specifies the forbidden overlaps between two layers. (The distance between them must be strictly positive)
.br
.br
.nf
.ie t \{\
.ft CR \}
.el \{\
.ft B\}
.br
rule 12 :
contact between PTIE and NWELL is forbidden.
corresponding error codes are : 126 127 128 129 130 131
.br
rule 13 :
contact between PTIE and NTIE is forbidden.
corresponding error codes are : 133 134 135 136 137 138
.br
rule 14 :
contact between NDIF and NWELL is forbidden.
corresponding error codes are : 144 145 146 147 148 149
.br
rule 15 :
contact between NDIF and NTIE is forbidden.
corresponding error codes are : 151 152 153 154 155 156
.br
rule 16 :
contact between NDIF and PTIE is forbidden.
corresponding error codes are : 158 159 160 161 162 163
.br
rule 17 :
contact between PDIF and NTIE is forbidden.
corresponding error codes are : 169 170 171 172 173 174
.br
rule 18 :
contact between PDIF and PTIE is forbidden.
corresponding error codes are : 176 177 178 179 180 181
.br
rule 19 :
contact between PDIF and NDIF is forbidden.
corresponding error codes are : 183 184 185 186 187 188
.br
rule 20 :
contact between GATE and NTIE is forbidden.
corresponding error codes are : 191 192 193 194 195 196
.br
rule 21 :
contact between GATE and PTIE is forbidden.
corresponding error codes are : 198 199 200 201 202 203
.br
rule 22 :
contact between POLY and NTIE is forbidden.
corresponding error codes are : 207 208 209 210 211 212
.br
rule 23 :
contact between POLY and PTIE is forbidden.
corresponding error codes are : 214 215 216 217 218 219
.br
rule 24 :
contact between POLY and NDIF is forbidden.
corresponding error codes are : 221 222 223 224 225 226
.br
rule 25 :
contact between POLY and PDIF is forbidden.
corresponding error codes are : 228 229 230 231 232 233
.bp
.br
rule 26 :
contact between CONT and GATE or POLY is forbidden.
corresponding error codes are : 249 250 251 252 253
.br
rule 27 :
contact between VIA and GATE is forbidden.
corresponding error codes are : 264 265 266 267 268 269
.br
rule 28 :
contact between VIA and POLY is forbidden.
corresponding error codes are : 271 272 273 274 275 276
.br
rule 29 :
contact between VIA and CONT is forbidden.
corresponding error codes are : 278 279 280 281 282 283
.br
rule 30 :
contact between NTIE and NWELL is forbidden.
corresponding error code is : 109
.br
rule 31 :
contact between PDIF and NWELL is forbidden.
corresponding error code is : 117
.br
.fi
.ft R
.bp
\fBIII: LAYER NOTCH.\fP
.br
This class of rules deals with the notch limits of a layer.
.br
.br
.nf
.ie t \{\
.ft CR \}
.el \{\
.ft B\}
.br
rule 32 :
the minimum notch for a segment of NWELL is 4
corresponding error code is : 102
.br
rule 33 :
the minimum notch for a segment of NTIE is 2
corresponding error code is : 120
.br
rule 34 :
the minimum notch for a segment of PTIE is 2
corresponding error code is : 124
.br
rule 35 :
the minimum notch for a segment of NDIF is 2
corresponding error code is : 142
.br
rule 36 :
the minimum notch for a segment of PDIF is 2
corresponding error code is : 167
.br
rule 37 :
the minimum notch for a segment of POLY is 1
corresponding error code is : 236
.br
rule 38 :
the minimum notch for a segment of ALU1 is 2.5
corresponding error code is : 240
.br
rule 39 :
the minimum notch for a segment of ALU2 is 2
corresponding error code is : 244
.br
.fi
.ft R
.bp
\fBIV: MINIMUM SPACING\fP
.br
This class of rules specifies the minimum edge-to-edge distance allowed between
two layers.
.br
.nf
.ie t \{\
.ft CR \}
.el \{\
.ft B\}
rule 40 :
the minimum distance between NWELL and NWELL is 12
corresponding error code is : 118
.br
rule 42 :
the minimum distance between NTIE and NTIE is 3
corresponding error code is : 121
.br
rule 43 :
the minimum distance between PTIE and NWELL is 7.5
corresponding error code is : 125
.br
rule 44 :
the minimum distance between PTIE and NTIE is 8
corresponding error code is : 132
.br
rule 45 :
the minimum distance between PTIE and PTIE is 3
corresponding error code is : 139
.br
rule 46 :
the minimum distance between NDIF and NWELL is 7.5
corresponding error code is : 143
.br
rule 47 :
the minimum distance between NDIF and NTIE is 8
corresponding error code is : 150
.br
rule 48 :
the minimum distance between NDIF and PTIE is 3
corresponding error code is : 157
.br
rule 49 :
the minimum distance between NDIF and NDIF is 3
corresponding error code is : 164
.br
rule 51 :
the minimum distance between PDIF and NTIE is 3
corresponding error code is : 168
.br
rule 52 :
the minimum distance between PDIF and PTIE is 8
corresponding error code is : 175
.br
rule 53 :
the minimum distance between PDIF and NDIF is 8
corresponding error code is : 182
.br
rule 54 :
the minimum distance between PDIF and PDIF is 3
corresponding error code is : 189
.br
rule 55 :
the minimum distance between GATE and NTIE is 1
corresponding error code is : 190
.br
rule 56 :
the minimum distance between GATE and PTIE is 1
corresponding error code is : 197
.br
rule 57 :
the minimum distance between GATE and NDIF is 1
corresponding error code is : 204
.br
rule 58 :
the minimum distance between GATE and PDIF is 1
corresponding error code is : 205
.br
rule 59 :
the minimum distance between GATE and GATE is 2
corresponding error code is : 237
.br
rule 60 :
the minimum distance between POLY and NTIE is 1
corresponding error code is : 206
.br
rule 61 :
the minimum distance between POLY and PTIE is 1
corresponding error code is : 213
.br
rule 62 :
the minimum distance between POLY and NDIF is 1
corresponding error code is : 220
.br
rule 63 :
the minimum distance between POLY and PDIF is 1
corresponding error code is : 227
.br
rule 64 :
the minimum distance between POLY and GATE is 2
corresponding error code is : 237
.br
rule 65 :
the minimum distance between POLY and POLY is 2
corresponding error code is : 237
.br
rule 66 :
the minimum distance between ALU1 and ALU1 is 2.5
corresponding error code is : 241
.br
rule 67 :
the minimum distance between ALU2 and ALU2 is 2
corresponding error code is : 245
.br
rule 68 :
the minimum distance between CONT and CONT is 3
corresponding error code is : 254
.br
.br
rule 69 :
the minimum distance between VIA and GATE is 2
corresponding error code is : 263
.br
rule 70 :
the minimum distance between VIA and POLY is 2
corresponding error code is : 270
.br
rule 71 :
the minimum distance between VIA and CONT is 2
corresponding error code is : 277
.br
rule 72 :
the minimum distance between VIA and VIA is 3
corresponding error code is : 284
.br
rule 73 :
the minimum distance between CONT and GATE or POLY is 1.5
corresponding error code is : 248
.br
.fi
.ft R
.bp
\fBV: TOTAL INCLUSION.\fP
.br
The last class of rules deals with the inclusion of a layer in another one.
.br
.br
.nf
.ie t \{\
.ft CR \}
.el \{\
.ft B\}
rule 74 :
NTIE must be included in NWELL with a minimun margin of 0.5
corresponding error code is : 103
.br
rule 75 :
PDIF must be included in NWELL with a minimun margin of 0.5
corresponding error code is : 110
.br
.br
.fi
.ft R
.SH OPTIONS
.br
No optons are currently avalable.
.br
.SH FILES
.br
If design errors are found, \fBDRuC\fP produces the list of them in two files :
.br
.IP
- \<\fIroot_name.drc\fP\>:
.br
This ascii file contains the list of DRC violations.
.br
- \<\fIroot_name.iii\fP\>:
.br
This \fBgds\fP ro \fBcif\fp file contains only rectangles detected in violation.
.br
( suffix iii is defined with the environment )
.br
\fIRDS_OUT_PH\fP is default setted to gds.
.br
.SH ENVIRONMENT VARIABLES
.br
\fBDRuC\fP uses several environment variables:
.ti 8
- MBK_IN_PH - defines the layout input format.
.br
.ti 8
- RDS_OUT_PH - defines the layout output format.
.br
.ti 8
- RDS_TECHNO_NAME - defines the technology file.
.br
.ti 8
- MBK_CATA_LIB - defines the catalog directory.
.HP
See the corresponding manual pages for further informations.
.SH EXAMPLE
druc register
.br
.so man1/alc_bug_report.1

View File

@ -0,0 +1,28 @@
lib_LIBRARIES = libVrd.a
include_HEADERS = vrd.h
libVrd_a_SOURCES = drucompi_l.l drucompi_y.y \
defdefin.c defdefin.h defexclu.c defexclu.h definclu.c definclu.h definter.c \
definter.h defresiz.c defresiz.h deftools.c deftools.h defunion.c defunion.h \
drucgral.c drucgral.h druchier.c druchier.h drucmin.c drucmin.h drucompi.c \
drucompi.h drucring.c drucring.h drucutil.c drucutil.h vmcaract.c vmcaract.h \
vmcasmld.c vmcasmld.h vmcerror.c vmcerror.h vmcmesur.c vmcmesur.h vmcrelat.c \
vmcrelat.h vmctools.c vmctools.h vmcunify.c vmcunify.h
CLEANFILES = drucompi_l.c drucompi_y.h drucompi_y.c
drucompi_y.c drucompi_y.h : $(srcdir)/drucompi_y.y
$(YACC) -d $(YFLAGS) $(srcdir)/drucompi_y.y && sed -e "s/yy/vrd_y_/g" -e "s/YY/VRD_Y_/g" y.tab.c > drucompi_y.c && sed -e "s/yy/vrd_y_/g" -e "s/YY/VRD_Y_/g" y.tab.h > drucompi_y.h
drucompi_l.c : $(srcdir)/drucompi_l.l drucompi_y.h
$(LEX) -t $(srcdir)/drucompi_l.l | sed -e "s/yy/vrd_y_/g" -e "s/YY/VRD_Y_/g" > drucompi_l.c
bin_PROGRAMS = druc
CFLAGS = @CFLAGS@ -DBOOM_VERSION=\"@BOOM_VERSION@\"
druc_LDADD = @LIBS@ \
-L. -lVrd -lRtl -lRgs -lRcf -lRfm -lRpr -lRwi -lRut -lRds -lMpu -lMcp -lMap -lMmg -lMph \
-lMut -lm
druc_SOURCES = \
drucbath.c drucbath.h

View File

@ -0,0 +1,317 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFDEFIN.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
#include "defunion.h"
#include "definter.h"
#include "defexclu.h"
#include "definclu.h"
#include "defresiz.h"
#include "defdefin.h"
/*------------------------------------------------------------\
| |
| DefDefin Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefine |
| Definit un layer temporaire caracterise par les parametres |
| contenus dans la StructInstruction pointee par son numero |
| puis chaine le layer en equipotentielles |
\------------------------------------------------------------*/
void DrucDefine ( DrucFigureRds,
DrucRdsWindow ,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
/*\
* DrucViewInstruction ( DrucInstructionCourante );
\*/
switch ( DrucInstructionCourante->OP_COMPOSE )
{
case DRUC_COMPOSE_UNION :
{
DrucDefineUnion ( DrucFigureRds,
DrucRdsWindow ,
DrucInstructionCourante
);
break;
}
case DRUC_COMPOSE_INTERSECT :
{
DrucDefineIntersection ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
);
break;
}
case DRUC_COMPOSE_EXCLUSION :
{
DrucDefineExclusion ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
);
/*\
DrucViewString ("\nfin EXCLUSION\n");
viewrdsfig ( DrucFigureRds
);
DrucViewString ("\n");
\*/
break;
}
case DRUC_COMPOSE_RESIZE :
{
DrucDefineResize ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
);
/*\
DrucViewString ("\nfin RESIZE\n");
viewrdsfig ( DrucFigureRds
);
DrucViewString ("\n");
saverdsfig ( DrucFigureRds );
\*/
break;
}
case DRUC_COMPOSE_INCLUSION :
{
DrucDefineInclusion ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
);
/*\
DrucViewString ("\nfin INCLUSION\n");
viewrdsfig ( DrucFigureRds
);
DrucViewString ("\n");
\*/
break;
}
}/* switch */
DrucComputeEquiLayer ( DrucFigureRds ,
DrucInstructionCourante->LAYER_DEST
);
/*\
DrucViewString (" DEFINE: COMPUTE EQUI AVANT UNIFICATION \n"
);
DrucVerifEquiLayer ( DrucFigureRds,
DrucInstructionCourante->LAYER_DEST
);
DrucViewString (" DEFINE: FIN COMPUTE EQUI AVANT UNIFICATION \n"
);
\*/
/*\
* Patrick le 22/03/94 la largeur min d'un layer construit ne peut pas etre
* le max des largeurs des layers sources. Il pourrait etre le min des 2
* mais en cas d,intersection on pourrait avoir des rectangles de taille
* inferieure
* L'unificateur supprime tous les rectangles de taille inf au min donc on met 0
*
* DrucStructRdsLayer [ DrucInstructionCourante->LAYER_DEST ].WIDTH =
* ( DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].WIDTH >
* DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].WIDTH ?
* DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].WIDTH :
* DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].WIDTH
* );
\*/
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_DEST ].WIDTH = 0;
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_DEST ].CTM =
( DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].CTM >
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].CTM ?
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].CTM :
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].CTM
);
DrucUnifyLayer ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante->LAYER_DEST
);
DrucDestroyLayerWindow ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante->LAYER_DEST
);
DrucBuiltLayerWindow ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante->LAYER_DEST
);
/*\
* On reconstruit les equi car l'unificateur a modifie les rectangles
* il en a modifie, detruit et cree
\*/
DrucComputeEquiLayer ( DrucFigureRds ,
DrucInstructionCourante->LAYER_DEST
);
/*\
viewrdsfig ( DrucFigureRds
);
DrucViewString ("\nDEFINE: FIN COMPUTE EQUI APRES UNIFICATION \n");
DrucViewString (" DEFINE: COMPUTE EQUI APRES UNIFICATION \n"
);
DrucViewString ( RDS_LAYER_NAME[DrucInstructionCourante->LAYER_1]
);
DrucViewString (": c'est le Layer source \n");
DrucViewString ( RDS_LAYER_NAME[DrucInstructionCourante->LAYER_2]
);
DrucViewString (": c'est le Layer source \n");
DrucVerifEquiLayer ( DrucFigureRds,
DrucInstructionCourante->LAYER_DEST
);
DrucViewString (" DEFINE: FIN COMPUTE EQUI APRES UNIFICATION \n");
\*/
}
/*------------------------------------------------------------\
| |
| DrucUndefine |
| Detruit le layer temporaire caracterise par les parametres |
| contenus dans la StructInstruction pointee par son numero |
| on parcourt tous les rectangles du layer defini dans la |
| fenetre et on les remet dans le tas gere par rdswin |
\------------------------------------------------------------*/
void DrucUndefine ( DrucFigureRds ,
DrucRdsWindow,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
register rdsrec_list *TmpRectangleDest;
register rdsrec_list *TmpRectangleSuivant;
DrucTypeStructPlusRect *TmpPlusRec;
DrucTypeStructPlusRect *TmpPlusRecSuivant;
/*\
* detruire la window associee au layer
\*/
for ( TmpRectangleDest = DrucFigureRds->LAYERTAB[ DrucInstructionCourante->LAYER_1 ];
TmpRectangleDest != (rdsrec_list *)NULL;
TmpRectangleDest = TmpRectangleDest->NEXT
)
{
delrdsrecwindow ( TmpRectangleDest,
DrucRdsWindow
);
}
/*\
* detruire les rectangles du layer
\*/
TmpRectangleDest = DrucFigureRds->LAYERTAB[ DrucInstructionCourante->LAYER_1 ];
while ( TmpRectangleDest != (rdsrec_list *)NULL
)
{
if ( MACRO_NEXT_DEFINE ( TmpRectangleDest ) != ( DrucTypeStructPlusRect *)NULL
)
{
/*\
* destruction des StructPlusRect du rectangle scourant
\*/
TmpPlusRec = MACRO_NEXT_DEFINE ( TmpRectangleDest );
while ( TmpPlusRec != ( DrucTypeStructPlusRect *)NULL
)
{
TmpPlusRecSuivant = TmpPlusRec->NEXT_DEFINE;
rdsfreeheap ( TmpPlusRec ,
MACRO_PLUS_TAILLE
);
TmpPlusRec = TmpPlusRecSuivant;
}
}
TmpRectangleSuivant = TmpRectangleDest->NEXT;
/*\
* destruction du rectangle courant dans la fenetre
\*/
delrdsrecwindow ( TmpRectangleDest,
DrucRdsWindow
);
/*\
* destruction du rectangle courant dans la figure
\*/
freerdsrec ( TmpRectangleDest,
sizeof ( DrucTypeStructPlusRect )
);
TmpRectangleDest = TmpRectangleSuivant;
}
DrucFigureRds->LAYERTAB[ DrucInstructionCourante->LAYER_1 ] =
(rdsrec_list *)NULL;
}
/*
* algo de NotInclus:
*
* Pour tout rectangle a
* si a n,est pas marque
* alors
* Pour tout rectangle b
* si a est entierement inclus dans b
* alors
* je le marque
* fsi
* fpour b
* fsi
* si a n'est pas marque
* alors
* je le met dans le layer utilisateur
* fpour a
*/
/*------------------------------------------------------------\
| |
| VMCDEFIN MODIFS |
| |
| PATRICK 22/03/94: ligne 739 |
| mise a 0 du with min des layers construits |
| |
| |
\------------------------------------------------------------*/

View File

@ -0,0 +1,35 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFDEFIN.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DefDefin Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefine |
| Definit un layer temporaire caracterise par les parametres |
| contenus dans la StructInstruction pointee par son numero |
| puis chaine le layer en equipotentielles |
\------------------------------------------------------------*/
extern void DrucDefine ();
/*------------------------------------------------------------\
| |
| DrucUndefine |
| Detruit le layer temporaire caracterise par les parametres |
| contenus dans la StructInstruction pointee par son numero |
| on parcourt tous les rectangles du layer defini dans la |
| fenetre et on les remet dans le tas gere par rdswin |
\------------------------------------------------------------*/
extern void DrucUndefine ();

View File

@ -0,0 +1,152 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFEXCLU.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
#include "defexclu.h"
/*------------------------------------------------------------\
| |
| DefExclu Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineExclusion |
| Definit un layer temporaire caracterise par l'operateur |
| contenu dans l'instruction ayant les deux layers source |
| comme operandes |
| range le resultat dans le tableau des layers userdefini par |
| l'instruction |
\------------------------------------------------------------*/
void DrucDefineExclusion ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
chain_list *PtChaine;
rdsrec_list *TmpRectangleSource;
rdswin_list *TmpWindowSource2;
long UnaireX;
long UnaireDX;
long UnaireY;
long UnaireDY;
register int TabIndex2;
register rdswinrec_list *TabRectangleSource2 = NULL;
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB [ DrucInstructionCourante->LAYER_1 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
/*\
* recuperer toutes les fenetres liees au rectangle
\*/
DrucCalculOperationUnaire ( DrucRdsWindow,
DrucInstructionCourante,
TmpRectangleSource,
& UnaireX,
& UnaireDX,
& UnaireY,
& UnaireDY
);
PtChaine = getrdswindow ( UnaireX,
UnaireY,
UnaireDX,
UnaireDY,
DrucRdsWindow
);
while ( PtChaine != (chain_list *)NULL
)
{
/*\
* parcours de chaque fenetre
\*/
TmpWindowSource2 = ( rdswin_list *) PtChaine->DATA;
PtChaine = PtChaine ->NEXT;
TabRectangleSource2 = TmpWindowSource2->LAYERTAB
[ DrucInstructionCourante->LAYER_2 ];
/*\
* parcours des tableaux de la fenetre du layer 2
\*/
while ( TabRectangleSource2 != (rdswinrec_list *)NULL
)
{
/*\
* parcourir tous les rectangles du layer B
\*/
TabIndex2 = 0;
while ( TabIndex2 < RWI_MAX_REC
)
{
if ( MACRO_RECT_SOURCE2 [ TabIndex2 ] != ( rdsrec_list *)NULL )
{
DrucMarqueInclusion ( UnaireX,
UnaireDX,
UnaireY,
UnaireDY,
TmpRectangleSource,
MACRO_RECT_SOURCE2 [ TabIndex2 ]
);
}
TabIndex2 ++;
} /* while les rectangles d'un tableau du layer 2 */
TabRectangleSource2 = TabRectangleSource2->NEXT;
} /* while les tableaux du layer 2 */
} /* while les fenetres du layer 2 */
if ( ( TmpRectangleSource->FLAGS &
DRUC_FLAG_REC_INCLUS ) == DRUC_NOFLAGS
)
{
DrucExclusionRectangle ( DrucFigureRds,
DrucRdsWindow,
TmpRectangleSource,
DrucInstructionCourante,
UnaireX,
UnaireDX,
UnaireY,
UnaireDY
);
}
} /* for le parcours des rectangles du layer 1 */
DrucClearFlag ( DrucFigureRds->LAYERTAB[ DrucInstructionCourante->LAYER_1 ],
DRUC_FLAG_REC_INCLUS
);
}

View File

@ -0,0 +1,26 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFEXCLU.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| defExclu Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineExclusion |
| Definit un layer temporaire caracterise par l'operateur |
| contenu dans l'instruction ayant les deux layers source |
| comme operandes |
| range le resultat dans le tableau des layers userdefini par |
| l'instruction |
\------------------------------------------------------------*/
extern void DrucDefineExclusion ();

View File

@ -0,0 +1,112 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFINCLU.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
#include "definclu.h"
/*------------------------------------------------------------\
| |
| DefInclu Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineInclusion |
| Definit un layer temporaire caracterise par l'operateur |
| contenu dans l'instruction ayant les deux layers source |
| comme operandes |
| range le resultat dans le tableau des layers userdefini par |
| l'instruction |
\------------------------------------------------------------*/
void DrucDefineInclusion ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
rdsrec_list *TmpRectangleSource;
rdsrecwin_list *TmpWindowSource2;
register int TabIndex2;
register rdswinrec_list *TabRectangleSource2 = NULL;
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB [ DrucInstructionCourante->LAYER_1 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
/*\
* recuperer toutes les fenetres liees au rectangle, marquer le rectangle visite
\*/
TmpWindowSource2 = DrucChercheWindow ( TmpRectangleSource
);
/*\
* parcours de chaque fenetre
\*/
while ( TmpWindowSource2 != (rdsrecwin_list *)NULL
)
{
TabRectangleSource2 = ( TmpWindowSource2->WINDOW )->LAYERTAB
[ DrucInstructionCourante->LAYER_2 ];
/*\
* parcours des tableaux de la fenetre du layer 1
\*/
while ( TabRectangleSource2 != (rdswinrec_list *)NULL
)
{
/*\
* parcourir tous les rectangles du layer 1
\*/
TabIndex2 = 0;
while ( TabIndex2 < RWI_MAX_REC
)
{
if ( MACRO_RECT_SOURCE2 [ TabIndex2 ] != ( rdsrec_list *)NULL )
{
DrucInclusionRectangle ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante,
TmpRectangleSource,
MACRO_RECT_SOURCE2 [ TabIndex2 ]
);
}
TabIndex2 ++;
} /* while les rectangles d'un tableau du layer 2 */
TabRectangleSource2 = TabRectangleSource2->NEXT;
} /* while les tableaux du layer 2 */
TmpWindowSource2 = TmpWindowSource2->NEXT;
} /* while les fenetres du layer 2 */
} /* for des rectangles du layer 1 */
}

View File

@ -0,0 +1,26 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFINCLU.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DefInclu Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineInclusion |
| Definit un layer temporaire caracterise par l'operateur |
| contenu dans l'instruction ayant les deux layers source |
| comme operandes |
| range le resultat dans le tableau des layers userdefini par |
| l'instruction |
\------------------------------------------------------------*/
extern void DrucDefineInclusion ();

View File

@ -0,0 +1,112 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFINTER.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
#include "definter.h"
/*------------------------------------------------------------\
| |
| DefInter Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineIntersection |
| Definit un layer temporaire caracterise par l'operateur |
| contenu dans l'instruction ayant les deux layers source |
| comme operandes |
| range le resultat dans le tableau des layers userdefini par |
| l'instruction |
\------------------------------------------------------------*/
void DrucDefineIntersection ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
rdsrec_list *TmpRectangleSource;
rdsrecwin_list *TmpWindowSource2;
register int TabIndex2;
register rdswinrec_list *TabRectangleSource2 = NULL;
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB [ DrucInstructionCourante->LAYER_1 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
/*\
* recuperer toutes les fenetres liees au rectangle, marquer le rectangle visite
\*/
TmpWindowSource2 = DrucChercheWindow ( TmpRectangleSource
);
/*\
* parcours de chaque fenetre
\*/
while ( TmpWindowSource2 != (rdsrecwin_list *)NULL
)
{
TabRectangleSource2 = ( TmpWindowSource2->WINDOW )->LAYERTAB
[ DrucInstructionCourante->LAYER_2 ];
/*\
* parcours des tableaux de la fenetre du layer 2
\*/
while ( TabRectangleSource2 != (rdswinrec_list *)NULL
)
{
/*\
* parcourir tous les rectangles du layer B
\*/
TabIndex2 = 0;
while ( TabIndex2 < RWI_MAX_REC
)
{
if ( MACRO_RECT_SOURCE2 [ TabIndex2 ] != ( rdsrec_list *)NULL )
{
DrucIntersectRectangle ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante,
TmpRectangleSource,
MACRO_RECT_SOURCE2 [ TabIndex2 ]
);
}
TabIndex2 ++;
} /* while les rectangles d'un tableau du layer 2 */
TabRectangleSource2 = TabRectangleSource2->NEXT;
} /* while les tableaux du layer 2 */
TmpWindowSource2 = TmpWindowSource2->NEXT;
} /* while les fenetres du layer 2 */
} /* for le parcours des rectangles du layer 1 */
}

View File

@ -0,0 +1,26 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFINTER.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DefInter Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineIntersection |
| Definit un layer temporaire caracterise par l'operateur |
| contenu dans l'instruction ayant les deux layers source |
| comme operandes |
| range le resultat dans le tableau des layers userdefini par |
| l'instruction |
\------------------------------------------------------------*/
extern void DrucDefineIntersection ();

View File

@ -0,0 +1,202 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFRESIZ.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
#include "defresiz.h"
/*------------------------------------------------------------\
| |
| DefResiz Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineUnion |
| Definit un layer temporaire caracterise par l'union |
| des deux layers source |
| range le resultat dans le tableau des layers user defini par|
| l'instruction |
\------------------------------------------------------------*/
void DrucDefineResize ( DrucFigureRds,
DrucRdsWindow ,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
int TmpLayerDest;
int TmpLayerSource1;
int TmpLayerSource2;
register rdsrec_list *TmpRectangleSource;
register rdsrec_list *TmpRectangleDest;
TmpLayerDest = DrucInstructionCourante->LAYER_DEST;
TmpLayerSource1 = DrucInstructionCourante->LAYER_1;
TmpLayerSource2 = DrucInstructionCourante->LAYER_2;
/*\
* modifier tous les rectangles du layer source 1
\*/
if ( TmpLayerSource1 == TmpLayerDest )
{
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB[ TmpLayerSource1 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
/*\
* modif des dimensions X
\*/
/*\
printf ("\nTmpRectangleSource %d %d %d %d\n",
TmpRectangleSource->X,
TmpRectangleSource->Y,
TmpRectangleSource->DX,
TmpRectangleSource->DY);
\*/
if ( ( DrucInstructionCourante->DEF_VALEUR < 0 ) &&
( TmpRectangleSource->DX < abs ( DrucInstructionCourante->DEF_VALEUR ) * 2 )
)
{
TmpRectangleSource->X = TmpRectangleSource->X + ( TmpRectangleSource->DX / 2 );
TmpRectangleSource->DX = 0;
}
else
{
TmpRectangleSource->X = TmpRectangleSource->X -
DrucInstructionCourante->DEF_VALEUR;
TmpRectangleSource->DX = TmpRectangleSource->DX +
(DrucInstructionCourante->DEF_VALEUR * 2);
}
/*\
* modif des dimensions Y
\*/
if ( ( DrucInstructionCourante->DEF_VALEUR < 0 ) &&
( TmpRectangleSource->DY < abs ( DrucInstructionCourante->DEF_VALEUR ) * 2 )
)
{
TmpRectangleSource->Y = TmpRectangleSource->Y + ( TmpRectangleSource->DY / 2 );
TmpRectangleSource->DY = 0;
}
else
{
TmpRectangleSource->Y = TmpRectangleSource->Y -
DrucInstructionCourante->DEF_VALEUR;
TmpRectangleSource->DY = TmpRectangleSource->DY +
(DrucInstructionCourante->DEF_VALEUR * 2);
}
/*\
printf ("TmpRectangleSource %d %d %d %d\n",
TmpRectangleSource->X,
TmpRectangleSource->Y,
TmpRectangleSource->DX,
TmpRectangleSource->DY);
\*/
}
}
else
/*\
* dupliquer tous les rectangles du layer source 1
\*/
{
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB[ TmpLayerSource1 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
TmpRectangleDest = allocrdsrec ( sizeof ( DrucTypeStructPlusRect ));
TmpRectangleDest->NEXT = ( rdsrec_list *)NULL;
/*\
* modif des dimensions X
\*/
if ( ( DrucInstructionCourante->DEF_VALEUR < 0 ) &&
( TmpRectangleSource->DX < abs ( DrucInstructionCourante->DEF_VALEUR ) * 2 )
)
{
TmpRectangleDest->X = TmpRectangleSource->X + ( TmpRectangleSource->DX / 2 );
TmpRectangleDest->DX = 0;
}
else
{
TmpRectangleDest->X = TmpRectangleSource->X -
DrucInstructionCourante->DEF_VALEUR;
TmpRectangleDest->DX = TmpRectangleSource->DX +
(DrucInstructionCourante->DEF_VALEUR * 2);
}
/*\
* modif des dimensions Y
\*/
if ( ( DrucInstructionCourante->DEF_VALEUR < 0 ) &&
( TmpRectangleSource->DY < abs ( DrucInstructionCourante->DEF_VALEUR ) * 2 )
)
{
TmpRectangleDest->Y = TmpRectangleSource->Y + ( TmpRectangleSource->DY / 2 );
TmpRectangleDest->DY = 0;
}
else
{
TmpRectangleDest->Y = TmpRectangleSource->Y -
DrucInstructionCourante->DEF_VALEUR;
TmpRectangleDest->DY = TmpRectangleSource->DY +
(DrucInstructionCourante->DEF_VALEUR * 2);
}
TmpRectangleDest->USER = (rdsrec_list *)NULL;
TmpRectangleDest->NAME = TmpRectangleSource->NAME;
SetRdsLayer ( TmpRectangleDest ,
TmpLayerDest
);
MACRO_NEXT_EQUI ( TmpRectangleDest ) = (rdsrec_list *)NULL;
DrucChaineCompose ( TmpRectangleDest ,
TmpRectangleSource,
TmpLayerSource1
);
addrdsrecwindow ( TmpRectangleDest ,
DrucRdsWindow
);
DrucAddRecFigure ( TmpRectangleDest ,
DrucFigureRds ,
TmpLayerDest
);
}
}
}

View File

@ -0,0 +1,25 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFRESIZ.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DefResiz Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineResize |
| Definit un layer temporaire caracterise par la modification |
| des dimensions des rectangles par valeur positive ou negative
| range le resultat dans le tableau des layers user defini par|
| l'instruction |
\------------------------------------------------------------*/
extern void DrucDefineResize ();

View File

@ -0,0 +1,437 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFTOOLS.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
/*------------------------------------------------------------\
| |
| DefTools Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucChaineCompose |
| Accroche le rectangle source au rectangle dest par le champ |
| NEXT_DEFINE pour connaite la liste des rectangles ayant |
| contribue a la creation du rectangle dest |
| on chaine des structures PlusRect entre elles a chaque |
| nouveau rectangle composant le layer virtuel |
| Le champ NEXT_EQUI de la structure ajoutee sert a retrouver |
| le rectangle ayant ete utilise pour composer le rectangle |
| dest |
\------------------------------------------------------------*/
void DrucChaineCompose ( RectangleDest ,
RectangleSource,
IndexLayer
)
rdsrec_list *RectangleDest;
rdsrec_list *RectangleSource;
int IndexLayer;
{
DrucTypeStructPlusRect *TmpPlusRec;
TmpPlusRec = ( DrucTypeStructPlusRect *)rdsalloc ( MACRO_PLUS_TAILLE ,
DRUC_ON_HEAP
);
if ( MACRO_INSTANCE_NUM ( RectangleDest ) == (rdsins_list*)NULL )
{
MACRO_INSTANCE_NUM ( RectangleDest ) = MACRO_INSTANCE_NUM ( RectangleSource );
}
TmpPlusRec->NEXT_EQUI = RectangleSource;
TmpPlusRec->NOMBRE = IndexLayer;
TmpPlusRec->NEXT_DEFINE = MACRO_NEXT_DEFINE ( RectangleDest );
MACRO_NEXT_DEFINE ( RectangleDest ) = TmpPlusRec;
}
/*------------------------------------------------------------\
| |
| DrucInclusionRectangle |
| Cree la copie du rectangle 2 s'il est inclus entierement|
| dans le rectangle 1 puis chaine les 2 rectangles source |
| par le pointeur USER au rectangle cree |
| ou retoune NULL |
\------------------------------------------------------------*/
void DrucInclusionRectangle ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante,
Rectangle1,
Rectangle2
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
register rdsrec_list *Rectangle1;
register rdsrec_list *Rectangle2;
{
register int TmpLayerDest = DrucInstructionCourante->LAYER_DEST;
rdsrec_list *TmpRectangleDest;
if ( ( ( Rectangle2->X <=
Rectangle1->X ) &&
( Rectangle2->X + Rectangle2->DX >=
Rectangle1->X + Rectangle1->DX ) ) &&
( ( Rectangle2->Y <=
Rectangle1->Y ) &&
( Rectangle2->Y + Rectangle2->DY >=
Rectangle1->Y + Rectangle1->DY ) )
)
{
TmpRectangleDest = allocrdsrec( sizeof ( DrucTypeStructPlusRect ));
TmpRectangleDest->X = Rectangle1->X;
TmpRectangleDest->Y = Rectangle1->Y;
TmpRectangleDest->DX = Rectangle1->DX;
TmpRectangleDest->DY = Rectangle1->DY;
SetRdsLayer ( TmpRectangleDest ,
TmpLayerDest
);
DrucChaineCompose ( TmpRectangleDest ,
Rectangle2,
DrucInstructionCourante->LAYER_2
);
DrucChaineCompose ( TmpRectangleDest ,
Rectangle1,
DrucInstructionCourante->LAYER_1
);
addrdsrecwindow ( TmpRectangleDest,
DrucRdsWindow
);
DrucAddRecFigure ( TmpRectangleDest ,
DrucFigureRds ,
TmpLayerDest
);
}
}
/*------------------------------------------------------------\
| |
| DrucIntersectRectangle |
| Cree un rectangle de dimensions et coordonnees |
| correspondant a l'intersection des 2 rectangles passes en |
| parametre |
| ou retoune NULL si les 2 rectangles ne sont pas en |
| intersection |
\------------------------------------------------------------*/
void DrucIntersectRectangle ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante,
Rectangle1,
Rectangle2
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
register rdsrec_list *Rectangle1;
register rdsrec_list *Rectangle2;
{
register long TmpDx1 = Rectangle1->X + Rectangle1->DX;
register long TmpDy1 = Rectangle1->Y + Rectangle1->DY;
register long TmpDx2 = Rectangle2->X + Rectangle2->DX;
register long TmpDy2 = Rectangle2->Y + Rectangle2->DY;
register int TmpLayerDest = DrucInstructionCourante->LAYER_DEST;
rdsrec_list *TmpRectangleDest;
if ( ( TmpDx1 < Rectangle2->X ) ||
( TmpDx2 < Rectangle1->X )
)
{
return;
}
if ( ( TmpDy1 < Rectangle2->Y ) ||
( TmpDy2 < Rectangle1->Y )
)
{
return;
}
TmpRectangleDest = allocrdsrec( sizeof
( DrucTypeStructPlusRect )
);
TmpRectangleDest->X = ( ( Rectangle1->X < Rectangle2->X ) ?
Rectangle2->X :
Rectangle1->X
);
TmpRectangleDest->Y = ( ( Rectangle1->Y < Rectangle2->Y ) ?
Rectangle2->Y :
Rectangle1->Y
);
TmpRectangleDest->DX = ( ( TmpDx1 < TmpDx2 ) ?
TmpDx1 - TmpRectangleDest->X :
TmpDx2 - TmpRectangleDest->X
);
TmpRectangleDest->DY = ( ( TmpDy1 < TmpDy2 ) ?
TmpDy1 - TmpRectangleDest->Y :
TmpDy2 - TmpRectangleDest->Y
);
SetRdsLayer ( TmpRectangleDest ,
TmpLayerDest
);
DrucChaineCompose ( TmpRectangleDest ,
Rectangle1,
DrucInstructionCourante->LAYER_1
);
DrucChaineCompose ( TmpRectangleDest ,
Rectangle2,
DrucInstructionCourante->LAYER_2
);
addrdsrecwindow ( TmpRectangleDest ,
DrucRdsWindow
);
DrucAddRecFigure ( TmpRectangleDest ,
DrucFigureRds ,
TmpLayerDest
);
}
/*------------------------------------------------------------\
| |
| DrucExclusionRectangle |
| Retourne la copie du rectangle 2 si il n'est pas en |
| intersection ou en contact avec le rectangle 1 |
| ou retoune NULL |
\------------------------------------------------------------*/
void DrucExclusionRectangle ( DrucFigureRds,
DrucRdsWindow,
TmpRectangle1,
DrucInstructionCourante,
UnaireX,
UnaireDX,
UnaireY,
UnaireDY
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
register rdsrec_list *TmpRectangle1;
register long UnaireX;
register long UnaireDX;
register long UnaireY;
register long UnaireDY;
{
register rdsrec_list *TmpRectangleDest;
register int TmpLayerDest = DrucInstructionCourante->LAYER_DEST;
register int TmpLayerSource = DrucInstructionCourante->LAYER_1;
TmpRectangleDest = allocrdsrec( sizeof ( DrucTypeStructPlusRect ));
TmpRectangleDest->X = UnaireX ;
TmpRectangleDest->Y = UnaireY ;
TmpRectangleDest->DX = UnaireDX ;
TmpRectangleDest->DY = UnaireDY ;
SetRdsLayer ( TmpRectangleDest ,
TmpLayerDest
);
DrucChaineCompose ( TmpRectangleDest ,
TmpRectangle1,
DrucInstructionCourante->LAYER_1
);
addrdsrecwindow ( TmpRectangleDest ,
DrucRdsWindow
);
DrucAddRecFigure ( TmpRectangleDest ,
DrucFigureRds ,
TmpLayerDest
);
/*\
DrucViewString ("\nCREATION DE RECTANGLE EXCLUS\n"
);
viewrdsrec (TmpRectangleDest
);
\*/
}
/*------------------------------------------------------------\
| |
| DrucMarqueInclusion |
| Marque le rectangle 1 si il est en contact avec |
| le rectangle 2 |
\------------------------------------------------------------*/
void DrucMarqueInclusion ( UnaireX,
UnaireDX,
UnaireY,
UnaireDY,
Rectangle1,
Rectangle2
)
register long UnaireX;
register long UnaireDX;
register long UnaireY;
register long UnaireDY;
register rdsrec_list *Rectangle1;
register rdsrec_list *Rectangle2;
{
register long TmpDx2 = Rectangle2->X + Rectangle2->DX;
register long TmpDy2 = Rectangle2->Y + Rectangle2->DY;
if ( ( UnaireX + UnaireDX < Rectangle2->X ) ||
( Rectangle2->X + Rectangle2->DX < UnaireX )
)
{
return;
}
if ( ( UnaireY + UnaireDY < Rectangle2->Y ) ||
( Rectangle2->Y + Rectangle2->DY < UnaireY )
)
{
return;
}
Rectangle1->FLAGS |= DRUC_FLAG_REC_INCLUS;
}
/*------------------------------------------------------------\
| |
| DrucCalculOperationUnaire |
| Retourne les dimensions d'un rectangle ayant subi l'ope |
| ration unaire contenue dans la struct instruction |
\------------------------------------------------------------*/
void DrucCalculOperationUnaire ( DrucRdsWindow,
DrucInstructionCourante,
TmpRectangleSource,
UnaireX,
UnaireDX,
UnaireY,
UnaireDY
)
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
rdsrec_list *TmpRectangleSource;
long *UnaireX;
long *UnaireDX;
long *UnaireY;
long *UnaireDY;
{
if ( DrucInstructionCourante->OP_UNAIRE == DRUC_UNDEFINED_OP_COMPOSE )
{
*UnaireX = TmpRectangleSource->X;
*UnaireDX = TmpRectangleSource->DX;
*UnaireY = TmpRectangleSource->Y;
*UnaireDY = TmpRectangleSource->DY;
return;
}
switch ( DrucInstructionCourante->OP_UNAIRE )
{
case DRUC_COMPOSE_RESIZE :
{
/*\
* modif des dimensions X
\*/
if ( ( DrucInstructionCourante->DEF_VALEUR < 0 ) &&
( TmpRectangleSource->DX < abs ( DrucInstructionCourante->DEF_VALEUR ) * 2 )
)
{
*UnaireX = TmpRectangleSource->X + ( TmpRectangleSource->DX / 2 );
*UnaireDX = 0;
}
else
{
*UnaireX = ( ( TmpRectangleSource->X -
DrucInstructionCourante->DEF_VALEUR ) <
DrucRdsWindow->XMIN ?
DrucRdsWindow->XMIN :
TmpRectangleSource->X -
DrucInstructionCourante->DEF_VALEUR
);
*UnaireDX = ( ( TmpRectangleSource->X +
TmpRectangleSource->DX +
DrucInstructionCourante->DEF_VALEUR ) >
DrucRdsWindow->XMAX ?
DrucRdsWindow->XMAX - *UnaireX :
TmpRectangleSource->X +
TmpRectangleSource->DX +
DrucInstructionCourante->DEF_VALEUR -
*UnaireX
);
}
/*\
* modif des dimensions Y
\*/
if ( ( DrucInstructionCourante->DEF_VALEUR < 0 ) &&
( TmpRectangleSource->DY < abs ( DrucInstructionCourante->DEF_VALEUR ) * 2 )
)
{
*UnaireY = TmpRectangleSource->Y + ( TmpRectangleSource->DY / 2 );
*UnaireDY = 0;
}
else
{
*UnaireY = ( ( TmpRectangleSource->Y -
DrucInstructionCourante->DEF_VALEUR ) <
DrucRdsWindow->YMIN ?
DrucRdsWindow->YMIN :
TmpRectangleSource->Y -
DrucInstructionCourante->DEF_VALEUR
);
*UnaireDY = ( ( TmpRectangleSource->Y +
TmpRectangleSource->DY +
DrucInstructionCourante->DEF_VALEUR ) >
DrucRdsWindow->YMAX ?
DrucRdsWindow->YMAX - *UnaireY :
TmpRectangleSource->Y +
TmpRectangleSource->DY +
DrucInstructionCourante->DEF_VALEUR -
*UnaireY
);
}
}
}
}

View File

@ -0,0 +1,67 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFTOOLS.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DefTools Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucChaineCompose |
| Accroche le rectangle source au rectangle dest par le champ |
| NEXT_DEFINE pour connaite la liste des rectangles ayant |
| contribue a la creation du rectangle dest |
\------------------------------------------------------------*/
extern void DrucChaineCompose ();
/*------------------------------------------------------------\
| |
| DrucAddRecFigure |
| insert le rectangle (initialise) dans la liste des |
| rectangles du layer donne |
\------------------------------------------------------------*/
extern void DrucAddRecFigure ();
/*------------------------------------------------------------\
| |
| DrucInclusionRectangle |
| Cree la copie du rectangle 2 s'il est inclus entierement|
| dans le rectangle 1 puis chaine les 2 rectangles source |
| par le pointeur USER au rectangle cree |
| ou retoune NULL |
\------------------------------------------------------------*/
extern void DrucInclusionRectangle ();
/*------------------------------------------------------------\
| |
| DrucIntersectRectangle |
| Cree un rectangle de dimensions et coordonnees |
| correspondant a l'intersection des 2 rectangles passes en |
| parametre |
| ou retoune NULL si les 2 rectangles ne sont pas en |
| intersection |
\------------------------------------------------------------*/
extern void DrucIntersectRectangle ();
/*------------------------------------------------------------\
| |
| DrucExclusionRectangle |
| Retourne la copie du rectangle 2 si il n'est pas en |
| intersection ou en contact avec le rectangle 1 |
| ou retoune NULL |
\------------------------------------------------------------*/
extern void DrucExclusionRectangle ();
/*------------------------------------------------------------\
| |
| DrucMarqueInclusion |
| Marque le rectangle 2 si il est inclus entierement |
| dans le rectangle 1 puis chaine les 2 rectangles source |
| par le pointeur USER au rectangle cree |
| ou retoune NULL |
\------------------------------------------------------------*/
extern void DrucMarqueInclusion ();

View File

@ -0,0 +1,136 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFUNION.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "deftools.h"
#include "defunion.h"
/*------------------------------------------------------------\
| |
| DefUnion Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineUnion |
| Definit un layer temporaire caracterise par l'union |
| des deux layers source |
| range le resultat dans le tableau des layers user defini par|
| l'instruction |
\------------------------------------------------------------*/
void DrucDefineUnion ( DrucFigureRds,
DrucRdsWindow ,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
int TmpLayerDest;
int TmpLayerSource1;
int TmpLayerSource2;
register rdsrec_list *TmpRectangleSource;
register rdsrec_list *TmpRectangleDest;
TmpLayerDest = DrucInstructionCourante->LAYER_DEST;
TmpLayerSource1 = DrucInstructionCourante->LAYER_1;
TmpLayerSource2 = DrucInstructionCourante->LAYER_2;
/*\
* dupliquer tous les rectangles du layer source 1
\*/
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB[ TmpLayerSource1 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
TmpRectangleDest = allocrdsrec ( sizeof ( DrucTypeStructPlusRect ));
TmpRectangleDest->NEXT = ( rdsrec_list *)NULL;
TmpRectangleDest->X = TmpRectangleSource->X;
TmpRectangleDest->Y = TmpRectangleSource->Y;
TmpRectangleDest->DX = TmpRectangleSource->DX;
TmpRectangleDest->DY = TmpRectangleSource->DY;
TmpRectangleDest->USER = ( rdsrec_list *)NULL;
TmpRectangleDest->NAME = TmpRectangleSource->NAME;
SetRdsLayer ( TmpRectangleDest ,
TmpLayerDest
);
MACRO_NEXT_EQUI ( TmpRectangleDest ) = (rdsrec_list *)NULL;
DrucChaineCompose ( TmpRectangleDest ,
TmpRectangleSource,
TmpLayerSource1
);
addrdsrecwindow ( TmpRectangleDest ,
DrucRdsWindow
);
DrucAddRecFigure ( TmpRectangleDest ,
DrucFigureRds ,
TmpLayerDest
);
}
/*\
* dupliquer tous les rectangles du layer source 2
\*/
for ( TmpRectangleSource = DrucFigureRds->LAYERTAB[ TmpLayerSource2 ];
TmpRectangleSource != (rdsrec_list *)NULL;
TmpRectangleSource = TmpRectangleSource->NEXT
)
{
TmpRectangleDest = allocrdsrec ( sizeof ( DrucTypeStructPlusRect ));
TmpRectangleDest->NEXT = ( rdsrec_list *)NULL;
TmpRectangleDest->X = TmpRectangleSource->X;
TmpRectangleDest->Y = TmpRectangleSource->Y;
TmpRectangleDest->DX = TmpRectangleSource->DX;
TmpRectangleDest->DY = TmpRectangleSource->DY;
TmpRectangleDest->USER = (rdsrec_list *)NULL;
TmpRectangleDest->NAME = TmpRectangleSource->NAME;
SetRdsLayer ( TmpRectangleDest ,
TmpLayerDest
);
MACRO_INSTANCE_NUM ( TmpRectangleDest ) = MACRO_INSTANCE_NUM ( TmpRectangleSource );
MACRO_NEXT_EQUI ( TmpRectangleDest ) = (rdsrec_list *)NULL;
DrucChaineCompose ( TmpRectangleDest ,
TmpRectangleSource,
TmpLayerSource2
);
addrdsrecwindow ( TmpRectangleDest ,
DrucRdsWindow
);
DrucAddRecFigure ( TmpRectangleDest ,
DrucFigureRds ,
TmpLayerDest
);
}
}

View File

@ -0,0 +1,25 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DEFUNION.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 26/07/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DefUnion Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDefineUnion |
| Definit un layer temporaire caracterise par l'union |
| des deux layers source |
| range le resultat dans le tableau des layers user defini par|
| l'instruction |
\------------------------------------------------------------*/
extern void DrucDefineEquipot ();

View File

@ -0,0 +1,708 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCBATH.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 03/07/95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "mut.h"
#include "mph.h"
#include "mpu.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
#include "druchier.h"
#include "vmcasmld.h"
#include "vmcaract.h"
#include "defdefin.h"
#include "vmcrelat.h"
#include "drucmin.h"
#include "vmcunify.h"
#include "drucring.h"
#include "drucbath.h"
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
extern FILE *DrucErrorFile;
/*------------------------------------------------------------\
| |
| DrucConcateneErrorFiles |
| |
\------------------------------------------------------------*/
void DrucConcateneErrorFiles ( DrucFigureRds,
DrucErrorFile
)
rdsfig_list *DrucFigureRds;
FILE *DrucErrorFile;
{
rdsins_list *InstanceCourante;
char *TmpErrorFileName;
FILE *TmpErrorFile;
char DrucTmpFileBuffer [ DRUC_MAX_STRING_BUFFER + 1 ];
fputs ( "\n" ,
DrucErrorFile
);
fputs ( DrucFigureRds->NAME ,
DrucErrorFile
);
fputs ( "\n" ,
DrucErrorFile
);
DrucViewString ( "Merge Errorfiles: "
);
DrucViewString ( "\n"
);
for ( InstanceCourante = DrucFigureRds->INSTANCE;
InstanceCourante != (rdsins_list *)NULL;
InstanceCourante = InstanceCourante->NEXT
)
{
TmpErrorFileName = DrucAddSuffixeName ( InstanceCourante->FIGNAME,
DRUC_ERROR_FILE_SUFFIXE
);
DrucViewString ("\r");
DrucViewString ( TmpErrorFileName);
DrucViewString (" ");
TmpErrorFile = fopen ( TmpErrorFileName,
"r"
);
if ( TmpErrorFile != NULL )
{
while ( fgets( DrucTmpFileBuffer,
DRUC_MAX_FILE_BUFFER,
TmpErrorFile
)
!= (char *)NULL
)
{
fputs ( DrucTmpFileBuffer ,
DrucErrorFile
);
}
fclose ( TmpErrorFile
);
/*\
unlink ( TmpErrorFileName
);
\*/
}
}
DrucViewString ( "\n");
}
/*------------------------------------------------------------\
| |
| DrucConcateneErrorFigures |
| |
\------------------------------------------------------------*/
void DrucConcateneErrorFigures ( DrucFigureRds,
DrucFigureRdsErreur
)
rdsfig_list *DrucFigureRds;
rdsfig_list *DrucFigureRdsErreur;
{
rdsfig_list *InstanceModele;
rdsins_list *InstanceCourante;
rdsrec_list *RectangleCourant;
rdsrec_list *NouveauRectangle;
char *TmpName;
int IndexLayer;
DrucViewString ( "Merge Error Instances:"
);
DrucViewString ( "\n"
);
for ( InstanceCourante = DrucFigureRds->INSTANCE;
InstanceCourante != (rdsins_list *)NULL;
InstanceCourante = InstanceCourante->NEXT
)
{
/*\
* pour toutes les instances de la figure inserer les rectangles
* du modele de l'instance dans le bloc
\*/
TmpName = DrucAddSuffixeName ( InstanceCourante->FIGNAME,
DRUC_ERROR_EXTEND
);
InstanceModele = searchrdsfig( TmpName
);
if ( InstanceModele == (rdsfig_list *)NULL
)
{
continue;
}
DrucViewString ( TmpName
);
DrucViewString ( "\n"
);
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER;
IndexLayer ++
)
{
if ( ( IndexLayer == DRUC_BBOX ) ||
( IndexLayer == RDS_USER0 ) ||
( IndexLayer == RDS_USER1 ) ||
( IndexLayer == RDS_USER2 ) ||
( IndexLayer == RDS_USER3 ) ||
( IndexLayer == RDS_USER4 ) ||
( IndexLayer == RDS_USER5 ) ||
( IndexLayer == RDS_USER6 ) ||
( IndexLayer == RDS_USER7 ) ||
( IndexLayer == RDS_USER8 ) ||
( IndexLayer == RDS_USER9 )
)
{
continue;
}
for ( RectangleCourant = InstanceModele->LAYERTAB [ IndexLayer ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
NouveauRectangle = addrdsfigrec ( DrucFigureRdsErreur,
RectangleCourant->NAME,
IndexLayer,
RectangleCourant->X,
RectangleCourant->Y,
RectangleCourant->DX,
RectangleCourant->DY
);
applyrdssym ( & NouveauRectangle->X,
& NouveauRectangle->Y,
& NouveauRectangle->DX,
& NouveauRectangle->DY,
InstanceCourante->X,
InstanceCourante->Y,
InstanceCourante->TRANSF
);
} /* for tous les rectangles */
}/* for tous les layers */
}/* for toutes les instances */
}
/*------------------------------------------------------------\
| |
| DrucSaveFgureErreur |
| |
\------------------------------------------------------------*/
void DrucSaveFigureErreur ( DrucFigureRdsErreur
)
rdsfig_list *DrucFigureRdsErreur;
{
rdsrec_list *RectangleCourant;
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER0
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER1
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER2
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER3
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER4
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER5
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER6
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER7
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER8
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER9
);
/*\
viewrdsfig ( DrucFigureRdsErreur
);
\*/
saverdsfig ( DrucFigureRdsErreur
);
}
/*------------------------------------------------------------\
| |
| DrucBloc |
| |
\------------------------------------------------------------*/
void DrucBloc ( DrucFigureName
)
char *DrucFigureName;
{
extern DrucTypeStructRdsLayer DrucStructRdsLayer[];
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucTabInstruction = ( DrucTypeStructInstruction *)NULL;
phfig_list *DrucFigureMbk;
rdsfig_list *DrucFigureRds;
rdsins_list *InstanceCourante;
rdsfig_list *InstanceModele;
char *TmpName;
char *DrucErrorName;
char *DrucCouronneName;
DrucFigureMbk = getphfig ( DrucFigureName,
'A'
);
if ( incatalog ( DrucFigureName) ||
DrucStructStat.FLAG_FLATTEN_MODE == DRUC_FLATTEN
)
{
DrucViewString ( "Flatten DRC on: "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
rflattenphfig ( DrucFigureMbk,
YES,
NO
);
DrucFigureRds = figmbkrds ( DrucFigureMbk,
MACRO_PLUS_TAILLE,
0
);
/*\
viewrdsfig ( DrucFigureRds );
\*/
DrucViewString ( "Delete MBK figure : "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
delphfig ( DrucFigureName
);
DrucViewString ( "Load Flatten Rules : "
);
DrucViewString ( RDS_TECHNO_NAME
);
DrucViewString ( "\n"
);
DrucInitInstruction ( & DrucTabInstruction
);
DrucViewString ( "Unify : "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
DrucUnifyFigure ( DrucFigureRds,
DrucStructRdsLayer
);
DrucRdsWindow = buildrdswindow ( DrucFigureRds
);
DrucComputeEquiFigure ( DrucFigureRds
);
}
else
{
/*\
* le bloc n'est pas dans le catalogue alors on fait sa verification hierarchique
\*/
DrucViewString ( "Hierarchical DRC on : "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
DrucFigureRds = figmbkrds ( DrucFigureMbk,
MACRO_PLUS_TAILLE,
0
);
/*\
viewrdsfig ( DrucFigureRds );
\*/
if ( DrucFigureRds->LAYERTAB [ DRUC_BBOX ]
!= (rdsrec_list *)NULL
)
{
delrdsfigrec ( DrucFigureRds,
DrucFigureRds->LAYERTAB [ DRUC_BBOX ]
);
}
DrucViewString ( "Delete MBK figure : "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
delphfig ( DrucFigureName
);
for ( InstanceCourante = DrucFigureRds->INSTANCE;
InstanceCourante != (rdsins_list *)NULL;
InstanceCourante = InstanceCourante->NEXT
)
{
/*\
* pour toutes les instances de la figure lancer la verif hierarchique
\*/
TmpName = DrucAddSuffixeName ( InstanceCourante->FIGNAME,
DRUC_COURONNE_EXTEND
);
InstanceModele = searchrdsfig ( TmpName
);
/*\
* si la couronne de l'instance n'exite pas lancer la verif hierarchique
\*/
if ( InstanceModele == ( rdsfig_list *)NULL
)
{
DrucBloc ( InstanceCourante->FIGNAME
);
}
}
DrucViewString ( "Load Hierarchical Rules"
);
DrucViewString ( "\n"
);
DrucInitInstruction ( & DrucTabInstruction
);
DrucViewString ( "Unify : "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
DrucUnifyFigure ( DrucFigureRds,
DrucStructRdsLayer
);
DrucFlattenInstanceRings ( DrucFigureRds
);
InstanceCourante = DrucFigureRds->INSTANCE;
DrucFigureRds->INSTANCE = (rdsins_list *)NULL;
DrucRdsWindow = buildrdswindow ( DrucFigureRds
);
DrucFigureRds->INSTANCE = InstanceCourante;
DrucComputeEquiFigure ( DrucFigureRds
);
}/* else */
/*\
* la figure RDS est chargee soit a plat soit avec ses couronnes on n'a plus besoin de MBK
\*/
DrucCouronneName = DrucAddSuffixeName ( DrucFigureName,
DRUC_COURONNE_EXTEND
);
DrucViewString ( "\nCreate Ring : "
);
DrucViewString ( DrucCouronneName
);
DrucViewString ( "\n"
);
DrucCreateCouron ( DrucFigureRds,
DrucRdsWindow,
DrucCouronneName
);
/*\
* ici se colle la concatenation des fichiers d'erreurs
* ici se colle la verification
\*/
DrucErrorName = DrucAddSuffixeName ( DrucFigureName,
DRUC_ERROR_FILE_SUFFIXE
);
DrucOpenErrorFile ( DrucErrorName,
"w"
);
DrucConcateneErrorFiles ( DrucFigureRds,
DrucErrorFile
);
/*\
* concatener les figures des erreurs
\*/
DrucConcateneErrorFigures ( DrucFigureRds,
DrucFigureRdsErreur
);
/*\
* envoyer la verif des regles
\*/
DrucMin ( DrucFigureRds,
DrucRdsWindow,
DrucTabInstruction ,
DrucNombreInstructions
);
/*\
* fermer le fichier des erreurs
* sauver la figure des erreurs
\*/
DrucSaveFigureErreur ( DrucFigureRdsErreur
);
DrucDelLayer ( DrucFigureRds,
DRUC_BBOX
);
DrucDelLayer ( DrucFigureRds,
RDS_USER0
);
DrucDelLayer ( DrucFigureRds,
RDS_USER1
);
DrucDelLayer ( DrucFigureRds,
RDS_USER2
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER3
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER4
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER5
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER6
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER7
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER8
);
DrucDelLayer ( DrucFigureRdsErreur,
RDS_USER9
);
InstanceCourante = DrucFigureRds->INSTANCE;
DrucFigureRds->INSTANCE = (rdsins_list *)NULL;
DrucFigureRds->INSTANCE = InstanceCourante;
/*\
\*/
DrucFigureRds->INSTANCE = (rdsins_list *)NULL;
destroyrdswindow ( DrucFigureRds,
DrucRdsWindow
);
delrdsfig ( DrucFigureName
);
DrucViewString ( "End DRC on: "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
DrucCloseErrorFile (
);
}
/*------------------------------------------------------------\
| |
| Main |
| |
\------------------------------------------------------------*/
void main (argc , argv )
int argc;
char *argv[];
{
phfig_list *DrucFigureMbk;
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
char *Name;
char *DrucFigureName;
char *DrucErrorName = (char *)NULL;
char *DrucCouronneRdsName;
char *DrucNetworkName;
DrucTypeStructInstruction *DrucTabInstruction = ( DrucTypeStructInstruction *)NULL;
int IndexLayer;
int Resultat;
int IndexName = 1;
int i;
boolean A,B;
mbkenv (
);
/*\
* affichage de la banniere standard
\*/
alliancebanner ( "DRuC",
VERSION,
"Design Rule Checker",
"1993",
ALLIANCE_VERSION
);
if ( argc < 2 || argc > 4
)
{
printf ( "Usage : %s figure_name (without extention) [-verbose] [-hierarchy]\n",argv [0]);
/*\
\*/
exit ( 2 );
}
A = DRUC_SILENT;
B = DRUC_FLATTEN;
for ( i = 1 ;
i < argc;
i ++
)
{
if (strcmp ( argv [i], "-verbose" )==0)
{
A = DRUC_VERBOSE;
}
else
{
if (strcmp ( argv [i], "-hierarchy" )==0)
{
B = DRUC_HIERARCHIE;
}
else
{
IndexName = i;
}
}
}
DrucStatInit ( B,
DRUC_VERBOSE,
A,
DRUC_ERROR_FILE
);
Name = argv [ IndexName ];
DrucFigureName = namealloc ( Name
);
Name = malloc ( strlen ( DrucFigureName ) +
strlen ( DRUC_ERROR_EXTEND) +
1
);
strcpy ( Name ,
DrucFigureName
);
strcat ( Name,
DRUC_ERROR_EXTEND
);
DrucErrorName = namealloc ( Name );
free ( Name
);
rdsenv (
);
loadrdsparam (
);
/*\
* creer la figure des erreurs locales
\*/
DrucFigureRdsErreur = addrdsfig ( DrucErrorName,
MACRO_PLUS_TAILLE
);
DrucBloc ( DrucFigureName
);
DrucViewString ( "Saving the Error file figure\n"
);
DrucDelLayer ( DrucFigureRdsErreur,
DRUC_BBOX
);
DrucViewString ( "Done\n"
);
DrucViewNumber ( DrucStructStat.ERROR_NUMBER
);
DrucViewString ( "\n"
);
if ( DrucStructStat.ERROR_NUMBER == 0
)
{
fprintf ( stdout,
"\nFile: %s%s is empty: no errors detected.\n",
DrucFigureName,
namealloc ( DRUC_ERROR_FILE_SUFFIXE
)
);
}
else
{
fprintf ( stdout,
"\nSome errors have been detected, see file: %s%s for detailled\n",
DrucFigureName,
namealloc ( DRUC_ERROR_FILE_SUFFIXE
)
);
}
exit ( DrucStructStat.ERROR_NUMBER
);
}

View File

@ -0,0 +1,29 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCFLAT.H |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
extern DrucTypeStructRdsLayer DrucStructRdsLayer[];
/*------------------------------------------------------------\
| |
| Fonction main |
| |
\------------------------------------------------------------*/
#define DRUC_OPTION_FIGURE_NAME "-f="
#define DRUC_OPTION_ERROR_NAME "-e="
#define DRUC_OPTION_NETWORK_NAME "-n="
#define DRUC_CATAL_NAME "CATAL"
#define DRUC_TECHNO_NAME "DRUC_ASM.TMP"
#define DRUC_NETWORK_NAME ""

View File

@ -0,0 +1,184 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCGRAAL.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
#include "druchier.h"
#include "vmcasmld.h"
#include "vmcaract.h"
#include "defdefin.h"
#include "vmcrelat.h"
#include "vmcunify.h"
#include "drucmin.h"
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
extern DrucTypeStructRdsLayer DrucStructRdsLayer[];
/*------------------------------------------------------------\
| |
| Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| drucgeterror |
| |
\------------------------------------------------------------*/
char *drucgeterror( Rule
)
long Rule;
{
return ( DrucGetRuleComment ( Rule
)
);
}
/*------------------------------------------------------------\
| |
| drucrdsfig |
| |
\------------------------------------------------------------*/
rdsfig_list *drucrdsfig ( DrucFigureRds,
DrucFigureRdsErrorName
)
rdsfig_list *DrucFigureRds;
char *DrucFigureRdsErrorName;
{
rdswindow *DrucRdsWindow;
static DrucTypeStructInstruction *DrucTabInstruction = ( DrucTypeStructInstruction *)NULL;
int LayerCourant;
int IndexLayer;
DrucStatInit ( DRUC_FLATTEN,
DRUC_SILENT,
DRUC_SILENT,
DRUC_NO_ERROR_FILE
);
DrucFigureRdsErreur = addrdsfig ( DrucFigureRdsErrorName,
MACRO_PLUS_TAILLE
);
/*
** Modified by L.Jacomme the 14/10/95
*/
if ( DrucTabInstruction == ( DrucTypeStructInstruction * )NULL )
{
DrucInitInstruction ( & DrucTabInstruction
);
}
/*
** End
*/
DrucRdsWindow = buildrdswindow ( DrucFigureRds
);
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER -1;
IndexLayer ++
)
{
LayerCourant = DrucStructRdsLayer [ IndexLayer ].RDS_INDEX ;
if ( LayerCourant != DRUC_UNDEFINED_LAYER
)
{
if ( DrucFigureRds->LAYERTAB [ LayerCourant ] != ( rdsrec_list * ) NULL
)
{
DrucComputeEquiLayer ( DrucFigureRds ,
LayerCourant
);
}
}
}
destroyrdswindow ( DrucFigureRds,
DrucRdsWindow
);
/*\
* le parametre DrucRdsWindow etait ooublie dans l'appel de DrucUnify
* thnaks to Xavier
\*/
DrucUnify ( DrucFigureRds,
DrucRdsWindow
);
DrucRdsWindow = buildrdswindow ( DrucFigureRds
);
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER -1;
IndexLayer ++
)
{
LayerCourant = DrucStructRdsLayer [ IndexLayer ].RDS_INDEX ;
if ( LayerCourant != DRUC_UNDEFINED_LAYER
)
{
if ( DrucFigureRds->LAYERTAB [ LayerCourant ] != ( rdsrec_list * ) NULL
)
{
DrucComputeEquiLayer ( DrucFigureRds ,
LayerCourant
);
}
}
}
DrucMin ( DrucFigureRds,
DrucRdsWindow,
DrucTabInstruction ,
DrucNombreInstructions
);
destroyrdswindow ( DrucFigureRds,
DrucRdsWindow
);
delrdsfig ( DrucFigureRds->NAME
);
return ( DrucFigureRdsErreur
);
}

View File

@ -0,0 +1,191 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCGRAL_TEST.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rut.h"
#include "rtl.h"
#include "rwi.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
#include "druchier.h"
#include "vmcasmld.h"
#include "vmcaract.h"
#include "defdefin.h"
#include "vmcrelat.h"
#include "drucmin.h"
#include "vmcunify.h"
#include "drucring.h"
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
/*------------------------------------------------------------\
| |
| Main |
| |
\------------------------------------------------------------*/
void main (argc , argv )
int argc;
char *argv[];
{
phfig_list *DrucFigureMbk;
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
char *Name;
char *DrucFigureName;
char *DrucErrorName = (char *)NULL;
char *DrucCouronneRdsName;
char *DrucNetworkName;
DrucTypeStructInstruction *DrucTabInstruction = ( DrucTypeStructInstruction *)NULL;
int DrucNombreInstructions;
int IndexLayer;
int Resultat;
/*\
* lecture des parametres d'entree
\*/
if ( argc != 2
)
{
printf ( "Usage : %s figure_name (without extention)\n",argv [0]
);
exit ( 1
);
}
/*\
* affichage de la banniere standard
\*/
alliancebanner ( "DRCGraL",
VERSION,
"Design Rule Checker",
"1993",
ALLIANCE_VERSION
);
DrucStatInit ( DRUC_FLATTEN,
DRUC_SILENT,
DRUC_SILENT,
DRUC_NO_ERROR_FILE
);
Name = argv [ 1 ];
DrucFigureName = namealloc ( Name
);
Name = malloc ( strlen ( DrucFigureName ) +
strlen ( DRUC_ERROR_EXTEND) +
1
);
strcpy ( Name ,
DrucFigureName
);
strcat ( Name,
DRUC_ERROR_EXTEND
);
DrucErrorName = namealloc ( Name
);
free ( Name
);
mbkenv (
);
rdsenv (
);
loadrdsparam (
);
DrucFigureMbk = getphfig ( DrucFigureName,
'A'
);
DrucViewString ( "Flatten DRC on: "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
rflattenphfig ( DrucFigureMbk,
YES,
NO
);
DrucFigureRds = figmbkrds ( DrucFigureMbk,
MACRO_PLUS_TAILLE,
0
);
DrucViewString ( "Delete MBK figure : "
);
DrucViewString ( DrucFigureName
);
DrucViewString ( "\n"
);
delphfig ( DrucFigureName
);
DrucViewString ( "Load Flatten Rules : "
);
DrucViewString ( RDS_TECHNO_NAME
);
DrucViewString ( "\n"
);
DrucOpenErrorFile ( DrucErrorName,
"w"
);
DrucFigureRdsErreur = drucrdsfig ( DrucFigureRds,
DrucErrorName
);
DrucStatInit ( DRUC_FLATTEN,
DRUC_VERBOSE,
DRUC_NO_ERROR_FILE
);
viewrdsfig ( DrucFigureRdsErreur
);
DrucViewString ( "\n"
);
DrucViewRuleComment (
);
DrucViewString ( "\nnombre d'erreurs rencontrees = valeur de sortie: "
);
DrucViewNumber ( DrucStructStat.ERROR_NUMBER
);
DrucViewString ( "\n"
);
exit ( DrucStructStat.ERROR_NUMBER
);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCHIER.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
| Modifications: voir fin de fichier |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucHier Types |
| |
\------------------------------------------------------------*/
typedef struct struct_trans_equiv
{
int LAYER_INDEX;
int LAYER_TRANSPARENCE;
}DrucTypeStructTransEquiv;
typedef struct struct_virtuel_equiv
{
int LAYER_INDEX;
int LAYER_VIRTUEL;
}DrucTypeStructVirtuEquiv;
/*------------------------------------------------------------\
| |
| DrucHier Defines |
| |
\------------------------------------------------------------*/
#define DRUC_MAX_VIRTUELS 1
#define DRUC_MAX_TRANSPARENCES 4
#define DRUC_BBOX RDS_USER2
/*------------------------------------------------------------\
| |
| DrucHier Variables |
| |
\------------------------------------------------------------*/
extern DrucTypeStructTransEquiv TabTransEquivalence [];
extern DrucTypeStructVirtuEquiv TabVirtuEquivalence [];
/*------------------------------------------------------------\
| |
| DrucHier Modifications |
| |
| Patrick 31/03/94: |
| ligne 36 |
| ajouter extern au tableau DrucTypeStructTransEquiv |
| |
\------------------------------------------------------------*/

View File

@ -0,0 +1,157 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCMIN.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 03/07/95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
#include "vmcasmld.h"
#include "vmcaract.h"
#include "defdefin.h"
#include "vmcrelat.h"
#include "drucmin.h"
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucMin |
| |
\------------------------------------------------------------*/
void DrucMin ( DrucFigureRds,
DrucRdsWindow,
DrucTabInstruction ,
DrucNombreInstructions
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucTabInstruction;
int DrucNombreInstructions;
{
int InstructionCourante;
DrucViewString ( "instructionCourante : 000"
);
/*\
* cette sauvegarde est pour cacher des pb de compilation de graal
* enlever quand graal link correctement
* saverdsfig ( DrucFigureRds
* );
\*/
for ( InstructionCourante = 0;
InstructionCourante != DrucNombreInstructions;
InstructionCourante = InstructionCourante + 1
)
{
DrucViewString ( "\b\b\b"
);
DrucViewNumber ( InstructionCourante
);
/*\
DrucViewInstruction ( DrucTabInstruction [InstructionCourante]
);
\*/
if ( MACRO_REGLE_COURANTE.LAYER_1 == DRUC_UNDEFINED_LAYER
)
{
/*\
* DrucViewString ("\ninstruction non verifiee\n)");
\*/
continue;
}
switch ( MACRO_REGLE_COURANTE.INSTRUCTION
)
{
case DRUC_ASM_BEGIN_REGLE :
{
switch ( MACRO_REGLE_COURANTE.OP_COMPOSE
)
{
case DRUC_INSTR_RELATION :
{
DrucRelation ( DrucFigureRds,
DrucRdsWindow,
& MACRO_REGLE_COURANTE
);
break;
}
case DRUC_INSTR_CARACTERISE :
{
DrucCaracterise ( DrucFigureRds,
& MACRO_REGLE_COURANTE
);
break;
}
}
break;
}
case DRUC_ASM_BEGIN_DEFINE :
{
DrucDefine ( DrucFigureRds,
DrucRdsWindow ,
& MACRO_REGLE_COURANTE
);
break;
}
case DRUC_ASM_BEGIN_UNDEFINE:
{
DrucUndefine ( DrucFigureRds,
DrucRdsWindow,
& MACRO_REGLE_COURANTE
);
break;
}
}/* switch */
}/* for InstructionCourante */
DrucViewString ( "\n"
);
/*\
saverdsfig (DrucFigureRds);
\*/
}/* DrucVerif */

View File

@ -0,0 +1,24 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCMIN.H |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
extern DrucTypeStructRdsLayer DrucStructRdsLayer[];
/*------------------------------------------------------------\
| |
| Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucMin ();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : Drucompi.h |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc Compiler Defines |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc Compiler Types |
| |
\------------------------------------------------------------*/
typedef struct data_list
{
struct data_list *NEXT;
int REGLE_NUM;
} DataList;
typedef struct struct_define
{
int LAYER_DEST;
int OP_COMPOSE;
int OP_UNAIRE;
int LAYER_1;
int LAYER_2;
long VALEUR;
int USER_LAYER_0;
int USER_LAYER_1;
int USER_LAYER_2;
char *USER_LAYER_NAME_0;
char *USER_LAYER_NAME_1;
char *USER_LAYER_NAME_2;
} DrucTypeStructDefine;
typedef struct struct_regle
{
DataList *LIST_REGLE_NUM;
int REGLE_NUM [ DRUC_MAX_MESURES ];
int INSTRUCTION;
int RELATION [ DRUC_MAX_MESURES ];
int LAYER_1;
int LAYER_2;
int MESURE [ DRUC_MAX_MESURES ];
int OP_COMPARE [ DRUC_MAX_MESURES ];
long VALEUR [ DRUC_MAX_MESURES ];
} DrucTypeStructRegle;
/*------------------------------------------------------------\
| |
| Druc Compiler variables |
| |
\------------------------------------------------------------*/
extern DrucTypeStructDefine DrucStructDefine;
extern DrucTypeStructRegle DrucStructRegle;
extern DrucTypeStructInstruction *DrucStructInstruction;
/*------------------------------------------------------------\
| |
| Druc Variables LEX/YACC |
| |
\------------------------------------------------------------*/
extern FILE *vrd_y_in;
extern int vrd_y_lineno;
extern int DrucInputEntier;
extern float DrucInputFloat;
extern char DrucInputChaine[];
/*------------------------------------------------------------\
| |
| Druc Fonctions LEX/YACC |
| |
\------------------------------------------------------------*/
extern vrd_y_parse ();
extern void vrd_y_error ();
/*------------------------------------------------------------\
| |
| Druc Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucInitCompiler ();
extern void DrucCloseCompiler ();
extern void DrucInitRdsLayerName ();
extern void DrucInitRdsLayerDef ();
extern void DrucStoreRdsLayer ();
extern void DrucInitDefineLayerDest ();
extern void DrucStructDefineOpCompose ();
extern void DrucInitDefineLayerA ();
extern void DrucInitDefineLayerB ();
extern void DrucStoreInstructionDefine ();
extern void DrucInitUndefineUserLayer ();
extern void DrucStoreInstructionUndefine ();
extern void DrucInitRegleNumero ();
extern void DrucInitRegleInstruction ();
extern void DrucInitRegleLayerA ();
extern void DrucInitRegleLayerB ();
extern void DrucInitRegleValeur ();
extern void DrucInitRegleRelation ();
extern void DrucInitRegleMesure ();
extern void DrucInitRegleOpCompare ();
extern void DrucStoreInstructionRegle ();
extern void DrucEcho ();

View File

@ -0,0 +1,192 @@
%{
#include "mut.h"
#include "drucompi_y.h"
#include "drucutil.h"
#include "drucompi.h"
#ifdef FLEX_SCANNER
#ifdef YY_INPUT
#undef YY_INPUT
#endif
#define YY_INPUT(buf,result,max_size) \
do { \
int c = getc(yyin); \
result = (c == EOF) ? YY_NULL \
: (buf[0] = isupper(c) ? toupper(c) : c, 1); \
} while(0)
int yylineno;
#else /* using lex, for sure */
#ifdef input
#undef input
#endif
#define input() (((yytchar = yysptr > yysbuf ? U(*--yysptr) \
: getc(yyin)) == 10 ?(yylineno++,yytchar) \
: yytchar) == EOF ? 0 \
: isupper(yytchar) ? toupper(yytchar) \
: yytchar)
#endif
%}
%p 3000
%option yylineno
delim [ \n\t]
esp [ \t]
rc [\n]
pct [\.\,\;\:\'\"\?\/\~\`\@\^<>\!\&\*\(\)\-\_\=\+\{\}\[\]\$\%\\\|]
blanc {delim}+
lettre [A-Za-z]
ident {lettre}({lettre}*|{dec}*|[_]*)*
dec [0-9]
decimal {dec}+
reel {dec}*([\.]{dec}*)
negat [\-]{reel}
comment [#]({lettre}*{dec}*{esp}*{pct}*)*{rc}
%%
{blanc} { DrucEcho ( yytext );
}
layer { DrucEcho ( yytext );
return(DRUC_LAYER);}
regle { DrucEcho ( yytext );
return(DRUC_REGLE);}
regles { DrucEcho ( yytext );
return(DRUC_REGLES);}
fin { DrucEcho ( yytext );
return(DRUC_FIN);}
define { DrucEcho ( yytext );
return(DRUC_DEFINE);}
undefine { DrucEcho ( yytext );
return(DRUC_UNDEFINE);}
caracterise { DrucEcho ( yytext );
return(DRUC_CARACTERISE);}
relation { DrucEcho ( yytext );
return(DRUC_RELATION);}
resize { DrucEcho ( yytext );
return(DRUC_RESIZE);}
exclusion { DrucEcho ( yytext );
return(DRUC_EXCLUSION);}
union { DrucEcho ( yytext );
return(DRUC_UNION);}
enveloppe { DrucEcho ( yytext );
return(DRUC_ENVELOPPE);}
marge { DrucEcho ( yytext );
return(DRUC_MARGE);}
croix { DrucEcho ( yytext );
return(DRUC_CROIX);}
intersection { DrucEcho ( yytext );
return(DRUC_INTERSECT);}
extension { DrucEcho ( yytext );
return(DRUC_EXTENSION);}
inclusion { DrucEcho ( yytext );
return(DRUC_INCLUSION);}
distance { DrucEcho ( yytext );
return(DRUC_DISTANCE);}
surface_inter { DrucEcho ( yytext );
return(DRUC_SURFACE_INTER);}
longueur_inter { DrucEcho ( yytext );
return(DRUC_LONG_INTER);}
largeur_inter { DrucEcho ( yytext );
return(DRUC_LARGE_INTER);}
penetre_inter { DrucEcho ( yytext );
return(DRUC_PENET_INTER);}
parallele_inter { DrucEcho ( yytext );
return(DRUC_PARAL_INTER);}
perpendiculaire_inter { DrucEcho ( yytext );
return(DRUC_PERPEN_INTER);}
axiale { DrucEcho ( yytext );
return(DRUC_AXIALE);}
geodesique { DrucEcho ( yytext );
return(DRUC_GEODESIQUE);}
frontale { DrucEcho ( yytext );
return(DRUC_FRONTALE);}
laterale_min { DrucEcho ( yytext );
return(DRUC_LATERALE_MIN);}
laterale_max { DrucEcho ( yytext );
return(DRUC_LATERALE_MAX);}
longueur_min { DrucEcho ( yytext );
return(DRUC_LONGUEUR_MIN);}
longueur_max { DrucEcho ( yytext );
return(DRUC_LONGUEUR_MAX);}
largeur_min { DrucEcho ( yytext );
return(DRUC_LARGEUR_MIN);}
largeur_max { DrucEcho ( yytext );
return(DRUC_LARGEUR_MAX);}
superieure { DrucEcho ( yytext );
return(DRUC_SUP);}
inferieure { DrucEcho ( yytext );
return(DRUC_INF);}
surface { DrucEcho ( yytext );
return(DRUC_SURFACE);}
longueur { DrucEcho ( yytext );
return(DRUC_LONGUEUR);}
largeur { DrucEcho ( yytext );
return(DRUC_LARGEUR);}
notch { DrucEcho ( yytext );
return(DRUC_NOTCH);}
min { DrucEcho ( yytext );
return(DRUC_MIN);}
max { DrucEcho ( yytext );
return(DRUC_MAX);}
"<=" { DrucEcho ( yytext );
return(DRUC_INFEQ);}
">=" { DrucEcho ( yytext );
return(DRUC_SUPEQ);}
"->" { DrucEcho ( yytext );
return(DRUC_DESTINATION);}
{decimal} { DrucEcho ( yytext );
sscanf(yytext,"%d",&DrucInputEntier);
return(DRUC_ENTIER);
}
{reel} { DrucEcho ( yytext );
sscanf( yytext,"%f",& DrucInputFloat);
return(DRUC_FLOAT);
}
{negat} { DrucEcho ( yytext );
sscanf( yytext,"%f",& DrucInputFloat);
return(DRUC_NEG_FLOAT);
}
{ident} { DrucEcho ( yytext );
sscanf(yytext,"%s",DrucInputChaine);
return(DRUC_NOM);
}
{comment} { DrucEcho ( yytext );
}
. { DrucEcho ( yytext );
return (*yytext);}
%%
void DrucEcho ( text )
{
if ( DrucStructStat.FLAG_VIEW_RULE_MODE == DRUC_VERBOSE
)
{
DrucViewString ( text );
}
}
#ifndef yywrap
int yywrap()
{ return(1) ; }
#endif

View File

@ -0,0 +1,306 @@
%{
#include <stdio.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "drucompi.h"
/*------------------------------------------------------------\
| |
| Druc MODIFICATIONS |
| |
| Patrick: 07/03/94 |
| Ajouter DRUC_FRONTALE et DRUC_LATERALE_MIN |
| qui etaient oublies dans les derivations |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc Variables LEX/YACC |
| |
\------------------------------------------------------------*/
extern int yylineno;
extern FILE *yyin;
int DrucIndexMesure;
int DrucInputEntier;
int DrucNegatif;
float DrucInputFloat;
char DrucInputChaine[DRUC_MAX_STRING_BUFFER + 1];
%}
/*------------------------------------------------------------\
| |
| Druc Types LEX/YACC |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc Terminaux |
| |
\------------------------------------------------------------*/
%token DRUC_REGLES DRUC_FIN DRUC_REGLE
DRUC_DEFINE DRUC_UNDEFINE
DRUC_CARACTERISE DRUC_RELATION
DRUC_LAYER DRUC_NOM
DRUC_UNION DRUC_EXCLUSION DRUC_RESIZE
DRUC_ENVELOPPE DRUC_MARGE DRUC_CROIX
DRUC_INTERSECT DRUC_EXTENSION DRUC_INCLUSION
DRUC_DISTANCE
DRUC_SURFACE_INTER DRUC_LONG_INTER DRUC_LARGE_INTER
DRUC_PENET_INTER DRUC_PARAL_INTER DRUC_PERPEN_INTER
DRUC_FRONTALE DRUC_LATERALE_MIN DRUC_LATERALE_MAX
DRUC_LARGEUR_MIN DRUC_LARGEUR_MAX
DRUC_LONGUEUR_MIN DRUC_LONGUEUR_MAX
DRUC_SUP DRUC_INF
DRUC_AXIALE DRUC_GEODESIQUE
DRUC_SURFACE DRUC_LONGUEUR DRUC_LARGEUR
DRUC_MIN DRUC_MAX
DRUC_INFEQ DRUC_SUPEQ
DRUC_DIFF DRUC_NOTCH
DRUC_DESTINATION
DRUC_ENTIER DRUC_FLOAT DRUC_NEG_FLOAT
/*------------------------------------------------------------\
| |
| Druc Racine |
| |
\------------------------------------------------------------*/
%start drc
/*------------------------------------------------------------\
| |
| Druc Regles |
| |
\------------------------------------------------------------*/
%%
drc : { DrucNombreInstructions = 0;
DrucInitCompiler () ;}
list_layer
DRUC_REGLES
list_bloc
DRUC_FIN
DRUC_REGLES { return ;}
;
list_layer: list_layer layer
| layer
;
layer : DRUC_LAYER
DRUC_NOM { DrucInitRdsLayerName ( DrucInputChaine ) ;}
DRUC_FLOAT { DrucInitRdsLayerDef ( RprTranslateParam ( DrucInputFloat ) );}
';'
;
list_bloc : list_bloc
bloc
| bloc
;
bloc : define { DrucLoadInstructionDefine () ;}
| undefine { DrucLoadInstructionUndefine () ;}
| caracter { DrucLoadInstructionRegle () ;}
| relation { DrucLoadInstructionRegle () ;}
;
define : DRUC_DEFINE
DRUC_NOM { DrucInitDefineLayerA ( DrucInputChaine ) ;}
','
resiz
DRUC_DESTINATION
DRUC_NOM { DrucInitDefineLayerDest ( DrucInputChaine ) ;}
';'
;
resiz : valresiz
defmodif
defoper
| DRUC_NOM { DrucInitDefineLayerB ( DrucInputChaine ) ;}
compose
;
valresiz : DRUC_FLOAT { DrucInitDefineValeur ( RprTranslateParam ( DrucInputFloat)) ;}
| DRUC_NEG_FLOAT { long i ;
i = RprTranslateParam ( DrucInputFloat );
DrucInitDefineValeur ( i );}
;
defoper : ',' { DrucInitOpUnaire ( ) ;}
DRUC_NOM { DrucInitDefineLayerB ( DrucInputChaine ) ;}
compose
|
;
compose : DRUC_UNION { DrucStructDefineOpCompose( DRUC_COMPOSE_UNION );}
| DRUC_INTERSECT { DrucStructDefineOpCompose( DRUC_COMPOSE_INTERSECT );}
| DRUC_EXCLUSION { DrucStructDefineOpCompose( DRUC_COMPOSE_EXCLUSION );}
| DRUC_INCLUSION { DrucStructDefineOpCompose( DRUC_COMPOSE_INCLUSION );}
;
defmodif : DRUC_RESIZE { DrucStructDefineOpCompose( DRUC_COMPOSE_RESIZE );}
;
undefine : DRUC_UNDEFINE
DRUC_NOM { DrucInitUndefineUserLayer ( DrucInputChaine ) ;}
';'
;
caracter : DRUC_CARACTERISE
DRUC_NOM { DrucInitRegleLayerA ( DrucInputChaine ) ;
DrucInitRegleInstruction ( DRUC_INSTR_CARACTERISE ) ;
DrucIndexMesure = -1 ;}
'('
lst_rgl_1
')'
';'
;
lst_rgl_1 : lst_rgl_1
regle_1
| regle_1
;
regle_1 : DRUC_REGLE { DrucIndexMesure ++ ;}
DRUC_ENTIER { DrucInitRegleNumero ( DrucInputEntier,
DrucIndexMesure) ;}
':'
mesure
compar
DRUC_FLOAT { DrucInitRegleValeur ( RprTranslateParam ( DrucInputFloat ),
DrucIndexMesure );}
';'
;
relation : DRUC_RELATION { DrucInitRegleInstruction ( DRUC_INSTR_RELATION ) ;}
DRUC_NOM { DrucInitRegleLayerA ( DrucInputChaine ) ;}
','
DRUC_NOM { DrucInitRegleLayerB ( DrucInputChaine ) ;
DrucIndexMesure = -1 ; }
'('
lst_rgl_2
')'
';'
;
lst_rgl_2 : lst_rgl_2
regle_2
| regle_2
;
regle_2 : DRUC_REGLE { DrucIndexMesure ++ ;}
DRUC_ENTIER { DrucInitRegleNumero ( DrucInputEntier,
DrucIndexMesure ) ;}
':'
config
mesure_rel
compar
DRUC_FLOAT { DrucInitRegleValeur ( RprTranslateParam ( DrucInputFloat ),
DrucIndexMesure );}
';'
;
config : DRUC_DISTANCE { DrucInitRegleRelation( DRUC_RELATION_DISTANCE,
DrucIndexMesure );}
| DRUC_INTERSECT { DrucInitRegleRelation( DRUC_RELATION_INTERSECTION,
DrucIndexMesure );}
| DRUC_EXTENSION { DrucInitRegleRelation( DRUC_RELATION_EXTENSION,
DrucIndexMesure );}
| DRUC_INCLUSION { DrucInitRegleRelation( DRUC_RELATION_INCLUSION,
DrucIndexMesure );}
| DRUC_ENVELOPPE { DrucInitRegleRelation( DRUC_RELATION_ENVELOPPE,
DrucIndexMesure );}
| DRUC_MARGE { DrucInitRegleRelation( DRUC_RELATION_MARGE,
DrucIndexMesure );}
| DRUC_CROIX { DrucInitRegleRelation( DRUC_RELATION_CROIX,
DrucIndexMesure );}
;
mesure_rel: DRUC_SURFACE_INTER{ DrucInitRegleMesure( DRUC_MESURE_SURFACE_INTER,
DrucIndexMesure );}
| DRUC_LONG_INTER { DrucInitRegleMesure( DRUC_MESURE_LONGUEUR_INTER,
DrucIndexMesure );}
| DRUC_LARGE_INTER { DrucInitRegleMesure( DRUC_MESURE_LARGEUR_INTER,
DrucIndexMesure );}
| DRUC_PENET_INTER { DrucInitRegleMesure( DRUC_MESURE_PENETRE_INTER,
DrucIndexMesure );}
| DRUC_PARAL_INTER { DrucInitRegleMesure( DRUC_MESURE_PARALEL_INTER,
DrucIndexMesure );}
| DRUC_PERPEN_INTER{ DrucInitRegleMesure( DRUC_MESURE_PERPEND_INTER,
DrucIndexMesure );}
| DRUC_LONGUEUR_MIN{ DrucInitRegleMesure( DRUC_MESURE_LONGUEUR_MIN,
DrucIndexMesure );}
| DRUC_LONGUEUR_MAX{ DrucInitRegleMesure( DRUC_MESURE_LONGUEUR_MAX,
DrucIndexMesure );}
| DRUC_LARGEUR_MIN { DrucInitRegleMesure( DRUC_MESURE_LARGEUR_MIN,
DrucIndexMesure );}
| DRUC_LARGEUR_MAX { DrucInitRegleMesure( DRUC_MESURE_LARGEUR_MAX,
DrucIndexMesure );}
| DRUC_FRONTALE { DrucInitRegleMesure( DRUC_MESURE_FRONTALE,
DrucIndexMesure );}
| DRUC_LATERALE_MIN{ DrucInitRegleMesure( DRUC_MESURE_LATERALE_MIN,
DrucIndexMesure );}
| DRUC_LATERALE_MAX{ DrucInitRegleMesure( DRUC_MESURE_LATERALE_MAX,
DrucIndexMesure );}
| DRUC_SUP { DrucInitRegleMesure( DRUC_MESURE_SUP,
DrucIndexMesure );}
| DRUC_INF { DrucInitRegleMesure( DRUC_MESURE_INF,
DrucIndexMesure );}
| DRUC_AXIALE { DrucInitRegleMesure( DRUC_MESURE_AXIALE,
DrucIndexMesure );}
| DRUC_GEODESIQUE { DrucInitRegleMesure( DRUC_MESURE_GEODESIQUE,
DrucIndexMesure );}
;
mesure : DRUC_SURFACE { DrucInitRegleMesure( DRUC_MESURE_SURFACE,
DrucIndexMesure );}
| DRUC_LONGUEUR { DrucInitRegleMesure( DRUC_MESURE_LONGUEUR,
DrucIndexMesure );}
| DRUC_LARGEUR { DrucInitRegleMesure( DRUC_MESURE_LARGEUR,
DrucIndexMesure );}
| DRUC_NOTCH { DrucInitRegleMesure( DRUC_MESURE_NOTCH,
DrucIndexMesure );}
| DRUC_SURFACE_INTER { DrucInitRegleMesure( DRUC_MESURE_SURFACE_INTER,
DrucIndexMesure );}
| DRUC_LONG_INTER { DrucInitRegleMesure( DRUC_MESURE_LONGUEUR_INTER,
DrucIndexMesure );}
| DRUC_LARGE_INTER { DrucInitRegleMesure( DRUC_MESURE_LARGEUR_INTER,
DrucIndexMesure );}
;
compar : DRUC_MIN { DrucInitRegleOpCompare ( DRUC_OPERATION_MIN,
DrucIndexMesure );}
| DRUC_MAX { DrucInitRegleOpCompare ( DRUC_OPERATION_MAX,
DrucIndexMesure );}
| DRUC_INFEQ { DrucInitRegleOpCompare ( DRUC_OPERATION_INFEQ,
DrucIndexMesure );}
| DRUC_SUPEQ { DrucInitRegleOpCompare ( DRUC_OPERATION_SUPEQ,
DrucIndexMesure );}
| '<' { DrucInitRegleOpCompare ( DRUC_OPERATION_INF,
DrucIndexMesure );}
| '>' { DrucInitRegleOpCompare ( DRUC_OPERATION_SUP,
DrucIndexMesure );}
| '=' { DrucInitRegleOpCompare ( DRUC_OPERATION_EQUAL,
DrucIndexMesure );}
| DRUC_DIFF { DrucInitRegleOpCompare ( DRUC_OPERATION_DIFF,
DrucIndexMesure );}
;
%%

View File

@ -0,0 +1,521 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCRING.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 03/07/95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| | |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "druchier.h"
#include "drucring.h"
/*------------------------------------------------------------\
| |
| DRUCRING Variables |
| |
\------------------------------------------------------------*/
extern long DrucCtmMax;
/*------------------------------------------------------------\
| |
| DRUCRING Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucDelLayer |
| |
\------------------------------------------------------------*/
void DrucDelLayer ( DrucFigureRds,
DeleteLayer
)
rdsfig_list *DrucFigureRds;
int DeleteLayer;
{
rdsrec_list *TmpRectangle;
while ( DrucFigureRds->LAYERTAB [ DeleteLayer ] != ( rdsrec_list *)NULL
)
{
TmpRectangle = DrucFigureRds->LAYERTAB [ DeleteLayer ];
DrucFigureRds->LAYERTAB [ DeleteLayer ] = TmpRectangle->NEXT;
freerdsrec ( TmpRectangle,
MACRO_PLUS_TAILLE
);
}
}
/*------------------------------------------------------------\
| |
| DrucModifieBboxInstance |
| |
\------------------------------------------------------------*/
void DrucModifieBboxInstance ( RectangleCourant,
PositionBboxX,
PositionBboxY,
PositionBboxDX,
PositionBboxDY
)
rdsrec_list *RectangleCourant;
long *PositionBboxX;
long *PositionBboxY;
long *PositionBboxDX;
long *PositionBboxDY;
{
*PositionBboxX = ( *PositionBboxX < RectangleCourant->X ?
*PositionBboxX :
RectangleCourant->X
);
*PositionBboxY = ( *PositionBboxY < RectangleCourant->Y ?
*PositionBboxY :
RectangleCourant->Y
);
*PositionBboxDX = ( *PositionBboxDX > ( RectangleCourant->X +
RectangleCourant->DX ) ?
*PositionBboxDX :
( RectangleCourant->X +
RectangleCourant->DX )
);
*PositionBboxDY = ( *PositionBboxDY > ( RectangleCourant->Y +
RectangleCourant->DY ) ?
*PositionBboxDY :
( RectangleCourant->Y +
RectangleCourant->DY )
);
}
/*------------------------------------------------------------\
| |
| DrucFlattenInstanceRings |
| |
\------------------------------------------------------------*/
void DrucFlattenInstanceRings ( DrucFigureRds
)
rdsfig_list *DrucFigureRds;
{
rdsfig_list *InstanceModele;
rdsins_list *InstanceCourante;
long PositionBboxX;
long PositionBboxY;
long PositionBboxDX;
long PositionBboxDY;
int IndexLayer;
char *TmpName;
char *savName;
char *brico = "a";
rdsrec_list *RectangleCourant;
rdsrec_list *NouveauRectangle;
DrucViewString ("Flatten Instance Rings:");
for ( InstanceCourante = DrucFigureRds->INSTANCE;
InstanceCourante != (rdsins_list *)NULL;
InstanceCourante = InstanceCourante->NEXT
)
{
/*\
* pour toutes les instances de la figure inserer les rectangles
* du modele de l'instance dans le bloc
\*/
TmpName = DrucAddSuffixeName ( InstanceCourante->FIGNAME,
DRUC_COURONNE_EXTEND
);
DrucViewString ("\r");
DrucViewString (TmpName);
DrucViewString (" ");
InstanceModele = searchrdsfig( TmpName
);
/*\
DrucViewString ("\nFIN_FLATTEN_INSTANCE:\n");
\*/
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER;
IndexLayer ++
)
{
if ( ( IndexLayer == DRUC_BBOX ) ||
( IndexLayer == RDS_ABOX ) ||
( IndexLayer == RDS_USER0 ) ||
( IndexLayer == RDS_USER1 ) ||
( IndexLayer == RDS_USER2 ) ||
( IndexLayer == RDS_USER3 ) ||
( IndexLayer == RDS_USER4 ) ||
( IndexLayer == RDS_USER5 ) ||
( IndexLayer == RDS_USER6 ) ||
( IndexLayer == RDS_USER7 ) ||
( IndexLayer == RDS_USER8 ) ||
( IndexLayer == RDS_USER9 )
)
{
continue;
}
for ( RectangleCourant = InstanceModele->LAYERTAB [ IndexLayer ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
NouveauRectangle = addrdsfigrec ( DrucFigureRds,
RectangleCourant->NAME,
IndexLayer,
RectangleCourant->X,
RectangleCourant->Y,
RectangleCourant->DX,
RectangleCourant->DY
);
applyrdssym ( & (NouveauRectangle->X),
& (NouveauRectangle->Y),
& (NouveauRectangle->DX),
& (NouveauRectangle->DY),
InstanceCourante->X,
InstanceCourante->Y,
InstanceCourante->TRANSF
);
MACRO_INSTANCE_NUM ( NouveauRectangle ) = InstanceCourante;
/*\
DrucViewRectangle ( &NouveauRectangle );
\*/
}
}/* for tous les layers */
/*\
DrucViewString ("\nFIN_FLATTEN_INSTANCE:\n");
\*/
for ( RectangleCourant = InstanceModele->LAYERTAB [ RDS_ABOX ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
NouveauRectangle = addrdsfigrec ( DrucFigureRds,
RectangleCourant->NAME,
DRUC_BBOX,
RectangleCourant->X,
RectangleCourant->Y,
RectangleCourant->DX,
RectangleCourant->DY
);
applyrdssym ( & (NouveauRectangle->X),
& (NouveauRectangle->Y),
& (NouveauRectangle->DX),
& (NouveauRectangle->DY),
InstanceCourante->X,
InstanceCourante->Y,
InstanceCourante->TRANSF
);
MACRO_INSTANCE_NUM ( NouveauRectangle ) = InstanceCourante;
} /* for le ABOX de la figure */
}/* for toutes les instances */
DrucViewString ("\n");
}
/*------------------------------------------------------------\
| |
| DrucIsLayerTransparence |
| |
\------------------------------------------------------------*/
boolean DrucIsLayerTransparence ( IndexLayer
)
int IndexLayer;
{
int IndexTableau;
for ( IndexTableau = 0;
IndexTableau < DRUC_MAX_TRANSPARENCES;
IndexTableau ++
)
{
if ( IndexLayer == ( TabTransEquivalence [ IndexTableau ] ).LAYER_TRANSPARENCE
)
{
return DRUC_TRUE;
}
}
return DRUC_FALSE;
}
/*------------------------------------------------------------\
| |
| DrucIsLayerVirtuel |
| |
\------------------------------------------------------------*/
boolean DrucIsLayerVirtuel ( IndexLayer
)
int IndexLayer;
{
int Index;
for ( Index = 0;
Index < DRUC_MAX_VIRTUELS;
Index ++
)
{
if ( IndexLayer == ( TabVirtuEquivalence [ Index ] ).LAYER_VIRTUEL
)
{
return DRUC_TRUE;
}
}
return DRUC_FALSE;
}
/*------------------------------------------------------------\
| |
| DrucCreateRectangleInCouronne |
| |
\------------------------------------------------------------*/
void DrucCreateRectangleInCouronne ( DrucCouronneRds,
IndexLayer,
RectangleCourant,
PositionInterneCouronneX,
PositionInterneCouronneY,
PositionInterneCouronneDX,
PositionInterneCouronneDY
)
rdsfig_list *DrucCouronneRds;
int IndexLayer;
rdsrec_list *RectangleCourant;
long PositionInterneCouronneX;
long PositionInterneCouronneY;
long PositionInterneCouronneDX;
long PositionInterneCouronneDY;
{
rdsrec_list *RectangleDest;
/*\
* si le rectangle est en contact avec la couronne
\*/
if ( ( RectangleCourant->X <=
PositionInterneCouronneX ) ||
( RectangleCourant->Y <=
PositionInterneCouronneY ) ||
( RectangleCourant->X + RectangleCourant->DX >=
PositionInterneCouronneDX ) ||
( RectangleCourant->Y + RectangleCourant->DY >=
PositionInterneCouronneDY )
)
{
/*\
* creer un nouveau rectangle,
* l'inserer dans la figure couronne sur son layer
\*/
RectangleDest = addrdsfigrec ( DrucCouronneRds,
RectangleCourant->NAME,
IndexLayer,
RectangleCourant->X,
RectangleCourant->Y,
RectangleCourant->DX,
RectangleCourant->DY
);
}
}
/*------------------------------------------------------------\
| |
| DrucCreateCouron |
| |
\------------------------------------------------------------*/
void DrucCreateCouron ( DrucFigureRds,
DrucRdsWindow,
DrucCouronneName
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
char *DrucCouronneName;
{
rdsfig_list *DrucCouronneRds;
rdsrec_list *RectangleCourant;
rdsrec_list *RectangleABox;
long IndexLayer;
long IndexVirtuel;
long DemiConnecteur;
long PositionInterneCouronneX;
long PositionInterneCouronneY;
long PositionInterneCouronneDX;
long PositionInterneCouronneDY;
long CouroneRefX;
long CouroneRefY;
long CouroneRefDX;
long CouroneRefDY;
/*\
* calculer les positions de la couronne interne
\*/
DrucCouronneRds = addrdsfig ( DrucCouronneName,
MACRO_PLUS_TAILLE
);
DemiConnecteur = DRUC_DEMI_CONNECTEUR;
RectangleABox = DrucFigureRds->LAYERTAB [ RDS_ABOX ];
/*\
* calcul des limites de la couronne
\*/
if ( RectangleABox != (rdsrec_list*)NULL )
{
CouroneRefX = RectangleABox->X + DemiConnecteur;
CouroneRefY = RectangleABox->Y + DemiConnecteur;
CouroneRefDX = RectangleABox->X + RectangleABox->DX - DemiConnecteur;
CouroneRefDY = RectangleABox->Y + RectangleABox->DY - DemiConnecteur;
}
else
{
CouroneRefX = DrucRdsWindow->XMIN + DrucCtmMax;
CouroneRefY = DrucRdsWindow->YMIN + DrucCtmMax;
CouroneRefDX = DrucRdsWindow->XMAX - DrucCtmMax;
CouroneRefDY = DrucRdsWindow->YMAX - DrucCtmMax;
}
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER;
IndexLayer ++
)
{
/*\
* on ne remonte pas les layers user ni les BBOX des instances ni les ABOX
\*/
if ( ( IndexLayer == DRUC_BBOX ) ||
( IndexLayer == RDS_ABOX ) ||
( IndexLayer == RDS_USER0 ) ||
( IndexLayer == RDS_USER1 ) ||
( IndexLayer == RDS_USER2 ) ||
( IndexLayer == RDS_USER3 ) ||
( IndexLayer == RDS_USER4 ) ||
( IndexLayer == RDS_USER5 ) ||
( IndexLayer == RDS_USER6 ) ||
( IndexLayer == RDS_USER7 ) ||
( IndexLayer == RDS_USER8 ) ||
( IndexLayer == RDS_USER9 )
)
{
continue;
}
/*\
* La position de la couronne est l'ABOX erodee de 1/2 connecteur et de
* 1 ctm du niveau
\*/
PositionInterneCouronneX = ( CouroneRefX +
DrucStructRdsLayer[ IndexLayer ].CTM
);
PositionInterneCouronneDX = ( CouroneRefDX -
DrucStructRdsLayer[ IndexLayer ].CTM
);
PositionInterneCouronneY = ( CouroneRefY +
DrucStructRdsLayer[ IndexLayer ].CTM
);
PositionInterneCouronneDY = ( CouroneRefDY -
DrucStructRdsLayer[ IndexLayer ].CTM
);
if ( DrucIsLayerTransparence ( IndexLayer ) == DRUC_TRUE
)
{
/*\
* on ne garde que les transparences du bloc (pere)
\*/
for ( RectangleCourant = DrucFigureRds->LAYERTAB [ IndexLayer ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
if ( MACRO_INSTANCE_NUM ( RectangleCourant ) == DRUC_BLOC_PERE
)
{
DrucCreateRectangleInCouronne ( DrucCouronneRds,
IndexLayer,
RectangleCourant,
PositionInterneCouronneX,
PositionInterneCouronneY,
PositionInterneCouronneDX,
PositionInterneCouronneDY
);
}
}
continue;
}
if ( DrucIsLayerVirtuel ( IndexLayer ) == DRUC_TRUE
)
{
/*\
* on ne garde que les virtuels du bloc (pere) et on les transforme en transparence
\*/
IndexVirtuel = DrucAsTransparenceEquivalent ( IndexLayer );
if ( IndexVirtuel != DRUC_UNDEFINED_LAYER )
{
for ( RectangleCourant = DrucFigureRds->LAYERTAB [ IndexLayer ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
if ( MACRO_INSTANCE_NUM ( RectangleCourant ) == DRUC_BLOC_PERE
)
{
DrucCreateRectangleInCouronne ( DrucCouronneRds,
IndexVirtuel,
RectangleCourant,
PositionInterneCouronneX,
PositionInterneCouronneY,
PositionInterneCouronneDX,
PositionInterneCouronneDY
);
}
}
}
continue;
}
for ( RectangleCourant = DrucFigureRds->LAYERTAB [ IndexLayer ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
DrucCreateRectangleInCouronne ( DrucCouronneRds,
IndexLayer,
RectangleCourant,
PositionInterneCouronneX,
PositionInterneCouronneY,
PositionInterneCouronneDX,
PositionInterneCouronneDY
);
}
}
/*\
* sauver l'ABOX du pere seulement
\*/
for ( RectangleCourant = DrucFigureRds->LAYERTAB [ RDS_ABOX ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
if ( MACRO_INSTANCE_NUM ( RectangleCourant ) == DRUC_BLOC_PERE
)
{
DrucCreateRectangleInCouronne ( DrucCouronneRds,
RDS_ABOX,
RectangleCourant,
PositionInterneCouronneX,
PositionInterneCouronneY,
PositionInterneCouronneDX,
PositionInterneCouronneDY
);
}
}
/*\
* sauver la couronne sur disque
viewrdsfig ( DrucCouronneRds );
\*/
saverdsfig ( DrucCouronneRds );
}

View File

@ -0,0 +1,24 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCRING.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 03/07/95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucRing Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucRing Defines |
| |
\------------------------------------------------------------*/
#define DRUC_BLOC_PERE (rdsins_list *)NULL
#define DRUC_DEMI_CONNECTEUR 4
#define DRUC_COURONNE_EXTEND "_RNG"

View File

@ -0,0 +1,231 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCUTIL.C |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
#include <stdio.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
/*------------------------------------------------------------\
| |
| DRUCSTAT variables |
| |
\------------------------------------------------------------*/
DrucTypeStructStat DrucStructStat;
/*------------------------------------------------------------\
| |
| DRUCUTIL variables |
| |
\------------------------------------------------------------*/
DrucTypeStructRuleComment *DrucRuleCommentList = NULL;
DrucTypeStructRdsLayer DrucStructRdsLayer [ RDS_ALL_LAYER ];
long DrucCtmMax;
int DrucNombreInstructions;
char *DrucCompilErrorMessage [] =
{
"\nDRUC Compiler terminated :OK \n",
"\nDRUC ERR: undefined user layer \n",
"\nDRUC ERR: Undefined RDS LAYER \n",
"\nDRUC ERR: Missing Out Name \n",
"\nDRUC ERR: Can't open Rules File \n",
"\nDRUC ERR: Rules File not found \n",
"\nDRUC ERR: Can't open Input Rules File \n",
"\nDRUC ERR: checksumm absent in compiled rules table \n",
"\nDRUC ERR: Input Rules File does'nt contain Rules Table \n",
"\nDRUC ERR: Rule Number \n",
"\nDRUC ERR: Invalid User Layer \n",
"\nDRUC ERR: memory allocation error\n",
"\nDRUC ERR: checksumm error in compiled rules \n",
"\nDRUC ERR: too much rules in relation \n",
"\nDRUC ERR: invalid arguments \n",
"\nDRUC ERR: il manque les commentaires dans le fichier technologique \n",
"\nDRUC ERR: unable to close outfile rules\n",
"\nDRUC ERR: Can't parse rules: I/O error during reading Techno File\n",
"\nDRUC ERR: bad read param in compiled rules \n",
"\nDRUC ERR: Destination RDS layer not empty \n",
"\nDRUC ERR: Destination layer empty \n",
"\nDRUC ERR: Destination RDS layer not declared \n",
"\n \n"
};
static char *DrucNoComment = "No comment";
/*------------------------------------------------------------\
| |
| DRUCUTIL Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucViewString |
| |
\------------------------------------------------------------*/
void DrucViewString ( String
)
char *String;
{
if ( DrucStructStat.FLAG_VERBOSE_MODE == DRUC_VERBOSE
)
{
fprintf ( stdout,
"%s",
String
);
fflush ( stdout
);
}
}
/*------------------------------------------------------------\
| |
| DrucViewNumber |
| |
\------------------------------------------------------------*/
void DrucViewNumber ( Number
)
long Number;
{
if ( DrucStructStat.FLAG_VERBOSE_MODE == DRUC_VERBOSE
)
{
fprintf ( stdout,
"%3ld",
Number
);
}
}
/*------------------------------------------------------------\
| |
| DrucComputeCheckSumm |
| |
| Calcule et met a jour le checksumm des instructions |
| assembleur ecrites dans le fichier DRUC_OUTPUT_NAME; |
void DrucComputeCheckSumm ( Value
)
int Value;
{
unsigned int TmpCheckSumm;
TmpCheckSumm = DrucCheckSumm << 1;
TmpCheckSumm = TmpCheckSumm & -1;
TmpCheckSumm = TmpCheckSumm ^ Value;
DrucCheckSumm = TmpCheckSumm;
}
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucGetRuleComment |
| |
\------------------------------------------------------------*/
char *DrucGetRuleComment ( Rule
)
long Rule;
{
DrucTypeStructRuleComment *Scan;
for ( Scan = DrucRuleCommentList;
Scan != (DrucTypeStructRuleComment *)NULL;
Scan = Scan->NEXT
)
{
if ( Scan->RULE == Rule
)
{
return ( Scan->COMMENT
);
}
}
return ( DrucNoComment
);
}
/*------------------------------------------------------------\
| |
| DrucViewRuleComment |
| |
\------------------------------------------------------------*/
void DrucViewRuleComment()
{
DrucTypeStructRuleComment *Scan;
for ( Scan = DrucRuleCommentList;
Scan != (DrucTypeStructRuleComment *)NULL;
Scan = Scan->NEXT
)
{
DrucViewNumber ( Scan->RULE
);
DrucViewString ( " : "
);
DrucViewString ( Scan->COMMENT
);
}
}
/*------------------------------------------------------------\
| |
| DRUCSTAT Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucInitStructStat |
| |
\------------------------------------------------------------*/
void DrucStatInit ( Flatten,
Verbose,
View_Rules,
FileType
)
boolean Flatten;
boolean Verbose;
boolean FileType;
{
DrucStructStat.ERROR_NUMBER = 0;
DrucStructStat.FLAG_FLATTEN_MODE = Flatten;
DrucStructStat.FLAG_VERBOSE_MODE = Verbose;
DrucStructStat.FLAG_VIEW_RULE_MODE = View_Rules;
DrucStructStat.FILE_ERROR = FileType;
}

View File

@ -0,0 +1,290 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : Drucutil.h |
| |
| Authors : Patrick Renaud |
| |
| Date : 03/07/95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc Defines |
| |
| Defines pour le code |
| |
\------------------------------------------------------------*/
#define DRUC_FALSE 0
#define DRUC_TRUE 1
#define DRUC_MAX_FILE_BUFFER 127
#define DRUC_MAX_STRING_BUFFER 80
#define DRUC_DRC_RULES "DRC_RULES"
#define DRUC_END_DRC_RULES "END_DRC_RULES"
#define DRUC_DRC_COMMENT "DRC_COMMENT"
#define DRUC_DRC_END_COMMENT "END_DRC_COMMENT"
/*------------------------------------------------------------\
| |
| Druc Default Names |
| |
\------------------------------------------------------------*/
#define DRUC_ERROR_FILE_NAME "DRUC_ERROR"
#define DRUC_ERROR_FILE_SUFFIXE ".DRC"
#define DRUC_ERROR_FIGURE_SUFFIXE "_ERR"
#define DRUC_ERROR_EXTEND "_DRC"
/*------------------------------------------------------------\
| |
| Druc Compiler Defines |
| |
| Defines pour les erreurs |
| |
\------------------------------------------------------------*/
#define DRUC_ERROR_NOT_DECLARED_LAYER 21
#define DRUC_ERROR_EMPTY_LAYER 20
#define DRUC_ERROR_NOT_EMPTY_LAYER 19
#define DRUC_ERROR_FILE_PARAM 18
#define DRUC_ERROR_READ_PARAM 17
#define DRUC_ERROR_CLOSE_DRC_FILE 16
#define DRUC_ERROR_COMMENT_FILE 15
#define DRUC_ERROR_BAD_COMMENT 14
#define DRUC_ERROR_MAX_OPERATOR 13
#define DRUC_ERROR_CHECKSUMM 12
#define DRUC_ERROR_MEMOIRE 11
#define DRUC_ERROR_DEFINE_USER_LAYER 10
#define DRUC_ERROR_RULE_NUMBER 9
#define DRUC_ERROR_IN_FILE 8
#define DRUC_ERROR_NO_CHECKSUM 7
#define DRUC_ERROR_NO_RULE_IN_FILE 6
#define DRUC_ERROR_NO_RULE_FILE 5
#define DRUC_ERROR_OUT_FILE 4
#define DRUC_ERROR_OUT_NAME 3
#define DRUC_ERROR_UNDEFINED_LAYER 2
#define DRUC_ERROR_UNDEFINED 1
#define DRUC_GOOD 0
/*------------------------------------------------------------\
| |
| Druc Defines |
| |
| Defines pour les structures |
| |
\------------------------------------------------------------*/
#define DRUC_UNDEFINED_CHECKSUMM -1
#define DRUC_UNDEFINED_CTM -1
#define DRUC_UNDEFINED_FLAGS -1
#define DRUC_FLAG_LAYER_INTERDIT 1
#define DRUC_FLAG_LAYER_LIBRE 2
#define DRUC_FLAG_LAYER_OCCUPE 3
#define DRUC_UNDEFINED_LAYER -1
#define DRUC_UNDEFINED_WIDTH -1
#define DRUC_UNDEFINED_OP_COMPOSE -1
#define DRUC_UNDEFINED_REGLE -1
#define DRUC_UNDEFINED_INSTRUCTION -1
#define DRUC_UNDEFINED_RELATION -1
#define DRUC_UNDEFINED_MESURE -1
#define DRUC_UNDEFINED_OPERATEUR -1
#define DRUC_UNDEFINED_VALEUR -1
#define DRUC_MAX_USER_LAYER 3
#define DRUC_USER_LAYER_0 RDS_MAX_LAYER - 4
#define DRUC_USER_LAYER_1 RDS_MAX_LAYER - 3
#define DRUC_USER_LAYER_2 RDS_MAX_LAYER - 2
/*\
* RDS_MAX_LAYER -1 correspond a RDS_ABOX
\*/
#define DRUC_NO_ERROR_FILE 0
#define DRUC_ERROR_FILE 1
#define DRUC_FLATTEN 0
#define DRUC_HIERARCHIE 1
#define DRUC_SILENT 0
#define DRUC_VERBOSE 1
/*------------------------------------------------------------\
| |
| Druc Maximum de mesures |
| |
\------------------------------------------------------------*/
#define DRUC_MAX_MESURES 8
#define DRUC_UN_CORPS_TRANS_METAL 1000
#define DRUC_UN_CORPS_VIRT_METAL 2000
#define DRUC_DEUX_CORPS_TRANS_METAL 3000
#define DRUC_DEUX_CORPS_VIRT_METAL 4000
#define DRUC_DEUX_CORPS_METAL_TRANS 5000
#define DRUC_DEUX_CORPS_TRANS_TRANS 6000
#define DRUC_DEUX_CORPS_VIRT_TRANS 7000
#define DRUC_DEUX_CORPS_METAL_VIRT 8000
#define DRUC_DEUX_CORPS_TRANS_VIRT 9000
#define DRUC_DEUX_CORPS_VIRT_VIRT 10000
#define DRUC_RULES_BASE_ABOX 11000
/*------------------------------------------------------------\
| |
| Druc Language |
| |
\------------------------------------------------------------*/
#define DRUC_ASM_BEGIN_LAYER 128
#define DRUC_ASM_END_LAYER 129
#define DRUC_ASM_BEGIN_DEFINE 130
#define DRUC_ASM_END_DEFINE 131
#define DRUC_ASM_BEGIN_UNDEFINE 132
#define DRUC_ASM_END_UNDEFINE 133
#define DRUC_ASM_BEGIN_REGLE 134
#define DRUC_ASM_END_REGLE 135
#define DRUC_ASM_BEGIN_CHECKSUMM 136
#define DRUC_ASM_END_CHECKSUMM 137
#define DRUC_COMPOSE_UNION 8
#define DRUC_COMPOSE_INTERSECT 9
#define DRUC_COMPOSE_EXCLUSION 10
#define DRUC_COMPOSE_INCLUSION 11
#define DRUC_COMPOSE_RESIZE 12
#define DRUC_INSTR_CARACTERISE 1
#define DRUC_INSTR_RELATION 2
#define DRUC_RELATION_DISTANCE 16
#define DRUC_RELATION_ENVELOPPE 17
#define DRUC_RELATION_MARGE 18
#define DRUC_RELATION_CROIX 19
#define DRUC_RELATION_INTERSECTION 20
#define DRUC_RELATION_EXTENSION 21
#define DRUC_RELATION_INCLUSION 22
#define DRUC_MESURE_SURFACE_INTER 30
#define DRUC_MESURE_LONGUEUR_INTER 31
#define DRUC_MESURE_LARGEUR_INTER 32
#define DRUC_MESURE_PENETRE_INTER 33
#define DRUC_MESURE_PARALEL_INTER 34
#define DRUC_MESURE_PERPEND_INTER 35
#define DRUC_MESURE_LONGUEUR_MIN 36
#define DRUC_MESURE_LONGUEUR_MAX 37
#define DRUC_MESURE_LARGEUR_MIN 38
#define DRUC_MESURE_LARGEUR_MAX 39
#define DRUC_MESURE_LATERALE_MIN 40
#define DRUC_MESURE_LATERALE_MAX 41
#define DRUC_MESURE_FRONTALE 42
#define DRUC_MESURE_INF 43
#define DRUC_MESURE_SUP 44
#define DRUC_MESURE_AXIALE 45
#define DRUC_MESURE_GEODESIQUE 46
#define DRUC_MESURE_SURFACE 48
#define DRUC_MESURE_LONGUEUR 49
#define DRUC_MESURE_LARGEUR 50
#define DRUC_MESURE_NOTCH 51
#define DRUC_OPERATION_MIN 64
#define DRUC_OPERATION_MAX 65
#define DRUC_OPERATION_INFEQ 66
#define DRUC_OPERATION_SUPEQ 67
#define DRUC_OPERATION_EQUAL 68
#define DRUC_OPERATION_DIFF 69
#define DRUC_OPERATION_INF 70
#define DRUC_OPERATION_SUP 71
/*------------------------------------------------------------\
| |
| Druc Types |
| |
\------------------------------------------------------------*/
typedef char boolean;
typedef struct struct_instruction
{
struct struct_instruction *NEXT;
int INSTRUCTION;
int LAYER_DEST;
int LAYER_1;
int LAYER_2;
int OP_COMPOSE;
int OP_UNAIRE;
long DEF_VALEUR;
int REGLE_NUM [ DRUC_MAX_MESURES ];
int RELATION [ DRUC_MAX_MESURES ];
int MESURE [ DRUC_MAX_MESURES ];
int OP_COMPARE [ DRUC_MAX_MESURES ];
int VALEUR [ DRUC_MAX_MESURES ];
} DrucTypeStructInstruction;
typedef struct struct_rdslayer
{
int RDS_INDEX;
int WIDTH;
int CTM;
int FLAGS;
} DrucTypeStructRdsLayer;
typedef struct struct_stat
{
unsigned long ERROR_NUMBER;
boolean FLAG_FLATTEN_MODE;
boolean FLAG_VERBOSE_MODE;
boolean FLAG_VIEW_RULE_MODE;
boolean FILE_ERROR;
} DrucTypeStructStat;
typedef struct struct_comment
{
struct struct_comment *NEXT;
long RULE;
char *COMMENT;
} DrucTypeStructRuleComment;
/*------------------------------------------------------------\
| |
| Druc variables |
| |
\------------------------------------------------------------*/
extern DrucTypeStructRdsLayer DrucStructRdsLayer[];
extern char *DrucCompilErrorMessage[];
extern DrucTypeStructInstruction *DrucTabInstruction;
extern int DrucNombreInstructions;
extern long DrucCtmMax;
extern DrucTypeStructRuleComment *DrucRuleCommentList;
extern char *DrucErrorMessage [];
extern DrucTypeStructStat DrucStructStat;
/*------------------------------------------------------------\
| |
| Druc Variables RDS |
| |
\------------------------------------------------------------*/
/*
extern char RDS_LAYER_NAME [] [];
*/
/*------------------------------------------------------------\
| |
| Druc Macros |
| |
\------------------------------------------------------------*/
#define DRUC_EXIT(Entier) \
do{ \
extern int vrd_y_lineno; \
fprintf ( stdout, \
"\nline %d DRUC ERROR %d : %s\n", \
vrd_y_lineno, Entier, \
DrucCompilErrorMessage [ Entier ]); \
EXIT( Entier ); \
} while (0)
/*------------------------------------------------------------\
| |
| Druc Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucComputeCheckSumm();
extern char *DrucGetRuleComment ();
extern void DrucViewRuleComment ();
extern chain_list *getrdswindow ();
extern void DrucStatInit ();

View File

@ -0,0 +1,785 @@
/*------------------------------------------------------------\
| |
| Tool : |
| |
| File : VMCARACT.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
#include "vmcmesur.h"
#include "vmcaract.h"
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucNotchTeste |
| |
\------------------------------------------------------------*/
boolean DrucNotchTeste ( DrucInstructionCourante,
IndexMesure,
Mesure
)
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
long Mesure;
{
switch ( DrucInstructionCourante->OP_COMPARE [ IndexMesure ] )
{
case DRUC_OPERATION_INF :
{
if ( Mesure >= DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
return ( DRUC_FALSE );
}
break;
}
case DRUC_OPERATION_INFEQ :
{
if ( Mesure > DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
return ( DRUC_FALSE );
}
break;
}
case DRUC_OPERATION_SUP :
{
if ( Mesure <= DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
return ( DRUC_FALSE );
}
break;
}
case DRUC_OPERATION_SUPEQ :
{
if ( Mesure < DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
return ( DRUC_FALSE );
}
break;
}
case DRUC_OPERATION_DIFF :
{
if ( Mesure == DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
return ( DRUC_FALSE );
}
break;
}
default :
{
/*
* printf (" DrucNotchTeste merde\n");
*/
}
} /* switch */
return ( DRUC_TRUE );
}
/*------------------------------------------------------------\
| |
| DrucCaracteriseNotch |
| |
\------------------------------------------------------------*/
void DrucCaracteriseNotch ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
)
rdsrec_list *TmpRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
DrucTypeStructPlusRect *PlusRec;
DrucTypeStructMesure DrucStructMesure;
rdsrec_list *RectangleCourant;
long PositionX1;
long PositionX2;
long PositionY1;
long PositionY2;
long PositionDX1;
long PositionDX2;
long PositionDY1;
long PositionDY2;
long DistanceX1DX2;
long DistanceX2DX1;
long DistanceY1DY2;
long DistanceY2DY1;
long Mesure;
int TmpCas;
boolean PerimetreInEqui;
DrucStructMesure.LAYER_1 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.LAYER_2 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.RECTANGLE1 = TmpRectangle;
PositionX1 = TmpRectangle->X;
PositionY1 = TmpRectangle->Y;
PositionDX1 = PositionX1 + TmpRectangle->DX;
PositionDY1 = PositionY1 + TmpRectangle->DY;
PlusRec = (DrucTypeStructPlusRect *)
((char *)(TmpRectangle)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)
((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( TmpRectangle != RectangleCourant )
{
PositionX2 = RectangleCourant->X;
PositionY2 = RectangleCourant->Y;
PositionDX2 = PositionX2 + RectangleCourant->DX;
PositionDY2 = PositionY2 + RectangleCourant->DY;
if ( PositionDX1 < PositionX2 ||
PositionDX2 < PositionX1 ||
PositionDY1 < PositionY2 ||
PositionDY2 < PositionY1
)
{
DrucStructMesure.BOOLEEN_DISTANCE = DRUC_TRUE;
DrucStructMesure.RECTANGLE2 = RectangleCourant;
DistanceX2DX1 = PositionX2 - PositionDX1;
DistanceY2DY1 = PositionY2 - PositionDY1;
DistanceX1DX2 = PositionX1 - PositionDX2;
DistanceY1DY2 = PositionY1 - PositionDY2;
Mesure = MACRO_MAX ( MACRO_MAX ( DistanceX1DX2 , DistanceX2DX1 ) ,
MACRO_MAX ( DistanceY1DY2 , DistanceY2DY1 )
);
if ( DrucNotchTeste ( DrucInstructionCourante,
IndexMesure,
Mesure
)
== DRUC_FALSE
)
{
TmpCas = 0;
if ( PositionX1 >= PositionX2 )
{
TmpCas |= 1;
}
if ( PositionDX1 <= PositionDX2 )
{
TmpCas |= 2;
}
if ( PositionY1 >= PositionY2 )
{
TmpCas |= 4;
}
if ( PositionDY1 <= PositionDY2 )
{
TmpCas |= 8;
}
DrucStructMesure.TOPOLOGIE = TmpCas;
/*\
* Pour les cas d'intersection : TmpCas =5 6 9 ou 10
* il faut tester si les 2 rectangles ont un vis a vis ou si ils sont
* en coin; dans le cas de vis a vis il faut un rectangle qui recouvre le notch
* dans le cas de coin il faut soit un rectangle qui recouvre le notch soit 2 rectangles pour recouvrir 2 cotes
* du perimetre de la surface en erreur
\*/
switch ( TmpCas )
{
case 1:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionDX2,
PositionY2,
PositionX1,
PositionDY2
);
break;
}
case 2:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionDX1,
PositionY2,
PositionX2,
PositionDY2
);
break;
}
case 4:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionX2,
PositionDY2,
PositionDX2,
PositionY1
);
break;
}
case 5:
{
if ( ( PositionDY2 < PositionY1) &&
( PositionDX2 < PositionX1)
)
{
PerimetreInEqui = DrucIsPerimetreInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX2 , PositionX1 ),
MACRO_MIN ( PositionDY2 , PositionY1 ),
MACRO_MAX ( PositionDX2 , PositionX1 ),
MACRO_MAX ( PositionDY2 , PositionY1 )
);
if ( PerimetreInEqui == DRUC_FALSE )
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX2 , PositionX1 ),
MACRO_MIN ( PositionDY2 , PositionY1 ),
MACRO_MAX ( PositionDX2 , PositionX1 ),
MACRO_MAX ( PositionDY2 , PositionY1 )
);
}
}
else
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX2 , PositionX1 ),
MACRO_MIN ( PositionDY2 , PositionY1 ),
MACRO_MAX ( PositionDX2 , PositionX1 ),
MACRO_MAX ( PositionDY2 , PositionY1 )
);
}
break;
}
case 6:
{
if ( ( PositionDY2 < PositionY1) &&
( PositionDX1 < PositionX2)
)
{
PerimetreInEqui = DrucIsPerimetreInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX1 , PositionX2 ),
MACRO_MIN ( PositionDY2 , PositionY1 ),
MACRO_MAX ( PositionDX1 , PositionX2 ),
MACRO_MAX ( PositionDY2 , PositionY1 )
);
if ( PerimetreInEqui == DRUC_FALSE )
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX1 , PositionX2 ),
MACRO_MIN ( PositionDY2 , PositionY1 ),
MACRO_MAX ( PositionDX1 , PositionX2 ),
MACRO_MAX ( PositionDY2 , PositionY1 )
);
}
}
else
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX1 , PositionX2 ),
MACRO_MIN ( PositionDY2 , PositionY1 ),
MACRO_MAX ( PositionDX1 , PositionX2 ),
MACRO_MAX ( PositionDY2 , PositionY1 )
);
}
break;
}
case 7:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionX1,
PositionDY2,
PositionDX1,
PositionY1
);
break;
}
case 8:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionX2,
PositionDY1,
PositionDX2,
PositionY2
);
break;
}
case 9:
{
if ( ( PositionDY1 < PositionY2) &&
( PositionDX2 < PositionX1)
)
{
PerimetreInEqui = DrucIsPerimetreInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX2 , PositionX1 ),
MACRO_MIN ( PositionDY1 , PositionY2 ),
MACRO_MAX ( PositionDX2 , PositionX1 ),
MACRO_MAX ( PositionDY1 , PositionY2 )
);
if ( PerimetreInEqui == DRUC_FALSE )
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX2 , PositionX1 ),
MACRO_MIN ( PositionDY1 , PositionY2 ),
MACRO_MAX ( PositionDX2 , PositionX1 ),
MACRO_MAX ( PositionDY1 , PositionY2 )
);
}
}
else
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX2 , PositionX1 ),
MACRO_MIN ( PositionDY1 , PositionY2 ),
MACRO_MAX ( PositionDX2 , PositionX1 ),
MACRO_MAX ( PositionDY1 , PositionY2 )
);
}
break;
}
case 10:
{
if ( ( PositionDY1 < PositionY2) &&
( PositionDX1 < PositionX2)
)
{
PerimetreInEqui = DrucIsPerimetreInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX1 , PositionX2 ),
MACRO_MIN ( PositionDY1 , PositionY2 ),
MACRO_MAX ( PositionDX1 , PositionX2 ),
MACRO_MAX ( PositionDY1 , PositionY2 )
);
if ( PerimetreInEqui == DRUC_FALSE )
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX1 , PositionX2 ),
MACRO_MIN ( PositionDY1 , PositionY2 ),
MACRO_MAX ( PositionDX1 , PositionX2 ),
MACRO_MAX ( PositionDY1 , PositionY2 )
);
}
}
else
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_MIN ( PositionDX1 , PositionX2 ),
MACRO_MIN ( PositionDY1 , PositionY2 ),
MACRO_MAX ( PositionDX1 , PositionX2 ),
MACRO_MAX ( PositionDY1 , PositionY2 )
);
}
break;
}
case 11:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionX1,
PositionDY1,
PositionDX1,
PositionY2
);
break;
}
case 13:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionDX2,
PositionY1,
PositionX1,
PositionDY1
);
break;
}
case 14:
{
DrucIsPositionInclusInEqui ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionDX1,
PositionY1,
PositionX2,
PositionDY1
);
break;
}
}
}
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)
((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
}
/*------------------------------------------------------------\
| |
| DrucCaracteriseTeste |
| |
\------------------------------------------------------------*/
void DrucCaracteriseTeste ( TmpRectangle,
DrucInstructionCourante,
IndexMesure,
Mesure
)
rdsrec_list *TmpRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
long Mesure;
{
switch ( DrucInstructionCourante->OP_COMPARE [ IndexMesure ] )
{
case DRUC_OPERATION_INF :
{
if ( Mesure >= DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
DrucErreurUnCorps ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_OPERATION_INFEQ :
case DRUC_OPERATION_MAX :
/*\
* a cause de l'unification les 2 sont identiques ici
\*/
{
if ( Mesure > DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
DrucErreurUnCorps ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_OPERATION_SUP :
{
if ( Mesure <= DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
DrucErreurUnCorps ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_OPERATION_SUPEQ :
case DRUC_OPERATION_MIN :
/*\
* a cause de l'unification les 2 sont identiques ici
\*/
{
if ( Mesure < DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
DrucErreurUnCorps ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_OPERATION_DIFF :
{
if ( Mesure == DrucInstructionCourante->VALEUR [ IndexMesure ] )
{
DrucErreurUnCorps ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
}
}
/*------------------------------------------------------------\
| |
| DrucCaracteriseTesteInter |
| |
\------------------------------------------------------------*/
void DrucCaracteriseTesteSurface ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
)
rdsrec_list *TmpRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
DrucTypeStructPlusRect *PlusRec;
DrucTypeStructMesure DrucStructMesure;
rdsrec_list *RectangleCourant;
DrucStructMesure.LAYER_1 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.LAYER_2 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.RECTANGLE1 = TmpRectangle;
PlusRec = (DrucTypeStructPlusRect *)((char *)(TmpRectangle)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( TmpRectangle != RectangleCourant )
{
if ( DrucIsRectanglesContact ( TmpRectangle,
RectangleCourant
)
== DRUC_TRUE
)
{
DrucStructMesure.RECTANGLE2 = RectangleCourant;
DrucRelationMesure ( &DrucStructMesure
);
DrucMesureInter ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER_1
);
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
}
/*------------------------------------------------------------\
| |
| DrucCaracteriseTesteLargeur |
| |
\------------------------------------------------------------*/
void DrucCaracteriseTesteLargeur ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
)
rdsrec_list *TmpRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
DrucTypeStructPlusRect *PlusRec;
DrucTypeStructMesure DrucStructMesure;
rdsrec_list *RectangleCourant;
DrucStructMesure.LAYER_1 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.LAYER_2 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.RECTANGLE1 = TmpRectangle;
PlusRec = (DrucTypeStructPlusRect *)((char *)(TmpRectangle)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( TmpRectangle != RectangleCourant )
{
if ( DrucIsRectanglesContact ( TmpRectangle,
RectangleCourant
)
== DRUC_TRUE
)
{
DrucStructMesure.RECTANGLE2 = RectangleCourant;
DrucRelationMesure ( &DrucStructMesure
);
DrucMesureInter ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER_1
);
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
}
/*------------------------------------------------------------\
| |
| DrucCaracteriseTesteLongueur |
| |
\------------------------------------------------------------*/
void DrucCaracteriseTesteLongueur ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
)
rdsrec_list *TmpRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
DrucTypeStructPlusRect *PlusRec;
DrucTypeStructMesure DrucStructMesure;
rdsrec_list *RectangleCourant;
DrucStructMesure.LAYER_1 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.LAYER_2 = DrucInstructionCourante->LAYER_1;
DrucStructMesure.RECTANGLE1 = TmpRectangle;
PlusRec = (DrucTypeStructPlusRect *)((char *)(TmpRectangle)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( TmpRectangle != RectangleCourant )
{
if ( DrucIsRectanglesContact ( TmpRectangle,
RectangleCourant
)
== DRUC_TRUE
)
{
DrucStructMesure.RECTANGLE2 = RectangleCourant;
DrucRelationMesure ( &DrucStructMesure
);
DrucMesureInter ( &DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER_1
);
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
}
/*------------------------------------------------------------\
| |
| DrucCaracterise |
| |
\------------------------------------------------------------*/
void DrucCaracterise ( DrucFigureRds,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
DrucTypeStructInstruction *DrucInstructionCourante;
{
rdsrec_list *TmpRectangle;
int IndexMesure;
long MesureMax;
long MesureMin;
for ( TmpRectangle = DrucFigureRds->LAYERTAB[ DrucInstructionCourante->LAYER_1 ];
TmpRectangle != (rdsrec_list *)NULL;
TmpRectangle = TmpRectangle->NEXT
)
{
MesureMax = ( TmpRectangle->DX > TmpRectangle->DY ?
TmpRectangle->DX :
TmpRectangle->DY
);
MesureMin = ( TmpRectangle->DX < TmpRectangle->DY ?
TmpRectangle->DX :
TmpRectangle->DY
);
IndexMesure = 0;
while ( ( DrucInstructionCourante->MESURE [ IndexMesure ] !=
DRUC_UNDEFINED_MESURE
) &&
( IndexMesure != DRUC_MAX_MESURES
)
)
{
switch ( DrucInstructionCourante->MESURE [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucCaracteriseTesteSurface ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucCaracteriseTesteLongueur ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucCaracteriseTesteLargeur ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
break;
}
case DRUC_MESURE_LARGEUR :
{
DrucCaracteriseTeste ( TmpRectangle,
DrucInstructionCourante,
IndexMesure,
MesureMin
);
break;
}
case DRUC_MESURE_LONGUEUR :
{
DrucCaracteriseTeste ( TmpRectangle,
DrucInstructionCourante,
IndexMesure,
MesureMax
);
break;
}
case DRUC_MESURE_SURFACE :
{
DrucCaracteriseTeste ( TmpRectangle,
DrucInstructionCourante,
IndexMesure,
MesureMin * MesureMax
);
break;
}
case DRUC_MESURE_NOTCH :
{
DrucCaracteriseNotch ( TmpRectangle,
DrucInstructionCourante,
IndexMesure
);
break;
}
} /* switch */
IndexMesure ++;
} /* while IndexMesure */
} /* for TmpRectangle */
}

View File

@ -0,0 +1,52 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCARACT.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmCaract Defines |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmCaract Macros |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmCaract variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmCaract Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucErreurUnCorps |
| |
\------------------------------------------------------------*/
extern void DrucErreurUnCorps ();
extern void DrucCaractLargeurInf ();
extern void DrucCaractLargeurSup ();
extern void DrucCaractLargeurSupEq ();
extern void DrucCaractLargeurInfEq ();
extern void DrucCaractLongueurInf ();
extern void DrucCaractLongueurSup ();
extern void DrucCaractLongueurSupEq ();
extern void DrucCaractLongueurInfEq ();
extern void DrucCaractLargeurMin ();
extern void DrucCaractLargeurMax ();
extern void DrucCaractLongueurMin ();
extern void DrucCaractLongueurMax ();
extern void DrucCaracteriseRectangle ();
extern void DrucCaracteriseEquipot ();
extern void DrucCaracterise ();

View File

@ -0,0 +1,329 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCASMLD.C |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <malloc.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucompi_y.h"
#include "drucutil.h"
#include "vmctools.h"
#include "drucompi.h"
#include "druchier.h"
#include "vmcasmld.h"
/*------------------------------------------------------------\
| |
| DRUCVMC variables |
| |
\------------------------------------------------------------*/
extern long DrucCtmMax;
extern DrucTypeStructRuleComment *DrucRuleCommentList;
static char DrucFileBuffer [ DRUC_MAX_FILE_BUFFER + 1 ];
/*------------------------------------------------------------\
| |
| DRUVMC Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucComputeCtm |
| |
\------------------------------------------------------------*/
void DrucComputeCtm ( DrucInstructionCourante
)
DrucTypeStructInstruction *DrucInstructionCourante;
{
int IndexInstruction;
long Value;
int IndexMesure = 0;
while ( DrucInstructionCourante->RELATION [ IndexMesure ]
!= DRUC_UNDEFINED_RELATION
)
{
if ( ( DrucInstructionCourante->MESURE [ IndexMesure ]
== DRUC_MESURE_AXIALE )
||
( DrucInstructionCourante->MESURE [ IndexMesure ]
== DRUC_MESURE_GEODESIQUE )
)
{
Value = DrucInstructionCourante->VALEUR [ IndexMesure ];
DrucCtmMax = ( DrucCtmMax > Value ?
DrucCtmMax :
Value
);
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].CTM =
( Value > DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].CTM ?
Value :
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].CTM
);
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].CTM =
( Value > DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].CTM ?
Value :
DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].CTM
);
}
IndexMesure ++;
}
}
/*------------------------------------------------------------\
| |
| DrucReadRulesComment |
| |
\------------------------------------------------------------*/
void DrucReadRulesComment (
)
{
long Rule;
DrucTypeStructRuleComment *Comment;
char *Flag;
char *TmpBuffer;
while ( 1
)
{
Flag = fgets( DrucFileBuffer, DRUC_MAX_FILE_BUFFER, vrd_y_in );
if ( Flag != (char *)NULL
)
{
if ( strstr( DrucFileBuffer, DRUC_DRC_END_COMMENT ) != (char *)NULL
)
{
return;
}
if ( sscanf ( DrucFileBuffer, "%ld\n", &Rule ) == EOF
)
{
DRUC_EXIT( DRUC_ERROR_BAD_COMMENT );
}
TmpBuffer = strchr ( DrucFileBuffer, ' '
);
TmpBuffer ++;
Comment = (DrucTypeStructRuleComment *)
rdsalloc( sizeof( DrucTypeStructRuleComment ),
1
);
Comment->NEXT = DrucRuleCommentList;
DrucRuleCommentList = Comment;
Comment->RULE = Rule;
Comment->COMMENT = (char *)rdsalloc( strlen( DrucFileBuffer ) + 1, 0 );
strcpy ( Comment->COMMENT, TmpBuffer
);
}
}
}
/*------------------------------------------------------------\
| |
| DrucInitInstruction |
| |
| Ouvre le fichier contenant le code assembleur de DRUC |
| Lit et charge le code dans la pile d'execution |
| Initialise la structure DrucStructRdsLayer |
| Initialise la structure DrucStructDefine |
| Initialise la structure DrucStructRegle |
\------------------------------------------------------------*/
int DrucInitInstruction ( DrucTabInstruction
)
DrucTypeStructInstruction **DrucTabInstruction;
{
int TmpIndexMesure;
int TmpResultat;
int IndexLayer;
boolean FlagBegin;
char *FlagBuffer;
DrucTypeStructInstruction *TmpStructInstruction;
DrucInitStructLayers (
);
vrd_y_in = fopen ( RDS_TECHNO_NAME ,
"r"
);
if ( vrd_y_in == (FILE *)NULL
)
{
DRUC_EXIT ( DRUC_ERROR_NO_RULE_FILE
);
}
FlagBegin = DRUC_FALSE;
FlagBuffer = (char *)NULL;
while ( FlagBegin != DRUC_TRUE
)
{
FlagBuffer = fgets ( DrucFileBuffer,
DRUC_MAX_FILE_BUFFER,
vrd_y_in
);
if ( FlagBuffer != (char *)NULL
)
{
if ( strstr ( DrucFileBuffer, DRUC_DRC_RULES ) != (char *)NULL
)
{
FlagBegin = DRUC_TRUE;
}
}
else
{
DRUC_EXIT ( DRUC_ERROR_NO_RULE_IN_FILE
);
}
}
DrucStructInstruction = ( DrucTypeStructInstruction *)NULL;
TmpResultat = vrd_y_parse();
DrucViewString ("\n");
if ( DrucStructStat.FLAG_FLATTEN_MODE == DRUC_HIERARCHIE
)
{
DrucAddABoxRules ( & DrucStructInstruction,
& DrucNombreInstructions
);
}
*DrucTabInstruction =
( DrucTypeStructInstruction *)malloc
(sizeof ( DrucTypeStructInstruction ) * DrucNombreInstructions );
for ( IndexLayer = DrucNombreInstructions - 1;
IndexLayer >= 0;
IndexLayer --
)
{
(*DrucTabInstruction) [ IndexLayer ].NEXT = (DrucTypeStructInstruction *)NULL;
(*DrucTabInstruction) [ IndexLayer ].INSTRUCTION = DrucStructInstruction->INSTRUCTION;
(*DrucTabInstruction) [ IndexLayer ].LAYER_DEST = DrucStructInstruction->LAYER_DEST;
(*DrucTabInstruction) [ IndexLayer ].OP_COMPOSE = DrucStructInstruction->OP_COMPOSE;
(*DrucTabInstruction) [ IndexLayer ].LAYER_1 = DrucStructInstruction->LAYER_1;
(*DrucTabInstruction) [ IndexLayer ].LAYER_2 = DrucStructInstruction->LAYER_2;
(*DrucTabInstruction) [ IndexLayer ].OP_UNAIRE = DrucStructInstruction->OP_UNAIRE ;
(*DrucTabInstruction) [ IndexLayer ].DEF_VALEUR = DrucStructInstruction->DEF_VALEUR;
for ( TmpIndexMesure = 0;
TmpIndexMesure < DRUC_MAX_MESURES;
TmpIndexMesure ++
)
{
(*DrucTabInstruction) [ IndexLayer ].REGLE_NUM [ TmpIndexMesure ] =
DrucStructInstruction->REGLE_NUM [ TmpIndexMesure ] ;
(*DrucTabInstruction) [ IndexLayer ].RELATION [ TmpIndexMesure ] =
DrucStructInstruction->RELATION [ TmpIndexMesure ] ;
(*DrucTabInstruction) [ IndexLayer ].MESURE [ TmpIndexMesure ] =
DrucStructInstruction->MESURE [ TmpIndexMesure ] ;
(*DrucTabInstruction) [ IndexLayer ].OP_COMPARE [ TmpIndexMesure ] =
DrucStructInstruction->OP_COMPARE [ TmpIndexMesure ] ;
(*DrucTabInstruction) [ IndexLayer ].VALEUR [ TmpIndexMesure ] =
DrucStructInstruction->VALEUR [ TmpIndexMesure ] ;
}
TmpStructInstruction = DrucStructInstruction;
DrucStructInstruction = DrucStructInstruction->NEXT;
free ( TmpStructInstruction
);
}
for ( IndexLayer = 0;
IndexLayer < DrucNombreInstructions -1;
IndexLayer ++
)
{
(*DrucTabInstruction)[ IndexLayer ].NEXT = (*DrucTabInstruction) +1;
}
/*\
* DrucNombreInstructions = DrucReadAsm ( & DrucTabInstruction
* );
\*/
FlagBegin = DRUC_FALSE;
FlagBuffer = (char *)NULL;
while ( FlagBegin != DRUC_TRUE
)
{
FlagBuffer = fgets ( DrucFileBuffer,
DRUC_MAX_FILE_BUFFER,
vrd_y_in
);
if ( FlagBuffer != (char *)NULL
)
{
if ( strstr ( DrucFileBuffer, DRUC_DRC_COMMENT ) != (char *)NULL
)
{
FlagBegin = DRUC_TRUE;
}
}
else
{
DRUC_EXIT ( DRUC_ERROR_COMMENT_FILE
);
}
}
DrucReadRulesComment (
);
fclose ( vrd_y_in
);
return ( DrucNombreInstructions
);
}

View File

@ -0,0 +1,27 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCASMLD.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcAsmLd variables |
| |
\------------------------------------------------------------*/
#define DRUC_FLATTEN_RULES 0
#define DRUC_HIERARCHICAL_RULES 1
/*------------------------------------------------------------\
| |
| Druc VmcAsmLd Fonctions |
| |
\------------------------------------------------------------*/
extern int DrucReadNextCodeAsm ();
extern int DrucInitInstruction ();
extern int DrucReadAsm ();

View File

@ -0,0 +1,478 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCERROR.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 25/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Modifs |
| 25/01/94: ligne 407 rajoutee (elle etait oubliee) |
| char *DrucFigureRdsErrorName; |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcasmld.h"
#include "vmcaract.h"
#include "defdefin.h"
#include "vmcmesur.h"
#include "vmcrelat.h"
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
rdsfig_list *DrucFigureRdsErreur;
FILE *DrucErrorFile;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucOpenErrorFile |
| |
\------------------------------------------------------------*/
void DrucOpenErrorFile ( DrucErrorFileName,
Mode
)
char *DrucErrorFileName;
char *Mode;
{
if ( DrucStructStat.FILE_ERROR == DRUC_ERROR_FILE
)
{
DrucErrorFile = fopen ( DrucErrorFileName,
Mode
);
}
}
/*------------------------------------------------------------\
| |
| DrucCloseErrorFile |
| |
\------------------------------------------------------------*/
void DrucCloseErrorFile (
)
{
if ( DrucStructStat.FILE_ERROR == DRUC_ERROR_FILE
)
{
fclose ( DrucErrorFile
);
}
}
/*------------------------------------------------------------\
| |
| DrucErreurOutFileRectangle |
| |
\------------------------------------------------------------*/
void DrucErreurOutFileRectangle ( RectangleErreur
)
rdsrec_list *RectangleErreur;
{
if ( DrucStructStat.FILE_ERROR == DRUC_ERROR_FILE
)
{
fprintf ( DrucErrorFile ,
"\tX = %.1f \t" ,
RectangleErreur->X / (float)RDS_LAMBDA );
fprintf ( DrucErrorFile ,
"Y = %.1f \t" ,
RectangleErreur->Y / (float)RDS_LAMBDA );
fprintf ( DrucErrorFile ,
"DX = %.1f \t" ,
RectangleErreur->DX / (float)RDS_LAMBDA);
fprintf ( DrucErrorFile ,
"DY = %.1f \t\n" ,
RectangleErreur->DY / (float)RDS_LAMBDA);
fflush (DrucErrorFile);
}
}
/*------------------------------------------------------------\
| |
| DrucErreurOutFileRegle |
| |
\------------------------------------------------------------*/
void DrucErreurOutFileRegle ( Regle
)
int Regle;
{
extern DrucTypeStructRuleComment *DrucRuleCommentList;
DrucTypeStructRuleComment *Comment;
if ( DrucStructStat.FILE_ERROR == DRUC_ERROR_FILE
)
{
fprintf ( DrucErrorFile ,
"\nERROR Code %4d: ",
Regle
);
for (Comment = DrucRuleCommentList;
Comment && (Comment->RULE != Regle);
Comment = Comment->NEXT);
if (Comment)
fprintf ( DrucErrorFile ,
"%s\n",
Comment->COMMENT
);
else
fprintf ( DrucErrorFile ,
"NO MESSAGE\n"
);
}
}
/*------------------------------------------------------------\
| |
| DrucErreurOutFileMesure |
| |
\------------------------------------------------------------*/
void DrucErreurOutFileMesure ( Mesure
)
float Mesure;
{
if ( DrucStructStat.FILE_ERROR == DRUC_ERROR_FILE
)
{
fprintf ( DrucErrorFile ,
"Mesure Effectuee :%.1f\n",
Mesure
);
}
}
/*------------------------------------------------------------\
| |
| DrucErreurOutFileLayer |
| |
\------------------------------------------------------------*/
void DrucErreurOutFileLayer ( IndexLayer
)
int IndexLayer;
{
if ( DrucStructStat.FILE_ERROR == DRUC_ERROR_FILE
)
{
fprintf ( DrucErrorFile ,
"\tLayer %s :",
( RDS_LAYER_NAME [ IndexLayer ]) + 4
);
}
}
/*------------------------------------------------------------\
| |
| DrucErreurUnRectangle |
| si on a une composition se composition il faut |
| re une boucle qui balaye toutes les compositions |
| |
\------------------------------------------------------------*/
rdsrec_list * DrucErreurUnRectangle ( DrucRectangle,
DrucInstructionCourante,
IndexMesure,
IndexLayer
)
rdsrec_list *DrucRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
int IndexLayer;
{
register rdsrec_list *RectangleOrigine;
register rdsrec_list *RectangleErreurPrec;
register rdsrec_list *RectangleErreur;
register DrucTypeStructPlusRect *TmpPlusRec;
/*\
DrucViewString ("\nDrucErreurUnRectangle\n");
DrucViewRectangle (&DrucRectangle);
\*/
TmpPlusRec = MACRO_NEXT_DEFINE ( DrucRectangle );
if ( TmpPlusRec != ( DrucTypeStructPlusRect *)NULL
)
{
RectangleErreur = allocrdsrec ( sizeof ( DrucTypeStructPlusRect )
);
RectangleOrigine = TmpPlusRec->NEXT_EQUI;
RectangleErreur->X = RectangleOrigine->X;
RectangleErreur->Y = RectangleOrigine->Y;
RectangleErreur->DX = RectangleOrigine->DX;
RectangleErreur->DY = RectangleOrigine->DY;
SetRdsLayer ( RectangleErreur,
GetRdsLayer ( RectangleOrigine )
);
MACRO_REGLE_NUM (RectangleErreur ) = DrucInstructionCourante->REGLE_NUM [ IndexMesure ];
MACRO_NEXT_EQUI (RectangleErreur ) = RectangleErreur;
/*\
* ca fait voir et mettre dans la figure des erreurs le rectangle
* user ce qui n'est pas utile
*
DrucErreurOutFileRectangle ( RectangleErreur
);
\*/
DrucAddRecFigure ( RectangleErreur,
DrucFigureRdsErreur,
TmpPlusRec->NOMBRE
);
/*\
* recopie de la liste des rectangles origines dans la rdsErreur
\*/
/*\
modif 08 03 94 : la ligne est reportee dans la boucle while
TmpPlusRec = TmpPlusRec->NEXT_DEFINE;
\*/
while ( TmpPlusRec != ( DrucTypeStructPlusRect *)NULL
)
{
/*\
* chainage circulaire des rectangles composant le RECTANGLE1
\*/
RectangleErreurPrec = RectangleErreur;
RectangleErreur = allocrdsrec ( sizeof
( DrucTypeStructPlusRect
)
);
MACRO_NEXT_EQUI (RectangleErreur ) = MACRO_NEXT_EQUI ( RectangleErreurPrec );
MACRO_NEXT_EQUI (RectangleErreurPrec ) = RectangleErreur;
RectangleOrigine = TmpPlusRec->NEXT_EQUI;
RectangleErreur->X = RectangleOrigine->X;
RectangleErreur->Y = RectangleOrigine->Y;
RectangleErreur->DX = RectangleOrigine->DX;
RectangleErreur->DY = RectangleOrigine->DY;
SetRdsLayer ( RectangleErreur,
TmpPlusRec->NOMBRE
);
MACRO_REGLE_NUM (RectangleErreur ) = DrucInstructionCourante->REGLE_NUM [ IndexMesure ];
DrucErreurOutFileLayer ( TmpPlusRec->NOMBRE
);
DrucErreurOutFileRectangle ( RectangleErreur
);
DrucAddRecFigure ( RectangleErreur,
DrucFigureRdsErreur,
TmpPlusRec->NOMBRE
);
/*\
modif 08 03 94 : la ligne suivante est rajoutee
\*/
TmpPlusRec = TmpPlusRec->NEXT_DEFINE;
}
}
else
{
/*\
* recopie des infos du rectangle origine dans la rdsErreur
\*/
RectangleErreur = allocrdsrec ( sizeof ( DrucTypeStructPlusRect )
);
RectangleErreur->X = DrucRectangle->X;
RectangleErreur->Y = DrucRectangle->Y;
RectangleErreur->DX = DrucRectangle->DX;
RectangleErreur->DY = DrucRectangle->DY;
SetRdsLayer ( RectangleErreur,
IndexLayer
);
MACRO_REGLE_NUM (RectangleErreur ) =
DrucInstructionCourante->REGLE_NUM [ IndexMesure ];
MACRO_NEXT_EQUI ( RectangleErreur ) = RectangleErreur;
DrucErreurOutFileLayer ( IndexLayer
);
DrucErreurOutFileRectangle ( RectangleErreur
);
DrucAddRecFigure ( RectangleErreur,
DrucFigureRdsErreur,
IndexLayer
);
}
return ( RectangleErreur
);
}
/*------------------------------------------------------------\
| |
| DrucErreurUnCorps |
| |
\------------------------------------------------------------*/
void DrucErreurUnCorps ( DrucRectangle,
DrucInstructionCourante,
IndexMesure
)
rdsrec_list *DrucRectangle;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
DrucStructStat.ERROR_NUMBER ++;
DrucErreurOutFileRegle ( DrucInstructionCourante->REGLE_NUM[IndexMesure]
);
/*\
* l'instruction est reportee dans l'affichage des rectangles
DrucErreurOutFileLayer ( DrucInstructionCourante->LAYER_1
);
\*/
DrucErreurUnRectangle ( DrucRectangle,
DrucInstructionCourante,
IndexMesure,
DrucInstructionCourante->LAYER_1
);
}
/*------------------------------------------------------------\
| |
| DrucErreurDeuxCorps |
| |
\------------------------------------------------------------*/
void DrucErreurDeuxCorps ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
DrucTypeStructInstruction *DrucInstructionCourante;
DrucTypeStructMesure *DrucStructMesure;
int IndexMesure;
{
rdsrec_list *First;
rdsrec_list *Second;
rdsrec_list *Link;
DrucStructStat.ERROR_NUMBER ++;
DrucErreurOutFileRegle ( DrucInstructionCourante->REGLE_NUM[IndexMesure]
);
/*\
modif 21/01/94 a la demande d'alain:
suppression de la mesure
DrucErreurOutFileMesure ( DrucStructMesure->MESURE_EFFECTIVE / (float)RDS_LAMBDA
);
suppression de l'affichage du layer user
la fonction est reportee dans l'affichage d'un rectangle
DrucErreurOutFileLayer ( DrucStructMesure->LAYER_1
);
\*/
First = DrucErreurUnRectangle ( DrucStructMesure->RECTANGLE1,
DrucInstructionCourante,
IndexMesure,
DrucStructMesure->LAYER_1
);
/*\
suppression de l'affichage du layer user
la fonction est reportee dans l'affichage d'un rectangle
DrucErreurOutFileLayer ( DrucStructMesure->LAYER_2
);
\*/
Second = DrucErreurUnRectangle ( DrucStructMesure->RECTANGLE2,
DrucInstructionCourante,
IndexMesure,
DrucStructMesure->LAYER_2
);
Link = MACRO_NEXT_EQUI ( First );
MACRO_NEXT_EQUI ( First ) = MACRO_NEXT_EQUI ( Second );
MACRO_NEXT_EQUI ( Second ) = Link;
}
/*------------------------------------------------------------\
| |
| DrucErreurCleanFigureErreur |
| |
\------------------------------------------------------------*/
void DrucErreurCleanFigureErreur ( DrucFigureRdsErreur,
DrucFigureRdsErrorName
)
rdsfig_list *DrucFigureRdsErreur;
char *DrucFigureRdsErrorName;
{
if ( DrucFigureRdsErreur != ( rdsfig_list *)NULL
)
{
delrdsfig ( DrucFigureRdsErrorName
);
DrucFigureRdsErreur = ( rdsfig_list *)NULL;
}
}

View File

@ -0,0 +1,40 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCERROR.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcError Defines |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcError Macros |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcError variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
extern FILE *DrucErrorFile;
/*------------------------------------------------------------\
| |
| Druc VmcError Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucErreurUnCorps ();
extern void DrucErreurDeuxCorps ();
extern void DrucErreurOutFileRectangle ();
extern void DrucErreurOutFileRegle ();
extern void DrucErreurOutFileLayer ();
extern void DrucErreurUnRectangle ();
extern void DrucErreurCleanFigureErreur ();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCMESUR.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcMesur Macros |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcMesur Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucRelationSetDistance ();
extern void DrucRelationMesure ();
extern void DrucRelationTeste ();

View File

@ -0,0 +1,986 @@
/*-----------------------------------------------------------*\
| |
| Tool : DRUC |
| |
| File : VMCRELAT.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
#include "druchier.h"
#include "vmcasmld.h"
#include "vmcmesur.h"
#include "vmcrelat.h"
/*------------------------------------------------------------\
| |
| Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucRelationDilateRectangle |
| |
\------------------------------------------------------------*/
void DrucRelationDilateRectangle ( DrucRdsWindow,
DrucInstructionCourante,
RectangleOrigine,
DilateX,
DilateY,
DilateDX,
DilateDY
)
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
rdsrec_list *RectangleOrigine;
long *DilateX;
long *DilateY;
long *DilateDX;
long *DilateDY;
{
int IndexMesure;
long DistanceInfluence;
long Ctm1;
long Ctm2;
long PositionDx = RectangleOrigine->X + RectangleOrigine->DX;
long PositionDy = RectangleOrigine->Y + RectangleOrigine->DY;
IndexMesure = 0;
while ( ( DrucInstructionCourante->RELATION [ IndexMesure ] !=
DRUC_UNDEFINED_MESURE
) &&
( IndexMesure != DRUC_MAX_MESURES
)
)
{
if ( DrucInstructionCourante->RELATION [ IndexMesure ] ==
DRUC_RELATION_DISTANCE
)
{
Ctm1 = DrucStructRdsLayer [ DrucInstructionCourante->LAYER_1 ].CTM;
Ctm2 = DrucStructRdsLayer [ DrucInstructionCourante->LAYER_2 ].CTM;
DistanceInfluence = ( Ctm1 > Ctm2 ?
Ctm1 :
Ctm2
);
*DilateX = ( ( RectangleOrigine->X - DistanceInfluence ) <
DrucRdsWindow->XMIN ?
DrucRdsWindow->XMIN :
RectangleOrigine->X - DistanceInfluence
);
*DilateY = ( ( RectangleOrigine->Y - DistanceInfluence ) <
DrucRdsWindow->YMIN ?
DrucRdsWindow->YMIN :
RectangleOrigine->Y - DistanceInfluence
);
*DilateDX = ( ( PositionDx + DistanceInfluence ) >
DrucRdsWindow->XMAX ?
DrucRdsWindow->XMAX - *DilateX :
PositionDx + DistanceInfluence - *DilateX
);
*DilateDY = ( ( PositionDy + DistanceInfluence ) >
DrucRdsWindow->YMAX ?
DrucRdsWindow->YMAX - *DilateY :
PositionDy + DistanceInfluence - *DilateY
);
return;
}
IndexMesure ++;
}
*DilateX = RectangleOrigine->X;
*DilateY = RectangleOrigine->Y;
*DilateDX = RectangleOrigine->DX;
*DilateDY = RectangleOrigine->DY;
}
/*------------------------------------------------------------\
| |
| DrucCompareDistance |
| |
\------------------------------------------------------------*/
void DrucRelationCompareDistance ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
long TmpHypotenuse;
if ( ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_MARGE ) ||
( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_EXTENSION )
)
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_AXIALE :
case DRUC_MESURE_GEODESIQUE :
{
DrucRelationTesteDistance ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_DISTANCE
);
break;
}
} /* switch */
} /* if orientation */
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_INTERSECTION
)
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_AXIALE :
{
DrucRelationTesteDistance ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_DISTANCE
);
break;
}
case DRUC_MESURE_GEODESIQUE :
{
TmpHypotenuse = (long) sqrt ( ( MACRO_LONG_DISTANCE * MACRO_LONG_DISTANCE ) +
( MACRO_LARGE_DISTANCE * MACRO_LARGE_DISTANCE )
);
DrucRelationTesteDistance ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
TmpHypotenuse
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucCompareEnveloppe |
| |
\------------------------------------------------------------*/
void DrucRelationCompareEnveloppe ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_ENVELOPPE )
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MIN,
MACRO_RECT_LONG_MIN
);
break;
}
case DRUC_MESURE_LONGUEUR_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MAX,
MACRO_RECT_LONG_MAX
);
break;
}
case DRUC_MESURE_LARGEUR_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_MAX,
MACRO_RECT_LARGE_MAX
);
break;
}
case DRUC_MESURE_LARGEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_MIN,
MACRO_RECT_LARGE_MIN
);
break;
}
case DRUC_MESURE_SUP :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SUP,
MACRO_RECT_SUP
);
break;
}
case DRUC_MESURE_INF :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_INF,
MACRO_RECT_INF
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucRelationCompareMarge |
| |
\------------------------------------------------------------*/
void DrucRelationCompareMarge ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_MARGE )
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER
);
break;
}
case DRUC_MESURE_PENETRE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_PENETRE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MAX,
MACRO_RECT_LONG_MAX
);
break;
}
case DRUC_MESURE_LONGUEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MIN,
MACRO_RECT_LONG_MIN
);
break;
}
case DRUC_MESURE_LARGEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_MIN,
MACRO_RECT_LARGE_MIN
);
break;
}
case DRUC_MESURE_LARGEUR_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_MAX,
MACRO_RECT_LARGE_MAX
);
break;
}
case DRUC_MESURE_LATERALE_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LATER_MIN,
MACRO_RECT_LATER_MIN
);
break;
}
case DRUC_MESURE_LATERALE_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LATER_MAX,
MACRO_RECT_LATER_MAX
);
break;
}
case DRUC_MESURE_FRONTALE :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_FRONT,
MACRO_RECT_FRONT
);
break;
}
case DRUC_MESURE_SUP :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SUP,
MACRO_RECT_SUP
);
break;
}
case DRUC_MESURE_INF :
{
/*\
printf ("\nDRUC_MESURE_SUP %d \n",(DrucInstructionCourante->MESURE) [ IndexMesure ]);
\*/
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_INF,
MACRO_RECT_INF
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucRelationCompareCroix |
| |
\------------------------------------------------------------*/
void DrucRelationCompareCroix ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_CROIX )
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER
);
break;
}
case DRUC_MESURE_PARALEL_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_PARAL_INTER
);
break;
}
case DRUC_MESURE_PERPEND_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_PERPEN_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MIN,
MACRO_RECT_LONG_MIN
);
break;
}
case DRUC_MESURE_LONGUEUR_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MAX,
MACRO_RECT_LONG_MAX
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucRelationCompareIntersection |
| |
\------------------------------------------------------------*/
void DrucRelationCompareIntersection ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_INTERSECTION )
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_MAX :
case DRUC_MESURE_LONGUEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MAX,
MACRO_RECT_LONG_MAX
);
break;
}
case DRUC_MESURE_LARGEUR_MAX :
case DRUC_MESURE_LARGEUR_MIN :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_MAX,
MACRO_RECT_LARGE_MAX
);
break;
}
case DRUC_MESURE_SUP :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SUP,
MACRO_RECT_SUP
);
break;
}
case DRUC_MESURE_INF :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_INF,
MACRO_RECT_INF
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucRelationCompareExtension |
| |
\------------------------------------------------------------*/
void DrucRelationCompareExtension ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_EXTENSION )
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER
);
break;
}
case DRUC_MESURE_PENETRE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_PENETRE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_MIN :
case DRUC_MESURE_LONGUEUR_MAX :
{
DrucRelationTeste ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_MAX,
MACRO_RECT_LONG_MAX
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucRelationCompareInclusion |
| |
\------------------------------------------------------------*/
void DrucRelationCompareInclusion ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
{
if ( DrucStructMesure->ORIENTATION == DRUC_ORIENTATION_INCLUSION )
{
switch ( ( DrucInstructionCourante->MESURE ) [ IndexMesure ] )
{
case DRUC_MESURE_SURFACE_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_SURFACE_INTER
);
break;
}
case DRUC_MESURE_LONGUEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LONG_INTER
);
break;
}
case DRUC_MESURE_LARGEUR_INTER :
{
DrucMesureInter ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
MACRO_LARGE_INTER
);
break;
}
} /* while */
} /* if orientation */
}
/*------------------------------------------------------------\
| |
| DrucRelationCompare |
| |
\------------------------------------------------------------*/
void DrucRelationCompare ( DrucStructMesure,
DrucInstructionCourante
)
register DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
{
int IndexMesure;
if ( DrucIsRectanglesValides ( DrucStructMesure,
DrucInstructionCourante
)
)
{
DrucRelationMesure ( DrucStructMesure
);
IndexMesure = 0;
while ( ( DrucInstructionCourante->RELATION [ IndexMesure ] !=
DRUC_UNDEFINED_MESURE
) &&
( IndexMesure != DRUC_MAX_MESURES
)
)
{
switch ( DrucInstructionCourante->RELATION [ IndexMesure ] )
{
case DRUC_RELATION_DISTANCE :
{
if ( DrucInstructionCourante->LAYER_1 == DrucInstructionCourante->LAYER_2 )
{
if ( DrucIsRectangleEquipot ( DrucStructMesure
)
)
{
break;
}
}
if ( MACRO_BOOL_DISTANCE == DRUC_TRUE )
{
DrucRelationCompareDistance ( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_RELATION_ENVELOPPE :
{
if ( MACRO_BOOL_DISTANCE == DRUC_FALSE )
{
DrucRelationCompareEnveloppe ( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_RELATION_MARGE :
{
if ( MACRO_BOOL_DISTANCE == DRUC_FALSE )
{
DrucRelationCompareMarge ( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_RELATION_CROIX :
{
if ( MACRO_BOOL_DISTANCE == DRUC_FALSE )
{
DrucRelationCompareCroix ( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_RELATION_INTERSECTION :
{
if ( MACRO_BOOL_DISTANCE == DRUC_FALSE )
{
DrucRelationCompareIntersection( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_RELATION_EXTENSION :
{
if ( MACRO_BOOL_DISTANCE == DRUC_FALSE )
{
DrucRelationCompareExtension ( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
case DRUC_RELATION_INCLUSION :
{
if ( MACRO_BOOL_DISTANCE == DRUC_FALSE )
{
DrucRelationCompareInclusion ( DrucStructMesure ,
DrucInstructionCourante,
IndexMesure
);
}
break;
}
} /* switch */
IndexMesure ++;
} /* while */
} /* if */
}
/*------------------------------------------------------------\
| |
| DrucRelation |
| |
\------------------------------------------------------------*/
void DrucRelation ( DrucFigureRds,
DrucRdsWindow,
DrucInstructionCourante
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
DrucTypeStructInstruction *DrucInstructionCourante;
{
rdsrec_list *TmpRectangleSource2;
rdswin_list *TmpWindowSource;
register int TabIndex;
register rdswinrec_list *TabRectangleSource = NULL;
DrucTypeStructMesure DrucStructMesure;
chain_list *PtChaine;
chain_list *HeadChaine;
long DilateX;
long DilateY;
long DilateDX;
long DilateDY;
DrucStructMesure.LAYER_2 = DrucInstructionCourante->LAYER_2;
DrucStructMesure.LAYER_1 = DrucInstructionCourante->LAYER_1;
for ( TmpRectangleSource2 = DrucFigureRds->LAYERTAB
[ DrucInstructionCourante->LAYER_2 ];
TmpRectangleSource2 != (rdsrec_list *)NULL;
TmpRectangleSource2 = TmpRectangleSource2->NEXT
)
{
DrucStructMesure.RECTANGLE2 = TmpRectangleSource2;
/*\
DrucViewString ("\nBOUCLE"
);
DrucViewNumber ( DrucStructMesure.LAYER_1
);
DrucViewNumber ( DrucStructMesure.LAYER_2
);
viewrdsrec ( TmpRectangleSource2
);
DrucVerifEquiLayer ( DrucFigureRds,
DrucStructMesure.LAYER_1
);
printf ("\n fin de viewrdsfig\n");
viewrdsfig (DrucFigureRds);
\*/
DrucRelationDilateRectangle ( DrucRdsWindow,
DrucInstructionCourante,
TmpRectangleSource2,
& DilateX,
& DilateY,
& DilateDX,
& DilateDY
);
PtChaine = getrdswindow ( DilateX,
DilateY,
DilateDX,
DilateDY,
DrucRdsWindow
);
HeadChaine = PtChaine;
while ( PtChaine != (chain_list *)NULL
)
{
TmpWindowSource = ( rdswin_list *) PtChaine->DATA;
PtChaine = PtChaine ->NEXT;
TabRectangleSource = TmpWindowSource->LAYERTAB
[ DrucInstructionCourante->LAYER_1 ];
while ( TabRectangleSource != (rdswinrec_list *)NULL
)
{
TabIndex = 0;
while ( TabIndex < RWI_MAX_REC )
{
if ( ( TabRectangleSource->RECTAB [ TabIndex ] !=
( rdsrec_list *)NULL
) &&
( ! ( TabRectangleSource->RECTAB [ TabIndex ]->FLAGS &
DRUC_FLAG_REC_VERIFIE
)
) )
{
DrucStructMesure.RECTANGLE1 =
TabRectangleSource->RECTAB [ TabIndex ];
/*\
viewrdsrec ( TabRectangleSource->RECTAB [ TabIndex ]
);
DrucViewString ("FIN BOUCLE");
\*/
DrucStructMesure.RECTANGLE1->FLAGS |= DRUC_FLAG_REC_VERIFIE;
DrucRelationCompare ( &DrucStructMesure ,
DrucInstructionCourante
);
}
TabIndex ++;
} /* while les rectangles d'un tableau du layer A */
TabRectangleSource = TabRectangleSource->NEXT;
} /* while les tableaux du layer A */
} /* while les fenetres du layer A */
PtChaine = HeadChaine;
while ( PtChaine != (chain_list *)NULL
)
{
TmpWindowSource = ( rdswin_list *) PtChaine->DATA;
PtChaine = PtChaine ->NEXT;
TabRectangleSource = TmpWindowSource->LAYERTAB
[ DrucInstructionCourante->LAYER_1 ];
while ( TabRectangleSource != (rdswinrec_list *)NULL
)
{
TabIndex = 0;
while ( TabIndex < RWI_MAX_REC
)
{
if ( TabRectangleSource->RECTAB [ TabIndex ] !=
( rdsrec_list *)NULL )
{
TabRectangleSource->RECTAB [ TabIndex ]->FLAGS &=
~DRUC_FLAG_REC_VERIFIE;
}
TabIndex ++;
} /* while les rectangles d'un tableau du layer A */
TabRectangleSource = TabRectangleSource->NEXT;
} /* while les tableaux du layer A */
} /* while les fenetres du layer A */
} /* for le parcours des rectangles du layer B */
}

View File

@ -0,0 +1,29 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCRELAT.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcRelat Macros |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcRelat Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucRelationDistance ();
extern void DrucRelationEnveloppe ();
extern void DrucRelationMarge ();
extern void DrucRelationCroix ();
extern void DrucRecationIntersection ();
extern void DrucRelationExtension ();
extern void DrucRelationInclusion ();
extern void DrucRelation ();

View File

@ -0,0 +1,926 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCTOOLS.C |
| |
| Authors : Renaud Patrick |
| |
| Date : 25/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Modifs |
| 25/01/94: DrucIsPerimetreInclusInEqui retourne boolean |
| ne fait pas de traitement d'erreur |
| retourne vrai ou faux |
| lignes 310 a 317 |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "mph.h"
#include "mut.h"
#include "rds.h"
#include "rwi.h"
#include "rut.h"
#include "rtl.h"
#include "rfm.h"
#include "rpr.h"
#include "drucutil.h"
#include "vmctools.h"
#include "vmcerror.h"
/*------------------------------------------------------------\
| |
| Druc Fonctions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| DrucAddSuffixeName |
| |
\------------------------------------------------------------*/
char *DrucAddSuffixeName ( Name,
Suffixe
)
char *Name;
char *Suffixe;
{
char TmpName [DRUC_MAX_STRING_BUFFER];
strcpy ( (char *)TmpName ,
Name
);
strcat ( (char *)TmpName,
Suffixe
);
return ( namealloc ( TmpName ));
}
/*------------------------------------------------------------\
| |
| DrucViewLayers |
| |
\------------------------------------------------------------*/
void DrucViewLayers ()
{
int IndexLayer;
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER;
IndexLayer ++
)
{
fprintf ( stdout ,"LAYER %d\tWIDTH %d\tCTM %d\n",
DrucStructRdsLayer [ IndexLayer ].RDS_INDEX,
DrucStructRdsLayer [ IndexLayer ].WIDTH,
DrucStructRdsLayer [ IndexLayer ].CTM
);
}
fflush ( stdout );
}
/*------------------------------------------------------------\
| |
| DrucInitStructLayers |
| |
\------------------------------------------------------------*/
void DrucInitStructLayers ()
{
int IndexLayer;
for ( IndexLayer = 0;
IndexLayer != RDS_MAX_LAYER;
IndexLayer ++
)
{
DrucStructRdsLayer [ IndexLayer ].RDS_INDEX = DRUC_UNDEFINED_LAYER;
DrucStructRdsLayer [ IndexLayer ].WIDTH = DRUC_UNDEFINED_WIDTH;
DrucStructRdsLayer [ IndexLayer ].CTM = DRUC_UNDEFINED_CTM;
DrucStructRdsLayer [ IndexLayer ].FLAGS = DRUC_UNDEFINED_FLAGS;
}
}
/*------------------------------------------------------------\
| |
| DrucViewInstruction |
| |
\------------------------------------------------------------*/
void DrucViewInstruction ( DrucInstructionCourante
)
DrucTypeStructInstruction *DrucInstructionCourante;
{
int IndexMesure;
fprintf ( stdout , "INSTRUCTION \t%d\n",
DrucInstructionCourante->INSTRUCTION );
fprintf ( stdout , "LAYER DESTINATION \t%s %d\n",
RDS_LAYER_NAME[ DrucInstructionCourante->LAYER_DEST ],
DrucInstructionCourante->LAYER_DEST );
fprintf ( stdout , "LAYER SOURCE 1 \t%s %d\n",
RDS_LAYER_NAME[ DrucInstructionCourante->LAYER_1 ],
DrucInstructionCourante->LAYER_1 );
fprintf ( stdout , "LAYER SOURCE 2 \t%s %d\n",
RDS_LAYER_NAME[ DrucInstructionCourante->LAYER_2 ],
DrucInstructionCourante->LAYER_2 );
/*\
fprintf ( stdout , "LAYER DESTINATION \t%d\n",
DrucInstructionCourante->LAYER_DEST );
fprintf ( stdout , "lAYER SOURCE 1 \t%d\n",
DrucInstructionCourante->LAYER_1 );
fprintf ( stdout , "LAYER SOURCE 2 \t%d\n",
DrucInstructionCourante->LAYER_2 );
\*/
fprintf ( stdout , "REL du CONSTRUCTEUR\t%d\n",
DrucInstructionCourante->OP_COMPOSE );
fprintf ( stdout , "OPERATION UNAIRE \t%d\n",
DrucInstructionCourante->OP_UNAIRE );
fprintf ( stdout , "VALEUR UNAIRE \t%ld\n",
DrucInstructionCourante->DEF_VALEUR );
for ( IndexMesure = 0;
IndexMesure < DRUC_MAX_MESURES;
IndexMesure ++
)
{
if ( ( ( DrucInstructionCourante->REGLE_NUM ) [ IndexMesure ] )
!= DRUC_UNDEFINED_REGLE
)
{
fprintf ( stdout , "REGLE NUMERO %d\t",
( DrucInstructionCourante->REGLE_NUM ) [ IndexMesure ] );
fprintf ( stdout , "OPERATEUR %d\t",
( DrucInstructionCourante->RELATION ) [ IndexMesure ] );
fprintf ( stdout , "MESURE %d\t",
( DrucInstructionCourante->MESURE ) [ IndexMesure ] );
fprintf ( stdout , "COMPARATEUR %d\t",
( DrucInstructionCourante->OP_COMPARE ) [ IndexMesure ] );
fprintf ( stdout , "VALEUR %d\n",
( DrucInstructionCourante->VALEUR ) [ IndexMesure ] );
}
}
DrucViewString ("");
}
/*------------------------------------------------------------\
| |
| DrucViewRectangle |
| |
\------------------------------------------------------------*/
void DrucViewRectangle ( Rectangle
)
rdsrec_list **Rectangle;
{
DrucTypeStructPlusRect *PlusRec;
PlusRec = (DrucTypeStructPlusRect *)
((char*)(*Rectangle)+sizeof(rdsrec_list));
printf ( "RECTANGLE \n");
printf ( "%p\t" ,
*Rectangle);
printf ( "%p " ,
(*Rectangle)->NEXT);
printf ( "\t%.1f\t" ,
(*Rectangle)->X / (float)RDS_LAMBDA );
printf ( "%.1f\t" ,
(*Rectangle)->Y / (float)RDS_LAMBDA );
printf ( "%.1f\t" ,
(*Rectangle)->DX / (float)RDS_LAMBDA);
printf ( "%.1f\t" ,
(*Rectangle)->DY / (float)RDS_LAMBDA);
printf ( "INSTANCE %p\t",
PlusRec->INSTANCE_NUM);
printf ( "EQUI %p\t",
PlusRec->NEXT_EQUI);
printf ( "%p\t" ,
(*Rectangle)->USER );
printf ( "%lx\t\n" ,
(*Rectangle)->FLAGS );
fflush (stdout);
}
/*------------------------------------------------------------\
| |
| DrucViewEqui |
| |
\------------------------------------------------------------*/
void DrucViewEqui ( Rectangle )
rdsrec_list **Rectangle;
{
DrucTypeStructPlusRect *PlusRec1;
rdsrec_list *RectangleCourant;
RectangleCourant = *Rectangle;
PlusRec1 = (DrucTypeStructPlusRect *)
((char *)(RectangleCourant)+sizeof(rdsrec_list));
fprintf ( stdout,
"\nEqui:\n"
);
while ( PlusRec1->NEXT_EQUI != *Rectangle
)
{
RectangleCourant->FLAGS |= DRUC_FLAG_REC_VISITE;
DrucViewRectangle ( & RectangleCourant
);
RectangleCourant = PlusRec1->NEXT_EQUI;
PlusRec1 = (DrucTypeStructPlusRect *)
((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
RectangleCourant->FLAGS |= DRUC_FLAG_REC_VISITE;
DrucViewRectangle ( & RectangleCourant
);
fprintf ( stdout,
"\nFin Equi:\n"
);
}
/*------------------------------------------------------------\
| |
| DrucIsPerimetreInclusInEqui |
| pour bien faire il faudrait calculer le vecteur separant |
| les deux rectangles en faute puis couvrir ce vecteur par |
| le balayage de l'equi et eliminer par morceaux ce vecteur |
| avec chaque rectangle de l'equi qui recouvre ces morceaux |
| |
\------------------------------------------------------------*/
boolean DrucIsPerimetreInclusInEqui ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionX,
PositionY,
PositionDX,
PositionDY
)
DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
long PositionX;
long PositionY;
long PositionDX;
long PositionDY;
{
DrucTypeStructPlusRect *PlusRec;
rdsrec_list *RectangleTete;
rdsrec_list *RectangleCourant;
boolean PerimetreXCouvert = DRUC_FALSE;
boolean PerimetreYCouvert = DRUC_FALSE;
/*
printf ("NOTCH %d %d %d %d \n",PositionX,PositionY,PositionDX,PositionDY);
*/
RectangleTete = DrucStructMesure->RECTANGLE1;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleTete)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( RectangleCourant != RectangleTete )
{
if ( RectangleCourant == DrucStructMesure->RECTANGLE2 )
{
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
continue;
}
/*\
* couverture du perimetre vertical gauche avec un rectangle a gauche droit avec un rectangle a droite
* il faut qu'un cote vertical et un cote horizontal soient recouverts par un rectangle du polygone
\*/
if ( ( RectangleCourant->Y <= PositionY ) &&
( RectangleCourant->Y + RectangleCourant->DY >= PositionDY )
)
{
if ( ( ( RectangleCourant->X <= PositionDX ) &&
( RectangleCourant->X + RectangleCourant->DX >= PositionDX )
) ||
( ( RectangleCourant->X <= PositionX ) &&
( RectangleCourant->X + RectangleCourant->DX >= PositionX )
)
)
{
PerimetreYCouvert = DRUC_TRUE;
}
}
/*\
* couverture du perimetre horizontal
* haut avec un rectangle en haut
* bas avec un rectangle en bas
\*/
if ( ( RectangleCourant->X <= PositionX ) &&
( RectangleCourant->X + RectangleCourant->DX >= PositionDX )
)
{
if ( ( ( RectangleCourant->Y <= PositionDY ) &&
( RectangleCourant->Y + RectangleCourant->DY >= PositionDY )
) ||
( ( RectangleCourant->Y <= PositionY ) &&
( RectangleCourant->Y + RectangleCourant->DY >= PositionY )
)
)
{
PerimetreXCouvert = DRUC_TRUE;
}
}
if ( ( PerimetreXCouvert == DRUC_TRUE ) &&
( PerimetreYCouvert == DRUC_TRUE )
)
{
return ( DRUC_TRUE
);
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
return ( DRUC_FALSE
);
}
/*------------------------------------------------------------\
| |
| DrucIsPositionInclusInEqui |
| |
\------------------------------------------------------------*/
void DrucIsPositionInclusInEqui ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure,
PositionX,
PositionY,
PositionDX,
PositionDY
)
DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
int IndexMesure;
long PositionX;
long PositionY;
long PositionDX;
long PositionDY;
{
DrucTypeStructPlusRect *PlusRec;
rdsrec_list *RectangleTete;
rdsrec_list *RectangleCourant;
/*
printf ("NOTCH %d %d %d %d \n",PositionX,PositionY,PositionDX,PositionDY);
*/
RectangleTete = DrucStructMesure->RECTANGLE1;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleTete)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( RectangleCourant != RectangleTete )
{
if ( RectangleCourant == DrucStructMesure->RECTANGLE2 )
{
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
continue;
}
if ( ( RectangleCourant->X <= PositionX ) &&
( RectangleCourant->Y <= PositionY ) &&
( RectangleCourant->X + RectangleCourant->DX >= PositionDX ) &&
( RectangleCourant->Y + RectangleCourant->DY >= PositionDY )
)
{
return;
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
DrucErreurDeuxCorps ( DrucStructMesure,
DrucInstructionCourante,
IndexMesure
);
}
/*------------------------------------------------------------\
| |
| DrucIsRectanglesContact |
| |
\------------------------------------------------------------*/
boolean DrucIsRectanglesContact ( Rectangle1,
Rectangle2
)
rdsrec_list *Rectangle1;
rdsrec_list *Rectangle2;
{
long PositionX1;
long PositionX2;
long PositionY1;
long PositionY2;
long PositionDX1;
long PositionDX2;
long PositionDY1;
long PositionDY2;
PositionX1 = Rectangle1->X;
PositionX2 = Rectangle2->X;
PositionY1 = Rectangle1->Y;
PositionY2 = Rectangle2->Y;
PositionDX1 = PositionX1 + Rectangle1->DX;
PositionDX2 = PositionX2 + Rectangle2->DX;
PositionDY1 = PositionY1 + Rectangle1->DY;
PositionDY2 = PositionY2 + Rectangle2->DY;
if ( PositionDX1 < PositionX2 ||
PositionDX2 < PositionX1 ||
PositionDY1 < PositionY2 ||
PositionDY2 < PositionY1
)
{
return ( DRUC_FALSE );
}
else
{
return ( DRUC_TRUE );
}
}
/*------------------------------------------------------------\
| |
| DrucChercheWindow |
|A partir d'un rectangle retourne la liste des fenetres |
| qui embrasse ce rectangle |
\------------------------------------------------------------*/
rdsrecwin_list *DrucChercheWindow ( TmpRectangleSource
)
rdsrec_list *TmpRectangleSource;
{
static rdsrecwin_list StaticWindowSource2;
if ( IsRdsOneWindow( TmpRectangleSource ) )
{
StaticWindowSource2.WINDOW = (rdswin_list *)TmpRectangleSource->USER;
StaticWindowSource2.NEXT = (rdsrecwin_list *) NULL;
return ( & StaticWindowSource2 );
}
else
{
return (rdsrecwin_list *)TmpRectangleSource->USER;
}
}
/*------------------------------------------------------------\
| |
| DrucComputeEquiRectangle |
| cree les equipotentielles du layer courant |
\------------------------------------------------------------*/
void DrucComputeEquiRectangle ( DrucRectangle,
LayerCourant
)
register rdsrec_list *DrucRectangle;
register int LayerCourant;
{
register int TabIndex;
register rdsrec_list *TmpRectangleCourant;
register rdsrecwin_list *TmpWindowCourante;
register rdswinrec_list *TabRectangleCourant;
/*\
* recuperer toutes les fenetres liees au rectangle
\*/
TmpWindowCourante = DrucChercheWindow ( DrucRectangle
);
/*\
* parcours de chaque fenetre
\*/
while ( TmpWindowCourante != (rdsrecwin_list *)NULL )
{
TabRectangleCourant = ( TmpWindowCourante->WINDOW )->LAYERTAB [ LayerCourant ];
/*\
* parcours des tableaux de la fenetre courante
\*/
while ( TabRectangleCourant != (rdswinrec_list *)NULL )
{
/*\
* parcourir tous les rectangles tableau courant
\*/
TabIndex = 0;
while ( TabIndex < RWI_MAX_REC
)
{
if ( ( TabRectangleCourant->RECTAB) [ TabIndex ] !=
( rdsrec_list *)NULL )
{
TmpRectangleCourant = TabRectangleCourant->RECTAB [ TabIndex ];
if ( ( TmpRectangleCourant != (rdsrec_list*) NULL ) &&
( (TmpRectangleCourant->FLAGS & DRUC_FLAG_REC_VISITE ) !=
DRUC_FLAG_REC_VISITE )
)
{
/*\
* si les rectangles sont en intersection on les chaine par les equi
\*/
if ( DrucIsRectanglesContact ( DrucRectangle,
TmpRectangleCourant
)
== DRUC_TRUE
)
{
TmpRectangleCourant->FLAGS |= DRUC_FLAG_REC_VISITE;
MACRO_NEXT_EQUI ( TmpRectangleCourant ) = MACRO_NEXT_EQUI ( DrucRectangle );
MACRO_NEXT_EQUI ( DrucRectangle ) = TmpRectangleCourant;
} /* if intersection */
} /* if TmpRectangle */
}
TabIndex ++;
} /* while les rectangles du tableau courant */
TabRectangleCourant = TabRectangleCourant->NEXT;
} /* while les tableaux */
TmpWindowCourante = TmpWindowCourante->NEXT;
} /* while les fenetres */
}
/*------------------------------------------------------------\
| |
| DrucComputeEqui |
| cree les equipotentielles du layer courant |
\------------------------------------------------------------*/
void DrucComputeEquiLayer ( DrucFigureRds ,
LayerCourant
)
rdsfig_list *DrucFigureRds;
int LayerCourant;
{
register rdsrec_list *TmpRectangleCourant;
register rdsrec_list *TmpRectangleEqui;
for ( TmpRectangleCourant = DrucFigureRds->LAYERTAB [ LayerCourant ];
TmpRectangleCourant != (rdsrec_list *)NULL;
TmpRectangleCourant = TmpRectangleCourant->NEXT
)
{
if ( (TmpRectangleCourant->FLAGS & DRUC_FLAG_REC_VISITE ) ==
DRUC_FLAG_REC_VISITE
)
{
continue;
}
TmpRectangleCourant->FLAGS |= DRUC_FLAG_REC_VISITE;
MACRO_NEXT_EQUI ( TmpRectangleCourant ) = TmpRectangleCourant;
DrucComputeEquiRectangle ( TmpRectangleCourant,
LayerCourant
);
/*\
* pour tous les rectangles de l'equi en cours chercher la suite de l'equi
\*/
TmpRectangleEqui = MACRO_NEXT_EQUI ( TmpRectangleCourant );
while ( TmpRectangleEqui != TmpRectangleCourant )
{
DrucComputeEquiRectangle ( TmpRectangleEqui,
LayerCourant
);
TmpRectangleEqui = MACRO_NEXT_EQUI ( TmpRectangleEqui );
} /* while les rectangles de l'equi en cours */
TmpRectangleEqui = MACRO_NEXT_EQUI ( TmpRectangleCourant );
} /* for le parcours des rectangles du layer */
DrucClearFlag ( DrucFigureRds->LAYERTAB [ LayerCourant ],
DRUC_FLAG_REC_VISITE
);
}
/*------------------------------------------------------------\
| |
| DrucComputeEquiFigure |
| |
\------------------------------------------------------------*/
void DrucComputeEquiFigure ( DrucFigureRds
)
rdsfig_list *DrucFigureRds;
{
int IndexLayer;
int LayerCourant;
for ( IndexLayer = 0;
IndexLayer < RDS_MAX_LAYER ;
IndexLayer ++
)
{
LayerCourant = DrucStructRdsLayer [ IndexLayer ].RDS_INDEX ;
if ( LayerCourant != DRUC_UNDEFINED_LAYER
)
{
if ( DrucFigureRds->LAYERTAB [ LayerCourant ] != ( rdsrec_list * ) NULL
)
{
DrucComputeEquiLayer ( DrucFigureRds ,
LayerCourant
);
}
}
}
}
/*------------------------------------------------------------\
| |
| DrucIsRectangleEquipot |
| |
\------------------------------------------------------------*/
boolean DrucIsRectangleEquipot ( DrucStructMesure
)
DrucTypeStructMesure *DrucStructMesure;
{
rdsrec_list *RectangleTete;
rdsrec_list *RectangleCourant;
DrucTypeStructPlusRect *PlusRec;
if ( DrucStructMesure->RECTANGLE1 == DrucStructMesure->RECTANGLE2 )
{
return ( DRUC_TRUE );
}
RectangleTete = DrucStructMesure->RECTANGLE1;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleTete)+sizeof(rdsrec_list));
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
while ( RectangleCourant != RectangleTete )
{
if ( RectangleCourant == DrucStructMesure->RECTANGLE2 )
{
return ( DRUC_TRUE );
}
RectangleCourant = PlusRec->NEXT_EQUI;
PlusRec = (DrucTypeStructPlusRect *)((char *)(RectangleCourant)+sizeof(rdsrec_list));
}
return ( DRUC_FALSE );
}
/*------------------------------------------------------------\
| |
| DrucIsRectanglesValides |
| si les deux rectangles appartiennent a des couronnes |
| alors tester si ils appartiennent a la meme couronne |
| si ils appartiennent a la meme couronne |
| alors inutile de verifier la regle courante |
\------------------------------------------------------------*/
boolean DrucIsRectanglesValides ( DrucStructMesure,
DrucInstructionCourante
)
DrucTypeStructMesure *DrucStructMesure;
DrucTypeStructInstruction *DrucInstructionCourante;
{
/*\
* doit aussi mesurer la ctm en fonction des l'operations courantes
* contenues dans les tableaux de DrucStructMesure
* si c'est une relation de superposition
* les deux rectangles qui ne se touchent pas ne sont pas valides
* si c'est la relation distance tenir compte de la ctm max des deux rectangles
* et tenir compte de l'appartenance des @ rectangles a la meme composition de layers
* en cas de layer user
if ( ( (DrucStructMesure->RECTANGLE1)->FLAGS &
(DrucStructMesure->RECTANGLE2)->FLAGS &
DRUC_FLAG_INSTANCE_RECTANGLE ) ==
DRUC_FLAG_INSTANCE_RECTANGLE
)
\*/
{
/*\
DrucViewRectangle ( &(DrucStructMesure->RECTANGLE1) );
viewrdsrec (DrucStructMesure->RECTANGLE1);
viewrdsrec (DrucStructMesure->RECTANGLE2);
DrucViewRectangle ( &(DrucStructMesure->RECTANGLE2) );
\*/
if ( ( MACRO_INSTANCE_NUM ( DrucStructMesure->RECTANGLE1 ) !=
(rdsins_list *)NULL
) &&
( ( MACRO_INSTANCE_NUM ( DrucStructMesure->RECTANGLE1 ) ) ==
( MACRO_INSTANCE_NUM ( DrucStructMesure->RECTANGLE2 ) )
)
)
{
return ( DRUC_FALSE );
}
}
DrucStructMesure->BOOLEEN_DISTANCE = !( DrucIsRectanglesContact
(
DrucStructMesure->RECTANGLE1,
DrucStructMesure->RECTANGLE2
)
);
return ( DRUC_TRUE );
}
/*------------------------------------------------------------\
| |
| DrucSetEquiFlag |
| positionne le bit du champ FLAG de tous les rectangles |
| de l'equi du rectangle |
| le bit a positionner est indique par le parametre flag |
\------------------------------------------------------------*/
void DrucSetEquiFlag ( Rectangle,
Flag
)
register rdsrec_list *Rectangle;
register long Flag;
{
register rdsrec_list *TmpEqui = Rectangle;
do
{
TmpEqui->FLAGS |= Flag;
TmpEqui = MACRO_NEXT_EQUI ( TmpEqui );
}
while ( Rectangle != TmpEqui );
}
/*------------------------------------------------------------\
| |
| DrucClearEquiFlag |
| efface le bit du champ FLAG de tous les rectangles |
| de l'equi du rectangle |
| le bit a effacer est indique par le parametre flag |
\------------------------------------------------------------*/
void DrucClearEquiFlag ( Rectangle,
Flag
)
register rdsrec_list *Rectangle;
register long Flag;
{
register rdsrec_list *TmpEqui = Rectangle;
do
{
TmpEqui->FLAGS &= ~( Flag );
TmpEqui = MACRO_NEXT_EQUI ( TmpEqui );
}
while ( Rectangle != TmpEqui );
}
/*------------------------------------------------------------\
| |
| DrucClearFlag |
| met a zero le bit du champ FLAG de tous les rectangles |
| le bit a mettre a zero est indique par le parametre flag |
\------------------------------------------------------------*/
void DrucClearFlag ( RectangleListe,
Flag
)
register rdsrec_list *RectangleListe;
register long Flag;
{
register rdsrec_list *TmpRectangle;
for ( TmpRectangle = RectangleListe;
TmpRectangle != (rdsrec_list *)NULL;
TmpRectangle = TmpRectangle->NEXT
)
{
TmpRectangle->FLAGS &= ~( Flag );
}
}
/*------------------------------------------------------------\
| |
| DrucAddRecFigure |
| insert le rectangle (initialise) dans la liste des |
| rectangles du layer donne |
\------------------------------------------------------------*/
void DrucAddRecFigure ( RectangleDest ,
DrucFigureRds ,
LayerDest
)
rdsrec_list *RectangleDest;
rdsfig_list *DrucFigureRds;
int LayerDest;
{
RectangleDest->NEXT = DrucFigureRds->LAYERTAB [ LayerDest ];
DrucFigureRds->LAYERTAB [ LayerDest ] = RectangleDest;
}
/*------------------------------------------------------------\
| |
| DrucDestroyLayerWindow |
| |
\------------------------------------------------------------*/
void DrucDestroyLayerWindow ( DrucFigureRds,
DrucRdsWindow,
LayerCourant
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
int LayerCourant;
{
rdsrec_list *RectangleCourant;
/*\
DrucViewString ("\nDESTRUCTION DES FENETRES DU LAYER DEST\n"
);
viewrdsfig ( DrucFigureRds
);
\*/
RectangleCourant = DrucFigureRds->LAYERTAB[ LayerCourant ];
while ( RectangleCourant != ( rdsrec_list * )NULL )
{
delrdsrecwindow ( RectangleCourant,
DrucRdsWindow
);
RectangleCourant = RectangleCourant->NEXT;
}
/*\
DrucViewString ("\nFIN DESTRUCTION DES FENETRES DU LAYER DEST\n"
);
\*/
}
/*------------------------------------------------------------\
| |
| DrucBuiltLayerWindow |
| |
\------------------------------------------------------------*/
void DrucBuiltLayerWindow ( DrucFigureRds,
DrucRdsWindow,
LayerCourant
)
rdsfig_list *DrucFigureRds;
rdswindow *DrucRdsWindow;
int LayerCourant;
{
rdsrec_list *RectangleCourant;
/*\
DrucViewString ("\nCONSTRUCTION DES FENETRES DU LAYER DEST\n"
);
viewrdsfig ( DrucFigureRds
);
\*/
for ( RectangleCourant = DrucFigureRds->LAYERTAB[ LayerCourant ];
RectangleCourant != (rdsrec_list *)NULL;
RectangleCourant = RectangleCourant->NEXT
)
{
addrdsrecwindow( RectangleCourant, DrucRdsWindow );
/*\
DrucViewString ("\nCONSTRUCTION EN COURS DES FENETRES DU LAYER DEST\n"
);
\*/
}
/*\
DrucViewString ("\nFIN CONSTRUCTION DES FENETRES DU LAYER DEST\n"
);
\*/
}
/*------------------------------------------------------------\
| |
| DrucVerifEquiLayer |
| |
\------------------------------------------------------------*/
void DrucVerifEquiLayer ( DrucFigureRds,
Layer
)
rdsfig_list *DrucFigureRds;
int Layer;
{
rdsrec_list *TmpRectangle;
DrucViewString ( "\n"
);
DrucViewString ( RDS_LAYER_NAME[Layer]
);
DrucViewString ( "\n"
);
TmpRectangle = DrucFigureRds->LAYERTAB[Layer];
while ( TmpRectangle != (rdsrec_list *)NULL
)
{
DrucViewString ("RECTANGLE COURANT PARCOURU PAR NEXT ");
DrucViewRectangle ( & TmpRectangle
);
if ( ( TmpRectangle->FLAGS & DRUC_FLAG_REC_VISITE ) ==
DRUC_FLAG_REC_VISITE
)
{
TmpRectangle = TmpRectangle->NEXT;
continue;
}
if ( MACRO_NEXT_EQUI ( TmpRectangle ) == (rdsrec_list *)NULL
)
{
DrucViewRectangle ( & TmpRectangle );
DrucViewString (" et un rectangle qui n'est pas chaine!");
DrucViewRectangle ( & TmpRectangle );
}
else
{
DrucViewEqui ( & TmpRectangle
);
}
TmpRectangle = TmpRectangle->NEXT;
}
DrucClearFlag ( DrucFigureRds->LAYERTAB [ Layer ],
DRUC_FLAG_REC_VISITE
);
printf ("\n layer verifie\n");
}
/*------------------------------------------------------------\
| |
| DrucVerifEquiFigure |
| |
\------------------------------------------------------------*/
void DrucVerifEquiFigure ( DrucFigureRds
)
rdsfig_list *DrucFigureRds;
{
int Layer;
DrucViewString ("Verif de la figure ");
DrucViewString (DrucFigureRds->NAME);
for ( Layer = 0;
Layer < RDS_MAX_LAYER;
Layer ++
)
{
DrucViewString ("Verif des chainages du layer ");
DrucVerifEquiLayer ( DrucFigureRds,
Layer
);
}
}

View File

@ -0,0 +1,339 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCTOOLS.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des champs de flags utilises par DRUC |
| c'est les bits a 1
\------------------------------------------------------------*/
/*\
* DRUC_ALL_FLAGS (long)0x0FF00000l
\*/
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des flags des rectangles pour l'unification |
\------------------------------------------------------------*/
#define DRUC_FLAG_SHORT_RECTANGLE (long)0x00400000l
#define DRUC_FLAG_INCLUSION_RECTANGLE (long)0x00200000l
#define DRUC_FLAG_INTERSECT_RECTANGLE (long)0x00100000l
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des flags des rectangles pour leur origine |
\------------------------------------------------------------*/
#define DRUC_FLAG_INSTANCE_RECTANGLE (long)0x00800000l
#define DRUC_FLAG_FIGURE_RECTANGLE (long)0x00000000l
#define DRUC_MASK_FIGURE_RECTANGLE (long)0x00700000l
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des flags des rectangles pour leur composition |
\------------------------------------------------------------*/
#define DRUC_FLAG_REC_INCLUS (long)0x02000000l
#define DRUC_FLAG_REMOVE (long)0x08000000l
#define DRUC_FLAG_REC_UNIFIE (long)0x01000000l
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des flags des rectangles pour leurs parcours |
\------------------------------------------------------------*/
#define DRUC_FLAG_REC_VISITE (long)0x10000000l
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des flags des rectangles pour leurs parcours |
\------------------------------------------------------------*/
#define DRUC_FLAG_REC_VERIFIE (long)0x20000000l
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
| Definition des flags des rectangles equipotentiels |
\------------------------------------------------------------*/
#define DRUC_FLAG_REC_ISEQUI (long)0x04000000l
/*------------------------------------------------------------\
| |
| Druc VmcTools Defines |
\------------------------------------------------------------*/
#define DRUC_NOFLAGS (long)0x00000000l
/*------------------------------------------------------------\
| |
| Druc VmcTools MACROS |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcMesure Orientations |
| |
\------------------------------------------------------------*/
#define DRUC_ORIENTATION_ENVELOPPE 0
#define DRUC_ORIENTATION_MARGE 1
#define DRUC_ORIENTATION_CROIX 2
#define DRUC_ORIENTATION_INTERSECTION 3
#define DRUC_ORIENTATION_EXTENSION 4
#define DRUC_ORIENTATION_INCLUSION 5
/*------------------------------------------------------------\
| |
| Druc VmcMesure Position de Rectangles |
| |
\------------------------------------------------------------*/
#define DRUC_RECTANGLE_UP 0
#define DRUC_RECTANGLE_DO 1
#define DRUC_RECTANGLE_LE 2
#define DRUC_RECTANGLE_RI 3
/*------------------------------------------------------------\
| |
| Druc VmcRelat Macros des mesures |
| |
\------------------------------------------------------------*/
#define DRUC_RELATION_UNDEF_MESURE 0xffffffffl
/*------------------------------------------------------------\
| |
| Druc VmcMesur Macros |
| d'acces a la structure DrucStructMesure |
| |
\------------------------------------------------------------*/
#define MACRO_RECTANGLE1 (DrucStructMesure->RECTANGLE1)
#define MACRO_RECTANGLE2 (DrucStructMesure->RECTANGLE2)
#define MACRO_ORIENTATION (DrucStructMesure->ORIENTATION)
#define MACRO_TOPOLOGIE (DrucStructMesure->TOPOLOGIE)
#define MACRO_BOOL_DISTANCE (DrucStructMesure->BOOLEEN_DISTANCE)
#define MACRO_SURFACE_INTER_1 (DrucStructMesure.DIMENSION_A)
#define MACRO_LONG_INTER_1 (DrucStructMesure.DIMENSION_B)
#define MACRO_LARGE_INTER_1 (DrucStructMesure.DIMENSION_C)
#define MACRO_SURFACE_INTER (DrucStructMesure->DIMENSION_A)
#define MACRO_LONG_INTER (DrucStructMesure->DIMENSION_B)
#define MACRO_LARGE_INTER (DrucStructMesure->DIMENSION_C)
#define MACRO_PENETRE_INTER (DrucStructMesure->DIMENSION_D)
#define MACRO_PARAL_INTER (DrucStructMesure->DIMENSION_G)
#define MACRO_PERPEN_INTER (DrucStructMesure->DIMENSION_H)
#define MACRO_LONG_MAX (DrucStructMesure->DIMENSION_E)
#define MACRO_LONG_MIN (DrucStructMesure->DIMENSION_F)
#define MACRO_RECT_LONG_MAX (DrucStructMesure->NUM_RECT_E)
#define MACRO_RECT_LONG_MIN (DrucStructMesure->NUM_RECT_F)
#define MACRO_LARGE_MAX (DrucStructMesure->DIMENSION_G)
#define MACRO_LARGE_MIN (DrucStructMesure->DIMENSION_H)
#define MACRO_RECT_LARGE_MAX (DrucStructMesure->NUM_RECT_G)
#define MACRO_RECT_LARGE_MIN (DrucStructMesure->NUM_RECT_H)
#define MACRO_FRONT (DrucStructMesure->DIMENSION_I)
#define MACRO_LATER_MIN (DrucStructMesure->DIMENSION_J)
#define MACRO_LATER_MAX (DrucStructMesure->DIMENSION_K)
#define MACRO_RECT_FRONT (DrucStructMesure->NUM_RECT_I)
#define MACRO_RECT_LATER_MIN (DrucStructMesure->NUM_RECT_J)
#define MACRO_RECT_LATER_MAX (DrucStructMesure->NUM_RECT_K)
#define MACRO_SUP (DrucStructMesure->DIMENSION_L)
#define MACRO_INF (DrucStructMesure->DIMENSION_M)
#define MACRO_RECT_SUP (DrucStructMesure->NUM_RECT_L)
#define MACRO_RECT_INF (DrucStructMesure->NUM_RECT_M)
#define MACRO_LONG_DISTANCE (DrucStructMesure->DIMENSION_N)
#define MACRO_LARGE_DISTANCE (DrucStructMesure->DIMENSION_O)
#define MACRO_POSX_DISTANCE (DrucStructMesure->DIMENSION_P)
#define MACRO_POSY_DISTANCE (DrucStructMesure->DIMENSION_Q)
#define MACRO_POSDX_DISTANCE (DrucStructMesure->DIMENSION_R)
#define MACRO_POSDY_DISTANCE (DrucStructMesure->DIMENSION_S)
#define MACRO_POSX_RECT_UP (DrucStructMesure->POSX_RECT_UP)
#define MACRO_POSY_RECT_UP (DrucStructMesure->POSY_RECT_UP)
#define MACRO_POSDX_RECT_UP (DrucStructMesure->POSDX_RECT_UP)
#define MACRO_POSDY_RECT_UP (DrucStructMesure->POSDY_RECT_UP)
#define MACRO_POSX_RECT_DO (DrucStructMesure->POSX_RECT_DO)
#define MACRO_POSY_RECT_DO (DrucStructMesure->POSY_RECT_DO)
#define MACRO_POSDX_RECT_DO (DrucStructMesure->POSDX_RECT_DO)
#define MACRO_POSDY_RECT_DO (DrucStructMesure->POSDY_RECT_DO)
#define MACRO_POSX_RECT_LE (DrucStructMesure->POSX_RECT_LE)
#define MACRO_POSY_RECT_LE (DrucStructMesure->POSY_RECT_LE)
#define MACRO_POSDX_RECT_LE (DrucStructMesure->POSDX_RECT_LE)
#define MACRO_POSDY_RECT_LE (DrucStructMesure->POSDY_RECT_LE)
#define MACRO_POSX_RECT_RI (DrucStructMesure->POSX_RECT_RI)
#define MACRO_POSY_RECT_RI (DrucStructMesure->POSY_RECT_RI)
#define MACRO_POSDX_RECT_RI (DrucStructMesure->POSDX_RECT_RI)
#define MACRO_POSDY_RECT_RI (DrucStructMesure->POSDY_RECT_RI)
/*------------------------------------------------------------\
| |
| Druc VmcTools MACROS |
| liees a rds |
\------------------------------------------------------------*/
#define DRUC_ON_HEAP 1
/*------------------------------------------------------------\
| |
| Min et Max de 3 valeurs |
| |
\------------------------------------------------------------*/
#define MACRO_MAX( Valeur1 , Valeur2 ) \
(( Valeur1 < Valeur2 ) ? Valeur2 : Valeur1 )
#define MACRO_MIN( Valeur1 , Valeur2 ) \
(( Valeur2 < Valeur1 ) ? Valeur2 : Valeur1 )
/*------------------------------------------------------------\
| |
| Druc VmcTools MACROS |
| manipulation de la structure complementaire de rectangle |
\------------------------------------------------------------*/
#define MACRO_PLUS_TAILLE (sizeof( DrucTypeStructPlusRect ))
#define MACRO_REGLE_NUM( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NOMBRE)
#define MACRO_LAYER_NUM( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NOMBRE)
#define MACRO_INSTANCE_NUM( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->INSTANCE_NUM)
#define MACRO_NEXT_EQUI( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NEXT_EQUI)
#define MACRO_NEXT_DEFINE( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NEXT_DEFINE)
/*------------------------------------------------------------\
| |
| Druc VmcTools MACROS |
| manipulation de la structure des recles de verif |
\------------------------------------------------------------*/
#define MACRO_REGLE_COURANTE (DrucTabInstruction [ InstructionCourante ])
#define MACRO_REGLE_VALEUR (DrucInstructionCourante->VALEUR)
#define MACRO_REGLE_COMPARE (DrucInstructionCourante->OP_COMPARE)
#define MACRO_REGLE_COMPOSE (DrucInstructionCourante->OP_COMPOSE)
/*------------------------------------------------------------\
| |
| Druc VmcTools MACROS |
| manipulation des rectangles de la structure de fenetre |
\------------------------------------------------------------*/
#define MACRO_RECT_DEST (TabRectangleDest->RECTAB)
#define MACRO_RECT_SOURCE (TabRectangleSource->RECTAB)
#define MACRO_RECT_SOURCE2 (TabRectangleSource2->RECTAB)
/*------------------------------------------------------------\
| |
| Druc VmcTools Types |
| |
\------------------------------------------------------------*/
typedef struct struct_plusrect
{
int NOMBRE;
rdsins_list *INSTANCE_NUM;
rdsrec_list *NEXT_EQUI;
struct struct_plusrect *NEXT_DEFINE;
} DrucTypeStructPlusRect;
/*------------------------------------------------------------\
| |
| Druc VmcTools variables |
| |
\------------------------------------------------------------*/
extern rdsfig_list *DrucFigureRdsErreur;
/*------------------------------------------------------------\
| |
| Druc Regles a 2 Corps TYPE |
| |
\------------------------------------------------------------*/
typedef struct struct_mesure
{
boolean BOOLEEN_DISTANCE;
long LAYER_1;
long LAYER_2;
rdsrec_list *RECTANGLE1;
rdsrec_list *RECTANGLE2;
int ORIENTATION;
int TOPOLOGIE;
long DIMENSION_A;
long DIMENSION_B;
long DIMENSION_C;
long DIMENSION_D;
long DIMENSION_E;
long DIMENSION_F;
long DIMENSION_G;
long DIMENSION_H;
long DIMENSION_I;
long DIMENSION_J;
long DIMENSION_K;
long DIMENSION_L;
long DIMENSION_M;
long DIMENSION_N;
long DIMENSION_O;
long DIMENSION_P;
long DIMENSION_Q;
long DIMENSION_R;
long DIMENSION_S;
int NUM_RECT_A;
int NUM_RECT_B;
int NUM_RECT_C;
int NUM_RECT_D;
int NUM_RECT_E;
int NUM_RECT_F;
int NUM_RECT_G;
int NUM_RECT_H;
int NUM_RECT_I;
int NUM_RECT_J;
int NUM_RECT_K;
int NUM_RECT_L;
int NUM_RECT_M;
int NUM_RECT_N;
int NUM_RECT_O;
int NUM_RECT_P;
int NUM_RECT_Q;
int NUM_RECT_R;
int NUM_RECT_S;
long MESURE_EFFECTIVE;
long POSX_RECT_UP;
long POSY_RECT_UP;
long POSDX_RECT_UP;
long POSDY_RECT_UP;
long POSX_RECT_DO;
long POSY_RECT_DO;
long POSDX_RECT_DO;
long POSDY_RECT_DO;
long POSX_RECT_LE;
long POSY_RECT_LE;
long POSDX_RECT_LE;
long POSDY_RECT_LE;
long POSX_RECT_RI;
long POSY_RECT_RI;
long POSDX_RECT_RI;
long POSDY_RECT_RI;
} DrucTypeStructMesure;
/*------------------------------------------------------------\
| |
| Druc VmcTools Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucClearFlag ();
extern void DrucComputeEqui ();
extern rdsrecwin_list *DrucChercheWindow ();
extern boolean DrucIsRectangleEquipot ();
extern boolean DrucIsRectanglesValides ();
extern void DrucSetEquiFlag ();
extern void DrucClearEquiFlag ();
extern void DrucAddRecFigure ();
extern void DrucViewString ();
extern char *DrucAddSuffixeName ();
extern void DrucVerifyEqui ();
extern void DrucVerifyEquiLayer ();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : VMCDEFINE.H |
| |
| Authors : Patrick Renaud |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Druc VmcUnify Fonctions |
| |
\------------------------------------------------------------*/
extern void DrucUnifyRemoveRectanglesEqui ();
extern rdsrec_list *DrucCreateRectangle ();
extern void DrucUnifyTransfertInfo ();
extern boolean DrucUnifyOrientation ();
extern void DrucUnifyRectangle ();
extern void DrucUnifyLayer ();
extern void DrucUnify ();
extern void DrucUnifyFigure ();

View File

@ -0,0 +1,66 @@
/*------------------------------------------------------------\
| |
| Tool : DRUC |
| |
| File : DRUCGRAL.H |
| |
| Authors : Renaud Patrick |
| |
| Date : 11/01/94 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# ifndef DRUC_104
# define DRUC_104
/*------------------------------------------------------------\
| |
| Macros |
| |
\------------------------------------------------------------*/
#define MACRO_PLUS_TAILLE (sizeof( DrucTypeStructPlusRect ))
#define MACRO_REGLE_NUM( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NOMBRE)
#define MACRO_LAYER_NUM( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NOMBRE)
#define MACRO_INSTANCE_NUM( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->INSTANCE_NUM)
#define MACRO_NEXT_EQUI( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NEXT_EQUI)
#define MACRO_NEXT_DEFINE( Rectangle ) \
(((DrucTypeStructPlusRect *)((char *)(Rectangle)+sizeof(rdsrec_list)))->NEXT_DEFINE)
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
typedef struct struct_plusrect
{
int NOMBRE;
rdsins_list *INSTANCE_NUM;
rdsrec_list *NEXT_EQUI;
struct struct_plusrect *NEXT_DEFINE;
} DrucTypeStructPlusRect;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern rdsfig_list *drucrdsfig();
extern char *drucgeterror();
# endif

View File

@ -0,0 +1 @@
SUBDIRS = src

View File

@ -0,0 +1,47 @@
dnl
/*
dnl This file is part of the Alliance CAD System
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
dnl Universite Pierre et Marie Curie
dnl
dnl Home page : http://www-asim.lip6.fr/alliance/
dnl E-mail support : mailto:alliance-support@asim.lip6.fr
dnl
dnl This library is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU Library General Public License as published
dnl by the Free Software Foundation; either version 2 of the License, or (at
dnl your option) any later version.
dnl
dnl Alliance VLSI CAD System is distributed in the hope that it will be
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Purpose : Auto stuffing Alliance
dnl Almost ten years since I wrote this stuff, I just can't
dnl believe it
dnl Date : 01/02/2002
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
dnl $Id: configure.in,v 1.1 2002/03/29 17:39:11 ludo Exp $
dnl
dnl
AC_INIT(src/gcp.h)
AM_INIT_AUTOMAKE(gcp, 1.1)
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LEX
AC_HEADER_STDC
AC_C_CONST
AC_PROG_RANLIB
AM_ALLIANCE
AC_OUTPUT([
Makefile
src/Makefile
])

View File

@ -0,0 +1,12 @@
lib_LIBRARIES = libGcp.a
include_HEADERS = gcp.h
libGcp_a_SOURCES = c_ccomp.y \
c_cdecl.c c_cdecl.h c_clex.c c_clex.h c_common.c c_common.h c_convert.c \
c_convert.h c_ctypeck.c c_ctypeck.h c_debug.c c_debug.h c_expand.c c_expand.h \
c_flags.c c_flags.h c_foldconst.c c_foldconst.h c_gperf.h c_parse.c c_parse.h \
c_stmt.c c_stmt.h c_tree.c c_treecompat.h c_tree.h gcp.h
CLEANFILES = c_ccomp.c c_ccomp.h vbl_bcomp_l.c
c_ccomp.c c_ccomp.h : $(srcdir)/c_ccomp.y
$(YACC) -d $(YFLAGS) $(srcdir)/c_ccomp.y && sed -e "s/yy/c_y_/g" -e "s/YY/C_Y_/g" y.tab.c > c_ccomp.c && sed -e "s/yy/c_y_/g" -e "s/YY/C_Y_/g" y.tab.h > c_ccomp.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,201 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_cdecl.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CDECL_H
# define C_CDECL_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# define C_INT_TYPE_SIZE (sizeof(int )*8)
# define C_CHAR_TYPE_SIZE (sizeof(char)*8)
# define C_LONG_TYPE_SIZE (sizeof(long)*8)
# define C_LONG_LONG_TYPE_SIZE (sizeof(long long int)*8)
# define C_SHORT_TYPE_SIZE (sizeof(short)*8)
# define C_FLOAT_TYPE_SIZE (sizeof(float)*8)
# define C_DOUBLE_TYPE_SIZE (sizeof(double)*8)
# define C_LONG_DOUBLE_TYPE_SIZE (sizeof(long double)*8)
# define C_POINTER_TYPE_SIZE (sizeof(char *)*8)
# define C_POINTER_SIZE C_POINTER_TYPE_SIZE
# define C_HOST_BITS_PER_WIDE_INT (int)C_INT_TYPE_SIZE
# define C_HOST_BITS_PER_LONG (int)C_LONG_TYPE_SIZE
# define C_HOST_BITS_PER_INT (int)C_INT_TYPE_SIZE
# define C_HOST_BITS_PER_CHAR (int)C_CHAR_TYPE_SIZE
# define C_HOST_WIDE_INT int
# define C_WCHAR_TYPE_SIZE C_INT_TYPE_SIZE
# define C_BITS_PER_UNIT C_CHAR_TYPE_SIZE
# define C_WCHAR_BYTES 1
# define C_BYTES_BIG_ENDIAN 0
# define C_BITS_PER_WORD (int)C_INT_TYPE_SIZE
/*------------------------------------------------------------\
| |
| Declar |
| |
\------------------------------------------------------------*/
# define C_CDECL_NORMAL 1
# define C_CDECL_FUNCDEF 2
# define C_CDECL_PARAM 3
# define C_CDECL_FIELD 4
# define C_CDECL_BIT_FIELD 5
# define C_CDECL_TYPENAME 6
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
# define c_resume_momentary(N)
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
typedef struct c_binding_level
{
struct c_binding_level *LEVEL_CHAIN;
c_tree_node *NAME_LIST;
c_tree_node *TAG_LIST;
c_tree_node *SHADOWED_LIST;
c_tree_node *BLOCK_LIST;
c_tree_node *THIS_BLOCK;
c_tree_node *PARAM_LIST;
char PARAM_FLAG;
char KEEP;
char KEEP_IF_SUBBLOCKS;
char TAG_TRANSPARENT;
char N_INCOMPLETE;
char SUBBLOCKS_TAG_TRANSPARENT;
} c_binding_level;
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern c_tree_node *c_tree_program_node;
extern c_tree_node *c_pending_invalid_xref;
extern char *c_pending_invalid_xref_file;
extern int c_pending_invalid_xref_line;
extern c_tree_node *c_current_function_decl;
extern int c_current_function_returns_value;
extern int c_current_function_returns_null;
extern c_tree_node *c_lastiddecl;
extern int c_skip_evaluation;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern c_binding_level * c_alloc_binding_level __P(());
extern int c_global_bindings_p __P(());
extern void c_view_binding __P((c_binding_level *Binding));
extern void c_view_current_binding __P(());
extern void c_clear_parm_order __P(());
extern void c_push_level __P((int tag_transparent));
extern c_tree_node * c_pop_level __P((int keep, int reverse, int functionbody));
extern c_tree_node * c_lookup_name __P((c_tree_node *TreeName));
extern c_tree_node * c_lookup_name_current_level __P((c_tree_node *TreeName));
extern int c_is_self_promoting_args_p __P((c_tree_node *parms));
extern int c_is_chain_member __P((c_tree_node *elem, c_tree_node *chain));
extern c_tree_node * c_push_decl __P((c_tree_node *TreeDecl));
extern void c_push_parm_decl __P((c_tree_node *parm));
extern void c_init_decl_processing __P(());
extern void c_decl_attributes __P((c_tree_node *Node, c_tree_node *Attributes, c_tree_node *Prefix_attributes));
extern c_tree_node * c_grokfield __P((char *Filename, int Line, c_tree_node *Declarator, c_tree_node *Declspecs, c_tree_node *Width));
extern c_tree_node * c_groktypename __P((c_tree_node *Typename));
extern c_tree_node * c_start_decl __P((c_tree_node *Declarator, c_tree_node *Declspecs, int Initialized, c_tree_node *Attributes, c_tree_node *Prefix_attributes));
extern void c_finish_decl __P((c_tree_node *decl, c_tree_node *init, c_tree_node *asmspec_tree));
extern void c_split_specs_attrs __P((c_tree_node *Specs_attrs, c_tree_node **Declspecs, c_tree_node **Prefix_attributes));
extern c_tree_node * c_round_up __P((c_tree_node *value, int divisor));
extern void c_layout_decl __P((c_tree_node *decl, unsigned known_align));
extern void c_layout_type __P((c_tree_node *type));
extern void c_parmlist_tags_warning __P(());
extern void c_declare_parm_level __P((int definition_flag));
extern int c_in_parm_level_p __P(());
extern int c_kept_level_p __P(());
extern void c_push_tag __P((c_tree_node *name, c_tree_node *type));
extern c_tree_node * c_start_struct __P((int code_type, c_tree_node *name));
extern c_tree_node * c_finish_struct __P((c_tree_node *t, c_tree_node *fieldlist, c_tree_node *attributes));
extern c_tree_node * c_xref_tag __P((int code, c_tree_node *name));
extern void c_shadow_tag_warned __P((c_tree_node *declspecs, int warned));
extern void c_shadow_tag __P((c_tree_node *declspecs));
extern c_tree_node * c_shadow_label __P((c_tree_node *name));
extern c_tree_node * c_lookup_label __P((c_tree_node *id));
extern c_tree_node * c_define_label __P((char *filename, int line, c_tree_node *name));
extern c_tree_node * c_start_enum __P((c_tree_node *name));
extern c_tree_node * c_finish_enum __P((c_tree_node *enumtype, c_tree_node *values, c_tree_node *attributes));
extern c_tree_node * c_build_enumerator __P((c_tree_node *name, c_tree_node *value));
extern int c_start_function __P((c_tree_node *declarator, c_tree_node *declspecs, c_tree_node *prefix_attributes, c_tree_node *attributes, int nested));
extern c_tree_node * c_finish_function __P((int nested, c_tree_node *body));
extern c_tree_node * c_get_tags __P(());
extern c_tree_node * c_get_decls __P(());
extern c_tree_node * c_get_parm_info __P((int void_at_end));
extern void c_store_parm_decls __P(());
extern int c_complete_array_type __P((c_tree_node *type, c_tree_node *initial_value, int do_default));
extern c_tree_node * c_implicitly_declare __P((c_tree_node *functionid));
extern void c_c_mark_varargs __P(());
extern void c_mark_varargs __P(());
extern void c_finish_file __P((c_tree_node *TreeNode ));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,120 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/* Define constants for communication with c-parse.y.
Copyright (C) 1987, 1992 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT 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
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
enum rid
{
RID_UNUSED,
RID_INT,
RID_CHAR,
RID_FLOAT,
RID_DOUBLE,
RID_VOID,
RID_UNUSED1,
RID_UNSIGNED,
RID_SHORT,
RID_LONG,
RID_AUTO,
RID_STATIC,
RID_EXTERN,
RID_REGISTER,
RID_TYPEDEF,
RID_SIGNED,
RID_CONST,
RID_VOLATILE,
RID_INLINE,
RID_NOALIAS,
RID_ITERATOR,
RID_COMPLEX,
RID_IN,
RID_OUT,
RID_INOUT,
RID_BYCOPY,
RID_ONEWAY,
RID_ID,
RID_MAX
};
typedef struct c_stmt_or_label
{
c_tree_node *stmt;
int ends_in_label;
} c_stmt_or_label;
#define NORID RID_UNUSED
#define RID_FIRST_MODIFIER RID_UNSIGNED
/* The elements of `ridpointers' are identifier nodes
for the reserved type names and storage classes.
It is indexed by a RID_... value. */
extern c_tree_node *c_ridpointers[(int) RID_MAX];
/* the declaration found for the last IDENTIFIER token read in.
yylex must look this up to detect typedefs, which get token type TYPENAME,
so it is left around in case the identifier is not a typedef but is
used in a context which makes it a reference to a variable. */
extern c_tree_node *c_lastiddecl;
extern char *token_buffer; /* Pointer to token buffer. */
# ifdef LUDO_NO_SKIP
extern tree make_pointer_declarator();
extern int yylex ();
# else
extern int c_y_lex __P(());
# endif
extern void c_reinit_parse_for_function __P(());
extern void c_position_after_white_space __P(());
extern void c_init_lex __P(( char *InputFileName ));
extern char *get_directive_line ();

View File

@ -0,0 +1,527 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_common.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_cdecl.h"
# include "c_convert.h"
# include "c_ctypeck.h"
# include "c_common.h"
# include "c_foldconst.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/* Print a warning if a constant expression had overflow in folding.
Invoke this function on every expression that the language
requires to be a constant expression.
Note the ANSI C standard says it is erroneous for a
constant expression to overflow. */
void c_constant_expression_warning (value)
c_tree_node *value;
{
if (( CTreeNodeFirstCode(value) == C_INT_CST_NODE || CTreeNodeFirstCode(value) == C_REAL_CST_NODE
|| CTreeNodeFirstCode(value) == C_COMPLEX_NODE)
&& CIsTreeNodeStatic(value) && c_pedantic)
{
pedwarn ("overflow in constant expression");
}
}
/* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
If X is 0, return -1.
This should be used via the floor_log2 macro. */
int
c_floor_log2_wide (x)
register unsigned C_HOST_WIDE_INT x;
{
register int log = -1;
while (x != 0)
log++,
x >>= 1;
return log;
}
/* Return the minimum number of bits needed to represent VALUE in a
signed or unsigned type, UNSIGNEDP says which. */
int c_min_precision (value, unsignedp)
c_tree_node *value;
int unsignedp;
{
int log;
/* If the value is negative, compute its negative minus 1. The latter
adjustment is because the absolute value of the largest negative value
is one larger than the largest positive value. This is equivalent to
a bit-wise negation, so use that operation instead. */
if (c_tree_is_int_cst_sgn(value) < 0)
value = c_fold (c_tree_build_unary_typed_expr(C_BIT_NOT_EXPR, CTreeType(value), value));
/* Return the number of bits needed, taking into account the fact
that we need one more bit for a signed than unsigned type. */
if (c_tree_is_integer_zerop (value))
log = 0;
else if (CTreeIntCstHigh(value) != 0)
log = C_HOST_BITS_PER_WIDE_INT + c_floor_log2_wide (CTreeIntCstHigh(value));
else
log = c_floor_log2_wide (CTreeIntCstLow(value));
return log + 1 + ! unsignedp;
}
/* Validate the expression after `case' and apply default promotions. */
c_tree_node *c_check_case_value(value)
c_tree_node *value;
{
if (value == NULL)
return value;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
CStripTypeNops(value);
if ( CTreeNodeFirstCode(value) != C_INT_CST_NODE
&& value != c_error_mark_node)
{
error ("case label does not reduce to an integer constant");
value = c_error_mark_node;
}
else
/* Promote char or short to int. */
value = c_default_conversion(value);
c_constant_expression_warning(value);
return value;
}
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type.
This function is also responsible for converting the two operands
to the proper common type for comparison.
The arguments of this function are all pointers to local variables
of build_binary_op: OP0_PTR is &OP0, OP1_PTR is &OP1,
RESTYPE_PTR is &RESULT_TYPE and RESCODE_PTR is &RESULTCODE.
If this function returns nonzero, it means that the comparison has
a constant value. What this function returns is an expression for
that value. */
c_tree_node *c_shorten_compare(op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
c_tree_node **op0_ptr;
c_tree_node **op1_ptr;
c_tree_node **restype_ptr;
int *rescode_ptr;
{
c_tree_node *type;
c_tree_node *op0 = *op0_ptr;
c_tree_node *op1 = *op1_ptr;
int unsignedp0, unsignedp1;
int real1, real2;
c_tree_node *primop0;
c_tree_node *primop1;
int code = *rescode_ptr;
/* Throw away any conversions to wider types
already present in the operands. */
primop0 = c_get_narrower(op0, &unsignedp0);
primop1 = c_get_narrower(op1, &unsignedp1);
/* Handle the case that OP0 does not *contain* a conversion
but it *requires* conversion to FINAL_TYPE. */
if (op0 == primop0 && CTreeType(op0) != *restype_ptr)
unsignedp0 = CIsTreeNodeUnsigned(CTreeType(op0));
if (op1 == primop1 && CTreeType(op1) != *restype_ptr)
unsignedp1 = CIsTreeNodeUnsigned(CTreeType(op1));
/* If one of the operands must be floated, we cannot optimize. */
real1 = CTreeTypeCode(CTreeType(primop0)) == C_REAL_TYPE;
real2 = CTreeTypeCode(CTreeType(primop1)) == C_REAL_TYPE;
/* If first arg is constant, swap the args (changing operation
so value is preserved), for canonicalization. Don't do this if
the second arg is 0. */
if ( CIsTreeNodeConstant(primop0)
&& ! c_tree_is_integer_zerop(primop1) && !
c_tree_is_real_zerop(primop1))
{
c_tree_node *tem = primop0;
int temi = unsignedp0;
primop0 = primop1;
primop1 = tem;
tem = op0;
op0 = op1;
op1 = tem;
*op0_ptr = op0;
*op1_ptr = op1;
unsignedp0 = unsignedp1;
unsignedp1 = temi;
temi = real1;
real1 = real2;
real2 = temi;
switch (code)
{
case C_LT_EXPR:
code = C_GT_EXPR;
break;
case C_GT_EXPR:
code = C_LT_EXPR;
break;
case C_LE_EXPR:
code = C_GE_EXPR;
break;
case C_GE_EXPR:
code = C_LE_EXPR;
break;
default:
break;
}
*rescode_ptr = code;
}
/* If comparing an integer against a constant more bits wide,
maybe we can deduce a value of 1 or 0 independent of the data.
Or else truncate the constant now
rather than extend the variable at run time.
This is only interesting if the constant is the wider arg.
Also, it is not safe if the constant is unsigned and the
variable arg is signed, since in this case the variable
would be sign-extended and then regarded as unsigned.
Our technique fails in this case because the lowest/highest
possible unsigned results don't follow naturally from the
lowest/highest possible values of the variable operand.
For just EQ_EXPR and NE_EXPR there is another technique that
could be used: see if the constant can be faithfully represented
in the other operand's type, by truncating it and reextending it
and see if that preserves the constant's value. */
if (!real1 && !real2
&& CTreeNodeFirstCode(primop1) == C_INT_CST_NODE
&& CTreeTypePrecision(CTreeType(primop0)) < CTreeTypePrecision(*restype_ptr))
{
int min_gt, max_gt, min_lt, max_lt;
c_tree_node *maxval;
c_tree_node *minval;
/* 1 if comparison is nominally unsigned. */
int unsignedp = CIsTreeNodeUnsigned(*restype_ptr);
c_tree_node *val;
type = c_get_signed_or_unsigned_type(unsignedp0, CTreeType(primop0));
maxval = CTreeTypeMaxValue(type);
minval = CTreeTypeMinValue(type);
if (unsignedp && !unsignedp0)
*restype_ptr = c_get_signed_type(*restype_ptr);
if (CTreeType(primop1) != *restype_ptr)
primop1 = c_convert_expr(*restype_ptr, primop1);
if (type != *restype_ptr)
{
minval = c_convert_expr(*restype_ptr, minval);
maxval = c_convert_expr(*restype_ptr, maxval);
}
if (unsignedp && unsignedp0)
{
min_gt = INT_CST_LT_UNSIGNED (primop1, minval);
max_gt = INT_CST_LT_UNSIGNED (primop1, maxval);
min_lt = INT_CST_LT_UNSIGNED (minval, primop1);
max_lt = INT_CST_LT_UNSIGNED (maxval, primop1);
}
else
{
min_gt = INT_CST_LT (primop1, minval);
max_gt = INT_CST_LT (primop1, maxval);
min_lt = INT_CST_LT (minval, primop1);
max_lt = INT_CST_LT (maxval, primop1);
}
val = 0;
/* This used to be a switch, but Genix compiler can't handle that. */
if (code == C_NE_EXPR)
{
if (max_lt || min_gt)
val = c_boolean_true_node;
}
else if (code == C_EQ_EXPR)
{
if (max_lt || min_gt)
val = c_boolean_false_node;
}
else if (code == C_LT_EXPR)
{
if (max_lt)
val = c_boolean_true_node;
if (!min_lt)
val = c_boolean_false_node;
}
else if (code == C_GT_EXPR)
{
if (min_gt)
val = c_boolean_true_node;
if (!max_gt)
val = c_boolean_false_node;
}
else if (code == C_LE_EXPR)
{
if (!max_gt)
val = c_boolean_true_node;
if (min_gt)
val = c_boolean_false_node;
}
else if (code == C_GE_EXPR)
{
if (!min_lt)
val = c_boolean_true_node;
if (max_lt)
val = c_boolean_false_node;
}
/* If primop0 was sign-extended and unsigned comparison specd,
we did a signed comparison above using the signed type bounds.
But the comparison we output must be unsigned.
Also, for inequalities, VAL is no good; but if the signed
comparison had *any* fixed result, it follows that the
unsigned comparison just tests the sign in reverse
(positive values are LE, negative ones GE).
So we can generate an unsigned comparison
against an extreme value of the signed type. */
if (unsignedp && !unsignedp0)
{
if (val != 0)
switch (code)
{
case C_LT_EXPR:
case C_GE_EXPR:
primop1 = CTreeTypeMinValue(type);
val = 0;
break;
case C_LE_EXPR:
case C_GT_EXPR:
primop1 = CTreeTypeMaxValue(type);
val = 0;
break;
default:
break;
}
type = c_get_unsigned_type(type);
}
if (!max_gt && !unsignedp0 && CTreeNodeFirstCode(primop0) != C_INT_CST_NODE)
{
/* This is the case of (char)x >?< 0x80, which people used to use
expecting old C compilers to change the 0x80 into -0x80. */
if (val == c_boolean_false_node)
{
warning ("comparison is always 0 due to limited range of data type");
}
if (val == c_boolean_true_node)
{
warning ("comparison is always 1 due to limited range of data type");
}
}
if (!min_lt && unsignedp0 && CTreeNodeFirstCode(primop0) != C_INT_CST_NODE)
{
/* This is the case of (unsigned char)x >?< -1 or < 0. */
if (val == c_boolean_false_node)
{
warning ("comparison is always 0 due to limited range of data type");
}
if (val == c_boolean_true_node)
{
warning ("comparison is always 1 due to limited range of data type");
}
}
if (val != 0)
{
/* Don't forget to evaluate PRIMOP0 if it has side effects. */
if ( CIsTreeNodeSideEffect(primop0))
return c_tree_build_binary_typed_expr(
C_COMPOUND_EXPR, CTreeType(val), primop0, val);
return val;
}
/* Value is not predetermined, but do the comparison
in the type of the operand that is not constant.
TYPE is already properly set. */
}
else if (real1 && real2
&& (CTreeTypePrecision(CTreeType(primop0))
== CTreeTypePrecision(CTreeType(primop1))))
type = CTreeType(primop0);
/* If args' natural types are both narrower than nominal type
and both extend in the same manner, compare them
in the type of the wider arg.
Otherwise must actually extend both to the nominal
common type lest different ways of extending
alter the result.
(eg, (short)-1 == (unsigned short)-1 should be 0.) */
else if (unsignedp0 == unsignedp1 && real1 == real2
&& CTreeTypePrecision(CTreeType(primop0)) < CTreeTypePrecision(*restype_ptr)
&& CTreeTypePrecision(CTreeType(primop1)) < CTreeTypePrecision(*restype_ptr))
{
type = c_get_common_type(CTreeType(primop0), CTreeType(primop1));
type = c_get_signed_or_unsigned_type(unsignedp0
|| CIsTreeNodeUnsigned(*restype_ptr),
type);
/* Make sure shorter operand is extended the right way
to match the longer operand. */
primop0 = c_convert_expr(
c_get_signed_or_unsigned_type(unsignedp0, CTreeType(primop0)), primop0);
primop1 = c_convert_expr(
c_get_signed_or_unsigned_type(unsignedp1, CTreeType(primop1)), primop1);
}
else
{
/* Here we must do the comparison on the nominal type
using the args exactly as we received them. */
type = *restype_ptr;
primop0 = op0;
primop1 = op1;
if (!real1 && !real2 && c_tree_is_integer_zerop(primop1)
&& CIsTreeNodeUnsigned(*restype_ptr))
{
c_tree_node *value = 0;
switch (code)
{
case C_GE_EXPR:
/* All unsigned values are >= 0, so we warn if extra warnings
are requested. However, if OP0 is a constant that is
>= 0, the signedness of the comparison isn't an issue,
so suppress the warning. */
if (c_extra_warnings
&& ! ( CTreeNodeFirstCode(primop0) == C_INT_CST_NODE
&& ! CIsTreeNodeOverflow(
c_convert_expr(c_get_signed_type(type), primop0))))
{
warning ("unsigned value >= 0 is always 1");
}
value = c_boolean_true_node;
break;
case C_LT_EXPR:
if (c_extra_warnings
&& ! ( CTreeNodeFirstCode(primop0) == C_INT_CST_NODE
&& ! CIsTreeNodeOverflow(
c_convert_expr(c_get_signed_type(type), primop0))))
{
warning ("unsigned value < 0 is always 0");
}
value = c_boolean_false_node;
break;
default:
break;
}
if (value != 0)
{
/* Don't forget to evaluate PRIMOP0 if it has side effects. */
if ( CIsTreeNodeSideEffect(primop0))
return c_tree_build_binary_typed_expr(
C_COMPOUND_EXPR, CTreeType(value), primop0, value);
return value;
}
}
}
*op0_ptr = c_convert_expr(type, primop0);
*op1_ptr = c_convert_expr(type, primop1);
*restype_ptr = c_boolean_type_node;
return 0;
}

View File

@ -0,0 +1,75 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_common.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_COMMON_H
# define C_COMMON_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern void c_constant_expression_warning __P((c_tree_node *value));
extern int c_min_precision __P((c_tree_node *value, int unsignedp));
extern c_tree_node * c_check_case_value __P((c_tree_node *value));
extern c_tree_node * c_check_case_value __P((c_tree_node *value));
extern c_tree_node * c_shorten_compare __P(( c_tree_node **op0_ptr, c_tree_node **op1_ptr, c_tree_node **restype_ptr, int *rescode_ptr ));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_convert.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CONVERT_H
# define C_CONVERT_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern c_tree_node * c_convert_to_pointer __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_to_real __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_to_complex __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_to_integer __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_convert_expr __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_default_conversion __P((c_tree_node *exp));
extern c_tree_node * c_truthvalue_conversion __P((c_tree_node *expr));
extern c_tree_node * c_convert_and_check __P((c_tree_node *type, c_tree_node *expr));
extern int c_is_staticp __P((c_tree_node *arg));
c_tree_node *arg;
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,116 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_ctypeck.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CTYPECK_H
# define C_CTYPECK_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern int c_is_comptypes __P((c_tree_node *type1, c_tree_node *type2));
extern c_tree_node * c_parser_build_indirect_ref __P((c_tree_node *ptr, char *errorstring));
extern c_tree_node * c_parser_build_conditional_expr __P((c_tree_node *TreeIf, c_tree_node *TreeArg1, c_tree_node *TreeArg2));
extern c_tree_node * c_parser_build_modify_expr __P(( c_tree_node *lhs, int modifycode, c_tree_node *rhs));
extern c_tree_node * c_get_non_lvalue __P((c_tree_node *x));
extern c_tree_node * c_parser_build_compound_expr __P((c_tree_node *list));
extern c_tree_node * c_is_initializer_constant_valid_p __P((c_tree_node *value, c_tree_node *endtype));
extern void c_store_init_value __P((c_tree_node *decl, c_tree_node *init));
extern c_tree_node * c_get_signed_or_unsigned_type __P((int unsignedp, c_tree_node *type));
extern c_tree_node * c_get_signed_type __P((c_tree_node *type));
extern c_tree_node * c_get_unsigned_type __P((c_tree_node *type));
extern int c_int_fits_type_p __P((c_tree_node *c, c_tree_node *type));
extern int c_is_tree_int_cst_lt __P((c_tree_node *t1, c_tree_node *t2));
extern c_tree_node * c_get_type_for_size __P((unsigned bits, int unsignedp));
extern int c_type_precision __P((c_tree_node *type));
extern c_tree_node * c_c_build_type_variant __P((c_tree_node *type, int constp, int volatilep));
extern void c_set_init_label __P((c_tree_node *fieldname));
extern void c_set_init_index __P((c_tree_node *first, c_tree_node *last));
extern c_tree_node * c_build_c_cast __P((c_tree_node *type, c_tree_node *expr));
extern c_tree_node * c_get_c_sizeof __P((c_tree_node *type));
extern c_tree_node * c_get_c_alignof __P((c_tree_node *type));
extern c_tree_node * c_get_c_alignof_expr __P((c_tree_node *expr));
extern int c_get_int_size_in_bytes __P((c_tree_node *type));
extern c_tree_node * c_parser_build_function_call __P((c_tree_node *function, c_tree_node *params));
extern void c_incomplete_type_error __P((c_tree_node *value, c_tree_node *type));
extern c_tree_node * c_require_complete_type __P((c_tree_node *value));
extern int c_is_lvalue_p __P((c_tree_node *ref));
extern c_tree_node * c_parser_build_array_ref __P((c_tree_node *array, c_tree_node *index));
extern c_tree_node * c_parser_build_component_ref __P((c_tree_node *datum, c_tree_node *component));
extern c_tree_node * c_get_size_in_bytes __P((c_tree_node *type));
extern c_tree_node * c_build_binary_op __P(( int code, c_tree_node *orig_op0, c_tree_node *orig_op1, int convert_p));
extern c_tree_node * c_parser_build_binary_op __P(( int code, c_tree_node *arg1, c_tree_node *arg2));
extern c_tree_node * c_parser_build_unary_op __P((int code, c_tree_node *xarg, int noconvert));
extern c_tree_node * c_get_narrower __P((c_tree_node *op, int *unsignedp_ptr));
extern c_tree_node * c_get_unwidened __P((c_tree_node *op, c_tree_node *for_type));
extern int c_mark_addressable __P((c_tree_node *exp));
extern void c_process_init_element __P((c_tree_node *value));
extern c_tree_node * c_pop_init_level __P((int implicit));
extern void c_push_init_level __P((int implicit));
extern void c_really_start_incremental_init __P((c_tree_node *type));
extern c_tree_node * c_finish_init __P(());
extern void c_start_init __P((c_tree_node *decl, c_tree_node *asmspec_tree, int top_level));
extern c_tree_node * c_get_common_type __P((c_tree_node *t1, c_tree_node *t2));
extern int c_force_fit_type __P((c_tree_node *t, int overflow ));
# endif

View File

@ -0,0 +1,712 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_debug.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include <varargs.h>
# include <stdarg.h>
# include <ctype.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_flags.h"
# include "c_cdecl.h"
# include "c_ctypeck.h"
# include "c_convert.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
#ifndef VPROTO
#ifdef __STDC__
#define PVPROTO(ARGS) ARGS
#define VPROTO(ARGS) ARGS
#define VA_START(va_list,var) va_start(va_list,var)
#else
#define PVPROTO(ARGS) ()
#define VPROTO(ARGS) (va_alist) va_dcl
#define VA_START(va_list,var) va_start(va_list)
#endif
#endif
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
static int c_need_error_newline;
/* Function of last error message;
more generally, function such that if next error message is in it
then we don't have to mention the function name. */
static c_tree_node *c_last_error_function = NULL;
/* Used to detect when input_file_stack has changed since last described. */
static int c_last_error_tick;
/* Called when the start of a function definition is parsed,
this function prints on stdout the name of the function. */
/* Number of error messages and warning messages so far. */
int c_errorcount = 0;
int c_warningcount = 0;
int c_sorrycount = 0;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/* Count an error or warning. Return 1 if the message should be printed. */
int c_count_error(warningp)
int warningp;
{
if (warningp && c_inhibit_warnings)
return 0;
if (warningp && !c_warnings_are_errors)
c_warningcount++;
else
{
static int warning_message = 0;
if (warningp && !warning_message)
{
fprintf (stdout, "warnings being treated as errors\n" );
warning_message = 1;
}
c_errorcount++;
}
return 1;
}
static char *c_print_decl_name(decl, verbosity)
c_tree_node *decl;
int verbosity;
{
return CTreeIdentPointer( CTreeDeclName(decl));
}
static void c_default_print_error_function(file)
char *file;
{
if (c_last_error_function != c_current_function_decl)
{
char *kind = "function";
if (c_current_function_decl != 0
&& CTreeTypeCode( CTreeType(c_current_function_decl)) == C_METHOD_TYPE)
{
kind = "method";
}
if (file)
{
fprintf (stdout, "%s: ", file);
}
if (c_current_function_decl == NULL)
{
fprintf (stdout, "At top level:\n");
}
else
{
char *name = c_print_decl_name(c_current_function_decl, 2);
fprintf (stdout, "In %s `%s':\n", kind, name);
}
c_last_error_function = c_current_function_decl;
}
}
/* Prints out, if necessary, the name of the current function
that caused an error. Called from all error and warning functions. */
void c_report_error_function(file)
char *file;
{
c_file_stack *p;
if (c_need_error_newline)
{
fprintf (stdout, "\n");
c_need_error_newline = 0;
}
c_default_print_error_function(file);
if (c_input_file_stack && c_input_file_stack->NEXT != 0
&& c_input_file_stack_tick != c_last_error_tick
&& file == c_input_filename)
{
fprintf (stdout, "In file included");
for (p = c_input_file_stack->NEXT; p; p = p->NEXT)
{
fprintf (stdout, " from %s:%d", p->NAME, p->LINE);
if (p->NEXT)
fprintf (stdout, ",\n ");
}
fprintf (stdout, ":\n");
c_last_error_tick = c_input_file_stack_tick;
}
}
/* Print a message. */
static void
c_vmessage(prefix, s, ap)
char *prefix;
char *s;
va_list ap;
{
if (prefix)
fprintf (stdout, "%s: ", prefix);
#ifdef HAVE_VPRINTF
vfprintf (stdout, s, ap);
#else
{
int v1 = va_arg(ap, int);
int v2 = va_arg(ap, int);
int v3 = va_arg(ap, int);
int v4 = va_arg(ap, int);
fprintf (stdout, s, v1, v2, v3, v4);
}
#endif
}
/* Print a message relevant to line LINE of file FILE. */
static void
c_v_message_with_file_and_line(file, line, prefix, s, ap)
char *file;
int line;
char *prefix;
char *s;
va_list ap;
{
if (file)
fprintf (stdout, "%s:%d: ", file, line);
c_vmessage(prefix, s, ap);
fputc('\n', stdout);
}
/* Print a message relevant to the given DECL. */
static void
c_v_message_with_decl(decl, prefix, s, ap)
c_tree_node *decl;
char *prefix;
char *s;
va_list ap;
{
char *p;
fprintf (stdout, "%s:%d: ",
CTreeDeclFileName(decl), CTreeDeclLineNum(decl));
if (prefix)
fprintf (stdout, "%s: ", prefix);
/* Do magic to get around lack of varargs support for insertion
of arguments into existing list. We know that the decl is first;
we ass_u_me that it will be printed with "%s". */
for (p = s; *p; ++p)
{
if (*p == '%')
{
if (*(p + 1) == '%')
++p;
else
break;
}
}
if (p > s) /* Print the left-hand substring. */
{
char fmt[sizeof "%.255s"];
long width = p - s;
if (width > 255L) width = 255L; /* arbitrary */
sprintf (fmt, "%%.%lds", width);
fprintf (stdout, fmt, s);
}
if (*p == '%') /* Print the name. */
{
char *n = (CTreeDeclName(decl)
? c_print_decl_name(decl, 2)
: "((anonymous))");
fputs (n, stdout);
while (*p)
{
++p;
if (isalpha (*(p - 1) & 0xFF))
break;
}
}
if (*p) /* Print the rest of the message. */
c_vmessage((char *)NULL, p, ap);
fputc ('\n', stdout);
}
/* Report an error at line LINE of file FILE. */
static void
c_v_error_with_file_and_line(file, line, s, ap)
char *file;
int line;
char *s;
va_list ap;
{
c_count_error(0);
c_report_error_function(file);
c_v_message_with_file_and_line(file, line, (char *)NULL, s, ap);
}
void
c_error_with_file_and_line(char *file, int line, char *s, ...)
{
#ifndef __STDC__
char *file;
int line;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
#endif
c_v_error_with_file_and_line (file, line, s, ap);
va_end (ap);
}
/* Report an error at the declaration DECL.
S is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la printf. */
static void c_v_error_with_decl (decl, s, ap)
c_tree_node *decl;
char *s;
va_list ap;
{
c_count_error(0);
c_report_error_function( CTreeDeclFileName(decl));
c_v_message_with_decl(decl, (char *)NULL, s, ap);
}
void
c_error_with_decl (tree decl, char *s, ...)
{
#ifndef __STDC__
c_tree_node *decl;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
#endif
c_v_error_with_decl (decl, s, ap);
va_end (ap);
}
/* Report an error at the line number of the insn INSN.
This is used only when INSN is an `asm' with operands,
and each ASM_OPERANDS records its own source file and line. */
static void
c_verror (s, ap)
char *s;
va_list ap;
{
c_v_error_with_file_and_line(c_input_filename, c_lineno, s, ap);
}
void c_error(char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_verror(s, ap);
va_end (ap);
}
/* Report a fatal error at the current line number. */
static void
c_vfatal (s, ap)
char *s;
va_list ap;
{
c_verror (s, ap);
gcpexit( 1 );
}
void
c_fatal (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vfatal (s, ap);
va_end (ap);
}
/* Report a warning at line LINE of file FILE. */
static void
c_v_warning_with_file_and_line (file, line, s, ap)
char *file;
int line;
char *s;
va_list ap;
{
if (c_count_error(1))
{
c_report_error_function(file);
c_v_message_with_file_and_line(file, line, "warning", s, ap);
}
}
void
c_warning_with_file_and_line (char *file, int line, char *s, ...)
{
#ifndef __STDC__
char *file;
int line;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
#endif
c_v_warning_with_file_and_line (file, line, s, ap);
va_end (ap);
}
/* Report a warning at the declaration DECL.
S is a format string which uses %s to substitute the declaration
name; subsequent substitutions are a la printf. */
static void c_v_warning_with_decl (decl, s, ap)
c_tree_node *decl;
char *s;
va_list ap;
{
if (c_count_error(1))
{
c_report_error_function ( CTreeDeclFileName(decl));
c_v_message_with_decl(decl, "warning", s, ap);
}
}
void c_warning_with_decl (tree decl, char *s, ...)
{
#ifndef __STDC__
c_tree_node *decl;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
#endif
c_v_warning_with_decl (decl, s, ap);
va_end (ap);
}
/* Report a warning at the current line number. */
static void
c_vwarning (s, ap)
char *s;
va_list ap;
{
c_v_warning_with_file_and_line(c_input_filename, c_lineno, s, ap);
}
void
c_warning (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vwarning(s, ap);
va_end (ap);
}
/* These functions issue either warnings or errors depending on
-pedantic-errors. */
static void
c_vpedwarn (s, ap)
char *s;
va_list ap;
{
if (c_flag_pedantic_errors)
c_verror (s, ap);
else
c_vwarning (s, ap);
}
void c_pedwarn (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vpedwarn (s, ap);
va_end (ap);
}
static void
c_v_pedwarn_with_decl(decl, s, ap)
c_tree_node *decl;
char *s;
va_list ap;
{
/* We don't want -pedantic-errors to cause the compilation to fail from
"errors" in system header files. Sometimes fixincludes can't fix what's
broken (eg: unsigned char bitfields - fixing it may change the alignment
which will cause programs to mysteriously fail because the C library
or kernel uses the original layout). There's no point in issuing a
warning either, it's just unnecessary noise. */
if (! CIsTreeDeclSystemHeader(decl))
{
if (c_flag_pedantic_errors)
c_v_error_with_decl(decl, s, ap);
else
c_v_warning_with_decl(decl, s, ap);
}
}
void
c_pedwarn_with_decl (tree decl, char *s, ...)
{
#ifndef __STDC__
c_tree_node *decl;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
#endif
c_v_pedwarn_with_decl (decl, s, ap);
va_end (ap);
}
static void
c_v_pedwarn_with_file_and_line (file, line, s, ap)
char *file;
int line;
char *s;
va_list ap;
{
if (c_flag_pedantic_errors)
c_v_error_with_file_and_line (file, line, s, ap);
else
c_v_warning_with_file_and_line (file, line, s, ap);
}
void
c_pedwarn_with_file_and_line (char *file, int line, char *s, ...)
{
#ifndef __STDC__
char *file;
int line;
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
#endif
c_v_pedwarn_with_file_and_line (file, line, s, ap);
va_end (ap);
}
/* Apologize for not implementing some feature. */
static void c_vsorry(s, ap)
char *s;
va_list ap;
{
c_sorrycount++;
if (c_input_filename)
fprintf (stdout, "%s:%d: ", c_input_filename, c_lineno);
else
c_vmessage ("sorry, not implemented", s, ap);
fputc ('\n', stdout);
}
void c_sorry(char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_vsorry (s, ap);
va_end (ap);
}
/* Apologize for not implementing some feature, then quit. */
static void
c_v_really_sorry (s, ap)
char *s;
va_list ap;
{
c_sorrycount++;
if (c_input_filename)
fprintf (stdout, "%s:%d: ", c_input_filename, c_lineno);
else
c_vmessage ("sorry, not implemented", s, ap);
c_fatal (" (fatal)\n");
}
void c_really_sorry (char *s, ...)
{
#ifndef __STDC__
char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#endif
c_v_really_sorry (s, ap);
va_end (ap);
}

View File

@ -0,0 +1,82 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_debug.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_DEBUG_H
# define C_DEBUG_H
# define c_header_debug() fprintf( stdout, "%s:%d: *%s*\n", \
__FILE__,__LINE__, __FUNCTION__)
# define c_fprintf c_header_debug(); fprintf
# define loc_c_tree_view_node c_header_debug(); fprintf( stdout, "\n" ); c_tree_view_node
# define loc_c_tree_view_node_list c_header_debug(); fprintf( stdout, "\n" ); c_tree_view_node_list
# define loc_c_view_binding c_header_debug(); fprintf( stdout, "\n" ); c_view_binding
# define warning c_header_debug(); c_warning
# define pedwarn c_header_debug(); c_pedwarn
# define error c_header_debug(); c_error
# define warning_with_decl c_header_debug(); c_warning_with_decl
# define error_with_decl c_header_debug(); c_error_with_decl
# define pedwarn_with_decl c_header_debug(); c_pedwarn_with_decl
# define warning_with_file_and_line c_header_debug(); c_warning_with_file_and_line
# define error_with_file_and_line c_header_debug(); c_error_with_file_and_line
# define pedwarn_with_file_and_line c_header_debug(); c_pedwarn_with_file_and_line
# define warning_init c_header_debug(); c_warning_init
# define pedwarn_init c_header_debug(); c_pedwarn_init
# define error_init c_header_debug(); c_error_init
# define warn_for_assignment c_header_debug(); c_warn_for_assignment
extern void c_error __P((char *s, ...));
extern void c_pedwarn __P((char *s, ...));
extern void c_warning __P((char *s, ...));
extern void c_warning_with_file_and_line __P((char *file, int line, char *s, ...));
extern void c_pedwarn_with_file_and_line __P((char *file, int line, char *s, ...));
extern void c_error_with_file_and_line __P((char *file, int line, char *s, ...));
extern void c_error_with_decl __P((c_tree_node *decl, char *s, ...));
extern void c_warning_with_decl __P((c_tree_node *decl, char *s, ...));
extern void c_pedwarn_with_decl __P((c_tree_node *decl, char *s, ...));
# endif

View File

@ -0,0 +1,106 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_expand.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_cdecl.h"
# include "c_convert.h"
# include "c_ctypeck.h"
# include "c_expand.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*
ITERATOR RTL EXPANSIONS
Expanding simple statements with iterators is straightforward:
collect the list of all free iterators in the statement, and
generate a loop for each of them.
An iterator is "free" if it has not been "bound" by a FOR
operator. The DECL_RTL of the iterator is the loop counter. */
/* Expand a statement STMT, possibly containing iterator usage, into RTL. */
void c_iterator_expand (stmt)
c_tree_node *stmt;
{
# ifdef LUDO_NO_SKIP
c_tree_node *iter_list;
save_exprs = NULL_TREE;
iter_list = collect_iterators (stmt, NULL_TREE);
expand_stmt_with_iterators_1 (stmt, iter_list);
istack_sublevel_to_current ();
# endif
/*
loc_c_tree_view_node( stmt );
*/
}

View File

@ -0,0 +1,72 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_expand.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_EXPAND_H
# define C_EXPAND_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern void c_iterator_expand __P((c_tree_node *stmt));
# endif

View File

@ -0,0 +1,740 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_flags.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Nonzero for -pedantic switch: warn about anything that standard C forbids. */
int c_pedantic = 0;
/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
int c_flag_traditional = 0;
/* Nonzero means `$' can be in an identifier. */
int c_dollars_in_ident = 0;
/* Nonzero enables objc features. */
int c_doing_objc_thang = 0;
/* Nonzero means don't recognize the keyword `asm'. */
int c_flag_no_asm = 0;
/* Nonzero means warn about any identifiers that match in the first N
characters. The value N is in `id_clash_len'. */
int c_warn_id_clash;
unsigned c_id_clash_len;
/* Nonzero for -fwritable-strings:
store string constants in data segment and don't uniquize them. */
int c_flag_writable_strings;
/* Nonzero means `char' should be signed. */
int c_flag_signed_char;
/* Nonzero means give an enum type only as many bytes as it needs. */
int c_flag_short_enums;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
int c_warn_return_type;
/* Nonzero to warn about variables used before they are initialized. */
int c_warn_uninitialized;
/* Nonzero to warn about unused local variables. */
int c_warn_unused;
/* Warn if a switch on an enum fails to have a case for every enum value. */
int c_warn_switch;
/* Nonzero means warn about all declarations which shadow others. */
int c_warn_shadow;
/* Nonzero means don't place uninitialized global data in common storage
by default. */
int c_flag_no_common;
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
int c_warn_larger_than;
unsigned c_larger_than_size;
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard. */
int c_flag_pedantic_errors = 0;
/* Tag all structures with __attribute__(packed) */
int c_flag_pack_struct = 0;
/* Warn about traditional constructs whose meanings changed in ANSI C. */
int c_warn_traditional;
/* Nonzero means that we have builtin functions, and main is an int */
int c_flag_hosted = 1;
/* Nonzero means don't recognize any builtin functions. */
int c_flag_no_builtin;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
int flag_allow_single_precision = 0;
/* Warn if main is suspicious. */
int c_warn_main;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
int c_flag_signed_bitfields = 1;
int c_explicit_flag_signed_bitfields = 0;
/* Nonzero means allow type mismatches in conditional expressions;
just make their values `void'. */
int c_flag_cond_mismatch;
/* Nonzero means give `double' the same size as `float'. */
int c_flag_short_double;
/* Nonzero means handle `#ident' directives. 0 means ignore them. */
int c_flag_no_ident = 0;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
int c_flag_no_nonansi_builtin;
/* Nonzero means message about use of implicit function declarations;
1 means warning; 2 means error. */
int c_mesg_implicit_function_declaration;
/* Nonzero means warn about use of implicit int. */
int c_warn_implicit_int;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
int c_flag_allow_single_precision = 0;
/* Nonzero means give string constants the type `const char *'
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
int c_warn_write_strings;
/* Nonzero means warn about pointer casts that can drop a type qualifier
from the pointer target type. */
int c_warn_cast_qual;
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
int c_warn_bad_function_cast;
/* Nonzero means warn about sizeof(function) or addition/subtraction
of function pointers. */
int c_warn_pointer_arith;
/* Nonzero means warn for non-prototype function decls
or non-prototyped defs without previous prototype. */
int c_warn_strict_prototypes;
/* Nonzero means warn for any global function def
without separate previous prototype decl. */
int c_warn_missing_prototypes;
/* Nonzero means warn for any global function def
without separate previous decl. */
int c_warn_missing_declarations;
/* Nonzero means warn about multiple (redundant) decls for the same single
variable or function. */
int c_warn_redundant_decls = 0;
/* Nonzero means warn about extern declarations of objects not at
file-scope level and about *all* declarations of functions (whether
extern or static) not at file-scope level. Note that we exclude
implicit function declarations. To get warnings about those, use
-Wimplicit. */
int c_warn_nested_externs = 0;
/* Warn about *printf or *scanf format/argument anomalies. */
int c_warn_format;
/* Warn about a subscript that has type char. */
int c_warn_char_subscripts = 0;
/* Warn if a type conversion is done that might have confusing results. */
int c_warn_conversion;
/* Warn if adding () is suggested. */
int c_warn_parentheses;
/* Warn if initializer is not completely bracketed. */
int c_warn_missing_braces;
/* Warn about comparison of signed and unsigned values.
If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
int c_warn_sign_compare = -1;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
int c_in_system_header = 0;
/* Name of current original source file (what was input to cpp).
This comes from each #-command in the actual input. */
char *c_input_filename;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
If there isn't any there, then this is the cc1 input file name. */
char *c_main_input_filename;
/* Stack of currently pending input files. */
c_file_stack *c_input_file_stack;
/* Incremented on each change to input_file_stack. */
int c_input_file_stack_tick;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
int c_flag_float_store = 0;
/* Nonzero means all references through pointers are volatile. */
int c_flag_volatile;
/* Don't print warning messages. -w. */
int c_inhibit_warnings = 0;
/* Print various extra warnings. -W. */
int c_extra_warnings = 0;
/* Treat warnings as errors. -Werror. */
int c_warnings_are_errors = 0;
/* Nonzero means we should be saving declaration info into a .X file. */
int c_flag_gen_aux_info = 0;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing
faster code for sqrt to be generated. */
int c_flag_fast_math = 0;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
static void c_init_flags()
{
/* Nonzero for -pedantic switch: warn about anything that standard C forbids. */
c_pedantic = 0;
/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
c_flag_traditional = 0;
/* Nonzero means `$' can be in an identifier. */
c_dollars_in_ident = 0;
/* Nonzero enables objc features. */
c_doing_objc_thang = 0;
/* Nonzero means don't recognize the keyword `asm'. */
c_flag_no_asm = 0;
/* Nonzero means warn about any identifiers that match in the first N
characters. The value N is in `id_clash_len'. */
c_warn_id_clash = 0;
c_id_clash_len = 0;
/* Nonzero for -fwritable-strings:
store string constants in data segment and don't uniquize them. */
c_flag_writable_strings = 0;
/* Nonzero means `char' should be signed. */
c_flag_signed_char = 0;
/* Nonzero means give an enum type only as many bytes as it needs. */
c_flag_short_enums = 0;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
c_warn_return_type = 0;
/* Nonzero to warn about variables used before they are initialized. */
c_warn_uninitialized = 0;
/* Nonzero to warn about unused local variables. */
c_warn_unused = 0;
/* Warn if a switch on an enum fails to have a case for every enum value. */
c_warn_switch = 0;
/* Nonzero means warn about all declarations which shadow others. */
c_warn_shadow = 0;
/* Nonzero means don't place uninitialized global data in common storage
by default. */
c_flag_no_common = 0;
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
c_warn_larger_than = 0;
c_larger_than_size = 0;
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard. */
c_flag_pedantic_errors = 0;
/* Tag all structures with __attribute__(packed) */
c_flag_pack_struct = 0;
/* Warn about traditional constructs whose meanings changed in ANSI C. */
c_warn_traditional = 0;
/* Nonzero means that we have builtin functions, and main is an*/
c_flag_hosted = 1;
/* Nonzero means don't recognize any builtin functions. */
c_flag_no_builtin = 0;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
flag_allow_single_precision = 0;
/* Warn if main is suspicious. */
c_warn_main = 0;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
c_flag_signed_bitfields = 1;
c_explicit_flag_signed_bitfields = 0;
/* Nonzero means allow type mismatches in conditional expressions = 0;
just make their values `void'. */
c_flag_cond_mismatch = 0;
/* Nonzero means give `double' the same size as `float'. */
c_flag_short_double = 0;
/* Nonzero means handle `#ident' directives. 0 means ignore them. */
c_flag_no_ident = 0;
/* Nonzero means don't recognize the non-ANSI builtin functions.
-ansi sets this. */
c_flag_no_nonansi_builtin = 0;
/* Nonzero means message about use of implicit function declarations = 0;
1 means warning; 2 means error. */
c_mesg_implicit_function_declaration = 0;
/* Nonzero means warn about use of implicit int. */
c_warn_implicit_int = 0;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
c_flag_allow_single_precision = 0;
/* Nonzero means give string constants the type `const char *'
to get extra warnings from them. These warnings will be too numerous
to be useful, except in thoroughly ANSIfied programs. */
c_warn_write_strings = 0;
/* Nonzero means warn about pointer casts that can drop a type qualifier
from the pointer target type. */
c_warn_cast_qual = 0;
/* Nonzero means warn when casting a function call to a type that does
not match the return type (e.g. (float)sqrt() or (anything*)malloc()
when there is no previous declaration of sqrt or malloc. */
c_warn_bad_function_cast = 0;
/* Nonzero means warn about sizeof(function) or addition/subtraction
of function pointers. */
c_warn_pointer_arith = 0;
/* Nonzero means warn for non-prototype function decls
or non-prototyped defs without previous prototype. */
c_warn_strict_prototypes = 0;
/* Nonzero means warn for any global function def
without separate previous prototype decl. */
c_warn_missing_prototypes = 0;
/* Nonzero means warn for any global function def
without separate previous decl. */
c_warn_missing_declarations = 0;
/* Nonzero means warn about multiple (redundant) decls for the same single
variable or function. */
c_warn_redundant_decls = 0;
/* Nonzero means warn about extern declarations of objects not at
file-scope level and about *all* declarations of functions (whether
extern or static) not at file-scope level. Note that we exclude
implicit function declarations. To get warnings about those, use
-Wimplicit. */
c_warn_nested_externs = 0;
/* Warn about *printf or *scanf format/argument anomalies. */
c_warn_format = 0;
/* Warn about a subscript that has type char. */
c_warn_char_subscripts = 0;
/* Warn if a type conversion is done that might have confusing results. */
c_warn_conversion = 0;
/* Warn if adding () is suggested. */
c_warn_parentheses = 0;
/* Warn if initializer is not completely bracketed. */
c_warn_missing_braces = 0;
/* Warn about comparison of signed and unsigned values.
If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
c_warn_sign_compare = -1;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
c_in_system_header = 0;
/* Name of current original source file (what was input to cpp).
This comes from each #-command in the actual input. */
c_input_filename = 0;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
If there isn't any there, then this is the cc1 input file name. */
c_main_input_filename = 0;
/* Stack of currently pending input files. */
c_input_file_stack = 0;
/* Incremented on each change to input_file_stack. */
c_input_file_stack_tick = 0;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
c_flag_float_store = 0;
/* Nonzero means all references through pointers are volatile. */
c_flag_volatile = 0;
/* Don't print warning messages. -w. */
c_inhibit_warnings = 0;
/* Print various extra warnings. -W. */
c_extra_warnings = 0;
/* Treat warnings as errors. -Werror. */
c_warnings_are_errors = 0;
/* Nonzero means we should be saving declaration info into a .X file. */
c_flag_gen_aux_info = 0;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing
faster code for sqrt to be generated. */
c_flag_fast_math = 0;
}
static int c_parse_one_flags( p )
char *p;
{
c_init_flags();
if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
{
c_flag_traditional = 1;
c_flag_writable_strings = 1;
}
else if (!strcmp (p, "-fallow-single-precision"))
c_flag_allow_single_precision = 1;
else if (!strcmp (p, "-fhosted") || !strcmp (p, "-fno-freestanding"))
{
c_flag_hosted = 1;
c_flag_no_builtin = 0;
}
else if (!strcmp (p, "-ffreestanding") || !strcmp (p, "-fno-hosted"))
{
c_flag_hosted = 0;
c_flag_no_builtin = 1;
/* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */
if (c_warn_main == 2)
c_warn_main = 0;
}
else if (!strcmp (p, "-fnotraditional") || !strcmp (p, "-fno-traditional"))
{
c_flag_traditional = 0;
c_flag_writable_strings = 0;
}
else if (!strcmp (p, "-fdollars-in-identifiers"))
c_dollars_in_ident = 1;
else if (!strcmp (p, "-fno-dollars-in-identifiers"))
c_dollars_in_ident = 0;
else if (!strcmp (p, "-fsigned-char"))
c_flag_signed_char = 1;
else if (!strcmp (p, "-funsigned-char"))
c_flag_signed_char = 0;
else if (!strcmp (p, "-fno-signed-char"))
c_flag_signed_char = 0;
else if (!strcmp (p, "-fno-unsigned-char"))
c_flag_signed_char = 1;
else if (!strcmp (p, "-fsigned-bitfields")
|| !strcmp (p, "-fno-unsigned-bitfields"))
{
c_flag_signed_bitfields = 1;
c_explicit_flag_signed_bitfields = 1;
}
else if (!strcmp (p, "-funsigned-bitfields")
|| !strcmp (p, "-fno-signed-bitfields"))
{
c_flag_signed_bitfields = 0;
c_explicit_flag_signed_bitfields = 1;
}
else if (!strcmp (p, "-fshort-enums"))
c_flag_short_enums = 1;
else if (!strcmp (p, "-fno-short-enums"))
c_flag_short_enums = 0;
else if (!strcmp (p, "-fcond-mismatch"))
c_flag_cond_mismatch = 1;
else if (!strcmp (p, "-fno-cond-mismatch"))
c_flag_cond_mismatch = 0;
else if (!strcmp (p, "-fshort-double"))
c_flag_short_double = 1;
else if (!strcmp (p, "-fno-short-double"))
c_flag_short_double = 0;
else if (!strcmp (p, "-fasm"))
c_flag_no_asm = 0;
else if (!strcmp (p, "-fno-asm"))
c_flag_no_asm = 1;
else if (!strcmp (p, "-fbuiltin"))
c_flag_no_builtin = 0;
else if (!strcmp (p, "-fno-builtin"))
c_flag_no_builtin = 1;
else if (!strcmp (p, "-fno-ident"))
c_flag_no_ident = 1;
else if (!strcmp (p, "-fident"))
c_flag_no_ident = 0;
else if (!strcmp (p, "-ansi"))
c_flag_no_asm = 1, c_flag_no_nonansi_builtin = 1;
else if (!strcmp (p, "-Werror-implicit-function-declaration"))
c_mesg_implicit_function_declaration = 2;
else if (!strcmp (p, "-Wimplicit-function-declaration"))
c_mesg_implicit_function_declaration = 1;
else if (!strcmp (p, "-Wno-implicit-function-declaration"))
c_mesg_implicit_function_declaration = 0;
else if (!strcmp (p, "-Wimplicit-int"))
c_warn_implicit_int = 1;
else if (!strcmp (p, "-Wno-implicit-int"))
c_warn_implicit_int = 0;
else if (!strcmp (p, "-Wimplicit"))
{
c_warn_implicit_int = 1;
if (c_mesg_implicit_function_declaration != 2)
c_mesg_implicit_function_declaration = 1;
}
else if (!strcmp (p, "-Wno-implicit"))
c_warn_implicit_int = 0, c_mesg_implicit_function_declaration = 0;
else if (!strcmp (p, "-Wwrite-strings"))
c_warn_write_strings = 1;
else if (!strcmp (p, "-Wno-write-strings"))
c_warn_write_strings = 0;
else if (!strcmp (p, "-Wcast-qual"))
c_warn_cast_qual = 1;
else if (!strcmp (p, "-Wno-cast-qual"))
c_warn_cast_qual = 0;
else if (!strcmp (p, "-Wbad-function-cast"))
c_warn_bad_function_cast = 1;
else if (!strcmp (p, "-Wno-bad-function-cast"))
c_warn_bad_function_cast = 0;
else if (!strcmp (p, "-Wpointer-arith"))
c_warn_pointer_arith = 1;
else if (!strcmp (p, "-Wno-pointer-arith"))
c_warn_pointer_arith = 0;
else if (!strcmp (p, "-Wstrict-prototypes"))
c_warn_strict_prototypes = 1;
else if (!strcmp (p, "-Wno-strict-prototypes"))
c_warn_strict_prototypes = 0;
else if (!strcmp (p, "-Wmissing-prototypes"))
c_warn_missing_prototypes = 1;
else if (!strcmp (p, "-Wno-missing-prototypes"))
c_warn_missing_prototypes = 0;
else if (!strcmp (p, "-Wmissing-declarations"))
c_warn_missing_declarations = 1;
else if (!strcmp (p, "-Wno-missing-declarations"))
c_warn_missing_declarations = 0;
else if (!strcmp (p, "-Wredundant-decls"))
c_warn_redundant_decls = 1;
else if (!strcmp (p, "-Wno-redundant-decls"))
c_warn_redundant_decls = 0;
else if (!strcmp (p, "-Wnested-externs"))
c_warn_nested_externs = 1;
else if (!strcmp (p, "-Wno-nested-externs"))
c_warn_nested_externs = 0;
else if (!strcmp (p, "-Wtraditional"))
c_warn_traditional = 1;
else if (!strcmp (p, "-Wno-traditional"))
c_warn_traditional = 0;
else if (!strcmp (p, "-Wformat"))
c_warn_format = 1;
else if (!strcmp (p, "-Wno-format"))
c_warn_format = 0;
else if (!strcmp (p, "-Wchar-subscripts"))
c_warn_char_subscripts = 1;
else if (!strcmp (p, "-Wno-char-subscripts"))
c_warn_char_subscripts = 0;
else if (!strcmp (p, "-Wconversion"))
c_warn_conversion = 1;
else if (!strcmp (p, "-Wno-conversion"))
c_warn_conversion = 0;
else if (!strcmp (p, "-Wparentheses"))
c_warn_parentheses = 1;
else if (!strcmp (p, "-Wno-parentheses"))
c_warn_parentheses = 0;
else if (!strcmp (p, "-Wreturn-type"))
c_warn_return_type = 1;
else if (!strcmp (p, "-Wno-return-type"))
c_warn_return_type = 0;
else if (!strcmp (p, "-Wcomment"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-comment"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wcomments"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-comments"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wtrigraphs"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-trigraphs"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wundef"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-undef"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wimport"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-import"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wmissing-braces"))
c_warn_missing_braces = 1;
else if (!strcmp (p, "-Wno-missing-braces"))
c_warn_missing_braces = 0;
else if (!strcmp (p, "-Wmain"))
c_warn_main = 1;
else if (!strcmp (p, "-Wno-main"))
c_warn_main = 0;
else if (!strcmp (p, "-Wsign-compare"))
c_warn_sign_compare = 1;
else if (!strcmp (p, "-Wno-sign-compare"))
c_warn_sign_compare = 0;
else if (!strcmp (p, "-Wall"))
{
/* We save the value of warn_uninitialized, since if they put
-Wuninitialized on the command line, we need to generate a
warning about not using it without also specifying -O. */
if (c_warn_uninitialized != 1)
c_warn_uninitialized = 2;
c_warn_implicit_int = 1;
c_mesg_implicit_function_declaration = 1;
c_warn_return_type = 1;
c_warn_unused = 1;
c_warn_switch = 1;
c_warn_format = 1;
c_warn_char_subscripts = 1;
c_warn_parentheses = 1;
c_warn_missing_braces = 1;
/* We set this to 2 here, but 1 in -Wmain, so -ffreestanding can turn
it off only if it's not explicit. */
c_warn_main = 2;
}
else
return 0;
return 1;
}
int c_parse_flags( Argc, Argv )
int Argc;
char **Argv;
{
int Index;
int Error;
Error = 0;
for ( Index = 0; Index < Argc; Index++ )
{
if ( ! c_parse_one_flags( Argv[ Index ] ) ) Error = 1;
}
return( Error );
}

View File

@ -0,0 +1,303 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_flags.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_FLAGS_H
# define C_FLAGS_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
typedef struct c_file_stack
{
struct c_file_stack *NEXT;
char *NAME;
int LINE;
int INDENT_LEVEL;
} c_file_stack;
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Nonzero for -pedantic switch: warn about anything that standard C forbids. */
int c_pedantic;
/* Nonzero means try to imitate old fashioned non-ANSI preprocessor. */
int c_flag_traditional;
/* Nonzero means `$' can be in an identifier. */
extern int c_dollars_in_ident;
/* Nonzero enables objc features. */
extern int c_doing_objc_thang;
/* Nonzero means don't recognize the keyword `asm'. */
extern int c_flag_no_asm;
/* Temporarily suppress certain warnings.
extern This is set while reading code from a system header file. */
extern int c_in_system_header;
/* Nonzero means warn about any identifiers that match in the first N
extern characters. The value N is in `id_clash_len'. */
extern int c_warn_id_clash;
extern unsigned c_id_clash_len;
/* Nonzero for -fwritable-strings:
extern store string constants in data segment and don't uniquize them. */
extern int c_flag_writable_strings;
/* Nonzero means `char' should be signed. */
extern int c_flag_signed_char;
/* Nonzero means give an enum type only as many bytes as it needs. */
extern int c_flag_short_enums;
/* Nonzero means warn about function definitions that default the return type
extern or that use a null return and have a return-type other than void. */
extern int c_warn_return_type;
/* Nonzero to warn about variables used before they are initialized. */
extern int c_warn_uninitialized;
/* Nonzero to warn about unused local variables. */
extern int c_warn_unused;
/* Warn if a switch on an enum fails to have a case for every enum value. */
extern int c_warn_switch;
/* Nonzero means warn about all declarations which shadow others. */
extern int c_warn_shadow;
/* Nonzero means don't place uninitialized global data in common storage
extern by default. */
extern int c_flag_no_common;
/* Nonzero means warn about any objects definitions whose size is larger
extern than N bytes. Also want about function definitions whose returned
extern values are larger than N bytes. The value N is in `larger_than_size'. */
extern int c_warn_larger_than;
extern unsigned c_larger_than_size;
/* Nonzero means change certain warnings into errors.
extern Usually these are warnings about failure to conform to some standard. */
extern int c_flag_pedantic_errors;
/* Tag all structures with __attribute__(packed) */
extern int c_flag_pack_struct;
/* Warn about traditional constructs whose meanings changed in ANSI C. */
extern int c_warn_traditional;
/* Nonzero means that we have builtin functions, and main is an int */
extern int c_flag_hosted;
/* Nonzero means don't recognize any builtin functions. */
extern int c_flag_no_builtin;
/* Nonzero means to allow single precision math even if we're generally
extern being traditional. */
extern int flag_allow_single_precision;
/* Warn if main is suspicious. */
extern int c_warn_main;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
extern int c_flag_signed_bitfields;
extern int c_explicit_flag_signed_bitfields;
/* Nonzero means allow type mismatches in conditional expressions;
extern just make their values `void'. */
extern int c_flag_cond_mismatch;
/* Nonzero means give `double' the same size as `float'. */
extern int c_flag_short_double;
/* Nonzero means handle `#ident' directives. 0 means ignore them. */
extern int c_flag_no_ident;
/* Nonzero means don't recognize the non-ANSI builtin functions.
extern -ansi sets this. */
extern int c_flag_no_nonansi_builtin;
/* Nonzero means message about use of implicit function declarations;
1 means warning; 2 means error. */
extern int c_mesg_implicit_function_declaration;
/* Nonzero means warn about use of implicit int. */
extern int c_warn_implicit_int;
/* Nonzero means to allow single precision math even if we're generally
extern being traditional. */
extern int c_flag_allow_single_precision;
/* Nonzero means give string constants the type `const char *'
extern to get extra warnings from them. These warnings will be too numerous
extern to be useful, except in thoroughly ANSIfied programs. */
extern int c_warn_write_strings;
/* Nonzero means warn about pointer casts that can drop a type qualifier
extern from the pointer target type. */
extern int c_warn_cast_qual;
/* Nonzero means warn when casting a function call to a type that does
extern not match the return type (e.g. (float)sqrt() or (anything*)malloc()
extern when there is no previous declaration of sqrt or malloc. */
extern int c_warn_bad_function_cast;
/* Nonzero means warn about sizeof(function) or addition/subtraction
extern of function pointers. */
extern int c_warn_pointer_arith;
/* Nonzero means warn for non-prototype function decls
extern or non-prototyped defs without previous prototype. */
extern int c_warn_strict_prototypes;
/* Nonzero means warn for any global function def
extern without separate previous prototype decl. */
extern int c_warn_missing_prototypes;
/* Nonzero means warn for any global function def
extern without separate previous decl. */
extern int c_warn_missing_declarations;
/* Nonzero means warn about multiple (redundant) decls for the same single
extern variable or function. */
extern int c_warn_redundant_decls;
/* Nonzero means warn about extern declarations of objects not at
extern file-scope level and about *all* declarations of functions (whether
extern extern or static) not at file-scope level. Note that we exclude
extern implicit function declarations. To get warnings about those, use
extern -Wimplicit. */
extern int c_warn_nested_externs;
/* Warn about *printf or *scanf format/argument anomalies. */
extern int c_warn_format;
/* Warn about a subscript that has type char. */
extern int c_warn_char_subscripts;
/* Warn if a type conversion is done that might have confusing results. */
extern int c_warn_conversion;
/* Warn if adding () is suggested. */
extern int c_warn_parentheses;
/* Warn if initializer is not completely bracketed. */
extern int c_warn_missing_braces;
/* Warn about comparison of signed and unsigned values.
extern If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
extern int c_warn_sign_compare;
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
extern int c_in_system_header;
/* Name of current original source file (what was input to cpp).
This comes from each #-command in the actual input. */
extern char *c_input_filename;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
If there isn't any there, then this is the cc1 input file name. */
extern char *c_main_input_filename;
/* Current line number in real source file. */
extern int c_lineno;
/* Stack of currently pending input files. */
extern c_file_stack *c_input_file_stack;
/* Incremented on each change to input_file_stack. */
extern int c_input_file_stack_tick;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
extern int c_flag_float_store;
/* Nonzero means all references through pointers are volatile. */
extern int c_flag_volatile;
/* Don't print warning messages. -w. */
extern int c_inhibit_warnings;
/* Print various extra warnings. -W. */
extern int c_extra_warnings;
/* Treat warnings as errors. -Werror. */
extern int c_warnings_are_errors;
/* Nonzero means we should be saving declaration info into a .X file. */
extern int c_flag_gen_aux_info;
/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
operations in the interest of optimization. For example it allows
GCC to assume arguments to sqrt are nonnegative numbers, allowing
faster code for sqrt to be generated. */
extern int c_flag_fast_math;
extern int c_parse_flags __P((int Argc, char **Argv));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_foldconst.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_FOLD_CONST_H
# define C_FOLD_CONST_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
Zero means allow extended lvalues. */
extern int c_pedantic_lvalues;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern c_tree_node *c_invert_truthvalue __P((c_tree_node *arg));
extern c_tree_node *c_non_lvalue __P(( c_tree_node *x));
extern c_tree_node *c_build_size_binop __P(( int code, c_tree_node *arg0, c_tree_node *arg1));
extern c_tree_node *c_fold __P((c_tree_node *expr));
extern int c_is_operand_equal_p __P((c_tree_node *arg0, c_tree_node *arg1, int only_const));
extern c_tree_node *c_get_pedantic_non_lvalue __P((c_tree_node *x));
# endif

View File

@ -0,0 +1,219 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/* C code produced by gperf version 2.5 (GNU C++ version) */
/* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ./c-parse.gperf */
/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
struct resword { char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 79
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 20
#define MIN_HASH_VALUE 10
#define MAX_HASH_VALUE 144
/* maximum key range = 135, duplicates = 0 */
#ifdef __GNUC__
inline
#endif
static unsigned int
hash (str, len)
register char *str;
register int unsigned len;
{
static unsigned char asso_values[] =
{
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 25, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 1, 145, 46, 8, 15,
61, 6, 36, 48, 3, 5, 145, 18, 63, 25,
29, 76, 1, 145, 13, 2, 1, 51, 37, 9,
9, 1, 3, 145, 145, 145, 145, 145,
};
register int hval = len;
switch (hval)
{
default:
case 3:
hval += asso_values[(unsigned int)str[2]];
case 2:
case 1:
hval += asso_values[(unsigned int)str[0]];
break;
}
return hval + asso_values[(unsigned int)str[len - 1]];
}
static struct resword wordlist[] =
{
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",},
{"int", tok_TYPESPEC, RID_INT},
{"",}, {"",},
{"__typeof__", tok_TYPEOF, NORID},
{"__signed__", tok_TYPESPEC, RID_SIGNED},
{"__imag__", tok_IMAGPART, NORID},
{"switch", tok_SWITCH, NORID},
{"__inline__", tok_SCSPEC, RID_INLINE},
{"else", tok_ELSE, NORID},
{"__iterator__", tok_SCSPEC, RID_ITERATOR},
{"__inline", tok_SCSPEC, RID_INLINE},
{"__extension__", tok_EXTENSION, NORID},
{"struct", tok_STRUCT, NORID},
{"__real__", tok_REALPART, NORID},
{"__const", tok_TYPE_QUAL, RID_CONST},
{"while", tok_WHILE, NORID},
{"__const__", tok_TYPE_QUAL, RID_CONST},
{"case", tok_CASE, NORID},
{"__complex__", tok_TYPESPEC, RID_COMPLEX},
{"__iterator", tok_SCSPEC, RID_ITERATOR},
{"bycopy", tok_TYPE_QUAL, RID_BYCOPY},
{"",}, {"",}, {"",},
{"__complex", tok_TYPESPEC, RID_COMPLEX},
{"",},
{"in", tok_TYPE_QUAL, RID_IN},
{"break", tok_BREAK, NORID},
{"@defs", tok_DEFS, NORID},
{"",}, {"",}, {"",},
{"extern", tok_SCSPEC, RID_EXTERN},
{"if", tok_IF, NORID},
{"typeof", tok_TYPEOF, NORID},
{"typedef", tok_SCSPEC, RID_TYPEDEF},
{"__typeof", tok_TYPEOF, NORID},
{"sizeof", tok_SIZEOF, NORID},
{"",},
{"return", tok_RETURN, NORID},
{"const", tok_TYPE_QUAL, RID_CONST},
{"__volatile__", tok_TYPE_QUAL, RID_VOLATILE},
{"@private", tok_PRIVATE, NORID},
{"@selector", tok_SELECTOR, NORID},
{"__volatile", tok_TYPE_QUAL, RID_VOLATILE},
{"__asm__", tok_ASM_KEYWORD, NORID},
{"",}, {"",},
{"continue", tok_CONTINUE, NORID},
{"__alignof__", tok_ALIGNOF, NORID},
{"__imag", tok_IMAGPART, NORID},
{"__attribute__", tok_ATTRIBUTE, NORID},
{"",}, {"",},
{"__attribute", tok_ATTRIBUTE, NORID},
{"for", tok_FOR, NORID},
{"",},
{"@encode", tok_ENCODE, NORID},
{"id", tok_OBJECTNAME, RID_ID},
{"static", tok_SCSPEC, RID_STATIC},
{"@interface", tok_INTERFACE, NORID},
{"",},
{"__signed", tok_TYPESPEC, RID_SIGNED},
{"",},
{"__label__", tok_LABEL, NORID},
{"",}, {"",},
{"__asm", tok_ASM_KEYWORD, NORID},
{"char", tok_TYPESPEC, RID_CHAR},
{"",},
{"inline", tok_SCSPEC, RID_INLINE},
{"out", tok_TYPE_QUAL, RID_OUT},
{"register", tok_SCSPEC, RID_REGISTER},
{"__real", tok_REALPART, NORID},
{"short", tok_TYPESPEC, RID_SHORT},
{"",},
{"enum", tok_ENUM, NORID},
{"inout", tok_TYPE_QUAL, RID_INOUT},
{"",},
{"oneway", tok_TYPE_QUAL, RID_ONEWAY},
{"union", tok_UNION, NORID},
{"",},
{"__alignof", tok_ALIGNOF, NORID},
{"",},
{"@implementation", tok_IMPLEMENTATION, NORID},
{"",},
{"@class", tok_CLASS, NORID},
{"",},
{"@public", tok_PUBLIC, NORID},
{"asm", tok_ASM_KEYWORD, NORID},
{"",}, {"",}, {"",}, {"",}, {"",},
{"default", tok_DEFAULT, NORID},
{"",},
{"void", tok_TYPESPEC, RID_VOID},
{"",},
{"@protected", tok_PROTECTED, NORID},
{"@protocol", tok_PROTOCOL, NORID},
{"",}, {"",}, {"",},
{"volatile", tok_TYPE_QUAL, RID_VOLATILE},
{"",}, {"",},
{"signed", tok_TYPESPEC, RID_SIGNED},
{"float", tok_TYPESPEC, RID_FLOAT},
{"@end", tok_END, NORID},
{"",}, {"",},
{"unsigned", tok_TYPESPEC, RID_UNSIGNED},
{"@compatibility_alias", tok_ALIAS, NORID},
{"double", tok_TYPESPEC, RID_DOUBLE},
{"",}, {"",},
{"auto", tok_SCSPEC, RID_AUTO},
{"",},
{"goto", tok_GOTO, NORID},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"do", tok_DO, NORID},
{"",}, {"",}, {"",}, {"",},
{"long", tok_TYPESPEC, RID_LONG},
};
#ifdef __GNUC__
inline
#endif
struct resword *
c_is_reserved_word (str, len)
register char *str;
register unsigned int len;
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register char *s = wordlist[key].name;
if (*s == *str && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
return 0;
}

View File

@ -0,0 +1,172 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : VBL |
| |
| File : c_parse.c |
| |
| Author : Jacomme Ludovic |
| |
| Date : 01.01.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include <unistd.h>
# include <sys/stat.h>
# include <errno.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include "c_tree.h"
# include "c_cdecl.h"
# include "c_clex.h"
# include "c_debug.h"
# include "c_flags.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern FILE *c_y_in;
extern int c_y_parse();
static char BuffTmpFile[ 64 ];
static int UnlinkTmpFile = 0;
void gcpexit( Code )
int Code;
{
if ( UnlinkTmpFile )
{
unlink( BuffTmpFile );
}
autexit( Code );
}
/*------------------------------------------------------------\
| |
| c_tree_parse_file |
| |
\------------------------------------------------------------*/
c_tree_node *c_tree_parse_file( InputFileName, Argc, Argv )
char *InputFileName;
int Argc;
char **Argv;
{
struct stat Stat;
char BuffExec[ 2048 ];
char *ScanArg;
int Index;
int Error;
if ( stat( InputFileName, &Stat ) )
{
fprintf( stdout, "Error unable to open file %s\n", InputFileName );
gcpexit( 1 );
}
sprintf( BuffTmpFile, "/tmp/gcp%d", getpid() );
ScanArg = BuffExec;
sprintf( ScanArg, "gcc -E %s ", InputFileName );
ScanArg += strlen( ScanArg );
for ( Index = 0; Index < Argc; Index++ )
{
strcpy( ScanArg, "'" );
ScanArg += 1;
strcpy( ScanArg, Argv[ Index ] );
ScanArg += strlen( ScanArg );
strcpy( ScanArg, "' " );
ScanArg += 2;
}
sprintf( ScanArg, "-o %s", BuffTmpFile );
UnlinkTmpFile = 1;
errno = 0;
Error = system( BuffExec );
if ( ( Error ) &&
( Error != -1 ) )
{
fprintf( stdout,
"An error occured while preprocessing %s, exit code %d (errno %d)\n",
InputFileName, Error, errno );
gcpexit( 2 );
}
c_y_in = fopen( BuffTmpFile, "r" );
if ( c_y_in == (FILE *)0 )
{
fprintf( stdout, "Error unable to open file %s\n", BuffTmpFile );
gcpexit( 3 );
}
c_parse_flags( Argc, Argv );
c_init_lex( InputFileName );
c_init_decl_processing();
Error = c_y_parse();
fclose( c_y_in );
unlink( BuffTmpFile );
UnlinkTmpFile = 0;
return( c_tree_program_node );
}

View File

@ -0,0 +1,52 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_cparse.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_CPARSE_H
# define C_CPARSE_H
extern void gcpexit __P(( int Code ));
# endif

View File

@ -0,0 +1,93 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_stmt.c |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
# include "c_flags.h"
# include "c_tree.h"
# include "c_treecompat.h"
# include "c_cdecl.h"
# include "c_convert.h"
# include "c_ctypeck.h"
# include "c_stmt.h"
# include "c_debug.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/* Filename and line number of last line-number note,
whether we actually emitted it or not. */
char *c_emit_filename;
int c_emit_lineno;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
void c_emit_line_note(file, line)
char *file;
int line;
{
c_emit_filename = file;
c_emit_lineno = line;
}

View File

@ -0,0 +1,81 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_stmt.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_STMT_H
# define C_STMT_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Macro |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern char *c_emit_filename;
extern int c_emit_lineno;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void c_emit_line_note __P((char *file, int line));
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_tree.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_TREE_H
# define C_TREE_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
# endif

View File

@ -0,0 +1,109 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
/*------------------------------------------------------------\
| |
| Tool : C |
| |
| File : c_treecompat.h |
| |
| Date : 09.07.99 |
| |
| Author : Jacomme Ludovic |
| |
\------------------------------------------------------------*/
# ifndef C_TREE_COMPAT_H
# define C_TREE_COMPAT_H
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# define C_NULL_TREE (c_tree_node *)0
# define TREE_TYPE(N) CTreeType(N)
# define TREE_CHAIN(N) CTreeChain(N)
# define TREE_INT_CST_LOW(N) CTreeIntCstLow(N)
# define TREE_INT_CST_HIGH(N) CTreeIntCstHigh(N)
# define TYPE_MIN_VALUE(N) CTreeTypeMinValue( N )
# define TYPE_MAX_VALUE(N) CTreeTypeMaxValue( N )
typedef union c_tree_node *tree;
# define NULL_TREE (tree)0
#define INT_CST_LT(A, B) \
(CTreeIntCstHigh(A) < CTreeIntCstHigh(B) \
|| ( CTreeIntCstHigh(A) == CTreeIntCstHigh(B) \
&& ((unsigned int) CTreeIntCstLow(A) \
< (unsigned int) CTreeIntCstLow(B))))
#define INT_CST_LT_UNSIGNED(A, B) \
(((unsigned int) CTreeIntCstHigh(A) \
< (unsigned int) CTreeIntCstHigh(B)) \
|| (((unsigned int) CTreeIntCstHigh(A) \
== (unsigned int ) CTreeIntCstHigh(B)) \
&& (((unsigned int) CTreeIntCstLow(A) \
< (unsigned int) CTreeIntCstLow(B)))))
# define INTEGRAL_TYPE_P(TYPE) \
( CTreeTypeCode(TYPE) == C_INTEGER_TYPE || \
CTreeTypeCode(TYPE) == C_ENUMERAL_TYPE || \
CTreeTypeCode(TYPE) == C_BOOLEAN_TYPE || \
CTreeTypeCode(TYPE) == C_CHAR_TYPE)
#define POINTER_TYPE_P(TYPE) \
(CTreeTypeCode(TYPE) == C_POINTER_TYPE || \
CTreeTypeCode(TYPE) == C_REFERENCE_TYPE)
# define REAL_VALUE_TYPE double
#define REAL_VALUE_NEGATE(N) (double)(-N)
#define REAL_VALUE_NEGATIVE(N) ((N) < 0.0)
#define REAL_VALUES_EQUAL(A,B) ((A) == (B))
#define REAL_VALUES_LESS(A,B) ((A) < (B))
#define FLOAT_TYPE_P(TYPE) \
( CTreeTypeCode(TYPE) == C_REAL_TYPE \
|| ( CTreeTypeCode(TYPE) == C_COMPLEX_TYPE \
&& CTreeTypeCode( CTreeType(TYPE)) == C_REAL_TYPE))
# define REAL_VALUES_IDENTICAL(A, B) (A == B)
# endif

1021
alliance/src/gcp/src/gcp.h Normal file

File diff suppressed because it is too large Load Diff

188
alliance/src/gcp/src/main.c Normal file
View File

@ -0,0 +1,188 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU Library General|
| Public License as published by the Free Software Foundation |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include <malloc.h>
# include "mut.h"
# include "aut.h"
# include "gcp.h"
/*------------------------------------------------------------\
| |
| Usage |
| |
\------------------------------------------------------------*/
void CUsage()
{
fprintf( stderr, "\t\tgcptest --[Options] Input_name_1 ... Input_name_N -[GCC Options]\n\n" );
fprintf( stdout, "\t\tOptions : --V Sets Verbose mode on\n" );
fprintf( stdout, "\t\t --D Sets Debug mode on\n" );
fprintf( stdout, "\t\t --F Sets Force display\n" );
fprintf( stdout, "\t\t --T Sets display Types\n" );
fprintf( stdout, "\t\t --S Sets display Sizes\n" );
fprintf( stdout, "\n" );
exit( 1 );
}
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern int c_y_debug;
int main( argc, argv )
int argc;
char **argv;
{
c_tree_node *TreeNode;
char *InputFileName[ 10 ];
int Last;
int Number;
int Index;
char Option;
char *Extention;
char **Argv;
int Argc;
int FlagVerbose = 0;
int FlagDebug = 0;
int NoMoreFileName = 0;
mbkenv();
autenv();
if ( argc < 2 ) CUsage();
InputFileName[ 0 ] = (char *)0;
Last = 0;
Argc = 0;
Argv = (char **)0;
for ( Number = 1; Number < argc; Number++ )
{
if ( argv[ Number ][ 0 ] == '-' )
{
if ( argv[ Number ][ 1 ] == '-' )
{
for ( Index = 2; argv[ Number ][ Index ] != '\0'; Index++ )
{
Option = argv[ Number ][ Index ];
if ( Option == 'I' )
{
Number++;
if ( Number < argc ) Extention = argv[ Number ];
else CUsage();
break;
}
switch ( Option )
{
case 'V' : FlagVerbose = 1;
break;
case 'D' : FlagDebug |= 1;
break;
case 'F' : FlagDebug |= 2;
break;
case 'T' : FlagDebug |= 4;
break;
case 'S' : FlagDebug |= 8;
break;
default : CUsage();
}
}
}
else
if ( ! NoMoreFileName )
{
NoMoreFileName = 1;
Argv = &argv[ Number ];
Argc = argc - Number;
}
}
else
if ( ! NoMoreFileName )
{
InputFileName[ Last ] = argv[ Number ];
Last++;
if ( Last >= 10 ) NoMoreFileName = 1;
else InputFileName[ Last ] = (char *)0;
}
else
CUsage();
}
if ( InputFileName[ 0 ] == (char *)0 ) CUsage();
if ( FlagDebug & 1 )
{
c_y_debug = 1;
}
if ( FlagDebug & 2 )
{
C_TREE_FORCE_VIEW_NODE = 1;
}
if ( FlagDebug & 4 )
{
C_TREE_VIEW_TYPE_NODE = 1;
}
if ( FlagDebug & 8 )
{
C_TREE_VIEW_SIZE_NODE = 1;
}
for ( Index = 0; Index < Last; Index++ )
{
if ( FlagVerbose )
{
fprintf( stdout, "--> Processing file %s\n", InputFileName[ Index ] );
}
TreeNode = c_tree_parse_file( InputFileName[ Index ], Argc, Argv );
if ( FlagVerbose )
{
fprintf( stdout, "<-- done\n\n" );
c_tree_view_node( TreeNode );
}
}
c_tree_free_all_node();
return( 0 );
}

View File

@ -0,0 +1 @@
SUBDIRS = src man1

View File

@ -0,0 +1,36 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/graal.c)
GRAAL_MAJOR_VERSION=1
GRAAL_MINOR_VERSION=27
GRAAL_VERSION=$GRAAL_MAJOR_VERSION.$GRAAL_MINOR_VERSION
AC_SUBST(GRAAL_MAJOR_VERSION)
AC_SUBST(GRAAL_MINOR_VERSION)
AC_SUBST(GRAAL_VERSION)
# For automake.
VERSION=$GRAAL_VERSION
PACKAGE=graal
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
dnl Checks for programs.
AC_PROG_CC
AM_PROG_LEX
AC_PROG_YACC
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_FIND_MOTIF
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AM_ALLIANCE
AC_OUTPUT([
Makefile
src/Makefile
man1/Makefile
])

View File

@ -0,0 +1,348 @@
# /*------------------------------------------------------------\
# | |
# | Title : Parameters File for Graal |
# | |
# | Technology : Cmos V7 |
# | |
# | Date : 27/06/95 |
# | |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Graal Peek Bound in lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_PEEK_BOUND 7
# /*------------------------------------------------------------\
# | |
# | Lower Grid Step in pixel by lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_LOWER_GRID_STEP 10
# /*------------------------------------------------------------\
# | |
# | Lower Figure Text Step in pixel by lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_LOWER_FIGURE_STEP 1
# /*------------------------------------------------------------\
# | |
# | Lower Instance Text Step in pixel by lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_LOWER_INSTANCE_STEP 1
# /*------------------------------------------------------------\
# | |
# | Lower Connector Text Step in pixel by lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_LOWER_CONNECTOR_STEP 5
# /*------------------------------------------------------------\
# | |
# | Lower Segment Text Step in pixel by lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_LOWER_SEGMENT_STEP 7
# /*------------------------------------------------------------\
# | |
# | Lower Reference Text Step in pixel by lambda |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_LOWER_REFERENCE_STEP 10
# /*------------------------------------------------------------\
# | |
# | Graal Cursor Color Name |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_CURSOR_COLOR_NAME Gray
# /*------------------------------------------------------------\
# | |
# | Graal Cursor Size in pixel |
# | |
# \------------------------------------------------------------*/
DEFINE GRAAL_CURSOR_SIZE 10
# /*------------------------------------------------------------\
# | |
# | Segment Panel Button Label, Foreground , Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_SEGMENT_NAME
NWELL Nwell tan Black
PWELL Pwell light_yellow Black
NDIF Ndif lawn_green Black
PDIF Pdif yellow Black
NTIE Ntie spring_green Black
PTIE Ptie light_goldenrod Black
POLY Poly red Black
POLY2 Poly2 orange Black
ALU1 Alu1 royal_blue Black
ALU2 Alu2 Cyan Black
ALU3 Alu3 light_pink Black
ALU4 Alu4 green Black
ALU5 Alu5 yellow Black
ALU6 Alu6 violet Black
TPOLY Tpoly hot_pink Black
TALU1 Talu1 royal_blue Black
TALU2 Talu2 turquoise Black
TALU3 Talu3 light_pink Black
TALU4 Talu4 green Black
TALU5 Talu5 yellow Black
TALU6 Talu6 violet Black
CALU1 CAlu1 royal_blue Black
CALU2 CAlu2 Cyan Black
CALU3 CAlu3 light_pink Black
CALU4 CAlu4 green Black
CALU5 CAlu5 yellow Black
CALU6 CAlu6 violet Black
END
# /*------------------------------------------------------------\
# | |
# | Transistor Panel Button Label, Foreground, Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_TRANSISTOR_NAME
NTRANS Ntrans lawn_green Black
PTRANS Ptrans yellow Black
END
# /*------------------------------------------------------------\
# | |
# | Connector Panel Button Label, Foreground , Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_CONNECTOR_NAME
POLY Poly red Black
POLY2 Poly2 orange Black
ALU1 Alu1 royal_blue Black
ALU2 Alu2 Cyan Black
ALU3 Alu3 light_pink Black
ALU4 Alu4 green Black
ALU5 Alu5 yellow Black
ALU6 Alu6 violet Black
END
# /*------------------------------------------------------------\
# | |
# | Minimun Length and Width for a symbolic Segment |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_SEGMENT_VALUE
NWELL 4 4
PWELL 4 4
NDIF 2 2
PDIF 2 2
NTIE 2 2
PTIE 2 2
NTRANS 1 4
PTRANS 1 4
POLY 1 1
POLY2 1 1
ALU1 1 1
ALU2 2 1
ALU3 2 1
ALU4 2 1
ALU5 2 1
ALU6 2 1
TPOLY 1 1
TALU1 1 1
TALU2 2 2
TALU3 2 2
TALU4 2 2
TALU5 2 2
TALU6 2 2
CALU1 2 0
CALU2 2 0
CALU3 2 0
CALU4 2 0
CALU5 2 0
CALU6 2 0
END
# /*------------------------------------------------------------\
# | |
# | Reference Panel Button Label, Foreground, Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_REFERENCE_NAME
REF_REF Ref_Ref red Black
REF_CON Ref_Con Cyan Black
END
# /*------------------------------------------------------------\
# | |
# | Via Panel Button Label, Foreground , Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_VIA_NAME
CONT_DIF_N Cont_NDif lawn_green Black
CONT_DIF_P Cont_PDif yellow Black
CONT_BODY_N Cont_NTie spring_green Black
CONT_BODY_P Cont_PTie light_goldenrod Black
CONT_POLY Cont_Poly red Black
CONT_POLY2 Cont_Poly2 orange Black
CONT_VIA Via_1-2 cyan Black
CONT_VIA2 Via_2-3 light_pink Black
CONT_VIA3 Via_3-4 green Black
CONT_VIA4 Via_4-5 yellow Black
CONT_VIA5 Via_5-6 violet Black
C_X_N Cont_CxN orange Black
C_X_P Cont_CxP orange Black
END
# /*------------------------------------------------------------\
# | |
# | Big Via Panel Button Label, Foreground , Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_BIGVIA_NAME
CONT_VIA Big_Via_1-2 cyan Black
CONT_VIA2 Big_Via_2-3 light_pink Black
CONT_VIA3 Big_Via_3-4 green Black
CONT_TURN1 Turn_Via_1 royal_blue Black
CONT_TURN2 Turn_Via_2 Cyan Black
CONT_TURN3 Turn_Via_3 light_pink Black
CONT_TURN4 Turn_Via_4 green Black
END
# /*------------------------------------------------------------\
# | |
# | Minimun Size for a symbolic Big Via |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_BIGVIA_VALUE
CONT_VIA 2
CONT_VIA2 2
CONT_VIA3 2
CONT_TURN1 2
CONT_TURN2 2
CONT_TURN3 2
CONT_TURN4 2
END
# /*------------------------------------------------------------\
# | |
# | Orient Panel Button Label, Foreground , Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_ORIENT_NAME
NORTH North lawn_green Black
SOUTH South yellow Black
EAST East tan Black
WEST West red Black
END
# /*------------------------------------------------------------\
# | |
# | Symmetry Panel Button Label, Foreground , Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_SYMMETRY_NAME
NOSYM No_Sym LightBlue Black
SYM_X Sym_X turquoise Black
SYM_Y Sym_Y cyan Black
SYMXY Sym_XY LightCyan Black
ROT_P Rot_P MediumAquamarine Black
ROT_M Rot_M aquamarine Black
SY_RP Sym_RP green Black
SY_RM Sym_RM MediumSpringGreen Black
END
# /*------------------------------------------------------------\
# | |
# | View Layer Panel Button Label, Foreground, Background Color |
# | |
# \------------------------------------------------------------*/
TABLE GRAAL_RDS_LAYER_NAME
RDS_NWELL Nwell tan Black
RDS_PWELL Pwell light_yellow Black
RDS_NIMP Nimp forest_green Black
RDS_PIMP Pimp goldenrod Black
RDS_ACTIV Activ brown Black
RDS_NDIF Ndif lawn_green Black
RDS_PDIF Pdif yellow Black
RDS_NTIE Ntie spring_green Black
RDS_PTIE Ptie light_goldenrod Black
RDS_POLY Poly red Black
RDS_POLY2 Poly2 orange Black
RDS_VPOLY VPoly coral Black
RDS_GATE Gate orange Black
RDS_TPOLY Tpoly hot_pink Black
RDS_CONT Cont dark_violet Black
RDS_TCONT TCont orchid Black
RDS_ALU1 Alu1 royal_blue Black
RDS_VALU1 VAlu1 sky_blue Black
RDS_TALU1 Talu1 royal_blue Black
RDS_VIA1 Via1 deep_sky_blue Black
RDS_TVIA1 TVia1 dodger_blue Black
RDS_ALU2 Alu2 cyan Black
RDS_TALU2 Talu2 turquoise Black
RDS_VIA2 Via2 deep_pink Black
RDS_ALU3 Alu3 light_pink Black
RDS_TALU3 Talu3 light_pink Black
RDS_VIA3 Via3 sea_green Black
RDS_ALU4 Alu4 green Black
RDS_TALU4 Talu4 green Black
RDS_VIA4 Via4 gold Black
RDS_ALU5 Alu5 yellow Black
RDS_TALU5 Talu5 yellow Black
RDS_VIA5 Via5 violet_red Black
RDS_ALU6 Alu6 violet Black
RDS_TALU6 Talu6 violet Black
RDS_CPAS Cpas gray Black
RDS_REF Ref coral Black
RDS_ABOX Abox pink Black
END

View File

@ -0,0 +1,2 @@
man_MANS = graal.1
EXTRA_DIST = $(man_MANS)

View File

@ -0,0 +1,153 @@
.\" $Id: graal.1,v 1.1 2002/03/29 17:39:57 ludo Exp $
.\" @(#)graal 1.07 94/10/10 UPMC/ASIM/LIP6/CAO-VLSI "
.TH GRAAL 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE Reference Manual"
.SH NAME
graal \- symbolic layout editor
.SH SYNOPSIS
.B graal
[\-l file_name]
[\-scale n]
[\-debug]
[\-xor]
[\-install]
[\-force]
.br
.so man1/alc_origin.1
.SH DESCRIPTION
.B Graal
is a hierarchical symbolic layout editor. All functionnalities can be
accessed through different menus.
Among them exists a design rule checker performing verifications inside a
user defined window.
.B Graal
works under Motif and X11r6.
When entering
.B Graal,
the main window appears and shows 7 different
menus on the top bar.These menus can be entered by simply clicking on the
mouse left button. Here is the description of these menus.
.TP 10
.B File
\f4New\fP : clean the entire window and save the current cell.
.br
\f4Open\fP : load an already existing cell.
.br
\f4Save\fP : save the current cell.
.br
\f4Save as\fP : rename and save the current cell.
.br
\f4Quit\fP : quit graal.
.TP 10
.B Edit
\f4Undo\fP : undo the previous action.
.br
\f4Copy\fP : copy a selected object.
.br
\f4Move\fP : move a selected object.
.br
\f4Delete\fP : delete a selected object.
.br
\f4Stretch\fP : strech a selected object (transistor or segment length).
.br
\f4Modify\fP : modify the caracteristics of an object (name, width,
etc...).
.br
\f4Identify\fP : identify a selected object.
.br
\f4Search\fP : search an object according to its type.
.TP 10
.B Window
This menu allows user to perform the same actions than the previous menu
Edit, not on an object but on a group of objects belonging to a defined
window.The two opposite corner of the window are set by clicking on the mouse
left button.
.TP 10
.B Create
\f4Instance\fP : add a new instance in the current cell.
.br
\f4Abutmentbox\fP : define the abutment box of the current cell.
.br
\f4Segment\fP : add segments.
.br
\f4Via\fP : add vias or contacts.
.br
\f4Connector\fP : add connectors.
.br
\f4Transistor\fP : add transistors.
.br
\f4Reference\fP : add references.
.TP 10
.B View
\f4Zoom\fP : perform zoom in, zoom out, center, fit, refresh on figure.
.br
\f4Layer\fP : select types of layers displayed.
.br
\f4Map\fP : show cursor position in the entire figure.
.br
\f4Arrows\fP : show arrows for moving at the grid step.
.br
\f4Grid\fP : Set the X,Y step of the grid if displayed.
.TP 10
.B Tools
\f4Equi\fP : highlight all objects electrically connected to a given object.
.br
\f4Flat\fP : virtual hierarchy flattening of an instance
(display all visible objects inside a given instance).
.br
\f4UnFlat\fP : undo the virtual flattening of an instance
(done before with the Flat command)
.br
\f4Peek\fP : virtual hierarchy flattening
(display all visible objects inside a given window).
.br
\f4UnPeek\fP : undo the virtual flattening of a window
(done before with the Peek command)
.br
\f4Druc\fP : call the design rule checker in a given window.
.br
\f4RealFlat\fP : real hierarchy flattening of instances included in a window
(this command can not be undone, and should be used very carefully)
.br
\f4Hierarchy\fP : navigate into the current figure hierarchy
.br
\f4Load Error\fP : load a real layout file and superpose it to the current figure.
.br
\f4Message\fP : display the last error messages
.TP 10
.B Setup
Save or load a user defined configuration of default displayed menus.
.SH ENVIRONMENT VARIABLES
.TP
.B MBK_CATA_LIB
indicates the path to the read only libraries to be used.
.TP
.B MBK_WORK_LIB
indicates the path to the read/write directory for the session.
.TP
.B MBK_IN_PH
indicates the file format to be used for the leaf cells.
.TP
.B MBK_OUT_PH
indicates the file format to be used for the generated figures.
.TP
.B GRAAL_TECHNO_NAME (optionnal)
indicates the path to the techno name file used by Graal.
.TP
.B RDS_TECHNO_NAME (optionnal)
indicates the path to the RDS configuration file used by Graal.
.SH SEE ALSO
mbk(1), MBK_CATA_LIB(1), MBK_IN_PH(1), MBK_OUT_PH(1), RDS_TECHNO_NAME(1)
.so man1/alc_bug_report.1

196
alliance/src/graal/motif.m4 Normal file
View File

@ -0,0 +1,196 @@
dnl
dnl
dnl AC_FIND_MOTIF : find OSF/Motif or LessTif, and provide variables
dnl to easily use them in a Makefile.
dnl
dnl Adapted from a macro by Andreas Zeller.
dnl
dnl The variables provided are :
dnl LINK_MOTIF (e.g. -L/usr/lesstif/lib -lXm)
dnl INCLUDE_MOTIF (e.g. -I/usr/lesstif/lib)
dnl MOTIF_LIBRARIES (e.g. /usr/lesstif/lib)
dnl MOTIF_INCLUDES (e.g. /usr/lesstif/include)
dnl
dnl The LINK_MOTIF and INCLUDE_MOTIF variables should be fit to put on
dnl your application's link line in your Makefile.
dnl
dnl Oleo CVS $Id: motif.m4,v 1.1 2002/03/29 17:39:54 ludo Exp $
dnl
AC_DEFUN(AC_FIND_MOTIF,
[
AC_REQUIRE([AC_PATH_XTRA])
MOTIF_INCLUDES=
MOTIF_LIBRARIES=
dnl AC_ARG_WITH(motif,
dnl [ --without-motif do not use Motif widgets])
dnl Treat --without-motif like
dnl --without-motif-includes --without-motif-libraries.
dnl if test "$with_motif" = "no"
dnl then
dnl MOTIF_INCLUDES=none
dnl MOTIF_LIBRARIES=none
dnl fi
AC_ARG_WITH(motif-includes,
[ --with-motif-includes=DIR Motif include files are in DIR],
MOTIF_INCLUDES="$withval")
AC_ARG_WITH(motif-libraries,
[ --with-motif-libraries=DIR Motif libraries are in DIR],
MOTIF_LIBRARIES="$withval")
AC_MSG_CHECKING(for Motif)
#
#
# Search the include files.
#
if test "$MOTIF_INCLUDES" = ""; then
AC_CACHE_VAL(ac_cv_motif_includes,
[
ac_motif_save_LIBS="$LIBS"
ac_motif_save_CFLAGS="$CFLAGS"
ac_motif_save_CPPFLAGS="$CPPFLAGS"
ac_motif_save_LDFLAGS="$LDFLAGS"
#
LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS"
CFLAGS="$X_CFLAGS $CFLAGS"
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
LDFLAGS="$X_LIBS $LDFLAGS"
#
ac_cv_motif_includes="none"
AC_TRY_COMPILE([#include <Xm/Xm.h>],[int a;],
[
# Xm/Xm.h is in the standard search path.
ac_cv_motif_includes=
],
[
# Xm/Xm.h is not in the standard search path.
# Locate it and put its directory in `MOTIF_INCLUDES'
#
# /usr/include/Motif* are used on HP-UX (Motif).
# /usr/include/X11* are used on HP-UX (X and Athena).
# /usr/dt is used on Solaris (Motif).
# /usr/openwin is used on Solaris (X and Athena).
# Other directories are just guesses.
for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \
/usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \
/usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \
/usr/dt/include /usr/openwin/include \
/usr/dt/*/include /opt/*/include /usr/include/Motif* \
"${prefix}"/*/include /usr/*/include /usr/local/*/include \
"${prefix}"/include/* /usr/include/* /usr/local/include/*; do
if test -f "$dir/Xm/Xm.h"; then
ac_cv_motif_includes="$dir"
break
fi
done
])
#
LIBS="$ac_motif_save_LIBS"
CFLAGS="$ac_motif_save_CFLAGS"
CPPFLAGS="$ac_motif_save_CPPFLAGS"
LDFLAGS="$ac_motif_save_LDFLAGS"
])
MOTIF_INCLUDES="$ac_cv_motif_includes"
fi
#
#
# Now for the libraries.
#
if test "$MOTIF_LIBRARIES" = ""; then
AC_CACHE_VAL(ac_cv_motif_libraries,
[
ac_motif_save_LIBS="$LIBS"
ac_motif_save_CFLAGS="$CFLAGS"
ac_motif_save_CPPFLAGS="$CPPFLAGS"
ac_motif_save_LDFLAGS="$LDFLAGS"
#
LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS"
CFLAGS="$X_CFLAGS $CFLAGS"
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
LDFLAGS="$X_LIBS $LDFLAGS"
#
ac_cv_motif_libraries="none"
AC_TRY_LINK([#include <Xm/Xm.h>],[XtToolkitInitialize();],
[
# libXm.a is in the standard search path.
ac_cv_motif_libraries=
],
[
# libXm.a is not in the standard search path.
# Locate it and put its directory in `MOTIF_LIBRARIES'
#
# /usr/lib/Motif* are used on HP-UX (Motif).
# /usr/lib/X11* are used on HP-UX (X and Athena).
# /usr/dt is used on Solaris (Motif).
# /usr/lesstif is used on Linux (Lesstif).
# /usr/openwin is used on Solaris (X and Athena).
# Other directories are just guesses.
for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \
/usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \
/usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \
/usr/dt/lib /usr/openwin/lib \
/usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \
/usr/lesstif*/lib /usr/lib/Lesstif* \
"${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \
"${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do
if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then
ac_cv_motif_libraries="$dir"
break
fi
done
])
#
LIBS="$ac_motif_save_LIBS"
CFLAGS="$ac_motif_save_CFLAGS"
CPPFLAGS="$ac_motif_save_CPPFLAGS"
LDFLAGS="$ac_motif_save_LDFLAGS"
])
#
MOTIF_LIBRARIES="$ac_cv_motif_libraries"
fi
#
# Provide an easier way to link
#
if test "$MOTIF_INCLUDES" = "none" -o "$MOTIF_LIBRARIES" = "none"; then
with_motif="no"
else
with_motif="yes"
fi
if test "$with_motif" != "no"; then
if test "$MOTIF_LIBRARIES" = ""; then
LINK_MOTIF="-lXm"
MOTIF_LIBS="-lXm"
else
LINK_MOTIF="-L$MOTIF_LIBRARIES -lXm"
MOTIF_LIBS="-L$MOTIF_LIBRARIES -lXm"
fi
if test "$MOTIF_INCLUDES" != ""; then
INCLUDE_MOTIF="-I$MOTIF_INCLUDES"
MOTIF_CFLAGS="-I$MOTIF_INCLUDES"
fi
AC_DEFINE(HAVE_MOTIF)
else
with_motif="no"
fi
#
AC_SUBST(LINK_MOTIF)
AC_SUBST(INCLUDE_MOTIF)
#
#
#
motif_libraries_result="$MOTIF_LIBRARIES"
motif_includes_result="$MOTIF_INCLUDES"
test "$motif_libraries_result" = "" && motif_libraries_result="in default path"
test "$motif_includes_result" = "" && motif_includes_result="in default path"
test "$motif_libraries_result" = "none" && motif_libraries_result="(none)"
test "$motif_includes_result" = "none" && motif_includes_result="(none)"
AC_MSG_RESULT(
[libraries $motif_libraries_result, headers $motif_includes_result])
])dnl

View File

@ -0,0 +1,102 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Create.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_GMC
# define GRAAL_GMC
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern GraalMenuItem GraalCreateMenu[];
extern GraalPanelItem GraalCreateSegmentPanel;
extern GraalPanelItem GraalCreateViaPanel;
extern GraalPanelItem GraalCreateBigViaPanel;
extern GraalPanelItem GraalCreateTransistorPanel;
extern GraalPanelItem GraalCreateConnectorPanel;
extern GraalPanelItem GraalCreateReferencePanel;
extern GraalPanelItem GraalCreateInstancePanel;
extern int GraalCreateSegmentDefaultValues[ 5 ];
extern int GraalCreateViaDefaultValues[ 5 ];
extern int GraalCreateBigViaDefaultValues[ 5 ];
extern int GraalCreateTransistorDefaultValues[ 5 ];
extern int GraalCreateConnectorDefaultValues[ 5 ];
extern int GraalCreateReferenceDefaultValues[ 5 ];
extern int GraalCreateInstanceDefaultValues[ 5 ];
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void GraalBuildPanelCreate();
extern void GraalBuildCreateDialog();
extern void GraalCreateSegmentMbk();
extern void GraalCreateViaMbk();
extern void GraalCreateBigViaMbk();
extern void GraalCreateTransistorMbk();
extern void GraalCreateConnectorMbk();
extern void GraalCreateReferenceMbk();
extern void GraalCreateInstanceMbk();
extern void GraalCreateAbutmentBoxMbk();
extern void GraalChangeSegmentLayer();
extern void GraalChangeViaType();
extern void GraalChangeBigViaType();
extern void GraalChangeTransistorType();
extern void GraalChangeConnectorLayer();
extern void GraalChangeReferenceType();
# endif

View File

@ -0,0 +1,891 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Create.c |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include <Xm/Xm.h>
# include <Xm/PushBG.h>
# include <Xm/CascadeBG.h>
# include "mut.h"
# include "mph.h"
# include "rds.h"
# include "rpr.h"
# include "rfm.h"
# include "GRM.h"
# include "GMX.h"
# include "GTB.h"
# include "GSB.h"
# include "GMC.h"
# include "GMC_create.h"
# include "GMC_dialog.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Segment & Wire |
| |
\------------------------------------------------------------*/
char GraalSegmentLayer = ALU1;
long GraalSegmentWidth = -1;
char *GraalSegmentName = (char *)NULL;
char GraalSegmentWire = GRAAL_FALSE;
/*------------------------------------------------------------\
| |
| Via |
| |
\------------------------------------------------------------*/
char GraalViaType = CONT_POLY;
char *GraalViaName = (char *)NULL;
/*------------------------------------------------------------\
| |
| Big Via |
| |
\------------------------------------------------------------*/
char GraalBigViaType = CONT_VIA;
char *GraalBigViaName = (char *)NULL;
/*------------------------------------------------------------\
| |
| Transistor |
| |
\------------------------------------------------------------*/
char GraalTransistorType = NTRANS;
long GraalTransistorWidth = -1;
char *GraalTransistorName = (char *)NULL;
char GraalTransistorWire = GRAAL_FALSE;
/*------------------------------------------------------------\
| |
| Connector |
| |
\------------------------------------------------------------*/
char GraalConnectorLayer = ALU1;
long GraalConnectorWidth = -1;
char *GraalConnectorName = (char *)NULL;
char GraalConnectorOrient = GRAAL_NORTH;
/*------------------------------------------------------------\
| |
| Reference |
| |
\------------------------------------------------------------*/
char GraalReferenceType = MBK_REF_REF;
char *GraalReferenceName = (char *)NULL;
/*------------------------------------------------------------\
| |
| Instance |
| |
\------------------------------------------------------------*/
char GraalInstanceSym = NOSYM;
char *GraalInstanceName = (char *)NULL;
char *GraalInstanceModel = (char *)NULL;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| GraalCreateFigureMbk |
| |
\------------------------------------------------------------*/
void GraalCreateFigureMbk()
{
if ( GraalFigureMbk == (phfig_list *)NULL )
{
rdsbegin();
GraalFigureMbk = addphfig( GRAAL_DEFAULT_FIGURE_NAME );
GraalAddFigure();
GraalChangeTopLevelTitle( GraalFigureMbk->NAME );
rdsend();
}
}
/*------------------------------------------------------------\
| |
| GraalCreateSegmentMbk |
| |
\------------------------------------------------------------*/
void GraalCreateSegmentMbk( LambdaX1, LambdaY1, LambdaX2, LambdaY2 )
long LambdaX1;
long LambdaY1;
long LambdaX2;
long LambdaY2;
{
rdsrec_list *Rectangle;
phseg_list *Segment;
char *SaveName;
char *SegmentName;
long Delta;
int Error;
rdsbegin();
if ( LambdaX1 == LambdaX2 )
{
Delta = LambdaY2 - LambdaY1;
}
else
{
Delta = LambdaX2 - LambdaX1;
}
if ( Delta < 0 ) Delta = - Delta;
if ( Delta < GRAAL_SEGMENT_VALUE_TABLE[GraalSegmentLayer][1] )
{
GraalErrorMessage( GraalMainWindow, "This segment is too small !" );
rdsend();
return;
}
if ( ( GraalSegmentLayer >= CALU1 ) &&
( GraalSegmentLayer <= CALU9 ) )
{
SaveName = GraalSegmentName;
GraalEnterDialog( &GraalChangeSegmentNameDialog );
if ( GraalCreateDialogCancel )
{
rdsend();
return;
}
SegmentName = GraalSegmentName;
GraalSegmentName = SaveName;
if ( SegmentName == (char *)NULL )
{
GraalErrorMessage( GraalMainWindow, "Connector must have name !" );
rdsend();
return;
}
}
else
{
SegmentName = GraalSegmentName;
}
GraalCreateFigureMbk();
Segment =
addphseg( GraalFigureMbk, GraalSegmentLayer,
GraalSegmentWidth * SCALE_X,
LambdaX1 * GRAAL_SCALE_X, LambdaY1 * GRAAL_SCALE_X,
LambdaX2 * GRAAL_SCALE_X, LambdaY2 * GRAAL_SCALE_X,
SegmentName );
Segment->USER = (void *)(&GraalFigureMbk->PHSEG);
if ( Segment->NEXT != (phseg_list *)NULL )
{
Segment->NEXT->USER = (void *)(&Segment->NEXT);
}
Rectangle = GraalAddSegment( Segment );
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
}
else
{
delphseg( GraalFigureMbk, Segment );
GraalErrorMessage( GraalMainWindow, "Can't create any segment of this layer !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| GraalCreateViaMbk |
| |
\------------------------------------------------------------*/
void GraalCreateViaMbk( LambdaX1, LambdaY1 )
long LambdaX1;
long LambdaY1;
{
rdsrec_list *Rectangle;
phvia_list *Via;
rdsbegin();
GraalCreateFigureMbk();
Via = addphvia( GraalFigureMbk, GraalViaType,
LambdaX1 * GRAAL_SCALE_X, LambdaY1 * GRAAL_SCALE_X, 0, 0, GraalViaName );
Via->USER = (void *)(&GraalFigureMbk->PHVIA);
if ( Via->NEXT != (phvia_list *)NULL )
{
Via->NEXT->USER = (void *)(&Via->NEXT);
}
Rectangle = GraalAddVia( Via );
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
}
else
{
delphvia( GraalFigureMbk, Via );
GraalErrorMessage( GraalMainWindow, "Can't create any via of this type !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| GraalCreateBigViaMbk |
| |
\------------------------------------------------------------*/
void GraalCreateBigViaMbk( LambdaX1, LambdaY1, LambdaX2, LambdaY2 )
long LambdaX1;
long LambdaY1;
{
rdsrec_list *Rectangle;
phvia_list *Via;
long Swap;
long ViaDx;
long ViaDy;
rdsbegin();
if ( ( LambdaX1 != LambdaX2 ) &&
( LambdaY1 != LambdaY2 ) )
{
if ( LambdaX1 > LambdaX2 )
{
Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap;
}
if ( LambdaY1 > LambdaY2 )
{
Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap;
}
ViaDx = LambdaX2 - LambdaX1;
ViaDy = LambdaY2 - LambdaY1;
if ( ( ViaDx < GRAAL_BIGVIA_VALUE_TABLE[ GraalBigViaType ][0] ) ||
( ViaDy < GRAAL_BIGVIA_VALUE_TABLE[ GraalBigViaType ][0] ) )
{
GraalErrorMessage( GraalMainWindow, "This big via is too small !" );
rdsend();
return;
}
}
else
{
GraalErrorMessage( GraalMainWindow, "The big via must be rectangular !" );
rdsend();
return;
}
GraalCreateFigureMbk();
Via = addphvia( GraalFigureMbk, GraalBigViaType,
(( LambdaX1 + LambdaX2 ) >> 1) * GRAAL_SCALE_X,
(( LambdaY1 + LambdaY2 ) >> 1) * GRAAL_SCALE_X,
ViaDx * GRAAL_SCALE_X, ViaDy * GRAAL_SCALE_X, GraalBigViaName );
Via->USER = (void *)(&GraalFigureMbk->PHVIA);
if ( Via->NEXT != (phvia_list *)NULL )
{
Via->NEXT->USER = (void *)(&Via->NEXT);
}
Rectangle = GraalAddVia( Via );
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
}
else
{
delphvia( GraalFigureMbk, Via );
GraalErrorMessage( GraalMainWindow, "Can't create any big via of this type !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| GraalCreateTransistorMbk |
| |
\------------------------------------------------------------*/
void GraalCreateTransistorMbk( LambdaX1, LambdaY1, LambdaX2, LambdaY2 )
long LambdaX1;
long LambdaY1;
long LambdaX2;
long LambdaY2;
{
rdsrec_list *Rectangle;
phseg_list *Transistor;
long Delta;
rdsbegin();
if ( LambdaX1 == LambdaX2 )
{
Delta = LambdaY2 - LambdaY1;
}
else
{
Delta = LambdaX2 - LambdaX1;
}
if ( Delta < 0 ) Delta = - Delta;
if ( Delta < GRAAL_SEGMENT_VALUE_TABLE[GraalTransistorType][1] )
{
GraalErrorMessage( GraalMainWindow, "This transistor is too small !" );
rdsend();
return;
}
GraalCreateFigureMbk();
Transistor =
addphseg( GraalFigureMbk, GraalTransistorType,
GraalTransistorWidth * SCALE_X,
LambdaX1 * GRAAL_SCALE_X, LambdaY1 * GRAAL_SCALE_X,
LambdaX2 * GRAAL_SCALE_X, LambdaY2 * GRAAL_SCALE_X,
GraalTransistorName );
Transistor->USER = (void *)(&GraalFigureMbk->PHSEG);
if ( Transistor->NEXT != (phseg_list *)NULL )
{
Transistor->NEXT->USER = (void *)(&Transistor->NEXT);
}
Rectangle = GraalAddSegment( Transistor );
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
}
else
{
delphseg( GraalFigureMbk, Transistor );
GraalErrorMessage( GraalMainWindow, "Can't create any transistor of this type !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| GraalCreateConnectorMbk |
| |
\------------------------------------------------------------*/
void GraalCreateConnectorMbk( LambdaX1, LambdaY1 )
long LambdaX1;
long LambdaY1;
{
rdsrec_list *Rectangle;
phcon_list *Connector;
char Orient;
char MbkOrient;
rdsbegin();
LambdaX1 = LambdaX1 * GRAAL_SCALE_X;
LambdaY1 = LambdaY1 * GRAAL_SCALE_X;
switch ( GraalConnectorOrient )
{
case GRAAL_NORTH : MbkOrient = NORTH;
break;
case GRAAL_SOUTH : MbkOrient = SOUTH;
break;
case GRAAL_EAST : MbkOrient = EAST;
break;
default : MbkOrient = WEST;
}
GraalEnterDialog( &GraalChangeConnectorNameDialog );
if ( GraalCreateDialogCancel )
{
rdsend();
return;
}
if ( GraalConnectorName != (char *)NULL )
{
GraalCreateFigureMbk();
Connector =
addphcon( GraalFigureMbk, MbkOrient,
GraalConnectorName,
LambdaX1, LambdaY1,
GraalConnectorLayer,
GraalConnectorWidth * SCALE_X );
Connector->USER = (void *)(&GraalFigureMbk->PHCON);
if ( Connector->NEXT != (phcon_list *)NULL )
{
Connector->NEXT->USER = (void *)(&Connector->NEXT);
}
Rectangle = GraalAddConnector( Connector );
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
}
else
{
delphcon( GraalFigureMbk, Connector );
GraalErrorMessage( GraalMainWindow, "Can't create any connector of this layer !" );
}
}
else
{
GraalErrorMessage( GraalMainWindow, "Connector must have name !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| GraalCreateReferenceMbk |
| |
\------------------------------------------------------------*/
void GraalCreateReferenceMbk( LambdaX1, LambdaY1 )
long LambdaX1;
long LambdaY1;
{
rdsrec_list *Rectangle;
phref_list *Reference;
rdsbegin();
GraalEnterDialog( &GraalChangeReferenceNameDialog );
if ( GraalCreateDialogCancel )
{
rdsend();
return;
}
if ( GraalReferenceName != (char *)NULL )
{
GraalCreateFigureMbk();
Reference =
addphref( GraalFigureMbk,
(GraalReferenceType == MBK_REF_REF) ? "ref_ref":"ref_con" ,
GraalReferenceName,
LambdaX1 * GRAAL_SCALE_X, LambdaY1 * GRAAL_SCALE_X );
Reference->USER = (void *)(&GraalFigureMbk->PHREF);
if ( Reference->NEXT != (phref_list *)NULL )
{
Reference->NEXT->USER = (void *)(&Reference->NEXT);
}
Rectangle = GraalAddReference( Reference );
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
}
else
{
delphref( GraalFigureMbk, Reference );
GraalErrorMessage( GraalMainWindow, "Can't create any reference of this type !" );
}
}
else
{
GraalErrorMessage( GraalMainWindow, "Reference must have name !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| GraalCreateInstanceMbk |
| |
\------------------------------------------------------------*/
void GraalCreateInstanceMbk( LambdaX1, LambdaY1 )
long LambdaX1;
long LambdaY1;
{
rdsrec_list *Rectangle;
phins_list *InstanceMbk;
phins_list *SaveInstance;
rdsins_list *InstanceRds;
rdsbegin();
GraalEnterChangeInstanceModelDialog();
if ( GraalCreateDialogCancel )
{
rdsend();
return;
}
if ( GraalInstanceModel != (char *)NULL )
{
GraalEnterDialog( &GraalChangeInstanceNameDialog );
if ( GraalCreateDialogCancel )
{
rdsend();
return;
}
if ( GraalInstanceName != (char *)NULL )
{
GraalCreateFigureMbk();
if ( GraalFigureMbk->NAME == GraalInstanceModel )
{
GraalErrorMessage( GraalMainWindow,
"A figure cannot be part of itself !" );
rdsend();
return;
}
for ( InstanceRds = GraalFigureRds->INSTANCE;
InstanceRds != (rdsins_list *)NULL;
InstanceRds = InstanceRds->NEXT )
{
if ( InstanceRds->INSNAME == GraalInstanceName )
{
if ( ! IsGraalDeleted( InstanceRds->LAYERTAB[ RDS_ABOX ] ) )
{
GraalErrorMessage( GraalMainWindow,
"All instances must have different names !" );
rdsend();
return;
}
}
}
SaveInstance = GraalFigureMbk->PHINS;
GraalFigureMbk->PHINS = (phins_list *)NULL;
InstanceMbk =
addphins( GraalFigureMbk,
GraalInstanceModel,
GraalInstanceName,
GraalInstanceSym,
LambdaX1 * GRAAL_SCALE_X, LambdaY1 * GRAAL_SCALE_X );
InstanceMbk->NEXT = SaveInstance;
InstanceMbk->USER = (void *)(&GraalFigureMbk->PHINS);
if ( SaveInstance != (phins_list *)NULL )
{
SaveInstance->USER = (void *)(&InstanceMbk->NEXT);
}
InstanceRds = GraalAddInstance( InstanceMbk );
GraalDisplayToolsMessage();
if ( InstanceRds == (rdsins_list *)NULL )
{
GraalFigureMbk->PHINS = SaveInstance;
mbkfree( InstanceMbk );
GraalErrorMessage( GraalMainWindow, "Unable to load instance model !" );
}
else
{
GraalDelEqui();
GraalAddUndo();
GraalAddUndoRec( InstanceRds->LAYERTAB[ RDS_ABOX ] );
GraalZoomRefresh();
}
}
else
{
GraalErrorMessage( GraalMainWindow, "An instance must have a name !" );
}
}
else
{
GraalErrorMessage( GraalMainWindow, "An instance model name must specified !" );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| Graal Create Abutmentbox |
| |
\------------------------------------------------------------*/
void GraalCreateAbutmentBoxMbk( LambdaX1, LambdaY1, LambdaX2, LambdaY2 )
long LambdaX1;
long LambdaY1;
long LambdaX2;
long LambdaY2;
{
rdsrec_list *Rectangle;
long Swap;
rdsbegin();
if ( ( LambdaX1 != LambdaX2 ) &&
( LambdaY1 != LambdaY2 ) )
{
if ( LambdaX1 > LambdaX2 )
{
Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap;
}
if ( LambdaY1 > LambdaY2 )
{
Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap;
}
}
else
{
GraalErrorMessage( GraalMainWindow, "The abutment box must be rectangular !" );
rdsend();
return;
}
GraalCreateFigureMbk();
GraalFigureMbk->XAB1 = LambdaX1 * GRAAL_SCALE_X;
GraalFigureMbk->YAB1 = LambdaY1 * GRAAL_SCALE_X;
GraalFigureMbk->XAB2 = LambdaX2 * GRAAL_SCALE_X;
GraalFigureMbk->YAB2 = LambdaY2 * GRAAL_SCALE_X;
Rectangle = GraalAddAbox();
if ( Rectangle != (rdsrec_list *)NULL )
{
GraalAddUndo();
GraalAddUndoRec( Rectangle );
if ( ( GraalHeadEqui != (rdsrec_list *)NULL ) ||
( GraalHeadPeek != (graalpeek *)NULL ) )
{
GraalDelEqui();
GraalDelPeek();
GraalZoomRefresh();
}
else
{
GraalDisplayRectangle( Rectangle );
}
GraalChangeEditMode( GRAAL_EDIT_MEASURE,
GraalPromptEditMeasure );
}
else
{
GraalFigureMbk->XAB1 = 0;
GraalFigureMbk->YAB1 = 0;
GraalFigureMbk->XAB2 = 0;
GraalFigureMbk->YAB2 = 0;
GraalErrorMessage( GraalMainWindow, "Can't create this abutment box !" );
}
rdsend();
}

View File

@ -0,0 +1,141 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Create.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_CREATE
# define GRAAL_CREATE
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Segment & Wire |
| |
\------------------------------------------------------------*/
extern char GraalSegmentLayer;
extern long GraalSegmentWidth;
extern char *GraalSegmentName;
extern char GraalSegmentWire;
/*------------------------------------------------------------\
| |
| Via |
| |
\------------------------------------------------------------*/
extern char GraalViaType;
extern char *GraalViaName;
/*------------------------------------------------------------\
| |
| Big Via |
| |
\------------------------------------------------------------*/
extern char GraalBigViaType;
extern char *GraalBigViaName;
/*------------------------------------------------------------\
| |
| Transistor |
| |
\------------------------------------------------------------*/
extern char GraalTransistorType;
extern char *GraalTransistorName;
extern long GraalTransistorWidth;
extern char GraalTransistorWire;
/*------------------------------------------------------------\
| |
| Connector |
| |
\------------------------------------------------------------*/
extern char GraalConnectorLayer;
extern long GraalConnectorWidth;
extern char *GraalConnectorName;
extern char GraalConnectorOrient;
/*------------------------------------------------------------\
| |
| Reference |
| |
\------------------------------------------------------------*/
extern char GraalReferenceType;
extern char *GraalReferenceName;
/*------------------------------------------------------------\
| |
| Instance |
| |
\------------------------------------------------------------*/
extern char GraalInstanceSym;
extern char *GraalInstanceName;
extern char *GraalInstanceModel;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,116 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Dialog.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_CREATE_DIALOG
# define GRAAL_CREATE_DIALOG
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern char GraalCreateDialogCancel;
extern GraalDialogItem GraalChangeSegmentWidthDialog;
extern GraalDialogItem GraalChangeSegmentNameDialog;
extern GraalDialogItem GraalChangeViaNameDialog;
extern GraalDialogItem GraalChangeBigViaNameDialog;
extern GraalDialogItem GraalChangeTransistorWidthDialog;
extern GraalDialogItem GraalChangeTransistorNameDialog;
extern GraalDialogItem GraalChangeConnectorWidthDialog;
extern GraalDialogItem GraalChangeConnectorNameDialog;
extern GraalDialogItem GraalChangeReferenceNameDialog;
extern GraalDialogItem GraalChangeInstanceNameDialog;
extern GraalDialogItem GraalChangeInstanceModelDialog;
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void CallbackChangeSegmentWidthOk();
extern void CallbackChangeSegmentWidthCancel();
extern void CallbackChangeSegmentNameOk();
extern void CallbackChangeSegmentNameCancel();
extern void CallbackChangeViaNameOk();
extern void CallbackChangeViaNameCancel();
extern void CallbackChangeBigViaNameOk();
extern void CallbackChangeBigViaNameCancel();
extern void CallbackChangeTransistorWidthOk();
extern void CallbackChangeTransistorWidthCancel();
extern void CallbackChangeTransistorNameOk();
extern void CallbackChangeTransistorNameCancel();
extern void CallbackChangeConnectorWidthOk();
extern void CallbackChangeConnectorWidthCancel();
extern void CallbackChangeConnectorNameOk();
extern void CallbackChangeConnectorNameCancel();
extern void CallbackChangeReferenceNameOk();
extern void CallbackChangeReferenceNameCancel();
extern void CallbackChangeInstanceNameOk();
extern void CallbackChangeInstanceNameCancel();
extern void CallbackChangeInstanceModelOk();
extern void CallbackChangeInstanceModelCancel();
extern void GraalEnterChangeInstanceModelDialog();
# endif

View File

@ -0,0 +1,435 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Menu.c |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include <Xm/Xm.h>
# include <Xm/PushBG.h>
# include <Xm/CascadeBG.h>
# include "mph.h"
# include "rds.h"
# include "rpr.h"
# include "GTB.h"
# include "GSB.h"
# include "GRM.h"
# include "GMX.h"
# include "GMC.h"
# include "GMC_menu.h"
# include "GMC_create.h"
# include "GMC_message.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
GraalMenuItem GraalCreateMenu[] =
{
{
"Instance",
'I',
"Ctrl<Key>I",
"Ctrl I",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateInstance,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Abutment Box",
'A',
"Ctrl<Key>A",
"Ctrl A",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateAbutmentBox,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Segment",
'S',
"Ctrl<Key>E",
"Ctrl E",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateSegment,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Via",
'V',
"Ctrl<Key>V",
"Ctrl V",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateVia,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Big Via",
'B',
"Ctrl<Key>B",
"Ctrl B",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateBigVia,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Connector ",
'o',
"Ctrl<Key>N",
"Ctrl N",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateConnector,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Transistor ",
'T',
"Ctrl<Key>T",
"Ctrl T",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateTransistor,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL
}
,
{
"Reference ",
'R',
"Ctrl<Key>F",
"Ctrl F",
&xmPushButtonGadgetClass,
False,
False,
False,
CallbackCreateReference,
(XtPointer)NULL,
(Widget)NULL,
(Widget)NULL,
(GraalMenuItem *)NULL,
}
,
NULL
};
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| CallbackCreateSegment |
| |
\------------------------------------------------------------*/
void CallbackCreateSegment( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
if ( GraalSegmentWidth == -1 )
{
GraalSegmentWidth = GRAAL_SEGMENT_VALUE_TABLE[ GraalSegmentLayer ][0];
}
if ( GraalSegmentWire == GRAAL_FALSE )
{
GraalChangeEditMode( GRAAL_CREATE_SEGMENT,
GraalPromptCreateSegment );
}
else
{
GraalChangeEditMode( GRAAL_CREATE_SEGMENT_WIRE,
GraalPromptCreateSegment );
}
GraalEnterPanel( &GraalCreateSegmentPanel );
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateReference |
| |
\------------------------------------------------------------*/
void CallbackCreateReference( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
GraalChangeEditMode( GRAAL_CREATE_REFERENCE,
GraalPromptCreateReference );
GraalEnterPanel( &GraalCreateReferencePanel );
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateVia |
| |
\------------------------------------------------------------*/
void CallbackCreateVia( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
GraalChangeEditMode( GRAAL_CREATE_VIA,
GraalPromptCreateVia );
GraalEnterPanel( &GraalCreateViaPanel );
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateBigVia |
| |
\------------------------------------------------------------*/
void CallbackCreateBigVia( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
GraalChangeEditMode( GRAAL_CREATE_BIGVIA,
GraalPromptCreateBigVia );
GraalEnterPanel( &GraalCreateBigViaPanel );
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateInstance |
| |
\------------------------------------------------------------*/
void CallbackCreateInstance( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
GraalChangeEditMode( GRAAL_CREATE_INSTANCE,
GraalPromptCreateInstance );
GraalEnterPanel( &GraalCreateInstancePanel );
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateConnector |
| |
\------------------------------------------------------------*/
void CallbackCreateConnector( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
if ( ( GraalFigureMbk == (phfig_list *)NULL ) ||
( ( GraalFigureMbk->XAB1 == 0 ) &&
( GraalFigureMbk->XAB2 == 0 ) &&
( GraalFigureMbk->YAB1 == 0 ) &&
( GraalFigureMbk->YAB2 == 0 ) ) )
{
GraalErrorMessage( GraalMainWindow, "No abutment box, can't create connector !" );
}
else
{
if ( GraalConnectorWidth == -1 )
{
GraalConnectorWidth = GRAAL_SEGMENT_VALUE_TABLE[ GraalConnectorLayer ][0];
}
GraalChangeEditMode( GRAAL_CREATE_CONNECTOR,
GraalPromptCreateConnector );
GraalEnterPanel( &GraalCreateConnectorPanel );
}
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateTransistor |
| |
\------------------------------------------------------------*/
void CallbackCreateTransistor( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
if ( GraalTransistorWidth == -1 )
{
GraalTransistorWidth = GRAAL_SEGMENT_VALUE_TABLE[ GraalTransistorType ][0];
}
GraalChangeEditMode( GRAAL_CREATE_TRANSISTOR,
GraalPromptCreateTransistor );
GraalEnterPanel ( &GraalCreateTransistorPanel );
rdsend();
}
/*------------------------------------------------------------\
| |
| CallbackCreateAbutmentBox |
| |
\------------------------------------------------------------*/
void CallbackCreateAbutmentBox( MyWidget, ClientData, CallData )
Widget MyWidget;
caddr_t ClientData;
caddr_t CallData;
{
rdsbegin();
if ( ( GraalFigureMbk != (phfig_list *)NULL ) &&
( ( GraalFigureMbk->XAB1 != 0 ) ||
( GraalFigureMbk->XAB2 != 0 ) ||
( GraalFigureMbk->YAB1 != 0 ) ||
( GraalFigureMbk->YAB2 != 0 ) ) )
{
GraalErrorMessage( GraalMainWindow, "There is already one abutment box !");
}
else
{
GraalChangeEditMode( GRAAL_CREATE_ABUTMENTBOX,
GraalPromptCreateAbutmentBox );
}
rdsend();
}

View File

@ -0,0 +1,79 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Menu.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_CREATE_MENU
# define GRAAL_CREATE_MENU
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void CallbackCreateSegment();
extern void CallbackCreateVia();
extern void CallbackCreateBigVia();
extern void CallbackCreateInstance();
extern void CallbackCreateConnector();
extern void CallbackCreateTransistor();
extern void CallbackCreateReference();
extern void CallbackCreateAbutmentBox();
# endif

View File

@ -0,0 +1,289 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Message.c |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# include <stdio.h>
# include <Xm/Xm.h>
# include <Xm/PushBG.h>
# include <Xm/CascadeBG.h>
# include "mut.h"
# include "mph.h"
# include "rds.h"
# include "rpr.h"
# include "rfm.h"
# include "GRM.h"
# include "GMX.h"
# include "GTB.h"
# include "GSB.h"
# include "GMC.h"
# include "GMC_message.h"
# include "GMC_create.h"
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
static char MessageBuffer[ 512 ];
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| GraalPromptCreateSegment |
| |
\------------------------------------------------------------*/
void GraalPromptCreateSegment()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Segment" );
sprintf( MessageBuffer, "Layer: %s Width: %2d Name: %s",
GRAAL_SEGMENT_NAME_TABLE[ GraalSegmentLayer ][0] ,
GraalSegmentWidth,
( GraalSegmentName ) ? GraalSegmentName : "none" );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
switch ( GraalCountEventEdit )
{
case 0 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first point" );
break;
case 1 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter second point" );
}
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateConnector |
| |
\------------------------------------------------------------*/
void GraalPromptCreateConnector()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Connector" );
sprintf( MessageBuffer, "Layer: %s Width: %2d Orient: %s",
GRAAL_CONNECTOR_NAME_TABLE[ GraalConnectorLayer ][0],
GraalConnectorWidth,
GRAAL_ORIENT_NAME_TABLE[ GraalConnectorOrient ][0] );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter center point" );
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateReference |
| |
\------------------------------------------------------------*/
void GraalPromptCreateReference()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Reference" );
sprintf( MessageBuffer, "Type: %s",
GRAAL_REFERENCE_NAME_TABLE[GraalReferenceType][0] );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter center point" );
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateVia |
| |
\------------------------------------------------------------*/
void GraalPromptCreateVia()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Via" );
sprintf( MessageBuffer, "Type: %s Name: %s",
GRAAL_VIA_NAME_TABLE[ GraalViaType ][0],
( GraalViaName ) ? GraalViaName : "none" );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter center point" );
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateBigVia |
| |
\------------------------------------------------------------*/
void GraalPromptCreateBigVia()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Big Via" );
sprintf( MessageBuffer, "Type: %s Name: %s",
GRAAL_BIGVIA_NAME_TABLE[ GraalBigViaType ][0],
( GraalBigViaName ) ? GraalBigViaName : "none" );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
switch ( GraalCountEventEdit )
{
case 0 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
break;
case 1 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter second corner" );
}
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateTransistor |
| |
\------------------------------------------------------------*/
void GraalPromptCreateTransistor()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Transistor" );
if ( GraalTransistorName == (char *)NULL )
{
sprintf( MessageBuffer, "Type: %s Width: %2d Name: none",
GRAAL_TRANSISTOR_NAME_TABLE[ GraalTransistorType ][0],
GraalTransistorWidth );
}
else
{
sprintf( MessageBuffer, "Type: %s Width: %2d Name: %s",
GRAAL_TRANSISTOR_NAME_TABLE[ GraalTransistorType ][0],
GraalTransistorWidth, GraalTransistorName );
}
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
switch ( GraalCountEventEdit )
{
case 0 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first point" );
break;
case 1 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter second point" );
}
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateAbutmentBox |
| |
\------------------------------------------------------------*/
void GraalPromptCreateAbutmentBox()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Abutmentbox" );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );
switch ( GraalCountEventEdit )
{
case 0 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );
break;
case 1 :
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter second corner" );
}
}
/*------------------------------------------------------------\
| |
| GraalPromptCreateInstance |
| |
\------------------------------------------------------------*/
void GraalPromptCreateInstance()
{
GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Create Instance" );
sprintf( MessageBuffer, "Symmetry: %s",
GRAAL_SYMMETRY_NAME_TABLE[ GraalInstanceSym ][0] );
GraalDisplayMessage( GRAAL_MESSAGE_INFO, MessageBuffer );
GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter base point" );
}

View File

@ -0,0 +1,79 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Message.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_MESSAGE
# define GRAAL_MESSAGE
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void GraalPromptCreateSegment();
extern void GraalPromptCreateConnector();
extern void GraalPromptCreateReference();
extern void GraalPromptCreateVia();
extern void GraalPromptCreateBigVia();
extern void GraalPromptCreateTransistor();
extern void GraalPromptCreateAbutmentBox();
extern void GraalPromptCreateInstance();
# endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,117 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Panel.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Include Files |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_CREATE_PANEL
# define GRAAL_CREATE_PANEL
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# define GRAAL_CREATE_SEGMENT_X 790
# define GRAAL_CREATE_SEGMENT_Y 230
# define GRAAL_CREATE_VIA_X 790
# define GRAAL_CREATE_VIA_Y 330
# define GRAAL_CREATE_BIGVIA_X 790
# define GRAAL_CREATE_BIGVIA_Y 330
# define GRAAL_CREATE_TRANSISTOR_X 790
# define GRAAL_CREATE_TRANSISTOR_Y 330
# define GRAAL_CREATE_CONNECTOR_X 790
# define GRAAL_CREATE_CONNECTOR_Y 330
# define GRAAL_CREATE_REFERENCE_X 790
# define GRAAL_CREATE_REFERENCE_Y 330
# define GRAAL_CREATE_INSTANCE_X 790
# define GRAAL_CREATE_INSTANCE_Y 330
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void CallbackChangeSegmentLayer();
extern void CallbackChangeSegmentWidth();
extern void CallbackChangeSegmentName();
extern void CallbackChangeSegmentWire();
extern void CallbackChangeSegmentClose();
extern void CallbackChangeViaType();
extern void CallbackChangeViaName();
extern void CallbackChangeViaClose();
extern void CallbackChangeBigViaType();
extern void CallbackChangeBigViaName();
extern void CallbackChangeBigViaClose();
extern void CallbackChangeTransistorType();
extern void CallbackChangeTransistorWidth();
extern void CallbackChangeTransistorName();
extern void CallbackChangeTransistorWire();
extern void CallbackChangeTransistorClose();
extern void CallbackChangeConnectorLayer();
extern void CallbackChangeConnectorWidth();
extern void CallbackChangeConnectorOrient();
extern void CallbackChangeConnectorClose();
extern void CallbackChangeReferenceType();
extern void CallbackChangeReferenceClose();
extern void CallbackChangeInstanceSym();
extern void CallbackChangeInstanceClose();
# endif

View File

@ -0,0 +1,129 @@
/*------------------------------------------------------------\
| |
| This file is part of the Alliance CAD System Copyright |
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
| |
| Home page : http://www-asim.lip6.fr/alliance/ |
| E-mail support : mailto:alliance-support@asim.lip6.fr |
| |
| This progam is free software; you can redistribute it |
| and/or modify it under the terms of the GNU General Public |
| License as published by the Free Software Foundation; |
| either version 2 of the License, or (at your option) any |
| later version. |
| |
| Alliance VLSI CAD System is distributed in the hope that |
| it will be useful, but WITHOUT 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 along with the GNU C Library; see the file COPYING. |
| If not, write to the Free Software Foundation, Inc., |
| 675 Mass Ave, Cambridge, MA 02139, USA. |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Tool : GRAAL |
| |
| File : Gme101.h |
| |
| Author : Jacomme Ludovic |
| |
| Date : 28.03.95 |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Constants |
| |
\------------------------------------------------------------*/
# ifndef GRAAL_GME
# define GRAAL_GME
/*------------------------------------------------------------\
| |
| Types |
| |
\------------------------------------------------------------*/
/*------------------------------------------------------------\
| |
| Variables |
| |
\------------------------------------------------------------*/
extern GraalMenuItem GraalEditMenu[];
extern GraalMenuItem GraalWindowMenu[];
extern GraalPanelItem GraalEditGlobalPanel;
extern GraalPanelItem GraalWindowGlobalPanel;
extern GraalPanelItem GraalEditSearchPanel;
extern GraalPanelItem GraalEditSearchViewPanel;
extern GraalPanelItem GraalEditIdentifyPanel;
extern GraalPanelItem GraalEditSelectPanel;
extern GraalPanelItem GraalModifySegmentPanel;
extern GraalPanelItem GraalModifyTransistorPanel;
extern GraalPanelItem GraalModifyConnectorPanel;
extern GraalPanelItem GraalModifyReferencePanel;
extern GraalPanelItem GraalModifyInstancePanel;
extern GraalPanelItem GraalModifyViaPanel;
extern GraalPanelItem GraalModifyBigViaPanel;
extern int GraalEditGlobalDefaultValues[ 5 ];
extern int GraalWindowGlobalDefaultValues[ 5 ];
extern int GraalEditSearchDefaultValues[ 5 ];
extern int GraalEditIdentifyDefaultValues[ 5 ];
extern int GraalEditSelectDefaultValues[ 5 ];
extern int GraalEditSearchViewDefaultValues[ 5 ];
extern int GraalModifySegmentDefaultValues[ 5 ];
extern int GraalModifyTransistorDefaultValues[ 5 ];
extern int GraalModifyConnectorDefaultValues[ 5 ];
extern int GraalModifyReferenceDefaultValues[ 5 ];
extern int GraalModifyInstanceDefaultValues[ 5 ];
extern int GraalModifyViaDefaultValues[ 5 ];
extern int GraalModifyBigViaDefaultValues[ 5 ];
/*------------------------------------------------------------\
| |
| Functions |
| |
\------------------------------------------------------------*/
extern void GraalBuidlPanelModify();
extern void GraalBuildEditDialog();
extern void GraalEditSelectPointDelete();
extern void GraalEditSelectWindowDelete();
extern void GraalEditSelectPointCopy();
extern void GraalEditSelectWindowCopy();
extern void GraalEditSelectPointMove();
extern void GraalEditSelectWindowMove();
extern void GraalEditSelectPointModify();
extern void GraalEditSelectWindowModify();
extern void GraalEditIdentify();
extern void GraalEditUnselectAll();
extern void GraalEditSelectPoint();
extern void GraalEditSelectWindow();
extern void GraalEditSelectFence();
extern void GraalEditUndo();
extern void GraalEditRedo();
extern void GraalEditCopy();
extern void GraalEditMove();
extern void GraalEditDelete();
extern void GraalEditModify();
extern void GraalEditStretch();
extern void GraalToolsSelectEqui();
extern void GraalToolsSelectFlatten();
extern void GraalToolsSelectUnflatten();
extern void GraalToolsSelectRealFlatten();
extern void GraalToolsSelectHierarchyDown();
# endif

Some files were not shown because too many files have changed in this diff Show More