   h ptr cname = do
     name <- peekCString cname
     handler name
+-- |Attach an EndElementHandler to a Parser.
 setEndElementHandler :: Parser -> EndElementHandler -> IO ()
 setEndElementHandler (Parser p) handler = do
   handler' <- wrapEndElementHandler handler

    cattrlist <- peekArray0 nullPtr cattrs
    attrlist <- mapM peekCString cattrlist
    handler name (pairwise attrlist)
setStartElementHandler :: Parser -> StartElementHandler -> IO ()
setStartElementHandler (Parser p) handler = do
  handler' <- wrapStartElementHandler handler

-- hexpat, a Haskell wrapper for expat
-- Copyright (C) 2008 Evan Martin <martine@danga.com>

-- |This module wraps the Expat API directly.  If you use this interface,
-- you must e.g. free your 'Parser' manually.

module Text.XML.Expat.Raw (
  -- ** Parser Setup
  Parser, parserCreate, parserFree, parse,

  -- ** Parser Callbacks
  StartElementHandler, EndElementHandler, CharacterDataHandler,
  setStartElementHandler, setEndElementHandler, setCharacterDataHandler
) where

import C2HS

#include <expat.h>
