scossu пре 2 недеља
родитељ
комит
035350ce85

+ 9 - 8
Makefile

@@ -13,7 +13,7 @@ AR = ar
 PREFIX ?= /usr/local
 bindir := $(PREFIX)/bin
 libdir := $(PREFIX)/lib
-includedir = $(PREFIX)/include/lsup
+INCLUDEDIR = $(PREFIX)/include
 outdir = ./bin
 VALGRIND_DUMP = /tmp/lsup_valgrind.log
 CALLGRIND_DUMP = /tmp/lsup_callgrind.out
@@ -149,15 +149,16 @@ $(PARSER): $(LEMON_SRC)
 
 install: lib ## Install library and dependencies to $PREFIX. May require sudo.
 	@echo "Installing library files in $(PREFIX)."
-	mkdir -p $(DESTDIR)$(libdir)
-	mkdir -p $(DESTDIR)$(includedir)
-	cp $(LIBS) $(DESTDIR)$(libdir) && \
-		cp -r include/*.h include/codec $(EXT_H) $(DESTDIR)$(includedir)
+	mkdir -p $(libdir)
+	mkdir -p $(INCLUDEDIR)/lsup
+	cp $(LIBS) $(libdir) && \
+		cp -r include/lsup/* $(EXT_H) $(INCLUDEDIR)/lsup && \
+		cp include/*.h $(INCLUDEDIR)
 
 
 debug_install: install debug ## Install standard and debug libraries.
 	@echo "Installing debug library files in $(PREFIX)."
-	cp $(DBG_LIBS) $(DESTDIR)$(libdir)
+	cp $(DBG_LIBS) $(libdir)
 
 
 .PHONY: clean
@@ -172,8 +173,8 @@ clean: ## Clean up artifacts, including language parsers.
 
 .PHONY: uninstall ## Uninstall library (not the dependencies).
 uninstall:
-	rm -f $(DESTDIR)$(libdir)/liblsuprdf*
-	rm -rf $(DESTDIR)$(includedir)
+	rm -f $(libdir)/liblsuprdf*
+	rm -rf $(INCLUDEDIR)/lsup*
 	rm -f bin/test*
 
 

+ 1 - 1
include/buffer.h → include/lsup/buffer.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_BUFFER_H
 #define _LSUP_BUFFER_H
 
-#include "core.h"
+#include "lsup/core.h"
 
 /** @defgroup buffer Buffer module
  * @ingroup public

+ 1 - 1
include/codec.h → include/lsup/codec.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_CODEC_BASE_H
 #define _LSUP_CODEC_BASE_H
 
-#include "graph.h"
+#include "lsup/graph.h"
 
 /** @defgroup codec RDF codec module
  * @ingroup private

+ 1 - 1
include/codec/codec_nt.h → include/lsup/codec/codec_nt.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_CODEC_NT_H
 #define _LSUP_CODEC_NT_H
 
-#include "codec/parser_nt.h"
+#include "lsup/codec/parser_nt.h"
 
 /** @brief N-Triples codec.
  */

+ 1 - 1
include/codec/codec_ttl.h → include/lsup/codec/codec_ttl.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_CODEC_TTL_H
 #define _LSUP_CODEC_TTL_H
 
-#include "codec/parser_ttl.h"
+#include "lsup/codec/parser_ttl.h"
 
 /** @brief Turtle codec.
  *

+ 1 - 1
include/codec/parser_nt.h → include/lsup/codec/parser_nt.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_NT_PARSER_H
 #define _LSUP_NT_PARSER_H
 
-#include "codec.h"
+#include "lsup/codec.h"
 
 
 /** @brief Parse a single term.

+ 1 - 1
include/codec/parser_ttl.h → include/lsup/codec/parser_ttl.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_TTL_PARSER_H
 #define _LSUP_TTL_PARSER_H
 
-#include "codec.h"
+#include "lsup/codec.h"
 
 
 /** @brief Parse a N-Triples document from a file handle.

+ 7 - 0
include/lsup/codec/tokens_nt.h

@@ -0,0 +1,7 @@
+#define T_EOF                              1
+#define T_DOT                              2
+#define T_IRIREF                           3
+#define T_BNODE                            4
+#define T_LITERAL                          5
+#define T_EOL                              6
+#define T_WS                               7

+ 23 - 0
include/lsup/codec/tokens_ttl.h

@@ -0,0 +1,23 @@
+#define T_PERIOD                           1
+#define T_SEMICOLON                        2
+#define T_COMMA                            3
+#define T_STRING                           4
+#define T_INTEGER                          5
+#define T_DOUBLE                           6
+#define T_DECIMAL                          7
+#define T_BOOLEAN                          8
+#define T_QNAME                            9
+#define T_BNODE_ID                        10
+#define T_IRIREF                          11
+#define T_LANGTAG                         12
+#define T_PREFIX                          13
+#define T_COLON                           14
+#define T_EOF                             15
+#define T_WS                              16
+#define T_BASE                            17
+#define T_RDF_TYPE                        18
+#define T_DTYPE_MARKER                    19
+#define T_LBRACKET                        20
+#define T_RBRACKET                        21
+#define T_LPAREN                          22
+#define T_RPAREN                          23

+ 0 - 0
include/core.h → include/lsup/core.h


+ 0 - 0
include/data/bootstrap.h → include/lsup/data/bootstrap.h


+ 1 - 1
include/environment.h → include/lsup/environment.h

@@ -12,7 +12,7 @@
 #define _LSUP_ENVIRONMENT_H
 
 
-#include "term.h"
+#include "lsup/term.h"
 
 
 /*

+ 3 - 3
include/graph.h → include/lsup/graph.h

@@ -1,9 +1,9 @@
 #ifndef _LSUP_GRAPH_H
 #define _LSUP_GRAPH_H
 
-#include "store.h"
-#include "environment.h"
-#include "term.h"
+#include "lsup/store.h"
+#include "lsup/environment.h"
+#include "lsup/term.h"
 
 
 /** @defgroup graph RDF graph module

+ 0 - 0
include/namespace.h → include/lsup/namespace.h


+ 2 - 2
include/store.h → include/lsup/store.h

@@ -16,8 +16,8 @@
 /*
  * Add new back end headers here.
  */
-#include "store_htable.h"
-#include "store_mdb.h"
+#include "lsup/store_htable.h"
+#include "lsup/store_mdb.h"
 
 /** @defgroup store Backend store module
  * @ingroup public

+ 2 - 2
include/store_htable.h → include/lsup/store_htable.h

@@ -20,8 +20,8 @@
 #ifndef _LSUP_STORE_HTABLE_H
 #define _LSUP_STORE_HTABLE_H
 
-#include "buffer.h"
-#include "store_interface.h"
+#include "lsup/buffer.h"
+#include "lsup/store_interface.h"
 
 
 extern const LSUP_StoreInt htstore_int;

+ 1 - 1
include/store_interface.h → include/lsup/store_interface.h

@@ -35,7 +35,7 @@
 #ifndef _LSUP_STORE_INTERFACE_H
 #define _LSUP_STORE_INTERFACE_H
 
-#include "environment.h"
+#include "lsup/environment.h"
 
 
 /** @defgroup store_interface Store interface module

+ 2 - 2
include/store_mdb.h → include/lsup/store_mdb.h

@@ -28,8 +28,8 @@
 
 #include "lmdb.h"
 
-#include "buffer.h"
-#include "store_interface.h"
+#include "lsup/buffer.h"
+#include "lsup/store_interface.h"
 
 
 // FIXME find a better cross-platform path.

+ 3 - 3
include/term.h → include/lsup/term.h

@@ -1,10 +1,10 @@
 #ifndef _LSUP_TERM_H
 #define _LSUP_TERM_H
 
-#include <assert.h>
+//#include <assert.h>
 
-#include "buffer.h"
-#include "namespace.h"
+#include "lsup/buffer.h"
+#include "lsup/namespace.h"
 
 /** @defgroup term RDF term and triple module
  * @ingroup public

+ 2 - 2
include/lsup_rdf.h

@@ -1,7 +1,7 @@
 #ifndef _LSUP_RDF_H
 #define _LSUP_RDF_H
 
-#include "codec/codec_nt.h"
-#include "codec/codec_ttl.h"
+#include "lsup/codec/codec_nt.h"
+#include "lsup/codec/codec_ttl.h"
 
 #endif  // _LSUP_RDF_H

+ 1 - 1
src/buffer.c

@@ -1,4 +1,4 @@
-#include "buffer.h"
+#include "lsup/buffer.h"
 
 /* * * Inline extern prototypes * * */
 

+ 1 - 1
src/codec.c

@@ -1,4 +1,4 @@
-#include "codec.h"
+#include "lsup/codec.h"
 
 
 /** @brief List of characters to be escaped in serialized literals.

+ 1 - 1
src/codec/Makefile

@@ -5,7 +5,7 @@ PARSER = $(BASEDIR)/bin/lemon
 LEMON_SRC_DIR = $(BASEDIR)/ext/sqlite/tool
 
 INCLUDE_DIR = $(BASEDIR)/include
-CODEC_INCLUDE_DIR = $(INCLUDE_DIR)/codec
+CODEC_INCLUDE_DIR = $(INCLUDE_DIR)/lsup/codec
 
 CODEC_SRC := $(wildcard codec_*.c)
 PARSER_SRC := $(CODEC_SRC:codec_%=parser_%)

+ 1 - 1
src/codec/codec_nt.c

@@ -1,4 +1,4 @@
-#include "codec/codec_nt.h"
+#include "lsup/codec/codec_nt.h"
 
 
 /// NT codec iterator type.

+ 1 - 1
src/codec/codec_ttl.c

@@ -1,4 +1,4 @@
-#include "codec/codec_ttl.h"
+#include "lsup/codec/codec_ttl.h"
 
 
 /** @brief NT codec iterator.

+ 1 - 1
src/codec/grammar_nt.y

@@ -8,7 +8,7 @@
  * To generate the parser, run: `lemon ${FILE}'
  */
 
-#include "codec.h"
+#include "lsup/codec.h"
 }
 
 %name NTParse

+ 1 - 1
src/codec/grammar_ttl.y

@@ -8,7 +8,7 @@
  * TTL EBNF: https://www.w3.org/TeamSubmission/turtle/#sec-grammar-grammar
  */
 
-#include "codec.h"
+#include "lsup/codec.h"
 
 }
 

+ 2 - 2
src/codec/lexer_nt.re

@@ -1,5 +1,5 @@
-#include "codec/parser_nt.h"
-#include "codec/tokens_nt.h"
+#include "lsup/codec/parser_nt.h"
+#include "lsup/codec/tokens_nt.h"
 
 
 #define YYCTYPE     uint8_t

+ 2 - 2
src/codec/lexer_ttl.re

@@ -1,5 +1,5 @@
-#include "codec/parser_ttl.h"
-#include "codec/tokens_ttl.h"
+#include "lsup/codec/parser_ttl.h"
+#include "lsup/codec/tokens_ttl.h"
 
 
 /** @brief TTL is UTF-8 encoded.

+ 2 - 1
src/core.c

@@ -2,7 +2,8 @@
 #include <errno.h>
 #include <ftw.h>
 #include <string.h>
-#include "core.h"
+
+#include "lsup/core.h"
 #include "lmdb.h"
 
 

+ 2 - 2
src/environment.c

@@ -1,5 +1,5 @@
-#include "environment.h"
-#include "data/bootstrap.h"
+#include "lsup/environment.h"
+#include "lsup/data/bootstrap.h"
 
 
 /** @brief Default context.

+ 1 - 1
src/graph.c

@@ -1,4 +1,4 @@
-#include "graph.h"
+#include "lsup/graph.h"
 
 /*
  * Data types.

+ 2 - 2
src/namespace.c

@@ -1,5 +1,5 @@
-#include "core.h"
-#include "namespace.h"
+#include "lsup/core.h"
+#include "lsup/namespace.h"
 
 
 /** @brief Prefix / Namespace pair.

+ 1 - 1
src/store.c

@@ -1,4 +1,4 @@
-#include "store.h"
+#include "lsup/store.h"
 
 
 #define ENTRY(a, b) case LSUP_STORE_##a: return &b;

+ 1 - 1
src/store_htable.c

@@ -1,6 +1,6 @@
 #include "hashmap.h"
 
-#include "store_htable.h"
+#include "lsup/store_htable.h"
 
 
 /**

+ 1 - 1
src/store_mdb.c

@@ -1,4 +1,4 @@
-#include "store_mdb.h"
+#include "lsup/store_mdb.h"
 
 /**
  * Number of DBs defined. See MAIN_TABLE and LOOKUP_TABLE defines below.

+ 1 - 1
src/term.c

@@ -1,6 +1,6 @@
 #include "tpl.h"
 
-#include "term.h"
+#include "lsup/term.h"
 
 /** @brief tpl packing format for a term.
  *

+ 1 - 1
test/test_codec_nt.c

@@ -1,5 +1,5 @@
+#include "lsup/codec/codec_nt.h"
 #include "test.h"
-#include "codec/codec_nt.h"
 
 #define TERM_CT 11
 #define TRP_CT 8

+ 1 - 1
test/test_codec_ttl.c

@@ -1,5 +1,5 @@
+#include "lsup/codec/codec_ttl.h"
 #include "test.h"
-#include "codec/codec_ttl.h"
 
 #define W3C_POS_TEST_CT 30
 #define W3C_NEG_TEST_CT 14

+ 1 - 1
test/test_graph.c

@@ -1,5 +1,5 @@
+#include "lsup/graph.h"
 #include "test.h"
-#include "graph.h"
 #include "assets/triples.h"
 
 #define N_LUT 13

+ 1 - 1
test/test_namespace.c

@@ -1,5 +1,5 @@
+#include "lsup/namespace.h"
 #include "test.h"
-#include "namespace.h"
 
 static int
 test_namespace()

+ 2 - 2
test/test_store.c

@@ -1,6 +1,6 @@
-#include "test.h"
-#include "store.h"
+#include "lsup/store.h"
 #include "assets/triples.h"
+#include "test.h"
 
 
 #define STORE_ID_MDB "file:///tmp/testdb";

+ 1 - 1
test/test_store_ht.c

@@ -1,5 +1,5 @@
+#include "lsup/store_htable.h"
 #include "test.h"
-#include "store_htable.h"
 #include "assets/triples.h"
 
 /** @brief Test hash table store.

+ 1 - 1
test/test_store_mdb.c

@@ -1,7 +1,7 @@
 #include <unistd.h>
 
+#include "lsup/store_mdb.h"
 #include "test.h"
-#include "store_mdb.h"
 
 
 #define MDBSTORE_ID "file:///tmp/testdb"