vdr
1.7.27
|
#include "tools.h"
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <jpeglib.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/vfs.h>
#include <time.h>
#include <unistd.h>
#include <utime.h>
#include "i18n.h"
#include "thread.h"
Go to the source code of this file.
Classes | |
struct | tJpegCompressData |
Defines | |
#define | MAXSYSLOGBUF 256 |
#define | MT(s, m, v) ((*(s) & (m)) == (v)) |
#define | JPEGCOMPRESSMEM 500000 |
#define | USE_FADVISE |
#define | WRITE_BUFFER KILOBYTE(800) |
#define | FADVGRAN KILOBYTE(4) |
#define | READCHUNK MEGABYTE(8) |
#define | LOCKFILENAME ".lock-vdr" |
#define | LOCKFILESTALETIME 600 |
Functions | |
void | syslog_with_tid (int priority, const char *format,...) |
int | BCD2INT (int x) |
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, int RetryMs) |
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 * | 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) |
cString | AddDirectory (const char *DirName, const char *FileName) |
cString | itoa (int n) |
bool | EntriesOnSameFileSystem (const char *File1, const char *File2) |
int | FreeDiskSpaceMB (const char *Directory, int *UsedMB) |
bool | DirectoryOk (const char *DirName, bool LogErrors) |
bool | MakeDirs (const char *FileName, bool IsDirectory) |
bool | RemoveFileOrDir (const char *FileName, bool FollowSymlinks) |
bool | RemoveEmptyDirectories (const char *DirName, bool RemoveThis) |
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) |
int | Utf8CharLen (const char *s) |
uint | Utf8CharGet (const char *s, int Length) |
int | Utf8CharSet (uint c, char *s) |
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) |
cString | WeekDayName (int WeekDay) |
cString | WeekDayName (time_t t) |
cString | WeekDayNameFull (int WeekDay) |
cString | WeekDayNameFull (time_t t) |
cString | DayDateTime (time_t t) |
cString | TimeToString (time_t t) |
cString | DateString (time_t t) |
cString | TimeString (time_t t) |
static void | JpegCompressInitDestination (j_compress_ptr cinfo) |
static boolean | JpegCompressEmptyOutputBuffer (j_compress_ptr cinfo) |
static void | JpegCompressTermDestination (j_compress_ptr cinfo) |
uchar * | RgbToJpeg (uchar *Mem, int Width, int Height, int &Size, int Quality) |
static int | CompareListObjects (const void *a, const void *b) |
Variables | |
int | SysLogLevel = 3 |
static uint | SystemToUtf8 [128] = { 0 } |
Definition at line 1611 of file tools.c.
Referenced by cUnbufferedFile::FadviseDrop().
#define JPEGCOMPRESSMEM 500000 |
Definition at line 1055 of file tools.c.
Referenced by JpegCompressEmptyOutputBuffer(), and JpegCompressInitDestination().
#define LOCKFILENAME ".lock-vdr" |
Definition at line 1754 of file tools.c.
Referenced by cLockFile::cLockFile().
#define LOCKFILESTALETIME 600 |
Definition at line 1755 of file tools.c.
Referenced by cLockFile::Lock().
#define MAXSYSLOGBUF 256 |
Definition at line 32 of file tools.c.
Referenced by syslog_with_tid().
#define MT | ( | s, | |
m, | |||
v | |||
) | ((*(s) & (m)) == (v)) |
Referenced by Utf8CharLen().
Definition at line 1612 of file tools.c.
Referenced by cUnbufferedFile::Read().
#define USE_FADVISE |
#define WRITE_BUFFER KILOBYTE(800) |
Definition at line 1560 of file tools.c.
Referenced by cUnbufferedFile::Write().
cString AddDirectory | ( | const char * | DirName, |
const char * | FileName | ||
) |
Definition at line 288 of file tools.c.
References cString::sprintf().
Referenced by cLockFile::cLockFile(), cSVDRP::CmdGRAB(), DirSizeMB(), GenerateIndex(), cDvbDevice::Initialize(), cPictureEntry::Load(), cThemes::Load(), cMarks::Load(), cFileNameList::Load(), main(), cPictureEntry::Path(), RemoveEmptyDirectories(), RemoveFileOrDir(), cRecordings::ScanVideoDir(), and cRecordings::UpdateFileName().
int BCD2INT | ( | int | x | ) |
Definition at line 44 of file tools.c.
References BCDCHARTOINT.
Referenced by cNitFilter::Process().
char* compactspace | ( | char * | s | ) |
Definition at line 187 of file tools.c.
References skipspace(), and stripspace().
Referenced by cEvent::FixEpgBugs(), cSetupLine::Parse(), cSdtFilter::Process(), and cRecordingInfo::Read().
static int CompareListObjects | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 1967 of file tools.c.
References cListObject::Compare().
Referenced by cListBase::Sort().
cString DateString | ( | time_t | t | ) |
Definition at line 1034 of file tools.c.
References WeekDayName().
Referenced by cEvent::GetDateString(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), and cPluginSvdrpdemo::SVDRPCommand().
cString DayDateTime | ( | time_t | t | ) |
Definition at line 1013 of file tools.c.
References WeekDayName().
Referenced by cMenuEditRecording::cMenuEditRecording(), cPictureControl::DisplayCaption(), cSkinClassicDisplayChannel::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinSTTNGDisplayMenu::Flush(), and cSkinSTTNGDisplayMenu::SetButtons().
bool DirectoryOk | ( | const char * | DirName, |
bool | LogErrors | ||
) |
Definition at line 332 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 474 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().
bool endswith | ( | const char * | s, |
const char * | p | ||
) |
Definition at line 236 of file tools.c.
Referenced by cCopyingThread::cCopyingThread(), cRecording::Remove(), and cRecordings::ScanVideoDir().
bool EntriesOnSameFileSystem | ( | const char * | File1, |
const char * | File2 | ||
) |
Definition at line 300 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 566 of file tools.c.
Referenced by cCuttingThread::Action(), cIndexFileGenerator::Action(), and cIndexFile::cIndexFile().
int FreeDiskSpaceMB | ( | const char * | Directory, |
int * | UsedMB | ||
) |
Definition at line 315 of file tools.c.
References LOG_ERROR_STR.
Referenced by cCopyingThread::Action(), cVideoDirectory::FreeMB(), OpenVideoFile(), and cRecorder::RunningLowOnDiskSpace().
bool isempty | ( | const char * | s | ) |
Definition at line 247 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(), cNestedItemList::Parse(), cSkins::QueueMessage(), cMenuFolder::Select(), cMenuFolder::Set(), cComponents::SetComponent(), cRecordingInfo::SetData(), cSkinClassicDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cTimer::SetFile(), cMenuEditTimer::SetFolder(), cMenuEditRecording::SetFolder(), cChannel::SetName(), cChannel::SetPortalName(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cChannel::ShortName(), and cChannel::ToText().
bool isnumber | ( | const char * | s | ) |
Definition at line 262 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().
Definition at line 293 of file tools.c.
Referenced by cDisplaySubtitleTracks::cDisplaySubtitleTracks(), cDisplayTracks::cDisplayTracks(), cResumeFile::cResumeFile(), cMenuTimerItem::Set(), and cTimer::ToText().
static boolean JpegCompressEmptyOutputBuffer | ( | j_compress_ptr | cinfo | ) | [static] |
Definition at line 1071 of file tools.c.
References esyslog, JPEGCOMPRESSMEM, tJpegCompressData::mem, and tJpegCompressData::size.
Referenced by RgbToJpeg().
static void JpegCompressInitDestination | ( | j_compress_ptr | cinfo | ) | [static] |
Definition at line 1062 of file tools.c.
References JPEGCOMPRESSMEM, MALLOC, tJpegCompressData::mem, and tJpegCompressData::size.
Referenced by RgbToJpeg().
static void JpegCompressTermDestination | ( | j_compress_ptr | cinfo | ) | [static] |
Definition at line 1094 of file tools.c.
References esyslog, tJpegCompressData::mem, and tJpegCompressData::size.
Referenced by RgbToJpeg().
time_t LastModifiedTime | ( | const char * | FileName | ) |
Definition at line 558 of file tools.c.
Referenced by cRecording::FileSizeMB(), cRecordings::NeedsUpdate(), cRecording::NumFrames(), and cMarks::Update().
bool MakeDirs | ( | const char * | FileName, |
bool | IsDirectory | ||
) |
Definition at line 350 of file tools.c.
References dsyslog, and LOG_ERROR_STR.
Referenced by cCopyingThread::Action(), cPlugin::ConfigDirectory(), cRecordControl::cRecordControl(), HardLinkVideoFile(), OpenVideoFile(), cThemes::SetThemesDirectory(), and cCutter::Start().
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 506 of file tools.c.
References LOG_ERROR_STR.
Referenced by cCuttingThread::Action(), cSafeFile::cSafeFile(), and HardLinkVideoFile().
bool RemoveEmptyDirectories | ( | const char * | DirName, |
bool | RemoveThis | ||
) |
Definition at line 436 of file tools.c.
References AddDirectory(), dsyslog, LOG_ERROR_STR, cReadDir::Next(), cReadDir::Ok(), and RemoveEmptyDirectories().
Referenced by cCopyingThread::Action(), RemoveEmptyDirectories(), and RemoveEmptyVideoDirectories().
bool RemoveFileOrDir | ( | const char * | FileName, |
bool | FollowSymlinks | ||
) |
Definition at line 378 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 1110 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 52 of file tools.c.
References dsyslog.
Referenced by cLircRemote::Action(), cSectionHandler::Action(), cIndexFile::CatchUp(), cIndexFile::cIndexFile(), cSVDRP::Process(), cDvbCiAdapter::Read(), cResumeFile::Read(), cRingBufferLinear::Read(), cUnbufferedFile::Read(), cKbdRemote::ReadKey(), and cRcuRemote::ReceiveByte().
ssize_t safe_write | ( | int | filedes, |
const void * | buffer, | ||
size_t | size | ||
) |
Definition at line 64 of file tools.c.
References dsyslog.
Referenced by cSVDRP::CmdGRAB(), cDevice::GrabImageFile(), cResumeFile::Save(), cSVDRP::Send(), cDvbCiAdapter::Write(), cIndexFile::Write(), cUnbufferedFile::Write(), and writechar().
bool SpinUpDisk | ( | const char * | FileName | ) |
Definition at line 520 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 | ||
) |
char* strcpyrealloc | ( | char * | dest, |
const char * | src | ||
) |
Definition at line 113 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().
Definition at line 204 of file tools.c.
References MALLOC.
Referenced by cShutdownHandler::CallShutdownCommand(), cMenuRecordings::Commands(), and cRecordingUserCommand::InvokeCommand().
char* stripspace | ( | char * | s | ) |
Definition at line 175 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 130 of file tools.c.
Referenced by cEIT::cEIT(), cMenuEditChannel::cMenuEditChannel(), cMenuEditFolder::cMenuEditFolder(), cMenuSetupPictures::cMenuSetupPictures(), cRecordingInfo::cRecordingInfo(), 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 138 of file tools.c.
Referenced by CopyString(), cRecording::cRecording(), 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 273 of file tools.c.
Referenced by main().
void syslog_with_tid | ( | int | priority, |
const char * | format, | ||
... | |||
) |
Definition at line 34 of file tools.c.
References MAXSYSLOGBUF, and cThread::ThreadId().
cString TimeString | ( | time_t | t | ) |
Definition at line 1045 of file tools.c.
Referenced by cEvent::GetEndTimeString(), cEvent::GetTimeString(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), and cPluginSvdrpdemo::SVDRPCommand().
cString TimeToString | ( | time_t | t | ) |
Definition at line 1024 of file tools.c.
Referenced by cSVDRP::CmdNEXT(), cTDT::cTDT(), cShutdownHandler::DoShutdown(), and cSVDRP::Process().
void TouchFile | ( | const char * | FileName | ) |
Definition at line 552 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 660 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 646 of file tools.c.
References MT, and cCharSetConv::SystemCharacterTable().
Referenced by cHdffOsd::DrawText(), cFreetypeFont::DrawText(), cTimer::PrintDay(), cTextWrapper::Set(), cCharSetConv::SetSystemCharacterTable(), 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 675 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 771 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 722 of file tools.c.
References cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cTimer::cTimer(), cSubtitleObject::DecodeCharacterString(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cChannels::MaxChannelNameLength(), cChannels::MaxShortChannelNameLength(), cTimer::Parse(), 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 734 of file tools.c.
References strn0cpy(), cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cMenuEditRecording::cMenuEditRecording(), cRecording::cRecording(), 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 709 of file tools.c.
References cCharSetConv::SystemCharacterTable(), and Utf8CharLen().
Referenced by cTimer::cTimer(), cTimer::Parse(), 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 753 of file tools.c.
References cCharSetConv::SystemCharacterTable(), Utf8CharGet(), and Utf8CharLen().
Referenced by cMenuEditStrItem::EnterEditMode().
cString WeekDayName | ( | int | WeekDay | ) |
Definition at line 971 of file tools.c.
References min(), strn0cpy(), tr, and Utf8SymChars().
Referenced by DateString(), DayDateTime(), cMenuEditDateItem::Set(), cMenuTimerItem::Set(), and WeekDayName().
cString WeekDayName | ( | time_t | t | ) |
Definition at line 986 of file tools.c.
References WeekDayName().
cString WeekDayNameFull | ( | int | WeekDay | ) |
cString WeekDayNameFull | ( | time_t | t | ) |
Definition at line 1007 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 89 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 84 of file tools.c.
References safe_write().
Referenced by cIndexFile::cIndexFile().
int SysLogLevel = 3 |
uint SystemToUtf8[128] = { 0 } [static] |
Definition at line 644 of file tools.c.
Referenced by cCharSetConv::SetSystemCharacterTable(), and Utf8CharGet().