Main Page | Class List | File List | Class Members | File Members | Related Pages

fdbuf.h

Go to the documentation of this file.
00001 /* 00002 * $Id: fdbuf.h,v 1.7.2.4 2003/12/26 22:23:07 jasta Exp $ 00003 * 00004 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net) 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2, or (at your option) any 00009 * later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 */ 00016 00017 #ifndef __FDBUF_H 00018 #define __FDBUF_H 00019 00020 /*****************************************************************************/ 00021 00032 /*****************************************************************************/ 00033 00034 #define FDBUF_ERR (-1) 00035 #define FDBUF_AGAIN (-2) 00036 #define FDBUF_EOF (-3) 00037 #define FDBUF_NVAL (-4) 00050 typedef int (*FDBufRead) (int fd, void *buf, size_t len, void *udata); 00051 00055 typedef struct 00056 { 00060 int flag; 00061 void *udata; 00062 00066 int fd; 00071 FDBufRead readfn; 00072 FDBufRead peekfn; 00073 GiBuffer buf; 00074 } FDBuf; 00075 00076 /*****************************************************************************/ 00077 00078 EXTERN_C_BEGIN 00079 00080 /*****************************************************************************/ 00081 00099 LIBGIFT_EXPORT 00100 FDBuf *fdbuf_new (int fd, FDBufRead readfn, FDBufRead peekfn, void *udata); 00101 00105 LIBGIFT_EXPORT 00106 void fdbuf_free (FDBuf *buf); 00107 00108 /*****************************************************************************/ 00109 00126 LIBGIFT_EXPORT 00127 int fdbuf_fill (FDBuf *buf, int bufsize); 00128 00142 LIBGIFT_EXPORT 00143 int fdbuf_delim_string (FDBuf *buf, const char *delim); 00144 00145 #define fdbuf_delim fdbuf_delim_string 00146 00150 LIBGIFT_EXPORT 00151 int fdbuf_delim_set (FDBuf *buf, const char *delim_set); 00152 00156 LIBGIFT_EXPORT 00157 int fdbuf_delim_char (FDBuf *buf, char delim); 00158 00159 /*****************************************************************************/ 00160 00168 LIBGIFT_EXPORT 00169 unsigned char *fdbuf_data (FDBuf *buf, size_t *len); 00170 00175 LIBGIFT_EXPORT 00176 void fdbuf_release (FDBuf *buf); 00177 00178 /*****************************************************************************/ 00179 00180 EXTERN_C_END 00181 00182 /*****************************************************************************/ 00183 00184 #endif /* __FDBUF_H */

Generated on Sun Aug 22 07:56:39 2004 by doxygen 1.3.7