dvbcfg_scanfile.h 1.9 KB

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