Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
thd_linecount.c
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 #include "mrilib.h"
00008 #include "thd.h"
00009 
00010 
00011 
00012 int THD_linecount( char *  str )
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 }