Mercurial > hg > Members > kono > nitros9-code
annotate 3rdparty/packages/ed/getone.c @ 2822:4ffb283f6233 lwtools-port
Forgot to add to makefile
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Wed, 22 May 2013 17:04:29 -0500 |
parents | bef1844de0dc |
children |
rev | line source |
---|---|
994 | 1 /* getone.c */ |
2 #include <stdio.h> | |
3 #include "tools.h" | |
4 #include "ed.h" | |
5 | |
6 #define FIRST 1 | |
7 #define NOTFIRST 0 | |
8 | |
9 int getone() | |
10 { | |
11 int c, i, num; | |
12 | |
13 if ((num = getnum(FIRST)) >= 0) { | |
14 while (1) { | |
15 while (*inptr == SP || *inptr == HT) inptr++; | |
16 | |
17 if (*inptr != '+' && *inptr != '-') break; | |
18 c = *inptr++; | |
19 | |
20 if ((i = getnum(NOTFIRST)) < 0) return(i); | |
21 | |
22 if (c == '+') { | |
23 num += i; | |
24 } else { | |
25 num -= i; | |
26 } | |
27 } | |
28 } | |
29 return(num > lastln ? ERR : num); | |
30 } | |
31 |