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.c File Reference

#include "ncx.h"
#include <string.h>
#include <limits.h>
#include <float.h>
#include <assert.h>

Go to the source code of this file.


Defines

#define SHORT_MAX   SHRT_MAX
#define SHORT_MIN   SHRT_MIN
#define USHORT_MAX   USHRT_MAX
#define FLT_MAX   3.40282347e+38f
#define SIZEOF_FLOAT   4
#define SIZEOF_DOUBLE   8

Functions

void get_ix_short (const void *xp, ix_short *ip)
void put_ix_short (void *xp, const ix_short *ip)
int ncx_get_short_schar (const void *xp, schar *ip)
int ncx_get_short_uchar (const void *xp, uchar *ip)
int ncx_get_short_short (const void *xp, short *ip)
int ncx_get_short_int (const void *xp, int *ip)
int ncx_get_short_long (const void *xp, long *ip)
int ncx_get_short_float (const void *xp, float *ip)
int ncx_get_short_double (const void *xp, double *ip)
int ncx_put_short_schar (void *xp, const schar *ip)
int ncx_put_short_uchar (void *xp, const uchar *ip)
int ncx_put_short_short (void *xp, const short *ip)
int ncx_put_short_int (void *xp, const int *ip)
int ncx_put_short_long (void *xp, const long *ip)
int ncx_put_short_float (void *xp, const float *ip)
int ncx_put_short_double (void *xp, const double *ip)
void get_ix_int (const void *xp, ix_int *ip)
void put_ix_int (void *xp, const ix_int *ip)
int ncx_get_int_schar (const void *xp, schar *ip)
int ncx_get_int_uchar (const void *xp, uchar *ip)
int ncx_get_int_short (const void *xp, short *ip)
int ncx_get_int_int (const void *xp, int *ip)
int ncx_get_int_long (const void *xp, long *ip)
int ncx_get_int_float (const void *xp, float *ip)
int ncx_get_int_double (const void *xp, double *ip)
int ncx_put_int_schar (void *xp, const schar *ip)
int ncx_put_int_uchar (void *xp, const uchar *ip)
int ncx_put_int_short (void *xp, const short *ip)
int ncx_put_int_int (void *xp, const int *ip)
int ncx_put_int_long (void *xp, const long *ip)
int ncx_put_int_float (void *xp, const float *ip)
int ncx_put_int_double (void *xp, const double *ip)
void get_ix_float (const void *xp, float *ip)
void put_ix_float (void *xp, const float *ip)
int ncx_get_float_schar (const void *xp, schar *ip)
int ncx_get_float_uchar (const void *xp, uchar *ip)
int ncx_get_float_short (const void *xp, short *ip)
int ncx_get_float_int (const void *xp, int *ip)
int ncx_get_float_long (const void *xp, long *ip)
int ncx_get_float_float (const void *xp, float *ip)
int ncx_get_float_double (const void *xp, double *ip)
int ncx_put_float_schar (void *xp, const schar *ip)
int ncx_put_float_uchar (void *xp, const uchar *ip)
int ncx_put_float_short (void *xp, const short *ip)
int ncx_put_float_int (void *xp, const int *ip)
int ncx_put_float_long (void *xp, const long *ip)
int ncx_put_float_float (void *xp, const float *ip)
int ncx_put_float_double (void *xp, const double *ip)
void get_ix_double (const void *xp, double *ip)
void put_ix_double (void *xp, const double *ip)
int ncx_get_double_schar (const void *xp, schar *ip)
int ncx_get_double_uchar (const void *xp, uchar *ip)
int ncx_get_double_short (const void *xp, short *ip)
int ncx_get_double_int (const void *xp, int *ip)
int ncx_get_double_long (const void *xp, long *ip)
int ncx_get_double_float (const void *xp, float *ip)
int ncx_get_double_double (const void *xp, double *ip)
int ncx_put_double_schar (void *xp, const schar *ip)
int ncx_put_double_uchar (void *xp, const uchar *ip)
int ncx_put_double_short (void *xp, const short *ip)
int ncx_put_double_int (void *xp, const int *ip)
int ncx_put_double_long (void *xp, const long *ip)
int ncx_put_double_float (void *xp, const float *ip)
int ncx_put_double_double (void *xp, const double *ip)
int ncx_put_size_t (void **xpp, const size_t *ulp)
int ncx_get_size_t (const void **xpp, size_t *ulp)
int ncx_put_off_t (void **xpp, const off_t *lp)
int ncx_get_off_t (const void **xpp, off_t *lp)
int ncx_getn_schar_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_getn_schar_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_getn_schar_short (const void **xpp, size_t nelems, short *tp)
int ncx_getn_schar_int (const void **xpp, size_t nelems, int *tp)
int ncx_getn_schar_long (const void **xpp, size_t nelems, long *tp)
int ncx_getn_schar_float (const void **xpp, size_t nelems, float *tp)
int ncx_getn_schar_double (const void **xpp, size_t nelems, double *tp)
int ncx_pad_getn_schar_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_pad_getn_schar_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_pad_getn_schar_short (const void **xpp, size_t nelems, short *tp)
int ncx_pad_getn_schar_int (const void **xpp, size_t nelems, int *tp)
int ncx_pad_getn_schar_long (const void **xpp, size_t nelems, long *tp)
int ncx_pad_getn_schar_float (const void **xpp, size_t nelems, float *tp)
int ncx_pad_getn_schar_double (const void **xpp, size_t nelems, double *tp)
int ncx_putn_schar_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_putn_schar_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_putn_schar_short (void **xpp, size_t nelems, const short *tp)
int ncx_putn_schar_int (void **xpp, size_t nelems, const int *tp)
int ncx_putn_schar_long (void **xpp, size_t nelems, const long *tp)
int ncx_putn_schar_float (void **xpp, size_t nelems, const float *tp)
int ncx_putn_schar_double (void **xpp, size_t nelems, const double *tp)
int ncx_pad_putn_schar_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_pad_putn_schar_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_pad_putn_schar_short (void **xpp, size_t nelems, const short *tp)
int ncx_pad_putn_schar_int (void **xpp, size_t nelems, const int *tp)
int ncx_pad_putn_schar_long (void **xpp, size_t nelems, const long *tp)
int ncx_pad_putn_schar_float (void **xpp, size_t nelems, const float *tp)
int ncx_pad_putn_schar_double (void **xpp, size_t nelems, const double *tp)
int ncx_getn_short_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_getn_short_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_getn_short_short (const void **xpp, size_t nelems, short *tp)
int ncx_getn_short_int (const void **xpp, size_t nelems, int *tp)
int ncx_getn_short_long (const void **xpp, size_t nelems, long *tp)
int ncx_getn_short_float (const void **xpp, size_t nelems, float *tp)
int ncx_getn_short_double (const void **xpp, size_t nelems, double *tp)
int ncx_pad_getn_short_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_pad_getn_short_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_pad_getn_short_short (const void **xpp, size_t nelems, short *tp)
int ncx_pad_getn_short_int (const void **xpp, size_t nelems, int *tp)
int ncx_pad_getn_short_long (const void **xpp, size_t nelems, long *tp)
int ncx_pad_getn_short_float (const void **xpp, size_t nelems, float *tp)
int ncx_pad_getn_short_double (const void **xpp, size_t nelems, double *tp)
int ncx_putn_short_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_putn_short_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_putn_short_short (void **xpp, size_t nelems, const short *tp)
int ncx_putn_short_int (void **xpp, size_t nelems, const int *tp)
int ncx_putn_short_long (void **xpp, size_t nelems, const long *tp)
int ncx_putn_short_float (void **xpp, size_t nelems, const float *tp)
int ncx_putn_short_double (void **xpp, size_t nelems, const double *tp)
int ncx_pad_putn_short_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_pad_putn_short_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_pad_putn_short_short (void **xpp, size_t nelems, const short *tp)
int ncx_pad_putn_short_int (void **xpp, size_t nelems, const int *tp)
int ncx_pad_putn_short_long (void **xpp, size_t nelems, const long *tp)
int ncx_pad_putn_short_float (void **xpp, size_t nelems, const float *tp)
int ncx_pad_putn_short_double (void **xpp, size_t nelems, const double *tp)
int ncx_getn_int_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_getn_int_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_getn_int_short (const void **xpp, size_t nelems, short *tp)
int ncx_getn_int_int (const void **xpp, size_t nelems, int *tp)
int ncx_getn_int_long (const void **xpp, size_t nelems, long *tp)
int ncx_getn_int_float (const void **xpp, size_t nelems, float *tp)
int ncx_getn_int_double (const void **xpp, size_t nelems, double *tp)
int ncx_putn_int_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_putn_int_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_putn_int_short (void **xpp, size_t nelems, const short *tp)
int ncx_putn_int_int (void **xpp, size_t nelems, const int *tp)
int ncx_putn_int_long (void **xpp, size_t nelems, const long *tp)
int ncx_putn_int_float (void **xpp, size_t nelems, const float *tp)
int ncx_putn_int_double (void **xpp, size_t nelems, const double *tp)
int ncx_getn_float_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_getn_float_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_getn_float_short (const void **xpp, size_t nelems, short *tp)
int ncx_getn_float_int (const void **xpp, size_t nelems, int *tp)
int ncx_getn_float_long (const void **xpp, size_t nelems, long *tp)
int ncx_getn_float_float (const void **xpp, size_t nelems, float *tp)
int ncx_getn_float_double (const void **xpp, size_t nelems, double *tp)
int ncx_putn_float_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_putn_float_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_putn_float_short (void **xpp, size_t nelems, const short *tp)
int ncx_putn_float_int (void **xpp, size_t nelems, const int *tp)
int ncx_putn_float_long (void **xpp, size_t nelems, const long *tp)
int ncx_putn_float_float (void **xpp, size_t nelems, const float *tp)
int ncx_putn_float_double (void **xpp, size_t nelems, const double *tp)
int ncx_getn_double_schar (const void **xpp, size_t nelems, schar *tp)
int ncx_getn_double_uchar (const void **xpp, size_t nelems, uchar *tp)
int ncx_getn_double_short (const void **xpp, size_t nelems, short *tp)
int ncx_getn_double_int (const void **xpp, size_t nelems, int *tp)
int ncx_getn_double_long (const void **xpp, size_t nelems, long *tp)
int ncx_getn_double_float (const void **xpp, size_t nelems, float *tp)
int ncx_getn_double_double (const void **xpp, size_t nelems, double *tp)
int ncx_putn_double_schar (void **xpp, size_t nelems, const schar *tp)
int ncx_putn_double_uchar (void **xpp, size_t nelems, const uchar *tp)
int ncx_putn_double_short (void **xpp, size_t nelems, const short *tp)
int ncx_putn_double_int (void **xpp, size_t nelems, const int *tp)
int ncx_putn_double_long (void **xpp, size_t nelems, const long *tp)
int ncx_putn_double_float (void **xpp, size_t nelems, const float *tp)
int ncx_putn_double_double (void **xpp, size_t nelems, const double *tp)
int ncx_getn_text (const void **xpp, size_t nelems, char *tp)
int ncx_pad_getn_text (const void **xpp, size_t nelems, char *tp)
int ncx_putn_text (void **xpp, size_t nelems, const char *tp)
int ncx_pad_putn_text (void **xpp, size_t nelems, const char *tp)
int ncx_getn_void (const void **xpp, size_t nelems, void *tp)
int ncx_pad_getn_void (const void **xpp, size_t nelems, void *tp)
int ncx_putn_void (void **xpp, size_t nelems, const void *tp)
int ncx_pad_putn_void (void **xpp, size_t nelems, const void *tp)

Variables

const char nada [X_ALIGN] = {0, 0, 0, 0}

Define Documentation

#define FLT_MAX   3.40282347e+38f
 

Definition at line 39 of file ncx.c.

Referenced by ncx_get_double_float(), ncx_get_int_float(), and ncx_get_short_float().

#define SHORT_MAX   SHRT_MAX
 

Definition at line 33 of file ncx.c.

Referenced by ncx_get_double_short(), ncx_get_float_short(), ncx_get_int_short(), and ncx_get_short_short().

#define SHORT_MIN   SHRT_MIN
 

Definition at line 34 of file ncx.c.

Referenced by ncx_get_double_short(), ncx_get_float_short(), ncx_get_int_short(), and ncx_get_short_short().

#define SIZEOF_DOUBLE   8
 

Definition at line 49 of file ncx.c.

#define SIZEOF_FLOAT   4
 

Definition at line 47 of file ncx.c.

#define USHORT_MAX   USHRT_MAX
 

Definition at line 35 of file ncx.c.


Function Documentation

void get_ix_double const void *    xp,
double *    ip
[static]
 

Definition at line 1279 of file ncx.c.

01280 {
01281 #ifdef WORDS_BIGENDIAN
01282         (void) memcpy(ip, xp, sizeof(double));
01283 #else
01284         swap8b(ip, xp);
01285 #endif
01286 }

void get_ix_float const void *    xp,
float *    ip
[static]
 

Definition at line 675 of file ncx.c.

00676 {
00677 #ifdef WORDS_BIGENDIAN
00678         (void) memcpy(ip, xp, sizeof(float));
00679 #else
00680         swap4b(ip, xp);
00681 #endif
00682 }

void get_ix_int const void *    xp,
ix_int   ip
[static]
 

Definition at line 439 of file ncx.c.

References ix_int.

00440 {
00441         const uchar *cp = (const uchar *) xp;
00442 
00443         *ip = *cp++ << 24;
00444 #if SIZEOF_IX_INT > X_SIZEOF_INT
00445         if(*ip & 0x80000000)
00446         {
00447                 /* extern is negative */
00448                 *ip |= (~(0xffffffff)); /* N.B. Assumes "twos complement" */
00449         }
00450 #endif
00451         *ip |= (*cp++ << 16);
00452         *ip |= (*cp++ << 8);
00453         *ip |= *cp; 
00454 }

void get_ix_short const void *    xp,
ix_short   ip
[static]
 

Definition at line 208 of file ncx.c.

References ix_short.

00209 {
00210         const uchar *cp = (const uchar *) xp;
00211         *ip = *cp++ << 8;
00212 #if SIZEOF_IX_SHORT > X_SIZEOF_SHORT
00213         if(*ip & 0x8000)
00214         {
00215                 /* extern is negative */
00216                 *ip |= (~(0xffff)); /* N.B. Assumes "twos complement" */
00217         }
00218 #endif
00219         *ip |= *cp; 
00220 }

int ncx_get_double_double const void *    xp,
double *    ip
 

Definition at line 1624 of file ncx.c.

References get_ix_double().

01625 {
01626         /* TODO */
01627         get_ix_double(xp, ip);
01628         return ENOERR;
01629 }

int ncx_get_double_float const void *    xp,
float *    ip
 

Definition at line 1605 of file ncx.c.

References FLT_MAX, and get_ix_double().

01606 {
01607         double xx;
01608         get_ix_double(xp, &xx);
01609         if(xx > FLT_MAX || xx < (-FLT_MAX))
01610         {
01611                 *ip = FLT_MAX;
01612                 return NC_ERANGE;
01613         }
01614         if(xx < (-FLT_MAX))
01615         {
01616                 *ip = (-FLT_MAX);
01617                 return NC_ERANGE;
01618         }
01619         *ip = (float) xx;
01620         return ENOERR;
01621 }

int ncx_get_double_int const void *    xp,
int *    ip
 

Definition at line 1583 of file ncx.c.

References get_ix_double().

01584 {
01585         double xx;
01586         get_ix_double(xp, &xx);
01587         *ip = (int) xx;
01588         if(xx > INT_MAX || xx < INT_MIN)
01589                 return NC_ERANGE;
01590         return ENOERR;
01591 }

int ncx_get_double_long const void *    xp,
long *    ip
 

Definition at line 1594 of file ncx.c.

References get_ix_double().

01595 {
01596         double xx;
01597         get_ix_double(xp, &xx);
01598         *ip = (long) xx;
01599         if(xx > LONG_MAX || xx < LONG_MIN)
01600                 return NC_ERANGE;
01601         return ENOERR;
01602 }

int ncx_get_double_schar const void *    xp,
schar   ip
 

Definition at line 1550 of file ncx.c.

References get_ix_double().

01551 {
01552         double xx;
01553         get_ix_double(xp, &xx);
01554         *ip = (schar) xx;
01555         if(xx > SCHAR_MAX || xx < SCHAR_MIN)
01556                 return NC_ERANGE;
01557         return ENOERR;
01558 }

int ncx_get_double_short const void *    xp,
short *    ip
 

Definition at line 1572 of file ncx.c.

References get_ix_double(), SHORT_MAX, and SHORT_MIN.

01573 {
01574         double xx;
01575         get_ix_double(xp, &xx);
01576         *ip = (short) xx;
01577         if(xx > SHORT_MAX || xx < SHORT_MIN)
01578                 return NC_ERANGE;
01579         return ENOERR;
01580 }

int ncx_get_double_uchar const void *    xp,
uchar   ip
 

Definition at line 1561 of file ncx.c.

References get_ix_double().

01562 {
01563         double xx;
01564         get_ix_double(xp, &xx);
01565         *ip = (uchar) xx;
01566         if(xx > UCHAR_MAX || xx < 0)
01567                 return NC_ERANGE;
01568         return ENOERR;
01569 }

int ncx_get_float_double const void *    xp,
double *    ip
 

Definition at line 1191 of file ncx.c.

References get_ix_float.

01192 {
01193         /* TODO */
01194         float xx;
01195         get_ix_float(xp, &xx);
01196         *ip = xx;
01197         return ENOERR;
01198 }

int ncx_get_float_float const void *    xp,
float *    ip
 

Definition at line 1183 of file ncx.c.

References get_ix_float.

01184 {
01185         /* TODO */
01186         get_ix_float(xp, ip);
01187         return ENOERR;
01188 }

int ncx_get_float_int const void *    xp,
int *    ip
 

Definition at line 1161 of file ncx.c.

References get_ix_float.

01162 {
01163         float xx;
01164         get_ix_float(xp, &xx);
01165         *ip = (int) xx;
01166         if(xx > (double)INT_MAX || xx < (double)INT_MIN)
01167                 return NC_ERANGE;
01168         return ENOERR;
01169 }

int ncx_get_float_long const void *    xp,
long *    ip
 

Definition at line 1172 of file ncx.c.

References get_ix_float.

01173 {
01174         float xx;
01175         get_ix_float(xp, &xx);
01176         *ip = (long) xx;
01177         if(xx > LONG_MAX || xx < LONG_MIN)
01178                 return NC_ERANGE;
01179         return ENOERR;
01180 }

int ncx_get_float_schar const void *    xp,
schar   ip
 

Definition at line 1128 of file ncx.c.

References get_ix_float.

01129 {
01130         float xx;
01131         get_ix_float(xp, &xx);
01132         *ip = (schar) xx;
01133         if(xx > SCHAR_MAX || xx < SCHAR_MIN)
01134                 return NC_ERANGE;
01135         return ENOERR;
01136 }

int ncx_get_float_short const void *    xp,
short *    ip
 

Definition at line 1150 of file ncx.c.

References get_ix_float, SHORT_MAX, and SHORT_MIN.

01151 {
01152         float xx;
01153         get_ix_float(xp, &xx);
01154         *ip = (short) xx;
01155         if(xx > SHORT_MAX || xx < SHORT_MIN)
01156                 return NC_ERANGE;
01157         return ENOERR;
01158 }

int ncx_get_float_uchar const void *    xp,
uchar   ip
 

Definition at line 1139 of file ncx.c.

References get_ix_float.

01140 {
01141         float xx;
01142         get_ix_float(xp, &xx);
01143         *ip = (uchar) xx;
01144         if(xx > UCHAR_MAX || xx < 0)
01145                 return NC_ERANGE;
01146         return ENOERR;
01147 }

int ncx_get_int_double const void *    xp,
double *    ip
 

Definition at line 558 of file ncx.c.

References get_ix_int, and ix_int.

00559 {
00560         /* assert((DBL_MAX >= X_INT_MAX); */
00561         ix_int xx;
00562         get_ix_int(xp, &xx);
00563         *ip = xx;
00564         return ENOERR;
00565 }

int ncx_get_int_float const void *    xp,
float *    ip
 

Definition at line 545 of file ncx.c.

References FLT_MAX, get_ix_int, and ix_int.

00546 {
00547         ix_int xx;
00548         get_ix_int(xp, &xx);
00549         *ip = xx;
00550 #if 0   /* TODO: determine when necessary */
00551         if(xx > FLT_MAX || xx < (-FLT_MAX))
00552                 return NC_ERANGE;
00553 #endif
00554         return ENOERR;
00555 }

int ncx_get_int_int const void *    xp,
int *    ip
 

Definition at line 509 of file ncx.c.

References get_ix_int, and ix_int.

00510 {
00511 #if SIZEOF_IX_INT == SIZEOF_INT && IX_INT_MAX == INT_MAX
00512         get_ix_int(xp, (ix_int *)ip);
00513         return ENOERR;
00514 #else
00515         ix_int xx;
00516         get_ix_int(xp, &xx);
00517         *ip = xx;
00518 #  if IX_INT_MAX > INT_MAX
00519         if(xx > INT_MAX || xx < INT_MIN)
00520                 return NC_ERANGE;
00521 #  endif
00522         return ENOERR;
00523 #endif
00524 }

int ncx_get_int_long const void *    xp,
long *    ip
 

Definition at line 527 of file ncx.c.

References get_ix_int, and ix_int.

00528 {
00529 #if SIZEOF_IX_INT == SIZEOF_LONG && IX_INT_MAX == LONG_MAX
00530         get_ix_int(xp, (ix_int *)ip);
00531         return ENOERR;
00532 #else
00533         ix_int xx;
00534         get_ix_int(xp, &xx);
00535         *ip = xx;
00536 #  if IX_INT_MAX > LONG_MAX     /* unlikely */
00537         if(xx > LONG_MAX || xx < LONG_MIN)
00538                 return NC_ERANGE;
00539 #  endif
00540         return ENOERR;
00541 #endif
00542 }

int ncx_get_int_schar const void *    xp,
schar   ip
 

Definition at line 469 of file ncx.c.

References get_ix_int, and ix_int.

00470 {
00471         ix_int xx;
00472         get_ix_int(xp, &xx);
00473         *ip = xx;
00474         if(xx > SCHAR_MAX || xx < SCHAR_MIN)
00475                 return NC_ERANGE;
00476         return ENOERR;
00477 }

int ncx_get_int_short const void *    xp,
short *    ip
 

Definition at line 491 of file ncx.c.

References get_ix_int, ix_int, SHORT_MAX, and SHORT_MIN.

00492 {
00493 #if SIZEOF_IX_INT == SIZEOF_SHORT && IX_INT_MAX == SHORT_MAX
00494         get_ix_int(xp, (ix_int *)ip);
00495         return ENOERR;
00496 #else
00497         ix_int xx;
00498         get_ix_int(xp, &xx);
00499         *ip = xx;
00500 #  if IX_INT_MAX > SHORT_MAX
00501         if(xx > SHORT_MAX || xx < SHORT_MIN)
00502                 return NC_ERANGE;
00503 #  endif
00504         return ENOERR;
00505 #endif
00506 }

int ncx_get_int_uchar const void *    xp,
uchar   ip
 

Definition at line 480 of file ncx.c.

References get_ix_int, and ix_int.

00481 {
00482         ix_int xx;
00483         get_ix_int(xp, &xx);
00484         *ip = xx;
00485         if(xx > UCHAR_MAX || xx < 0)
00486                 return NC_ERANGE;
00487         return ENOERR;
00488 }

int ncx_get_off_t const void **    xpp,
off_t *    lp
 

Definition at line 1777 of file ncx.c.

References X_SIZEOF_OFF_T.

01778 {
01779         /* similar to get_ix_int() */
01780         const uchar *cp = (const uchar *) *xpp;
01781         assert((*cp & 0x80) == 0); /* No negative offsets stored in netcdf */
01782 
01783         *lp = *cp++ << 24;
01784         *lp |= (*cp++ << 16);
01785         *lp |= (*cp++ << 8);
01786         *lp |= *cp; 
01787 
01788         *xpp = (const void *)((const char *)(*xpp) + X_SIZEOF_OFF_T);
01789         return ENOERR;
01790 }

int ncx_get_short_double const void *    xp,
double *    ip
 

Definition at line 318 of file ncx.c.

References get_ix_short, and ix_short.

00319 {
00320         /* assert(DBL_MAX >= X_SHORT_MAX); */
00321         ix_short xx;
00322         get_ix_short(xp, &xx);
00323         *ip = xx;
00324         return ENOERR;
00325 }

int ncx_get_short_float const void *    xp,
float *    ip
 

Definition at line 305 of file ncx.c.

References FLT_MAX, get_ix_short, and ix_short.

00306 {
00307         ix_short xx;
00308         get_ix_short(xp, &xx);
00309         *ip = xx;
00310 #if 0   /* TODO: determine when necessary */
00311         if(xx > FLT_MAX || xx < (-FLT_MAX))
00312                 return NC_ERANGE;
00313 #endif
00314         return ENOERR;
00315 }

int ncx_get_short_int const void *    xp,
int *    ip
 

Definition at line 272 of file ncx.c.

References get_ix_short, and ix_short.

00273 {
00274 #if SIZEOF_IX_SHORT == SIZEOF_INT && IX_SHORT_MAX == INT_MAX
00275         get_ix_short(xp, (ix_short *)ip);
00276         return ENOERR;
00277 #else
00278         ix_short xx;
00279         get_ix_short(xp, &xx);
00280         *ip = xx;
00281 #   if IX_SHORT_MAX > INT_MAX
00282         if(xx > INT_MAX || xx < INT_MIN)
00283                 return NC_ERANGE;
00284 #   endif
00285         return ENOERR;
00286 #endif
00287 }

int ncx_get_short_long const void *    xp,
long *    ip
 

Definition at line 290 of file ncx.c.

References get_ix_short, and ix_short.

00291 {
00292 #if SIZEOF_IX_SHORT == SIZEOF_LONG && IX_SHORT_MAX == LONG_MAX
00293         get_ix_short(xp, (ix_short *)ip);
00294         return ENOERR;
00295 #else
00296         /* assert(LONG_MAX >= X_SHORT_MAX); */
00297         ix_short xx;
00298         get_ix_short(xp, &xx);
00299         *ip = xx;
00300         return ENOERR;
00301 #endif
00302 }

int ncx_get_short_schar const void *    xp,
schar   ip
 

Definition at line 232 of file ncx.c.

References get_ix_short, and ix_short.

00233 {
00234         ix_short xx;
00235         get_ix_short(xp, &xx);
00236         *ip = xx;
00237         if(xx > SCHAR_MAX || xx < SCHAR_MIN)
00238                 return NC_ERANGE;
00239         return ENOERR;
00240 }

int ncx_get_short_short const void *    xp,
short *    ip
 

Definition at line 254 of file ncx.c.

References get_ix_short, ix_short, SHORT_MAX, and SHORT_MIN.

00255 {
00256 #if SIZEOF_IX_SHORT == SIZEOF_SHORT && IX_SHORT_MAX == SHORT_MAX
00257         get_ix_short(xp, (ix_short *)ip);
00258         return ENOERR;
00259 #else
00260         ix_short xx;
00261         get_ix_short(xp, &xx);
00262         *ip = xx;
00263 #   if IX_SHORT_MAX > SHORT_MAX
00264         if(xx > SHORT_MAX || xx < SHORT_MIN)
00265                 return NC_ERANGE;
00266 #   endif
00267         return ENOERR;
00268 #endif
00269 }

int ncx_get_short_uchar const void *    xp,
uchar   ip
 

Definition at line 243 of file ncx.c.

References get_ix_short, and ix_short.

00244 {
00245         ix_short xx;
00246         get_ix_short(xp, &xx);
00247         *ip = xx;
00248         if(xx > UCHAR_MAX || xx < 0)
00249                 return NC_ERANGE;
00250         return ENOERR;
00251 }

int ncx_get_size_t const void **    xpp,
size_t *    ulp
 

Definition at line 1735 of file ncx.c.

References X_SIZEOF_SIZE_T.

01736 {
01737         /* similar to get_ix_int */
01738         const uchar *cp = (const uchar *) *xpp;
01739         assert((*cp & 0x80) == 0); /* sizes limited to 2^31 -1 in netcdf */
01740 
01741         *ulp = *cp++ << 24;
01742         *ulp |= (*cp++ << 16);
01743         *ulp |= (*cp++ << 8);
01744         *ulp |= *cp; 
01745 
01746         *xpp = (const void *)((const char *)(*xpp) + X_SIZEOF_SIZE_T);
01747         return ENOERR;
01748 }

int ncx_getn_double_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 3726 of file ncx.c.

References X_SIZEOF_DOUBLE.

03727 {
03728 # if WORDS_BIGENDIAN
03729         (void) memcpy(tp, *xpp, nelems * sizeof(double));
03730 # else
03731         swapn8b(tp, *xpp, nelems);
03732 # endif
03733         *xpp = (const void *)((const char *)(*xpp) + nelems * X_SIZEOF_DOUBLE);
03734         return ENOERR;
03735 }

int ncx_getn_double_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 3707 of file ncx.c.

References ncx_get_double_float(), and X_SIZEOF_DOUBLE.

03708 {
03709         const char *xp = (const char *) *xpp;
03710         int status = ENOERR;
03711 
03712         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03713         {
03714                 const int lstatus = ncx_get_double_float(xp, tp);
03715                 if(lstatus != ENOERR)
03716                         status = lstatus;
03717         }
03718 
03719         *xpp = (const void *)xp;
03720         return status;
03721 }

int ncx_getn_double_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 3673 of file ncx.c.

References ncx_get_double_int(), and X_SIZEOF_DOUBLE.

03674 {
03675         const char *xp = (const char *) *xpp;
03676         int status = ENOERR;
03677 
03678         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03679         {
03680                 const int lstatus = ncx_get_double_int(xp, tp);
03681                 if(lstatus != ENOERR)
03682                         status = lstatus;
03683         }
03684 
03685         *xpp = (const void *)xp;
03686         return status;
03687 }

int ncx_getn_double_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 3690 of file ncx.c.

References ncx_get_double_long(), and X_SIZEOF_DOUBLE.

03691 {
03692         const char *xp = (const char *) *xpp;
03693         int status = ENOERR;
03694 
03695         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03696         {
03697                 const int lstatus = ncx_get_double_long(xp, tp);
03698                 if(lstatus != ENOERR)
03699                         status = lstatus;
03700         }
03701 
03702         *xpp = (const void *)xp;
03703         return status;
03704 }

int ncx_getn_double_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 3622 of file ncx.c.

References ncx_get_double_schar(), and X_SIZEOF_DOUBLE.

03623 {
03624         const char *xp = (const char *) *xpp;
03625         int status = ENOERR;
03626 
03627         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03628         {
03629                 const int lstatus = ncx_get_double_schar(xp, tp);
03630                 if(lstatus != ENOERR)
03631                         status = lstatus;
03632         }
03633 
03634         *xpp = (const void *)xp;
03635         return status;
03636 }

int ncx_getn_double_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 3656 of file ncx.c.

References ncx_get_double_short(), and X_SIZEOF_DOUBLE.

03657 {
03658         const char *xp = (const char *) *xpp;
03659         int status = ENOERR;
03660 
03661         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03662         {
03663                 const int lstatus = ncx_get_double_short(xp, tp);
03664                 if(lstatus != ENOERR)
03665                         status = lstatus;
03666         }
03667 
03668         *xpp = (const void *)xp;
03669         return status;
03670 }

int ncx_getn_double_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 3639 of file ncx.c.

References ncx_get_double_uchar(), and X_SIZEOF_DOUBLE.

03640 {
03641         const char *xp = (const char *) *xpp;
03642         int status = ENOERR;
03643 
03644         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03645         {
03646                 const int lstatus = ncx_get_double_uchar(xp, tp);
03647                 if(lstatus != ENOERR)
03648                         status = lstatus;
03649         }
03650 
03651         *xpp = (const void *)xp;
03652         return status;
03653 }

int ncx_getn_float_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 3396 of file ncx.c.

References ncx_get_float_double(), and X_SIZEOF_FLOAT.

03397 {
03398         const char *xp = (const char *) *xpp;
03399         int status = ENOERR;
03400 
03401         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03402         {
03403                 const int lstatus = ncx_get_float_double(xp, tp);
03404                 if(lstatus != ENOERR)
03405                         status = lstatus;
03406         }
03407 
03408         *xpp = (const void *)xp;
03409         return status;
03410 }

int ncx_getn_float_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 3295 of file ncx.c.

References X_SIZEOF_FLOAT.

03296 {
03297 # if WORDS_BIGENDIAN
03298         (void) memcpy(tp, *xpp, nelems * sizeof(float));
03299 # else
03300         swapn4b(tp, *xpp, nelems);
03301 # endif
03302         *xpp = (const void *)((const char *)(*xpp) + nelems * X_SIZEOF_FLOAT);
03303         return ENOERR;
03304 }

int ncx_getn_float_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 3259 of file ncx.c.

References ncx_get_float_int(), and X_SIZEOF_FLOAT.

03260 {
03261         const char *xp = (const char *) *xpp;
03262         int status = ENOERR;
03263 
03264         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03265         {
03266                 const int lstatus = ncx_get_float_int(xp, tp);
03267                 if(lstatus != ENOERR)
03268                         status = lstatus;
03269         }
03270 
03271         *xpp = (const void *)xp;
03272         return status;
03273 }

int ncx_getn_float_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 3276 of file ncx.c.

References ncx_get_float_long(), and X_SIZEOF_FLOAT.

03277 {
03278         const char *xp = (const char *) *xpp;
03279         int status = ENOERR;
03280 
03281         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03282         {
03283                 const int lstatus = ncx_get_float_long(xp, tp);
03284                 if(lstatus != ENOERR)
03285                         status = lstatus;
03286         }
03287 
03288         *xpp = (const void *)xp;
03289         return status;
03290 }

int ncx_getn_float_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 3208 of file ncx.c.

References ncx_get_float_schar(), and X_SIZEOF_FLOAT.

03209 {
03210         const char *xp = (const char *) *xpp;
03211         int status = ENOERR;
03212 
03213         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03214         {
03215                 const int lstatus = ncx_get_float_schar(xp, tp);
03216                 if(lstatus != ENOERR)
03217                         status = lstatus;
03218         }
03219 
03220         *xpp = (const void *)xp;
03221         return status;
03222 }

int ncx_getn_float_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 3242 of file ncx.c.

References ncx_get_float_short(), and X_SIZEOF_FLOAT.

03243 {
03244         const char *xp = (const char *) *xpp;
03245         int status = ENOERR;
03246 
03247         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03248         {
03249                 const int lstatus = ncx_get_float_short(xp, tp);
03250                 if(lstatus != ENOERR)
03251                         status = lstatus;
03252         }
03253 
03254         *xpp = (const void *)xp;
03255         return status;
03256 }

int ncx_getn_float_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 3225 of file ncx.c.

References ncx_get_float_uchar(), and X_SIZEOF_FLOAT.

03226 {
03227         const char *xp = (const char *) *xpp;
03228         int status = ENOERR;
03229 
03230         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03231         {
03232                 const int lstatus = ncx_get_float_uchar(xp, tp);
03233                 if(lstatus != ENOERR)
03234                         status = lstatus;
03235         }
03236 
03237         *xpp = (const void *)xp;
03238         return status;
03239 }

int ncx_getn_int_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 3037 of file ncx.c.

References ncx_get_int_double(), and X_SIZEOF_INT.

03038 {
03039         const char *xp = (const char *) *xpp;
03040         int status = ENOERR;
03041 
03042         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03043         {
03044                 const int lstatus = ncx_get_int_double(xp, tp);
03045                 if(lstatus != ENOERR)
03046                         status = lstatus;
03047         }
03048 
03049         *xpp = (const void *)xp;
03050         return status;
03051 }

int ncx_getn_int_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 3020 of file ncx.c.

References ncx_get_int_float(), and X_SIZEOF_INT.

03021 {
03022         const char *xp = (const char *) *xpp;
03023         int status = ENOERR;
03024 
03025         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03026         {
03027                 const int lstatus = ncx_get_int_float(xp, tp);
03028                 if(lstatus != ENOERR)
03029                         status = lstatus;
03030         }
03031 
03032         *xpp = (const void *)xp;
03033         return status;
03034 }

int ncx_getn_int_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 2958 of file ncx.c.

References X_SIZEOF_INT.

02959 {
02960 # if WORDS_BIGENDIAN
02961         (void) memcpy(tp, *xpp, nelems * sizeof(int));
02962 # else
02963         swapn4b(tp, *xpp, nelems);
02964 # endif
02965         *xpp = (const void *)((const char *)(*xpp) + nelems * X_SIZEOF_INT);
02966         return ENOERR;
02967 }

int ncx_getn_int_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 2990 of file ncx.c.

References X_SIZEOF_INT.

02991 {
02992 # if WORDS_BIGENDIAN
02993         (void) memcpy(tp, *xpp, nelems * sizeof(long));
02994 # else
02995         swapn4b(tp, *xpp, nelems);
02996 # endif
02997         *xpp = (const void *)((const char *)(*xpp) + nelems * X_SIZEOF_INT);
02998         return ENOERR;
02999 }

int ncx_getn_int_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 2905 of file ncx.c.

References ncx_get_int_schar(), and X_SIZEOF_INT.

02906 {
02907         const char *xp = (const char *) *xpp;
02908         int status = ENOERR;
02909 
02910         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
02911         {
02912                 const int lstatus = ncx_get_int_schar(xp, tp);
02913                 if(lstatus != ENOERR)
02914                         status = lstatus;
02915         }
02916 
02917         *xpp = (const void *)xp;
02918         return status;
02919 }

int ncx_getn_int_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 2939 of file ncx.c.

References ncx_get_int_short(), and X_SIZEOF_INT.

02940 {
02941         const char *xp = (const char *) *xpp;
02942         int status = ENOERR;
02943 
02944         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
02945         {
02946                 const int lstatus = ncx_get_int_short(xp, tp);
02947                 if(lstatus != ENOERR)
02948                         status = lstatus;
02949         }
02950 
02951         *xpp = (const void *)xp;
02952         return status;
02953 }

int ncx_getn_int_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 2922 of file ncx.c.

References ncx_get_int_uchar(), and X_SIZEOF_INT.

02923 {
02924         const char *xp = (const char *) *xpp;
02925         int status = ENOERR;
02926 
02927         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
02928         {
02929                 const int lstatus = ncx_get_int_uchar(xp, tp);
02930                 if(lstatus != ENOERR)
02931                         status = lstatus;
02932         }
02933 
02934         *xpp = (const void *)xp;
02935         return status;
02936 }

int ncx_getn_schar_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 1874 of file ncx.c.

01875 {
01876         schar *xp = (schar *)(*xpp);
01877 
01878         while(nelems-- != 0)
01879         {
01880                 *tp++ = *xp++;
01881         }
01882 
01883         *xpp = (const void *)xp;
01884         return ENOERR;
01885 }

int ncx_getn_schar_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 1860 of file ncx.c.

01861 {
01862         schar *xp = (schar *)(*xpp);
01863 
01864         while(nelems-- != 0)
01865         {
01866                 *tp++ = *xp++;
01867         }
01868 
01869         *xpp = (const void *)xp;
01870         return ENOERR;
01871 }

int ncx_getn_schar_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 1832 of file ncx.c.

01833 {
01834         schar *xp = (schar *)(*xpp);
01835 
01836         while(nelems-- != 0)
01837         {
01838                 *tp++ = *xp++;
01839         }
01840 
01841         *xpp = (const void *)xp;
01842         return ENOERR;
01843 }

int ncx_getn_schar_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 1846 of file ncx.c.

01847 {
01848         schar *xp = (schar *)(*xpp);
01849 
01850         while(nelems-- != 0)
01851         {
01852                 *tp++ = *xp++;
01853         }
01854 
01855         *xpp = (const void *)xp;
01856         return ENOERR;
01857 }

int ncx_getn_schar_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 1802 of file ncx.c.

01803 {
01804                 (void) memcpy(tp, *xpp, nelems);
01805         *xpp = (void *)((char *)(*xpp) + nelems);
01806         return ENOERR;
01807 
01808 }

int ncx_getn_schar_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 1818 of file ncx.c.

01819 {
01820         schar *xp = (schar *)(*xpp);
01821 
01822         while(nelems-- != 0)
01823         {
01824                 *tp++ = *xp++;
01825         }
01826 
01827         *xpp = (const void *)xp;
01828         return ENOERR;
01829 }

int ncx_getn_schar_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 1810 of file ncx.c.

01811 {
01812                 (void) memcpy(tp, *xpp, nelems);
01813         *xpp = (void *)((char *)(*xpp) + nelems);
01814         return ENOERR;
01815 
01816 }

int ncx_getn_short_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 2418 of file ncx.c.

References ncx_get_short_double(), and X_SIZEOF_SHORT.

02419 {
02420         const char *xp = (const char *) *xpp;
02421         int status = ENOERR;
02422 
02423         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02424         {
02425                 const int lstatus = ncx_get_short_double(xp, tp);
02426                 if(lstatus != ENOERR)
02427                         status = lstatus;
02428         }
02429 
02430         *xpp = (const void *)xp;
02431         return status;
02432 }

int ncx_getn_short_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 2401 of file ncx.c.

References ncx_get_short_float(), and X_SIZEOF_SHORT.

02402 {
02403         const char *xp = (const char *) *xpp;
02404         int status = ENOERR;
02405 
02406         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02407         {
02408                 const int lstatus = ncx_get_short_float(xp, tp);
02409                 if(lstatus != ENOERR)
02410                         status = lstatus;
02411         }
02412 
02413         *xpp = (const void *)xp;
02414         return status;
02415 }

int ncx_getn_short_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 2367 of file ncx.c.

References ncx_get_short_int(), and X_SIZEOF_SHORT.

02368 {
02369         const char *xp = (const char *) *xpp;
02370         int status = ENOERR;
02371 
02372         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02373         {
02374                 const int lstatus = ncx_get_short_int(xp, tp);
02375                 if(lstatus != ENOERR)
02376                         status = lstatus;
02377         }
02378 
02379         *xpp = (const void *)xp;
02380         return status;
02381 }

int ncx_getn_short_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 2384 of file ncx.c.

References ncx_get_short_long(), and X_SIZEOF_SHORT.

02385 {
02386         const char *xp = (const char *) *xpp;
02387         int status = ENOERR;
02388 
02389         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02390         {
02391                 const int lstatus = ncx_get_short_long(xp, tp);
02392                 if(lstatus != ENOERR)
02393                         status = lstatus;
02394         }
02395 
02396         *xpp = (const void *)xp;
02397         return status;
02398 }

int ncx_getn_short_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 2301 of file ncx.c.

References ncx_get_short_schar(), and X_SIZEOF_SHORT.

02302 {
02303         const char *xp = (const char *) *xpp;
02304         int status = ENOERR;
02305 
02306         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02307         {
02308                 const int lstatus = ncx_get_short_schar(xp, tp);
02309                 if(lstatus != ENOERR)
02310                         status = lstatus;
02311         }
02312 
02313         *xpp = (const void *)xp;
02314         return status;
02315 }

int ncx_getn_short_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 2337 of file ncx.c.

References X_SIZEOF_SHORT.

02338 {
02339 # if WORDS_BIGENDIAN
02340         (void) memcpy(tp, *xpp, nelems * sizeof(short));
02341 # else
02342         swapn2b(tp, *xpp, nelems);
02343 # endif
02344         *xpp = (const void *)((const char *)(*xpp) + nelems * X_SIZEOF_SHORT);
02345         return ENOERR;
02346 }

int ncx_getn_short_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 2318 of file ncx.c.

References ncx_get_short_uchar(), and X_SIZEOF_SHORT.

02319 {
02320         const char *xp = (const char *) *xpp;
02321         int status = ENOERR;
02322 
02323         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02324         {
02325                 const int lstatus = ncx_get_short_uchar(xp, tp);
02326                 if(lstatus != ENOERR)
02327                         status = lstatus;
02328         }
02329 
02330         *xpp = (const void *)xp;
02331         return status;
02332 }

int ncx_getn_text const void **    xpp,
size_t    nelems,
char *    tp
 

Definition at line 4051 of file ncx.c.

04052 {
04053         (void) memcpy(tp, *xpp, nelems);
04054         *xpp = (void *)((char *)(*xpp) + nelems);
04055         return ENOERR;
04056 
04057 }

int ncx_getn_void const void **    xpp,
size_t    nelems,
void *    tp
 

Definition at line 4109 of file ncx.c.

04110 {
04111         (void) memcpy(tp, *xpp, nelems);
04112         *xpp = (void *)((char *)(*xpp) + nelems);
04113         return ENOERR;
04114 
04115 }

int ncx_pad_getn_schar_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 1989 of file ncx.c.

References X_ALIGN.

01990 {
01991         size_t rndup = nelems % X_ALIGN;
01992         schar *xp = (schar *) *xpp;
01993 
01994         if(rndup)
01995                 rndup = X_ALIGN - rndup;
01996 
01997         while(nelems-- != 0)
01998         {
01999                 *tp++ = *xp++;
02000         }
02001 
02002         *xpp = (void *)(xp + rndup);
02003         return ENOERR;
02004 }

int ncx_pad_getn_schar_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 1971 of file ncx.c.

References X_ALIGN.

01972 {
01973         size_t rndup = nelems % X_ALIGN;
01974         schar *xp = (schar *) *xpp;
01975 
01976         if(rndup)
01977                 rndup = X_ALIGN - rndup;
01978 
01979         while(nelems-- != 0)
01980         {
01981                 *tp++ = *xp++;
01982         }
01983 
01984         *xpp = (void *)(xp + rndup);
01985         return ENOERR;
01986 }

int ncx_pad_getn_schar_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 1935 of file ncx.c.

References X_ALIGN.

01936 {
01937         size_t rndup = nelems % X_ALIGN;
01938         schar *xp = (schar *) *xpp;
01939 
01940         if(rndup)
01941                 rndup = X_ALIGN - rndup;
01942 
01943         while(nelems-- != 0)
01944         {
01945                 *tp++ = *xp++;
01946         }
01947 
01948         *xpp = (void *)(xp + rndup);
01949         return ENOERR;
01950 }

int ncx_pad_getn_schar_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 1953 of file ncx.c.

References X_ALIGN.

01954 {
01955         size_t rndup = nelems % X_ALIGN;
01956         schar *xp = (schar *) *xpp;
01957 
01958         if(rndup)
01959                 rndup = X_ALIGN - rndup;
01960 
01961         while(nelems-- != 0)
01962         {
01963                 *tp++ = *xp++;
01964         }
01965 
01966         *xpp = (void *)(xp + rndup);
01967         return ENOERR;
01968 }

int ncx_pad_getn_schar_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 1889 of file ncx.c.

References X_ALIGN.

01890 {
01891                 size_t rndup = nelems % X_ALIGN;
01892 
01893         if(rndup)
01894                 rndup = X_ALIGN - rndup;
01895 
01896         (void) memcpy(tp, *xpp, nelems);
01897         *xpp = (void *)((char *)(*xpp) + nelems + rndup);
01898 
01899         return ENOERR;
01900 
01901 }

int ncx_pad_getn_schar_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 1917 of file ncx.c.

References X_ALIGN.

01918 {
01919         size_t rndup = nelems % X_ALIGN;
01920         schar *xp = (schar *) *xpp;
01921 
01922         if(rndup)
01923                 rndup = X_ALIGN - rndup;
01924 
01925         while(nelems-- != 0)
01926         {
01927                 *tp++ = *xp++;
01928         }
01929 
01930         *xpp = (void *)(xp + rndup);
01931         return ENOERR;
01932 }

int ncx_pad_getn_schar_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 1903 of file ncx.c.

References X_ALIGN.

01904 {
01905                 size_t rndup = nelems % X_ALIGN;
01906 
01907         if(rndup)
01908                 rndup = X_ALIGN - rndup;
01909 
01910         (void) memcpy(tp, *xpp, nelems);
01911         *xpp = (void *)((char *)(*xpp) + nelems + rndup);
01912 
01913         return ENOERR;
01914 
01915 }

int ncx_pad_getn_short_double const void **    xpp,
size_t    nelems,
double *    tp
 

Definition at line 2568 of file ncx.c.

References ncx_get_short_double(), and X_SIZEOF_SHORT.

02569 {
02570         const size_t rndup = nelems % 2;
02571 
02572         const char *xp = (const char *) *xpp;
02573         int status = ENOERR;
02574 
02575         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02576         {
02577                 const int lstatus = ncx_get_short_double(xp, tp);
02578                 if(lstatus != ENOERR)
02579                         status = lstatus;
02580         }
02581 
02582         if(rndup != 0)
02583                 xp += X_SIZEOF_SHORT;
02584                 
02585         *xpp = (void *)xp;
02586         return status;
02587 }

int ncx_pad_getn_short_float const void **    xpp,
size_t    nelems,
float *    tp
 

Definition at line 2546 of file ncx.c.

References ncx_get_short_float(), and X_SIZEOF_SHORT.

02547 {
02548         const size_t rndup = nelems % 2;
02549 
02550         const char *xp = (const char *) *xpp;
02551         int status = ENOERR;
02552 
02553         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02554         {
02555                 const int lstatus = ncx_get_short_float(xp, tp);
02556                 if(lstatus != ENOERR)
02557                         status = lstatus;
02558         }
02559 
02560         if(rndup != 0)
02561                 xp += X_SIZEOF_SHORT;
02562                 
02563         *xpp = (void *)xp;
02564         return status;
02565 }

int ncx_pad_getn_short_int const void **    xpp,
size_t    nelems,
int *    tp
 

Definition at line 2502 of file ncx.c.

References ncx_get_short_int(), and X_SIZEOF_SHORT.

02503 {
02504         const size_t rndup = nelems % 2;
02505 
02506         const char *xp = (const char *) *xpp;
02507         int status = ENOERR;
02508 
02509         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02510         {
02511                 const int lstatus = ncx_get_short_int(xp, tp);
02512                 if(lstatus != ENOERR)
02513                         status = lstatus;
02514         }
02515 
02516         if(rndup != 0)
02517                 xp += X_SIZEOF_SHORT;
02518                 
02519         *xpp = (void *)xp;
02520         return status;
02521 }

int ncx_pad_getn_short_long const void **    xpp,
size_t    nelems,
long *    tp
 

Definition at line 2524 of file ncx.c.

References ncx_get_short_long(), and X_SIZEOF_SHORT.

02525 {
02526         const size_t rndup = nelems % 2;
02527 
02528         const char *xp = (const char *) *xpp;
02529         int status = ENOERR;
02530 
02531         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02532         {
02533                 const int lstatus = ncx_get_short_long(xp, tp);
02534                 if(lstatus != ENOERR)
02535                         status = lstatus;
02536         }
02537 
02538         if(rndup != 0)
02539                 xp += X_SIZEOF_SHORT;
02540                 
02541         *xpp = (void *)xp;
02542         return status;
02543 }

int ncx_pad_getn_short_schar const void **    xpp,
size_t    nelems,
schar   tp
 

Definition at line 2436 of file ncx.c.

References ncx_get_short_schar(), and X_SIZEOF_SHORT.

02437 {
02438         const size_t rndup = nelems % 2;
02439 
02440         const char *xp = (const char *) *xpp;
02441         int status = ENOERR;
02442 
02443         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02444         {
02445                 const int lstatus = ncx_get_short_schar(xp, tp);
02446                 if(lstatus != ENOERR)
02447                         status = lstatus;
02448         }
02449 
02450         if(rndup != 0)
02451                 xp += X_SIZEOF_SHORT;
02452                 
02453         *xpp = (void *)xp;
02454         return status;
02455 }

int ncx_pad_getn_short_short const void **    xpp,
size_t    nelems,
short *    tp
 

Definition at line 2480 of file ncx.c.

References ncx_get_short_short(), and X_SIZEOF_SHORT.

02481 {
02482         const size_t rndup = nelems % 2;
02483 
02484         const char *xp = (const char *) *xpp;
02485         int status = ENOERR;
02486 
02487         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02488         {
02489                 const int lstatus = ncx_get_short_short(xp, tp);
02490                 if(lstatus != ENOERR)
02491                         status = lstatus;
02492         }
02493 
02494         if(rndup != 0)
02495                 xp += X_SIZEOF_SHORT;
02496                 
02497         *xpp = (void *)xp;
02498         return status;
02499 }

int ncx_pad_getn_short_uchar const void **    xpp,
size_t    nelems,
uchar   tp
 

Definition at line 2458 of file ncx.c.

References ncx_get_short_uchar(), and X_SIZEOF_SHORT.

02459 {
02460         const size_t rndup = nelems % 2;
02461 
02462         const char *xp = (const char *) *xpp;
02463         int status = ENOERR;
02464 
02465         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02466         {
02467                 const int lstatus = ncx_get_short_uchar(xp, tp);
02468                 if(lstatus != ENOERR)
02469                         status = lstatus;
02470         }
02471 
02472         if(rndup != 0)
02473                 xp += X_SIZEOF_SHORT;
02474                 
02475         *xpp = (void *)xp;
02476         return status;
02477 }

int ncx_pad_getn_text const void **    xpp,
size_t    nelems,
char *    tp
 

Definition at line 4060 of file ncx.c.

References X_ALIGN.

04061 {
04062         size_t rndup = nelems % X_ALIGN;
04063 
04064         if(rndup)
04065                 rndup = X_ALIGN - rndup;
04066 
04067         (void) memcpy(tp, *xpp, nelems);
04068         *xpp = (void *)((char *)(*xpp) + nelems + rndup);
04069 
04070         return ENOERR;
04071 
04072 }

int ncx_pad_getn_void const void **    xpp,
size_t    nelems,
void *    tp
 

Definition at line 4118 of file ncx.c.

References X_ALIGN.

04119 {
04120         size_t rndup = nelems % X_ALIGN;
04121 
04122         if(rndup)
04123                 rndup = X_ALIGN - rndup;
04124 
04125         (void) memcpy(tp, *xpp, nelems);
04126         *xpp = (void *)((char *)(*xpp) + nelems + rndup);
04127 
04128         return ENOERR;
04129 
04130 }

int ncx_pad_putn_schar_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 2268 of file ncx.c.

References nada, X_ALIGN, X_SCHAR_MAX, and X_SCHAR_MIN.

02269 {
02270         int status = ENOERR;
02271         size_t rndup = nelems % X_ALIGN;
02272         schar *xp = (schar *) *xpp;
02273 
02274         if(rndup)
02275                 rndup = X_ALIGN - rndup;
02276 
02277         while(nelems-- != 0)
02278         {
02279                 /* N.B. schar as signed */
02280                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02281                         status = NC_ERANGE;
02282                 *xp++ = (schar) *tp++;
02283         }
02284 
02285 
02286         if(rndup)
02287         {
02288                 (void) memcpy(xp, nada, rndup);
02289                 xp += rndup;
02290         }
02291 
02292         *xpp = (void *)xp;
02293         return status;
02294 }

int ncx_pad_putn_schar_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 2239 of file ncx.c.

References nada, X_ALIGN, X_SCHAR_MAX, and X_SCHAR_MIN.

02240 {
02241         int status = ENOERR;
02242         size_t rndup = nelems % X_ALIGN;
02243         schar *xp = (schar *) *xpp;
02244 
02245         if(rndup)
02246                 rndup = X_ALIGN - rndup;
02247 
02248         while(nelems-- != 0)
02249         {
02250                 /* N.B. schar as signed */
02251                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02252                         status = NC_ERANGE;
02253                 *xp++ = (schar) *tp++;
02254         }
02255 
02256 
02257         if(rndup)
02258         {
02259                 (void) memcpy(xp, nada, rndup);
02260                 xp += rndup;
02261         }
02262 
02263         *xpp = (void *)xp;
02264         return status;
02265 }

int ncx_pad_putn_schar_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 2181 of file ncx.c.

References nada, X_ALIGN, X_SCHAR_MAX, and X_SCHAR_MIN.

02182 {
02183         int status = ENOERR;
02184         size_t rndup = nelems % X_ALIGN;
02185         schar *xp = (schar *) *xpp;
02186 
02187         if(rndup)
02188                 rndup = X_ALIGN - rndup;
02189 
02190         while(nelems-- != 0)
02191         {
02192                 /* N.B. schar as signed */
02193                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02194                         status = NC_ERANGE;
02195                 *xp++ = (schar) *tp++;
02196         }
02197 
02198 
02199         if(rndup)
02200         {
02201                 (void) memcpy(xp, nada, rndup);
02202                 xp += rndup;
02203         }
02204 
02205         *xpp = (void *)xp;
02206         return status;
02207 }

int ncx_pad_putn_schar_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 2210 of file ncx.c.

References nada, X_ALIGN, X_SCHAR_MAX, and X_SCHAR_MIN.

02211 {
02212         int status = ENOERR;
02213         size_t rndup = nelems % X_ALIGN;
02214         schar *xp = (schar *) *xpp;
02215 
02216         if(rndup)
02217                 rndup = X_ALIGN - rndup;
02218 
02219         while(nelems-- != 0)
02220         {
02221                 /* N.B. schar as signed */
02222                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02223                         status = NC_ERANGE;
02224                 *xp++ = (schar) *tp++;
02225         }
02226 
02227 
02228         if(rndup)
02229         {
02230                 (void) memcpy(xp, nada, rndup);
02231                 xp += rndup;
02232         }
02233 
02234         *xpp = (void *)xp;
02235         return status;
02236 }

int ncx_pad_putn_schar_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 2112 of file ncx.c.

References nada, and X_ALIGN.

02113 {
02114                 size_t rndup = nelems % X_ALIGN;
02115 
02116         if(rndup)
02117                 rndup = X_ALIGN - rndup;
02118 
02119         (void) memcpy(*xpp, tp, nelems);
02120         *xpp = (void *)((char *)(*xpp) + nelems);
02121 
02122         if(rndup)
02123         {
02124                 (void) memcpy(*xpp, nada, rndup);
02125                 *xpp = (void *)((char *)(*xpp) + rndup);
02126         }
02127         
02128         return ENOERR;
02129 
02130 }

int ncx_pad_putn_schar_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 2152 of file ncx.c.

References nada, X_ALIGN, X_SCHAR_MAX, and X_SCHAR_MIN.

02153 {
02154         int status = ENOERR;
02155         size_t rndup = nelems % X_ALIGN;
02156         schar *xp = (schar *) *xpp;
02157 
02158         if(rndup)
02159                 rndup = X_ALIGN - rndup;
02160 
02161         while(nelems-- != 0)
02162         {
02163                 /* N.B. schar as signed */
02164                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02165                         status = NC_ERANGE;
02166                 *xp++ = (schar) *tp++;
02167         }
02168 
02169 
02170         if(rndup)
02171         {
02172                 (void) memcpy(xp, nada, rndup);
02173                 xp += rndup;
02174         }
02175 
02176         *xpp = (void *)xp;
02177         return status;
02178 }

int ncx_pad_putn_schar_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 2132 of file ncx.c.

References nada, and X_ALIGN.

02133 {
02134                 size_t rndup = nelems % X_ALIGN;
02135 
02136         if(rndup)
02137                 rndup = X_ALIGN - rndup;
02138 
02139         (void) memcpy(*xpp, tp, nelems);
02140         *xpp = (void *)((char *)(*xpp) + nelems);
02141 
02142         if(rndup)
02143         {
02144                 (void) memcpy(*xpp, nada, rndup);
02145                 *xpp = (void *)((char *)(*xpp) + rndup);
02146         }
02147         
02148         return ENOERR;
02149 
02150 }

int ncx_pad_putn_short_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 2876 of file ncx.c.

References nada, ncx_put_short_double(), and X_SIZEOF_SHORT.

02877 {
02878         const size_t rndup = nelems % 2;
02879 
02880         char *xp = (char *) *xpp;
02881         int status = ENOERR;
02882 
02883         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02884         {
02885                 int lstatus = ncx_put_short_double(xp, tp);
02886                 if(lstatus != ENOERR)
02887                         status = lstatus;
02888         }
02889 
02890         if(rndup != 0)
02891         {
02892                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02893                 xp += X_SIZEOF_SHORT;   
02894         }
02895                 
02896         *xpp = (void *)xp;
02897         return status;
02898 }

int ncx_pad_putn_short_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 2851 of file ncx.c.

References nada, ncx_put_short_float(), and X_SIZEOF_SHORT.

02852 {
02853         const size_t rndup = nelems % 2;
02854 
02855         char *xp = (char *) *xpp;
02856         int status = ENOERR;
02857 
02858         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02859         {
02860                 int lstatus = ncx_put_short_float(xp, tp);
02861                 if(lstatus != ENOERR)
02862                         status = lstatus;
02863         }
02864 
02865         if(rndup != 0)
02866         {
02867                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02868                 xp += X_SIZEOF_SHORT;   
02869         }
02870                 
02871         *xpp = (void *)xp;
02872         return status;
02873 }

int ncx_pad_putn_short_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 2801 of file ncx.c.

References nada, ncx_put_short_int(), and X_SIZEOF_SHORT.

02802 {
02803         const size_t rndup = nelems % 2;
02804 
02805         char *xp = (char *) *xpp;
02806         int status = ENOERR;
02807 
02808         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02809         {
02810                 int lstatus = ncx_put_short_int(xp, tp);
02811                 if(lstatus != ENOERR)
02812                         status = lstatus;
02813         }
02814 
02815         if(rndup != 0)
02816         {
02817                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02818                 xp += X_SIZEOF_SHORT;   
02819         }
02820                 
02821         *xpp = (void *)xp;
02822         return status;
02823 }

int ncx_pad_putn_short_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 2826 of file ncx.c.

References nada, ncx_put_short_long(), and X_SIZEOF_SHORT.

02827 {
02828         const size_t rndup = nelems % 2;
02829 
02830         char *xp = (char *) *xpp;
02831         int status = ENOERR;
02832 
02833         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02834         {
02835                 int lstatus = ncx_put_short_long(xp, tp);
02836                 if(lstatus != ENOERR)
02837                         status = lstatus;
02838         }
02839 
02840         if(rndup != 0)
02841         {
02842                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02843                 xp += X_SIZEOF_SHORT;   
02844         }
02845                 
02846         *xpp = (void *)xp;
02847         return status;
02848 }

int ncx_pad_putn_short_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 2726 of file ncx.c.

References nada, ncx_put_short_schar(), and X_SIZEOF_SHORT.

02727 {
02728         const size_t rndup = nelems % 2;
02729 
02730         char *xp = (char *) *xpp;
02731         int status = ENOERR;
02732 
02733         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02734         {
02735                 int lstatus = ncx_put_short_schar(xp, tp);
02736                 if(lstatus != ENOERR)
02737                         status = lstatus;
02738         }
02739 
02740         if(rndup != 0)
02741         {
02742                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02743                 xp += X_SIZEOF_SHORT;   
02744         }
02745                 
02746         *xpp = (void *)xp;
02747         return status;
02748 }

int ncx_pad_putn_short_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 2776 of file ncx.c.

References nada, ncx_put_short_short(), and X_SIZEOF_SHORT.

02777 {
02778         const size_t rndup = nelems % 2;
02779 
02780         char *xp = (char *) *xpp;
02781         int status = ENOERR;
02782 
02783         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02784         {
02785                 int lstatus = ncx_put_short_short(xp, tp);
02786                 if(lstatus != ENOERR)
02787                         status = lstatus;
02788         }
02789 
02790         if(rndup != 0)
02791         {
02792                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02793                 xp += X_SIZEOF_SHORT;   
02794         }
02795                 
02796         *xpp = (void *)xp;
02797         return status;
02798 }

int ncx_pad_putn_short_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 2751 of file ncx.c.

References nada, ncx_put_short_uchar(), and X_SIZEOF_SHORT.

02752 {
02753         const size_t rndup = nelems % 2;
02754 
02755         char *xp = (char *) *xpp;
02756         int status = ENOERR;
02757 
02758         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02759         {
02760                 int lstatus = ncx_put_short_uchar(xp, tp);
02761                 if(lstatus != ENOERR)
02762                         status = lstatus;
02763         }
02764 
02765         if(rndup != 0)
02766         {
02767                 (void) memcpy(xp, nada, X_SIZEOF_SHORT);
02768                 xp += X_SIZEOF_SHORT;   
02769         }
02770                 
02771         *xpp = (void *)xp;
02772         return status;
02773 }

int ncx_pad_putn_text void **    xpp,
size_t    nelems,
const char *    tp
 

Definition at line 4085 of file ncx.c.

References nada, and X_ALIGN.

04086 {
04087         size_t rndup = nelems % X_ALIGN;
04088 
04089         if(rndup)
04090                 rndup = X_ALIGN - rndup;
04091 
04092         (void) memcpy(*xpp, tp, nelems);
04093         *xpp = (void *)((char *)(*xpp) + nelems);
04094 
04095         if(rndup)
04096         {
04097                 (void) memcpy(*xpp, nada, rndup);
04098                 *xpp = (void *)((char *)(*xpp) + rndup);
04099         }
04100         
04101         return ENOERR;
04102 
04103 }

int ncx_pad_putn_void void **    xpp,
size_t    nelems,
const void *    tp
 

Definition at line 4143 of file ncx.c.

References nada, and X_ALIGN.

04144 {
04145         size_t rndup = nelems % X_ALIGN;
04146 
04147         if(rndup)
04148                 rndup = X_ALIGN - rndup;
04149 
04150         (void) memcpy(*xpp, tp, nelems);
04151         *xpp = (void *)((char *)(*xpp) + nelems);
04152 
04153         if(rndup)
04154         {
04155                 (void) memcpy(*xpp, nada, rndup);
04156                 *xpp = (void *)((char *)(*xpp) + rndup);
04157         }
04158         
04159         return ENOERR;
04160 
04161 }

int ncx_put_double_double void *    xp,
const double *    ip
 

Definition at line 1697 of file ncx.c.

References put_ix_double().

01698 {
01699         put_ix_double(xp, ip);
01700 #ifdef NO_IEEE_FLOAT
01701         if(*ip > X_DOUBLE_MAX || *ip < X_DOUBLE_MIN)
01702                 return NC_ERANGE;
01703 #endif
01704         return ENOERR;
01705 }

int ncx_put_double_float void *    xp,
const float *    ip
 

Definition at line 1685 of file ncx.c.

References put_ix_double().

01686 {
01687         double xx = (double) *ip;
01688         put_ix_double(xp, &xx);
01689 #if 1   /* TODO: figure this out */
01690         if((double)(*ip) > X_DOUBLE_MAX || (double)(*ip) < X_DOUBLE_MIN)
01691                 return NC_ERANGE;
01692 #endif
01693         return ENOERR;
01694 }

int ncx_put_double_int void *    xp,
const int *    ip
 

Definition at line 1661 of file ncx.c.

References put_ix_double().

01662 {
01663         double xx = (double) *ip;
01664         put_ix_double(xp, &xx);
01665 #if 0   /* TODO: figure this out */
01666         if((double)(*ip) > X_DOUBLE_MAX || (double)(*ip) < X_DOUBLE_MIN)
01667                 return NC_ERANGE;
01668 #endif
01669         return ENOERR;
01670 }

int ncx_put_double_long void *    xp,
const long *    ip
 

Definition at line 1673 of file ncx.c.

References put_ix_double().

01674 {
01675         double xx = (double) *ip;
01676         put_ix_double(xp, &xx);
01677 #if 1   /* TODO: figure this out */
01678         if((double)(*ip) > X_DOUBLE_MAX || (double)(*ip) < X_DOUBLE_MIN)
01679                 return NC_ERANGE;
01680 #endif
01681         return ENOERR;
01682 }

int ncx_put_double_schar void *    xp,
const schar   ip
 

Definition at line 1633 of file ncx.c.

References put_ix_double().

01634 {
01635         double xx = (double) *ip;
01636         put_ix_double(xp, &xx);
01637         return ENOERR;
01638 }

int ncx_put_double_short void *    xp,
const short *    ip
 

Definition at line 1649 of file ncx.c.

References put_ix_double().

01650 {
01651         double xx = (double) *ip;
01652         put_ix_double(xp, &xx);
01653 #if 0   /* TODO: figure this out */
01654         if((double)(*ip) > X_DOUBLE_MAX || (double)(*ip) < X_DOUBLE_MIN)
01655                 return NC_ERANGE;
01656 #endif
01657         return ENOERR;
01658 }

int ncx_put_double_uchar void *    xp,
const uchar   ip
 

Definition at line 1641 of file ncx.c.

References put_ix_double().

01642 {
01643         double xx = (double) *ip;
01644         put_ix_double(xp, &xx);
01645         return ENOERR;
01646 }

int ncx_put_float_double void *    xp,
const double *    ip
 

Definition at line 1265 of file ncx.c.

References put_ix_float.

01266 {
01267         float xx = (float) *ip;
01268         put_ix_float(xp, &xx);
01269         if(*ip > X_FLOAT_MAX || *ip < X_FLOAT_MIN)
01270                 return NC_ERANGE;
01271         return ENOERR;
01272 }

int ncx_put_float_float void *    xp,
const float *    ip
 

Definition at line 1254 of file ncx.c.

References put_ix_float.

01255 {
01256         put_ix_float(xp, ip);
01257 #ifdef NO_IEEE_FLOAT
01258         if(*ip > X_FLOAT_MAX || *ip < X_FLOAT_MIN)
01259                 return NC_ERANGE;
01260 #endif
01261         return ENOERR;
01262 }

int ncx_put_float_int void *    xp,
const int *    ip
 

Definition at line 1230 of file ncx.c.

References put_ix_float.

01231 {
01232         float xx = (float) *ip;
01233         put_ix_float(xp, &xx);
01234 #if 1   /* TODO: figure this out */
01235         if((float)(*ip) > X_FLOAT_MAX || (float)(*ip) < X_FLOAT_MIN)
01236                 return NC_ERANGE;
01237 #endif
01238         return ENOERR;
01239 }

int ncx_put_float_long void *    xp,
const long *    ip
 

Definition at line 1242 of file ncx.c.

References put_ix_float.

01243 {
01244         float xx = (float) *ip;
01245         put_ix_float(xp, &xx);
01246 #if 1   /* TODO: figure this out */
01247         if((float)(*ip) > X_FLOAT_MAX || (float)(*ip) < X_FLOAT_MIN)
01248                 return NC_ERANGE;
01249 #endif
01250         return ENOERR;
01251 }

int ncx_put_float_schar void *    xp,
const schar   ip
 

Definition at line 1202 of file ncx.c.

References put_ix_float.

01203 {
01204         float xx = (float) *ip;
01205         put_ix_float(xp, &xx);
01206         return ENOERR;
01207 }

int ncx_put_float_short void *    xp,
const short *    ip
 

Definition at line 1218 of file ncx.c.

References put_ix_float.

01219 {
01220         float xx = (float) *ip;
01221         put_ix_float(xp, &xx);
01222 #if 0   /* TODO: figure this out */
01223         if((float)(*ip) > X_FLOAT_MAX || (float)(*ip) < X_FLOAT_MIN)
01224                 return NC_ERANGE;
01225 #endif
01226         return ENOERR;
01227 }

int ncx_put_float_uchar void *    xp,
const uchar   ip
 

Definition at line 1210 of file ncx.c.

References put_ix_float.

01211 {
01212         float xx = (float) *ip;
01213         put_ix_float(xp, &xx);
01214         return ENOERR;
01215 }

int ncx_put_int_double void *    xp,
const double *    ip
 

Definition at line 660 of file ncx.c.

References ix_int, and put_ix_int.

00661 {
00662         ix_int xx = (ix_int)(*ip);
00663         put_ix_int(xp, &xx);
00664         if(*ip > X_INT_MAX || *ip < X_INT_MIN)
00665                 return NC_ERANGE;
00666         return ENOERR;
00667 }

int ncx_put_int_float void *    xp,
const float *    ip
 

Definition at line 650 of file ncx.c.

References ix_int, and put_ix_int.

00651 {
00652         ix_int xx = (ix_int)(*ip);
00653         put_ix_int(xp, &xx);
00654         if(*ip > (double)X_INT_MAX || *ip < (double)X_INT_MIN)
00655                 return NC_ERANGE;
00656         return ENOERR;
00657 }

int ncx_put_int_int void *    xp,
const int *    ip
 

Definition at line 616 of file ncx.c.

References ix_int, and put_ix_int.

00617 {
00618 #if SIZEOF_IX_INT == SIZEOF_INT && IX_INT_MAX == INT_MAX
00619         put_ix_int(xp, (ix_int *)ip);
00620         return ENOERR;
00621 #else
00622         ix_int xx = (ix_int)(*ip);
00623         put_ix_int(xp, &xx);
00624 #   if IX_INT_MAX < INT_MAX
00625         if(*ip > X_INT_MAX || *ip < X_INT_MIN)
00626                 return NC_ERANGE;
00627 #   endif
00628         return ENOERR;
00629 #endif
00630 }

int ncx_put_int_long void *    xp,
const long *    ip
 

Definition at line 633 of file ncx.c.

References ix_int, and put_ix_int.

00634 {
00635 #if SIZEOF_IX_INT == SIZEOF_LONG && IX_INT_MAX == LONG_MAX
00636         put_ix_int(xp, (ix_int *)ip);
00637         return ENOERR;
00638 #else
00639         ix_int xx = (ix_int)(*ip);
00640         put_ix_int(xp, &xx);
00641 #   if IX_INT_MAX < LONG_MAX
00642         if(*ip > X_INT_MAX || *ip < X_INT_MIN)
00643                 return NC_ERANGE;
00644 #   endif
00645         return ENOERR;
00646 #endif
00647 }

int ncx_put_int_schar void *    xp,
const schar   ip
 

Definition at line 568 of file ncx.c.

00569 {
00570         uchar *cp = (uchar *) xp;
00571         if(*ip & 0x80)
00572         {
00573                 *cp++ = 0xff;
00574                 *cp++ = 0xff;
00575                 *cp++ = 0xff;
00576         }
00577         else
00578         {
00579                 *cp++ = 0x00;
00580                 *cp++ = 0x00;
00581                 *cp++ = 0x00;
00582         }
00583         *cp = (uchar)*ip;
00584         return ENOERR;
00585 }

int ncx_put_int_short void *    xp,
const short *    ip
 

Definition at line 599 of file ncx.c.

References ix_int, and put_ix_int.

00600 {
00601 #if SIZEOF_IX_INT == SIZEOF_SHORT && IX_INT_MAX == SHORT_MAX
00602         put_ix_int(xp, (ix_int *)ip);
00603         return ENOERR;
00604 #else
00605         ix_int xx = (ix_int)(*ip);
00606         put_ix_int(xp, &xx);
00607 #   if IX_INT_MAX < SHORT_MAX
00608         if(*ip > X_INT_MAX || *ip < X_INT_MIN)
00609                 return NC_ERANGE;
00610 #   endif
00611         return ENOERR;
00612 #endif
00613 }

int ncx_put_int_uchar void *    xp,
const uchar   ip
 

Definition at line 588 of file ncx.c.

00589 {
00590         uchar *cp = (uchar *) xp;
00591         *cp++ = 0x00;
00592         *cp++ = 0x00;
00593         *cp++ = 0x00;
00594         *cp   = *ip;
00595         return ENOERR;
00596 }

int ncx_put_off_t void **    xpp,
const off_t *    lp
 

Definition at line 1760 of file ncx.c.

References X_OFF_MAX, and X_SIZEOF_OFF_T.

01761 {
01762         /* similar to put_ix_int() */
01763         uchar *cp = (uchar *) *xpp;
01764                 /* No negative offsets stored in netcdf */
01765         assert(*lp >= 0 && *lp <= X_OFF_MAX);
01766 
01767         *cp++ = (uchar)((*lp) >> 24);
01768         *cp++ = (uchar)(((*lp) & 0x00ff0000) >> 16);
01769         *cp++ = (uchar)(((*lp) & 0x0000ff00) >>  8);
01770         *cp   = (uchar)((*lp) & 0x000000ff);
01771 
01772         *xpp = (void *)((char *)(*xpp) + X_SIZEOF_OFF_T);
01773         return ENOERR;
01774 }

int ncx_put_short_double void *    xp,
const double *    ip
 

Definition at line 410 of file ncx.c.

References ix_short, and put_ix_short().

00411 {
00412         ix_short xx = *ip;
00413         put_ix_short(xp, &xx);
00414         if(*ip > X_SHORT_MAX || *ip < X_SHORT_MIN)
00415                 return NC_ERANGE;
00416         return ENOERR;
00417 }

int ncx_put_short_float void *    xp,
const float *    ip
 

Definition at line 400 of file ncx.c.

References ix_short, and put_ix_short().

00401 {
00402         ix_short xx = *ip;
00403         put_ix_short(xp, &xx);
00404         if(*ip > X_SHORT_MAX || *ip < X_SHORT_MIN)
00405                 return NC_ERANGE;
00406         return ENOERR;
00407 }

int ncx_put_short_int void *    xp,
const int *    ip
 

Definition at line 366 of file ncx.c.

References ix_short, and put_ix_short().

00367 {
00368 #if SIZEOF_IX_SHORT == SIZEOF_INT && X_SHORT_MAX == INT_MAX
00369         put_ix_short(xp, (const ix_short *)ip);
00370         return ENOERR;
00371 #else
00372         ix_short xx = (ix_short)*ip;
00373         put_ix_short(xp, &xx);
00374 # if X_SHORT_MAX < INT_MAX
00375         if(*ip > X_SHORT_MAX || *ip < X_SHORT_MIN)
00376                 return NC_ERANGE;
00377 # endif
00378         return ENOERR;
00379 #endif
00380 }

int ncx_put_short_long void *    xp,
const long *    ip
 

Definition at line 383 of file ncx.c.

References ix_short, and put_ix_short().

00384 {
00385 #if SIZEOF_IX_SHORT == SIZEOF_LONG && X_SHORT_MAX == LONG_MAX
00386         put_ix_short(xp, (const ix_short *)ip);
00387         return ENOERR;
00388 #else
00389         ix_short xx = (ix_short)*ip;
00390         put_ix_short(xp, &xx);
00391 # if X_SHORT_MAX < LONG_MAX
00392         if(*ip > X_SHORT_MAX || *ip < X_SHORT_MIN)
00393                 return NC_ERANGE;
00394 # endif
00395         return ENOERR;
00396 #endif
00397 }

int ncx_put_short_schar void *    xp,
const schar   ip
 

Definition at line 328 of file ncx.c.

00329 {
00330         uchar *cp = (uchar *) xp;
00331         if(*ip & 0x80)
00332                 *cp++ = 0xff;
00333         else
00334                 *cp++ = 0;
00335         *cp = (uchar)*ip;
00336         return ENOERR;
00337 }

int ncx_put_short_short void *    xp,
const short *    ip
 

Definition at line 349 of file ncx.c.

References ix_short, and put_ix_short().

00350 {
00351 #if SIZEOF_IX_SHORT == SIZEOF_SHORT && X_SHORT_MAX == SHORT_MAX
00352         put_ix_short(xp, (const ix_short *)ip);
00353         return ENOERR;
00354 #else
00355         ix_short xx = (ix_short)*ip;
00356         put_ix_short(xp, &xx);
00357 # if X_SHORT_MAX < SHORT_MAX
00358         if(*ip > X_SHORT_MAX || *ip < X_SHORT_MIN)
00359                 return NC_ERANGE;
00360 # endif
00361         return ENOERR;
00362 #endif
00363 }

int ncx_put_short_uchar void *    xp,
const uchar   ip
 

Definition at line 340 of file ncx.c.

00341 {
00342         uchar *cp = (uchar *) xp;
00343         *cp++ = 0;
00344         *cp = *ip;
00345         return ENOERR;
00346 }

int ncx_put_size_t void **    xpp,
const size_t *    ulp
 

Definition at line 1718 of file ncx.c.

References X_SIZEOF_SIZE_T.

01719 {
01720         /* similar to put_ix_int() */
01721         uchar *cp = (uchar *) *xpp;
01722                 /* sizes limited to 2^31 -1 in netcdf */
01723         assert(*ulp <= X_SIZE_MAX && (long) (*ulp) >= 0);
01724 
01725         *cp++ = (uchar)((*ulp) >> 24);
01726         *cp++ = (uchar)(((*ulp) & 0x00ff0000) >> 16);
01727         *cp++ = (uchar)(((*ulp) & 0x0000ff00) >>  8);
01728         *cp   = (uchar)((*ulp) & 0x000000ff);
01729 
01730         *xpp = (void *)((char *)(*xpp) + X_SIZEOF_SIZE_T);
01731         return ENOERR;
01732 }

int ncx_putn_double_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 3928 of file ncx.c.

References X_SIZEOF_DOUBLE.

03929 {
03930 # if WORDS_BIGENDIAN
03931         (void) memcpy(*xpp, tp, nelems * X_SIZEOF_DOUBLE);
03932 # else
03933         swapn8b(*xpp, tp, nelems);
03934 # endif
03935         *xpp = (void *)((char *)(*xpp) + nelems * X_SIZEOF_DOUBLE);
03936         return ENOERR;
03937 }

int ncx_putn_double_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 3909 of file ncx.c.

References ncx_put_double_float(), and X_SIZEOF_DOUBLE.

03910 {
03911         char *xp = (char *) *xpp;
03912         int status = ENOERR;
03913 
03914         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03915         {
03916                 int lstatus = ncx_put_double_float(xp, tp);
03917                 if(lstatus != ENOERR)
03918                         status = lstatus;
03919         }
03920 
03921         *xpp = (void *)xp;
03922         return status;
03923 }

int ncx_putn_double_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 3875 of file ncx.c.

References ncx_put_double_int(), and X_SIZEOF_DOUBLE.

03876 {
03877         char *xp = (char *) *xpp;
03878         int status = ENOERR;
03879 
03880         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03881         {
03882                 int lstatus = ncx_put_double_int(xp, tp);
03883                 if(lstatus != ENOERR)
03884                         status = lstatus;
03885         }
03886 
03887         *xpp = (void *)xp;
03888         return status;
03889 }

int ncx_putn_double_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 3892 of file ncx.c.

References ncx_put_double_long(), and X_SIZEOF_DOUBLE.

03893 {
03894         char *xp = (char *) *xpp;
03895         int status = ENOERR;
03896 
03897         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03898         {
03899                 int lstatus = ncx_put_double_long(xp, tp);
03900                 if(lstatus != ENOERR)
03901                         status = lstatus;
03902         }
03903 
03904         *xpp = (void *)xp;
03905         return status;
03906 }

int ncx_putn_double_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 3824 of file ncx.c.

References ncx_put_double_schar(), and X_SIZEOF_DOUBLE.

03825 {
03826         char *xp = (char *) *xpp;
03827         int status = ENOERR;
03828 
03829         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03830         {
03831                 int lstatus = ncx_put_double_schar(xp, tp);
03832                 if(lstatus != ENOERR)
03833                         status = lstatus;
03834         }
03835 
03836         *xpp = (void *)xp;
03837         return status;
03838 }

int ncx_putn_double_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 3858 of file ncx.c.

References ncx_put_double_short(), and X_SIZEOF_DOUBLE.

03859 {
03860         char *xp = (char *) *xpp;
03861         int status = ENOERR;
03862 
03863         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03864         {
03865                 int lstatus = ncx_put_double_short(xp, tp);
03866                 if(lstatus != ENOERR)
03867                         status = lstatus;
03868         }
03869 
03870         *xpp = (void *)xp;
03871         return status;
03872 }

int ncx_putn_double_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 3841 of file ncx.c.

References ncx_put_double_uchar(), and X_SIZEOF_DOUBLE.

03842 {
03843         char *xp = (char *) *xpp;
03844         int status = ENOERR;
03845 
03846         for( ; nelems != 0; nelems--, xp += X_SIZEOF_DOUBLE, tp++)
03847         {
03848                 int lstatus = ncx_put_double_uchar(xp, tp);
03849                 if(lstatus != ENOERR)
03850                         status = lstatus;
03851         }
03852 
03853         *xpp = (void *)xp;
03854         return status;
03855 }

int ncx_putn_float_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 3601 of file ncx.c.

References ncx_put_float_double(), and X_SIZEOF_FLOAT.

03602 {
03603         char *xp = (char *) *xpp;
03604         int status = ENOERR;
03605 
03606         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03607         {
03608                 int lstatus = ncx_put_float_double(xp, tp);
03609                 if(lstatus != ENOERR)
03610                         status = lstatus;
03611         }
03612 
03613         *xpp = (void *)xp;
03614         return status;
03615 }

int ncx_putn_float_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 3501 of file ncx.c.

References X_SIZEOF_FLOAT.

03502 {
03503 # if WORDS_BIGENDIAN
03504         (void) memcpy(*xpp, tp, nelems * X_SIZEOF_FLOAT);
03505 # else
03506         swapn4b(*xpp, tp, nelems);
03507 # endif
03508         *xpp = (void *)((char *)(*xpp) + nelems * X_SIZEOF_FLOAT);
03509         return ENOERR;
03510 }

int ncx_putn_float_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 3465 of file ncx.c.

References ncx_put_float_int(), and X_SIZEOF_FLOAT.

03466 {
03467         char *xp = (char *) *xpp;
03468         int status = ENOERR;
03469 
03470         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03471         {
03472                 int lstatus = ncx_put_float_int(xp, tp);
03473                 if(lstatus != ENOERR)
03474                         status = lstatus;
03475         }
03476 
03477         *xpp = (void *)xp;
03478         return status;
03479 }

int ncx_putn_float_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 3482 of file ncx.c.

References ncx_put_float_long(), and X_SIZEOF_FLOAT.

03483 {
03484         char *xp = (char *) *xpp;
03485         int status = ENOERR;
03486 
03487         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03488         {
03489                 int lstatus = ncx_put_float_long(xp, tp);
03490                 if(lstatus != ENOERR)
03491                         status = lstatus;
03492         }
03493 
03494         *xpp = (void *)xp;
03495         return status;
03496 }

int ncx_putn_float_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 3414 of file ncx.c.

References ncx_put_float_schar(), and X_SIZEOF_FLOAT.

03415 {
03416         char *xp = (char *) *xpp;
03417         int status = ENOERR;
03418 
03419         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03420         {
03421                 int lstatus = ncx_put_float_schar(xp, tp);
03422                 if(lstatus != ENOERR)
03423                         status = lstatus;
03424         }
03425 
03426         *xpp = (void *)xp;
03427         return status;
03428 }

int ncx_putn_float_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 3448 of file ncx.c.

References ncx_put_float_short(), and X_SIZEOF_FLOAT.

03449 {
03450         char *xp = (char *) *xpp;
03451         int status = ENOERR;
03452 
03453         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03454         {
03455                 int lstatus = ncx_put_float_short(xp, tp);
03456                 if(lstatus != ENOERR)
03457                         status = lstatus;
03458         }
03459 
03460         *xpp = (void *)xp;
03461         return status;
03462 }

int ncx_putn_float_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 3431 of file ncx.c.

References ncx_put_float_uchar(), and X_SIZEOF_FLOAT.

03432 {
03433         char *xp = (char *) *xpp;
03434         int status = ENOERR;
03435 
03436         for( ; nelems != 0; nelems--, xp += X_SIZEOF_FLOAT, tp++)
03437         {
03438                 int lstatus = ncx_put_float_uchar(xp, tp);
03439                 if(lstatus != ENOERR)
03440                         status = lstatus;
03441         }
03442 
03443         *xpp = (void *)xp;
03444         return status;
03445 }

int ncx_putn_int_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 3187 of file ncx.c.

References ncx_put_int_double(), and X_SIZEOF_INT.

03188 {
03189         char *xp = (char *) *xpp;
03190         int status = ENOERR;
03191 
03192         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03193         {
03194                 int lstatus = ncx_put_int_double(xp, tp);
03195                 if(lstatus != ENOERR)
03196                         status = lstatus;
03197         }
03198 
03199         *xpp = (void *)xp;
03200         return status;
03201 }

int ncx_putn_int_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 3170 of file ncx.c.

References ncx_put_int_float(), and X_SIZEOF_INT.

03171 {
03172         char *xp = (char *) *xpp;
03173         int status = ENOERR;
03174 
03175         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03176         {
03177                 int lstatus = ncx_put_int_float(xp, tp);
03178                 if(lstatus != ENOERR)
03179                         status = lstatus;
03180         }
03181 
03182         *xpp = (void *)xp;
03183         return status;
03184 }

int ncx_putn_int_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 3108 of file ncx.c.

References X_SIZEOF_INT.

03109 {
03110 # if WORDS_BIGENDIAN
03111         (void) memcpy(*xpp, tp, nelems * X_SIZEOF_INT);
03112 # else
03113         swapn4b(*xpp, tp, nelems);
03114 # endif
03115         *xpp = (void *)((char *)(*xpp) + nelems * X_SIZEOF_INT);
03116         return ENOERR;
03117 }

int ncx_putn_int_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 3140 of file ncx.c.

References X_SIZEOF_INT.

03141 {
03142 # if WORDS_BIGENDIAN
03143         (void) memcpy(*xpp, tp, nelems * X_SIZEOF_INT);
03144 # else
03145         swapn4b(*xpp, tp, nelems);
03146 # endif
03147         *xpp = (void *)((char *)(*xpp) + nelems * X_SIZEOF_INT);
03148         return ENOERR;
03149 }

int ncx_putn_int_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 3055 of file ncx.c.

References ncx_put_int_schar(), and X_SIZEOF_INT.

03056 {
03057         char *xp = (char *) *xpp;
03058         int status = ENOERR;
03059 
03060         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03061         {
03062                 int lstatus = ncx_put_int_schar(xp, tp);
03063                 if(lstatus != ENOERR)
03064                         status = lstatus;
03065         }
03066 
03067         *xpp = (void *)xp;
03068         return status;
03069 }

int ncx_putn_int_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 3089 of file ncx.c.

References ncx_put_int_short(), and X_SIZEOF_INT.

03090 {
03091         char *xp = (char *) *xpp;
03092         int status = ENOERR;
03093 
03094         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03095         {
03096                 int lstatus = ncx_put_int_short(xp, tp);
03097                 if(lstatus != ENOERR)
03098                         status = lstatus;
03099         }
03100 
03101         *xpp = (void *)xp;
03102         return status;
03103 }

int ncx_putn_int_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 3072 of file ncx.c.

References ncx_put_int_uchar(), and X_SIZEOF_INT.

03073 {
03074         char *xp = (char *) *xpp;
03075         int status = ENOERR;
03076 
03077         for( ; nelems != 0; nelems--, xp += X_SIZEOF_INT, tp++)
03078         {
03079                 int lstatus = ncx_put_int_uchar(xp, tp);
03080                 if(lstatus != ENOERR)
03081                         status = lstatus;
03082         }
03083 
03084         *xpp = (void *)xp;
03085         return status;
03086 }

int ncx_putn_schar_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 2094 of file ncx.c.

References X_SCHAR_MAX, and X_SCHAR_MIN.

02095 {
02096         int status = ENOERR;
02097         schar *xp = (schar *) *xpp;
02098 
02099         while(nelems-- != 0)
02100         {
02101                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02102                         status = NC_ERANGE;
02103                 *xp++ = (schar) *tp++;
02104         }
02105 
02106         *xpp = (void *)xp;
02107         return status;
02108 }

int ncx_putn_schar_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 2077 of file ncx.c.

References X_SCHAR_MAX, and X_SCHAR_MIN.

02078 {
02079         int status = ENOERR;
02080         schar *xp = (schar *) *xpp;
02081 
02082         while(nelems-- != 0)
02083         {
02084                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02085                         status = NC_ERANGE;
02086                 *xp++ = (schar) *tp++;
02087         }
02088 
02089         *xpp = (void *)xp;
02090         return status;
02091 }

int ncx_putn_schar_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 2043 of file ncx.c.

References X_SCHAR_MAX, and X_SCHAR_MIN.

02044 {
02045         int status = ENOERR;
02046         schar *xp = (schar *) *xpp;
02047 
02048         while(nelems-- != 0)
02049         {
02050                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02051                         status = NC_ERANGE;
02052                 *xp++ = (schar) *tp++;
02053         }
02054 
02055         *xpp = (void *)xp;
02056         return status;
02057 }

int ncx_putn_schar_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 2060 of file ncx.c.

References X_SCHAR_MAX, and X_SCHAR_MIN.

02061 {
02062         int status = ENOERR;
02063         schar *xp = (schar *) *xpp;
02064 
02065         while(nelems-- != 0)
02066         {
02067                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02068                         status = NC_ERANGE;
02069                 *xp++ = (schar) *tp++;
02070         }
02071 
02072         *xpp = (void *)xp;
02073         return status;
02074 }

int ncx_putn_schar_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 2008 of file ncx.c.

02009 {
02010                 (void) memcpy(*xpp, tp, nelems);
02011         *xpp = (void *)((char *)(*xpp) + nelems);
02012 
02013         return ENOERR;
02014 
02015 }

int ncx_putn_schar_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 2026 of file ncx.c.

References X_SCHAR_MAX, and X_SCHAR_MIN.

02027 {
02028         int status = ENOERR;
02029         schar *xp = (schar *) *xpp;
02030 
02031         while(nelems-- != 0)
02032         {
02033                 if(*tp > X_SCHAR_MAX || *tp < X_SCHAR_MIN)
02034                         status = NC_ERANGE;
02035                 *xp++ = (schar) *tp++;
02036         }
02037 
02038         *xpp = (void *)xp;
02039         return status;
02040 }

int ncx_putn_schar_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 2017 of file ncx.c.

02018 {
02019                 (void) memcpy(*xpp, tp, nelems);
02020         *xpp = (void *)((char *)(*xpp) + nelems);
02021 
02022         return ENOERR;
02023 
02024 }

int ncx_putn_short_double void **    xpp,
size_t    nelems,
const double *    tp
 

Definition at line 2708 of file ncx.c.

References ncx_put_short_double(), and X_SIZEOF_SHORT.

02709 {
02710         char *xp = (char *) *xpp;
02711         int status = ENOERR;
02712 
02713         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02714         {
02715                 int lstatus = ncx_put_short_double(xp, tp);
02716                 if(lstatus != ENOERR)
02717                         status = lstatus;
02718         }
02719 
02720         *xpp = (void *)xp;
02721         return status;
02722 }

int ncx_putn_short_float void **    xpp,
size_t    nelems,
const float *    tp
 

Definition at line 2691 of file ncx.c.

References ncx_put_short_float(), and X_SIZEOF_SHORT.

02692 {
02693         char *xp = (char *) *xpp;
02694         int status = ENOERR;
02695 
02696         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02697         {
02698                 int lstatus = ncx_put_short_float(xp, tp);
02699                 if(lstatus != ENOERR)
02700                         status = lstatus;
02701         }
02702 
02703         *xpp = (void *)xp;
02704         return status;
02705 }

int ncx_putn_short_int void **    xpp,
size_t    nelems,
const int *    tp
 

Definition at line 2657 of file ncx.c.

References ncx_put_short_int(), and X_SIZEOF_SHORT.

02658 {
02659         char *xp = (char *) *xpp;
02660         int status = ENOERR;
02661 
02662         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02663         {
02664                 int lstatus = ncx_put_short_int(xp, tp);
02665                 if(lstatus != ENOERR)
02666                         status = lstatus;
02667         }
02668 
02669         *xpp = (void *)xp;
02670         return status;
02671 }

int ncx_putn_short_long void **    xpp,
size_t    nelems,
const long *    tp
 

Definition at line 2674 of file ncx.c.

References ncx_put_short_long(), and X_SIZEOF_SHORT.

02675 {
02676         char *xp = (char *) *xpp;
02677         int status = ENOERR;
02678 
02679         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02680         {
02681                 int lstatus = ncx_put_short_long(xp, tp);
02682                 if(lstatus != ENOERR)
02683                         status = lstatus;
02684         }
02685 
02686         *xpp = (void *)xp;
02687         return status;
02688 }

int ncx_putn_short_schar void **    xpp,
size_t    nelems,
const schar   tp
 

Definition at line 2591 of file ncx.c.

References ncx_put_short_schar(), and X_SIZEOF_SHORT.

02592 {
02593         char *xp = (char *) *xpp;
02594         int status = ENOERR;
02595 
02596         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02597         {
02598                 int lstatus = ncx_put_short_schar(xp, tp);
02599                 if(lstatus != ENOERR)
02600                         status = lstatus;
02601         }
02602 
02603         *xpp = (void *)xp;
02604         return status;
02605 }

int ncx_putn_short_short void **    xpp,
size_t    nelems,
const short *    tp
 

Definition at line 2627 of file ncx.c.

References X_SIZEOF_SHORT.

02628 {
02629 # if WORDS_BIGENDIAN
02630         (void) memcpy(*xpp, tp, nelems * X_SIZEOF_SHORT);
02631 # else
02632         swapn2b(*xpp, tp, nelems);
02633 # endif
02634         *xpp = (void *)((char *)(*xpp) + nelems * X_SIZEOF_SHORT);
02635         return ENOERR;
02636 }

int ncx_putn_short_uchar void **    xpp,
size_t    nelems,
const uchar   tp
 

Definition at line 2608 of file ncx.c.

References ncx_put_short_uchar(), and X_SIZEOF_SHORT.

02609 {
02610         char *xp = (char *) *xpp;
02611         int status = ENOERR;
02612 
02613         for( ; nelems != 0; nelems--, xp += X_SIZEOF_SHORT, tp++)
02614         {
02615                 int lstatus = ncx_put_short_uchar(xp, tp);
02616                 if(lstatus != ENOERR)
02617                         status = lstatus;
02618         }
02619 
02620         *xpp = (void *)xp;
02621         return status;
02622 }

int ncx_putn_text void **    xpp,
size_t    nelems,
const char *    tp
 

Definition at line 4075 of file ncx.c.

04076 {
04077         (void) memcpy(*xpp, tp, nelems);
04078         *xpp = (void *)((char *)(*xpp) + nelems);
04079 
04080         return ENOERR;
04081 
04082 }

int ncx_putn_void void **    xpp,
size_t    nelems,
const void *    tp
 

Definition at line 4133 of file ncx.c.

04134 {
04135         (void) memcpy(*xpp, tp, nelems);
04136         *xpp = (void *)((char *)(*xpp) + nelems);
04137 
04138         return ENOERR;
04139 
04140 }

void put_ix_double void *    xp,
const double *    ip
[static]
 

Definition at line 1289 of file ncx.c.

References X_SIZEOF_DOUBLE.

01290 {
01291 #ifdef WORDS_BIGENDIAN
01292         (void) memcpy(xp, ip, X_SIZEOF_DOUBLE);
01293 #else
01294         swap8b(xp, ip);
01295 #endif
01296 }

void put_ix_float void *    xp,
const float *    ip
[static]
 

Definition at line 685 of file ncx.c.

References X_SIZEOF_FLOAT.

00686 {
00687 #ifdef WORDS_BIGENDIAN
00688         (void) memcpy(xp, ip, X_SIZEOF_FLOAT);
00689 #else
00690         swap4b(xp, ip);
00691 #endif
00692 }

void put_ix_int void *    xp,
const ix_int   ip
[static]
 

Definition at line 457 of file ncx.c.

References ix_int.

00458 {
00459         uchar *cp = (uchar *) xp;
00460 
00461         *cp++ = (*ip) >> 24;
00462         *cp++ = ((*ip) & 0x00ff0000) >> 16;
00463         *cp++ = ((*ip) & 0x0000ff00) >>  8;
00464         *cp   = ((*ip) & 0x000000ff);
00465 }

void put_ix_short void *    xp,
const ix_short   ip
[static]
 

Definition at line 223 of file ncx.c.

References ix_short.

Referenced by ncx_put_short_double(), ncx_put_short_float(), ncx_put_short_int(), ncx_put_short_long(), and ncx_put_short_short().

00224 {
00225         uchar *cp = (uchar *) xp;
00226         *cp++ = (*ip) >> 8;
00227         *cp = (*ip) & 0xff;
00228 }

Variable Documentation

const char nada[X_ALIGN] = {0, 0, 0, 0} [static]
 

Definition at line 80 of file ncx.c.

Referenced by ncx_pad_putn_schar_double(), ncx_pad_putn_schar_float(), ncx_pad_putn_schar_int(), ncx_pad_putn_schar_long(), ncx_pad_putn_schar_schar(), ncx_pad_putn_schar_short(), ncx_pad_putn_schar_uchar(), ncx_pad_putn_short_double(), ncx_pad_putn_short_float(), ncx_pad_putn_short_int(), ncx_pad_putn_short_long(), ncx_pad_putn_short_schar(), ncx_pad_putn_short_short(), ncx_pad_putn_short_uchar(), ncx_pad_putn_text(), and ncx_pad_putn_void().

 

Powered by Plone

This site conforms to the following standards: