From 2f86fd33142670f2421ba33e2921b94458ea70f3 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Wed, 4 Apr 2018 13:42:21 -0700
Subject: [PATCH 01/14] add nginx source as submodule created sys crate to
 generate rust binding

---
 .gitignore                        |   1 -
 .gitmodules                       |   3 +
 Cargo.lock                        | 620 +++++-------------------
 Cargo.toml                        |   3 +-
 Makefile                          |   2 +
 {tools => docker}/README.md       |   0
 {tools => docker}/rust/Dockerfile |   0
 {tools => docker}/rust/Makefile   |   0
 {tools => docker}/rust/README.md  |   0
 nginx.mk                          |   1 -
 ngx-binding/Cargo.lock            | 756 ------------------------------
 ngx-binding/Cargo.toml            |   9 +-
 ngx-binding/src/lib.rs            |   1 -
 ngx-sys/Cargo.toml                |  15 +
 ngx-sys/Makefile                  |  27 ++
 {ngx-binding => ngx-sys}/build.rs |   8 +-
 ngx-sys/nginx                     |   1 +
 ngx-sys/src/lib.rs                |   0
 18 files changed, 178 insertions(+), 1269 deletions(-)
 create mode 100644 .gitmodules
 rename {tools => docker}/README.md (100%)
 rename {tools => docker}/rust/Dockerfile (100%)
 rename {tools => docker}/rust/Makefile (100%)
 rename {tools => docker}/rust/README.md (100%)
 delete mode 100644 ngx-binding/Cargo.lock
 create mode 100644 ngx-sys/Cargo.toml
 create mode 100644 ngx-sys/Makefile
 rename {ngx-binding => ngx-sys}/build.rs (90%)
 create mode 160000 ngx-sys/nginx
 create mode 100644 ngx-sys/src/lib.rs

diff --git a/.gitignore b/.gitignore
index fe91bc82..83fe80ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
 target
 .idea
 .vscode
-nginx
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..9d45d5b0
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "ngx-sys/nginx"]
+	path = ngx-sys/nginx
+	url = https://github.com/nginx/nginx.git
diff --git a/Cargo.lock b/Cargo.lock
index d6c5d0f5..3a241750 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,107 +1,60 @@
-[root]
-name = "ngx-rust"
-version = "0.1.2"
-dependencies = [
- "bindgen 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "hyper 0.11.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "aho-corasick"
-version = "0.6.3"
+version = "0.6.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "ansi_term"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "aster"
-version = "0.41.0"
+version = "0.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "atty"
-version = "0.2.3"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "base64"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "bindgen"
-version = "0.30.0"
+version = "0.35.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cexpr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "bitflags"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "bitflags"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "bitflags"
-version = "0.9.1"
+version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "byteorder"
-version = "1.1.0"
+name = "cc"
+version = "1.0.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "bytes"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "cexpr"
-version = "0.2.2"
+version = "0.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -114,24 +67,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "clang-sys"
-version = "0.19.0"
+version = "0.22.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "libloading 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "clap"
-version = "2.27.1"
+version = "2.31.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -139,41 +91,14 @@ dependencies = [
 
 [[package]]
 name = "env_logger"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "fuchsia-zircon"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "fuchsia-zircon-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "futures"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "futures-cpupool"
-version = "0.1.7"
+version = "0.5.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -182,141 +107,65 @@ version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "httparse"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "hyper"
-version = "0.11.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "relay 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "iovec"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "kernel32-sys"
-version = "0.2.2"
+name = "humantime"
+version = "1.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "language-tags"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "lazy_static"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "lazycell"
-version = "0.5.1"
+version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libc"
-version = "0.2.33"
+version = "0.2.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libloading"
-version = "0.4.2"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "log"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "memchr"
-version = "1.0.2"
+version = "0.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "mime"
-version = "0.3.5"
+name = "memchr"
+version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "mio"
-version = "0.6.11"
+name = "memchr"
+version = "2.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "miow"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
+name = "ngx-rust"
+version = "0.2.0"
 
 [[package]]
-name = "net2"
-version = "0.2.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+name = "ngx-sys"
+version = "0.2.0"
 dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -327,56 +176,24 @@ dependencies = [
  "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "num_cpus"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "peeking_take_while"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "percent-encoding"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "quasi"
-version = "0.32.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "quasi_codegen"
-version = "0.32.0"
+name = "quick-error"
+version = "1.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
 
 [[package]]
-name = "rand"
-version = "0.3.18"
+name = "quote"
+version = "0.3.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
-]
 
 [[package]]
 name = "redox_syscall"
-version = "0.1.31"
+version = "0.1.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -384,123 +201,40 @@ name = "redox_termios"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "regex"
-version = "0.2.2"
+version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "regex-syntax"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "relay"
-version = "0.1.0"
+version = "0.5.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "rustc-serialize"
-version = "0.3.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "safemem"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "scoped-tls"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "slab"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "slab"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "smallvec"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "strsim"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "syntex"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syntex_errors"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syntex_pos"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syntex_syntax"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "take"
-version = "0.1.0"
+version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "term"
-version = "0.4.6"
+name = "termcolor"
+version = "0.3.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -508,8 +242,8 @@ name = "termion"
 version = "1.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -523,92 +257,23 @@ dependencies = [
 
 [[package]]
 name = "thread_local"
-version = "0.3.4"
+version = "0.3.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "time"
-version = "0.1.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-core"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-io"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-proto"
+name = "ucd-util"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-service"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "unicase"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
 
 [[package]]
 name = "unicode-width"
 version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "unicode-xid"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "unreachable"
 version = "1.0.0"
@@ -627,11 +292,6 @@ name = "vec_map"
 version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "version_check"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "void"
 version = "1.0.2"
@@ -639,110 +299,80 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "which"
-version = "1.0.3"
+version = "1.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "winapi"
-version = "0.2.8"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "winapi-build"
-version = "0.1.1"
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "ws2_32-sys"
-version = "0.2.1"
+name = "wincolor"
+version = "0.1.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [metadata]
-"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699"
-"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
-"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0"
-"checksum atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"
-"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
-"checksum bindgen 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33024f55a754d920637461adf87fb485702a69bdf7ac1d307b7e18da93bae505"
-"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
-"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4"
-"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
-"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
-"checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6"
-"checksum cexpr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cdbb21df6ff3497a61df5059994297f746267020ba38ce237aad9c875f7b4313"
+"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
+"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
+"checksum atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "af80143d6f7608d746df1520709e5d141c96f240b0e62b0aa41bdfb53374d9d4"
+"checksum bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b023955126e7909ab9fc1d1973965b8b004f1f388afb5c589640ab483b3b0ad2"
+"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
+"checksum cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2b4911e4bdcb4100c7680e7e854ff38e23f1b34d4d9e079efae3da2801341ffc"
+"checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c"
 "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
-"checksum clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "611ec2e3a7623afd8a8c0d027887b6b55759d894abbf5fe11b9dc11b50d5b49a"
-"checksum clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b8c532887f1a292d17de05ae858a8fe50a301e196f9ef0ddb7ccd0d1d00f180"
-"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
-"checksum fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159"
-"checksum fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82"
-"checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1"
-"checksum futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e86f49cc0d92fe1b97a5980ec32d56208272cbb00f15044ea9e2799dde766fdf"
+"checksum clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "939a1a34310b120d26eba35c29475933128b0ec58e24b43327f8dbe6036fc538"
+"checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536"
+"checksum env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0561146661ae44c579e993456bc76d11ce1e0c7d745e57b2fa7146b6e49fa2ad"
 "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
-"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07"
-"checksum hyper 0.11.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4959ca95f55df4265bff2ad63066147255e6fa733682cf6d1cb5eaff6e53324b"
-"checksum iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e8b9c2247fcf6c6a1151f1156932be5606c9fd6f55a2d7f9fc1cb29386b2f7"
-"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
-"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
-"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
-"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b"
-"checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2"
-"checksum libloading 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3f92926a9a4ba7aeeb01f5fba3f0d577147243b6e7fa8261c219cd1d6fbe3b1c"
-"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"
+"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
+"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
+"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b"
+"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"
+"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
 "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
-"checksum mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e00e17be181010a91dbfefb01660b17311059dc8c7f48b9017677721e732bd"
-"checksum mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0e8411968194c7b139e9105bc4ae7db0bae232af087147e72f0616ebf5fdb9cb"
-"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
-"checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09"
+"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
 "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
-"checksum num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "514f0d73e64be53ff320680ca671b64fe3fb91da01e1ae2ddc99eb51d453b20d"
 "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
-"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
-"checksum quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c45c4854d6d1cf5d531db97c75880feb91c958b0720f4ec1057135fec358b3"
-"checksum quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9e25fa23c044c1803f43ca59c98dac608976dd04ce799411edd58ece776d4"
-"checksum rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd"
-"checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509"
+"checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
+"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
+"checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd"
 "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
-"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
-"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
-"checksum relay 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f301bafeb60867c85170031bdb2fcf24c8041f33aee09e7b116a58d4e9f781c5"
-"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
-"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
-"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
-"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
-"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d"
-"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013"
-"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
-"checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e"
-"checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"
-"checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"
-"checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"
-"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5"
-"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
+"checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb"
+"checksum regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2550876c31dc914696a6c2e01cbce8afba79a93c8ae979d2fe051c0230b3756"
+"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
+"checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
 "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
 "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
-"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
-"checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"
-"checksum tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c843a027f7c1df5f81e7734a0df3f67bf329411781ebf36393ce67beef6071e3"
-"checksum tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "514aae203178929dbf03318ad7c683126672d4d96eccb77b29603d33c9e25743"
-"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389"
-"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
-"checksum unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284b6d3db520d67fbe88fd778c21510d1b0ba4a551e5d0fbb023d33405f6de8a"
+"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
+"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
 "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
-"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
 "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
 "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
 "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
-"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d"
 "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
-"checksum which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4be6cfa54dab45266e98b5d7be2f8ce959ddd49abd141a05d52dce4b07f803bb"
-"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
-"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
+"checksum which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2"
+"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3"
+"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+"checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767"
diff --git a/Cargo.toml b/Cargo.toml
index 1124e3ad..31a0892f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,4 +1,5 @@
 [workspace]
 members = [
-    "ngx-binding"
+    "ngx-binding",
+    "ngx-sys"
 ]
diff --git a/Makefile b/Makefile
index 47f489ac..5ad12323 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+NGINX_VER = 1.13.11
+
 clean:
 	cargo clean
 	make -C ngx-binding clean
diff --git a/tools/README.md b/docker/README.md
similarity index 100%
rename from tools/README.md
rename to docker/README.md
diff --git a/tools/rust/Dockerfile b/docker/rust/Dockerfile
similarity index 100%
rename from tools/rust/Dockerfile
rename to docker/rust/Dockerfile
diff --git a/tools/rust/Makefile b/docker/rust/Makefile
similarity index 100%
rename from tools/rust/Makefile
rename to docker/rust/Makefile
diff --git a/tools/rust/README.md b/docker/rust/README.md
similarity index 100%
rename from tools/rust/README.md
rename to docker/rust/README.md
diff --git a/nginx.mk b/nginx.mk
index f8f5d327..b15186a8 100644
--- a/nginx.mk
+++ b/nginx.mk
@@ -1,4 +1,3 @@
-NGINX_VER = 1.13.7
 UNAME_S := $(shell uname -s)
 NGX_MODULES = --with-compat  --with-threads --with-http_addition_module \
      --with-http_auth_request_module   --with-http_gunzip_module --with-http_gzip_static_module  \
diff --git a/ngx-binding/Cargo.lock b/ngx-binding/Cargo.lock
deleted file mode 100644
index 2c5358a8..00000000
--- a/ngx-binding/Cargo.lock
+++ /dev/null
@@ -1,756 +0,0 @@
-[root]
-name = "ngx-rust"
-version = "0.1.2"
-dependencies = [
- "bindgen 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "aho-corasick"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "ansi_term"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "aster"
-version = "0.41.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "atty"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "base64"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bindgen"
-version = "0.30.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cexpr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "which 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bitflags"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "bitflags"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "bitflags"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "byteorder"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "bytes"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cexpr"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "nom 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cfg-if"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "clang-sys"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "libloading 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "clap"
-version = "2.26.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "conv"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "custom_derive"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "env_logger"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "futures"
-version = "0.1.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "futures-cpupool"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "glob"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "httparse"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "hyper"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mime 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "iovec"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "kernel32-sys"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "language-tags"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "lazy_static"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "lazycell"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "libc"
-version = "0.2.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "libloading"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "log"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "magenta"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "magenta-sys"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "memchr"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "mime"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "mio"
-version = "0.6.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "miow"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "net2"
-version = "0.2.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "nom"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "peeking_take_while"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "percent-encoding"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "quasi"
-version = "0.32.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "quasi_codegen"
-version = "0.32.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "regex"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rustc-serialize"
-version = "0.3.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rustc_version"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "safemem"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "scoped-tls"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "semver"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "slab"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "smallvec"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "strsim"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "syntex"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syntex_errors"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syntex_pos"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syntex_syntax"
-version = "0.58.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "take"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "term"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "term_size"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "thread_local"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "time"
-version = "0.1.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-core"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-io"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-proto"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-service"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "unicase"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "unicode-segmentation"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "unicode-width"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "unicode-xid"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "unreachable"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "utf8-ranges"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "vec_map"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "void"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "which"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "winapi"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "winapi-build"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "ws2_32-sys"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[metadata]
-"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699"
-"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
-"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0"
-"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159"
-"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
-"checksum bindgen 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33024f55a754d920637461adf87fb485702a69bdf7ac1d307b7e18da93bae505"
-"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
-"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4"
-"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
-"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
-"checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6"
-"checksum cexpr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cdbb21df6ff3497a61df5059994297f746267020ba38ce237aad9c875f7b4313"
-"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
-"checksum clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "611ec2e3a7623afd8a8c0d027887b6b55759d894abbf5fe11b9dc11b50d5b49a"
-"checksum clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2267a8fdd4dce6956ba6649e130f62fb279026e5e84b92aa939ac8f85ce3f9f0"
-"checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299"
-"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"
-"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
-"checksum futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a82bdc62350ca9d7974c760e9665102fc9d740992a528c2254aa930e53b783c4"
-"checksum futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a283c84501e92cade5ea673a2a7ca44f71f209ccdd302a3e0896f50083d2c5ff"
-"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
-"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07"
-"checksum hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "641abc3e3fcf0de41165595f801376e01106bca1fd876dda937730e477ca004c"
-"checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be"
-"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
-"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
-"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf"
-"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b"
-"checksum libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "2370ca07ec338939e356443dac2296f581453c35fe1e3a3ed06023c49435f915"
-"checksum libloading 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6b699b2cb9154b7a5c7b8c40fd200bd077791b292556a44ddae07482192123c6"
-"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"
-"checksum magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527"
-"checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699"
-"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
-"checksum mime 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "153f98dde2b135dece079e5478ee400ae1bab13afa52d66590eacfc40e912435"
-"checksum mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "dbd91d3bfbceb13897065e97b2ef177a09a438cb33612b2d371bf568819a9313"
-"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
-"checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09"
-"checksum nom 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06989cbd367e06f787a451f3bc67d8c3e0eaa10b461cc01152ffab24261a31b1"
-"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584"
-"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
-"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356"
-"checksum quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c45c4854d6d1cf5d531db97c75880feb91c958b0720f4ec1057135fec358b3"
-"checksum quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9e25fa23c044c1803f43ca59c98dac608976dd04ce799411edd58ece776d4"
-"checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf"
-"checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509"
-"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
-"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
-"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
-"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
-"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
-"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
-"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
-"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
-"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013"
-"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
-"checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e"
-"checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"
-"checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"
-"checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"
-"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5"
-"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
-"checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209"
-"checksum textwrap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f728584ea33b0ad19318e20557cb0a39097751dbb07171419673502f848c7af6"
-"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
-"checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"
-"checksum tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e85d419699ec4b71bfe35bbc25bb8771e52eff0471a7f75c853ad06e200b4f86"
-"checksum tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ab83e7adb5677e42e405fa4ceff75659d93c4d7d7dd22f52fcec59ee9f02af"
-"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389"
-"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
-"checksum unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e01da42520092d0cd2d6ac3ae69eb21a22ad43ff195676b86f8c37f487d6b80"
-"checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946"
-"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
-"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
-"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
-"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
-"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
-"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
-"checksum which 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d238435618c0f298d2d75596c2d4fa7d4ea469c0c1c3ff824737ed50ad5ab61c"
-"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
-"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
diff --git a/ngx-binding/Cargo.toml b/ngx-binding/Cargo.toml
index 8c3d06b6..b0cf033e 100644
--- a/ngx-binding/Cargo.toml
+++ b/ngx-binding/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "ngx-rust"
-version = "0.1.2"
+version = "0.2.0"
 authors = ["Sehyo Chang   sehyo@nginx.com"]
 
 [lib]
@@ -9,12 +9,5 @@ test = true
 crate-type = ["staticlib","rlib"]
 
 
-[dev-dependencies]
-futures = "0.1.14"
-hyper = "0.11.2"
-tokio-core = "0.1.9"
-
-[build-dependencies]
-bindgen = "0.30.0"
 
 
diff --git a/ngx-binding/src/lib.rs b/ngx-binding/src/lib.rs
index b9e76f55..25667b4f 100644
--- a/ngx-binding/src/lib.rs
+++ b/ngx-binding/src/lib.rs
@@ -1,6 +1,5 @@
 
 
-pub mod bindings;
 pub mod nginx_http;
 pub mod nginx;
 
diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
new file mode 100644
index 00000000..6a0943db
--- /dev/null
+++ b/ngx-sys/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+name = "ngx-sys"
+version = "0.2.0"
+authors = ["Sehyo Chang   sehyo@nginx.com"]
+
+[lib]
+doctest = false
+test = true
+crate-type = ["staticlib","rlib"]
+
+
+[build-dependencies]
+bindgen = "0.35.0"
+
+
diff --git a/ngx-sys/Makefile b/ngx-sys/Makefile
new file mode 100644
index 00000000..d360be3b
--- /dev/null
+++ b/ngx-sys/Makefile
@@ -0,0 +1,27 @@
+NGINX_VER = 1.13.11
+
+UNAME_S := $(shell uname -s)
+NGX_MODULES = --with-compat  --with-threads --with-http_addition_module \
+     --with-http_auth_request_module   --with-http_gunzip_module --with-http_gzip_static_module  \
+     --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module \
+     --with-http_slice_module  --with-http_stub_status_module --with-http_sub_module \
+     --with-stream --with-stream_realip_module --with-stream_ssl_preread_module
+
+ifeq ($(UNAME_S),Linux)
+    NGINX_SRC = nginx-linux
+    NGX_OPT= $(NGX_MODULES) \
+       --with-file-aio --with-http_ssl_module --with-stream_ssl_module  \
+       --with-cc-opt='-g -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \
+       --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
+endif
+ifeq ($(UNAME_S),Darwin)
+    NGINX_SRC = nginx-darwin
+    NGX_OPT= $(NGX_MODULES)
+endif
+
+NGX_DEBUG="--with-debug"
+
+configure:
+	echo "using opt: $(NGX_OPT)"
+	cd nginx; bash auto/configure $(NGX_OPT)
+
diff --git a/ngx-binding/build.rs b/ngx-sys/build.rs
similarity index 90%
rename from ngx-binding/build.rs
rename to ngx-sys/build.rs
index db19f7ff..083137be 100644
--- a/ngx-binding/build.rs
+++ b/ngx-sys/build.rs
@@ -5,11 +5,7 @@ use std::process::Output;
 use std::env;
 use std::io::Result;
 
-#[cfg(target_os = "macos")]
-const NGIX_DIR: &str  = "./nginx/nginx-darwin";
-
-#[cfg(target_os = "linux")]
-const NGIX_DIR: &str  = "./nginx/nginx-linux";
+const NGIX_DIR: &str  = "./nginx/";
 
 // perform make with argument
 fn make(arg: &str) -> Result<Output> {
@@ -37,7 +33,7 @@ fn make(arg: &str) -> Result<Output> {
 
 
 fn configure() -> Result<Output> {
-    make("nginx-setup")
+    make("configure")
 }
 
 
diff --git a/ngx-sys/nginx b/ngx-sys/nginx
new file mode 160000
index 00000000..d627eeef
--- /dev/null
+++ b/ngx-sys/nginx
@@ -0,0 +1 @@
+Subproject commit d627eeefe58d517fae67c6ca94d7bdf1adfc7af0
diff --git a/ngx-sys/src/lib.rs b/ngx-sys/src/lib.rs
new file mode 100644
index 00000000..e69de29b

From ab754fc289b24591d05dc4a29f23d4cd26206bc5 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Wed, 4 Apr 2018 16:11:24 -0700
Subject: [PATCH 02/14] add rest of NGINX module options

---
 ngx-sys/Cargo.toml                 |  29 +++++++++
 ngx-sys/build.rs                   | 100 ++++++++++++++++++++++++++---
 ngx-sys/src/.gitignore             |   1 +
 {ngx-binding => ngx-sys}/wrapper.h |   0
 4 files changed, 121 insertions(+), 9 deletions(-)
 create mode 100644 ngx-sys/src/.gitignore
 rename {ngx-binding => ngx-sys}/wrapper.h (100%)

diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
index 6a0943db..f082d5d2 100644
--- a/ngx-sys/Cargo.toml
+++ b/ngx-sys/Cargo.toml
@@ -8,6 +8,35 @@ doctest = false
 test = true
 crate-type = ["staticlib","rlib"]
 
+[features]
+default = ["with-compat","with-threads","with-http_addition_module","with-http_auth_request_module",
+"with-http_gunzip_module","with-http_gzip_static_module","with-http_random_index_module",
+"with-http_realip_module","with-http_secure_link_module","with-http_slice_module",
+"with-http_stub_status_module","with-http_sub_module","with-stream","with-stream_realip_module",
+"with-stream_ssl_preread_module","with-file-aio","with-http_ssl_module","with-stream_ssl_module"
+]
+
+with-compat=[]
+with-threads=[]
+with-http_addition_module=[]
+with-http_auth_request_module=[]
+with-http_gunzip_module=[]
+with-http_gzip_static_module=[]
+with-http_random_index_module=[]
+with-http_realip_module=[]
+with-http_secure_link_module=[]
+with-http_slice_module=[]
+with-http_stub_status_module=[]
+with-http_sub_module=[]
+with-stream=[]
+with-stream_realip_module=[]
+with-stream_ssl_preread_module=[]
+with-file-aio=[]
+with-http_ssl_module=[]
+with-stream_ssl_module=[]
+
+
+
 
 [build-dependencies]
 bindgen = "0.35.0"
diff --git a/ngx-sys/build.rs b/ngx-sys/build.rs
index 083137be..18944e09 100644
--- a/ngx-sys/build.rs
+++ b/ngx-sys/build.rs
@@ -4,16 +4,100 @@ use std::process::Command;
 use std::process::Output;
 use std::env;
 use std::io::Result;
+use std::vec::Vec;
 
 const NGIX_DIR: &str  = "./nginx/";
 
-// perform make with argument
-fn make(arg: &str) -> Result<Output> {
+// return all nginx features
+fn ngix_features() -> Vec<&'static str> {
+    let mut features: Vec<&'static str> = Vec::new();
+    if cfg!(feature = "with-compat") {
+        features.push("--with-compat");
+    }
+    if cfg!(feature = "with-threads") {
+        features.push("--with-threads");
+    }
+    if cfg!(feature = "with-http_addition_module") {
+        features.push("--with-http_addition_module");
+    }      
+    if cfg!(feature = "with-http_auth_request_module") {
+        features.push("--with-http_auth_request_module");
+    }
+    if cfg!(feature = "with-http_gunzip_module") {
+        features.push("--with-http_gunzip_module");
+    }
+    if cfg!(feature = "with-http_auth_request_module") {
+        features.push("--with-http_auth_request_module");
+    }
+    if cfg!(feature = "with-http_gzip_static_module") {
+        features.push("--with-http_gzip_static_module");
+    }
+    if cfg!(feature = "with-http_random_index_module") {
+        features.push("--with-http_random_index_module");
+    }
+    if cfg!(feature = "with-http_realip_module") {
+        features.push("--with-http_realip_module");
+    }  
+    if cfg!(feature = "with-http_secure_link_module") {
+        features.push("--with-http_secure_link_module");
+    }    
+    if cfg!(feature = "with-http_slice_module") {
+        features.push("--with-http_slice_module");
+    }
+    if cfg!(feature = "with-http_stub_status_module") {
+        features.push("--with-http_stub_status_module");
+    } 
+    if cfg!(feature = "with-http_sub_module") {
+        features.push("--with-http_sub_module");
+    }  
+    if cfg!(feature = "with-stream") {
+        features.push("--with-stream");
+    }  
+    if cfg!(feature = "with-stream_realip_module") {
+        features.push("--with-stream_realip_module");
+    }
+    if cfg!(feature = "with-stream_ssl_preread_module") {
+        features.push("--with-stream_ssl_preread_module");
+    }  
+    
+    if cfg!(all(feature = "with-file-aio", target_os="linux")) {
+        features.push("--with-file-aio");
+    }
+    if cfg!(all(feature = "with-file-aio", target_os="linux"))  {
+        features.push("--with-http_ssl_module");
+    }
+    if cfg!(all(feature = "with-file-aio", target_os="linux"))  {
+        features.push("--with-stream_ssl_module");
+    } 
+
+
+    if cfg!(target_os="linux")  {
+        features.push("--with-cc-opt='-g -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC'");
+        features.push("--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'");
+    } 
+    
+
+    println!("configuring nginx: {:?}",features);
+
+    features
+    
+}
+
+fn configure() -> Result<Output> {
     let current_path = env::current_dir().unwrap();
-    let path_name = format!("{}",current_path.display());
+    let path_name = format!("{}/nginx",current_path.display());
     println!("executing make command at {}",path_name);
-    let result =  Command::new("/usr/bin/make")
-        .args(&[arg])
+    let mut args: Vec<&str> = Vec::new();
+    args.push("auto/configure");
+    
+    let features = ngix_features();
+    
+    for feature in features {
+        args.push(&feature)
+    }
+        
+    let result =  Command::new("bash")
+        .args(&args)
         .current_dir(path_name)
         .output();
 
@@ -29,13 +113,11 @@ fn make(arg: &str) -> Result<Output> {
             return Ok(output);
         }
     }
+    
+    
 }
 
 
-fn configure() -> Result<Output> {
-    make("configure")
-}
-
 
 
 
diff --git a/ngx-sys/src/.gitignore b/ngx-sys/src/.gitignore
new file mode 100644
index 00000000..55300bdb
--- /dev/null
+++ b/ngx-sys/src/.gitignore
@@ -0,0 +1 @@
+bindings.rs
diff --git a/ngx-binding/wrapper.h b/ngx-sys/wrapper.h
similarity index 100%
rename from ngx-binding/wrapper.h
rename to ngx-sys/wrapper.h

From 372c4b8657f744ee3b1f52f82aad0a9068f5d9da Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Wed, 4 Apr 2018 16:33:07 -0700
Subject: [PATCH 03/14] ensure formatted bindings are generated

---
 README.md        |  2 ++
 ngx-sys/Makefile | 29 ++++-------------------------
 ngx-sys/build.rs |  5 +++--
 3 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/README.md b/README.md
index cd2a2ec3..a6014b00 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,8 @@ Next, add this to your crate:
 extern crate ngx-rust;
 ```
 
+## to ensure bindings are formatted, run following cmd
+```rustup component add rustfmt-preview```
 
 ## Limitation
 
diff --git a/ngx-sys/Makefile b/ngx-sys/Makefile
index d360be3b..86483855 100644
--- a/ngx-sys/Makefile
+++ b/ngx-sys/Makefile
@@ -1,27 +1,6 @@
 NGINX_VER = 1.13.11
 
-UNAME_S := $(shell uname -s)
-NGX_MODULES = --with-compat  --with-threads --with-http_addition_module \
-     --with-http_auth_request_module   --with-http_gunzip_module --with-http_gzip_static_module  \
-     --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module \
-     --with-http_slice_module  --with-http_stub_status_module --with-http_sub_module \
-     --with-stream --with-stream_realip_module --with-stream_ssl_preread_module
-
-ifeq ($(UNAME_S),Linux)
-    NGINX_SRC = nginx-linux
-    NGX_OPT= $(NGX_MODULES) \
-       --with-file-aio --with-http_ssl_module --with-stream_ssl_module  \
-       --with-cc-opt='-g -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \
-       --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
-endif
-ifeq ($(UNAME_S),Darwin)
-    NGINX_SRC = nginx-darwin
-    NGX_OPT= $(NGX_MODULES)
-endif
-
-NGX_DEBUG="--with-debug"
-
-configure:
-	echo "using opt: $(NGX_OPT)"
-	cd nginx; bash auto/configure $(NGX_OPT)
-
+clean:
+	cargo clean
+	rm -f src/bindings.rs
+	cd nginx;make clean
diff --git a/ngx-sys/build.rs b/ngx-sys/build.rs
index 18944e09..051d5042 100644
--- a/ngx-sys/build.rs
+++ b/ngx-sys/build.rs
@@ -122,11 +122,12 @@ fn configure() -> Result<Output> {
 
 
 fn generate_binding() {
-    let bindings = bindgen::Builder::default()
+    let builder = bindgen::Builder::default()
     // The input header we would like to generate
     // bindings for.
     .header("wrapper.h")
     .layout_tests(false)
+    .rustfmt_bindings(true)
     .clang_arg(format!("-I{}/src/core",NGIX_DIR))
     .clang_arg(format!("-I{}/src/event",NGIX_DIR))
     .clang_arg(format!("-I{}/src/event/modules",NGIX_DIR))
@@ -139,7 +140,7 @@ fn generate_binding() {
     // Unwrap the Result and panic on failure.
     .expect("Unable to generate bindings");
 
-    bindings
+    builder
     .write_to_file("src/bindings.rs")
     .expect("Couldn't write bindings!");
 }

From 29d31c6c8703dc5aa9d58386c3716da41c1f10f6 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 6 Apr 2018 12:06:24 -0700
Subject: [PATCH 04/14] remove nginx modules

---
 .gitmodules            |  3 ---
 Cargo.lock             |  3 +++
 Cargo.toml             |  2 +-
 ngx-binding/Cargo.toml | 28 ++++++++++++++++++++++++++++
 ngx-binding/src/lib.rs |  6 +++---
 ngx-sys/Cargo.toml     |  2 --
 ngx-sys/nginx          |  1 -
 ngx-sys/src/lib.rs     |  1 +
 8 files changed, 36 insertions(+), 10 deletions(-)
 delete mode 160000 ngx-sys/nginx

diff --git a/.gitmodules b/.gitmodules
index 9d45d5b0..e69de29b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "ngx-sys/nginx"]
-	path = ngx-sys/nginx
-	url = https://github.com/nginx/nginx.git
diff --git a/Cargo.lock b/Cargo.lock
index 3a241750..356f2001 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -160,6 +160,9 @@ dependencies = [
 [[package]]
 name = "ngx-rust"
 version = "0.2.0"
+dependencies = [
+ "ngx-sys 0.2.0",
+]
 
 [[package]]
 name = "ngx-sys"
diff --git a/Cargo.toml b/Cargo.toml
index 31a0892f..36ee63a0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
 [workspace]
 members = [
     "ngx-binding",
-    "ngx-sys"
+    "ngx-module"
 ]
diff --git a/ngx-binding/Cargo.toml b/ngx-binding/Cargo.toml
index b0cf033e..f3c495d8 100644
--- a/ngx-binding/Cargo.toml
+++ b/ngx-binding/Cargo.toml
@@ -8,6 +8,34 @@ doctest = false
 test = true
 crate-type = ["staticlib","rlib"]
 
+[features]
+default = ["with-compat","with-threads","with-http_addition_module","with-http_auth_request_module",
+"with-http_gunzip_module","with-http_gzip_static_module","with-http_random_index_module",
+"with-http_realip_module","with-http_secure_link_module","with-http_slice_module",
+"with-http_stub_status_module","with-http_sub_module","with-stream","with-stream_realip_module",
+"with-stream_ssl_preread_module","with-file-aio","with-http_ssl_module","with-stream_ssl_module"
+]
 
+with-compat=[]
+with-threads=[]
+with-http_addition_module=[]
+with-http_auth_request_module=[]
+with-http_gunzip_module=[]
+with-http_gzip_static_module=[]
+with-http_random_index_module=[]
+with-http_realip_module=[]
+with-http_secure_link_module=[]
+with-http_slice_module=[]
+with-http_stub_status_module=[]
+with-http_sub_module=[]
+with-stream=[]
+with-stream_realip_module=[]
+with-stream_ssl_preread_module=[]
+with-file-aio=[]
+with-http_ssl_module=[]
+with-stream_ssl_module=[]
 
 
+[build-dependencies]
+bindgen = "0.35.0"
+
diff --git a/ngx-binding/src/lib.rs b/ngx-binding/src/lib.rs
index 25667b4f..53208422 100644
--- a/ngx-binding/src/lib.rs
+++ b/ngx-binding/src/lib.rs
@@ -1,7 +1,7 @@
-
+extern crate ngx_sys;
 
 pub mod nginx_http;
 pub mod nginx;
+pub mod log;
 
-
-pub mod log;
\ No newline at end of file
+pub use ngx_sys::bindings;
\ No newline at end of file
diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
index f082d5d2..ce0369dc 100644
--- a/ngx-sys/Cargo.toml
+++ b/ngx-sys/Cargo.toml
@@ -38,7 +38,5 @@ with-stream_ssl_module=[]
 
 
 
-[build-dependencies]
-bindgen = "0.35.0"
 
 
diff --git a/ngx-sys/nginx b/ngx-sys/nginx
deleted file mode 160000
index d627eeef..00000000
--- a/ngx-sys/nginx
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit d627eeefe58d517fae67c6ca94d7bdf1adfc7af0
diff --git a/ngx-sys/src/lib.rs b/ngx-sys/src/lib.rs
index e69de29b..44946577 100644
--- a/ngx-sys/src/lib.rs
+++ b/ngx-sys/src/lib.rs
@@ -0,0 +1 @@
+pub mod bindings;
\ No newline at end of file

From 1fc3360c39705a838b97a8f94c3b0e22f7263238 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 6 Apr 2018 12:20:36 -0700
Subject: [PATCH 05/14] remove ngx-sys since ngix generated code to be in the
 same crate due to trait issue ngx-module crate will be added for higher level
 stuff

---
 .gitmodules                        |  3 ++
 Cargo.lock                         |  7 -----
 Cargo.toml                         |  3 +-
 docker/nginx/Dockerfile            | 17 +++++++++++
 docker/nginx/Makefile              | 13 +++++++++
 docker/nginx/README.md             |  5 ++++
 ngx-binding/.gitignore             |  1 -
 ngx-binding/Makefile               | 47 ++----------------------------
 {ngx-sys => ngx-binding}/build.rs  |  0
 ngx-binding/nginx                  |  1 +
 ngx-binding/src/.gitignore         | 10 -------
 ngx-binding/src/lib.rs             |  5 +---
 {ngx-sys => ngx-binding}/wrapper.h |  0
 ngx-sys/Cargo.toml                 | 40 +------------------------
 ngx-sys/Makefile                   |  6 ----
 ngx-sys/src/lib.rs                 |  1 -
 16 files changed, 45 insertions(+), 114 deletions(-)
 create mode 100644 docker/nginx/Dockerfile
 create mode 100644 docker/nginx/Makefile
 create mode 100644 docker/nginx/README.md
 rename {ngx-sys => ngx-binding}/build.rs (100%)
 create mode 160000 ngx-binding/nginx
 rename {ngx-sys => ngx-binding}/wrapper.h (100%)
 delete mode 100644 ngx-sys/Makefile

diff --git a/.gitmodules b/.gitmodules
index e69de29b..1039f319 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "ngx-binding/nginx"]
+	path = ngx-binding/nginx
+	url = https://github.com/nginx/nginx.git
diff --git a/Cargo.lock b/Cargo.lock
index 356f2001..de71ac66 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -160,13 +160,6 @@ dependencies = [
 [[package]]
 name = "ngx-rust"
 version = "0.2.0"
-dependencies = [
- "ngx-sys 0.2.0",
-]
-
-[[package]]
-name = "ngx-sys"
-version = "0.2.0"
 dependencies = [
  "bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
diff --git a/Cargo.toml b/Cargo.toml
index 36ee63a0..1124e3ad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,4 @@
 [workspace]
 members = [
-    "ngx-binding",
-    "ngx-module"
+    "ngx-binding"
 ]
diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile
new file mode 100644
index 00000000..ba634264
--- /dev/null
+++ b/docker/nginx/Dockerfile
@@ -0,0 +1,17 @@
+ARG NGINX_VER
+FROM nginx:$NGINX_VER
+
+MAINTAINER Sehyo Chang "sehyo@nginx.com"
+
+
+# install nginx required libraries
+
+RUN apt-get update
+
+# install dev en
+RUN apt-get install curl wget unzip gnupg vim netcat make net-tools iptables procps -y
+
+RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
+    apt-get install -y nodejs
+
+RUN apt-get install -y iproute2
diff --git a/docker/nginx/Makefile b/docker/nginx/Makefile
new file mode 100644
index 00000000..ac5ee5c6
--- /dev/null
+++ b/docker/nginx/Makefile
@@ -0,0 +1,13 @@
+
+TAG = 1.13.10
+NAME = nginmesh/nginx-dev
+
+
+all:    build push
+
+build:
+	docker build -t $(NAME):$(TAG) --build-arg NGINX_VER=${TAG} .
+
+push:
+	docker push $(NAME):$(TAG)
+
diff --git a/docker/nginx/README.md b/docker/nginx/README.md
new file mode 100644
index 00000000..76f02317
--- /dev/null
+++ b/docker/nginx/README.md
@@ -0,0 +1,5 @@
+# Docker image to test Nginx rust module.
+
+It contains rust tools chain and protobuf compiler
+
+'make build;push'
diff --git a/ngx-binding/.gitignore b/ngx-binding/.gitignore
index da70e208..e69de29b 100644
--- a/ngx-binding/.gitignore
+++ b/ngx-binding/.gitignore
@@ -1 +0,0 @@
-nginx
\ No newline at end of file
diff --git a/ngx-binding/Makefile b/ngx-binding/Makefile
index b16fe554..5874d16a 100644
--- a/ngx-binding/Makefile
+++ b/ngx-binding/Makefile
@@ -1,48 +1,7 @@
-NGINX_VER = 1.13.7
-UNAME_S := $(shell uname -s)
-NGX_MODULES = --with-compat  --with-threads --with-http_addition_module \
-     --with-http_auth_request_module   --with-http_gunzip_module --with-http_gzip_static_module  \
-     --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module \
-     --with-http_slice_module  --with-http_stub_status_module --with-http_sub_module \
-     --with-stream --with-stream_realip_module --with-stream_ssl_preread_module
-
-ifeq ($(UNAME_S),Linux)
-    NGINX_SRC = nginx-linux
-    NGX_OPT= $(NGX_MODULES) \
-       --with-file-aio --with-http_ssl_module --with-stream_ssl_module  \
-       --with-cc-opt='-g -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' \
-       --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
-endif
-ifeq ($(UNAME_S),Darwin)
-    NGINX_SRC = nginx-darwin
-    NGX_OPT= $(NGX_MODULES)
-endif
-
-
-setup-nginx:
-	mkdir -p nginx
-
-nginx-source:	setup-nginx
-	rm -rf nginx/${NGINX_SRC}
-	wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz
-	tar zxf nginx-${NGINX_VER}.tar.gz
-	mv nginx-${NGINX_VER} ${NGINX_SRC}
-	mv ${NGINX_SRC} nginx
-	rm nginx-${NGINX_VER}.tar.gz*
-
-nginx-configure:
-	cd nginx/${NGINX_SRC}; \
-    ./configure $(NGX_OPT)
-
-
-nginx-setup:	nginx-source nginx-configure
-
-
-nginx-module:
-	cd nginx/${NGINX_SRC}; \
-	make modules;
+NGINX_VER = 1.13.11
 
 
 clean:
-	rm -rf nginx
+	cargo clean
 	rm -f src/bindings.rs
+	cd nginx;make clean
\ No newline at end of file
diff --git a/ngx-sys/build.rs b/ngx-binding/build.rs
similarity index 100%
rename from ngx-sys/build.rs
rename to ngx-binding/build.rs
diff --git a/ngx-binding/nginx b/ngx-binding/nginx
new file mode 160000
index 00000000..f9e43a31
--- /dev/null
+++ b/ngx-binding/nginx
@@ -0,0 +1 @@
+Subproject commit f9e43a31544bb67f24703e1dad91ea51f49c7a16
diff --git a/ngx-binding/src/.gitignore b/ngx-binding/src/.gitignore
index b1dd71c5..55300bdb 100644
--- a/ngx-binding/src/.gitignore
+++ b/ngx-binding/src/.gitignore
@@ -1,11 +1 @@
 bindings.rs
-helloworld.rs
-helloworld_grpc.rs
-route_guide.rs
-route_guide_grpc.rs
-check.rs
-attributes.rs
-status.rs
-service_grpc.rs
-quota.rs
-report.rs
diff --git a/ngx-binding/src/lib.rs b/ngx-binding/src/lib.rs
index 53208422..8a69fc22 100644
--- a/ngx-binding/src/lib.rs
+++ b/ngx-binding/src/lib.rs
@@ -1,7 +1,4 @@
-extern crate ngx_sys;
-
+pub mod bindings;
 pub mod nginx_http;
 pub mod nginx;
 pub mod log;
-
-pub use ngx_sys::bindings;
\ No newline at end of file
diff --git a/ngx-sys/wrapper.h b/ngx-binding/wrapper.h
similarity index 100%
rename from ngx-sys/wrapper.h
rename to ngx-binding/wrapper.h
diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
index ce0369dc..c7298713 100644
--- a/ngx-sys/Cargo.toml
+++ b/ngx-sys/Cargo.toml
@@ -1,42 +1,4 @@
 [package]
-name = "ngx-sys"
+name = "ngx-module"
 version = "0.2.0"
 authors = ["Sehyo Chang   sehyo@nginx.com"]
-
-[lib]
-doctest = false
-test = true
-crate-type = ["staticlib","rlib"]
-
-[features]
-default = ["with-compat","with-threads","with-http_addition_module","with-http_auth_request_module",
-"with-http_gunzip_module","with-http_gzip_static_module","with-http_random_index_module",
-"with-http_realip_module","with-http_secure_link_module","with-http_slice_module",
-"with-http_stub_status_module","with-http_sub_module","with-stream","with-stream_realip_module",
-"with-stream_ssl_preread_module","with-file-aio","with-http_ssl_module","with-stream_ssl_module"
-]
-
-with-compat=[]
-with-threads=[]
-with-http_addition_module=[]
-with-http_auth_request_module=[]
-with-http_gunzip_module=[]
-with-http_gzip_static_module=[]
-with-http_random_index_module=[]
-with-http_realip_module=[]
-with-http_secure_link_module=[]
-with-http_slice_module=[]
-with-http_stub_status_module=[]
-with-http_sub_module=[]
-with-stream=[]
-with-stream_realip_module=[]
-with-stream_ssl_preread_module=[]
-with-file-aio=[]
-with-http_ssl_module=[]
-with-stream_ssl_module=[]
-
-
-
-
-
-
diff --git a/ngx-sys/Makefile b/ngx-sys/Makefile
deleted file mode 100644
index 86483855..00000000
--- a/ngx-sys/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-NGINX_VER = 1.13.11
-
-clean:
-	cargo clean
-	rm -f src/bindings.rs
-	cd nginx;make clean
diff --git a/ngx-sys/src/lib.rs b/ngx-sys/src/lib.rs
index 44946577..e69de29b 100644
--- a/ngx-sys/src/lib.rs
+++ b/ngx-sys/src/lib.rs
@@ -1 +0,0 @@
-pub mod bindings;
\ No newline at end of file

From cf8069a272e700ef1de2b7e6d76424be971c58c1 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Wed, 11 Apr 2018 15:46:03 -0700
Subject: [PATCH 06/14] add module crate to workspace add procedure macro to
 parse location structure implemented initial macro

---
 Cargo.lock                             | 47 ++++++++++++++++++-
 Cargo.toml                             |  3 +-
 ngx-binding/Cargo.toml                 |  2 +-
 ngx-module/Cargo.toml                  | 14 ++++++
 {ngx-sys => ngx-module}/src/.gitignore |  0
 ngx-module/src/lib.rs                  | 25 ++++++++++
 ngx-module/src/loc_conf.rs             | 64 ++++++++++++++++++++++++++
 ngx-sys/Cargo.toml                     |  4 --
 ngx-sys/src/lib.rs                     |  0
 9 files changed, 152 insertions(+), 7 deletions(-)
 create mode 100644 ngx-module/Cargo.toml
 rename {ngx-sys => ngx-module}/src/.gitignore (100%)
 create mode 100644 ngx-module/src/lib.rs
 create mode 100644 ngx-module/src/loc_conf.rs
 delete mode 100644 ngx-sys/Cargo.toml
 delete mode 100644 ngx-sys/src/lib.rs

diff --git a/Cargo.lock b/Cargo.lock
index de71ac66..b836c20e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -158,12 +158,22 @@ dependencies = [
 ]
 
 [[package]]
-name = "ngx-rust"
+name = "ngx-binding"
 version = "0.2.0"
 dependencies = [
  "bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "ngx-module"
+version = "0.2.0"
+dependencies = [
+ "ngx-binding 0.2.0",
+ "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "nom"
 version = "3.2.1"
@@ -177,6 +187,14 @@ name = "peeking_take_while"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "proc-macro2"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "quick-error"
 version = "1.2.1"
@@ -187,6 +205,14 @@ name = "quote"
 version = "0.3.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "quote"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "redox_syscall"
 version = "0.1.37"
@@ -225,6 +251,16 @@ name = "strsim"
 version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "syn"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "termcolor"
 version = "0.3.6"
@@ -270,6 +306,11 @@ name = "unicode-width"
 version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "unicode-xid"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "unreachable"
 version = "1.0.0"
@@ -350,19 +391,23 @@ dependencies = [
 "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
 "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
 "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
+"checksum proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "49b6a521dc81b643e9a51e0d1cf05df46d5a2f3c0280ea72bcb68276ba64a118"
 "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
 "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
+"checksum quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0ff51282f28dc1b53fd154298feaa2e77c5ea0dba68e1fd8b03b72fbe13d2a"
 "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd"
 "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
 "checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb"
 "checksum regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2550876c31dc914696a6c2e01cbce8afba79a93c8ae979d2fe051c0230b3756"
 "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
+"checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59"
 "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
 "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
 "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
 "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
 "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
 "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
+"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
 "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
 "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
 "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
diff --git a/Cargo.toml b/Cargo.toml
index 1124e3ad..36ee63a0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,4 +1,5 @@
 [workspace]
 members = [
-    "ngx-binding"
+    "ngx-binding",
+    "ngx-module"
 ]
diff --git a/ngx-binding/Cargo.toml b/ngx-binding/Cargo.toml
index f3c495d8..b7bc4e8c 100644
--- a/ngx-binding/Cargo.toml
+++ b/ngx-binding/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "ngx-rust"
+name = "ngx-binding"
 version = "0.2.0"
 authors = ["Sehyo Chang   sehyo@nginx.com"]
 
diff --git a/ngx-module/Cargo.toml b/ngx-module/Cargo.toml
new file mode 100644
index 00000000..9b0632a0
--- /dev/null
+++ b/ngx-module/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "ngx-module"
+version = "0.2.0"
+authors = ["Sehyo Chang   sehyo@nginx.com"]
+
+[lib]
+proc-macro = true
+
+[dependencies]
+ngx-binding   =  { path = "../ngx-binding" , version = "0.2.0" }
+proc-macro2 = "0.3.6"
+quote = "0.5.1"
+syn = "0.13.1"
+
diff --git a/ngx-sys/src/.gitignore b/ngx-module/src/.gitignore
similarity index 100%
rename from ngx-sys/src/.gitignore
rename to ngx-module/src/.gitignore
diff --git a/ngx-module/src/lib.rs b/ngx-module/src/lib.rs
new file mode 100644
index 00000000..01c59f87
--- /dev/null
+++ b/ngx-module/src/lib.rs
@@ -0,0 +1,25 @@
+extern crate proc_macro;
+extern crate proc_macro2;
+#[macro_use]
+extern crate quote;
+#[macro_use]
+extern crate syn;
+
+mod loc_conf;
+
+use proc_macro::TokenStream;
+use syn::DeriveInput;
+use loc_conf::expand_loc_conf;
+
+
+#[proc_macro_derive(NgxLocConf)]
+pub fn ngx_loc_conf(input: TokenStream) -> TokenStream {
+    // Parse the input tokens into a syntax tree
+    let input: DeriveInput = syn::parse(input).unwrap();
+
+    match expand_loc_conf(&input) {
+        Ok(expanded) => expanded.into(),
+        Err(msg) => panic!(msg),
+    }
+
+}
diff --git a/ngx-module/src/loc_conf.rs b/ngx-module/src/loc_conf.rs
new file mode 100644
index 00000000..0a5c35d3
--- /dev/null
+++ b/ngx-module/src/loc_conf.rs
@@ -0,0 +1,64 @@
+
+use syn::DeriveInput;
+use syn::Data;
+use syn::Fields;
+use syn::Field;
+use syn::Ident;
+use syn::punctuated;
+use quote::Tokens;
+
+pub fn expand_loc_conf(input: &DeriveInput) -> Result<Tokens,String>  {
+
+    let result = match input.data {
+        Data::Struct(ref s) => handle_loc_struct(&input, &s.fields, None),
+        Data::Union(_) => panic!("doesn't work with unions yet"),
+        Data::Enum(ref e) => panic!("doesn't work with enums yet")
+    };
+    Ok(result)
+}
+
+fn handle_loc_struct(ast: &DeriveInput,
+                  fields: &Fields,
+                  variant: Option<&Ident>) -> Tokens
+{
+    match *fields {
+        Fields::Named(ref fields) => {
+            
+            directive(&ast, Some(&fields.named), true, variant)
+        },
+        Fields::Unit => {
+            directive(&ast, None, false, variant)
+        },
+        Fields::Unnamed(ref fields) => {
+            directive(&ast, Some(&fields.unnamed), false, variant)
+        },
+    }
+}
+
+fn directive(ast: &DeriveInput,
+            fields: Option<&punctuated::Punctuated<Field, Token![,]>>,
+            named: bool, variant: Option<&Ident>) -> Tokens
+{
+    let name = &ast.ident;
+    quote! {
+        printf!("field name: {}",name)
+    }
+}
+
+/*
+#[cfg(test)]
+mod tests {
+
+    
+    #[repr(C)]
+    #[NgxLocConf]
+    pub struct test_loca_conf_t {
+        #[loc_conf(name="topic")]
+        pub topic: ngx_str_t,
+        pub destination_service: ngx_str_t
+    }
+
+    
+}
+*/
+
diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
deleted file mode 100644
index c7298713..00000000
--- a/ngx-sys/Cargo.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-[package]
-name = "ngx-module"
-version = "0.2.0"
-authors = ["Sehyo Chang   sehyo@nginx.com"]
diff --git a/ngx-sys/src/lib.rs b/ngx-sys/src/lib.rs
deleted file mode 100644
index e69de29b..00000000

From 133ebbb240ec0c4fb6938460abc8eff6ca4ee0a7 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Mon, 16 Apr 2018 22:42:44 -0700
Subject: [PATCH 07/14] implement derive macro add test suite

---
 Cargo.lock                    |  8 ++++++
 Cargo.toml                    |  3 ++-
 ngx-module/Cargo.toml         |  2 +-
 ngx-module/src/loc_conf.rs    | 48 +++++++++++------------------------
 test-suites/Cargo.toml        | 11 ++++++++
 test-suites/tests/test_ser.rs | 18 +++++++++++++
 6 files changed, 55 insertions(+), 35 deletions(-)
 create mode 100644 test-suites/Cargo.toml
 create mode 100644 test-suites/tests/test_ser.rs

diff --git a/Cargo.lock b/Cargo.lock
index b836c20e..cc7b0a8b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -174,6 +174,14 @@ dependencies = [
  "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "ngx_test_suite"
+version = "0.2.0"
+dependencies = [
+ "ngx-binding 0.2.0",
+ "ngx-module 0.2.0",
+]
+
 [[package]]
 name = "nom"
 version = "3.2.1"
diff --git a/Cargo.toml b/Cargo.toml
index 36ee63a0..4438231c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,6 @@
 [workspace]
 members = [
     "ngx-binding",
-    "ngx-module"
+    "ngx-module",
+    "test-suites"
 ]
diff --git a/ngx-module/Cargo.toml b/ngx-module/Cargo.toml
index 9b0632a0..42160cdc 100644
--- a/ngx-module/Cargo.toml
+++ b/ngx-module/Cargo.toml
@@ -10,5 +10,5 @@ proc-macro = true
 ngx-binding   =  { path = "../ngx-binding" , version = "0.2.0" }
 proc-macro2 = "0.3.6"
 quote = "0.5.1"
-syn = "0.13.1"
+syn = { version = "0.13.1", features = ["visit"] }
 
diff --git a/ngx-module/src/loc_conf.rs b/ngx-module/src/loc_conf.rs
index 0a5c35d3..e2c09998 100644
--- a/ngx-module/src/loc_conf.rs
+++ b/ngx-module/src/loc_conf.rs
@@ -2,9 +2,7 @@
 use syn::DeriveInput;
 use syn::Data;
 use syn::Fields;
-use syn::Field;
 use syn::Ident;
-use syn::punctuated;
 use quote::Tokens;
 
 pub fn expand_loc_conf(input: &DeriveInput) -> Result<Tokens,String>  {
@@ -14,7 +12,12 @@ pub fn expand_loc_conf(input: &DeriveInput) -> Result<Tokens,String>  {
         Data::Union(_) => panic!("doesn't work with unions yet"),
         Data::Enum(ref e) => panic!("doesn't work with enums yet")
     };
-    Ok(result)
+    let expanded = quote! {
+        fn test()  {
+            #result
+        }
+    };
+    Ok(expanded)
 }
 
 fn handle_loc_struct(ast: &DeriveInput,
@@ -24,41 +27,20 @@ fn handle_loc_struct(ast: &DeriveInput,
     match *fields {
         Fields::Named(ref fields) => {
             
-            directive(&ast, Some(&fields.named), true, variant)
+            //directive(&ast, Some(&fields.named), true, variant)
+             let fnames = fields.named.iter().map(|f| f.ident);
+             quote! {
+                0 # (
+                    let #fnames = 2;
+                )*
+             }
         },
         Fields::Unit => {
-            directive(&ast, None, false, variant)
+            quote!(0)
         },
         Fields::Unnamed(ref fields) => {
-            directive(&ast, Some(&fields.unnamed), false, variant)
+            quote!(0)
         },
     }
 }
 
-fn directive(ast: &DeriveInput,
-            fields: Option<&punctuated::Punctuated<Field, Token![,]>>,
-            named: bool, variant: Option<&Ident>) -> Tokens
-{
-    let name = &ast.ident;
-    quote! {
-        printf!("field name: {}",name)
-    }
-}
-
-/*
-#[cfg(test)]
-mod tests {
-
-    
-    #[repr(C)]
-    #[NgxLocConf]
-    pub struct test_loca_conf_t {
-        #[loc_conf(name="topic")]
-        pub topic: ngx_str_t,
-        pub destination_service: ngx_str_t
-    }
-
-    
-}
-*/
-
diff --git a/test-suites/Cargo.toml b/test-suites/Cargo.toml
new file mode 100644
index 00000000..8d3c2875
--- /dev/null
+++ b/test-suites/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "ngx_test_suite"
+version = "0.2.0"
+authors = ["Sehyo Chang   sehyo@nginx.com"]
+
+
+[dependencies]
+ngx-binding   =  { path = "../ngx-binding" , version = "0.2.0" }
+ngx-module   =  { path = "../ngx-module" , version = "0.2.0" }
+
+
diff --git a/test-suites/tests/test_ser.rs b/test-suites/tests/test_ser.rs
new file mode 100644
index 00000000..c7ca65ed
--- /dev/null
+++ b/test-suites/tests/test_ser.rs
@@ -0,0 +1,18 @@
+#[macro_use]
+extern crate ngx_module;
+extern crate ngx_binding;
+
+use ngx_binding::ngx_str_t;
+
+#[repr(C)]
+#[derive(NgxLocConf)]
+pub struct test_loca_conf_t {
+    pub topic: ngx_str_t,
+    pub destination_service: ngx_str_t
+}
+
+#[test]
+fn test1() {
+
+    assert!(true,"test successfull");
+}
\ No newline at end of file

From afda8fab07ef6f13290216eff7fe3e87c15ed16f Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Mon, 16 Apr 2018 23:14:50 -0700
Subject: [PATCH 08/14] add syntax completed macro

---
 ngx-module/src/loc_conf.rs    | 3 ++-
 test-suites/tests/test_ser.rs | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ngx-module/src/loc_conf.rs b/ngx-module/src/loc_conf.rs
index e2c09998..f9b9aaa0 100644
--- a/ngx-module/src/loc_conf.rs
+++ b/ngx-module/src/loc_conf.rs
@@ -17,6 +17,7 @@ pub fn expand_loc_conf(input: &DeriveInput) -> Result<Tokens,String>  {
             #result
         }
     };
+    println!("macro: {}", expanded);
     Ok(expanded)
 }
 
@@ -30,7 +31,7 @@ fn handle_loc_struct(ast: &DeriveInput,
             //directive(&ast, Some(&fields.named), true, variant)
              let fnames = fields.named.iter().map(|f| f.ident);
              quote! {
-                0 # (
+                # (
                     let #fnames = 2;
                 )*
              }
diff --git a/test-suites/tests/test_ser.rs b/test-suites/tests/test_ser.rs
index c7ca65ed..b4933311 100644
--- a/test-suites/tests/test_ser.rs
+++ b/test-suites/tests/test_ser.rs
@@ -2,7 +2,7 @@
 extern crate ngx_module;
 extern crate ngx_binding;
 
-use ngx_binding::ngx_str_t;
+use ngx_binding::bindings::ngx_str_t;
 
 #[repr(C)]
 #[derive(NgxLocConf)]

From 8352db769a72934314360b090d838f1e7aeedd85 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 20 Apr 2018 15:20:13 -0700
Subject: [PATCH 09/14] auto configure nginx in rust out directory instead of
 source directory this fixes issue where rust is unnecessary cause build

---
 ngx-binding/Cargo.toml |  1 +
 ngx-binding/build.rs   | 65 ++++++++++++++++++++++++++++++++----------
 2 files changed, 51 insertions(+), 15 deletions(-)

diff --git a/ngx-binding/Cargo.toml b/ngx-binding/Cargo.toml
index b7bc4e8c..95081e27 100644
--- a/ngx-binding/Cargo.toml
+++ b/ngx-binding/Cargo.toml
@@ -39,3 +39,4 @@ with-stream_ssl_module=[]
 [build-dependencies]
 bindgen = "0.35.0"
 
+
diff --git a/ngx-binding/build.rs b/ngx-binding/build.rs
index 051d5042..67812553 100644
--- a/ngx-binding/build.rs
+++ b/ngx-binding/build.rs
@@ -3,11 +3,10 @@ extern crate bindgen;
 use std::process::Command;
 use std::process::Output;
 use std::env;
+use std::path::PathBuf;
 use std::io::Result;
 use std::vec::Vec;
 
-const NGIX_DIR: &str  = "./nginx/";
-
 // return all nginx features
 fn ngix_features() -> Vec<&'static str> {
     let mut features: Vec<&'static str> = Vec::new();
@@ -83,10 +82,44 @@ fn ngix_features() -> Vec<&'static str> {
     
 }
 
-fn configure() -> Result<Output> {
+// nginx source directory
+fn nginx_dir() -> String  {
+    let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+    format!("{}/nginx",out_dir.display())
+}
+
+
+
+// copy nginx to out directory
+fn copy_nginx() -> Result<Output> {
     let current_path = env::current_dir().unwrap();
-    let path_name = format!("{}/nginx",current_path.display());
-    println!("executing make command at {}",path_name);
+    let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());
+    let dest_str = dst.to_str().unwrap();
+    let mut args: Vec<&str> = vec!["-r","nginx",dest_str];
+    let result =  Command::new("cp")
+        .args(&args)
+        .current_dir(env::current_dir().unwrap())
+        .output();
+
+    println!("copying nginx to: {}",dest_str);
+    match result  {
+        Err(e)  =>  {
+            return Err(e);
+        },
+
+        Ok(output) => {
+            println!("status: {}", output.status);
+            println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
+            println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
+            return Ok(output);
+        }
+    }
+        
+}
+
+fn configure() -> Result<Output> {
+    let nginx_path_name = nginx_dir();
+    println!("nginx auto config at {}",nginx_path_name);
     let mut args: Vec<&str> = Vec::new();
     args.push("auto/configure");
     
@@ -98,7 +131,7 @@ fn configure() -> Result<Output> {
         
     let result =  Command::new("bash")
         .args(&args)
-        .current_dir(path_name)
+        .current_dir(nginx_path_name)
         .output();
 
     match result  {
@@ -122,19 +155,20 @@ fn configure() -> Result<Output> {
 
 
 fn generate_binding() {
+    let nginx_path_name = nginx_dir();
     let builder = bindgen::Builder::default()
     // The input header we would like to generate
     // bindings for.
     .header("wrapper.h")
     .layout_tests(false)
     .rustfmt_bindings(true)
-    .clang_arg(format!("-I{}/src/core",NGIX_DIR))
-    .clang_arg(format!("-I{}/src/event",NGIX_DIR))
-    .clang_arg(format!("-I{}/src/event/modules",NGIX_DIR))
-    .clang_arg(format!("-I{}/src/os/unix",NGIX_DIR))
-    .clang_arg(format!("-I{}/objs",NGIX_DIR))
-    .clang_arg(format!("-I{}/src/http",NGIX_DIR))
-    .clang_arg(format!("-I{}/src/http/modules",NGIX_DIR))
+    .clang_arg(format!("-I{}/src/core",nginx_path_name))
+    .clang_arg(format!("-I{}/src/event",nginx_path_name))
+    .clang_arg(format!("-I{}/src/event/modules",nginx_path_name))
+    .clang_arg(format!("-I{}/src/os/unix",nginx_path_name))
+    .clang_arg(format!("-I{}/objs",nginx_path_name))
+    .clang_arg(format!("-I{}/src/http",nginx_path_name))
+    .clang_arg(format!("-I{}/src/http/modules",nginx_path_name))
     // Finish the builder and generate the bindings.
     .generate()
     // Unwrap the Result and panic on failure.
@@ -147,7 +181,8 @@ fn generate_binding() {
 
 fn main() {
 
-    configure();
-    generate_binding();
+    copy_nginx();
+   // configure();
+   // generate_binding();
 
 }

From 421cb848a4cde594d5d2c47a1ca822243e057161 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Sat, 28 Apr 2018 08:59:04 -0700
Subject: [PATCH 10/14] add location config template

---
 ngx-module/src/loc_conf.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ngx-module/src/loc_conf.rs b/ngx-module/src/loc_conf.rs
index f9b9aaa0..26bfeb67 100644
--- a/ngx-module/src/loc_conf.rs
+++ b/ngx-module/src/loc_conf.rs
@@ -13,9 +13,11 @@ pub fn expand_loc_conf(input: &DeriveInput) -> Result<Tokens,String>  {
         Data::Enum(ref e) => panic!("doesn't work with enums yet")
     };
     let expanded = quote! {
-        fn test()  {
-            #result
+    
+        pub extern fn ngx_http_create_loc_conf(conf: &ngx_conf_t)  {
+            #result    
         }
+
     };
     println!("macro: {}", expanded);
     Ok(expanded)

From 94a42d0e14c9a00237031e107d19ec489de3f1ea Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 18 May 2018 10:29:31 -0700
Subject: [PATCH 11/14] minor clean up of README

---
 README.md | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index a6014b00..e97fdeda 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Add the following dependency to your Cargo manifest...
 
 ```toml
 [dependencies]
-ngix-rust = "0.1.1"
+ngix-rust = "0.2"
 ```
 
 Next, add this to your crate:
@@ -21,8 +21,7 @@ Next, add this to your crate:
 extern crate ngx-rust;
 ```
 
-## to ensure bindings are formatted, run following cmd
-```rustup component add rustfmt-preview```
+[TBD]
 
 ## Limitation
 

From f634c52e6c4cba0a0d939f4d016e9537195c1b5e Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 18 May 2018 11:26:22 -0700
Subject: [PATCH 12/14] rename ngx-binding directory to ngx-sys

---
 .gitmodules                                | 4 ++--
 {ngx-binding => ngx-sys}/.gitignore        | 0
 {ngx-binding => ngx-sys}/Cargo.toml        | 0
 {ngx-binding => ngx-sys}/Makefile          | 0
 {ngx-binding => ngx-sys}/build.rs          | 0
 {ngx-binding => ngx-sys}/nginx             | 0
 {ngx-binding => ngx-sys}/src/.gitignore    | 0
 {ngx-binding => ngx-sys}/src/lib.rs        | 0
 {ngx-binding => ngx-sys}/src/log.rs        | 0
 {ngx-binding => ngx-sys}/src/nginx.rs      | 0
 {ngx-binding => ngx-sys}/src/nginx_http.rs | 0
 {ngx-binding => ngx-sys}/wrapper.h         | 0
 12 files changed, 2 insertions(+), 2 deletions(-)
 rename {ngx-binding => ngx-sys}/.gitignore (100%)
 rename {ngx-binding => ngx-sys}/Cargo.toml (100%)
 rename {ngx-binding => ngx-sys}/Makefile (100%)
 rename {ngx-binding => ngx-sys}/build.rs (100%)
 rename {ngx-binding => ngx-sys}/nginx (100%)
 rename {ngx-binding => ngx-sys}/src/.gitignore (100%)
 rename {ngx-binding => ngx-sys}/src/lib.rs (100%)
 rename {ngx-binding => ngx-sys}/src/log.rs (100%)
 rename {ngx-binding => ngx-sys}/src/nginx.rs (100%)
 rename {ngx-binding => ngx-sys}/src/nginx_http.rs (100%)
 rename {ngx-binding => ngx-sys}/wrapper.h (100%)

diff --git a/.gitmodules b/.gitmodules
index 1039f319..9d45d5b0 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "ngx-binding/nginx"]
-	path = ngx-binding/nginx
+[submodule "ngx-sys/nginx"]
+	path = ngx-sys/nginx
 	url = https://github.com/nginx/nginx.git
diff --git a/ngx-binding/.gitignore b/ngx-sys/.gitignore
similarity index 100%
rename from ngx-binding/.gitignore
rename to ngx-sys/.gitignore
diff --git a/ngx-binding/Cargo.toml b/ngx-sys/Cargo.toml
similarity index 100%
rename from ngx-binding/Cargo.toml
rename to ngx-sys/Cargo.toml
diff --git a/ngx-binding/Makefile b/ngx-sys/Makefile
similarity index 100%
rename from ngx-binding/Makefile
rename to ngx-sys/Makefile
diff --git a/ngx-binding/build.rs b/ngx-sys/build.rs
similarity index 100%
rename from ngx-binding/build.rs
rename to ngx-sys/build.rs
diff --git a/ngx-binding/nginx b/ngx-sys/nginx
similarity index 100%
rename from ngx-binding/nginx
rename to ngx-sys/nginx
diff --git a/ngx-binding/src/.gitignore b/ngx-sys/src/.gitignore
similarity index 100%
rename from ngx-binding/src/.gitignore
rename to ngx-sys/src/.gitignore
diff --git a/ngx-binding/src/lib.rs b/ngx-sys/src/lib.rs
similarity index 100%
rename from ngx-binding/src/lib.rs
rename to ngx-sys/src/lib.rs
diff --git a/ngx-binding/src/log.rs b/ngx-sys/src/log.rs
similarity index 100%
rename from ngx-binding/src/log.rs
rename to ngx-sys/src/log.rs
diff --git a/ngx-binding/src/nginx.rs b/ngx-sys/src/nginx.rs
similarity index 100%
rename from ngx-binding/src/nginx.rs
rename to ngx-sys/src/nginx.rs
diff --git a/ngx-binding/src/nginx_http.rs b/ngx-sys/src/nginx_http.rs
similarity index 100%
rename from ngx-binding/src/nginx_http.rs
rename to ngx-sys/src/nginx_http.rs
diff --git a/ngx-binding/wrapper.h b/ngx-sys/wrapper.h
similarity index 100%
rename from ngx-binding/wrapper.h
rename to ngx-sys/wrapper.h

From 27154942793e8dbe1fc6c03cb69bebe52aba67f5 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 18 May 2018 13:23:31 -0700
Subject: [PATCH 13/14] rename ngx-binding to ngx-sys in cargo and module path

---
 Cargo.lock             | 110 ++++++++++++++++++++++++-----------------
 Cargo.toml             |   2 +-
 Makefile               |   2 +-
 ngx-module/Cargo.toml  |   2 +-
 ngx-sys/Cargo.toml     |   2 +-
 ngx-sys/build.rs       |   4 +-
 ngx-sys/src/lib.rs     |   5 ++
 test-suites/Cargo.toml |   2 +-
 8 files changed, 78 insertions(+), 51 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index cc7b0a8b..1c19bb0f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -16,7 +16,7 @@ dependencies = [
 
 [[package]]
 name = "atty"
-version = "0.2.8"
+version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -30,26 +30,26 @@ version = "0.35.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "bitflags"
-version = "1.0.1"
+version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "cc"
-version = "1.0.9"
+version = "1.0.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -62,7 +62,7 @@ dependencies = [
 
 [[package]]
 name = "cfg-if"
-version = "0.1.2"
+version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -81,23 +81,23 @@ version = "2.31.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "env_logger"
-version = "0.5.6"
+version = "0.5.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -129,7 +129,7 @@ name = "libloading"
 version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -138,7 +138,7 @@ name = "log"
 version = "0.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -158,28 +158,28 @@ dependencies = [
 ]
 
 [[package]]
-name = "ngx-binding"
+name = "ngx-module"
 version = "0.2.0"
 dependencies = [
- "bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ngx-sys 0.2.0",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.13.10 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "ngx-module"
+name = "ngx-sys"
 version = "0.2.0"
 dependencies = [
- "ngx-binding 0.2.0",
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "ngx_test_suite"
 version = "0.2.0"
 dependencies = [
- "ngx-binding 0.2.0",
  "ngx-module 0.2.0",
+ "ngx-sys 0.2.0",
 ]
 
 [[package]]
@@ -197,7 +197,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "proc-macro2"
-version = "0.3.6"
+version = "0.3.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -215,10 +215,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "quote"
-version = "0.5.1"
+version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -236,19 +236,39 @@ dependencies = [
 
 [[package]]
 name = "regex"
-version = "0.2.10"
+version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "regex"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "regex-syntax"
-version = "0.5.3"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -261,11 +281,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "syn"
-version = "0.13.1"
+version = "0.13.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -334,7 +354,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "vec_map"
-version = "0.8.0"
+version = "0.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -380,15 +400,15 @@ dependencies = [
 [metadata]
 "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
 "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
-"checksum atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "af80143d6f7608d746df1520709e5d141c96f240b0e62b0aa41bdfb53374d9d4"
+"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
 "checksum bindgen 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b023955126e7909ab9fc1d1973965b8b004f1f388afb5c589640ab483b3b0ad2"
-"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
-"checksum cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2b4911e4bdcb4100c7680e7e854ff38e23f1b34d4d9e079efae3da2801341ffc"
+"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
+"checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba"
 "checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c"
-"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
+"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18"
 "checksum clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "939a1a34310b120d26eba35c29475933128b0ec58e24b43327f8dbe6036fc538"
 "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536"
-"checksum env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0561146661ae44c579e993456bc76d11ce1e0c7d745e57b2fa7146b6e49fa2ad"
+"checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a"
 "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
 "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
 "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
@@ -399,16 +419,18 @@ dependencies = [
 "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
 "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
 "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
-"checksum proc-macro2 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "49b6a521dc81b643e9a51e0d1cf05df46d5a2f3c0280ea72bcb68276ba64a118"
+"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7"
 "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4"
 "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
-"checksum quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0ff51282f28dc1b53fd154298feaa2e77c5ea0dba68e1fd8b03b72fbe13d2a"
+"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
 "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd"
 "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
-"checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb"
-"checksum regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2550876c31dc914696a6c2e01cbce8afba79a93c8ae979d2fe051c0230b3756"
+"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
+"checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3"
+"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
+"checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b"
 "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
-"checksum syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "91b52877572087400e83d24b9178488541e3d535259e04ff17a63df1e5ceff59"
+"checksum syn 0.13.10 (registry+https://github.com/rust-lang/crates.io-index)" = "77961dcdac942fa8bc033c16f3a790b311c8a27d00811b878ebd8cf9b7ba39d5"
 "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
 "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
 "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
@@ -418,7 +440,7 @@ dependencies = [
 "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
 "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
 "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
-"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
+"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
 "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
 "checksum which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2"
 "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3"
diff --git a/Cargo.toml b/Cargo.toml
index 4438231c..3512452d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [workspace]
 members = [
-    "ngx-binding",
+    "ngx-sys",
     "ngx-module",
     "test-suites"
 ]
diff --git a/Makefile b/Makefile
index 5ad12323..5313971e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,4 +2,4 @@ NGINX_VER = 1.13.11
 
 clean:
 	cargo clean
-	make -C ngx-binding clean
+	make -C ngx-sys clean
diff --git a/ngx-module/Cargo.toml b/ngx-module/Cargo.toml
index 42160cdc..21fc9a02 100644
--- a/ngx-module/Cargo.toml
+++ b/ngx-module/Cargo.toml
@@ -7,7 +7,7 @@ authors = ["Sehyo Chang   sehyo@nginx.com"]
 proc-macro = true
 
 [dependencies]
-ngx-binding   =  { path = "../ngx-binding" , version = "0.2.0" }
+ngx-sys   =  { path = "../ngx-sys" , version = "0.2.0" }
 proc-macro2 = "0.3.6"
 quote = "0.5.1"
 syn = { version = "0.13.1", features = ["visit"] }
diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
index 95081e27..ad3ff6be 100644
--- a/ngx-sys/Cargo.toml
+++ b/ngx-sys/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "ngx-binding"
+name = "ngx-sys"
 version = "0.2.0"
 authors = ["Sehyo Chang   sehyo@nginx.com"]
 
diff --git a/ngx-sys/build.rs b/ngx-sys/build.rs
index 67812553..943100fe 100644
--- a/ngx-sys/build.rs
+++ b/ngx-sys/build.rs
@@ -182,7 +182,7 @@ fn generate_binding() {
 fn main() {
 
     copy_nginx();
-   // configure();
-   // generate_binding();
+    configure();
+    generate_binding();
 
 }
diff --git a/ngx-sys/src/lib.rs b/ngx-sys/src/lib.rs
index 8a69fc22..e9abe62e 100644
--- a/ngx-sys/src/lib.rs
+++ b/ngx-sys/src/lib.rs
@@ -1,4 +1,9 @@
 pub mod bindings;
+
+pub use bindings::*;
+
 pub mod nginx_http;
 pub mod nginx;
 pub mod log;
+
+
diff --git a/test-suites/Cargo.toml b/test-suites/Cargo.toml
index 8d3c2875..37da5dec 100644
--- a/test-suites/Cargo.toml
+++ b/test-suites/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Sehyo Chang   sehyo@nginx.com"]
 
 
 [dependencies]
-ngx-binding   =  { path = "../ngx-binding" , version = "0.2.0" }
+ngx-sys   =  { path = "../ngx-sys" , version = "0.2.0" }
 ngx-module   =  { path = "../ngx-module" , version = "0.2.0" }
 
 

From 22776e08da25c015410823cc9f56e95c80a74ce1 Mon Sep 17 00:00:00 2001
From: Sehyo Chang <sehyo@nginx.com>
Date: Fri, 18 May 2018 14:17:52 -0700
Subject: [PATCH 14/14] move ngx types implementation into ngx_sys crate

---
 Cargo.lock                    |   7 ++
 Cargo.toml                    |  38 ++++++++
 ngx-sys/Cargo.toml            |   7 --
 ngx-sys/src/lib.rs            |   8 +-
 ngx-sys/src/nginx_http.rs     | 159 ----------------------------------
 {ngx-sys/src => src}/log.rs   |   6 +-
 {ngx-sys/src => src}/nginx.rs |   2 +-
 7 files changed, 52 insertions(+), 175 deletions(-)
 delete mode 100644 ngx-sys/src/nginx_http.rs
 rename {ngx-sys/src => src}/log.rs (59%)
 rename {ngx-sys/src => src}/nginx.rs (99%)

diff --git a/Cargo.lock b/Cargo.lock
index 1c19bb0f..bf44bbf4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -167,6 +167,13 @@ dependencies = [
  "syn 0.13.10 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "ngx-rs"
+version = "0.2.0"
+dependencies = [
+ "ngx-sys 0.2.0",
+]
+
 [[package]]
 name = "ngx-sys"
 version = "0.2.0"
diff --git a/Cargo.toml b/Cargo.toml
index 3512452d..a6f28ba8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,3 +1,41 @@
+[package]
+name = "ngx-rs"
+version = "0.2.0"
+authors = ["Sehyo Chang <sehyo@nginx.com>"]
+
+
+[features]
+default = ["with-compat","with-threads","with-http_addition_module","with-http_auth_request_module",
+"with-http_gunzip_module","with-http_gzip_static_module","with-http_random_index_module",
+"with-http_realip_module","with-http_secure_link_module","with-http_slice_module",
+"with-http_stub_status_module","with-http_sub_module","with-stream","with-stream_realip_module",
+"with-stream_ssl_preread_module","with-file-aio","with-http_ssl_module","with-stream_ssl_module"
+]
+
+with-compat=["ngx-sys/with-compat"]
+with-threads=["ngx-sys/with-threads"]
+with-http_addition_module=["ngx-sys/with-http_addition_module"]
+with-http_auth_request_module=["ngx-sys/with-http_auth_request_module"]
+with-http_gunzip_module=["ngx-sys/with-http_gunzip_module"]
+with-http_gzip_static_module=["ngx-sys/with-http_gzip_static_module"]
+with-http_random_index_module=["ngx-sys/with-http_random_index_module"]
+with-http_realip_module=["ngx-sys/with-http_realip_module"]
+with-http_secure_link_module=["ngx-sys/with-http_secure_link_module"]
+with-http_slice_module=["ngx-sys/with-http_slice_module"]
+with-http_stub_status_module=["ngx-sys/with-http_stub_status_module"]
+with-http_sub_module=["ngx-sys/with-http_sub_module"]
+with-stream=["ngx-sys/with-stream"]
+with-stream_realip_module=["ngx-sys/with-stream_realip_module"]
+with-stream_ssl_preread_module=["ngx-sys/with-stream_ssl_preread_module"]
+with-file-aio=["ngx-sys/with-file-aio"]
+with-http_ssl_module=["ngx-sys/with-http_ssl_module"]
+with-stream_ssl_module=["ngx-sys/with-http_ssl_module"]
+
+
+[dependencies]
+ngx-sys = { path = "ngx-sys", version = "0.2.0"}
+
+
 [workspace]
 members = [
     "ngx-sys",
diff --git a/ngx-sys/Cargo.toml b/ngx-sys/Cargo.toml
index ad3ff6be..91b0851b 100644
--- a/ngx-sys/Cargo.toml
+++ b/ngx-sys/Cargo.toml
@@ -9,13 +9,6 @@ test = true
 crate-type = ["staticlib","rlib"]
 
 [features]
-default = ["with-compat","with-threads","with-http_addition_module","with-http_auth_request_module",
-"with-http_gunzip_module","with-http_gzip_static_module","with-http_random_index_module",
-"with-http_realip_module","with-http_secure_link_module","with-http_slice_module",
-"with-http_stub_status_module","with-http_sub_module","with-stream","with-stream_realip_module",
-"with-stream_ssl_preread_module","with-file-aio","with-http_ssl_module","with-stream_ssl_module"
-]
-
 with-compat=[]
 with-threads=[]
 with-http_addition_module=[]
diff --git a/ngx-sys/src/lib.rs b/ngx-sys/src/lib.rs
index e9abe62e..13620371 100644
--- a/ngx-sys/src/lib.rs
+++ b/ngx-sys/src/lib.rs
@@ -1,9 +1,7 @@
-pub mod bindings;
+mod bindings;
+mod http;
+mod string;
 
 pub use bindings::*;
 
-pub mod nginx_http;
-pub mod nginx;
-pub mod log;
-
 
diff --git a/ngx-sys/src/nginx_http.rs b/ngx-sys/src/nginx_http.rs
deleted file mode 100644
index 29106488..00000000
--- a/ngx-sys/src/nginx_http.rs
+++ /dev/null
@@ -1,159 +0,0 @@
-
-use std::str;
-use std::slice;
-
-use bindings::ngx_http_request_s;
-use bindings::ngx_http_headers_in_t;
-use bindings::ngx_http_headers_out_t;
-use bindings::ngx_list_part_t;
-use bindings::ngx_table_elt_t;
-use bindings::ngx_list_t;
-use bindings::ngx_uint_t;
-use bindings::ngx_str_t;
-use bindings::ngx_log_t;
-use bindings::ngx_log_error_core;
-use bindings::NGX_LOG_ERR;
-use bindings::ngx_cycle;
-
-
-impl ngx_str_t  {
-    // convert nginx string to str slice
-    pub fn to_str(&self) -> &str  {
-
-        unsafe {
-            let slice = slice::from_raw_parts(self.data,self.len) ;
-            return str::from_utf8(slice).unwrap();
-        }            
-   
-    }
-
-    // get string 
-    pub fn to_string(&self) -> String  {
-        return String::from(self.to_str());
-    }
-}
-
-impl ngx_http_request_s {
-
-    /*
-    pub fn scheme(&self) -> char {
-        unsafe {  (*self.schema_start)};
-    }
-    */
-
-}
-
-impl ngx_http_headers_in_t {
-
-    // host
-    pub fn host_str(&self) -> &str  {
-        unsafe { (*self.host).value.to_str() }
-    }
-
-    pub fn user_agent_str(&self) -> &str  {
-        unsafe { (*self.user_agent).value.to_str() }
-    }
-
-    // referrer
-    pub fn referer_str(&self) -> Option<&str>  {
-
-        let referer = self.referer;
-
-        if referer.is_null() {
-            return None;
-        }
-
-        return Some(unsafe { (*referer).value.to_str() });
-    }
-
-    pub fn headers_iterator(&self) -> NgxListIterator {
-        list_iterator( &self.headers )
-    }
-
-}
-
-impl ngx_http_headers_out_t {
-
-    pub fn content_length_str(&self) -> &str  {
-        unsafe { (*self.content_length).value.to_str() }
-    }
-
-    pub fn server_str(&self) -> &str  {
-        unsafe { (*self.server).value.to_str() }
-    }
-
-    pub fn headers_iterator(&self) -> NgxListIterator {
-        list_iterator( &self.headers )
-    }
-
-}
-
-
-pub struct NgxListIterator {
-
-    done: bool ,
-    part: *const ngx_list_part_t,
-    h: *const ngx_table_elt_t,
-    i: ngx_uint_t
-}
-
-
-// create new http request iterator 
-pub fn list_iterator(list: *const ngx_list_t) -> NgxListIterator  {
-
-    unsafe {
-        let  part: *const ngx_list_part_t  = &(*list).part ;
-
-        NgxListIterator  {
-            done: false,
-            part: part,
-            h: (*part).elts as *const ngx_table_elt_t,
-            i: 0
-        }
-    }
-    
-}
-
-// iterator for ngx_list_t
-
-impl Iterator for NgxListIterator  {
-
-    // type Item = (&str,&str);
-    // TODO: try to use str instead of string
-
-    type Item = (String,String);
-    
-    fn next(&mut self) -> Option<Self::Item> {
-
-        unsafe {
-            if self.done  {
-                return None;
-            } else {
-                if self.i >= (*self.part).nelts  {
-                        if (*self.part).next.is_null() {
-                            self.done = true;
-                            return None
-                        }
-
-                        // loop back
-                        self.part = (*self.part).next;
-                        self.h = (*self.part).elts as *mut ngx_table_elt_t;
-                        self.i = 0;
-                }
-
-                let header: *const ngx_table_elt_t = self.h.offset(self.i as isize);
-
-                let header_name: ngx_str_t = (*header).key;   
-                    
-                let header_value: ngx_str_t = (*header).value;
-               
-                self.i = self.i + 1;
-
-                return Some( (header_name.to_string(),header_value.to_string()) ) ;
-
-            }
-        }
-    
-    }
-
-}
diff --git a/ngx-sys/src/log.rs b/src/log.rs
similarity index 59%
rename from ngx-sys/src/log.rs
rename to src/log.rs
index 9949ef74..e49bb5aa 100644
--- a/ngx-sys/src/log.rs
+++ b/src/log.rs
@@ -5,7 +5,7 @@ macro_rules! ngx_debug  {
     ($level:expr,$log:expr,$($arg:tt)*) => {
         if (*$log).log_level & $level as usize > 0{
             let c_message = ::std::ffi::CString::new(format!($($arg)*)).unwrap();
-            $crate::bindings::ngx_log_error_core($crate::bindings::NGX_LOG_DEBUG as usize, $log, 0, c_message.as_ptr());
+            $crate::ngx_log_error_core($crate::NGX_LOG_DEBUG as usize, $log, 0, c_message.as_ptr());
         }
     }
 }
@@ -15,7 +15,7 @@ macro_rules! ngx_http_debug  {
 
     ($request:expr,$($arg:tt)*) => {
         unsafe  {
-            ngx_debug!($crate::bindings::NGX_LOG_DEBUG_HTTP,(*($request).connection).log,$($arg)*);
+            ngx_debug!($crate::NGX_LOG_DEBUG_HTTP,(*($request).connection).log,$($arg)*);
         }
     }
 }
@@ -26,7 +26,7 @@ macro_rules! ngx_event_debug  {
 
     ($($arg:tt)*) => {
         unsafe  {
-            ngx_debug!($crate::bindings::NGX_LOG_DEBUG_EVENT,(*$crate::bindings::ngx_cycle).log,$($arg)*);
+            ngx_debug!($crate::NGX_LOG_DEBUG_EVENT,(*$crate::ngx_cycle).log,$($arg)*);
         }
     }
 }
diff --git a/ngx-sys/src/nginx.rs b/src/nginx.rs
similarity index 99%
rename from ngx-sys/src/nginx.rs
rename to src/nginx.rs
index c5015c5d..f64d8a09 100644
--- a/ngx-sys/src/nginx.rs
+++ b/src/nginx.rs
@@ -74,7 +74,7 @@ impl Nginx  {
     // intentinally ignore failure in stop
     pub fn restart(&mut self) -> Result<Output> {
 
-        self.stop();
+        self.stop()?;
         self.start()
     }
 
