~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/input/httpInputStream.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  reads input data
 
3
  Copyright (C) 1999  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#ifndef __HTTPINPUTSTREAM_H
 
15
#define __HTTPINPUTSTREAM_H
 
16
 
 
17
 
 
18
#include "inputStream.h"
 
19
 
 
20
#ifndef __STRICT_ANSI__
 
21
#define __STRICT_ANSI__
 
22
#endif
 
23
 
 
24
#include <stdlib.h>
 
25
#include <string.h>
 
26
 
 
27
 
 
28
 
 
29
#if defined WIN32
 
30
#include <io.h>
 
31
#define SOCKETWRITEFUNC _write
 
32
#else
 
33
 
 
34
extern "C" {
 
35
#include <netdb.h>
 
36
#include <sys/param.h>
 
37
#include <sys/socket.h>
 
38
#include <netinet/in.h>
 
39
#include <arpa/inet.h>
 
40
           }
 
41
#define SOCKETWRITEFUNC write
 
42
#endif
 
43
 
 
44
#include <sys/types.h>
 
45
#include <errno.h>
 
46
 
 
47
class HttpInputStream : public InputStream{
 
48
 
 
49
  long byteCnt;
 
50
  
 
51
 public:
 
52
  HttpInputStream();
 
53
  ~HttpInputStream();
 
54
 
 
55
  int open(const char* dest);
 
56
  void close();
 
57
  int isOpen();
 
58
 
 
59
  int eof();
 
60
  int read(char* ptr,int size);
 
61
  int seek(long bytePos);
 
62
 
 
63
  long getByteLength();
 
64
  long getBytePosition();
 
65
 
 
66
  void print();
 
67
 
 
68
 private:
 
69
 
 
70
  FILE* fp;
 
71
  int  size;
 
72
  
 
73
  int writestring(int fd,char *string);
 
74
  int readstring(char *string,int maxlen,FILE *f);
 
75
  FILE* http_open(char *url); 
 
76
 
 
77
  char* proxyurl;
 
78
  unsigned long proxyip;
 
79
  unsigned int proxyport;
 
80
 
 
81
  int lopen;
 
82
 
 
83
};
 
84
#endif