Path: blob/main/contrib/libcbor/src/cbor/streaming.h
39507 views
/*1* Copyright (c) 2014-2020 Pavel Kalvoda <[email protected]>2*3* libcbor is free software; you can redistribute it and/or modify4* it under the terms of the MIT license. See LICENSE for details.5*/67#ifndef LIBCBOR_STREAMING_H8#define LIBCBOR_STREAMING_H910#include "callbacks.h"11#include "cbor/cbor_export.h"12#include "cbor/common.h"1314#ifdef __cplusplus15extern "C" {16#endif1718/** Stateless decoder19*20* Will try parsing the \p source and will invoke the appropriate callback on21* success. Decodes one item at a time. No memory allocations occur.22*23* @param source Input buffer24* @param source_size Length of the buffer25* @param callbacks The callback bundle26* @param context An arbitrary pointer to allow for maintaining context.27*/28_CBOR_NODISCARD CBOR_EXPORT struct cbor_decoder_result cbor_stream_decode(29cbor_data source, size_t source_size,30const struct cbor_callbacks* callbacks, void* context);3132#ifdef __cplusplus33}34#endif3536#endif // LIBCBOR_STREAMING_H373839