OLD | NEW |
1 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd | 1 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd |
2 See the file COPYING for copying permission. | 2 See the file COPYING for copying permission. |
3 */ | 3 */ |
4 | 4 |
5 #ifndef Expat_INCLUDED | 5 #ifndef Expat_INCLUDED |
6 #define Expat_INCLUDED 1 | 6 #define Expat_INCLUDED 1 |
7 | 7 |
8 #ifdef __VMS | 8 #ifdef __VMS |
9 /* 0 1 2 3 0 1 2 3 | 9 /* 0 1 2 3 0 1 2 3 |
10 1234567890123456789012345678901 1234567890123456789012345678901 */ | 10 1234567890123456789012345678901 1234567890123456789012345678901 */ |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 XML_GetSpecifiedAttributeCount(XML_Parser parser); | 735 XML_GetSpecifiedAttributeCount(XML_Parser parser); |
736 | 736 |
737 /* Returns the index of the ID attribute passed in the last call to | 737 /* Returns the index of the ID attribute passed in the last call to |
738 XML_StartElementHandler, or -1 if there is no ID attribute. Each | 738 XML_StartElementHandler, or -1 if there is no ID attribute. Each |
739 attribute/value pair counts as 2; thus this correspondds to an | 739 attribute/value pair counts as 2; thus this correspondds to an |
740 index into the atts array passed to the XML_StartElementHandler. | 740 index into the atts array passed to the XML_StartElementHandler. |
741 */ | 741 */ |
742 XMLPARSEAPI(int) | 742 XMLPARSEAPI(int) |
743 XML_GetIdAttributeIndex(XML_Parser parser); | 743 XML_GetIdAttributeIndex(XML_Parser parser); |
744 | 744 |
| 745 #ifdef XML_ATTR_INFO |
| 746 /* Source file byte offsets for the start and end of attribute names and values. |
| 747 The value indices are exclusive of surrounding quotes; thus in a UTF-8 source |
| 748 file an attribute value of "blah" will yield: |
| 749 info->valueEnd - info->valueStart = 4 bytes. |
| 750 */ |
| 751 typedef struct { |
| 752 XML_Index nameStart; /* Offset to beginning of the attribute name. */ |
| 753 XML_Index nameEnd; /* Offset after the attribute name's last byte. */ |
| 754 XML_Index valueStart; /* Offset to beginning of the attribute value. */ |
| 755 XML_Index valueEnd; /* Offset after the attribute value's last byte. */ |
| 756 } XML_AttrInfo; |
| 757 |
| 758 /* Returns an array of XML_AttrInfo structures for the attribute/value pairs |
| 759 passed in last call to the XML_StartElementHandler that were specified |
| 760 in the start-tag rather than defaulted. Each attribute/value pair counts |
| 761 as 1; thus the number of entries in the array is |
| 762 XML_GetSpecifiedAttributeCount(parser) / 2. |
| 763 */ |
| 764 XMLPARSEAPI(const XML_AttrInfo *) |
| 765 XML_GetAttributeInfo(XML_Parser parser); |
| 766 #endif |
| 767 |
745 /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is | 768 /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is |
746 detected. The last call to XML_Parse must have isFinal true; len | 769 detected. The last call to XML_Parse must have isFinal true; len |
747 may be zero for this call (or any other). | 770 may be zero for this call (or any other). |
748 | 771 |
749 Though the return values for these functions has always been | 772 Though the return values for these functions has always been |
750 described as a Boolean value, the implementation, at least for the | 773 described as a Boolean value, the implementation, at least for the |
751 1.95.x series, has always returned exactly one of the XML_Status | 774 1.95.x series, has always returned exactly one of the XML_Status |
752 values. | 775 values. |
753 */ | 776 */ |
754 XMLPARSEAPI(enum XML_Status) | 777 XMLPARSEAPI(enum XML_Status) |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 entity parsing (ie without XML_DTD being defined), then | 899 entity parsing (ie without XML_DTD being defined), then |
877 XML_SetParamEntityParsing will return 0 if parsing of parameter | 900 XML_SetParamEntityParsing will return 0 if parsing of parameter |
878 entities is requested; otherwise it will return non-zero. | 901 entities is requested; otherwise it will return non-zero. |
879 Note: If XML_SetParamEntityParsing is called after XML_Parse or | 902 Note: If XML_SetParamEntityParsing is called after XML_Parse or |
880 XML_ParseBuffer, then it has no effect and will always return 0. | 903 XML_ParseBuffer, then it has no effect and will always return 0. |
881 */ | 904 */ |
882 XMLPARSEAPI(int) | 905 XMLPARSEAPI(int) |
883 XML_SetParamEntityParsing(XML_Parser parser, | 906 XML_SetParamEntityParsing(XML_Parser parser, |
884 enum XML_ParamEntityParsing parsing); | 907 enum XML_ParamEntityParsing parsing); |
885 | 908 |
| 909 /* Sets the hash salt to use for internal hash calculations. |
| 910 Helps in preventing DoS attacks based on predicting hash |
| 911 function behavior. This must be called before parsing is started. |
| 912 Returns 1 if successful, 0 when called after parsing has started. |
| 913 */ |
| 914 XMLPARSEAPI(int) |
| 915 XML_SetHashSalt(XML_Parser parser, |
| 916 unsigned long hash_salt); |
| 917 |
886 /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then | 918 /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then |
887 XML_GetErrorCode returns information about the error. | 919 XML_GetErrorCode returns information about the error. |
888 */ | 920 */ |
889 XMLPARSEAPI(enum XML_Error) | 921 XMLPARSEAPI(enum XML_Error) |
890 XML_GetErrorCode(XML_Parser parser); | 922 XML_GetErrorCode(XML_Parser parser); |
891 | 923 |
892 /* These functions return information about the current parse | 924 /* These functions return information about the current parse |
893 location. They may be called from any callback called to report | 925 location. They may be called from any callback called to report |
894 some parse event; in this case the location is the location of the | 926 some parse event; in this case the location is the location of the |
895 first of the sequence of characters that generated the event. When | 927 first of the sequence of characters that generated the event. When |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 enum XML_FeatureEnum { | 1009 enum XML_FeatureEnum { |
978 XML_FEATURE_END = 0, | 1010 XML_FEATURE_END = 0, |
979 XML_FEATURE_UNICODE, | 1011 XML_FEATURE_UNICODE, |
980 XML_FEATURE_UNICODE_WCHAR_T, | 1012 XML_FEATURE_UNICODE_WCHAR_T, |
981 XML_FEATURE_DTD, | 1013 XML_FEATURE_DTD, |
982 XML_FEATURE_CONTEXT_BYTES, | 1014 XML_FEATURE_CONTEXT_BYTES, |
983 XML_FEATURE_MIN_SIZE, | 1015 XML_FEATURE_MIN_SIZE, |
984 XML_FEATURE_SIZEOF_XML_CHAR, | 1016 XML_FEATURE_SIZEOF_XML_CHAR, |
985 XML_FEATURE_SIZEOF_XML_LCHAR, | 1017 XML_FEATURE_SIZEOF_XML_LCHAR, |
986 XML_FEATURE_NS, | 1018 XML_FEATURE_NS, |
987 XML_FEATURE_LARGE_SIZE | 1019 XML_FEATURE_LARGE_SIZE, |
| 1020 XML_FEATURE_ATTR_INFO |
988 /* Additional features must be added to the end of this enum. */ | 1021 /* Additional features must be added to the end of this enum. */ |
989 }; | 1022 }; |
990 | 1023 |
991 typedef struct { | 1024 typedef struct { |
992 enum XML_FeatureEnum feature; | 1025 enum XML_FeatureEnum feature; |
993 const XML_LChar *name; | 1026 const XML_LChar *name; |
994 long int value; | 1027 long int value; |
995 } XML_Feature; | 1028 } XML_Feature; |
996 | 1029 |
997 XMLPARSEAPI(const XML_Feature *) | 1030 XMLPARSEAPI(const XML_Feature *) |
998 XML_GetFeatureList(void); | 1031 XML_GetFeatureList(void); |
999 | 1032 |
1000 | 1033 |
1001 /* Expat follows the GNU/Linux convention of odd number minor version for | 1034 /* Expat follows the GNU/Linux convention of odd number minor version for |
1002 beta/development releases and even number minor version for stable | 1035 beta/development releases and even number minor version for stable |
1003 releases. Micro is bumped with each release, and set to 0 with each | 1036 releases. Micro is bumped with each release, and set to 0 with each |
1004 change to major or minor version. | 1037 change to major or minor version. |
1005 */ | 1038 */ |
1006 #define XML_MAJOR_VERSION 2 | 1039 #define XML_MAJOR_VERSION 2 |
1007 #define XML_MINOR_VERSION 0 | 1040 #define XML_MINOR_VERSION 1 |
1008 #define XML_MICRO_VERSION 1 | 1041 #define XML_MICRO_VERSION 0 |
1009 | 1042 |
1010 #ifdef __cplusplus | 1043 #ifdef __cplusplus |
1011 } | 1044 } |
1012 #endif | 1045 #endif |
1013 | 1046 |
1014 #endif /* not Expat_INCLUDED */ | 1047 #endif /* not Expat_INCLUDED */ |
OLD | NEW |