VIA - Volumetric Image Analysis
file.h
1 /*
2  * $Id: file.h 726 2004-03-08 13:12:45Z lohmann $
3  *
4  * This file contains definitions related to the Vista data file format.
5  */
6 
7 #ifndef V_file_h
8 #define V_file_h 1
9 
10 /*
11  * Copyright 1993, 1994 University of British Columbia
12  *
13  * Permission to use, copy, modify, distribute, and sell this software and its
14  * documentation for any purpose is hereby granted without fee, provided that
15  * the above copyright notice appears in all copies and that both that
16  * copyright notice and this permission notice appear in supporting
17  * documentation. UBC makes no representations about the suitability of this
18  * software for any purpose. It is provided "as is" without express or
19  * implied warranty.
20  *
21  * Author: Arthur Pope, UBC Laboratory for Computational Intelligence
22  */
23 
24 /* From the Vista library: */
25 #include <viaio/Vlib.h>
26 
27 /* From the standard C library: */
28 #ifdef NULL /* because some stdio's blindly defined NULL */
29 #undef NULL
30 #endif
31 #include <stdio.h>
32 #ifndef NULL
33 #define NULL 0
34 #endif
35 
36 /* For portability: */
37 #include <X11/Xfuncproto.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /*
44  * Components of the Vista data file header, and the delimeter separating
45  * attributes from binary data.
46  */
47 
48 #define VFileHeader "V-data"
49 #define VFileVersion 2
50 #define VFileDelimiter "\f\n"
51 
52 
53 /*
54  * Limit on the length of an attribute name.
55  */
56 
57 #define VMaxAttrNameLength 256
58 
59 
60 /*
61  * Type of function supplied as a filter to VReadFile.
62  */
63 
64 typedef VBoolean VReadFileFilterProc (
65 #if NeedFunctionPrototypes
66  VBundle /* bundle */,
67  VRepnKind /* repn */
68 #endif
69 );
70 
71 
72 /*
73  * Declarations of library routines.
74 
75  */
76 
77 /* Open a file for input: */
78 extern FILE *VOpenInputFile (
79 #if NeedFunctionPrototypes
80  VStringConst /* filename */,
81  VBoolean /* nofail */
82 #endif
83 );
84 
85 /* Open a file for output: */
86 extern FILE *VOpenOutputFile (
87 #if NeedFunctionPrototypes
88  VStringConst /* filename */,
89  VBoolean /* nofail */
90 #endif
91 );
92 
93 /* Read objects of a certain type: */
94 extern int VReadObjects (
95 #if NeedFunctionPrototypes
96  FILE * /* file */,
97  VRepnKind /* repn */,
98  VAttrList * /* attributes */,
99  VPointer ** /* objects */
100 #endif
101 );
102 
103 /* Read a Vista data file: */
104 extern VAttrList VReadFile (
105 #if NeedFunctionPrototypes
106  FILE * /* f */,
107  VReadFileFilterProc * /* filter */
108 #endif
109 );
110 
111 /* Write objects of a certain type: */
112 extern VBoolean VWriteObjects (
113 #if NeedFunctionPrototypes
114  FILE * /* file */,
115  VRepnKind /* repn */,
116  VAttrList /* attributes */,
117  int /* nobjects */,
118  VPointer [] /* objects */
119 #endif
120 );
121 
122 /* Write a Vista data file: */
123 extern VBoolean VWriteFile (
124 #if NeedFunctionPrototypes
125  FILE * /* f */,
126  VAttrList /* list */
127 #endif
128 );
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* V_file_h */