summaryrefslogtreecommitdiffabout
path: root/lib/consumer.cc
authorMichael Krelin <hacker@klever.net>2007-11-21 14:01:36 (UTC)
committer Michael Krelin <hacker@klever.net>2007-11-21 14:01:36 (UTC)
commit8e397698d6a224e36f2b4a188380ec04400aac66 (patch) (unidiff)
treeda7aa7d75f6dd74b8d7260b7ab9c39241726ca88 /lib/consumer.cc
parent10916ef2b15b91badb17af5404acd9981b8a2087 (diff)
downloadlibopkele-8e397698d6a224e36f2b4a188380ec04400aac66.zip
libopkele-8e397698d6a224e36f2b4a188380ec04400aac66.tar.gz
libopkele-8e397698d6a224e36f2b4a188380ec04400aac66.tar.bz2
added some missing includes for gcc 4.3
According to Marcus Rueckert gcc 4.3 wants these. Thanks, Marcus! Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'lib/consumer.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/consumer.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc
index f9212ea..d578546 100644
--- a/lib/consumer.cc
+++ b/lib/consumer.cc
@@ -1,50 +1,51 @@
1#include <algorithm> 1#include <algorithm>
2#include <cassert> 2#include <cassert>
3#include <cstring>
3#include <opkele/util.h> 4#include <opkele/util.h>
4#include <opkele/exception.h> 5#include <opkele/exception.h>
5#include <opkele/data.h> 6#include <opkele/data.h>
6#include <opkele/consumer.h> 7#include <opkele/consumer.h>
7#include <openssl/sha.h> 8#include <openssl/sha.h>
8#include <openssl/hmac.h> 9#include <openssl/hmac.h>
9#include <curl/curl.h> 10#include <curl/curl.h>
10 11
11#include <iostream> 12#include <iostream>
12 13
13#include "config.h" 14#include "config.h"
14 15
15#include <pcre.h> 16#include <pcre.h>
16 17
17namespace opkele { 18namespace opkele {
18 using namespace std; 19 using namespace std;
19 20
20 class pcre_matches_t { 21 class pcre_matches_t {
21 public: 22 public:
22 int *_ov; 23 int *_ov;
23 int _s; 24 int _s;
24 25
25 pcre_matches_t() : _ov(0), _s(0) { } 26 pcre_matches_t() : _ov(0), _s(0) { }
26 pcre_matches_t(int s) : _ov(0), _s(s) { 27 pcre_matches_t(int s) : _ov(0), _s(s) {
27 if(_s&1) ++_s; 28 if(_s&1) ++_s;
28 _s += _s>>1; 29 _s += _s>>1;
29 _ov = new int[_s]; 30 _ov = new int[_s];
30 } 31 }
31 ~pcre_matches_t() throw() { if(_ov) delete[] _ov; } 32 ~pcre_matches_t() throw() { if(_ov) delete[] _ov; }
32 33
33 int begin(int i) const { return _ov[i<<1]; } 34 int begin(int i) const { return _ov[i<<1]; }
34 int end(int i) const { return _ov[(i<<1)+1]; } 35 int end(int i) const { return _ov[(i<<1)+1]; }
35 int length(int i) const { int t=i<<1; return _ov[t+1]-_ov[t]; } 36 int length(int i) const { int t=i<<1; return _ov[t+1]-_ov[t]; }
36 }; 37 };
37 38
38 class pcre_t { 39 class pcre_t {
39 public: 40 public:
40 pcre *_p; 41 pcre *_p;
41 42
42 pcre_t() : _p(0) { } 43 pcre_t() : _p(0) { }
43 pcre_t(pcre *p) : _p(p) { } 44 pcre_t(pcre *p) : _p(p) { }
44 pcre_t(const char *re,int opts) : _p(0) { 45 pcre_t(const char *re,int opts) : _p(0) {
45 static const char *errptr; static int erroffset; 46 static const char *errptr; static int erroffset;
46 _p = pcre_compile(re,opts,&errptr,&erroffset,NULL); 47 _p = pcre_compile(re,opts,&errptr,&erroffset,NULL);
47 if(!_p) 48 if(!_p)
48 throw internal_error(OPKELE_CP_ string("Failed to compile regexp: ")+errptr); 49 throw internal_error(OPKELE_CP_ string("Failed to compile regexp: ")+errptr);
49 } 50 }
50 ~pcre_t() throw() { if(_p) (*pcre_free)(_p); } 51 ~pcre_t() throw() { if(_p) (*pcre_free)(_p); }