Removed gestalt options from C ohcount (use ruby/gestalt.rb).
[ohcount] / src / parsed_language.h
1 // parsed_language.h written by Mitchell Foral. mitchell<att>caladbolg.net.
2 // See COPYING for license information.
3
4 #ifndef OHCOUNT_PARSED_LANGUAGE_H
5 #define OHCOUNT_PARSED_LANGUAGE_H
6
7 #include "structs.h"
8
9 /**
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
15  *   text.
16  * @return ParsedLanguage
17  */
18 ParsedLanguage *ohcount_parsed_language_new(const char *language,
19                                             int buffer_size);
20
21 /**
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.
27  */
28 void ohcount_parsed_language_add_code(ParsedLanguage *parsed_language,
29                                       char *p, int length);
30
31 /**
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.
37  */
38 void ohcount_parsed_language_add_comment(ParsedLanguage *parsed_language,
39                                          char *p, int length);
40
41 /**
42  * Frees the memory allocated for the given ParsedLanguage.
43  * @param parsed_language A ParsedLanguage created from
44  *   ohcount_parsed_language_new().
45  */
46 void ohcount_parsed_language_free(ParsedLanguage *parsed_language);
47
48 /**
49  * Creates a new ParsedLanguageList that is initially empty.
50  * @return ParsedLanguageList
51  */
52 ParsedLanguageList *ohcount_parsed_language_list_new();
53
54 /**
55  * Frees the memory allocated for the given ParsedLanguageList.
56  * @param list A ParsedLanguage created from ohcount_parsed_language_list_new().
57  */
58 void ohcount_parsed_language_list_free(ParsedLanguageList *list);
59
60 #endif