Exemplo n.º 1
0
void lp_config_remove_section(LpConfig *lpconfig, LpSection *section){
#ifdef HAVE_SQLITE3
	char szSQL[128];
	sprintf(szSQL,"DELETE FROM ua_config WHERE  section = '%s';",section->name);

	if(!lpconfig->db)
	{
		if (sqlite3_open(lpconfig->filename,&lpconfig->db) == SQLITE_OK)
		{
			sqlite3_key(lpconfig->db,SQLITE3_KEY,SQLITE3_KEY_LEN);

			sqlite3_exec(lpconfig->db,szSQL,0,0, 0);
			ms_message("lp_config_remove_section: sqlite3_exec %s", szSQL);
			sqlite3_close(lpconfig->db);
		}
		lpconfig->db = NULL;	
	}else
	{
		sqlite3_exec(lpconfig->db,szSQL,0,0, 0);
		ms_message("lp_config_remove_section: sqlite3_exec %s", szSQL);
	}

#endif
	lpconfig->sections=ms_list_remove(lpconfig->sections,(void *)section);
	lp_section_destroy(section);
}
Exemplo n.º 2
0
void lp_config_remove_section(LpConfig *lpconfig, LpSection *section){
	lpconfig->sections=ms_list_remove(lpconfig->sections,(void *)section);
	lp_section_destroy(section);
}