You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pEpEngine/src/growing_buf.h

57 lines
1.0 KiB
C

5 years ago
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#pragma once
#include "pEpEngine.h"
#ifdef __cplusplus
extern "C" {
#endif
// this is a growing buffer, which is needed by the ASN.1 implementation
// i.e. for encoding to XER
typedef struct growing_buf {
char *data;
size_t size;
} growing_buf_t;
// new_growing_buf() - allocate a new growing buffer
//
// return value:
// new buffer or NULL if out of memory
growing_buf_t *new_growing_buf(void);
// free_growing_buf() - free growing buffer
//
// parameters:
// buf (in) buffer to free
void free_growing_buf(growing_buf_t *buf);
// growing_buf_consume() - append new data to growing buffer
//
// parameters:
// src (in) new data
// size (in) size of new data
// dst (in) growing buffer where new data will be appended
//
// return value:
// 1 on succes, -1 on failure
int growing_buf_consume(const void *src, size_t size, growing_buf_t *dst);
#ifdef __cplusplus
}
#endif