/*
 * minervini@neuralnoise.com (c) 2004, All rights reserved.
 * 
 * Nothing can be reproduced in whole or in part without the prior
 * written permission of the author.
 * Permission to link to this code from the internet is hereby granted.
 */

#include <sys/types.h>
#include <stdio.h>

u_int8_t
  endianess()
{
   u_int16_t       var = 0xbeef;
   u_int8_t       *end = (u_int8_t *) & var;
   return (end[0] == 0xef ? 1 : 0);
}

int
  main()
{
   printf("%s endian.\n", endianess() == 1 ? "little" : "big");
   return (0);
}
