Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

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

Powered by Plone

This site conforms to the following standards: