stdio.h revision 2777329775a039bea0ec3142a3e3158d9441fc75
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User * Copyright (C) 2004-2007, 2013 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 */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/* $Id: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#ifndef ISC_STDIO_H
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#define ISC_STDIO_H 1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User/*! \file isc/stdio.h */
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*%
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 */
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#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
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*% Open */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_open(const char *filename, const char *mode, FILE **fp);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*% Close */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_close(FILE *f);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/*% Seek */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_seek(FILE *f, off_t offset, int whence);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*% Tell */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_tell(FILE *f, off_t *offsetp);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*% Read */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_result_t
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt size_t *nret);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*% Write */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt size_t *nret);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*% Flush */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_flush(FILE *f);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntisc_stdio_sync(FILE *f);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt/*%<
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * Invoke fsync() on the file descriptor underlying an stdio stream, or an
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * equivalent system-dependent operation. Note that this function has no
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * direct counterpart in the stdio library.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsISC_LANG_ENDDECLS
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#endif /* ISC_STDIO_H */
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt