 }
 
 extension String {
+    /// Returns a `String` given a c error `number`.
     public static func fromCError(number: Int32) -> String {
         return String.fromCString(strerror(number))!
     }

}

/// Calls gethostbyname2 in the implementation.
public func gethostbyname(str: String, family: DomainAddressFamily)
    -> HostEntry? {
        switch family {
        case .INET, .INET6: break
        default:
            preconditionFailure(
                "Only internet addresses are supported (i.e. INET or INET6"
            )
        }
        let ent = Darwin.gethostbyname2(str, family.systemValue)

public let htons = ntohs

/// WARNING: Don't use, I don't know what it does...
//public func ntohs_char(value: Int8) -> Int8 {
//    return (value << 8) + (value >> 8)
//}
//

extension String {
    /// Returns an underlying c buffer.
    /// - Warning: Deallocate the pointer when done to aviod memory leaks.
    public var getCString: (ptr: UnsafeMutablePointer<Int8>, len: Int) {
        return self.withCString { (ptr: UnsafePointer<Int8>) ->
            (UnsafeMutablePointer<Int8>, Int) in
