KronkNet 1.0
Loading...
Searching...
No Matches
types.h
1/*
2** FREE PROJECT, 2026
3** KRONKNET
4** File description:
5** Explicit type definitions used across the public API.
6*/
7#ifndef KRONKNET_MACROS_TYPES_H
8 #define KRONKNET_MACROS_TYPES_H
9 #include <stdint.h>
10
11 #define KNBUFFSIZ 8192
12
14
18 typedef int knBool;
19 #define knTrue 1
20 #define knFalse 0
22
23
25
29 typedef unsigned short int knPort;
31
32
34
42 #ifdef _WIN32
43 typedef uintptr_t knSocket;
44 #define KN_INVALID_SOCKET (~(knSocket)0)
45 #else
46 typedef int knSocket;
47 #define KN_INVALID_SOCKET (-1)
48 #endif /* _WIN32 */
50
51
53
57 #if defined(_MSC_VER) && !defined(_SSIZE_T_DEFINED)
58 typedef intptr_t ssize_t;
59 #define _SSIZE_T_DEFINED
60 #elif !defined(_MSC_VER)
61 #include <sys/types.h>
62 #endif /* _MSC_VER */
64
65
67
71 typedef enum kronknet_log_level_e {
72
73 knLogTrace = 0,
74 knLogDebug,
75 knLogInfo,
76 knLogWarn,
77 knLogError,
78 knLogFatal,
79
80 knLogNone,
81
82 } knLogLevel;
84
85
87
91 typedef enum kronknet_flags_e {
92
93 knTCP = 0x01,
94 knUDP = 0x02,
95
96 } knFlags;
98
99#endif /* KRONKNET_MACROS_TYPES_H */