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.

nukedata.cc 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. nukedata: remove all (waypoint|tracks|routes) from the stream.
  3. Copyright (C) 2005 Robert Lipe robertlipe+source@gpsbabel.org
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  15. */
  16. #include "defs.h"
  17. #include "filterdefs.h"
  18. #if FILTERS_ENABLED
  19. #define MYNAME "nukedata"
  20. static char* nukewpts, *nuketrks, *nukertes;
  21. static
  22. arglist_t nuke_args[] = {
  23. {
  24. "waypoints", &nukewpts, "Remove all waypoints from data stream",
  25. "0", ARGTYPE_BOOL, ARG_NOMINMAX
  26. } ,
  27. {
  28. "tracks", &nuketrks, "Remove all tracks from data stream",
  29. "0", ARGTYPE_BOOL, ARG_NOMINMAX
  30. } ,
  31. {
  32. "routes", &nukertes, "Remove all routes from data stream",
  33. "0", ARGTYPE_BOOL, ARG_NOMINMAX
  34. } ,
  35. ARG_TERMINATOR
  36. };
  37. static void
  38. nuke_process(void)
  39. {
  40. if (*nukewpts != '0') {
  41. waypt_flush_all();
  42. }
  43. if (*nuketrks != '0') {
  44. route_flush_all_tracks();
  45. }
  46. if (*nukertes != '0') {
  47. route_flush_all_routes();
  48. }
  49. }
  50. filter_vecs_t nuke_vecs = {
  51. NULL,
  52. nuke_process,
  53. NULL,
  54. NULL,
  55. nuke_args
  56. };
  57. #endif