~ubuntu-branches/ubuntu/warty/curl/warty-security

« back to all changes in this revision

Viewing changes to docs/examples/sepheaders.c

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2004-06-04 19:09:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040604190925-wy048bp31320r2z6
Tags: 7.12.0.is.7.11.2-1
* Reverted to version 7.11.2 (closes: #252348).
* Disabled support for libidn (closes: #252367). This is to leave
  curl in unstable as much similar as possible to the one in testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___ 
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: sepheaders.c,v 1.3 2001/05/15 12:55:35 bagder Exp $
 
8
 * $Id: sepheaders.c,v 1.6 2003/11/19 08:21:34 bagder Exp $
9
9
 */
10
10
 
11
 
/* to make this work under windows, use the win32-functions from the
12
 
   win32socket.c file as well */
13
 
 
14
11
#include <stdio.h>
15
12
#include <stdlib.h>
16
13
#include <unistd.h>
21
18
 
22
19
size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
23
20
{
24
 
  written = fwrite(ptr, size, nmemb, (FILE *)stream);
 
21
  int written = fwrite(ptr, size, nmemb, (FILE *)stream);
25
22
  return written;
26
23
}
27
24
 
33
30
  char *bodyfilename = "body.out";
34
31
  FILE *bodyfile;
35
32
 
 
33
  curl_global_init(CURL_GLOBAL_ALL);
 
34
 
36
35
  /* init the curl session */
37
36
  curl_handle = curl_easy_init();
38
37
 
63
62
  /* we want the headers to this file handle */
64
63
  curl_easy_setopt(curl_handle,   CURLOPT_WRITEHEADER ,headerfile);
65
64
 
 
65
  /*
 
66
   * Notice here that if you want the actual data sent anywhere else but
 
67
   * stdout, you should consider using the CURLOPT_WRITEDATA option.  */
 
68
 
66
69
  /* get it! */
67
70
  curl_easy_perform(curl_handle);
68
71