diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-02-16 12:25:34 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-16 12:25:34 -0500 |
commit | 1ae23627240b664df9caaf1e4652de3cf7632875 (patch) | |
tree | 473af5e6ee951a8cb4eec930a776017f9dd7b32e /libgpsd_core.c | |
parent | ff5f1ea7e741c3faaf5e5d2f09d1edce1aaf8cd5 (diff) | |
download | gpsd-1ae23627240b664df9caaf1e4652de3cf7632875.tar.gz |
More layer separation. All regression tests pass.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index d17075e1..4e6cdd70 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -151,6 +151,40 @@ int gpsd_switch_driver(struct gps_device_t *session, char *type_name) /*@ +compmempass @*/ } +void gps_context_init(struct gps_context_t *context) +{ + /* *INDENT-OFF* */ + /*@ -initallelements -nullassign -nullderef @*/ + struct gps_context_t nullcontext = { + .valid = 0, + .readonly = false, + .sentdgps = false, + .netgnss_service = netgnss_none, + .fixcnt = 0, + .dsock = -1, + .netgnss_privdata = NULL, + .rtcmbytes = 0, + .rtcmbuf = {'\0'}, + .rtcmtime = 0, + .start_time = 0, + .leap_seconds = 0, + .gps_week = 0, + .gps_tow = 0, + .century = 0, + .rollovers = 0, +#ifdef NTPSHM_ENABLE + .enable_ntpshm = false, + .shmTime = {0}, + .shmTimeInuse = {0}, +# ifdef PPS_ENABLE + .shmTimePPS = false, +# endif /* PPS_ENABLE */ +#endif /* NTPSHM_ENABLE */ + }; + /*@ +initallelements +nullassign +nullderef @*/ + /* *INDENT-ON* */ + (void)memcpy(context, &nullcontext, sizeof(struct gps_context_t)); +} void gpsd_init(struct gps_device_t *session, struct gps_context_t *context, char *device) |