-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommon.go
More file actions
40 lines (34 loc) · 717 Bytes
/
common.go
File metadata and controls
40 lines (34 loc) · 717 Bytes
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
package main
import (
"os"
)
//HexRecord defines strcture of a line in HexDump.
type HexRecord struct {
byteCount uint8
offset uint16
recordType uint8
data []byte
checksum byte
linearAddr uint32
}
//HexFormat is an iterface for pasring hexdumps.
type HexFormat struct {
input *os.File
output *os.File
buffers map[uint32][]byte
records []*HexRecord
}
// Parse is an abstract definition to parse input file content.
func (hxfmt *HexFormat) Parse() bool {
return false
}
// Dump dumps content to outfile.
/* func (hxfmt *HexFormat) Dump() int32 {
var preRecord HexRecord
writer := bufio.NewWriter(hxfmt.output)
contentLength := 0
for record := range hxfmt.records {
}
return
}
*/