/[rdesktop]/sourceforge.net/trunk/rdesktop/pstcache.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/pstcache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 725 by jsorg71, Sun Jun 27 17:51:54 2004 UTC revision 738 by astrand, Mon Jul 12 21:07:39 2004 UTC
# Line 20  Line 20 
20    
21  #include "rdesktop.h"  #include "rdesktop.h"
22    
23  #define MAX_CELL_SIZE           0x1000                  /* pixels */  #define MAX_CELL_SIZE           0x1000  /* pixels */
24    
25  #define IS_PERSISTENT(id) (g_pstcache_fd[id] > 0)  #define IS_PERSISTENT(id) (g_pstcache_fd[id] > 0)
26    
# Line 33  extern BOOL g_bitmap_cache_precache; Line 33  extern BOOL g_bitmap_cache_precache;
33  int g_pstcache_fd[8];  int g_pstcache_fd[8];
34  int g_pstcache_Bpp;  int g_pstcache_Bpp;
35  BOOL g_pstcache_enumerated = False;  BOOL g_pstcache_enumerated = False;
36  uint8 zero_id[] = {0, 0, 0, 0, 0, 0, 0, 0};  uint8 zero_id[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
37    
38    
39  /* Update usage info for a bitmap */  /* Update usage info for a bitmap */
# Line 65  pstcache_load_bitmap(uint8 cache_id, uin Line 65  pstcache_load_bitmap(uint8 cache_id, uin
65          fd = g_pstcache_fd[cache_id];          fd = g_pstcache_fd[cache_id];
66          rd_lseek_file(fd, cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));          rd_lseek_file(fd, cache_idx * (g_pstcache_Bpp * MAX_CELL_SIZE + sizeof(CELLHEADER)));
67          rd_read_file(fd, &cellhdr, sizeof(CELLHEADER));          rd_read_file(fd, &cellhdr, sizeof(CELLHEADER));
68          celldata = (uint8 *)xmalloc(cellhdr.length);          celldata = (uint8 *) xmalloc(cellhdr.length);
69          rd_read_file(fd, celldata, cellhdr.length);          rd_read_file(fd, celldata, cellhdr.length);
70    
71          DEBUG(("Loading bitmap from disk (%d:%d)\n", cache_id, cache_idx));          DEBUG(("Loading bitmap from disk (%d:%d)\n", cache_id, cache_idx));
# Line 79  pstcache_load_bitmap(uint8 cache_id, uin Line 79  pstcache_load_bitmap(uint8 cache_id, uin
79    
80  /* Store a bitmap in the persistent cache */  /* Store a bitmap in the persistent cache */
81  BOOL  BOOL
82  pstcache_put_bitmap(uint8 cache_id, uint16 cache_idx, uint8 *bitmap_id,  pstcache_put_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * bitmap_id,
83                  uint16 width, uint16 height, uint16 length, uint8 *data)                      uint16 width, uint16 height, uint16 length, uint8 * data)
84  {  {
85          int fd;          int fd;
86          CELLHEADER cellhdr;          CELLHEADER cellhdr;
# Line 104  pstcache_put_bitmap(uint8 cache_id, uint Line 104  pstcache_put_bitmap(uint8 cache_id, uint
104    
105  /* list the bitmaps from the persistent cache file */  /* list the bitmaps from the persistent cache file */
106  int  int
107  pstcache_enumerate(uint8 cache_id, uint8 *idlist)  pstcache_enumerate(uint8 cache_id, uint8 * idlist)
108  {  {
109          int fd, n, c = 0;          int fd, n, c = 0;
110          CELLHEADER cellhdr;          CELLHEADER cellhdr;
# Line 127  pstcache_enumerate(uint8 cache_id, uint8 Line 127  pstcache_enumerate(uint8 cache_id, uint8
127                  if (memcmp(cellhdr.bitmap_id, zero_id, sizeof(BITMAP_ID)) != 0)                  if (memcmp(cellhdr.bitmap_id, zero_id, sizeof(BITMAP_ID)) != 0)
128                  {                  {
129                          memcpy(idlist + n * sizeof(BITMAP_ID), cellhdr.bitmap_id,                          memcpy(idlist + n * sizeof(BITMAP_ID), cellhdr.bitmap_id,
130                                          sizeof(BITMAP_ID));                                 sizeof(BITMAP_ID));
131    
132                          if (cellhdr.stamp)                          if (cellhdr.stamp)
133                          {                          {

Legend:
Removed from v.725  
changed lines
  Added in v.738

  ViewVC Help
Powered by ViewVC 1.1.26