getService :: ForeignPtr SessionImpl
           -> CString
           -> IO (Either String (Service, ForeignPtr ServiceImpl))
getService s serName = withForeignPtr s $ \p ->
     alloca $ \rHandle -> do
       rc <- blpapi_Session_getService p rHandle serName
       if (rc /= 0)
       then getErrorString rc >>= (return . Left)
       else do
         sImpl <- peek rHandle
         blpapi_Service_addRef sImpl
         ser <- convertServiceImpl sImpl
         fsImpl <- newForeignPtr blpapi_Service_release sImpl
         return $ Right (ser, fsImpl)
getService :: ForeignPtr SessionImpl
           -> CString
           -> IO (Either String (Service, ForeignPtr ServiceImpl))
getService s serName = withForeignPtr s $ \p ->
     alloca $ \rHandle -> do
       rc <- blpapi_Session_getService p rHandle serName
       if (rc /= 0)
       then getErrorString rc >>= (return . Left)
       else do
         sImpl <- peek rHandle
         blpapi_Service_addRef sImpl
         ser <- convertServiceImpl sImpl
         fsImpl <- newForeignPtr blpapi_Service_release sImpl
         return $ Right (ser, fsImpl)
getService s serName = withForeignPtr s $ \p ->
     alloca $ \rHandle -> do
       rc <- blpapi_Session_getService p rHandle serName
       if (rc /= 0)
       then getErrorString rc >>= (return . Left)
       else do
         sImpl <- peek rHandle
         blpapi_Service_addRef sImpl
         ser <- convertServiceImpl sImpl
         fsImpl <- newForeignPtr blpapi_Service_release sImpl
         return $ Right (ser, fsImpl)