From: E. Scott Daniels Date: Thu, 2 May 2019 15:44:16 +0000 (+0000) Subject: fix(API): Add missing trace init function X-Git-Tag: 1.0.31~26 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=2f37eac699d6727b6f32bd7de6838d948812ccde;p=ric-plt%2Flib%2Frmr.git fix(API): Add missing trace init function The trace init funciton was missing from the nanomsg support in the library. Change-Id: I4afae697c32e1d7eb99685f10843890fd98be73c Signed-off-by: E. Scott Daniels --- diff --git a/src/nanomsg/src/rmr.c b/src/nanomsg/src/rmr.c index e67402f..392feb7 100644 --- a/src/nanomsg/src/rmr.c +++ b/src/nanomsg/src/rmr.c @@ -634,6 +634,26 @@ static void* init( char* uproto_port, int max_msg_size, int flags ) { return (void *) ctx; } +/* + This sets the default trace length which will be added to any message buffers + allocated. It can be set at any time, and if rmr_set_trace() is given a + trace len that is different than the default allcoated in a message, the message + will be resized. + + Returns 0 on failure and 1 on success. If failure, then errno will be set. +*/ +extern int rmr_init_trace( void* vctx, int tr_len ) { + uta_ctx_t* ctx; + + errno = 0; + if( (ctx = (uta_ctx_t *) vctx) == NULL ) { + errno = EINVAL; + return 0; + } + + ctx->trace_data_len = tr_len; + return 1; +} /* Publicly facing initialisation function. Wrapper for the init() funcion above