File: LISTOFCWTV.c

package info (click to toggle)
qepcad 1.74%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,848 kB
  • sloc: ansic: 27,242; cpp: 2,995; makefile: 1,287; perl: 91
file content (38 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*======================================================================
                 LISTOFCWTV(C;Lt,Lf)

List (true/false) of cells with truth values.

Inputs
  C : A CAD cell.

Outputs
  Lt : A list of all true cells.
  Lf : A list of all false cells.
======================================================================*/
#include "qepcad.h"

void LISTOFCWTV(Word C, Word *Lt_, Word *Lf_)
{
      Word Cp,Lt,Lf,t,Ltp,Lfp;

Step1: /* If C is undetermined recurse on the children. */
      t = LELTI(C,TRUTH); 
      switch (t) {
      case (TRUE) :
        Lt = LIST1(C); Lf = NIL; break;
      case (FALSE) :
        Lf = LIST1(C); Lt = NIL; break;
      default :
        Lf = NIL; Lt = NIL;
        for(Cp = LELTI(C,CHILD); Cp != NIL; Cp = RED(Cp)) {
          LISTOFCWTV(FIRST(Cp),&Ltp,&Lfp);
          Lt = CONC(Ltp,Lt);
          Lf = CONC(Lfp,Lf); }
        break; }

Return:
      *Lt_ = Lt;
      *Lf_ = Lf;
      return;
}