GRPC Core  0.10.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
stream_op.c File Reference
#include "src/core/transport/stream_op.h"
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

Macros

#define GROW(x)   (3 * (x) / 2)
 

Functions

void grpc_sopb_init (grpc_stream_op_buffer *sopb)
 
void grpc_sopb_destroy (grpc_stream_op_buffer *sopb)
 
void grpc_sopb_reset (grpc_stream_op_buffer *sopb)
 
void grpc_sopb_swap (grpc_stream_op_buffer *a, grpc_stream_op_buffer *b)
 
void grpc_stream_ops_unref_owned_objects (grpc_stream_op *ops, size_t nops)
 
void grpc_sopb_add_no_op (grpc_stream_op_buffer *sopb)
 
void grpc_sopb_add_begin_message (grpc_stream_op_buffer *sopb, gpr_uint32 length, gpr_uint32 flags)
 
void grpc_sopb_add_metadata (grpc_stream_op_buffer *sopb, grpc_metadata_batch b)
 
void grpc_sopb_add_slice (grpc_stream_op_buffer *sopb, gpr_slice slice)
 
void grpc_sopb_append (grpc_stream_op_buffer *sopb, grpc_stream_op *ops, size_t nops)
 
void grpc_sopb_move_to (grpc_stream_op_buffer *src, grpc_stream_op_buffer *dst)
 
void grpc_metadata_batch_assert_ok (grpc_metadata_batch *batch)
 
void grpc_metadata_batch_init (grpc_metadata_batch *batch)
 
void grpc_metadata_batch_destroy (grpc_metadata_batch *batch)
 
void grpc_metadata_batch_add_head (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_mdelem *elem_to_add)
 Add elem_to_add as the first element in batch, using storage as backing storage for the linked list element. More...
 
void grpc_metadata_batch_link_head (grpc_metadata_batch *batch, grpc_linked_mdelem *storage)
 Add storage to the beginning of batch. More...
 
void grpc_metadata_batch_add_tail (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_mdelem *elem_to_add)
 Add elem_to_add as the last element in batch, using storage as backing storage for the linked list element. More...
 
void grpc_metadata_batch_link_tail (grpc_metadata_batch *batch, grpc_linked_mdelem *storage)
 Add storage to the end of batch. More...
 
void grpc_metadata_batch_merge (grpc_metadata_batch *target, grpc_metadata_batch *add)
 
void grpc_metadata_batch_move (grpc_metadata_batch *dst, grpc_metadata_batch *src)
 Moves the metadata information from src to dst. More...
 
void grpc_metadata_batch_filter (grpc_metadata_batch *batch, grpc_mdelem *(*filter)(void *user_data, grpc_mdelem *elem), void *user_data)
 For each element in batch, execute filter. More...
 

Macro Definition Documentation

#define GROW (   x)    (3 * (x) / 2)

Function Documentation

void grpc_metadata_batch_add_head ( grpc_metadata_batch batch,
grpc_linked_mdelem storage,
grpc_mdelem elem_to_add 
)

Add elem_to_add as the first element in batch, using storage as backing storage for the linked list element.

storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call. Takes ownership of elem_to_add

void grpc_metadata_batch_add_tail ( grpc_metadata_batch batch,
grpc_linked_mdelem storage,
grpc_mdelem elem_to_add 
)

Add elem_to_add as the last element in batch, using storage as backing storage for the linked list element.

storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call. Takes ownership of elem_to_add

void grpc_metadata_batch_assert_ok ( grpc_metadata_batch batch)
void grpc_metadata_batch_destroy ( grpc_metadata_batch batch)
void grpc_metadata_batch_filter ( grpc_metadata_batch batch,
grpc_mdelem *(*)(void *user_data, grpc_mdelem *elem)  filter,
void *  user_data 
)

For each element in batch, execute filter.

The return value from filter will be substituted for the grpc_mdelem passed to filter. If filter returns NULL, the element will be moved to the garbage list.

void grpc_metadata_batch_init ( grpc_metadata_batch batch)
void grpc_metadata_batch_link_head ( grpc_metadata_batch batch,
grpc_linked_mdelem storage 
)

Add storage to the beginning of batch.

storage->md is assumed to be valid. storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call.

void grpc_metadata_batch_link_tail ( grpc_metadata_batch batch,
grpc_linked_mdelem storage 
)

Add storage to the end of batch.

storage->md is assumed to be valid. storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call.

void grpc_metadata_batch_merge ( grpc_metadata_batch target,
grpc_metadata_batch add 
)
void grpc_metadata_batch_move ( grpc_metadata_batch dst,
grpc_metadata_batch src 
)

Moves the metadata information from src to dst.

Upon return, src is zeroed.

void grpc_sopb_add_begin_message ( grpc_stream_op_buffer sopb,
gpr_uint32  length,
gpr_uint32  flags 
)
void grpc_sopb_add_metadata ( grpc_stream_op_buffer sopb,
grpc_metadata_batch  b 
)
void grpc_sopb_add_no_op ( grpc_stream_op_buffer sopb)
void grpc_sopb_add_slice ( grpc_stream_op_buffer sopb,
gpr_slice  slice 
)
void grpc_sopb_append ( grpc_stream_op_buffer sopb,
grpc_stream_op ops,
size_t  nops 
)
void grpc_sopb_destroy ( grpc_stream_op_buffer sopb)
void grpc_sopb_init ( grpc_stream_op_buffer sopb)
void grpc_sopb_move_to ( grpc_stream_op_buffer src,
grpc_stream_op_buffer dst 
)
void grpc_sopb_reset ( grpc_stream_op_buffer sopb)
void grpc_sopb_swap ( grpc_stream_op_buffer a,
grpc_stream_op_buffer b 
)
void grpc_stream_ops_unref_owned_objects ( grpc_stream_op ops,
size_t  nops 
)