Skip to content

Commit

Permalink
namespacing ragel stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Cliff Moon authored and macournoyer committed Dec 17, 2008
1 parent a0b9ce7 commit c7915b5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ext/thin_parser/parser.rl
Expand Up @@ -83,7 +83,7 @@
/** Data **/
%% write data;

int http_parser_init(http_parser *parser) {
int thin_http_parser_init(http_parser *parser) {
int cs = 0;
%% write init;
parser->cs = cs;
Expand All @@ -99,7 +99,7 @@ int http_parser_init(http_parser *parser) {


/** exec **/
size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len, size_t off) {
size_t thin_http_parser_execute(http_parser *parser, const char *buffer, size_t len, size_t off) {
const char *p, *pe;
int cs = parser->cs;

Expand Down Expand Up @@ -133,27 +133,27 @@ size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len,
return(parser->nread);
}

int http_parser_finish(http_parser *parser)
int thin_http_parser_finish(http_parser *parser)
{
int cs = parser->cs;

%%write eof;

parser->cs = cs;

if (http_parser_has_error(parser) ) {
if (thin_http_parser_has_error(parser) ) {
return -1;
} else if (http_parser_is_finished(parser) ) {
} else if (thin_http_parser_is_finished(parser) ) {
return 1;
} else {
return 0;
}
}

int http_parser_has_error(http_parser *parser) {
int thin_http_parser_has_error(http_parser *parser) {
return parser->cs == http_parser_error;
}

int http_parser_is_finished(http_parser *parser) {
int thin_http_parser_is_finished(http_parser *parser) {
return parser->cs == http_parser_first_final;
}

0 comments on commit c7915b5

Please sign in to comment.