Skip to content

MSG_CAT_ORANGE

Jurek Muszyński edited this page Mar 28, 2024 · 3 revisions

bool MSG_CAT_ORANGE(int code)

Description

Tells whether error code belongs to “warnings” category.

Returns

Returns true if code belongs to warnings, otherwise false.

Example

/* --------------------------------------------------------------------------
   Show error message if present in URI
-------------------------------------------------------------------------- */
int check_error_msg()
{
    int msg;

    if ( !QSI("msg", &msg) || msg==OK ) return OK;

    if ( MSG_CAT_RED(msg) )
        OUT("<p class=\"red\">%s</p>", npp_message(msg));
    else if ( MSG_CAT_ORANGE(msg) )
        OUT("<p class=\"ora\">%s</p>", npp_message(msg));
    else    /* Successful message -- in green */
        OUT("<p class=\"grn\">%s</p>", npp_message(msg));

    return msg;
}
Clone this wiki locally