Tizen 2.0 Release
[external/libgnutls26.git] / src / cfg / platon / str / dynfgets.h
1 /**
2  * Unlimited dynamic fgets() routine
3  *
4  * @file        platon/str/dynfgets.h
5  * @author      Yuuki Ninomiya <gm@debian.or.jp>
6  * @author      Ondrej Jombik <nepto@platon.sk>
7  * @version     \$Platon: libcfg+/src/platon/str/dynfgets.h,v 1.12 2004/01/12 06:03:09 nepto Exp $
8  * @date        2001-2004
9  */
10
11 #ifndef _PLATON_STR_DYNFGETS_H
12 #define _PLATON_STR_DYNFGETS_H
13
14 #include <stdio.h>
15
16 #ifndef PLATON_FUNC
17 # define PLATON_FUNC(_name) _name
18 #endif
19 #ifndef PLATON_FUNC_STR
20 # define PLATON_FUNC_STR(_name) #_name
21 #endif
22
23 /** Size of input buffer. In others words, size of realloc() step. */
24 #define DYNAMIC_FGETS_BUFSIZE   (128)
25
26 /** Macro alias */
27 #define dynfgets(f)             dynamic_fgets(f)
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33         /**
34          * Dynamic fgets() with unlimited line length
35          *
36          * @param       fp      stream (FILE * pointer)
37          * @return      dynamically allocated buffer or NULL on not enough memory error
38          */
39         char *PLATON_FUNC(dynamic_fgets)(FILE *fp);
40
41 #ifdef __cplusplus
42 }
43 #endif
44
45 #endif /* #ifndef _PLATON_STR_DYNFGETS_H */
46