int
dav_save_lock_database(const char *filepath)
{
	XML_TREE *tree = NULL;
	DAV_LOCKENTRY_INFO *lockentry_cursor = NULL;
	HTTP_FILE_STORAGE *storage = NULL;
	int error;
	if(global_lock_database != NULL)
	{
		if((error = xml_tree_create(&tree)) != XT_OK)
		{
			return error;
		}
		if((error = xml_tree_start_node(tree, "dav_lockentry_database", "http://davim.sourceforge.net/")) != XT_OK)
		{
			xml_tree_destroy(&tree);
			return error;
		}
		for(lockentry_cursor = global_lock_database->first_lockentry; lockentry_cursor != NULL; lockentry_cursor = lockentry_cursor->next_lockentry)
		{
			if((error = xml_tree_start_node(tree, "lockentry_info", "http://davim.sourceforge.net/")) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
			if((error = xml_tree_add_node(tree, "host", "http://davim.sourceforge.net/", lockentry_cursor->host)) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
			if((error = xml_tree_add_node(tree, "resource", "http://davim.sourceforge.net/", lockentry_cursor->resource)) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
			if((error = xml_tree_add_node(tree, "locktoken", "http://davim.sourceforge.net/", lockentry_cursor->locktoken)) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
			if((error = xml_tree_add_node(tree, "owner", "http://davim.sourceforge.net/", lockentry_cursor->owner)) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
			if((error = xml_tree_add_node(tree, "depth", "http://davim.sourceforge.net/", get_depth_str(lockentry_cursor->depth))) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
			if((error = xml_tree_close_node(tree, "lockentry_info", "http://davim.sourceforge.net/")) != XT_OK)
			{
				xml_tree_destroy(&tree);
				return error;
			}
		}
		if((error = xml_tree_close_node(tree, "dav_lockentry_database", "http://davim.sourceforge.net/")) != XT_OK)
		{
			xml_tree_destroy(&tree);
			return error;
		}
		if((error = http_create_file_storage(&storage, filepath, "w+")) != HT_OK)
		{
			xml_tree_destroy(&tree);
			return error;
		}
		if((error = xml_tree_write_to_storage(tree, (HTTP_STORAGE *) storage)) != XT_OK)
		{
			http_storage_destroy(&storage);
			xml_tree_destroy(&tree);
			return error;
		}
		http_storage_close(storage);
		http_storage_destroy(&storage);
		xml_tree_destroy(&tree);
	}
	return HT_TRUE;
}
static void out_linetoscr_decl (DEPTH_T bpp, HMODE_T hmode, int aga)
{
    outlnf ("static int NOINLINE linetoscr_%s%s%s (int spix, int dpix, int stoppos)",
	    get_depth_str (bpp),
	    get_hmode_str (hmode), aga ? "_aga" : "");
}
Exemple #3
0
{
	va_list ap;
	outindent();
	va_start (ap, s);
	vfprintf (outfile, s, ap);
	fputc ('\n', outfile);
}

static void out_linetoscr_decl (DEPTH_T bpp, HMODE_T hmode, int aga, int spr, int genlock)
{
#ifdef FSUAE
	outlnf ("static int NOINLINE __attribute__((__unused__)) linetoscr_%s%s%s%s%s(int spix, int dpix, int dpix_end)",
#else
	outlnf ("static int NOINLINE linetoscr_%s%s%s%s%s(int spix, int dpix, int dpix_end)",
#endif
		get_depth_str (bpp),
		get_hmode_str (hmode), aga ? "_aga" : "", spr > 0 ? "_spr" : (spr < 0 ? "_spronly" : ""), genlock ? "_genlock" : "");
}

static void out_linetoscr_do_srcpix (DEPTH_T bpp, HMODE_T hmode, int aga, CMODE_T cmode, int spr)
{
	if (spr < 0) {
		outln (     "    sprpix_val = 0;");
	} else {
		if (aga && cmode != CMODE_DUALPF) {
			if (spr)
				outln (     "    sprpix_val = pixdata.apixels[spix];");
			outln ( 	"    spix_val = pixdata.apixels[spix] ^ xor_val;");
		} else if (cmode != CMODE_HAM) {
			outln ( 	"    spix_val = pixdata.apixels[spix];");
			if (spr)