annotate stream/http.h @ 29250:bc5115226204

Get rid of some more trailing whitespace
author reynaldo
date Tue, 12 May 2009 02:33:28 +0000
parents 7ee4ae1648e6
children 0f1b5b68af32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
1 /*
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
2 * HTTP Helper
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
3 * by Bertrand Baudet <bertrand_baudet@yahoo.com>
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
4 * (C) 2001, MPlayer team.
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
5 */
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
6
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 23689
diff changeset
7 #ifndef MPLAYER_HTTP_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 23689
diff changeset
8 #define MPLAYER_HTTP_H
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
9
26184
7ee4ae1648e6 Add missing header #includes to fix 'make checkheaders'.
diego
parents: 26029
diff changeset
10 #include <sys/types.h>
7ee4ae1648e6 Add missing header #includes to fix 'make checkheaders'.
diego
parents: 26029
diff changeset
11
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
12 typedef struct HTTP_field_type {
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
13 char *field_name;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
14 struct HTTP_field_type *next;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
15 } HTTP_field_t;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
16
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
17 typedef struct {
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
18 char *protocol;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
19 char *method;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
20 char *uri;
7953
60624e692b95 GCC warning fixes
bertrand
parents: 6514
diff changeset
21 unsigned int status_code;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
22 char *reason_phrase;
7953
60624e692b95 GCC warning fixes
bertrand
parents: 6514
diff changeset
23 unsigned int http_minor_version;
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
24 // Field variables
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
25 HTTP_field_t *first_field;
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
26 HTTP_field_t *last_field;
7953
60624e692b95 GCC warning fixes
bertrand
parents: 6514
diff changeset
27 unsigned int field_nb;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
28 char *field_search;
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
29 HTTP_field_t *field_search_pos;
6514
37b0b3302395 Added base64 encoder
bertrand
parents: 3039
diff changeset
30 // Body variables
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
31 char *body;
7953
60624e692b95 GCC warning fixes
bertrand
parents: 6514
diff changeset
32 size_t body_size;
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
33 char *buffer;
7953
60624e692b95 GCC warning fixes
bertrand
parents: 6514
diff changeset
34 size_t buffer_size;
60624e692b95 GCC warning fixes
bertrand
parents: 6514
diff changeset
35 unsigned int is_parsed;
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
36 } HTTP_header_t;
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
37
17566
f580a7755ac5 Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents: 7953
diff changeset
38 HTTP_header_t* http_new_header(void);
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
39 void http_free( HTTP_header_t *http_hdr );
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
40 int http_response_append( HTTP_header_t *http_hdr, char *data, int length );
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
41 int http_response_parse( HTTP_header_t *http_hdr );
2489
0ecc1b4f7cf8 Added ASF http server streaming (Not mms streaming).
bertrand
parents: 2310
diff changeset
42 int http_is_header_entire( HTTP_header_t *http_hdr );
902
ede5785faa53 Bugs fix, improvements...
bertrand
parents: 870
diff changeset
43 char* http_build_request( HTTP_header_t *http_hdr );
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
44 char* http_get_field( HTTP_header_t *http_hdr, const char *field_name );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
45 char* http_get_next_field( HTTP_header_t *http_hdr );
3039
80189681c02b Removed the field number limitation.
bertrand
parents: 2489
diff changeset
46 void http_set_field( HTTP_header_t *http_hdr, const char *field_name );
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
47 void http_set_method( HTTP_header_t *http_hdr, const char *method );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
48 void http_set_uri( HTTP_header_t *http_hdr, const char *uri );
6514
37b0b3302395 Added base64 encoder
bertrand
parents: 3039
diff changeset
49 int http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, const char *password );
870
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
50
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
51 void http_debug_hdr( HTTP_header_t *http_hdr );
f641c96e431b Some simple code to handle HTTP requests/responses.
bertrand
parents:
diff changeset
52
6514
37b0b3302395 Added base64 encoder
bertrand
parents: 3039
diff changeset
53 int base64_encode(const void *enc, int encLen, char *out, int outMax);
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 23689
diff changeset
54 #endif /* MPLAYER_HTTP_H */