---
name: "addrdsins"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/addrdsins"
---

# addrdsins(3)

adds an instance to a figure

## NAME

 addrdsins - adds an instance to a figure

## SYNOPSYS

```
#include "rdsnnn.h"
rdsins_list ∗addrdsins( Figure, Model, Name, Sym, X, Y )
     rdsfig_list ∗Figure;
     char        ∗Model;
     char        ∗Name;
     char         Sym;
     long         X;
     long         Y;
```

## PARAMETER

- *Figure*

  figure which contains the instance.

- *Model*

  Name of the model of the instance.

- *Name*

  Name of the instance in the figure at which it belongs.

- *Sym*

  Symmetry applied to the instance.

  - possible values :

    - **RDS\_NOSYM**

    no symmetry.

  - **RDS\_ROT\_P**

    90 degrees rotation counter clockwise.

  - **RDS\_SYMXY**

    symmetry with regard to a horizontal and vertical axis.

  - **RDS\_ROT\_M**

    90 degrees rotation clockwise.

  - **RDS\_SYM\_X**

    symmetry with regard to a vertical axis.

  - **RDS\_SY\_RM**

    symmetry with regard to a vertical axis and 90 degrees clockwise.

  - **RDS\_SYM\_Y**

    symmetry with regard to a horizontal axis.

  - **RDS\_SY\_RP**

    symmetry with regard to a horizontal axis and 90 degrees rotation counter clockwise.

- *X,Y*

  position of the lower left corner of the instance in the figure after symmetry.

## DESCRIPTION

The *addrdsins* function adds an instance to the head of instances's list in the figure described in function parameter. Some fields of rdsins\_list structure are modified as follows :\
 The field *FIGNAME* is set to **Model**\
 The field *INSNAME* is set to **Name**\
 The field *X* is set to **X**\
 The field *Y* is set to **Y** \
 The field *TRANSF* is set to **Sym**\
 The field *SIZE* is set to **Figure-\>SIZE**

## RETURN VALUE

**addrdsins** returns a pointer to the newly created instance which is head of instances's list of the figure.

## ERRORS

**"Rds202: rdsalloc error, can't continue !"**

it's impossible to allocate the memory size desired.

## EXAMPLE

```
#include "mutnnn.h"
#include "rdsnnn.h"
#include "rtlnnn.h"
        typedef struct UserStruct
         {
           char ∗STRING;
           void ∗USER1;
         } UserStruct;
         main()
          {
            rdsfig_list ∗RdsFigure;
            rdsins_list ∗Instance;
            mbkenv();
            rdsenv();
            loadrdsparam();
            RdsFigure = addrdsfig ("core",sizeof ( UserStruct ) );
            Instance = addrdsins (RdsFigure,"na2_y","and2",RDS_NOSYM,8,6);
            printf("(RdsFigure->INSTANCE)->NAME = %s\n",
                    (RdsFigure->INSTANCE)->NAME);
            /∗ Instance is head of instance list of the figure ∗/
            printf("Instance->NAME = %s\n", Instance->NAME);
          }
```

## SEE ALSO

**librds,** **delrdsins,** **viewrdsins**
