1 //*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2052 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21 
22 #include "../my_config.h"
23 
24 #include "integers.hpp"
25 #include "infinint.hpp"
26 #include "compile_time_features.hpp"
27 
28 namespace libdar
29 {
30     namespace compile_time
31     {
32 
ea()33 	bool ea()
34 	{
35 #ifdef EA_SUPPORT
36 	    return true;
37 #else
38 	    return false;
39 #endif
40 	}
41 
42 
largefile()43 	bool largefile()
44 	{
45 #if defined( _FILE_OFFSET_BITS ) ||  defined( _LARGE_FILES )
46 	    return true;
47 #else
48 	    return sizeof(off_t) > 4;
49 #endif
50 	}
51 
52 
nodump()53 	bool nodump()
54 	{
55 	    return FSA_linux_extX();
56 	}
57 
special_alloc()58 	bool special_alloc()
59 	{
60 #ifdef LIBDAR_SPECIAL_ALLOC
61 	    return true;
62 #else
63 	    return false;
64 #endif
65 	}
66 
67 
bits()68 	U_I bits()
69 	{
70 #ifdef LIBDAR_MODE
71 	    return LIBDAR_MODE;
72 #else
73 	    return 0; // infinint
74 #endif
75 	}
76 
77 
thread_safe()78 	bool thread_safe()
79 	{
80 #if defined( MUTEX_WORKS ) && !defined ( MISSING_REENTRANT_LIBCALL )
81 	    return true;
82 #else
83 	    return false;
84 #endif
85 	}
86 
87 
libz()88 	bool libz()
89 	{
90 #if LIBZ_AVAILABLE
91 	    return true;
92 #else
93 	    return false;
94 #endif
95 	}
96 
97 
libbz2()98 	bool libbz2()
99 	{
100 #if LIBBZ2_AVAILABLE
101 	    return true;
102 #else
103 	    return false;
104 #endif
105 	}
106 
107 
liblzo()108 	bool liblzo()
109 	{
110 #if LIBLZO2_AVAILABLE
111 	    return true;
112 #else
113 	    return false;
114 #endif
115 	}
116 
libxz()117 	bool libxz()
118 	{
119 #if LIBLZMA_AVAILABLE
120 	    return true;
121 #else
122 	    return false;
123 #endif
124 	}
125 
libgcrypt()126 	bool libgcrypt()
127 	{
128 #if CRYPTO_AVAILABLE
129 	    return true;
130 #else
131 	    return false;
132 #endif
133 	}
134 
135 
furtive_read()136 	bool furtive_read()
137 	{
138 #if FURTIVE_READ_MODE_AVAILABLE
139 	    return true;
140 #else
141 	    return false;
142 #endif
143 	}
144 
145 
system_endian()146 	endian system_endian()
147 	{
148 	    endian ret;
149 
150 	    try
151 	    {
152 		ret = infinint::is_system_big_endian() ? big : little;
153 	    }
154 	    catch(...)
155 	    {
156 		ret = error;
157 	    }
158 
159 	    return ret;
160 	}
161 
posix_fadvise()162 	bool posix_fadvise()
163 	{
164 #if HAVE_POSIX_FADVISE
165 	    return true;
166 #else
167 	    return false;
168 #endif
169 	}
170 
fast_dir()171 	bool fast_dir()
172 	{
173 #if LIBDAR_FAST_DIR
174 	    return true;
175 #else
176 	    return false;
177 #endif
178 	}
179 
FSA_linux_extX()180 	bool FSA_linux_extX()
181 	{
182 #ifdef LIBDAR_NODUMP_FEATURE
183 	    return true;
184 #else
185 	    return false;
186 #endif
187 	}
188 
FSA_birthtime()189 	bool FSA_birthtime()
190 	{
191 #ifdef LIBDAR_BIRTHTIME
192 	    return true;
193 #else
194 	    return false;
195 #endif
196 	}
197 
microsecond_read()198 	bool microsecond_read()
199 	{
200 #ifdef LIBDAR_MICROSECOND_READ_ACCURACY
201 	    return true;
202 #else
203 	    return false;
204 #endif
205 	}
206 
microsecond_write()207 	bool microsecond_write()
208 	{
209 #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY
210 	    return true;
211 #else
212 	    return false;
213 #endif
214 	}
215 
symlink_restore_dates()216 	bool symlink_restore_dates()
217 	{
218 #ifdef HAVE_LUTIMES
219 	    return true;
220 #else
221 	    return false;
222 #endif
223 	}
224 
225 
public_key_cipher()226 	bool public_key_cipher()
227 	{
228 #ifdef GPGME_SUPPORT
229 	    return true;
230 #else
231 	    return false;
232 #endif
233 	}
234 
libthreadar()235 	bool libthreadar()
236 	{
237 #ifdef LIBTHREADAR_AVAILABLE
238 	    return true;
239 #else
240 	    return false;
241 #endif
242 	}
243 
244     } // end of compile_time nested namespace
245 } // end of libdar namespace
246