1 // parser.c written by Mitchell Foral. mitchell<att>caladbolg.net.
2 // See COPYING for license information.
6 #include "sourcefile.h"
7 #include "hash/parser_hash.h"
9 int ohcount_parse(SourceFile *sourcefile, int count,
10 void (*callback) (const char *, const char *, int, int,
13 const char *language = ohcount_sourcefile_get_language(sourcefile);
15 struct ParserMap *rp =
16 ohcount_hash_parser_from_language(language, strlen(language));
18 char *buffer = ohcount_sourcefile_get_contents(sourcefile);
19 int buffer_len = ohcount_sourcefile_get_contents_size(sourcefile);
21 rp->parser(buffer, buffer_len, count, callback, userdata);