MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / cdb2_push_context

Function cdb2_push_context

cdb2api/cdb2api.c:6784–6796  ·  view source on GitHub ↗

Store the specified message in the handle. Return error if MAX_CONTEXTS number of messages have already been stored. @param hndl [IN] Connection handle @param msg [IN] Context message @return 0 Success 1 Error */

Source from the content-addressed store, hash-verified

6782 1 Error
6783*/
6784int cdb2_push_context(cdb2_hndl_tp *hndl, const char *msg)
6785{
6786 /* Check for overflow. */
6787 if (hndl->context_msgs.count >= MAX_CONTEXTS) {
6788 return 1;
6789 }
6790
6791 hndl->context_msgs.message[hndl->context_msgs.count] =
6792 strndup(msg, MAX_CONTEXT_LEN);
6793 hndl->context_msgs.count++;
6794 hndl->context_msgs.has_changed = 1;
6795 return 0;
6796}
6797
6798/*
6799 Remove the last stored context message.

Callers 1

run_statementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected