/*                                                                          */
/* Function    : tracker memory allocation                                  */


#include  "windef.h"
#include  "mbdr_dsp_debug_stream_manage.h"

#ifndef __MBDR_DSP_DEBUG_PRINT_UTILS_H
#define __MBDR_DSP_DEBUG_PRINT_UTILS_H


#define MBDR_DSP_DBG_GLOBAL_PRINT_LINE_SIZE 200
//#define MBDR_DSP_PRINT_CLEAR_GLOBAL_LINE_M mbdr_dsp_dbg_global_print_line = " "
#define MBDR_DSP_PRINT_CLEAR_GLOBAL_LINE_M\
    memset(&mbdr_dsp_dbg_global_print_line[0], 0, MBDR_DSP_DBG_GLOBAL_PRINT_LINE_SIZE)
#define MBDR_DSP_PRINT_GET_GLOBAL_LINE_END_M &mbdr_dsp_dbg_global_print_line[(strlen(mbdr_dsp_dbg_global_print_line))]
extern  char mbdr_dsp_dbg_global_print_line[MBDR_DSP_DBG_GLOBAL_PRINT_LINE_SIZE];


extern void mbdr_dsp_dbg_print_line_to_stream_and_clear(
             mbdr_dsp_dbg_print_output_stream_procs_t *pio_output_stream_manage_p);



extern void mbdr_dsp_dbg_print_line(char pi_line_element_ascii_code);

extern void mbdr_dsp_print_new_line(void);

extern void mbdr_dsp_print_pdbuf_header(void);


/* appends pi_s32_q16 in floating point format to output string,             */
/* remark: routine doese not pio_string_p, it enables append to exist string */
extern void mbdr_dsp_debug_print_s32_q16(LONG  pi_s32_q16,
                                         LONG  pi_integer_part_string_size,
                                         char *pio_string_p);


extern void mbdr_dsp_debug_print_fraction_of_s32_f16(LONG   pi_s32_f16,
                                              char  *pio_string_p);


#define  MBDR_DSP_DEBUG_PRINT_LINE_MAX_LENGTH 80
#define  MBDR_DSP_DEBUG_PRINT_LINE_PUT_EOL_M(po_my_temporary)\
         mbdr_dsp_dbg_global_print_line[MBDR_DSP_DEBUG_PRINT_LINE_MAX_LENGTH] = 0;\
         po_my_temporary = min(strlen(mbdr_dsp_dbg_global_print_line), MBDR_DSP_DEBUG_PRINT_LINE_MAX_LENGTH);\
         mbdr_dsp_dbg_global_print_line[po_my_temporary+1]= 10;\
         mbdr_dsp_dbg_global_print_line[po_my_temporary+2]= 13;\
         mbdr_dsp_dbg_global_print_line[po_my_temporary+3]=  0

#endif

