예제 #1
0
파일: messages.go 프로젝트: gmuch/gmuch
func (ms *Messages) get() *Message {
	cmessage := C.notmuch_messages_get(ms.toC())
	checkOOM(unsafe.Pointer(cmessage))
	message := &Message{
		cptr:   unsafe.Pointer(cmessage),
		parent: (*cStruct)(ms),
	}
	setGcClose(message)
	return message
}
예제 #2
0
/* Get the current message from 'messages' as a notmuch_message_t.
 *
 * Note: The returned message belongs to 'messages' and has a lifetime
 * identical to it (and the query to which it belongs).
 *
 * See the documentation of notmuch_query_search_messages for example
 * code showing how to iterate over a notmuch_messages_t object.
 *
 * If an out-of-memory situation occurs, this function will return
 * NULL.
 */
func (self *Messages) Get() *Message {
	if self.messages == nil {
		return nil
	}
	msg := C.notmuch_messages_get(self.messages)
	if msg == nil {
		return nil
	}
	return &Message{message: msg}
}