vdr 2.7.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>
#include "thread.h"
Go to the source code of this file.
Classes | |
class | cCharSetConv |
class | cString |
class | cNullTerminate |
class | cBase64Encoder |
class | cBitStream |
class | cTimeMs |
class | cReadLine |
class | cPoller |
class | cReadDir |
class | cFile |
class | cSafeFile |
class | cUnbufferedFile |
class | cLockFile |
class | cListObject |
class | cListGarbageCollector |
class | cListBase |
class | cList< T > |
class | cVector< T > |
class | cStringList |
class | cFileNameList |
class | cDynamicBuffer |
class | cHashObject |
class | cHashBase |
class | cHash< T > |
Macros | |
#define | esyslog(a...) |
#define | isyslog(a...) |
#define | dsyslog(a...) |
#define | LOG_ERROR esyslog("ERROR (%s,%d): %m", __FILE__, __LINE__) |
#define | LOG_ERROR_STR(s) |
#define | SECSINDAY 86400 |
#define | KILOBYTE(n) |
#define | MEGABYTE(n) |
#define | MALLOC(type, size) |
#define | CHECK(s) |
#define | FATALERRNO (errno && errno != EAGAIN && errno != EINTR) |
#define | BCDCHARTOINT(x) |
#define | IsBitSet(v, b) |
#define | Utf8BufSize(s) |
#define | Utf8to(conv, c) |
#define | Utf8is(ccls, c) |
#define | DEF_LIST_LOCK2(Class, Name) |
#define | DEF_LIST_LOCK(Class) |
#define | USE_LIST_LOCK_READ2(Class, Name) |
#define | USE_LIST_LOCK_READ(Class) |
#define | USE_LIST_LOCK_WRITE2(Class, Name) |
#define | USE_LIST_LOCK_WRITE(Class) |
#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> | |
void | swap (T &a, T &b) |
template<class T> | |
int | sgn (T a) |
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) |
const char * | strchrn (const char *s, char c, size_t n) |
int | strcountchr (const char *s, char c) |
cString | strgetbefore (const char *s, char c, int n=1) |
const char * | strgetlast (const char *s, char c) |
char * | strgetlast (char *s, char c) |
char * | skipspace (const char *s) |
char * | stripspace (char *s) |
char * | compactspace (char *s) |
char * | compactchars (char *s, char c) |
cString | strescape (const char *s, const char *chars) |
cString | strgetval (const char *s, const char *name, char d='=') |
char * | strshift (char *s, int n) |
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) |
uint16_t | Peek13 (const uchar *p) |
void | Poke13 (uchar *p, uint16_t v) |
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, bool Create=false) |
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) |
const char * | GetHostName (void) |
int | CompareInts (const void *a, const void *b) |
int | CompareStrings (const void *a, const void *b) |
int | CompareStringsIgnoreCase (const void *a, const void *b) |
int | CompareStringsNumerically (const void *a, const void *b) |
Variables | |
int | SysLogLevel |
cListGarbageCollector | ListGarbageCollector |
#define BCDCHARTOINT | ( | x | ) |
#define CHECK | ( | s | ) |
Definition at line 51 of file tools.h.
Referenced by cDvbHdFfDevice::Clear(), cDvbSdFfDevice::Clear(), cDvbTuner::ExecuteDiseqc(), cDvbSdFfDevice::Freeze(), cDvbSdFfDevice::GetAudioChannelDevice(), cDvbSdFfDevice::Mute(), cDvbSdFfDevice::Play(), cDvbTuner::ResetToneAndVoltage(), cDiseqcPositioner::SendDiseqc(), cDvbSdFfDevice::SetAudioChannelDevice(), cDvbSdFfDevice::SetChannelDevice(), cDvbTuner::SetFrontend(), cDvbDevice::SetPid(), cDvbHdFfDevice::SetPid(), cDvbSdFfDevice::SetPid(), cDvbSdFfDevice::SetPlayMode(), cDvbSdFfDevice::SetVideoDisplayFormat(), cDvbSdFfDevice::SetVideoFormat(), cDvbSdFfDevice::SetVolumeDevice(), cDvbSdFfDevice::StillPicture(), cDvbSdFfDevice::TrickSpeed(), and cDvbSdFfDevice::TurnOffLiveMode().
#define DEF_LIST_LOCK | ( | Class | ) |
#define DEF_LIST_LOCK2 | ( | Class, | |
Name ) |
#define dsyslog | ( | a... | ) |
Definition at line 37 of file tools.h.
Referenced by cDevice::Action(), cDirCopier::Action(), cSectionHandler::Action(), cIoThrottle::Activate(), cRecordingsHandler::Add(), cCaDescriptors::AddCaDescriptor(), cReceiver::AddPid(), cFrameDetector::Analyze(), cCamSlot::Assign(), cDevice::AttachReceiver(), cBackTrace::BackTrace(), cDvbDevice::Bond(), cDvbTuner::Bond(), cCamSlot::CanDecrypt(), cDevice::cDevice(), cDvbSdFfDevice::cDvbSdFfDevice(), cEIT::cEIT(), cRecording::ChangeName(), cRecording::ChangePriorityLifetime(), cStatusTest::ChannelSwitch(), cShutdownHandler::CheckManualStart(), cSVDRPServer::CmdGRAB(), cRecordControl::cRecordControl(), cSourceParam::cSourceParam(), cSVDRPClient::cSVDRPClient(), cSVDRPServer::cSVDRPServer(), cIndexFile::Delete(), cChannels::DeleteDuplicateChannels(), cSocket::Discover(), cShutdownHandler::DoShutdown(), cDvbSpuDecoder::Draw(), cStateLockLog::Dump(), cDevice::EnsureAudioTrack(), cMenuCommands::Execute(), cTimer::Expired(), cRecording::FileName(), cDiseqcs::Get(), cDvbTuner::GetBondedMaster(), cRecordControl::GetEvent(), cCamResponses::GetMatch(), cMtdHandler::GetMtdCamSlot(), cPositioner::GotoAngle(), cPositioner::GotoPosition(), cDvbHdFfDevice::GrabImage(), cDvbSdFfDevice::GrabImage(), I18nInitialize(), I18nSetLocale(), cDvbDevice::Initialize(), cCamSlot::KeepSharedCaPids(), cInterface::LearnKeys(), cChannelCamRelations::Load(), cStateLock::Lock(), main(), MakeDirs(), cTimer::Matches(), cMenuSetupCAM::Menu(), cSkins::Message(), cVideoDirectory::Move(), cRecordings::MoveRecordings(), cCamSlot::MtdActivate(), cChannels::NewChannel(), cTimeMs::Now(), cFileName::Open(), cDvbDevice::OpenFilter(), cStatusTest::OsdChannel(), cStatusTest::OsdClear(), cStatusTest::OsdCurrentItem(), cStatusTest::OsdHelpKeys(), cStatusTest::OsdItem(), cStatusTest::OsdProgramme(), cStatusTest::OsdStatusMessage(), cStatusTest::OsdTextItem(), cStatusTest::OsdTitle(), cMpeg2Parser::Parse(), cH264Parser::ParseSequenceParameterSet(), cH265Parser::ParseSequenceParameterSet(), cDevice::PlayPesPacket(), cDvbDevice::Probe(), cDvbHdFfDeviceProbe::Probe(), cDvbSdFfDeviceProbe::Probe(), cCiConditionalAccessSupport::Process(), cCiMMI::Process(), cEITScanner::Process(), cSdtFilter::Process(), cSVDRPClient::Process(), cSkins::ProcessQueuedMessages(), cDvbTuner::ProvidesFrontend(), cInterface::QueryKeys(), cSkins::QueueMessage(), cSchedules::Read(), cCaActivationReceiver::Receive(), cCaPidReceiver::Receive(), cStatusTest::Recording(), cIoThrottle::Release(), RemoveEmptyDirectories(), RemoveFileOrDir(), cVideoDirectory::Rename(), cStatusTest::Replaying(), ReportEpgBugFixStats(), cShutdownHandler::RequestEmergencyExit(), cRecorder::RunningLowOnDiskSpace(), safe_read(), safe_write(), cChannelCamRelations::Save(), cVideoDirectoryScannerThread::ScanVideoDir(), cMenuCam::Select(), cSocket::SendDgram(), cMenuCam::Set(), cStatusTest::SetAudioChannel(), cStatusTest::SetAudioTrack(), cRemux::SetBrokenLink(), cChannel::SetCaDescriptors(), cChannel::SetCaIds(), cChannel::SetId(), cChannel::SetLcn(), cChannel::SetLinkChannels(), cChannel::SetName(), cFileName::SetOffset(), cChannel::SetPids(), cChannel::SetPortalName(), cDvbTuner::SetPowerSaveMode(), SetRecordingTimerId(), cChannel::SetSource(), cStatusTest::SetSubtitleTrack(), cChannel::SetTransponderData(), cStatusTest::SetVolume(), SignalToSQI(), SpinUpDisk(), cRecordControls::Start(), cCamSlot::StartActivation(), cThread::StartThread(), cTsPayload::Statistics(), cDevice::SwitchChannel(), cCuttingThread::Throttled(), cDirCopier::Throttled(), cStatusTest::TimerChange(), cTimer::TriggerRespawn(), cDvbDevice::UnBond(), cDvbTuner::UnBond(), cOsdProvider::UpdateOsdSize(), cRingBuffer::UpdatePercentage(), cCamSlots::WaitForAllCamSlotsReady(), cMtdHandler::~cMtdHandler(), cRingBuffer::~cRingBuffer(), cSVDRPClient::~cSVDRPClient(), and cSVDRPServer::~cSVDRPServer().
#define esyslog | ( | a... | ) |
Definition at line 35 of file tools.h.
Referenced by cCuttingThread::Action(), cDirCopier::Action(), cDvbPlayer::Action(), cDvbTuner::Action(), cLircUsrRemote::Action(), cRecorder::Action(), cTSBuffer::Action(), cPoller::Add(), cRecordingsHandler::Add(), cCiCaPmt::AddCaDescriptors(), cCiAdapter::AddCamSlot(), cDevice::AddPid(), cPluginManager::AddPlugin(), cDoneRecordings::Append(), cString::Append(), cString::Append(), cDevice::AttachReceiver(), cDvbPlayer::Backward(), cDvbDevice::Bond(), cDvbTuner::Bond(), cDvbDevice::BondDevices(), cPlugin::CacheDirectory(), cShutdownHandler::CallShutdownCommand(), cThread::Cancel(), cIndexFile::CatchUp(), cCuttingThread::cCuttingThread(), cDevice::cDevice(), cDvbCiAdapter::cDvbCiAdapter(), cDvbPlayer::cDvbPlayer(), cDvbSdFfOsd::cDvbSdFfOsd(), cFileName::cFileName(), cFrame::cFrame(), cFreetypeFont::cFreetypeFont(), cRecording::ChangeName(), cStateLockLog::Check(), cIndexFile::cIndexFile(), cDvbFrontend::Close(), cCiTransportConnection::CloseSession(), cPlugin::ConfigDirectory(), cCharSetConv::Convert(), cPixmap::cPixmap(), cRecorder::cRecorder(), cRecording::cRecording(), cResumeFile::cResumeFile(), cRingBufferLinear::cRingBufferLinear(), cSourceParam::cSourceParam(), cSVDRPClient::cSVDRPClient(), cTDT::cTDT(), cTPDU::cTPDU(), cRingBufferLinear::Del(), cOsd::DestroyPixmap(), DirectoryOk(), cRingBufferFrame::Drop(), cSchedule::Dump(), ExchangeChars(), cDiseqc::Execute(), cMenuCommands::Execute(), cDvbTuner::ExecuteDiseqc(), cTheme::FileNameOk(), cMpeg2Fixer::FindHeader(), cDvbPlayer::Forward(), cSatCableNumbers::FromString(), cSource::FromString(), cDiseqcs::Get(), cTSBuffer::Get(), GetClippedNumProvidedSystems(), cDiseqc::GetCodes(), cFont::GetFont(), cFont::GetFontFileName(), cSubtitleClut::GetPalette(), cDiseqc::GetPosition(), cSVDRPClient::GetRemoteTimers(), GetRequiredDeliverySystem(), cDiseqc::GetScrBank(), cDvbTuner::GetSignalQuality(), cDvbTuner::GetSignalStats(), cDvbTuner::GetSignalStrength(), cDvbHdFfDevice::GetSTC(), cDvbSdFfDevice::GetSTC(), cCiMMI::GetText(), cFreetypeFont::Glyph(), cDvbHdFfDevice::GrabImage(), cDvbSdFfDevice::GrabImage(), cSVDRPClientHandler::HandleClientConnection(), cRecorder::HandleErrors(), cCiTransportConnection::HandleSessions(), I18nInitialize(), JpegCompressEmptyOutputBuffer(), JpegCompressEmptyOutputBuffer(), JpegCompressTermDestination(), JpegCompressTermDestination(), cInterface::LearnKeys(), cConfig< T >::Load(), cDll::Load(), cSetup::Load(), cTheme::Load(), cThemes::Load(), cBitmap::LoadXpm(), cListBase::Lock(), cLockFile::Lock(), cStateLock::Lock(), main(), cMtdMapper::MakeUniqPid(), cTimer::Matches(), cSkins::Message(), cDvbCiAdapter::ModuleStatus(), MtdMapCaDescriptor(), cCamSlot::NewConnection(), cOsdProvider::NewOsd(), cDevice::NextCardIndex(), cTimeMs::Now(), cFile::Open(), cFile::Open(), cDvbDevice::OpenFilter(), cCiTransportConnection::OpenSession(), cChannel::Parse(), cDiseqc::Parse(), cDvbTransponderParameters::Parse(), cEvent::Parse(), cKeyMacro::Parse(), cScr::Parse(), cTimer::Parse(), ParseDeviceNumbers(), cDvbTransponderParameters::ParseParameter(), cPatPmtParser::ParsePat(), cPatPmtParser::ParsePmt(), cExternalAudio::Play(), cDevice::PlayPes(), cPlayer::PlayPes(), cDevice::PlayPesPacket(), cDevice::PlayTs(), cExternalAudio::PlayTs(), cCamSlot::Process(), cCiApplicationInformation::Process(), cCiConditionalAccessSupport::Process(), cCiDateTime::Process(), cCiHostControl::Process(), cCiMMI::Process(), cCiResourceManager::Process(), cCiTransportConnection::Process(), cSVDRPClient::Process(), cSVDRPServer::Process(), cSVDRPClientHandler::ProcessConnections(), cMtdHandler::Put(), cKeys::PutSetup(), cTsToPes::PutTs(), cDvbFrontend::QueryDeliverySystems(), cDvbCiAdapter::Read(), cEvent::Read(), cRecordingInfo::Read(), cRecordingInfo::Read(), cSchedule::Read(), cArgs::ReadDirectory(), ReadFrame(), cComponents::Realloc(), cDvbSubtitleAssembler::Realloc(), cDynamicBuffer::Realloc(), cVector< T >::Realloc(), cCaPidReceiver::Receive(), cTransfer::Receive(), cVideoDirectory::Register(), cRecording::Remove(), cStateKey::Remove(), cSVDRPServer::Reply(), cRingBuffer::ReportOverflow(), cShutdownHandler::RequestEmergencyExit(), cDvbCiAdapter::Reset(), cPlugin::ResourceDirectory(), cCiSession::SendData(), cMenuSchedule::Set(), cOsd::SetAreas(), cDevice::SetAvailableTrack(), cDvbHdFfDevice::SetChannelDevice(), cDvbSdFfDevice::SetChannelDevice(), cSubtitleClut::SetColor(), cSkins::SetCurrent(), cStateLock::SetExplicitModify(), cDvbTuner::SetFrontend(), cPixmap::SetLayer(), cThread::SetMainThreadId(), cStateLock::SetModified(), cFileName::SetOffset(), cFrameDetector::SetPid(), cDvbSdFfDevice::SetPlayMode(), cDevice::SetPrimaryDevice(), cDiseqc::SetScrFrequency(), cBitmap::SetSize(), cStateLock::SetSyncStateKey(), cDvbSpuDecoder::setTime(), cChannel::SetTransponderData(), cDevice::SetVideoDisplayFormat(), cDvbSdFfDevice::SetVideoDisplayFormat(), cBitmap::SetXpm(), SkipQuote(), SpinUpDisk(), cString::sprintf(), cRecordControls::Start(), cThread::StartThread(), cStateKey::StateChanged(), cDevice::StillPicture(), cCutter::Stop(), cTimers::StoreRemoteTimers(), strcpyrealloc(), strreplace(), cOsdProvider::SupportsTrueColor(), cDevice::SwitchChannel(), cChannel::Transponder(), TsSync(), cRecording::Undelete(), cStateLock::Unlock(), cString::vsprintf(), cDiseqc::Wait(), Watchdog(), cDvbCiAdapter::Write(), cListGarbageCollector::~cListGarbageCollector(), cReceiver::~cReceiver(), and cStateKey::~cStateKey().
#define FATALERRNO (errno && errno != EAGAIN && errno != EINTR) |
Definition at line 52 of file tools.h.
Referenced by cSocket::Accept(), cDvbPlayer::Action(), cNonBlockingFileReader::Action(), cTSBuffer::Action(), cSocket::Discover(), and WriteAllOrNothing().
#define HASHSIZE 512 |
Definition at line 914 of file tools.h.
Referenced by cEitTablesHash::cEitTablesHash(), and cHash< T >::cHash().
#define IsBitSet | ( | v, | |
b ) |
Definition at line 77 of file tools.h.
Referenced by cDiseqcs::Get(), and cScrs::GetUnused().
#define isyslog | ( | a... | ) |
Definition at line 36 of file tools.h.
Referenced by cSocket::Accept(), cDirCopier::Action(), cDvbPlayer::Action(), cDvbTuner::Action(), cIndexFileGenerator::Action(), cLircUsrRemote::Action(), cTimer::AdjustSpawnedTimer(), AssertFreeDiskSpace(), cShutdownHandler::CallShutdownCommand(), cDvbCiAdapter::cDvbCiAdapter(), cDvbPlayer::cDvbPlayer(), cRecordControls::ChannelDataModified(), cIndexFile::cIndexFile(), cSVDRPServer::Close(), cSVDRPServer::CmdDELC(), cSVDRPServer::CmdDELR(), cSVDRPServer::CmdDELT(), cSVDRPServer::CmdMESG(), cSVDRPServer::CmdMODC(), cSVDRPServer::CmdMODT(), cSVDRPServer::CmdMOVC(), cSVDRPServer::CmdNEWC(), cSVDRPServer::CmdNEWT(), cSVDRPServer::CmdUPDT(), cInterface::Confirm(), cSocket::Connect(), cRcuRemote::cRcuRemote(), cRecordControl::cRecordControl(), cTDT::cTDT(), cMenuChannels::Delete(), cRecording::Delete(), cTimers::DeleteExpired(), cSocket::Discover(), cDevice::GrabImageFile(), HandleRemoteTimerModifications(), cDvbDevice::Initialize(), cRcuRemote::Initialize(), cPluginManager::InitializePlugins(), cRecordingUserCommand::InvokeCommand(), cSocket::Listen(), cConfig< T >::Load(), cDll::Load(), cDoneRecordings::Load(), cNestedItemList::Load(), cTheme::Load(), main(), cSkins::Message(), cMenuChannels::Move(), cOsdProvider::NewOsd(), cMenuTimers::OnOff(), cCamSlot::Process(), cCiApplicationInformation::Process(), cSVDRPClient::Process(), cSVDRPServer::Process(), cMenuEditChannel::ProcessKey(), cDvbFrontend::QueryDeliverySystems(), cRecording::Remove(), cSetup::Save(), cVideoDirectoryScannerThread::ScanVideoDir(), cSkins::SetCurrent(), cTimer::SetDeferred(), cTimer::SetEvent(), cTimer::SetInVpsMargin(), cDevice::SetPrimaryDevice(), cTimer::SetRecording(), cEvent::SetRunningStatus(), cPluginManager::Shutdown(), cTimer::SpawnPatternTimer(), cRecordControls::Start(), cPluginManager::StartPlugins(), cCutter::Stop(), cPluginDvbhddevice::Stop(), cRecordControl::Stop(), cRecordControls::Stop(), cReplayControl::Stop(), cPluginManager::StopPlugins(), cDevice::SwitchChannel(), TimerStillRecording(), TouchFile(), and cRecording::Undelete().
#define KILOBYTE | ( | n | ) |
Definition at line 44 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 39 of file tools.h.
Referenced by cSocket::Accept(), cDvbPlayer::Action(), cNonBlockingFileReader::Action(), cTSBuffer::Action(), cThread::Active(), cIndexFile::cIndexFile(), cPipe::Close(), cSocket::Connect(), cPUTEhandler::cPUTEhandler(), cSocket::Discover(), cSchedules::Dump(), GetHostName(), cDvbSdFfDevice::GetOsdSize(), cDvbHdFfDevice::GetVideoSize(), cDvbSdFfDevice::GetVideoSize(), cSocket::Listen(), cExternalAudio::Play(), cExternalAudio::PlayTs(), cDvbFrontend::QueryDeliverySystems(), cSchedules::Read(), ReadFrame(), cRcuRemote::ReceiveByte(), cSVDRPClient::Send(), cSVDRPServer::Send(), cRcuRemote::SendByteHandshake(), cSocket::SendDgram(), cThread::SetIOPriority(), cDvbDevice::SetPid(), cDvbHdFfDevice::SetPid(), cDvbSdFfDevice::SetPid(), cThread::SetPriority(), and cThread::Start().
#define LOG_ERROR_STR | ( | s | ) |
Definition at line 40 of file tools.h.
Referenced by cRecorder::Action(), cIndexFile::CatchUp(), cIndexFile::cIndexFile(), cFileName::Close(), cSafeFile::Close(), cSVDRPServer::CmdGRAB(), HDFF::cHdffCmdIf::CmdOsdCreateDisplay(), HDFF::cHdffCmdIf::CmdOsdCreateFont(), HDFF::cHdffCmdIf::CmdOsdCreateFontFace(), HDFF::cHdffCmdIf::CmdOsdCreatePalette(), cLircDevRemote::Connect(), cLircUsrRemote::Connect(), cRcuRemote::cRcuRemote(), cRecording::cRecording(), cResumeFile::Delete(), cMarks::DeleteMarksFile(), DirectoryOk(), DirSizeMB(), DvbOpen(), EntriesOnSameFileSystem(), cDvbDevice::Exists(), FreeDiskSpaceMB(), cDvbSdFfDevice::GrabImage(), cDevice::GrabImageFile(), cChannelCamRelations::Load(), cConfig< T >::Load(), cDoneRecordings::Load(), cFileNameList::Load(), cNestedItemList::Load(), cPictureEntry::Load(), cTheme::Load(), cLockFile::Lock(), MakeDirs(), cVideoDirectory::Move(), cFileName::Open(), cPipe::Open(), cSafeFile::Open(), cRecordingInfo::Read(), cResumeFile::Read(), cKbdRemote::ReadKey(), ReadLink(), RemoveEmptyDirectories(), RemoveFileOrDir(), cVideoDirectory::Rename(), cChannelCamRelations::Save(), cResumeFile::Save(), cFileName::SetOffset(), cPicturePlayer::SetPicture(), SetRecordingTimerId(), SpinUpDisk(), cDevice::StillPicture(), SystemExec(), TouchFile(), cIndexFile::Write(), cRecordingInfo::Write(), cRecording::WriteInfo(), and cSubtitleDebug::WriteJpeg().
#define MALLOC | ( | type, | |
size ) |
Definition at line 47 of file tools.h.
Referenced by cDirCopier::Action(), cBase64Encoder::cBase64Encoder(), cCaDescriptor::cCaDescriptor(), cFileName::cFileName(), cFrame::cFrame(), cGlyph::cGlyph(), cHeapBuffer::cHeapBuffer(), cImage::cImage(), cImage::cImage(), cIndexFile::cIndexFile(), CopyString(), cPicturePlayer::cPicturePlayer(), cPixmapMemory::cPixmapMemory(), cRecording::cRecording(), cResumeFile::cResumeFile(), cRingBufferLinear::cRingBufferLinear(), cSafeFile::cSafeFile(), cSatCableNumbers::cSatCableNumbers(), cString::cString(), cSVDRPClient::cSVDRPClient(), cSVDRPServer::cSVDRPServer(), cDvbSdFfDevice::GrabImage(), JpegCompressInitDestination(), JpegCompressInitDestination(), cBitmap::LoadXpm(), cSubtitleObject::Parse(), cTimer::Parse(), cSubtitleObject::ParsePgs(), cSVDRPServer::Process(), RemoveFileOrDir(), cNonBlockingFileReader::Request(), cMenuCam::Set(), cTextWrapper::Set(), cBitmap::SetSize(), cListBase::Sort(), cRecording::SortName(), cDvbHdFfDevice::StillPicture(), cDvbSdFfDevice::StillPicture(), strescape(), and cRecording::Title().
#define MEGABYTE | ( | n | ) |
Definition at line 45 of file tools.h.
Referenced by cCuttingThread::cCuttingThread(), DirSizeMB(), cCuttingThread::LoadFrame(), main(), cRecorder::NextFile(), and cUnbufferedFile::Write().
#define SECSINDAY 86400 |
Definition at line 42 of file tools.h.
Referenced by AssertFreeDiskSpace(), cSkinLCARSDisplayMenu::DrawTimer(), cTimer::Matches(), cMenuEditDateItem::ProcessKey(), and cMenuTimerItem::Set().
#define USE_LIST_LOCK_READ | ( | Class | ) |
#define USE_LIST_LOCK_READ2 | ( | Class, | |
Name ) |
#define USE_LIST_LOCK_WRITE | ( | Class | ) |
#define USE_LIST_LOCK_WRITE2 | ( | Class, | |
Name ) |
#define Utf8BufSize | ( | s | ) |
Definition at line 143 of file tools.h.
Referenced by cEIT::cEIT(), and cSdtFilter::Process().
#define Utf8is | ( | ccls, | |
c ) |
Definition at line 149 of file tools.h.
Referenced by cMenuEditStrItem::AdvancePos(), and cMenuEditStrItem::ProcessKey().
#define Utf8to | ( | conv, | |
c ) |
Definition at line 148 of file tools.h.
Referenced by cMenuEditStrItem::ProcessKey().
cString AddDirectory | ( | const char * | DirName, |
const char * | FileName ) |
Definition at line 410 of file tools.c.
References cString::sprintf().
Referenced by cDirCopier::Action(), cLockFile::cLockFile(), cSVDRPServer::CmdGRAB(), cMenuRecordings::DirectoryName(), DirSizeMB(), GenerateIndex(), GetRecordingsSortMode(), GetRecordingTimerId(), HasRecordingsSortMode(), cDvbDevice::Initialize(), cFileNameList::Load(), cMarks::Load(), cPictureEntry::Load(), cThemes::Load(), main(), cMarks::MarksFileName(), cPictureEntry::Path(), cArgs::ReadDirectory(), RemoveEmptyDirectories(), RemoveFileOrDir(), cVideoDirectoryScannerThread::ScanVideoDir(), SetRecordingsSortMode(), SetRecordingTimerId(), StillRecording(), 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 419 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 * compactchars | ( | char * | s, |
char | c ) |
removes all occurrences of 'c' from the beginning an end of 's' and replaces sequences of multiple 'c's with a single 'c'.
Definition at line 256 of file tools.c.
Referenced by cString::CompactChars().
char * compactspace | ( | char * | s | ) |
Definition at line 239 of file tools.c.
References skipspace(), and stripspace().
Referenced by cEvent::FixEpgBugs(), cSetupLine::Parse(), cSdtFilter::Process(), and cRecordingInfo::Read().
|
inline |
Definition at line 817 of file tools.h.
Referenced by cMenuSetupCAMItem::Changed().
|
inline |
Definition at line 822 of file tools.h.
Referenced by CompareStringsNumerically(), and cStringList::Sort().
|
inline |
Definition at line 827 of file tools.h.
Referenced by cStringList::Sort().
|
inline |
Definition at line 832 of file tools.h.
References CompareStrings().
Referenced by cStringList::SortNumerically().
|
inline |
Definition at line 70 of file tools.h.
Referenced by DrawDevicePosition(), cIndexFile::GetClosestIFrame(), GetRecordingsSortMode(), cDvbTuner::GetSignalQuality(), RgbShade(), cPixmap::SetAlpha(), cFont::SetFont(), cSkinLCARSDisplayReplay::SetMode(), cSkinSTTNGDisplayReplay::SetMode(), cOsd::SetOsdPosition(), cReceiver::SetPriority(), cDevice::SetVolume(), and cSubtitleClut::yuv2rgb().
cString DateString | ( | time_t | t | ) |
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition at line 1281 of file tools.c.
References WeekDayName().
Referenced by cEvent::GetDateString(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::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 1260 of file tools.c.
References WeekDayName().
Referenced by cPictureControl::DisplayCaption(), cSkinLCARSDisplayChannel::DrawDate(), cSkinLCARSDisplayMenu::DrawDate(), cSkinLCARSDisplayReplay::DrawDate(), cSkinLCARSDisplayMenu::DrawTimer(), cStateLockLog::Dump(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), and cSkinSTTNGDisplayMenu::SetButtons().
|
inline |
Definition at line 49 of file tools.h.
Referenced by cDvbSubtitleConverter::Action(), cDevice::AttachPlayer(), cSVDRPServer::Close(), cSVDRPServer::CmdPUTE(), cRecordControl::cRecordControl(), cPictureControl::DisplayCaption(), cSVDRPServer::Execute(), cDevice::MakePrimaryDevice(), cRecordControls::Process(), cPictureControl::ProcessKey(), cEvent::Read(), cDvbSubtitleConverter::Reset(), cDevice::SetChannel(), cDevice::SetCurrentSubtitleTrack(), cDvbSubtitleConverter::SetVisible(), cRecordControls::Shutdown(), cRecordControl::Stop(), cRecordControls::Stop(), cOsdMenu::~cOsdMenu(), and cPictureMenu::~cPictureMenu().
bool DirectoryOk | ( | const char * | DirName, |
bool | LogErrors = false ) |
Definition at line 489 of file tools.c.
References esyslog, and LOG_ERROR_STR.
Referenced by cDirCopier::Action(), cLockFile::cLockFile(), CutRecording(), GenerateIndex(), main(), 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 647 of file tools.c.
References AddDirectory(), DirSizeMB(), LOG_ERROR_STR, MEGABYTE, cReadDir::Next(), and cReadDir::Ok().
Referenced by DirSizeMB(), EnoughFreeDiskSpaceForEdit(), cRecording::FileSizeMB(), FileSizeMBafterEdit(), and cRecordingsHandler::GetRequiredDiskSpaceMB().
|
inline |
Definition at line 97 of file tools.h.
Referenced by cIndexFileGenerator::Action(), cRecorder::Action(), cDvbSubtitleBitmaps::Draw(), cOsd::DrawScaledBitmap(), cPixmapMemory::DrawScaledImage(), 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 440 of file tools.c.
References DECIMAL_POINT_C, and strreplace().
Referenced by cRecordingInfo::FrameParams(), cSetup::Store(), and cRecordingInfo::Write().
bool endswith | ( | const char * | s, |
const char * | p ) |
Definition at line 346 of file tools.c.
Referenced by cChannel::ClearObsoleteChannel(), cChannels::MarkObsoleteChannels(), MatchPattern(), cArgs::ReadDirectory(), cRecording::Remove(), cVideoDirectoryScannerThread::ScanVideoDir(), and cRecordingInfo::SetFileName().
bool EntriesOnSameFileSystem | ( | const char * | File1, |
const char * | File2 ) |
Checks whether the given files are on the same file system.
If either of the files doesn't exist, this function returns true to avoid any actions that might be triggered if files are on different file system.
Definition at line 457 of file tools.c.
References LOG_ERROR_STR.
Referenced by cVideoDirectory::Contains(), cRecordingsHandler::GetRequiredDiskSpaceMB(), and cVideoDirectory::Move().
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 747 of file tools.c.
Referenced by cDirCopier::Action(), cIndexFileGenerator::Action(), and cIndexFile::cIndexFile().
int FreeDiskSpaceMB | ( | const char * | Directory, |
int * | UsedMB = NULL ) |
Definition at line 472 of file tools.c.
References LOG_ERROR_STR.
Referenced by cVideoDirectory::FreeMB(), and cRecorder::RunningLowOnDiskSpace().
|
inline |
Definition at line 82 of file tools.h.
References __attribute__().
Referenced by cCiTransportConnection::HandleSessions(), cCiApplicationInformation::Process(), and cCiTransportConnection::ResourceIdToInt().
const char * GetHostName | ( | void | ) |
Gets the host name of this machine.
Definition at line 1409 of file tools.c.
References LOG_ERROR.
Referenced by cSetup::cSetup(), and cSetup::Save().
bool isempty | ( | const char * | s | ) |
Definition at line 357 of file tools.c.
References skipspace().
Referenced by cPluginManager::Active(), cMenuEditFolder::cMenuEditFolder(), cRecording::cRecording(), cRecording::cRecording(), cTimer::cTimer(), cMenuFolder::Delete(), cMenuFolder::DescendPath(), cOsdMenu::Display(), cEvent::Dump(), cMenuCommands::Execute(), cTheme::FileNameOk(), cEvent::FixEpgBugs(), cSource::FromString(), tComponent::FromString(), cRecording::IsInPath(), cConfig< T >::Load(), cTheme::Load(), MakePatternFileName(), cChannel::Name(), cNestedItemList::Parse(), cSkins::QueueMessage(), cArgs::ReadDirectory(), cMenuFolder::Select(), cMenuCam::Set(), cMenuFolder::Set(), cComponents::SetComponent(), cSkinClassicDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cTimer::SetFile(), cMenuEditTimer::SetFolder(), cChannel::SetName(), cChannel::SetPortalName(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cChannel::ShortName(), and cChannel::ToText().
bool isnumber | ( | const char * | s | ) |
Definition at line 372 of file tools.c.
Referenced by cSVDRPServer::CmdAUDI(), cSVDRPServer::CmdCHAN(), cSVDRPServer::CmdCLRE(), cSVDRPServer::CmdCPYR(), cSVDRPServer::CmdDELC(), cSVDRPServer::CmdDELR(), cSVDRPServer::CmdDELT(), cSVDRPServer::CmdEDIT(), cSVDRPServer::CmdGRAB(), cSVDRPServer::CmdLSTC(), cSVDRPServer::CmdLSTE(), cSVDRPServer::CmdLSTR(), cSVDRPServer::CmdLSTT(), cSVDRPServer::CmdMOVR(), cSVDRPServer::CmdPLAY(), cSVDRPServer::CmdPRIM(), cSVDRPServer::CmdVOLU(), main(), cCamResponse::Parse(), cTimer::Parse(), and SetUser().
cString itoa | ( | int | n | ) |
Definition at line 450 of file tools.c.
Referenced by cDisplaySubtitleTracks::cDisplaySubtitleTracks(), cDisplayTracks::cDisplayTracks(), cResumeFile::cResumeFile(), DrawDeviceData(), cSkinLCARSDisplayMenu::DrawDisk(), DrawEllipseAlignments(), cSkinLCARSDisplayMenu::DrawLive(), cSkinLCARSDisplayMenu::DrawTimers(), cMenuTimerItem::Set(), cTimer::ToText(), and cRecordingInfo::Write().
time_t LastModifiedTime | ( | const char * | FileName | ) |
Definition at line 739 of file tools.c.
Referenced by cIndexFile::cIndexFile(), cRecordings::NeedsUpdate(), cMarks::Save(), and cMarks::Update().
bool MakeDirs | ( | const char * | FileName, |
bool | IsDirectory = false ) |
Definition at line 507 of file tools.c.
References dsyslog, and LOG_ERROR_STR.
Referenced by cMenuRecordingEdit::Action(), cPlugin::CacheDirectory(), cRecording::ChangeName(), cSVDRPServer::CmdCPYR(), cPlugin::ConfigDirectory(), cRecordControl::cRecordControl(), cPlugin::ResourceDirectory(), cThemes::SetThemesDirectory(), and cCutter::Start().
|
inline |
Definition at line 64 of file tools.h.
Referenced by cDirCopier::Action(), cBackTrace::BackTrace(), cDvbSpuDecoder::CalcAreaSize(), cTimer::CalcMargins(), cDvbSpuBitmap::cDvbSpuBitmap(), cEIT::cEIT(), cMenuSetupOSD::cMenuSetupOSD(), cRect::Combine(), cRect::Combine(), cDvbSubtitlePage::CombineAreas(), cCharSetConv::Convert(), cRecorder::cRecorder(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cOsdMenu::CursorDown(), cOsdMenu::CursorUp(), cOsdMenu::Display(), DrawDeviceData(), DrawDevicePosition(), DrawDeviceSignal(), cBitmap::DrawEllipse(), cPixmapMemory::DrawEllipse(), cBitmap::DrawRectangle(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cBitmap::DrawText(), cHdffOsd::DrawText(), cPixmapMemory::DrawText(), cSkinLCARSDisplayMenu::DrawTimer(), FileSizeMBafterEdit(), cSkinClassicDisplayMenu::Flush(), cBackTrace::GetCaller(), cTimers::GetMaxPriority(), cAdaptiveSkipper::GetValue(), cRect::Intersected(), cTimer::Matches(), cTimer::Matches(), cChannels::MaxChannelNameLength(), cChannels::MaxShortChannelNameLength(), cOsdMenu::PageDown(), cDevice::Priority(), cMtdHandler::Priority(), cLineGame::ProcessKey(), cTrueColorDemo::ProcessKey(), cTsToPes::PutTs(), cUnbufferedFile::Read(), cDvbSubtitleAssembler::Realloc(), cDynamicBuffer::Realloc(), cBitmap::Scaled(), cImage::Scaled(), cOsd::SetAreas(), cSkinLCARSDisplayChannel::SetChannel(), cOsdMenu::SetCurrent(), cSkinLCARSDisplayReplay::SetCurrent(), cDevice::SetOccupied(), cSkinLCARSDisplayReplay::SetTotal(), cDvbPlayer::SkipSeconds(), cCondWait::SleepMs(), strcpyrealloc(), cRecording::Title(), TsDump(), cUnbufferedFile::Write(), and cRecording::WriteInfo().
|
inline |
Definition at line 63 of file tools.h.
Referenced by cTrueColorDemo::Action(), cDvbSpuDecoder::CalcAreaSize(), cTimer::CalcMargins(), cDvbSpuBitmap::cDvbSpuBitmap(), cRect::Combine(), cRect::Combine(), cDvbSubtitlePage::CombineAreas(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cOsdMenu::Display(), DrawDevicePosition(), cBitmap::DrawRectangle(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayChannel::DrawSeen(), cSkinLCARSDisplayMenu::DrawSeen(), cSkinSTTNGDisplayChannel::Flush(), cFont::GetFont(), cTsToPes::GetPes(), cDvbTuner::GetSignalQuality(), cRect::Intersected(), cReplayControl::MarkMove(), cTimer::Matches(), cH265Parser::ParseSequenceParameterSet(), cNitFilter::Process(), cLineGame::ProcessKey(), cTrueColorDemo::ProcessKey(), cUnbufferedFile::Read(), cCaPidReceiver::Receive(), RgbShade(), cBitmap::Scaled(), cImage::Scaled(), cCiMMI::SendAnswer(), cDiseqcPositioner::SendDiseqc(), cTextScroller::Set(), cDevice::SetOccupied(), cDvbSubtitleConverter::SetOsdData(), cSkinLCARSDisplayMenu::SetTitle(), cDiseqcPositioner::Step(), cReplayControl::TimeSearchProcess(), TsDump(), cOsdProvider::UpdateOsdSize(), WeekDayName(), and cUnbufferedFile::Write().
|
inline |
Definition at line 293 of file tools.h.
Referenced by MtdMapPid(), and cCaPidReceiver::Receive().
|
inline |
Definition at line 298 of file tools.h.
Referenced by MtdMapPid().
|
inline |
Definition at line 88 of file tools.h.
References __attribute__().
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 679 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 593 of file tools.c.
References AddDirectory(), dsyslog, LOG_ERROR_STR, cReadDir::Next(), cReadDir::Ok(), RemoveEmptyDirectories(), and StrInArray().
Referenced by cVideoDirectory::Cleanup(), and RemoveEmptyDirectories().
bool RemoveFileOrDir | ( | const char * | FileName, |
bool | FollowSymlinks = false ) |
Definition at line 535 of file tools.c.
References AddDirectory(), dsyslog, LOG_ERROR_STR, MALLOC, cReadDir::Next(), and cReadDir::Ok().
Referenced by cVideoDirectory::Remove().
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 1366 of file tools.c.
References JpegCompressEmptyOutputBuffer(), JpegCompressInitDestination(), JpegCompressTermDestination(), tJpegCompressData::mem, and tJpegCompressData::size.
Referenced by cDvbSdFfDevice::GrabImage(), and cSubtitleDebug::WriteJpeg().
ssize_t safe_read | ( | int | filedes, |
void * | buffer, | ||
size_t | size ) |
Definition at line 53 of file tools.c.
References dsyslog.
Referenced by cDirCopier::Action(), cLircUsrRemote::Action(), cIndexFile::CatchUp(), cIndexFile::cIndexFile(), cSVDRPClient::Process(), cSVDRPServer::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 cDirCopier::Action(), cSVDRPServer::CmdGRAB(), cDevice::GrabImageFile(), cResumeFile::Save(), cSVDRPClient::Send(), cSVDRPServer::Send(), cDvbCiAdapter::Write(), cIndexFile::Write(), cUnbufferedFile::Write(), and writechar().
|
inline |
Definition at line 68 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 1292 of file tools.c.
Referenced by cSkinLCARSDisplayMenu::DrawPlay(), and cSkinLCARSDisplayReplay::SetRecording().
|
inline |
Definition at line 244 of file tools.h.
References cString::s.
Referenced by cPluginManager::AddPlugin(), cSVDRPServer::CmdCPYR(), cSVDRPServer::CmdLSTC(), cSVDRPServer::CmdMODC(), cSVDRPServer::CmdMODT(), cSVDRPServer::CmdMOVC(), cSVDRPServer::CmdMOVR(), cSVDRPServer::CmdPLAY(), cSVDRPServer::CmdPLUG(), compactspace(), cSVDRPServer::Execute(), cSatCableNumbers::FromString(), cDiseqc::GetCodes(), cOsdMenu::HotKey(), isempty(), cDll::Load(), cTheme::Load(), cBitmap::LoadXpm(), cCamResponse::Parse(), cChannel::Parse(), cEvent::Parse(), cKey::Parse(), cMark::Parse(), cMenuCommands::Parse(), cNestedItemList::Parse(), cTimer::Parse(), cTimer::ParseDay(), cSdtFilter::Process(), cEvent::Read(), cRecordingInfo::Read(), cResumeFile::Read(), cSchedule::Read(), cArgs::ReadDirectory(), cBitmap::SetXpm(), and strgetval().
bool SpinUpDisk | ( | const char * | FileName | ) |
Definition at line 693 of file tools.c.
References DirectoryOk(), dsyslog, esyslog, LOG_ERROR_STR, and cString::sprintf().
Referenced by cRecorder::cRecorder().
bool startswith | ( | const char * | s, |
const char * | p ) |
Definition at line 337 of file tools.c.
Referenced by cSVDRPServer::CmdLSTC(), cSocket::Discover(), cTimer::Matches(), MatchPattern(), cArgs::ReadDirectory(), and cTimer::SpawnPatternTimer().
const char * strchrn | ( | const char * | s, |
char | c, | ||
size_t | n ) |
returns a pointer to the n'th occurrence (counting from 1) of c in s, or NULL if no such character was found. If n is 0, s is returned.
Definition at line 186 of file tools.c.
Referenced by cMenuRecordings::Info().
int strcountchr | ( | const char * | s, |
char | c ) |
returns the number of occurrences of 'c' in 's'.
Definition at line 199 of file tools.c.
Referenced by cMenuRecordings::cMenuRecordings(), and cMenuRecordings::Open().
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 280 of file tools.c.
References MALLOC.
Referenced by cShutdownHandler::CallShutdownCommand(), cMenuRecordings::Commands(), and cRecordingUserCommand::InvokeCommand().
cString strgetbefore | ( | const char * | s, |
char | c, | ||
int | n = 1 ) |
Definition at line 211 of file tools.c.
Referenced by cVideoDirectory::Move().
|
inline |
Definition at line 243 of file tools.h.
References cString::s, and strgetlast().
const char * strgetlast | ( | const char * | s, |
char | c ) |
Definition at line 221 of file tools.c.
Referenced by cRecording::BaseName(), cRecording::cRecording(), cRecording::IsEdited(), cTimer::Matches(), cMenuEditTimer::SetFolder(), cMenuEditTimer::SetPatternItem(), cRecordControl::Stop(), and strgetlast().
cString strgetval | ( | const char * | s, |
const char * | name, | ||
char | d = '=' ) |
Returns the value part of a 'name=value' pair in s.
name must either be at the beginning of s, or has to be preceded by white space. There may be any number of white space around the '=' sign. The value is everything up to (and excluding) the next white space, or the end of s. If an other delimiter shall be used (like, e.g., ':'), it can be given as the third parameter. If name occurs more than once in s, only the first occurrence is taken.
Definition at line 303 of file tools.c.
References skipspace().
Referenced by cSVDRPServerParams::cSVDRPServerParams(), and cSocket::Discover().
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 398 of file tools.c.
Referenced by RemoveEmptyDirectories().
char * stripspace | ( | char * | s | ) |
Definition at line 227 of file tools.c.
Referenced by compactspace(), GetRecordingTimerId(), cMenuEditStrItem::LeaveEditMode(), cConfig< T >::Load(), cDll::Load(), cTheme::Load(), cMenuCommands::Parse(), cNestedItemList::Parse(), cArgs::ReadDirectory(), 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 cLircUsrRemote::Action(), cDvbFrontend::cDvbFrontend(), cEIT::cEIT(), cStateLockLog::Check(), cLircUsrRemote::cLircUsrRemote(), cMenuEditChannel::cMenuEditChannel(), cMenuEditFolder::cMenuEditFolder(), cMenuEditTimer::cMenuEditTimer(), cMenuPathEdit::cMenuPathEdit(), cMenuRecordingEdit::cMenuRecordingEdit(), cMenuSetupPictures::cMenuSetupPictures(), cRecordingInfo::cRecordingInfo(), cSetup::cSetup(), cSkinLCARSDisplayChannel::DrawTrack(), cSkinLCARSDisplayReplay::DrawTrack(), cStateLockLog::Dump(), cSkinSTTNGDisplayChannel::Flush(), cChannel::Parse(), cMenuCommands::Parse(), cSetup::Parse(), cTimer::Parse(), cSetup::ParseLanguages(), cPatPmtParser::ParsePmt(), cPatFilter::Process(), cPluginPictures::ProcessArgs(), cMenuSetupOSD::ProcessKey(), cMenuRecordingEdit::RemoveName(), cMenuEditStrlItem::Set(), cDevice::SetAvailableTrack(), cComponents::SetComponent(), cMenuEditTimer::SetFolder(), cMenuPathEdit::SetFolder(), cMenuRecordingEdit::SetFolder(), cSkinClassicDisplayReplay::SetMode(), cSkinCursesDisplayReplay::SetMode(), cMenuEditTimer::SetPatternItem(), cChannel::SetPids(), cPluginPictures::SetupParse(), cMenuSetupPictures::Store(), cRecording::Title(), Utf8Strn0Cpy(), and WeekDayName().
char * strreplace | ( | char * | s, |
char | c1, | ||
char | c2 ) |
Definition at line 142 of file tools.c.
Referenced by cMenuRecordingEdit::Action(), AddRecordingFolders(), cSVDRPServer::CmdCPYR(), cRecording::cRecording(), cSetupLine::cSetupLine(), dtoa(), cEvent::Dump(), cEvent::FixEpgBugs(), cFont::GetAvailableFontNames(), cFont::GetFontFileName(), HandleUnderscores(), MakePatternFileName(), cChannel::Parse(), cEvent::Parse(), cTimer::Parse(), cRecording::SortName(), cChannel::ToText(), and cTimer::ToText().
char * strreplace | ( | char * | s, |
const char * | s1, | ||
const char * | s2 ) |
char * strshift | ( | char * | s, |
int | n ) |
Shifts the given string to the left by the given number of bytes, thus removing the first n bytes from s.
If n is greater than the length of s, the resulting string will be empty. If n is <= 0 s will be unchanged. Returns s.
Definition at line 325 of file tools.c.
Referenced by cSVDRPClient::GetRemoteTimers().
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 383 of file tools.c.
Referenced by main().
|
inline |
Definition at line 65 of file tools.h.
Referenced by DrawDevicePosition(), and cMarks::Sort().
void syslog_with_tid | ( | int | priority, |
const char * | format, | ||
... ) |
References __attribute__().
cString TimeString | ( | time_t | t | ) |
Converts the given time to a string of the form "hh:mm".
Definition at line 1301 of file tools.c.
Referenced by cTimer::AdjustSpawnedTimer(), cEIT::cEIT(), cSkinLCARSDisplayMenu::DrawPlay(), cSkinLCARSDisplayMenu::DrawTimer(), cEvent::GetEndTimeString(), cEvent::GetTimeString(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), cSkinSTTNGDisplayMenu::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 1271 of file tools.c.
Referenced by cSVDRPServer::CmdNEXT(), cSVDRPServer::cSVDRPServer(), cTDT::cTDT(), cShutdownHandler::DoShutdown(), cFrameChecker::Report(), and cTsChecker::Report().
void TouchFile | ( | const char * | FileName, |
bool | Create = false ) |
Definition at line 725 of file tools.c.
References isyslog, and 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 841 of file tools.c.
References cCharSetConv::SystemCharacterTable(), SystemToUtf8, and Utf8CharLen().
Referenced by cFreetypeFont::DrawText(), cFreetypeFont::DrawText(), cHdffOsd::DrawText(), cKbdRemote::ReadKeySequence(), 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 827 of file tools.c.
References MT, and cCharSetConv::SystemCharacterTable().
Referenced by cFreetypeFont::DrawText(), cFreetypeFont::DrawText(), cHdffOsd::DrawText(), LimitNameLengths(), cTimer::PrintDay(), cTextWrapper::Set(), cCharSetConv::SetSystemCharacterTable(), StripControlCharacters(), Utf8CharGet(), Utf8StrLen(), Utf8Strn0Cpy(), Utf8SymChars(), Utf8ToArray(), and cFreetypeFont::Width().
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 856 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 956 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 903 of file tools.c.
References cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cChannels::MaxChannelNameLength(), cChannels::MaxShortChannelNameLength(), cSkinCursesDisplayReplay::SetCurrent(), cSkinCursesDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetRecording(), cSkinCursesDisplayReplay::SetTotal(), cSkinCursesDisplayVolume::SetVolume(), 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 915 of file tools.c.
References strn0cpy(), cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cTimer::cTimer(), cSetup::Parse(), cTimer::Parse(), cMenuSetupOSD::ProcessKey(), cDevice::SetAvailableTrack(), cTimer::SetFile(), and cTimer::SetPattern().
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 890 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 938 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 1218 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 1233 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 1239 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 1254 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 cDvbHdFfDevice::PlayAudio(), cDvbSdFfDevice::PlayAudio(), cDvbHdFfDevice::PlayTsAudio(), cDvbSdFfDevice::PlayTsAudio(), cDvbHdFfDevice::PlayTsVideo(), cDvbSdFfDevice::PlayTsVideo(), cDvbHdFfDevice::PlayVideo(), and cDvbSdFfDevice::PlayVideo().
void writechar | ( | int | filedes, |
char | c ) |
Definition at line 85 of file tools.c.
References safe_write().
Referenced by cIndexFile::cIndexFile().
|
extern |
Definition at line 2111 of file tools.c.
Referenced by cListBase::Del(), and main().