diff --git a/Makefile b/Makefile index 79eccf3..323e63f 100644 --- a/Makefile +++ b/Makefile @@ -16,13 +16,13 @@ all: debug release pkgconfig # VERSION_MAJOR = 2 -VERSION_MINOR = 0 -VERSION_MICRO = 0 -VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO) +VERSION_MINOR = 1 +VERSION_RELEASE = 0 +VERSION = $(VERSION_MAJOR).$(VERSION_MINOR) -LIB_SHORTCUT = libwspcodec.so -LIB_SONAME = $(LIB_SHORTCUT).$(VERSION_MAJOR) -LIB = $(LIB_SHORTCUT).$(VERSION) +LIB_SHORTCUT = libwspcodec-$(VERSION).so +LIB_SONAME = $(LIB_SHORTCUT) +LIB = $(LIB_SONAME).$(VERSION_RELEASE) # # Sources @@ -124,7 +124,7 @@ $(RELEASE_BUILD_DIR)/%.o : $(SRC_DIR)/%.c $(CC) -c $(RELEASE_CFLAGS) -MF"$(@:%.o=%.d)" $< -o $@ $(PKGCONFIG): libwspcodec.pc.in - sed -e 's/\[version\]/'$(VERSION)/g $< >> $@ + sed -e 's/\[version\]/'$(VERSION)/g $< > $@ # # Install @@ -142,13 +142,11 @@ INSTALL_LIB_DIR = $(DESTDIR)/usr/lib INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/libwspcodec/wspcodec INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig -INSTALL_ALIAS1 = $(INSTALL_LIB_DIR)/$(LIB_SONAME) -INSTALL_ALIAS2 = $(INSTALL_LIB_DIR)/$(LIB_SHORTCUT) +INSTALL_ALIAS = $(INSTALL_LIB_DIR)/$(LIB_SHORTCUT) install: $(INSTALL_LIB_DIR) $(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR) - ln -sf $(LIB) $(INSTALL_ALIAS1) - ln -sf $(LIB) $(INSTALL_ALIAS2) + ln -sf $(LIB) $(INSTALL_ALIAS) install-dev: install $(INSTALL_INCLUDE_DIR) $(INSTALL_PKGCONFIG_DIR) $(INSTALL_FILES) $(SRC_DIR)/wsputil.h $(INSTALL_INCLUDE_DIR) diff --git a/debian/changelog b/debian/changelog index a90587c..2473daf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +libwspcodec (2.1.0) unstable; urgency=low + + * Took out wsp_text_header_iter stuff. + Those functions were parsing a strange representation of textual + Content-Type like headers but the syntax they understood wasn't + HTTP compliant. This is pretty useless, has nothing to do with + WSP and doesn't belong here. + + -- Slava Monich Fri, 21 Feb 2014 16:36:45 +0200 + libwspcodec (2.0.0) unstable; urgency=low * Made content type field configurable. diff --git a/debian/libwspcodec.install b/debian/libwspcodec.install index 633b21a..a22e27e 100644 --- a/debian/libwspcodec.install +++ b/debian/libwspcodec.install @@ -1 +1 @@ -debian/tmp/usr/lib/libwspcodec.so* usr/lib +debian/tmp/usr/lib/libwspcodec*.so* usr/lib diff --git a/libwspcodec.pc.in b/libwspcodec.pc.in index 8e44582..5901e52 100644 --- a/libwspcodec.pc.in +++ b/libwspcodec.pc.in @@ -5,5 +5,5 @@ Name: libwspcodec Description: WSP encoder and decoder library Version: [version] Requires: glib-2.0 -Libs: -L${libdir} -lwspcodec +Libs: -L${libdir} -lwspcodec-[version] Cflags: -I${includedir} -I${includedir}/wspcodec diff --git a/rpm/libwspcodec.spec b/rpm/libwspcodec.spec index e87a761..b387a70 100644 --- a/rpm/libwspcodec.spec +++ b/rpm/libwspcodec.spec @@ -1,6 +1,6 @@ Name: libwspcodec -Version: 2.0.0 -Release: 1 +Version: 2.1 +Release: 0 Summary: WSP encoder and decoder library Group: Development/Libraries License: GPLv2 @@ -38,11 +38,11 @@ make install-dev DESTDIR=%{buildroot} %files %defattr(-,root,root,-) -%{_libdir}/%{name}.so.* +%{_libdir}/%{name}*.so.* %files devel %defattr(-,root,root,-) -%{_libdir}/%{name}.so +%{_libdir}/%{name}-2.1.so %{_libdir}/pkgconfig/libwspcodec.pc %{_includedir}/libwspcodec/wspcodec/wsputil.h %{_includedir}/libwspcodec/wspcodec/wspcodec.h diff --git a/wspcodec/wsputil.c b/wspcodec/wsputil.c index 8aa4c52..0cc2e5a 100644 --- a/wspcodec/wsputil.c +++ b/wspcodec/wsputil.c @@ -1147,161 +1147,3 @@ gboolean wsp_parameter_iter_next(struct wsp_parameter_iter *pi, return TRUE; } - -static const char *decode_token(char *buf, gboolean accept_quotes, - unsigned int *out_consumed, - char *out_terminator) -{ - unsigned int pos = 0; - unsigned int start; - unsigned int end; - char *endp; - char terminator = '\0'; - - /* Skip leading space */ - while (buf[pos] == ' ' || buf[pos] == '\t') - pos += 1; - - if (buf[pos] == '\0') - return NULL; - - start = pos; - - if (buf[pos] == '"') { - if (accept_quotes == FALSE) - return NULL; - - pos += 1; - start = pos; - - endp = strchr(buf + pos, '"'); - if (endp == NULL) - return NULL; - - pos = endp - buf; - end = pos; - pos += 1; - } else { - endp = strpbrk(buf + pos, sep_chars); - - if (endp == NULL) - pos = strlen(buf); - else - pos = endp - buf; - - end = pos; - } - - while (buf[pos] == ' ' || buf[pos] == '\t') - pos += 1; - - if (buf[pos] != '\0') { - terminator = buf[pos]; - pos += 1; - } - - buf[end] = '\0'; - - if (strpbrk(buf + start, ctl_chars) != NULL) - return NULL; - - *out_consumed = pos; - *out_terminator = terminator; - - return buf + start; -} - -gboolean wsp_text_header_iter_init(struct wsp_text_header_iter *iter, - const char *hdr) -{ - unsigned int len = strlen(hdr); - char terminator; - unsigned int consumed; - const char *key; - const char *value; - - if (len > MAX_TEXT_HEADER_SIZE) - return FALSE; - - memcpy(iter->hdr, hdr, len); - iter->hdr[len] = '\0'; - iter->pos = 0; - iter->key = NULL; - iter->value = NULL; - - key = decode_token(iter->hdr, FALSE, &consumed, &terminator); - if (key == NULL) - return FALSE; - - if (terminator != ':') - return FALSE; - - len = consumed; - - value = decode_token(iter->hdr + len, TRUE, &consumed, &terminator); - if (value == NULL) - return FALSE; - - if (terminator != '\0' && terminator != ';') - return FALSE; - - len += consumed; - - iter->key = key; - iter->value = value; - iter->pos = len; - - return TRUE; -} - -gboolean wsp_text_header_iter_param_next(struct wsp_text_header_iter *iter) -{ - unsigned int pos = iter->pos; - char terminator; - unsigned int consumed; - const char *key; - const char *value; - - key = decode_token(iter->hdr + pos, FALSE, &consumed, &terminator); - if (key == NULL) - return FALSE; - - /* Empty value */ - if (terminator == ';' || terminator == '\0') { - iter->key = key; - iter->value = NULL; - iter->pos += consumed; - - return TRUE; - } - - if (terminator != '=') - return FALSE; - - pos += consumed; - - value = decode_token(iter->hdr + pos, TRUE, &consumed, &terminator); - if (value == NULL) - return FALSE; - - if (terminator != '\0' && terminator != ';') - return FALSE; - - pos += consumed; - - iter->key = key; - iter->value = value; - iter->pos = pos; - - return TRUE; -} - -const char *wsp_text_header_iter_get_key(struct wsp_text_header_iter *iter) -{ - return iter->key; -} - -const char *wsp_text_header_iter_get_value(struct wsp_text_header_iter *iter) -{ - return iter->value; -} diff --git a/wspcodec/wsputil.h b/wspcodec/wsputil.h index cd59ca2..f098361 100644 --- a/wspcodec/wsputil.h +++ b/wspcodec/wsputil.h @@ -132,15 +132,6 @@ struct wsp_parameter_iter { unsigned int pos; }; -#define MAX_TEXT_HEADER_SIZE 4096 - -struct wsp_text_header_iter { - char hdr[MAX_TEXT_HEADER_SIZE + 1]; - unsigned int pos; - const char *key; - const char *value; -}; - gboolean wsp_decode_uintvar(const unsigned char *pdu, unsigned int len, unsigned int *out_len, unsigned int *consumed); gboolean wsp_decode_integer(const unsigned char *pdu, unsigned int len, @@ -210,10 +201,4 @@ void wsp_parameter_iter_init(struct wsp_parameter_iter *pi, gboolean wsp_parameter_iter_next(struct wsp_parameter_iter *pi, struct wsp_parameter *out_param); -gboolean wsp_text_header_iter_init(struct wsp_text_header_iter *iter, - const char *hdr); -gboolean wsp_text_header_iter_param_next(struct wsp_text_header_iter *iter); -const char *wsp_text_header_iter_get_key(struct wsp_text_header_iter *iter); -const char *wsp_text_header_iter_get_value(struct wsp_text_header_iter *iter); - #endif /* WSPUTIL_H */