aboutsummaryrefslogtreecommitdiffstats
path: root/isdb-t/br-go-Alexania
blob: b004d31bf1b6c54e39ac75578669d7c7d89d904c (plain)
1
2
3
4
5
6
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
# Channel table for Alexânia - GO - Brazil
# Source: http://www.portalbsd.com.br/terrestres_channels.php?channels=2494

# Physical channel 33
[TV Anhanguera Anápolis]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 587142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0
utput */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* $Id: plugin_mysql.c,v 1.3 2004/03/21 22:05:53 reinelt Exp $
 *
 * plugin for execute SQL queries into a MySQL DBSM.
 *
 * Copyright 2004 Javier Garcia <javi@gsmlandia.com>
 * Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.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: plugin_mysql.c,v $
 * Revision 1.3  2004/03/21 22:05:53  reinelt
 * MySQL plugin fixes from Javi
 *
 * Revision 1.2  2004/03/20 23:09:01  reinelt
 * MySQL plugin fixes from Javi
 *
 * Revision 1.1  2004/03/10 07:16:15  reinelt
 * MySQL plugin from Javier added
 *
 */

/* DOC:
 * To compile the plugin remember to add -lmysqlclient option into Makefile. I.E: CC = gcc -lmysqlclient 
 * or run:
 * $ gcc -I/usr/include/mysql -L/usr/lib/mysql plugin_mysql.c -lmysqlclient -o plugin_mysql.o
 *
 * exported functions:
 *
 * int plugin_init_mysql (void)
 *
 *  adds various functions:
 *     MySQLquery(query) 
 *        Returns the number of rows in query.
 *     MySQLstatus()
 *        Returns the current server status:
 *        Uptime in seconds and the number of running threads,
 *        questions, reloads, and open tables.
 *
 */

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "debug.h"
#include "plugin.h"
#include "cfg.h"

#ifdef HAVE_MYSQL_MYSQL_H
#include <mysql/mysql.h>
#else
#warning mysql/mysql.h not found: plugin deactivated
#endif

#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif


#ifdef HAVE_MYSQL_MYSQL_H
static MYSQL conex;

static char Section[] = "Plugin:MySQL";

static void my_MySQLquery (RESULT *result, RESULT *query)
{
  double value;
  MYSQL_RES *res;
  char *q=R2S(query);
  
  /* mysql_ping(MYSQL *mysql) checks whether the connection to the server is working.
     If it has gone down, an automatic reconnection is attempted. */
  mysql_ping(&conex);
  if (mysql_real_query(&conex,q,(unsigned int) strlen(q)))
  {
    error( "[MySQL] query error: %s",mysql_error(&conex));
    value=-1;
  }
  else
    {
    /* We don't use res=mysql_use_result();  because mysql_num_rows() will not
       return the correct value until all the rows in the result set have been retrieved
       with mysql_fetch_row(), so we use res=mysql_store_result(); instead */
    res=mysql_store_result(&conex);   
    value = (double) mysql_num_rows(res);
    mysql_free_result(res);
  }

  SetResult(&result, R_NUMBER, &value); 
}

static void my_MySQLstatus (RESULT *result)
{
  char *value;
  char *status;
  
  mysql_ping(&conex);
  status=strdup(mysql_stat(&conex));
  if (!status)
  {
    error( "[MySQL] status error: %s",mysql_error(&conex));
    value="error";
  }
  else value = status;
  
  SetResult(&result, R_STRING, value); 
}

#endif

int plugin_init_mysql (void)
{
#ifdef HAVE_MYSQL_MYSQL_H
  char server[256];
  unsigned int port;
  char user[128];
  char password[256];
  char database[256];  

  char *s = cfg_get (Section, "server", "localhost");
  if (*s=='\0') {
    info ("[MySQL] empty '%s.server' entry from %s, assuming 'localhost'", Section, cfg_source());
    strcpy(server,"localhost"); 
  }
  else strcpy(server,s);
  free(s);
  
  if (cfg_number(Section, "port", 0, 1, 65536, &port)<1) {
    /* using 0 as default port because mysql_real_connect() will convert it to real default one */
    info ("[MySQL] no '%s.port' entry from %s using MySQL's default", Section, cfg_source());
  }

  s = cfg_get (Section, "user", "");
  if (*s=='\0') {
    /* If user is NULL or the empty string "", the lcd4linux Unix user is assumed. */
    info ("[MySQL] empty '%s.user' entry from %s, assuming lcd4linux owner", Section, cfg_source());
    strcpy(user,""); 
  }
  else strcpy(user,s);
  free(s);   

  s = cfg_get (Section, "password","");
  /*Do not encrypt the password because encryption is handled automatically
   by the MySQL client API.*/  
  if (*s=='\0') {
    info ("[MySQL] empty '%s.password' entry in %s, assuming none", Section, cfg_source());
    strcpy(password,""); 
  }
  else strcpy(password,s);
  free(s);  
  
  s = cfg_get (Section, "database","\0");
  if (*s=='\0') {
    error ("[MySQL] no '%s:database' entry from %s, specify one", Section, cfg_source());
  }
  else {
    strcpy(database,s);
    free(s);  
    
    mysql_init(&conex);
    if (!mysql_real_connect(&conex,server,user,password,database,port,NULL,0))
      error( "[MySQL] conection error: %s",mysql_error(&conex));
    else
    {
      AddFunction ("MySQL::query",  1, my_MySQLquery);
      AddFunction ("MySQL::status", 0, my_MySQLstatus);
    }
  }
#endif
  return 0;
}

void plugin_exit_mysql(void) 
{
#ifdef HAVE_MYSQL_MYSQL_H
  mysql_close(&conex);
#endif
}