/******************************************************************************

    FILE:  MC0.H

       Header file for MC0.C.

    89/02/21 - J. Ranada - University of Hawaii JIMAR

*/

/* 1999/07/30 Pierre Jaccard
      Adding a define here to ensure that this file will only be included 
      once. See also at the end of the file.
*/
#ifndef mc0_h_included
#define mc0_h_included

#ifndef dbhost_included
#include "dbhost.h"          /* PROTOTYPE_ALLOWED */
#endif

#ifndef dbext_included
#include "dbext.h"           /* STRUCT_DEF_HDR_TYPE, etc */
#endif

/*--------------------
   BYTE-COPYING FLAGS
  --------------------*/
#define AS_IS    0
#define INVERTED 1
#define SPECIAL  2
/*-----------------------
   SHIFT DIRECTION FLAGS
  -----------------------*/
#define RIGHT    0
#define LEFT     1

#if PROTOTYPE_ALLOWED

unsigned int copy_byte           (char dest[], char src[], int nbytes, int flag,
                                  int index[]);
void shift_double                (unsigned char orig[], int nbits,
                                  int direction, int to);
int IEEE_to_VAXDFLOAT            (unsigned char vaxd[], unsigned char ieee[]);
void VAXDFLOAT_to_IEEE           (unsigned char ieee[], unsigned char vaxd[], int to);
unsigned int convert_array_double(char dest[], char src[], int from, int to,
                                  unsigned int nv);
unsigned int convert_array_float (char dest[], char src[], int from, int to,
                                  unsigned int nv);
unsigned int convert_array_long  (char dest[], char src[], int from, int to,
                                  unsigned int nv);
unsigned int convert_array_short (char dest[], char src[], int from, int to,
                                  unsigned int nv);
unsigned int convert_struct      (char *dest, char *src, int from, int to,
                                  char *struct_name, STRUCT_DEF_HDR_TYPE *strdef);
unsigned int convert_array_struct(char *dest, char *src, int from, int to,
                                  int nv, char *struct_name,
                                  STRUCT_DEF_HDR_TYPE *strdef);
unsigned int convert_select      (char *dest, char *src, int from, int to,
                                  unsigned int nv, unsigned int value_type,
                                  char *struct_name, STRUCT_DEF_HDR_TYPE *strdef);

#else

unsigned int copy_byte();
void shift_double();
int IEEE_to_VAXDFLOAT();
void VAXDFLOAT_to_IEEE();
unsigned int convert_array_double();
unsigned int convert_array_float();
unsigned int convert_array_long();
unsigned int convert_array_short();
unsigned int convert_struct();
unsigned int convert_array_struct();
unsigned int convert_select();

#endif

#endif /* mc0_h_included */
