00001 #ifndef __XPTYPES_H 00002 #define __XPTYPES_H 00003 /******************************************************************************/ 00004 /* */ 00005 /* X P t y p e s . h h */ 00006 /* */ 00007 /* (c) 2012 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* The XRootD protocol definition, documented in this file, is distributed */ 00025 /* under a modified BSD license and may be freely used to reimplement it. */ 00026 /* Any references to "source" in this license refers to this file or any */ 00027 /* other file that specifically contains the following license. */ 00028 /* */ 00029 /* Redistribution and use in source and binary forms, with or without */ 00030 /* modification, are permitted provided that the following conditions */ 00031 /* are met: */ 00032 /* */ 00033 /* 1. Redistributions of source code must retain the above copyright notice, */ 00034 /* this list of conditions and the following disclaimer. */ 00035 /* */ 00036 /* 2. Redistributions in binary form must reproduce the above copyright */ 00037 /* notice, this list of conditions and the following disclaimer in the */ 00038 /* documentation and/or other materials provided with the distribution. */ 00039 /* */ 00040 /* 3. Neither the name of the copyright holder nor the names of its */ 00041 /* contributors may be used to endorse or promote products derived from */ 00042 /* this software without specific prior written permission. */ 00043 /* */ 00044 /* 4. Derived software may not use the name XRootD or cmsd (regardless of */ 00045 /* capitilization) in association with the derived work if the protocol */ 00046 /* documented in this file is changed in any way. */ 00047 /* */ 00048 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ 00049 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ 00050 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ 00051 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ 00052 /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ 00053 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ 00054 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ 00055 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ 00056 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ 00057 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ 00058 /******************************************************************************/ 00059 00060 // Full range type compatibility work done by Gerardo Ganis, CERN. 00061 00062 // Typical data types 00063 // 00064 // Only char and short are truly portable types 00065 typedef unsigned char kXR_char; 00066 typedef short kXR_int16; 00067 typedef unsigned short kXR_unt16; 00068 00069 // Signed integer 4 bytes 00070 // 00071 #ifndef XR__INT16 00072 # if defined(LP32) || defined(__LP32) || defined(__LP32__) || \ 00073 defined(BORLAND) 00074 # define XR__INT16 00075 # endif 00076 #endif 00077 #ifndef XR__INT64 00078 # if defined(ILP64) || defined(__ILP64) || defined(__ILP64__) 00079 # define XR__INT64 00080 # endif 00081 #endif 00082 #if defined(XR__INT16) 00083 typedef long kXR_int32; 00084 typedef unsigned long kXR_unt32; 00085 #elif defined(XR__INT64) 00086 typedef int32 kXR_int32; 00087 typedef unsigned int32 kXR_unt32; 00088 #else 00089 typedef int kXR_int32; 00090 typedef unsigned int kXR_unt32; 00091 #endif 00092 00093 // Signed integer 8 bytes 00094 // 00095 //#if defined(_WIN32) 00096 //typedef __int64 kXR_int64; 00097 //#else 00098 typedef long long kXR_int64; 00099 typedef unsigned long long kXR_unt64; 00100 //#endif 00101 #endif