コード例 #1
0
ファイル: c-error.c プロジェクト: 51weekend/r3
*/	void Init_Errors(REBVAL *errors)
/*
***********************************************************************/
{
	REBSER *errs;
	REBVAL *val;

	// Create error objects and error type objects:
	*ROOT_ERROBJ = *Get_System(SYS_STANDARD, STD_ERROR);
	errs = Construct_Object(0, VAL_BLK(errors), 0);
	Set_Object(Get_System(SYS_CATALOG, CAT_ERRORS), errs);

	Set_Root_Series(TASK_ERR_TEMPS, Make_Block(3));

	// Create objects for all error types:
	for (val = BLK_SKIP(errs, 1); NOT_END(val); val++) {
		errs = Construct_Object(0, VAL_BLK(val), 0);
		SET_OBJECT(val, errs);
	}

	// Catch top level errors, to provide decent output:
	PUSH_STATE(Top_State, Saved_State);
	if (SET_JUMP(Top_State)) {
		POP_STATE(Top_State, Saved_State);
		DSP++; // Room for return value
		Catch_Error(DS_TOP); // Stores error value here
		Print_Value(DS_TOP, 0, FALSE);
		Crash(RP_NO_CATCH);
	}
	SET_STATE(Top_State, Saved_State);
}
コード例 #2
0
ファイル: container.cpp プロジェクト: pchapin/coursesmart
Container::Container(oid_t ID){
  List<Contained_Object> *Object_List = new List<Contained_Object>;
  //open a list to hold info on stuff in this container

  My_ID = ID;
  Get_NTPObject(ID);//get ready to get to info

  String Buffer;

  int n=0;
  String Temp1;
  String Temp2;

  int Objects;
  int Objects_Received = 0;
  Read_NTPData(Buffer, 1);// get one byte which will hold the number of objects
  sscanf(Buffer, "%d", &Objects);
  while(Objects != Objects_Received){
    Get_NTPchar(Buffer,1024); //This function will get a character from the buffer Buffer, when it gets to the end it will try and get more data
    
    if(!n%2){
      Temp1 = Buffer;
      n++;
    }
    else{
      Temp2 = Buffer;
      n++;
      Set_Object(Temp1, Temp2);
      Temp1.Erase();
      Temp2.Erase();
      Objects_Received++;
    }
  }
}