Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
GenPrimT.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: GenPrimT.h 6917 2026-11-24 21:38:24Z wini $
15 *
16 * COPYRIGHT: Real Time Logic, 2004 - 2026
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 *
37 * Do not directly include this file!!!
38 * This header file contains Generic Primitive Type definitions.
39 * The header file is included by the architecture dependent header file
40 * TargConfig.h for most of the supported platforms.
41 */
42
45#ifndef _TargConfig_h
46#include <TargConfig.h>
47#endif
48
49#ifndef _GenPrimT_h
50#define _GenPrimT_h
51#include <BaConfigTypes.h>
52#include <stdint.h>
53#include <float.h>
54#include <limits.h>
55
56/* JSON/UBJSON and binary numeric encodings require these representations. */
57#if CHAR_BIT != 8 || FLT_RADIX != 2 || FLT_MANT_DIG != 24 || DBL_MANT_DIG != 53 || FLT_MAX_EXP != 128 || DBL_MAX_EXP != 1024
58#error BAS requires 8-bit bytes, binary32 float and binary64 double
59#endif
60typedef char BaFloatSizeCheck[sizeof(float) == 4 ? 1 : -1];
61typedef char BaDoubleSizeCheck[sizeof(double) == 8 ? 1 : -1];
62
63
64#ifdef __ICCARM__
65#pragma diag_suppress=Pa084
66#pragma diag_suppress=Pa089
67#pragma diag_suppress=Pa181
68#pragma diag_suppress=Pe188
69#pragma diag_suppress=Pe546
70#pragma diag_suppress=Pe550
71#endif
72
78/***********************************************************************
79 * Barracuda types
80 ***********************************************************************/
81
82/* Define Barracuda's legacy types */
84typedef int8_t S8;
86typedef int16_t S16;
88typedef int32_t S32;
90typedef int64_t S64;
91#ifndef BA_PORT_HAS_U8_U16_U32
93typedef uint8_t U8;
95typedef uint16_t U16;
97typedef uint32_t U32;
98#endif
100typedef uint64_t U64;
101
108typedef S64 BaTime;
109
110
113typedef struct {
120} BaTimeEx;
121
123typedef U8 BaBool;
124#ifndef TRUE
125#define TRUE 1
126#define FALSE 0
127#endif
128
129#define S64_getMsw(o) ((S32)(0xFFFFFFFF & ((o) >> 32) ))
130
131#if BA_FILE_OFFSET_BITS == 64
133typedef U64 BaFileSize;
135typedef S64 SBaFileSize;
136/* Unsigned and Signed baprintf FileSize format flags */
137#define BA_UFSF "llu"
138#define BA_SFSF "lld"
139#else
144#define BA_UFSF "lu"
145#define BA_SFSF "ld"
146#endif
149#define iStrlen(s) ((int)strlen(s))
150
151#include "BaAtoi.h"
152
153#endif
uint16_t U16
Unsigned 16-bit integer.
Definition: GenPrimT.h:95
int64_t S64
Signed 64-bit integer.
Definition: GenPrimT.h:90
uint64_t U64
Unsigned 64-bit integer.
Definition: GenPrimT.h:100
S32 SBaFileSize
Signed file-size value in bytes; 32 bits with BA_FILE_OFFSET_BITS=32.
Definition: GenPrimT.h:143
int32_t S32
Signed 32-bit integer.
Definition: GenPrimT.h:88
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:00 UTC,...
Definition: GenPrimT.h:108
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:97
int16_t S16
Signed 16-bit integer.
Definition: GenPrimT.h:86
uint8_t U8
Unsigned 8-bit integer.
Definition: GenPrimT.h:93
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:123
int8_t S8
Signed 8-bit integer.
Definition: GenPrimT.h:84
U32 BaFileSize
Unsigned file size or position in bytes; 32 bits with BA_FILE_OFFSET_BITS=32.
Definition: GenPrimT.h:141
UTC timestamp with a fractional second and an explicit timezone offset.
Definition: GenPrimT.h:113
S16 offset
Minutes east of UTC, from -1439 to 1439; negative values are west.
Definition: GenPrimT.h:119
BaTime sec
Signed seconds since 1970-01-01 00:00:00 UTC, independent of offset.
Definition: GenPrimT.h:115
S32 nsec
Nanoseconds, valid range: 0 to 999999999.
Definition: GenPrimT.h:117