/[rdesktop]/sourceforge.net/trunk/rdesktop/printercache.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/printercache.c

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

revision 569 by n-ki, Wed Jan 21 14:40:40 2004 UTC revision 598 by n-ki, Fri Feb 6 10:32:13 2004 UTC
# Line 79  printercache_load_blob(char *printer_nam Line 79  printercache_load_blob(char *printer_nam
79          if (printer_name == NULL)          if (printer_name == NULL)
80                  return 0;                  return 0;
81    
82            *data = NULL;
83    
84          home = getenv("HOME");          home = getenv("HOME");
85          if (home == NULL)          if (home == NULL)
86                  return 0;                  return 0;
87    
88          path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) + sizeof("/AutoPrinterCacheData"));          path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) +
89                                    sizeof("/AutoPrinterCacheData"));
90          sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);          sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);
91    
92          fd = open(path, O_RDONLY);          fd = open(path, O_RDONLY);
# Line 116  printercache_save_blob(char *printer_nam Line 119  printercache_save_blob(char *printer_nam
119          if (!printercache_mkdir(home, printer_name))          if (!printercache_mkdir(home, printer_name))
120                  return;                  return;
121    
122          path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) + sizeof("/AutoPrinterCacheData"));          path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) +
123                                    sizeof("/AutoPrinterCacheData"));
124          sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);          sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name);
125    
126          fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);          fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
# Line 145  printercache_process(STREAM s) Line 149  printercache_process(STREAM s)
149          in_uint32_le(s, type);          in_uint32_le(s, type);
150          switch (type)          switch (type)
151          {          {
152                    /*case 4: renaming of item old name and then new name */
153                    /*case 3: delete item name */
154                  case 2:                  case 2:
   
155                          in_uint32_le(s, printer_unicode_length);                          in_uint32_le(s, printer_unicode_length);
156                          in_uint32_le(s, blob_length);                          in_uint32_le(s, blob_length);
157    
# Line 157  printercache_process(STREAM s) Line 162  printercache_process(STREAM s)
162                          }                          }
163                          break;                          break;
164    
165                  case 1:                  /*case 1: */
   
166                          // TODO: I think this one just tells us what printer is on LPT? but why?                          // TODO: I think this one just tells us what printer is on LPT? but why?
167    
168                            //
169                            // your name and the "users choice" of printer driver
170                            // my guess is that you can store it and automagically reconnect
171                            // the printer with correct driver next time.
172                  default:                  default:
173    
174                          unimpl("RDPDR Printer Cache Packet Type: %d\n", type);                          unimpl("RDPDR Printer Cache Packet Type: %d\n", type);

Legend:
Removed from v.569  
changed lines
  Added in v.598

  ViewVC Help
Powered by ViewVC 1.1.26