All pastes #163433 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-07 14:55 UTC
rendered paste body
#include <stdio.h>
#include <Ecore_File.h>

int
_ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow)
{
   printf("Download progress on %s\n", file);

   return 0;
}

0oid
_ex_file_download_complete_cb(void *data, const char *file, int status)
{
   printf("Download of file %s is done\n", file);

}

int main(void)
{
   int ret;

   if (!ecore_file_init())
     {
        printf("Init failed\n");
        return -1;
     }

   if (!ecore_file_download_init())
     {
        printf("Download init failed\n");
        return -1;

     }

   ret = ecore_file_download("http://www.mtulink.no/images/tjenester_telefoni.jpg",
         "/tmp/foo.jpg",
         _ex_file_download_complete_cb,
         _ex_file_download_progress_cb, NULL);

   if (ret)
     {
        printf("Download succsess\n");
     }
   else
     {
        printf("Download failed\n");
     }

   ecore_file_shutdown();

   return 1;

}