forked from Unidata/netcdf-c
/
ncx.h
753 lines (681 loc) · 23 KB
/
ncx.h
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
/*
* Copyright 1996, University Corporation for Atmospheric Research
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
/* "$Id: ncx.h,v 1.65 2010/05/26 18:11:08 dmh Exp $" */
#ifndef _NCX_H_
#define _NCX_H_
#include "ncdispatch.h"
#include "ncio.h"
#include "fbits.h"
/*
* An external data representation interface.
*
* This started out as a general replacement for ONC XDR,
* specifically, the xdrmem family of functions.
*
* We eventually realized that we could write more portable
* code if we decoupled any association between the 'C' types
* and the external types. (XDR has this association between the 'C'
* types and the external representations, like xdr_int() takes
* an int argument and goes to an external int representation.)
* So, now there is a matrix of functions.
*
*/
#include <config.h> /* output of 'configure' */
#include "rnd.h"
#include <stddef.h> /* size_t */
#include <errno.h>
#include <sys/types.h> /* off_t */
#include <ncdispatch.h>
#define longlong long long
#if defined(_CRAY) && !defined(_CRAYIEEE) && !defined(__crayx1)
#define CRAYFLOAT 1 /* CRAY Floating point */
#elif defined(_SX) && defined(_FLOAT2) /* NEC SUPER-UX in CRAY mode */
#define CRAYFLOAT 1 /* CRAY Floating point */
#endif
/*
* The integer return code for the conversion routines
* is 0 (ENOERR) when no error occured, or NC_ERANGE as appropriate
* for an overflow conversion.
*/
#ifndef ENOERR
#define ENOERR 0
#endif
#ifndef NC_ERANGE
#define NC_ERANGE (-60) /* N.B. must match value in netcdf.h */
#endif
#ifndef NC_ENOMEM
#define NC_ENOMEM (-61) /* N.B. must match value in netcdf.h */
#endif
/*
* External sizes of the primitive elements.
*/
#define X_SIZEOF_CHAR 1
#define X_SIZEOF_SHORT 2
#define X_SIZEOF_INT 4 /* xdr_int */
#if 0
#define X_SIZEOF_LONG 8 */ /* xdr_long_long */
#endif
#define X_SIZEOF_FLOAT 4
#define X_SIZEOF_DOUBLE 8
/*
* For now, netcdf is limited to 32 bit sizes,
* If compiled with support for "large files", then
* netcdf will use a 64 bit off_t and it can then write a file
* using 64 bit offsets.
* see also X_SIZE_MAX, X_OFF_MAX below
*/
#define X_SIZEOF_OFF_T (sizeof(off_t))
#define X_SIZEOF_SIZE_T X_SIZEOF_INT
/*
* limits of the external representation
*/
#define X_SCHAR_MIN (-128)
#define X_SCHAR_MAX 127
#define X_UCHAR_MAX 255U
#define X_SHORT_MIN (-32768)
#define X_SHRT_MIN X_SHORT_MIN /* alias compatible with limits.h */
#define X_SHORT_MAX 32767
#define X_SHRT_MAX X_SHORT_MAX /* alias compatible with limits.h */
#define X_USHORT_MAX 65535U
#define X_USHRT_MAX X_USHORT_MAX /* alias compatible with limits.h */
#define X_INT_MIN (-2147483647-1)
#define X_INT_MAX 2147483647
#define X_UINT_MAX 4294967295U
#define X_LONGLONG_MIN (-9223372036854775807LL-1LL)
#define X_LONGLONG_MAX 9223372036854775807LL
#define X_ULONGLONG_MAX 18446744073709551615ULL
#define X_FLOAT_MAX 3.402823466e+38f
#define X_FLOAT_MIN (-X_FLOAT_MAX)
#define X_FLT_MAX X_FLOAT_MAX /* alias compatible with limits.h */
#if CRAYFLOAT
/* ldexp(1. - ldexp(.5 , -46), 1024) */
#define X_DOUBLE_MAX 1.79769313486230e+308
#else
/* scalb(1. - scalb(.5 , -52), 1024) */
#define X_DOUBLE_MAX 1.7976931348623157e+308
#endif
#define X_DOUBLE_MIN (-X_DOUBLE_MAX)
#define X_DBL_MAX X_DOUBLE_MAX /* alias compatible with limits.h */
#define X_SIZE_MAX X_UINT_MAX
#define X_OFF_MAX X_INT_MAX
/* Begin ncx_len */
/*
* ncx_len_xxx() interfaces are defined as macros below,
* These give the length of an array of nelems of the type.
* N.B. The 'char' and 'short' interfaces give the X_ALIGNED length.
*/
#define X_ALIGN 4 /* a.k.a. BYTES_PER_XDR_UNIT */
#define ncx_len_char(nelems) \
_RNDUP((nelems), X_ALIGN)
#define ncx_len_short(nelems) \
(((nelems) + (nelems)%2) * X_SIZEOF_SHORT)
#define ncx_len_int(nelems) \
((nelems) * X_SIZEOF_INT)
#define ncx_len_long(nelems) \
((nelems) * X_SIZEOF_LONG)
#define ncx_len_float(nelems) \
((nelems) * X_SIZEOF_FLOAT)
#define ncx_len_double(nelems) \
((nelems) * X_SIZEOF_DOUBLE)
/* End ncx_len */
#if __CHAR_UNSIGNED__
/* 'char' is unsigned, declare ncbyte as 'signed char' */
typedef signed char schar;
#else
/* 'char' is signed */
typedef signed char schar;
#endif /* __CHAR_UNSIGNED__ */
/*
* Primitive numeric conversion functions.
* The `put' functions convert from native internal
* type to the external type, while the `get' functions
* convert from the external to the internal.
*
* These take the form
* int ncx_get_{external_type}_{internal_type}(
* const void *xp,
* internal_type *ip
* );
* int ncx_put_{external_type}_{internal_type}(
* void *xp,
* const internal_type *ip
* );
* where
* `external_type' and `internal_type' chosen from
schar
uchar
short
ushort
int
uint
long
ulong
float
double
*
* Not all combinations make sense.
* We may not implement all combinations that make sense.
* The netcdf functions that use this ncx interface don't
* use these primitive conversion functions. They use the
* aggregate conversion functions declared below.
*
* Storage for a single element of external type is at the `void * xp'
* argument.
*
* Storage for a single element of internal type is at `ip' argument.
*
* These functions return 0 (ENOERR) when no error occured,
* or NC_ERANGE when the value being converted is too large.
* When NC_ERANGE occurs, an undefined (implementation dependent)
* conversion may have occured.
*
* Note that loss of precision may occur silently.
*
*/
#if 0
extern int
ncx_get_schar_schar(const void *xp, schar *ip);
extern int
ncx_get_schar_uchar(const void *xp, uchar *ip);
extern int
ncx_get_schar_short(const void *xp, short *ip);
extern int
ncx_get_schar_int(const void *xp, int *ip);
extern int
ncx_get_schar_long(const void *xp, long *ip);
extern int
ncx_get_schar_float(const void *xp, float *ip);
extern int
ncx_get_schar_double(const void *xp, double *ip);
extern int
ncx_put_schar_schar(void *xp, const schar *ip);
extern int
ncx_put_schar_uchar(void *xp, const uchar *ip);
extern int
ncx_put_schar_short(void *xp, const short *ip);
extern int
ncx_put_schar_int(void *xp, const int *ip);
extern int
ncx_put_schar_long(void *xp, const long *ip);
extern int
ncx_put_schar_float(void *xp, const float *ip);
extern int
ncx_put_schar_double(void *xp, const double *ip);
#endif
extern int
ncx_get_short_schar(const void *xp, schar *ip);
extern int
ncx_get_short_uchar(const void *xp, uchar *ip);
extern int
ncx_get_short_short(const void *xp, short *ip);
extern int
ncx_get_short_int(const void *xp, int *ip);
extern int
ncx_get_short_long(const void *xp, long *ip);
extern int
ncx_get_short_float(const void *xp, float *ip);
extern int
ncx_get_short_double(const void *xp, double *ip);
extern int
ncx_put_short_schar(void *xp, const schar *ip);
extern int
ncx_put_short_uchar(void *xp, const uchar *ip);
extern int
ncx_put_short_short(void *xp, const short *ip);
extern int
ncx_put_short_int(void *xp, const int *ip);
extern int
ncx_put_short_long(void *xp, const long *ip);
extern int
ncx_put_short_float(void *xp, const float *ip);
extern int
ncx_put_short_double(void *xp, const double *ip);
extern int
ncx_get_int_schar(const void *xp, schar *ip);
extern int
ncx_get_int_uchar(const void *xp, uchar *ip);
extern int
ncx_get_int_short(const void *xp, short *ip);
extern int
ncx_get_int_int(const void *xp, int *ip);
extern int
ncx_get_int_long(const void *xp, long *ip);
extern int
ncx_get_int_float(const void *xp, float *ip);
extern int
ncx_get_int_double(const void *xp, double *ip);
extern int
ncx_put_int_schar(void *xp, const schar *ip);
extern int
ncx_put_int_uchar(void *xp, const uchar *ip);
extern int
ncx_put_int_short(void *xp, const short *ip);
extern int
ncx_put_int_int(void *xp, const int *ip);
extern int
ncx_put_int_long(void *xp, const long *ip);
extern int
ncx_put_int_float(void *xp, const float *ip);
extern int
ncx_put_int_double(void *xp, const double *ip);
extern int
ncx_get_float_schar(const void *xp, schar *ip);
extern int
ncx_get_float_uchar(const void *xp, uchar *ip);
extern int
ncx_get_float_short(const void *xp, short *ip);
extern int
ncx_get_float_int(const void *xp, int *ip);
extern int
ncx_get_float_long(const void *xp, long *ip);
extern int
ncx_get_float_float(const void *xp, float *ip);
extern int
ncx_get_float_double(const void *xp, double *ip);
extern int
ncx_put_float_schar(void *xp, const schar *ip);
extern int
ncx_put_float_uchar(void *xp, const uchar *ip);
extern int
ncx_put_float_short(void *xp, const short *ip);
extern int
ncx_put_float_int(void *xp, const int *ip);
extern int
ncx_put_float_long(void *xp, const long *ip);
extern int
ncx_put_float_float(void *xp, const float *ip);
extern int
ncx_put_float_double(void *xp, const double *ip);
extern int
ncx_get_double_schar(const void *xp, schar *ip);
extern int
ncx_get_double_uchar(const void *xp, uchar *ip);
extern int
ncx_get_double_short(const void *xp, short *ip);
extern int
ncx_get_double_int(const void *xp, int *ip);
extern int
ncx_get_double_long(const void *xp, long *ip);
extern int
ncx_get_double_float(const void *xp, float *ip);
extern int
ncx_get_double_double(const void *xp, double *ip);
extern int
ncx_put_double_schar(void *xp, const schar *ip);
extern int
ncx_put_double_uchar(void *xp, const uchar *ip);
extern int
ncx_put_double_short(void *xp, const short *ip);
extern int
ncx_put_double_int(void *xp, const int *ip);
extern int
ncx_put_double_long(void *xp, const long *ip);
extern int
ncx_put_double_float(void *xp, const float *ip);
extern int
ncx_put_double_double(void *xp, const double *ip);
/*
* Other primitive conversion functions
* N.B. slightly different interface
* Used by netcdf.
*/
/* ncx_get_int_size_t */
extern int
ncx_get_size_t(const void **xpp, size_t *ulp);
/* ncx_get_int_off_t */
extern int
ncx_get_off_t(const void **xpp, off_t *lp, size_t sizeof_off_t);
/* ncx_put_int_size_t */
extern int
ncx_put_size_t(void **xpp, const size_t *ulp);
/* ncx_put_int_off_t */
extern int
ncx_put_off_t(void **xpp, const off_t *lp, size_t sizeof_off_t);
/*
* Aggregate numeric conversion functions.
* Convert an array. Replaces xdr_array(...).
* These functions are used by netcdf. Unlike the xdr
* interface, we optimize for aggregate conversions.
* This functions should be implemented to take advantage
* of multiple processor / parallel hardware where available.
*
* These take the form
* int ncx_getn_{external_type}_{internal_type}(
* const void *xpp,
* size_t nelems,
* internal_type *ip
* );
* int ncx_putn_{external_type}_{internal_type}(
* void **xpp,
* size_t nelems,
* const internal_type *ip
* );
* Where the types are as in the primitive numeric conversion functions.
*
* The value of the pointer to pointer argument, *xpp, is
* expected to reference storage for `nelems' of the external
* type. On return, it modified to reference just past the last
* converted external element.
*
* The types whose external size is less than X_ALIGN also have `pad'
* interfaces. These round (and zero fill on put) *xpp up to X_ALIGN
* boundaries. (This is the usual xdr behavior.)
*
* The `ip' argument should point to an array of `nelems' of
* internal_type.
*
* Range errors (NC_ERANGE) for a individual values in the array
* DO NOT terminate the array conversion. All elements are converted,
* with some having undefined values.
* If any range error occurs, the function returns NC_ERANGE.
*
*/
extern int
ncx_getn_schar_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_getn_schar_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_getn_schar_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_getn_schar_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_getn_schar_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_getn_schar_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_getn_schar_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_getn_schar_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_getn_schar_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_getn_schar_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_pad_getn_schar_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_pad_getn_schar_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_pad_getn_schar_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_pad_getn_schar_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_pad_getn_schar_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_pad_getn_schar_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_pad_getn_schar_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_pad_getn_schar_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_pad_getn_schar_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_pad_getn_schar_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_putn_schar_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_putn_schar_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_putn_schar_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_putn_schar_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_putn_schar_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_putn_schar_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_putn_schar_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_putn_schar_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_putn_schar_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_putn_schar_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
extern int
ncx_pad_putn_schar_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_pad_putn_schar_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_pad_putn_schar_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_pad_putn_schar_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_pad_putn_schar_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_pad_putn_schar_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_pad_putn_schar_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_pad_putn_schar_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_pad_putn_schar_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_pad_putn_schar_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
extern int
ncx_getn_short_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_getn_short_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_getn_short_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_getn_short_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_getn_short_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_getn_short_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_getn_short_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_getn_short_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_getn_short_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_getn_short_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_pad_getn_short_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_pad_getn_short_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_pad_getn_short_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_pad_getn_short_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_pad_getn_short_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_pad_getn_short_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_pad_getn_short_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_pad_getn_short_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_pad_getn_short_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_pad_getn_short_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_putn_short_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_putn_short_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_putn_short_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_putn_short_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_putn_short_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_putn_short_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_putn_short_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_putn_short_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_putn_short_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_putn_short_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
extern int
ncx_pad_putn_short_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_pad_putn_short_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_pad_putn_short_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_pad_putn_short_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_pad_putn_short_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_pad_putn_short_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_pad_putn_short_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_pad_putn_short_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_pad_putn_short_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_pad_putn_short_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
extern int
ncx_getn_int_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_getn_int_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_getn_int_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_getn_int_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_getn_int_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_getn_int_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_getn_int_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_getn_int_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_getn_int_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_getn_int_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_putn_int_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_putn_int_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_putn_int_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_putn_int_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_putn_int_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_putn_int_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_putn_int_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_putn_int_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_putn_int_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_putn_int_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
extern int
ncx_getn_float_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_getn_float_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_getn_float_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_getn_float_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_getn_float_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_getn_float_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_getn_float_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_getn_float_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_getn_float_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_getn_float_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_putn_float_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_putn_float_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_putn_float_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_putn_float_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_putn_float_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_putn_float_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_putn_float_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_putn_float_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_putn_float_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_putn_float_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
extern int
ncx_getn_double_schar(const void **xpp, size_t nelems, schar *ip);
extern int
ncx_getn_double_uchar(const void **xpp, size_t nelems, uchar *ip);
extern int
ncx_getn_double_short(const void **xpp, size_t nelems, short *ip);
extern int
ncx_getn_double_int(const void **xpp, size_t nelems, int *ip);
extern int
ncx_getn_double_long(const void **xpp, size_t nelems, long *ip);
extern int
ncx_getn_double_float(const void **xpp, size_t nelems, float *ip);
extern int
ncx_getn_double_double(const void **xpp, size_t nelems, double *ip);
extern int
ncx_getn_double_uint(const void **xpp, size_t nelems, unsigned int *ip);
extern int
ncx_getn_double_longlong(const void **xpp, size_t nelems, longlong *ip);
extern int
ncx_getn_double_ulonglong(const void **xpp, size_t nelems, ulonglong *ip);
extern int
ncx_putn_double_schar(void **xpp, size_t nelems, const schar *ip);
extern int
ncx_putn_double_uchar(void **xpp, size_t nelems, const uchar *ip);
extern int
ncx_putn_double_short(void **xpp, size_t nelems, const short *ip);
extern int
ncx_putn_double_int(void **xpp, size_t nelems, const int *ip);
extern int
ncx_putn_double_long(void **xpp, size_t nelems, const long *ip);
extern int
ncx_putn_double_float(void **xpp, size_t nelems, const float *ip);
extern int
ncx_putn_double_double(void **xpp, size_t nelems, const double *ip);
extern int
ncx_putn_double_uint(void **xpp, size_t nelems, const unsigned int *ip);
extern int
ncx_putn_double_longlong(void **xpp, size_t nelems, const longlong *ip);
extern int
ncx_putn_double_ulonglong(void **xpp, size_t nelems, const ulonglong *ip);
/*
* Other aggregate conversion functions.
*/
/* read ASCII characters */
extern int
ncx_getn_text(const void **xpp, size_t nchars, char *cp);
extern int
ncx_pad_getn_text(const void **xpp, size_t nchars, char *cp);
/* write ASCII characters */
extern int
ncx_putn_text(void **xpp, size_t nchars, const char *cp);
extern int
ncx_pad_putn_text(void **xpp, size_t nchars, const char *cp);
/* for symmetry */
#define ncx_getn_char_char(xpp, nelems, fillp) ncx_getn_text(xpp, nelems, fillp)
#define ncx_putn_char_char(xpp, nelems, fillp) ncx_putn_text(xpp, nelems, fillp)
/* read opaque data */
extern int
ncx_getn_void(const void **xpp, size_t nchars, void *vp);
extern int
ncx_pad_getn_void(const void **xpp, size_t nchars, void *vp);
/* write opaque data */
extern int
ncx_putn_void(void **xpp, size_t nchars, const void *vp);
extern int
ncx_pad_putn_void(void **xpp, size_t nchars, const void *vp);
#endif /* _NCX_H_ */