deps/kb_meme/meme-5.0.1/src/display.c
/**********************************************************************
  sym_2_id

  Given a buffer return a string that can be used as the id for a symbol.
**********************************************************************/
sym_2_id
Given a buffer return a string that can be used as the id for a symbol.
sym_2_id Given a buffer return a string that can be used as the id for a symbol .
static char* sym_2_id(char symbol, STR_T *buffer) {
  str_clear(buffer);
  if ((symbol >= 'A' && symbol <= 'Z') || (symbol >= 'a' && symbol <= 'z') || symbol == ':' || symbol == '_') {
    str_appendf(buffer, "%c", symbol); 
  } else if ((symbol >= '0' && symbol <= '9') || symbol == '.' || symbol == '-') {
    str_appendf(buffer, "s%c", symbol); 
  } else {
    str_appendf(buffer, "s%2X", (uint8_t)symbol);
  }
  return str_internal(buffer);
}
static char * sym_2_id ( char symbol , STR_T * buffer ) { str_clear ( buffer ) ; if ( ( symbol >= ' ' && symbol <= ' ' ) || ( symbol >= ' ' && symbol <= ' ' ) || symbol == ' ' || symbol == ' ' ) { str_appendf ( buffer , " " , symbol ) ; } else if ( ( symbol >= ' ' && symbol <= ' ' ) || symbol == ' ' || symbol == ' ' ) { str_appendf ( buffer , " " , symbol ) ; } else { str_appendf ( buffer , " " , ( uint8_t ) symbol ) ; } return str_internal ( buffer ) ; }
sym_2_id
Given a buffer return a string that can be used as the id for a symbol.
sym_2_id Given a buffer return a string that can be used as the id for a symbol .
// these can be used as-is // these are valid but not NameStartChar // any other symbols (eg '*') get encoded as hexadecimal