# SFBTypes.h

Go to the documentation of this file.

    00001 /*                                              -*- mode:C++; fill-column:100 -*-
    00002   SFBTypes.h - Short names for sized ints, and limits
    00003   Copyright (C) 2008 The Regents of the University of New Mexico.  All rights reserved.
    00004
    00005   This library is free software; you can redistribute it and/or
    00006   modify it under the terms of the GNU Lesser General Public
    00007   License as published by the Free Software Foundation; either
    00008   version 2.1 of the License, or (at your option) any later version.
    00009
    00010   This library is distributed in the hope that it will be useful,
    00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013   Lesser General Public License for more details.
    00014
    00015   You should have received a copy of the GNU General Public License
    00016   along with this library; if not, write to the Free Software
    00017   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00018   USA
    00019 */
    00020
    00027 #ifndef SFBTYPES_H
    00028 #define SFBTYPES_H
    00029
    00030 #include <inttypes.h>
    00031
    00032 typedef int8_t  s8;                    /* signed */
    00033 typedef int16_t s16;
    00034 typedef int32_t s32;
    00035 typedef int64_t s64;
    00036 typedef intptr_t sptr;
    00037
    00038 typedef const int8_t  sc8;             /* signed const */
    00039 typedef const int16_t sc16;
    00040 typedef const int32_t sc32;
    00041 typedef const int64_t sc64;
    00042 typedef const intptr_t scptr;
    00043
    00044 typedef volatile int8_t  sv8;          /* signed volatile */
    00045 typedef volatile int16_t sv16;
    00046 typedef volatile int32_t sv32;
    00047 typedef volatile int64_t sv64;
    00048 typedef volatile intptr_t svptr;
    00049
    00050 typedef volatile const int8_t  svc8;   /* signed volatile const */
    00051 typedef volatile const int16_t svc16;
    00052 typedef volatile const int32_t svc32;
    00053 typedef volatile const int64_t svc64;
    00054 typedef volatile const intptr_t svcptr;
    00055
    00056 typedef uint8_t  u8;                   /* unsigned */
    00057 typedef uint16_t u16;
    00058 typedef uint32_t u32;
    00059 typedef uint64_t u64;
    00060 typedef uintptr_t uptr;
    00061
    00062 typedef const uint8_t  uc8;            /* unsigned const */
    00063 typedef const uint16_t uc16;
    00064 typedef const uint32_t uc32;
    00065 typedef const uint64_t uc64;
    00066 typedef const uintptr_t ucptr;
    00067
    00068 typedef volatile uint8_t  uv8;         /* unsigned volatile */
    00069 typedef volatile uint16_t uv16;
    00070 typedef volatile uint32_t uv32;
    00071 typedef volatile uint64_t uv64;
    00072 typedef volatile uintptr_t uvptr;
    00073
    00074 typedef volatile const uint8_t  uvc8;  /* unsigned volatile const */
    00075 typedef volatile const uint16_t uvc16;
    00076 typedef volatile const uint32_t uvc32;
    00077 typedef volatile const uint64_t uvc64;
    00078 typedef volatile const uintptr_t uvcptr;
    00079
    00080 #define S8_MAX     ((s8)127)           /* signed ranges */
    00081 #define S8_MIN     ((s8)-128)
    00082 #define S16_MAX    ((s16)32767)
    00083 #define S16_MIN    ((s16)-32768)
    00084 #define S32_MAX    ((s32)2147483647)
    00085 #define S32_MIN    ((s32)2147483648UL)
    00086 #define S64_MIN    ((s64)2147483648UL)
    00087
    00088 #define U8_MAX     ((u8)255)           /* unsigned ranges */
    00089 #define U8_MIN     ((u8)0)
    00090 #define U16_MAX    ((u16)65535U)
    00091 #define U16_MIN    ((u16)0)
    00092 #define U32_MAX    ((u32)4294967295UL)
    00093 #define U32_MIN    ((u32)0)
    00094
    00095 typedef void IRQHandler (void);
    00096
    00097 #endif  /* SFBTYPES_H */