diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-01-07 18:53:40 +0100 |
---|---|---|
committer | mturkia <miika.turkia@gmail.com> | 2018-01-08 09:52:55 +0200 |
commit | afeb2e36527b04c18c42a8ddaa9be3091115d0af (patch) | |
tree | 28fbbb0aa48dd130f5c785a07383556cba89024e /core/file.c | |
parent | fa5865a5664126e11bb6a9f5d456cd1c410a3fc1 (diff) | |
download | subsurface-afeb2e36527b04c18c42a8ddaa9be3091115d0af.tar.gz |
Make a few functions of static linkage
Make functions in core/file.c, core/parse.c and core/import-csv.c
that were not used outside their translation unit of static linkage.
parse_date is moved from core/file.c to core/import-csv.c, since it
is used only there.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/file.c')
-rw-r--r-- | core/file.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/core/file.c b/core/file.c index 9682bc0c3..55a7b73a3 100644 --- a/core/file.c +++ b/core/file.c @@ -115,7 +115,7 @@ int try_to_open_zip(const char *filename) return success; } -int db_test_func(void *param, int columns, char **data, char **column) +static int db_test_func(void *param, int columns, char **data, char **column) { (void) param; (void) columns; @@ -186,38 +186,6 @@ static int try_to_open_db(const char *filename, struct memblock *mem) return retval; } -timestamp_t parse_date(const char *date) -{ - int hour, min, sec; - struct tm tm; - char *p; - - memset(&tm, 0, sizeof(tm)); - tm.tm_mday = strtol(date, &p, 10); - if (tm.tm_mday < 1 || tm.tm_mday > 31) - return 0; - for (tm.tm_mon = 0; tm.tm_mon < 12; tm.tm_mon++) { - if (!memcmp(p, monthname(tm.tm_mon), 3)) - break; - } - if (tm.tm_mon > 11) - return 0; - date = p + 3; - tm.tm_year = strtol(date, &p, 10); - if (date == p) - return 0; - if (tm.tm_year < 70) - tm.tm_year += 2000; - if (tm.tm_year < 100) - tm.tm_year += 1900; - if (sscanf(p, "%d:%d:%d", &hour, &min, &sec) != 3) - return 0; - tm.tm_hour = hour; - tm.tm_min = min; - tm.tm_sec = sec; - return utc_mktime(&tm); -} - /* * Cochran comma-separated values: depth in feet, temperature in F, pressure in psi. * @@ -389,4 +357,3 @@ int parse_file(const char *filename) free(mem.buffer); return ret; } - |