Files
epics-base/src/gdd/aitTypes.h
2000-10-12 21:52:49 +00:00

173 lines
4.0 KiB
C

#ifndef AIT_TYPES_H
#define AIT_TYPES_H 1
/*
* Author: Jim Kowalkowski
* Date: 2/96
*
* $Id$
*
* $Log$
* Revision 1.13 1999/10/21 23:41:11 jhill
* reformatted
*
* Revision 1.12 1999/05/13 20:59:39 jhill
* removed redundant includes
*
* Revision 1.11 1999/05/11 00:30:04 jhill
* removed unused includes
*
* Revision 1.10 1999/05/10 23:40:06 jhill
* removed timespec def and os specific ifdef maintenance nightmare
*
* Revision 1.9 1998/12/21 20:59:30 jhill
* changes from Salikova
*
* Revision 1.8 1998/06/16 03:10:51 jhill
* added sgi support
*
* Revision 1.7 1998/04/16 21:16:35 jhill
* removed redundant solaris test
*
* Revision 1.6 1997/12/18 19:03:18 jba
* Linux change.
*
* Revision 1.5 1997/08/05 00:51:08 jhill
* fixed problems in aitString and the conversion matrix
*
* Revision 1.4 1997/04/10 19:59:24 jhill
* api changes
*
* Revision 1.3 1997/03/21 01:56:00 jbk
* *** empty log message ***
*
* Revision 1.2 1996/08/22 21:05:40 jbk
* More fixes to make strings and fixed string work better.
*
* Revision 1.1 1996/06/25 19:11:33 jbk
* new in EPICS base
*
*
* *Revision 1.2 1996/06/17 15:24:07 jbk
* *many mods, string class corrections.
* *gdd operator= protection.
* *dbmapper uses aitString array for menus now
* *Revision 1.1 1996/05/31 13:15:22 jbk
* *add new stuff
*
*/
/* This is the file the user sets up for a given architecture */
#define AIT_FIXED_STRING_SIZE 40
#include "shareLib.h"
typedef char aitInt8;
typedef unsigned char aitUint8;
typedef short aitInt16;
typedef unsigned short aitUint16;
typedef aitUint16 aitEnum16;
typedef int aitInt32;
typedef unsigned int aitUint32;
typedef float aitFloat32;
typedef double aitFloat64;
typedef aitUint32 aitIndex;
typedef void* aitPointer;
typedef aitUint32 aitStatus;
/* should the bool be added as a conversion type? it currently is not */
typedef enum {
aitFalse=0,
aitTrue
} aitBool;
typedef struct {
char fixed_string[AIT_FIXED_STRING_SIZE];
} aitFixedString;
#ifdef __cplusplus
#include "aitHelpers.h"
#else
/* need time stamp structure different from posix unfortunetly */
typedef struct {
aitUint32 tv_sec;
aitUint32 tv_nsec;
} aitTimeStamp;
/* strings are a struct so they are different then aitInt8 */
typedef struct {
char* string;
aitUint32 len;
} aitString;
#endif
/* all normal types */
#define aitTotal 13
#define aitFirst aitEnumInvalid
#define aitLast aitEnumContainer
#define aitValid(x) ((x)<=aitLast && (x)>aitFirst)
/* all conversion types */
#define aitConvertTotal 11
#define aitConvertFirst aitEnumInt8
#define aitConvertLast aitEnumString
#define aitConvertAutoFirst aitEnumInt8
#define aitConvertAutoLast aitEnumFloat64
#define aitConvertValid(x) ((x)>=aitConvertFirst && (x)<=aitConvertLast)
/* currently no 64-bit integer support */
typedef enum {
aitEnumInvalid=0,
aitEnumInt8,
aitEnumUint8,
aitEnumInt16,
aitEnumUint16,
aitEnumEnum16,
aitEnumInt32,
aitEnumUint32,
aitEnumFloat32,
aitEnumFloat64,
aitEnumFixedString,
aitEnumString,
aitEnumContainer
} aitEnum;
typedef union {
aitInt8 Int8;
aitUint8 Uint8;
aitInt16 Int16;
aitUint16 Uint16;
aitEnum16 Enum16;
aitInt32 Int32;
aitUint32 Uint32;
aitFloat32 Float32;
aitFloat64 Float64;
aitIndex Index;
aitPointer Pointer;
aitFixedString* FString;
aitUint8 Dumb1[sizeof(aitString)]; /* aitString String; */
aitUint8 Dumb3[sizeof(aitTimeStamp)]; /* aitTimeStamp Stamp; */
} aitType;
/*
classes are not allowed in union that required construction/destruction
so I am insuring that the size of aitType is large enough to hold
strings and timestamps in an obsure, horrible way with the Dumb variables
*/
#ifdef __cplusplus
extern "C" {
#endif
epicsShareExtern const size_t aitSize[aitTotal];
epicsShareExtern const char* aitName[aitTotal];
epicsShareExtern const char* aitPrintf[aitTotal];
epicsShareExtern const char* aitScanf[aitTotal];
#ifdef __cplusplus
}
#endif
#endif