Lines Matching refs:sub
113 Substring sub; in Substring_Init() local
115 sub.start = start; in Substring_Init()
116 sub.end = end; in Substring_Init()
117 return sub; in Substring_Init()
127 Substring_Length(Substring sub) in Substring_Length() argument
129 return (size_t)(sub.end - sub.start); in Substring_Length()
133 Substring_IsEmpty(Substring sub) in Substring_IsEmpty() argument
135 return sub.start == sub.end; in Substring_IsEmpty()
139 Substring_Equals(Substring sub, const char *str) in Substring_Equals() argument
142 return Substring_Length(sub) == len && in Substring_Equals()
143 memcmp(sub.start, str, len) == 0; in Substring_Equals()
147 Substring_Eq(Substring sub, Substring str) in Substring_Eq() argument
149 size_t len = Substring_Length(sub); in Substring_Eq()
151 memcmp(sub.start, str.start, len) == 0; in Substring_Eq()
155 Substring_HasPrefix(Substring sub, Substring prefix) in Substring_HasPrefix() argument
157 return Substring_Length(sub) >= Substring_Length(prefix) && in Substring_HasPrefix()
158 memcmp(sub.start, prefix.start, Substring_Length(prefix)) == 0; in Substring_HasPrefix()
162 Substring_HasSuffix(Substring sub, Substring suffix) in Substring_HasSuffix() argument
165 return Substring_Length(sub) >= suffixLen && in Substring_HasSuffix()
166 memcmp(sub.end - suffixLen, suffix.start, suffixLen) == 0; in Substring_HasSuffix()
171 Substring_Str(Substring sub) in Substring_Str() argument
173 if (Substring_IsEmpty(sub)) in Substring_Str()
175 return FStr_InitOwn(bmake_strsedup(sub.start, sub.end)); in Substring_Str()
179 Substring_SkipFirst(Substring sub, char ch) in Substring_SkipFirst() argument
183 for (p = sub.start; p != sub.end; p++) in Substring_SkipFirst()
186 return sub.start; in Substring_SkipFirst()
190 Substring_FindLast(Substring sub, char ch) in Substring_FindLast() argument
194 for (p = sub.end; p != sub.start; p--) in Substring_FindLast()
271 LazyBuf_AddSubstring(LazyBuf *buf, Substring sub) in LazyBuf_AddSubstring() argument
275 for (p = sub.start; p != sub.end; p++) in LazyBuf_AddSubstring()