v4.0.0-rc2 - add function 'successlog'

This commit is contained in:
Liam Waldron 2024-10-03 11:37:10 -04:00
parent fff7072e0f
commit bcb0c4ba88
2 changed files with 42 additions and 0 deletions

View File

@ -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

View File

@ -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
*