ICP  1
Classes | Macros | Functions | Variables
vms_convert.cpp File Reference
#include "stdafx.h"
#include "vms_convert.h"

Go to the source code of this file.

Classes

struct  ieee_single
 
struct  vax_single
 
struct  sgl_limits_struct
 
struct  ieee_double
 
struct  vax_double
 
struct  dbl_limits
 

Macros

#define swap_int(a)
 
#define swap_short(a)   ( ((a & 0xff) << 8) | ((unsigned short)(a) >> 8) )
 
#define IEEEFP   1
 
#define VAX_SNG_BIAS   0x81
 
#define IEEE_SNG_BIAS   0x7f
 
#define mmax   sgl_limits[0]
 
#define mmin   sgl_limits[1]
 
#define VAX_DBL_BIAS   0x81
 
#define IEEE_DBL_BIAS   0x3ff
 
#define MASK(nbits)   ((1 << nbits) - 1)
 
#define maybe_flip_bytes(__p, __n)
 

Functions

unsigned short local_to_vax_short (const unsigned short *s)
 
unsigned short vax_to_local_short (const unsigned short *s)
 
unsigned local_to_vax_int (const fort_int *i)
 
unsigned vax_to_local_int (const fort_int *i)
 
void local_to_vax_shorts (unsigned short *sa, const int *n)
 
void vax_to_local_shorts (unsigned short *sa, const int *n)
 
void local_to_vax_ints (fort_int *ia, const fort_int *n)
 
void vax_to_local_ints (fort_int *ia, const fort_int *n)
 
static int vax_to_ieee_float (float *fp)
 
static int ieee_to_vax_float (float *fp)
 
void vaxf_to_local (float *val, const int *n, int *errcode)
 
void local_to_vaxf (float *val, const int *n, int *errcode)
 
void ieee_float_to_local (float *val, const int *n, int *errcode)
 
void ieee_double_to_local (double *val, const int *n, int *errcode)
 
void local_to_ieee_float (float *val, const int *n, int *errcode)
 
void local_to_ieee_double (double *val, const int *n, int *errcode)
 

Variables

static struct sgl_limits_struct sgl_limits [2]
 
static struct dbl_limits dbl_limits [2]
 

Macro Definition Documentation

#define IEEE_DBL_BIAS   0x3ff

Definition at line 247 of file vms_convert.cpp.

#define IEEE_SNG_BIAS   0x7f

Definition at line 188 of file vms_convert.cpp.

Referenced by ieee_to_vax_float(), and vax_to_ieee_float().

#define IEEEFP   1

Definition at line 129 of file vms_convert.cpp.

#define MASK (   nbits)    ((1 << nbits) - 1)

Definition at line 248 of file vms_convert.cpp.

#define maybe_flip_bytes (   __p,
  __n 
)

Definition at line 275 of file vms_convert.cpp.

Referenced by ieee_to_vax_float(), and vax_to_ieee_float().

#define mmax   sgl_limits[0]

Definition at line 200 of file vms_convert.cpp.

Referenced by ieee_to_vax_float(), and vax_to_ieee_float().

#define mmin   sgl_limits[1]

Definition at line 201 of file vms_convert.cpp.

Referenced by ieee_to_vax_float(), and vax_to_ieee_float().

#define swap_int (   a)
Value:
( ((a) << 24) | \
(((a) << 8) & 0x00ff0000) | \
(((a) >> 8) & 0x0000ff00) | \
((unsigned long)(a) >>24) )

Definition at line 28 of file vms_convert.cpp.

Referenced by local_to_vax_int(), local_to_vax_ints(), vax_to_local_int(), and vax_to_local_ints().

#define swap_short (   a)    ( ((a & 0xff) << 8) | ((unsigned short)(a) >> 8) )
#define VAX_DBL_BIAS   0x81

Definition at line 246 of file vms_convert.cpp.

#define VAX_SNG_BIAS   0x81

Definition at line 187 of file vms_convert.cpp.

Referenced by ieee_to_vax_float(), and vax_to_ieee_float().

Function Documentation

void ieee_double_to_local ( double *  val,
const int *  n,
int *  errcode 
)

Definition at line 435 of file vms_convert.cpp.

void ieee_float_to_local ( float *  val,
const int *  n,
int *  errcode 
)

Definition at line 413 of file vms_convert.cpp.

static int ieee_to_vax_float ( float *  fp)
static
void local_to_ieee_double ( double *  val,
const int *  n,
int *  errcode 
)

Definition at line 481 of file vms_convert.cpp.

void local_to_ieee_float ( float *  val,
const int *  n,
int *  errcode 
)

Definition at line 458 of file vms_convert.cpp.

unsigned local_to_vax_int ( const fort_int i)

Definition at line 55 of file vms_convert.cpp.

References swap_int.

void local_to_vax_ints ( fort_int ia,
const fort_int n 
)

Definition at line 97 of file vms_convert.cpp.

References swap_int.

unsigned short local_to_vax_short ( const unsigned short *  s)

Definition at line 37 of file vms_convert.cpp.

References swap_short.

void local_to_vax_shorts ( unsigned short *  sa,
const int *  n 
)

Definition at line 73 of file vms_convert.cpp.

References swap_short.

void local_to_vaxf ( float *  val,
const int *  n,
int *  errcode 
)

Definition at line 393 of file vms_convert.cpp.

References ieee_to_vax_float().

Referenced by ISISRAW::ioRAW().

static int vax_to_ieee_float ( float *  fp)
static
unsigned vax_to_local_int ( const fort_int i)

Definition at line 64 of file vms_convert.cpp.

References swap_int.

void vax_to_local_ints ( fort_int ia,
const fort_int n 
)

Definition at line 110 of file vms_convert.cpp.

References swap_int.

unsigned short vax_to_local_short ( const unsigned short *  s)

Definition at line 46 of file vms_convert.cpp.

References swap_short.

void vax_to_local_shorts ( unsigned short *  sa,
const int *  n 
)

Definition at line 85 of file vms_convert.cpp.

References swap_short.

void vaxf_to_local ( float *  val,
const int *  n,
int *  errcode 
)

Definition at line 362 of file vms_convert.cpp.

References vax_to_ieee_float().

Referenced by ISISRAW::ioRAW().

Variable Documentation

struct dbl_limits dbl_limits[2]
static
Initial value:
= {
{{ 0x7f, 0xff, 0x0, 0xffff, 0xffff, 0xffff },
{ 0x0, 0x7ff, 0x0, 0x0 }},
{{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
{ 0x0, 0x0, 0x0, 0x0 }}
}
struct sgl_limits_struct sgl_limits[2]
static
Initial value:
= {
{{ 0x7f, 0xff, 0x0, 0xffff },
{ 0x0, 0xff, 0x0 }},
{{ 0x0, 0x0, 0x0, 0x0 },
{ 0x0, 0x0, 0x0 }}
}