diff --git a/.gitignore b/.gitignore index 52540e70..b533abec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,26 @@ -CMakeCache.txt -CMakeFiles -Makefile -cmake_install.cmake -install_manifest.txt +/build*/ +cscope.* +.* +!.gitignore +*~ +/tmp/ +generated*.* +*.so +*.o +*.a +*.aux +*.out +*.log +*.nav +*.snm +*.glo +*.ist +*.toc +*.vrb +*.bbl +*.blg +*.pre +__pycache__/ +*.pyc +*.pya +*.fdb_latexmk diff --git a/CMakeLists.txt b/CMakeLists.txt index f7f2747b..4194d884 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,26 @@ -Project(libwebqq) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +project(libwebqq) +cmake_minimum_required(VERSION 2.6) -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/src) +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(PURPLE REQUIRED purple) +pkg_check_modules(GLIB REQUIRED glib-2.0) +pkg_check_modules(CURL REQUIRED libcurl) + +if(NOT PURPLE_MAJOR_VERSION) + set(PURPLE_MAJOR_VERSION "2") +endif(NOT PURPLE_MAJOR_VERSION) + +SET(PURPLE_LIB_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/lib/purple-${PURPLE_MAJOR_VERSION}") + +add_definitions(-DINST_PREFIX="${CMAKE_INSTALL_PREFIX}") + +option(NLS "Native language support" On) +if(NLS) + find_package(Gettext) +endif(NLS) add_subdirectory(src) +add_subdirectory(res) diff --git a/include/libghttp/.deps/libghttp_la-ghttp.Plo b/include/libghttp/.deps/libghttp_la-ghttp.Plo deleted file mode 100644 index a17cc0ad..00000000 --- a/include/libghttp/.deps/libghttp_la-ghttp.Plo +++ /dev/null @@ -1,202 +0,0 @@ -libghttp_la-ghttp.lo: ghttp.c /usr/include/stdlib.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/sys/types.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/unistd.h \ - /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ - /usr/include/x86_64-linux-gnu/bits/environments.h \ - /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/x86_64-linux-gnu/bits/unistd.h ghttp.h ghttp_constants.h \ - http_uri.h http_hdrs.h ghttp_constants.h http_trans.h \ - /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/x86_64-linux-gnu/bits/wchar.h \ - /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/x86_64-linux-gnu/bits/netdb.h \ - http_req.h /usr/include/stdio.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ - /usr/include/x86_64-linux-gnu/bits/stdio.h \ - /usr/include/x86_64-linux-gnu/bits/stdio2.h http_resp.h http_date.h \ - http_global.h http_base64.h - -/usr/include/stdlib.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -/usr/include/unistd.h: - -/usr/include/x86_64-linux-gnu/bits/posix_opt.h: - -/usr/include/x86_64-linux-gnu/bits/environments.h: - -/usr/include/x86_64-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/x86_64-linux-gnu/bits/unistd.h: - -ghttp.h: - -ghttp_constants.h: - -http_uri.h: - -http_hdrs.h: - -ghttp_constants.h: - -http_trans.h: - -/usr/include/x86_64-linux-gnu/sys/socket.h: - -/usr/include/x86_64-linux-gnu/sys/uio.h: - -/usr/include/x86_64-linux-gnu/bits/uio.h: - -/usr/include/x86_64-linux-gnu/bits/socket.h: - -/usr/include/x86_64-linux-gnu/bits/sockaddr.h: - -/usr/include/x86_64-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/x86_64-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/x86_64-linux-gnu/bits/socket2.h: - -/usr/include/netinet/in.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/x86_64-linux-gnu/bits/wchar.h: - -/usr/include/x86_64-linux-gnu/bits/in.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/x86_64-linux-gnu/bits/netdb.h: - -http_req.h: - -/usr/include/stdio.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h: - -/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: - -/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: - -/usr/include/x86_64-linux-gnu/bits/stdio.h: - -/usr/include/x86_64-linux-gnu/bits/stdio2.h: - -http_resp.h: - -http_date.h: - -http_global.h: - -http_base64.h: diff --git a/include/libghttp/.deps/libghttp_la-http_base64.Plo b/include/libghttp/.deps/libghttp_la-http_base64.Plo deleted file mode 100644 index f377db46..00000000 --- a/include/libghttp/.deps/libghttp_la-http_base64.Plo +++ /dev/null @@ -1,111 +0,0 @@ -libghttp_la-http_base64.lo: http_base64.c /usr/include/stdlib.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/sys/types.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/stdio.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ - /usr/include/x86_64-linux-gnu/bits/stdio.h \ - /usr/include/x86_64-linux-gnu/bits/stdio2.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h - -/usr/include/stdlib.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -/usr/include/stdio.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h: - -/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: - -/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: - -/usr/include/x86_64-linux-gnu/bits/stdio.h: - -/usr/include/x86_64-linux-gnu/bits/stdio2.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: diff --git a/include/libghttp/.deps/libghttp_la-http_date.Plo b/include/libghttp/.deps/libghttp_la-http_date.Plo deleted file mode 100644 index f1674e09..00000000 --- a/include/libghttp/.deps/libghttp_la-http_date.Plo +++ /dev/null @@ -1,60 +0,0 @@ -libghttp_la-http_date.lo: http_date.c /usr/include/string.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/ctype.h \ - http_date.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/bits/time.h - -/usr/include/string.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/stdlib.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -/usr/include/ctype.h: - -http_date.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: diff --git a/include/libghttp/.deps/libghttp_la-http_hdrs.Plo b/include/libghttp/.deps/libghttp_la-http_hdrs.Plo deleted file mode 100644 index c26054bb..00000000 --- a/include/libghttp/.deps/libghttp_la-http_hdrs.Plo +++ /dev/null @@ -1,92 +0,0 @@ -libghttp_la-http_hdrs.lo: http_hdrs.c /usr/include/stdlib.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/sys/types.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h http_hdrs.h \ - ghttp_constants.h - -/usr/include/stdlib.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -http_hdrs.h: - -ghttp_constants.h: diff --git a/include/libghttp/.deps/libghttp_la-http_req.Plo b/include/libghttp/.deps/libghttp_la-http_req.Plo deleted file mode 100644 index 0daace6b..00000000 --- a/include/libghttp/.deps/libghttp_la-http_req.Plo +++ /dev/null @@ -1,173 +0,0 @@ -libghttp_la-http_req.lo: http_req.c /usr/include/string.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ - /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h http_req.h \ - /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ - /usr/include/wchar.h /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ - /usr/include/x86_64-linux-gnu/bits/stdio.h \ - /usr/include/x86_64-linux-gnu/bits/stdio2.h http_hdrs.h \ - ghttp_constants.h http_trans.h \ - /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/x86_64-linux-gnu/bits/wchar.h \ - /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/x86_64-linux-gnu/bits/netdb.h \ - http_global.h - -/usr/include/string.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/stdlib.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -http_req.h: - -/usr/include/stdio.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h: - -/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: - -/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: - -/usr/include/x86_64-linux-gnu/bits/stdio.h: - -/usr/include/x86_64-linux-gnu/bits/stdio2.h: - -http_hdrs.h: - -ghttp_constants.h: - -http_trans.h: - -/usr/include/x86_64-linux-gnu/sys/socket.h: - -/usr/include/x86_64-linux-gnu/sys/uio.h: - -/usr/include/x86_64-linux-gnu/bits/uio.h: - -/usr/include/x86_64-linux-gnu/bits/socket.h: - -/usr/include/x86_64-linux-gnu/bits/sockaddr.h: - -/usr/include/x86_64-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/x86_64-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/x86_64-linux-gnu/bits/socket2.h: - -/usr/include/netinet/in.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/x86_64-linux-gnu/bits/wchar.h: - -/usr/include/x86_64-linux-gnu/bits/in.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/x86_64-linux-gnu/bits/netdb.h: - -http_global.h: diff --git a/include/libghttp/.deps/libghttp_la-http_resp.Plo b/include/libghttp/.deps/libghttp_la-http_resp.Plo deleted file mode 100644 index fe85ae84..00000000 --- a/include/libghttp/.deps/libghttp_la-http_resp.Plo +++ /dev/null @@ -1,193 +0,0 @@ -libghttp_la-http_resp.lo: http_resp.c /usr/include/stdlib.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/sys/types.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/ctype.h \ - /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ - /usr/include/x86_64-linux-gnu/bits/environments.h \ - /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/x86_64-linux-gnu/bits/unistd.h http_resp.h http_hdrs.h \ - ghttp_constants.h http_trans.h \ - /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/x86_64-linux-gnu/bits/wchar.h \ - /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/x86_64-linux-gnu/bits/netdb.h \ - http_req.h /usr/include/stdio.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ - /usr/include/x86_64-linux-gnu/bits/stdio.h \ - /usr/include/x86_64-linux-gnu/bits/stdio2.h http_global.h - -/usr/include/stdlib.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -/usr/include/ctype.h: - -/usr/include/unistd.h: - -/usr/include/x86_64-linux-gnu/bits/posix_opt.h: - -/usr/include/x86_64-linux-gnu/bits/environments.h: - -/usr/include/x86_64-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/x86_64-linux-gnu/bits/unistd.h: - -http_resp.h: - -http_hdrs.h: - -ghttp_constants.h: - -http_trans.h: - -/usr/include/x86_64-linux-gnu/sys/socket.h: - -/usr/include/x86_64-linux-gnu/sys/uio.h: - -/usr/include/x86_64-linux-gnu/bits/uio.h: - -/usr/include/x86_64-linux-gnu/bits/socket.h: - -/usr/include/x86_64-linux-gnu/bits/sockaddr.h: - -/usr/include/x86_64-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/x86_64-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/x86_64-linux-gnu/bits/socket2.h: - -/usr/include/netinet/in.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/x86_64-linux-gnu/bits/wchar.h: - -/usr/include/x86_64-linux-gnu/bits/in.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/x86_64-linux-gnu/bits/netdb.h: - -http_req.h: - -/usr/include/stdio.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdarg.h: - -/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: - -/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: - -/usr/include/x86_64-linux-gnu/bits/stdio.h: - -/usr/include/x86_64-linux-gnu/bits/stdio2.h: - -http_global.h: diff --git a/include/libghttp/.deps/libghttp_la-http_trans.Plo b/include/libghttp/.deps/libghttp_la-http_trans.Plo deleted file mode 100644 index a8c4c363..00000000 --- a/include/libghttp/.deps/libghttp_la-http_trans.Plo +++ /dev/null @@ -1,176 +0,0 @@ -libghttp_la-http_trans.lo: http_trans.c \ - /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/features.h \ - /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/types.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/unistd.h \ - /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ - /usr/include/x86_64-linux-gnu/bits/environments.h \ - /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/x86_64-linux-gnu/bits/unistd.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/errno.h \ - /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/x86_64-linux-gnu/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - http_trans.h /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/x86_64-linux-gnu/bits/wchar.h \ - /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/x86_64-linux-gnu/bits/netdb.h \ - http_global.h - -/usr/include/x86_64-linux-gnu/sys/time.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/unistd.h: - -/usr/include/x86_64-linux-gnu/bits/posix_opt.h: - -/usr/include/x86_64-linux-gnu/bits/environments.h: - -/usr/include/x86_64-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/x86_64-linux-gnu/bits/unistd.h: - -/usr/include/stdlib.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -/usr/include/errno.h: - -/usr/include/x86_64-linux-gnu/bits/errno.h: - -/usr/include/linux/errno.h: - -/usr/include/x86_64-linux-gnu/asm/errno.h: - -/usr/include/asm-generic/errno.h: - -/usr/include/asm-generic/errno-base.h: - -http_trans.h: - -/usr/include/x86_64-linux-gnu/sys/socket.h: - -/usr/include/x86_64-linux-gnu/sys/uio.h: - -/usr/include/x86_64-linux-gnu/bits/uio.h: - -/usr/include/x86_64-linux-gnu/bits/socket.h: - -/usr/include/x86_64-linux-gnu/bits/sockaddr.h: - -/usr/include/x86_64-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/x86_64-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/x86_64-linux-gnu/bits/socket2.h: - -/usr/include/netinet/in.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/x86_64-linux-gnu/bits/wchar.h: - -/usr/include/x86_64-linux-gnu/bits/in.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/x86_64-linux-gnu/bits/netdb.h: - -http_global.h: diff --git a/include/libghttp/.deps/libghttp_la-http_uri.Plo b/include/libghttp/.deps/libghttp_la-http_uri.Plo deleted file mode 100644 index b2aaed9a..00000000 --- a/include/libghttp/.deps/libghttp_la-http_uri.Plo +++ /dev/null @@ -1,92 +0,0 @@ -libghttp_la-http_uri.lo: http_uri.c /usr/include/string.h \ - /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h \ - /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ - /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/string3.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ - /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/bits/select2.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/ctype.h \ - http_uri.h - -/usr/include/string.h: - -/usr/include/features.h: - -/usr/include/x86_64-linux-gnu/bits/predefs.h: - -/usr/include/x86_64-linux-gnu/sys/cdefs.h: - -/usr/include/x86_64-linux-gnu/bits/wordsize.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs.h: - -/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: - -/usr/lib/gcc/x86_64-linux-gnu/4.6/include/stddef.h: - -/usr/include/xlocale.h: - -/usr/include/x86_64-linux-gnu/bits/string.h: - -/usr/include/x86_64-linux-gnu/bits/string2.h: - -/usr/include/endian.h: - -/usr/include/x86_64-linux-gnu/bits/endian.h: - -/usr/include/x86_64-linux-gnu/bits/byteswap.h: - -/usr/include/x86_64-linux-gnu/bits/types.h: - -/usr/include/x86_64-linux-gnu/bits/typesizes.h: - -/usr/include/stdlib.h: - -/usr/include/x86_64-linux-gnu/bits/string3.h: - -/usr/include/x86_64-linux-gnu/bits/waitflags.h: - -/usr/include/x86_64-linux-gnu/bits/waitstatus.h: - -/usr/include/x86_64-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/x86_64-linux-gnu/sys/select.h: - -/usr/include/x86_64-linux-gnu/bits/select.h: - -/usr/include/x86_64-linux-gnu/bits/sigset.h: - -/usr/include/x86_64-linux-gnu/bits/time.h: - -/usr/include/x86_64-linux-gnu/bits/select2.h: - -/usr/include/x86_64-linux-gnu/sys/sysmacros.h: - -/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: - -/usr/include/alloca.h: - -/usr/include/x86_64-linux-gnu/bits/stdlib.h: - -/usr/include/ctype.h: - -http_uri.h: diff --git a/include/libghttp/ghttp.c b/include/libghttp/ghttp.c deleted file mode 100644 index 01b71784..00000000 --- a/include/libghttp/ghttp.c +++ /dev/null @@ -1,768 +0,0 @@ -/* - * ghttp.c -- Implementation of the public interface to http functions - * Created: Christopher Blizzard , 21-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include "ghttp.h" -#include "http_uri.h" -#include "http_hdrs.h" -#include "http_trans.h" -#include "http_req.h" -#include "http_resp.h" -#include "http_date.h" -#include "http_global.h" -#include "http_base64.h" - -struct _ghttp_request -{ - http_uri *uri; - http_uri *proxy; - http_req *req; - http_resp *resp; - http_trans_conn *conn; - const char *errstr; - int connected; - ghttp_proc proc; - char *username; - char *password; - char *authtoken; - char *proxy_username; - char *proxy_password; - char *proxy_authtoken; -}; - -static const char *basic_header = "Basic "; - -ghttp_request * -ghttp_request_new(void) -{ - struct _ghttp_request *l_return = NULL; - - /* create everything */ - l_return = malloc(sizeof(struct _ghttp_request)); - memset(l_return, 0, sizeof(struct _ghttp_request)); - l_return->uri = http_uri_new(); - l_return->proxy = http_uri_new(); - l_return->req = http_req_new(); - l_return->resp = http_resp_new(); - l_return->conn = http_trans_conn_new(); - return l_return; -} - -void -ghttp_request_destroy(ghttp_request *a_request) -{ - if (!a_request) - return; - /* make sure that the socket was shut down. */ - if (a_request->conn->sock >= 0) - { - close(a_request->conn->sock); - a_request->conn->sock = -1; - } - /* destroy everything else */ - if (a_request->uri) - http_uri_destroy(a_request->uri); - if (a_request->proxy) - http_uri_destroy(a_request->proxy); - if (a_request->req) - http_req_destroy(a_request->req); - if (a_request->resp) - http_resp_destroy(a_request->resp); - if (a_request->conn) - http_trans_conn_destroy(a_request->conn); - /* destroy username info. */ - if (a_request->username) - { - free(a_request->username); - a_request->username = NULL; - } - if (a_request->password) - { - free(a_request->password); - a_request->password = NULL; - } - if (a_request->authtoken) - { - free(a_request->authtoken); - a_request->authtoken = NULL; - } - /* destroy proxy authentication */ - if (a_request->proxy_username) - { - free(a_request->proxy_username); - a_request->proxy_username = NULL; - } - if (a_request->proxy_password) - { - free(a_request->proxy_password); - a_request->proxy_password = NULL; - } - if (a_request->proxy_authtoken) - { - free(a_request->proxy_authtoken); - a_request->proxy_authtoken = NULL; - } - if (a_request) - free(a_request); - return; -} - -int -ghttp_uri_validate(char *a_uri) -{ - if (!a_uri) - return -1; - /* you can do this... */ - return(http_uri_parse(a_uri, NULL)); -} - -int -ghttp_set_uri(ghttp_request *a_request, char *a_uri) -{ - int l_rv = 0; - http_uri *l_new_uri = NULL; - - if ((!a_request) || (!a_uri)) - return -1; - /* set the uri */ - l_new_uri = http_uri_new(); - l_rv = http_uri_parse(a_uri, l_new_uri); - if (l_rv < 0) - { - http_uri_destroy(l_new_uri); - return -1; - } - if (a_request->uri) - { - /* check to see if this has been set yet. */ - if (a_request->uri->host && - a_request->uri->port && - a_request->uri->resource) - { - /* check to see if we just need to change the resource */ - if ((!strcmp(a_request->uri->host, l_new_uri->host)) && - (a_request->uri->port == l_new_uri->port)) - { - free(a_request->uri->resource); - /* make a copy since we're about to destroy it */ - a_request->uri->resource = strdup(l_new_uri->resource); - http_uri_destroy(l_new_uri); - } - else - { - http_uri_destroy(a_request->uri); - a_request->uri = l_new_uri; - } - } - else - { - http_uri_destroy(a_request->uri); - a_request->uri = l_new_uri; - } - } - return 0; -} - -int -ghttp_set_proxy(ghttp_request *a_request, char *a_uri) -{ - int l_rv = 0; - - if ((!a_request) || (!a_uri)) - return -1; - /* set the uri */ - l_rv = http_uri_parse(a_uri, a_request->proxy); - if (l_rv < 0) - return -1; - return 0; -} - -int -ghttp_set_type(ghttp_request *a_request, ghttp_type a_type) -{ - int l_return = 0; - - /* check to make sure that the args are ok */ - if (!a_request) - return -1; - /* switch on all of the supported types */ - switch(a_type) - { - case ghttp_type_get: - a_request->req->type = http_req_type_get; - break; - case ghttp_type_options: - a_request->req->type = http_req_type_options; - break; - case ghttp_type_head: - a_request->req->type = http_req_type_head; - break; - case ghttp_type_post: - a_request->req->type = http_req_type_post; - break; - case ghttp_type_put: - a_request->req->type = http_req_type_put; - break; - case ghttp_type_delete: - a_request->req->type = http_req_type_delete; - break; - case ghttp_type_trace: - a_request->req->type = http_req_type_trace; - break; - case ghttp_type_connect: - a_request->req->type = http_req_type_connect; - break; - case ghttp_type_propfind: - a_request->req->type = http_req_type_propfind; - break; - case ghttp_type_proppatch: - a_request->req->type = http_req_type_proppatch; - break; - case ghttp_type_mkcol: - a_request->req->type = http_req_type_mkcol; - break; - case ghttp_type_copy: - a_request->req->type = http_req_type_copy; - break; - case ghttp_type_move: - a_request->req->type = http_req_type_move; - break; - case ghttp_type_lock: - a_request->req->type = http_req_type_lock; - break; - case ghttp_type_unlock: - a_request->req->type = http_req_type_unlock; - break; - default: - l_return = -1; - break; - } - return l_return; -} - -int -ghttp_set_body(ghttp_request *a_request, char *a_body, int a_len) -{ - /* check to make sure the request is there */ - if (!a_request) - return -1; - /* check to make sure the body is there */ - if ((a_len > 0) && (a_body == NULL)) - return -1; - /* check to make sure that it makes sense */ - if ((a_request->req->type != http_req_type_post) && - (a_request->req->type != http_req_type_put) && - (a_request->req->type != http_req_type_proppatch) && - (a_request->req->type != http_req_type_propfind) && - (a_request->req->type != http_req_type_lock)) - return -1; - /* set the variables */ - a_request->req->body = a_body; - a_request->req->body_len = a_len; - return 0; -} - -int -ghttp_set_sync(ghttp_request *a_request, - ghttp_sync_mode a_mode) -{ - if (!a_request) - return -1; - if (a_mode == ghttp_sync) - a_request->conn->sync = HTTP_TRANS_SYNC; - else if (a_mode == ghttp_async) - a_request->conn->sync = HTTP_TRANS_ASYNC; - else - return -1; - return 0; -} - -int -ghttp_prepare(ghttp_request *a_request) -{ - /* only allow http requests if no proxy has been set */ - if (!a_request->proxy->host && a_request->uri->proto && - strcmp(a_request->uri->proto, "http")) - return 1; - /* check to see if we have to set up the - host information */ - if ((a_request->conn->host == NULL) || - (a_request->conn->host != a_request->uri->host) || - (a_request->conn->port != a_request->uri->port) || - (a_request->conn->proxy_host != a_request->proxy->host) || - (a_request->conn->proxy_port != a_request->proxy->port)) - { - /* reset everything. */ - a_request->conn->host = a_request->uri->host; - a_request->req->host = a_request->uri->host; - a_request->req->full_uri = a_request->uri->full; - a_request->conn->port = a_request->uri->port; - a_request->conn->proxy_host = a_request->proxy->host; - a_request->conn->proxy_port = a_request->proxy->port; - a_request->conn->hostinfo = NULL; - /* close the socket if it looks open */ - if (a_request->conn->sock >= 0) - { - close(a_request->conn->sock); - a_request->conn->sock = -1; - a_request->connected = 0; - } - } - /* check to see if we need to change the resource. */ - if ((a_request->req->resource == NULL) || - (a_request->req->resource != a_request->uri->resource)) - { - a_request->req->resource = a_request->uri->resource; - a_request->req->host = a_request->uri->host; - } - /* set the authorization header */ - if ((a_request->authtoken != NULL) && - (strlen(a_request->authtoken) > 0)) - { - http_hdr_set_value(a_request->req->headers, - http_hdr_Authorization, - a_request->authtoken); - } - else - { - http_hdr_set_value(a_request->req->headers, - http_hdr_WWW_Authenticate, - NULL); - } - /* set the proxy authorization header */ - if ((a_request->proxy_authtoken != NULL) && - (strlen(a_request->proxy_authtoken) > 0)) - { - http_hdr_set_value(a_request->req->headers, - http_hdr_Proxy_Authorization, - a_request->proxy_authtoken); - } - http_req_prepare(a_request->req); - return 0; -} - -ghttp_status -ghttp_process(ghttp_request *a_request) -{ - int l_rv = 0; - - if (a_request->proc == ghttp_proc_none) - a_request->proc = ghttp_proc_request; - if (a_request->proc == ghttp_proc_request) - { - if (a_request->connected == 0) - { - if (http_trans_connect(a_request->conn) < 0) - { - if (a_request->conn->error_type == http_trans_err_type_errno) - a_request->errstr = strerror(a_request->conn->error); - else if(a_request->conn->error_type == http_trans_err_type_host) - a_request->errstr = http_trans_get_host_error(h_errno); - return ghttp_error; - } - a_request->connected = 1; - } - l_rv = http_req_send(a_request->req, a_request->conn); - if (l_rv == HTTP_TRANS_ERR) - return ghttp_error; - if (l_rv == HTTP_TRANS_NOT_DONE) - return ghttp_not_done; - if (l_rv == HTTP_TRANS_DONE) - { - a_request->proc = ghttp_proc_response_hdrs; - if (a_request->conn->sync == HTTP_TRANS_ASYNC) - return ghttp_not_done; - } - } - if (a_request->proc == ghttp_proc_response_hdrs) - { - l_rv = http_resp_read_headers(a_request->resp, a_request->conn); - if (l_rv == HTTP_TRANS_ERR) - return ghttp_error; - if (l_rv == HTTP_TRANS_NOT_DONE) - return ghttp_not_done; - if (l_rv == HTTP_TRANS_DONE) - { - a_request->proc = ghttp_proc_response; - if (a_request->conn->sync == HTTP_TRANS_ASYNC) - return ghttp_not_done; - } - } - if (a_request->proc == ghttp_proc_response) - { - l_rv = http_resp_read_body(a_request->resp, - a_request->req, - a_request->conn); - if (l_rv == HTTP_TRANS_ERR) - { - /* make sure that the connected flag is fixed and stuff */ - if (a_request->conn->sock == -1) - a_request->connected = 0; - return ghttp_error; - } - if (l_rv == HTTP_TRANS_NOT_DONE) - return ghttp_not_done; - if (l_rv == HTTP_TRANS_DONE) - { - /* make sure that the connected flag is fixed and stuff */ - if (a_request->conn->sock == -1) - a_request->connected = 0; - a_request->proc = ghttp_proc_none; - return ghttp_done; - } - } - return ghttp_error; -} - -ghttp_current_status -ghttp_get_status(ghttp_request *a_request) -{ - ghttp_current_status l_return; - - l_return.proc = a_request->proc; - if (a_request->proc == ghttp_proc_request) - { - l_return.bytes_read = a_request->conn->io_buf_io_done; - l_return.bytes_total = a_request->conn->io_buf_alloc; - } - else if (a_request->proc == ghttp_proc_response_hdrs) - { - l_return.bytes_read = 0; - l_return.bytes_total = 0; - } - else if (a_request->proc == ghttp_proc_response) - { - if (a_request->resp->content_length > 0) - { - l_return.bytes_read = a_request->resp->body_len + - a_request->conn->io_buf_alloc + - a_request->resp->flushed_length; - l_return.bytes_total = a_request->resp->content_length; - } - else - { - l_return.bytes_read = a_request->resp->body_len + - a_request->conn->io_buf_alloc + - a_request->resp->flushed_length; - l_return.bytes_total = -1; - } - } - else - { - l_return.bytes_read = 0; - l_return.bytes_total = 0; - } - return l_return; -} - -void -ghttp_flush_response_buffer(ghttp_request *a_request) -{ - http_resp_flush(a_request->resp, a_request->conn); -} - -int -ghttp_close(ghttp_request *a_request) -{ - if (!a_request) - return -1; - if (a_request->conn->sock >= 0) - { - close(a_request->conn->sock); - a_request->conn->sock = -1; - } - a_request->connected = 0; - return 0; -} - -void -ghttp_clean(ghttp_request *a_request) -{ - http_resp_destroy(a_request->resp); - a_request->resp = http_resp_new(); - http_req_destroy(a_request->req); - a_request->req = http_req_new(); - http_trans_buf_reset(a_request->conn); - a_request->proc = ghttp_proc_none; - return; -} - -void -ghttp_set_chunksize(ghttp_request *a_request, int a_size) -{ - if (a_request && (a_size > 0)) - a_request->conn->io_buf_chunksize = a_size; -} - -void -ghttp_set_header(ghttp_request *a_request, - const char *a_hdr, const char *a_val) -{ - http_hdr_set_value(a_request->req->headers, - a_hdr, a_val); -} - -const char * -ghttp_get_header(ghttp_request *a_request, - const char *a_hdr) -{ - return http_hdr_get_value(a_request->resp->headers, - a_hdr); -} - -char *ghttp_get_cookie(ghttp_request *a_request, const char *a_hdr) -{ - return http_hdr_get_cookie(a_request->resp->headers, a_hdr); -} - -int -ghttp_get_header_names(ghttp_request *a_request, - char ***a_hdrs, int *a_num_hdrs) -{ - return http_hdr_get_headers(a_request->resp->headers, - a_hdrs, a_num_hdrs); -} - -const char * -ghttp_get_error(ghttp_request *a_request) -{ - if (a_request->errstr == NULL) - return "Unknown Error."; - return a_request->errstr; -} - -time_t -ghttp_parse_date(char *a_date) -{ - if (!a_date) - return 0; - return (http_date_to_time(a_date)); -} - -int -ghttp_status_code(ghttp_request *a_request) -{ - if (!a_request) - return 0; - return(a_request->resp->status_code); -} - -const char * -ghttp_reason_phrase(ghttp_request *a_request) -{ - if (!a_request) - return 0; - return(a_request->resp->reason_phrase); -} - -int -ghttp_get_socket(ghttp_request *a_request) -{ - if (!a_request) - return -1; - return(a_request->conn->sock); -} - -char * -ghttp_get_body(ghttp_request *a_request) -{ - if (!a_request) - return NULL; - if (a_request->proc == ghttp_proc_none) - return (a_request->resp->body); - if (a_request->proc == ghttp_proc_response) - { - if (a_request->resp->content_length > 0) - { - if (a_request->resp->body_len) - return a_request->resp->body; - else - return a_request->conn->io_buf; - } - else - { - return a_request->resp->body; - } - } - return NULL; -} - -int -ghttp_get_body_len(ghttp_request *a_request) -{ - if (!a_request) - return 0; - if (a_request->proc == ghttp_proc_none) - return (a_request->resp->body_len); - if (a_request->proc == ghttp_proc_response) - { - if (a_request->resp->content_length > 0) - { - if (a_request->resp->body_len) - return a_request->resp->body_len; - else - return a_request->conn->io_buf_alloc; - } - else - { - return a_request->resp->body_len; - } - } - return 0; -} - -int -ghttp_set_authinfo(ghttp_request *a_request, - const char *a_user, - const char *a_pass) -{ - char *l_authtoken = NULL; - char *l_final_auth = NULL; - char *l_auth64 = NULL; - - /* check our args */ - if (!a_request) - return -1; - /* if we have a NULL or zero length string in the username - or password field, blitz the authinfo */ - if ((!a_user) || (strlen(a_user) < 1) || - (!a_pass) || (strlen(a_pass)< 1)) - { - if (a_request->username) - { - free(a_request->username); - a_request->username = NULL; - } - if (a_request->password) - { - free(a_request->password); - a_request->password = NULL; - } - if (a_request->authtoken) - { - free(a_request->authtoken); - a_request->authtoken = NULL; - } - return 0; - } - /* encode the string using base64. Usernames and passwords - for basic authentication are encoded like this: - username:password - That's it. Easy, huh? - */ - /* enough for the trailing \0 and the : */ - l_authtoken = malloc(strlen(a_user) + strlen(a_pass) + 2); - memset(l_authtoken, 0, (strlen(a_user) + strlen(a_pass) + 2)); - sprintf(l_authtoken, "%s:%s", a_user, a_pass); - l_auth64 = http_base64_encode(l_authtoken); - if (!l_auth64) - { - free(l_authtoken); - return -1; - } - /* build the final header */ - l_final_auth = malloc(strlen(l_auth64) + strlen(basic_header) + 1); - memset(l_final_auth, 0, (strlen(l_auth64) + strlen(basic_header) + 1)); - strcat(l_final_auth, basic_header); - strcat(l_final_auth, l_auth64); - free(l_auth64); - free(l_authtoken); - /* copy the strings into the request */ - - if (a_request->username) free(a_request->username); - if (a_request->password) free(a_request->password); - if (a_request->authtoken) free(a_request->authtoken); - a_request->username = strdup(a_user); - a_request->password = strdup(a_pass); - a_request->authtoken = l_final_auth; - - return 0; -} - - -int -ghttp_set_proxy_authinfo(ghttp_request *a_request, - const char *a_user, - const char *a_pass) -{ - char *l_authtoken = NULL; - char *l_final_auth = NULL; - char *l_auth64 = NULL; - - /* check our args */ - if (!a_request) - return -1; - /* if we have a NULL or zero length string in the username - or password field, blitz the authinfo */ - if ((!a_user) || (strlen(a_user) < 1) || - (!a_pass) || (strlen(a_pass)< 1)) - { - if (a_request->proxy_username) - { - free(a_request->proxy_username); - a_request->proxy_username = NULL; - } - if (a_request->proxy_password) - { - free(a_request->proxy_password); - a_request->proxy_password = NULL; - } - if (a_request->proxy_authtoken) - { - free(a_request->proxy_authtoken); - a_request->proxy_authtoken = NULL; - } - return 0; - } - /* encode the string using base64. Usernames and passwords - for basic authentication are encoded like this: - username:password - That's it. Easy, huh? - */ - /* enough for the trailing \0 and the : */ - l_authtoken = malloc(strlen(a_user) + strlen(a_pass) + 2); - memset(l_authtoken, 0, (strlen(a_user) + strlen(a_pass) + 2)); - sprintf(l_authtoken, "%s:%s", a_user, a_pass); - l_auth64 = http_base64_encode(l_authtoken); - if (!l_auth64) - { - free(l_authtoken); - return -1; - } - /* build the final header */ - l_final_auth = malloc(strlen(l_auth64) + strlen(basic_header) + 1); - memset(l_final_auth, 0, (strlen(l_auth64) + strlen(basic_header) + 1)); - strcat(l_final_auth, basic_header); - strcat(l_final_auth, l_auth64); - free(l_auth64); - free(l_authtoken); - /* copy the strings into the request */ - if (a_request->proxy_username) free(a_request->proxy_username); - if (a_request->proxy_password) free(a_request->proxy_password); - if (a_request->proxy_authtoken) free(a_request->proxy_authtoken); - a_request->proxy_username = strdup(a_user); - a_request->proxy_password = strdup(a_pass); - a_request->proxy_authtoken = l_final_auth; - - return 0; -} diff --git a/include/libghttp/ghttp.h b/include/libghttp/ghttp.h deleted file mode 100644 index 5cb4360b..00000000 --- a/include/libghttp/ghttp.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * ghttp.h -- A public interface to common http functions - * Created: Christopher Blizzard , 21-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef GHTTP_H -#define GHTTP_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ghttp_request ghttp_request; - -typedef enum ghttp_type_tag -{ - ghttp_type_get = 0, - ghttp_type_options, - ghttp_type_head, - ghttp_type_post, - ghttp_type_put, - ghttp_type_delete, - ghttp_type_trace, - ghttp_type_connect, - ghttp_type_propfind, - ghttp_type_proppatch, - ghttp_type_mkcol, - ghttp_type_copy, - ghttp_type_move, - ghttp_type_lock, - ghttp_type_unlock -} ghttp_type; - -typedef enum ghttp_sync_mode_tag -{ - ghttp_sync = 0, - ghttp_async -} ghttp_sync_mode; - -typedef enum ghttp_status_tag -{ - ghttp_error = -1, - ghttp_not_done, - ghttp_done -} ghttp_status; - -typedef enum ghttp_proc_tag -{ - ghttp_proc_none = 0, - ghttp_proc_request, - ghttp_proc_response_hdrs, - ghttp_proc_response -} ghttp_proc; - -typedef struct ghttp_current_status_tag -{ - ghttp_proc proc; /* what's it doing? */ - int bytes_read; /* how many bytes have been read? */ - int bytes_total; /* how many total */ -} ghttp_current_status; - -/* create a new request object */ -ghttp_request * -ghttp_request_new(void); - -/* delete a current request object */ -void -ghttp_request_destroy(ghttp_request *a_request); - -/* Validate a uri - * This will return -1 if a uri is invalid - */ -int -ghttp_uri_validate(char *a_uri); - -/* Set a uri in a request - * This will return -1 if the uri is invalid - */ - -int -ghttp_set_uri(ghttp_request *a_request, char *a_uri); - -/* Set a proxy for a request - * This will return -1 if the uri is invalid - */ - -int -ghttp_set_proxy(ghttp_request *a_request, char *a_uri); - -/* Set a request type - * This will return -1 if the request type is invalid or - * unsupported - */ - -int -ghttp_set_type(ghttp_request *a_request, ghttp_type a_type); - -/* Set the body. - * This will return -1 if the request type doesn't support it - */ - -int -ghttp_set_body(ghttp_request *a_request, char *a_body, int a_len); - -/* Set whether or not you want to use sync or async mode. - */ - -int -ghttp_set_sync(ghttp_request *a_request, - ghttp_sync_mode a_mode); - -/* Prepare a request. - * Call this before trying to process a request or if you change the - * uri. - */ - -int -ghttp_prepare(ghttp_request *a_request); - -/* Set the chunk size - * You might want to do this to optimize for different connection speeds. - */ - -void -ghttp_set_chunksize(ghttp_request *a_request, int a_size); - -/* Set a random request header - */ - -void -ghttp_set_header(ghttp_request *a_request, - const char *a_hdr, const char *a_val); - -/* Process a request - */ - -ghttp_status -ghttp_process(ghttp_request *a_request); - -/* Get the status of a request - */ - -ghttp_current_status -ghttp_get_status(ghttp_request *a_request); - -/* Flush the received data (so far) into the response body. This is - * useful for asynchronous requests with large responses: you can - * periodically flush the response buffer and parse the data that's - * arrived so far. - */ - -void -ghttp_flush_response_buffer(ghttp_request *a_request); - -/* Get the value of a random response header - */ - -const char * -ghttp_get_header(ghttp_request *a_request, - const char *a_hdr); - -/* Get a_name's cookie, caller must free the return string */ -char * ghttp_get_cookie(ghttp_request *a_request, const char *a_hdr); - -/* Get the list of headers that were returned in the response. You - must free the returned string values. This function will return 0 - on success, -1 on some kind of error. */ -int -ghttp_get_header_names(ghttp_request *a_request, - char ***a_hdrs, int *a_num_hdrs); - -/* Abort a currently running request. */ -int -ghttp_close(ghttp_request *a_request); - -/* Clean a request - */ -void -ghttp_clean(ghttp_request *a_request); - -/* Get the socket associated with a particular connection - */ - -int -ghttp_get_socket(ghttp_request *a_request); - -/* get the return entity body - */ - -char * -ghttp_get_body(ghttp_request *a_request); - -/* get the returned length - */ - -int -ghttp_get_body_len(ghttp_request *a_request); - -/* Get an error message for a request that has failed. - */ - -const char * -ghttp_get_error(ghttp_request *a_request); - -/* Parse a date string that is one of the standard - * date formats - */ - -time_t -ghttp_parse_date(char *a_date); - -/* Return the status code. - */ - -int -ghttp_status_code(ghttp_request *a_request); - -/* Return the reason phrase. - */ - -const char * -ghttp_reason_phrase(ghttp_request *a_request); - -/* Set your username/password pair - */ - -int -ghttp_set_authinfo(ghttp_request *a_request, - const char *a_user, - const char *a_pass); - - - /* Set your username/password pair for proxy - */ - -int -ghttp_set_proxy_authinfo(ghttp_request *a_request, - const char *a_user, - const char *a_pass); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* GHTTP_H */ diff --git a/include/libghttp/ghttp_constants.h b/include/libghttp/ghttp_constants.h deleted file mode 100644 index 7e1d07a6..00000000 --- a/include/libghttp/ghttp_constants.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * ghttp_constants.h -- definitions for char constants that people - * might want to use - * Created: Christopher Blizzard - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef GHTTP_CONSTANTS_H -#define GHTTP_CONSTANTS_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -extern const char http_hdr_Allow[]; -extern const char http_hdr_Content_Encoding[]; -extern const char http_hdr_Content_Language[]; -extern const char http_hdr_Content_Length[]; -extern const char http_hdr_Content_Location[]; -extern const char http_hdr_Content_MD5[]; -extern const char http_hdr_Content_Range[]; -extern const char http_hdr_Content_Type[]; -extern const char http_hdr_Expires[]; -extern const char http_hdr_Last_Modified[]; - -/* general headers */ - -extern const char http_hdr_Cache_Control[]; -extern const char http_hdr_Connection[]; -extern const char http_hdr_Date[]; -extern const char http_hdr_Pragma[]; -extern const char http_hdr_Transfer_Encoding[]; -extern const char http_hdr_Update[]; -extern const char http_hdr_Trailer[]; -extern const char http_hdr_Via[]; - -/* request headers */ - -extern const char http_hdr_Accept[]; -extern const char http_hdr_Accept_Charset[]; -extern const char http_hdr_Accept_Encoding[]; -extern const char http_hdr_Accept_Language[]; -extern const char http_hdr_Authorization[]; -extern const char http_hdr_Expect[]; -extern const char http_hdr_From[]; -extern const char http_hdr_Host[]; -extern const char http_hdr_If_Modified_Since[]; -extern const char http_hdr_If_Match[]; -extern const char http_hdr_If_None_Match[]; -extern const char http_hdr_If_Range[]; -extern const char http_hdr_If_Unmodified_Since[]; -extern const char http_hdr_Max_Forwards[]; -extern const char http_hdr_Proxy_Authorization[]; -extern const char http_hdr_Range[]; -extern const char http_hdr_Referrer[]; -extern const char http_hdr_TE[]; -extern const char http_hdr_User_Agent[]; - -/* response headers */ - -extern const char http_hdr_Accept_Ranges[]; -extern const char http_hdr_Age[]; -extern const char http_hdr_ETag[]; -extern const char http_hdr_Location[]; -extern const char http_hdr_Retry_After[]; -extern const char http_hdr_Server[]; -extern const char http_hdr_Vary[]; -extern const char http_hdr_Warning[]; -extern const char http_hdr_WWW_Authenticate[]; - -/* Other headers */ - -extern const char http_hdr_Set_Cookie[]; - -/* WebDAV headers */ - -extern const char http_hdr_DAV[]; -extern const char http_hdr_Depth[]; -extern const char http_hdr_Destination[]; -extern const char http_hdr_If[]; -extern const char http_hdr_Lock_Token[]; -extern const char http_hdr_Overwrite[]; -extern const char http_hdr_Status_URI[]; -extern const char http_hdr_Timeout[]; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* GHTTP_CONSTANTS_H */ diff --git a/include/libghttp/http_base64.c b/include/libghttp/http_base64.c deleted file mode 100644 index 8f33b3fe..00000000 --- a/include/libghttp/http_base64.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * http_base64.c -- This file contains code for encoding strings with base64. - * Created: Christopher Blizzard , 20-Nov-1998 - * Author: Joe Orton - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include - -const char b64_alphabet[65] = { - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/=" }; - -char * -http_base64_encode(const char *text) { - /* The tricky thing about this is doing the padding at the end, - * doing the bit manipulation requires a bit of concentration only */ - char *buffer = NULL; - char *point = NULL; - int inlen = 0; - int outlen = 0; - - /* check our args */ - if (text == NULL) - return NULL; - - /* Use 'buffer' to store the output. Work out how big it should be... - * This must be a multiple of 4 bytes */ - - inlen = strlen( text ); - /* check our arg...avoid a pesky FPE */ - if (inlen == 0) - { - buffer = malloc(sizeof(char)); - buffer[0] = '\0'; - return buffer; - } - outlen = (inlen*4)/3; - if( (inlen % 3) > 0 ) /* got to pad */ - outlen += 4 - (inlen % 3); - - buffer = malloc( outlen + 1 ); /* +1 for the \0 */ - memset(buffer, 0, outlen + 1); /* initialize to zero */ - - /* now do the main stage of conversion, 3 bytes at a time, - * leave the trailing bytes (if there are any) for later */ - - for( point=buffer; inlen>=3; inlen-=3, text+=3 ) { - *(point++) = b64_alphabet[ *text>>2 ]; - *(point++) = b64_alphabet[ (*text<<4 & 0x30) | *(text+1)>>4 ]; - *(point++) = b64_alphabet[ (*(text+1)<<2 & 0x3c) | *(text+2)>>6 ]; - *(point++) = b64_alphabet[ *(text+2) & 0x3f ]; - } - - /* Now deal with the trailing bytes */ - if( inlen ) { - /* We always have one trailing byte */ - *(point++) = b64_alphabet[ *text>>2 ]; - *(point++) = b64_alphabet[ (*text<<4 & 0x30) | - (inlen==2?*(text+1)>>4:0) ]; - *(point++) = (inlen==1?'=':b64_alphabet[ *(text+1)<<2 & 0x3c ] ); - *(point++) = '='; - } - - *point = '\0'; - - return buffer; -} diff --git a/include/libghttp/http_base64.h b/include/libghttp/http_base64.h deleted file mode 100644 index 73b92765..00000000 --- a/include/libghttp/http_base64.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * http_base64.h -- Header file for base64 function(s). - * Created: Christopher Blizzard , 20-Nov-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_BASE64_H -#define HTTP_BASE64_H - -char * -http_base64_encode(const char *text); - -#endif /* HTTP_BASE64_H */ diff --git a/include/libghttp/http_date.c b/include/libghttp/http_date.c deleted file mode 100644 index 343c4667..00000000 --- a/include/libghttp/http_date.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * http_date.c -- Routines for parsing and generating http dates - * Created: Christopher Blizzard , 16-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include "http_date.h" - -static int -month_from_string_short(const char *a_month); - -/* - * date formats come in one of the following three flavors according to - * rfc 2068 and later drafts: - * - * Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 - * Sunday, 06-Nov-1994, 08:49:37 GMT ; RFC 850, updated by RFC 1036 - * Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format - * - * the first format is preferred however all must be supported. -*/ - - -time_t -http_date_to_time(const char *a_date) -{ - struct tm l_tm_time; - time_t l_return = 0; - char l_buf[12]; - const char *l_start_date = NULL; - int i = 0; - - /* make sure we can use it */ - if (!a_date) - return -1; - memset(&l_tm_time, 0, sizeof(struct tm)); - memset(l_buf, 0, 12); - /* try to figure out which format it's in */ - /* rfc 1123 */ - if (a_date[3] == ',') - { - if (strlen(a_date) != 29) - return -1; - /* make sure that everything is legal */ - if (a_date[4] != ' ') - return -1; - /* 06 */ - if ((isdigit(a_date[5]) == 0) || - (isdigit(a_date[6]) == 0)) - return -1; - /* Nov */ - if ((l_tm_time.tm_mon = month_from_string_short(&a_date[8])) < 0) - return -1; - /* 1994 */ - if ((isdigit(a_date[12]) == 0) || - (isdigit(a_date[13]) == 0) || - (isdigit(a_date[14]) == 0) || - (isdigit(a_date[15]) == 0)) - return -1; - if (a_date[16] != ' ') - return -1; - /* 08:49:37 */ - if ((isdigit(a_date[17]) == 0) || - (isdigit(a_date[18]) == 0) || - (a_date[19] != ':') || - (isdigit(a_date[20]) == 0) || - (isdigit(a_date[21]) == 0) || - (a_date[22] != ':') || - (isdigit(a_date[23]) == 0) || - (isdigit(a_date[24]) == 0)) - return -1; - if (a_date[25] != ' ') - return -1; - /* GMT */ - if (strncmp(&a_date[26], "GMT", 3) != 0) - return -1; - /* ok, it's valid. Do it */ - /* parse out the day of the month */ - l_tm_time.tm_mday += (a_date[5] - 0x30) * 10; - l_tm_time.tm_mday += (a_date[6] - 0x30); - /* already got the month from above */ - /* parse out the year */ - l_tm_time.tm_year += (a_date[12] - 0x30) * 1000; - l_tm_time.tm_year += (a_date[13] - 0x30) * 100; - l_tm_time.tm_year += (a_date[14] - 0x30) * 10; - l_tm_time.tm_year += (a_date[15] - 0x30); - l_tm_time.tm_year -= 1900; - /* parse out the time */ - l_tm_time.tm_hour += (a_date[17] - 0x30) * 10; - l_tm_time.tm_hour += (a_date[18] - 0x30); - l_tm_time.tm_min += (a_date[20] - 0x30) * 10; - l_tm_time.tm_min += (a_date[21] - 0x30); - l_tm_time.tm_sec += (a_date[23] - 0x30) * 10; - l_tm_time.tm_sec += (a_date[24] - 0x30); - /* ok, generate the result */ - l_return = mktime(&l_tm_time); - } - /* ansi C */ - else if (a_date[3] == ' ') - { - if (strlen(a_date) != 24) - return -1; - /* Nov */ - if ((l_tm_time.tm_mon = - month_from_string_short(&a_date[4])) < 0) - return -1; - if (a_date[7] != ' ') - return -1; - /* "10" or " 6" */ - if (((a_date[8] != ' ') && (isdigit(a_date[8]) == 0)) || - (isdigit(a_date[9]) == 0)) - return -1; - if (a_date[10] != ' ') - return -1; - /* 08:49:37 */ - if ((isdigit(a_date[11]) == 0) || - (isdigit(a_date[12]) == 0) || - (a_date[13] != ':') || - (isdigit(a_date[14]) == 0) || - (isdigit(a_date[15]) == 0) || - (a_date[16] != ':') || - (isdigit(a_date[17]) == 0) || - (isdigit(a_date[18]) == 0)) - return -1; - if (a_date[19] != ' ') - return -1; - /* 1994 */ - if ((isdigit(a_date[20]) == 0) || - (isdigit(a_date[21]) == 0) || - (isdigit(a_date[22]) == 0) || - (isdigit(a_date[23]) == 0)) - return -1; - /* looks good */ - /* got the month from above */ - /* parse out the day of the month */ - if (a_date[8] != ' ') - l_tm_time.tm_mday += (a_date[8] - 0x30) * 10; - l_tm_time.tm_mday += (a_date[9] - 0x30); - /* parse out the time */ - l_tm_time.tm_hour += (a_date[11] - 0x30) * 10; - l_tm_time.tm_hour += (a_date[12] - 0x30); - l_tm_time.tm_min += (a_date[14] - 0x30) * 10; - l_tm_time.tm_min += (a_date[15] - 0x30); - l_tm_time.tm_sec += (a_date[17] - 0x30) * 10; - l_tm_time.tm_sec += (a_date[18] - 0x30); - /* parse out the year */ - l_tm_time.tm_year += (a_date[20] - 0x30) * 1000; - l_tm_time.tm_year += (a_date[21] - 0x30) * 100; - l_tm_time.tm_year += (a_date[22] - 0x30) * 10; - l_tm_time.tm_year += (a_date[23] - 0x30); - l_tm_time.tm_year -= 1900; - /* generate the result */ - l_return = mktime(&l_tm_time); - } - /* must be the 1036... */ - else - { - /* check to make sure we won't rn out of any bounds */ - if (strlen(a_date) < 11) - return -1; - while (a_date[i]) - { - if (a_date[i] == ' ') - { - l_start_date = &a_date[i+1]; - break; - } - i++; - } - /* check to make sure there was a space found */ - if (l_start_date == NULL) - return -1; - /* check to make sure that we don't overrun anything */ - if (strlen(l_start_date) != 22) - return -1; - /* make sure that the rest of the date was valid */ - /* 06- */ - if ((isdigit(l_start_date[0]) == 0) || - (isdigit(l_start_date[1]) == 0) || - (l_start_date[2] != '-')) - return -1; - /* Nov */ - if ((l_tm_time.tm_mon = - month_from_string_short(&l_start_date[3])) < 0) - return -1; - /* -94 */ - if ((l_start_date[6] != '-') || - (isdigit(l_start_date[7]) == 0) || - (isdigit(l_start_date[8]) == 0)) - return -1; - if (l_start_date[9] != ' ') - return -1; - /* 08:49:37 */ - if ((isdigit(l_start_date[10]) == 0) || - (isdigit(l_start_date[11]) == 0) || - (l_start_date[12] != ':') || - (isdigit(l_start_date[13]) == 0) || - (isdigit(l_start_date[14]) == 0) || - (l_start_date[15] != ':') || - (isdigit(l_start_date[16]) == 0) || - (isdigit(l_start_date[17]) == 0)) - return -1; - if (l_start_date[18] != ' ') - return -1; - if (strncmp(&l_start_date[19], "GMT", 3) != 0) - return -1; - /* looks ok to parse */ - /* parse out the day of the month */ - l_tm_time.tm_mday += (l_start_date[0] - 0x30) * 10; - l_tm_time.tm_mday += (l_start_date[1] - 0x30); - /* have the month from above */ - /* parse out the year */ - l_tm_time.tm_year += (l_start_date[7] - 0x30) * 10; - l_tm_time.tm_year += (l_start_date[8] - 0x30); - /* check for y2k */ - if (l_tm_time.tm_year < 20) - l_tm_time.tm_year += 100; - /* parse out the time */ - l_tm_time.tm_hour += (l_start_date[10] - 0x30) * 10; - l_tm_time.tm_hour += (l_start_date[11] - 0x30); - l_tm_time.tm_min += (l_start_date[13] - 0x30) * 10; - l_tm_time.tm_min += (l_start_date[14] - 0x30); - l_tm_time.tm_sec += (l_start_date[16] - 0x30) * 10; - l_tm_time.tm_sec += (l_start_date[17] - 0x30); - /* generate the result */ - l_return = mktime(&l_tm_time); - } - return l_return; -} - -static int -month_from_string_short(const char *a_month) -{ - if (strncmp(a_month, "Jan", 3) == 0) - return 0; - if (strncmp(a_month, "Feb", 3) == 0) - return 1; - if (strncmp(a_month, "Mar", 3) == 0) - return 2; - if (strncmp(a_month, "Apr", 3) == 0) - return 3; - if (strncmp(a_month, "May", 3) == 0) - return 4; - if (strncmp(a_month, "Jun", 3) == 0) - return 5; - if (strncmp(a_month, "Jul", 3) == 0) - return 6; - if (strncmp(a_month, "Aug", 3) == 0) - return 7; - if (strncmp(a_month, "Sep", 3) == 0) - return 8; - if (strncmp(a_month, "Oct", 3) == 0) - return 9; - if (strncmp(a_month, "Nov", 3) == 0) - return 10; - if (strncmp(a_month, "Dec", 3) == 0) - return 11; - /* not a valid date */ - return -1; -} - diff --git a/include/libghttp/http_date.h b/include/libghttp/http_date.h deleted file mode 100644 index 9d103601..00000000 --- a/include/libghttp/http_date.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * http_date.h -- Routines for parsing and generating http dates - * Created: Christoper Blizzard , 16-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_DATE_H -#define HTTP_DATE_H - -#include - -time_t -http_date_to_time(const char *a_date); - -#endif /* HTTP_DATE_H */ diff --git a/include/libghttp/http_global.h b/include/libghttp/http_global.h deleted file mode 100644 index ea400ce3..00000000 --- a/include/libghttp/http_global.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * http_global.h -- Definitions for things that will be used throughout - * the library. - * Created: Christopher Blizzard , 16-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_GLOBAL_H -#define HTTP_GLOBAL_H - -#define HTTP_TRANS_ERR -1 -#define HTTP_TRANS_NOT_DONE 1 -#define HTTP_TRANS_DONE 2 - -#define HTTP_TRANS_SYNC 0 -#define HTTP_TRANS_ASYNC 1 - -#endif /* GHTTP_GLOBAL_H */ diff --git a/include/libghttp/http_hdrs.c b/include/libghttp/http_hdrs.c deleted file mode 100644 index 93b43d12..00000000 --- a/include/libghttp/http_hdrs.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * http_hdrs.c -- This file contains declarations for http headers - * Created: Christopher Blizzard , 3-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include "http_hdrs.h" - -/* entity headers */ - -const char http_hdr_Allow[] = "Allow"; -const char http_hdr_Content_Encoding[] = "Content-Encoding"; -const char http_hdr_Content_Language[] = "Content-Language"; -const char http_hdr_Content_Length[] = "Content-Length"; -const char http_hdr_Content_Location[] = "Content-Location"; -const char http_hdr_Content_MD5[] = "Content-MD5"; -const char http_hdr_Content_Range[] = "Content-Range"; -const char http_hdr_Content_Type[] = "Content-Type"; -const char http_hdr_Expires[] = "Expires"; -const char http_hdr_Last_Modified[] = "Last-Modified"; - -/* general headers */ - -const char http_hdr_Cache_Control[] = "Cache-Control"; -const char http_hdr_Connection[] = "Connection"; -const char http_hdr_Date[] = "Date"; -const char http_hdr_Pragma[] = "Pragma"; -const char http_hdr_Transfer_Encoding[] = "Transfer-Encoding"; -const char http_hdr_Update[] = "Update"; -const char http_hdr_Trailer[] = "Trailer"; -const char http_hdr_Via[] = "Via"; - -/* request headers */ - -const char http_hdr_Accept[] = "Accept"; -const char http_hdr_Accept_Charset[] = "Accept-Charset"; -const char http_hdr_Accept_Encoding[] = "Accept-Encoding"; -const char http_hdr_Accept_Language[] = "Accept-Language"; -const char http_hdr_Authorization[] = "Authorization"; -const char http_hdr_Expect[] = "Expect"; -const char http_hdr_From[] = "From"; -const char http_hdr_Host[] = "Host"; -const char http_hdr_If_Modified_Since[] = "If-Modified-Since"; -const char http_hdr_If_Match[] = "If-Match"; -const char http_hdr_If_None_Match[] = "If-None-Match"; -const char http_hdr_If_Range[] = "If-Range"; -const char http_hdr_If_Unmodified_Since[] = "If-Unmodified-Since"; -const char http_hdr_Max_Forwards[] = "Max-Forwards"; -const char http_hdr_Proxy_Authorization[] = "Proxy-Authorization"; -const char http_hdr_Range[] = "Range"; -const char http_hdr_Referrer[] = "Referrer"; -const char http_hdr_TE[] = "TE"; -const char http_hdr_User_Agent[] = "User-Agent"; - -/* response headers */ - -const char http_hdr_Accept_Ranges[] = "Accept-Ranges"; -const char http_hdr_Age[] = "Age"; -const char http_hdr_ETag[] = "ETag"; -const char http_hdr_Location[] = "Location"; -const char http_hdr_Retry_After[] = "Retry-After"; -const char http_hdr_Server[] = "Server"; -const char http_hdr_Vary[] = "Vary"; -const char http_hdr_Warning[] = "Warning"; -const char http_hdr_WWW_Authenticate[] = "WWW-Authenticate"; - -/* Other headers */ - -const char http_hdr_Set_Cookie[] = "Set-Cookie"; - -/* WebDAV headers */ - -const char http_hdr_DAV[] = "DAV"; -const char http_hdr_Depth[] = "Depth"; -const char http_hdr_Destination[] = "Destination"; -const char http_hdr_If[] = "If"; -const char http_hdr_Lock_Token[] = "Lock-Token"; -const char http_hdr_Overwrite[] = "Overwrite"; -const char http_hdr_Status_URI[] = "Status-URI"; -const char http_hdr_Timeout[] = "Timeout"; - -const char *http_hdr_known_list[] = -{ - /* entity headers */ - http_hdr_Allow, - http_hdr_Content_Encoding, - http_hdr_Content_Language, - http_hdr_Content_Length, - http_hdr_Content_Location, - http_hdr_Content_MD5, - http_hdr_Content_Range, - http_hdr_Content_Type, - http_hdr_Expires, - http_hdr_Last_Modified, - /* general headers */ - http_hdr_Cache_Control, - http_hdr_Connection, - http_hdr_Date, - http_hdr_Pragma, - http_hdr_Transfer_Encoding, - http_hdr_Update, - http_hdr_Trailer, - http_hdr_Via, - /* request headers */ - http_hdr_Accept, - http_hdr_Accept_Charset, - http_hdr_Accept_Encoding, - http_hdr_Accept_Language, - http_hdr_Authorization, - http_hdr_Expect, - http_hdr_From, - http_hdr_Host, - http_hdr_If_Modified_Since, - http_hdr_If_Match, - http_hdr_If_None_Match, - http_hdr_If_Range, - http_hdr_If_Unmodified_Since, - http_hdr_Max_Forwards, - http_hdr_Proxy_Authorization, - http_hdr_Range, - http_hdr_Referrer, - http_hdr_TE, - http_hdr_User_Agent, - /* response headers */ - http_hdr_Accept_Ranges, - http_hdr_Age, - http_hdr_ETag, - http_hdr_Location, - http_hdr_Retry_After, - http_hdr_Server, - http_hdr_Vary, - http_hdr_Warning, - http_hdr_WWW_Authenticate, - NULL -}; - -/* functions dealing with headers */ - -const char * -http_hdr_is_known(const char *a_hdr) -{ - int l_pos = 0; - const char *l_return = NULL; - - if (!a_hdr) - goto ec; - while(http_hdr_known_list[l_pos] != NULL) - { - if (strcasecmp(a_hdr, http_hdr_known_list[l_pos]) == 0) - { - l_return = http_hdr_known_list[l_pos]; - break; - } - l_pos++; - } - ec: - return l_return; -} - -http_hdr_list * -http_hdr_list_new(void) -{ - http_hdr_list *l_return = NULL; - - l_return = (http_hdr_list *)malloc(sizeof(http_hdr_list)); - memset(l_return, 0, sizeof(http_hdr_list)); - return l_return; -} - -void -http_hdr_list_destroy(http_hdr_list *a_list) -{ - int i = 0; - - if (a_list == NULL) - return; - for(i=0; i < HTTP_HDRS_MAX; i++) - { - if (a_list->header[i] && - (http_hdr_is_known(a_list->header[i]) == NULL)) - free(a_list->header[i]); - if (a_list->value[i]) - free(a_list->value[i]); - } - free (a_list); -} - -int -http_hdr_set_value_no_nts(http_hdr_list *a_list, - const char *a_name_start, - int a_name_len, - const char *a_val_start, - int a_val_len) -{ - int l_return = 0; - char *l_temp_name = NULL; - char *l_temp_val = NULL; - - /* note that a zero len value is valid... */ - if ((a_list == NULL) || - (a_name_start == NULL) || - (a_val_start == NULL) || - (a_name_len == 0)) - goto ec; - l_temp_name = (char *)malloc(a_name_len + 1); - memset(l_temp_name, 0, a_name_len + 1); - memcpy(l_temp_name, a_name_start, a_name_len); - l_temp_val = (char *)malloc(a_val_len + 1); - memset(l_temp_val, 0, a_val_len + 1); - memcpy(l_temp_val, a_val_start, a_val_len); - /* set the value */ - l_return = http_hdr_set_value(a_list, - l_temp_name, - l_temp_val); - free(l_temp_name); - free(l_temp_val); - ec: - return l_return; - -} - -/** - * NB: if the key of header is "cookie", things to be more complex, - * cause cookie may be more than one. - * like: - * Set-Cookie: a=b; c=d; - * Set-Cookie: e=f; g=m; - * So, we set cookie here - * - * @param a_list - * @param a_name - * @param a_val - * - * @return - */ -static int -http_hdr_set_cookie_value(http_hdr_list *a_list, - const char *a_val) -{ - int i = 0; - char *l_temp_value = NULL; - int l_return = 0; - - for (i = 0; i < HTTP_HDRS_MAX; i++) { - if (a_list->header[i]) - continue; - - /* I promise not to mess with this value. */ - l_temp_value = (char *)http_hdr_is_known("Set-Cookie"); - if (l_temp_value) { - a_list->header[i] = l_temp_value; - /* dont free this later... */ - } else{ - a_list->header[i] = strdup("Set-Cookie"); - } - a_list->value[i] = strdup(a_val); - l_return = 1; - break; - } - return l_return; -} - -int -http_hdr_set_value(http_hdr_list *a_list, - const char *a_name, - const char *a_val) -{ - int i = 0; - char *l_temp_value = NULL; - int l_return = 0; - - if ((a_list == NULL) || (a_name == NULL) || (a_val == NULL)) - goto ec; - - /* If the key is "Set-Cookie", go to a different branch */ - if (!strcmp(a_name, "Set-Cookie")) { - return http_hdr_set_cookie_value(a_list, a_val); - } - - l_temp_value = http_hdr_get_value(a_list, a_name); - if (l_temp_value == NULL) - { - for (i=0; i < HTTP_HDRS_MAX; i++) - { - if (a_list->header[i] == NULL) - { - /* I promise not to mess with this value. */ - l_temp_value = (char *)http_hdr_is_known(a_name); - if (l_temp_value) - { - a_list->header[i] = l_temp_value; - /* dont free this later... */ - } - else - a_list->header[i] = strdup(a_name); - a_list->value[i] = strdup(a_val); - l_return = 1; - break; - } - } - } - else - { - for(i = 0; i < HTTP_HDRS_MAX; i++) - { - if (a_list->value[i] == l_temp_value) - { - free(a_list->value[i]); - a_list->value[i] = strdup(a_val); - l_return = 1; - break; - } - } - } -ec: - return l_return; -} - -char *http_hdr_get_cookie(http_hdr_list *a_list, const char *a_name) -{ - int i = 0; - char *l_return = NULL; - - if (a_name == NULL) - goto ec; - for (i=0; i < HTTP_HDRS_MAX; i++) { - if (a_list->header[i] == NULL || - a_list->value[i] == NULL|| - strcasecmp(a_list->header[i], "Set-Cookie")) { - continue; - } - if (strstr(a_list->value[i], a_name)) { - char cookie[256] = {0}; - char *start; - char *end; - - strncpy(cookie, a_list->value[i], sizeof(cookie) - 1); - start = strstr(cookie, a_name); - if(!start){ - goto ec; - } - start += strlen(a_name) + 1; - end = strstr(start, ";"); - if (end) { - *end = '\0'; - } - - l_return = strdup(start); - break; - } - } -ec: - return l_return; -} - -char * -http_hdr_get_value(http_hdr_list *a_list, - const char *a_name) -{ - int i = 0; - char *l_return = NULL; - - if (a_name == NULL) - goto ec; - for (i=0; i < HTTP_HDRS_MAX; i++) - { - if (a_list->header[i] && - (strcasecmp(a_list->header[i], a_name) == 0)) - { - if (a_list->value[i] == NULL) - goto ec; - l_return = a_list->value[i]; - break; - } - } - ec: - return l_return; -} - -int -http_hdr_get_headers(http_hdr_list *a_list, char ***a_names, - int *a_num_names) -{ - int i = 0; - int l_num_names = 0; - char **l_names; - - if (a_num_names == NULL) - return -1; - if (a_names == NULL) - return -1; - - /* set our return values */ - *a_names = NULL; - *a_num_names = 0; - - /* make a pass to find out how many headers we have. */ - for (i=0; i < HTTP_HDRS_MAX; i++) - { - if (a_list->header[i]) - l_num_names++; - } - - /* return if there are no headers */ - if (l_num_names == 0) - return 0; - - /* now that we know how many headers we have allocate the number of - slots in the return */ - l_names = malloc(sizeof(char *) * l_num_names); - if (l_names == NULL) - return -1; - - /* zero the list so that we can clean up later if we have to */ - memset(l_names, 0, l_num_names); - - /* copy the headers */ - for (i=0; i < HTTP_HDRS_MAX; i++) - { - if (a_list->header[i]) - { - l_names[i] = strdup(a_list->header[i]); - if (l_names[i] == NULL) - goto ec; - } - } - - *a_names = l_names; - *a_num_names = l_num_names; - return 0; - - /* something bad happened. Try to free up as much as possible. */ - ec: - if (l_names) - { - for (i=0; i < l_num_names; i++) - { - if (l_names[i]) - { - free(l_names[i]); - l_names[i] = NULL; - } - } - free(l_names); - *a_names = 0; - } - *a_num_names = 0; - return -1; -} - -int -http_hdr_clear_value(http_hdr_list *a_list, - const char *a_name) -{ - int i = 0; - int l_return = 0; - - if ((a_list == NULL) || (a_name == NULL)) - goto ec; - for (i=0; i < HTTP_HDRS_MAX; i++) - { - if (a_name && a_list->header[i] && - (strcasecmp(a_list->header[i], a_name) == 0)) - { - if (http_hdr_is_known(a_name) == NULL) - free(a_list->header[i]); - a_list->header[i] = NULL; - free(a_list->value[i]); - a_list->value[i] = NULL; - } - } - ec: - return l_return; -} - diff --git a/include/libghttp/http_hdrs.h b/include/libghttp/http_hdrs.h deleted file mode 100644 index 556cf579..00000000 --- a/include/libghttp/http_hdrs.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * http_hdrs.h -- This file contains declarations for http headers - * Created: Christopher Blizzard , 3-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_HDRS_H -#define HTTP_HDRS_H - -#include "ghttp_constants.h" - -/* the list of known headers */ -extern const char *http_hdr_known_list[]; - -/* a header list */ -#define HTTP_HDRS_MAX 256 -typedef struct http_hdr_list_tag -{ - char *header[HTTP_HDRS_MAX]; - char *value[HTTP_HDRS_MAX]; -} http_hdr_list; - -/* functions dealing with headers */ - -/* check to see if the library knows about the header */ -const char * -http_hdr_is_known(const char *a_hdr); - -/* create a new list */ -http_hdr_list * -http_hdr_list_new(void); - -/* destroy a list */ -void -http_hdr_list_destroy(http_hdr_list *a_list); - -/* set a value in a list */ -int -http_hdr_set_value(http_hdr_list *a_list, - const char *a_name, - const char *a_val); - -/* set the value in a list from a range, not a NTS */ -int -http_hdr_set_value_no_nts(http_hdr_list *a_list, - const char *a_name_start, - int a_name_len, - const char *a_val_start, - int a_val_len); - -/* get a copy of a value in a list */ -char * -http_hdr_get_value(http_hdr_list *a_list, - const char *a_name); - -/* Get a_name's cookie, caller must free the return string */ -char * -http_hdr_get_cookie(http_hdr_list *a_list, - const char *a_name); - -/* get a copy of the headers in a list */ -int -http_hdr_get_headers(http_hdr_list *a_list, - char ***a_names, - int *a_num_names); - -/* clear a header in a list */ -int -http_hdr_clear_value(http_hdr_list *a_list, - const char *a_name); - - -#endif /* HTTP_HDRS_H */ diff --git a/include/libghttp/http_req.c b/include/libghttp/http_req.c deleted file mode 100644 index de8faf2b..00000000 --- a/include/libghttp/http_req.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * http_req.c -- Functions for making http requests - * Created: Christopher Blizzard , 6-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include "http_req.h" -#include "http_trans.h" -#include "http_global.h" - -const char * -http_req_type_char[] = { - "GET", - "OPTIONS", - "HEAD", - "POST", - "PUT", - "DELETE", - "TRACE", - "CONNECT", - "PROPFIND", - "PROPPATCH", - "MKCOL", - "COPY", - "MOVE", - "LOCK", - "UNLOCK", - NULL -}; - -http_req * -http_req_new(void) -{ - http_req *l_return = NULL; - - l_return = (http_req *)malloc(sizeof(http_req)); - memset(l_return, 0, sizeof(http_req)); - /* default to 1.1 */ - l_return->http_ver = 1.1; - l_return->headers = http_hdr_list_new(); - return l_return; -} - -void -http_req_destroy(http_req *a_req) -{ - if (!a_req) - return; - if (a_req->headers) - http_hdr_list_destroy(a_req->headers); - free(a_req); -} - -int -http_req_prepare(http_req *a_req) -{ - int l_return = 0; - char l_buf[30]; - - if (!a_req) - return -1; - memset(l_buf, 0, 30); - /* set the host header */ - http_hdr_set_value(a_req->headers, - http_hdr_Host, - a_req->host); - /* check to see if we have an entity body */ - if ((a_req->type == http_req_type_post) || - (a_req->type == http_req_type_put) || - (a_req->type == http_req_type_trace)) - { - sprintf(l_buf, "%d", a_req->body_len); - http_hdr_set_value(a_req->headers, - http_hdr_Content_Length, - l_buf); - } - /* if the user agent isn't set then set a default */ - if (http_hdr_get_value(a_req->headers, http_hdr_User_Agent) == NULL) - http_hdr_set_value(a_req->headers, http_hdr_User_Agent, - "libghttp/1.0"); - return l_return; -} - -int -http_req_send(http_req *a_req, http_trans_conn *a_conn) -{ - char *l_request = NULL; - int l_request_len = 0; - int i = 0; - int l_len = 0; - int l_headers_len = 0; - int l_rv = 0; - char *l_content = NULL; - - /* see if we need to jump into the function somewhere */ - if (a_conn->sync == HTTP_TRANS_ASYNC) - { - if (a_req->state == http_req_state_sending_request) - goto http_req_state_sending_request_jump; - if (a_req->state == http_req_state_sending_headers) - goto http_req_state_sending_headers_jump; - if (a_req->state == http_req_state_sending_body) - goto http_req_state_sending_body_jump; - } - /* enough for the request and the other little headers */ - l_request = malloc(30 + strlen(a_req->resource) + (a_conn->proxy_host ? - (strlen(a_req->host) + 20) : 0)); - memset(l_request, 0, 30 + strlen(a_req->resource) + (a_conn->proxy_host ? - (strlen(a_req->host) + 20) : 0)); - /* copy it into the buffer */ - if (a_conn->proxy_host) - { - l_request_len = sprintf(l_request, - "%s %s HTTP/%01.1f\r\n", - http_req_type_char[a_req->type], - a_req->full_uri, - a_req->http_ver); - } - else - { - l_request_len = sprintf(l_request, - "%s %s HTTP/%01.1f\r\n", - http_req_type_char[a_req->type], - a_req->resource, - a_req->http_ver); - } - /* set the request in the connection buffer */ - http_trans_append_data_to_buf(a_conn, l_request, l_request_len); - /* free up the request - we don't need it anymore */ - free(l_request); - l_request = NULL; - /* set the state */ - a_req->state = http_req_state_sending_request; - http_req_state_sending_request_jump: - /* send the request */ - do { - l_rv = http_trans_write_buf(a_conn); - if ((a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - if ((l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - return HTTP_TRANS_ERR; - } while (l_rv == HTTP_TRANS_NOT_DONE); - /* reset the buffer */ - http_trans_buf_reset(a_conn); - /* set up all of the headers */ - for (i = 0; i < HTTP_HDRS_MAX; i++) - { - l_len = 0; - if (a_req->headers->header[i]) - { - l_len = strlen(a_req->headers->header[i]); - if (l_len > 0) - { - http_trans_append_data_to_buf(a_conn, a_req->headers->header[i], l_len); - l_headers_len += l_len; - http_trans_append_data_to_buf(a_conn, ": ", 2); - l_headers_len += 2; - /* note, it's ok to have no value for a request */ - if ((l_len = strlen(a_req->headers->value[i])) > 0) - { - http_trans_append_data_to_buf(a_conn, a_req->headers->value[i], l_len); - l_headers_len += l_len; - } - http_trans_append_data_to_buf(a_conn, "\r\n", 2); - l_headers_len += 2; - } - } - } - http_trans_append_data_to_buf(a_conn, "\r\n", 2); - l_headers_len += 2; - /* set the state */ - a_req->state = http_req_state_sending_headers; - http_req_state_sending_headers_jump: - /* blast that out to the network */ - do { - l_rv = http_trans_write_buf(a_conn); - if ((a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - if ((l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - return HTTP_TRANS_ERR; - } while (l_rv == HTTP_TRANS_NOT_DONE); - /* reset the buffer */ - http_trans_buf_reset(a_conn); - l_content = http_hdr_get_value(a_req->headers, http_hdr_Content_Length); - if (l_content) - { - /* append the information to the buffer */ - http_trans_append_data_to_buf(a_conn, a_req->body, a_req->body_len); - a_req->state = http_req_state_sending_body; - http_req_state_sending_body_jump: - do { - l_rv = http_trans_write_buf(a_conn); - if ((a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - if ((l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - return HTTP_TRANS_ERR; - } while (l_rv == HTTP_TRANS_NOT_DONE); - /* reset the buffer */ - http_trans_buf_reset(a_conn); - } - return HTTP_TRANS_DONE; -} diff --git a/include/libghttp/http_req.h b/include/libghttp/http_req.h deleted file mode 100644 index eac5e124..00000000 --- a/include/libghttp/http_req.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * http_req.h -- Routines for setting up an http request - * Created: Christopher Blizzard , 6-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* types of requests */ - -#ifndef HTTP_REQ_H -#define HTTP_REQ_H - -#include -#include "http_hdrs.h" -#include "http_trans.h" - -typedef enum http_req_type { - http_req_type_get = 0, - http_req_type_options, - http_req_type_head, - http_req_type_post, - http_req_type_put, - http_req_type_delete, - http_req_type_trace, - http_req_type_connect, - http_req_type_propfind, - http_req_type_proppatch, - http_req_type_mkcol, - http_req_type_copy, - http_req_type_move, - http_req_type_lock, - http_req_type_unlock -} http_req_type; - -typedef enum http_req_state_tag { - http_req_state_start = 0, - http_req_state_sending_request, - http_req_state_sending_headers, - http_req_state_sending_body -} http_req_state; - -/* same character representations as above. */ - -extern const char *http_req_type_char[]; - -typedef struct http_req_tag { - http_req_type type; - float http_ver; - char *host; - char *full_uri; - char *resource; - char *body; - int body_len; - http_hdr_list *headers; - http_req_state state; -} http_req; - -http_req * -http_req_new(void); - -void -http_req_destroy(http_req *a_req); - -int -http_req_prepare(http_req *a_req); - -int -http_req_send(http_req *a_req, http_trans_conn *a_conn); - -#endif /* HTTP_REQ_H */ diff --git a/include/libghttp/http_resp.c b/include/libghttp/http_resp.c deleted file mode 100644 index a4254d98..00000000 --- a/include/libghttp/http_resp.c +++ /dev/null @@ -1,711 +0,0 @@ -/* - * http_resp.c -- routines for reading http_responses - * Created: Christopher Blizzard 9-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include -#include "http_resp.h" -#include "http_global.h" - -typedef enum header_state_tag -{ - reading_header = 0, - reading_value, - reading_sep, - reading_eol -} header_state; - -static int -string_is_number(char *a_string); - -static int -read_chunk(http_trans_conn *a_conn); - -static int -read_body_chunked(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn); - -static int -read_body_content_length(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn); - -static int -read_body_standard(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn); - -http_resp * -http_resp_new(void) -{ - http_resp *l_return = NULL; - - l_return = (http_resp *)malloc(sizeof(http_resp)); - memset(l_return, 0, sizeof(http_resp)); - l_return->headers = http_hdr_list_new(); - return l_return; -} - -void -http_resp_destroy(http_resp *a_resp) -{ - if (!a_resp) - return; - if (a_resp->reason_phrase) - free(a_resp->reason_phrase); - if (a_resp->headers) - http_hdr_list_destroy(a_resp->headers); - if (a_resp->body) - free(a_resp->body); - free(a_resp); - return; -} - -int -http_resp_read_headers(http_resp *a_resp, http_trans_conn *a_conn) -{ - char *l_start_body = NULL; - int l_rv = 0; - int l_done = 0; - int l_return = HTTP_TRANS_DONE; - char *l_start_header = NULL; - int l_header_len = 0; - char *l_last_header = NULL; - int l_last_header_len = 0; - char *l_start_value = NULL; - int l_value_len = 0; - char *l_cur_ptr = NULL; - char *l_ptr = NULL; - header_state l_state = reading_header; - - /* check to see if we need to jump in somewhere */ - if (a_conn->sync == HTTP_TRANS_ASYNC) - { - if (a_resp->header_state == http_resp_reading_header) - goto http_resp_reading_header_jump; - } - /* start reading headers */ - do - { - a_resp->header_state = http_resp_reading_header; - http_resp_reading_header_jump: - /* read in the buffer */ - l_rv = http_trans_read_into_buf(a_conn); - /* check for an error */ - if (l_rv == HTTP_TRANS_ERR) - { - a_conn->errstr = "Failed to read http response line"; - l_return = HTTP_TRANS_ERR; - goto ec; - } - /* check to see if the end of headers string is in the buffer */ - l_start_body = http_trans_buf_has_patt(a_conn->io_buf, - a_conn->io_buf_alloc, - "\r\n\r\n", 4); - if (l_start_body != NULL) - l_done = 1; - if ((l_done == 0) && (a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - /* yes, that !l_done is ther because in the case of a 100 - continue we well get back up to this loop without doing a - successful read. */ - if ((!l_done) && (l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - { - a_conn->errstr = "Short read while reading http response headers"; - return HTTP_TRANS_ERR; - } - } while (l_done == 0); - /* parse out the response header */ - /* check to make sure that there's enough that came back */ - if ((a_conn->io_buf_alloc) < 14) - { - a_conn->errstr = "The http response line was too short."; - l_return = HTTP_TRANS_ERR; - goto ec; - } - l_ptr = a_conn->io_buf; - /* can you say PARANOID? I thought you could. */ - if (strncmp(l_ptr, "HTTP", 4) != 0) - { - a_conn->errstr = "The http response line did not begin with \"HTTP\""; - l_return = HTTP_TRANS_ERR; - goto ec; - } - if ((isdigit(l_ptr[5]) == 0) || /* http ver */ - (l_ptr[6] != '.') || - (isdigit(l_ptr[7]) == 0) || - (l_ptr[8] != ' ') || /* space */ - (isdigit(l_ptr[9]) == 0) || /* code */ - (isdigit(l_ptr[10]) == 0) || - (isdigit(l_ptr[11]) == 0) || - (l_ptr[12] != ' ')) /* space */ - { - a_conn->errstr = "Error parsing http response line"; - l_return = HTTP_TRANS_ERR; - goto ec; - } - /* convert char into int */ - a_resp->http_ver = (l_ptr[5] - 0x30); - a_resp->http_ver += ((l_ptr[7] - 0x30) / 10.0); - /* convert the response into an int */ - a_resp->status_code = ((l_ptr[9] - 0x30)*100); - a_resp->status_code += ((l_ptr[10] - 0x30)*10); - a_resp->status_code += (l_ptr[11] - 0x30); - /* get the length of the reason_phrase */ - l_cur_ptr = &l_ptr[13]; - /* you can't overrun this because you already know that - there has to be a '\r' above from searching from the - end of the headers */ - while (*l_cur_ptr != '\r') - l_cur_ptr++; - /* make sure to free the buffer if it's already allocated */ - if (a_resp->reason_phrase) { - free(a_resp->reason_phrase); - a_resp->reason_phrase = NULL; - } - /* allocate space for the reason phrase */ - a_resp->reason_phrase = - malloc((l_cur_ptr - (&l_ptr[13])) + 1); - memset(a_resp->reason_phrase, 0, - ((l_cur_ptr - (&l_ptr[13])) + 1)); - memcpy(a_resp->reason_phrase, - &l_ptr[13], (l_cur_ptr - (&l_ptr[13]))); - /* see if there are any headers. If there aren't any headers - then the end of the reason phrase is the same as the start body - as above. If that's the case then skip reading any headers. */ - if (l_cur_ptr == l_start_body) - l_done = 1; - else - l_done = 0; - /* make sure that it's not a continue. */ - if (a_resp->status_code == 100) - { - /* look for the next \r\n\r\n and cut it off */ - char *l_end_continue = http_trans_buf_has_patt(a_conn->io_buf, - a_conn->io_buf_alloc, - "\r\n\r\n", 4); - if (!l_end_continue) - return HTTP_TRANS_ERR; - http_trans_buf_clip(a_conn, l_end_continue + 4); - l_start_body = NULL; - a_resp->status_code = 0; - l_done = 0; - if (a_conn->sync == HTTP_TRANS_ASYNC) - return HTTP_TRANS_NOT_DONE; - else - goto http_resp_reading_header_jump; - } - /* set the start past the end of the reason phrase, - checking if there's a CRLF after it. */ - while ((*l_cur_ptr == '\r') || - (*l_cur_ptr == '\n')) - l_cur_ptr++; - - /* start parsing out the headers */ - /* start at the beginning */ - l_start_header = l_cur_ptr; - while (l_done == 0) - { - /* check to see if we're at the end of the - headers as determined above by the _patt() call */ - if (l_cur_ptr == (l_start_body + 1)) - break; - /* reading the header name */ - if (l_state == reading_header) - { - /* check to see if there's leading whitespace. - If that's the case then it needs to be combined - from the previous header */ - if (l_header_len == 0) - { - if ((*l_cur_ptr == ' ') || (*l_cur_ptr == '\t')) - { - /* bomb if it's the first header. That's not valid */ - if ((l_last_header == NULL) || (l_last_header_len == 0)) - { - a_conn->errstr = "The first http response header began with whitespace"; - l_return = HTTP_TRANS_ERR; - goto ec; - } - l_cur_ptr++; - /* set it reading sep. sep will eat all of the write space */ - l_state = reading_sep; - continue; - } - } - if (*l_cur_ptr == ':') - { - /* make sure that there's some header there */ - if (l_header_len == 0) - { - a_conn->errstr = "An http response header was zero length"; - l_return = HTTP_TRANS_ERR; - goto ec; - } - /* start reading the seperator */ - l_state = reading_sep; - l_cur_ptr++; - } - /* make sure there's a seperator in - there somewhere */ - else if (*l_cur_ptr == '\r') - { - a_conn->errstr = "Failed to find seperator in http response headers"; - l_return = HTTP_TRANS_ERR; - goto ec; - } - else - { - l_cur_ptr++; - l_header_len++; - } - } - /* read the seperator */ - else if(l_state == reading_sep) - { - /* walk until you get a non-whitespace character */ - if ((*l_cur_ptr == ' ') || (*l_cur_ptr == '\t')) - l_cur_ptr++; - else - { - l_state = reading_value; - l_start_value = l_cur_ptr; - l_value_len = 0; - } - } - /* read the value */ - else if(l_state == reading_value) - { - /* check to see if we've reached the end of the - value */ - if ((*l_cur_ptr == '\r') || (*l_cur_ptr == '\n')) - { - /* check to see if this is a continuation of the last - header. If the header len is 0 and we've gotten to - this point then that's the case */ - if (l_header_len == 0) - { - http_hdr_set_value_no_nts(a_resp->headers, - l_last_header, - l_last_header_len, - l_start_value, - l_value_len); - } - else - { - http_hdr_set_value_no_nts(a_resp->headers, - l_start_header, - l_header_len, - l_start_value, - l_value_len); - - /* set the last header and the length so that a new line - that starts with spaces can figure out what header it - applies to */ - l_last_header = l_start_header; - l_last_header_len = l_header_len; - } - /* start eating the end of line */ - l_state = reading_eol; - } - else - { - l_cur_ptr++; - l_value_len++; - } - } - /* read the eof */ - else if(l_state == reading_eol) - { - /* eat the eol */ - if ((*l_cur_ptr == '\r') || (*l_cur_ptr == '\n')) - l_cur_ptr++; - else - { - /* start reading a new header again. */ - l_state = reading_header; - l_start_header = l_cur_ptr; - l_header_len = 0; - } - } - /* what state is this? */ - else - { - a_conn->errstr = "Unknown state while reading http response headers"; - l_return = HTTP_TRANS_ERR; - goto ec; - } - } - /* clip the buffer */ - http_trans_buf_clip(a_conn, l_start_body + 4); - ec: - a_resp->header_state = http_resp_header_start; - return l_return; -} - -int -http_resp_read_body(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn) -{ - int l_return = 0; - char *l_content_length = NULL; - char *l_transfer_encoding = NULL; - char *l_connection = NULL; - - /* check to see if we have to jump in anywhere. */ - if (a_conn->sync == HTTP_TRANS_ASYNC) - { - if (a_resp->body_state == http_resp_body_read_content_length) - goto http_resp_body_read_content_length_jump; - if (a_resp->body_state == http_resp_body_read_chunked) - goto http_resp_body_read_chunked_jump; - if (a_resp->body_state == http_resp_body_read_standard) - goto http_resp_body_read_standard_jump; - } - /* check to make sure that things are ok. */ - if ((!a_resp) || (!a_conn)) - return -1; - /* check to see if there should be an entity body. */ - /* check to see if there's a content length */ - l_content_length = - http_hdr_get_value(a_resp->headers, - http_hdr_Content_Length); - /* check to see if there's a transfer encoding */ - l_transfer_encoding = - http_hdr_get_value(a_resp->headers, - http_hdr_Transfer_Encoding); - /* check to see if the connection header is set */ - l_connection = - http_hdr_get_value(a_resp->headers, - http_hdr_Connection); - /* if there's a content length, do your stuff */ - if (l_content_length && (a_req->type != http_req_type_head)) - { - if (string_is_number(l_content_length) == 0) - { - a_conn->errstr = "Content length in http response was not a number"; - return -1; - } - a_resp->content_length = atoi(l_content_length); - /* set the state */ - a_resp->body_state = http_resp_body_read_content_length; - http_resp_body_read_content_length_jump: - l_return = read_body_content_length(a_resp, a_req, a_conn); - } - else if (l_content_length) - { - /* this happens in a head request with content length. */ - return HTTP_TRANS_DONE; - } - else if (l_transfer_encoding) - { - /* check to see if it's using chunked transfer encoding */ - if (!strcasecmp(l_transfer_encoding, "chunked")) - { - /* set the state */ - a_resp->body_state = http_resp_body_read_chunked; - http_resp_body_read_chunked_jump: - l_return = read_body_chunked(a_resp, a_req, a_conn); - } - else - { - /* what kind of encoding? */ - a_conn->errstr = "Unknown encoding type in http response"; - return -1; - } - } - else - { - a_resp->body_state = http_resp_body_read_standard; - /* set the state */ - http_resp_body_read_standard_jump: - l_return = read_body_standard(a_resp, a_req, a_conn); - /* after that the connection gets closed */ - if (l_return == HTTP_TRANS_DONE) - { - close(a_conn->sock); - a_conn->sock = -1; - } - } - /* check to see if the connection should be closed */ - if (l_connection && (l_return != HTTP_TRANS_NOT_DONE)) - { - if (!strcasecmp(l_connection, "close")) - { - close (a_conn->sock); - a_conn->sock = -1; - } - } - if (l_return == HTTP_TRANS_DONE) - a_resp->body_state = http_resp_body_start; - return l_return; -} - -static int -string_is_number(char *a_string) -{ - int i = 0; - - if (strlen(a_string) < 1) - return 0; - while (a_string[i]) - { - if (isdigit(a_string[i]) == 0) - return 0; - i++; - } - return 1; -} - -static int -read_chunk(http_trans_conn *a_conn) -{ - char *l_end_chunk_hdr = NULL; - int l_len = 0; - int i = 0; - int j = 0; - char *l_ptr = NULL; - int l_left_to_read = 0; - int l_rv = 0; - - if (a_conn->chunk_len == 0) - { - /* check to make sure that the pattern is in the - buffer */ - do { - if ((l_end_chunk_hdr = - http_trans_buf_has_patt(a_conn->io_buf, a_conn->io_buf_alloc, - "\r\n", 2)) == NULL) - { - l_rv = http_trans_read_into_buf(a_conn); - if (l_rv == HTTP_TRANS_ERR) - return HTTP_TRANS_ERR; - /* check to see if the remote end hung up. */ - if ((l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - return HTTP_TRANS_ERR; - if ((a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - } - } while (l_end_chunk_hdr == NULL); - /* set the begining at the start of the buffer */ - l_ptr = a_conn->io_buf; - /* eat the hex value of the chunk */ - while ((l_ptr < l_end_chunk_hdr) && - (((tolower(*l_ptr) <= 'f') && (tolower(*l_ptr) >= 'a')) || - ((*l_ptr <= '9') && (*l_ptr >= '0')))) - l_ptr++; - /* get the length of the hex number */ - l_len = l_ptr - a_conn->io_buf; - if (l_len == 0) - { - a_conn->chunk_len = -1; - return HTTP_TRANS_ERR; - } - /* walk the size adding the values as you go along. */ - for (i=0, j=l_len-1; i < l_len; i++, j--) - { - if ((tolower(a_conn->io_buf[i]) <= 'f') && (tolower(a_conn->io_buf[i]) >= 'a')) - a_conn->chunk_len += (tolower(a_conn->io_buf[i]) - 0x57) << (4*j); - else - a_conn->chunk_len += (tolower(a_conn->io_buf[i]) - 0x30) << (4*j); - } - /* reset the pointer past the end of the header */ - http_trans_buf_clip(a_conn, l_end_chunk_hdr + 2); - } - /* check to see if it's the last chunk. If not then add it.*/ - if (a_conn->chunk_len != 0) - { - /* figure out how much we need to read */ - /* the + 2 is for the \r\n that always follows a chunk. */ - l_left_to_read = a_conn->chunk_len - a_conn->io_buf_alloc + 2; - /* check to make sure that we actually need to read anything in. */ - if (l_left_to_read > 0) - { - /* set the vars in the struct */ - a_conn->io_buf_io_left = l_left_to_read; - a_conn->io_buf_io_done = 0; - /* append it */ - do { - l_rv = http_trans_read_into_buf(a_conn); - if (l_rv == HTTP_TRANS_ERR) - return HTTP_TRANS_ERR; - /* check and see if the server hung up. */ - if ((l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - return HTTP_TRANS_ERR; - if ((a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - } while (l_rv == HTTP_TRANS_NOT_DONE); - } - } - if (a_conn->io_buf_alloc >= a_conn->chunk_len + 2) - return HTTP_TRANS_DONE; - /* we only get here if there was an error. */ - if (a_conn->chunk_len == 0) - return HTTP_TRANS_DONE; - return HTTP_TRANS_ERR; -} - -static int -read_body_chunked(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn) -{ - int l_rv = 0; - int l_done = 0; - - do - { - /* read a chunk */ - l_rv = read_chunk(a_conn); - if (l_rv == HTTP_TRANS_ERR) - return HTTP_TRANS_ERR; - if ((a_conn->sync == HTTP_TRANS_ASYNC) && (l_rv == HTTP_TRANS_NOT_DONE)) - return HTTP_TRANS_NOT_DONE; - /* see if it's the first time */ - if (a_conn->chunk_len > 0) - { - if (a_resp->body == NULL) - { - a_resp->body = malloc(a_conn->chunk_len); - memcpy(a_resp->body, a_conn->io_buf, a_conn->chunk_len); - a_resp->body_len = a_conn->chunk_len; - } - /* append it to the body */ - else - { - a_resp->body = realloc(a_resp->body, - (a_resp->body_len + a_conn->chunk_len)); - memcpy(&a_resp->body[a_resp->body_len], a_conn->io_buf, a_conn->chunk_len); - a_resp->body_len += a_conn->chunk_len; - } - } - /* make sure there's at least 2 bytes in the buffer. - This happens when a read was 3 bytes as in 0\r\n - and there is still 2 bytes ( \r\n ) in the read queue. */ - if ((a_conn->chunk_len == 0) && (a_conn->io_buf_alloc < 2)) - { - a_conn->io_buf_io_left = ( 2 - a_conn->io_buf_alloc ); - a_conn->io_buf_io_done = 0; - do { - l_rv = http_trans_read_into_buf(a_conn); - } while (l_rv == HTTP_TRANS_NOT_DONE); - /* check for an error */ - if (l_rv == HTTP_TRANS_ERR) - return HTTP_TRANS_ERR; - } - if (a_conn->chunk_len == 0) - l_done = 1; - else - { - /* clip the buffer */ - http_trans_buf_clip(a_conn, &a_conn->io_buf[a_conn->chunk_len + 2]); - } - a_conn->chunk_len = 0; - } while (l_done == 0); - return HTTP_TRANS_DONE; -} - -static void -flush_response_body(http_resp *a_resp, - http_trans_conn *a_conn) -{ - if (a_resp->body != NULL) { - free(a_resp->body); - } - a_resp->flushed_length += a_resp->body_len; - a_resp->body_len = a_conn->io_buf_alloc; - a_resp->body = malloc(a_conn->io_buf_alloc + 1); - memset(a_resp->body, 0, a_conn->io_buf_alloc + 1); - memcpy(a_resp->body, a_conn->io_buf, a_conn->io_buf_alloc); - /* clean the buffer */ - http_trans_buf_reset(a_conn); -} - -void -http_resp_flush(http_resp *a_resp, - http_trans_conn *a_conn) -{ - flush_response_body(a_resp, a_conn); -} - -static int -read_body_content_length(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn) -{ - int l_len = 0; - int l_left_to_read = 0; - int l_rv = 0; - - l_len = a_resp->content_length; - if (l_len == 0) - return HTTP_TRANS_DONE; - - /* find out how much more we have to read */ - l_left_to_read = l_len - a_conn->io_buf_alloc - a_resp->flushed_length - a_resp->body_len; - /* set the variables */ - a_conn->io_buf_io_left = l_left_to_read; - a_conn->io_buf_io_done = 0; - if (l_left_to_read > 0) - { - /* append the rest of the body to the - buffer */ - do { - l_rv = http_trans_read_into_buf(a_conn); - if ((l_rv == HTTP_TRANS_NOT_DONE) && - (a_conn->sync == HTTP_TRANS_ASYNC)) - return HTTP_TRANS_NOT_DONE; - if ((l_rv == HTTP_TRANS_DONE) && (a_conn->last_read == 0)) - return HTTP_TRANS_ERR; - } while(l_rv == HTTP_TRANS_NOT_DONE); - if (l_rv == HTTP_TRANS_ERR) - return HTTP_TRANS_ERR; - } - /* write it into the body */ - flush_response_body (a_resp, a_conn); - return HTTP_TRANS_DONE; -} - -static int -read_body_standard(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn) -{ - int l_rv = 0; - /* anything without a content length or chunked encoding */ - do { - l_rv = http_trans_read_into_buf(a_conn); - if (a_conn->sync == HTTP_TRANS_ASYNC) - { - if ((l_rv == HTTP_TRANS_NOT_DONE) || (a_conn->last_read != 0)) - return HTTP_TRANS_NOT_DONE; - } - } while ((l_rv == HTTP_TRANS_NOT_DONE) || (a_conn->last_read > 0)); - - if (l_rv == HTTP_TRANS_ERR) - return HTTP_TRANS_ERR; - - flush_response_body(a_resp, a_conn); - return HTTP_TRANS_DONE; -} diff --git a/include/libghttp/http_resp.h b/include/libghttp/http_resp.h deleted file mode 100644 index c8a44ba0..00000000 --- a/include/libghttp/http_resp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * http_resp.h -- routines for reading http responses - * Created: Christopher Blizzard 9-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_RESP_H -#define HTTP_RESP_H - -#include "http_hdrs.h" -#include "http_trans.h" -#include "http_req.h" - -#define HTTP_RESP_INFORMATIONAL(x) (x >=100 && < 200) -#define HTTP_RESP_SUCCESS(x) (x >= 200 && x < 300) -#define HTTP_RESP_REDIR(x) (x >= 300 && x < 400) -#define HTTP_RESP_CLIENT_ERR(x) (x >= 400 && x < 500) -#define HTTP_RESP_SERVER_ERR(x) (x >= 500 && x < 600) - -typedef enum http_resp_header_state_tag -{ - http_resp_header_start = 0, - http_resp_reading_header -} http_resp_header_state; - -typedef enum http_resp_body_state_tag -{ - http_resp_body_start = 0, - http_resp_body_read_content_length, - http_resp_body_read_chunked, - http_resp_body_read_standard -} http_resp_body_state; - - - -typedef struct http_resp_tag -{ - float http_ver; - int status_code; - char *reason_phrase; - http_hdr_list *headers; - char *body; - int body_len; - int content_length; - int flushed_length; - http_resp_header_state header_state; - http_resp_body_state body_state; -} http_resp; - -http_resp * -http_resp_new(void); - -void -http_resp_destroy(http_resp *a_resp); - -int -http_resp_read_body(http_resp *a_resp, - http_req *a_req, - http_trans_conn *a_conn); - -int -http_resp_read_headers(http_resp *a_resp, http_trans_conn *a_conn); - -void -http_resp_flush(http_resp *a_resp, - http_trans_conn *a_conn); - -#endif /* HTTP_RESP_H */ diff --git a/include/libghttp/http_trans.c b/include/libghttp/http_trans.c deleted file mode 100644 index 23ac87da..00000000 --- a/include/libghttp/http_trans.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * http_trans.c -- Functions for doing transport related stuff including - * automatically extending buffers and whatnot. - * Created: Christopher Blizzard , 5-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include -#include -#include -#include "http_trans.h" -#include "http_global.h" - -static int -http_trans_buf_free(http_trans_conn *a_conn); - -int -http_trans_connect(http_trans_conn *a_conn) -{ - if ((a_conn == NULL) || (a_conn->host == NULL)) - goto ec; - if (a_conn->hostinfo == NULL) - { - /* look up the name of the proxy if it's there. */ - if (a_conn->proxy_host) - { - if ((a_conn->hostinfo = gethostbyname(a_conn->proxy_host)) == NULL) - { - a_conn->error_type = http_trans_err_type_host; - a_conn->error = h_errno; - goto ec; - } - } - else - { - /* look up the name */ - if ((a_conn->hostinfo = gethostbyname(a_conn->host)) == NULL) - { - a_conn->error_type = http_trans_err_type_host; - a_conn->error = h_errno; - goto ec; - } - } - /* set up the saddr */ - a_conn->saddr.sin_family = AF_INET; - /* set the proxy port */ - if (a_conn->proxy_host) - a_conn->saddr.sin_port = htons(a_conn->proxy_port); - else - a_conn->saddr.sin_port = htons(a_conn->port); - /* copy the name info */ - memcpy(&a_conn->saddr.sin_addr.s_addr, - a_conn->hostinfo->h_addr_list[0], - sizeof(unsigned long)); - } - /* set up the socket */ - if ((a_conn->sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) - { - a_conn->error_type = http_trans_err_type_errno; - a_conn->error = errno; - goto ec; - } - /* set up the socket */ - if (connect(a_conn->sock, - (struct sockaddr *)&a_conn->saddr, - sizeof(struct sockaddr)) < 0) - { - a_conn->error_type = http_trans_err_type_errno; - a_conn->error = errno; - goto ec; - } - - return 0; - ec: - return -1; -} - -http_trans_conn * -http_trans_conn_new(void) -{ - http_trans_conn *l_return = NULL; - - /* allocate a new connection struct */ - l_return = (http_trans_conn *)malloc(sizeof(http_trans_conn)); - memset(l_return, 0, sizeof(http_trans_conn)); - /* default to 80 */ - l_return->port = 80; - /* default to 1000 bytes at a time */ - l_return->io_buf_chunksize = 1024; - /* allocate a new trans buffer */ - l_return->io_buf = malloc(l_return->io_buf_chunksize); - memset(l_return->io_buf, 0, l_return->io_buf_chunksize); - l_return->io_buf_len = l_return->io_buf_chunksize; - /* make sure the socket looks like it's closed */ - l_return->sock = -1; - return l_return; -} - -void -http_trans_conn_destroy(http_trans_conn *a_conn) -{ - /* destroy the connection structure. */ - if (a_conn == NULL) - return; - if (a_conn->io_buf) - free(a_conn->io_buf); - if (a_conn->sock != -1) - close(a_conn->sock); - free(a_conn); - return; -} - -const char * -http_trans_get_host_error(int a_herror) -{ - switch (a_herror) - { - case HOST_NOT_FOUND: - return "Host not found"; - case NO_ADDRESS: - return "An address is not associated with that host"; - case NO_RECOVERY: - return "An unrecoverable name server error occured"; - case TRY_AGAIN: - return "A temporary error occurred on an authoritative name server. Please try again later."; - default: - return "No error or error not known."; - } -} - -int -http_trans_append_data_to_buf(http_trans_conn *a_conn, - char *a_data, - int a_data_len) -{ - if (http_trans_buf_free(a_conn) < a_data_len) - { - a_conn->io_buf = realloc(a_conn->io_buf, a_conn->io_buf_len + a_data_len); - a_conn->io_buf_len += a_data_len; - } - memcpy(&a_conn->io_buf[a_conn->io_buf_alloc], a_data, a_data_len); - a_conn->io_buf_alloc += a_data_len; - return 1; -} - -int -http_trans_read_into_buf(http_trans_conn *a_conn) -{ - int l_read = 0; - int l_bytes_to_read = 0; - - /* set the length if this is the first time */ - if (a_conn->io_buf_io_left == 0) - { - a_conn->io_buf_io_left = a_conn->io_buf_chunksize; - a_conn->io_buf_io_done = 0; - } - /* make sure there's enough space */ - if (http_trans_buf_free(a_conn) < a_conn->io_buf_io_left) - { - a_conn->io_buf = realloc(a_conn->io_buf, - a_conn->io_buf_len + a_conn->io_buf_io_left); - a_conn->io_buf_len += a_conn->io_buf_io_left; - } - /* check to see how much we should try to read */ - if (a_conn->io_buf_io_left > a_conn->io_buf_chunksize) - l_bytes_to_read = a_conn->io_buf_chunksize; - else - l_bytes_to_read = a_conn->io_buf_io_left; - /* read in some data */ - if ((a_conn->last_read = l_read = read(a_conn->sock, - &a_conn->io_buf[a_conn->io_buf_alloc], - l_bytes_to_read)) < 0) - { - if (errno == EINTR) - l_read = 0; - else - return HTTP_TRANS_ERR; - } - else if (l_read == 0) - return HTTP_TRANS_DONE; - /* mark the buffer */ - a_conn->io_buf_io_left -= l_read; - a_conn->io_buf_io_done += l_read; - a_conn->io_buf_alloc += l_read; - /* generate the result */ - if (a_conn->io_buf_io_left == 0) - return HTTP_TRANS_DONE; - return HTTP_TRANS_NOT_DONE; -} - -int -http_trans_write_buf(http_trans_conn *a_conn) -{ - int l_written = 0; - - if (a_conn->io_buf_io_left == 0) - { - a_conn->io_buf_io_left = a_conn->io_buf_alloc; - a_conn->io_buf_io_done = 0; - } - /* write out some data */ - if ((a_conn->last_read = l_written = write (a_conn->sock, - &a_conn->io_buf[a_conn->io_buf_io_done], - a_conn->io_buf_io_left)) <= 0) - { - if (errno == EINTR) - l_written = 0; - else - return HTTP_TRANS_ERR; - } - if (l_written == 0) - return HTTP_TRANS_DONE; - /* advance the counters */ - a_conn->io_buf_io_left -= l_written; - a_conn->io_buf_io_done += l_written; - if (a_conn->io_buf_io_left == 0) - return HTTP_TRANS_DONE; - return HTTP_TRANS_NOT_DONE; -} - -void -http_trans_buf_reset(http_trans_conn *a_conn) -{ - if (a_conn->io_buf) - free(a_conn->io_buf); - a_conn->io_buf = malloc(a_conn->io_buf_chunksize); - memset(a_conn->io_buf, 0, a_conn->io_buf_chunksize); - a_conn->io_buf_len = a_conn->io_buf_chunksize; - a_conn->io_buf_alloc = 0; - a_conn->io_buf_io_done = 0; - a_conn->io_buf_io_left = 0; -} - -void -http_trans_buf_clip(http_trans_conn *a_conn, char *a_clip_to) -{ - int l_bytes = 0; - - /* get the number of bytes to clip off of the front */ - l_bytes = a_clip_to - a_conn->io_buf; - if (l_bytes > 0) - { - memmove(a_conn->io_buf, a_clip_to, a_conn->io_buf_alloc - l_bytes); - a_conn->io_buf_alloc -= l_bytes; - } - a_conn->io_buf_io_done = 0; - a_conn->io_buf_io_left = 0; -} - -char * -http_trans_buf_has_patt(char *a_buf, int a_len, - char *a_pat, int a_patlen) -{ - int i = 0; - for ( ; i <= ( a_len - a_patlen ); i++ ) - { - if (a_buf[i] == a_pat[0]) - { - if (memcmp(&a_buf[i], a_pat, a_patlen) == 0) - return &a_buf[i]; - } - } - return NULL; -} - -/* static functions */ - -static int -http_trans_buf_free(http_trans_conn *a_conn) -{ - return (a_conn->io_buf_len - a_conn->io_buf_alloc); -} diff --git a/include/libghttp/http_trans.h b/include/libghttp/http_trans.h deleted file mode 100644 index 9e517899..00000000 --- a/include/libghttp/http_trans.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * http_trans.h -- This file contains definitions for http transport functions - * Created: Christopher Blizzard , 5-Aug-1998 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_TRANS_H -#define HTTP_TRANS_H - -#include -#include -#include -#include - -typedef enum http_trans_err_type_tag { - http_trans_err_type_host = 0, - http_trans_err_type_errno -} http_trans_err_type; - -typedef struct http_trans_conn_tag { - struct hostent *hostinfo; - struct sockaddr_in saddr; - char *host; - char *proxy_host; - int sock; - short port; - short proxy_port; - http_trans_err_type error_type; - int error; - int sync; /* sync or async? */ - char *io_buf; /* buffer */ - int io_buf_len; /* how big is it? */ - int io_buf_alloc; /* how much is used */ - int io_buf_io_done; /* how much have we already moved? */ - int io_buf_io_left; /* how much data do we have left? */ - int io_buf_chunksize; /* how big should the chunks be that get - read in and out be? */ - int last_read; /* the size of the last read */ - int chunk_len; /* length of a chunk. */ - char *errstr; /* a hint as to an error */ -} http_trans_conn; - -http_trans_conn * -http_trans_conn_new(void); - -void -http_trans_conn_destroy(http_trans_conn *a_conn); - -void -http_trans_buf_reset(http_trans_conn *a_conn); - -void -http_trans_buf_clip(http_trans_conn *a_conn, char *a_clip_to); - -int -http_trans_connect(http_trans_conn *a_conn); - -const char * -http_trans_get_host_error(int a_herror); - -int -http_trans_append_data_to_buf(http_trans_conn *a_conn, - char *a_data, - int a_data_len); - -int -http_trans_read_into_buf(http_trans_conn *a_conn); - -int -http_trans_write_buf(http_trans_conn *a_conn); - -char * -http_trans_buf_has_patt(char *a_buf, int a_len, - char *a_pat, int a_patlen); - -#endif /* HTTP_TRANS_H */ diff --git a/include/libghttp/http_uri.c b/include/libghttp/http_uri.c deleted file mode 100644 index 912d0695..00000000 --- a/include/libghttp/http_uri.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - * http_uri.c --- Contains functions to parse uri's - * Created: Christopher Blizzard , 4-Jul-98 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include "http_uri.h" - -typedef enum uri_parse_state_tag -{ - parse_state_read_host = 0, - parse_state_read_port, - parse_state_read_resource -} uri_parse_state; - - -int -http_uri_parse(char *a_string, - http_uri *a_uri) -{ - /* Everyone chant... "we love state machines..." */ - uri_parse_state l_state = parse_state_read_host; - char *l_start_string = NULL; - char *l_end_string = NULL; - char l_temp_port[6]; - - /* init the array */ - memset(l_temp_port, 0, 6); - /* check the parameters */ - if (a_string == NULL) - goto ec; - if (a_uri) { - a_uri->full = strdup(a_string); - } - l_start_string = strchr(a_string, ':'); - /* check to make sure that there was a : in the string */ - if (!l_start_string) - goto ec; - if (a_uri) { - a_uri->proto = (char *)malloc(l_start_string - a_string + 1); - memcpy(a_uri->proto, a_string, (l_start_string - a_string)); - a_uri->proto[l_start_string - a_string] = '\0'; - } - /* check to make sure it starts with "http://" */ - if (strncmp(l_start_string, "://", 3) != 0) - goto ec; - /* start at the beginning of the string */ - l_start_string = l_end_string = &l_start_string[3]; - while(*l_end_string) - { - if (l_state == parse_state_read_host) - { - if (*l_end_string == ':') - { - l_state = parse_state_read_port; - if ((l_end_string - l_start_string) == 0) - goto ec; - /* allocate space */ - if ((l_end_string - l_start_string) == 0) - goto ec; - /* only do this if a uri was passed in */ - if (a_uri) - { - a_uri->host = (char *)malloc(l_end_string - l_start_string + 1); - /* copy the data */ - memcpy(a_uri->host, l_start_string, (l_end_string - l_start_string)); - /* terminate */ - a_uri->host[l_end_string - l_start_string] = '\0'; - } - /* reset the counters */ - l_end_string++; - l_start_string = l_end_string; - continue; - } - else if (*l_end_string == '/') - { - l_state = parse_state_read_resource; - if ((l_end_string - l_start_string) == 0) - goto ec; - if (a_uri) - { - a_uri->host = (char *)malloc(l_end_string - l_start_string + 1); - memcpy(a_uri->host, l_start_string, (l_end_string - l_start_string)); - a_uri->host[l_end_string - l_start_string] = '\0'; - } - l_start_string = l_end_string; - continue; - } - } - else if (l_state == parse_state_read_port) - { - if (*l_end_string == '/') - { - l_state = parse_state_read_resource; - /* check to make sure we're not going to overflow */ - if (l_end_string - l_start_string > 5) - goto ec; - /* check to make sure there was a port */ - if ((l_end_string - l_start_string) == 0) - goto ec; - /* copy the port into a temp buffer */ - memcpy(l_temp_port, l_start_string, l_end_string - l_start_string); - /* convert it. */ - if (a_uri) - a_uri->port = atoi(l_temp_port); - l_start_string = l_end_string; - continue; - } - else if (isdigit(*l_end_string) == 0) - { - /* check to make sure they are just digits */ - goto ec; - } - } - /* next.. */ - l_end_string++; - continue; - } - - if (l_state == parse_state_read_host) - { - if ((l_end_string - l_start_string) == 0) - goto ec; - if (a_uri) - { - a_uri->host = (char *)malloc(l_end_string - l_start_string + 1); - memcpy(a_uri->host, l_start_string, (l_end_string - l_start_string)); - a_uri->host[l_end_string - l_start_string] = '\0'; - /* for a "/" */ - a_uri->resource = strdup("/"); - } - } - else if (l_state == parse_state_read_port) - { - if (strlen(l_start_string) == 0) - /* oops. that's not a valid number */ - goto ec; - if (a_uri) - { - a_uri->port = atoi(l_start_string); - a_uri->resource = strdup("/"); - } - } - else if (l_state == parse_state_read_resource) - { - if (strlen(l_start_string) == 0) - { - if (a_uri) - a_uri->resource = strdup("/"); - } - else - { - if (a_uri) - a_uri->resource = strdup(l_start_string); - } - } - else - { - /* uhh...how did we get here? */ - goto ec; - } - return 0; - - ec: - return -1; -} - -http_uri * -http_uri_new(void) -{ - http_uri *l_return = NULL; - - l_return = (http_uri *)malloc(sizeof(http_uri)); - l_return->full = NULL; - l_return->proto = NULL; - l_return->host = NULL; - l_return->port = 80; - l_return->resource = NULL; - return l_return; -} - -void -http_uri_destroy(http_uri *a_uri) -{ - if (a_uri->full) { - free(a_uri->full); - a_uri->full = NULL; - } - if (a_uri->proto) { - free(a_uri->proto); - a_uri->proto = NULL; - } - if (a_uri->host) { - free(a_uri->host); - a_uri->host = NULL; - } - if (a_uri->resource) { - free(a_uri->resource); - a_uri->resource = NULL; - } - free(a_uri); -} - - diff --git a/include/libghttp/http_uri.h b/include/libghttp/http_uri.h deleted file mode 100644 index ab1dccad..00000000 --- a/include/libghttp/http_uri.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * http_uri.h --- Contains routines for working with uri's - * Created: Christopher Blizzard , 9-Jul-98 - * - * Copyright (C) 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef HTTP_URI_H -#define HTTP_URI_H - -/* strings that are used all over the place */ - -typedef struct http_uri_tag -{ - char *full; /* full URL */ - char *proto; /* protocol */ - char *host; /* copy semantics */ - unsigned short port; - char *resource; /* copy semantics */ -} http_uri; - -http_uri * -http_uri_new(void); - -void -http_uri_destroy(http_uri *a_uri); - -int -http_uri_parse(char *a_uri, - http_uri *a_request); - -#endif - - - diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt new file mode 100644 index 00000000..278f056a --- /dev/null +++ b/res/CMakeLists.txt @@ -0,0 +1,6 @@ +install(DIRECTORY "pidgin" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pixmaps/pidgin/protocols") +install(DIRECTORY "empathy" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/empathy/icons/hicolor") +install(DIRECTORY "qqfaces" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/lwqq/icons/qqfaces") diff --git a/res/qqfaces/Makefile.am b/res/qqfaces/Makefile.am deleted file mode 100644 index bfa3df6d..00000000 --- a/res/qqfaces/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -faceimgdir=${pkgdatadir}/icons/qqfaces -faceimg_DATA=\ - 0.gif 109.gif 118.gif 127.gif 14.gif 23.gif 32.gif\ - 41.gif 50.gif 5.gif 69.gif 78.gif 87.gif 96.gif\ - 100.gif 10.gif 119.gif 128.gif 15.gif 24.gif 33.gif\ - 42.gif 51.gif 60.gif 6.gif 79.gif 88.gif 97.gif\ - 101.gif 110.gif 11.gif 129.gif 16.gif 25.gif 34.gif\ - 43.gif 52.gif 61.gif 70.gif 7.gif 89.gif 98.gif\ - 102.gif 111.gif 120.gif 12.gif 17.gif 26.gif 35.gif\ - 44.gif 53.gif 62.gif 71.gif 80.gif 8.gif 99.gif\ - 103.gif 112.gif 121.gif 130.gif 18.gif 27.gif 36.gif\ - 45.gif 54.gif 63.gif 72.gif 81.gif 90.gif 9.gif\ - 104.gif 113.gif 122.gif 131.gif 19.gif 28.gif 37.gif\ - 46.gif 55.gif 64.gif 73.gif 82.gif 91.gif\ - 105.gif 114.gif 123.gif 132.gif 1.gif 29.gif 38.gif\ - 47.gif 56.gif 65.gif 74.gif 83.gif 92.gif\ - 106.gif 115.gif 124.gif 133.gif 20.gif 2.gif 39.gif\ - 48.gif 57.gif 66.gif 75.gif 84.gif 93.gif\ - 107.gif 116.gif 125.gif 134.gif 21.gif 30.gif 3.gif\ - 49.gif 58.gif 67.gif 76.gif 85.gif 94.gif\ - 108.gif 117.gif 126.gif 13.gif 22.gif 31.gif 40.gif\ - 4.gif 59.gif 68.gif 77.gif 86.gif 95.gif - -EXTRA_DIST = $(faceimg_DATA) diff --git a/res/qqfaces/Makefile.in b/res/qqfaces/Makefile.in deleted file mode 100644 index 04fa4e44..00000000 --- a/res/qqfaces/Makefile.in +++ /dev/null @@ -1,446 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = icons/qqfaces -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(faceimgdir)" -DATA = $(faceimg_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ -GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBEV_CFLAGS = @LIBEV_CFLAGS@ -LIBEV_LIBS = @LIBEV_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ -SQLITE3_LIBS = @SQLITE3_LIBS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ZLIB_CFLAGS = @ZLIB_CFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -faceimgdir = ${pkgdatadir}/icons/qqfaces -faceimg_DATA = \ - 0.gif 109.gif 118.gif 127.gif 14.gif 23.gif 32.gif\ - 41.gif 50.gif 5.gif 69.gif 78.gif 87.gif 96.gif\ - 100.gif 10.gif 119.gif 128.gif 15.gif 24.gif 33.gif\ - 42.gif 51.gif 60.gif 6.gif 79.gif 88.gif 97.gif\ - 101.gif 110.gif 11.gif 129.gif 16.gif 25.gif 34.gif\ - 43.gif 52.gif 61.gif 70.gif 7.gif 89.gif 98.gif\ - 102.gif 111.gif 120.gif 12.gif 17.gif 26.gif 35.gif\ - 44.gif 53.gif 62.gif 71.gif 80.gif 8.gif 99.gif\ - 103.gif 112.gif 121.gif 130.gif 18.gif 27.gif 36.gif\ - 45.gif 54.gif 63.gif 72.gif 81.gif 90.gif 9.gif\ - 104.gif 113.gif 122.gif 131.gif 19.gif 28.gif 37.gif\ - 46.gif 55.gif 64.gif 73.gif 82.gif 91.gif\ - 105.gif 114.gif 123.gif 132.gif 1.gif 29.gif 38.gif\ - 47.gif 56.gif 65.gif 74.gif 83.gif 92.gif\ - 106.gif 115.gif 124.gif 133.gif 20.gif 2.gif 39.gif\ - 48.gif 57.gif 66.gif 75.gif 84.gif 93.gif\ - 107.gif 116.gif 125.gif 134.gif 21.gif 30.gif 3.gif\ - 49.gif 58.gif 67.gif 76.gif 85.gif 94.gif\ - 108.gif 117.gif 126.gif 13.gif 22.gif 31.gif 40.gif\ - 4.gif 59.gif 68.gif 77.gif 86.gif 95.gif - -EXTRA_DIST = $(faceimg_DATA) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu icons/qqfaces/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu icons/qqfaces/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-faceimgDATA: $(faceimg_DATA) - @$(NORMAL_INSTALL) - test -z "$(faceimgdir)" || $(MKDIR_P) "$(DESTDIR)$(faceimgdir)" - @list='$(faceimg_DATA)'; test -n "$(faceimgdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(faceimgdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(faceimgdir)" || exit $$?; \ - done - -uninstall-faceimgDATA: - @$(NORMAL_UNINSTALL) - @list='$(faceimg_DATA)'; test -n "$(faceimgdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(faceimgdir)'; $(am__uninstall_files_from_dir) -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(faceimgdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-faceimgDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-faceimgDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-faceimgDATA install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-faceimgDATA - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 698bda37..d22bf684 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,69 +1,37 @@ -AUX_SOURCE_DIRECTORY(. SRC_LIST) -AUX_SOURCE_DIRECTORY(../include/liblwqq LWQQ_LIST) -LIST(REMOVE_ITEM LWQQ_LIST ../include/liblwqq/http.c) -LIST(REMOVE_ITEM LWQQ_LIST ../include/liblwqq/http_curl.c) -LIST(REMOVE_ITEM LWQQ_LIST ../include/liblwqq/async.c) -LIST(REMOVE_ITEM SRC_LIST ./http.c) -LIST(REMOVE_ITEM SRC_LIST ./test.c) - -FIND_PACKAGE(PkgConfig REQUIRED) -PKG_CHECK_MODULES(PURPLE REQUIRED purple) -PKG_CHECK_MODULES(GLIB REQUIRED glib-2.0) -PKG_CHECK_MODULES(CURL REQUIRED libcurl) -ADD_LIBRARY (curldbg STATIC IMPORTED) -SET_PROPERTY (TARGET curldbg PROPERTY IMPORTED_LOCATION /home/xiehuc/PROJECT/pidgin-lwqq/lib/libcurl7.24.a ) -#ADD_EXECUTABLE(test -# test.c -# ../include/liblwqq/async.c -# ../include/liblwqq/http_curl.c -# ${LWQQ_LIST} -# ) -#TARGET_LINK_LIBRARIES(test -# ${CURL_LIBRARIES} -# ev -# ) - -ADD_LIBRARY(webqq MODULE - ${SRC_LIST} +set(SRC_LIST + async.c + background.c + trex.c + webqq.c + translate.c + http_curl.c + ) + +set(LWQQ_LIST + liblwqq/url.c + liblwqq/md5.c + liblwqq/unicode.c + liblwqq/logger.c + liblwqq/login.c + liblwqq/json.c + liblwqq/msg.c + liblwqq/type.c + liblwqq/smemory.c + liblwqq/info.c) + +ADD_LIBRARY(webqq MODULE + ${SRC_LIST} ${LWQQ_LIST} ) -INCLUDE_DIRECTORIES(webqq - ${PURPLE_INCLUDE_DIRS} - ${GLIB_INCLUDE_DIRS} - ../include/libghttp - ../include/liblwqq - ) -MESSAGE(state "${CURL_LIBRARIES}") -TARGET_LINK_LIBRARIES(webqq - ${PURPLE_LIBRARIES} - ${GLIB_LIBRARIES} - ${CURL_LIBRARIES} - ) - -MESSAGE(state "prefix" "${CMAKE_INSTALL_PREFIX}") -ADD_DEFINITIONS(-g -O0 -Wall ) -ADD_DEFINITIONS(-DINST_PREFIX="${CMAKE_INSTALL_PREFIX}") - -option(NLS "Native language support" OFF) -if(NLS) - find_package(Gettext) -endif(NLS) - -IF(NOT PURPLE_MAJOR_VERSION) - SET(PURPLE_MAJOR_VERSION "2") -ENDIF(NOT PURPLE_MAJOR_VERSION) - -EXEC_PROGRAM("whereis libpurple| sed -e 's/[^\\/]*//' -e 's/\\(.*\\)lib\\/libpurple\\.so.*/\\1/'" - OUTPUT_VARIABLE PURPLE_PREFIX) - -EXEC_PROGRAM("whereis pidgin | sed -e 's/[^\\/]*//' -e 's/\\(.*\\)bin\\/pidgin.*/\\1/'" - OUTPUT_VARIABLE PIDGIN_PREFIX) - -SET(PIDGIN_PIX_INSTALL_DIR "${PIDGIN_PREFIX}share/pixmaps/pidgin/protocols") -SET(LIB_INSTALL_DIR "${PURPLE_PREFIX}lib/purple-${PURPLE_MAJOR_VERSION}") - -INSTALL(DIRECTORY "../res/pidgin/" DESTINATION ${PIDGIN_PIX_INSTALL_DIR}) -INSTALL(DIRECTORY "../res/empathy/" DESTINATION "/usr/share/empathy/icons/hicolor") -INSTALL(DIRECTORY "../res/qqfaces/" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/lwqq/icons/qqfaces") -INSTALL(TARGETS webqq DESTINATION ${LIB_INSTALL_DIR}) - +include_directories( + ${PURPLE_INCLUDE_DIRS} + ${GLIB_INCLUDE_DIRS} + liblwqq) + +target_link_libraries(webqq + ${PURPLE_LIBRARIES} + ${GLIB_LIBRARIES} + ${CURL_LIBRARIES} + ) + +INSTALL(TARGETS webqq DESTINATION "${PURPLE_LIB_INSTALL_DIR}") diff --git a/include/liblwqq/async.c b/src/liblwqq/async.c similarity index 100% rename from include/liblwqq/async.c rename to src/liblwqq/async.c diff --git a/include/liblwqq/async.h b/src/liblwqq/async.h similarity index 100% rename from include/liblwqq/async.h rename to src/liblwqq/async.h diff --git a/include/liblwqq/http.c b/src/liblwqq/http.c similarity index 100% rename from include/liblwqq/http.c rename to src/liblwqq/http.c diff --git a/include/liblwqq/http.h b/src/liblwqq/http.h similarity index 100% rename from include/liblwqq/http.h rename to src/liblwqq/http.h diff --git a/include/liblwqq/http_curl.c b/src/liblwqq/http_curl.c similarity index 100% rename from include/liblwqq/http_curl.c rename to src/liblwqq/http_curl.c diff --git a/include/liblwqq/info.c b/src/liblwqq/info.c similarity index 100% rename from include/liblwqq/info.c rename to src/liblwqq/info.c diff --git a/include/liblwqq/info.h b/src/liblwqq/info.h similarity index 100% rename from include/liblwqq/info.h rename to src/liblwqq/info.h diff --git a/include/liblwqq/json.c b/src/liblwqq/json.c similarity index 100% rename from include/liblwqq/json.c rename to src/liblwqq/json.c diff --git a/include/liblwqq/json.h b/src/liblwqq/json.h similarity index 100% rename from include/liblwqq/json.h rename to src/liblwqq/json.h diff --git a/include/liblwqq/logger.c b/src/liblwqq/logger.c similarity index 100% rename from include/liblwqq/logger.c rename to src/liblwqq/logger.c diff --git a/include/liblwqq/logger.h b/src/liblwqq/logger.h similarity index 100% rename from include/liblwqq/logger.h rename to src/liblwqq/logger.h diff --git a/include/liblwqq/login.c b/src/liblwqq/login.c similarity index 100% rename from include/liblwqq/login.c rename to src/liblwqq/login.c diff --git a/include/liblwqq/login.h b/src/liblwqq/login.h similarity index 100% rename from include/liblwqq/login.h rename to src/liblwqq/login.h diff --git a/include/liblwqq/md5.c b/src/liblwqq/md5.c similarity index 100% rename from include/liblwqq/md5.c rename to src/liblwqq/md5.c diff --git a/include/liblwqq/md5.h b/src/liblwqq/md5.h similarity index 100% rename from include/liblwqq/md5.h rename to src/liblwqq/md5.h diff --git a/include/liblwqq/msg.c b/src/liblwqq/msg.c similarity index 100% rename from include/liblwqq/msg.c rename to src/liblwqq/msg.c diff --git a/include/liblwqq/msg.h b/src/liblwqq/msg.h similarity index 100% rename from include/liblwqq/msg.h rename to src/liblwqq/msg.h diff --git a/include/liblwqq/queue.h b/src/liblwqq/queue.h similarity index 100% rename from include/liblwqq/queue.h rename to src/liblwqq/queue.h diff --git a/include/liblwqq/smemory.c b/src/liblwqq/smemory.c similarity index 100% rename from include/liblwqq/smemory.c rename to src/liblwqq/smemory.c diff --git a/include/liblwqq/smemory.h b/src/liblwqq/smemory.h similarity index 100% rename from include/liblwqq/smemory.h rename to src/liblwqq/smemory.h diff --git a/include/liblwqq/type.c b/src/liblwqq/type.c similarity index 100% rename from include/liblwqq/type.c rename to src/liblwqq/type.c diff --git a/include/liblwqq/type.h b/src/liblwqq/type.h similarity index 100% rename from include/liblwqq/type.h rename to src/liblwqq/type.h diff --git a/include/liblwqq/unicode.c b/src/liblwqq/unicode.c similarity index 100% rename from include/liblwqq/unicode.c rename to src/liblwqq/unicode.c diff --git a/include/liblwqq/unicode.h b/src/liblwqq/unicode.h similarity index 100% rename from include/liblwqq/unicode.h rename to src/liblwqq/unicode.h diff --git a/include/liblwqq/url.c b/src/liblwqq/url.c similarity index 100% rename from include/liblwqq/url.c rename to src/liblwqq/url.c diff --git a/include/liblwqq/url.h b/src/liblwqq/url.h similarity index 100% rename from include/liblwqq/url.h rename to src/liblwqq/url.h