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

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

revision 1396 by stargo, Mon Jan 8 12:38:34 2007 UTC revision 1397 by stargo, Tue Feb 20 16:51:46 2007 UTC
# Line 42  Line 42 
42  #define SCARD_MAX_MEM 102400  #define SCARD_MAX_MEM 102400
43  #define SCARD_AUTOALLOCATE -1  #define SCARD_AUTOALLOCATE -1
44  #define OUT_STREAM_SIZE 4096  #define OUT_STREAM_SIZE 4096
 #define STREAM_COUNT 8  
45    
 static struct stream out[STREAM_COUNT];  
 static int cur_stream_id = 0;  
46  static pthread_mutex_t **scard_mutex = NULL;  static pthread_mutex_t **scard_mutex = NULL;
47    
48  static uint32 curDevice = 0, curId = 0, curBytesOut = 0;  static uint32 curDevice = 0, curId = 0, curBytesOut = 0;
# Line 2663  scard_unlock(int lock) Line 2660  scard_unlock(int lock)
2660  {  {
2661          pthread_mutex_unlock(scard_mutex[lock]);          pthread_mutex_unlock(scard_mutex[lock]);
2662  }  }
   
 STREAM  
 scard_tcp_init(void)  
 {  
         STREAM result = NULL;  
   
         result = &out[cur_stream_id];  
         cur_stream_id = (cur_stream_id + 1) % STREAM_COUNT;  
   
         return result;  
 }  
   
 void  
 scard_tcp_connect(void)  
 {  
         int i;  
   
         for (i = 0; i < STREAM_COUNT; i++)  
         {  
                 out[i].size = 4096;  
                 out[i].data = (uint8 *) xmalloc(out[i].size);  
         }  
 }  
   
 void  
 scard_tcp_reset_state(void)  
 {  
         int i;  
         struct stream *p;  
   
         for (i = 0, p = out; i < STREAM_COUNT; i++, p++)  
         {  
                 if (p->data != NULL)  
                         xfree(p->data);  
                 p->p = NULL;  
                 p->end = NULL;  
                 p->data = NULL;  
                 p->size = 0;  
                 p->iso_hdr = NULL;  
                 p->mcs_hdr = NULL;  
                 p->sec_hdr = NULL;  
                 p->rdp_hdr = NULL;  
                 p->channel_hdr = NULL;  
         }  
 }  

Legend:
Removed from v.1396  
changed lines
  Added in v.1397

  ViewVC Help
Powered by ViewVC 1.1.26