Mercurial > mplayer.hg
annotate stream/http.h @ 29588:17d7ae586d03
Reduce code duplication for half/normal/double video size handling.
author | reimar |
---|---|
date | Wed, 02 Sep 2009 14:02:15 +0000 |
parents | 0f1b5b68af32 |
children | ce0122361a39 |
rev | line source |
---|---|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26184
diff
changeset
|
1 /* |
902 | 2 * HTTP Helper |
3 * by Bertrand Baudet <bertrand_baudet@yahoo.com> | |
4 * (C) 2001, MPlayer team. | |
5 */ | |
6 | |
26029 | 7 #ifndef MPLAYER_HTTP_H |
8 #define MPLAYER_HTTP_H | |
870 | 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 | 12 typedef struct HTTP_field_type { |
13 char *field_name; | |
14 struct HTTP_field_type *next; | |
15 } HTTP_field_t; | |
870 | 16 |
17 typedef struct { | |
18 char *protocol; | |
19 char *method; | |
20 char *uri; | |
7953 | 21 unsigned int status_code; |
870 | 22 char *reason_phrase; |
7953 | 23 unsigned int http_minor_version; |
3039 | 24 // Field variables |
25 HTTP_field_t *first_field; | |
26 HTTP_field_t *last_field; | |
7953 | 27 unsigned int field_nb; |
870 | 28 char *field_search; |
3039 | 29 HTTP_field_t *field_search_pos; |
6514 | 30 // Body variables |
870 | 31 char *body; |
7953 | 32 size_t body_size; |
902 | 33 char *buffer; |
7953 | 34 size_t buffer_size; |
35 unsigned int is_parsed; | |
870 | 36 } HTTP_header_t; |
37 | |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
7953
diff
changeset
|
38 HTTP_header_t* http_new_header(void); |
870 | 39 void http_free( HTTP_header_t *http_hdr ); |
902 | 40 int http_response_append( HTTP_header_t *http_hdr, char *data, int length ); |
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 | 43 char* http_build_request( HTTP_header_t *http_hdr ); |
870 | 44 char* http_get_field( HTTP_header_t *http_hdr, const char *field_name ); |
45 char* http_get_next_field( HTTP_header_t *http_hdr ); | |
3039 | 46 void http_set_field( HTTP_header_t *http_hdr, const char *field_name ); |
870 | 47 void http_set_method( HTTP_header_t *http_hdr, const char *method ); |
48 void http_set_uri( HTTP_header_t *http_hdr, const char *uri ); | |
6514 | 49 int http_add_basic_authentication( HTTP_header_t *http_hdr, const char *username, const char *password ); |
870 | 50 |
51 void http_debug_hdr( HTTP_header_t *http_hdr ); | |
52 | |
6514 | 53 int base64_encode(const void *enc, int encLen, char *out, int outMax); |
26029 | 54 #endif /* MPLAYER_HTTP_H */ |