/* $Id$ * $URL$ * $URL$ * * LCD4Linux * * Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team * * This file is part of LCD4Linux. * * LCD4Linux is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * LCD4Linux is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "config.h" #include #include #include #include #include #include #include #include #include "svn_version.h" #include "cfg.h" #include "debug.h" #include "qprintf.h" #include "pid.h" #include "udelay.h" #include "drv.h" #include "timer.h" #include "layout.h" #include "plugin.h" #include "thread.h" #include "widget.h" #include "widget_timer.h" #ifdef WITH_DMALLOC #include #endif #define PIDFILE "/var/run/lcd4linux.pid" static char *release = "LCD4Linux " VERSION "-" SVN_VERSION; static char *copyright = "Copyright (C) 2005, 2006, 2007 The LCD4Linux Team "; static char **my_argv; extern char *output; int got_signal = 0; static void usage(void) { printf("%s\n", release); printf("%s\n", copyright); printf("usage: lcd4linux [-h]\n"); printf(" lcd4linux [-l]\n"); printf(" lcd4linux [-c key=value] [-i] [-f config-file] [-v] [-p pid-file]\n"); printf(" lcd4linux [-c key=value] [-F] [-f config-file] [-o output-file] [-q] [-v]\n"); } static void interactive_mode(void) { char line[1024]; void *tree; RESULT result = { 0, 0, 0, NULL }; printf("\neval> "); for (fgets(line, sizeof(line), stdin); !feof(stdin); fgets(line, sizeof(line), stdin)) { if (line[strlen(line) - 1] == '\n') line[strlen(line) - 1] = '\0'; if (strlen(line) > 0) { if (Compile(line, &tree) != -1) { Eval(tree, &result); if (result.type == R_NUMBER) { printf("%g\n", R2N(&result)); } else if (result.type == R_STRING) { printf("'%s'\n", R2S(&result)); } else if (result.type == (R_NUMBER | R_STRING)) { printf("'%s' (%g)\n", R2S(&result), R2N(&result)); } else { printf("internal error: unknown result type %d\n", result.type); } DelResult(&result); } DelTree(tree); } printf("eval> "); } printf("\n"); } void handler(int signal) { debug("got signal %d", signal); got_signal = signal; } static void daemonize(void) { /* thanks to Petri Damsten, we now follow the guidelines from the UNIX Programming FAQ */ /* 1.7 How do I get my program to act like a daemon? */ /* http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 */ /* especially the double-fork solved the 'lcd4linux dying when called from init' problem */ pid_t i; int fd; /* Step 1: fork() so that the parent can exit */ i = fork(); if (i < 0) { error("fork(#1) failed: %s", strerror(errno)); exit(1); } if (i != 0) exit(0); /* Step 2: setsid() to become a process group and session group leader */ setsid(); /* Step 3: fork() again so the parent (the session group leader) can exit */ i = fork(); if (i < 0) { error("fork(#2) failed: %s", strerror(errno)); exit(1); } if (i != 0) exit(0); /* Step 4: chdir("/") to ensure that our process doesn't keep any directory in use */ if (chdir("/") != 0) { error("chdir(\"/\") failed: %s", strerror(errno)); exit(1); } /* Step 5: umask(0) so that we have complete control over the permissions of anything we write */ umask(0); /* Step 6: Establish new open descriptors for stdin, stdout and stderr */ /* detach stdin */ if (freopen("/dev/null", "r", stdin) == NULL) { error("freopen (/dev/null) failed: %s", strerror(errno)); exit(1); } /* detach stdout and stderr */ fd = open("/dev/null", O_WRONLY, 0666); if (fd == -1) { error("open (/dev/null) failed: %s", strerror(errno)); exit(1); } fflush(stdout); dup2(fd, STDOUT_FILENO); fflush(stderr); dup2(fd, STDERR_FILEN
# Hungary / Mor-Siofok-Veszprem-Zirc
#
# A.multiplex UHF-64:
# FREE -----------------------------------------------------------------------------------
# m1 HD, m2 HD, Duna World, Duna HD, MR1 Kossuth Radio, MR2 Petofi Radio, MR3 Bartok Radio
[CHANNEL]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 818000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 3/4
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

#
# B.multiplex UHF-29:
# NON-FREE ----------------------------------------------------------------------------
# PRO4, VIASAT3, Prizma TV, Muzsika TV, Universal Channel, Comedy Central, Minimax,
# Cartoon Network, Spektrum, History, Sport1, Sport2, Dorcel TV
[CHANNEL]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 538000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 3/4
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

#
# C.multiplex UHF-61:
# FREE --------------------------------------------------------------------------------
# RTL Klub, TV2, Euronews Test, Info csatorna, Neo FM
# NON-FREE ----------------------------------------------------------------------------
# Cool, Film+, HBO, National Geographic, Disney Channel, AXN, FEM3, Private spice, ATV,
# HirTV, Sportklub
[CHANNEL]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 794000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 3/4
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO