packages feed

sendfile-0.1: sendfile.cabal

name:          sendfile
version:       0.1
stability:     experimental
synopsis:      A portable sendfile library
description:   A library which exposes zero-copy sendfile functionality in a portable way. If a platform does not support sendfile, a fallback implementation in haskell is provided.
license:       BSD3
license-file:  LICENSE
author:        Matthew Elder <matt@mattelder.org>
maintainer:    Matthew Elder <matt@mattelder.org>
homepage:      http://patch-tag.com/r/sendfile
category:      Network
build-type:    Simple
cabal-version: >= 1.6

flag portable
    description: Explicitly enable portable sendfile support (implemented in Haskell)
    default:     False

library
    hs-source-dirs:  src

    exposed-modules: SendFile
                     SendFile.Internal
    
    build-depends:   base >= 3 && < 5,
                     bytestring >= 0.9.1.4 && < 0.10,
                     network >= 2 && < 3
    
    if flag(portable)
      cc-options: -DPORTABLE_SENDFILE
    else
      if os(windows)
        cc-options: -DWIN32_SENDFILE
        c-sources: csrc/sendfile_win32.c
        extra-libraries: kernel32, mswsock
      else
        if os(linux)
          cc-options: -DLINUX_SENDFILE
          c-sources: csrc/sendfile_linux.c
        else
          cc-options: -DPORTABLE_SENDFILE

source-repository head
    type:     darcs
    location: http://patch-tag.com/r/sendfile/pullrepo