You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

filter_skeleton.cc 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. Filter skeleton:
  3. Simply copy this file to <your_filter_name>.c and
  4. rename all filter_skeleton tokens to <your_filter_name>. Replace
  5. the stupid name and address in the Copyright few lines below.
  6. To active your new filter you have to create a new section in
  7. filter_vecs and finally add complying statements to Makefile.
  8. Copyright (C) YYYY John Doe, anybody@wherever.com
  9. Copyright (C) 2001-YYYY Robert Lipe, robertlipe+source@gpsbabel.org
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2 of the License, or
  13. (at your option) any later version.
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. GNU General Public License for more details.
  18. You should have received a copy of the GNU General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  21. */
  22. #include "defs.h"
  23. #include "filterdefs.h"
  24. #define MYNAME "filter_skeleton"
  25. #if FILTERS_ENABLED
  26. // Any arg in this list will appear in command line help and will be
  27. // populated for you.
  28. static
  29. arglist_t filter_skeleton_args[] = {
  30. // {"foo", &fooopt, "The text of the foo option in help",
  31. // "default", ARGYTPE_STRING, ARG_NOMINMAX} ,
  32. ARG_TERMINATOR
  33. };
  34. /*******************************************************************************
  35. * %%% global callbacks called by gpsbabel main process %%% *
  36. *******************************************************************************/
  37. static void
  38. filter_skeleton_init(const char* args)
  39. {
  40. /* Called before filter processing */
  41. /* optional. If not needed, delete and replace entry in vecs with NULL */
  42. /* This may be used to parse filter options, allocate memory, and do other
  43. * housekeeping that should be done before filtering */
  44. }
  45. static void
  46. filter_skeleton_process(void) /* this procedure must be present in vecs */
  47. {
  48. // Here is how you register callbacks for all waypoints, routes, tracks.
  49. // waypt_disp_all(waypt)
  50. // route_disp_all(head, tail, rtept);
  51. // track_disp_all(head, tail, trkpt);
  52. }
  53. static void
  54. filter_skeleton_deinit(void)
  55. {
  56. /* called after filter processing */
  57. /* optional. If not needed, delete and replace entry in vecs with NULL */
  58. /* This should be used to clean up any memory allocations that are no longer
  59. * needed after the filter terminates. */
  60. }
  61. static void
  62. filter_skeleton_exit(void)
  63. {
  64. /* called on program exit */
  65. /* optional. If not needed, delete and replace entry in vecs with NULL */
  66. /* You should not need this for simple filters, but it may be used to
  67. * clean up memory allocations that must persist from one invocation of
  68. * your filter to the next (for example, the stack in the stack filter.)
  69. * Note that this member will be called even if your filter has not been
  70. * used, so it *cannot* assume that _init or _process has been called
  71. * previously. */
  72. }
  73. /*******************************************************************************/
  74. filter_vecs_t filter_skeleton_vecs = {
  75. filter_skeleton_init,
  76. filter_skeleton_process,
  77. filter_skeleton_deinit,
  78. filter_skeleton_exit,
  79. filter_skeleton_args
  80. };
  81. /*******************************************************************************/
  82. #endif // FILTERS_ENABLED