v4.0.0-rc2 - add function 'successlog'
This commit is contained in:
parent
fff7072e0f
commit
bcb0c4ba88
@ -76,4 +76,24 @@ void warnlog(char MSG[]);
|
||||
|
||||
void errlog(char MSG[]);
|
||||
|
||||
/**************************************************************************************************************/
|
||||
|
||||
/*
|
||||
* successlog
|
||||
*
|
||||
* DESCRIPTION: Successlog outputs a stylized success message. It follows Glacier's uniform CLI style.
|
||||
* PARAMETERS:
|
||||
* char MSG[] -> The message to output
|
||||
* RETURN VALUES:
|
||||
* None.
|
||||
* CAVEATS:
|
||||
* * Cannot output variables. If you must output variables, use printf instead.
|
||||
* * A NEWLINE ('\n') character is implied, therefore putting one at the end of
|
||||
* a string is not needed.
|
||||
* EXAMPLE:
|
||||
* successlog("This is a success message.");
|
||||
*/
|
||||
|
||||
void successlog(char MSG[]);
|
||||
|
||||
#endif
|
||||
|
22
libglacier.c
22
libglacier.c
@ -103,6 +103,28 @@ errlog(char MSG[])
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* successlog
|
||||
*
|
||||
* DESCRIPTION: Output a stylized success message.
|
||||
* PARAMETERS: char MSG[]
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
successlog(char MSG[])
|
||||
{
|
||||
const wchar_t w_check = 0x2713;
|
||||
setlocale(LC_TYPE, "");
|
||||
|
||||
if (MSG == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
printf(COL_GREEN "[%lc]" COL_RESET " %s\n", w_check, MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* runtime_exists
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user