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_zblock.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    utilities for writing char arrays to disk
00012    (replace 0's with ZBLOCK's, and vice-versa)
00013 -------------------------------------------------------------------*/
00014 
00015 void THD_zblock( int nch , char *ch )
00016 {
00017    int ii ;
00018    if( nch <= 0 ) return ;
00019 
00020    for( ii=0 ; ii < nch ; ii++ ){
00021      if( ch[ii] == ZBLOCK ) ch[ii] = '*' ;  /* irreversible */
00022      if( ch[ii] == '\0'   ) ch[ii] = ZBLOCK ;
00023    }
00024 }
00025 
00026 void THD_unzblock( int nch , char *ch )
00027 {
00028    int ii ;
00029    if( nch <= 0 ) return ;
00030 
00031    for( ii=0 ; ii < nch ; ii++ )
00032      if( ch[ii] == ZBLOCK ) ch[ii] = '\0' ;
00033 
00034    ch[nch-1] = '\0' ;
00035 }
 

Powered by Plone

This site conforms to the following standards: