#include <stdio.h>
#include <stdlib.h>

union {
  short s;
  char	c[sizeof(short)];
} un;

int main(void)
{
  char *os;

  un.s = 0x0102;

  /* what kind of system are we using? */
  if (os=getenv("OS"))
    printf("OS:\t\t\t%s\n", os);
  if (os=getenv("OSTYPE"))
    printf("OSTYPE:\t\t\t%s\n", os);
  if (os=getenv("MACHTYPE"))
    printf("MACHTYPE:\t\t%s\n", os);
  if (os=getenv("VENDOR"))
    printf("VENDOR:\t\t\t%s\n", os);
  if (os=getenv("HOSTTYPE"))
    printf("HOSTTYPE:\t\t%s\n", os);
  printf("\n");

  if (sizeof(short) == 2) {
    if (un.c[0] == 1 && un.c[1] == 2)
      printf("This system uses big-endian byte order\n");
    else if (un.c[0] == 2 && un.c[1] == 1)
      printf("This system uses little-endian byte order\n");
    else
      printf("Unknown.\n");
  }
  else
    printf("sizeof(short) = %d\n", sizeof(short));

  return(0);
}