00001 /* 00002 * 00003 * This file is part of the 'NewsService Journaline(R) Decoder' 00004 * 00005 * Copyright (c) 2003, 2004 by Fraunhofer IIS, Erlangen, Germany 00006 * 00007 * -------------------------------------------------------------------- 00008 * 00009 * For NON-COMMERCIAL USE, 00010 * the 'NewsService Journaline(R) Decoder' is free software; 00011 * you can redistribute it and/or modify it under the terms of 00012 * the GNU General Public License as published by the 00013 * Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * The 'NewsService Journaline(R) Decoder' is distributed in the hope 00017 * that it will be useful, but WITHOUT ANY WARRANTY; 00018 * without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with the 'NewsService Journaline(R) Decoder'; 00024 * if not, write to the Free Software Foundation, Inc., 00025 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 * 00027 * 00028 * If you use this software in a project with user interaction, please 00029 * provide the following text to the user in an appropriate place: 00030 * "Features NewsService Journaline(R) decoder technology by 00031 * Fraunhofer IIS, Erlangen, Germany. 00032 * For more information visit http://www.iis.fhg.de/dab" 00033 * 00034 * -------------------------------------------------------------------- 00035 * 00036 * To use the 'NewsService Journaline(R) Decoder' software for 00037 * COMMERCIAL purposes, please contact Fraunhofer IIS for a 00038 * commercial license (see below for contact information)! 00039 * 00040 * -------------------------------------------------------------------- 00041 * 00042 * Contact: 00043 * Fraunhofer IIS, Department 'Broadcast Applications' 00044 * Am Wolfsmantel 33, 91058 Erlangen, Germany 00045 * http://www.iis.fraunhofer.de/dab 00046 * mailto:bc-info@iis.fraunhofer.de 00047 * 00048 */ 00049 00050 #ifndef __NEWS_SVC_DEC__ 00051 #define __NEWS_SVC_DEC__ 00052 00090 #ifdef __cplusplus 00091 extern "C" { 00092 #endif 00093 00094 00096 typedef const void* NEWS_SVC_DEC_decoder_t; 00097 00098 00100 typedef enum 00101 { 00102 NEWS_SVC_DEC_OBJ_NOT_YET_AVAILABLE, 00103 NEWS_SVC_DEC_OBJ_REMOVED, 00105 NEWS_SVC_DEC_OBJ_RECEIVED, 00106 NEWS_SVC_DEC_OBJ_UPDATED 00107 } NEWS_SVC_DEC_obj_availability_status_t; 00108 00110 typedef struct 00111 { 00112 unsigned short object_id; 00113 NEWS_SVC_DEC_obj_availability_status_t status; 00115 } NEWS_SVC_DEC_obj_availability_t; 00116 00117 00132 typedef void(NEWS_SVC_DEC_cb)( 00133 unsigned long number_of_elements, 00134 NEWS_SVC_DEC_obj_availability_t *chg_list, 00135 void *arg 00136 ); 00137 00138 00139 00140 00141 /**************************************************************************** 00142 * 00143 * public function interface 00144 * 00145 ****************************************************************************/ 00146 00147 00148 /******************************************* 00149 * 1. object lifetime control * 00150 *******************************************/ 00151 00178 NEWS_SVC_DEC_decoder_t NEWS_SVC_DEC_createDec( 00179 NEWS_SVC_DEC_cb update, 00180 unsigned long max_memory, 00181 unsigned long *max_objects, 00182 unsigned long extended_header_len, 00183 void *arg 00184 ); 00185 00198 void NEWS_SVC_DEC_deleteDec( 00199 NEWS_SVC_DEC_decoder_t decoder 00200 ); 00201 00202 00203 /******************************************* 00204 * 2. news service pull functions * 00205 *******************************************/ 00206 00227 int NEWS_SVC_DEC_get_news_object( 00228 NEWS_SVC_DEC_decoder_t decoder, 00229 unsigned short object_id, 00230 unsigned long *extended_header_len, 00231 unsigned long *len, 00232 unsigned char *nml 00233 ); 00234 00235 00253 int NEWS_SVC_DEC_get_object_availability( 00254 NEWS_SVC_DEC_decoder_t decoder, 00255 unsigned long number_of_elements, 00256 NEWS_SVC_DEC_obj_availability_t *query_list 00257 ); 00258 00259 00260 /******************************************* 00261 * 3. data provision * 00262 *******************************************/ 00263 00278 unsigned long NEWS_SVC_DEC_putData( 00279 NEWS_SVC_DEC_decoder_t decoder, 00280 const unsigned long len, 00281 const unsigned char *buf 00282 ); 00283 00284 00285 /******************************************* 00286 * 4. watch and cache management * 00287 *******************************************/ 00288 00313 int NEWS_SVC_DEC_watch_objects( 00314 NEWS_SVC_DEC_decoder_t decoder, 00315 unsigned long number_of_elements, 00316 NEWS_SVC_DEC_obj_availability_t *watch_list 00317 ); 00318 00342 int NEWS_SVC_DEC_keep_in_cache( 00343 NEWS_SVC_DEC_decoder_t decoder, 00344 unsigned long number_of_elements, 00345 unsigned short *object_ids 00346 ); 00347 00348 #ifdef __cplusplus 00349 } 00350 #endif 00351 00352 #endif /* __NEWS_SVC_DEC__ */