ohcount
Functions
parser.h File Reference
#include "sourcefile.h"

Go to the source code of this file.

Functions

int ohcount_parse (SourceFile *sourcefile, int count, void(*callback)(const char *, const char *, int, int, void *), void *userdata)
 

Function Documentation

◆ ohcount_parse()

int ohcount_parse ( SourceFile sourcefile,
int  count,
void(*)(const char *, const char *, int, int, void *)  callback,
void *  userdata 
)

Tries to use an existing Ragel parser for the given language.

Parameters
sourcefileA SourceFile created by ohcount_sourcefile_new().
countAn integer flag indicating whether to count lines or parse entities.
callbackA callback to use for every line or entity in the source file discovered (depends on count).
userdataPointer to userdata used by callback (if any).
Returns
1 if a Ragel parser is found, 0 otherwise.