Home | History | Annotate | Download | only in spellprog

Lines Matching refs:back

58 look(u_char *string, u_char *front, u_char *back)
68 front = binary_search(string, front, back);
69 front = linear_search(string, front, back);
75 * Binary search for "string" in memory between "front" and "back".
85 * back points to the beginning of a line at or after the first
90 * back = EOF;
94 * p = first newline after halfway point from front to back.
97 * p is the new front. Otherwise it is the new back.
104 * In fact, it returns when the chosen "p" equals "back". This
106 * (back - front), which in turn implies that a linear search will
112 #define SKIP_PAST_NEWLINE(p, back) \
113 while (p < back && *p++ != '\n') \
117 binary_search(u_char *string, u_char *front, u_char *back)
121 p = front + (back - front) / 2;
122 SKIP_PAST_NEWLINE(p, back);
128 while (p < back && back > front) {
129 if (compare(string, p, back) > 0)
132 back = p;
133 p = front + (back - front) / 2;
134 SKIP_PAST_NEWLINE(p, back);
141 * to back.
151 linear_search(u_char *string, u_char *front, u_char *back)
155 while (front < back) {
156 result = compare(string, front, back);
162 SKIP_PAST_NEWLINE(front, back);
168 compare(u_char *s1, u_char *s2, u_char *back)
174 if (*s2 == '\n' || s2 == back)