// print returns a human-readable string representation of the opcode for use
// in script disassembly.
552515
func (pop *parsedOpcode) print(oneline bool) string {
	// The reference implementation one-line disassembly replaces opcodes
	// which represent values (e.g. OP_0 through OP_16 and OP_1NEGATE)
	// with the raw value.  However, when not doing a one-line dissassembly,
	// we prefer to show the actual opcode names.  Thus, only replace the
	// opcodes in question when the oneline flag is set.
	opcodeName := pop.opcode.name
	if oneline {
		if replName, ok := opcodeOnelineRepls[opcodeName]; ok {
			opcodeName = replName
		}

		// Nothing more to do for non-data push opcodes.
		if pop.opcode.length == 1 {
			return opcodeName
		}

		return fmt.Sprintf("%x", pop.data)
	}

	// Nothing more to do for non-data push opcodes.
	if pop.opcode.length == 1 {
		return opcodeName
	}

	// Add length for the OP_PUSHDATA# opcodes.
	retString := opcodeName
	switch pop.opcode.length {
	case -1:
		retString += fmt.Sprintf(" 0x%02x", len(pop.data))
	case -2:
		retString += fmt.Sprintf(" 0x%04x", len(pop.data))
	case -4:
		retString += fmt.Sprintf(" 0x%08x", len(pop.data))
	}

	return fmt.Sprintf("%s 0x%02x", retString, pop.data)
}
161776
func (p *Printer) Print(obj runtime.Object, w io.Writer) error {
	if obj == nil {
		return nil
	}
	data, err := yaml.Marshal(obj)
	if err != nil {
		return err
	}
	_, err = w.Write(data)
	return err

}
1202685
func (u *UITable) Print() error {
	result := &bytes.Buffer{}
	t := u.Table

	err := t.PrintTo(result)
	if err != nil {
		return err
	}

	// DevNote. With the change to printing into a buffer all
	// lines now come with a terminating \n. The t.ui.Say() below
	// will then add another \n to that. To avoid this additional
	// line we chop off the last \n from the output (if there is
	// any). Operating on the slice avoids string copying.
	//
	// WIBNI if the terminal API had a variant of Say not assuming
	// that each output is a single line.

	r := result.Bytes()
	if len(r) > 0 {
		r = r[0 : len(r)-1]
	}

	// Only generate output for a non-empty table.
	if len(r) > 0 {
		u.UI.Say("%s", string(r))
	}
	return nil
}
106332
func (logger *Logger) Print(args ...interface{}) {
	unsafeStd := (*unsafe.Pointer)(unsafe.Pointer(&logger.std))
	stdVal := (*lg.Logger)(atomic.LoadPointer(unsafeStd))
	if stdVal != nil {
		stdVal.Print(args...)
	}
}
935469
func (p LogPrinter) Print(logger *Logger, a ...interface{}) {
	b := make([]interface{}, 1)
	b[0] = logger.Color(logger.Name)
	a = append(b, a...)
	log.Print(a...)
}
844984
func (a *Writer) Print(args ...interface{}) (int, error) {
	return fmt.Fprint(a.w, args...)
}
624334
func Print(err error) string {
	return fmt.Sprintf("%v: %v\n", Code(err), err.Error())
}
369142
func Print(format string, args ...interface{}) {
	if len(args) == 0 {
		fmt.Fprintln(OutputWriter, format)
		return
	}
	fmt.Fprintf(OutputWriter, format+"\n", args...)
}
643573
func Print(program string) string {
	m := map[string]string{
		"program":   program,
		"version":   Version,
		"revision":  Revision,
		"branch":    Branch,
		"buildUser": BuildUser,
		"buildDate": BuildDate,
		"goVersion": GoVersion,
	}
	t := template.Must(template.New("version").Parse(versionInfoTmpl))

	var buf bytes.Buffer
	if err := t.ExecuteTemplate(&buf, "version", m); err != nil {
		panic(err)
	}
	return strings.TrimSpace(buf.String())
}
203801
func (m *ElementWriter) Print(e *Element) string {
	// if we are on the server && is this element marked as removed, if so we skip and return an empty string
	if detect.IsServer() {
		if e.Removed() && !m.allowRemoved {
			return ""
		}
	}

	//if we are dealing with a text type just return the content
	if e.Name() == "text" {
		return m.text.Print(e)
	}

	//collect uid and hash of the element so we can write them along
	hash := &Attribute{"hash", e.Hash()}
	uid := &Attribute{"uid", e.UID()}

	//management attributes
	mido := []*Attribute{hash, uid}

	// if e.Removed() {
	// 	mido = append(mido, &Attribute{"haikuRemoved", ""})
	// }

	//write out the hash and uid as attributes
	hashes := m.attrWriter.Print(mido)

	//write out the elements attributes using the AttrWriter
	attrs := m.attrWriter.Print(e.Attributes())

	//write out the elements inline-styles using the StyleWriter
	style := m.styleWriter.Print(e.Styles())

	var closer string
	var beginbrack string

	if e.AutoClosed() {
		closer = "/>"
	} else {
		beginbrack = ">"
		closer = fmt.Sprintf("</%s>", e.Name())
	}

	var children = []string{}

	for _, ch := range e.Children() {
		// if ch.Name() == "text" {
		// 	children = append(children, m.text.Print(ch))
		// 	continue
		// }
		if ech, ok := ch.(*Element); ok {
			if ech == e {
				continue
			}
			children = append(children, m.Print(ech))
		}
	}

	//lets create the elements markup now
	return strings.Join([]string{
		fmt.Sprintf("<%s", e.Name()),
		hashes,
		attrs,
		fmt.Sprintf(` style="%s"`, style),
		beginbrack,
		e.textContent,
		strings.Join(children, ""),
		closer,
	}, "")
}
596017
func (l *Logger) Print(args ...interface{}) {
	l.logf(l.app, logLevelNotice, "", true, args...)
}
390340
func (l *Logger) Print(v ...interface{}) {
	if e := l.Debug(); e.Enabled() {
		e.Msg(fmt.Sprint(v...))
	}
}
576962
func (p *MJPEGPrinter) Print(r io.Reader, fps int) error {
	showCursor(p.w, false)
	defer showCursor(p.w, true)
	go p.handleInterrupt()

	reader := mjpegStreamer{
		r:   r,
		fps: fps,
	}

	for frame := range reader.ReadAll() {
		if frame.err != nil {
			return frame.err
		}

		frame.img = redraw(frame.img, p.c.Filter, p.c.Drawer)

		// Draw the image and reset the cursor
		if err := flush(p.w, frame.img, p.c.Flusher); err != nil {
			return err
		}
		rows := frame.img.Bounds().Dy() / 4
		if frame.img.Bounds().Dy()%4 != 0 {
			rows++
		}

		resetCursor(p.w, rows)
	}

	return nil
}
495265
func (t *StringTree) Print(w io.Writer, f StringIterateFunc, itemSiz int) {
	t.Tree.Print(w, func(v interface{}) bool { return f(v.(string)) }, itemSiz)
}
934184
func (t *PairTree) Print(w io.Writer, f PairIterateFunc, itemSiz int) {
	t.ObjectTree.Print(w, func(v interface{}) bool { return f(v.(Pair)) }, itemSiz)
}
397263
func (p *Packet) Print(context uint64) {

	if p.ipHdr.ipProto != IPProtocolTCP {
		return
	}

	logPkt := false
	detailed := false

	if PacketLogLevel || context == 0 {
		logPkt = true
		detailed = true
	}

	var buf string
	print := false

	if logPkt {
		if printCount%200 == 0 {
			buf += fmt.Sprintf("Packet: %5s %5s %25s %15s %5s %15s %5s %6s %20s %20s %6s %20s %20s %2s %5s %5s\n",
				"IPID", "Dir", "Comment", "SIP", "SP", "DIP", "DP", "Flags", "TCPSeq", "TCPAck", "TCPLen", "ExpAck", "ExpSeq", "DO", "Acsum", "Ccsum")
		}
		printCount++
		offset := 0

		if (p.GetTCPFlags() & TCPSynMask) == TCPSynMask {
			offset = 1
		}

		expAck := p.tcpHdr.tcpSeq + uint32(uint16(len(p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]))-p.TCPDataStartBytes()) + uint32(offset)
		ccsum := p.computeTCPChecksum()
		csumValidationStr := ""

		if p.tcpHdr.tcpChecksum != ccsum {
			csumValidationStr = "Bad Checksum"
		}

		buf += fmt.Sprintf("Packet: %5d %5s %25s %15s %5d %15s %5d %6s %20d %20d %6d %20d %20d %2d %5d %5d %12s\n",
			p.ipHdr.ipID,
			flagsToDir(p.context|context),
			flagsToStr(p.context|context),
			p.ipHdr.sourceAddress.To4().String(), p.tcpHdr.sourcePort,
			p.ipHdr.destinationAddress.To4().String(), p.tcpHdr.destinationPort,
			tcpFlagsToStr(p.GetTCPFlags()),
			p.tcpHdr.tcpSeq, p.tcpHdr.tcpAck, uint16(len(p.ipHdr.Buffer[p.ipHdr.ipHeaderLen:]))-p.TCPDataStartBytes(),
			expAck, expAck, p.tcpHdr.tcpDataOffset,
			p.tcpHdr.tcpChecksum, ccsum, csumValidationStr)
		print = true
	}

	if detailed {
		pktBytes := []byte{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 8, 0}
		pktBytes = append(pktBytes, p.ipHdr.Buffer...)
		pktBytes = append(pktBytes, p.tcpHdr.tcpOptions...)
		pktBytes = append(pktBytes, p.tcpHdr.tcpData...)
		buf += fmt.Sprintf("%s\n", hex.Dump(pktBytes))
		print = true
	}

	if print {
		zap.L().Debug(buf)
	}
}
1002721
func (l *Slog) Print(v ...interface{}) {
	l = l.copy()
	l.Log.di(fnLevelDi)
	l.Log.Message(fmt.Sprint(v...))
	l.commit()
}