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.
 
 
 
 

17 lines
386 B

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