示例#1
0
文件: server.c 项目: Asiron/ucs
void init_server(){
    
    signal(SIGINT, clean);
    
    MSG_RECEIVER = msgget(IPC_PRIVATE, 0666);

    init_sems();
    init_repo();
    init_local_repo();
    

    register_new_server(MSG_RECEIVER);
    create_room("");
    
    printf("SERVER READY, LISTENING ON QUEUE %d\n", MSG_RECEIVER);
}
示例#2
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;
}
示例#3
0
int
Locator_Repository::init (PortableServer::POA_ptr root_poa,
                          PortableServer::POA_ptr imr_poa,
                          const char* this_ior)
{
  this->imr_ior_ = this_ior;
  int err = init_repo(imr_poa);
  if (err != 0)
    {
      return err;
    }

  // Activate the two poa managers
  PortableServer::POAManager_var poaman =
    root_poa->the_POAManager ();
  poaman->activate ();
  poaman = imr_poa->the_POAManager ();
  poaman->activate ();

  return err;
}
示例#4
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;
}