File: ist.cocci

package info (click to toggle)
haproxy 3.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 23,928 kB
  • sloc: ansic: 268,119; sh: 3,466; xml: 1,756; python: 1,345; makefile: 1,155; perl: 168; cpp: 21
file content (86 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@@
struct ist i;
expression p, l;
@@

(
- i.ptr = p;
- i.len = strlen(i.ptr);
+ i = ist(p);
|
- i.ptr = p;
- i.len = l;
+ i = ist2(p, l);
)

@@
@@

- ist2(NULL, 0)
+ IST_NULL

@@
struct ist i;
expression e;
@@

- i.ptr += e;
- i.len -= e;
+ i = istadv(i, e);

@@
struct ist i;
@@

- i = istadv(i, 1);
+ i = istnext(i);

@@
struct ist i;
@@

- i.ptr++;
- i.len--;
+ i = istnext(i);

@@
struct ist i;
@@

- (\(i.ptr\|istptr(i)\) + \(i.len\|istlen(i)\))
+ istend(i)

@@
struct ist i;
expression e;
@@

- if (\(i.len\|istlen(i)\) > e) { i.len = e; }
+ i = isttrim(i, e);

@@
struct ist i;
struct buffer *b;
@@

- chunk_memcat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\));
+ chunk_istcat(b, i);

@@
struct ist i;
@@

- i.ptr != NULL
+ isttest(i)

@@
char *s;
@@

(
- ist2(s, strlen(s))
+ ist(s)
|
- ist2(strdup(s), strlen(s))
+ ist(strdup(s))
)