Skip to content

npp_app_init

Jurek Muszyński edited this page Dec 19, 2021 · 2 revisions

bool npp_app_init(int argc, char *argv[])

Description

Called when application starts. Good place to call init functions.

Returns

true if everything is OK. false will stop booting process, npp_app_done() will be called and application will be terminated.

Example

bool npp_app_init(int argc, char *argv[])
{
    /* generated statics */

    prepare_css();

    /* authorization levels */

    npp_require_auth("show",      AUTH_LEVEL_NONE);
    npp_require_auth("dashboard", AUTH_LEVEL_LOGGEDIN);
    /* admin */
    npp_require_auth("logs",      AUTH_LEVEL_ADMIN);

    /* messages */

    npp_add_message(ERR_PAGE_MAX_SIZE, "EN-US", "You can't add any more elements to this page");

    return true;
}

Clone this wiki locally