vdr  1.7.31
Macros | Functions | Variables
vdr.c File Reference
#include <getopt.h>
#include <grp.h>
#include <langinfo.h>
#include <locale.h>
#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include <termios.h>
#include <unistd.h>
#include "audio.h"
#include "channels.h"
#include "config.h"
#include "cutter.h"
#include "device.h"
#include "diseqc.h"
#include "dvbdevice.h"
#include "eitscan.h"
#include "epg.h"
#include "filetransfer.h"
#include "i18n.h"
#include "interface.h"
#include "keys.h"
#include "libsi/si.h"
#include "lirc.h"
#include "menu.h"
#include "osdbase.h"
#include "plugin.h"
#include "recording.h"
#include "shutdown.h"
#include "skinclassic.h"
#include "skinlcars.h"
#include "skinsttng.h"
#include "sourceparams.h"
#include "sources.h"
#include "themes.h"
#include "timers.h"
#include "tools.h"
#include "transfer.h"
#include "videodir.h"

Go to the source code of this file.

Macros

#define MINCHANNELWAIT   10
#define ACTIVITYTIMEOUT   60
#define SHUTDOWNWAIT   300
#define SHUTDOWNRETRY   360
#define SHUTDOWNFORCEPROMPT   5
#define SHUTDOWNCANCELPROMPT   5
#define RESTARTCANCELPROMPT   5
#define MANUALSTART   600
#define CHANNELSAVEDELTA   600
#define DEVICEREADYTIMEOUT   30
#define MENUTIMEOUT   120
#define TIMERCHECKDELTA   10
#define TIMERDEVICETIMEOUT   8
#define TIMERLOOKAHEADTIME   60
#define VPSLOOKAHEADTIME   24
#define VPSUPTODATETIME   3600
#define EXIT(v)   { ShutdownHandler.Exit(v); goto Exit; }
#define dd(a, b)   (*a ? a : b)
#define DEFAULTSVDRPPORT   6419
#define DEFAULTWATCHDOG   0
#define DEFAULTVIDEODIR   VIDEODIR
#define DEFAULTCONFDIR   dd(CONFDIR, VideoDirectory)
#define DEFAULTCACHEDIR   dd(CACHEDIR, VideoDirectory)
#define DEFAULTRESDIR   dd(RESDIR, ConfigDirectory)
#define DEFAULTPLUGINDIR   PLUGINDIR
#define DEFAULTLOCDIR   LOCDIR
#define DEFAULTEPGDATAFILENAME   "epg.data"
#define DELETE_MENU   ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL)
#define DirectMainFunction(function)

Functions

static bool SetUser (const char *UserName, bool UserDump)
static bool DropCaps (void)
static bool SetKeepCaps (bool On)
static void SignalHandler (int signum)
static void Watchdog (int signum)
int main (int argc, char *argv[])

Variables

static int LastSignal = 0

Macro Definition Documentation

#define ACTIVITYTIMEOUT   60

Definition at line 71 of file vdr.c.

Referenced by main().

#define CHANNELSAVEDELTA   600

Definition at line 78 of file vdr.c.

Referenced by main().

#define dd (   a,
 
)    (*a ? a : b)
#define DEFAULTCACHEDIR   dd(CACHEDIR, VideoDirectory)

Referenced by main().

#define DEFAULTCONFDIR   dd(CONFDIR, VideoDirectory)

Referenced by main().

#define DEFAULTEPGDATAFILENAME   "epg.data"

Referenced by main().

#define DEFAULTLOCDIR   LOCDIR

Referenced by main().

#define DEFAULTPLUGINDIR   PLUGINDIR

Referenced by main().

#define DEFAULTRESDIR   dd(RESDIR, ConfigDirectory)

Referenced by main().

#define DEFAULTSVDRPPORT   6419

Referenced by main().

#define DEFAULTVIDEODIR   VIDEODIR

Referenced by main().

#define DEFAULTWATCHDOG   0

Referenced by main().

#define DELETE_MENU   ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL)

Referenced by main().

#define DEVICEREADYTIMEOUT   30

Definition at line 79 of file vdr.c.

Referenced by main().

#define DirectMainFunction (   function)
Value:
Menu = new cMenuMain(function);\
key = kNone;

Referenced by main().

#define EXIT (   v)    { ShutdownHandler.Exit(v); goto Exit; }

Definition at line 87 of file vdr.c.

Referenced by main().

#define MANUALSTART   600

Definition at line 77 of file vdr.c.

Referenced by main().

#define MENUTIMEOUT   120

Definition at line 80 of file vdr.c.

Referenced by main().

#define MINCHANNELWAIT   10

Definition at line 70 of file vdr.c.

Referenced by main().

#define RESTARTCANCELPROMPT   5

Definition at line 76 of file vdr.c.

Referenced by main().

#define SHUTDOWNCANCELPROMPT   5

Definition at line 75 of file vdr.c.

Referenced by main().

#define SHUTDOWNFORCEPROMPT   5

Definition at line 74 of file vdr.c.

Referenced by main().

#define SHUTDOWNRETRY   360

Definition at line 73 of file vdr.c.

Referenced by main().

#define SHUTDOWNWAIT   300

Definition at line 72 of file vdr.c.

Referenced by main().

#define TIMERCHECKDELTA   10

Definition at line 81 of file vdr.c.

Referenced by main().

#define TIMERDEVICETIMEOUT   8

Definition at line 82 of file vdr.c.

Referenced by main().

#define TIMERLOOKAHEADTIME   60

Definition at line 83 of file vdr.c.

Referenced by main().

#define VPSLOOKAHEADTIME   24

Definition at line 84 of file vdr.c.

Referenced by main().

#define VPSUPTODATETIME   3600

Definition at line 85 of file vdr.c.

Referenced by main().

Function Documentation

static bool DropCaps ( void  )
static

Definition at line 117 of file vdr.c.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)

Definition at line 168 of file vdr.c.

References cFileTransfer::Active(), cCutter::Active(), cEITScanner::Active(), cRecordControls::Active(), cEITScanner::Activity(), ACTIVITYTIMEOUT, cDevice::ActualDevice(), AddDirectory(), cPluginManager::AddPlugin(), cChannel::Apid(), APIVERSION, cControl::Attach(), Audios, cTimers::BeingEdited(), cChannels::BeingEdited(), cDvbDevice::BondDevices(), CamControl(), CamMenuActive(), cCountdown::Cancel(), cTimer::Channel(), cRecordControls::ChannelDataModified(), CHANNELMOD_RETUNE, Channels, CHANNELSAVEDELTA, CHANNELSMOD_USER, cShutdownHandler::CheckManualStart(), cSchedules::Cleanup(), cSkins::Clear(), cListBase::Clear(), cPlugin::CommandLineHelp(), Commands, cInterface::Confirm(), cShutdownHandler::ConfirmRestart(), cShutdownHandler::ConfirmShutdown(), cControl::Control(), cShutdownHandler::countdown, cDisplayVolume::Create(), cDisplayTracks::Create(), cDisplaySubtitleTracks::Create(), cSkins::Current(), cDevice::CurrentChannel(), cSetup::CurrentChannel, cSetup::CurrentVolume, cDevice::CurrentVolume(), CutRecording(), DEFAULTCACHEDIR, DEFAULTCONFDIR, DEFAULTEPGDATAFILENAME, DEFAULTLOCDIR, DEFAULTPLUGINDIR, DEFAULTRESDIR, DEFAULTSVDRPPORT, DEFAULTVIDEODIR, DEFAULTWATCHDOG, DELETE_MENU, DeletedRecordings, cTimers::DeleteExpired(), cPlugin::Description(), cSetup::DeviceBondings, cDevice::DeviceNumber(), DEVICEREADYTIMEOUT, DirectMainFunction, DirectoryOk(), cSetup::DiSEqC, Diseqcs, cShutdownHandler::DoExit(), cCountdown::Done(), cShutdownHandler::DoShutdown(), cChannel::Dpid(), DropCaps(), dsyslog, EITScanner, cShutdownHandler::EmergencyExitRequested(), cFileTransfer::Ended(), cCutter::Ended(), EpgHandlers, cFileTransfer::Error(), cCutter::Error(), esyslog, cTimer::Event(), EXIT, cList< T >::First(), Folders, cSetup::FontOsd, tChannelID::FromString(), GenerateIndex(), cKeyMacros::Get(), cChannels::GetByChannelID(), cChannels::GetByNumber(), cDevice::GetDevice(), cDevice::GetDeviceForTransponder(), cShutdownHandler::GetExitCode(), cFont::GetFontFileName(), cControl::GetInfo(), cInterface::GetKey(), cTimers::GetMatch(), cRemote::GetPlugin(), cPluginManager::GetPlugin(), cSchedules::GetSchedule(), cDevice::HasDecoder(), cTimer::HasFlags(), cPluginManager::HasPlugins(), cDevice::HasProgramme(), cInterface::HasSVDRPConnection(), cControl::Hide(), cPluginManager::Housekeeping(), I18nInitialize(), cSetup::InitialChannel, cDvbDevice::Initialize(), cPluginManager::InitializePlugins(), cSetup::InitialVolume, InstanceId, Interface, cOsdObject::IsMenu(), ISMODELESSKEY, isnumber(), cDisplayChannel::IsOpen(), cDisplayTracks::IsOpen(), cDisplaySubtitleTracks::IsOpen(), cSkins::IsOpen(), cOsd::IsOpen(), cDevice::IsPrimaryDevice(), ISREALKEY, cDevice::IsTunedToTransponder(), cShutdownHandler::IsUserInactive(), isyslog, k0, k1, k9, k_Plugin, k_Repeat, kAudio, kChanDn, kChannels, kChanPrev, kChanUp, kCommands, kDown, KeyMacros, Keys, kInfo, kLeft, kMenu, kMute, kNext, kNone, kOk, kPause, kPlay, kPower, kPrev, kRecord, kRecordings, kRight, kSchedule, kSetup, kSubtitles, kTimers, kUp, kUser0, kUser9, kVolDn, kVolUp, cRemote::LastActivity(), cReplayControl::LastReplayed(), LastSignal, cControl::Launch(), cInterface::LearnKeys(), LIVEPRIORITY, cThemes::Load(), cConfig< T >::Load(), cNestedItemList::Load(), cChannels::Load(), cSetup::Load(), cPluginManager::LoadPlugins(), cRwLock::Lock(), cPlugin::MainMenuAction(), cPluginManager::MainThreadHook(), MANUALSTART, cTimer::Matches(), MAXDEVICES, cSetup::MaxVideoFileSize, MAXVIDEOFILESIZEDEFAULT, MAXVIDEOFILESIZETS, MEGABYTE, cSetup::MenuKeyCloses, MENUTIMEOUT, cSkins::Message(), MINCHANNELWAIT, MINPRIORITY, MINVIDEOFILESIZE, cTimers::Modified(), cChannels::Modified(), mtError, mtInfo, mtWarning, cPlugin::Name(), cSkin::Name(), cOsdObject::NeedsFastResponse(), cRecordings::NeedsUpdate(), cList< T >::Next(), NORMALKEY, cChannel::Number(), cDevice::NumDevices(), osBack, osChannels, osCommands, cSetup::OSDSkin, cSetup::OSDTheme, osEnd, osPause, osPlugin, osRecord, osRecordings, osReplay, osSchedule, osSetup, osStopReplay, osSwitchDvb, osTimers, osUnknown, cSetup::PauseKeyHandling, cRecordControls::PauseLiveVideo(), cMenuMain::PluginOsdObject(), cSchedule::PresentSeenWithin(), cDevice::PrimaryDevice(), cSetup::PrimaryDVB, cEITScanner::Process(), cDisplayVolume::Process(), cDisplayTracks::Process(), cDisplaySubtitleTracks::Process(), cRecordControls::Process(), cOsdObject::ProcessKey(), cSkins::ProcessQueuedMessages(), cDevice::ProvidesTransponder(), cRemote::Put(), cRemote::PutMacro(), cTimer::Recording(), RecordingCommands, Recordings, Remotes, RemoveDeletedRecordings(), cDevice::Replaying(), ReportEpgBugFixStats(), RESTARTCANCELPROMPT, cShutdownHandler::Retry(), cEvent::RunningStatus(), SI::RunningStatusUndefined, cConfig< T >::Save(), cSetup::Save(), cSchedules::Schedules(), Scrs, cEvent::SeenWithin(), cPlugin::SetCacheDirectory(), cRecordingUserCommand::SetCommand(), cPlugin::SetConfigDirectory(), cSkins::SetCurrent(), cPluginManager::SetDirectory(), cSchedules::SetEpgDataFileName(), cTimers::SetEvents(), cSVDRP::SetGrabImageDir(), cTimer::SetInVpsMargin(), SetKeepCaps(), cThread::SetMainThreadId(), cDevice::SetOccupied(), cTimer::SetPending(), cDevice::SetPrimaryDevice(), cPlugin::SetResourceDirectory(), cShutdownHandler::SetRetry(), cShutdownHandler::SetShutdownCommand(), cCharSetConv::SetSystemCharacterTable(), SI::SetSystemCharacterTable(), cThemes::SetThemesDirectory(), Setup, cDevice::SetUseDevice(), SetUser(), cShutdownHandler::SetUserInactive(), cShutdownHandler::SetUserInactiveTimeout(), SetVideoDirectory(), cDevice::SetVolume(), cOsdObject::Show(), cControl::Shutdown(), cPluginManager::Shutdown(), cDevice::Shutdown(), cRecordControls::Shutdown(), cOsdProvider::Shutdown(), SHUTDOWNCANCELPROMPT, SHUTDOWNFORCEPROMPT, ShutdownHandler, SHUTDOWNRETRY, SHUTDOWNWAIT, SignalHandler(), Skins, SourceParams, Sources, cSetup::SplitEditedFiles, cCountdown::Start(), cThread::Start(), cRecordControls::Start(), cPluginManager::StartPlugins(), cEvent::StartTime(), cFileTransfer::Stop(), cCutter::Stop(), cPluginManager::StopPlugins(), cDevice::StopReplay(), StrToNum(), SVDRPhosts, cDevice::SwitchChannel(), cChannels::SwitchTo(), SysLogLevel, tfActive, tfVps, cSkin::Theme(), cThread::ThreadId(), TIMERCHECKDELTA, TimerCommands, TIMERDEVICETIMEOUT, TIMERLOOKAHEADTIME, Timers, cDevice::ToggleMute(), tr, cDevice::Transferring(), cRwLock::Unlock(), cCountdown::Update(), cRecordings::Update(), cOsdProvider::UpdateOsdSize(), VDRVERSION, cPlugin::Version(), VfatFileSystem, VideoDirectory, VOLUMEDELTA, cChannel::Vpid(), VPSLOOKAHEADTIME, cSetup::VpsMargin, VPSUPTODATETIME, cDevice::WaitForAllDevicesReady(), Watchdog(), and cSetup::ZapTimeout.

static bool SetKeepCaps ( bool  On)
static

Definition at line 134 of file vdr.c.

Referenced by main().

static bool SetUser ( const char *  UserName,
bool  UserDump 
)
static

Definition at line 91 of file vdr.c.

Referenced by main().

static void SignalHandler ( int  signum)
static

Definition at line 144 of file vdr.c.

References cShutdownHandler::Exit(), Interface, cInterface::Interrupt(), LastSignal, and ShutdownHandler.

Referenced by main().

static void Watchdog ( int  signum)
static

Definition at line 160 of file vdr.c.

References esyslog.

Referenced by main().

Variable Documentation

int LastSignal = 0
static

Definition at line 89 of file vdr.c.

Referenced by main(), and SignalHandler().