summaryrefslogtreecommitdiffstats
path: root/Python/thread_nt.h
blob: 7d2290e6b88ac816792f4fb7cebdc7c59da57ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315

/* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */
/* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */
/* Eliminated some memory leaks, gsw@agere.com */

#include <windows.h>
#include <limits.h>
#include <process.h>

typedef struct NRMUTEX {
	LONG   owned ;
	DWORD  thread_id ;
	HANDLE hevent ;
} NRMUTEX, *PNRMUTEX ;

typedef PVOID WINAPI interlocked_cmp_xchg_t(PVOID *dest, PVOID exc, PVOID comperand) ;

/* Sorry mate, but we haven't got InterlockedCompareExchange in Win95! */
static PVOID WINAPI interlocked_cmp_xchg(PVOID *dest, PVOID exc, PVOID comperand)
{
	static LONG spinlock = 0 ;
	PVOID result ;
	DWORD dwSleep = 0;

	/* Acqire spinlock (yielding control to other threads if cant aquire for the moment) */
	while(InterlockedExchange(&spinlock, 1))
	{
		// Using Sleep(0) can cause a priority inversion.
		// Sleep(0) only yields the processor if there's
		// another thread of the same priority that's
		// ready to run.  If a high-priority thread is
		// trying to acquire the lock, which is held by
		// a low-priority thread, then the low-priority
		// thread may never get scheduled and hence never
		// free the lock.  NT attempts to avoid priority
		// inversions by temporarily boosting the priority
		// of low-priority runnable threads, but the problem
		// can still occur if there's a medium-priority
		// thread that's always runnable.  If Sleep(1) is used,
		// then the thread unconditionally yields the CPU.  We
		// only do this for the second and subsequent even
		// iterations, since a millisecond is a long time to wait
		// if the thread can be scheduled in again sooner
		// (~100,000 instructions).
		// Avoid priority inversion: 0, 1, 0, 1,...
		Sleep(dwSleep);
		dwSleep = !dwSleep;
	}
	result = *dest ;
	if (result == comperand)
		*dest = exc ;
	/* Release spinlock */
	spinlock = 0 ;
	return result ;
} ;

static interlocked_cmp_xchg_t *ixchg ;
BOOL InitializeNonRecursiveMutex(PNRMUTEX mutex)
{
	if (!ixchg)
	{
		/* Sorely, Win95 has no InterlockedCompareExchange API (Win98 has), so we have to use emulation */
		HANDLE kernel = GetModuleHandle("kernel32.dll") ;
		if (!kernel || (ixchg = (interlocked_cmp_xchg_t *)GetProcAddress(kernel, "InterlockedCompareExchange")) == NULL)
			ixchg = interlocked_cmp_xchg ;
	}

	mutex->owned = -1 ;  /* No threads have entered NonRecursiveMutex */
	mutex->thread_id = 0 ;
	mutex->hevent = CreateEvent(NULL, FALSE, FALSE, NULL) ;
	return mutex->hevent != NULL ;	/* TRUE if the mutex is created */
}

#ifdef InterlockedCompareExchange
#undef InterlockedCompareExchange
#endif
#define InterlockedCompareExchange(dest,exchange,comperand) (ixchg((dest), (exchange), (comperand)))

VOID DeleteNonRecursiveMutex(PNRMUTEX mutex)
{
	/* No in-use check */
	CloseHandle(mutex->hevent) ;
	mutex->hevent = NULL ; /* Just in case */
}

DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
{
	/* Assume that the thread waits successfully */
	DWORD ret ;

	/* InterlockedIncrement(&mutex->owned) == 0 means that no thread currently owns the mutex */
	if (!wait)
	{
		if (InterlockedCompareExchange((PVOID *)&mutex->owned, (PVOID)0, (PVOID)-1) != (PVOID)-1)
			return WAIT_TIMEOUT ;
		ret = WAIT_OBJECT_0 ;
	}
	else
		ret = InterlockedIncrement(&mutex->owned) ?
			/* Some thread owns the mutex, let's wait... */
			WaitForSingleObject(mutex->hevent, INFINITE) : WAIT_OBJECT_0 ;

	mutex->thread_id = GetCurrentThreadId() ; /* We own it */
	return ret ;
}

BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex)
{
	/* We don't own the mutex */
	mutex->thread_id = 0 ;
	return
		InterlockedDecrement(&mutex->owned) < 0 ||
		SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */
}

PNRMUTEX AllocNonRecursiveMutex(void)
{
	PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ;
	if (mutex && !InitializeNonRecursiveMutex(mutex))
	{
		free(mutex) ;
		mutex = NULL ;
	}
	return mutex ;
}

void FreeNonRecursiveMutex(PNRMUTEX mutex)
{
	if (mutex)
	{
		DeleteNonRecursiveMutex(mutex) ;
		free(mutex) ;
	}
}

long PyThread_get_thread_ident(void);

/*
 * Initialization of the C package, should not be needed.
 */
static void PyThread__init_thread(void)
{
}

/*
 * Thread support.
 */

typedef struct {
	void (*func)(void*);
	void *arg;
	long id;
	HANDLE done;
} callobj;

static int
bootstrap(void *call)
{
	callobj *obj = (callobj*)call;
	/* copy callobj since other thread might free it before we're done */
	void (*func)(void*) = obj->func;
	void *arg = obj->arg;

	obj->id = PyThread_get_thread_ident();
	ReleaseSemaphore(obj->done, 1, NULL);
	func(arg);
	return 0;
}

long
PyThread_start_new_thread(void (*func)(void *), void *arg)
{
	unsigned long rv;
	callobj obj;

	dprintf(("%ld: PyThread_start_new_thread called\n",
		 PyThread_get_thread_ident()));
	if (!initialized)
		PyThread_init_thread();

	obj.id = -1;	/* guilty until proved innocent */
	obj.func = func;
	obj.arg = arg;
	obj.done = CreateSemaphore(NULL, 0, 1, NULL);
	if (obj.done == NULL)
		return -1;

	rv = _beginthread(bootstrap, 0, &obj); /* use default stack size */
	if (rv == (unsigned long)-1) {
		/* I've seen errno == EAGAIN here, which means "there are
		 * too many threads".
		 */
		dprintf(("%ld: PyThread_start_new_thread failed: %p errno %d\n",
		         PyThread_get_thread_ident(), rv, errno));
		obj.id = -1;
	}
	else {
		dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n",
		         PyThread_get_thread_ident(), rv));
		/* wait for thread to initialize, so we can get its id */
		WaitForSingleObject(obj.done, INFINITE);
		assert(obj.id != -1);
	}
	CloseHandle((HANDLE)obj.done);
	return obj.id;
}

/*
 * Return the thread Id instead of an handle. The Id is said to uniquely identify the
 * thread in the system
 */
long PyThread_get_thread_ident(void)
{
	if (!initialized)
		PyThread_init_thread();

	return GetCurrentThreadId();
}

static void do_PyThread_exit_thread(int no_cleanup)
{
	dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
	if (!initialized)
		if (no_cleanup)
			_exit(0);
		else
			exit(0);
	_endthread();
}

void PyThread_exit_thread(void)
{
	do_PyThread_exit_thread(0);
}

void PyThread__exit_thread(void)
{
	do_PyThread_exit_thread(1);
}

#ifndef NO_EXIT_PROG
static void do_PyThread_exit_prog(int status, int no_cleanup)
{
	dprintf(("PyThread_exit_prog(%d) called\n", status));
	if (!initialized)
		if (no_cleanup)
			_exit(status);
		else
			exit(status);
}

void PyThread_exit_prog(int status)
{
	do_PyThread_exit_prog(status, 0);
}

void PyThread__exit_prog(int status)
{
	do_PyThread_exit_prog(status, 1);
}
#endif /* NO_EXIT_PROG */

/*
 * Lock support. It has too be implemented as semaphores.
 * I [Dag] tried to implement it with mutex but I could find a way to
 * tell whether a thread already own the lock or not.
 */
PyThread_type_lock PyThread_allocate_lock(void)
{
	PNRMUTEX aLock;

	dprintf(("PyThread_allocate_lock called\n"));
	if (!initialized)
		PyThread_init_thread();

	aLock = AllocNonRecursiveMutex() ;

	dprintf(("%ld: PyThread_allocate_lock() -> %p\n", PyThread_get_thread_ident(), aLock));

	return (PyThread_type_lock) aLock;
}

void PyThread_free_lock(PyThread_type_lock aLock)
{
	dprintf(("%ld: PyThread_free_lock(%p) called\n", PyThread_get_thread_ident(),aLock));

	FreeNonRecursiveMutex(aLock) ;
}

/*
 * Return 1 on success if the lock was acquired
 *
 * and 0 if the lock was not acquired. This means a 0 is returned
 * if the lock has already been acquired by this thread!
 */
int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
{
	int success ;

	dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),aLock, waitflag));

	success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag == 1 ? INFINITE : 0)) == WAIT_OBJECT_0 ;

	dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success));

	return success;
}

void PyThread_release_lock(PyThread_type_lock aLock)
{
	dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));

	if (!(aLock && LeaveNonRecursiveMutex((PNRMUTEX) aLock)))
		dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n", PyThread_get_thread_ident(), aLock, GetLastError()));
}
iv class='ctx'> if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
- if(H5FD_MPIO != H5P_get_driver(plist))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
/* Get the transfer mode */
- if (xfer_mode)
- if (H5P_get(plist,H5D_XFER_IO_XFER_MODE_NAME,xfer_mode)<0)
+ if(xfer_mode)
+ if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, xfer_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_dxpl_mpio() */
+
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_collective_opt
-
-Purpose:
- To set a flag to choose linked chunk IO or multi-chunk IO without
- involving decision-making inside HDF5
-
-Description:
- The library will do linked chunk IO or multi-chunk IO without
- involving communications for decision-making process.
- The library won't behave as it asks for only when we find
- that the low-level MPI-IO package doesn't support this.
-
-Parameters:
- hid_t dxpl_id in: Data transfer property list identifier
- H5FD_mpio_chunk_opt_t in: The optimization flag for linked chunk IO
- or multi-chunk IO.
-
-
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-*
+ *
+ * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
+ * without involving decision-making inside HDF5
+ *
+ * Note: The library will do linked chunk I/O or multi-chunk I/O without
+ * involving communications for decision-making process.
+ * The library won't behave as it asks for only when we find
+ * that the low-level MPI-IO package doesn't support this.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mode)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iDc", dxpl_id, opt_mode);
@@ -577,9 +561,6 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo
if(H5P_set(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &opt_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value = H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_dxpl_mpio_collective_opt() */
@@ -587,33 +568,28 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_chunk_opt
-
-Purpose:
- To set a flag to choose linked chunk IO or multi-chunk IO without
- involving decision-making inside HDF5
-
-Description:
- The library will do linked chunk IO or multi-chunk IO without
- involving communications for decision-making process.
- The library won't behave as it asks for only when we find
- that the low-level MPI-IO package doesn't support this.
-
-Parameters:
- hid_t dxpl_id in: Data transfer property list identifier
- H5FD_mpio_chunk_opt_t in: The optimization flag for linked chunk IO
- or multi-chunk IO.
-
-
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-*
+ *
+ * Purpose: To set a flag to choose linked chunk I/O or multi-chunk I/O
+ * without involving decision-making inside HDF5
+ *
+ * Note: The library will do linked chunk I/O or multi-chunk I/O without
+ * involving communications for decision-making process.
+ * The library won't behave as it asks for only when we find
+ * that the low-level MPI-IO package doesn't support this.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iDh", dxpl_id, opt_mode);
@@ -626,41 +602,36 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME,&opt_mode)<0)
+ if(H5P_set(plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &opt_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio_chunk_opt() */
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_chunk_opt_num
-
-Purpose:
- To set a threshold for doing linked chunk IO
-
-Description:
- If the number is greater than the threshold set by the user,
- the library will do linked chunk IO; otherwise, IO will be done for every chunk.
-
-Parameters:
- hid_t dxpl_id in: Data transfer property list identifier
- unsigned num_proc_per_chunk in: the threshold of the average number of chunks selected by each process
-
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-*
+ *
+ * Purpose: To set a threshold for doing linked chunk IO
+ *
+ * Note: If the number is greater than the threshold set by the user,
+ * the library will do linked chunk I/O; otherwise, I/O will be
+ * done for every chunk.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iIu", dxpl_id, num_chunk_per_proc);
@@ -673,41 +644,39 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME,&num_chunk_per_proc)<0)
+ if(H5P_set(plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &num_chunk_per_proc) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio_chunk_opt_num() */
/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_mpio_chunk_opt_ratio
-
-Purpose:
- To set a threshold for doing collective IO for each chunk
-Description:
- The library will calculate the percentage of the number of process holding selections at each chunk. If that percentage of number of process in the individual chunk is greater than the threshold set by the user, the library will do collective chunk IO for this chunk; otherwise, independent IO will be done for this chunk.
-Parameters:
- hid_t dxpl_id
- in: Data transfer property list identifier
- unsigned percent_num_proc_per_chunk
- in: the threshold of the percentage of the number of process holding selections per chunk
-Returns:
-Returns a non-negative value if successful. Otherwise returns a negative value.
-
-
-*
+ *
+ * Purpose: To set a threshold for doing collective I/O for each chunk
+ *
+ * Note: The library will calculate the percentage of the number of
+ * process holding selections at each chunk. If that percentage
+ * of number of process in the individual chunk is greater than
+ * the threshold set by the user, the library will do collective
+ * chunk I/O for this chunk; otherwise, independent I/O will be
+ * done for this chunk.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Kent Yang
+ * ? ?, ?
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_chunk)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iIu", dxpl_id, percent_num_proc_per_chunk);
@@ -720,15 +689,12 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
/* Set the transfer mode */
- if (H5P_set(plist,H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME,&percent_num_proc_per_chunk)<0)
+ if(H5P_set(plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &percent_num_proc_per_chunk) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- /* Initialize driver-specific properties */
- ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL);
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_dxpl_mpio_chunk_opt_ratio() */
/*-------------------------------------------------------------------------
@@ -745,10 +711,6 @@ done:
* Programmer: Robb Matzke
* Friday, August 13, 1999
*
- * Modifications:
- * Albert Cheng, 2003-04-17
- * Duplicate the communicator and Info object so that the new
- * property list is insulated from the old one.
*-------------------------------------------------------------------------
*/
static void *
@@ -790,8 +752,6 @@ done:
* Programmer: Albert Cheng
* Jan 8, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index b1d312f..08529e2 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -74,6 +74,10 @@
#define END_MEMBERS }}
+#define H5FD_MULTI_DXPL_PROP_NAME "H5FD_MULTI_DXPL"
+#define H5FD_MULTI_DXPL_PROP_SIZE sizeof(H5FD_multi_dxpl_t)
+
+
/* The driver identification number, initialized at runtime */
static hid_t H5FD_MULTI_g = 0;
@@ -126,8 +130,6 @@ static herr_t H5FD_multi_sb_decode(H5FD_t *file, const char *name,
static void *H5FD_multi_fapl_get(H5FD_t *file);
static void *H5FD_multi_fapl_copy(const void *_old_fa);
static herr_t H5FD_multi_fapl_free(void *_fa);
-static void *H5FD_multi_dxpl_copy(const void *_old_dx);
-static herr_t H5FD_multi_dxpl_free(void *_dx);
static H5FD_t *H5FD_multi_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_multi_close(H5FD_t *_file);
@@ -161,9 +163,9 @@ static const H5FD_class_t H5FD_multi_g = {
H5FD_multi_fapl_get, /*fapl_get */
H5FD_multi_fapl_copy, /*fapl_copy */
H5FD_multi_fapl_free, /*fapl_free */
- sizeof(H5FD_multi_dxpl_t), /*dxpl_size */
- H5FD_multi_dxpl_copy, /*dxpl_copy */
- H5FD_multi_dxpl_free, /*dxpl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
H5FD_multi_open, /*open */
H5FD_multi_close, /*close */
H5FD_multi_cmp, /*cmp */
@@ -590,6 +592,127 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_dxpl_copy_cb
+ *
+ * Purpose: Multi VFD DXPL property 'copy' callback
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, August 15, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_dxpl_copy_cb(const char *name, size_t size, void *_dx)
+{
+ H5FD_multi_dxpl_t *dx = (H5FD_multi_dxpl_t *)_dx;
+ static const char *func = "H5FD_multi_dxpl_copy_cb"; /* Function Name for error reporting */
+
+ /* Shut compiler up */
+ name = name;
+
+ /* Sanity check */
+ assert(size == sizeof(H5FD_multi_dxpl_t));
+
+ ALL_MEMBERS(mt) {
+ if(dx->memb_dxpl[mt] >= 0)
+ if(H5Iinc_ref(dx->memb_dxpl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTINC, "can't increment ref. count for multi VFD property", -1)
+ } END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_dxpl_copy_cb() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_dxpl_cmp_cb
+ *
+ * Purpose: Multi VFD DXPL property 'compare' callback
+ *
+ * Return: Success: same as memcmp()
+ * Failure: <can't fail>
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, August 15, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5FD_multi_dxpl_cmp_cb(const void *_dx1, const void *_dx2, size_t size)
+{
+ const H5FD_multi_dxpl_t *dx1 = (const H5FD_multi_dxpl_t *)_dx1;
+ const H5FD_multi_dxpl_t *dx2 = (const H5FD_multi_dxpl_t *)_dx2;
+ int cmp_status;
+
+ /* Sanity check */
+ assert(size == sizeof(H5FD_multi_dxpl_t));
+
+ ALL_MEMBERS(mt) {
+ if(dx1->memb_dxpl[mt] >= 0) {
+ if(dx2->memb_dxpl[mt] >= 0) {
+ cmp_status = H5Pequal(dx1->memb_dxpl[mt], dx2->memb_dxpl[mt]);
+ if(cmp_status != 0)
+ return(cmp_status);
+ } /* end if */
+ else
+ return(1);
+ } /* end if */
+ else {
+ if(dx2->memb_dxpl[mt] >= 0)
+ return(-1);
+ else
+ if(dx1->memb_dxpl[mt] > dx2->memb_dxpl[mt])
+ return(1);
+ else if(dx1->memb_dxpl[mt] < dx2->memb_dxpl[mt])
+ return(-1);
+ else
+ continue;
+ } /* end else */
+ } END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_dxpl_cmp_cb() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_dxpl_cls_cb
+ *
+ * Purpose: Multi VFD DXPL property 'close' callback
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, August 15, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_dxpl_cls_cb(const char *name, size_t size, void *_dx)
+{
+ H5FD_multi_dxpl_t *dx = (H5FD_multi_dxpl_t *)_dx;
+ static const char *func = "H5FD_multi_dxpl_cls_cb"; /* Function Name for error reporting */
+
+ /* Shut compiler up */
+ name = name;
+
+ /* Sanity check */
+ assert(size == sizeof(H5FD_multi_dxpl_t));
+
+ ALL_MEMBERS(mt) {
+ if(dx->memb_dxpl[mt] >= 0)
+ if(H5Idec_ref(dx->memb_dxpl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTDEC, "can't increment ref. count for multi VFD property", -1)
+ } END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_dxpl_cls_cb() */
+
+
+
+/*-------------------------------------------------------------------------
* Function: H5Pset_dxpl_multi
*
* Purpose: Set the data transfer property list DXPL_ID to use the multi
@@ -613,7 +736,8 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
{
H5FD_multi_dxpl_t dx;
H5FD_mem_t mt;
- static const char *func="H5FDset_dxpl_multi"; /* Function Name for error reporting */
+ htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */
+ static const char *func = "H5FDset_dxpl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
@@ -621,26 +745,56 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
H5Eclear2(H5E_DEFAULT);
/* Check arguments */
- if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
+ if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1)
- if (!memb_dxpl)
+ if(!memb_dxpl)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1)
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (memb_dxpl[mt]!=H5P_DEFAULT && TRUE!=H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(memb_dxpl[mt] != H5P_DEFAULT && TRUE != H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1)
- }
+ } /* end for */
+
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+
+ /* Copy the DXPLs to internal property, converting "generic" default
+ * property lists into default dataset transfer property lists */
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(memb_dxpl[mt] == H5P_DEFAULT)
+ dx.memb_dxpl[mt] = H5P_DATASET_XFER_DEFAULT;
+ else {
+ if((dx.memb_dxpl[mt] = H5Pcopy(memb_dxpl[mt])) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCOPY, "can't copy dataset transfer property list", -1)
+ } /* end else */
+ } /* end for */
+
+ /* Clear previous property, if it exists */
+ if(prop_exists) {
+ H5FD_multi_dxpl_t old_dx;
+
+ /* Get the old DXPL value */
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &old_dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1)
- /* Initialize the data transfer property list */
- memcpy(dx.memb_dxpl, memb_dxpl, H5FD_MEM_NTYPES*sizeof(hid_t));
+ ALL_MEMBERS(mt) {
+ if(old_dx.memb_dxpl[mt] >= 0)
+ if(H5Pclose(old_dx.memb_dxpl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTCLOSEOBJ, "can't close property list", -1)
+ } END_MEMBERS;
- /* Convert "generic" default property lists into default dataset transfer property lists */
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (dx.memb_dxpl[mt]==H5P_DEFAULT)
- dx.memb_dxpl[mt]=H5P_DATASET_XFER_DEFAULT;
- }
+ /* Set the new value */
+ if(H5Pset(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get previous property value", -1)
+ } /* end if */
+ else {
+ /* Insert multi VFD DXPL property into property list */
+ if(H5Pinsert2(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, H5FD_MULTI_DXPL_PROP_SIZE, &dx, NULL, NULL, NULL, H5FD_multi_dxpl_copy_cb, H5FD_multi_dxpl_cmp_cb, H5FD_multi_dxpl_cls_cb) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTINSERT, "can't insert multi VFD DXPL property", -1)
+ } /* end else */
- return H5Pset_driver(dxpl_id, H5FD_MULTI, &dx);
-}
+ return 0;
+} /* end H5Pset_dxpl_multi() */
/*-------------------------------------------------------------------------
@@ -663,33 +817,42 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
herr_t
H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/)
{
- H5FD_multi_dxpl_t *dx;
+ H5FD_multi_dxpl_t dx;
H5FD_mem_t mt;
- static const char *func="H5FDget_dxpl_multi"; /* Function Name for error reporting */
+ htri_t prop_exists; /* Whether the multi VFD DXPL property already exists */
+ static const char *func = "H5FDget_dxpl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
+ /* Argument checking */
+ if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1)
- if (H5FD_MULTI!=H5Pget_driver(dxpl_id))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1)
- if(NULL == (dx = (H5FD_multi_dxpl_t *)H5Pget_driver_info(dxpl_id)))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1)
- if (memb_dxpl) {
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
- if (dx->memb_dxpl[mt]>=0)
- memb_dxpl[mt] = H5Pcopy(dx->memb_dxpl[mt]);
+ if(memb_dxpl) {
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+ if(!prop_exists)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "multi VFD DXPL property not set", -1)
+
+ /* Get the DXPL value */
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1)
+
+ /* Deep copy the multi VFD DXPL value */
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
+ if(dx.memb_dxpl[mt] >= 0)
+ memb_dxpl[mt] = H5Pcopy(dx.memb_dxpl[mt]);
else
- memb_dxpl[mt] = dx->memb_dxpl[mt]; /*default or bad ID */
- }
- }
+ memb_dxpl[mt] = dx.memb_dxpl[mt]; /*default or bad ID */
+ } /* end for */
+ } /* end if */
return 0;
-}
+} /* end H5Pget_dxpl_multi() */
/*-------------------------------------------------------------------------
@@ -1106,90 +1269,6 @@ H5FD_multi_fapl_free(void *_fa)
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_dxpl_copy
- *
- * Purpose: Copes the multi-specific data transfer properties.
- *
- * Return: Success: Ptr to new property list
- *
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_multi_dxpl_copy(const void *_old_dx)
-{
- const H5FD_multi_dxpl_t *old_dx = (const H5FD_multi_dxpl_t*)_old_dx;
- H5FD_multi_dxpl_t *new_dx = (H5FD_multi_dxpl_t *)malloc(sizeof(H5FD_multi_dxpl_t));
- int nerrors = 0;
- static const char *func="H5FD_multi_dxpl_copy"; /* Function Name for error reporting */
-
- assert(new_dx);
-
- /* Clear the error stack */
- H5Eclear2(H5E_DEFAULT);
-
- memcpy(new_dx, old_dx, sizeof(H5FD_multi_dxpl_t));
- ALL_MEMBERS(mt) {
- if (old_dx->memb_dxpl[mt]>=0) {
- new_dx->memb_dxpl[mt] = H5Pcopy(old_dx->memb_dxpl[mt]);
- if (new_dx->memb_dxpl[mt]<0) nerrors++;
- }
- } END_MEMBERS;
-
- if (nerrors) {
- ALL_MEMBERS(mt) {
- (void)H5Pclose(new_dx->memb_dxpl[mt]);
- } END_MEMBERS;
- free(new_dx);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL)
- }
- return new_dx;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_multi_dxpl_free
- *
- * Purpose: Frees the multi-specific data transfer properties.
- *
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_multi_dxpl_free(void *_dx)
-{
- H5FD_multi_dxpl_t *dx = (H5FD_multi_dxpl_t*)_dx;
- static const char *func="H5FD_multi_dxpl_free"; /* Function Name for error reporting */
-
- /* Clear the error stack */
- H5Eclear2(H5E_DEFAULT);
-
- ALL_MEMBERS(mt) {
- if (dx->memb_dxpl[mt]>=0)
- if(H5Pclose(dx->memb_dxpl[mt])<0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1)
- } END_MEMBERS;
-
- free(dx);
- return 0;
-}
-
-
-/*-------------------------------------------------------------------------
* Function: H5FD_multi_open
*
* Purpose: Creates and/or opens a multi HDF5 file.
@@ -1823,25 +1902,33 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *_buf/*out*/)
+H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, void *_buf/*out*/)
{
H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_multi_dxpl_t *dx=NULL;
- H5FD_mem_t mt, mmt, hi=H5FD_MEM_DEFAULT;
- haddr_t start_addr=0;
+ H5FD_multi_dxpl_t dx;
+ htri_t prop_exists = FALSE; /* Whether the multi VFD DXPL property already exists */
+ H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
+ haddr_t start_addr = 0;
+ static const char *func = "H5FD_multi_read"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Get the data transfer properties */
- if(H5P_FILE_ACCESS_DEFAULT != dxpl_id && H5FD_MULTI == H5Pget_driver(dxpl_id))
- dx = (H5FD_multi_dxpl_t *)H5Pget_driver_info(dxpl_id);
+ if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) {
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+
+ /* Get the DXPL value, if it exists */
+ if(prop_exists)
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1)
+ } /* end if */
/* Find the file to which this address belongs */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
@@ -1850,18 +1937,19 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
mmt = mt;
assert(mmt > 0 && mmt < H5FD_MEM_NTYPES);
- if (file->fa.memb_addr[mmt]>addr) continue;
- if (file->fa.memb_addr[mmt]>=start_addr) {
+ if(file->fa.memb_addr[mmt] > addr)
+ continue;
+ if(file->fa.memb_addr[mmt] >= start_addr) {
start_addr = file->fa.memb_addr[mmt];
hi = mmt;
- }
- }
- assert(hi>0);
+ } /* end if */
+ } /* end for */
+ assert(hi > 0);
/* Read from that member */
- return H5FDread(file->memb[hi], type, dx?dx->memb_dxpl[hi]:H5P_DEFAULT,
- addr-start_addr, size, _buf);
-}
+ return H5FDread(file->memb[hi], type, (prop_exists ? dx.memb_dxpl[hi] : H5P_DEFAULT),
+ addr - start_addr, size, _buf);
+} /* end H5FD_multi_read() */
/*-------------------------------------------------------------------------
@@ -1878,45 +1966,54 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *_buf)
+H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, const void *_buf)
{
H5FD_multi_t *file = (H5FD_multi_t*)_file;
- H5FD_multi_dxpl_t *dx=NULL;
- H5FD_mem_t mt, mmt, hi=H5FD_MEM_DEFAULT;
- haddr_t start_addr=0;
+ H5FD_multi_dxpl_t dx;
+ htri_t prop_exists = FALSE; /* Whether the multi VFD DXPL property already exists */
+ H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT;
+ haddr_t start_addr = 0;
+ static const char *func = "H5FD_multi_read"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Get the data transfer properties */
- if(H5P_FILE_ACCESS_DEFAULT != dxpl_id && H5FD_MULTI == H5Pget_driver(dxpl_id))
- dx = (H5FD_multi_dxpl_t *)H5Pget_driver_info(dxpl_id);
+ if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) {
+ /* Check for existence of multi VFD DXPL property in DXPL */
+ if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1)
+
+ /* Get the DXPL value, if it exists */
+ if(prop_exists)
+ if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1)
+ } /* end if */
/* Find the file to which this address belongs */
for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
mmt = file->fa.memb_map[mt];
if(H5FD_MEM_DEFAULT == mmt)
mmt = mt;
- assert(mmt>0 && mmt<H5FD_MEM_NTYPES);
+ assert(mmt > 0 && mmt<H5FD_MEM_NTYPES);
- if (file->fa.memb_addr[mmt]>addr) continue;
- if (file->fa.memb_addr[mmt]>=start_addr) {
+ if(file->fa.memb_addr[mmt] > addr)
+ continue;
+ if(file->fa.memb_addr[mmt] >= start_addr) {
start_addr = file->fa.memb_addr[mmt];
hi = mmt;
- }
- }
- assert(hi>0);
+ } /* end if */
+ } /* end for */
+ assert(hi > 0);
/* Write to that member */
- return H5FDwrite(file->memb[hi], type, dx?dx->memb_dxpl[hi]:H5P_DEFAULT,
- addr-start_addr, size, _buf);
-}
+ return H5FDwrite(file->memb[hi], type, (prop_exists ? dx.memb_dxpl[hi] : H5P_DEFAULT),
+ addr - start_addr, size, _buf);
+} /* end H5FD_multi_write() */
/*-------------------------------------------------------------------------
@@ -1931,8 +2028,6 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 9c19562..64b71d4 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -96,8 +96,6 @@ H5_DLL herr_t H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf)
H5_DLL void *H5FD_fapl_get(H5FD_t *file);
H5_DLL herr_t H5FD_fapl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info);
H5_DLL herr_t H5FD_fapl_close(hid_t driver_id, void *fapl);
-H5_DLL herr_t H5FD_dxpl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info);
-H5_DLL herr_t H5FD_dxpl_close(hid_t driver_id, void *dxpl);
H5_DLL hid_t H5FD_register(const void *cls, size_t size, hbool_t app_ref);
H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index f724471..56db4cb 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1509,7 +1509,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/,
+H5P_get_fill_value(H5P_genplist_t *plist, H5T_t *type, void *value/*out*/,
hid_t dxpl_id)
{
H5O_fill_t fill; /* Fill value to retrieve */
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 6cfd6ac..3a34be1 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -50,49 +50,43 @@
#define H5D_XFER_MAX_TEMP_BUF_SIZE sizeof(size_t)
#define H5D_XFER_MAX_TEMP_BUF_DEF H5D_TEMP_BUF_SIZE
/* Definitions for type conversion buffer property */
-#define H5D_XFER_TCONV_BUF_SIZE sizeof(void *)
-#define H5D_XFER_TCONV_BUF_DEF NULL
+#define H5D_XFER_TCONV_BUF_SIZE sizeof(void *)
+#define H5D_XFER_TCONV_BUF_DEF NULL
/* Definitions for background buffer property */
-#define H5D_XFER_BKGR_BUF_SIZE sizeof(void *)
-#define H5D_XFER_BKGR_BUF_DEF NULL
+#define H5D_XFER_BKGR_BUF_SIZE sizeof(void *)
+#define H5D_XFER_BKGR_BUF_DEF NULL
/* Definitions for background buffer type property */
-#define H5D_XFER_BKGR_BUF_TYPE_SIZE sizeof(H5T_bkg_t)
+#define H5D_XFER_BKGR_BUF_TYPE_SIZE sizeof(H5T_bkg_t)
#define H5D_XFER_BKGR_BUF_TYPE_DEF H5T_BKG_NO
/* Definitions for B-tree node splitting ratio property */
/* (These default B-tree node splitting ratios are also used for splitting
* group's B-trees as well as chunked dataset's B-trees - QAK)
*/
-#define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3])
-#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1, 0.5, 0.9}
+#define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3])
+#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1, 0.5, 0.9}
/* Definitions for vlen allocation function property */
-#define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t)
-#define H5D_XFER_VLEN_ALLOC_DEF H5D_VLEN_ALLOC
+#define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t)
+#define H5D_XFER_VLEN_ALLOC_DEF H5D_VLEN_ALLOC
/* Definitions for vlen allocation info property */
-#define H5D_XFER_VLEN_ALLOC_INFO_SIZE sizeof(void *)
-#define H5D_XFER_VLEN_ALLOC_INFO_DEF H5D_VLEN_ALLOC_INFO
+#define H5D_XFER_VLEN_ALLOC_INFO_SIZE sizeof(void *)
+#define H5D_XFER_VLEN_ALLOC_INFO_DEF H5D_VLEN_ALLOC_INFO
/* Definitions for vlen free function property */
-#define H5D_XFER_VLEN_FREE_SIZE sizeof(H5MM_free_t)
-#define H5D_XFER_VLEN_FREE_DEF H5D_VLEN_FREE
+#define H5D_XFER_VLEN_FREE_SIZE sizeof(H5MM_free_t)
+#define H5D_XFER_VLEN_FREE_DEF H5D_VLEN_FREE
/* Definitions for vlen free info property */
-#define H5D_XFER_VLEN_FREE_INFO_SIZE sizeof(void *)
-#define H5D_XFER_VLEN_FREE_INFO_DEF H5D_VLEN_FREE_INFO
-/* Definitions for file driver ID property */
-#define H5D_XFER_VFL_ID_SIZE sizeof(hid_t)
-#define H5D_XFER_VFL_ID_DEF H5FD_VFD_DEFAULT
-/* Definitions for file driver info property */
-#define H5D_XFER_VFL_INFO_SIZE sizeof(void *)
-#define H5D_XFER_VFL_INFO_DEF NULL
+#define H5D_XFER_VLEN_FREE_INFO_SIZE sizeof(void *)
+#define H5D_XFER_VLEN_FREE_INFO_DEF H5D_VLEN_FREE_INFO
/* Definitions for hyperslab vector size property */
/* (Be cautious about increasing the default size, there are arrays allocated
* on the stack which depend on it - QAK)
*/
-#define H5D_XFER_HYPER_VECTOR_SIZE_SIZE sizeof(size_t)
-#define H5D_XFER_HYPER_VECTOR_SIZE_DEF H5D_IO_VECTOR_SIZE
+#define H5D_XFER_HYPER_VECTOR_SIZE_SIZE sizeof(size_t)
+#define H5D_XFER_HYPER_VECTOR_SIZE_DEF H5D_IO_VECTOR_SIZE
#ifdef H5_HAVE_PARALLEL
/* Definitions for I/O transfer mode property */
-#define H5D_XFER_IO_XFER_MODE_SIZE sizeof(H5FD_mpio_xfer_t)
-#define H5D_XFER_IO_XFER_MODE_DEF H5FD_MPIO_INDEPENDENT
+#define H5D_XFER_IO_XFER_MODE_SIZE sizeof(H5FD_mpio_xfer_t)
+#define H5D_XFER_IO_XFER_MODE_DEF H5FD_MPIO_INDEPENDENT
/* Definitions for optimization of MPI-IO transfer mode property */
#define H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE sizeof(H5FD_mpio_collective_opt_t)
#define H5D_XFER_MPIO_COLLECTIVE_OPT_DEF H5FD_MPIO_COLLECTIVE_IO
@@ -128,9 +122,9 @@
/* Definitions for data transform property */
#define H5D_XFER_XFORM_SIZE sizeof(void *)
#define H5D_XFER_XFORM_DEF NULL
-#define H5D_XFER_XFORM_DEL H5P_dxfr_xform_del
-#define H5D_XFER_XFORM_COPY H5P_dxfr_xform_copy
-#define H5D_XFER_XFORM_CLOSE H5P_dxfr_xform_close
+#define H5D_XFER_XFORM_DEL H5P__dxfr_xform_del
+#define H5D_XFER_XFORM_COPY H5P__dxfr_xform_copy
+#define H5D_XFER_XFORM_CLOSE H5P__dxfr_xform_close
/******************/
/* Local Typedefs */
@@ -147,15 +141,12 @@
/********************/
/* Property class callbacks */
-static herr_t H5P_dxfr_reg_prop(H5P_genclass_t *pclass);
-static herr_t H5P_dxfr_create(hid_t dxpl_id, void *create_data);
-static herr_t H5P_dxfr_copy(hid_t dst_dxpl_id, hid_t src_dxpl_id, void *copy_data);
-static herr_t H5P_dxfr_close(hid_t dxpl_id, void *close_data);
+static herr_t H5P__dxfr_reg_prop(H5P_genclass_t *pclass);
/* Property list callbacks */
-static herr_t H5P_dxfr_xform_del(hid_t prop_id, const char* name, size_t size, void* value);
-static herr_t H5P_dxfr_xform_copy(const char* name, size_t size, void* value);
-static herr_t H5P_dxfr_xform_close(const char* name, size_t size, void* value);
+static herr_t H5P__dxfr_xform_del(hid_t prop_id, const char* name, size_t size, void* value);
+static herr_t H5P__dxfr_xform_copy(const char* name, size_t size, void* value);
+static herr_t H5P__dxfr_xform_close(const char* name, size_t size, void* value);
/*********************/
@@ -169,12 +160,12 @@ const H5P_libclass_t H5P_CLS_DXFR[1] = {{
&H5P_CLS_ROOT_g, /* Parent class ID */
&H5P_CLS_DATASET_XFER_g, /* Pointer to class ID */
&H5P_LST_DATASET_XFER_g, /* Pointer to default property list ID */
- H5P_dxfr_reg_prop, /* Default property registration routine */
- H5P_dxfr_create, /* Class creation callback */
+ H5P__dxfr_reg_prop, /* Default property registration routine */
+ NULL, /* Class creation callback */
NULL, /* Class creation callback info */
- H5P_dxfr_copy, /* Class copy callback */
+ NULL, /* Class copy callback */
NULL, /* Class copy callback info */
- H5P_dxfr_close, /* Class close callback */
+ NULL, /* Class close callback */
NULL /* Class close callback info */
}};
@@ -186,7 +177,7 @@ const H5P_libclass_t H5P_CLS_DXFR[1] = {{
/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_reg_prop
+ * Function: H5P__dxfr_reg_prop
*
* Purpose: Register the data transfer property list class's properties
*
@@ -197,7 +188,7 @@ const H5P_libclass_t H5P_CLS_DXFR[1] = {{
*-------------------------------------------------------------------------
*/
static herr_t
-H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
+H5P__dxfr_reg_prop(H5P_genclass_t *pclass)
{
size_t def_max_temp_buf = H5D_XFER_MAX_TEMP_BUF_DEF; /* Default value for maximum temp buffer size */
void *def_tconv_buf = H5D_XFER_TCONV_BUF_DEF; /* Default value for type conversion buffer */
@@ -208,8 +199,6 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
void *def_vlen_alloc_info = H5D_XFER_VLEN_ALLOC_INFO_DEF; /* Default value for vlen allocation information */
H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; /* Default value for vlen free function */
void *def_vlen_free_info = H5D_XFER_VLEN_FREE_INFO_DEF; /* Default value for vlen free information */
- hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; /* Default value for file driver ID */
- void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; /* Default value for file driver info */
size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; /* Default value for vector size */
haddr_t metadata_tag = H5AC_METADATA_TAG_DEF; /* Default value for metadata tag */
#ifdef H5_HAVE_PARALLEL
@@ -229,7 +218,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Default value for data transform */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Register the max. temp buffer size property */
if(H5P_register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &def_max_temp_buf, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
@@ -271,14 +260,6 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
if(H5P_register_real(pclass, H5D_XFER_VLEN_FREE_INFO_NAME, H5D_XFER_VLEN_FREE_INFO_SIZE, &def_vlen_free_info, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
- /* Register the file driver ID property */
- if(H5P_register_real(pclass, H5D_XFER_VFL_ID_NAME, H5D_XFER_VFL_ID_SIZE, &def_vfl_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
-
- /* Register the file driver info property */
- if(H5P_register_real(pclass, H5D_XFER_VFL_INFO_NAME, H5D_XFER_VFL_INFO_SIZE, &def_vfl_info, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
-
/* Register the vector size property */
if(H5P_register_real(pclass, H5D_XFER_HYPER_VECTOR_SIZE_NAME, H5D_XFER_HYPER_VECTOR_SIZE_SIZE, &def_hyp_vec_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -300,7 +281,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &def_mpio_actual_chunk_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
- /* Register the actual io mode property. */
+ /* Register the actual I/O mode property. */
if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &def_mpio_actual_io_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
@@ -334,157 +315,9 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_reg_prop() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_create
- *
- * Purpose: Callback routine which is called whenever any dataset transfer
- * property list is created. This routine performs any generic
- * initialization needed on the properties the library put into
- * the list.
- * Right now, it's just allocating the driver-specific dataset
- * transfer information.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Thursday, August 2, 2001
- *
- *-------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static herr_t
-H5P_dxfr_create(hid_t dxpl_id, void UNUSED *create_data)
-{
- hid_t driver_id; /* VFL driver ID */
- void *driver_info; /* VFL driver info */
- H5P_genplist_t *plist; /* Property list */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check arguments */
- if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
-
- /* Get the driver information */
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver info")
-
- /* Check if we have a valid driver ID */
- if(driver_id > 0) {
- /* Set the driver for the property list */
- if(H5FD_dxpl_open(plist, driver_id, driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_create() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_copy
- *
- * Purpose: Callback routine which is called whenever any dataset
- * transfer property list is copied. This routine copies
- * the properties from the old list to the new list.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Raymond Lu
- * Tuesday, October 2, 2001
- *
- *-------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static herr_t
-H5P_dxfr_copy(hid_t dst_dxpl_id, hid_t src_dxpl_id, void UNUSED *copy_data)
-{
- hid_t driver_id;
- void* driver_info;
- H5P_genplist_t *dst_plist; /* Destination property list */
- H5P_genplist_t *src_plist; /* Source property list */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
- if(NULL == (src_plist = (H5P_genplist_t *)H5I_object(src_dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
-
- /* Get values from old property list */
- if(H5P_get(src_plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(src_plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info")
-
- if(driver_id > 0) {
- /* Set the driver for the property list */
- if(H5FD_dxpl_open(dst_plist, driver_id, driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_copy() */
+} /* end H5P__dxfr_reg_prop() */
-/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_close
- *
- * Purpose: Callback routine which is called whenever any dataset transfer
- * property list is closed. This routine performs any generic
- * cleanup needed on the properties the library put into the list.
- * Right now, it's just freeing the driver-specific dataset
- * transfer information.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Wednesday, July 11, 2001
- *
- *-------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static herr_t
-H5P_dxfr_close(hid_t dxpl_id, void UNUSED *close_data)
-{
- hid_t driver_id; /* VFL driver ID */
- void *driver_info; /* VFL driver info */
- H5P_genplist_t *plist; /* Property list */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check arguments */
- if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
-
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info")
- if(driver_id > 0) {
- /* Close the driver for the property list */
- if(H5FD_dxpl_close(driver_id, driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_close() */
/*-------------------------------------------------------------------------
@@ -502,11 +335,11 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5P_dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value)
+H5P__dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(value);
@@ -515,11 +348,11 @@ H5P_dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_xform_del() */
+} /* end H5P__dxfr_xform_del() */
/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_xform_copy
+ * Function: H5P__dxfr_xform_copy
*
* Purpose: Creates a copy of the user's data transform string and its
* associated parse tree.
@@ -534,11 +367,11 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5P_dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value)
+H5P__dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(value);
@@ -547,11 +380,11 @@ H5P_dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_xform_copy() */
+} /* end H5P__dxfr_xform_copy() */
/*-------------------------------------------------------------------------
- * Function: H5P_dxfr_xform_close
+ * Function: H5P__dxfr_xform_close
*
* Purpose: Frees memory allocated by H5P_dxfr_xform_set
*
@@ -565,11 +398,11 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5P_dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value)
+H5P__dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(value);
@@ -578,18 +411,15 @@ H5P_dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_dxfr_xform_close() */
+} /* end H5P__dxfr_xform_close() */
/*-------------------------------------------------------------------------
* Function: H5Pset_data_transform
*
- * Purpose:
- * Sets data transform expression.
- *
- *
- * Return: Returns a non-negative value if successful; otherwise returns a negative value.
+ * Purpose: Sets data transform expression.
*
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Leon Arber
* Monday, March 07, 2004
@@ -611,7 +441,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL")
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* See if a data transform is already set, and free it if it is */
@@ -628,9 +458,8 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
done:
if(ret_value < 0) {
- if(data_xform_prop)
- if(H5Z_xform_destroy(data_xform_prop) < 0)
- HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
+ if(data_xform_prop && H5Z_xform_destroy(data_xform_prop) < 0)
+ HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
} /* end if */
FUNC_LEAVE_API(ret_value)
@@ -640,10 +469,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_data_transform
*
- * Purpose:
- * Gets data transform expression.
+ * Purpose: Gets data transform expression.
*
- * Return: Returns a non-negative value if successful; otherwise returns a negative value.
+ * Return: Non-negative on success/Negative on failure
*
* Comments:
* If `expression' is non-NULL then write up to `size' bytes into that
@@ -683,9 +511,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "data transform has not been set")
/* Get the data transform string */
- pexp = H5Z_xform_extract_xform_str(data_xform_prop);
-
- if(!pexp)
+ if(NULL == (pexp = H5Z_xform_extract_xform_str(data_xform_prop)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "failed to retrieve transform expression")
len = HDstrlen(pexp);
@@ -699,9 +525,8 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
done:
if(ret_value < 0) {
- if(data_xform_prop)
- if(H5Z_xform_destroy(data_xform_prop) < 0)
- HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
+ if(data_xform_prop && H5Z_xform_destroy(data_xform_prop) < 0)
+ HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
} /* end if */
FUNC_LEAVE_API(ret_value)
@@ -733,7 +558,7 @@ herr_t
H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iz*x*x", plist_id, size, tconv, bkg);
@@ -784,27 +609,27 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/)
H5TRACE3("z", "ixx", plist_id, tconv, bkg);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, 0, "can't find object for ID")
/* Return values */
- if (tconv)
- if(H5P_get(plist, H5D_XFER_TCONV_BUF_NAME, tconv)<0)
+ if(tconv)
+ if(H5P_get(plist, H5D_XFER_TCONV_BUF_NAME, tconv) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "Can't get transfer type conversion buffer")
- if (bkg)
- if(H5P_get(plist, H5D_XFER_BKGR_BUF_NAME, bkg)<0)
+ if(bkg)
+ if(H5P_get(plist, H5D_XFER_BKGR_BUF_NAME, bkg) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, 0, "Can't get background type conversion buffer")
/* Get the size */
- if(H5P_get(plist, H5D_XFER_MAX_TEMP_BUF_NAME, &size)<0)
+ if(H5P_get(plist, H5D_XFER_MAX_TEMP_BUF_NAME, &size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, 0, "Can't set transfer buffer size")
/* Set the return value */
- ret_value=size;
+ ret_value = size;
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_buffer() */
/*-------------------------------------------------------------------------
@@ -821,32 +646,30 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 17, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_preserve(hid_t plist_id, hbool_t status)
{
- H5T_bkg_t need_bkg; /* Value for background buffer type */
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ H5T_bkg_t need_bkg; /* Value for background buffer type */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ib", plist_id, status);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Update property list */
need_bkg = status ? H5T_BKG_YES : H5T_BKG_NO;
- if (H5P_set(plist,H5D_XFER_BKGR_BUF_TYPE_NAME,&need_bkg)<0)
+ if(H5P_set(plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_preserve() */
/*-------------------------------------------------------------------------
@@ -861,8 +684,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 17, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -876,19 +697,19 @@ H5Pget_preserve(hid_t plist_id)
H5TRACE1("Is", "i", plist_id);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get value */
- if (H5P_get(plist,H5D_XFER_BKGR_BUF_TYPE_NAME,&need_bkg)<0)
+ if(H5P_get(plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
/* Set return value */
- ret_value= need_bkg ? TRUE : FALSE;
+ ret_value = need_bkg ? TRUE : FALSE;
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_preserve() */
/*-------------------------------------------------------------------------
@@ -904,21 +725,19 @@ done:
* Programmer: Raymond Lu
* Jan 3, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iZe", plist_id, check);
/* Check argument */
- if (check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC)
+ if(check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid value")
/* Get the plist structure */
@@ -926,12 +745,12 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Update property list */
- if (H5P_set(plist,H5D_XFER_EDC_NAME,&check)<0)
+ if(H5P_set(plist, H5D_XFER_EDC_NAME, &check) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_edc_check() */
/*-------------------------------------------------------------------------
@@ -947,15 +766,13 @@ done:
* Programmer: Raymond Lu
* Jan 3, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5Z_EDC_t
H5Pget_edc_check(hid_t plist_id)
{
H5P_genplist_t *plist; /* Property list pointer */
- H5Z_EDC_t ret_value; /* return value */
+ H5Z_EDC_t ret_value; /* Return value */
FUNC_ENTER_API(H5Z_ERROR_EDC)
H5TRACE1("Ze", "i", plist_id);
@@ -965,16 +782,12 @@ H5Pget_edc_check(hid_t plist_id)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5Z_ERROR_EDC, "can't find object for ID")
/* Update property list */
- if (H5P_get(plist,H5D_XFER_EDC_NAME,&ret_value)<0)
+ if(H5P_get(plist, H5D_XFER_EDC_NAME, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5Z_ERROR_EDC, "unable to set value")
- /* check valid value */
- if (ret_value != H5Z_ENABLE_EDC && ret_value != H5Z_DISABLE_EDC)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5Z_ERROR_EDC, "not a valid value")
-
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_edc_check() */
/*-------------------------------------------------------------------------
@@ -1117,40 +930,38 @@ done:
* Programmer: Robb Matzke
* Monday, September 28, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/,
- double *right/*out*/)
+ double *right/*out*/)
{
+ H5P_genplist_t *plist; /* Property list pointer */
double btree_split_ratio[3]; /* B-tree node split ratios */
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "ixxx", plist_id, left, middle, right);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get the split ratios */
- if (H5P_get(plist,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&btree_split_ratio)<0)
+ if(H5P_get(plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &btree_split_ratio) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
/* Get values */
- if (left)
+ if(left)
*left = btree_split_ratio[0];
- if (middle)
+ if(middle)
*middle = btree_split_ratio[1];
- if (right)
+ if(right)
*right = btree_split_ratio[2];
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_btree_ratios() */
/*-------------------------------------------------------------------------
@@ -1171,28 +982,26 @@ done:
* Programmer: Robb Matzke
* Monday, September 28, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
- double right)
+ double right)
{
- double split_ratio[3]; /* B-tree node split ratios */
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ double split_ratio[3]; /* B-tree node split ratios */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iddd", plist_id, left, middle, right);
/* Check arguments */
- if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 ||
- right<0.0 || right>1.0)
+ if(left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 ||
+ right < 0.0 || right > 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0")
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
@@ -1201,12 +1010,12 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
split_ratio[2] = right;
/* Set the split ratios */
- if (H5P_set(plist,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&split_ratio)<0)
+ if(H5P_set(plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &split_ratio) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_btree_ratios() */
/*-------------------------------------------------------------------------
@@ -1226,28 +1035,26 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 1, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5P_set_vlen_mem_manager(H5P_genplist_t *plist, H5MM_allocate_t alloc_func,
- void *alloc_info, H5MM_free_t free_func, void *free_info)
+ void *alloc_info, H5MM_free_t free_func, void *free_info)
{
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- assert(plist);
+ HDassert(plist);
/* Update property list */
- if (H5P_set(plist,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_ALLOC_NAME, &alloc_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- if (H5P_set(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_ALLOC_INFO_NAME, &alloc_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- if (H5P_set(plist,H5D_XFER_VLEN_FREE_NAME,&free_func)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_FREE_NAME, &free_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
- if (H5P_set(plist,H5D_XFER_VLEN_FREE_INFO_NAME,&free_info)<0)
+ if(H5P_set(plist, H5D_XFER_VLEN_FREE_INFO_NAME, &free_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
@@ -1272,27 +1079,24 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 1, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func,
- void *alloc_info, H5MM_free_t free_func, void *free_info)
+ void *alloc_info, H5MM_free_t free_func, void *free_info)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func,
- free_info);
+ H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func, free_info);
/* Check arguments */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
/* Update property list */
- if (H5P_set_vlen_mem_manager(plist,alloc_func,alloc_info,free_func,free_info)<0)
+ if(H5P_set_vlen_mem_manager(plist, alloc_func, alloc_info, free_func, free_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set values")
done:
@@ -1310,42 +1114,38 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 1, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/,
- void **alloc_info/*out*/,
- H5MM_free_t *free_func/*out*/,
- void **free_info/*out*/)
+ void **alloc_info/*out*/, H5MM_free_t *free_func/*out*/, void **free_info/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ixxxx", plist_id, alloc_func, alloc_info, free_func, free_info);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- if(alloc_func!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,alloc_func)<0)
+ if(alloc_func)
+ if(H5P_get(plist, H5D_XFER_VLEN_ALLOC_NAME, alloc_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
- if(alloc_info!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,alloc_info)<0)
+ if(alloc_info)
+ if(H5P_get(plist, H5D_XFER_VLEN_ALLOC_INFO_NAME, alloc_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
- if(free_func!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_FREE_NAME,free_func)<0)
+ if(free_func)
+ if(H5P_get(plist, H5D_XFER_VLEN_FREE_NAME, free_func) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
- if(free_info!=NULL)
- if (H5P_get(plist,H5D_XFER_VLEN_FREE_INFO_NAME,free_info)<0)
+ if(free_info)
+ if(H5P_get(plist, H5D_XFER_VLEN_FREE_INFO_NAME, free_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_vlen_mem_manager() */
/*-------------------------------------------------------------------------
@@ -1367,29 +1167,27 @@ done:
* Programmer: Quincey Koziol
* Monday, July 9, 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iz", plist_id, vector_size);
/* Check arguments */
- if (vector_size<1)
+ if(vector_size < 1)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "vector size too small")
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Update property list */
- if (H5P_set(plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0)
+ if(H5P_set(plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &vector_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
done:
@@ -1407,34 +1205,32 @@ done:
* Programmer: Quincey Koziol
* Monday, July 9, 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", plist_id, vector_size);
/* Get the plist structure */
- if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Return values */
- if (vector_size)
- if (H5P_get(plist,H5D_XFER_HYPER_VECTOR_SIZE_NAME,vector_size)<0)
+ if(vector_size)
+ if(H5P_get(plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, vector_size) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_hyper_vector_size() */
-
#ifdef H5_HAVE_PARALLEL
+
/*-------------------------------------------------------------------------
* Function: H5Pget_mpio_actual_chunk_opt_mode
*
@@ -1444,6 +1240,7 @@ done:
*
* Programmer: Jacob Gruber
* Wednesday, May 4, 2011
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1479,6 +1276,7 @@ done:
*
* Programmer: Jacob Gruber
* Wednesday, May 4, 2011
+ *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 9b5d1b0..adf1364 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -544,47 +544,40 @@ done:
* Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/,
- hsize_t *alignment/*out*/)
+ hsize_t *alignment/*out*/)
{
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", fapl_id, threshold, alignment);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (threshold)
+ if(threshold)
if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, threshold) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get threshold");
- if (alignment)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get threshold")
+ if(alignment)
if(H5P_get(plist, H5F_ACS_ALIGN_NAME, alignment) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_alignment() */
/*-------------------------------------------------------------------------
* Function: H5P_set_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access or data
- * transfer property list (PLIST_ID) and supply an optional
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
* struct containing the driver-specific properites
* (DRIVER_INFO). The driver properties will be copied into the
* property list and the reference count on the driver will be
@@ -592,19 +585,11 @@ done:
* still use the property list.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -612,7 +597,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
{
hid_t driver_id; /* VFL driver ID */
void *driver_info; /* VFL driver info */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -627,29 +612,15 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL,"can't get driver info")
/* Close the driver for the property list */
- if(H5FD_fapl_close(driver_id, driver_info)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
-
- /* Set the driver for the property list */
- if(H5FD_fapl_open(plist, new_driver_id, new_driver_info)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } else if(TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER)) {
- /* Get the current driver information */
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver info")
-
- /* Close the driver for the property list */
- if(H5FD_dxpl_close(driver_id, driver_info) < 0)
+ if(H5FD_fapl_close(driver_id, driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
/* Set the driver for the property list */
- if(H5FD_dxpl_open(plist, new_driver_id, new_driver_info) < 0)
+ if(H5FD_fapl_open(plist, new_driver_id, new_driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list")
- }
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -659,8 +630,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access or data
- * transfer property list (PLIST_ID) and supply an optional
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
* struct containing the driver-specific properites
* (DRIVER_INFO). The driver properties will be copied into the
* property list and the reference count on the driver will be
@@ -668,19 +639,11 @@ done:
* still use the property list.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -711,7 +674,7 @@ done:
* Function: H5P_get_driver
*
* Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list or data transfer propert list.
+ * be a file access property list.
*
* Return: Success: A low-level driver ID which is the same ID
* used when the driver was set for the property
@@ -723,54 +686,36 @@ done:
* Programmer: Robb Matzke
* Thursday, February 26, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-03
- * Rewritten to use the virtual file layer.
- *
- * Robb Matzke, 1999-08-05
- * If the driver ID is H5FD_VFD_DEFAULT then substitute the
- * current value of H5FD_SEC2.
- *
- * Quincey Koziol 2000-11-28
- * Added internal function..
- *
- * Raymond Lu, 2001-10-23
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
hid_t
H5P_get_driver(H5P_genplist_t *plist)
{
- hid_t ret_value=FAIL; /* Return value */
+ hid_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Get the current driver ID */
- if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID");
- } else if( TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER) ) {
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &ret_value)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
-
- if (H5FD_VFD_DEFAULT==ret_value)
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+
+ if(H5FD_VFD_DEFAULT == ret_value)
ret_value = H5_DEFAULT_VFD;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_driver() */
/*-------------------------------------------------------------------------
* Function: H5Pget_driver
*
* Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list or data transfer propert list.
+ * be a file access property list.
*
* Return: Success: A low-level driver ID which is the same ID
* used when the driver was set for the property
@@ -782,16 +727,6 @@ done:
* Programmer: Robb Matzke
* Thursday, February 26, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-03
- * Rewritten to use the virtual file layer.
- *
- * Robb Matzke, 1999-08-05
- * If the driver ID is H5FD_VFD_DEFAULT then substitute the current value of
- * H5FD_SEC2.
- *
- * Quincey Koziol 2000-11-28
- * Added internal function..
*-------------------------------------------------------------------------
*/
hid_t
@@ -806,7 +741,9 @@ H5Pget_driver(hid_t plist_id)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
- ret_value = H5P_get_driver(plist);
+ /* Get the driver */
+ if((ret_value = H5P_get_driver(plist)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver")
done:
FUNC_LEAVE_API(ret_value)
@@ -817,7 +754,7 @@ done:
* Function: H5P_get_driver_info
*
* Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access or data transfer property list.
+ * information of a file access.
*
* Return: Success: Ptr to *uncopied* driver specific data
* structure if any.
@@ -830,32 +767,22 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
void *
H5P_get_driver_info(H5P_genplist_t *plist)
{
- void *ret_value=NULL;
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
/* Get the current driver info */
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_INFO_NAME, &ret_value) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,NULL,"can't get driver info");
- } else if( TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER) ) {
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &ret_value)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, NULL, "Can't retrieve VFL driver ID");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver info")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -866,7 +793,7 @@ done:
* Function: H5Pget_driver_info
*
* Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access or data transfer property list.
+ * information of a file access.
*
* Return: Success: Ptr to *uncopied* driver specific data
* structure if any.
@@ -879,26 +806,20 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
void *
H5Pget_driver_info(hid_t plist_id)
{
H5P_genplist_t *plist; /* Property list pointer */
- void *ret_value; /* Return value */
+ void *ret_value; /* Return value */
FUNC_ENTER_API(NULL)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list")
+ /* Get the driver info */
if(NULL == (ret_value = H5P_get_driver_info(plist)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver info")
@@ -915,37 +836,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_family_offset(hid_t fapl_id, hsize_t offset)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ih", fapl_id, offset);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_set_family_offset(plist, offset)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if((ret_value = H5P_set_family_offset(plist, offset)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_family_offset() */
/*-------------------------------------------------------------------------
@@ -955,33 +874,30 @@ done:
* H5Pset_family_offset
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_set(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_set_family_offset() */
/*-------------------------------------------------------------------------
@@ -992,37 +908,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_family_offset(hid_t fapl_id, hsize_t *offset)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*h", fapl_id, offset);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_get_family_offset(plist, offset)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if((ret_value = H5P_get_family_offset(plist, offset)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_family_offset() */
/*-------------------------------------------------------------------------
@@ -1032,33 +946,30 @@ done:
* H5Pget_family_offset
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_family_offset() */
/*-------------------------------------------------------------------------
@@ -1069,14 +980,11 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1090,16 +998,17 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_set_multi_type(plist, type)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if((ret_value = H5P_set_multi_type(plist, type)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_multi_type() */
/*-------------------------------------------------------------------------
@@ -1109,33 +1018,30 @@ done:
* H5Pset_multi_type.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_set(plist, H5F_ACS_MULTI_TYPE_NAME, &type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set type for multi driver");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set type for multi driver")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_set_multi_type() */
/*-------------------------------------------------------------------------
@@ -1146,37 +1052,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*Mt", fapl_id, type);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_get_multi_type(plist, type)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if((ret_value = H5P_get_multi_type(plist, type)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_multi_type() */
/*-------------------------------------------------------------------------
@@ -1186,33 +1090,30 @@ done:
* H5Pget_multi_type.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get type for multi driver")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_multi_type() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h
index 6ebca3e..849a533 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -121,7 +121,7 @@ H5_DLL size_t H5P_peek_size_t(H5P_genplist_t *plist, const char *name);
/* Private DCPL routines */
H5_DLL herr_t H5P_fill_value_defined(H5P_genplist_t *plist,
H5D_fill_value_t *status);
-H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type,
+H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, H5T_t *type,
void *value, hid_t dxpl_id);
#endif /* _H5Pprivate_H */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index e6ae53e..1538765 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c