Files
libcoap/include/coap/str.h
T
Carsten Schoenert 0e59edc231 i/c/*.h: more public header cleanup
Resume the cleaning of the public header files, no functional changes.

Reformatting the infos in the head of the header files, restructure header
inclusion check to be more generic. Reorder some include directives in a
alphabetical order. Remove including instructions for C++ stuff, it's
already done in the coap.h header, and the user only has to include this
header file.

Dropping the prefixing of the include guarding of uthash.h because it would
cause trouble with the macro handling in TinyDLS.
Thanks Olaf for reminding this!
2016-01-10 17:49:07 +01:00

34 lines
761 B
C

/*
* str.h -- strings to be used in the CoAP library
*
* Copyright (C) 2010-2011 Olaf Bergmann <bergmann@tzi.org>
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
#ifndef _COAP_STR_H_
#define _COAP_STR_H_
#include <string.h>
typedef struct {
size_t length; /* length of string */
unsigned char *s; /* string data */
} str;
#define COAP_SET_STR(st,l,v) { (st)->length = (l), (st)->s = (v); }
/**
* Returns a new string object with at least size bytes storage allocated. The
* string must be released using coap_delete_string();
*/
str *coap_new_string(size_t size);
/**
* Deletes the given string and releases any memory allocated.
*/
void coap_delete_string(str *);
#endif /* _COAP_STR_H_ */