aboutsummaryrefslogtreecommitdiffstats
path: root/core/import-csv.c
AgeCommit message (Collapse)Author
2018-05-14Core: introduce new subsurface-string headerGravatar Dirk Hohndel
First small step to shrinking dive.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-02-26Cleanup: Unify qthelper.h and qthelperfromc.hGravatar Berthold Stoeger
Since all qt-helpers are defined in qthelper.cpp, there seems to be no reason to have two include files. By unifying the two files, duplication and inconsistencies are removed. The C++-only part is simply compiled away with #ifdefs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-11Move always true ++lineptr out of while-conditionGravatar Berthold Stoeger
In core/file.c move ++lineptr out of the while condition !empty_string(lineptr) && (lineptr = strchr(lineptr, '\n') && ++lineptr since it always evaluates to true. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-11Use helper function empty_string() instead of manual checksGravatar Berthold Stoeger
For code consistency, substitute boolean expressions: s && *s -> !empty_string(s) s && s[0] -> !empty_string(s) !s || !*s -> empty_string(s) !s || !s[0] -> empty_string(s) Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Make a few functions of static linkageGravatar Berthold Stoeger
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>
2018-01-08Remove obsolete error/debug messagesGravatar Miika Turkia
The used parse_dl7_new_line function already prints an error / debug message so these are unnecessary. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Parse water temperature from ZDTGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Function to look for new line on DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Use dynamic indexing instead of hard codedGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add support for air temp on DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Dummy parse empty divesGravatar Miika Turkia
Easiest way to get dives without profiles in, is to just parse empty csv tags. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Stricter check we get dive profileGravatar Miika Turkia
We should get either dive trailer or dive profile immediately after header. Thus make sure that is the case. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Ignore empty divesGravatar Miika Turkia
This is first step towards parsing "empty" dives properly. I.e. now the updated test dive parses properly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Refactor CSV importGravatar Miika Turkia
Move CSV import related functions into import-csv.c. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>