{\scriptsize \begin{lstlisting}
     1	/**
     2	   @file
     3	
     4	   This program tests the size and the organisation of an integer on
     5	   the local machine, with the local compiler.
     6	
     7	*/
     8	
     9	/*
    10	  Copyright (c) Andreas Hofmeier
    11	  (www.an-h.de, www.an-h.de.vu, www.lgut.uni-bremen.de/an-h/)
    12	  
    13	  This program is free software; you can redistribute it and/or modify
    14	  it under the terms of the GNU General Public License as published by
    15	  the Free Software Foundation; either version 2 of the License, or
    16	  (at your option) any later version.
    17	
    18	  This program is distributed in the hope that it will be useful, but
    19	  WITHOUT ANY WARRANTY; without even the implied warranty of
    20	  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    21	  General Public License for more details.
    22	
    23	  You should have received a copy of the GNU General Public License
    24	  along with this program; if not, write to the Free Software
    25	  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    26	*/
    27	
    28	#include <stdio.h>
    29	
    30	
    31	main(int argc, char *argv[]) {
    32	  unsigned int i;
    33	  int size = sizeof(i);
    34	  unsigned char *s, c;
    35	
    36	  // make sure, that the size of the integer is greater or equal than
    37	  // two bytes
    38	  printf("testing integer...\n");
    39	  printf("  sizeof(int) = %d Bytes (%d Bits)\n", size, size * 8);
    40	  if (size < 2) {
    41	    fail("The size of integer must be greater or equal that two " \
    42		 "bytes (or 16 bits)", 1);
    43	  }
    44	  s = (char *) &i;
    45	  printf("  organisation: ");
    46	  for (i = 1; i <= 128; i = i * 2) {
    47	    c = (unsigned char) i;
    48	    if ((s[0] != c) ||
    49		(s[1] != 0)) {
    50	      fail("organisation of Integer is on this machine different, " \
    51		   "than the library expect.", 1);
    52	    }
    53	    printf("%d ", i);
    54	  }
    55	  for (i = 256; i <= 32768; i = i * 2) {
    56	    c = (unsigned char) (i / 256);
    57	    if ((s[0] != 0) ||
    58		(s[1] != c)) {
    59	      fail("organisation of Integer is on this machine different, " \
    60		   "than the library expect.", 1);
    61	    }
    62	    printf("%d ", i);
    63	  }
    64	  printf(" OK.\n");
    65	  exit(0);
    66	}
\end{lstlisting}}
