dvbcfg_zapchannel.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * dvbcfg - support for linuxtv configuration files
  3. * zap channel file support
  4. *
  5. * Copyright (C) 2006 Christoph Pfister <christophpfister@gmail.com>
  6. * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  21. */
  22. #ifndef DVBCFG_ZAPCHANNEL_H
  23. #define DVBCFG_ZAPCHANNEL_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #include <libdvbapi/dvbfe.h>
  28. #include <stdio.h>
  29. struct dvbcfg_zapchannel {
  30. char name[128];
  31. int video_pid;
  32. int audio_pid;
  33. int service_id;
  34. enum dvbfe_type fe_type;
  35. struct dvbfe_parameters fe_params;
  36. char polarization; /* l,r,v,h - only used for dvb-s */
  37. int diseqc_switch; /* only used for dvb-s */
  38. };
  39. /**
  40. * Callback used in dvbcfg_zapchannel_parse() and dvbcfg_zapchannel_save()
  41. *
  42. * @param channel Selected channel
  43. * @param private_data Private data for the callback
  44. * @return 0 to continue, other values to stop (values > 0 are forwarded; see below)
  45. */
  46. typedef int (*dvbcfg_zapcallback)(struct dvbcfg_zapchannel *channel, void *private_data);
  47. /**
  48. * Parse a linuxtv channel file
  49. *
  50. * @param file Linuxtv channel file
  51. * @param callback Callback called for each channel
  52. * @param private_data Private data for the callback
  53. * @return on success 0 or value from the callback if it's > 0, error code on failure
  54. */
  55. extern int dvbcfg_zapchannel_parse(FILE *file, dvbcfg_zapcallback callback, void *private_data);
  56. /**
  57. * Save to a linuxtv channel file
  58. *
  59. * @param file Linuxtv channel file
  60. * @param callback Callback called for each channel
  61. * @param private_data Private data for the callback
  62. * @return on success 0 or value from the callback if it's > 0, error code on failure
  63. */
  64. extern int dvbcfg_zapchannel_save(FILE *file, dvbcfg_zapcallback callback, void *private_data);
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* DVBCFG_ZAPCHANNEL_H */