Add COLOR_CHAR and BELL_CHAR defines to replace open-coded values
This commit is contained in:
@@ -111,22 +111,26 @@ extern char thing_star[4];
|
|||||||
#include "newio.h"
|
#include "newio.h"
|
||||||
|
|
||||||
/* these define what characters do, inverse, underline, bold and all off */
|
/* these define what characters do, inverse, underline, bold and all off */
|
||||||
#define REV_TOG '\026' /* ^V */
|
#define REV_TOG '\026' /* ^V */
|
||||||
#define REV_TOG_STR "\026"
|
#define REV_TOG_STR "\026"
|
||||||
#define UND_TOG '\037' /* ^_ */
|
#define UND_TOG '\037' /* ^_ */
|
||||||
#define UND_TOG_STR "\037"
|
#define UND_TOG_STR "\037"
|
||||||
#define BOLD_TOG '\002' /* ^B */
|
#define BOLD_TOG '\002' /* ^B */
|
||||||
#define BOLD_TOG_STR "\002"
|
#define BOLD_TOG_STR "\002"
|
||||||
#define ALL_OFF '\017' /* ^O */
|
#define ALL_OFF '\017' /* ^O */
|
||||||
#define ALL_OFF_STR "\017"
|
#define ALL_OFF_STR "\017"
|
||||||
#define BLINK_TOG '\006' /* ^F (think flash) */
|
#define BLINK_TOG '\006' /* ^F (think flash) */
|
||||||
#define BLINK_TOG_STR "\006"
|
#define BLINK_TOG_STR "\006"
|
||||||
#define ROM_CHAR '\022' /* ^R */
|
#define ROM_CHAR '\022' /* ^R */
|
||||||
#define ROM_CHAR_STR "\022"
|
#define ROM_CHAR_STR "\022"
|
||||||
#define ALT_TOG '\005' /* ^E (think Extended) */
|
#define ALT_TOG '\005' /* ^E (think Extended) */
|
||||||
#define ALT_TOG_STR "\005"
|
#define ALT_TOG_STR "\005"
|
||||||
#define ND_SPACE '\023' /* ^S */
|
#define ND_SPACE '\023' /* ^S */
|
||||||
#define ND_SPACE_STR "\023"
|
#define ND_SPACE_STR "\023"
|
||||||
|
#define COLOR_CHAR '\003' /* ^C */
|
||||||
|
#define COLOR_CHAR_STR "\003"
|
||||||
|
#define BELL_CHAR '\007' /* ^G */
|
||||||
|
#define BELL_CHAR_STR "\007"
|
||||||
|
|
||||||
#define IRCD_BUFFER_SIZE 512
|
#define IRCD_BUFFER_SIZE 512
|
||||||
#define BIG_BUFFER_SIZE (4 * IRCD_BUFFER_SIZE)
|
#define BIG_BUFFER_SIZE (4 * IRCD_BUFFER_SIZE)
|
||||||
|
|||||||
@@ -2853,7 +2853,7 @@ BUILT_IN_FUNCTION(function_nohighlight, input)
|
|||||||
case BOLD_TOG:
|
case BOLD_TOG:
|
||||||
case BLINK_TOG:
|
case BLINK_TOG:
|
||||||
case ALL_OFF:
|
case ALL_OFF:
|
||||||
case '\003':
|
case COLOR_CHAR:
|
||||||
case '\033':
|
case '\033':
|
||||||
{
|
{
|
||||||
*ptr++ = REV_TOG;
|
*ptr++ = REV_TOG;
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ BUILT_IN_COMMAND(lastlog)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
match = "\007";
|
match = BELL_CHAR_STR;
|
||||||
}
|
}
|
||||||
else if (!my_strnicmp(arg, "CLEAR", len))
|
else if (!my_strnicmp(arg, "CLEAR", len))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -228,9 +228,9 @@ int annoy_kicks(int list_type, char *to, char *from, char *ptr, NickList *nick)
|
|||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
if (annoy_hl(ptr, BOLD_TOG))
|
if (annoy_hl(ptr, BOLD_TOG))
|
||||||
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for " BOLD_TOG_STR "bold" BOLD_TOG_STR);
|
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for " BOLD_TOG_STR "bold" BOLD_TOG_STR);
|
||||||
else if (strchr(ptr, '\007'))
|
else if (strchr(ptr, BELL_CHAR))
|
||||||
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for beeping");
|
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for beeping");
|
||||||
else if (annoy_hl(ptr, '\003'))
|
else if (annoy_hl(ptr, COLOR_CHAR))
|
||||||
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for " UND_TOG_STR "mirc color" UND_TOG_STR);
|
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for " UND_TOG_STR "mirc color" UND_TOG_STR);
|
||||||
else if (annoy_hl(ptr, UND_TOG))
|
else if (annoy_hl(ptr, UND_TOG))
|
||||||
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for " UND_TOG_STR "underline" UND_TOG_STR);
|
malloc_sprintf(&buffer, "KICK %s %s :%s", to, from, "autokick for " UND_TOG_STR "underline" UND_TOG_STR);
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ void BX_add_to_window(Window *window, const unsigned char *str)
|
|||||||
* This is for archon -- he wanted a way to have
|
* This is for archon -- he wanted a way to have
|
||||||
* a hidden window always beep, even if BEEP is off.
|
* a hidden window always beep, even if BEEP is off.
|
||||||
*/
|
*/
|
||||||
if (window->beep_always && strchr(str, '\007'))
|
if (window->beep_always && strchr(str, BELL_CHAR))
|
||||||
{
|
{
|
||||||
Window *old_target_window = target_window;
|
Window *old_target_window = target_window;
|
||||||
target_window = current_window;
|
target_window = current_window;
|
||||||
@@ -456,7 +456,7 @@ const u_char *ptr = NULL;
|
|||||||
{
|
{
|
||||||
switch (*ptr)
|
switch (*ptr)
|
||||||
{
|
{
|
||||||
case '\007': /* bell */
|
case BELL_CHAR: /* bell */
|
||||||
{
|
{
|
||||||
beep_cnt++;
|
beep_cnt++;
|
||||||
if ((beep_max == -1) || (beep_cnt > beep_max))
|
if ((beep_max == -1) || (beep_cnt > beep_max))
|
||||||
@@ -522,14 +522,14 @@ const u_char *ptr = NULL;
|
|||||||
word_break = pos;
|
word_break = pos;
|
||||||
break; /* case '\n' */
|
break; /* case '\n' */
|
||||||
}
|
}
|
||||||
case '\003':
|
case COLOR_CHAR:
|
||||||
{
|
{
|
||||||
int lhs = 0, rhs = 0;
|
int lhs = 0, rhs = 0;
|
||||||
const u_char *end = skip_ctl_c_seq(ptr, &lhs, &rhs, 0);
|
const u_char *end = skip_ctl_c_seq(ptr, &lhs, &rhs, 0);
|
||||||
while (ptr < end)
|
while (ptr < end)
|
||||||
buffer[pos++] = *ptr++;
|
buffer[pos++] = *ptr++;
|
||||||
ptr = end - 1;
|
ptr = end - 1;
|
||||||
break; /* case '\003' */
|
break; /* case COLOR_CHAR */
|
||||||
}
|
}
|
||||||
case ROM_CHAR:
|
case ROM_CHAR:
|
||||||
{
|
{
|
||||||
@@ -1116,7 +1116,7 @@ const u_char *ptr = str;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '\007':
|
case BELL_CHAR:
|
||||||
{
|
{
|
||||||
beep++;
|
beep++;
|
||||||
break;
|
break;
|
||||||
@@ -1150,7 +1150,7 @@ const u_char *ptr = str;
|
|||||||
out++;
|
out++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '\003':
|
case COLOR_CHAR:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* By the time we get here, we know we need to
|
* By the time we get here, we know we need to
|
||||||
@@ -2059,7 +2059,7 @@ const u_char *after = start;
|
|||||||
/*
|
/*
|
||||||
* If we're passed a non ^C code, dont do anything.
|
* If we're passed a non ^C code, dont do anything.
|
||||||
*/
|
*/
|
||||||
if (*after != '\003')
|
if (*after != COLOR_CHAR)
|
||||||
return after;
|
return after;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -515,7 +515,7 @@ int in_rhs = 0,
|
|||||||
* Skip over color attributes if we're not
|
* Skip over color attributes if we're not
|
||||||
* doing color.
|
* doing color.
|
||||||
*/
|
*/
|
||||||
else if (*ptr == '\003')
|
else if (*ptr == COLOR_CHAR)
|
||||||
{
|
{
|
||||||
const u_char *end = skip_ctl_c_seq(ptr, NULL, NULL, 0);
|
const u_char *end = skip_ctl_c_seq(ptr, NULL, NULL, 0);
|
||||||
while (ptr < end)
|
while (ptr < end)
|
||||||
@@ -783,7 +783,7 @@ void make_status(Window *win)
|
|||||||
* Skip over color attributes if we're not
|
* Skip over color attributes if we're not
|
||||||
* doing color.
|
* doing color.
|
||||||
*/
|
*/
|
||||||
else if (*ptr == '\003')
|
else if (*ptr == COLOR_CHAR)
|
||||||
{
|
{
|
||||||
const u_char *end = skip_ctl_c_seq(ptr, NULL, NULL, 0);
|
const u_char *end = skip_ctl_c_seq(ptr, NULL, NULL, 0);
|
||||||
while (ptr < end)
|
while (ptr < end)
|
||||||
|
|||||||
Reference in New Issue
Block a user