libgpsfile  0.2.2
some useful C-functions
gpx.h
Go to the documentation of this file.
1 /* kate: indent-mode cstyle; tab-width 6; indent-width 6; */
2 #ifndef XGPX_H
3 #define XGPX_H
4 
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <cfe-tables/tables.h>
8 
9 typedef int (*gpx_write_callback_t)(const char *, void **);
10 
11 int write_gpx(const table_t *table, const char *filename, const char *trackname, const char *desc, const char *comment, const char *author, gpx_write_callback_t callback, void **out);
12 int write_gpx_callback_string(const char *in, void **out);
13 int write_gpx_callback_file(const char *in, void **out);
14 
15 static inline int write_gpx_string(const table_t *t, const char *filename, const char *trackname, const char *desc, const char *comment, const char *author, char **data)
16 {
17  char *str = NULL;
18  int ret = write_gpx(t, filename, trackname, desc, comment, author, write_gpx_callback_string, (void **)&str);
19  *data = str;
20  return ret;
21 }
22 
23 static inline int write_gpx_file(const table_t *t, const char *filename, const char *trackname, const char *desc, const char *comment, const char *author, FILE *fp)
24 {
25  return write_gpx(t, filename, trackname, desc, comment, author, write_gpx_callback_file, (void **)&fp);
26 }
27 
28 int read_gpx(FILE *f, table_t *table);
29 
30 #endif /* XGPX_H */
int write_gpx_callback_string(const char *in, void **out)
int write_gpx_callback_file(const char *in, void **out)
int read_gpx(FILE *f, table_t *table)
int write_gpx(const table_t *table, const char *filename, const char *trackname, const char *desc, const char *comment, const char *author, gpx_write_callback_t callback, void **out)
int(* gpx_write_callback_t)(const char *, void **)
Definition: gpx.h:9