~ubuntu-branches/ubuntu/raring/freerdp/raring-proposed

« back to all changes in this revision

Viewing changes to X11/xfreerdp.c

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2010-07-05 14:05:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100705140526-2ltv2dqy49qomob3
Tags: 0.7.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        return 0;
68
68
}
69
69
 
 
70
/* Returns "true" on errors or other reasons to not continue normal operation */
70
71
static int
71
72
process_params(xfInfo * xfi, int argc, char ** argv, int * pindex)
72
73
{
168
169
                                printf("0x%08X\t%s\n", layouts[i].code, layouts[i].name);
169
170
                        free(layouts);
170
171
 
171
 
                        exit(0);
 
172
                        return 1;
172
173
                }
173
174
                else if (strcmp("-s", argv[*pindex]) == 0)
174
175
                {
307
308
                        }
308
309
                        freerdp_chanman_load_plugin(xfi->chan_man, settings, argv[index], plugin_data);
309
310
                }
310
 
                else if (strcmp("-h", argv[*pindex]) == 0)
 
311
                else if ((strcmp("-h", argv[*pindex]) == 0) || strcmp("--help", argv[*pindex]) == 0)
311
312
                {
312
313
                        char help[] =
313
314
                                "\n"
336
337
                                "\n";
337
338
 
338
339
                        printf(help);
339
 
                        exit(0);
 
340
                        return 1;
340
341
                }
341
 
                else
 
342
                else if (argv[*pindex][0] != '-')
342
343
                {
343
344
                        settings->server[sizeof(settings->server) - 1] = 0;
344
 
                        if (argv[*pindex][0] == '[' && (p = strchr(argv[*pindex], ']')) 
 
345
                        if (argv[*pindex][0] == '[' && (p = strchr(argv[*pindex], ']'))
345
346
                                && (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':'))))
346
347
                        {
347
348
                                /* Either "[...]" or "[...]:..." with at most one : after the brackets */
368
369
                        *pindex = *pindex + 1;
369
370
                        return 0;
370
371
                }
 
372
                else
 
373
                {
 
374
                        printf("invalid option: %s\n", argv[*pindex]);
 
375
                        return 1;
 
376
                }
371
377
                *pindex = *pindex + 1;
372
378
        }
373
379
        printf("missing server name\n");
557
563
                xfi->settings = (rdpSet *) malloc(sizeof(rdpSet));
558
564
                xfi->chan_man = freerdp_chanman_new();
559
565
                rv = process_params(xfi, argc, argv, &index);
560
 
                xf_kb_init(xfi->keyboard_layout_id);
561
 
                
562
 
                if (rv == 0)
563
 
                {
564
 
                        g_thread_count++;
565
 
                        printf("starting thread %d to %s:%d\n", g_thread_count,
566
 
                                xfi->settings->server, xfi->settings->tcp_port_rdp);
567
 
                        pthread_create(&thread, 0, thread_func, xfi);
568
 
                }
569
 
                else
 
566
                if (rv)
570
567
                {
571
568
                        free(xfi->settings);
572
569
                        freerdp_chanman_free(xfi->chan_man);
573
570
                        free(xfi);
574
571
                        break;
575
572
                }
 
573
 
 
574
                xf_kb_init(xfi->keyboard_layout_id);
 
575
                g_thread_count++;
 
576
                printf("starting thread %d to %s:%d\n", g_thread_count,
 
577
                        xfi->settings->server, xfi->settings->tcp_port_rdp);
 
578
                pthread_create(&thread, 0, thread_func, xfi);
576
579
        }
577
580
 
578
581
        while (g_thread_count > 0)