File: CELLRDR.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 (31 lines) | stat: -rw-r--r-- 786 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
/*======================================================================
                      CELLRDR(D; c,t)

Cell Read, Robust.

\Input
  \parm{D} is a partial CAD.
  
\Output
  \parm{c} is a cell in $D$ whose index has been read from the input stream.
  \parm{t} is 1 if successful, 0 otherwise.
======================================================================*/
#include "qepcad.h"

void CELLRDR(Word D, Word *c_, Word *t_)
{
       Word c,t,x;
       /* hide t; */

Step1: /* Read in a cell index. */
       XREADR(&x,&t); if (t == 0) goto Return;

Step2: /* Get a cell from the index. */
       CELLFIDX(x,D,&c,&t);
       if (t == 0) { LWRITE(x); SWRITE(" is not an existing cell.\n"); }

Return: /* Prepare for return. */
       *c_ = c;
       *t_ = t;
       return;
}