VIA - Volumetric Image Analysis
file.h
00001 /*
00002  *  $Id: file.h 726 2004-03-08 13:12:45Z lohmann $
00003  *
00004  *  This file contains definitions related to the Vista data file format.
00005  */
00006 
00007 #ifndef V_file_h
00008 #define V_file_h 1
00009 
00010 /*
00011  *  Copyright 1993, 1994 University of British Columbia
00012  *
00013  *  Permission to use, copy, modify, distribute, and sell this software and its
00014  *  documentation for any purpose is hereby granted without fee, provided that
00015  *  the above copyright notice appears in all copies and that both that
00016  *  copyright notice and this permission notice appear in supporting
00017  *  documentation. UBC makes no representations about the suitability of this
00018  *  software for any purpose. It is provided "as is" without express or
00019  *  implied warranty.
00020  *
00021  *  Author: Arthur Pope, UBC Laboratory for Computational Intelligence
00022  */
00023 
00024 /* From the Vista library: */
00025 #include <viaio/Vlib.h>
00026 
00027 /* From the standard C library: */
00028 #ifdef NULL     /* because some stdio's blindly defined NULL */
00029 #undef NULL
00030 #endif
00031 #include <stdio.h>
00032 #ifndef NULL
00033 #define NULL 0
00034 #endif
00035 
00036 /* For portability: */
00037 #include <X11/Xfuncproto.h>
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 /*
00044  *  Components of the Vista data file header, and the delimeter separating
00045  *  attributes from binary data.
00046  */
00047 
00048 #define VFileHeader             "V-data"
00049 #define VFileVersion            2
00050 #define VFileDelimiter          "\f\n"
00051 
00052 
00053 /*
00054  *  Limit on the length of an attribute name.
00055  */
00056 
00057 #define VMaxAttrNameLength      256
00058 
00059 
00060 /*
00061  *  Type of function supplied as a filter to VReadFile.
00062  */
00063 
00064 typedef VBoolean VReadFileFilterProc (
00065 #if NeedFunctionPrototypes
00066     VBundle                 /* bundle */,
00067     VRepnKind               /* repn */
00068 #endif
00069 );
00070 
00071 
00072 /*
00073  *  Declarations of library routines.
00074 
00075  */
00076 
00077 /* Open a file for input: */
00078 extern FILE *VOpenInputFile (
00079 #if NeedFunctionPrototypes
00080     VStringConst        /* filename */,
00081     VBoolean            /* nofail */
00082 #endif
00083 );
00084 
00085 /* Open a file for output: */
00086 extern FILE *VOpenOutputFile (
00087 #if NeedFunctionPrototypes
00088     VStringConst        /* filename */,
00089     VBoolean            /* nofail */
00090 #endif
00091 );
00092 
00093 /* Read objects of a certain type: */
00094 extern int VReadObjects (
00095 #if NeedFunctionPrototypes
00096     FILE *              /* file */,
00097     VRepnKind           /* repn */,
00098     VAttrList *         /* attributes */,
00099     VPointer **         /* objects */
00100 #endif
00101 );
00102 
00103 /* Read a Vista data file: */
00104 extern VAttrList VReadFile (
00105 #if NeedFunctionPrototypes
00106     FILE *              /* f */,
00107     VReadFileFilterProc * /* filter */
00108 #endif
00109 );
00110 
00111 /* Write objects of a certain type: */
00112 extern VBoolean VWriteObjects (
00113 #if NeedFunctionPrototypes
00114     FILE *              /* file */,
00115     VRepnKind           /* repn */,
00116     VAttrList           /* attributes */,
00117     int                 /* nobjects */,
00118     VPointer []         /* objects */
00119 #endif
00120 );
00121 
00122 /* Write a Vista data file: */
00123 extern VBoolean VWriteFile (
00124 #if NeedFunctionPrototypes
00125     FILE *              /* f */,
00126     VAttrList           /* list */
00127 #endif
00128 );
00129 
00130 #ifdef __cplusplus
00131 }
00132 #endif
00133 
00134 #endif /* V_file_h */