static void mmo_rd_deinit(void) { mmo_release_avltree(icons, 0); mmo_release_avltree(category_ids, 0); mmo_release_avltree(objects, 1); gbfclose(fin); }
static void humminbird_wr_deinit(void) { avltree_done(waypoints); mkshort_del_handle(&wptname_sh); mkshort_del_handle(&rtename_sh); mkshort_del_handle(&trkname_sh); gbfclose(fout); }
static void wr_deinit(void) { if (!split_output) { gbfclose(file_out); } mkshort_del_handle(&mkshort_handle); xfree(output_name); }
static void osm_wr_deinit(void) { gbfclose(fout); waypt_disp_all(osm_release_ids); route_disp_all(NULL, NULL, osm_release_ids); track_disp_all(NULL, NULL, osm_release_ids); avltree_done(waypoints); }
static void garmin_txt_rd_deinit(void) { header_type h; for (h = waypt_header; h <= unknown_header; h++) { free_header(h); } gbfclose(fin); xfree(date_time_format); }
static void kml_wr_deinit(void) { gbfclose(ofd); if (posnfilenametmp) { #if __WIN32__ MoveFileEx(posnfilenametmp, posnfilename, MOVEFILE_REPLACE_EXISTING); #endif rename(posnfilenametmp, posnfilename); } ofd = NULL; }
static void mmo_read(void) { #ifdef MMO_DBG const char *sobj = "main"; #endif gbfile *fx; int i; /* copy file to memory stream (needed for seek-ops and piped commands) */ DBG(("main", "loading file \"%s\".\n", fin->name)); fx = gbfopen(NULL, "wb", MYNAME); gbfcopyfrom(fx, fin, 0x7FFFFFFF); gbfrewind(fx); gbfclose(fin); fin = fx; mmo_obj_ct = gbfgetuint16(fin); DBG((sobj, "number of objects = %d\n", mmo_obj_ct)); i = gbfgetuint16(fin); if (i != 0xFFFF) fatal(MYNAME ": Marker not equel to 0xFFFF!\n"); mmo_version = gbfgetuint16(fin); DBG((sobj, "version = 0x%02X\n", mmo_version)); mmo_filemark = 0xFFFF0000UL | be_read16(&mmo_version); DBG((sobj, "filemark = 0x%08X\n", mmo_filemark)); gbfseek(fin, -4, SEEK_CUR); while (! gbfeof(fin)) { /* main read loop */ (void) mmo_read_object(NULL); } #ifdef MMO_DBG printf("\n" MYNAME ":---------------------------------------\n"); printf(MYNAME ": EOF reached, nice!!!\n"); printf(MYNAME ": =======================================\n\n"); #endif }
static void nav_wr_deinit(void) { gbfclose(fout); }
static void sbp_rd_deinit(void) { gbfclose(file_handle); }
static void nav_rd_deinit(void) { gbfclose(fin); }
static void compegps_rd_deinit(void) { gbfclose(fin); }
static void compegps_wr_deinit(void) { mkshort_del_handle(&sh); gbfclose(fout); }
static void garmin_txt_wr_deinit(void) { gbfclose(fout); xfree(date_time_format); }
static void wr_deinit(void) { gbfclose(file_out); mkshort_del_handle(&mkshort_handle); }
static void text_disp(const waypoint *wpt) { int latint, lonint; char tbuf[1024]; time_t tm = wpt->creation_time; gbint32 utmz; double utme, utmn; char utmzc; char *tmpout1, *tmpout2; char *altout; fs_xml *fs_gpx; waypoint_count++; if (split_output) { char *thisfname; xasprintf(&thisfname, "%s%d", output_name, waypoint_count); file_out = gbfopen(thisfname, "w", MYNAME); } lonint = abs((int) wpt->longitude); latint = abs((int) wpt->latitude); GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, &utme, &utmn, &utmz, &utmzc); if (tm == 0) tm = time(NULL); strftime(tbuf, sizeof(tbuf), "%d-%b-%Y", localtime(&tm)); tmpout1 = pretty_deg_format(wpt->latitude, wpt->longitude, degformat[2], " ", 0); if (wpt->altitude != unknown_alt) { xasprintf(&altout, " alt:%d", (int) ( (altunits[0]=='f')?METERS_TO_FEET(wpt->altitude):wpt->altitude) ); } else { altout = ""; } xasprintf (&tmpout2, "%s (%d%c %6.0f %7.0f)%s", tmpout1, utmz, utmzc, utme, utmn, altout ); gbfprintf(file_out, "%-16s %59s\n", (global_opts.synthesize_shortnames) ? mkshort_from_wpt(mkshort_handle, wpt) : wpt->shortname, tmpout2); xfree(tmpout2); xfree(tmpout1); if (altout[0]) xfree(altout); if (strcmp(wpt->description, wpt->shortname)) { gbfprintf(file_out, "%s", wpt->description); if (wpt->gc_data->placer) gbfprintf(file_out, " by %s", wpt->gc_data->placer); } if (wpt->gc_data->terr) { gbfprintf(file_out, " - %s / %s - (%d%s / %d%s)\n", gs_get_cachetype(wpt->gc_data->type), gs_get_container(wpt->gc_data->container), (int)(wpt->gc_data->diff / 10), (wpt->gc_data->diff%10)?".5":"", (int)(wpt->gc_data->terr / 10), (wpt->gc_data->terr%10)?".5":"" ); if (wpt->gc_data->desc_short.utfstring) { char *stripped_html = strip_html(&wpt->gc_data->desc_short); gbfprintf (file_out, "\n%s\n", stripped_html); xfree(stripped_html); } if (wpt->gc_data->desc_long.utfstring) { char *stripped_html = strip_html(&wpt->gc_data->desc_long); gbfprintf (file_out, "\n%s\n", stripped_html); xfree(stripped_html); } if (wpt->gc_data->hint) { char *hint = NULL; if ( txt_encrypt ) hint = rot13( wpt->gc_data->hint ); else hint = xstrdup( wpt->gc_data->hint ); gbfprintf (file_out, "\nHint: %s\n", hint); xfree( hint ); } } else if (wpt->notes && (!wpt->description || strcmp(wpt->notes,wpt->description))) { gbfprintf (file_out, "\n%s\n", wpt->notes); } fs_gpx = NULL; if ( includelogs ) { fs_gpx = (fs_xml *)fs_chain_find( wpt->fs, FS_GPX); } if ( fs_gpx && fs_gpx->tag ) { xml_tag *root = fs_gpx->tag; xml_tag *curlog = NULL; xml_tag *logpart = NULL; curlog = xml_findfirst( root, "groundspeak:log" ); while ( curlog ) { time_t logtime = 0; struct tm *logtm = NULL; gbfprintf( file_out, "\n" ); logpart = xml_findfirst( curlog, "groundspeak:type" ); if ( logpart ) { gbfprintf( file_out, "%s by ", logpart->cdata ); } logpart = xml_findfirst( curlog, "groundspeak:finder" ); if ( logpart ) { gbfprintf( file_out, "%s on ", logpart->cdata ); } logpart = xml_findfirst( curlog, "groundspeak:date" ); if ( logpart ) { logtime = xml_parse_time( logpart->cdata, NULL); logtm = localtime( &logtime ); if ( logtm ) { gbfprintf( file_out, "%4.4d-%2.2d-%2.2d\n", logtm->tm_year+1900, logtm->tm_mon+1, logtm->tm_mday ); } } logpart = xml_findfirst( curlog, "groundspeak:log_wpt" ); if ( logpart ) { char *coordstr = NULL; float lat = 0; float lon = 0; coordstr = xml_attribute( logpart, "lat" ); if ( coordstr ) { lat = atof( coordstr ); } coordstr = xml_attribute( logpart, "lon" ); if ( coordstr ) { lon = atof( coordstr ); } coordstr = pretty_deg_format(lat, lon, degformat[2], " ", 0); gbfprintf( file_out, "%s\n", coordstr); xfree(coordstr); } logpart = xml_findfirst( curlog, "groundspeak:text" ); if ( logpart ) { char *encstr = NULL; char *s = NULL; int encoded = 0; encstr = xml_attribute( logpart, "encoded" ); encoded = (encstr[0] != 'F'); if ( txt_encrypt && encoded ) { s = rot13( logpart->cdata ); } else { s = xstrdup( logpart->cdata ); } gbfprintf( file_out, "%s", s ); xfree( s ); } gbfprintf( file_out, "\n" ); curlog = xml_findnext( root, curlog, "groundspeak:log" ); } } if (! suppresssep) gbfprintf(file_out, "\n-----------------------------------------------------------------------------\n"); else gbfprintf(file_out, "\n"); if (split_output) { gbfclose(file_out); file_out = NULL; } }
static void gtc_wr_deinit(void) { gbfclose(ofd); xfree(tdata); }
static void rd_deinit(void) { gbfclose(file_in); }
static void unicsv_rd_deinit(void) { gbfclose(fin); if (unicsv_fields_tab) xfree(unicsv_fields_tab); }
static void gopal_rd_deinit(void) { gbfclose(fin); }
static void vpl_rd_deinit(void) { gbfclose(vpl_file_in); }
static void gopal_wr_deinit(void) { gbfclose(fout); }
static void psp_rd_deinit(void) { gbfclose(psp_file_in); }
static void humminbird_rd_deinit(void) { avltree_done(waypoints); gbfclose(fin); }
static void psp_wr_deinit(void) { mkshort_del_handle(&mkshort_handle); gbfclose(psp_file_out); }
static void xol_wr_deinit(void) { mkshort_del_handle(&short_h); gbfclose(fout); }
static void wr_deinit(void) { gbfclose(file_out); }
static void format_garmin_xt_rd_deinit(void) { gbfclose(fin); }