stdio.h revision 31707708c585c53b61ca1edb2e224e6bb1b985a5
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*
bec154197d3d640b0d5b416cd5218ea58dca5d3aTinderbox User * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Copyright (C) 2000, 2001 Internet Software Consortium.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater * Permission to use, copy, modify, and/or distribute this software for any
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * purpose with or without fee is hereby granted, provided that the above
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * copyright notice and this permission notice appear in all copies.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews */
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/* $Id: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#ifndef ISC_STDIO_H
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#define ISC_STDIO_H 1
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*! \file isc/stdio.h */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater/*%
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * These functions are wrappers around the corresponding stdio functions.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * They return a detailed error code in the form of an an isc_result_t. ANSI C
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * does not guarantee that stdio functions set errno, hence these functions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * must use platform dependent methods (e.g., the POSIX errno) to construct the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * error code.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater#include <stdio.h>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#include <isc/lang.h>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#include <isc/result.h>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsISC_LANG_BEGINDECLS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*% Open */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_open(const char *filename, const char *mode, FILE **fp);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*% Close */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_close(FILE *f);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*% Seek */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_seek(FILE *f, off_t offset, int whence);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
4f9cb7bd58e2c0a7407fee3758ea265aee329ac6Tinderbox User/*% Tell */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_tell(FILE *f, off_t *offsetp);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*% Read */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews size_t *nret);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*% Write */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userisc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User size_t *nret);
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews/*% Flush */
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userisc_result_t
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userisc_stdio_flush(FILE *f);
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_sync(FILE *f);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*%<
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Invoke fsync() on the file descriptor underlying an stdio stream, or an
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * equivalent system-dependent operation. Note that this function has no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * direct counterpart in the stdio library.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsISC_LANG_ENDDECLS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#endif /* ISC_STDIO_H */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews