parser_f.h
512dcd98
 /* 
  * $Id$
  */
 
 #ifndef parser_f_h
 #define parser_f_h
 
 char* eat_line(char* buffer, unsigned int len);
f571aa35
 
726efa25
 /* turn the most frequently called functions into macros */
 
 
f571aa35
 #define eat_space_end(buffer,pend)                                       \
31c86f5f
   ( {   char *_p;                                                 	\
 	char *_pe=(pend);						\
         for(_p=(buffer);(_p<_pe)&& (*_p==' ' || *_p=='\t') ;_p++);		\
         _p;                                                              \
726efa25
   } )
 
f571aa35
 #define eat_token_end(buffer,pend)					\
31c86f5f
   ( { char *_p       ;							\
       char *_pe=(pend);						\
       for (_p=(buffer);(_p<_pe)&&					\
                         (*_p!=' ')&&(*_p!='\t')&&(*_p!='\n')&&(*_p!='\r');	\
                 _p++);							\
       _p;								\
726efa25
   } )
 
f571aa35
 #define eat_token2_end(buffer,pend,delim)					\
31c86f5f
   ( { char *_p       ;							\
       char *_pe=(pend);						\
       for (_p=(buffer);(_p<_pe)&&					\
                         (*_p!=(delim))&&(*_p!='\n')&&(*_p!='\r');		\
                 _p++);							\
       _p;								\
726efa25
   } )
 
f571aa35
 #define is_empty_end(buffer, pend )					\
31c86f5f
   ( { char *_p;								\
       char *_pe=(pend);						\
       _p=eat_space_end( buffer, _pe );					\
       ((_p<(pend )) && (*_p=='\r' || *_p=='\n')) ? 1 : 0;			\
f571aa35
   } )
 
726efa25
 
512dcd98
 #endif