Example #1
0
int ape_mysql_connect(acetables *g_ape)
{
	MYSQL *mysql = mysql_instance(g_ape);
	
	if (!mysql_real_connect(mysql, READ_CONF("db_server"), READ_CONF("db_user"), READ_CONF("db_password"), READ_CONF("db_name"), 0, NULL, 0)) { // Faire une function generique
		return 0;
	}
	mysql->reconnect = 1;
	return 1;
}
SpectralDimensionObservable::SpectralDimensionObservable(unsigned int writeFrequency) :
Observable(writeFrequency, 0, true),
sigmaMax(READ_CONF("spec.sigmaMax", 1000)),
diffusionConst(READ_CONF("spec.diff", 1.0)),
dualLattice(READ_CONF("spec.dualLattice", false)),
filename(createFilename("specdim")),
file(filename.c_str()),
specDim(sigmaMax),
specDim1(sigmaMax) {
}
Example #3
0
void ANO_Param::Init(void)
{

	if(READ_FirstInitFlag()!= FirstInitFlag)	//板子从未初始化
	{
		SAVE_PID();
	}
	
	READ_CONF();
	SAVE_FirstInitFlag();
	
}
static unsigned int cmd_control(callbackp *callbacki)
{
	CHANNEL *jchan;
	
	if (strcmp(callbacki->param[1], READ_CONF("password")) != 0) {
		SENDH(callbacki->fdclient, "ERR BAD_PASSWORD", callbacki->g_ape);
		
	} else if ((jchan = getchan(callbacki->param[2], callbacki->g_ape)) == NULL) {
		SENDH(callbacki->fdclient, "ERR NOT_A_CHANNEL", callbacki->g_ape);
		
	} else {
		if (strcasecmp(callbacki->param[3], "POSTMSG") == 0) {
			send_msg_channel(jchan, callbacki->param[5], callbacki->param[4], callbacki->g_ape);
			SENDH(callbacki->fdclient, "OK POSTED", callbacki->g_ape);
		}
	}
	return (FOR_NOTHING);
}