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  

close.c File Reference

#include "stdlib.h"
#include "f2c.h"
#include "fio.h"

Go to the source code of this file.


Defines

#define unlink   remove

Functions

integer f_clos (cllist *a)
void f_exit (void)
int flush_ (void)

Define Documentation

#define unlink   remove
 

Definition at line 13 of file close.c.

Referenced by close_backing_store(), COMPRESS_unlink(), DCM_CloseObject(), exit_me_baby(), f_clos(), ISQ_saver_CB(), main(), ncio_close(), NI_read_URL_tmpdir(), read_URL_ftp(), read_URL_http(), read_URL_tmpdir(), t_runc(), THD_delete_3dim_dataset(), THD_fetch_1D(), THD_fetch_dataset(), THD_open_3dcalc(), and Un_link_all().


Function Documentation

integer f_clos cllist   a
 

Definition at line 27 of file close.c.

References a, free, MXUNIT, t_runc(), unit::uend, unit::ufd, unit::ufnm, unlink, unit::uscrtch, and unit::uwrt.

Referenced by f_exit(), f_open(), and MAIN__().

00029 {       unit *b;
00030 
00031         if(a->cunit >= MXUNIT) return(0);
00032         b= &f__units[a->cunit];
00033         if(b->ufd==NULL)
00034                 goto done;
00035         if (!a->csta)
00036                 if (b->uscrtch == 1)
00037                         goto Delete;
00038                 else
00039                         goto Keep;
00040         switch(*a->csta) {
00041                 default:
00042                 Keep:
00043                 case 'k':
00044                 case 'K':
00045                         if(b->uwrt == 1)
00046                                 t_runc((alist *)a);
00047                         if(b->ufnm) {
00048                                 fclose(b->ufd);
00049                                 free(b->ufnm);
00050                                 }
00051                         break;
00052                 case 'd':
00053                 case 'D':
00054                 Delete:
00055                         if(b->ufnm) {
00056                                 fclose(b->ufd);
00057                                 unlink(b->ufnm); /*SYSDEP*/
00058                                 free(b->ufnm);
00059                                 }
00060                 }
00061         b->ufd=NULL;
00062  done:
00063         b->uend=0;
00064         b->ufnm=NULL;
00065         return(0);
00066         }

void f_exit void   
 

Definition at line 71 of file close.c.

References cllist::cerr, cllist::csta, cllist::cunit, f_clos(), i, and MXUNIT.

Referenced by exit_(), main(), s_1paus(), and s_stop().

00073 {       int i;
00074         static cllist xx;
00075         if (!xx.cerr) {
00076                 xx.cerr=1;
00077                 xx.csta=NULL;
00078                 for(i=0;i<MXUNIT;i++)
00079                 {
00080                         xx.cunit=i;
00081                         (void) f_clos(&xx);
00082                 }
00083         }
00084 }

int flush_ void   
 

Definition at line 89 of file close.c.

References i, and MXUNIT.

00091 {       int i;
00092         for(i=0;i<MXUNIT;i++)
00093                 if(f__units[i].ufd != NULL && f__units[i].uwrt)
00094                         fflush(f__units[i].ufd);
00095 return 0;
00096 }
 

Powered by Plone

This site conforms to the following standards: