Doxygen Source Code Documentation
niccc.c File Reference
#include "niml.h"
Go to the source code of this file.
Functions | |
void | NIML_to_stderr (void *nini) |
int | main (int argc, char *argv[]) |
Function Documentation
|
\** File : SUMA.c
Input paramters :
Definition at line 17 of file niccc.c. References argc, NI_free_element(), NI_read_element(), NI_sleep(), NI_stream_goodcheck(), NI_stream_open(), NI_stream_readcheck(), and NIML_to_stderr().
00018 { 00019 NI_stream ns ; 00020 void *nini ; 00021 int nn ; 00022 00023 if( argc < 2 ){ 00024 fprintf(stderr,"Usage: niccc streamspec\n");exit(0); 00025 } 00026 00027 ns = NI_stream_open( argv[1], "r" ) ; 00028 if( ns == NULL ){ 00029 fprintf(stderr,"*** niccc: NI_stream_open fails\n") ; exit(1) ; 00030 } 00031 while(1){ 00032 nn = NI_stream_goodcheck( ns , 1 ) ; 00033 if( nn < 0 ){ 00034 fprintf(stderr,"\n*** niccc: Stream fails\n"); exit(1); 00035 } 00036 if( nn == 0 ){ NI_sleep(5); continue; } /* waiting for Godot */ 00037 00038 nn = NI_stream_readcheck( ns , 1 ) ; /* check for data */ 00039 00040 if( nn > 0 ){ 00041 nini = NI_read_element( ns , 2 ) ; 00042 if( nini == NULL ){ 00043 fprintf(stderr,"*** niccc: read returns NULL\n"); 00044 } else { 00045 NIML_to_stderr( nini ) ; 00046 NI_free_element( nini ) ; 00047 } 00048 } 00049 } 00050 } |
|
Definition at line 5 of file niccc.c. References NI_HEADERSHARP_FLAG, NI_stream_close(), NI_stream_open(), NI_TEXT_MODE, and NI_write_element(). Referenced by AFNI_niml_redisplay_CB(), AFNI_niml_viewpoint_CB(), AFNI_niml_workproc(), and main().
00006 { 00007 NI_stream ns_err ; 00008 ns_err = NI_stream_open( "stderr:" , "w" ) ; 00009 if( ns_err != NULL ){ 00010 NI_write_element( ns_err , nini , NI_TEXT_MODE | NI_HEADERSHARP_FLAG ) ; 00011 NI_stream_close( ns_err ) ; 00012 } 00013 } |