Get rid of ubjson

PUBLISHED_FROM=e6f1dca95ec7ed3795adf493cca9cdcdc07381f5
This commit is contained in:
Alexander Alashkin 2016-07-12 21:37:07 +01:00 committed by Cesanta Bot
parent 36a1927915
commit 68dd8d277d
2 changed files with 7 additions and 1 deletions

View File

@ -971,6 +971,11 @@ struct mg_str mg_mk_str(const char *s) {
return ret;
}
struct mg_str mg_mk_str_n(const char *s, size_t len) {
struct mg_str ret = {s, len};
return ret;
}
int mg_vcmp(const struct mg_str *str1, const char *str2) {
size_t n2 = strlen(str2), n1 = str1->len;
int r = memcmp(str1->p, str2, (n1 < n2) ? n1 : n2);

View File

@ -862,10 +862,11 @@ struct mg_str {
};
/*
* A helper function for creating mg_str struct from plain C string.
* Helper functions 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);
struct mg_str mg_mk_str_n(const char *s, size_t len);
/* Macro for initializing mg_str. */
#define MG_MK_STR(str_literal) \