Separated Values (TSV, CSV) library
C Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.last-cl-gen
.travis.yml
COPYING
COPYING.LIB
ChangeLog
GNUMakefile
LICENSE-2.0.txt
LICENSE.txt
Makefile.am
NOTES.md
NOTICE
README.md
design.md
example.c
gen.c
one.tsv
option.c
read.c
sv.c
sv.h
sv2c.c
sv_internal.h
svtest.c
test1.csv
test1.tsv
write.c
zero.tsv

README.md

libsv - a simple Separated Values (CSV, TSV) library in ANSI C.

License: LGPL 2.1+ or GPL 2+ or Apache 2+

Home: http://github.com/dajobe/libsv/tree/master Source: git clone git://github.com/dajobe/libsv.git

Standalone build

make -f GNUMakefile

Embedded build in an automake package

$ git submodule add --name libsv https://github.com/dajobe/libsv.git libsv
$ git submodule init libsv
$ git submodule update libsv

Then add these lines to your library Makefile.am

AM_CFLAGS += -DSV_CONFIG -I$(top_srcdir)/libsv
libexample_la_LIBADD += $(top_builddir)/libsv/libsv.la
libexample_la_DEPENDENCIES += $(top_builddir)/libsv/libsv.la

$(top_builddir)/libsv/libsv.la:
<tab>cd $(top_builddir)/libsv && $(MAKE) libsv.la

and add a configuration file sv_config.h in the include path which defines HAVE_STDLIB_H etc. as needed by sv.h and sv.c

Optionally you might want in this file to redefine the exposed API symbols with lines like:

#define sv_new example_sv_new
#define sv_free example_sv_free
#define sv_reset example_sv_reset
#define sv_set_option example_sv_set_option
#define sv_get_line example_sv_get_line
#define sv_get_header example_sv_get_header
#define sv_parse_chunk example_sv_parse_chunk
#define sv_write_fields example_sv_write_fields

You can see this demonstrated inside Rasqal

Example

See example.c for API use.

Dave Beckett http://www.dajobe.org/