Browse Source

[core] buffer_is_equal_string -> buffer_eq_slen

master
Glenn Strauss 7 months ago
parent
commit
f7bcc83355
  1. 7
      src/buffer.c
  2. 5
      src/buffer.h

7
src/buffer.c

@ -419,13 +419,6 @@ int buffer_is_equal(const buffer *a, const buffer *b) {
return (a->used == b->used && 0 == memcmp(a->ptr, b->ptr, a->used));
}
int buffer_is_equal_string(const buffer *a, const char *s, size_t b_len) {
force_assert(b_len + 1 > b_len);
/* 1 = equal; 0 = not equal */
return (a->used == b_len + 1 && 0 == memcmp(a->ptr, s, b_len));
}
void li_tohex_lc(char * const restrict buf, size_t buf_len, const char * const restrict s, size_t s_len) {
force_assert(2 * s_len > s_len);

5
src/buffer.h

@ -181,15 +181,12 @@ int buffer_eq_icase_slen(const buffer * const b, const char * const s, const siz
__attribute_nonnull__
__attribute_pure__
int buffer_eq_slen(const buffer * const b, const char * const s, const size_t slen);
#define buffer_is_equal_string buffer_eq_slen
__attribute_nonnull__
__attribute_pure__
int buffer_is_equal(const buffer *a, const buffer *b);
__attribute_nonnull__
__attribute_pure__
int buffer_is_equal_string(const buffer *a, const char *s, size_t b_len);
__attribute_nonnull__
void buffer_substr_replace (buffer * restrict b, size_t offset, size_t len, const buffer * restrict replace);

Loading…
Cancel
Save