Support OnClientCapLs in modpython #98

This commit is contained in:
Alexey Sokolov
2012-07-28 01:37:58 +07:00
parent 592b5d158d
commit 219e6a97ce
4 changed files with 5 additions and 1 deletions

View File

@@ -261,7 +261,7 @@ while (<$in>) {
when (/vector\s*<\s*.*\*\s*>/) {
say $out "PyList_New(0);";
}
when (/CString/) {
when (/(?:^|\s)CString/) { # not SCString
if ($a->{base} eq 'CString' && $a->{mod} eq '&') {
say $out "CPyRetString::wrap($a->{var});";
} else {

View File

@@ -72,3 +72,4 @@ EModRet OnModuleLoading(const CString& sModName, const CString& sArgs, CModInfo:
EModRet OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg)
EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule, bool& bSuccess, CString& sRetMsg)
void OnGetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType)
void OnClientCapLs(CClient* pClient, SCString& ssCaps)

View File

@@ -65,6 +65,8 @@ using std::allocator;
%template(VChannels) std::vector<CChan*>;
%template(MNicks) std::map<CString, CNick>;
%template(SModInfo) std::set<CModInfo>;
%template(SCString) std::set<CString>;
typedef std::set<CString> SCString;
%typemap(in) CString& {
String* p;

View File

@@ -123,6 +123,7 @@ public:
virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg);
virtual void OnGetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType);
virtual void OnClientCapLs(CClient* pClient, SCString& ssCaps);
};
static inline CPyModule* AsPyModule(CModule* p) {