1 /*
2  * readbuf.c
3  *
4  * This file is part of msmtp, an SMTP client, and of mpop, a POP3 client.
5  *
6  * Copyright (C) 2008
7  * Martin Lambers <marlam@marlam.de>
8  *
9  *   This program is free software; you can redistribute it and/or modify
10  *   it under the terms of the GNU General Public License as published by
11  *   the Free Software Foundation; either version 3 of the License, or
12  *   (at your option) any later version.
13  *
14  *   This program is distributed in the hope that it will be useful,
15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *   GNU General Public License for more details.
18  *
19  *   You should have received a copy of the GNU General Public License
20  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 
24 #ifdef HAVE_CONFIG_H
25 # include "config.h"
26 #endif
27 
28 #include "readbuf.h"
29 
30 
31 /*
32  * readbuf_init()
33  *
34  * see readbuf.h
35  */
36 
readbuf_init(readbuf_t * readbuf)37 void readbuf_init(readbuf_t *readbuf)
38 {
39     readbuf->count = 0;
40     readbuf->ptr = readbuf->buf;
41 }
42 
43 
44 /*
45  * readbuf_is_empty()
46  *
47  * see readbuf.h
48  */
49 
readbuf_is_empty(const readbuf_t * readbuf)50 int readbuf_is_empty(const readbuf_t *readbuf)
51 {
52     return (readbuf->count == 0);
53 }
54