------------------------------------------------------------------------------
--                              adacurl.easy                                --
--                             Specification                                --
--                    Copyright (C) 2003 Andreas Almroth                    --
--                                                                          --
-- AdacURL is free  software; you  can  redistribute it  and/or modify it   --
-- under terms of the  GNU General Public License as published by the Free  --
-- Software Foundation; either version 2,  or (at your option) any later    --
-- version.  AdacURL is distributed in the  hope that it will be useful,    --
-- but  WITH  OUT  ANY  WARRANTY;  without  even the  implied  warranty  of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details.  You should have received a copy of the --
-- GNU General Public License distributed with AdacURL;  see file COPYING. --
-- If not,  write  to  the Free  Software  Foundation, 59 Temple Place -    --
-- Suite 330, Boston, MA 02111-1307, USA.                                   --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
------------------------------------------------------------------------------
-- $Author: Andreas Almroth $
-- $Date: 03-07-29 17:15 $
-- $Workfile: adacurl-easy.ads $
-- $Revision: 1 $
-- $State: Unstable $
--
-- HISTORY:
--
-- Revision 1: Initial release
--

with Adacurl;

package Adacurl.Easy is

   function Curl_Easy_Init return CURL_P;

   ---------------------------------------------------------------------------
   -- Overload function with the possible types
   ---------------------------------------------------------------------------
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Chars_Ptr) return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Long) return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Double) return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Curl_Readwrite_Callback)
                            return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Curl_Passwd_Callback) return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Curl_Progress_Callback) return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : Curl_Ssl_Ctx_Callback) return CURLcode;
   function Curl_Easy_Setopt(C : CURL_P;
                             Option : CURLoption;
                             Datap  : File_P) return CURLcode;

   function Curl_Easy_Perform(C : CURL_P) return CURLcode;

   procedure Curl_Easy_Cleanup(C : CURL_P);

   ---------------------------------------------------------------------------
   -- Overload function with the three possible types; string, long or double
   ---------------------------------------------------------------------------
   function Curl_Easy_Getinfo(C : CURL_P;
                              Option : CURLINFO;
                              Datap  : access Chars_Ptr) return CURLcode;
   function Curl_Easy_Getinfo(C : CURL_P;
                              Option : CURLINFO;
                              Datap  : access Long) return CURLcode;
   function Curl_Easy_Getinfo(C : CURL_P;
                              Option : CURLINFO;
                              Datap  : access Double) return CURLcode;

   function Curl_Easy_Duphandle(C : CURL_P) return CURL_P;

private
   pragma Import(C,Curl_Easy_Init,"curl_easy_init");
   pragma Import(C,Curl_Easy_Setopt,"curl_easy_setopt");
   pragma Import(C,Curl_Easy_Perform,"curl_easy_perform");
   pragma Import(C,Curl_Easy_Cleanup,"curl_easy_cleanup");
   pragma Import(C,Curl_Easy_Getinfo,"curl_easy_getinfo");
   pragma Import(C,Curl_Easy_Duphandle,"curl_easy_duphandle");
end Adacurl.Easy;