1 // parsed_language.h written by Mitchell Foral. mitchell<att>caladbolg.net.
2 // See COPYING for license information.
4 #ifndef OHCOUNT_PARSED_LANGUAGE_H
5 #define OHCOUNT_PARSED_LANGUAGE_H
10 * Creates a new ParsedLanguage for the given language and buffer size.
11 * The given language is not copied and may not be 'free'd. Use a language
12 * defined in src/languages.h.
13 * @param language The parsed language.
14 * @param buffer_size The size of the buffers to store parsed code and comment
16 * @return ParsedLanguage
18 ParsedLanguage *ohcount_parsed_language_new(const char *language,
22 * Adds some code to the code buffer for the given ParsedLanguage.
23 * @param parsed_language A ParsedLanguage created from
24 * ohcount_parsed_language_new().
25 * @param p A pointer in memory to start copying code from.
26 * @param length The number of characters to copy from p.
28 void ohcount_parsed_language_add_code(ParsedLanguage *parsed_language,
32 * Adds a comment to the comment buffer for the given ParsedLanguage.
33 * @param parsed_language A ParsedLanguage created from
34 * ohcount_parsed_language_new().
35 * @param p A pointer in memory to start copying the comment from.
36 * @param length The number of characters to copy from p.
38 void ohcount_parsed_language_add_comment(ParsedLanguage *parsed_language,
42 * Frees the memory allocated for the given ParsedLanguage.
43 * @param parsed_language A ParsedLanguage created from
44 * ohcount_parsed_language_new().
46 void ohcount_parsed_language_free(ParsedLanguage *parsed_language);
49 * Creates a new ParsedLanguageList that is initially empty.
50 * @return ParsedLanguageList
52 ParsedLanguageList *ohcount_parsed_language_list_new();
55 * Frees the memory allocated for the given ParsedLanguageList.
56 * @param list A ParsedLanguage created from ohcount_parsed_language_list_new().
58 void ohcount_parsed_language_list_free(ParsedLanguageList *list);