SolarCapture C Bindings
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
mailbox.h
Go to the documentation of this file.
1 
8 #ifndef __SOLAR_CAPTURE_MAILBOX_H__
9 #define __SOLAR_CAPTURE_MAILBOX_H__
10 
11 
12 struct sc_mailbox;
13 struct sc_attr;
14 struct sc_thread;
15 struct sc_node;
16 
17 
33 extern int sc_mailbox_alloc(struct sc_mailbox** mb_out, const struct sc_attr* attr,
34  struct sc_thread* thread);
35 
45 extern int sc_mailbox_connect(struct sc_mailbox* mb1, struct sc_mailbox* mb2);
46 
57 extern int sc_mailbox_set_recv(struct sc_mailbox* mailbox,
58  struct sc_node* node,
59  const char* name_opt);
60 
69 extern struct sc_node* sc_mailbox_get_send_node(struct sc_mailbox* mailbox);
70 
71 #if SC_API_VER >= 1
72 
82 extern int sc_mailbox_poll(struct sc_mailbox* mailbox,
83  struct sc_packet_list* list);
84 #endif
85 
86 #if SC_API_VER >= 1
87 
99 extern void sc_mailbox_send(struct sc_mailbox* mailbox,
100  struct sc_packet* packet);
101 #endif
102 
103 #if SC_API_VER >= 1
104 
116 extern void sc_mailbox_send_list(struct sc_mailbox* mailbox,
117  struct sc_packet_list* list);
118 #endif
119 
120 
121 #endif /* __SOLAR_CAPTURE_MAILBOX_H__ */
122 
Attribute object.
int sc_mailbox_alloc(struct sc_mailbox **mb_out, const struct sc_attr *attr, struct sc_thread *thread)
Allocate a mailbox.
void sc_mailbox_send(struct sc_mailbox *mailbox, struct sc_packet *packet)
Send a packet through a mailbox to another thread.
int sc_mailbox_set_recv(struct sc_mailbox *mailbox, struct sc_node *node, const char *name_opt)
Connect a mailbox to a node.
struct sc_node * sc_mailbox_get_send_node(struct sc_mailbox *mailbox)
Return a mailbox's "send node".
int sc_mailbox_poll(struct sc_mailbox *mailbox, struct sc_packet_list *list)
Poll a mailbox.
Representation of a packet.
Definition: ext_packet.h:56
void sc_mailbox_send_list(struct sc_mailbox *mailbox, struct sc_packet_list *list)
Send a list of packets through a mailbox to another thread.
A list of packets or packet buffers.
Definition: ext_packet_list.h:14
int sc_mailbox_connect(struct sc_mailbox *mb1, struct sc_mailbox *mb2)
Connect a pair of mailboxes.
Description of a node.
Definition: ext_node.h:17