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

# rflattenlofig(3)

recursivly flatten a figure

## NAME

rflattenlofig - recursivly flatten a figure

## SYNOPSYS

```
#include "mlu.h"
void rflattenlofig(ptfig, concat, catal)
lofig_list ∗ptfig;
char concat;
char catal;
```

## PARAMETERS

- *ptfig*

  Pointer to a logical figure

- *concat*

  Name generation mode

- *catal*

  End level choice

## DESCRIPTION

**rflattenlofig** recursivly flattens all the instances of the figure pointed to by *ptfig*. \
 The *concat* argument can take either the value **YES** in which case the name of the objects comming from instances are named *insname'X'objectname*, where *'X'* is the caracter set int the [**MBK\_SEPAR**(1)](/MBK_SEPAR/1.md) environment variable, or the value **NO**, and then the object name remains inchanged. This is quite dangerous since name unicity is no more warrantied, and may cause the flatten to fail. See [**MBK\_SEPAR**(1)](/MBK_SEPAR/1.md), [**mbkenv**(3)](/mbkenv/3.md) and [**concatname**(3)](/concatname/3.md) for details.\
 The *catal* argument may be set to **NO**, in which case flattening stops at the transistor level, all hierachies and instances have desapeard, only terminal elements remains. If set to **YES**, flattening stops when it encounters an instance model beeing present in the catalog file, set by the [**MBK\_CATAL\_NAME**(1)](/MBK_CATAL_NAME/1.md) environment variable. See [**MBK\_CATAL\_NAME**(1)](/MBK_CATAL_NAME/1.md) and [**incatalog**(3)](/incatalog/3.md) for details.

## ERRORS

No errors can directly result from a call to **rflattenlofig**, but since it uses many other mbk functions, it may be a good error starting point.

## EXAMPLE

```
#include "mlu.h"
void flatten_my_amd2901()
{
loins_list ∗pt;
	pt = getlofig("my_amd2901", 'A');
	rflattenlofig(pt, YES, YES);
	pt->NAME = "my_flattened_amd2901";
	savelofig(pt);
}
```

## SEE ALSO

**mbk**(1), [**incatalog**(3)](/incatalog/3.md), [**mbkenv**(3)](/mbkenv/3.md), [**lofig**(3)](/lofig/3.md), [**addlofig**(3)](/addlofig/3.md), [**getlofig**(3)](/getlofig/3.md), [**dellofig**(3)](/dellofig/3.md), [**loadlofig**(3)](/loadlofig/3.md), [**savelofig**(3)](/savelofig/3.md), [**flattenlofig**(3)](/flattenlofig/3.md), [**MBK\_CATAL\_NAME**(1)](/MBK_CATAL_NAME/1.md).
