Split src/ into core/ and stream/.

pull/13171/head
Joshua Haberman 15 years ago
parent 604c1a78bc
commit 28ec9a1fa0
  1. 22
      Makefile
  2. 9
      README
  3. 0
      core/upb.c
  4. 0
      core/upb.h
  5. 0
      core/upb_atomic.h
  6. 0
      core/upb_def.c
  7. 0
      core/upb_def.h
  8. 0
      core/upb_stream.h
  9. 0
      core/upb_stream_vtbl.h
  10. 0
      core/upb_string.c
  11. 0
      core/upb_string.h
  12. 0
      core/upb_table.c
  13. 0
      core/upb_table.h
  14. 2
      gen-deps.sh
  15. 20
      src/upb_inlinedefs.c
  16. 0
      stream/upb_byteio.h
  17. 0
      stream/upb_decoder.c
  18. 0
      stream/upb_decoder.h
  19. 0
      stream/upb_encoder.c
  20. 0
      stream/upb_encoder.h
  21. 0
      stream/upb_text.c
  22. 0
      stream/upb_text.h

@ -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 \

@ -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/

@ -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

@ -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"
Loading…
Cancel
Save