~ubuntu-branches/ubuntu/lucid/polyglot/lucid

« back to all changes in this revision

Viewing changes to main.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Korff
  • Date: 2010-01-16 10:52:58 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100116105258-fzpvrh7sap08ofqh
Tags: 1.4.56b-1
New upstream version, fixes a bug on linux with a not existing 
engine command

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
// constants
40
40
 
41
41
 
42
 
static const char * const Version = "1.4.55b";
 
42
static const char * const Version = "1.4.56b";
43
43
static const char * const HelpMessage = "\
44
44
SYNTAX\n\
45
45
* polyglot [configfile] [-noini] [-ec engine] [-ed enginedirectory] [-en enginename] [-log] [-lf logfile] [-hash value] [-bk book] [-pg <name>=<value>]* [-uci <name>=<value>]*\n\
364
364
    
365
365
    if(!my_string_equal(option_get_string(Option,"SettingsFile"),"<empty>")){
366
366
        if(ini_parse(ini,option_get_string(Option,"SettingsFile"))){
367
 
            my_fatal("main(): Can't open file \"%s\": %s\n",
 
367
            my_fatal("main(): Can't open config file \"%s\": %s\n",
368
368
                   option_get_string(Option,"SettingsFile"),
369
369
                   strerror(errno));
370
370
        }
437
437
        option_set(Option,entry->name,entry->value);
438
438
    }
439
439
 
 
440
    // Make sure that EngineCommand has been set
 
441
    if(my_string_case_equal(option_get(Option,"EngineCommand"),"<empty>")){
 
442
      my_fatal("main(): EngineCommand not set\n");
 
443
    }
 
444
 
440
445
        // start engine
441
446
    
442
447
    engine_open(Engine);
443
448
 
444
449
    if(!engine_active(Engine)){
445
 
        my_fatal("Could not start \"%s\"\n",option_get(Option,"EngineCommand"));
 
450
        my_fatal("main(): Could not start \"%s\"\n",option_get(Option,"EngineCommand"));
446
451
    }
447
452
 
448
453
        // switch to UCI mode if necessary
561
566
    argc=1;
562
567
    while((arg=argv[argc++])){
563
568
        if(!my_string_equal(arg,"")){
564
 
            my_fatal("main(): Option: \"%s\" not found\n",argv[argc-1]);
 
569
            my_fatal("main(): Incorrect use of option: \"%s\"\n",argv[argc-1]);
565
570
        }
566
571
    }
567
572
 
629
634
// quit()
630
635
 
631
636
void quit() {
632
 
 
633
637
    my_log("POLYGLOT *** QUIT ***\n");
634
 
    
635
638
    if (Init && !Engine->pipex->quit_pending) {
636
 
        
637
639
        stop_search();
638
640
        Engine->pipex->quit_pending=TRUE;
639
641
        engine_send(Engine,"quit");