/[rdesktop]/jpeg/rdesktop/trunk/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 /jpeg/rdesktop/trunk/rdesktop.c

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

revision 1271 by stargo, Mon Sep 18 21:42:50 2006 UTC revision 1365 by jsorg71, Thu Jan 4 05:39:39 2007 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Entrypoint and utility functions     Entrypoint and utility functions
4     Copyright (C) Matthew Chapman 1999-2005     Copyright (C) Matthew Chapman 1999-2007
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 193  usage(char *program) Line 193  usage(char *program)
193                  "                      'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD\n");                  "                      'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD\n");
194          fprintf(stderr, "                      when sending data to server.\n");          fprintf(stderr, "                      when sending data to server.\n");
195          fprintf(stderr, "                      'CLIPBOARD' looks at only CLIPBOARD.\n");          fprintf(stderr, "                      'CLIPBOARD' looks at only CLIPBOARD.\n");
196    #ifdef WITH_SCARD
197            fprintf(stderr, "         '-r scard[:\"Scard Name\"=\"Alias Name[;Vendor Name]\"[,...]]\n");
198            fprintf(stderr, "          example: -r scard:\"eToken PRO 00 00\"=\"AKS ifdh 0\"\n");
199            fprintf(stderr,
200                    "                   \"eToken PRO 00 00\" -> Device in Linux/Unix enviroment\n");
201            fprintf(stderr,
202                    "                   \"AKS ifdh 0\"       -> Device shown in Windows enviroment \n");
203            fprintf(stderr, "          example: -r scard:\"eToken PRO 00 00\"=\"AKS ifdh 0;AKS\"\n");
204            fprintf(stderr,
205                    "                   \"eToken PRO 00 00\" -> Device in Linux/Unix enviroment\n");
206            fprintf(stderr,
207                    "                   \"AKS ifdh 0\"       -> Device shown in Windows enviroment \n");
208            fprintf(stderr,
209                    "                   \"AKS\"              -> Device vendor name                 \n");
210    #endif
211          fprintf(stderr, "   -0: attach to console\n");          fprintf(stderr, "   -0: attach to console\n");
212          fprintf(stderr, "   -4: use RDP version 4\n");          fprintf(stderr, "   -4: use RDP version 4\n");
213          fprintf(stderr, "   -5: use RDP version 5 (default)\n");          fprintf(stderr, "   -5: use RDP version 5 (default)\n");
# Line 408  main(int argc, char *argv[]) Line 423  main(int argc, char *argv[])
423          BOOL geometry_option = False;          BOOL geometry_option = False;
424          int run_count = 0;      /* Session Directory support */          int run_count = 0;      /* Session Directory support */
425          BOOL continue_connect = True;   /* Session Directory support */          BOOL continue_connect = True;   /* Session Directory support */
426    #ifdef WITH_RDPSND
427            char *rdpsnd_optarg = NULL;
428    #endif
429    
430  #ifdef HAVE_LOCALE_H  #ifdef HAVE_LOCALE_H
431          /* Set locale according to environment */          /* Set locale according to environment */
# Line 669  main(int argc, char *argv[]) Line 687  main(int argc, char *argv[])
687                                                          if (str_startswith(optarg, "local"))                                                          if (str_startswith(optarg, "local"))
688  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
689                                                          {                                                          {
690                                                                  char *driver = NULL, *options =                                                                  rdpsnd_optarg =
691                                                                          NULL;                                                                          next_arg(optarg, ':');
692                                                                    g_rdpsnd = True;
                                                                 if ((driver =  
                                                                      next_arg(optarg, ':')))  
                                                                 {  
                                                                         if (!strlen(driver))  
                                                                         {  
                                                                                 driver = NULL;  
                                                                         }  
                                                                         else if ((options =  
                                                                                   next_arg(driver,  
                                                                                            ':')))  
                                                                         {  
                                                                                 if (!strlen  
                                                                                     (options))  
                                                                                         options =  
                                                                                                 NULL;  
                                                                         }  
                                                                 }  
   
                                                                 if (!rdpsnd_select_driver  
                                                                     (driver, options))  
                                                                 {  
                                                                         warning("Driver not available\n");  
                                                                 }  
                                                                 else  
                                                                 {  
                                                                         g_rdpsnd = True;  
                                                                 }  
693                                                          }                                                          }
694    
695  #else  #else
# Line 718  main(int argc, char *argv[]) Line 709  main(int argc, char *argv[])
709                                          else                                          else
710                                          {                                          {
711  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
712                                                  if (!rdpsnd_select_driver(NULL, NULL))                                                  g_rdpsnd = True;
                                                 {  
                                                         warning("No sound-driver available\n");  
                                                 }  
                                                 else  
                                                 {  
                                                         g_rdpsnd = True;  
                                                 }  
713  #else  #else
714                                                  warning("Not compiled with sound support\n");                                                  warning("Not compiled with sound support\n");
715  #endif  #endif
# Line 773  main(int argc, char *argv[]) Line 757  main(int argc, char *argv[])
757                                          else                                          else
758                                                  g_rdpclip = True;                                                  g_rdpclip = True;
759                                  }                                  }
760                                    else if (strncmp("scard", optarg, 5) == 0)
761                                    {
762    #ifdef WITH_SCARD
763                                            scard_enum_devices(&g_num_devices, optarg + 5);
764    #else
765                                            warning("Not compiled with smartcard support\n");
766    #endif
767                                    }
768                                  else                                  else
769                                  {                                  {
770                                          warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound, clipboard\n");                                          warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound, clipboard, scard\n");
771                                  }                                  }
772                                  break;                                  break;
773    
# Line 920  main(int argc, char *argv[]) Line 912  main(int argc, char *argv[])
912    
913  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
914          if (g_rdpsnd)          if (g_rdpsnd)
915                  rdpsnd_init();          {
916                    if (!rdpsnd_init(rdpsnd_optarg))
917                    {
918                            warning("Initializing sound-support failed!\n");
919                    }
920            }
921  #endif  #endif
922    
923          if (lspci_enabled)          if (lspci_enabled)
# Line 1107  xmalloc(int size) Line 1104  xmalloc(int size)
1104          return mem;          return mem;
1105  }  }
1106    
1107    /* Exit on NULL pointer. Use to verify result from XGetImage etc */
1108    void
1109    exit_if_null(void *ptr)
1110    {
1111            if (ptr == NULL)
1112            {
1113                    error("unexpected null pointer. Out of memory?\n");
1114                    exit(1);
1115            }
1116    }
1117    
1118  /* strdup */  /* strdup */
1119  char *  char *
1120  xstrdup(const char *s)  xstrdup(const char *s)

Legend:
Removed from v.1271  
changed lines
  Added in v.1365

  ViewVC Help
Powered by ViewVC 1.1.26