All tables are now using DVBv5 format. That allows suporting all standards available on a standard way. GENERATING FILES TO THE LEGACY DVBV3 FORMAT =========================================== A Makefile target is provided to convert to the legacy channel format. For it to work, you need to have v4l-utils installed (specifically, the v4l-utils package that contains the dvbv5 utils). Be sure that you have at least version 1.4.0 installed, or, if you're compiling v4l-utils from its source. Versions below may work too, but some DVB files won't be properly parsed with earlier versions. This is the minimal changeset of v4l-utils required for it to work: commit 64751eb98a15b9c0077d8c2e4409b9b69ac80448 Date: Fri Sep 5 15:50:43 2014 -0300 Subject: libdvbv5: make sure that all needed properties are filled You can download and install v4l-utils from: http://git.linuxtv.org/cgit.cgi/v4l-utils.git/ Once having it installed, generating all the tables usind DVBv3 channel format is as easy as running: $ make clean $ make dvbv3 The files can also be individually converted from DVBv5 to DVBv3 with: $ dvb-format-convert -I dvbv5 -O channel dvb-c/ch-Rega-Sense legacy-format-ch-Rega-Sense And converting back into DVBv5 format with: $ dvb-format-convert -I channel -O dvbv5 legacy-format-ch-Rega-Sense dvb-c/ch-Rega-Sense Plese notice that comments are not preserved when doing the conversions. PS.: If you're willing to submit new entries and/or corrections, please be sure to send them at the DVBv5 format and sending them via e-mail to linux-media@vger.kernel.org. INSTALL ======= In order to install the files, use: $ make install By default, it will install the files at /usr/local/share/dvbv5. In order to install the legacy v3 formatted files, use: $ make install_v3 Don't forget to run "make dvbv3" before running the above command, in order to convert the files to the legacy format. By default, it will install the files at /usr/local/share/dvbv3. There are a few extra parameters that could be used to define where the files will be stored: PREFIX= (default: /usr/local) DATADIR= (default: $(PREFIX/share) DVBV5DIR= (default: dvbv3) DVBV3DIR= (default: dvbv5) So, if it is desired to install both v3 and v5 files at a tmp file, under the current dir, the install command would be: $ make install install_v3 PREFIX=`pwd`/tmp Installing dvbv5-formatted files at /home/myuser/dtv-scan-tables/tmp/share/dvbv5...done. Installing dvbv3-formatted files at /home/myuser/dtv-scan-tables/tmp/share/dvbv3...done. Please also note that install takes some time, as there are lots of files to be copied. f='#n7'>7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
/* $Id: seti.c,v 1.13 2004/01/29 04:40:03 reinelt Exp $
 *
 * seti@home specific functions
 *
 * Copyright 2001 Axel Ehnert <axel@ehnert.net>
 *
 * 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.
 *
 *
 * $Log: seti.c,v $
 * Revision 1.13  2004/01/29 04:40:03  reinelt
 * every .c file includes "config.h" now
 *
 * Revision 1.12  2004/01/09 04:16:06  reinelt
 * added 'section' argument to cfg_get(), but NULLed it on all calls by now.
 *
 * Revision 1.11  2004/01/06 22:33:14  reinelt
 * Copyright statements cleaned up
 *
 * Revision 1.10  2003/10/05 17:58:50  reinelt
 * libtool junk; copyright messages cleaned up
 *
 * Revision 1.9  2003/08/24 05:17:58  reinelt
 * liblcd4linux patch from Patrick Schemitz
 *
 * Revision 1.8  2003/06/13 05:11:11  reinelt
 * error message cosmetics
 *
 * Revision 1.7  2003/02/22 07:53:10  reinelt
 * cfg_get(key,defval)
 *
 * Revision 1.6  2001/09/12 05:37:22  reinelt
 *
 * fixed a bug in seti.c (file was never closed, lcd4linux run out of fd's
 *
 * improved socket debugging
 *
 * Revision 1.5  2001/08/05 17:13:29  reinelt
 *
 * cleaned up inlude of sys/time.h and time.h
 *
 * Revision 1.4  2001/03/08 09:02:04  reinelt
 *
 * seti client cleanup
 *
 * Revision 1.3  2001/02/19 00:15:46  reinelt
 *
 * integrated mail and seti client
 * major rewrite of parser and tokenizer to support double-byte tokens
 *
 * Revision 1.2  2001/02/18 21:16:06  reinelt
 * *** empty log message ***
 *
 * Revision 1.1  2001/02/18 21:15:15  reinelt
 *
 * added setiathome client
 *
 */

/* 
 * exported functions:
 *
 * Seti (int *perc, int *cput)
 *   returns 0 if ok, -1 if error
 *   sets *perc to the percentage completed by seti@home client
 *   sets *perc to the cpu time used
 *
 */


#define STATEFILE "state.sah"

#include "config.h"

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>
#include <sys/ioctl.h>
#include <sys/types.h>

#include "cfg.h"
#include "debug.h"
#include "seti.h"


int Seti (double *perc, double *cput)
{
  static char fn[256];
  static time_t now=0;
  static int fd=-2;
  static double v1=0;
  static double v2=0;
  char buffer[8192], *p;
  
  *perc=v1;
  *cput=v2;

  if (fd==-1) return -1;
  
  if (time(NULL)==now) return 0;
  time(&now);
  
  if (fd==-2) {
    char *dir=cfg_get(NULL, "SetiDir", NULL);
    if (dir==NULL || *dir=='\0') {
      error ("no 'SetiDir' entry in %s!\n", cfg_source());
      fd=-1;
      return -1;
    }
    if (strlen(dir)>sizeof(fn)-sizeof(STATEFILE)-2) {
      error ("entry 'SetiDir' too long in %s!\n", cfg_source());
      fd=-1;
      return -1;
    }
    strcpy(fn, dir);
    strcat(fn, "/");
    strcat(fn, STATEFILE);
  }

  fd = open(fn, O_RDONLY);
  if (fd==-1) {
    error ("open(%s) failed: %s", fn, strerror(errno));
    return -1;
  }

  if (read (fd, &buffer, sizeof(buffer)-1)==-1) {
    error ("read(%s) failed: %s", fn, strerror(errno));
    close (fd);
    fd=-1;
    return -1;
  }

  close (fd);
  
  p=strstr(buffer, "prog=");
  if (p==NULL) {
    error ("parse(%s) failed: no 'prog=' line", fn);
    fd=-1;
    return -1;
  }
  if (sscanf(p+5, "%lf", &v1)!=1) {
    error ("parse(%s) failed: unknown 'prog=' format", fn);
    fd=-1;
    return -1;
  }

  p=strstr(buffer, "cpu=");
  if (p==NULL) {
    error ("parse(%s) failed: no 'cpu=' line", fn);
    fd=-1;
    return -1;
  }
  if (sscanf(p+4, "%lf", &v2)!=1) {
    error ("parse(%s) failed: unknown 'cpu=' format", fn);
    fd=-1;
    return -1;
  }

  *perc=v1;
  *cput=v2;

  return 0;

}