aura  0.1
 All Data Structures Functions Variables Modules Pages
dummy-buffer-arg.c
1 #include <aura/aura.h>
2 
3 int main() {
4  slog_init(NULL, 18);
5 
6  int ret;
7  struct aura_node *n = aura_open("dummy", NULL);
8  struct aura_buffer *retbuf;
9  struct aura_buffer *iobuf = aura_buffer_request(n, 80);
10  aura_wait_status(n, AURA_STATUS_ONLINE);
11 
12  ret = aura_call(n, "echo_buf", &retbuf, iobuf);
13  slog(0, SLOG_DEBUG, "call ret %d", ret);
14  if (ret)
15  BUG(n, "call failed");
16  struct aura_buffer *tmp = aura_buffer_get_buf(retbuf);
17  if (tmp != iobuf)
18  BUG(n, "test not ok");
19 
20  aura_buffer_release(retbuf);
22  aura_close(n);
23 
24  return 0;
25 }
26 
27 
struct aura_buffer * aura_buffer_request(struct aura_node *nd, int size)
Definition: buffer.c:40
void aura_wait_status(struct aura_node *node, int status)
Definition: aura.c:607
int aura_call(struct aura_node *node, const char *name, struct aura_buffer **retbuf,...)
Definition: aura.c:666
struct aura_node * aura_open(const char *name, const char *opts)
Definition: aura.c:34
void aura_buffer_release(struct aura_buffer *buf)
Definition: buffer.c:80
void aura_close(struct aura_node *node)
Definition: aura.c:102
struct aura_buffer * aura_buffer_get_buf(struct aura_buffer *buf)
Retrieve aura_buffer pointer from within the buffer and advance internal pointer by it's size...
Definition: retparse.c:83