Doxygen Source Code Documentation
thd_linecount.c File Reference
#include "mrilib.h"
#include "thd.h"
Go to the source code of this file.
Functions | |
int | THD_linecount (char *str) |
Function Documentation
|
Definition at line 12 of file thd_linecount.c. Referenced by PLUG_action_CB().
00013 { 00014 int nlin ; 00015 char * cpt ; 00016 00017 if( str == NULL || str[0] == '\0' ) return 0 ; 00018 00019 nlin = 0 ; 00020 for( cpt=str ; *cpt != '\0' ; cpt++ ) 00021 if( *cpt == '\n' ) nlin++ ; 00022 00023 if( *(cpt-1) != '\n' ) nlin++ ; 00024 00025 return nlin ; 00026 } |