summary refs log tree commit diff
path: root/warteraum/http_string.h
blob: ee47aa68a747edfacfe6569a252082fc8b0ee8a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef WARTERAUM_HTTP_STRING_H
#define WARTERAUM_HTTP_STRING_H

#include <string.h>

#define STATIC_HTTP_STRING(s) \
  { s, sizeof(s) - 1 }

#define HTTP_STRING_EQ(a, b) \
  (a.len == b.len && strncmp(a.buf, b.buf, a.len) == 0)

#define HTTP_STRING_IS(a, s) \
  (a.len == sizeof(s) - 1 && strncmp(a.buf, s, a.len) == 0)

#endif