#ifndef HEADER_CURL_BUFREF_H1#define HEADER_CURL_BUFREF_H2/***************************************************************************3* _ _ ____ _4* Project ___| | | | _ \| |5* / __| | | | |_) | |6* | (__| |_| | _ <| |___7* \___|\___/|_| \_\_____|8*9* Copyright (C) Daniel Stenberg, <[email protected]>, et al.10*11* This software is licensed as described in the file COPYING, which12* you should have received as part of this distribution. The terms13* are also available at https://curl.se/docs/copyright.html.14*15* You may opt to use, copy, modify, merge, publish, distribute and/or sell16* copies of the Software, and permit persons to whom the Software is17* furnished to do so, under the terms of the COPYING file.18*19* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY20* KIND, either express or implied.21*22* SPDX-License-Identifier: curl23*24***************************************************************************/2526/*27* Generic buffer reference.28*/29struct bufref {30void (*dtor)(void *); /* Associated destructor. */31const unsigned char *ptr; /* Referenced data buffer. */32size_t len; /* The data size in bytes. */33#ifdef DEBUGBUILD34int signature; /* Detect API use mistakes. */35#endif36};373839void Curl_bufref_init(struct bufref *br);40void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len,41void (*dtor)(void *));42const unsigned char *Curl_bufref_ptr(const struct bufref *br);43size_t Curl_bufref_len(const struct bufref *br);44CURLcode Curl_bufref_memdup(struct bufref *br, const void *ptr, size_t len);45void Curl_bufref_free(struct bufref *br);4647#endif484950