/* * 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_SHORT_EVENT_DESCRIPTOR #define _UCSI_DVB_SHORT_EVENT_DESCRIPTOR 1 #ifdef __cplusplus extern "C" { #endif #include #include #include /** * dvb_short_event_descriptor structure. */ struct dvb_short_event_descriptor { struct descriptor d; iso639lang_t language_code; uint8_t event_name_length; /* uint8_t event_name[] */ /* struct dvb_short_event_descriptor_part2 part2 */ } __ucsi_packed; /** * Second part of a dvb_short_event_descriptor, following the variable length * name field. */ struct dvb_short_event_descriptor_part2 { uint8_t text_length; /* uint8_t text[] */ } __ucsi_packed; /** * Process a dvb_short_event_descriptor. * * @param d Generic descriptor pointer. * @return dvb_short_event_descriptor pointer, or NULL on error. */ static inline struct dvb_short_event_descriptor* dvb_short_event_descriptor_codec(struct descriptor* d) { struct dvb_short_event_descriptor *p = (struct dvb_short_event_descriptor*) d; struct dvb_short_event_descriptor_part2 *p2; uint32_t pos = sizeof(struct dvb_short_event_descriptor) - 2; uint32_t len = d->len; if (pos > len) return NULL; pos += p->event_name_length; if (pos > len) return NULL; p2 = (struct dvb_short_event_descriptor_part2*) ((uint8_t*) d + 2 + pos); pos += sizeof(struct dvb_short_event_descriptor_part2); if (pos > len) return NULL; pos += p2->text_length; if (pos != len) return NULL; return p; } /** * Accessor for name field in a dvb_short_event_descriptor. * * @param d dvb_short_event_descriptor pointer. * @return Pointer to name field. */ static inline uint8_t * dvb_short_event_descriptor_event_name(struct dvb_short_event_descriptor *d) { return (uint8_t *) d + sizeof(struct dvb_short_event_descriptor); } /** * Accessor for second part of a dvb_short_event_descriptor. * * @param d dvb_short_event_descriptor pointer. * @return dvb_short_event_descriptor_part2 pointer. */ static inline struct dvb_short_event_descriptor_part2 * dvb_short_event_descriptor_part2(struct dvb_short_event_descriptor *d) { return (struct dvb_short_event_descriptor_part2 *) ((uint8_t*) d + sizeof(struct dvb_short_event_descriptor) + d->event_name_length); } /** * Accessor for text field in a dvb_short_event_descriptor_part2. * * @param d dvb_short_event_descriptor_part2 pointer. * @return Pointer to text field. */ static inline uint8_t * dvb_short_event_descriptor_text(struct dvb_short_event_descriptor_part2 *d) { return (uint8_t *) d + sizeof(struct dvb_short_event_descriptor_part2); } #ifdef __cplusplus } #endif #endif /commit/plugin_button_exec.c?id=10178eea94afed7253ccd755a1d367d4017f8b36&follow=1'>Import upstream version 0.11.0~svn1189Jonathan McCrohan3-6/+6 2012-05-19Fixes plugin_file syslog flood if file does not existJonathan McCrohan1-0/+1 2012-05-17d/rules: Add get-orig-source targetJonathan McCrohan3-0/+23 2012-05-17Import upstream version 0.11.0~svn1188Jonathan McCrohan12-428/+435 2012-05-17Undo wrap-and-sort for Uploaders: field.Jonathan McCrohan1-2/+1 dch thinks I'm NMU'ing. 2012-03-18update debian/changelogReinhard Tartler1-1/+6 2012-03-18Update Vcs-Bzr control field to new team addressReinhard Tartler1-1/+1 2012-03-09* Rewrite init script to use lsb-base functionsJonathan McCrohan2-7/+13 - fixes issue where invoke-rc.d would return error status during installation 2012-03-09Add watchfile lintian override; Using upstream svn instead Jonathan McCrohan2-1/+4 2012-03-08Update to S-V 3.9.3Jonathan McCrohan2-2/+3 2012-03-08* Rewrite init script to use lsb-base functions.Jonathan McCrohan3-15/+16 - init.d-script-does-not-implement-optional-option 2012-03-08copyright-refers-to-symlink-licenseJonathan McCrohan2-2/+3 2012-03-08* Lintian fixesJonathan McCrohan2-4/+7 - spelling-error-in-manpage 2012-03-08Import upstream version 0.11.0~svn1180Jonathan McCrohan19-2871/+3952 2011-12-27Import upstream version 0.11.0~svn1165Jonathan McCrohan6-166/+495 2011-12-25Import upstream version 0.11.0~svn1164Jonathan McCrohan11-162/+315 2011-12-25Update libmysqlclient-dev virtual package in build-depends.Jonathan McCrohan1-1/+1 Thanks to Clint Byrum <clint@ubuntu.com> for the patch. 2011-08-31Import upstream version 0.11.0~svn1159Jonathan McCrohan4-5/+5 2011-08-30update debian/changelogReinhard Tartler1-1/+4 2011-08-28* New upstream snapshotJonathan McCrohan2-4/+11 * Make lcd4linux linux specific (requested by kFreeBSD team) * Add optional build targets build-indep and build-dep (thanks to lintian for catching this) 2011-08-26Import upstream version 0.11.0~svn1158Reinhard Tartler34-1743/+4490 2011-08-20normalize with wrap-and-sort(1)Reinhard Tartler2-17/+20 2011-08-20Make lcd4linux linux specificReinhard Tartler1-2/+1 on request of freebsd porters: http://permalink.gmane.org/gmane.linux.debian.devel.general/164670 2011-04-29add sqlite3-dev to build dependssiretart@tauware.de2-2/+4 2011-04-29mention new co-maintainersiretart@tauware.de1-0/+1 2011-04-29add libdbus-1-dev to build dependssiretart@tauware.de2-1/+3 2011-04-29normalize fields with wrap-and-sort(1)siretart@tauware.de2-18/+20 2011-04-29fix order of calling dh_autoreconf_cleansiretart@tauware.de1-1/+1 avoids leftover debhelper log file 2011-04-29Add Uploader details to Debian PackageJonathan McCrohan1-0/+1 2011-04-27Bug fix: "script lcd4linux/init.d/lcd4linux missing dependency onReinhard Tartler2-1/+5 $syslog", thanks to Petter Reinholdtsen (Closes: #582825). 2011-04-27No longer build the mpd module. Closes: #578226Reinhard Tartler1-0/+1 2011-04-27No longer compile against Python. Python 2.6 now links against libssl,Reinhard Tartler2-2/+3 which is in conflicts with the package license GPL.