]> rtime.felk.cvut.cz Git - can-usb1.git/blob - ulan/host/ul_drv/ul_lib/ul_msg_buf.h
Initializing repo
[can-usb1.git] / ulan / host / ul_drv / ul_lib / ul_msg_buf.h
1 /*******************************************************************
2   uLan Communication - C interface library
3
4   ul_netbase.c  - basic network and module constructions
5
6   (C) Copyright 2001 by Pavel Pisa - Originator
7
8   (C) Copyright 2002-2004 by Pavel Pisa - Originator
9
10   The uLan C interface library can be used, copied and modified
11   under next licenses
12     - GPL - GNU General Public License
13     - LGPL - GNU Lesser General Public License
14     - MPL - Mozilla Public License
15     - and other licenses added by project originators
16   Code can be modified and re-distributed under any combination
17   of the above listed licenses. If contributor does not agree with
18   some of the licenses, he/she can delete appropriate line.
19   Warning, if you delete all lines, you are not allowed to
20   distribute source code and/or binaries utilizing code.
21   
22   See files COPYING and README for details.
23
24  *******************************************************************/
25
26 #ifndef _UL_MSG_BUF_H
27 #define _UL_MSG_BUF_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #include <ul_lib/ulan.h>
34 #include <ul_dbuff.h>
35
36
37 typedef struct ul_msg_buf{      /* buffer to hold full message taken from driver */
38   ul_msginfo msginfo;           /* dadr, sadr, cmd, flg, len, stamp */
39   ul_dbuff_t  data;             /* message data */
40   struct ul_msg_buf *tail;      /* optional tail message */
41 } ul_msg_buf_t;
42
43
44 int ul_msg_buf_init(ul_msg_buf_t *buf);
45 void ul_msg_buf_destroy(ul_msg_buf_t *buf);
46 int ul_msg_buf_rd_data(ul_msg_buf_t *buf, ul_fd_t ul_fd);
47 int ul_msg_buf_rd_rest(ul_msg_buf_t *buf, ul_fd_t ul_fd);
48 int ul_msg_buf_wr(ul_msg_buf_t *buf, ul_fd_t ul_fd);
49
50 #ifdef __cplusplus
51 } /* extern "C"*/
52 #endif
53
54 #endif /* _UL_MSG_BUF_H */