Example #1
0
int sdl_main(int argc, char **argv, void *runner) {
  char *game_argv[] = {"descent", "-debug"};
  int game_argc = 2;
  NaClCrashDumpInit();
  loaddata(runner);
  GameArg.DbgVerbose = CON_DEBUG;
  con_printf(CON_DEBUG, "starting\n");
  game_main(game_argc, game_argv);
  return 0;
}
int main(void) {
  if (!NaClCrashDumpInit()) {
    fprintf(stderr, "ERROR: failed to set up crash dumping\n");
    return 2;
  }

  fprintf(stderr, "** intended_exit_status=166\n");
  layer1(2, 9);

  return 1;
}
/**
 * Called when the NaCl module is instantiated on the web page. The identifier
 * of the new instance will be passed in as the first argument (this value is
 * generated by the browser and is an opaque handle).  This is called for each
 * instantiation of the NaCl module, which is each time the <embed> tag for
 * this module is encountered.
 *
 * If this function reports a failure (by returning @a PP_FALSE), the NaCl
 * module will be deleted and DidDestroy will be called.
 * @param[in] instance The identifier of the new instance representing this
 *     NaCl module.
 * @param[in] argc The number of arguments contained in @a argn and @a argv.
 * @param[in] argn An array of argument names.  These argument names are
 *     supplied in the <embed> tag, for example:
 *       <embed id="nacl_module" dimensions="2">
 *     will produce two arguments, one named "id" and one named "dimensions".
 * @param[in] argv An array of argument values.  These are the values of the
 *     arguments listed in the <embed> tag.  In the above example, there will
 *     be two elements in this array, "nacl_module" and "2".  The indices of
 *     these values match the indices of the corresponding names in @a argn.
 * @return @a PP_TRUE on success.
 */
static PP_Bool Instance_DidCreate(PP_Instance instance,
                                  uint32_t argc,
                                  const char* argn[],
                                  const char* argv[]) {
  g_Instance = instance;
  g_PPAPIThread = pthread_self();

  PostMessage("LOG: DidCreate");
  if (!NaClCrashDumpInit()) {
    PostMessage("LOG: Failed to set up crash dump.");
  }
  else {
    PostMessage("LOG: Crash Dump On");
  }
  pthread_create(&g_NexeThread, NULL, NexeMain, NULL);
  return PP_TRUE;
}