Esempio n. 1
0
CString GetRemDsc(CWPReminder& rem,BOOL bAddDate=FALSE)
{
	CString sDsc=TrimMessage(rem.szText,30,1);
	if(sDsc==""){
		sDsc=_l2("No description");
	}
	COleDateTime tm(rem.EventTime);
	COleDateTime dtNow=COleDateTime::GetCurrentTime();
	if(bAddDate && (tm.GetDay()!=dtNow.GetDay() || tm.GetMonth()!=dtNow.GetMonth() || tm.GetYear()!=dtNow.GetYear())){
		return Format("%s %s %s",DateFormat(tm,TRUE),TimeFormat(tm),sDsc);
	}else{
		return Format("%s %s",TimeFormat(tm),sDsc);
	}
}
Esempio n. 2
0
void
TimeFormatSettingsView::_UpdateExamples()
{
	time_t timeValue = (time_t)time(NULL);
	tm timeData;
	localtime_r(&timeValue, &timeData);
	BString timeFormat = "Internal Error!";
	char buffer[256];

	FormatSeparator separator;

	BMenuItem *item = fSeparatorMenuField->Menu()->FindMarked();
	if (item) {
		int32 index = fSeparatorMenuField->Menu()->IndexOf(item);
		if (index >= 0)
			separator = (FormatSeparator)index;
		else
			separator = kSlashSeparator;
	} else
		separator = kSlashSeparator;

	DateOrder order =
		fYMDRadioButton->Value() ? kYMDFormat :
		(fDMYRadioButton->Value() ? kDMYFormat : kMDYFormat);

	bool clockIs24hr = (f24HrRadioButton->Value() > 0);

	TimeFormat(timeFormat, 0, separator, order, clockIs24hr);
	strftime(buffer, 256, timeFormat.String(), &timeData);

	fLongDateExampleView->SetText(buffer);
	fLongDateExampleView->ResizeToPreferred();

	TimeFormat(timeFormat, 4, separator, order, clockIs24hr);
	strftime(buffer, 256, timeFormat.String(), &timeData);

	fShortDateExampleView->SetText(buffer);
	fShortDateExampleView->ResizeToPreferred();
}
Esempio n. 3
0
const AjPTime ajTimeRefTodayFmt(const char* timefmt)
{
    time_t tim;
    
    tim = time(0);

    if(!timeTodayData)
	AJNEW0(timeTodayData);

    if(!ajTimeSetLocal(timeTodayData, tim))
        return NULL;

    timeTodayData->format = TimeFormat(timefmt, &timeTodayData->uppercase);

    return timeTodayData;
}
Esempio n. 4
0
AjPTime ajTimeNewTodayFmt(const char* timefmt)
{
    AjPTime thys = NULL;
    time_t tim;
    
    tim = time(0);

    if(!thys)
	AJNEW0(thys);

    if(!ajTimeSetLocal(thys, tim))
        return NULL;

    thys->format = TimeFormat(timefmt, &thys->uppercase);

    return thys;
}
void CRuleManager::WriteToFile(RFile& file,CRule* aRule)
	{
	HBufC8* name = CCommonUtils::ConvertToUTF8FromUnicode(aRule->GetName());
	file.Write(name->Des());
	delete name;
	file.Write(KRuleSymbolSplit);
	
	TBuf8<16> uid;
	uid.AppendNum((aRule->GetUid().iUid));
	file.Write(uid);
	file.Write(KRuleSymbolSplit);
	
	TBuf8<2> type;
	type.AppendNum(aRule->GetType());
	file.Write(type);
	file.Write(KRuleSymbolSplit);
	
	if (aRule->GetType() == 0)
		{
		TBuf8<8> count;
		count.AppendNum(aRule->GetCountDown());
		file.Write(count);
		}
	else
		{
		TBuf8<8> count;
		TimeFormat(aRule->GetClock(),count);
		file.Write(count);
		}	
	file.Write(KRuleSymbolSplit);
	
	HBufC8* rulename = CCommonUtils::ConvertToUTF8FromUnicode(aRule->GetRuleName());
	file.Write(rulename->Des());
	delete rulename;
	file.Write(KRuleSymbolSplit);
	
	TBuf8<2> lunch;
	lunch.AppendNum(aRule->IsLunchRun());
	file.Write(lunch);
	
	file.Write(KRuleSymbolEnd);
	}
Esempio n. 6
0
File: test.c Progetto: licko/timelib
int main()
{
	time_t timer = GetCurrentTime();
	printf("timer = %ld \n", timer);
	printf("%s", asctime(localtime(&timer)));
	printf("day = %d \n", GetDay(timer));
	printf("month = %d \n", GetMonth(timer));
	printf("year = %d \n", GetYear(timer));
	struct tm *p_tm = localtime(&timer);
	ULONG timm = GetTimeByYMDHMS(p_tm->tm_year + 1900, p_tm->tm_mon + 1,p_tm->tm_mday, 
							p_tm->tm_hour,p_tm->tm_min,p_tm->tm_sec);
		printf("1ptm = %ld\n", timm);
	char tmp[50];
	
	TimeFormat(timer, "Y-*M-D:H-M)S", tmp, 21);
	
	printf("tmp  = %s\n", tmp);
	printf("Getptm = %ld\n", GetTimeByString("[email protected]"));
	return 0;
}
Esempio n. 7
0
float
TruncTimeBase(BString *result, int64 value, const View *view, float width)
{
	TrackerSettings settings;
	FormatSeparator separator = settings.TimeFormatSeparator();
	DateOrder order = settings.DateOrderFormat();
	bool clockIs24hr = settings.ClockIs24Hr();

	float resultWidth = 0;
	char buffer[256];

	time_t timeValue = (time_t)value;
	tm timeData;
	// use reentrant version of localtime to avoid having to have a semaphore
	// (localtime uses a global structure to do it's conversion)
	localtime_r(&timeValue, &timeData);

	BString timeFormat;

	for (int32 index = 0; ; index++) {
		if (TimeFormat(timeFormat, index, separator, order, clockIs24hr)
				!= B_OK)
			break;
		strftime(buffer, 256, timeFormat.String(), &timeData);
		resultWidth = view->StringWidth(buffer);
		if (resultWidth <= width)
			break;
	}
	if (resultWidth > width) {
		// even the shortest format string didn't do it, insert ellipsis
		resultWidth = TruncStringBase(result, buffer, (ssize_t)strlen(buffer),
			view, width);
	} else
		*result = buffer;

	return resultWidth;
}
Esempio n. 8
0
void LogEntryGeneric(char *ProgramName, bool Console, char *Text)
{
    TRACEENTER();

    char                 *s;
    int                   l;
    TYPE_File             *File;
    char                  TimeResult[40];
    char                  CRLF[] = {'\r', '\n'};
    byte                  Sec;
    byte                 *ISOText;

#define FILENAME      "TAPSystem.log"

    if(!ProgramName || !Text)
    {
        TRACEEXIT();
        return;
    }

    HDD_TAP_PushDir();
    if(!HDD_ChangeDir("/ProgramFiles/Settings"))
    {
        HDD_ChangeDir("/ProgramFiles");
        if(!TAP_Hdd_Exist("Settings")) TAP_Hdd_Create("Settings", ATTR_FOLDER);
        HDD_ChangeDir("Settings");
    }

    l = strlen(ProgramName) + strlen(Text) + 4;
    s = TAP_MemAlloc(l);
    if(s)
    {
        memset(s, 0, l);
        TAP_SPrint(s, "%s: %s", ProgramName, Text);
        StrToISOAlloc(s, &ISOText);
        if(ISOText)
        {
            TimeFormat(Now(&Sec), Sec, TIMESTAMP_YMDHMS, TimeResult);
            strcat(TimeResult, " ");

            if(!TAP_Hdd_Exist(FILENAME)) TAP_Hdd_Create(FILENAME, ATTR_NORMAL);
            if((File = TAP_Hdd_Fopen(FILENAME)) != NULL)
            {
                TAP_Hdd_Fseek(File, 0, SEEK_END);
                TAP_Hdd_Fwrite(TimeResult, strlen(TimeResult), 1, File);
                TAP_Hdd_Fwrite(ISOText, strlen(ISOText), 1, File);
                TAP_Hdd_Fwrite(CRLF, 2, 1, File);
                TAP_Hdd_Fclose(File);
            }

            if(Console)
            {
                TAP_PrintNet("%s%s\n", TimeResult, ISOText);
            }

            TAP_MemFree(ISOText);
        }
        TAP_MemFree(s);
    }
    HDD_TAP_PopDir();

    TRACEEXIT();
}
Esempio n. 9
0
void Window::SetupAnnotation()
{
    int slice = m_ImageHandler.GetImageObj()->GetActiveSlice();
    DICOMIOType::Pointer io = *m_ImageHandler.GetImageObj()->GetIOObject(slice);

    std::string temp;
    std::shared_ptr<ImageContainer> imageObj = m_ImageHandler.GetImageObj();

    io->GetValueFromTag("0010|0010", temp);  //Patient name
    std::string UpperLeftText = temp + "\n";
    temp = "";
    io->GetValueFromTag("0010|0030", temp);  // Birthday
    UpperLeftText += DateFormat(temp) + ", ";
    temp = "";
    io->GetValueFromTag("0010|0040", temp);  // Sex
    UpperLeftText += temp + ", ";
    temp = "";
    io->GetValueFromTag("0010|1010", temp);  // Age
    UpperLeftText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0008|103e", temp);  // Series Description
    UpperLeftText += temp +"\n";
    temp = "";
    io->GetValueFromTag("0008|0012", temp);  // Instance Creation Day
    UpperLeftText += DateFormat(temp) + "\n";
    temp = "";
    io->GetValueFromTag("0008|0013", temp);  // Instance Creation Time
    UpperLeftText += TimeFormat(temp) + "\n";
    temp = "";
    temp = std::to_string(imageObj->GetActiveSlice()+1);
    UpperLeftText += temp + "/";
    temp = "";
    temp = std::to_string(imageObj->GetMaxSliceNum()+1);  // Number of Slices
    UpperLeftText += temp + "\n";
    temp = "";


    io->GetValueFromTag("0008|0080", temp);  // Institution Name
    std::string UpperRightText = temp + "\n";
    temp = "";
    io->GetValueFromTag("0008|1090", temp);  // Manufacturer Model Name
    UpperRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0018|1020", temp);  // Software Versions
    UpperRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0018|5100", temp);  // Patient Position
    UpperRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|1013", temp);  //
    UpperRightText += temp + "\n";
    temp = "";


    io->GetValueFromTag("0018|0080", temp);  // TR
    std::string LowerLeftText = "TR " + temp + "\n";
    temp = "";
    io->GetValueFromTag("0018|0081", temp);  // TE
    LowerLeftText += "TE " + temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|100a", temp);  // TA
    LowerLeftText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0018|0095", temp);  // BW
    LowerLeftText += "BW " + temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|1016", temp);  //
    LowerLeftText += temp + "\n\n";
    temp = "";
    io->GetValueFromTag("0051|1019", temp);  //
    LowerLeftText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|100f", temp);  //
    LowerLeftText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0018|0024", temp);  // Sequence Name
    LowerLeftText += temp + "\n";
    temp = "";


    io->GetValueFromTag("0051|1012", temp);  //
    std::string LowerRightText = temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|100d", temp);  //
    LowerRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|1017", temp);  //
    LowerRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|100c", temp);  // FOV
    LowerRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|100b", temp);  // Matrix Size
    LowerRightText += temp + "\n";
    temp = "";
    io->GetValueFromTag("0051|100e", temp);  //
    LowerRightText += temp + "\n";
    temp = "";
    temp = std::to_string(imageObj->GetCurrentWW());  // WW
    LowerRightText += "W " + temp + "\n";
    temp = "";
    temp = std::to_string(imageObj->GetCurrentWC());  // WC
    LowerRightText += "C " + temp + "\n";
    temp = "";


    m_pDisplay->SetUpperLeftAnnotation(UpperLeftText);
    m_pDisplay->SetUpperRightAnnotation(UpperRightText);
    m_pDisplay->SetLowerLeftAnnotation(LowerLeftText);
    m_pDisplay->SetLowerRightAnnotation(LowerRightText);
}
Esempio n. 10
0
std::vector<cpunit::ExecutionReport>
cpunit::TestExecutionFacade::execute(std::vector<TestUnit> &tests, const bool verbose, const TestRunnerFactory &trf) {

  // Make sure a newline is allways sent to std::cout at the end.
  struct NewlineAppender {
    std::ostream& out;
    NewlineAppender(std::ostream& out_) :
      out(out_)
    {}

    ~NewlineAppender() {
      out<<std::endl<<std::flush;
    }
  } nla(std::cout);

  // Create one test runner for set-up and tests.
  // Tear down uses a temporary, since its test runner may have to outlive
  // this scope.
  std::auto_ptr<TestRunner> runner = trf.create();

  std::vector<ExecutionReport> result;
  for (std::size_t i=0; i<tests.size(); i++) {
    if (verbose) {
      const RegInfo &ri = tests[i].get_test()->get_reg_info();
      std::cout<<"Running "<<ri.get_path()<<"::"<<ri.get_name()<<' '<<std::flush;
    }

    Callable* setUp    = tests[i].get_set_up();
    Callable* test     = tests[i].get_test();
    Callable* tearDown = tests[i].get_tear_down();

    SafeTearDown td(tearDown, trf.create());

    ExecutionReport res;

    if (setUp != NULL) {
      res = runner->run(*setUp);
    } else {
      res = ExecutionReport(ExecutionReport::OK, "No set-up", RegInfo(), .0);
    }

    if (res.get_execution_result() == ExecutionReport::OK) {

      const double timeSoFar = res.get_time_spent();

      res = runner->run(*test);
      res.set_time_spent(res.get_time_spent() + timeSoFar);
      result.push_back(res);
    } 

    if (verbose) {
      std::cout<<"\t"<<TimeFormat(res.get_time_spent())<<"s " << "\t";
    }
    
    if (verbose) {
      std::cout << report_progress_str(res.get_execution_result())<<std::flush;
      std::cout<<std::endl;
    }
    else {
      std::cout << report_progress(res.get_execution_result())<<std::flush;
    }
  }
  return result;
}
Esempio n. 11
0
	std::string MonTime()
	{
		return TimeFormat("%04d%02d", year, mon);
	}
Esempio n. 12
0
	std::string DayTime10()
	{
		return TimeFormat("%04d-%02d-%02d", year, mon, day);
	}
Esempio n. 13
0
	std::string Time14()
	{
		return TimeFormat("%04d%02d%02d%02d%02d%02d", year, mon, day, hour, min, sec);
	}
Esempio n. 14
0
	std::string TimeStamp()
	{
		return TimeFormat("%04d-%02d-%02d %02d:%02d:%02d", year, mon, day, hour, min, sec);
	}
Esempio n. 15
0
int TAP_Main (void)
{
  AddTime(0, 0);
  BMP_WriteHeader(NULL, 0, 0);
  BootReason();
  BuildWindowBorder();
  BuildWindowInfo();
  BuildWindowLine();
  BuildWindowLineSelected();
  BuildWindowScrollBar();
  BuildWindowTitle();
  busyWait();
  CalcAbsSectorFromFAT(NULL, 0);
  CalcPrepare();
  CalcTopIndex(0, 0);
  Callback(0, NULL, 0, 0, 0, 0);
  CallbackHelper(NULL, NULL, 0, 0, 0, 0);
  CallBIOS(0, 0, 0, 0, 0);
  CallFirmware(0, 0, 0, 0, 0);
  CallTraceEnable(FALSE);
  CallTraceEnter(NULL);
  CallTraceExit(NULL);
  CallTraceInit();
  CaptureScreen(0, 0, 0, NULL, 0, 0);
  ChangeDirRoot();
  CheckSelectable(0, 0);
  combineVfdData(NULL, NULL);
  compact(NULL, 0);
  CompressBlock(NULL, 0, NULL);
  CompressedTFDSize(NULL, 0, NULL);
  CompressTFD(NULL, 0, NULL, 0, 0, NULL);
  CRC16(0, NULL, 0);
  CRC32 (0, NULL, 0);
  Delay(0);
  DialogEvent(NULL, NULL, NULL);
  DialogMsgBoxButtonAdd(NULL, FALSE);
  DialogMsgBoxExit();
  DialogMsgBoxInit(NULL, NULL, NULL, NULL);
  DialogMsgBoxShow();
  DialogMsgBoxShowInfo(0);
  DialogMsgBoxShowOK();
  DialogMsgBoxShowOKCancel(0);
  DialogMsgBoxShowYesNo(0);
  DialogMsgBoxShowYesNoCancel(0);
  DialogMsgBoxTitleSet(NULL, NULL);
  DialogProfileChange(NULL);
  DialogProfileCheck(NULL, NULL, FALSE);
  DialogProfileLoad(NULL);
  DialogProfileLoadDefault();
  DialogProfileLoadMy(NULL, FALSE);
  DialogProfileSave(NULL);
  DialogProfileSaveDefault();
  DialogProfileScrollBehaviourChange(FALSE, FALSE);
  DialogProgressBarExit();
  DialogProgressBarInit(NULL, NULL, 0, 0, NULL, 0, 0);
  DialogProgressBarSet(0, 0);
  DialogProgressBarShow();
  DialogProgressBarTitleSet(NULL);
  DialogWindowChange(NULL, FALSE);
  DialogWindowCursorChange(FALSE);
  DialogWindowCursorSet(0);
  DialogWindowExit();
  DialogWindowHide();
  DialogWindowInfoAddIcon(0, 0, NULL);
  DialogWindowInfoAddS(0, 0, 0, NULL, 0, 0, 0, 0, 0);
  DialogWindowInfoDeleteAll();
  DialogWindowInit(NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, 0);
  DialogWindowItemAdd(NULL, 0, NULL, 0, FALSE, FALSE, 0, NULL);
  DialogWindowItemAddSeparator();
  DialogWindowItemChangeFlags(0, FALSE, FALSE);
  DialogWindowItemChangeIcon(0, 0, NULL);
  DialogWindowItemChangeParameter(0, NULL, 0);
  DialogWindowItemChangeValue(0, NULL, 0);
  DialogWindowItemDelete(0);
  DialogWindowItemDeleteAll();
  DialogWindowRefresh();
  DialogWindowReInit(0, 0, 0, 0, 0, 0);
  DialogWindowScrollDown();
  DialogWindowScrollDownPage();
  DialogWindowScrollUp();
  DialogWindowScrollUpPage();
  DialogWindowShow();
  DialogWindowTabulatorSet(0, 0);
  DialogWindowTitleChange(NULL, NULL, NULL);
  DialogWindowTypeChange(0);
  DrawMsgBoxButtons();
  DrawMsgBoxTitle();
  DrawOSDLine(0, 0, 0, 0, 0, 0);
  DrawProgressBarBar(0, 0);
  DrawProgressBarTitle();
  DrawWindowBorder();
  DrawWindowInfo();
  DrawWindowLine(0);
  DrawWindowLines();
  DrawWindowScrollBar();
  DrawWindowTitle();
  EndMessageWin();
  exitHook();
  ExtractLine(NULL, NULL);
  FileSelector(NULL, NULL, NULL, 0);
  FileSelectorKey(0, 0);
  FindDBTrack();
  FindInstructionSequence(NULL, NULL, 0, 0, 0, 0);
  findSendToVfdDisplay(0, 0);
  FlashAddFavourite(NULL, 0, FALSE);
  FlashDeleteFavourites();
  FlashFindEndOfServiceNameTableAddress();
  FlashFindEndOfServiceTableAddress(0);
  FlashFindServiceAddress(0, 0, 0, 0);
  FlashFindTransponderIndex(0, 0, 0);
  FlashGetBlockStartAddress(0);
  FlashGetChannelNumber(0, 0, 0, 0);
  FlashGetSatelliteByIndex(0);
  FlashGetServiceByIndex(0, FALSE);
  FlashGetServiceByName (NULL, FALSE);
  FlashGetTransponderCByIndex(0);
  FlashGetTransponderSByIndex(0, 0);
  FlashGetTransponderTByIndex(0);
  FlashGetTrueLocalTime(0, 0);
  FlashGetType();
  FlashInitialize(0);
  FlashProgram();
  FlashReindexFavourites(0, 0, 0);
  FlashReindexTimers(0, 0, 0);
  FlashRemoveCASServices(FALSE);
  FlashRemoveServiceByIndex(0, FALSE);
  FlashRemoveServiceByIndexString(NULL, FALSE);
  FlashRemoveServiceByLCN(NULL, FALSE);
  FlashRemoveServiceByName(NULL, FALSE);
  FlashRemoveServiceByPartOfName(NULL, FALSE);
  FlashRemoveServiceByUHF(NULL, FALSE, FALSE);
  FlashServiceAddressToServiceIndex(NULL);
  FlashWrite(NULL, NULL, 0, NULL);
  FlushCache(NULL, 0);
  FreeOSDRegion(0);
  fwHook(0);
  GetAudioTrackPID(0, NULL);
  GetClusterPointer(0);
  GetCurrentEvent(NULL);
  GetEEPROMAddress();
  GetEEPROMPin();
  GetFrameBufferPixel(0, 0);
  GetFrameSize(0, 0);
  GetFWInfo(0, 0, 0, 0, 0, 0, 0, 0);
  GetHeapParameter(NULL, 0);
  GetLine(NULL, 0);
  GetOSDMapAddress();
  GetOSDRegionHeight(0);
  GetOSDRegionWidth(0);
  GetPinStatus();
  GetPIPPosition(NULL, NULL, NULL, NULL);
  getRECSlotAddress();
  GetSysOsdControl(0);
  GetToppyString(0);
  HasEnoughItemMemory();
  HDD_AAM_Disable();
  HDD_AAM_Enable(0);
  HDD_APM_Disable();
  HDD_APM_Enable(0);
  HDD_BigFile_Read(NULL, 0, 0, NULL);
  HDD_BigFile_Size(NULL);
  HDD_BigFile_Write(NULL, 0, 0, NULL);
  HDD_ChangeDir(NULL);
  HDD_DecodeRECHeader(NULL, NULL);
  HDD_EncodeRECHeader(NULL, NULL, 0);
  HDD_FappendOpen(NULL);
  HDD_FappendWrite(NULL, NULL);
  HDD_FindPCR(NULL, 0);
  HDD_FindPMT(NULL, 0, NULL);
  HDD_FreeSize();
  HDD_GetClusterSize();
  HDD_GetFileDir(NULL, 0, NULL);
  HDD_GetFirmwareDirCluster();
  HDD_GetHddID(NULL, NULL, NULL);
  HDD_IdentifyDevice(NULL);
  HDD_isAnyRecording();
  HDD_isCryptedStream(NULL, 0);
  HDD_isRecording(0);
  HDD_LiveFS_GetChainLength(0);
  HDD_LiveFS_GetFAT1Address();
  HDD_LiveFS_GetFAT2Address();
  HDD_LiveFS_GetFirstCluster(0);
  HDD_LiveFS_GetLastCluster(0);
  HDD_LiveFS_GetNextCluster(0);
  HDD_LiveFS_GetPreviousCluster(0);
  HDD_LiveFS_GetRootDirAddress();
  HDD_LiveFS_GetSuperBlockAddress();
  HDD_MakeNewRecName(NULL, 0);
  HDD_Move(NULL, NULL, NULL);
  HDD_ReadClusterDMA(0, NULL);
  HDD_ReadSector(0, 0);
  HDD_ReadSectorDMA(0, 0, NULL);
  HDD_RECSlotGetAddress(0);
  HDD_RECSlotIsPaused(0);
  HDD_RECSlotPause(0, FALSE);
  HDD_RECSlotSetDuration(0, 0);
  HDD_SetCryptFlag(NULL, 0);
  HDD_SetFileDateTime(NULL, 0, 0, 0);
  HDD_SetSkipFlag (NULL, FALSE);
  HDD_SetStandbyTimer(0);
  HDD_Smart_DisableAttributeAutoSave();
  HDD_Smart_DisableOperations();
  HDD_Smart_EnableAttributeAutoSave();
  HDD_Smart_EnableOperations();
  HDD_Smart_ExecuteOfflineImmediate(0);
  HDD_Smart_ReadData(0);
  HDD_Smart_ReadThresholdData(0);
  HDD_Smart_ReturnStatus();
  HDD_Stop();
  HDD_TAP_Callback(0, NULL, 0, 0, 0, 0);
  HDD_TAP_Disable(0, 0);
  HDD_TAP_DisableAll(0);
  HDD_TAP_DisabledEventHandler(0, 0, 0);
  HDD_TAP_GetCurrentDir(NULL);
  HDD_TAP_GetCurrentDirCluster();
  HDD_TAP_GetIDByFileName(NULL);
  HDD_TAP_GetIDByIndex(0);
  HDD_TAP_GetIndexByID(0);
  HDD_TAP_GetInfo(0, NULL);
  HDD_TAP_GetStartParameter();
  HDD_TAP_isAnyRunning();
  HDD_TAP_isBatchMode();
  HDD_TAP_isDisabled(0);
  HDD_TAP_isDisabledAll();
  HDD_TAP_isRunning(0);
  HDD_TAP_SendEvent(0, FALSE, 0, 0, 0);
  HDD_TAP_SetCurrentDirCluster(0);
  HDD_TAP_Start(NULL, FALSE, NULL, NULL);
  HDD_TAP_StartedByTAP();
  HDD_TAP_Terminate(0);
  HDD_TouchFile(NULL);
  HDD_TranslateDirCluster(0, NULL);
  HDD_TruncateFile(NULL, 0);
  HDD_Write(NULL, 0, NULL);
  HDD_WriteClusterDMA(0, NULL);
  HDD_WriteSectorDMA(0, 0, NULL);
  HookEnable(0, 0);
  HookExit();
  HookIsEnabled(0);
  HookMIPS_Clear(0, 0, 0);
  HookMIPS_Set(0, 0, 0);
  HookSet(0, 0);
  IMEM_Alloc(0);
  IMEM_Init(0);
  IMEM_isInitialized();
  IMEM_Compact();
  IMEM_Free(NULL);
  IMEM_GetInfo(NULL, NULL);
  IMEM_Kill();
  InfoTestGrid();
  INICloseFile();
  INIFindStartEnd(NULL, NULL, NULL, 0);
  INIGetARGB(NULL, NULL, NULL, NULL, NULL, 0);
  INIGetHexByte(NULL, 0, 0, 0);
  INIGetHexDWord(NULL, 0, 0, 0);
  INIGetHexWord(NULL, 0, 0, 0);
  INIGetInt(NULL, 0, 0, 0);
  INIGetString(NULL, NULL, NULL, 0);
  INIKillKey(NULL);
  INIOpenFile(NULL);
  INISaveFile(NULL);
  INISetARGB(NULL, 0, 0, 0, 0);
  INISetComment(NULL);
  INISetHexByte(NULL, 0);
  INISetHexDWord(NULL, 0);
  INISetHexWord(NULL, 0);
  INISetInt(NULL, 0);
  INISetString(NULL, NULL);
  initCodeWrapper(0);
  InitTAPAPIFix();
  InitTAPex();
  InteractiveGetStatus();
  InteractiveSetStatus(FALSE);
  intLock();
  intUnlock(0);
  isAnyOSDVisible(0, 0, 0, 0);
  isLegalChar(0, 0);
  isMasterpiece();
  isMPMenu();
  iso639_1(0);
  isOSDRegionAlive(0);
  isValidChannel(NULL);
  LangGetString(0);
  LangLoadStrings(NULL, 0, 0);
  LangUnloadStrings();
  Log(NULL, NULL, FALSE, 0, NULL);
  LowerCase(NULL);
  MakeValidFileName(NULL, 0);
  MHEG_Status();
  MPDisplayClearDisplay();
  MPDisplayClearSegments(0, 0);
  MPDisplayDisplayLongString(NULL);
  MPDisplayDisplayShortString(NULL);
  MPDisplayGetDisplayByte(0);
  MPDisplayGetDisplayMask(0);
  MPDisplayInstallMPDisplayFwHook();
  MPDisplaySetAmFlag(0);
  MPDisplaySetColonFlag(0);
  MPDisplaySetDisplayByte(0, 0);
  MPDisplaySetDisplayMask(0, 0);
  MPDisplaySetDisplayMemory(NULL);
  MPDisplaySetDisplayMode(0);
  MPDisplaySetPmFlag(0);
  MPDisplaySetSegments(0, 0);
  MPDisplayToggleSegments(0, 0);
  MPDisplayUninstallMPDisplayFwHook();
  MPDisplayUpdateDisplay();
  Now(NULL);
  OSDCopy(0, 0, 0, 0, 0, 0, 0);
  OSDLinesForeDirty(FALSE);
  ParseLine(NULL, NULL, 0);
  ProfileDirty();
  ProfileInit();
  ProfileLoad(NULL, FALSE);
  ProfileMayReload();
  ReadEEPROM(0, 0, NULL);
  ReadIICRegister(0, 0, 0, 0, NULL);
  Reboot(0);
  ReceiveSector(0);
  RTrim(NULL);
  SaveBitmap(NULL, 0, 0, NULL);
  SendEvent(0, 0, 0, 0);
  SendEventHelper(NULL, 0, 0, 0);
  SendHDDCommand(0, 0, 0, 0, 0, 0, 0);
  SendToFP(NULL);
  SeparatePathComponents(NULL, NULL, NULL, NULL);
  SetCrashBehaviour(0);
  setSymbol14(0, 0);
  setSymbol17(0, 0);
  ShowMessageWin(NULL, NULL, NULL, 0);
  ShowMessageWindow(NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  Shutdown(0);
  SoundSinus(0, 0, 0);
  StrEndsWith(NULL, NULL);
  stricstr(NULL, NULL);
  SubtitleGetStatus();
  SubtitleSetStatus(FALSE);
  SuppressedAutoStart();
  SwapDWords(0);
  SwapWords(0);
  TAP_Osd_PutFreeColorGd(0, 0, 0, NULL, FALSE, 0);
  TAPCOM_CloseChannel(NULL);
  TAPCOM_Finish(NULL, 0);
  TAPCOM_GetChannel(0, NULL, NULL, NULL, NULL);
  TAPCOM_GetReturnValue(NULL);
  TAPCOM_GetStatus(NULL);
  TAPCOM_LastAlive(NULL);
  TAPCOM_OpenChannel(0, 0, 0, NULL);
  TAPCOM_Reject(NULL);
  TAPCOM_StillAlive(NULL);
  TFDSize(NULL);
  TimeDiff(0, 0);
  TimeFormat(0, 0, 0);
  TunerGet(0);
  TunerSet(0);
  UncompressBlock(NULL, 0, NULL, 0);
  UncompressedFirmwareSize(NULL);
  UncompressedLoaderSize(NULL);
  UncompressedTFDSize(NULL);
  UncompressFirmware(NULL, NULL, NULL);
  UncompressLoader(NULL, NULL, NULL);
  UncompressTFD(NULL, NULL, NULL);
  UpperCase(NULL);
  ValidFileName(NULL, 0);
  WindowDirty();
  WriteIICRegister(0, 0, 0, 0, NULL);
  YUV2RGB(0, 0, 0, NULL, NULL, NULL);
  YUV2RGB2(0, 0, 0, NULL, NULL, NULL);

  return 0;
}
Esempio n. 16
0
void LogEntry(char *FileName, char *ProgramName, bool Console, eTimeStampFormat TimeStampFormat, char *Text)
{
  TRACEENTER();

  int                   f;
  char                  TimeResult[40];
  char                  CRLF[] = {'\r', '\n'};
  byte                  Sec;
  byte                 *ISOText;
  char                  AbsFileName[FBLIB_DIR_SIZE];
  struct utimbuf        times;

  if(!Text)
  {
    TRACEEXIT();
    return;
  }

  TimeFormat(Now(&Sec), Sec, TimeStampFormat, TimeResult);
  if(TimeResult[0]) strcat(TimeResult, " ");

  if(FileName && FileName[0])
  {
    ConvertPathType(FileName, AbsFileName, PF_FullLinuxPath);
    f = open(AbsFileName, O_WRONLY | O_CREAT | O_APPEND);
    if(f >= 0)
    {
      write(f, TimeResult, strlen(TimeResult));
      if(Text && Text[0]) write(f, Text, strlen(Text));
      write(f, CRLF, 2);
      close(f);

      //As the log would receive the Linux time stamp (01.01.2000), adjust to the PVR's time
      times.actime = PvrTimeToLinux(Now(NULL));
      times.modtime = times.actime;
      utime(AbsFileName, &times);
    }
  }

  if(Console)
  {
    if(TimeStampFormat != TIMESTAMP_NONE) TAP_Print(TimeResult);
    if(ProgramName && ProgramName[0]) TAP_Print("%s: ", ProgramName);

    if(isUTFToppy())
    {
      if(strlen(Text) < 510)
      {
        TAP_Print("%s", Text);
      }
      else
      {
        char *p = Text;

        while(*p)
        {
          int     l;
          char    q;

          l = strlen(p);
          q = p[l];
          p[l] = '\0';
          TAP_Print("%s", p);
          p[l] = q;
          p += l;
        }
      }
      TAP_Print("\n");
    }
    else
    {
      //Max length is 512. If above, a buffer overflow may occur
      StrToISOAlloc(Text, &ISOText);
      if(ISOText && ISOText[0])
      {
        if(strlen(ISOText) < 510)
        {
          TAP_Print("%s", ISOText);
        }
        else
        {
          char *p = ISOText;

          while(*p)
          {
            int     l;
            char    q;

            l = strlen(p);
            if(l > 510) l = 510;

            q = p[l];
            p[l] = '\0';
            TAP_Print("%s", p);
            p[l] = q;
            p += l;
          }
        }
      }
      TAP_Print("\n");
      TAP_MemFree(ISOText);
    }
  }

  TRACEEXIT();
}