Returns whether the buffer begins with the specified magic bytes. */
| 109 | |
| 110 | /* Returns whether the buffer begins with the specified magic bytes. */ |
| 111 | static inline bool buffer_check_magic(const struct buffer *b, const char *magic, |
| 112 | size_t magic_len) |
| 113 | { |
| 114 | assert(magic); |
| 115 | return b && b->size >= magic_len && |
| 116 | memcmp(b->data, magic, magic_len) == 0; |
| 117 | } |
| 118 | |
| 119 | /* Returns the start of the underlying buffer, with the offset undone */ |
| 120 | static inline void *buffer_get_original_backing(const struct buffer *b) |
no test coverage detected