Commit 7c04f501 authored by Slava Monich's avatar Slava Monich

[libwspcodec] Repackaging + content type fix

Moved the sources to wspcodec directory so that it resembles the
layout of the installed include files. Makes it easier to build
something that references libwspcodec without installing the devel
package.

Made content type field configurable. This resolves the conflict
between WSP Content-Type and X-Mms-Report-Allowed (both are 0x11)

Bumped version to 2.0.0 because this update is not backward compatible.
parent 719b9e74
......@@ -2,6 +2,14 @@
build
debian/*.log
debian/*substvars
debian/libwspcodec
debian/libwspcodec-dev
debian/libwspcodec.postinst.debhelper
debian/libwspcodec.postrm.debhelper
debian/files
debian/tmp
documentation.list
installroot
libwspcodec.ncb
libwspcodec.opt
RPMS
......@@ -15,7 +15,7 @@ all: debug release pkgconfig
# Library version
#
VERSION_MAJOR = 1
VERSION_MAJOR = 2
VERSION_MINOR = 0
VERSION_MICRO = 0
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO)
......@@ -34,7 +34,7 @@ SRC = wsputil.c
# Directories
#
SRC_DIR = src
SRC_DIR = wspcodec
BUILD_DIR = build
DEBUG_BUILD_DIR = $(BUILD_DIR)/debug
RELEASE_BUILD_DIR = $(BUILD_DIR)/release
......
libwspcodec (2.0.0) unstable; urgency=low
* Made content type field configurable.
This resolves conflict between WSP Content-Type and X-Mms-Report-Allowed
headers (both are equal 0x11)
-- Slava Monich <slava.monich@jolla.com> Thu, 26 Dec 2013 00:27:57 +0200
libwspcodec (1.0.1) unstable; urgency=low
* Repackaged the sources, no API changes.
-- Slava Monich <slava.monich@jolla.com> Thu, 26 Dec 2013 00:27:57 +0200
libwspcodec (1.0.0) unstable; urgency=low
* Initial release
......
......@@ -8,11 +8,11 @@ Standards-Version: 3.8.4
Package: libwspcodec
Section: libs
Architecture: any
Depends: libglib2.0-bin (>= 2.0)
Depends: libglib2.0-bin (>= 2.32), ${shlibs:Depends}, ${misc:Depends}
Description: WSP encoder and decoder library
Package: libwspcodec-dev
Section: libdevel
Architecture: any
Depends: libwspcodec (= ${binary:Version})
Depends: libwspcodec (= ${binary:Version}), libglib2.0-dev (>= 2.32), ${misc:Depends}
Description: Development files for libwspcodec
src/wspcodec.h usr/include/libwspcodec/wspcodec
src/wsputil.h usr/include/libwspcodec/wspcodec
wspcodec/wspcodec.h usr/include/libwspcodec/wspcodec
wspcodec/wsputil.h usr/include/libwspcodec/wspcodec
build/libwspcodec.pc usr/lib/pkgconfig
debian/tmp/usr/lib/libwspcodec.so* usr/lib
# Microsoft Developer Studio Project File - Name="libwspcodec" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=libwspcodec - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libwspcodec.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libwspcodec.mak" CFG="libwspcodec - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libwspcodec - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "libwspcodec - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "libwspcodec - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "build/Release"
# PROP BASE Intermediate_Dir "build/Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "build/Release"
# PROP Intermediate_Dir "build/Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "$(GTK_ROOT)/include/glib-2.0" /I "$(GTK_ROOT)/lib/glib-2.0/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "libwspcodec - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "build/Debug"
# PROP BASE Intermediate_Dir "build/Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "build/Debug"
# PROP Intermediate_Dir "build/Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "$(GTK_ROOT)/include/glib-2.0" /I "$(GTK_ROOT)/lib/glib-2.0/include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "libwspcodec - Win32 Release"
# Name "libwspcodec - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\wspcodec\wsputil.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\wspcodec\wspcodec.h
# End Source File
# Begin Source File
SOURCE=.\wspcodec\wsputil.h
# End Source File
# End Group
# End Target
# End Project
Name: libwspcodec
Version: 1.0.0
Version: 2.0.0
Release: 1
Summary: WSP encoder and decoder library
Group: Development/Libraries
......
......@@ -528,18 +528,13 @@ gboolean wsp_decode_application_id(struct wsp_header_iter *iter,
}
static inline gboolean is_content_type_header(const unsigned char *pdu,
unsigned char code_page,
unsigned int flags)
struct wsp_header_iter *iter)
{
/* Check for MMS Content-Type header */
if (flags & WSP_HEADER_ITER_FLAG_DETECT_MMS_MULTIPART)
if (code_page == 1 && *pdu == 0x84)
/* Check for Content-Type header */
if (iter->flags & WSP_HEADER_ITER_FLAG_DETECT_MULTIPART)
if (iter->code_page == 1 && *pdu == iter->content_type_header)
return TRUE;
/* Check for WSP default Content-Type header */
if (code_page == 1 && *pdu == 0x91)
return TRUE;
return FALSE;
}
......@@ -639,6 +634,12 @@ void wsp_header_iter_init(struct wsp_header_iter *iter,
iter->max = len;
iter->code_page = 1;
iter->flags = flags;
if (flags & WSP_HEADER_ITER_FLAG_DETECT_MMS_MULTIPART) {
iter->flags |= WSP_HEADER_ITER_FLAG_DETECT_MULTIPART;
iter->content_type_header = 0x84;
} else {
iter->content_type_header = 0x91;
}
}
gboolean wsp_header_iter_next(struct wsp_header_iter *iter)
......@@ -687,7 +688,7 @@ gboolean wsp_header_iter_next(struct wsp_header_iter *iter)
return FALSE;
if (*pdu >= 0x80) {
if (is_content_type_header(pdu, iter->code_page, iter->flags))
if (is_content_type_header(pdu, iter))
return FALSE;
header = WSP_HEADER_TYPE_WELL_KNOWN;
......@@ -742,7 +743,7 @@ gboolean wsp_header_iter_is_multipart(struct wsp_header_iter *iter)
{
const unsigned char *pdu = iter->pdu + iter->pos;
return is_content_type_header(pdu, iter->code_page, iter->flags);
return is_content_type_header(pdu, iter);
}
enum wsp_header_type wsp_header_iter_get_hdr_type(struct wsp_header_iter *iter)
......
......@@ -19,9 +19,13 @@
*
*/
#ifndef WSPUTIL_H
#define WSPUTIL_H
enum wsp_header_iter_flag {
WSP_HEADER_ITER_FLAG_REJECT_CP = 0x1,
WSP_HEADER_ITER_FLAG_DETECT_MMS_MULTIPART = 0x2,
WSP_HEADER_ITER_FLAG_DETECT_MULTIPART = 0x4,
};
enum wsp_header_type {
......@@ -97,6 +101,7 @@ struct wsp_header_iter {
unsigned int pos;
unsigned int flags;
unsigned char code_page;
unsigned char content_type_header;
enum wsp_header_type header_type;
const void *header;
......@@ -210,3 +215,5 @@ gboolean wsp_text_header_iter_init(struct wsp_text_header_iter *iter,
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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment