summaryrefslogtreecommitdiff
path: root/include/qntan
diff options
context:
space:
mode:
Diffstat (limited to 'include/qntan')
-rw-r--r--include/qntan/Qntan.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h
index aadeccf..47ec2ab 100644
--- a/include/qntan/Qntan.h
+++ b/include/qntan/Qntan.h
@@ -1076,6 +1076,10 @@ struct Qntan_CsvDec_Mentor {
+#ifndef Qntan_CsvIStream_write
+# define Qntan_CsvIStream_write(A, B, C, D, E, F) (*A)->write(A, B, C, D, E, F)
+#endif
+
struct Qntan_CsvIStream {
/**/
void (*write)( struct Qntan_CsvIStream**,
@@ -1085,18 +1089,19 @@ struct Qntan_CsvIStream {
* 0x4 set means this is last chunk.
* Any other bit set is UNDEFINED BEHAVIOR!
*/
- void (*pause)( struct Qntan_CsvIStream** );
- /* TODO doc
- */
- void (*resume)( struct Qntan_CsvIStream** );
- /* TODO doc
- */
};
+#ifndef Qntan_CsvIStream_Mentor_onCsvDocEnd
+# define Qntan_CsvIStream_Mentor_onCsvDocEnd(A, B, C) (*A)->onCsvDocEnd(A, B, C)
+#endif
+#ifndef Qntan_CsvIStream_Mentor_onCsvRow
+# define Qntan_CsvIStream_Mentor_onCsvRow(A, B, C, D) (*A)->onCsvRow(A, B, C, D)
+#endif
+
struct Qntan_CsvIStream_Mentor {
/**/
- void (*onCsvRow)(
- char const**values, int*values_len, int numCols, Qntan_Cls );
+ void (*onCsvRow)( struct Qntan_CsvIStream_Mentor**,
+ char const**values, int*values_len, int numCols );
/* Called for every CSV row.
*
* How an implementation could look like:
@@ -1113,8 +1118,10 @@ struct Qntan_CsvIStream_Mentor {
* Number of columns present in this row. Aka number of entries present
* in 'values' and 'values_len'.
*/
- void (*onCsvDocEnd)( Qntan_Cls );
- /* Called when there are no more rows.
+ void (*onCsvDocEnd)( struct Qntan_CsvIStream_Mentor**, int err, char const*emsg );
+ /* Called when there are no more rows. on success, `err` is `0`.
+ * Otherwise contains an error and maybe `emsg` holds some detail
+ * description of the error.
*/
};