Skip to content

Commit

Permalink
Fix modperl and modpython compilation.
Browse files Browse the repository at this point in the history
Also fix few string-related inconsistences.
  • Loading branch information
DarthGandalf committed Aug 14, 2012
1 parent e06c3f5 commit 9fd4149
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/znc/Buffer.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class CClient;


class CBufLine { class CBufLine {
public: public:
CBufLine() { throw 0; } // shouldn't be called, but is needed for compilation
CBufLine(const CString& sFormat, const CString& sText = "", const timeval* ts = 0); CBufLine(const CString& sFormat, const CString& sText = "", const timeval* ts = 0);
~CBufLine(); ~CBufLine();
CString GetLine(const CClient& Client, const MCString& msParams) const; CString GetLine(const CClient& Client, const MCString& msParams) const;
Expand All @@ -46,6 +47,8 @@ class CBufLine {


class CBuffer : private std::deque<CBufLine> { class CBuffer : private std::deque<CBufLine> {
public: public:
typedef typename std::deque<CBufLine>::size_type size_type;

CBuffer(unsigned int uLineCount = 100); CBuffer(unsigned int uLineCount = 100);
~CBuffer(); ~CBuffer();


Expand Down
2 changes: 2 additions & 0 deletions include/znc/Utils.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class CException {
*/ */
class CTable : protected std::vector<std::vector<CString> > { class CTable : protected std::vector<std::vector<CString> > {
public: public:
typedef typename std::vector<std::vector<CString> >::size_type size_type;

CTable() {} CTable() {}
virtual ~CTable() {} virtual ~CTable() {}


Expand Down
5 changes: 4 additions & 1 deletion modules/modperl/CString.i
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@




%feature("naturalvar") CString; %feature("naturalvar") CString;
class CString; class CString {
public:
typedef size_t size_type;
};




/*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/ /*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/
Expand Down
7 changes: 7 additions & 0 deletions modules/modperl/modperl.i
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "../include/znc/FileUtils.h" #include "../include/znc/FileUtils.h"
#include "../include/znc/ZNCDebug.h" #include "../include/znc/ZNCDebug.h"
#include "../include/znc/ExecSock.h" #include "../include/znc/ExecSock.h"
#include "../include/znc/Buffer.h"
#include "modperl/module.h" #include "modperl/module.h"
#define stat struct stat #define stat struct stat
%} %}
Expand All @@ -50,6 +51,7 @@
%include <typemaps.i> %include <typemaps.i>
%include <stl.i> %include <stl.i>
%include <std_list.i> %include <std_list.i>
%include <std_deque.i>


namespace std { namespace std {
template<class K> class set { template<class K> class set {
Expand Down Expand Up @@ -78,6 +80,8 @@ namespace std {


%template(VIRCNetworks) std::vector<CIRCNetwork*>; %template(VIRCNetworks) std::vector<CIRCNetwork*>;
%template(VChannels) std::vector<CChan*>; %template(VChannels) std::vector<CChan*>;
%template(VCString) std::vector<CString>;
typedef std::vector<CString> VCString;
/*%template(MNicks) std::map<CString, CNick>;*/ /*%template(MNicks) std::map<CString, CNick>;*/
/*%template(SModInfo) std::set<CModInfo>; /*%template(SModInfo) std::set<CModInfo>;
%template(SCString) std::set<CString>; %template(SCString) std::set<CString>;
Expand All @@ -86,6 +90,8 @@ typedef std::set<CString> SCString;*/
class MCString : public std::map<CString, CString> {}; class MCString : public std::map<CString, CString> {};
/*%template(PerlModulesVector) std::vector<CModule*>;*/ /*%template(PerlModulesVector) std::vector<CModule*>;*/
%template(VListeners) std::vector<CListener*>; %template(VListeners) std::vector<CListener*>;
%template(BufLines) std::deque<CBufLine>;
%template(VVString) std::vector<VCString>;


%typemap(out) std::map<CString, CNick> { %typemap(out) std::map<CString, CNick> {
HV* myhv = newHV(); HV* myhv = newHV();
Expand Down Expand Up @@ -124,6 +130,7 @@ class MCString : public std::map<CString, CString> {};
%include "../include/znc/Server.h" %include "../include/znc/Server.h"
%include "../include/znc/ZNCDebug.h" %include "../include/znc/ZNCDebug.h"
%include "../include/znc/ExecSock.h" %include "../include/znc/ExecSock.h"
%include "../include/znc/Buffer.h"


%include "modperl/module.h" %include "modperl/module.h"


Expand Down
5 changes: 4 additions & 1 deletion modules/modpython/cstring.i
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
%} %}


%feature("naturalvar") CString; %feature("naturalvar") CString;
class CString; class CString {
public:
typedef size_t size_type;
};


/*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/ /*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/


Expand Down
5 changes: 5 additions & 0 deletions modules/modpython/modpython.i
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ using std::allocator;
%include <stl.i> %include <stl.i>
%include <std_list.i> %include <std_list.i>
%include <std_set.i> %include <std_set.i>
%include <std_deque.i>


%include "modpython/cstring.i" %include "modpython/cstring.i"
%template(_stringlist) std::list<CString>; %template(_stringlist) std::list<CString>;
Expand All @@ -67,11 +68,15 @@ using std::allocator;
%template(SModInfo) std::set<CModInfo>; %template(SModInfo) std::set<CModInfo>;
%template(SCString) std::set<CString>; %template(SCString) std::set<CString>;
typedef std::set<CString> SCString; typedef std::set<CString> SCString;
%template(VCString) std::vector<CString>;
typedef std::vector<CString> VCString;
%template(PyMCString) std::map<CString, CString>; %template(PyMCString) std::map<CString, CString>;
%template(PyMStringVString) std::map<CString, VCString>; %template(PyMStringVString) std::map<CString, VCString>;
class MCString : public std::map<CString, CString> {}; class MCString : public std::map<CString, CString> {};
%template(PyModulesVector) std::vector<CModule*>; %template(PyModulesVector) std::vector<CModule*>;
%template(VListeners) std::vector<CListener*>; %template(VListeners) std::vector<CListener*>;
%template(BufLines) std::deque<CBufLine>;
%template(VVString) std::vector<VCString>;


%typemap(in) CString& { %typemap(in) CString& {
String* p; String* p;
Expand Down

0 comments on commit 9fd4149

Please sign in to comment.