Skip to content

Commit 12230ab

Browse files
committed
Remove include directory
- Initially added include directory is now removed - Source files and headers are placed in the source directory
1 parent e57f5f2 commit 12230ab

34 files changed

+62
-57
lines changed

Makefile

+11-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ prefix = /usr/local
33
exec_prefix = $(prefix)
44
bindir = $(exec_prefix)/bin
55
libdir = $(exec_prefix)/lib
6-
includedir = $(prefix)/include
6+
includedir = $(prefix)/src
77
pkgconfigdir = $(libdir)/pkgconfig
88

99
CFLAGS = -Wall -Wextra
@@ -20,7 +20,12 @@ RMDIR = rmdir
2020
SED = sed
2121

2222
# Our sources
23-
TINYCBOR_HEADERS = include
23+
TINYCBOR_HEADERS = \
24+
src/cbor.h \
25+
src/cborjson.h \
26+
src/cbor_enocoder_writer.h \
27+
src/cbor_decoder_reader.h \
28+
src/cbor_defs.h
2429
TINYCBOR_SOURCES = \
2530
src/cborerrorstrings.c \
2631
src/cborencoder.c \
@@ -29,7 +34,7 @@ TINYCBOR_SOURCES = \
2934
src/cborpretty.c \
3035
src/cbortojson.c \
3136
src/cborvalidation.c \
32-
src/cbor_buf_reader.c\
37+
src/cbor_buf_reader.c \
3338
src/cbor_buf_writer.c
3439
#
3540
CBORDUMP_SOURCES = tools/cbordump/cbordump.c
@@ -44,7 +49,7 @@ INSTALL_TARGETS += $(libdir)/libtinycbor.so.0
4449
INSTALL_TARGETS += $(libdir)/libtinycbor.so.$(VERSION)
4550
endif
4651
INSTALL_TARGETS += $(pkgconfigdir)/tinycbor.pc
47-
INSTALL_TARGETS += $(TINYCBOR_HEADERS:./%=$(includedir)/tinycbor/%)
52+
INSTALL_TARGETS += $(TINYCBOR_HEADERS:./%=$(includedir)/%)
4853

4954
# setup VPATH
5055
MAKEFILE := $(lastword $(MAKEFILE_LIST))
@@ -157,7 +162,7 @@ $(DESTDIR)$(bindir)/%: bin/%
157162
$(DESTDIR)$(pkgconfigdir)/%: %
158163
$(INSTALL) -d $(@D)
159164
$(INSTALL_DATA) $< $@
160-
$(DESTDIR)$(includedir)/%: include/%
165+
$(DESTDIR)$(includedir)/%: src/%
161166
$(INSTALL) -d $(@D)
162167
$(INSTALL_DATA) $< $@
163168

@@ -201,7 +206,7 @@ tag: distcheck
201206
.PHONY: docs dist distcheck release
202207
.SECONDARY:
203208

204-
cflags := $(CPPFLAGS) -I$(SRCDIR)include
209+
cflags := $(CPPFLAGS) -I$(SRCDIR)/src
205210
cflags += -DTINYCBOR_VERSION_SUFFIX=\"$(DIRTYSRC)\"
206211
cflags += -std=c99 $(CFLAGS)
207212
%.o: %.c

Makefile.nmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CFLAGS = -W3
22

3-
TINYCBOR_HEADERS = include
3+
TINYCBOR_HEADERS = src
44
TINYCBOR_SOURCES = \
55
src\cborerrorstrings.c \
66
src\cborencoder.c \

include/tinycbor/cbor.h renamed to src/cbor.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
#include <string.h>
3232
#include <stdio.h>
3333

34-
#include <tinycbor/cbor_buf_writer.h>
35-
#include <tinycbor/cbor_buf_reader.h>
36-
#include <tinycbor/cbor_defs.h>
37-
#include "tinycbor/tinycbor-version.h"
34+
#include "cbor_buf_writer.h"
35+
#include "cbor_buf_reader.h"
36+
#include "cbor_defs.h"
37+
#include "tinycbor-version.h"
3838

3939
#define TINYCBOR_VERSION ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)
4040

src/cbor_buf_reader.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
**
2323
****************************************************************************/
2424

25-
#include <tinycbor/cbor_buf_reader.h>
26-
#include <tinycbor/compilersupport_p.h>
25+
#include "cbor_buf_reader.h"
26+
#include "compilersupport_p.h"
2727

2828
CBOR_INLINE_API uint16_t get16(const uint8_t *ptr)
2929
{

include/tinycbor/cbor_buf_reader.h renamed to src/cbor_buf_reader.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
extern "C" {
3030
#endif
3131

32-
#include <tinycbor/cbor_decoder_reader.h>
32+
#include "cbor_decoder_reader.h"
3333

3434
struct cbor_buf_reader {
3535
struct cbor_decoder_reader r;

src/cbor_buf_writer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
**
2323
****************************************************************************/
2424

25-
#include <tinycbor/cbor.h>
26-
#include <tinycbor/cbor_buf_writer.h>
25+
#include "cbor.h"
26+
#include "cbor_buf_writer.h"
2727

2828
CBOR_INLINE_API int
2929
would_overflow(struct cbor_buf_writer *cb, size_t len)

include/tinycbor/cbor_buf_writer.h renamed to src/cbor_buf_writer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef CBOR_BUF_WRITER_H
2626
#define CBOR_BUF_WRITER_H
2727

28-
#include <tinycbor/cbor_encoder_writer.h>
28+
#include "cbor_encoder_writer.h"
2929

3030
#ifdef __cplusplus
3131
extern "C" {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/cborencoder.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
# define __STDC_LIMIT_MACROS 1
2929
#endif
3030

31-
#include "tinycbor/cbor.h"
32-
#include "tinycbor/cborconstants_p.h"
33-
#include "tinycbor/compilersupport_p.h"
34-
#include "tinycbor/cbor_buf_writer.h"
31+
#include "cbor.h"
32+
#include "cborconstants_p.h"
33+
#include "compilersupport_p.h"
34+
#include "cbor_buf_writer.h"
3535

3636
#include <stdlib.h>
3737
#include <string.h>

src/cborerrorstrings.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
**
2323
****************************************************************************/
2424

25-
#include "tinycbor/cbor_defs.h"
26-
#include "tinycbor/cbor.h"
25+
#include "cbor_defs.h"
26+
#include "cbor.h"
2727

2828
#ifndef _
2929
# define _(msg) msg

include/tinycbor/cborinternal_p.h renamed to src/cborinternal_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef CBORINTERNAL_P_H
2626
#define CBORINTERNAL_P_H
2727

28-
#include "tinycbor/compilersupport_p.h"
28+
#include "compilersupport_p.h"
2929

3030
#ifndef CBOR_INTERNAL_API
3131
# define CBOR_INTERNAL_API
File renamed without changes.

src/cborparser.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
# define __STDC_LIMIT_MACROS 1
2929
#endif
3030

31-
#include "tinycbor/cbor.h"
32-
#include "tinycbor/cborconstants_p.h"
33-
#include "tinycbor/compilersupport_p.h"
31+
#include "cbor.h"
32+
#include "cborconstants_p.h"
33+
#include "compilersupport_p.h"
3434

3535
#include <string.h>
3636

37-
#include <tinycbor/cbor_buf_reader.h>
37+
#include "cbor_buf_reader.h"
3838

3939
#ifndef CBOR_PARSER_MAX_RECURSIONS
4040
# define CBOR_PARSER_MAX_RECURSIONS 1024

src/cborparser_dup_string.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
# define __STDC_LIMIT_MACROS 1
2929
#endif
3030

31-
#include "tinycbor/cbor.h"
31+
#include "cbor.h"
3232
#include <stdlib.h>
33-
#include "tinycbor/compilersupport_p.h"
33+
#include "compilersupport_p.h"
3434

3535
/**
3636
* \fn CborError cbor_value_dup_text_string(const CborValue *value, char **buffer, size_t *buflen, CborValue *next)

src/cborpretty.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
# define __STDC_LIMIT_MACROS 1
2929
#endif
3030

31-
#include "tinycbor/cbor.h"
32-
#include "tinycbor/compilersupport_p.h"
33-
#include "tinycbor/cborinternal_p.h"
34-
#include "tinycbor/utf8_p.h"
31+
#include "cbor.h"
32+
#include "compilersupport_p.h"
33+
#include "cborinternal_p.h"
34+
#include "utf8_p.h"
3535

3636
#include <float.h>
3737
#include <inttypes.h>

src/cbortojson.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
# define __STDC_LIMIT_MACROS 1
3131
#endif
3232

33-
#include "tinycbor/cbor.h"
34-
#include "tinycbor/cborjson.h"
35-
#include "tinycbor/compilersupport_p.h"
33+
#include "cbor.h"
34+
#include "cborjson.h"
35+
#include "compilersupport_p.h"
3636

3737
#include <float.h>
3838
#include <inttypes.h>

src/cborvalidation.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
# define __STDC_LIMIT_MACROS 1
2929
#endif
3030

31-
#include "tinycbor/cbor.h"
32-
#include "tinycbor/cborinternal_p.h"
33-
#include "tinycbor/compilersupport_p.h"
34-
#include "tinycbor/utf8_p.h"
31+
#include "cbor.h"
32+
#include "cborinternal_p.h"
33+
#include "compilersupport_p.h"
34+
#include "utf8_p.h"
3535

3636
#include <string.h>
3737

File renamed without changes.

src/open_memstream.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef size_t LenType;
4747
# error "Cannot implement open_memstream!"
4848
#endif
4949

50-
#include "tinycbor/compilersupport_p.h"
50+
#include "compilersupport_p.h"
5151

5252
struct Buffer
5353
{

src/src.pri

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ SOURCES += \
1313
HEADERS += $$PWD/cbor.h $$PWD/tinycbor-version.h
1414
QMAKE_CFLAGS *= $$QMAKE_CFLAGS_SPLIT_SECTIONS
1515
QMAKE_LFLAGS *= $$QMAKE_LFLAGS_GCSECTIONS
16-
INCLUDEPATH += $$PWD/include
16+
INCLUDEPATH += $$PWD/
1717
CONFIG(release, debug|release): DEFINES += NDEBUG
File renamed without changes.

include/tinycbor/utf8_p.h renamed to src/utf8_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
**
2323
****************************************************************************/
2424

25-
#include "tinycbor/compilersupport_p.h"
25+
#include "compilersupport_p.h"
2626

2727
#include <stdint.h>
2828

tests/cpp/cpp.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CONFIG += testcase parallel_test c++11
22
QT = core testlib
33

44
SOURCES = tst_cpp.cpp
5-
INCLUDEPATH += ../../include/
5+
INCLUDEPATH += ../../src/
66
msvc: POST_TARGETDEPS = ../../lib/tinycbor.lib
77
else: POST_TARGETDEPS += ../../lib/libtinycbor.a
88
LIBS += $$POST_TARGETDEPS

tests/encoder/encoder.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SOURCES += tst_encoder.cpp
33
CONFIG += testcase parallel_test c++11
44
QT = core testlib
55

6-
INCLUDEPATH += ../../include
6+
INCLUDEPATH += ../../src
77
msvc: POST_TARGETDEPS = ../../lib/tinycbor.lib
88
else: POST_TARGETDEPS += ../../lib/libtinycbor.a
99
LIBS += $$POST_TARGETDEPS

tests/encoder/tst_encoder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
****************************************************************************/
2424

2525
#include <QtTest>
26-
#include "tinycbor/cbor.h"
27-
#include "tinycbor/cbor_buf_writer.h"
26+
#include "cbor.h"
27+
#include "cbor_buf_writer.h"
2828

2929
Q_DECLARE_METATYPE(CborError)
3030

tests/parser/parser.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CONFIG += testcase parallel_test c++11
44
QT = core testlib
55
DEFINES += CBOR_PARSER_MAX_RECURSIONS=16
66

7-
INCLUDEPATH += ../../include
7+
INCLUDEPATH += ../../src
88
msvc: POST_TARGETDEPS = ../../lib/tinycbor.lib
99
else: POST_TARGETDEPS += ../../lib/libtinycbor.a
1010
LIBS += $$POST_TARGETDEPS

tests/parser/tst_parser.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#define _XOPEN_SOURCE 700
2626
#include <QtTest>
27-
#include "tinycbor/cbor.h"
28-
#include "tinycbor/cbor_buf_reader.h"
27+
#include "cbor.h"
28+
#include "cbor_buf_reader.h"
2929
#include <locale.h>
3030
#include <stdio.h>
3131

tests/tojson/tojson.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CONFIG += testcase parallel_test c++11
22
QT = core testlib
33

44
SOURCES += tst_tojson.cpp
5-
INCLUDEPATH += ../../include
5+
INCLUDEPATH += ../../src
66
msvc: POST_TARGETDEPS = ../../lib/tinycbor.lib
77
else: POST_TARGETDEPS += ../../lib/libtinycbor.a
88
LIBS += $$POST_TARGETDEPS

tests/tojson/tst_tojson.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
****************************************************************************/
2424

2525
#include <QtTest>
26-
#include "tinycbor/cbor.h"
27-
#include "tinycbor/cborjson.h"
26+
#include "cbor.h"
27+
#include "cborjson.h"
2828
#include <locale.h>
2929

3030
extern "C" FILE *open_memstream(char **bufptr, size_t *sizeptr);

tools/cbordump/cbordump.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
****************************************************************************/
2424

2525
#define _POSIX_C_SOURCE 200809L
26-
#include "tinycbor/cbor.h"
27-
#include "tinycbor/cborjson.h"
28-
#include "tinycbor/cbor_buf_reader.h"
26+
#include "cbor.h"
27+
#include "cborjson.h"
28+
#include "cbor_buf_reader.h"
2929
#include <errno.h>
3030
#include <stdio.h>
3131
#include <stdlib.h>

0 commit comments

Comments
 (0)