MCPcopy Create free account
hub / github.com/apache/trafficserver / ptr_len_casecmp

Function ptr_len_casecmp

include/tscore/ink_string.h:89–116  ·  view source on GitHub ↗

inline int ptr_len_casecmp(const char* p1, int l1, const char* p2, int l2) strcasecmp() functionality for two ptr length pairs

Source from the content-addressed store, hash-verified

87// strcasecmp() functionality for two ptr length pairs
88//
89inline int
90ptr_len_casecmp(const char *p1, int l1, const char *p2, int l2)
91{
92 if (l1 < l2) {
93 return -1;
94 } else if (l1 > l2) {
95 return 1;
96 }
97
98 while (l1) {
99 char p1c = ParseRules::ink_tolower(*p1);
100 char p2c = ParseRules::ink_tolower(*p2);
101
102 if (p1c != p2c) {
103 if (p1c > p2c) {
104 return 1;
105 } else {
106 return -1;
107 }
108 }
109
110 p1++;
111 p2++;
112 l1--;
113 }
114
115 return 0;
116}
117
118// inline const char* ptr_len_str(const char* p1, int l1, const char* str)
119//

Callers 3

HandleRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected