r->lu.y=c->y;
}
- /* [Proj:][Ð]DMM.ss[S][S]... N/S [D][D]DMM.ss[S][S]... E/W */
- /* [Proj:][-][D]D.d[d]... [-][D][D]D.d[d]... */
- /* [Proj:][-]0xX [-]0xX */
-/*
- * Currently supported:
- * [Proj:]-0xX [-]0xX
- * - where Proj can be mg/garmin, defaults to mg
- * [Proj:][D][D]Dmm.ss[S][S] N/S [D][D]DMM.ss[S][S]... E/W
- * [Proj:][-][D]D.d[d]... [-][D][D]D.d[d]
- * - where Proj can be geo
+/**
+ * Parses \c char \a *c_str and writes back the coordinates to \c coord \a *c_ret. Uses \c projection \a pro if no projection is given in \c char \a *c_str.
+ * The format for \a *c_str can be:
+ * \li [Proj:]-0xX [-]0xX
+ * - where Proj can be mg/garmin, defaults to mg
+ * \li [Proj:][D][D]Dmm.ss[S][S] N/S [D][D]DMM.ss[S][S]... E/W
+ * \li [Proj:][-][D]D.d[d]... [-][D][D]D.d[d]
+ * - where Proj can be geo
+ *
+ * @param *c_str String to be parsed
+ * @param pro Projection of the string
+ * @param *pc_ret Where the \a pcoord should get stored
+ * @returns The lenght of the parsed string
*/
int
return ret;
}
+/**
+ * A wrapper for pcoord_parse that also return the projection
+ * @param *c_str String to be parsed
+ * @param pro Projection of the string
+ * @param *pc_ret Where the \a pcoord should get stored
+ * @returns The lenght of the parsed string
+ */
+
+int
+pcoord_parse(const char *c_str, enum projection pro, struct pcoord *pc_ret)
+{
+ struct coord c;
+ int ret;
+ ret = coord_parse(c_str, pro, &c);
+ pc_ret->x = c.x;
+ pc_ret->y = c.y;
+ pc_ret->pro = pro;
+ return ret;
+}
+
void
coord_print(enum projection pro, struct coord *c, FILE *out) {
unsigned int x;
struct coord * coord_new_from_attrs(struct attr *parent, struct attr **attrs);
void coord_destroy(struct coord *c);
int coord_parse(const char *c_str, enum projection pro, struct coord *c_ret);
+int pcoord_parse(const char *c_str, enum projection pro, struct pcoord *c_ret);
void coord_print(enum projection pro, struct coord *c, FILE *out);
struct coord_rect * coord_rect_new(struct coord *lu, struct coord *rl);
void coord_rect_destroy(struct coord_rect *r);