musrfit 1.10.0
mud_encode.c File Reference
#include "mud.h"
Include dependency graph for mud_encode.c:

Go to the source code of this file.

Classes

struct  ieee_single
 
struct  vax_single
 
struct  sgl_limits
 
struct  ieee_double
 
struct  vax_double
 
struct  dbl_limits
 

Macros

#define VAX_SNG_BIAS   0x81
 
#define IEEE_SNG_BIAS   0x7f
 
#define VAX_DBL_BIAS   0x81
 
#define IEEE_DBL_BIAS   0x3ff
 
#define MASK(nbits)
 

Functions

void bdecode_2 (void *b, void *p)
 
void bencode_2 (void *b, void *p)
 
void bdecode_4 (void *b, void *p)
 
void bencode_4 (void *b, void *p)
 
void bdecode_8 (void *b, void *p)
 
void bencode_8 (void *b, void *p)
 
void decode_str (BUF *pB, char **ps)
 
void encode_str (BUF *pB, char **ps)
 
void bencode_float (char *buf, float *fp)
 
void encode_float (BUF *pBuf, float *fp)
 
void bdecode_float (char *buf, float *fp)
 
void decode_float (BUF *pBuf, float *fp)
 
void bencode_double (char *buf, double *dp)
 
void encode_double (BUF *pBuf, double *fp)
 
void bdecode_double (char *buf, double *dp)
 
void decode_double (BUF *pBuf, double *fp)
 

Variables

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

Macro Definition Documentation

◆ IEEE_DBL_BIAS

#define IEEE_DBL_BIAS   0x3ff

Definition at line 361 of file mud_encode.c.

Referenced by bdecode_double(), and bencode_double().

◆ IEEE_SNG_BIAS

#define IEEE_SNG_BIAS   0x7f

Definition at line 203 of file mud_encode.c.

Referenced by bdecode_float(), and bencode_float().

◆ MASK

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

Definition at line 362 of file mud_encode.c.

◆ VAX_DBL_BIAS

#define VAX_DBL_BIAS   0x81

Definition at line 360 of file mud_encode.c.

Referenced by bdecode_double(), and bencode_double().

◆ VAX_SNG_BIAS

#define VAX_SNG_BIAS   0x81

Definition at line 202 of file mud_encode.c.

Referenced by bdecode_float(), and bencode_float().

Function Documentation

◆ bdecode_2()

void bdecode_2 ( void * b,
void * p )

Definition at line 28 of file mud_encode.c.

References _swap2bytes.

Referenced by _ANSI_ARGS_(), decode_str(), MUD_SEC_GEN_HIST_dopack(), and varBinArray().

◆ bdecode_4()

void bdecode_4 ( void * b,
void * p )

Definition at line 60 of file mud_encode.c.

References _swap4bytes.

Referenced by _ANSI_ARGS_(), bdecode_float(), MUD_read(), MUD_SEC_GEN_HIST_dopack(), and varBinArray().

◆ bdecode_8()

void bdecode_8 ( void * b,
void * p )

Definition at line 86 of file mud_encode.c.

References _swap4bytes.

Referenced by _ANSI_ARGS_(), and bdecode_double().

◆ bdecode_double()

◆ bdecode_float()

◆ bencode_2()

void bencode_2 ( void * b,
void * p )

Definition at line 41 of file mud_encode.c.

References _swap2bytes.

Referenced by _ANSI_ARGS_(), encode_str(), and MUD_SEC_GEN_HIST_dopack().

◆ bencode_4()

void bencode_4 ( void * b,
void * p )

Definition at line 73 of file mud_encode.c.

References _swap4bytes.

Referenced by _ANSI_ARGS_(), bencode_float(), and MUD_SEC_GEN_HIST_dopack().

◆ bencode_8()

void bencode_8 ( void * b,
void * p )

Definition at line 100 of file mud_encode.c.

References _swap4bytes.

Referenced by _ANSI_ARGS_(), and bencode_double().

◆ bencode_double()

◆ bencode_float()

◆ decode_double()

void decode_double ( BUF * pBuf,
double * fp )

◆ decode_float()

void decode_float ( BUF * pBuf,
float * fp )

Definition at line 293 of file mud_encode.c.

References bdecode_float(), BUF::buf, BUF::pos, and BUF::size.

Referenced by _ANSI_ARGS_(), and MUD_SEC_GEN_ARRAY_proc().

◆ decode_str()

◆ encode_double()

void encode_double ( BUF * pBuf,
double * fp )

◆ encode_float()

void encode_float ( BUF * pBuf,
float * fp )

Definition at line 244 of file mud_encode.c.

References bencode_float(), BUF::buf, BUF::pos, and BUF::size.

Referenced by _ANSI_ARGS_(), and MUD_SEC_GEN_ARRAY_proc().

◆ encode_str()

Variable Documentation

◆ dbl_limits

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

◆ sgl_limits

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