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 6657 2026-10-28 18:19:39Z 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;
92typedef uint8_t U8;
94typedef uint16_t U16;
96typedef uint32_t U32;
98typedef uint64_t U64;
99
106typedef S64 BaTime;
107
108
111typedef struct {
118} BaTimeEx;
119
121typedef U8 BaBool;
122#ifndef TRUE
123#define TRUE 1
124#define FALSE 0
125#endif
126
127#define S64_getMsw(o) ((S32)(0xFFFFFFFF & ((o) >> 32) ))
128
129#if BA_FILE_OFFSET_BITS == 64
131typedef U64 BaFileSize;
133typedef S64 SBaFileSize;
134/* Unsigned and Signed baprintf FileSize format flags */
135#define BA_UFSF "llu"
136#define BA_SFSF "lld"
137#else
142#define BA_UFSF "lu"
143#define BA_SFSF "ld"
144#endif
147#define iStrlen(s) ((int)strlen(s))
148
149#include "BaAtoi.h"
150
151#endif
uint16_t U16
Unsigned 16-bit integer.
Definition: GenPrimT.h:94
int64_t S64
Signed 64-bit integer.
Definition: GenPrimT.h:90
uint64_t U64
Unsigned 64-bit integer.
Definition: GenPrimT.h:98
S32 SBaFileSize
Signed file-size value in bytes; 32 bits with BA_FILE_OFFSET_BITS=32.
Definition: GenPrimT.h:141
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:106
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:96
int16_t S16
Signed 16-bit integer.
Definition: GenPrimT.h:86
uint8_t U8
Unsigned 8-bit integer.
Definition: GenPrimT.h:92
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:121
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:139
UTC timestamp with a fractional second and an explicit timezone offset.
Definition: GenPrimT.h:111
S16 offset
Minutes east of UTC, from -1439 to 1439; negative values are west.
Definition: GenPrimT.h:117
BaTime sec
Signed seconds since 1970-01-01 00:00:00 UTC, independent of offset.
Definition: GenPrimT.h:113
S32 nsec
Nanoseconds, valid range: 0 to 999999999.
Definition: GenPrimT.h:115