summaryrefslogtreecommitdiff
path: root/library/backend
Unidiff
Diffstat (limited to 'library/backend') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vcc.y2
-rw-r--r--library/backend/vcc_yacc.cpp2
-rw-r--r--library/backend/vobject.cpp1
3 files changed, 5 insertions, 0 deletions
diff --git a/library/backend/vcc.y b/library/backend/vcc.y
index 94a8fea..4c79368 100644
--- a/library/backend/vcc.y
+++ b/library/backend/vcc.y
@@ -988,98 +988,100 @@ static char* lexGetQuotedPrintable()
988 lexSkipLookahead(); 988 lexSkipLookahead();
989 c = lexLookahead(); 989 c = lexLookahead();
990 continue; 990 continue;
991 } 991 }
992 992
993 // got a valid escaped =. append it. 993 // got a valid escaped =. append it.
994 lexSkipLookahead(); // skip second 0-9A-F 994 lexSkipLookahead(); // skip second 0-9A-F
995 lexAppendc(cur); 995 lexAppendc(cur);
996 } else { 996 } else {
997 lexSkipLookahead(); // skip whatever we just read. 997 lexSkipLookahead(); // skip whatever we just read.
998 lexAppendc(c); // and append it. 998 lexAppendc(c); // and append it.
999 } 999 }
1000 c = lexLookahead(); 1000 c = lexLookahead();
1001 } 1001 }
1002 lexAppendc(0); 1002 lexAppendc(0);
1003 return c==EOF?0:lexStr(); 1003 return c==EOF?0:lexStr();
1004} 1004}
1005 1005
1006static int yylex() { 1006static int yylex() {
1007 1007
1008 int lexmode = LEXMODE(); 1008 int lexmode = LEXMODE();
1009 if (lexmode == L_VALUES) { 1009 if (lexmode == L_VALUES) {
1010 int c = lexGetc(); 1010 int c = lexGetc();
1011 if (c == ';' && fieldedProp) { 1011 if (c == ';' && fieldedProp) {
1012 DBG_(("db: SEMICOLON\n")); 1012 DBG_(("db: SEMICOLON\n"));
1013 lexPushLookaheadc(c); 1013 lexPushLookaheadc(c);
1014 handleMoreRFC822LineBreak(c); 1014 handleMoreRFC822LineBreak(c);
1015 lexSkipLookahead(); 1015 lexSkipLookahead();
1016 return SEMICOLON; 1016 return SEMICOLON;
1017 } 1017 }
1018 else if (strchr("\n",c)) { 1018 else if (strchr("\n",c)) {
1019 ++mime_lineNum; 1019 ++mime_lineNum;
1020 /* consume all line separator(s) adjacent to each other */ 1020 /* consume all line separator(s) adjacent to each other */
1021 c = lexLookahead(); 1021 c = lexLookahead();
1022 while (strchr("\n",c)) { 1022 while (strchr("\n",c)) {
1023 lexSkipLookahead(); 1023 lexSkipLookahead();
1024 c = lexLookahead(); 1024 c = lexLookahead();
1025 ++mime_lineNum; 1025 ++mime_lineNum;
1026 } 1026 }
1027 DBG_(("db: LINESEP\n")); 1027 DBG_(("db: LINESEP\n"));
1028 return LINESEP; 1028 return LINESEP;
1029 } 1029 }
1030 else { 1030 else {
1031 char *p = 0; 1031 char *p = 0;
1032 lexPushLookaheadc(c); 1032 lexPushLookaheadc(c);
1033 if (lexWithinMode(L_BASE64)) { 1033 if (lexWithinMode(L_BASE64)) {
1034 /* get each char and convert to bin on the fly... */ 1034 /* get each char and convert to bin on the fly... */
1035 p = lexGetDataFromBase64(); 1035 p = lexGetDataFromBase64();
1036 #if 0
1036 yylval.str = p; 1037 yylval.str = p;
1037 return STRING; 1038 return STRING;
1039 #endif
1038 } 1040 }
1039 else if (lexWithinMode(L_QUOTED_PRINTABLE)) { 1041 else if (lexWithinMode(L_QUOTED_PRINTABLE)) {
1040 p = lexGetQuotedPrintable(); 1042 p = lexGetQuotedPrintable();
1041 } 1043 }
1042 else { 1044 else {
1043#ifdef _SUPPORT_LINE_FOLDING 1045#ifdef _SUPPORT_LINE_FOLDING
1044 p = lexGet1Value(); 1046 p = lexGet1Value();
1045#else 1047#else
1046 p = lexGetStrUntil(";\n"); 1048 p = lexGetStrUntil(";\n");
1047#endif 1049#endif
1048 } 1050 }
1049 if (p) { 1051 if (p) {
1050 DBG_(("db: STRING: '%s'\n", p)); 1052 DBG_(("db: STRING: '%s'\n", p));
1051 yylval.str = p; 1053 yylval.str = p;
1052 return STRING; 1054 return STRING;
1053 } 1055 }
1054 else return 0; 1056 else return 0;
1055 } 1057 }
1056 } 1058 }
1057 else { 1059 else {
1058 /* normal mode */ 1060 /* normal mode */
1059 while (1) { 1061 while (1) {
1060 int c = lexGetc(); 1062 int c = lexGetc();
1061 switch(c) { 1063 switch(c) {
1062 case ':': { 1064 case ':': {
1063 /* consume all line separator(s) adjacent to each other */ 1065 /* consume all line separator(s) adjacent to each other */
1064 /* ignoring linesep immediately after colon. */ 1066 /* ignoring linesep immediately after colon. */
1065 /* I don't see this in the spec, and it breaks null values -- WA 1067 /* I don't see this in the spec, and it breaks null values -- WA
1066 c = lexLookahead(); 1068 c = lexLookahead();
1067 while (strchr("\n",c)) { 1069 while (strchr("\n",c)) {
1068 lexSkipLookahead(); 1070 lexSkipLookahead();
1069 c = lexLookahead(); 1071 c = lexLookahead();
1070 ++mime_lineNum; 1072 ++mime_lineNum;
1071 } 1073 }
1072 */ 1074 */
1073 DBG_(("db: COLON\n")); 1075 DBG_(("db: COLON\n"));
1074 return COLON; 1076 return COLON;
1075 } 1077 }
1076 case ';': 1078 case ';':
1077 DBG_(("db: SEMICOLON\n")); 1079 DBG_(("db: SEMICOLON\n"));
1078 return SEMICOLON; 1080 return SEMICOLON;
1079 case '=': 1081 case '=':
1080 DBG_(("db: EQ\n")); 1082 DBG_(("db: EQ\n"));
1081 return EQ; 1083 return EQ;
1082 /* ignore whitespace in this mode */ 1084 /* ignore whitespace in this mode */
1083 case '\t': 1085 case '\t':
1084 case ' ': continue; 1086 case ' ': continue;
1085 case '\n': { 1087 case '\n': {
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp
index 5649522..5f53aef 100644
--- a/library/backend/vcc_yacc.cpp
+++ b/library/backend/vcc_yacc.cpp
@@ -1008,98 +1008,100 @@ static char* lexGetQuotedPrintable()
1008 lexSkipLookahead(); 1008 lexSkipLookahead();
1009 c = lexLookahead(); 1009 c = lexLookahead();
1010 continue; 1010 continue;
1011 } 1011 }
1012 1012
1013 // got a valid escaped =. append it. 1013 // got a valid escaped =. append it.
1014 lexSkipLookahead(); // skip second 0-9A-F 1014 lexSkipLookahead(); // skip second 0-9A-F
1015 lexAppendc(cur); 1015 lexAppendc(cur);
1016 } else { 1016 } else {
1017 lexSkipLookahead(); // skip whatever we just read. 1017 lexSkipLookahead(); // skip whatever we just read.
1018 lexAppendc(c); // and append it. 1018 lexAppendc(c); // and append it.
1019 } 1019 }
1020 c = lexLookahead(); 1020 c = lexLookahead();
1021 } 1021 }
1022 lexAppendc(0); 1022 lexAppendc(0);
1023 return c==EOF?0:lexStr(); 1023 return c==EOF?0:lexStr();
1024} 1024}
1025 1025
1026static int yylex() { 1026static int yylex() {
1027 1027
1028 int lexmode = LEXMODE(); 1028 int lexmode = LEXMODE();
1029 if (lexmode == L_VALUES) { 1029 if (lexmode == L_VALUES) {
1030 int c = lexGetc(); 1030 int c = lexGetc();
1031 if (c == ';' && fieldedProp) { 1031 if (c == ';' && fieldedProp) {
1032 DBG_(("db: SEMICOLON\n")); 1032 DBG_(("db: SEMICOLON\n"));
1033 lexPushLookaheadc(c); 1033 lexPushLookaheadc(c);
1034 handleMoreRFC822LineBreak(c); 1034 handleMoreRFC822LineBreak(c);
1035 lexSkipLookahead(); 1035 lexSkipLookahead();
1036 return SEMICOLON; 1036 return SEMICOLON;
1037 } 1037 }
1038 else if (strchr("\n",c)) { 1038 else if (strchr("\n",c)) {
1039 ++mime_lineNum; 1039 ++mime_lineNum;
1040 /* consume all line separator(s) adjacent to each other */ 1040 /* consume all line separator(s) adjacent to each other */
1041 c = lexLookahead(); 1041 c = lexLookahead();
1042 while (strchr("\n",c)) { 1042 while (strchr("\n",c)) {
1043 lexSkipLookahead(); 1043 lexSkipLookahead();
1044 c = lexLookahead(); 1044 c = lexLookahead();
1045 ++mime_lineNum; 1045 ++mime_lineNum;
1046 } 1046 }
1047 DBG_(("db: LINESEP\n")); 1047 DBG_(("db: LINESEP\n"));
1048 return LINESEP; 1048 return LINESEP;
1049 } 1049 }
1050 else { 1050 else {
1051 char *p = 0; 1051 char *p = 0;
1052 lexPushLookaheadc(c); 1052 lexPushLookaheadc(c);
1053 if (lexWithinMode(L_BASE64)) { 1053 if (lexWithinMode(L_BASE64)) {
1054 /* get each char and convert to bin on the fly... */ 1054 /* get each char and convert to bin on the fly... */
1055 p = lexGetDataFromBase64(); 1055 p = lexGetDataFromBase64();
1056#if 0
1056 yylval.str = p; 1057 yylval.str = p;
1057 return STRING; 1058 return STRING;
1059 #endif
1058 } 1060 }
1059 else if (lexWithinMode(L_QUOTED_PRINTABLE)) { 1061 else if (lexWithinMode(L_QUOTED_PRINTABLE)) {
1060 p = lexGetQuotedPrintable(); 1062 p = lexGetQuotedPrintable();
1061 } 1063 }
1062 else { 1064 else {
1063#ifdef _SUPPORT_LINE_FOLDING 1065#ifdef _SUPPORT_LINE_FOLDING
1064 p = lexGet1Value(); 1066 p = lexGet1Value();
1065#else 1067#else
1066 p = lexGetStrUntil(";\n"); 1068 p = lexGetStrUntil(";\n");
1067#endif 1069#endif
1068 } 1070 }
1069 if (p) { 1071 if (p) {
1070 DBG_(("db: STRING: '%s'\n", p)); 1072 DBG_(("db: STRING: '%s'\n", p));
1071 yylval.str = p; 1073 yylval.str = p;
1072 return STRING; 1074 return STRING;
1073 } 1075 }
1074 else return 0; 1076 else return 0;
1075 } 1077 }
1076 } 1078 }
1077 else { 1079 else {
1078 /* normal mode */ 1080 /* normal mode */
1079 while (1) { 1081 while (1) {
1080 int c = lexGetc(); 1082 int c = lexGetc();
1081 switch(c) { 1083 switch(c) {
1082 case ':': { 1084 case ':': {
1083 /* consume all line separator(s) adjacent to each other */ 1085 /* consume all line separator(s) adjacent to each other */
1084 /* ignoring linesep immediately after colon. */ 1086 /* ignoring linesep immediately after colon. */
1085 /* I don't see this in the spec, and it breaks null values -- WA 1087 /* I don't see this in the spec, and it breaks null values -- WA
1086 c = lexLookahead(); 1088 c = lexLookahead();
1087 while (strchr("\n",c)) { 1089 while (strchr("\n",c)) {
1088 lexSkipLookahead(); 1090 lexSkipLookahead();
1089 c = lexLookahead(); 1091 c = lexLookahead();
1090 ++mime_lineNum; 1092 ++mime_lineNum;
1091 } 1093 }
1092 */ 1094 */
1093 DBG_(("db: COLON\n")); 1095 DBG_(("db: COLON\n"));
1094 return COLON; 1096 return COLON;
1095 } 1097 }
1096 case ';': 1098 case ';':
1097 DBG_(("db: SEMICOLON\n")); 1099 DBG_(("db: SEMICOLON\n"));
1098 return SEMICOLON; 1100 return SEMICOLON;
1099 case '=': 1101 case '=':
1100 DBG_(("db: EQ\n")); 1102 DBG_(("db: EQ\n"));
1101 return EQ; 1103 return EQ;
1102 /* ignore whitespace in this mode */ 1104 /* ignore whitespace in this mode */
1103 case '\t': 1105 case '\t':
1104 case ' ': continue; 1106 case ' ': continue;
1105 case '\n': { 1107 case '\n': {
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp
index b6d17dc..4c8de70 100644
--- a/library/backend/vobject.cpp
+++ b/library/backend/vobject.cpp
@@ -712,96 +712,97 @@ static struct PreDefProp propNames[] = {
712 { VCJPEGProp, 0, 0, 0 }, 712 { VCJPEGProp, 0, 0, 0 },
713 { VCLanguageProp, 0, 0, 0 }, 713 { VCLanguageProp, 0, 0, 0 },
714 { VCLastModifiedProp, 0, 0, 0 }, 714 { VCLastModifiedProp, 0, 0, 0 },
715 { VCLastRevisedProp, 0, 0, 0 }, 715 { VCLastRevisedProp, 0, 0, 0 },
716 { VCLocationProp, 0, 0, 0 }, 716 { VCLocationProp, 0, 0, 0 },
717 { VCLogoProp, 0, 0, 0 }, 717 { VCLogoProp, 0, 0, 0 },
718 { VCMailerProp, 0, 0, 0 }, 718 { VCMailerProp, 0, 0, 0 },
719 { VCMAlarmProp, 0, MAlarmFields, 0 }, 719 { VCMAlarmProp, 0, MAlarmFields, 0 },
720 { VCMCIMailProp, 0, 0, 0 }, 720 { VCMCIMailProp, 0, 0, 0 },
721 { VCMessageProp, 0, 0, 0 }, 721 { VCMessageProp, 0, 0, 0 },
722 { VCMETProp, 0, 0, 0 }, 722 { VCMETProp, 0, 0, 0 },
723 { VCModemProp, 0, 0, 0 }, 723 { VCModemProp, 0, 0, 0 },
724 { VCMPEG2Prop, 0, 0, 0 }, 724 { VCMPEG2Prop, 0, 0, 0 },
725 { VCMPEGProp, 0, 0, 0 }, 725 { VCMPEGProp, 0, 0, 0 },
726 { VCMSNProp, 0, 0, 0 }, 726 { VCMSNProp, 0, 0, 0 },
727 { VCNamePrefixesProp, 0, 0, 0 }, 727 { VCNamePrefixesProp, 0, 0, 0 },
728 { VCNameProp, 0, nameFields, 0 }, 728 { VCNameProp, 0, nameFields, 0 },
729 { VCNameSuffixesProp, 0, 0, 0 }, 729 { VCNameSuffixesProp, 0, 0, 0 },
730 { VCNoteProp, 0, 0, 0 }, 730 { VCNoteProp, 0, 0, 0 },
731 { VCOrgNameProp, 0, 0, 0 }, 731 { VCOrgNameProp, 0, 0, 0 },
732 { VCOrgProp, 0, orgFields, 0 }, 732 { VCOrgProp, 0, orgFields, 0 },
733 { VCOrgUnit2Prop, 0, 0, 0 }, 733 { VCOrgUnit2Prop, 0, 0, 0 },
734 { VCOrgUnit3Prop, 0, 0, 0 }, 734 { VCOrgUnit3Prop, 0, 0, 0 },
735 { VCOrgUnit4Prop, 0, 0, 0 }, 735 { VCOrgUnit4Prop, 0, 0, 0 },
736 { VCOrgUnitProp, 0, 0, 0 }, 736 { VCOrgUnitProp, 0, 0, 0 },
737 { VCPagerProp, 0, 0, 0 }, 737 { VCPagerProp, 0, 0, 0 },
738 { VCPAlarmProp, 0, PAlarmFields, 0 }, 738 { VCPAlarmProp, 0, PAlarmFields, 0 },
739 { VCParcelProp, 0, 0, 0 }, 739 { VCParcelProp, 0, 0, 0 },
740 { VCPartProp, 0, 0, 0 }, 740 { VCPartProp, 0, 0, 0 },
741 { VCPCMProp, 0, 0, 0 }, 741 { VCPCMProp, 0, 0, 0 },
742 { VCPDFProp, 0, 0, 0 }, 742 { VCPDFProp, 0, 0, 0 },
743 { VCPGPProp, 0, 0, 0 }, 743 { VCPGPProp, 0, 0, 0 },
744 { VCPhotoProp, 0, 0, 0 }, 744 { VCPhotoProp, 0, 0, 0 },
745 { VCPICTProp, 0, 0, 0 }, 745 { VCPICTProp, 0, 0, 0 },
746 { VCPMBProp, 0, 0, 0 }, 746 { VCPMBProp, 0, 0, 0 },
747 { VCPostalBoxProp, 0, 0, 0 }, 747 { VCPostalBoxProp, 0, 0, 0 },
748 { VCPostalCodeProp, 0, 0, 0 }, 748 { VCPostalCodeProp, 0, 0, 0 },
749 { VCPostalProp, 0, 0, 0 }, 749 { VCPostalProp, 0, 0, 0 },
750 { VCPowerShareProp, 0, 0, 0 }, 750 { VCPowerShareProp, 0, 0, 0 },
751 { VCPreferredProp, 0, 0, 0 }, 751 { VCPreferredProp, 0, 0, 0 },
752 { VCPriorityProp, 0, 0, 0 }, 752 { VCPriorityProp, 0, 0, 0 },
753 { VCProcedureNameProp, 0, 0, 0 }, 753 { VCProcedureNameProp, 0, 0, 0 },
754 { VCProdIdProp, 0, 0, 0 }, 754 { VCProdIdProp, 0, 0, 0 },
755 { VCProdigyProp, 0, 0, 0 }, 755 { VCProdigyProp, 0, 0, 0 },
756 { VCPronunciationProp, 0, 0, 0 }, 756 { VCPronunciationProp, 0, 0, 0 },
757 { VCPSProp, 0, 0, 0 }, 757 { VCPSProp, 0, 0, 0 },
758 { VCPublicKeyProp, 0, 0, 0 }, 758 { VCPublicKeyProp, 0, 0, 0 },
759 { VCQPProp, VCQuotedPrintableProp, 0, 0 }, 759 { VCQPProp, VCQuotedPrintableProp, 0, 0 },
760 { VCQPProp, VCBase64Prop, 0, 0 },
760 { VCQuickTimeProp, 0, 0, 0 }, 761 { VCQuickTimeProp, 0, 0, 0 },
761 { VCQuotedPrintableProp, 0, 0, 0 }, 762 { VCQuotedPrintableProp, 0, 0, 0 },
762 { VCRDateProp, 0, 0, 0 }, 763 { VCRDateProp, 0, 0, 0 },
763 { VCRegionProp, 0, 0, 0 }, 764 { VCRegionProp, 0, 0, 0 },
764 { VCRelatedToProp, 0, 0, 0 }, 765 { VCRelatedToProp, 0, 0, 0 },
765 { VCRepeatCountProp, 0, 0, 0 }, 766 { VCRepeatCountProp, 0, 0, 0 },
766 { VCResourcesProp, 0, 0, 0 }, 767 { VCResourcesProp, 0, 0, 0 },
767 { VCRNumProp, 0, 0, 0 }, 768 { VCRNumProp, 0, 0, 0 },
768 { VCRoleProp, 0, 0, 0 }, 769 { VCRoleProp, 0, 0, 0 },
769 { VCRRuleProp, 0, 0, 0 }, 770 { VCRRuleProp, 0, 0, 0 },
770 { VCRSVPProp, 0, 0, 0 }, 771 { VCRSVPProp, 0, 0, 0 },
771 { VCRunTimeProp, 0, 0, 0 }, 772 { VCRunTimeProp, 0, 0, 0 },
772 { VCSequenceProp, 0, 0, 0 }, 773 { VCSequenceProp, 0, 0, 0 },
773 { VCSnoozeTimeProp, 0, 0, 0 }, 774 { VCSnoozeTimeProp, 0, 0, 0 },
774 { VCStartProp, 0, 0, 0 }, 775 { VCStartProp, 0, 0, 0 },
775 { VCStatusProp, 0, 0, 0 }, 776 { VCStatusProp, 0, 0, 0 },
776 { VCStreetAddressProp, 0, 0, 0 }, 777 { VCStreetAddressProp, 0, 0, 0 },
777 { VCSubTypeProp, 0, 0, 0 }, 778 { VCSubTypeProp, 0, 0, 0 },
778 { VCSummaryProp, 0, 0, 0 }, 779 { VCSummaryProp, 0, 0, 0 },
779 { VCTelephoneProp, 0, 0, 0 }, 780 { VCTelephoneProp, 0, 0, 0 },
780 { VCTIFFProp, 0, 0, 0 }, 781 { VCTIFFProp, 0, 0, 0 },
781 { VCTimeZoneProp, 0, 0, 0 }, 782 { VCTimeZoneProp, 0, 0, 0 },
782 { VCTitleProp, 0, 0, 0 }, 783 { VCTitleProp, 0, 0, 0 },
783 { VCTLXProp, 0, 0, 0 }, 784 { VCTLXProp, 0, 0, 0 },
784 { VCTodoProp, 0, 0, PD_BEGIN }, 785 { VCTodoProp, 0, 0, PD_BEGIN },
785 { VCTranspProp, 0, 0, 0 }, 786 { VCTranspProp, 0, 0, 0 },
786 { VCUniqueStringProp, 0, 0, 0 }, 787 { VCUniqueStringProp, 0, 0, 0 },
787 { VCURLProp, 0, 0, 0 }, 788 { VCURLProp, 0, 0, 0 },
788 { VCURLValueProp, 0, 0, 0 }, 789 { VCURLValueProp, 0, 0, 0 },
789 { VCValueProp, 0, 0, 0 }, 790 { VCValueProp, 0, 0, 0 },
790 { VCVersionProp, 0, 0, 0 }, 791 { VCVersionProp, 0, 0, 0 },
791 { VCVideoProp, 0, 0, 0 }, 792 { VCVideoProp, 0, 0, 0 },
792 { VCVoiceProp, 0, 0, 0 }, 793 { VCVoiceProp, 0, 0, 0 },
793 { VCWAVEProp, 0, 0, 0 }, 794 { VCWAVEProp, 0, 0, 0 },
794 { VCWMFProp, 0, 0, 0 }, 795 { VCWMFProp, 0, 0, 0 },
795 { VCWorkProp, 0, 0, 0 }, 796 { VCWorkProp, 0, 0, 0 },
796 { VCX400Prop, 0, 0, 0 }, 797 { VCX400Prop, 0, 0, 0 },
797 { VCX509Prop, 0, 0, 0 }, 798 { VCX509Prop, 0, 0, 0 },
798 { VCXRuleProp, 0, 0, 0 }, 799 { VCXRuleProp, 0, 0, 0 },
799 { 0,0,0,0 } 800 { 0,0,0,0 }
800 }; 801 };
801 802
802 803
803static struct PreDefProp* lookupPropInfo(const char* str) 804static struct PreDefProp* lookupPropInfo(const char* str)
804{ 805{
805 /* brute force for now, could use a hash table here. */ 806 /* brute force for now, could use a hash table here. */
806 int i; 807 int i;
807 808