00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef SIO_FUNCTIONS_H
00015 #define SIO_FUNCTIONS_H 1
00016
00017 #define SIO_LEN_SB 1
00018 #define SIO_LEN_DB 2
00019 #define SIO_LEN_QB 4
00020 #define SIO_LEN_OB 8
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #if defined(_AIX) || defined(__alpha__) || defined(__i386__) || defined(__sparc__) || defined(__APPLE_CC__) || defined(_LP64)
00043
00044
00045
00046 #define SIO_64BITINT long long
00047
00048 #endif
00049
00050 #if defined(_M_ALPHA) || defined(_M_IX86) || defined(_M_PPC)
00051 #define SIO_64BITINT __int64
00052 #endif
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 #if defined(__alpha__) || defined(_M_ALPHA) || defined(_LP64)
00072 #define SIO_POINTER_DECL size_t
00073 #endif
00074
00075 #if defined(_AIX) || defined(__i386__) || defined(__sparc__) || defined(_M_IX86) || defined(_M_PPC) || defined(__APPLE_CC__)
00076 #define SIO_POINTER_DECL unsigned int
00077 #endif
00078
00079
00080
00081
00082 #define SIO_DATA( rec, pnt, cnt ) status = SIO_functions::data( (rec), (pnt), (cnt) ); if( !(status & 1) ) return status;
00083
00084 #define SIO_PNTR( rec, pnt ) status = SIO_functions::pointer_to( (rec), (SIO_POINTER_DECL *)(pnt) ); if( !(status & 1) ) return status;
00085
00086 #define SIO_PTAG( rec, pnt ) status = SIO_functions::pointed_at( (rec), (SIO_POINTER_DECL *)(pnt) ); if( !(status & 1) ) return status;
00087
00088
00089
00090
00091 #define UCHR_CAST(pntr) (reinterpret_cast<unsigned char*>((pntr)))
00092
00093 class SIO_stream;
00094
00095 class SIO_functions
00096 {
00097 public:
00098
00099 static unsigned int data( SIO_stream*, char*, const int );
00100 static unsigned int data( SIO_stream*, unsigned char*, const int );
00101 static unsigned int data( SIO_stream*, short*, const int );
00102 static unsigned int data( SIO_stream*, unsigned short*, const int );
00103 static unsigned int data( SIO_stream*, int*, const int );
00104 static unsigned int data( SIO_stream*, unsigned int*, const int );
00105 static unsigned int data( SIO_stream*, SIO_64BITINT*, const int );
00106 static unsigned int data( SIO_stream*, unsigned SIO_64BITINT*, const int );
00107 static unsigned int data( SIO_stream*, float*, const int );
00108 static unsigned int data( SIO_stream*, double*, const int );
00109
00110 static unsigned int pointed_at( SIO_stream*, SIO_POINTER_DECL* );
00111 static unsigned int pointer_to( SIO_stream*, SIO_POINTER_DECL* );
00112
00113 static bool validateName( const char* );
00114
00115 private:
00116
00117 static void copy( unsigned char*, unsigned char*,
00118 const int, const int );
00119 static unsigned int xfer( SIO_stream*, const int,
00120 const int, unsigned char* );
00121
00122 friend class SIO_stream;
00123 friend class SIO_record;
00124 };
00125
00126 #endif