CodeSnippets/src/helper.c
uint32_t helper_get_value_text (T_EDGE_DATA *edge_data, char *value_as_text, uint32_t max_len_value_as_string)
{
   uint32_t pos = 0;
   switch (edge_data->type)
   {
      case E_EDGE_DATA_TYPE_INT32:
         pos = snprintf (value_as_text, max_len_value_as_string, "%d", edge_data->value.int32);
         break;
      case E_EDGE_DATA_TYPE_UINT32:
         pos = snprintf (value_as_text, max_len_value_as_string, "%u", edge_data->value.uint32);
         break;
      case E_EDGE_DATA_TYPE_INT64:
         pos = snprintf (value_as_text, max_len_value_as_string, "%lld", edge_data->value.int64);
         break;
      case E_EDGE_DATA_TYPE_UINT64:
         pos = snprintf (value_as_text, max_len_value_as_string, "%llu", edge_data->value.uint64);
         break;
      case E_EDGE_DATA_TYPE_FLOAT32:
         pos = snprintf (value_as_text, max_len_value_as_string, "%f", edge_data->value.float32);
         break;
      case E_EDGE_DATA_TYPE_DOUBLE64:
         pos = snprintf (value_as_text, max_len_value_as_string, "%lf", edge_data->value.double64);
         break;
      case E_EDGE_DATA_TYPE_UNKNOWN:
      default:
         pos = snprintf (value_as_text, max_len_value_as_string, "?");
         break;
   }
   return pos;
}
/*!
******************************************************************************
DESCRIPTION:     Convert value from edge to string
*****************************************************************************/
Convert value from edge to string
Convert value from edge to string
uint32_t helper_get_value_text (T_EDGE_DATA *edge_data, char *value_as_text, uint32_t max_len_value_as_string)
{
   uint32_t pos = 0;
   switch (edge_data->type)
   {
      case E_EDGE_DATA_TYPE_INT32:
         pos = snprintf (value_as_text, max_len_value_as_string, "%d", edge_data->value.int32);
         break;
      case E_EDGE_DATA_TYPE_UINT32:
         pos = snprintf (value_as_text, max_len_value_as_string, "%u", edge_data->value.uint32);
         break;
      case E_EDGE_DATA_TYPE_INT64:
         pos = snprintf (value_as_text, max_len_value_as_string, "%lld", edge_data->value.int64);
         break;
      case E_EDGE_DATA_TYPE_UINT64:
         pos = snprintf (value_as_text, max_len_value_as_string, "%llu", edge_data->value.uint64);
         break;
      case E_EDGE_DATA_TYPE_FLOAT32:
         pos = snprintf (value_as_text, max_len_value_as_string, "%f", edge_data->value.float32);
         break;
      case E_EDGE_DATA_TYPE_DOUBLE64:
         pos = snprintf (value_as_text, max_len_value_as_string, "%lf", edge_data->value.double64);
         break;
      case E_EDGE_DATA_TYPE_UNKNOWN:
      default:
         pos = snprintf (value_as_text, max_len_value_as_string, "?");
         break;
   }
   return pos;
}
uint32_t helper_get_value_text ( T_EDGE_DATA * edge_data , char * value_as_text , uint32_t max_len_value_as_string ) { uint32_t pos = 0 ; switch ( edge_data -> type ) { case E_EDGE_DATA_TYPE_INT32 : pos = snprintf ( value_as_text , max_len_value_as_string , " " , edge_data -> value . int32 ) ; break ; case E_EDGE_DATA_TYPE_UINT32 : pos = snprintf ( value_as_text , max_len_value_as_string , " " , edge_data -> value . uint32 ) ; break ; case E_EDGE_DATA_TYPE_INT64 : pos = snprintf ( value_as_text , max_len_value_as_string , " " , edge_data -> value . int64 ) ; break ; case E_EDGE_DATA_TYPE_UINT64 : pos = snprintf ( value_as_text , max_len_value_as_string , " " , edge_data -> value . uint64 ) ; break ; case E_EDGE_DATA_TYPE_FLOAT32 : pos = snprintf ( value_as_text , max_len_value_as_string , " " , edge_data -> value . float32 ) ; break ; case E_EDGE_DATA_TYPE_DOUBLE64 : pos = snprintf ( value_as_text , max_len_value_as_string , " " , edge_data -> value . double64 ) ; break ; case E_EDGE_DATA_TYPE_UNKNOWN : default : pos = snprintf ( value_as_text , max_len_value_as_string , " " ) ; break ; } return pos ; }
DESCRIPTION:     Convert value from edge to string
DESCRIPTION : Convert value from edge to string