go-hep.org/x/hep@v0.38.1/sio/defs.go (about)

     1  // Copyright ©2017 The go-hep Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package sio
     6  
     7  type Operation int
     8  
     9  const (
    10  	OpRead Operation = iota
    11  	OpWrite
    12  )
    13  
    14  const (
    15  	recMarker      uint32 = 0xabadcafe
    16  	blkMarker      uint32 = 0xdeadbeef
    17  	ptagMarker     uint32 = 0xffffffff
    18  	pntrMarker     uint32 = 0x00000000
    19  	optCompress    uint32 = 0x00000001
    20  	optNotCompress uint32 = 0xfffffffe
    21  	alignLen       uint32 = 0x00000003
    22  )
    23  
    24  var (
    25  	blkMarkerBeg = []byte{222, 173, 190, 239}
    26  )
    27  
    28  // align4U32 returns sz adjusted to align at 4-byte boundaries
    29  func align4U32(sz uint32) uint32 {
    30  	return sz + (4-(sz&alignLen))&alignLen
    31  }