466 {
468 int bufLen;
469
473
474
476 int AllOk = 0;
477
478 while ( inpfile ) {
479
482 if ( !bufLen ) continue;
483
484 if (
buf[0] ==
'[' &&
buf[bufLen-1] ==
']' ) {
485
487
490 AllOk = 0;
491 break;
492 };
493
494 if (
stricmp(temps.c_str(),
"[comment]") == 0 ) {
495#ifdef KEYDEBUG
497#endif
500 break;
501 };
502#ifdef KEYDEBUG
504#endif
505 continue;
506 };
507
508
509 string back = temps;
510
511
514
515#ifndef __BORLANDC__
517#else
518 back.remove(7);
519#endif
520 back += "]";
521 }
523
524#ifndef __BORLANDC__
526#else
527 back.remove(8);
528#endif
529 back += "]";
530 }
532
533#ifndef __BORLANDC__
535#else
536 back.remove(7);
537#endif
538 back += "]";
539 }
540 else {
541
543 break;
544 };
545
547#ifdef KEYDEBUG
549#endif
550
552
553 while ( 1 ) {
556 if ( !bufLen ) break;
557 if (
buf[0] ==
'[' &&
buf[bufLen-1] ==
']' ) {
560
563 break;
564 };
565
566
567 if (
stricmp(
t.c_str(),
"[comment]") == 0 &&
569
570 break;
571 };
572 temps += "\n";
574 };
576
578 AllOk = 0;
579 break;
580 };
581#ifdef KEYDEBUG
583#endif
584 AllOk = SA.Add(temps);
585 if ( !AllOk ) break;
586 } else {
587
589 AllOk = 0;
590 break;
591 };
592 };
593
594 inpfile.close();
595
596 if ( !AllOk ) return 0;
597
598
599
602
604 return 0;
605 };
607 return 0;
608 };
609
610
613
615 return 0;
616 };
617
620
622
623 while (
config.length() ) {
627 if ( !bufLen || (
buf[0] ==
'[' &&
buf[bufLen-1] ==
']') )
continue;
633
635
636
638 break;
639 };
641 if ( switchKey !=
NULL ) {
642
643
645 };
650 }
651 else {
652 string keydef(switchKey);
653 keydef += " !*!*!*";
656 switchKey =
ParseKeyDef(keydef.c_str(),vk_code,control);
657 if ( switchKey !=
NULL ) {
660
662 break;
663 };
666 }
667 };
668 mapdef+=7;
669
670 while ((mapdef !=
NULL)&&
674
676 } else {
678
680 };
681 };
682
683 }
686 char * mapdef =
buf + 8;
687 int SuccesLoaded = 0;
688
689 while ((mapdef !=
NULL)&&
693
695 } else {
697
699 SuccesLoaded++;
700 };
701 };
702 if (!SuccesLoaded) {
703
706 };
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721 }
722 else {
723
725 }
726 }
727
728 if ( hadKeys) {
732
736 return 1;
737 };
738 return 0;
739}
ACPI_SIZE strlen(const char *String)
char * strtok(char *String, const char *Delimiters)
#define MSG_KEYNOCHARMAPS
#define MSG_KEYUNKNOWNMAP
#define MSG_KEYUNEXPTOKIN
int switchMap(TKeyDef &tk)
char * ParseKeyDef(const char *buf, WORD &vk_code, DWORD &control)
int LoadKeyMap(string buf)
int LookForPart(stringArray &sa, const char *partType, const char *partName)
int LoadCharMap(string buf)
int LoadGlobal(string &buf)
_Self & erase(size_type __pos=0, size_type __n=npos)
const _CharT * c_str() const
_Self & insert(size_type __pos, const _Self &__s)
static const WCHAR empty[]
#define stricmp(_String1, _String2)
int getLongComment(istream &is, char *wbuf, size_t sz)
int normalizeSplitter(string &buf)