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

# sortlosig(3)

sort the logical signals of a figure by name

## NAME

sortlosig - sort the logical signals of a figure by name

## SYNOPSYS

```
#include "mlo.h"
void sortlosig(signals)
losig_list ∗∗signals;
```

## PARAMETERS

- *∗∗signals*

  Pointer to the head of the list of signals that is to be sorted

## DESCRIPTION

**sortlosig** sorts the list of signals pointed to by *signals*. The signals are sorted by names, but since names are not the signals identifier, the [**getsigname**(3)](/getsigname/3.md) routine is called to retrieve a signal name.\
 The standart [**qsort**(3)](/qsort/3.md) function library is called for sorting. Therefore, a table the number of signal wide is created, requiring a lot of memory with big circuits. Also, even if [**qsort**(3)](/qsort/3.md) runs in n log n time, [**getsigname**(3)](/getsigname/3.md) is called twice, and the natural comparison function once, and this is quite time consuming with big circuits. It is recommended to use this function only if needed.

## EXAMPLE

```
#include "mlo.h"
void savesorted(figname)
char ∗figname;
{
lofig_list ∗figure = getlosig(figname, 'A');
  sortlocon(&figure->LOCON);
  sortlosig(&figure->LOSIG);
  savelofig(figure);
}
```

## SEE ALSO

**mbk**(1), [**losig**(3)](/losig/3.md), [**addlosig**(3)](/addlosig/3.md), [**dellosig**(3)](/dellosig/3.md), [**getsigname**(3)](/getsigname/3.md), [**sortlocon**(3)](/sortlocon/3.md), [**qsort**(3)](/qsort/3.md).
