Skip to content
a small protobuf implementation in C
Branch: master
Clone or download
haberman Merge pull request #162 from haberman/aspect
Replaced upb_proto_library() with a truly aspect-based rule.
Latest commit b088197 Apr 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
generated_for_cmake Fixed amalgamation and CMake build. Apr 24, 2019
kokoro/ubuntu
tests Merge pull request #162 from haberman/aspect Apr 24, 2019
third_party/lunit
tools Fixed include path. Apr 24, 2019
upb
upbc Fixed oneof case accessor to cast to enum for C++. Apr 19, 2019
.gitignore Implement json decoding for Any message. (#130) Dec 4, 2018
.gitmodules A good start on upb_encode and upb_decode. Jul 8, 2017
BUILD Merge pull request #162 from haberman/aspect Apr 24, 2019
CMakeLists.txt Fixed include path. Apr 24, 2019
CONTRIBUTING.md
DESIGN.md First version of a real C codegen for upb. Jul 5, 2017
LICENSE Update copyright to be Google Inc. Mar 20, 2011
README.md
WORKSPACE Fixed upb_proto_library() for macOS. Apr 23, 2019
build_defs.bzl Fixed amalgamation and CMake build. Apr 24, 2019
lua.BUILD WIP. Nov 2, 2018
ragel.BUILD Added missing files from Bazel build. Nov 4, 2018

README.md

μpb - a small protobuf implementation in C

Build Status Coverage Status

μpb is a small protobuf implementation written in C.

API and ABI are both subject to change! Please do not distribute as a shared library for this reason (for now at least).

Building the core libraries

The core libraries are pure C99 and have no dependencies.

$ make

This will create a separate C library for each core library in lib/. They are built separately to help your binaries slim, so you don't need to link in things you neither want or need.

Other useful targets:

$ make tests
$ make test

C and C++ API

The public C/C++ API is defined by all of the .h files in upb/ except .int.h files (which are internal-only).

Lua bindings

Lua bindings provide μpb's functionality to Lua programs. The bindings target Lua 5.1, Lua 5.2, LuaJIT, and (soon) Lua 5.3.

To build the Lua bindings, the Lua libraries must be installed. Once they are installed, run:

$ make lua

Note that if the Lua headers are not in a standard place, you may need to pass custom flags:

$ make lua USER_CPPFLAGS=`pkg-config lua5.2 --cflags`

To test the Lua bindings:

$ make testlua

Contact

Author: Josh Haberman (jhaberman@gmail.com, haberman@google.com)

You can’t perform that action at this time.