#include "stdafx.h"
#include <string.h>
#include <stdio.h>

long LongSwap (long dat)
{
	unsigned    a,b,c,d;
	
	a = (dat>>24)&0xff;
	b = (dat>>16)&0xff;
	c = (dat>>8)&0xff;
	d = dat&0xff;
	return (d<<24)+(c<<16)+(b<<8)+a;
}

short ShortSwap (short dat)
{
	return (((unsigned short)dat<<8) + ((unsigned short)dat>>8))&0xffff;
}

#define	BIGSHORT(x) ShortSwap(x)

#define	LITTLELONG(x) LongSwap(x)

short APIENTRY Swap_16 (short value)
{
	return BIGSHORT(value);
}

long APIENTRY Swap_32 (long value)
{
	return LITTLELONG(value);
}

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    return TRUE;
}

