     public let mode: Mode
     
     private var state: State = .ready
-    private var context = Context()
-    private var buffer: [UInt8] = []
+    fileprivate var context = Context()
+    fileprivate var buffer: [UInt8] = []
     
     private var messages: [Message] = []
     

    }
}

private func http_parser_on_message_begin(ctx: UnsafeMutablePointer<http_parser>?) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnMessageBegin()
}

private func http_parser_on_url(ctx: UnsafeMutablePointer<http_parser>?, data: UnsafePointer<Int8>?, length: Int) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnURL(data: data!, length: length)
}

private func http_parser_on_status(ctx: UnsafeMutablePointer<http_parser>?, data: UnsafePointer<Int8>?, length: Int) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnStatus(data: data!, length: length)
}

private func http_parser_on_header_field(ctx: UnsafeMutablePointer<http_parser>?, data: UnsafePointer<Int8>?, length: Int) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnHeaderField(data: data!, length: length)
}

private func http_parser_on_header_value(ctx: UnsafeMutablePointer<http_parser>?, data: UnsafePointer<Int8>?, length: Int) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnHeaderValue(data: data!, length: length)
}

private func http_parser_on_headers_complete(ctx: UnsafeMutablePointer<http_parser>?) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnHeadersComplete()
}

private func http_parser_on_body(ctx: UnsafeMutablePointer<http_parser>?, data: UnsafePointer<Int8>?, length: Int) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnBody(data: data!, length: length)
}

private func http_parser_on_message_complete(ctx: UnsafeMutablePointer<http_parser>?) -> Int32 {
    let ref = Unmanaged<MessageParser>.fromOpaque(ctx!.pointee.data).takeUnretainedValue()
    return ref.processOnMessageComplete()
}


import CHTTPParser
import Foundation

