• Home
  • Raw
  • Download

Lines Matching +full:magic +full:- +full:string

13 //	"sky!"		[4]byte		# magic number
16 // filename string
20 // names []string
49 // filename string
53 // type varint # 0=string string
54 // data ... # 1=bytes string
57 // # 4=bigint string (decimal ASCII text)
59 // The encoding starts with a four-byte magic number.
60 // The next four bytes are a little-endian uint32
61 // that provides the offset of the string section
73 // so the start offset of each string is implicit.
93 const magic = "!sky" const
98 e.p = append(e.p, magic...)
99 e.p = append(e.p, "????"...) // string data offset; filled in later
101 e.string(prog.Toplevel.Pos.Filename())
105 e.string(name)
110 case string:
112 e.string(c)
115 e.string(string(c))
124 e.string(c.Text(10))
134 // Patch in the offset of the string data section.
160 func (e *encoder) string(s string) { func
171 e.string(bind.Name)
185 e.string(fn.Doc)
214 if len(data) < len(magic) {
215 return nil, fmt.Errorf("not a compiled module: no magic number")
217 if got := string(data[:4]); got != magic {
218 return nil, fmt.Errorf("not a compiled module: got magic number %q, want %q",
219 got, magic)
238 filename := d.string()
243 names := make([]string, d.int())
245 names[i] = d.string()
254 c = d.string()
256 c = Bytes(d.string())
262 c, _ = new(big.Int).SetString(d.string(), 10)
297 filename *string // (indirect to avoid keeping decoder live)
316 func (d *decoder) string() (s string) { func
318 // Avoid a memory allocation for each string
320 type string struct {
324 ptr := (*string)(unsafe.Pointer(&s))
339 name := d.string()
365 doc := d.string()