<commit_before>#include <stdio.h>
#include <string.h>

#include "ppapi/c/pp_errors.h"

#include "ppapi/c/ppb_var.h"
#include "ppapi/c/ppp.h"
#include "ppapi/c/ppp_input_event.h"
#include "ppapi/c/ppp_instance.h"
#include "ppapi/c/ppp_messaging.h"

extern "C" {
  const void* GetBrowserInterface(const char* interface_name);

  void DoPostMessage(PP_Instance instance, const PP_Var* var) {
    const PPP_Messaging* messaging_interface = (const PPP_Messaging*)PPP_GetInterface(PPP_MESSAGING_INTERFACE);
    if (!messaging_interface) {
      return;
    }
    messaging_interface->HandleMessage(instance, *var);
    // It appears that the callee own the var, so no need to release it?
  }

  void DoChangeView(PP_Instance instance, PP_Resource resource) {
    const PPP_Instance* instance_interface = (const PPP_Instance*)PPP_GetInterface(PPP_INSTANCE_INTERFACE);
    if (instance_interface == NULL) {
      printf("STUB: Failed to get instance interface.\n");
      return;
    }
    instance_interface->DidChangeView(instance, resource);
  }

  void DoChangeFocus(PP_Instance instance, PP_Bool hasFocus) {<commit_msg>Work around bug where malloc was not being linked into simple examples.<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "ppapi/c/pp_errors.h"

#include "ppapi/c/ppb_var.h"
#include "ppapi/c/ppp.h"
#include "ppapi/c/ppp_input_event.h"
#include "ppapi/c/ppp_instance.h"
#include "ppapi/c/ppp_messaging.h"

extern "C" {
  // Work around a bug in Emscripten that prevent malloc from being included unless it is referenced from native code.
  // TODO(ncbray): fix the bug and remove this hack.
  __attribute__((used)) static void* hack = (void *)&malloc;

  const void* GetBrowserInterface(const char* interface_name);

  void DoPostMessage(PP_Instance instance, const PP_Var* var) {
    const PPP_Messaging* messaging_interface = (const PPP_Messaging*)PPP_GetInterface(PPP_MESSAGING_INTERFACE);
    if (!messaging_interface) {
      return;
    }
    messaging_interface->HandleMessage(instance, *var);
    // It appears that the callee own the var, so no need to release it?
  }

  void DoChangeView(PP_Instance instance, PP_Resource resource) {
    const PPP_Instance* instance_interface = (const PPP_Instance*)PPP_GetInterface(PPP_INSTANCE_INTERFACE);
    if (instance_interface == NULL) {
      printf("STUB: Failed to get instance interface.\n");
      return;
    }
    instance_interface->DidChangeView(instance, resource);
  }

  void DoChangeFocus(PP_Instance instance, PP_Bool hasFocus) {
{'fraction_non_alphanumeric': 0.10731132075471699, 'fraction_numerical': 0.0, 'mean_word_length': 4.693512304250559, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '5179468', 'n_tokens_mistral': 859, 'n_tokens_neox': 835, 'n_words': 206}