ncdf4a13/libsrc/ncx.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright 1996, University Corporation for Atmospheric Research
00003  *      See netcdf/COPYRIGHT file for copying and redistribution conditions.
00004  */
00005 /* "$Id: ncx.h,v 1.58 2005/02/07 03:56:02 ed Exp $" */
00006 
00007 #ifndef _NCX_H_
00008 #define _NCX_H_
00009 
00010 /*
00011  * An external data representation interface.
00012  *
00013  * This started out as a general replacement for ONC XDR,
00014  * specifically, the xdrmem family of functions.
00015  * 
00016  * We eventually realized that we could write more portable
00017  * code if we decoupled any association between the 'C' types
00018  * and the external types. (XDR has this association between the 'C'
00019  * types and the external representations, like xdr_int() takes
00020  * an int argument and goes to an external int representation.) 
00021  * So, now there is a matrix of functions.
00022  * 
00023  */
00024 
00025 #include <config.h> /* output of 'configure' */
00026 #include "rnd.h"
00027 #include <stddef.h> /* size_t */
00028 #include <errno.h>
00029 #include <sys/types.h> /* off_t */
00030 
00031 #if defined(_CRAY) && !defined(_CRAYIEEE)
00032 #define CRAYFLOAT 1 /* CRAY Floating point */
00033 #elif defined(_SX) && defined(_FLOAT2)  /* NEC SUPER-UX in CRAY mode */
00034 #define CRAYFLOAT 1 /* CRAY Floating point */
00035 #endif
00036 
00037 
00038 #if defined(DLL_NETCDF) /* define when library is a DLL */
00039 #include <io.h>
00040 #define lseek _lseeki64
00041 #define off_t __int64
00042 #endif  /* defined(DLL_NETCDF) */
00043 
00044 /*
00045  * The integer return code for the conversion routines
00046  * is 0 (ENOERR) when no error occured, or NC_ERANGE as appropriate
00047  * for an overflow conversion.
00048  */
00049 #ifndef ENOERR
00050 #define ENOERR 0
00051 #endif
00052 #ifndef NC_ERANGE
00053 #define NC_ERANGE (-60) /* N.B. must match value in netcdf.h */
00054 #endif
00055 #ifndef NC_ENOMEM
00056 #define NC_ENOMEM (-61) /* N.B. must match value in netcdf.h */
00057 #endif
00058 
00059 
00060 /*
00061  * External sizes of the primitive elements.
00062  */
00063 #define X_SIZEOF_CHAR           1
00064 #define X_SIZEOF_SHORT          2
00065 #define X_SIZEOF_INT            4       /* xdr_int */
00066 #if 0
00067 #define X_SIZEOF_LONG           8 */    /* xdr_long_long */
00068 #endif
00069 #define X_SIZEOF_FLOAT          4
00070 #define X_SIZEOF_DOUBLE         8
00071 
00072 /*
00073  * For now, netcdf is limited to 32 bit sizes,
00074  * If compiled with support for "large files", then
00075  * netcdf will use a 64 bit off_t and it can then write a file
00076  * using 64 bit offsets. 
00077  *  see also X_SIZE_MAX, X_OFF_MAX below
00078  */
00079 #define X_SIZEOF_OFF_T          (sizeof(off_t))
00080 #define X_SIZEOF_SIZE_T         X_SIZEOF_INT
00081 
00082 /*
00083  * limits of the external representation
00084  */
00085 #define X_SCHAR_MIN     (-128)
00086 #define X_SCHAR_MAX     127
00087 #define X_UCHAR_MAX     255U
00088 #define X_SHORT_MIN     (-32768)
00089 #define X_SHRT_MIN      X_SHORT_MIN     /* alias compatible with limits.h */
00090 #define X_SHORT_MAX     32767
00091 #define X_SHRT_MAX      X_SHORT_MAX     /* alias compatible with limits.h */
00092 #define X_USHORT_MAX    65535U
00093 #define X_USHRT_MAX     X_USHORT_MAX    /* alias compatible with limits.h */
00094 #define X_INT_MIN       (-2147483647-1)
00095 #define X_INT_MAX       2147483647
00096 #define X_UINT_MAX      4294967295U
00097 #define X_FLOAT_MAX     3.402823466e+38f
00098 #define X_FLOAT_MIN     (-X_FLOAT_MAX)
00099 #define X_FLT_MAX       X_FLOAT_MAX     /* alias compatible with limits.h */
00100 #if CRAYFLOAT
00101 /* ldexp(1. - ldexp(.5 , -46), 1024) */
00102 #define X_DOUBLE_MAX    1.79769313486230e+308
00103 #else
00104 /* scalb(1. - scalb(.5 , -52), 1024) */
00105 #define X_DOUBLE_MAX    1.7976931348623157e+308 
00106 #endif
00107 #define X_DOUBLE_MIN    (-X_DOUBLE_MAX)
00108 #define X_DBL_MAX       X_DOUBLE_MAX    /* alias compatible with limits.h */
00109 
00110 #define X_SIZE_MAX      X_UINT_MAX
00111 #define X_OFF_MAX       X_INT_MAX
00112 
00113 
00114 /* Begin ncx_len */
00115 
00116 /*
00117  * ncx_len_xxx() interfaces are defined as macros below, 
00118  * These give the length of an array of nelems of the type.
00119  * N.B. The 'char' and 'short' interfaces give the X_ALIGNED length.
00120  */
00121 #define X_ALIGN                 4       /* a.k.a. BYTES_PER_XDR_UNIT */
00122 
00123 #define ncx_len_char(nelems) \
00124         _RNDUP((nelems), X_ALIGN)
00125 
00126 #define ncx_len_short(nelems) \
00127         (((nelems) + (nelems)%2)  * X_SIZEOF_SHORT)
00128 
00129 #define ncx_len_int(nelems) \
00130         ((nelems) * X_SIZEOF_INT)
00131 
00132 #define ncx_len_long(nelems) \
00133         ((nelems) * X_SIZEOF_LONG)
00134 
00135 #define ncx_len_float(nelems) \
00136         ((nelems) * X_SIZEOF_FLOAT)
00137 
00138 #define ncx_len_double(nelems) \
00139         ((nelems) * X_SIZEOF_DOUBLE)
00140 
00141 /* End ncx_len */
00142 
00143 #if __CHAR_UNSIGNED__
00144         /* 'char' is unsigned, declare ncbyte as 'signed char' */
00145 typedef signed char schar;
00146 
00147 #else
00148         /* 'char' is signed */
00149 typedef signed char schar;
00150 
00151 #endif  /* __CHAR_UNSIGNED__ */
00152 
00153 /*
00154  * Primitive numeric conversion functions.
00155  * The `put' functions convert from native internal
00156  * type to the external type, while the `get' functions
00157  * convert from the external to the internal.
00158  *
00159  * These take the form
00160  *      int ncx_get_{external_type}_{internal_type}(
00161  *              const void *xp,
00162  *              internal_type *ip
00163  *      );
00164  *      int ncx_put_{external_type}_{internal_type}(
00165  *              void *xp,
00166  *              const internal_type *ip
00167  *      );
00168  * where
00169  *      `external_type' and `internal_type' chosen from
00170                 schar
00171                 uchar
00172                 short
00173                 ushort
00174                 int
00175                 uint
00176                 long
00177                 ulong
00178                 float
00179                 double
00180  *
00181  * Not all combinations make sense.
00182  * We may not implement all combinations that make sense.
00183  * The netcdf functions that use this ncx interface don't
00184  * use these primitive conversion functions. They use the
00185  * aggregate conversion functions declared below.
00186  *
00187  * Storage for a single element of external type is at the `void * xp'
00188  * argument.
00189  *
00190  * Storage for a single element of internal type is at `ip' argument.
00191  *
00192  * These functions return 0 (ENOERR) when no error occured,
00193  * or NC_ERANGE when the value being converted is too large.
00194  * When NC_ERANGE occurs, an undefined (implementation dependent)
00195  * conversion may have occured.
00196  *
00197  * Note that loss of precision may occur silently.
00198  *
00199  */
00200 
00201 #if 0
00202 extern int
00203 ncx_get_schar_schar(const void *xp, schar *ip);
00204 extern int
00205 ncx_get_schar_uchar(const void *xp, uchar *ip);
00206 extern int
00207 ncx_get_schar_short(const void *xp, short *ip);
00208 extern int
00209 ncx_get_schar_int(const void *xp, int *ip);
00210 extern int
00211 ncx_get_schar_long(const void *xp, long *ip);
00212 extern int
00213 ncx_get_schar_float(const void *xp, float *ip);
00214 extern int
00215 ncx_get_schar_double(const void *xp, double *ip);
00216 
00217 extern int
00218 ncx_put_schar_schar(void *xp, const schar *ip);
00219 extern int
00220 ncx_put_schar_uchar(void *xp, const uchar *ip);
00221 extern int
00222 ncx_put_schar_short(void *xp, const short *ip);
00223 extern int
00224 ncx_put_schar_int(void *xp, const int *ip);
00225 extern int
00226 ncx_put_schar_long(void *xp, const long *ip);
00227 extern int
00228 ncx_put_schar_float(void *xp, const float *ip);
00229 extern int
00230 ncx_put_schar_double(void *xp, const double *ip);
00231 #endif
00232  
00233 
00234 extern int
00235 ncx_get_short_schar(const void *xp, schar *ip);
00236 extern int
00237 ncx_get_short_uchar(const void *xp, uchar *ip);
00238 extern int
00239 ncx_get_short_short(const void *xp, short *ip);
00240 extern int
00241 ncx_get_short_int(const void *xp, int *ip);
00242 extern int
00243 ncx_get_short_long(const void *xp, long *ip);
00244 extern int
00245 ncx_get_short_float(const void *xp, float *ip);
00246 extern int
00247 ncx_get_short_double(const void *xp, double *ip);
00248 
00249 extern int
00250 ncx_put_short_schar(void *xp, const schar *ip);
00251 extern int
00252 ncx_put_short_uchar(void *xp, const uchar *ip);
00253 extern int
00254 ncx_put_short_short(void *xp, const short *ip);
00255 extern int
00256 ncx_put_short_int(void *xp, const int *ip);
00257 extern int
00258 ncx_put_short_long(void *xp, const long *ip);
00259 extern int
00260 ncx_put_short_float(void *xp, const float *ip);
00261 extern int
00262 ncx_put_short_double(void *xp, const double *ip);
00263  
00264 
00265 extern int
00266 ncx_get_int_schar(const void *xp, schar *ip);
00267 extern int
00268 ncx_get_int_uchar(const void *xp, uchar *ip);
00269 extern int
00270 ncx_get_int_short(const void *xp, short *ip);
00271 extern int
00272 ncx_get_int_int(const void *xp, int *ip);
00273 extern int
00274 ncx_get_int_long(const void *xp, long *ip);
00275 extern int
00276 ncx_get_int_float(const void *xp, float *ip);
00277 extern int
00278 ncx_get_int_double(const void *xp, double *ip);
00279 
00280 extern int
00281 ncx_put_int_schar(void *xp, const schar *ip);
00282 extern int
00283 ncx_put_int_uchar(void *xp, const uchar *ip);
00284 extern int
00285 ncx_put_int_short(void *xp, const short *ip);
00286 extern int
00287 ncx_put_int_int(void *xp, const int *ip);
00288 extern int
00289 ncx_put_int_long(void *xp, const long *ip);
00290 extern int
00291 ncx_put_int_float(void *xp, const float *ip);
00292 extern int
00293 ncx_put_int_double(void *xp, const double *ip);
00294  
00295 
00296 extern int
00297 ncx_get_float_schar(const void *xp, schar *ip);
00298 extern int
00299 ncx_get_float_uchar(const void *xp, uchar *ip);
00300 extern int
00301 ncx_get_float_short(const void *xp, short *ip);
00302 extern int
00303 ncx_get_float_int(const void *xp, int *ip);
00304 extern int
00305 ncx_get_float_long(const void *xp, long *ip);
00306 extern int
00307 ncx_get_float_float(const void *xp, float *ip);
00308 extern int
00309 ncx_get_float_double(const void *xp, double *ip);
00310 
00311 extern int
00312 ncx_put_float_schar(void *xp, const schar *ip);
00313 extern int
00314 ncx_put_float_uchar(void *xp, const uchar *ip);
00315 extern int
00316 ncx_put_float_short(void *xp, const short *ip);
00317 extern int
00318 ncx_put_float_int(void *xp, const int *ip);
00319 extern int
00320 ncx_put_float_long(void *xp, const long *ip);
00321 extern int
00322 ncx_put_float_float(void *xp, const float *ip);
00323 extern int
00324 ncx_put_float_double(void *xp, const double *ip);
00325  
00326 
00327 extern int
00328 ncx_get_double_schar(const void *xp, schar *ip);
00329 extern int
00330 ncx_get_double_uchar(const void *xp, uchar *ip);
00331 extern int
00332 ncx_get_double_short(const void *xp, short *ip);
00333 extern int
00334 ncx_get_double_int(const void *xp, int *ip);
00335 extern int
00336 ncx_get_double_long(const void *xp, long *ip);
00337 extern int
00338 ncx_get_double_float(const void *xp, float *ip);
00339 extern int
00340 ncx_get_double_double(const void *xp, double *ip);
00341 
00342 extern int
00343 ncx_put_double_schar(void *xp, const schar *ip);
00344 extern int
00345 ncx_put_double_uchar(void *xp, const uchar *ip);
00346 extern int
00347 ncx_put_double_short(void *xp, const short *ip);
00348 extern int
00349 ncx_put_double_int(void *xp, const int *ip);
00350 extern int
00351 ncx_put_double_long(void *xp, const long *ip);
00352 extern int
00353 ncx_put_double_float(void *xp, const float *ip);
00354 extern int
00355 ncx_put_double_double(void *xp, const double *ip);
00356  
00357 
00358 /*
00359  * Other primitive conversion functions
00360  * N.B. slightly different interface
00361  * Used by netcdf.
00362  */
00363 
00364 /* ncx_get_int_size_t */
00365 extern int
00366 ncx_get_size_t(const void **xpp, size_t *ulp);
00367 /* ncx_get_int_off_t */
00368 extern int
00369 ncx_get_off_t(const void **xpp, off_t *lp, size_t sizeof_off_t);
00370 
00371 /* ncx_put_int_size_t */
00372 extern int
00373 ncx_put_size_t(void **xpp, const size_t *ulp);
00374 /* ncx_put_int_off_t */
00375 extern int
00376 ncx_put_off_t(void **xpp, const off_t *lp, size_t sizeof_off_t);
00377 
00378 
00379 /*
00380  * Aggregate numeric conversion functions.
00381  * Convert an array.  Replaces xdr_array(...).
00382  * These functions are used by netcdf. Unlike the xdr
00383  * interface, we optimize for aggregate conversions.
00384  * This functions should be implemented to take advantage
00385  * of multiple processor / parallel hardware where available.
00386  *
00387  * These take the form
00388  *      int ncx_getn_{external_type}_{internal_type}(
00389  *              const void *xpp,
00390  *              size_t nelems,
00391  *              internal_type *ip
00392  *      );
00393  *      int ncx_putn_{external_type}_{internal_type}(
00394  *              void **xpp,
00395  *              size_t nelems,
00396  *              const internal_type *ip
00397  *      );
00398  * Where the types are as in the primitive numeric conversion functions.
00399  *
00400  * The value of the pointer to pointer argument, *xpp, is
00401  * expected to reference storage for `nelems' of the external
00402  * type.  On return, it modified to reference just past the last
00403  * converted external element.
00404  *
00405  * The types whose external size is less than X_ALIGN also have `pad'
00406  * interfaces. These round (and zero fill on put) *xpp up to X_ALIGN
00407  * boundaries. (This is the usual xdr behavior.)
00408  *
00409  * The `ip' argument should point to an array of `nelems' of
00410  * internal_type.
00411  *
00412  * Range errors (NC_ERANGE) for a individual values in the array 
00413  * DO NOT terminate the array conversion. All elements are converted,
00414  * with some having undefined values.
00415  * If any range error occurs, the function returns NC_ERANGE.
00416  *
00417  */
00418 
00419 extern int
00420 ncx_getn_schar_schar(const void **xpp, size_t nelems, schar *ip);
00421 extern int
00422 ncx_getn_schar_uchar(const void **xpp, size_t nelems, uchar *ip);
00423 extern int
00424 ncx_getn_schar_short(const void **xpp, size_t nelems, short *ip);
00425 extern int
00426 ncx_getn_schar_int(const void **xpp, size_t nelems, int *ip);
00427 extern int
00428 ncx_getn_schar_long(const void **xpp, size_t nelems, long *ip);
00429 extern int
00430 ncx_getn_schar_float(const void **xpp, size_t nelems, float *ip);
00431 extern int
00432 ncx_getn_schar_double(const void **xpp, size_t nelems, double *ip);
00433 
00434 extern int
00435 ncx_pad_getn_schar_schar(const void **xpp, size_t nelems, schar *ip);
00436 extern int
00437 ncx_pad_getn_schar_uchar(const void **xpp, size_t nelems, uchar *ip);
00438 extern int
00439 ncx_pad_getn_schar_short(const void **xpp, size_t nelems, short *ip);
00440 extern int
00441 ncx_pad_getn_schar_int(const void **xpp, size_t nelems, int *ip);
00442 extern int
00443 ncx_pad_getn_schar_long(const void **xpp, size_t nelems, long *ip);
00444 extern int
00445 ncx_pad_getn_schar_float(const void **xpp, size_t nelems, float *ip);
00446 extern int
00447 ncx_pad_getn_schar_double(const void **xpp, size_t nelems, double *ip);
00448 
00449 extern int
00450 ncx_putn_schar_schar(void **xpp, size_t nelems, const schar *ip);
00451 extern int
00452 ncx_putn_schar_uchar(void **xpp, size_t nelems, const uchar *ip);
00453 extern int
00454 ncx_putn_schar_short(void **xpp, size_t nelems, const short *ip);
00455 extern int
00456 ncx_putn_schar_int(void **xpp, size_t nelems, const int *ip);
00457 extern int
00458 ncx_putn_schar_long(void **xpp, size_t nelems, const long *ip);
00459 extern int
00460 ncx_putn_schar_float(void **xpp, size_t nelems, const float *ip);
00461 extern int
00462 ncx_putn_schar_double(void **xpp, size_t nelems, const double *ip);
00463  
00464 extern int
00465 ncx_pad_putn_schar_schar(void **xpp, size_t nelems, const schar *ip);
00466 extern int
00467 ncx_pad_putn_schar_uchar(void **xpp, size_t nelems, const uchar *ip);
00468 extern int
00469 ncx_pad_putn_schar_short(void **xpp, size_t nelems, const short *ip);
00470 extern int
00471 ncx_pad_putn_schar_int(void **xpp, size_t nelems, const int *ip);
00472 extern int
00473 ncx_pad_putn_schar_long(void **xpp, size_t nelems, const long *ip);
00474 extern int
00475 ncx_pad_putn_schar_float(void **xpp, size_t nelems, const float *ip);
00476 extern int
00477 ncx_pad_putn_schar_double(void **xpp, size_t nelems, const double *ip);
00478 
00479 
00480 extern int
00481 ncx_getn_short_schar(const void **xpp, size_t nelems, schar *ip);
00482 extern int
00483 ncx_getn_short_uchar(const void **xpp, size_t nelems, uchar *ip);
00484 extern int
00485 ncx_getn_short_short(const void **xpp, size_t nelems, short *ip);
00486 extern int
00487 ncx_getn_short_int(const void **xpp, size_t nelems, int *ip);
00488 extern int
00489 ncx_getn_short_long(const void **xpp, size_t nelems, long *ip);
00490 extern int
00491 ncx_getn_short_float(const void **xpp, size_t nelems, float *ip);
00492 extern int
00493 ncx_getn_short_double(const void **xpp, size_t nelems, double *ip);
00494 
00495 extern int
00496 ncx_pad_getn_short_schar(const void **xpp, size_t nelems, schar *ip);
00497 extern int
00498 ncx_pad_getn_short_uchar(const void **xpp, size_t nelems, uchar *ip);
00499 extern int
00500 ncx_pad_getn_short_short(const void **xpp, size_t nelems, short *ip);
00501 extern int
00502 ncx_pad_getn_short_int(const void **xpp, size_t nelems, int *ip);
00503 extern int
00504 ncx_pad_getn_short_long(const void **xpp, size_t nelems, long *ip);
00505 extern int
00506 ncx_pad_getn_short_float(const void **xpp, size_t nelems, float *ip);
00507 extern int
00508 ncx_pad_getn_short_double(const void **xpp, size_t nelems, double *ip);
00509 
00510 extern int
00511 ncx_putn_short_schar(void **xpp, size_t nelems, const schar *ip);
00512 extern int
00513 ncx_putn_short_uchar(void **xpp, size_t nelems, const uchar *ip);
00514 extern int
00515 ncx_putn_short_short(void **xpp, size_t nelems, const short *ip);
00516 extern int
00517 ncx_putn_short_int(void **xpp, size_t nelems, const int *ip);
00518 extern int
00519 ncx_putn_short_long(void **xpp, size_t nelems, const long *ip);
00520 extern int
00521 ncx_putn_short_float(void **xpp, size_t nelems, const float *ip);
00522 extern int
00523 ncx_putn_short_double(void **xpp, size_t nelems, const double *ip);
00524  
00525 extern int
00526 ncx_pad_putn_short_schar(void **xpp, size_t nelems, const schar *ip);
00527 extern int
00528 ncx_pad_putn_short_uchar(void **xpp, size_t nelems, const uchar *ip);
00529 extern int
00530 ncx_pad_putn_short_short(void **xpp, size_t nelems, const short *ip);
00531 extern int
00532 ncx_pad_putn_short_int(void **xpp, size_t nelems, const int *ip);
00533 extern int
00534 ncx_pad_putn_short_long(void **xpp, size_t nelems, const long *ip);
00535 extern int
00536 ncx_pad_putn_short_float(void **xpp, size_t nelems, const float *ip);
00537 extern int
00538 ncx_pad_putn_short_double(void **xpp, size_t nelems, const double *ip);
00539 
00540 
00541 extern int
00542 ncx_getn_int_schar(const void **xpp, size_t nelems, schar *ip);
00543 extern int
00544 ncx_getn_int_uchar(const void **xpp, size_t nelems, uchar *ip);
00545 extern int
00546 ncx_getn_int_short(const void **xpp, size_t nelems, short *ip);
00547 extern int
00548 ncx_getn_int_int(const void **xpp, size_t nelems, int *ip);
00549 extern int
00550 ncx_getn_int_long(const void **xpp, size_t nelems, long *ip);
00551 extern int
00552 ncx_getn_int_float(const void **xpp, size_t nelems, float *ip);
00553 extern int
00554 ncx_getn_int_double(const void **xpp, size_t nelems, double *ip);
00555 
00556 extern int
00557 ncx_putn_int_schar(void **xpp, size_t nelems, const schar *ip);
00558 extern int
00559 ncx_putn_int_uchar(void **xpp, size_t nelems, const uchar *ip);
00560 extern int
00561 ncx_putn_int_short(void **xpp, size_t nelems, const short *ip);
00562 extern int
00563 ncx_putn_int_int(void **xpp, size_t nelems, const int *ip);
00564 extern int
00565 ncx_putn_int_long(void **xpp, size_t nelems, const long *ip);
00566 extern int
00567 ncx_putn_int_float(void **xpp, size_t nelems, const float *ip);
00568 extern int
00569 ncx_putn_int_double(void **xpp, size_t nelems, const double *ip);
00570  
00571 
00572 extern int
00573 ncx_getn_float_schar(const void **xpp, size_t nelems, schar *ip);
00574 extern int
00575 ncx_getn_float_uchar(const void **xpp, size_t nelems, uchar *ip);
00576 extern int
00577 ncx_getn_float_short(const void **xpp, size_t nelems, short *ip);
00578 extern int
00579 ncx_getn_float_int(const void **xpp, size_t nelems, int *ip);
00580 extern int
00581 ncx_getn_float_long(const void **xpp, size_t nelems, long *ip);
00582 extern int
00583 ncx_getn_float_float(const void **xpp, size_t nelems, float *ip);
00584 extern int
00585 ncx_getn_float_double(const void **xpp, size_t nelems, double *ip);
00586 
00587 extern int
00588 ncx_putn_float_schar(void **xpp, size_t nelems, const schar *ip);
00589 extern int
00590 ncx_putn_float_uchar(void **xpp, size_t nelems, const uchar *ip);
00591 extern int
00592 ncx_putn_float_short(void **xpp, size_t nelems, const short *ip);
00593 extern int
00594 ncx_putn_float_int(void **xpp, size_t nelems, const int *ip);
00595 extern int
00596 ncx_putn_float_long(void **xpp, size_t nelems, const long *ip);
00597 extern int
00598 ncx_putn_float_float(void **xpp, size_t nelems, const float *ip);
00599 extern int
00600 ncx_putn_float_double(void **xpp, size_t nelems, const double *ip);
00601  
00602 
00603 extern int
00604 ncx_getn_double_schar(const void **xpp, size_t nelems, schar *ip);
00605 extern int
00606 ncx_getn_double_uchar(const void **xpp, size_t nelems, uchar *ip);
00607 extern int
00608 ncx_getn_double_short(const void **xpp, size_t nelems, short *ip);
00609 extern int
00610 ncx_getn_double_int(const void **xpp, size_t nelems, int *ip);
00611 extern int
00612 ncx_getn_double_long(const void **xpp, size_t nelems, long *ip);
00613 extern int
00614 ncx_getn_double_float(const void **xpp, size_t nelems, float *ip);
00615 extern int
00616 ncx_getn_double_double(const void **xpp, size_t nelems, double *ip);
00617 
00618 extern int
00619 ncx_putn_double_schar(void **xpp, size_t nelems, const schar *ip);
00620 extern int
00621 ncx_putn_double_uchar(void **xpp, size_t nelems, const uchar *ip);
00622 extern int
00623 ncx_putn_double_short(void **xpp, size_t nelems, const short *ip);
00624 extern int
00625 ncx_putn_double_int(void **xpp, size_t nelems, const int *ip);
00626 extern int
00627 ncx_putn_double_long(void **xpp, size_t nelems, const long *ip);
00628 extern int
00629 ncx_putn_double_float(void **xpp, size_t nelems, const float *ip);
00630 extern int
00631 ncx_putn_double_double(void **xpp, size_t nelems, const double *ip);
00632  
00633 
00634 /*
00635  * Other aggregate conversion functions.
00636  */
00637 
00638 /* read ASCII characters */
00639 extern int
00640 ncx_getn_text(const void **xpp, size_t nchars, char *cp);
00641 extern int
00642 ncx_pad_getn_text(const void **xpp, size_t nchars, char *cp);
00643 
00644 /* write ASCII characters */
00645 extern int
00646 ncx_putn_text(void **xpp, size_t nchars, const char *cp);
00647 extern int
00648 ncx_pad_putn_text(void **xpp, size_t nchars, const char *cp);
00649 
00650 /* for symmetry */
00651 #define ncx_getn_char_char(xpp, nelems, fillp) ncx_getn_text(xpp, nelems, fillp)
00652 #define ncx_putn_char_char(xpp, nelems, fillp) ncx_putn_text(xpp, nelems, fillp)
00653 
00654 /* read opaque data */
00655 extern int
00656 ncx_getn_void(const void **xpp, size_t nchars, void *vp);
00657 extern int
00658 ncx_pad_getn_void(const void **xpp, size_t nchars, void *vp);
00659 
00660 /* write opaque data */
00661 extern int
00662 ncx_putn_void(void **xpp, size_t nchars, const void *vp);
00663 extern int
00664 ncx_pad_putn_void(void **xpp, size_t nchars, const void *vp);
00665 
00666 #endif /* _NCX_H_ */

Generated on Thu Mar 16 18:10:09 2006 for nco by  doxygen 1.4.4