bridge/class-master/depend/pari/src/language/es.c
/* s must be able to store 12 chars (including final \0) */
s must be able to store 12 chars (including final \0)
s must be able to store 12 chars ( including final \ 0 )
char *
term_get_color(char *s, long n)
{
  long c[3], a;
  if (!s) s = stack_malloc(COLOR_LEN);
  if (disable_color) { *s = 0; return s; }
  if (n == c_NONE || (a = gp_colors[n]) == c_NONE)
    strcpy(s, "\x1b[0m"); 
  else
  {
    decode_color(a,c);
    if (c[1]<8) c[1] += 30; else c[1] += 82;
    if (a & (1L<<12)) 
      sprintf(s, "\x1b[%ld;%ldm", c[0], c[1]);
    else
    {
      if (c[2]<8) c[2] += 40; else c[2] += 92;
      sprintf(s, "\x1b[%ld;%ld;%ldm", c[0], c[1], c[2]);
    }
  }
  return s;
}
char * term_get_color ( char * s , long n ) { long c [ 3 ] , a ; if ( ! s ) s = stack_malloc ( COLOR_LEN ) ; if ( disable_color ) { * s = 0 ; return s ; } if ( n == c_NONE || ( a = gp_colors [ n ] ) == c_NONE ) strcpy ( s , " \x1b " ) ; else { decode_color ( a , c ) ; if ( c [ 1 ] < 8 ) c [ 1 ] += 30 ; else c [ 1 ] += 82 ; if ( a & ( 1L << 12 ) ) sprintf ( s , " \x1b " , c [ 0 ] , c [ 1 ] ) ; else { if ( c [ 2 ] < 8 ) c [ 2 ] += 40 ; else c [ 2 ] += 92 ; sprintf ( s , " \x1b " , c [ 0 ] , c [ 1 ] , c [ 2 ] ) ; } } return s ; }
s must be able to store 12 chars (including final \0)
s must be able to store 12 chars ( including final \ 0 )
/* reset */ /* transparent background */