1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 07:07:13 +02:00

Implement methods to send messages with style formatting in the IRC module. Should close #7

Also remove duplicate code in raw squirrel functions by merging it into one function.
This commit is contained in:
Sandu Liviu Catalin
2016-08-16 21:38:04 +03:00
parent 0f2ac5679a
commit e770ac3405
6 changed files with 193 additions and 142 deletions

View File

@ -246,7 +246,7 @@ static int libirc_colorparser_colorlookup (const char * color)
/*
* [code] to IRC color conversion.
*/
char * irc_color_convert_to_mirc (const char * source)
char * irc_color_convert_to_mirc (const char * source, void * (*memory_allocator)(size_t))
{
unsigned int destlen = 0;
char * destline = 0, *d = 0;
@ -262,7 +262,7 @@ char * irc_color_convert_to_mirc (const char * source)
if ( destlen > 0 )
{
// This is the 2nd pass; allocate memory.
if ( (destline = malloc (destlen)) == 0 )
if ( (destline = memory_allocator (destlen)) == 0 )
return 0;
d = destline;