~ubuntu-branches/ubuntu/hardy/rdesktop/hardy-security

« back to all changes in this revision

Viewing changes to pstcache.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2006-10-17 21:31:16 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061017213116-tx5px198eujcbs10
Tags: 1.5.0-1
* New upstream release (closes: #393520), accept Victor's change
  (closes: #343946).
* New maintainer with ACK from Tomas.
* Tune packaging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
 
1
/* -*- c-basic-offset: 8 -*-
2
2
   rdesktop: A Remote Desktop Protocol client.
3
3
   Persistent Bitmap Cache routines
4
4
   Copyright (C) Jeroen Meijer 2004-2005
24
24
 
25
25
#define IS_PERSISTENT(id) (id < 8 && g_pstcache_fd[id] > 0)
26
26
 
27
 
extern int g_server_bpp;
 
27
extern int g_server_depth;
28
28
extern BOOL g_bitmap_cache;
29
29
extern BOOL g_bitmap_cache_persist_enable;
30
30
extern BOOL g_bitmap_cache_precache;
81
81
/* Store a bitmap in the persistent cache */
82
82
BOOL
83
83
pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * key,
84
 
                     uint16 width, uint16 height, uint16 length, uint8 * data)
 
84
                     uint8 width, uint8 height, uint16 length, uint8 * data)
85
85
{
86
86
        int fd;
87
87
        CELLHEADER cellhdr;
107
107
int
108
108
pstcache_enumerate(uint8 id, HASH_KEY * keylist)
109
109
{
110
 
        int fd, idx, n;
 
110
        int fd, n;
 
111
        uint16 idx;
111
112
        sint16 mru_idx[0xa00];
112
113
        uint32 mru_stamp[0xa00];
113
114
        CELLHEADER cellhdr;
131
132
                {
132
133
                        memcpy(keylist[idx], cellhdr.key, sizeof(HASH_KEY));
133
134
 
134
 
                        /* Pre-cache (not possible for 8bpp because 8bpp needs a colourmap) */
135
 
                        if (g_bitmap_cache_precache && cellhdr.stamp && g_server_bpp > 8)
 
135
                        /* Pre-cache (not possible for 8 bit colour depth cause it needs a colourmap) */
 
136
                        if (g_bitmap_cache_precache && cellhdr.stamp && g_server_depth > 8)
136
137
                                pstcache_load_bitmap(id, idx);
137
138
 
138
139
                        /* Sort by stamp */
179
180
                return False;
180
181
        }
181
182
 
182
 
        g_pstcache_Bpp = (g_server_bpp + 7) / 8;
 
183
        g_pstcache_Bpp = (g_server_depth + 7) / 8;
183
184
        sprintf(filename, "cache/pstcache_%d_%d", cache_id, g_pstcache_Bpp);
184
185
        DEBUG(("persistent bitmap cache file: %s\n", filename));
185
186