Tim Duesterhus | c1af0ba | 2021-09-15 13:58:43 +0200 | [diff] [blame] | 1 | @@ |
| 2 | struct ist i; |
| 3 | expression p, l; |
| 4 | @@ |
| 5 | |
| 6 | - i.ptr = p; |
| 7 | - i.len = l; |
| 8 | + i = ist2(p, l); |
| 9 | |
| 10 | @@ |
| 11 | @@ |
| 12 | |
| 13 | - ist2(NULL, 0) |
| 14 | + IST_NULL |
| 15 | |
| 16 | @@ |
| 17 | struct ist i; |
| 18 | expression e; |
| 19 | @@ |
| 20 | |
| 21 | - i.ptr += e; |
| 22 | - i.len -= e; |
| 23 | + i = istadv(i, e); |
| 24 | |
| 25 | @@ |
| 26 | struct ist i; |
| 27 | @@ |
| 28 | |
Tim Duesterhus | ef00c53 | 2021-11-04 22:35:43 +0100 | [diff] [blame] | 29 | - i = istadv(i, 1); |
| 30 | + i = istnext(i); |
| 31 | |
| 32 | @@ |
| 33 | struct ist i; |
Tim Duesterhus | ef00c53 | 2021-11-04 22:35:43 +0100 | [diff] [blame] | 34 | @@ |
| 35 | |
| 36 | - i.ptr++; |
| 37 | - i.len--; |
| 38 | + i = istnext(i); |
| 39 | |
| 40 | @@ |
| 41 | struct ist i; |
| 42 | @@ |
| 43 | |
Tim Duesterhus | 958f504 | 2021-11-06 15:14:43 +0100 | [diff] [blame] | 44 | - (\(i.ptr\|istptr(i)\) + \(i.len\|istlen(i)\)) |
| 45 | + istend(i) |
| 46 | |
| 47 | @@ |
| 48 | struct ist i; |
Tim Duesterhus | 9b80a6c | 2021-11-08 09:05:00 +0100 | [diff] [blame] | 49 | expression e; |
| 50 | @@ |
| 51 | |
| 52 | - if (\(i.len\|istlen(i)\) > e) { i.len = e; } |
| 53 | + i = isttrim(i, e); |
| 54 | |
| 55 | @@ |
| 56 | struct ist i; |
Tim Duesterhus | 755d241 | 2021-11-08 09:05:02 +0100 | [diff] [blame] | 57 | struct buffer *b; |
| 58 | @@ |
| 59 | |
| 60 | - chunk_memcat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\)); |
| 61 | + chunk_istcat(b, i); |
| 62 | |
| 63 | @@ |
| 64 | struct ist i; |
Tim Duesterhus | 958f504 | 2021-11-06 15:14:43 +0100 | [diff] [blame] | 65 | @@ |
| 66 | |
Tim Duesterhus | c1af0ba | 2021-09-15 13:58:43 +0200 | [diff] [blame] | 67 | - i.ptr != NULL |
| 68 | + isttest(i) |
| 69 | |
| 70 | @@ |
| 71 | char *s; |
| 72 | @@ |
| 73 | |
| 74 | ( |
| 75 | - ist2(s, strlen(s)) |
| 76 | + ist(s) |
| 77 | | |
| 78 | - ist2(strdup(s), strlen(s)) |
| 79 | + ist(strdup(s)) |
| 80 | ) |