blob: ca01a14ba4616e12026225bda2139ae1c6cf91c7 [file]
/****************************************************************************
* include/stdio_ext.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __INCLUDE_STDIO_EXT_H
#define __INCLUDE_STDIO_EXT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Values for __fsetlocking() */
#define FSETLOCKING_QUERY 0 /* Only return the current mode */
#define FSETLOCKING_INTERNAL 1 /* The library locks the stream */
#define FSETLOCKING_BYCALLER 2 /* The caller locks the stream */
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/* These functions give access to the state of a stream. glibc and musl
* provide them, and portable code (gnulib, for example) uses them instead
* of looking inside FILE.
*/
#ifdef __cplusplus
extern "C"
{
#endif
size_t __fbufsize(FAR FILE *stream);
size_t __fpending(FAR FILE *stream);
int __freading(FAR FILE *stream);
int __fwriting(FAR FILE *stream);
int __freadable(FAR FILE *stream);
int __fwritable(FAR FILE *stream);
int __flbf(FAR FILE *stream);
void __fpurge(FAR FILE *stream);
size_t __freadahead(FAR FILE *stream);
FAR const char *__freadptr(FAR FILE *stream, FAR size_t *sizep);
void __freadptrinc(FAR FILE *stream, size_t inc);
void __fseterr(FAR FILE *stream);
int __fsetlocking(FAR FILE *stream, int type);
void _flushlbf(void);
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_STDIO_EXT_H */