19 #ifndef APT_TEXT_STREAM_H
20 #define APT_TEXT_STREAM_H
33 #define APT_TOKEN_SP 0x20
35 #define APT_TOKEN_HTAB 0x09
37 #define APT_TOKEN_CR 0x0D
39 #define APT_TOKEN_LF 0x0A
126 stream->pos = stream->text.buf;
127 stream->end = stream->text.buf + stream->text.length;
128 stream->is_eos = FALSE;
132 static APR_INLINE
void apt_text_stream_init(
apt_text_stream_t *stream,
char *buffer, apr_size_t size)
136 apt_text_stream_reset(stream);
142 if(stream->
pos + 2 < stream->
end) {
153 if(stream->
pos + 1 < stream->
end) {
173 static APR_INLINE
apt_bool_t apt_text_is_wsp(
char ch)
188 while(stream->
pos < stream->
end && apt_text_is_wsp(*stream->
pos) == TRUE)
195 if(stream->
pos < stream->
end && *stream->
pos == ch) stream->
pos++;
201 while(stream->
pos < stream->
end && *stream->
pos == ch) stream->
pos++;
207 while(stream->
pos < stream->
end && *stream->
pos != ch) stream->
pos++;
213 return (stream->
pos >= stream->
end || stream->
is_eos == TRUE) ? TRUE : FALSE;