a7e4140d8466c8dee5118c7480f4b116072cd7b1 kent Tue May 30 18:12:50 2017 -0700 Adding csv module. diff --git src/inc/csv.h src/inc/csv.h new file mode 100644 index 0000000..cff8000 --- /dev/null +++ src/inc/csv.h @@ -0,0 +1,17 @@ +/* csv - stuff to help process comma separated values. Have to wrap quotes around + * things with commas, and escape quotes with more quotes sometimes. */ + +#ifndef CSV_H +#define CSV_H + +char *csvEscapeToDyString(struct dyString *dy, char *string); +/* Wrap string in quotes if it has any commas. Anything already in quotes get s double-quoted + * Returns transformated result, which will be input string if it has no commas, otherwise + * will be dy*/ + +void csvWriteVal(char *val, FILE *f); +/* Write val, which may have some quotes or commas in it, in a way to be compatable with + * csv list representation */ + +#endif /* CSV_H */ +