1 /*
2
3 Filter skeleton:
4
5 Simply copy this file to <your_filter_name>.c and
6 rename all filter_skeleton tokens to <your_filter_name>. Replace
7 the stupid name and address in the Copyright few lines below.
8 To active your new filter you have to create a new section in
9 filter_vecs and finally add complying statements to Makefile.
10
11 Copyright (C) YYYY John Doe, anybody@wherever.com
12 Copyright (C) 2001-YYYY Robert Lipe, robertlipe@gpsbabel.org
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
27
28 */
29
30 #include "defs.h"
31 #include "filterdefs.h"
32 #include <ctype.h>
33
34 #define MYNAME "filter_skeleton"
35
36 #if FILTERS_ENABLED
37
38 // Any arg in this list will appear in command line help and will be
39 // populated for you.
40 static
41 arglist_t filter_skeleton_args[] = {
42 // {"foo", &fooopt, "The text of the foo option in help",
43 // "default", ARGYTPE_STRING, ARG_NOMINMAX} ,
44 ARG_TERMINATOR
45 };
46
47 /*******************************************************************************
48 * %%% global callbacks called by gpsbabel main process %%% *
49 *******************************************************************************/
50
51 static void
filter_skeleton_init(const char * args)52 filter_skeleton_init(const char* args)
53 {
54 /* Called before filter processing */
55
56 /* optional. If not needed, delete and replace entry in vecs with NULL */
57
58 /* This may be used to parse filter options, allocate memory, and do other
59 * housekeeping that should be done before filtering */
60 }
61
62 static void
filter_skeleton_process(void)63 filter_skeleton_process(void) /* this procedure must be present in vecs */
64 {
65 // Here is how you register callbacks for all waypoints, routes, tracks.
66 // waypt_disp_all(waypt)
67 // route_disp_all(head, tail, rtept);
68 // track_disp_all(head, tail, trkpt);
69 }
70
71 static void
filter_skeleton_deinit(void)72 filter_skeleton_deinit(void)
73 {
74 /* called after filter processing */
75
76 /* optional. If not needed, delete and replace entry in vecs with NULL */
77
78 /* This should be used to clean up any memory allocations that are no longer
79 * needed after the filter terminates. */
80 }
81
82 static void
filter_skeleton_exit(void)83 filter_skeleton_exit(void)
84 {
85 /* called on program exit */
86
87 /* optional. If not needed, delete and replace entry in vecs with NULL */
88
89 /* You should not need this for simple filters, but it may be used to
90 * clean up memory allocations that must persist from one invocation of
91 * your filter to the next (for example, the stack in the stack filter.)
92 * Note that this member will be called even if your filter has not been
93 * used, so it *cannot* assume that _init or _process has been called
94 * previously. */
95 }
96
97 /*******************************************************************************/
98
99 filter_vecs_t filter_skeleton_vecs = {
100 filter_skeleton_init,
101 filter_skeleton_process,
102 filter_skeleton_deinit,
103 filter_skeleton_exit,
104 filter_skeleton_args
105 };
106
107 /*******************************************************************************/
108 #endif // FILTERS_ENABLED
109