summaryrefslogtreecommitdiff
path: root/upb/sink.c
blob: 7a7eeb41c8f74667f65fe2da9eba0e74082fcd47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

#include "upb/sink.h"

bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink sink) {
  void *subc;
  bool ret;
  upb_bufhandle handle = UPB_BUFHANDLE_INIT;
  handle.buf = buf;
  ret = upb_bytessink_start(&sink, len, &subc);
  if (ret && len != 0) {
    ret = (upb_bytessink_putbuf(&sink, subc, buf, len, &handle) >= len);
  }
  if (ret) {
    ret = upb_bytessink_end(&sink);
  }
  return ret;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback