示例#1
0
文件: rand.c 项目: elric1/heimdal
/**
 * Get a random block from the random generator, can be used for key material.
 *
 * @param outdata random data
 * @param size length random data
 *
 * @return 1 on success, 0 on failure.
 *
 * @ingroup hcrypto_rand
 */
int
RAND_bytes(void *outdata, size_t size)
{
    if (size == 0)
	return 1;
    init_method();
    return (*selected_meth->bytes)(outdata, size);
}
示例#2
0
static PLHashEntry *method_allocentry(void *pool, const void *key)
{
    tmmethodnode *node =
        (tmmethodnode*) arena_alloc(pool, sizeof(tmmethodnode));
    if (!node)
        return NULL;
    init_method(node);
    return &node->graphnode.entry;
}
示例#3
0
/* Initialize the C++ front end.  This function is very sensitive to
   the exact order that things are done here.  It would be nice if the
   initialization done by this routine were moved to its subroutines,
   and the ordering dependencies clarified and reduced.  */
bool
cxx_init (void)
{
  location_t saved_loc;
  unsigned int i;
  static const enum tree_code stmt_codes[] = {
   CTOR_INITIALIZER,	TRY_BLOCK,	HANDLER,
   EH_SPEC_BLOCK,	USING_STMT,	TAG_DEFN,
   IF_STMT,		CLEANUP_STMT,	FOR_STMT,
   RANGE_FOR_STMT,	WHILE_STMT,	DO_STMT,
   BREAK_STMT,		CONTINUE_STMT,	SWITCH_STMT,
   EXPR_STMT
  };

  memset (&statement_code_p, 0, sizeof (statement_code_p));
  for (i = 0; i < ARRAY_SIZE (stmt_codes); i++)
    statement_code_p[stmt_codes[i]] = true;

  saved_loc = input_location;
  input_location = BUILTINS_LOCATION;

  init_reswords ();
  init_tree ();
  init_cp_semantics ();
  init_operators ();
  init_method ();
  init_error ();

  current_function_decl = NULL;

  class_type_node = ridpointers[(int) RID_CLASS];

  cxx_init_decl_processing ();

  if (c_common_init () == false)
    {
      input_location = saved_loc;
      return false;
    }

  init_cp_pragma ();

  init_repo ();

  input_location = saved_loc;
  return true;
}
示例#4
0
int32_t LevelChecker::get_method_level(DexMethod* method) {
  always_assert_log(s_has_been_init, "must call init first");
  int32_t method_level = method->rstate.get_api_level();
  if (method_level == -1) {
    // must have been created later on by Redex
    DexClass* cls = type_class(method->get_class());
    int32_t class_level = cls->rstate.get_api_level();
    if (class_level == -1) {
      // must have been created later on by Redex
      init_class(cls);
    }

    init_method(method);
    method_level = method->rstate.get_api_level();
  }

  return method_level;
}
示例#5
0
文件: rand.c 项目: elric1/heimdal
void
RAND_seed(const void *indata, size_t size)
{
    init_method();
    (*selected_meth->seed)(indata, size);
}
示例#6
0
文件: rand.c 项目: elric1/heimdal
const RAND_METHOD *
RAND_get_rand_method(void)
{
    init_method();
    return selected_meth;
}
示例#7
0
文件: rand.c 项目: elric1/heimdal
int
RAND_status(void)
{
    init_method();
    return (*selected_meth->status)();
}
示例#8
0
文件: rand.c 项目: elric1/heimdal
int
RAND_pseudo_bytes(void *outdata, size_t size)
{
    init_method();
    return (*selected_meth->pseudorand)(outdata, size);
}
示例#9
0
文件: rand.c 项目: elric1/heimdal
void
RAND_add(const void *indata, size_t size, double entropi)
{
    init_method();
    (*selected_meth->add)(indata, size, entropi);
}
示例#10
0
文件: lex.c 项目: Akheon23/nvopencc
/* Initialize the C++ front end.  This function is very sensitive to
   the exact order that things are done here.  It would be nice if the
   initialization done by this routine were moved to its subroutines,
   and the ordering dependencies clarified and reduced.  */
bool
cxx_init (void)
{
  unsigned int i;
  static const enum tree_code stmt_codes[] = {
   CTOR_INITIALIZER,	TRY_BLOCK,	HANDLER,
   EH_SPEC_BLOCK,	USING_STMT,	TAG_DEFN,
   IF_STMT,		CLEANUP_STMT,	FOR_STMT,
   WHILE_STMT,		DO_STMT,	BREAK_STMT,
   CONTINUE_STMT,	SWITCH_STMT,	EXPR_STMT
  };

  memset (&statement_code_p, 0, sizeof (statement_code_p));
  for (i = 0; i < ARRAY_SIZE (stmt_codes); i++)
    statement_code_p[stmt_codes[i]] = true;

  /* We cannot just assign to input_filename because it has already
     been initialized and will be used later as an N_BINCL for stabs+
     debugging.  */
#ifdef USE_MAPPED_LOCATION
  push_srcloc (BUILTINS_LOCATION);
#else
  push_srcloc ("<built-in>", 0);
#endif

  init_reswords ();
  init_tree ();
  init_cp_semantics ();
  init_operators ();
  init_method ();
  init_error ();

  current_function_decl = NULL;

  class_type_node = ridpointers[(int) RID_CLASS];

  cxx_init_decl_processing ();

  /* The fact that G++ uses COMDAT for many entities (inline
     functions, template instantiations, virtual tables, etc.) mean
     that it is fundamentally unreliable to try to make decisions
     about whether or not to output a particular entity until the end
     of the compilation.  However, the inliner requires that functions
     be provided to the back end if they are to be inlined.
     Therefore, we always use unit-at-a-time mode; in that mode, we
     can provide entities to the back end and it will decide what to
     emit based on what is actually needed.  */
  flag_unit_at_a_time = 1;

  if (c_common_init () == false)
    {
      pop_srcloc();
      return false;
    }

  init_cp_pragma ();

  init_repo ();

  pop_srcloc();
  return true;
}