source: buchla-68k/ram/infield.c@ 6262b5c

Last change on this file since 6262b5c 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
RevLine 
[f40a309]1/*
2 =============================================================================
3 infield.c -- field input functions
4 Version 6 -- 1988-10-20 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
[6262b5c]8#include "all.h"
[f40a309]9
[7258c6a]10extern int16_t stcrow, stccol;
[f40a309]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
[7258c6a]20int16_t infield(int16_t row, int16_t col, struct fet *fetp)
[f40a309]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
[6262b5c]43
Note: See TracBrowser for help on using the repository browser.