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

NAME

6        addrdsfigrec - adds a rectangle to a figure
7

SYNOPSIS

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

PARAMETER

20       Figure              figure 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 rectangle to add.
27

DESCRIPTION

29       addrdsfigrec  creates  an adds a rectangle in the figure called Figure.
30       The size of the user structure to add next to the structure rdsrec_list
31       (if  it  exists)  is defined by the field SIZE of the figure who has to
32       contain the rectangle. The rectangle is added in front of the list, and
33       becomes itself the list head associated to the defined layer in parame‐
34       ters of the function.  The fields of the rectangle structure are  modi‐
35       fied as follows :
36       The field NAME is set to Name.
37       The field X is set to X.
38       The field Y is set to Y.
39       The field DX is set to Dx.
40       The field DY is set to Dy.
41       The field FLAGS is modified with the value Layer.
42

RETURN VALUE

44       addrdsfigrec returns a pointer to the newly added rectangle.
45

ERRORS

47       "Rds202: rdsalloc error, can't continue !"
48              it's impossible to allocate the memory size desired
49

EXAMPLE

51       #include "mutnnn.h"
52       #include "rdsnnn.h"
53       #include "rtlnnn.h"
54               typedef struct UserStruct
55                {
56                  char ∗STRING;
57                  void ∗USER1;
58                } UserStruct;
59               # define POINTER_STRING(R)                                \
60                                                                         \
61                 (((UserStruct ∗)((char ∗)(R)+sizeof(rdsrec_list)))->STRING )
62                main()
63                 {
64                   rdsfig_list ∗RdsFigure;
65                   rdsrec_list ∗Rectangle;
66                   char Layer;
67                   rdsrec_list ∗ScanRec;
68                   mbkenv();
69                   rdsenv();
70                   loadrdsparam();
71                   RdsFigure = addrdsfig ("core",sizeof ( UserStruct ) );
72                   Rectangle = addrdsfigrec (RdsFigure,
73                                                   "Alu1",RDS_ALU1,
74                                                   2,4,12,1);
75                   POINTER_STRING(Rectangle) = namealloc ("rectangle_alu1");
76                   ...
77                   /∗
78                      print caracteristics of all rectangles of the Rds figure
79                   ∗/
80                   for ( Layer = 0 ; Layer < RDS_MAX_LAYER ; Layer ++ )
81                    {
82                      for (
83                             ScanRec  = RdsFigure->LAYERTAB[Layer] ;
84                             ScanRec != (rdsrec_list ∗) NULL     ;
85                             ScanRec  = ScanRec->NEXT
86                          )
87                       {
88                         printf("Rectangle->LAYER = %s\n",
89                            RDS_LAYER_NAME[GetRdsLayer(ScanRec)]);
90                         printf("Rectangle->NAME   = %s\n",ScanRec->NAME);
91                         printf("Rectangle->X      = %ld\n",ScanRec->X);
92                         printf("Rectangle->Y      = %ld\n",ScanRec->Y);
93                         printf("Rectangle->DX     = %ld\n",ScanRec->DX);
94                         printf("Rectangle->DY     = %ld\n",ScanRec->DY);
95                         printf("Rectangle->STRING = %s\n",POINTER_STRING(ScanRec));
96                       }
97                    }
98                 }
99

SEE ALSO

101       librds, delrdsfigrec, viewrdsfig
102
103
104
105
106
107
108ASIM/LIP6                       October 1, 1997                ADDRDSFIGREC(3)
Impressum