aboutsummaryrefslogtreecommitdiffstats
BranchCommit messageAuthorAge
masterRelease 0.9.1-1Jonathan McCrohan6 years
upstreamNew upstream version 0.9.1Jonathan McCrohan6 years
 
TagDownloadAuthorAge
debian/0.9.1-1wavemon-debian/0.9.1-1.tar.gz  Jonathan McCrohan6 years
upstream/0.9.1wavemon-upstream/0.9.1.tar.gz  Jonathan McCrohan6 years
debian/0.8.2-1wavemon-debian/0.8.2-1.tar.gz  Jonathan McCrohan8 years
upstream/0.8.2wavemon-upstream/0.8.2.tar.gz  Jonathan McCrohan8 years
debian/0.8.1-1wavemon-debian/0.8.1-1.tar.gz  Jonathan McCrohan9 years
upstream/0.8.1wavemon-upstream/0.8.1.tar.gz  Jonathan McCrohan9 years
upstream/0.8.0wavemon-upstream/0.8.0.tar.gz  Jonathan McCrohan10 years
debian/0.7.6-4wavemon-debian/0.7.6-4.tar.gz  Jonathan McCrohan11 years
debian/0.7.6-3wavemon-debian/0.7.6-3.tar.gz  Jonathan McCrohan11 years
debian/0.7.6-2wavemon-debian/0.7.6-2.tar.gz  Jonathan McCrohan12 years
debian/0.7.6-1wavemon-debian/0.7.6-1.tar.gz  Jonathan McCrohan12 years
upstream/0.7.6wavemon-upstream/0.7.6.tar.gz  Jonathan McCrohan12 years
debian/0.7.5-3wavemon-debian/0.7.5-3.tar.gz  Jonathan McCrohan14 years
debian/0.7.5-2wavemon-debian/0.7.5-2.tar.gz  Jonathan McCrohan14 years
debian/0.7.5-1wavemon-debian/0.7.5-1.tar.gz  Jonathan McCrohan14 years
upstream/0.7.5wavemon-upstream/0.7.5.tar.gz  Jonathan McCrohan14 years
debian/0.7.4-1wavemon-debian/0.7.4-1.tar.gz  Jonathan McCrohan14 years
debian/0.7.3-1wavemon-debian/0.7.3-1.tar.gz  Jonathan McCrohan14 years
upstream/0.7.4wavemon-upstream/0.7.4.tar.gz  Jonathan McCrohan14 years
upstream/0.7.3wavemon-upstream/0.7.3.tar.gz  Jonathan McCrohan14 years
debian/0.6.10-1wavemon-debian/0.6.10-1.tar.gz  Jonathan McCrohan14 years
upstream/0.6.10wavemon-upstream/0.6.10.tar.gz  Jonathan McCrohan14 years
umber.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 */
/*
 * section and descriptor parser
 *
 * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org)
 * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#ifndef _UCSI_DVB_TELETEXT_DESCRIPTOR
#define _UCSI_DVB_TELETEXT_DESCRIPTOR 1

#ifdef __cplusplus
extern "C"
{
#endif

#include <libucsi/descriptor.h>
#include <libucsi/endianops.h>
#include <libucsi/types.h>

/**
 * Possible values for the type field.
 */
enum {
	DVB_TELETEXT_TYPE_INITIAL		= 0x01,
	DVB_TELETEXT_TYPE_SUBTITLE		= 0x02,
	DVB_TELETEXT_TYPE_ADDITIONAL		= 0x03,
	DVB_TELETEXT_TYPE_SCHEDULE		= 0x04,
	DVB_TELETEXT_TYPE_SUBTITLE_HEARING_IMPAIRED= 0x05,
};

/**
 * dvb_teletext_descriptor structure.
 */
struct dvb_teletext_descriptor {
	struct descriptor d;

	/* struct dvb_teletext_entry entries[] */
} __ucsi_packed;

/**
 * An entry in the entries field of a dvb_teletext_descriptor.
 */
struct dvb_teletext_entry {
	iso639lang_t language_code;
  EBIT2(uint8_t type		: 5; ,
	uint8_t magazine_number: 3; );
	uint8_t page_number;
} __ucsi_packed;

/**
 * Process a dvb_teletext_descriptor.
 *
 * @param d Generic descriptor.
 * @return dvb_teletext_descriptor pointer, or NULL on error.
 */
static inline struct dvb_teletext_descriptor*
	dvb_teletext_descriptor_codec(struct descriptor* d)
{
	if (d->len % sizeof(struct dvb_teletext_entry))
		return NULL;

	return (struct dvb_teletext_descriptor*) d;
}

/**
 * Iterator for entries field of a dvb_teletext_descriptor.
 *
 * @param d dvb_teletext_descriptor pointer.
 * @param pos Variable holding a pointer to the current dvb_teletext_entry.
 */
#define dvb_teletext_descriptor_entries_for_each(d, pos) \
	for ((pos) = dvb_teletext_descriptor_entries_first(d); \
	     (pos); \
	     (pos) = dvb_teletext_descriptor_entries_next(d, pos))










/******************************** PRIVATE CODE ********************************/
static inline struct dvb_teletext_entry*
	dvb_teletext_descriptor_entries_first(struct dvb_teletext_descriptor *d)
{
	if (d->d.len == 0)
		return NULL;

	return (struct dvb_teletext_entry *)
		((uint8_t*) d + sizeof(struct dvb_teletext_descriptor));
}

static inline struct dvb_teletext_entry*
	dvb_teletext_descriptor_entries_next(struct dvb_teletext_descriptor *d,
					     struct dvb_teletext_entry *pos)
{
	uint8_t *end = (uint8_t*) d + 2 + d->d.len;
	uint8_t *next =	(uint8_t *) pos + sizeof(struct dvb_teletext_entry);

	if (next >= end)
		return NULL;

	return (struct dvb_teletext_entry *) next;
}

#ifdef __cplusplus
}
#endif

#endif