コード例 #1
0
ファイル: system.c プロジェクト: KnightOS/libc
void load_library(const char *path) {
	__asm
	POP HL
	POP DE
		PCALL(LOADLIBRARY)
	PUSH DE
	PUSH HL
	__endasm;
	path;
}
コード例 #2
0
ファイル: modperl.cpp プロジェクト: stevestreza/ZNC-Node
	virtual ~CModPerl() {
		if (m_pPerl) {
			PSTART;
			PCALL("ZNC::Core::UnloadAll");
			PEND;
			perl_destruct(m_pPerl);
			perl_free(m_pPerl);
			PERL_SYS_TERM();
		}
	}
コード例 #3
0
ファイル: system.c プロジェクト: KnightOS/libc
void free(void *ptr) {
	__asm
	POP HL
	EX (SP), IX
	PCALL(FREE)
	EX (SP), IX
	JP (HL)
	__endasm;
	ptr;
}
コード例 #4
0
ファイル: modperl.cpp プロジェクト: bpcampbe/znc
CPerlTimer::~CPerlTimer() {
	CPerlModule* pMod = AsPerlModule(GetModule());
	if (pMod) {
		PSTART;
		PUSH_STR(pMod->GetPerlID());
		PUSH_STR(GetPerlID());
		PCALL("ZNC::Core::RemoveTimer");
		PEND;
	}
}
コード例 #5
0
ファイル: modperl.cpp プロジェクト: bpcampbe/znc
void CPerlTimer::RunJob() {
	CPerlModule* pMod = AsPerlModule(GetModule());
	if (pMod) {
		PSTART;
		PUSH_STR(pMod->GetPerlID());
		PUSH_STR(GetPerlID());
		PCALL("ZNC::Core::CallTimer");
		PEND;
	}
}
コード例 #6
0
ファイル: modperl.cpp プロジェクト: stevestreza/ZNC-Node
	virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
			bool& bSuccess, CString& sRetMsg) {
		PSTART;
		PUSH_STR(sModule);
		PCALL("ZNC::Core::GetModInfo");
		EModRet result = CONTINUE;
		if (SvTRUE(ERRSV)) {
			bSuccess = false;
			sRetMsg = PString(ERRSV);
		} else if (0 < ret) {
			switch(static_cast<ELoadPerlMod>(SvUV(ST(0)))) {
				case Perl_NotFound:
					result = CONTINUE;
					break;
				case Perl_Loaded:
					result = HALT;
					if (3 == ret) {
						ModInfo.SetGlobal(false);
						ModInfo.SetDescription(PString(ST(2)));
						ModInfo.SetName(sModule);
						ModInfo.SetPath(PString(ST(1)));
						bSuccess = true;
					} else {
						bSuccess = false;
						sRetMsg = "Something weird happened";
					}
					break;
				case Perl_LoadError:
					result = HALT;
					bSuccess = false;
					if (2 == ret) {
						sRetMsg = PString(ST(1));
					} else {
						sRetMsg = "Something weird happened";
					}
			}
		} else {
			result = HALT;
			bSuccess = false;
			sRetMsg = "Something weird happened";
		}
		PEND;
		DEBUG(__PRETTY_FUNCTION__ << " " << sRetMsg);
		return result;
	}
コード例 #7
0
ファイル: modperl.cpp プロジェクト: stevestreza/ZNC-Node
	ELoadPerlMod LoadPerlModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg) {
		ELoadPerlMod result = Perl_LoadError;
		PSTART;
		PUSH_STR(sModule);
		PUSH_STR(sArgs);
		PUSH_PTR(CUser*, pUser);
		PCALL("ZNC::Core::LoadModule");

		if (SvTRUE(ERRSV)) {
			sRetMsg = PString(ERRSV);
		} else if (2 == ret) {
			result = static_cast<ELoadPerlMod>(SvUV(ST(0)));
			sRetMsg = PString(ST(1));
		}
		DEBUG(__PRETTY_FUNCTION__ << " " << sRetMsg);

		PEND;
		return result;
	}
コード例 #8
0
ファイル: modperl.cpp プロジェクト: stevestreza/ZNC-Node
	virtual EModRet OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg) {
		CPerlModule* pMod = AsPerlModule(pModule);
		if (pMod) {
			CString sModName = pMod->GetModName();
			PSTART;
			PUSH_PTR(CPerlModule*, pMod);
			PCALL("ZNC::Core::UnloadModule");
			if (SvTRUE(ERRSV)) {
				bSuccess = false;
				sRetMsg = PString(ERRSV);
			} else {
				bSuccess = true;
				sRetMsg = "Module [" + sModName + "] unloaded";
			}
			DEBUG(__PRETTY_FUNCTION__ << " " << sRetMsg);
			return HALT;
		}
		return CONTINUE;
	}
コード例 #9
0
ファイル: modperl.cpp プロジェクト: IshaqAzmi/GKZNC
	virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
			bool& bSuccess, CString& sRetMsg) {
		PSTART;
		PUSH_STR(sModule);
		PUSH_PTR(CModInfo*, &ModInfo);
		PCALL("ZNC::Core::GetModInfo");
		EModRet result = CONTINUE;
		if (SvTRUE(ERRSV)) {
			bSuccess = false;
			sRetMsg = PString(ERRSV);
		} else if (0 < ret) {
			switch(static_cast<ELoadPerlMod>(SvUV(ST(0)))) {
				case Perl_NotFound:
					result = CONTINUE;
					break;
				case Perl_Loaded:
					result = HALT;
					if (1 == ret) {
						bSuccess = true;
					} else {
						bSuccess = false;
						sRetMsg = "Something weird happened";
					}
					break;
				case Perl_LoadError:
					result = HALT;
					bSuccess = false;
					if (2 == ret) {
						sRetMsg = PString(ST(1));
					} else {
						sRetMsg = "Something weird happened";
					}
			}
		} else {
			result = HALT;
			bSuccess = false;
			sRetMsg = "Something weird happened";
		}
		PEND;
		return result;
	}