title: libcurl c CURLOPT_PROGRESSFUNCTION
body: <p>I need to know the status of my download using libcurl in C. I found that I have to use CURLOPT_PROGRESSFUNCTION.</p>
  
  <pre><code>int progress_func(void* ptr, double TotalToDownload, double NowDownloaded, 
                      double TotalToUpload, double NowUploaded)
  {
     //Bla bla
  }
  
  curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
  curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func);
  </code></pre>
  
  <p>I can't understand two things:
  1) This function progress_func "how often" is called?
  2) How can I pass other parameters to progress_func function? Because I have to write the connection status (speed, tot downloaded) in a file with a variable url, so I have to pass this url to the function.</p>
  
  <p>Thanks</p>