//export go_msg_callback
185327
func go_msg_callback(msgID C.uint16_t, data unsafe.Pointer, size C.size_t) {
	// convert unsafe.Pointer to byte slice
	sliceHeader := &reflect.SliceHeader{Data: uintptr(data), Len: int(size), Cap: int(size)}
	byteSlice := *(*[]byte)(unsafe.Pointer(sliceHeader))

	globalVppClient.msgCallback(uint16(msgID), byteSlice)
}
273038
func SendGroupMessage(hexid string, msg string) (uint64, error) {
	return sendGroupHelper(hexid, msg, nil)
}
735554
func (s *State) GlobalCallbacks() []GlobalCallback {
	s.mu.RLock()
	defer s.mu.RUnlock()

	return append([]GlobalCallback{}, s.globalCallbacks...)
}
1046636
func (g *GoWebSocket) MessageSend(v interface{}) error {
	return websocket.Message.Send(g.Conn, v)
}
623360
func (m *Message) SendCallback(fn CallbackFunc, arg interface{}) error {
	s, err := newSocket()
	if err != nil {
		return err
	}
	defer s.free()

	if errno := C.genl_connect(s.nls); errno != 0 {
		return &Error{errno, "failed to connect to netlink"}
	}
	defer C.nl_close(s.nls)

	cbArg := &callbackArg{fn: fn, arg: arg}
	cbID := registerCallback(cbArg)
	defer unregisterCallback(cbArg)

	if errno := C._nl_socket_modify_cb(s.nls, C.NL_CB_VALID, C.NL_CB_CUSTOM, (C.nl_recvmsg_msg_cb_t)(unsafe.Pointer(C.callbackGateway)), C.uintptr_t(cbID)); errno != 0 {
		return &Error{errno, "failed to modify callback"}
	}
	// nl_send_auto_complete returns number of bytes sent or a negative
	// errno on failure.
	if errno := C.nl_send_auto_complete(s.nls, m.nlm); errno < 0 {
		return &Error{errno, "failed to send netlink message"}
	}
	if errno := C.nl_recvmsgs_default(s.nls); errno != 0 {
		return &Error{errno, "failed to receive messages"}
	}
	return nil
}
1155764
func (l *Logger) Msg(format string, v ...interface{}) {
	fmt.Fprintf(l.stdout, appendNewLine(format), v...)
}
310685
func msgLen(msg interface{}) (msgLen int) {
	switch m := msg.(type) {
	case string:
		msgLen = len(m)
	case []slack.Attachment:
		msgLen = len(fmt.Sprintf("%#v", m))
	}
	return
}
947886
func (bot TgBot) SimpleSendMessage(msg Message, text string) (res Message, err error) {
	ressm := bot.SendMessage(msg.Chat.ID, text, nil, nil, nil, nil)
	return splitResultInMessageError(ressm)
}
1329905
func MsgToCorePlugins(msg []*Plugin) []core.Plugin {
	plugins := make([]core.Plugin, len(msg))
	for i, v := range msg {
		plugins[i] = MsgToCorePlugin(v)
	}
	return plugins
}
194075
func (vtg *VTGate) MessageAck(ctx context.Context, request *vtgatepb.MessageAckRequest) (response *querypb.MessageAckResponse, err error) {
	defer vtg.server.HandlePanic(&err)
	ctx = withCallerIDContext(ctx, request.CallerId)
	count, vtgErr := vtg.server.MessageAck(ctx, request.Keyspace, request.Name, request.Ids)
	if vtgErr != nil {
		return nil, vterrors.ToGRPC(vtgErr)
	}
	return &querypb.MessageAckResponse{
		Result: &querypb.QueryResult{
			RowsAffected: uint64(count),
		},
	}, nil
}
206598
func SendMessage(command, family, flags int) error {
	return SendMessageCallback(command, family, flags, callbackDefault, nil)
}
966246
func SendMessage(tel, msg string) (uint64, error) {
	omsg := &outgoingMessage{
		tel: tel,
		msg: msg,
	}
	return sendMessage(omsg)
}
198771
func (c *Connection) msgCallback(msgID uint16, data []byte) {
	if c == nil {
		log.Warn("Already disconnected, ignoring the message.")
		return
	}

	msg, ok := c.msgMap[msgID]
	if !ok {
		log.Warnf("Unknown message received, ID: %d", msgID)
		return
	}

	// decode message context to fix for special cases of messages,
	// for example:
	// - replies that don't have context as first field (comes as zero)
	// - events that don't have context at all (comes as non zero)
	//
	context, err := c.codec.DecodeMsgContext(data, msg)
	if err != nil {
		log.Errorf("decoding context failed: %v", err)
	}

	chanID, isMulti, seqNum := unpackRequestContext(context)
	if log.Level == logger.DebugLevel { // for performance reasons - logrus does some processing even if debugs are disabled
		log.WithFields(logger.Fields{
			"context":  context,
			"msg_id":   msgID,
			"msg_size": len(data),
			"channel":  chanID,
			"is_multi": isMulti,
			"seq_num":  seqNum,
			"msg_crc":  msg.GetCrcString(),
		}).Debugf("<-- govpp recv: %s", msg.GetMessageName())
	}

	if context == 0 || c.isNotificationMessage(msgID) {
		// process the message as a notification
		c.sendNotifications(msgID, data)
		return
	}

	// match ch according to the context
	c.channelsLock.RLock()
	ch, ok := c.channels[chanID]
	c.channelsLock.RUnlock()
	if !ok {
		log.WithFields(logger.Fields{
			"channel": chanID,
			"msg_id":  msgID,
		}).Error("Channel ID not known, ignoring the message.")
		return
	}

	// if this is a control ping reply to a multipart request,
	// treat this as a last part of the reply
	lastReplyReceived := isMulti && msgID == c.pingReplyID

	// send the data to the channel, it needs to be copied,
	// because it will be freed after this function returns
	sendReply(ch, &vppReply{
		msgID:        msgID,
		seqNum:       seqNum,
		data:         append([]byte(nil), data...),
		lastReceived: lastReplyReceived,
	})

	// store actual time of this reply
	c.lastReplyLock.Lock()
	c.lastReply = time.Now()
	c.lastReplyLock.Unlock()
}
888014
func (c *Callbacks) OnCUserMessageCloseCaption(fn func(*dota.CUserMessageCloseCaption) error) {
	c.onCUserMessageCloseCaption = append(c.onCUserMessageCloseCaption, fn)
}
388707
func (rtm *RTM) SendMessage(msg *OutgoingMessage) {
	if msg == nil {
		rtm.Debugln("Error: Attempted to SendMessage(nil)")
		return
	}

	rtm.outgoingMessages <- *msg
}
1094911
func (r *ResponseReverter) WriteMsg(res *dns.Msg) error {
	res.Question[0] = r.original
	return r.ResponseWriter.WriteMsg(res)
}
424988
func (e *ganeshaExporter) Export(path string) error {
	// Call AddExport using dbus
	conn, err := dbus.SystemBus()
	if err != nil {
		return fmt.Errorf("error getting dbus session bus: %v", err)
	}
	obj := conn.Object("org.ganesha.nfsd", "/org/ganesha/nfsd/ExportMgr")
	call := obj.Call("org.ganesha.nfsd.exportmgr.AddExport", 0, e.config, fmt.Sprintf("export(path = %s)", path))
	if call.Err != nil {
		return fmt.Errorf("error calling org.ganesha.nfsd.exportmgr.AddExport: %v", call.Err)
	}

	return nil
}