libcoap  4.2.0
str.h File Reference
#include <string.h>
+ Include dependency graph for str.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  coap_string_t
 Coap string data definition. More...
 
struct  coap_str_const_t
 Coap string data definition with const data. More...
 
struct  coap_binary_t
 Coap binary data definition. More...
 

Macros

#define COAP_SET_STR(st, l, v)   { (st)->length = (l), (st)->s = (v); }
 
#define coap_make_str_const(string)   (&(coap_str_const_t){sizeof(string)-1,(const uint8_t *)(string)})
 Take the specified byte array (text) and create a coap_str_const_t *. More...
 
#define coap_string_equal(string1, string2)
 Compares the two strings for equality. More...
 

Typedefs

typedef struct coap_string_t coap_string_t
 Coap string data definition. More...
 
typedef struct coap_str_const_t coap_str_const_t
 Coap string data definition with const data. More...
 
typedef struct coap_binary_t coap_binary_t
 Coap binary data definition. More...
 

Functions

coap_string_tcoap_new_string (size_t size)
 Returns a new string object with at least size+1 bytes storage allocated. More...
 
void coap_delete_string (coap_string_t *string)
 Deletes the given string and releases any memory allocated. More...
 
coap_str_const_tcoap_new_str_const (const uint8_t *data, size_t size)
 Returns a new const string object with at least size+1 bytes storage allocated, and the provided data copied into the string object. More...
 
void coap_delete_str_const (coap_str_const_t *string)
 Deletes the given const string and releases any memory allocated. More...