VIGIE home page VIGIE FAQ


Is there a port of VIGIE to Windows 95 or Windows NT ?

No such port is planned.

I have troubles to read files written on a PC running Linux ?

A unique external binary format is used by VIGIE for coding integers and floats. This format is used for all the binary formats known by VIGIE: HFEP, HDB, HHDB... This format uses the BIG ENDIAN convention for integers and the IEEE convention for floats.

For machines which DO NOT use this format, like DEC ALPHA and LINUX machines, we provide here the routines BIGE2INT et FLT2IEE which can be used to produce the correct binary data to be read by VIGIE. For information, we provide the routines INT2BIGE and IEEE2FLT which are used by VIGIE on these machines, for converting the data after reading the file.


/* #if defined(DECA)||defined(LINUX) */

void int2bige(int *local_int, unsigned char *bige_int)
{
  if( *local_int < 0 ) {
    unsigned long ul = -(*local_int);
    unsigned char shft;
 
    shft = ul/16777216; ul = ul-shft*16777216;
    bige_int[0] = ~shft;
    shft = ul/65536;    ul = ul-shft*65536;
    bige_int[1] = ~shft;
    shft = ul/256;      ul = ul-shft*256;
    bige_int[2] = ~shft;
    bige_int[3] = ~ul;
    /* Take care of 2's complement. */
    if( bige_int[3] != 255 ) {
      bige_int[3]++;
      return;
    }
    bige_int[3] = 0;
    if( bige_int[2] != 255 ) {
      bige_int[2]++;
      return;
    }
    bige_int[2] = 0;
    if( bige_int[1] != 255 ) {
      bige_int[1]++;
      return;
    }
    bige_int[1] = 0;
    bige_int[0]++;
    return;
  }
  else {
    unsigned long ul =  (*local_int),shft;

    shft = ul/16777216; ul = ul-shft*16777216;
    bige_int[0] = shft;
    shft = ul/65536;    ul = ul-shft*65536;
    bige_int[1] = shft;
    shft = ul/256;      ul = ul-shft*256;
    bige_int[2] = shft;
    bige_int[3] = ul;
    return;
  }
}


void ieee2flt(float *local_flt,unsigned char *ieee_flt)
{
  double frac;
  int S,E;
  long  F;

  /* Decode: SEEEEEEE EFFFFFF FFFFFFFF FFFFFFFFF */
  S = ( 128&ieee_flt[0] );
  E = ( (ieee_flt[0]&127)*2 ) | ( ieee_flt[1]/128 );
  F = ieee_flt[3] + 256*( ieee_flt[2] + 256*( ieee_flt[1]&127 ) );

  /* (We're cheating a little here.) */
  if( E == 0 ) {
    E = 0;
    frac = 0.0; /* Yields +-0. */
  }
  else
  if( E == 255 ) {
    E = 255;
    frac = 1.0; /* Yields +-infty. */
  }
  else {
    frac = (((double)F-0.5)*(0.11920928955078125E-06) + 1.0);
  }

  if( S ) 
    *local_flt = -ldexp(frac,E-127);
  else
    *local_flt =  ldexp(frac,E-127);

  return;
}

void int2bigel (int *i)
{
  int ibe;
  int2bige (i, (unsigned char *) &ibe); *i = ibe;
}

void ieee2fltl (float *f)
{
  float lf;
  ieee2flt (&lf, (unsigned char *) f); *f = lf;
}


_______________________________________________________________________


void BIGE2INT(local_int,bige_int)
int           *local_int;
unsigned char *bige_int;
{
  if( bige_int[0] > 127 ) {
    unsigned char be0 = ~bige_int[0], be1 = ~bige_int[1],
                  be2 = ~bige_int[2], be3 = ~bige_int[3];
    *local_int = -(1+be3+256*(be2+256*(be1+256*be0)));
    return;
  }
  else {
    *local_int = bige_int[3]+256*(bige_int[2]
                +256*(bige_int[1]+256*bige_int[0]));
    return;
  }
}


void FLT2IEEE(local_flt,ieee_flt)
float         *local_flt;
unsigned char *ieee_flt;
{
  double frac;
  int S,E;
  long  F,shft;

  frac = 2.0*FREXP((double)*local_flt,&E); /* Normalize to [1.0,2.0). */
  E = E+126; /* Normalized to [0,255]. */
  S = 0;
  if( frac < 0.0 ) {
    S = 128;
    frac = -frac;
  }
  F = (frac-1.0)*(8388608.0)+0.5; /* (8388608) = 2**23. */

  /* Clip out-of-range exp's. (We're cheating a little here.) */
  if( E <= 0 ) {
    E = 0;
    F = 0; /* Yields +-0. */
  }
  if( E >= 255 ) {
    E = 255;
    F = 0; /* Yields +-infty. */
  }

  /* Build: SEEEEEEE EFFFFFF FFFFFFFF FFFFFFFFF */
  ieee_flt[0]  = S;                      shft = E/2;
  ieee_flt[0] |= shft; E = (E-shft*2)*128;
  ieee_flt[1]  = E;                      shft = F/65536;
  ieee_flt[1] |= shft; F = F-shft*65536; shft = F/256;
  ieee_flt[2]  = shft; F = F-shft*256;
  ieee_flt[3]  = F;

  return;
}


I try to run vigie on Solaris and I get this kind of errors:

Warning: Widget class VendorShell version mismatch (recompilation needed):
  widget 11006 vs. intrinsics 11005.
Set your LD_LIBRARY_PATH to nothing. In bash this is done with:
$ unset LD_LIBRARY_PATH 

webmaster-sinus@sophia.inria.fr
Last modified: Fri Dec 11 18:49:58 MET 1998