ohcount
Functions
parsed_language.h File Reference
#include "structs.h"

Go to the source code of this file.

Functions

ParsedLanguageohcount_parsed_language_new (const char *language, int buffer_size)
void ohcount_parsed_language_add_code (ParsedLanguage *parsed_language, char *p, int length)
void ohcount_parsed_language_add_comment (ParsedLanguage *parsed_language, char *p, int length)
void ohcount_parsed_language_free (ParsedLanguage *parsed_language)
ParsedLanguageListohcount_parsed_language_list_new ()
void ohcount_parsed_language_list_free (ParsedLanguageList *list)

Function Documentation

void ohcount_parsed_language_add_code ( ParsedLanguage parsed_language,
char *  p,
int  length 
)

Adds some code to the code buffer for the given ParsedLanguage.

Parameters:
parsed_languageA ParsedLanguage created from ohcount_parsed_language_new().
pA pointer in memory to start copying code from.
lengthThe number of characters to copy from p.
void ohcount_parsed_language_add_comment ( ParsedLanguage parsed_language,
char *  p,
int  length 
)

Adds a comment to the comment buffer for the given ParsedLanguage.

Parameters:
parsed_languageA ParsedLanguage created from ohcount_parsed_language_new().
pA pointer in memory to start copying the comment from.
lengthThe number of characters to copy from p.
void ohcount_parsed_language_free ( ParsedLanguage parsed_language)

Frees the memory allocated for the given ParsedLanguage.

Parameters:
parsed_languageA ParsedLanguage created from ohcount_parsed_language_new().
void ohcount_parsed_language_list_free ( ParsedLanguageList list)

Frees the memory allocated for the given ParsedLanguageList.

Parameters:
listA ParsedLanguage created from ohcount_parsed_language_list_new().
ParsedLanguageList* ohcount_parsed_language_list_new ( )

Creates a new ParsedLanguageList that is initially empty.

Returns:
ParsedLanguageList
ParsedLanguage* ohcount_parsed_language_new ( const char *  language,
int  buffer_size 
)

Creates a new ParsedLanguage for the given language and buffer size. The given language is not copied and may not be 'free'd. Use a language defined in src/languages.h.

Parameters:
languageThe parsed language.
buffer_sizeThe size of the buffers to store parsed code and comment text.
Returns:
ParsedLanguage