2000-01-13 07:09:20 +00:00
|
|
|
/* file_wrappers.h
|
1999-09-22 01:28:04 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-09-22 01:28:04 +00:00
|
|
|
*
|
|
|
|
* Wiretap Library
|
2001-11-13 23:55:44 +00:00
|
|
|
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
|
2002-08-28 20:30:45 +00:00
|
|
|
*
|
1999-09-22 01:28:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 20:30:45 +00:00
|
|
|
*
|
1999-09-22 01:28:04 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 20:30:45 +00:00
|
|
|
*
|
1999-09-22 01:28:04 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FILE_H__
|
|
|
|
#define __FILE_H__
|
|
|
|
|
2011-04-08 00:28:37 +00:00
|
|
|
extern gint64 file_seek(FILE_T stream, gint64 offset, int whence, int *err);
|
|
|
|
extern gint64 file_tell(FILE_T stream);
|
2011-05-09 05:30:59 +00:00
|
|
|
extern gint64 file_tell_raw(FILE_T stream);
|
2011-05-09 08:12:26 +00:00
|
|
|
extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err);
|
2011-04-21 09:41:52 +00:00
|
|
|
extern int file_error(FILE_T fh, gchar **err_info);
|
2002-03-04 00:25:35 +00:00
|
|
|
|
2011-04-06 07:09:56 +00:00
|
|
|
extern FILE_T file_open(const char *path);
|
2011-04-08 00:28:37 +00:00
|
|
|
extern FILE_T filed_open(int fildes);
|
|
|
|
extern int file_read(void *buf, unsigned int count, FILE_T file);
|
|
|
|
extern int file_close(FILE_T file);
|
|
|
|
extern int file_getc(FILE_T stream);
|
|
|
|
extern char *file_gets(char *buf, int len, FILE_T stream);
|
|
|
|
extern int file_eof(FILE_T stream);
|
|
|
|
extern void file_clearerr(FILE_T stream);
|
2002-03-04 00:25:35 +00:00
|
|
|
|
2011-04-12 02:40:14 +00:00
|
|
|
extern void file_set_random_access(FILE_T stream, gboolean random, GPtrArray *seek);
|
|
|
|
|
2011-04-11 21:33:22 +00:00
|
|
|
#ifdef HAVE_LIBZ
|
|
|
|
typedef struct wtap_writer *GZWFILE_T;
|
|
|
|
|
|
|
|
extern GZWFILE_T gzwfile_open(const char *path);
|
|
|
|
extern GZWFILE_T gzwfile_fdopen(int fd);
|
|
|
|
extern unsigned gzwfile_write(GZWFILE_T state, const void *buf, unsigned len);
|
|
|
|
extern int gzwfile_flush(GZWFILE_T state);
|
|
|
|
extern int gzwfile_close(GZWFILE_T state);
|
|
|
|
extern int gzwfile_geterr(GZWFILE_T state);
|
|
|
|
#endif /* HAVE_LIBZ */
|
1999-09-22 01:28:04 +00:00
|
|
|
|
|
|
|
#endif /* __FILE_H__ */
|