libdvbpsi  0.2.2
cat.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * cat.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id$
5  *
6  * Authors: Johann Hanne
7  * heavily based on pmt.h which was written by
8  * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  *****************************************************************************/
25 
35 #ifndef _DVBPSI_CAT_H_
36 #define _DVBPSI_CAT_H_
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 /*****************************************************************************
44  * dvbpsi_cat_t
45  *****************************************************************************/
57 typedef struct dvbpsi_cat_s
58 {
59  uint8_t i_version;
64 } dvbpsi_cat_t;
65 
66 
67 /*****************************************************************************
68  * dvbpsi_cat_callback
69  *****************************************************************************/
75 typedef void (* dvbpsi_cat_callback)(void* p_cb_data, dvbpsi_cat_t* p_new_cat);
76 
77 
78 /*****************************************************************************
79  * dvbpsi_AttachCAT
80  *****************************************************************************/
89 __attribute__((deprecated))
90 dvbpsi_handle dvbpsi_AttachCAT(dvbpsi_cat_callback pf_callback,
91  void* p_cb_data);
92 
93 
94 /*****************************************************************************
95  * dvbpsi_DetachCAT
96  *****************************************************************************/
105 __attribute__((deprecated))
106 void dvbpsi_DetachCAT(dvbpsi_handle h_dvbpsi);
107 
108 
109 /*****************************************************************************
110  * dvbpsi_InitCAT/dvbpsi_NewCAT
111  *****************************************************************************/
121 __attribute__((deprecated))
122 void dvbpsi_InitCAT(dvbpsi_cat_t* p_cat,
123  uint8_t i_version, int b_current_next);
124 
134 #define dvbpsi_NewCAT(p_cat, \
135  i_version, b_current_next) \
136 do { \
137  p_cat = (dvbpsi_cat_t*)malloc(sizeof(dvbpsi_cat_t)); \
138  if(p_cat != NULL) \
139  dvbpsi_InitCAT(p_cat, i_version, b_current_next); \
140 } while(0);
141 
142 
143 /*****************************************************************************
144  * dvbpsi_EmptyCAT/dvbpsi_DeleteCAT
145  *****************************************************************************/
152 __attribute__((deprecated))
153 void dvbpsi_EmptyCAT(dvbpsi_cat_t* p_cat);
154 
161 #define dvbpsi_DeleteCAT(p_cat) \
162 do { \
163  dvbpsi_EmptyCAT(p_cat); \
164  free(p_cat); \
165 } while(0);
166 
167 
168 /*****************************************************************************
169  * dvbpsi_CATAddDescriptor
170  *****************************************************************************/
183 __attribute__((deprecated))
184 dvbpsi_descriptor_t* dvbpsi_CATAddDescriptor(dvbpsi_cat_t* p_cat,
185  uint8_t i_tag, uint8_t i_length,
186  uint8_t* p_data);
187 
188 
189 /*****************************************************************************
190  * dvbpsi_GenCATSections
191  *****************************************************************************/
200 __attribute__((deprecated))
201 dvbpsi_psi_section_t* dvbpsi_GenCATSections(dvbpsi_cat_t* p_cat);
202 
203 
204 #ifdef __cplusplus
205 };
206 #endif
207 
208 #else
209 #error "Multiple inclusions of cat.h"
210 #endif
211