aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_str.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_str.h')
-rw-r--r--src/microhttpd/mhd_str.h42
1 files changed, 2 insertions, 40 deletions
diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h
index 284ad853..cd0af55f 100644
--- a/src/microhttpd/mhd_str.h
+++ b/src/microhttpd/mhd_str.h
@@ -38,6 +38,8 @@
38#include <stdbool.h> 38#include <stdbool.h>
39#endif /* HAVE_STDBOOL_H */ 39#endif /* HAVE_STDBOOL_H */
40 40
41#include "mhd_str_types.h"
42
41#if defined(_MSC_FULL_VER) && ! defined(_SSIZE_T_DEFINED) 43#if defined(_MSC_FULL_VER) && ! defined(_SSIZE_T_DEFINED)
42#define _SSIZE_T_DEFINED 44#define _SSIZE_T_DEFINED
43typedef intptr_t ssize_t; 45typedef intptr_t ssize_t;
@@ -47,46 +49,6 @@ typedef intptr_t ssize_t;
47#include "mhd_limits.h" 49#include "mhd_limits.h"
48#endif /* MHD_FAVOR_SMALL_CODE */ 50#endif /* MHD_FAVOR_SMALL_CODE */
49 51
50#ifndef MHD_STATICSTR_LEN_
51/**
52 * Determine length of static string / macro strings at compile time.
53 */
54#define MHD_STATICSTR_LEN_(macro) (sizeof(macro) / sizeof(char) - 1)
55#endif /* ! MHD_STATICSTR_LEN_ */
56
57/**
58 * Constant string with length
59 */
60struct _MHD_cstr_w_len
61{
62 const char *const str;
63 const size_t len;
64};
65
66/**
67 * String with length
68 */
69struct _MHD_str_w_len
70{
71 const char *str;
72 size_t len;
73};
74
75/**
76 * Modifiable string with length
77 */
78struct _MHD_mstr_w_len
79{
80 char *str;
81 size_t len;
82};
83
84/**
85 * Static string initialiser for struct _MHD_str_w_len
86 */
87#define _MHD_S_STR_W_LEN(str) { str, MHD_STATICSTR_LEN_(str) }
88
89
90/* 52/*
91 * Block of functions/macros that use US-ASCII charset as required by HTTP 53 * Block of functions/macros that use US-ASCII charset as required by HTTP
92 * standards. Not affected by current locale settings. 54 * standards. Not affected by current locale settings.