Mercurial > hg > Members > kono > nitros9-code
view 3rdparty/packages/ed/getone.c @ 1530:a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
author | boisy |
---|---|
date | Wed, 14 Apr 2004 13:35:50 +0000 |
parents | bef1844de0dc |
children |
line wrap: on
line source
/* getone.c */ #include <stdio.h> #include "tools.h" #include "ed.h" #define FIRST 1 #define NOTFIRST 0 int getone() { int c, i, num; if ((num = getnum(FIRST)) >= 0) { while (1) { while (*inptr == SP || *inptr == HT) inptr++; if (*inptr != '+' && *inptr != '-') break; c = *inptr++; if ((i = getnum(NOTFIRST)) < 0) return(i); if (c == '+') { num += i; } else { num -= i; } } } return(num > lastln ? ERR : num); }