source: buchla-68k/orig/RAM/INFIELD.C@ 5f1d169

Last change on this file since 5f1d169 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.3 KB
RevLine 
[3ae31e9]1/*
2 =============================================================================
3 infield.c -- field input functions
4 Version 6 -- 1988-10-20 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "fields.h"
9#include "stddefs.h"
10
11extern short stcrow, stccol;
12
13/*
14 =============================================================================
15 infield() -- Determines whether or not a given position is in a field.
16 Returns TRUE if in a field, FALSE if not. If in a field, sets 'infetp'
17 to point at the fet entry. If not in a field, sets 'infetp' to NULL.
18 =============================================================================
19*/
20
21short
22infield(row, col, fetp)
23register short row, col;
24register struct fet *fetp;
25{
26 infetp = (struct fet *)NULL; /* setup for NULL infetp return */
27
28 if ((struct fet *)NULL EQ fetp) /* handle NULL fet pointer */
29 return(FALSE);
30
31 while (fetp->redisp) { /* redisp EQ NULL is end of table */
32
33 if ((row EQ fetp->frow) AND /* check the entry */
34 (col GE fetp->flcol) AND
35 (col LE fetp->frcol)) {
36
37 infetp = fetp; /* set new fet pointer */
38 return(TRUE); /* return 'found' */
39 }
40
41 ++fetp; /* advance field pointer */
42 }
43
44 return(FALSE); /* return 'not found' */
45}
46
Note: See TracBrowser for help on using the repository browser.