source: buchla-68k/ram/infield.c@ 39a696b

Last change on this file since 39a696b was 6262b5c, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added include files for global functions and variables.

  • 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 "all.h"
9
10extern int16_t stcrow, stccol;
11
12/*
13 =============================================================================
14 infield() -- Determines whether or not a given position is in a field.
15 Returns TRUE if in a field, FALSE if not. If in a field, sets 'infetp'
16 to point at the fet entry. If not in a field, sets 'infetp' to NULL.
17 =============================================================================
18*/
19
20int16_t infield(int16_t row, int16_t col, struct fet *fetp)
21{
22 infetp = (struct fet *)NULL; /* setup for NULL infetp return */
23
24 if ((struct fet *)NULL EQ fetp) /* handle NULL fet pointer */
25 return(FALSE);
26
27 while (fetp->redisp) { /* redisp EQ NULL is end of table */
28
29 if ((row EQ fetp->frow) AND /* check the entry */
30 (col GE fetp->flcol) AND
31 (col LE fetp->frcol)) {
32
33 infetp = fetp; /* set new fet pointer */
34 return(TRUE); /* return 'found' */
35 }
36
37 ++fetp; /* advance field pointer */
38 }
39
40 return(FALSE); /* return 'not found' */
41}
42
43
Note: See TracBrowser for help on using the repository browser.