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  

myget.c File Reference

#include "thd_iochan.h"

Go to the source code of this file.


Functions

int main (int argc, char *argv[])

Function Documentation

int main int    argc,
char *    argv[]
 

\** File : SUMA.c

Author:
: Ziad Saad Date : Thu Dec 27 16:21:01 EST 2001
Purpose :

Input paramters :

Parameters:
param  Usage : SUMA ( )
Returns :
Returns:
Support :
See also:
OpenGL prog. Guide 3rd edition , varray.c from book's sample code
Side effects :

Definition at line 3 of file myget.c.

References argc, free, read_URL(), set_HTTP_10(), set_HTTP_user_agent(), and set_URL_progress().

00004 {
00005    char * buf ;
00006    int    nbuf , iarg=1 ;
00007 
00008    if( argc < 2 ){ fprintf(stderr,"Usage: myget [-1] URL > filename\n"); exit(0) ; }
00009 
00010    if( strcmp(argv[iarg],"-1") == 0 ){
00011      set_HTTP_10( 1 ) ; set_HTTP_user_agent( "myget" ) ; iarg++ ;
00012      if( iarg >= argc ) exit(1) ;
00013    }
00014 
00015    set_URL_progress(1) ;
00016    nbuf = read_URL( argv[iarg] , &buf ) ;
00017    if( nbuf <= 0 ){ fprintf(stderr,"Can't open URL %s\n",argv[iarg]) ; exit(1) ; }
00018 
00019    fwrite( buf , 1 , nbuf , stdout ) ;
00020    fflush(stdout) ;
00021    free(buf) ;
00022    fprintf(stderr,"Wrote out URL %s\n",argv[iarg]) ;
00023    exit(0) ;
00024 }
 

Powered by Plone

This site conforms to the following standards: