Renamed lang_ext -> bindings, README updates.

pull/13171/head
Joshua Haberman 14 years ago
parent 3387ccaffd
commit 08e7ad94f9
  1. 20
      Makefile
  2. 8
      README
  3. 0
      bindings/cpp/upb/handlers.hpp
  4. 0
      bindings/lua/test.lua
  5. 0
      bindings/lua/upb.c
  6. 0
      bindings/python/setup.py
  7. 0
      bindings/python/test.py
  8. 0
      bindings/python/upb.c
  9. 0
      bindings/python/upb/__init__.py
  10. 3
      upb/descriptor.c

@ -126,8 +126,8 @@ clean_leave_profile:
rm -rf $(TESTS) tests/t.*
rm -rf upb/descriptor.pb
rm -rf tools/upbc deps
rm -rf lang_ext/lua/upb.so
rm -rf lang_ext/python/build
rm -rf bindings/lua/upb.so
rm -rf bindings/python/build
clean: clean_leave_profile
rm -rf $(call rwildcard,,*.gcno) $(call rwildcard,,*.gcda)
@ -464,21 +464,21 @@ else
LUA_LDFLAGS =
endif
LUAEXT=lang_ext/lua/upb.so
LUAEXT=bindings/lua/upb.so
lua: $(LUAEXT)
lang_ext/lua/upb.so: lang_ext/lua/upb.c $(LIBUPB_PIC)
$(E) CC lang_ext/lua/upb.c
bindings/lua/upb.so: bindings/lua/upb.c $(LIBUPB_PIC)
$(E) CC bindings/lua/upb.c
$(Q) $(CC) $(CFLAGS) $(CPPFLAGS) $(LUA_CPPFLAGS) -fpic -shared -o $@ $< upb/libupb_pic.a $(LUA_LDFLAGS)
# Python extension #############################################################
PYTHON=python
PYTHONEXT=lang_ext/python/build/install/lib/python/upb/__init__.so
PYTHONEXT=bindings/python/build/install/lib/python/upb/__init__.so
python: $(PYTHONEXT)
$(PYTHONEXT): $(LIBUPB_PIC) lang_ext/python/upb.c
$(E) PYTHON lang_ext/python/upb.c
$(Q) cd lang_ext/python && $(PYTHON) setup.py build --debug install --home=build/install
$(PYTHONEXT): $(LIBUPB_PIC) bindings/python/upb.c
$(E) PYTHON bindings/python/upb.c
$(Q) cd bindings/python && $(PYTHON) setup.py build --debug install --home=build/install
pythontest: $(PYTHONEXT)
cd lang_ext/python && cp test.py build/install/lib/python && valgrind $(PYTHON) ./build/install/lib/python/test.py
cd bindings/python && cp test.py build/install/lib/python && valgrind $(PYTHON) ./build/install/lib/python/test.py

@ -1,9 +1,9 @@
upb - a minimalist implementation of protocol buffers.
upb - a small, low-level protocol buffer library
For API documentation, see the header files.
To build (the core library is ANSI C and has no dependencies):
To build (the core library is ANSI C99 and has no dependencies):
$ make
Other useful targets:
@ -33,10 +33,6 @@ the major things that are broken or not yet implemented yet:
- serialization isn't written yet (only deserialization)
- the language extensions that exist so far (Python and Lua) are totally
incomplete/broken. They are not usable for anything yet. This will
be remedied very soon.
CONTACT
=======

@ -304,6 +304,7 @@ static bool upb_fielddef_parsedefault(char *str, upb_value *d, int type) {
} else if (type == UPB_TYPE(MESSAGE) || type == UPB_TYPE(GROUP)) {
// We don't expect to get a default value.
free(str);
upb_value_setptr(d, NULL);
if (str != NULL) success = false;
} else if (type == UPB_TYPE(BOOL)) {
if (!str || strcmp(str, "false") == 0)
@ -356,6 +357,7 @@ static bool upb_fielddef_parsedefault(char *str, upb_value *d, int type) {
upb_value_setfloat(d, strtof(str, &end));
if (errno == ERANGE || *end) success = false;
break;
default: abort();
}
free(str);
}
@ -377,6 +379,7 @@ static void upb_fielddef_endmsg(void *_r, upb_status *status) {
char *dstr = r->default_string;
r->default_string = NULL;
upb_value val;
upb_value_setptr(&val, NULL); // Silence inaccurate compiler warnings.
if (!upb_fielddef_parsedefault(dstr, &val, f->type)) {
// We don't worry too much about giving a great error message since the
// compiler should have ensured this was correct.

Loading…
Cancel
Save