GRPC Core  0.11.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
slice.h File Reference
#include <grpc/support/sync.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  gpr_slice_refcount
 
struct  gpr_slice
 

Macros

#define GPR_SLICE_INLINED_SIZE   (sizeof(size_t) + sizeof(gpr_uint8 *) - 1)
 
#define GPR_SLICE_START_PTR(slice)
 
#define GPR_SLICE_LENGTH(slice)
 
#define GPR_SLICE_SET_LENGTH(slice, newlen)
 
#define GPR_SLICE_END_PTR(slice)   GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(slice)
 
#define GPR_SLICE_IS_EMPTY(slice)   (GPR_SLICE_LENGTH(slice) == 0)
 

Typedefs

typedef struct gpr_slice_refcount gpr_slice_refcount
 
typedef struct gpr_slice gpr_slice
 

Functions

gpr_slice gpr_slice_ref (gpr_slice s)
 
void gpr_slice_unref (gpr_slice s)
 
gpr_slice gpr_slice_new (void *p, size_t len, void(*destroy)(void *))
 
gpr_slice gpr_slice_new_with_len (void *p, size_t len, void(*destroy)(void *, size_t))
 
gpr_slice gpr_slice_malloc (size_t length)
 
gpr_slice gpr_slice_from_copied_string (const char *source)
 
gpr_slice gpr_slice_from_copied_buffer (const char *source, size_t len)
 
gpr_slice gpr_slice_sub (gpr_slice s, size_t begin, size_t end)
 
gpr_slice gpr_slice_sub_no_ref (gpr_slice s, size_t begin, size_t end)
 
gpr_slice gpr_slice_split_tail (gpr_slice *s, size_t split)
 
gpr_slice gpr_slice_split_head (gpr_slice *s, size_t split)
 
gpr_slice gpr_empty_slice (void)
 
int gpr_slice_cmp (gpr_slice a, gpr_slice b)
 
int gpr_slice_str_cmp (gpr_slice a, const char *b)
 

Macro Definition Documentation

#define GPR_SLICE_END_PTR (   slice)    GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(slice)
#define GPR_SLICE_INLINED_SIZE   (sizeof(size_t) + sizeof(gpr_uint8 *) - 1)
#define GPR_SLICE_IS_EMPTY (   slice)    (GPR_SLICE_LENGTH(slice) == 0)
#define GPR_SLICE_LENGTH (   slice)
Value:
((slice).refcount ? (slice).data.refcounted.length \
: (slice).data.inlined.length)
#define GPR_SLICE_SET_LENGTH (   slice,
  newlen 
)
Value:
((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \
: ((slice).data.inlined.length = (gpr_uint8)(newlen)))
uint8_t gpr_uint8
Definition: port_platform.h:310
#define GPR_SLICE_START_PTR (   slice)
Value:
((slice).refcount ? (slice).data.refcounted.bytes \
: (slice).data.inlined.bytes)

Typedef Documentation

typedef struct gpr_slice gpr_slice

Function Documentation

gpr_slice gpr_empty_slice ( void  )
int gpr_slice_cmp ( gpr_slice  a,
gpr_slice  b 
)
gpr_slice gpr_slice_from_copied_buffer ( const char *  source,
size_t  len 
)
gpr_slice gpr_slice_from_copied_string ( const char *  source)
gpr_slice gpr_slice_malloc ( size_t  length)
gpr_slice gpr_slice_new ( void *  p,
size_t  len,
void(*)(void *)  destroy 
)
gpr_slice gpr_slice_new_with_len ( void *  p,
size_t  len,
void(*)(void *, size_t)  destroy 
)
gpr_slice gpr_slice_ref ( gpr_slice  s)
gpr_slice gpr_slice_split_head ( gpr_slice s,
size_t  split 
)
gpr_slice gpr_slice_split_tail ( gpr_slice s,
size_t  split 
)
int gpr_slice_str_cmp ( gpr_slice  a,
const char *  b 
)
gpr_slice gpr_slice_sub ( gpr_slice  s,
size_t  begin,
size_t  end 
)
gpr_slice gpr_slice_sub_no_ref ( gpr_slice  s,
size_t  begin,
size_t  end 
)
void gpr_slice_unref ( gpr_slice  s)