Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
343 B

  1. #include "byte.h"
  2. #include "buffer.h"
  3. #include "scan.h"
  4. int buffer_get_token_pred(buffer* b,char* x,unsigned long int len,
  5. string_predicate p) {
  6. int blen;
  7. for (blen=0;blen<len;++blen) {
  8. register int r;
  9. if ((r=buffer_getc(b,x))<0) return r;
  10. if (r==0) break;
  11. if (p(x-blen,blen+1)) break;
  12. ++x;
  13. }
  14. return blen;
  15. }