1SORTLOSIG(3) MBK LOGICAL FUNCTIONS SORTLOSIG(3)
2
3
4
6 sortlosig - sort the logical signals of a figure by name
7
9 #include "mlo.h"
10 void sortlosig(signals)
11 losig_list ∗∗signals;
12
14 ∗∗signals Pointer to the head of the list of signals that is
15 to be sorted
16
18 sortlosig sorts the list of signals pointed to by signals. The signals
19 are sorted by names, but since names are not the signals identifier,
20 the getsigname(3) routine is called to retrieve a signal name.
21 The standard qsort(3) function library is called for sorting. There‐
22 fore, a table the number of signal wide is created, requiring a lot of
23 memory with big circuits. Also, even if qsort(3) runs in n log n time,
24 getsigname(3) is called twice, and the natural comparison function
25 once, and this is quite time consuming with big circuits. It is recom‐
26 mended to use this function only if needed.
27
29 #include "mlo.h"
30 void savesorted(figname)
31 char ∗figname;
32 {
33 lofig_list ∗figure = getlosig(figname, 'A');
34 sortlocon(&figure->LOCON);
35 sortlosig(&figure->LOSIG);
36 savelofig(figure);
37 }
38
40 mbk(1), losig(3), addlosig(3), dellosig(3), getsigname(3), sortlo‐
41 con(3), qsort(3).
42
43
44
45
46
47
48ASIM/LIP6 October 1, 1997 SORTLOSIG(3)