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.

garmin_device_xml.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. Parse 'GarminDevice.xml' on a Garmin mass storage device (e.g. Zumo,
  3. Nuvi, Colorado, etc. and return key device info.
  4. Copyright (C) 2008-2014 Robert Lipe
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
  16. */
  17. /*
  18. * Describes a file on the unit.
  19. */
  20. typedef struct {
  21. char* path;
  22. char* basename;
  23. char* extension;
  24. char* canon; // full name, when applicable.
  25. } gdx_file;
  26. /*
  27. * The interesting traits of this device.
  28. */
  29. typedef struct {
  30. const char* device_desc;
  31. const char* device_id;
  32. const char* device_mounted_path; // Not from the file; about the file.
  33. gdx_file from_device;
  34. gdx_file to_device;
  35. // gdx_file geocache_logs;
  36. } gdx_info;
  37. const gdx_info* gdx_read(const char* fname);
  38. const gdx_info* gdx_get_info(void);
  39. const gdx_info* gdx_find_file(char** dirlist);
  40. // This is so gross. By the time we know it's not a USB device
  41. // and could be one of our devices, we're so deep into the callstack
  42. // that can't back out tracefully without bludgeoning most of the
  43. // (Mac|Lin|Win) x (USB|Serial) matrix. Since we don't *really* want
  44. // to progress any further, we just longjump back to the caller...
  45. #include <setjmp.h>
  46. extern jmp_buf gdx_jmp_buf;