1ADDRDSINSREC(3)             RDS PHYSICAL FUNCTIONS             ADDRDSINSREC(3)
2
3
4

NAME

6        addrdsinsrec - adds a rectangle to an instance
7

SYNOPSIS

9       #include"rdsnnn.h"
10        rdsrec_list ∗addrdsinsrec( Instance, Name, Layer, X, Y, Dx, Dy )
11          rdsins_list ∗Instance;
12          char        ∗Name;
13          char         Layer;
14          long         X;
15          long         Y;
16          long         Dx;
17          long         Dy;
18

PARAMETER

20       Instance            The instance which contains the rectangle to add.
21
22       Name                Name of the rectangle to add.
23
24       Layer               Layer of the rectangle to add.
25
26       X,Y,DX,DY           Dimensions of the the rectangle to add.
27

DESCRIPTION

29       This  function  creates an adds a rectangle to an instance. The size of
30       the user structure  to  add  (if  if  exists)  next  to  the  structure
31       rdsrec_list  is  defined by the field SIZE of the instance which has to
32       contain the rectangle. The rectangle is chained to the head of the rec‐
33       tangles's  list  associated  to  the defined layer in parameters of the
34       function addrdsinsrec(). The fields of the rectangle structure are mod‐
35       ified as follows :
36
37       The field NAME is set to ´Name´.
38       The field X is set to ´X´.
39       The field Y is set to ´Y´.
40       The field DX is set to ´Dx´.
41       The field DY is set to ´Dy´.
42       The field FLAGS is modified with the value ´Layer´.
43
44       Note :
45
46       - This function uses MBK namealloc() function.
47
48       -  coordinates of the rectangle are related to the instance before geo‐
49       metrical transformation.
50

RETURN VALUE

52       The pointer to the added rectangle. It is also the head of rectangles's
53       list associated to the corresponding layer.
54

ERRORS

56       "Rds202: rdsalloc error, can't continue !"
57              it's impossible to allocate the memory size desired
58

EXAMPLE

60               #include "mutnnn.h"
61               #include "rdsnnn.h"
62               #include "rtlnnn.h"
63               typedef struct UserStruct
64                {
65                  char ∗STRING;
66                  void ∗USER1;
67                } UserStruct;
68               # define POINTER_STRING(R)                                \
69                                                                         \
70                 (((UserStruct ∗)((char ∗)(R)+sizeof(rdsrec_list)))->STRING )
71                main()
72                 {
73                   rdsfig_list ∗RdsFigure;
74                   rdsins_list ∗Instance;
75                   rdsrec_list ∗Rectangle;
76                   char Layer;
77                   rdsrec_list ∗ScanRec;
78                   mbkenv();
79                   rdsenv();
80                   loadrdsparam();
81                   RdsFigure = addrdsfig ("core",sizeof ( UserStruct ) );
82                   Instance  = addrdsins (RdsFigure,"na2_y","and2",RDS_NOSYM,8,6);
83                   Rectangle = addrdsinsrec (Instance,"Alu1",RDS_ALU1,2,4,12,1);
84                   POINTER_STRING( Rectangle ) = namealloc ("un_alu1");
85                   /∗
86                      Displays caracteristics of all the rectangles of the instance
87                   ∗/
88                  for ( Layer = 0 ; Layer < RDS_MAX_LAYER ; Layer ++ )
89                   {
90                     for (
91                            ScanRec  = Instance->LAYERTAB[Layer] ;
92                            ScanRec != (rdsrec_list ∗) NULL      ;
93                            ScanRec  = ScanRec->NEXT
94                         )
95                      {
96                        printf("Rectangle->LAYER = %s\n",
97                           RDS_LAYER_NAME[GetRdsLayer(ScanRec)]);
98                        printf("Rectangle->NAME   = %s\n",ScanRec->NAME);
99                        printf("Rectangle->X      = %ld\n",ScanRec->X);
100                        printf("Rectangle->Y      = %ld\n",ScanRec->Y);
101                        printf("Rectangle->DX     = %ld\n",ScanRec->DX);
102                        printf("Rectangle->DY     = %ld\n",ScanRec->DY);
103                        printf("Rectangle->STRING = %s\n",POINTER_STRING(ScanRec));
104                      }
105                   }
106                 }
107

SEE ALSO

109       librds, delrdsinsrec, viewrdsins
110
111
112
113
114
115
116ASIM/LIP6                       October 1, 1997                ADDRDSINSREC(3)
Impressum