Changeset 3412 for libcaca


Ignore:
Timestamp:
Mar 24, 2009, 1:58:01 AM (11 years ago)
Author:
Sam Hocevar
Message:

Apparently \033 is more common than \x1b for ESC. Use the former in our
code for clarity.

Location:
libcaca/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/codec/import.c

    r2962 r3412  
    111111        /* If we find ESC[ argv, we guess it's an ANSI file */
    112112        for(i = 0; i + 1 < len; i++)
    113             if((str[i] == 0x1b) && (str[i + 1] == '['))
     113            if((str[i] == '\033') && (str[i + 1] == '['))
    114114                return import_ansi(cv, data, len, 0);
    115115
     
    456456        /* If there are not enough characters to parse the escape sequence,
    457457         * wait until the next try. We require 3. */
    458         else if(buffer[i] == '\x1b' && i + 2 >= size)
     458        else if(buffer[i] == '\033' && i + 2 >= size)
    459459            break;
    460460
    461461        /* XXX: What the fuck is this shit? */
    462         else if(buffer[i] == '\x1b' && buffer[i + 1] == '('
     462        else if(buffer[i] == '\033' && buffer[i + 1] == '('
    463463                 && buffer[i + 2] == 'B')
    464464        {
     
    468468        /* Interpret escape commands, as per Standard ECMA-48 "Control
    469469         * Functions for Coded Character Sets", 5.4. Control sequences. */
    470         else if(buffer[i] == '\x1b' && buffer[i + 1] == '[')
     470        else if(buffer[i] == '\033' && buffer[i + 1] == '[')
    471471        {
    472472            unsigned int argc = 0, argv[101];
     
    642642
    643643        /* Parse OSC stuff. */
    644         else if(buffer[i] == '\x1b' && buffer[i + 1] == ']')
     644        else if(buffer[i] == '\033' && buffer[i + 1] == ']')
    645645        {
    646646            char *string;
  • libcaca/trunk/caca/driver/win32.c

    r3168 r3412  
    285285                case VK_TAB:        ev->data.key.ch = '\t';              break;
    286286                case VK_RETURN:     ev->data.key.ch = '\r';              break;
    287                 case VK_ESCAPE:     ev->data.key.ch = '\x1b';            break;
     287                case VK_ESCAPE:     ev->data.key.ch = '\033';            break;
    288288                case VK_SPACE:      ev->data.key.ch = ' ';               break;
    289289                case VK_DELETE:     ev->data.key.ch = '\x7f';            break;
  • libcaca/trunk/caca/graphics.c

    r2821 r3412  
    262262#endif
    263263
    264     fprintf(stdout, "\x1b]0;%s\x07", str);
     264    fprintf(stdout, "\033]0;%s\007", str);
    265265    fflush(stdout);
    266266}
  • libcaca/trunk/src/cacaserver.c

    r2821 r3412  
    5656    "\xff\x1f\xfa____" /* SB NAWS */ \
    5757    "\xff\xf0"         /* SE */  \
    58     "\x1b]2;caca for the network\x07" /* Change window title */ \
    59     "\x1b[H\x1b[J" /* Clear screen */
    60     /*"\x1b[?25l"*/ /* Hide cursor */
     58    "\033]2;caca for the network\x07" /* Change window title */ \
     59    "\033[H\033[J" /* Clear screen */
     60    /*"\033[?25l"*/ /* Hide cursor */
    6161
    6262#define ANSI_PREFIX \
    63     "\x1b[1;1H" /* move(0,0) */ \
    64     "\x1b[1;1H" /* move(0,0) again */
     63    "\033[1;1H" /* move(0,0) */ \
     64    "\033[1;1H" /* move(0,0) again */
    6565
    6666#define ANSI_RESET \
    6767    "    " /* Garbage */ \
    68     "\x1b[?1049h" /* Clear screen */ \
    69     "\x1b[?1049h" /* Clear screen again */
     68    "\033[?1049h" /* Clear screen */ \
     69    "\033[?1049h" /* Clear screen again */
    7070
    7171static char const telnet_commands[16][5] =
Note: See TracChangeset for help on using the changeset viewer.