/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/rdesktop/rdesktop.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/branches/seamlessrdp-branch/rdesktop/rdesktop.c

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

revision 710 by jsorg71, Tue Jun 15 22:17:08 2004 UTC revision 725 by jsorg71, Sun Jun 27 17:51:54 2004 UTC
# Line 59  int g_win_button_size = 0;     /* If zero, d Line 59  int g_win_button_size = 0;     /* If zero, d
59  BOOL g_bitmap_compression = True;  BOOL g_bitmap_compression = True;
60  BOOL g_sendmotion = True;  BOOL g_sendmotion = True;
61  BOOL g_bitmap_cache = True;  BOOL g_bitmap_cache = True;
62    BOOL g_bitmap_cache_persist_enable = False;
63    BOOL g_bitmap_cache_precache = True;
64  BOOL g_encryption = True;  BOOL g_encryption = True;
65  BOOL packet_encryption = True;  BOOL packet_encryption = True;
66  BOOL g_desktop_save = True;  BOOL g_desktop_save = True;
# Line 124  usage(char *program) Line 126  usage(char *program)
126          fprintf(stderr, "   -N: enable numlock syncronization\n");          fprintf(stderr, "   -N: enable numlock syncronization\n");
127          fprintf(stderr, "   -X: embed into another window with a given id.\n");          fprintf(stderr, "   -X: embed into another window with a given id.\n");
128          fprintf(stderr, "   -a: connection colour depth\n");          fprintf(stderr, "   -a: connection colour depth\n");
129          fprintf(stderr,          fprintf(stderr, "   -x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)\n");
130                  "   -x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex number)\n");          fprintf(stderr, "   -P: use persistent bitmap caching\n");
131          fprintf(stderr, "   -r: enable specified device redirection (this flag can be repeated)\n");          fprintf(stderr, "   -r: enable specified device redirection (this flag can be repeated)\n");
132          fprintf(stderr,          fprintf(stderr,
133                  "         '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");                  "         '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");
# Line 364  main(int argc, char *argv[]) Line 366  main(int argc, char *argv[])
366  #define VNCOPT  #define VNCOPT
367  #endif  #endif
368    
369          while ((c = getopt(argc, argv, VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:NX:a:x:r:045h?")) != -1)          while ((c = getopt(argc, argv,
370                            VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:NX:a:x:Pr:045h?")) != -1)
371          {          {
372                  switch (c)                  switch (c)
373                  {                  {
# Line 547  main(int argc, char *argv[]) Line 550  main(int argc, char *argv[])
550                                  }                                  }
551                                  break;                                  break;
552    
553                            case 'P':
554                                    g_bitmap_cache_persist_enable = True;
555                                    break;
556    
557                          case 'r':                          case 'r':
558    
559                                  if (strncmp("sound", optarg, 5) == 0)                                  if (strncmp("sound", optarg, 5) == 0)
# Line 713  main(int argc, char *argv[]) Line 720  main(int argc, char *argv[])
720          }          }
721    
722          DEBUG(("Disconnecting...\n"));          DEBUG(("Disconnecting...\n"));
723            cache_save_state();
724          rdp_disconnect();          rdp_disconnect();
725          ui_deinit();          ui_deinit();
726    
# Line 1121  save_licence(unsigned char *data, int le Line 1129  save_licence(unsigned char *data, int le
1129          xfree(tmppath);          xfree(tmppath);
1130          xfree(path);          xfree(path);
1131  }  }
1132    
1133    /* Create the bitmap cache directory */
1134    BOOL
1135    rd_pstcache_mkdir(void)
1136    {
1137            char *home;
1138            char bmpcache_dir[256];
1139    
1140            home = getenv("HOME");
1141    
1142            if (home == NULL)
1143                    return False;
1144    
1145            sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop");
1146    
1147            if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
1148            {
1149                    perror(bmpcache_dir);
1150                    return False;
1151            }
1152    
1153            sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop/cache");
1154    
1155            if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
1156            {
1157                    perror(bmpcache_dir);
1158                    return False;
1159            }
1160    
1161            return True;
1162    }
1163    
1164    /* open a file in the .rdesktop directory */
1165    int
1166    rd_open_file(char *filename)
1167    {
1168            char *home;
1169            char fn[256];
1170       int fd;
1171    
1172            home = getenv("HOME");
1173            if (home == NULL)
1174                    return -1;
1175            sprintf(fn, "%s/.rdesktop/%s", home, filename);
1176            fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
1177            if (fd == -1)
1178                    perror(fn);
1179            return fd;
1180    }
1181    
1182    /* close file */
1183    void
1184    rd_close_file(int fd)
1185    {
1186      close(fd);
1187    }
1188    
1189    /* read from file*/
1190    int
1191    rd_read_file(int fd, void *ptr, int len)
1192    {
1193      return read(fd, ptr, len);
1194    }
1195    
1196    /* write to file */
1197    int
1198    rd_write_file(int fd, void* ptr, int len)
1199    {
1200      return write(fd, ptr, len);
1201    }
1202    
1203    /* move file pointer */
1204    int
1205    rd_lseek_file(int fd, int offset)
1206    {
1207      return lseek(fd, offset, SEEK_SET);
1208    }
1209    
1210    /* do a write lock on a file */
1211    BOOL
1212    rd_lock_file(int fd, int start, int len)
1213    {
1214            struct flock lock;
1215    
1216            lock.l_type = F_WRLCK;
1217            lock.l_whence = SEEK_SET;
1218            lock.l_start = start;
1219            lock.l_len = len;
1220            if (fcntl(fd, F_SETLK, &lock) == -1)
1221                    return False;
1222            return True;
1223    }

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

  ViewVC Help
Powered by ViewVC 1.1.26