diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-11-27 20:28:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-11-27 13:42:10 -0800 |
commit | 8be626d2c1f7d6a91eecb45dc91cdeb961f0a62b (patch) | |
tree | 2d84710a4094bc2c5841fd337c07e0d54b3f9f30 | |
parent | b3605de93e1c5e7f5a68f6692b8d26806f575625 (diff) | |
download | subsurface-8be626d2c1f7d6a91eecb45dc91cdeb961f0a62b.tar.gz |
Move atoi_n to parse.c
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
-rw-r--r-- | core/parse-xml.c | 13 | ||||
-rw-r--r-- | core/parse.c | 13 | ||||
-rw-r--r-- | core/parse.h | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c index f1da26e9a..372e81008 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -29,7 +29,6 @@ int verbose, quit, force_root; int last_xml_version = -1; -int diveid = -1; static xmlDoc *test_xslt_transforms(xmlDoc *doc, const char **params); @@ -1886,18 +1885,6 @@ extern int divinglog_cylinder(void *handle, int columns, char **data, char **col return 0; } -static int atoi_n(char *ptr, unsigned int len) -{ - if (len < 10) { - char buf[10]; - - memcpy(buf, ptr, len); - buf[len] = 0; - return atoi(buf); - } - return 0; -} - extern int divinglog_profile(void *handle, int columns, char **data, char **column) { (void) handle; diff --git a/core/parse.c b/core/parse.c index 3335b8f57..57f6eb019 100644 --- a/core/parse.c +++ b/core/parse.c @@ -12,6 +12,7 @@ #include "gettext.h" int metric = 1; +int diveid = -1; /* static union { @@ -516,3 +517,15 @@ void add_dive_site(char *ds_name, struct dive *dive) free(to_free); } +int atoi_n(char *ptr, unsigned int len) +{ + if (len < 10) { + char buf[10]; + + memcpy(buf, ptr, len); + buf[len] = 0; + return atoi(buf); + } + return 0; +} + diff --git a/core/parse.h b/core/parse.h index f8af63d04..259cf5aaa 100644 --- a/core/parse.h +++ b/core/parse.h @@ -54,6 +54,7 @@ extern struct dive_table dive_table; extern struct dive_table *target_table; extern int metric; +extern int diveid; int trimspace(char *buffer); void clear_table(struct dive_table *table); @@ -96,5 +97,6 @@ void userid_stop(void); void utf8_string(char *buffer, void *_res); void add_dive_site(char *ds_name, struct dive *dive); +int atoi_n(char *ptr, unsigned int len); #endif |