pstcache.c revision 4b9d6701570cb98fd36e209314239d104ec584d3
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Persistent Bitmap Cache routines
Copyright (C) Jeroen Meijer 2004-2007
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Oracle GPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the General Public License version 2 (GPLv2) at this time for any software where
* a choice of GPL license versions is made available with the language indicating
* that GPLv2 or any later version may be used, or where a choice of which version
* of the GPL is applied is otherwise unspecified.
*/
#include "rdesktop.h"
extern int g_server_depth;
extern RD_BOOL g_bitmap_cache;
extern RD_BOOL g_bitmap_cache_persist_enable;
extern RD_BOOL g_bitmap_cache_precache;
int g_pstcache_fd[8];
int g_pstcache_Bpp;
void
{
int fd;
return;
}
/* Load a bitmap from the persistent cache */
{
int fd;
return False;
return False;
return True;
}
/* Store a bitmap in the persistent cache */
{
int fd;
return False;
return True;
}
/* List the bitmap keys from the persistent cache file */
int
{
int fd, n;
return 0;
/* The server disconnects if the bitmap cache content is sent more than once */
return 0;
DEBUG_RDP5(("Persistent bitmap cache enumeration... "));
{
break;
{
/* Pre-cache (not possible for 8 bit colour depth cause it needs a colourmap) */
/* Sort by stamp */
{
}
}
else
{
break;
}
}
return idx;
}
/* initialise the persistent bitmap cache */
{
int fd;
char filename[256];
return True;
g_pstcache_fd[cache_id] = 0;
if (!(g_bitmap_cache && g_bitmap_cache_persist_enable))
return False;
if (!rd_pstcache_mkdir())
{
return False;
}
if (fd == -1)
return False;
if (!rd_lock_file(fd, 0, 0))
{
warning("Persistent bitmap caching is disabled. (The file is already in use)\n");
return False;
}
return True;
}