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.

72 lines
1.3KB

  1. // Display all the Garmin icons that we know about so we can copy/paste
  2. // into our doc, http://www.gpsbabel.org/htmldoc-development/GarminIcons.html
  3. #include "fatal.cc"
  4. #include "util.cc"
  5. #include "cet.cc"
  6. #include "globals.cc"
  7. #include "jeeps/gpsmath.cc"
  8. #include <stdlib.h> // qsort
  9. void tbl_ent(int n, ...)
  10. {
  11. int i;
  12. char* t;
  13. va_list args;
  14. va_start(args, n);
  15. #if 0
  16. for (i = 0; i < n; i++) {
  17. t = va_arg(args, char*);
  18. printf("%s%s", i > 0 ? "," : "", t);
  19. }
  20. #else
  21. t = va_arg(args, char*);
  22. printf("<member>%s</member>", t);
  23. #endif
  24. printf("\n");
  25. va_end(args);
  26. }
  27. #include "garmin_tables.cc"
  28. int sort_garmin(const void* a, const void* b)
  29. {
  30. const icon_mapping_t* ap = (const icon_mapping_t*) a;
  31. const icon_mapping_t* bp = (const icon_mapping_t*) b;
  32. return (case_ignore_strcmp((ap)->icon, (bp)->icon));
  33. }
  34. void garmin()
  35. {
  36. icon_mapping_t* i;
  37. int n = 0;
  38. char pbuf[100];
  39. char mbuf[100];
  40. for (i = garmin_icon_table; i->icon; i++) {
  41. n++;
  42. }
  43. qsort(garmin_icon_table,
  44. n,
  45. sizeof(garmin_icon_table[0]),
  46. sort_garmin);
  47. for (i = garmin_icon_table; i->icon; i++) {
  48. snprintf(pbuf, sizeof(pbuf), "%d", i->pcxsymnum);
  49. snprintf(mbuf, sizeof(mbuf), "%d", i->mpssymnum);
  50. tbl_ent(3, i->icon, pbuf, mbuf);
  51. }
  52. }
  53. int main()
  54. {
  55. garmin();
  56. return 0;
  57. }