source: buchla-68k/ram/infield.c@ 60288f5

Last change on this file since 60288f5 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Point of no return.

  • Property mode set to 100644
File size: 1.2 KB
Line 
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 infield(short row, short col, struct fet *fetp)
22{
23 infetp = (struct fet *)NULL; /* setup for NULL infetp return */
24
25 if ((struct fet *)NULL EQ fetp) /* handle NULL fet pointer */
26 return(FALSE);
27
28 while (fetp->redisp) { /* redisp EQ NULL is end of table */
29
30 if ((row EQ fetp->frow) AND /* check the entry */
31 (col GE fetp->flcol) AND
32 (col LE fetp->frcol)) {
33
34 infetp = fetp; /* set new fet pointer */
35 return(TRUE); /* return 'found' */
36 }
37
38 ++fetp; /* advance field pointer */
39 }
40
41 return(FALSE); /* return 'not found' */
42}
43
Note: See TracBrowser for help on using the repository browser.