-
Notifications
You must be signed in to change notification settings - Fork 0
/
d.go
206 lines (190 loc) · 6.64 KB
/
d.go
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/*
* Copyright (c) 2000-2018, 达梦数据库有限公司.
* All rights reserved.
*/
package dm
import (
"container/list"
"io"
)
type Dm_build_1498 struct {
dm_build_1499 *list.List
dm_build_1500 *dm_build_1552
dm_build_1501 int
}
func Dm_build_1502() *Dm_build_1498 {
return &Dm_build_1498{
dm_build_1499: list.New(),
dm_build_1501: 0,
}
}
func (dm_build_1504 *Dm_build_1498) Dm_build_1503() int {
return dm_build_1504.dm_build_1501
}
func (dm_build_1506 *Dm_build_1498) Dm_build_1505(dm_build_1507 *Dm_build_0, dm_build_1508 int) int {
var dm_build_1509 = 0
var dm_build_1510 = 0
for dm_build_1509 < dm_build_1508 && dm_build_1506.dm_build_1500 != nil {
dm_build_1510 = dm_build_1506.dm_build_1500.dm_build_1560(dm_build_1507, dm_build_1508-dm_build_1509)
if dm_build_1506.dm_build_1500.dm_build_1555 == 0 {
dm_build_1506.dm_build_1542()
}
dm_build_1509 += dm_build_1510
dm_build_1506.dm_build_1501 -= dm_build_1510
}
return dm_build_1509
}
func (dm_build_1512 *Dm_build_1498) Dm_build_1511(dm_build_1513 []byte, dm_build_1514 int, dm_build_1515 int) int {
var dm_build_1516 = 0
var dm_build_1517 = 0
for dm_build_1516 < dm_build_1515 && dm_build_1512.dm_build_1500 != nil {
dm_build_1517 = dm_build_1512.dm_build_1500.dm_build_1564(dm_build_1513, dm_build_1514, dm_build_1515-dm_build_1516)
if dm_build_1512.dm_build_1500.dm_build_1555 == 0 {
dm_build_1512.dm_build_1542()
}
dm_build_1516 += dm_build_1517
dm_build_1512.dm_build_1501 -= dm_build_1517
dm_build_1514 += dm_build_1517
}
return dm_build_1516
}
func (dm_build_1519 *Dm_build_1498) Dm_build_1518(dm_build_1520 io.Writer, dm_build_1521 int) int {
var dm_build_1522 = 0
var dm_build_1523 = 0
for dm_build_1522 < dm_build_1521 && dm_build_1519.dm_build_1500 != nil {
dm_build_1523 = dm_build_1519.dm_build_1500.dm_build_1569(dm_build_1520, dm_build_1521-dm_build_1522)
if dm_build_1519.dm_build_1500.dm_build_1555 == 0 {
dm_build_1519.dm_build_1542()
}
dm_build_1522 += dm_build_1523
dm_build_1519.dm_build_1501 -= dm_build_1523
}
return dm_build_1522
}
func (dm_build_1525 *Dm_build_1498) Dm_build_1524(dm_build_1526 []byte, dm_build_1527 int, dm_build_1528 int) {
if dm_build_1528 == 0 {
return
}
var dm_build_1529 = dm_build_1556(dm_build_1526, dm_build_1527, dm_build_1528)
if dm_build_1525.dm_build_1500 == nil {
dm_build_1525.dm_build_1500 = dm_build_1529
} else {
dm_build_1525.dm_build_1499.PushBack(dm_build_1529)
}
dm_build_1525.dm_build_1501 += dm_build_1528
}
func (dm_build_1531 *Dm_build_1498) dm_build_1530(dm_build_1532 int) byte {
var dm_build_1533 = dm_build_1532
var dm_build_1534 = dm_build_1531.dm_build_1500
for dm_build_1533 > 0 && dm_build_1534 != nil {
if dm_build_1534.dm_build_1555 == 0 {
continue
}
if dm_build_1533 > dm_build_1534.dm_build_1555-1 {
dm_build_1533 -= dm_build_1534.dm_build_1555
dm_build_1534 = dm_build_1531.dm_build_1499.Front().Value.(*dm_build_1552)
} else {
break
}
}
return dm_build_1534.dm_build_1573(dm_build_1533)
}
func (dm_build_1536 *Dm_build_1498) Dm_build_1535(dm_build_1537 *Dm_build_1498) {
if dm_build_1537.dm_build_1501 == 0 {
return
}
var dm_build_1538 = dm_build_1537.dm_build_1500
for dm_build_1538 != nil {
dm_build_1536.dm_build_1539(dm_build_1538)
dm_build_1537.dm_build_1542()
dm_build_1538 = dm_build_1537.dm_build_1500
}
dm_build_1537.dm_build_1501 = 0
}
func (dm_build_1540 *Dm_build_1498) dm_build_1539(dm_build_1541 *dm_build_1552) {
if dm_build_1541.dm_build_1555 == 0 {
return
}
if dm_build_1540.dm_build_1500 == nil {
dm_build_1540.dm_build_1500 = dm_build_1541
} else {
dm_build_1540.dm_build_1499.PushBack(dm_build_1541)
}
dm_build_1540.dm_build_1501 += dm_build_1541.dm_build_1555
}
func (dm_build_1543 *Dm_build_1498) dm_build_1542() {
var dm_build_1544 = dm_build_1543.dm_build_1499.Front()
if dm_build_1544 == nil {
dm_build_1543.dm_build_1500 = nil
} else {
dm_build_1543.dm_build_1500 = dm_build_1544.Value.(*dm_build_1552)
dm_build_1543.dm_build_1499.Remove(dm_build_1544)
}
}
func (dm_build_1546 *Dm_build_1498) Dm_build_1545() []byte {
var dm_build_1547 = make([]byte, dm_build_1546.dm_build_1501)
var dm_build_1548 = dm_build_1546.dm_build_1500
var dm_build_1549 = 0
var dm_build_1550 = len(dm_build_1547)
var dm_build_1551 = 0
for dm_build_1548 != nil {
if dm_build_1548.dm_build_1555 > 0 {
if dm_build_1550 > dm_build_1548.dm_build_1555 {
dm_build_1551 = dm_build_1548.dm_build_1555
} else {
dm_build_1551 = dm_build_1550
}
copy(dm_build_1547[dm_build_1549:dm_build_1549+dm_build_1551], dm_build_1548.dm_build_1553[dm_build_1548.dm_build_1554:dm_build_1548.dm_build_1554+dm_build_1551])
dm_build_1549 += dm_build_1551
dm_build_1550 -= dm_build_1551
}
if dm_build_1546.dm_build_1499.Front() == nil {
dm_build_1548 = nil
} else {
dm_build_1548 = dm_build_1546.dm_build_1499.Front().Value.(*dm_build_1552)
}
}
return dm_build_1547
}
type dm_build_1552 struct {
dm_build_1553 []byte
dm_build_1554 int
dm_build_1555 int
}
func dm_build_1556(dm_build_1557 []byte, dm_build_1558 int, dm_build_1559 int) *dm_build_1552 {
return &dm_build_1552{
dm_build_1557,
dm_build_1558,
dm_build_1559,
}
}
func (dm_build_1561 *dm_build_1552) dm_build_1560(dm_build_1562 *Dm_build_0, dm_build_1563 int) int {
if dm_build_1561.dm_build_1555 <= dm_build_1563 {
dm_build_1563 = dm_build_1561.dm_build_1555
}
dm_build_1562.Dm_build_79(dm_build_1561.dm_build_1553[dm_build_1561.dm_build_1554 : dm_build_1561.dm_build_1554+dm_build_1563])
dm_build_1561.dm_build_1554 += dm_build_1563
dm_build_1561.dm_build_1555 -= dm_build_1563
return dm_build_1563
}
func (dm_build_1565 *dm_build_1552) dm_build_1564(dm_build_1566 []byte, dm_build_1567 int, dm_build_1568 int) int {
if dm_build_1565.dm_build_1555 <= dm_build_1568 {
dm_build_1568 = dm_build_1565.dm_build_1555
}
copy(dm_build_1566[dm_build_1567:dm_build_1567+dm_build_1568], dm_build_1565.dm_build_1553[dm_build_1565.dm_build_1554:dm_build_1565.dm_build_1554+dm_build_1568])
dm_build_1565.dm_build_1554 += dm_build_1568
dm_build_1565.dm_build_1555 -= dm_build_1568
return dm_build_1568
}
func (dm_build_1570 *dm_build_1552) dm_build_1569(dm_build_1571 io.Writer, dm_build_1572 int) int {
if dm_build_1570.dm_build_1555 <= dm_build_1572 {
dm_build_1572 = dm_build_1570.dm_build_1555
}
dm_build_1571.Write(dm_build_1570.dm_build_1553[dm_build_1570.dm_build_1554 : dm_build_1570.dm_build_1554+dm_build_1572])
dm_build_1570.dm_build_1554 += dm_build_1572
dm_build_1570.dm_build_1555 -= dm_build_1572
return dm_build_1572
}
func (dm_build_1574 *dm_build_1552) dm_build_1573(dm_build_1575 int) byte {
return dm_build_1574.dm_build_1553[dm_build_1574.dm_build_1554+dm_build_1575]
}