mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
Make mg_mk_str take NULL, rename MG_STR MG_MK_STR
PUBLISHED_FROM=77f24c29667ca2aed3ad8a5102d7e1264f84228b
This commit is contained in:
1 parent
cf48c7280a
commit
a68d3d63b2
4 files changed
+66
-33
No files matched your search
+8
-4
@@ -1014,9 +1014,6 @@ struct mg_str {
|
||||
size_t len; /* Memory chunk length */
|
||||
};
|
||||
|
||||
#define MG_STR(str_literal) \
|
||||
{ str_literal, sizeof(str_literal) - 1 }
|
||||
|
||||
/*
|
||||
* Callback function (event handler) prototype, must be defined by user.
|
||||
* Mongoose calls event handler, passing events defined below.
|
||||
@@ -1799,9 +1796,16 @@ int mg_match_prefix(const char *pattern, int pattern_len, const char *str);
|
||||
int mg_match_prefix_n(const char *pattern, int pattern_len, const char *str,
|
||||
int str_len);
|
||||
|
||||
/* A helper function for creating mg_str struct from plain C string */
|
||||
/*
|
||||
* A helper function for creating mg_str struct from plain C string.
|
||||
* NULL is allowed and becomes {NULL, 0}.
|
||||
*/
|
||||
struct mg_str mg_mk_str(const char *s);
|
||||
|
||||
/* Macro for initializing mg_str. */
|
||||
#define MG_MK_STR(str_literal) \
|
||||
{ str_literal, sizeof(str_literal) - 1 }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Reference in new issue
Block a user