Mercurial > hg > Members > kono > nitros9-code
view 3rdparty/packages/ed/ckglob.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
/* ckglob.c */ #include <stdio.h> #include "tools.h" #include "ed.h" int ckglob() { TOKEN *glbpat; char c, delim; char lin[MAXLINE]; int num; LINE *ptr; c = *inptr; if (c != 'g' && c != 'v') return(0); if (deflt(1, lastln) < 0) return(ERR); delim = *++inptr; if (delim <= ' ') return(ERR); glbpat = optpat(); if (*inptr == delim) inptr++; ptr = getptr(1); for (num = 1; num <= lastln; num++) { ptr->l_stat &= ~LGLOB; if (line1 <= num && num <= line2) { strcpy(lin, ptr->l_buff); strcat(lin, "\n"); if (matchs(lin, glbpat, 0)) { if (c == 'g') ptr->l_stat |= LGLOB; } else { if (c == 'v') ptr->l_stat |= LGLOB; } } ptr = ptr->l_next; } return(1); }