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 */
| 6782 | 1 Error |
| 6783 | */ |
| 6784 | int 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. |