Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

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    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
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 }
 

Powered by Plone

This site conforms to the following standards: