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.

swapdata.cc 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. Swap data filter
  3. Copyright (C) 2008 Olaf Klein, o.b.klein@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. #define MYNAME "swapdata"
  19. #if FILTERS_ENABLED
  20. static
  21. arglist_t swapdata_args[] = {
  22. ARG_TERMINATOR
  23. };
  24. static void
  25. swapdata_cb(const Waypoint* ref)
  26. {
  27. Waypoint* wpt = (Waypoint*)ref;
  28. double x;
  29. x = wpt->latitude;
  30. wpt->latitude = wpt->longitude;
  31. wpt->longitude = x;
  32. return;
  33. }
  34. /*******************************************************************************
  35. * %%% global callbacks called by gpsbabel main process %%% *
  36. *******************************************************************************/
  37. static void
  38. swapdata_process(void) /* this procedure must be present in vecs */
  39. {
  40. waypt_disp_all(swapdata_cb);
  41. route_disp_all(NULL, NULL, swapdata_cb);
  42. track_disp_all(NULL, NULL, swapdata_cb);
  43. }
  44. /*******************************************************************************/
  45. filter_vecs_t swapdata_vecs = {
  46. NULL,
  47. swapdata_process,
  48. NULL,
  49. NULL,
  50. swapdata_args
  51. };
  52. /*******************************************************************************/
  53. #endif // FILTERS_ENABLED