vdr
2.0.5
|
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <iconv.h>
#include <math.h>
#include <poll.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <sys/stat.h>
#include <sys/types.h>
Go to the source code of this file.
Classes | |
class | cCharSetConv |
class | cString |
class | cBase64Encoder |
class | cBitStream |
class | cTimeMs |
class | cReadLine |
class | cPoller |
class | cReadDir |
class | cFile |
class | cSafeFile |
class | cUnbufferedFile |
class | cLockFile |
class | cListObject |
class | cListBase |
class | cList< T > |
class | cVector< T > |
class | cStringList |
class | cFileNameList |
class | cHashObject |
class | cHashBase |
class | cHash< T > |
Macros | |
#define | esyslog(a...) void( (SysLogLevel > 0) ? syslog_with_tid(LOG_ERR, a) : void() ) |
#define | isyslog(a...) void( (SysLogLevel > 1) ? syslog_with_tid(LOG_ERR, a) : void() ) |
#define | dsyslog(a...) void( (SysLogLevel > 2) ? syslog_with_tid(LOG_ERR, a) : void() ) |
#define | LOG_ERROR esyslog("ERROR (%s,%d): %m", __FILE__, __LINE__) |
#define | LOG_ERROR_STR(s) esyslog("ERROR (%s,%d): %s: %m", __FILE__, __LINE__, s) |
#define | SECSINDAY 86400 |
#define | KILOBYTE(n) ((n) * 1024) |
#define | MEGABYTE(n) ((n) * 1024LL * 1024LL) |
#define | MALLOC(type, size) (type *)malloc(sizeof(type) * (size)) |
#define | CHECK(s) { if ((s) < 0) LOG_ERROR; } |
#define | FATALERRNO (errno && errno != EAGAIN && errno != EINTR) |
#define | BCDCHARTOINT(x) (10 * ((x & 0xF0) >> 4) + (x & 0xF)) |
#define | Utf8BufSize(s) ((s) * 4) |
#define | Utf8to(conv, c) (cCharSetConv::SystemCharacterTable() ? to##conv(c) : tow##conv(c)) |
#define | Utf8is(ccls, c) (cCharSetConv::SystemCharacterTable() ? is##ccls(c) : isw##ccls(c)) |
#define | HASHSIZE 512 |
Typedefs | |
typedef unsigned char | uchar |
Functions | |
template<class T > | |
void | DELETENULL (T *&p) |
template<class T > | |
T | min (T a, T b) |
template<class T > | |
T | max (T a, T b) |
template<class T > | |
int | sgn (T a) |
template<class T > | |
void | swap (T &a, T &b) |
template<class T > | |
T | constrain (T v, T l, T h) |
void | syslog_with_tid (int priority, const char *format,...) __attribute__((format(printf |
int | BCD2INT (int x) |
template<class T > | |
T | get_unaligned (T *p) |
template<class T > | |
void | put_unaligned (unsigned int v, T *p) |
bool | DoubleEqual (double a, double b) |
int | Utf8CharLen (const char *s) |
uint | Utf8CharGet (const char *s, int Length=0) |
int | Utf8CharSet (uint c, char *s=NULL) |
int | Utf8SymChars (const char *s, int Symbols) |
int | Utf8StrLen (const char *s) |
char * | Utf8Strn0Cpy (char *Dest, const char *Src, int n) |
int | Utf8ToArray (const char *s, uint *a, int Size) |
int | Utf8FromArray (const uint *a, char *s, int Size, int Max=-1) |
ssize_t | safe_read (int filedes, void *buffer, size_t size) |
ssize_t | safe_write (int filedes, const void *buffer, size_t size) |
void | writechar (int filedes, char c) |
int | WriteAllOrNothing (int fd, const uchar *Data, int Length, int TimeoutMs=0, int RetryMs=0) |
char * | strcpyrealloc (char *dest, const char *src) |
char * | strn0cpy (char *dest, const char *src, size_t n) |
char * | strreplace (char *s, char c1, char c2) |
char * | strreplace (char *s, const char *s1, const char *s2) |
char * | skipspace (const char *s) |
char * | stripspace (char *s) |
char * | compactspace (char *s) |
cString | strescape (const char *s, const char *chars) |
bool | startswith (const char *s, const char *p) |
bool | endswith (const char *s, const char *p) |
bool | isempty (const char *s) |
int | numdigits (int n) |
bool | isnumber (const char *s) |
int64_t | StrToNum (const char *s) |
bool | StrInArray (const char *a[], const char *s) |
double | atod (const char *s) |
cString | dtoa (double d, const char *Format="%f") |
cString | itoa (int n) |
cString | AddDirectory (const char *DirName, const char *FileName) |
bool | EntriesOnSameFileSystem (const char *File1, const char *File2) |
int | FreeDiskSpaceMB (const char *Directory, int *UsedMB=NULL) |
bool | DirectoryOk (const char *DirName, bool LogErrors=false) |
bool | MakeDirs (const char *FileName, bool IsDirectory=false) |
bool | RemoveFileOrDir (const char *FileName, bool FollowSymlinks=false) |
bool | RemoveEmptyDirectories (const char *DirName, bool RemoveThis=false, const char *IgnoreFiles[]=NULL) |
int | DirSizeMB (const char *DirName) |
char * | ReadLink (const char *FileName) |
bool | SpinUpDisk (const char *FileName) |
void | TouchFile (const char *FileName) |
time_t | LastModifiedTime (const char *FileName) |
off_t | FileSize (const char *FileName) |
cString | WeekDayName (int WeekDay) |
cString | WeekDayName (time_t t) |
cString | WeekDayNameFull (int WeekDay) |
cString | WeekDayNameFull (time_t t) |
cString | DayDateTime (time_t t=0) |
cString | TimeToString (time_t t) |
cString | DateString (time_t t) |
cString | ShortDateString (time_t t) |
cString | TimeString (time_t t) |
uchar * | RgbToJpeg (uchar *Mem, int Width, int Height, int &Size, int Quality=100) |
int | CompareStrings (const void *a, const void *b) |
int | CompareStringsIgnoreCase (const void *a, const void *b) |
Variables | |
int | SysLogLevel |
#define BCDCHARTOINT | ( | x | ) | (10 * ((x & 0xF0) >> 4) + (x & 0xF)) |
Definition at line 64 of file tools.h.
Referenced by BCD2INT(), and tTeletextSubtitlePage::PageNumber().
#define CHECK | ( | s | ) | { if ((s) < 0) LOG_ERROR; } |
Definition at line 50 of file tools.h.
Referenced by cDvbSdFfDevice::Clear(), cDvbHdFfDevice::Clear(), cDvbTuner::ExecuteDiseqc(), cDvbSdFfDevice::Freeze(), cDvbSdFfDevice::GetAudioChannelDevice(), cDvbSdFfDevice::Mute(), cDvbSdFfDevice::Play(), cDvbTuner::ResetToneAndVoltage(), cDvbSdFfDevice::SetAudioChannelDevice(), cDvbSdFfDevice::SetChannelDevice(), cDvbTuner::SetFrontend(), cDvbHdFfDevice::SetPid(), cDvbSdFfDevice::SetPid(), cDvbDevice::SetPid(), cDvbSdFfDevice::SetPlayMode(), cDvbSdFfDevice::SetVideoDisplayFormat(), cDvbSdFfDevice::SetVideoFormat(), cDvbSdFfDevice::SetVolumeDevice(), cDvbSdFfDevice::StillPicture(), cDvbSdFfDevice::TrickSpeed(), and cDvbSdFfDevice::TurnOffLiveMode().
#define dsyslog | ( | a... | ) | void( (SysLogLevel > 2) ? syslog_with_tid(LOG_ERR, a) : void() ) |
Definition at line 36 of file tools.h.
Referenced by cSectionHandler::Action(), cIoThrottle::Activate(), cMenuTimers::ActualiseDiskStatus(), cCaDescriptors::AddCaDescriptor(), cReceiver::AddPid(), cFrameDetector::Analyze(), cCamSlot::Assign(), cDvbDevice::Bond(), cDvbTuner::Bond(), cCamSlot::CanDecrypt(), cDevice::cDevice(), cDvbSdFfDevice::cDvbSdFfDevice(), cStatusTest::ChannelSwitch(), cShutdownHandler::CheckManualStart(), cSVDRP::CmdGRAB(), cRecordControl::cRecordControl(), cSourceParam::cSourceParam(), cIndexFile::Delete(), cChannels::DeleteDuplicateChannels(), cShutdownHandler::DoShutdown(), cDvbSpuDecoder::Draw(), cDevice::EnsureAudioTrack(), cMenuCommands::Execute(), cRecording::FileName(), cDiseqcs::Get(), cDvbTuner::GetBondedMaster(), cRecordControl::GetEvent(), cDvbHdFfDevice::GrabImage(), cDvbSdFfDevice::GrabImage(), I18nInitialize(), I18nSetLocale(), cInterface::LearnKeys(), main(), MakeDirs(), cMenuSetupCAM::Menu(), cSkins::Message(), cChannels::NewChannel(), cTimeMs::Now(), cFileName::Open(), cStatusTest::OsdChannel(), cStatusTest::OsdClear(), cStatusTest::OsdCurrentItem(), cStatusTest::OsdHelpKeys(), cStatusTest::OsdProgramme(), cStatusTest::OsdStatusMessage(), cStatusTest::OsdTextItem(), cStatusTest::OsdTitle(), cDevice::PlayPesPacket(), cDvbSdFfDeviceProbe::Probe(), cDvbHdFfDeviceProbe::Probe(), cDvbDevice::Probe(), cCiConditionalAccessSupport::Process(), cNaluDumper::ProcessPayload(), cSkins::ProcessQueuedMessages(), cNaluDumper::ProcessTSPacket(), cInterface::QueryKeys(), cSkins::QueueMessage(), cSchedules::Read(), cStatusTest::Recording(), cIoThrottle::Release(), RemoveEmptyDirectories(), RemoveFileOrDir(), cStatusTest::Replaying(), ReportEpgBugFixStats(), cShutdownHandler::RequestEmergencyExit(), cRecorder::RunningLowOnDiskSpace(), safe_read(), safe_write(), cMenuCam::Select(), cMenuCam::Set(), cStatusTest::SetAudioChannel(), cStatusTest::SetAudioTrack(), cRemux::SetBrokenLink(), cChannel::SetCaDescriptors(), cChannel::SetCaIds(), cChannel::SetId(), cChannel::SetLinkChannels(), cChannel::SetName(), cFileName::SetOffset(), cChannel::SetPids(), cChannel::SetPortalName(), cStatusTest::SetSubtitleTrack(), cChannel::SetTransponderData(), cStatusTest::SetVolume(), SpinUpDisk(), cRecordControls::Start(), cThread::StartThread(), cDevice::SwitchChannel(), cCuttingThread::Throttled(), cStatusTest::TimerChange(), cDvbDevice::UnBond(), cDvbTuner::UnBond(), cOsdProvider::UpdateOsdSize(), cRingBuffer::UpdatePercentage(), and cRingBuffer::~cRingBuffer().
#define esyslog | ( | a... | ) | void( (SysLogLevel > 0) ? syslog_with_tid(LOG_ERR, a) : void() ) |
Definition at line 34 of file tools.h.
Referenced by cLircRemote::Action(), cRecorder::Action(), cDvbPlayer::Action(), cCuttingThread::Action(), cDvbTuner::Action(), cTSBuffer::Action(), cPoller::Add(), cCiCaPmt::AddCaDescriptors(), cCiAdapter::AddCamSlot(), cDevice::AddPid(), cPluginManager::AddPlugin(), cFrameDetector::Analyze(), cDevice::AttachReceiver(), cDvbPlayer::Backward(), cDvbDevice::Bond(), cDvbTuner::Bond(), cDvbDevice::BondDevices(), cPlugin::CacheDirectory(), cShutdownHandler::CallShutdownCommand(), cThread::Cancel(), cIndexFile::CatchUp(), cCuttingThread::cCuttingThread(), cDevice::cDevice(), cDvbCiAdapter::cDvbCiAdapter(), cDvbDevice::cDvbDevice(), cDvbPlayer::cDvbPlayer(), cDvbSdFfOsd::cDvbSdFfOsd(), cFileName::cFileName(), cFrame::cFrame(), cFreetypeFont::cFreetypeFont(), cIndexFile::cIndexFile(), cCiTransportConnection::CloseSession(), cPlugin::ConfigDirectory(), cCharSetConv::Convert(), cPixmap::cPixmap(), cRecorder::cRecorder(), cRecording::cRecording(), cResumeFile::cResumeFile(), cRingBufferLinear::cRingBufferLinear(), cSourceParam::cSourceParam(), cTDT::cTDT(), cTPDU::cTPDU(), cRingBufferLinear::Del(), cOsd::DestroyPixmap(), DirectoryOk(), cRingBufferFrame::Drop(), cSchedule::Dump(), ExchangeChars(), cMenuCommands::Execute(), cDvbTuner::ExecuteDiseqc(), cTheme::FileNameOk(), cMpeg2Fixer::FindHeader(), cDvbPlayer::Forward(), cSource::FromString(), cSatCableNumbers::FromString(), cDiseqcs::Get(), cTSBuffer::Get(), cNaluStreamProcessor::GetBuffer(), GetClippedNumProvidedSystems(), cDiseqc::GetCodes(), cFont::GetFont(), cFont::GetFontFileName(), cSubtitleClut::GetPalette(), GetRequiredDeliverySystem(), cDiseqc::GetScrBank(), cDvbSdFfDevice::GetSTC(), cDvbHdFfDevice::GetSTC(), cCiMMI::GetText(), cFreetypeFont::Glyph(), cDvbHdFfDevice::GrabImage(), cDvbSdFfDevice::GrabImage(), cCiTransportConnection::HandleSessions(), I18nInitialize(), JpegCompressEmptyOutputBuffer(), JpegCompressTermDestination(), cInterface::LearnKeys(), cTheme::Load(), cThemes::Load(), cDll::Load(), cConfig< cDiseqc >::Load(), cSetup::Load(), cBitmap::LoadXpm(), cLockFile::Lock(), main(), cSkins::Message(), cDvbCiAdapter::ModuleStatus(), cCamSlot::NewConnection(), cOsdProvider::NewOsd(), cDevice::NextCardIndex(), cTimeMs::Now(), cMenuSchedule::Number(), cFile::Open(), cDvbDevice::OpenFilter(), cCiTransportConnection::OpenSession(), OpenVideoFile(), cScr::Parse(), cTimer::Parse(), cDiseqc::Parse(), cKeyMacro::Parse(), cEvent::Parse(), cDvbTransponderParameters::Parse(), cChannel::Parse(), ParseDeviceNumbers(), cDvbTransponderParameters::ParseParameter(), cPatPmtParser::ParsePat(), cPatPmtParser::ParsePmt(), cExternalAudio::Play(), cPlayer::PlayPes(), cDevice::PlayPes(), cDevice::PlayPesPacket(), cExternalAudio::PlayTs(), cDevice::PlayTs(), cSVDRP::Process(), cCamSlot::Process(), cCiTransportConnection::Process(), cCiResourceManager::Process(), cCiApplicationInformation::Process(), cCiConditionalAccessSupport::Process(), cCiDateTime::Process(), cCiMMI::Process(), cNaluStreamProcessor::PutBuffer(), cKeys::PutSetup(), cTsToPes::PutTs(), cDvbDevice::QueryDeliverySystems(), cDvbCiAdapter::Read(), cRecordingInfo::Read(), cEvent::Read(), cSchedule::Read(), ReadFrame(), cComponents::Realloc(), cVector< const cTimer * >::Realloc(), cDvbSubtitleAssembler::Realloc(), cTransfer::Receive(), cRecording::Remove(), cSVDRP::Reply(), cRingBuffer::ReportOverflow(), cShutdownHandler::RequestEmergencyExit(), cDvbCiAdapter::Reset(), cPlugin::ResourceDirectory(), cCiSession::SendData(), cOsd::SetAreas(), cDevice::SetAvailableTrack(), cDvbHdFfDevice::SetChannelDevice(), cDvbSdFfDevice::SetChannelDevice(), cSubtitleClut::SetColor(), cSkins::SetCurrent(), cDvbTuner::SetFrontend(), cPixmap::SetLayer(), cThread::SetMainThreadId(), cFileName::SetOffset(), cFrameDetector::SetPid(), cDvbSdFfDevice::SetPlayMode(), cDevice::SetPrimaryDevice(), cBitmap::SetSize(), cDvbSpuDecoder::setTime(), cChannel::SetTransponderData(), cDvbSdFfDevice::SetVideoDisplayFormat(), cDevice::SetVideoDisplayFormat(), cBitmap::SetXpm(), SkipQuote(), SpinUpDisk(), cString::sprintf(), cRecordControls::Start(), cThread::StartThread(), cDevice::StillPicture(), cFileTransfer::Stop(), cCutter::Stop(), strcpyrealloc(), strreplace(), cOsdProvider::SupportsTrueColor(), cDevice::SwitchChannel(), cChannel::Transponder(), cRecording::Undelete(), cString::vsprintf(), cDiseqc::Wait(), Watchdog(), cDvbCiAdapter::Write(), and cReceiver::~cReceiver().
#define FATALERRNO (errno && errno != EAGAIN && errno != EINTR) |
Definition at line 51 of file tools.h.
Referenced by cNonBlockingFileReader::Action(), cDvbPlayer::Action(), cTSBuffer::Action(), and WriteAllOrNothing().
#define isyslog | ( | a... | ) | void( (SysLogLevel > 1) ? syslog_with_tid(LOG_ERR, a) : void() ) |
Definition at line 35 of file tools.h.
Referenced by cSocket::Accept(), cLircRemote::Action(), cDvbPlayer::Action(), cDvbTuner::Action(), cMarks::Align(), AssertFreeDiskSpace(), cShutdownHandler::CallShutdownCommand(), cDvbCiAdapter::cDvbCiAdapter(), cDvbPlayer::cDvbPlayer(), cRecordControls::ChannelDataModified(), cIndexFile::cIndexFile(), cSVDRP::Close(), cSVDRP::CmdDELC(), cSVDRP::CmdDELT(), cSVDRP::CmdMESG(), cSVDRP::CmdMODC(), cSVDRP::CmdMODT(), cSVDRP::CmdMOVC(), cSVDRP::CmdNEWC(), cSVDRP::CmdNEWT(), cSVDRP::CmdUPDT(), cMenuTimers::Commands(), cInterface::Confirm(), cRcuRemote::cRcuRemote(), cRecordControl::cRecordControl(), cRecorder::cRecorder(), cSVDRP::cSVDRP(), cTDT::cTDT(), cRecording::Delete(), cMenuRecordings::Delete(), cMenuChannels::Delete(), cMenuTimers::Delete(), cTimers::DeleteExpired(), cMenuTimers::Edit(), cDevice::GrabImageFile(), cRcuRemote::Initialize(), cDvbDevice::Initialize(), cPluginManager::InitializePlugins(), cRecordingUserCommand::InvokeCommand(), cTheme::Load(), cDll::Load(), cConfig< cDiseqc >::Load(), cNestedItemList::Load(), main(), cSkins::Message(), cMenuChannels::Move(), cMenuTimers::OnOff(), cSVDRP::Process(), cCamSlot::Process(), cCiApplicationInformation::Process(), cMenuEditTimer::ProcessKey(), cMenuEditChannel::ProcessKey(), cDvbDevice::QueryDeliverySystems(), cMenuWhatsOn::Record(), cMenuSchedule::Record(), cRecording::Remove(), cSetup::Save(), cRecordings::ScanVideoDir(), cSkins::SetCurrent(), cTimer::SetDeferred(), cTimer::SetEvent(), cTimer::SetInVpsMargin(), cDevice::SetPrimaryDevice(), cTimer::SetRecording(), cEvent::SetRunningStatus(), cPluginManager::Shutdown(), cRecordControls::Start(), cPluginManager::StartPlugins(), cPluginDvbhddevice::Stop(), cFileTransfer::Stop(), cCutter::Stop(), cRecordControls::Stop(), cReplayControl::Stop(), cPluginManager::StopPlugins(), cDevice::SwitchChannel(), cRecording::Undelete(), and cRecorder::~cRecorder().
#define KILOBYTE | ( | n | ) | ((n) * 1024) |
Definition at line 43 of file tools.h.
Referenced by cIndexFileGenerator::Action(), cPicturePlayer::cPicturePlayer(), cUnbufferedFile::Open(), and cTsToPes::PutTs().
#define LOG_ERROR esyslog("ERROR (%s,%d): %m", __FILE__, __LINE__) |
Definition at line 38 of file tools.h.
Referenced by cSocket::Accept(), cNonBlockingFileReader::Action(), cDvbPlayer::Action(), cTSBuffer::Action(), cThread::Active(), cIndexFile::cIndexFile(), cPipe::Close(), cPUTEhandler::cPUTEhandler(), cSchedules::Dump(), cDvbSdFfDevice::GetOsdSize(), cDvbHdFfDevice::GetVideoSize(), cDvbSdFfDevice::GetVideoSize(), cDvbHdFfDevice::GetVideoSystem(), cDvbSdFfDevice::GetVideoSystem(), cSocket::Open(), cPipe::Open(), cExternalAudio::Play(), cExternalAudio::PlayTs(), cDvbDevice::QueryDeliverySystems(), cSchedules::Read(), ReadFrame(), cRcuRemote::ReceiveByte(), cSVDRP::Send(), cRcuRemote::SendByteHandshake(), cThread::SetIOPriority(), cDvbHdFfDevice::SetPid(), cDvbSdFfDevice::SetPid(), cDvbDevice::SetPid(), cThread::SetPriority(), cThread::Start(), and SystemExec().
#define LOG_ERROR_STR | ( | s | ) | esyslog("ERROR (%s,%d): %s: %m", __FILE__, __LINE__, s) |
Definition at line 39 of file tools.h.
Referenced by cRecorder::Action(), cIndexFile::CatchUp(), cIndexFile::cIndexFile(), cFileName::Close(), cSafeFile::Close(), cSVDRP::CmdGRAB(), HDFF::cHdffCmdIf::CmdOsdCreateDisplay(), HDFF::cHdffCmdIf::CmdOsdCreateFont(), HDFF::cHdffCmdIf::CmdOsdCreateFontFace(), HDFF::cHdffCmdIf::CmdOsdCreatePalette(), cLircRemote::Connect(), cRcuRemote::cRcuRemote(), cRecording::cRecording(), cResumeFile::Delete(), DirectoryOk(), DirSizeMB(), cDvbDevice::DvbOpen(), EntriesOnSameFileSystem(), cDvbDevice::Exists(), FreeDiskSpaceMB(), cDvbSdFfDevice::GrabImage(), cDevice::GrabImageFile(), cPictureEntry::Load(), cTheme::Load(), cConfig< cDiseqc >::Load(), cNestedItemList::Load(), cFileNameList::Load(), cLockFile::Lock(), MakeDirs(), cPipe::Open(), cFileName::Open(), cSafeFile::Open(), OpenVideoFile(), cResumeFile::Read(), cRecordingInfo::Read(), cKbdRemote::ReadKey(), ReadLink(), RemoveEmptyDirectories(), RemoveFileOrDir(), RenameVideoFile(), cResumeFile::Save(), cFileName::SetOffset(), cPicturePlayer::SetPicture(), SpinUpDisk(), cDevice::StillPicture(), SystemExec(), TouchFile(), cRecordingInfo::Write(), cIndexFile::Write(), and cRecording::WriteInfo().
#define MALLOC | ( | type, | |
size | |||
) | (type *)malloc(sizeof(type) * (size)) |
Definition at line 46 of file tools.h.
Referenced by cCopyingThread::Action(), cBase64Encoder::cBase64Encoder(), cCaDescriptor::cCaDescriptor(), cFileName::cFileName(), cFrame::cFrame(), cGlyph::cGlyph(), cHeapBuffer::cHeapBuffer(), cImage::cImage(), cIndexFile::cIndexFile(), CopyString(), cPicturePlayer::cPicturePlayer(), cPixmapMemory::cPixmapMemory(), cRecording::cRecording(), cResumeFile::cResumeFile(), cRingBufferLinear::cRingBufferLinear(), cSafeFile::cSafeFile(), cSatCableNumbers::cSatCableNumbers(), cSVDRP::cSVDRP(), cDvbSdFfDevice::GrabImage(), JpegCompressInitDestination(), cBitmap::LoadXpm(), cTimer::Parse(), cSVDRP::Process(), RemoveFileOrDir(), cNonBlockingFileReader::Request(), cTextWrapper::Set(), cMenuCam::Set(), cBitmap::SetSize(), cRecording::SortName(), cDvbSdFfDevice::StillPicture(), cDvbHdFfDevice::StillPicture(), strescape(), and cRecording::Title().
#define MEGABYTE | ( | n | ) | ((n) * 1024LL * 1024LL) |
Definition at line 44 of file tools.h.
Referenced by cCuttingThread::cCuttingThread(), DirSizeMB(), cCuttingThread::LoadFrame(), main(), cRecorder::NextFile(), cDvbDevice::OpenDvr(), and cUnbufferedFile::Write().
#define SECSINDAY 86400 |
Definition at line 41 of file tools.h.
Referenced by AssertFreeDiskSpace(), cSkinLCARSDisplayMenu::DrawTimer(), cTimer::Matches(), cMenuEditDateItem::ProcessKey(), and cMenuTimerItem::Set().
#define Utf8BufSize | ( | s | ) | ((s) * 4) |
Definition at line 131 of file tools.h.
Referenced by cEIT::cEIT(), and cSdtFilter::Process().
#define Utf8is | ( | ccls, | |
c | |||
) | (cCharSetConv::SystemCharacterTable() ? is##ccls(c) : isw##ccls(c)) |
Definition at line 137 of file tools.h.
Referenced by cMenuEditStrItem::AdvancePos(), and cMenuEditStrItem::ProcessKey().
#define Utf8to | ( | conv, | |
c | |||
) | (cCharSetConv::SystemCharacterTable() ? to##conv(c) : tow##conv(c)) |
Definition at line 136 of file tools.h.
Referenced by cMenuEditStrItem::ProcessKey().
cString AddDirectory | ( | const char * | DirName, |
const char * | FileName | ||
) |
Definition at line 301 of file tools.c.
References cString::sprintf().
Referenced by cLockFile::cLockFile(), cSVDRP::CmdGRAB(), cMenuRecordings::DirectoryName(), DirSizeMB(), GenerateIndex(), GetRecordingsSortMode(), HasRecordingsSortMode(), cDvbDevice::Initialize(), cPictureEntry::Load(), cThemes::Load(), cMarks::Load(), cFileNameList::Load(), main(), cPictureEntry::Path(), RemoveEmptyDirectories(), RemoveFileOrDir(), cRecordings::ScanVideoDir(), SetRecordingsSortMode(), and cRecordings::UpdateFileName().
double atod | ( | const char * | s | ) |
Converts the given string, which is a floating point number using a '.
' as the decimal point, to a double value, independent of the currently selected locale.
Definition at line 308 of file tools.c.
References DECIMAL_POINT_C.
Referenced by cSetup::Parse(), and cRecordingInfo::Read().
int BCD2INT | ( | int | x | ) |
Definition at line 45 of file tools.c.
References BCDCHARTOINT.
Referenced by cNitFilter::Process().
char* compactspace | ( | char * | s | ) |
Definition at line 188 of file tools.c.
References skipspace(), and stripspace().
Referenced by cEvent::FixEpgBugs(), cSetupLine::Parse(), cSdtFilter::Process(), and cRecordingInfo::Read().
|
inline |
Definition at line 569 of file tools.h.
Referenced by cStringList::Sort().
|
inline |
Definition at line 574 of file tools.h.
Referenced by cStringList::Sort().
|
inline |
Definition at line 60 of file tools.h.
Referenced by cReceiver::cReceiver(), cIndexFile::GetClosestIFrame(), GetRecordingsSortMode(), cDvbTuner::GetSignalQuality(), RgbShade(), cPixmap::SetAlpha(), cFont::SetFont(), cSkinSTTNGDisplayReplay::SetMode(), cSkinLCARSDisplayReplay::SetMode(), cOsd::SetOsdPosition(), cDevice::SetVolume(), and cDvbSubtitleConverter::yuv2rgb().
cString DateString | ( | time_t | t | ) |
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition at line 1097 of file tools.c.
References WeekDayName().
Referenced by cEvent::GetDateString(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), and cPluginSvdrpdemo::SVDRPCommand().
cString DayDateTime | ( | time_t | t = 0 | ) |
Converts the given time to a string of the form "www dd.mm. hh:mm".
If no time is given, the current time is taken.
Definition at line 1076 of file tools.c.
References WeekDayName().
Referenced by cMenuEditRecording::cMenuEditRecording(), cPictureControl::DisplayCaption(), cSkinLCARSDisplayChannel::DrawDate(), cSkinLCARSDisplayMenu::DrawDate(), cSkinLCARSDisplayReplay::DrawDate(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinClassicDisplayChannel::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinSTTNGDisplayMenu::Flush(), and cSkinSTTNGDisplayMenu::SetButtons().
|
inline |
Definition at line 48 of file tools.h.
Referenced by cCopyingThread::Action(), cDvbSubtitleConverter::Action(), cDevice::AttachPlayer(), cRecording::ClearSortName(), cSVDRP::Close(), cSVDRP::CmdPUTE(), cRecordControl::cRecordControl(), cPictureControl::DisplayCaption(), cSVDRP::Execute(), cDevice::MakePrimaryDevice(), cRecordControls::Process(), cPictureControl::ProcessKey(), cEvent::Read(), cDvbSubtitleConverter::Reset(), cDevice::SetChannel(), cDevice::SetCurrentSubtitleTrack(), cRecordControls::Shutdown(), cFileTransfer::Stop(), cRecordControl::Stop(), cOsdMenu::~cOsdMenu(), and cPictureMenu::~cPictureMenu().
bool DirectoryOk | ( | const char * | DirName, |
bool | LogErrors = false |
||
) |
Definition at line 378 of file tools.c.
References esyslog, and LOG_ERROR_STR.
Referenced by cLockFile::cLockFile(), CutRecording(), GenerateIndex(), main(), cVideoDirectory::Next(), and SpinUpDisk().
int DirSizeMB | ( | const char * | DirName | ) |
returns the total size of the files in the given directory, or -1 in case of an error
Definition at line 536 of file tools.c.
References AddDirectory(), DirSizeMB(), LOG_ERROR_STR, MEGABYTE, cReadDir::Next(), and cReadDir::Ok().
Referenced by cCopyingThread::Action(), cMenuEditRecording::cMenuEditRecording(), DirSizeMB(), and cRecording::FileSizeMB().
|
inline |
Definition at line 85 of file tools.h.
Referenced by cRecorder::Action(), cIndexFileGenerator::Action(), cDvbSubtitleBitmaps::Draw(), cMenuEditPrcItem::ProcessKey(), cMenuSetupOSD::ProcessKey(), and cOsdProvider::UpdateOsdSize().
cString dtoa | ( | double | d, |
const char * | Format = "%f" |
||
) |
Converts the given double value to a string, making sure it uses a '.
' as the decimal point, independent of the currently selected locale. If Format is given, it will be used instead of the default.
Definition at line 329 of file tools.c.
References DECIMAL_POINT_C, and strreplace().
Referenced by cSetup::Store(), and cRecordingInfo::Write().
bool endswith | ( | const char * | s, |
const char * | p | ||
) |
Definition at line 237 of file tools.c.
Referenced by cCopyingThread::cCopyingThread(), cRecording::Remove(), and cRecordings::ScanVideoDir().
bool EntriesOnSameFileSystem | ( | const char * | File1, |
const char * | File2 | ||
) |
Definition at line 346 of file tools.c.
References LOG_ERROR_STR.
Referenced by cCopyingThread::Action(), and IsOnVideoDirectoryFileSystem().
off_t FileSize | ( | const char * | FileName | ) |
returns the size of the given file, or -1 in case of an error (e.g. if the file doesn't exist)
Definition at line 628 of file tools.c.
Referenced by cIndexFileGenerator::Action(), and cIndexFile::cIndexFile().
int FreeDiskSpaceMB | ( | const char * | Directory, |
int * | UsedMB = NULL |
||
) |
Definition at line 361 of file tools.c.
References LOG_ERROR_STR.
Referenced by cCopyingThread::Action(), cVideoDirectory::FreeMB(), OpenVideoFile(), and cRecorder::RunningLowOnDiskSpace().
|
inline |
Definition at line 70 of file tools.h.
Referenced by cCiTransportConnection::HandleSessions(), cCiApplicationInformation::Process(), and cCiTransportConnection::ResourceIdToInt().
bool isempty | ( | const char * | s | ) |
Definition at line 248 of file tools.c.
References skipspace().
Referenced by cPluginManager::Active(), cMenuEditFolder::cMenuEditFolder(), cRecording::cRecording(), cTimer::cTimer(), cMenuFolder::Delete(), cMenuFolder::DescendPath(), cOsdMenu::Display(), cEvent::Dump(), cMenuCommands::Execute(), cTheme::FileNameOk(), cEvent::FixEpgBugs(), cSource::FromString(), tComponent::FromString(), cTheme::Load(), cConfig< cDiseqc >::Load(), cChannel::Name(), cNestedItemList::Parse(), cSkins::QueueMessage(), cMenuFolder::Select(), cMenuFolder::Set(), cComponents::SetComponent(), cRecordingInfo::SetData(), cSkinClassicDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cTimer::SetFile(), cMenuEditTimer::SetFolder(), cMenuEditRecording::SetFolder(), cChannel::SetName(), cChannel::SetPortalName(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cChannel::ShortName(), and cChannel::ToText().
bool isnumber | ( | const char * | s | ) |
Definition at line 263 of file tools.c.
Referenced by cSVDRP::CmdCHAN(), cSVDRP::CmdCLRE(), cSVDRP::CmdDELC(), cSVDRP::CmdDELR(), cSVDRP::CmdDELT(), cSVDRP::CmdEDIT(), cSVDRP::CmdGRAB(), cSVDRP::CmdLSTC(), cSVDRP::CmdLSTE(), cSVDRP::CmdLSTR(), cSVDRP::CmdLSTT(), cSVDRP::CmdPLAY(), cSVDRP::CmdVOLU(), main(), and cTimer::Parse().
cString itoa | ( | int | n | ) |
Definition at line 339 of file tools.c.
Referenced by cDisplaySubtitleTracks::cDisplaySubtitleTracks(), cDisplayTracks::cDisplayTracks(), cResumeFile::cResumeFile(), DrawDeviceData(), cSkinLCARSDisplayMenu::DrawDisk(), cSkinLCARSDisplayMenu::DrawLive(), cSkinLCARSDisplayMenu::DrawTimers(), cMenuTimerItem::Set(), and cTimer::ToText().
time_t LastModifiedTime | ( | const char * | FileName | ) |
Definition at line 620 of file tools.c.
Referenced by cRecording::FileSizeMB(), cRecordings::NeedsUpdate(), cRecording::NumFrames(), cMarks::Save(), and cMarks::Update().
bool MakeDirs | ( | const char * | FileName, |
bool | IsDirectory = false |
||
) |
Definition at line 396 of file tools.c.
References dsyslog, and LOG_ERROR_STR.
Referenced by cCopyingThread::Action(), cPlugin::CacheDirectory(), cPlugin::ConfigDirectory(), cRecordControl::cRecordControl(), OpenVideoFile(), cPlugin::ResourceDirectory(), cThemes::SetThemesDirectory(), and cCutter::Start().
|
inline |
Definition at line 55 of file tools.h.
Referenced by cMenuTimers::ActualiseDiskStatus(), cDvbSpuDecoder::CalcAreaSize(), cDvbSpuBitmap::cDvbSpuBitmap(), cEIT::cEIT(), cMenuSetupOSD::cMenuSetupOSD(), cRect::Combine(), cCharSetConv::Convert(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cOsdMenu::CursorDown(), cOsdMenu::CursorUp(), cOsdMenu::Display(), DrawDeviceData(), DrawDeviceSignal(), cBitmap::DrawEllipse(), cPixmapMemory::DrawEllipse(), cBitmap::DrawRectangle(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::DrawScrollbar(), cHdffOsd::DrawText(), cBitmap::DrawText(), cPixmapMemory::DrawText(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinClassicDisplayMenu::Flush(), cRect::Intersected(), cTimer::Matches(), cChannels::MaxChannelNameLength(), cChannels::MaxShortChannelNameLength(), cOsdMenu::PageDown(), cDevice::Priority(), cLineGame::ProcessKey(), cTrueColorDemo::ProcessKey(), cTsToPes::PutTs(), cUnbufferedFile::Read(), cDvbSubtitleAssembler::Realloc(), cOsd::SetAreas(), cSkinLCARSDisplayChannel::SetChannel(), cSkinLCARSDisplayReplay::SetCurrent(), cSkinLCARSDisplayReplay::SetTotal(), cDvbPlayer::SkipSeconds(), cCondWait::SleepMs(), strcpyrealloc(), cRecording::Title(), TsDump(), and cUnbufferedFile::Write().
|
inline |
Definition at line 54 of file tools.h.
Referenced by cTrueColorDemo::Action(), cDvbSpuDecoder::CalcAreaSize(), cDvbSpuBitmap::cDvbSpuBitmap(), cRect::Combine(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cOsdMenu::Display(), cBitmap::DrawRectangle(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayChannel::DrawSeen(), cSkinLCARSDisplayMenu::DrawSeen(), cSkinSTTNGDisplayChannel::Flush(), cNaluStreamProcessor::GetBuffer(), cFont::GetFont(), cTsToPes::GetPes(), cRect::Intersected(), cTimer::Matches(), cNitFilter::Process(), cLineGame::ProcessKey(), cTrueColorDemo::ProcessKey(), cUnbufferedFile::Read(), RgbShade(), cBitmap::Scaled(), cTextScroller::Set(), cDevice::SetOccupied(), cReplayControl::TimeSearchProcess(), TsDump(), cOsdProvider::UpdateOsdSize(), WeekDayName(), and cUnbufferedFile::Write().
|
inline |
Definition at line 76 of file tools.h.
Referenced by cCiTransportConnection::SendTag().
char* ReadLink | ( | const char * | FileName | ) |
returns a new string allocated on the heap, which the caller must delete (or NULL in case of an error)
Definition at line 568 of file tools.c.
References LOG_ERROR_STR.
Referenced by cSafeFile::cSafeFile().
bool RemoveEmptyDirectories | ( | const char * | DirName, |
bool | RemoveThis = false , |
||
const char * | IgnoreFiles[] = NULL |
||
) |
Removes all empty directories under the given directory DirName.
If RemoveThis is true, DirName will also be removed if it is empty. IgnoreFiles can be set to an array of file names that will be ignored when considering whether a directory is empty. If IgnoreFiles is given, the array must end with a NULL pointer.
Definition at line 482 of file tools.c.
References AddDirectory(), dsyslog, LOG_ERROR_STR, cReadDir::Next(), cReadDir::Ok(), RemoveEmptyDirectories(), and StrInArray().
Referenced by cCopyingThread::Action(), RemoveEmptyDirectories(), and RemoveEmptyVideoDirectories().
bool RemoveFileOrDir | ( | const char * | FileName, |
bool | FollowSymlinks = false |
||
) |
Definition at line 424 of file tools.c.
References AddDirectory(), dsyslog, LOG_ERROR_STR, MALLOC, cReadDir::Next(), and cReadDir::Ok().
Referenced by cCopyingThread::Action(), and RemoveVideoFile().
Converts the given Memory to a JPEG image and returns a pointer to the resulting image.
Mem must point to a data block of exactly (Width * Height) triplets of RGB image data bytes. Upon return, Size will hold the number of bytes of the resulting JPEG data. Quality can be in the range 0..100 and controls the quality of the resulting image, where 100 is "best". The caller takes ownership of the result and has to delete it once it is no longer needed. The result may be NULL in case of an error.
Definition at line 1182 of file tools.c.
References JpegCompressEmptyOutputBuffer(), JpegCompressInitDestination(), JpegCompressTermDestination(), tJpegCompressData::mem, and tJpegCompressData::size.
Referenced by cDvbSdFfDevice::GrabImage().
ssize_t safe_read | ( | int | filedes, |
void * | buffer, | ||
size_t | size | ||
) |
Definition at line 53 of file tools.c.
References dsyslog.
Referenced by cLircRemote::Action(), cIndexFile::CatchUp(), cIndexFile::cIndexFile(), cSVDRP::Process(), cDvbCiAdapter::Read(), cResumeFile::Read(), cRingBufferLinear::Read(), cUnbufferedFile::Read(), cDevice::ReadFilter(), cKbdRemote::ReadKey(), and cRcuRemote::ReceiveByte().
ssize_t safe_write | ( | int | filedes, |
const void * | buffer, | ||
size_t | size | ||
) |
Definition at line 65 of file tools.c.
References dsyslog.
Referenced by cSVDRP::CmdGRAB(), cDevice::GrabImageFile(), cResumeFile::Save(), cSVDRP::Send(), cDvbCiAdapter::Write(), cIndexFile::Write(), cUnbufferedFile::Write(), and writechar().
|
inline |
Definition at line 56 of file tools.h.
Referenced by cDevice::SwitchChannel().
cString ShortDateString | ( | time_t | t | ) |
Converts the given time to a string of the form "dd.mm.yy".
Definition at line 1108 of file tools.c.
Referenced by cSkinLCARSDisplayMenu::DrawPlay(), and cSkinLCARSDisplayReplay::SetRecording().
|
inline |
Definition at line 194 of file tools.h.
References cString::s.
Referenced by cPluginManager::AddPlugin(), cSVDRP::CmdCPYR(), cSVDRP::CmdMODC(), cSVDRP::CmdMODT(), cSVDRP::CmdMOVC(), cSVDRP::CmdMOVR(), cSVDRP::CmdPLAY(), cSVDRP::CmdPLUG(), compactspace(), cSVDRP::Execute(), cSatCableNumbers::FromString(), cDiseqc::GetCodes(), cOsdMenu::HotKey(), isempty(), cTheme::Load(), cDll::Load(), cBitmap::LoadXpm(), cMenuCommands::Parse(), cTimer::Parse(), cKey::Parse(), cEvent::Parse(), cChannel::Parse(), cNestedItemList::Parse(), cMark::Parse(), cTimer::ParseDay(), cSdtFilter::Process(), cResumeFile::Read(), cRecordingInfo::Read(), cEvent::Read(), cSchedule::Read(), and cBitmap::SetXpm().
bool SpinUpDisk | ( | const char * | FileName | ) |
Definition at line 582 of file tools.c.
References DirectoryOk(), dsyslog, esyslog, LOG_ERROR_STR, and cString::sprintf().
Referenced by cRecorder::cRecorder().
char* strcpyrealloc | ( | char * | dest, |
const char * | src | ||
) |
Definition at line 114 of file tools.c.
References esyslog, and max().
Referenced by cEvent::FixEpgBugs(), cChannel::operator=(), cChannel::Parse(), cMenuEditChannel::ProcessKey(), cComponents::SetComponent(), cEvent::SetDescription(), cChannel::SetName(), cChannel::SetPortalName(), cEvent::SetShortText(), and cEvent::SetTitle().
cString strescape | ( | const char * | s, |
const char * | chars | ||
) |
Definition at line 205 of file tools.c.
References MALLOC.
Referenced by cShutdownHandler::CallShutdownCommand(), cMenuRecordings::Commands(), and cRecordingUserCommand::InvokeCommand().
bool StrInArray | ( | const char * | a[], |
const char * | s | ||
) |
Returns true if the string s is equal to one of the strings pointed to by the (NULL terminated) array a.
Definition at line 289 of file tools.c.
Referenced by RemoveEmptyDirectories().
char* stripspace | ( | char * | s | ) |
Definition at line 176 of file tools.c.
Referenced by compactspace(), cMenuEditStrItem::LeaveEditMode(), cTheme::Load(), cDll::Load(), cConfig< cDiseqc >::Load(), cMenuCommands::Parse(), cNestedItemList::Parse(), cTextWrapper::Set(), and cRecording::Title().
char* strn0cpy | ( | char * | dest, |
const char * | src, | ||
size_t | n | ||
) |
Definition at line 131 of file tools.c.
Referenced by cEIT::cEIT(), cMenuEditChannel::cMenuEditChannel(), cMenuEditFolder::cMenuEditFolder(), cMenuSetupPictures::cMenuSetupPictures(), cRecordingInfo::cRecordingInfo(), cSkinLCARSDisplayChannel::DrawTrack(), cSkinLCARSDisplayReplay::DrawTrack(), cSkinSTTNGDisplayChannel::Flush(), cMenuCommands::Parse(), cTimer::Parse(), cChannel::Parse(), cSetup::Parse(), cSetup::ParseLanguages(), cPatPmtParser::ParsePmt(), cPatFilter::Process(), cPluginPictures::ProcessArgs(), cMenuSetupOSD::ProcessKey(), cDevice::SetAvailableTrack(), cComponents::SetComponent(), cMenuEditTimer::SetFolder(), cMenuEditRecording::SetFolder(), cSkinClassicDisplayReplay::SetMode(), cSkinCursesDisplayReplay::SetMode(), cChannel::SetPids(), cPluginPictures::SetupParse(), cMenuSetupPictures::Store(), cRecording::Title(), Utf8Strn0Cpy(), and WeekDayName().
char* strreplace | ( | char * | s, |
char | c1, | ||
char | c2 | ||
) |
Definition at line 139 of file tools.c.
Referenced by CopyString(), cRecording::cRecording(), cSetupLine::cSetupLine(), dtoa(), cEvent::Dump(), cEvent::FixEpgBugs(), cFont::GetAvailableFontNames(), cFont::GetFontFileName(), HandleUnderscores(), cTimer::Parse(), cEvent::Parse(), cChannel::Parse(), cRecording::SortName(), cTimer::ToText(), and cChannel::ToText().
char* strreplace | ( | char * | s, |
const char * | s1, | ||
const char * | s2 | ||
) |
int64_t StrToNum | ( | const char * | s | ) |
Converts the given string to a number.
The numerical part of the string may be followed by one of the letters K, M, G or T to abbreviate Kilo-, Mega-, Giga- or Terabyte, respectively (based on 1024). Everything after the first non-numeric character is silently ignored, as are any characters other than the ones mentioned here.
Definition at line 274 of file tools.c.
Referenced by main().
|
inline |
Definition at line 57 of file tools.h.
Referenced by cMarks::Sort().
void syslog_with_tid | ( | int | priority, |
const char * | format, | ||
... | |||
) |
cString TimeString | ( | time_t | t | ) |
Converts the given time to a string of the form "hh:mm".
Definition at line 1117 of file tools.c.
Referenced by cSkinLCARSDisplayMenu::DrawPlay(), cSkinLCARSDisplayMenu::DrawTimer(), cEvent::GetEndTimeString(), cEvent::GetTimeString(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), and cPluginSvdrpdemo::SVDRPCommand().
cString TimeToString | ( | time_t | t | ) |
Converts the given time to a string of the form "www mmm dd hh:mm:ss yyyy".
Definition at line 1087 of file tools.c.
Referenced by cSVDRP::CmdNEXT(), cTDT::cTDT(), cShutdownHandler::DoShutdown(), and cSVDRP::Process().
void TouchFile | ( | const char * | FileName | ) |
Definition at line 614 of file tools.c.
References LOG_ERROR_STR.
Referenced by cRecordings::TouchUpdate().
uint Utf8CharGet | ( | const char * | s, |
int | Length = 0 |
||
) |
Returns the UTF-8 symbol at the beginning of the given string.
Length can be given from a previous call to Utf8CharLen() to avoid calculating it again. If no Length is given, Utf8CharLen() will be called.
Definition at line 722 of file tools.c.
References cCharSetConv::SystemCharacterTable(), SystemToUtf8, and Utf8CharLen().
Referenced by cHdffOsd::DrawText(), cFreetypeFont::DrawText(), cTextWrapper::Set(), cCharSetConv::SetSystemCharacterTable(), Utf8ToArray(), and cFreetypeFont::Width().
int Utf8CharLen | ( | const char * | s | ) |
Returns the number of character bytes at the beginning of the given string that form a UTF-8 symbol.
Definition at line 708 of file tools.c.
References MT, and cCharSetConv::SystemCharacterTable().
Referenced by cCharSetConv::SetSystemCharacterTable(), Utf8CharGet(), Utf8StrLen(), Utf8Strn0Cpy(), Utf8SymChars(), and Utf8ToArray().
int Utf8CharSet | ( | uint | c, |
char * | s = NULL |
||
) |
Converts the given UTF-8 symbol to a sequence of character bytes and copies them to the given string.
Returns the number of bytes written. If no string is given, only the number of bytes is returned and nothing is copied.
Definition at line 737 of file tools.c.
References cCharSetConv::SystemCharacterTable().
Referenced by Utf8FromArray().
int Utf8FromArray | ( | const uint * | a, |
char * | s, | ||
int | Size, | ||
int | Max = -1 |
||
) |
Converts the given array of UTF-8 symbols (including the terminating 0) into a sequence of character bytes of at most Size length.
Returns the number of character bytes written (without the terminating 0). If Max is given, only that many symbols will be converted. The resulting string is always zero-terminated if Size is big enough.
Definition at line 833 of file tools.c.
References cCharSetConv::SystemCharacterTable(), and Utf8CharSet().
Referenced by cMenuEditStrItem::LeaveEditMode(), and cMenuEditStrItem::Set().
int Utf8StrLen | ( | const char * | s | ) |
Returns the number of UTF-8 symbols formed by the given string of character bytes.
Definition at line 784 of file tools.c.
References cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cSubtitleObject::DecodeCharacterString(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cChannels::MaxChannelNameLength(), cChannels::MaxShortChannelNameLength(), cSkinCursesDisplayReplay::SetCurrent(), cSkinCursesDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetRecording(), cSkinCursesDisplayReplay::SetTotal(), cSkinCursesDisplayVolume::SetVolume(), cSubtitleRegion::UpdateTextData(), and cCursesFont::Width().
char* Utf8Strn0Cpy | ( | char * | Dest, |
const char * | Src, | ||
int | n | ||
) |
Copies at most n character bytes from Src to Dest, making sure that the resulting copy ends with a complete UTF-8 symbol.
The copy is guaranteed to be zero terminated. Returns a pointer to Dest.
Definition at line 796 of file tools.c.
References strn0cpy(), cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cMenuEditRecording::cMenuEditRecording(), cTimer::cTimer(), cSubtitleObject::DecodeCharacterString(), cTimer::Parse(), cSetup::Parse(), cMenuSetupOSD::ProcessKey(), cDevice::SetAvailableTrack(), and cTimer::SetFile().
int Utf8SymChars | ( | const char * | s, |
int | Symbols | ||
) |
Returns the number of character bytes at the beginning of the given string that form at most the given number of UTF-8 symbols.
Definition at line 771 of file tools.c.
References cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cMenuScheduleItem::Update(), and WeekDayName().
int Utf8ToArray | ( | const char * | s, |
uint * | a, | ||
int | Size | ||
) |
Converts the given character bytes (including the terminating 0) into an array of UTF-8 symbols of the given Size.
Returns the number of symbols in the array (without the terminating 0).
Definition at line 815 of file tools.c.
References cCharSetConv::SystemCharacterTable(), Utf8CharGet(), and Utf8CharLen().
Referenced by cMenuEditStrItem::EnterEditMode().
cString WeekDayName | ( | int | WeekDay | ) |
Converts the given WeekDay (0=Sunday, 1=Monday, ...) to a three letter day name.
Definition at line 1034 of file tools.c.
References min(), strn0cpy(), tr, and Utf8SymChars().
Referenced by DateString(), DayDateTime(), cSkinLCARSDisplayMenu::DrawTimer(), cMenuEditDateItem::Set(), cMenuTimerItem::Set(), and WeekDayName().
cString WeekDayName | ( | time_t | t | ) |
Converts the week day of the given time to a three letter day name.
Definition at line 1049 of file tools.c.
References WeekDayName().
cString WeekDayNameFull | ( | int | WeekDay | ) |
Converts the given WeekDay (0=Sunday, 1=Monday, ...) to a full day name.
Definition at line 1055 of file tools.c.
References tr.
Referenced by WeekDayNameFull().
cString WeekDayNameFull | ( | time_t | t | ) |
Converts the week day of the given time to a full day name.
Definition at line 1070 of file tools.c.
References WeekDayNameFull().
int WriteAllOrNothing | ( | int | fd, |
const uchar * | Data, | ||
int | Length, | ||
int | TimeoutMs = 0 , |
||
int | RetryMs = 0 |
||
) |
Writes either all Data to the given file descriptor, or nothing at all.
If TimeoutMs is greater than 0, it will only retry for that long, otherwise it will retry forever. RetryMs defines the time between two retries.
Definition at line 90 of file tools.c.
References cTimeMs::Elapsed(), FATALERRNO, and cPoller::Poll().
Referenced by cDvbSdFfDevice::PlayAudio(), cDvbHdFfDevice::PlayAudio(), cDvbSdFfDevice::PlayTsAudio(), cDvbHdFfDevice::PlayTsAudio(), cDvbSdFfDevice::PlayTsVideo(), cDvbHdFfDevice::PlayTsVideo(), cDvbSdFfDevice::PlayVideo(), and cDvbHdFfDevice::PlayVideo().
void writechar | ( | int | filedes, |
char | c | ||
) |
Definition at line 85 of file tools.c.
References safe_write().
Referenced by cIndexFile::cIndexFile().