forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4e1d2a1
committed
Decouple psqlscan.l from surrounding program.
Remove assorted external references from psqlscan.l in preparation formaking it usable by other frontend programs. This mostly involvesgetting rid of direct calls to psql_error() and GetVariable() in favorof introducing a callback-functions struct to encapsulate variablefetching and error printing. In addition, pass the current encodingand standard-strings status as additional parameters to psql_scan_setupinstead of looking directly at "pset" or calling additional functions.I did not bother to change some references to psql_error that are infunctions that will soon migrate to a psql-specific backslash-commandlexer. Other than that, this version of psqlscan.l is capable ofcompiling standalone. It still depends on assorted src/common functionsas well as some encoding-related libpq functions, but we expect thatall programs using it will be happy with those dependencies.Kyotaro Horiguchi, somewhat editorialized on by me1 parent08a6d36 commit4e1d2a1
File tree
7 files changed
+154
-64
lines changed- src/bin/psql
7 files changed
+154
-64
lines changedLines changed: 59 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
110 | 169 |
| |
111 | 170 |
| |
112 | 171 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
| 22 | + | |
21 | 23 |
| |
22 | 24 |
| |
23 | 25 |
| |
|
Lines changed: 12 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
12 | 11 |
| |
13 | 12 |
| |
14 | 13 |
| |
| |||
17 | 16 |
| |
18 | 17 |
| |
19 | 18 |
| |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 |
| |
21 | 27 |
| |
22 | 28 |
| |
| |||
61 | 67 |
| |
62 | 68 |
| |
63 | 69 |
| |
64 |
| - | |
| 70 | + | |
65 | 71 |
| |
66 | 72 |
| |
67 | 73 |
| |
| |||
233 | 239 |
| |
234 | 240 |
| |
235 | 241 |
| |
236 |
| - | |
| 242 | + | |
| 243 | + | |
237 | 244 |
| |
238 | 245 |
| |
239 | 246 |
| |
| |||
373 | 380 |
| |
374 | 381 |
| |
375 | 382 |
| |
376 |
| - | |
| 383 | + | |
| 384 | + | |
377 | 385 |
| |
378 | 386 |
| |
379 | 387 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 |
| |
12 | 16 |
| |
13 | 17 |
|
Lines changed: 13 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 |
| |
40 |
| - | |
| 50 | + | |
41 | 51 |
| |
42 | 52 |
| |
43 | 53 |
| |
44 |
| - | |
| 54 | + | |
| 55 | + | |
45 | 56 |
| |
46 | 57 |
| |
47 | 58 |
| |
|
0 commit comments
Comments
(0)