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