forked from zuberfowler/zedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GETSTRT.C
84 lines (76 loc) · 2.56 KB
/
GETSTRT.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "zedit.h"
void getstrt(
int coloffset,
char bline[],
int temp_rowcol[] [5],
char *scratch,
int *where,
int *amode,
int *eol,
int *toright)
/**********************************************************************/
/* */
/* Calculate starting position in buffer record for screen display. */
/* */
/**********************************************************************/
/* */
/* This is ZEDIT source material. */
/* */
/* ZEDIT Source Materials are intellectual property */
/* (c) Copyright 1987,2001 by Clyde Thomas Zuber. */
/* */
/**********************************************************************/
{
static int dummy = 0;
int column;
int tmap[3];
char tbuf[3];
char ttxt[3];
column = 0;
/* when scrolled over to the right */
while (column < coloffset && !(*eol))
{
if (bline[*where] == '\n')
{
*eol = YES;
*where += (coloffset - column - 1);
} /* end then */
else
while (bline[*where] == PRECDR)
{
++(*where);
switch(bline[*where])
{
case BUF_HEBREW:
*amode = bline[*where];
*toright = NO;
break;
case BUF_CHGDIR:
*toright = !(*toright);
break;
default:
*amode = bline[*where];
*toright = YES;
break;
} /* end switch */
++(*where);
} /* end while */
convinp(NULL, bline[*where], 0x00, *amode, YES, &dummy, &column, 0,
temp_rowcol, (char (*)[25][80]) scratch, NO);
++(*where);
} /* end while */
if (!(*eol))
{
tbuf[2] = '\0';
tmap[1] = 0;
while (!tmap[1] && bline[*where] != '\n' &&
bline[*where] != PRECDR && bline[*where])
{
tbuf[0] = bline[(*where) - 1];
tbuf[1] = bline[*where];
txtonly(*amode, tbuf, ttxt, tmap);
if (!tmap[1])
++(*where);
} /* end while */
} /* end then */
} /* end getstrt */