Last change
on this file since d21fc6f 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
|
Rev | Line | |
---|
[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 |
|
---|
| 11 | extern 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 |
|
---|
| 21 | short
|
---|
| 22 | infield(row, col, fetp)
|
---|
| 23 | register short row, col;
|
---|
| 24 | register 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.