src/occ_405/trac/trac_interface.c
// Function Specification
//
// Name: trace_adal_write_all
//
// Description: In order to leverage the tracepp, need to add this function. It will call
//              trac_write_int finally
//
// End Function Specification
Function Specification
Name: trace_adal_write_all

In order to leverage the tracepp, need to add this function. It will call
trac_write_int finally

End Function Specification
Function Specification Name : trace_adal_write_all In order to leverage the tracepp need to add this function . It will call trac_write_int finally End Function Specification
UINT trace_adal_write_all(const trace_descriptor_array_t *io_td,const trace_hash_val i_hash,
                     const char *i_fmt,const ULONG i_line, const ULONG i_type,...)
{
    UINT rc = 0, i = 0;
    UINT l_num_args = 0;
    ULONG l_i_param[TRACE_MAX_ARGS] = {0};
    if(i_fmt != NULL)
    {
        l_num_args = 1;
        for(i=0;i_fmt[i] != 0;i++)
        {
            if( i_fmt[i] == ',')
            {
                l_num_args++;
            }
        }
    }
    va_list l_argptr;     
    va_start(l_argptr,i_type);
    if(TRACE_MAX_ARGS < l_num_args)
    {
        l_num_args = TRACE_MAX_ARGS;
    }
    for (i=0;i<l_num_args;i++)
    {
        l_i_param[i] = va_arg(l_argptr,ULONG);
    }
    va_end(l_argptr);
    rc = trac_write_int(io_td,
                        i_hash, i_line,
                        l_num_args,
                        l_i_param[0],
                        l_i_param[1],
                        l_i_param[2],
                        l_i_param[3],
                        l_i_param[4]   );
    return rc;
}
UINT trace_adal_write_all ( const trace_descriptor_array_t * io_td , const trace_hash_val i_hash , const char * i_fmt , const ULONG i_line , const ULONG i_type , ... ) { UINT rc = 0 , i = 0 ; UINT l_num_args = 0 ; ULONG l_i_param [ TRACE_MAX_ARGS ] = { 0 } ; if ( i_fmt != NULL ) { l_num_args = 1 ; for ( i = 0 ; i_fmt [ i ] != 0 ; i ++ ) { if ( i_fmt [ i ] == ' ' ) { l_num_args ++ ; } } } va_list l_argptr ; va_start ( l_argptr , i_type ) ; if ( TRACE_MAX_ARGS < l_num_args ) { l_num_args = TRACE_MAX_ARGS ; } for ( i = 0 ; i < l_num_args ; i ++ ) { l_i_param [ i ] = va_arg ( l_argptr , ULONG ) ; } va_end ( l_argptr ) ; rc = trac_write_int ( io_td , i_hash , i_line , l_num_args , l_i_param [ 0 ] , l_i_param [ 1 ] , l_i_param [ 2 ] , l_i_param [ 3 ] , l_i_param [ 4 ] ) ; return rc ; }
Function Specification
Name: trace_adal_write_all
Function Specification Name : trace_adal_write_all
// Calculate the number of optional parameters by looking at the i_fmt. // i_fmt will store something like "%d,%f,%u" // Get the optional parameters //will hold optional parameters // Check the number of optional parameters