Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Server maintenance on Tue 24.5. at 12:00.
Estimated downtime less than 30 minutes.
Open sidebar
Vesa Oikonen
tpcclib
Commits
f27ea327
Commit
f27ea327
authored
Jun 12, 2020
by
Vesa Oikonen
Browse files
comments
parent
0191b0e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
v2/libtpccsv/csvio.c
View file @
f27ea327
...
...
@@ -16,20 +16,19 @@
/*****************************************************************************/
/** Write CSV data into file opened for writing, using the column separator
specified inside CSV struct.
specified inside CSV struct
ure
.
Field contents are written as they are, that is, no conversions
for decimal separator is done here.
Field contents are written as they are, that is, no conversions for decimal separator is done here.
@return enum tpcerror (TPCERROR_OK when successful).
@author Vesa Oikonen
@sa csvRead, csvMakeRegular
*/
int
csvWrite
(
/** Pointer to CSV struct, contents of which are to be written */
/** Pointer to CSV struct
ure
, contents of which are to be written
.
*/
CSV
*
csv
,
/** Output file pointer */
/** Output file pointer
.
*/
FILE
*
fp
,
/** Pointer to status data; enter NULL if not needed */
/** Pointer to status data; enter NULL if not needed
.
*/
TPCSTATUS
*
status
)
{
int
verbose
=
0
;
if
(
status
!=
NULL
)
verbose
=
status
->
verbose
;
...
...
@@ -221,11 +220,11 @@ int csvRead(
@sa csvInit, csvFree, csvWrite, csvPutString, csvPutInt, csvPutLineWithSpaces
*/
int
csvPutLine
(
/** Pointer to initiated CSV; previous contents are not changed */
/** Pointer to initiated CSV; previous contents are not changed
.
*/
CSV
*
csv
,
/** Pointer to the CSV file line to be processed */
/** Pointer to the CSV file line to be processed
.
*/
const
char
*
line
,
/** Pointer to status data; enter NULL if not needed */
/** Pointer to status data; enter NULL if not needed
.
*/
TPCSTATUS
*
status
)
{
if
(
csv
==
NULL
)
return
TPCERROR_FAIL
;
...
...
@@ -318,14 +317,14 @@ int csvPutLine(
@pre Before first use initialize the CSV struct with csvInit().
@post Remember to free the memory in CSV after last use with csvFree().
@author Vesa Oikonen
@sa csvPutLine, csvRemoveEmptyLines
@sa csvPutLine, csvRemoveEmptyLines
, csvRead
*/
int
csvPutLineWithSpaces
(
/** Pointer to initiated CSV; previous contents are not changed */
/** Pointer to initiated CSV; previous contents are not changed
.
*/
CSV
*
csv
,
/** Pointer to the CSV file line to be processed */
/** Pointer to the CSV file line to be processed
.
*/
const
char
*
line
,
/** Pointer to status data; enter NULL if not needed */
/** Pointer to status data; enter NULL if not needed
.
*/
TPCSTATUS
*
status
)
{
if
(
csv
==
NULL
)
return
TPCERROR_FAIL
;
...
...
@@ -351,7 +350,7 @@ int csvPutLineWithSpaces(
// Find the end of token
lptr
=
cptr
;
j
=
0
;
while
(
*
lptr
)
{
// jump over quoted sequenc
i
es */
// jump over quoted sequences */
if
(
*
lptr
==
'\''
)
{
if
(
single_quotation
==
0
&&
strchr
(
lptr
+
1
,
'\''
)
!=
NULL
)
single_quotation
=
1
;
else
single_quotation
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment