Example #1
0
void Syscon_Print(const char *msg) {
    if (input_on) {
        set_raw(false);
    }
    printf("%s", msg);
    fflush(stdout);
    if (input_on) {
        set_raw(true);
    }
}
Example #2
0
void SYS_ShowError(const char *text) {
    if (input_on) {
        set_raw(false);
    }
    printf("Error: %s", text);
    fflush(stdout);
    if (input_on) {
        set_raw(true);
    }
}
Example #3
0
	void unserialize(SerializeFormat format, Extensible* container, const std::string& value) override
	{
		if (value == "1")
			set_raw(container, this);
		else
			unset_raw(container);
	}
Example #4
0
	void set(Extensible* container, bool value)
	{
		if (value)
			set_raw(container, this);
		else
			unset_raw(container);
	}
Example #5
0
	void set(Extensible* item, ssl_cert* value)
	{
		value->refcount_inc();
		ssl_cert* old = static_cast<ssl_cert*>(set_raw(item, value));
		if (old && old->refcount_dec())
			delete old;
	}
Example #6
0
	void unserialize(SerializeFormat format, Extensible* container, const std::string& value)
	{
		if (format == FORMAT_NETWORK)
			return;

		callerid_data* dat = new callerid_data;
		irc::commasepstream s(value);
		std::string tok;
		if (s.GetToken(tok))
			dat->lastnotify = ConvToInt(tok);

		while (s.GetToken(tok))
		{
			User *u = ServerInstance->FindNick(tok);
			if ((u) && (u->registered == REG_ALL) && (!u->quitting))
			{
				if (dat->accepting.insert(u).second)
				{
					callerid_data* other = this->get(u, true);
					other->wholistsme.push_back(dat);
				}
			}
		}

		void* old = set_raw(container, dat);
		if (old)
			this->free(old);
	}
Example #7
0
void Syscon_Cleanup() {

    con_redirectOutput(NULL);
    if (input_on) {
        set_raw(false);
    }
}
Example #8
0
bool Syscon_Init()
{
    input_on = true;
    init_term();
    set_raw(false);
    con_redirectOutput(Syscon_Print);
    return true;
}
Example #9
0
	callerid_data* get(User* user, bool create)
	{
		callerid_data* dat = static_cast<callerid_data*>(get_raw(user));
		if (create && !dat)
		{
			dat = new callerid_data;
			set_raw(user, dat);
		}
		return dat;
	}
Example #10
0
		ExtData* get(Extensible* container, bool create = false)
		{
			ExtData* extdata = static_cast<ExtData*>(get_raw(container));
			if ((!extdata) && (create))
			{
				extdata = new ExtData;
				set_raw(container, extdata);
			}
			return extdata;
		}