#define __STDC_FORMAT_MACROS #include #define _LARGE_FILES #include #include #include #include #include #include #include #include "fbioc.h" const uint32_t fortranheader = 4; void c_endian(int *endian) { union { uint32_t i; char c[4]; } bint = {0x01020304}; if (bint.c[0] == 1) *endian = 0; /* big endian */ else *endian = 1; /* little endian */ } void c_swap(char *a, const int width, const int size) { int i, j; char swap[8]; if (width == 1) return; if (width != 2 && width != 4 && width != 8) { fprintf(stderr,"swap: width in not 1,2,4 or 8 width=%d size=%d\n",width,size); exit(1); } for (j=0; j