<commit_before>// Copyright (c) 2011 <NAME>. All rights reserved.
// Use of this source code is governed by an MIT-style license that can be
// found in the LICENSE file.

#include <cstdio>

#include "browser.h"
#include "npapi-headers/npfunctions.h"
#include "plugin.h"
#include "plugin_instance.h"

/*****************************/
/* Plugin implementation     */
/*****************************/

namespace {
Plugin* g_plugin = NULL;
}  // namespace

Plugin::Plugin() {
}

Plugin::~Plugin() {
}

Plugin* Plugin::get() {
    if (g_plugin == NULL)
        g_plugin = Plugin::createPlugin();
    return g_plugin;
}

NPError Plugin::init() {
    return NPERR_NO_ERROR;
}

NPError Plugin::getValue(NPPVariable variable, void *value) {
    return NPERR_INVALID_PARAM;
}

/*****************************/
/* NP Functions              */
/*****************************/

NPError NP_GetEntryPoints(NPPluginFuncs* pFuncs)
{
    pFuncs->size = sizeof(*pFuncs);
    pFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
    pFuncs->newp = NPP_New;
    pFuncs->destroy = NPP_Destroy;
    pFuncs->setwindow = NPP_SetWindow;
    pFuncs->getvalue = NPP_GetValue;
    return NPERR_NO_ERROR;
}

NPError NP_Initialize(NPNetscapeFuncs* bFuncs,
		      NPPluginFuncs* pFuncs)
{
    NPError err = initializeBrowserFuncs(bFuncs);
    if (err != NPERR_NO_ERROR)
        return err;

    err = Plugin::get()->init();
    if (err != NPERR_NO_ERROR)
        return err;

    // On Unix, it looks like NP_GetEntryPoints isn't called directly?
    // The prototype for NP_Initialize is different from everyone
    // else. Meh.<commit_msg>Why did I put curly braces on a new line again?<commit_after>// Copyright (c) 2011 <NAME>. All rights reserved.
// Use of this source code is governed by an MIT-style license that can be
// found in the LICENSE file.

#include <cstdio>

#include "browser.h"
#include "npapi-headers/npfunctions.h"
#include "plugin.h"
#include "plugin_instance.h"

/*****************************/
/* Plugin implementation     */
/*****************************/

namespace {
Plugin* g_plugin = NULL;
}  // namespace

Plugin::Plugin() {
}

Plugin::~Plugin() {
}

Plugin* Plugin::get() {
    if (g_plugin == NULL)
        g_plugin = Plugin::createPlugin();
    return g_plugin;
}

NPError Plugin::init() {
    return NPERR_NO_ERROR;
}

NPError Plugin::getValue(NPPVariable variable, void *value) {
    return NPERR_INVALID_PARAM;
}

/*****************************/
/* NP Functions              */
/*****************************/

NPError NP_GetEntryPoints(NPPluginFuncs* pFuncs) {
    pFuncs->size = sizeof(*pFuncs);
    pFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
    pFuncs->newp = NPP_New;
    pFuncs->destroy = NPP_Destroy;
    pFuncs->setwindow = NPP_SetWindow;
    pFuncs->getvalue = NPP_GetValue;
    return NPERR_NO_ERROR;
}

NPError NP_Initialize(NPNetscapeFuncs* bFuncs,
		      NPPluginFuncs* pFuncs) {
    NPError err = initializeBrowserFuncs(bFuncs);
    if (err != NPERR_NO_ERROR)
        return err;

    err = Plugin::get()->init();
    if (err != NPERR_NO_ERROR)
        return err;

    // On Unix, it looks like NP_GetEntryPoints isn't called directly?
    // The prototype for NP_Initialize is different from everyone
    // else. Meh.
{'fraction_non_alphanumeric': 0.1856269113149847, 'fraction_numerical': 0.0030581039755351682, 'mean_word_length': 3.60056258790436, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '182110', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1061, 'n_words': 261}