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

# sortlocon(3)

sort the logical connectors of a figure by name

## NAME

sortlocon - sort the logical connectors of a figure by name

## SYNOPSYS

```
#include "mlo.h"
void sortlocon(connectors)
locon_list ∗∗connectors;
```

## PARAMETERS

- *connectors*

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

## DESCRIPTION

**sortlocon** sorts the list of logical connectors pointed to by *∗connectors*. The connectors are sorted by names, using a numerical comparison function that ensures **x\_12 \> x\_2**.\
 The standart [**qsort**(3)](/qsort/3.md) function library is called for sorting. Therefore, a table the number of connectors wide is created. This is not very memory consuming since the number of connectors in a circuit interface is quite small, nor very time consuming since this algorithm runs in a n log n time.

## EXAMPLE

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

## SEE ALSO

**mbk**(1), [**locon**(3)](/locon/3.md), [**addlocon**(3)](/addlocon/3.md), [**dellocon**(3)](/dellocon/3.md), [**checkloconorder**(3)](/checkloconorder/3.md), [**qsort**(3)](/qsort/3.md).
