summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-07-09 20:20:33 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-07-09 20:20:33 -0700
commit28ec9a1fa0f9b1d741920dfa8afc91fa2532c43d (patch)
tree6849230180a254424f4c1f385b919632211f3ac1
parent604c1a78bcbcc5b282ac6aab01a425baeaebdfbd (diff)
Split src/ into core/ and stream/.
-rw-r--r--Makefile22
-rw-r--r--README9
-rw-r--r--core/upb.c (renamed from src/upb.c)0
-rw-r--r--core/upb.h (renamed from src/upb.h)0
-rw-r--r--core/upb_atomic.h (renamed from src/upb_atomic.h)0
-rw-r--r--core/upb_def.c (renamed from src/upb_def.c)0
-rw-r--r--core/upb_def.h (renamed from src/upb_def.h)0
-rw-r--r--core/upb_stream.h (renamed from src/upb_stream.h)0
-rw-r--r--core/upb_stream_vtbl.h (renamed from src/upb_stream_vtbl.h)0
-rw-r--r--core/upb_string.c (renamed from src/upb_string.c)0
-rw-r--r--core/upb_string.h (renamed from src/upb_string.h)0
-rw-r--r--core/upb_table.c (renamed from src/upb_table.c)0
-rw-r--r--core/upb_table.h (renamed from src/upb_table.h)0
-rwxr-xr-xgen-deps.sh2
-rw-r--r--src/upb_inlinedefs.c20
-rw-r--r--stream/upb_byteio.h (renamed from src/upb_byteio.h)0
-rw-r--r--stream/upb_decoder.c (renamed from src/upb_decoder.c)0
-rw-r--r--stream/upb_decoder.h (renamed from src/upb_decoder.h)0
-rw-r--r--stream/upb_encoder.c (renamed from src/upb_encoder.c)0
-rw-r--r--stream/upb_encoder.h (renamed from src/upb_encoder.h)0
-rw-r--r--stream/upb_text.c (renamed from src/upb_text.c)0
-rw-r--r--stream/upb_text.h (renamed from src/upb_text.h)0
22 files changed, 19 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index 1ba7400..ca4f940 100644
--- a/Makefile
+++ b/Makefile
@@ -27,13 +27,13 @@ rwildcard=$(strip $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)$(filter $
CC=gcc
CXX=g++
CFLAGS=-std=c99
-INCLUDE=-Idescriptor -Isrc -Itests -I.
+INCLUDE=-Idescriptor -Icore -Itests -I.
CPPFLAGS=-Wall -Wextra -g $(INCLUDE) $(strip $(shell test -f perf-cppflags && cat perf-cppflags))
LDLIBS=-lpthread
-LIBUPB=src/libupb.a
-LIBUPB_PIC=src/libupb_pic.a
-LIBUPB_SHARED=src/libupb.so
+LIBUPB=core/libupb.a
+LIBUPB_PIC=core/libupb_pic.a
+LIBUPB_SHARED=core/libupb.so
ALL=deps $(OBJ) $(LIBUPB) $(LIBUPB_PIC)
all: $(ALL)
clean:
@@ -45,16 +45,16 @@ clean:
rm -rf tools/upbc deps
cd lang_ext/python && python setup.py clean --all
-# The core library (src/libupb.a)
-SRC=src/upb.c src/upb_decoder.c src/upb_table.c src/upb_def.c src/upb_string.c \
+# The core library (core/libupb.a)
+SRC=core/upb.c stream/upb_decoder.c core/upb_table.c core/upb_def.c core/upb_string.c \
descriptor/descriptor.c
# Parts of core that are yet to be converted.
OTHERSRC=src/upb_encoder.c src/upb_text.c
# Override the optimization level for upb_def.o, because it is not in the
# critical path but gets very large when -O3 is used.
-src/upb_def.o: src/upb_def.c
+core/upb_def.o: core/upb_def.c
$(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $<
-src/upb_def.lo: src/upb_def.c
+core/upb_def.lo: core/upb_def.c
$(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< -fPIC
@@ -91,7 +91,7 @@ TESTS=tests/tests \
tests/t.test_vs_proto2.googlemessage1 \
tests/t.test_vs_proto2.googlemessage2 \
tests/test.proto.pb
-$(TESTS): src/libupb.a
+$(TESTS): core/libupb.a
#VALGRIND=valgrind --leak-check=full --error-exitcode=1
VALGRIND=
@@ -129,10 +129,10 @@ tests/test_table: tests/test_table.cc
# Includes <hash_set> which is a deprecated header.
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -Wno-deprecated -o $@ $< $(LIBUPB)
-tests/tests: src/libupb.a
+tests/tests: core/libupb.a
# Tools
-tools/upbc: src/libupb.a
+tools/upbc: core/libupb.a
# Benchmarks
UPB_BENCHMARKS=benchmarks/b.parsetostruct_googlemessage1.upb_table_byval \
diff --git a/README b/README
index e869667..efa3ddb 100644
--- a/README
+++ b/README
@@ -10,6 +10,11 @@ ROADMAP OF THE SOURCE
benchmark/
Benchmarks of upb and other protocol buffer implementations.
+core/
+ The core source directory. builds into core/libupb.a. Contains only the
+ very core library, which is capable of loading descriptors given the
+ appropriate decoder. Does not even contain decoders for the standard
+ formats like the protobuf text and binary formats.
descriptor/
Files that describe the format of Protocol Buffer "descriptors", which are
protocol buffers that describe the format of other protocol buffers. These
@@ -19,8 +24,8 @@ labs/
about alternate ways of implementing things. When possible, these are
benchmarked by the tests in benchmark/. We also test these with the tests
in tests/, to ensure that the alternate implementations are actually correct.
-src/
- The core source directory. builds into src/libupb.a.
+stream/
+ Implementations of streaming protobuf encoders and decoders.
tests/
Unit tests.
tools/
diff --git a/src/upb.c b/core/upb.c
index a98512d..a98512d 100644
--- a/src/upb.c
+++ b/core/upb.c
diff --git a/src/upb.h b/core/upb.h
index 230e638..230e638 100644
--- a/src/upb.h
+++ b/core/upb.h
diff --git a/src/upb_atomic.h b/core/upb_atomic.h
index 01fc8a2..01fc8a2 100644
--- a/src/upb_atomic.h
+++ b/core/upb_atomic.h
diff --git a/src/upb_def.c b/core/upb_def.c
index bfab738..bfab738 100644
--- a/src/upb_def.c
+++ b/core/upb_def.c
diff --git a/src/upb_def.h b/core/upb_def.h
index c297e83..c297e83 100644
--- a/src/upb_def.h
+++ b/core/upb_def.h
diff --git a/src/upb_stream.h b/core/upb_stream.h
index e7b4074..e7b4074 100644
--- a/src/upb_stream.h
+++ b/core/upb_stream.h
diff --git a/src/upb_stream_vtbl.h b/core/upb_stream_vtbl.h
index 0ec45d2..0ec45d2 100644
--- a/src/upb_stream_vtbl.h
+++ b/core/upb_stream_vtbl.h
diff --git a/src/upb_string.c b/core/upb_string.c
index 91ab9ae..91ab9ae 100644
--- a/src/upb_string.c
+++ b/core/upb_string.c
diff --git a/src/upb_string.h b/core/upb_string.h
index 770dba7..770dba7 100644
--- a/src/upb_string.h
+++ b/core/upb_string.h
diff --git a/src/upb_table.c b/core/upb_table.c
index b91776c..b91776c 100644
--- a/src/upb_table.c
+++ b/core/upb_table.c
diff --git a/src/upb_table.h b/core/upb_table.h
index 20dae92..20dae92 100644
--- a/src/upb_table.h
+++ b/core/upb_table.h
diff --git a/gen-deps.sh b/gen-deps.sh
index 6c0ced3..2bc82f8 100755
--- a/gen-deps.sh
+++ b/gen-deps.sh
@@ -14,5 +14,5 @@
set -e
rm -f deps
for file in $@; do
- gcc -MM $file -MT ${file%.*}.o -DUPB_THREAD_UNSAFE -Idescriptor -Isrc -I. >> deps
+ gcc -MM $file -MT ${file%.*}.o -DUPB_THREAD_UNSAFE -Idescriptor -Icore -Istream -I. >> deps
done
diff --git a/src/upb_inlinedefs.c b/src/upb_inlinedefs.c
deleted file mode 100644
index 5db04f6..0000000
--- a/src/upb_inlinedefs.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * upb - a minimalist implementation of protocol buffers.
- *
- * This file, if compiled, will contain standalone (non-inlined) versions of
- * all inline functions defined in header files. We don't generally use this
- * file since we use "static inline" for inline functions (which will put a
- * standalone version of the function in any .o file that needs it, but
- * compiling this file and dumping the object file will let us inspect how
- * inline functions are compiled, so we keep it around.
- *
- * Copyright (c) 2009 Joshua Haberman. See LICENSE for details.
- */
-
-#define INLINE
-#include "upb.h"
-#include "upb_data.h"
-#include "upb_def.h"
-#include "upb_parse.h"
-#include "upb_table.h"
-#include "upb_text.h"
diff --git a/src/upb_byteio.h b/stream/upb_byteio.h
index 69a28b3..69a28b3 100644
--- a/src/upb_byteio.h
+++ b/stream/upb_byteio.h
diff --git a/src/upb_decoder.c b/stream/upb_decoder.c
index e3fdc49..e3fdc49 100644
--- a/src/upb_decoder.c
+++ b/stream/upb_decoder.c
diff --git a/src/upb_decoder.h b/stream/upb_decoder.h
index dde61fc..dde61fc 100644
--- a/src/upb_decoder.h
+++ b/stream/upb_decoder.h
diff --git a/src/upb_encoder.c b/stream/upb_encoder.c
index 304a423..304a423 100644
--- a/src/upb_encoder.c
+++ b/stream/upb_encoder.c
diff --git a/src/upb_encoder.h b/stream/upb_encoder.h
index e879b0b..e879b0b 100644
--- a/src/upb_encoder.h
+++ b/stream/upb_encoder.h
diff --git a/src/upb_text.c b/stream/upb_text.c
index 8662269..8662269 100644
--- a/src/upb_text.c
+++ b/stream/upb_text.c
diff --git a/src/upb_text.h b/stream/upb_text.h
index d89c9d6..d89c9d6 100644
--- a/src/upb_text.h
+++ b/stream/upb_text.h
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback