/************************************************************************
 *
 * Operating system definitions for the 32-bit VI/VM on 64-bit AOSF.
 *
 *	Copyright (C) 1999-2008 Cincom Systems, Inc.
 *
 ************************************************************************/

#ifdef OSF32
#undef long
#  ifndef assembly
#	pragma pointer_size (save)
#	pragma pointer_size (long)
#  endif
#endif

#define	operatingSystem	operatingSystemAOSF

/* access to more 64-bit pointers within long pointer_size pragma. */
typedef oeChar         *farOECharStar;
#	if OE_IS_UNICODE
typedef wchar_t        *farWCharStar;
typedef wchar_t       **farWCharStarStar;
#	endif

#define SIGNALSemaphores 1

#define maxPathNameLength 1024

/* These are the defines to read and write image files */
#define fileHandle int

/* Flags for use with pdOpenImage and pdSeek */
#ifndef assembly
#include <fcntl.h>						/* for open() */
#include <unistd.h>						/* for read, write, close */
#include <sys/file.h>					/* for L_SET */

extern fileHandle pdOpenImage(char *, long, int *);
extern int pdCloseImage(fileHandle);
extern long pdRead(fileHandle, void *, long, int *);
extern long pdWrite(fileHandle, void *, long, int *);

#endif
#define imageReadFlags O_RDONLY
#define imageWriteFlags (O_WRONLY | O_CREAT | O_TRUNC)
#define imageOpenError -1
#define fileHandleForImageResource -2

#define pdSeek(file, offset) lseek(file, offset, L_SET)

#ifdef OSF32
#  ifndef assembly
#       pragma pointer_size (restore)
#  endif
#define long int
#endif
