Hide private snprintf symbols
[lttng-ust.git] / snprintf / local.h
CommitLineData
bf0d695d
PMF
1/* $OpenBSD: local.h,v 1.14 2009/10/22 01:23:16 guenther Exp $ */
2
c0c0989a
MJ
3/*
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Copyright (C) 1990, 1993
bf0d695d
PMF
7 * The Regents of the University of California. All rights reserved.
8 *
9 * This code is derived from software contributed to Berkeley by
10 * Chris Torek.
bf0d695d
PMF
11 */
12
13/*
14 * Information local to this implementation of stdio,
15 * in particular, macros and private variables.
16 */
17
2786d9d5
FD
18#include <stdio.h>
19#include <wchar.h>
e88c7263 20#include "ust-helper.h"
bf0d695d
PMF
21#include "various.h"
22#include "wcio.h"
23#include "fileext.h"
24
e88c7263 25LTTNG_HIDDEN
002e1fde 26int __sflush(LTTNG_UST_LFILE *);
e88c7263 27LTTNG_HIDDEN
002e1fde 28LTTNG_UST_LFILE *__sfp(void);
e88c7263 29LTTNG_HIDDEN
002e1fde 30int __srefill(LTTNG_UST_LFILE *);
e88c7263 31LTTNG_HIDDEN
bf0d695d 32int __sread(void *, char *, int);
e88c7263 33LTTNG_HIDDEN
bf0d695d 34int __swrite(void *, const char *, int);
e88c7263 35LTTNG_HIDDEN
bf0d695d 36fpos_t __sseek(void *, fpos_t, int);
e88c7263 37LTTNG_HIDDEN
bf0d695d 38int __sclose(void *);
e88c7263 39LTTNG_HIDDEN
bf0d695d 40void __sinit(void);
e88c7263 41LTTNG_HIDDEN
bf0d695d 42void _cleanup(void);
e88c7263 43LTTNG_HIDDEN
002e1fde 44void __smakebuf(LTTNG_UST_LFILE *);
e88c7263 45LTTNG_HIDDEN
002e1fde 46int __swhatbuf(LTTNG_UST_LFILE *, size_t *, int *);
e88c7263 47LTTNG_HIDDEN
002e1fde 48int _fwalk(int (*)(LTTNG_UST_LFILE *));
e88c7263 49LTTNG_HIDDEN
002e1fde 50int __swsetup(LTTNG_UST_LFILE *);
e88c7263 51LTTNG_HIDDEN
bf0d695d 52int __sflags(const char *, int *);
e88c7263 53LTTNG_HIDDEN
002e1fde 54wint_t __fgetwc_unlock(LTTNG_UST_LFILE *);
bf0d695d 55
e88c7263 56LTTNG_HIDDEN
bf0d695d 57extern void __atexit_register_cleanup(void (*)(void));
e88c7263 58LTTNG_HIDDEN
bf0d695d
PMF
59extern int __sdidinit;
60
61/*
002e1fde 62 * Return true if the given LTTNG_UST_LFILE cannot be written now.
bf0d695d
PMF
63 */
64#define cantwrite(fp) \
65 ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \
66 __swsetup(fp))
67
68/*
69 * Test whether the given stdio file has an active ungetc buffer;
70 * release such a buffer, without restoring ordinary unread data.
71 */
72#define HASUB(fp) (_UB(fp)._base != NULL)
73#define FREEUB(fp) { \
74 if (_UB(fp)._base != (fp)->_ubuf) \
75 free(_UB(fp)._base); \
76 _UB(fp)._base = NULL; \
77}
78
79/*
80 * test for an fgetln() buffer.
81 */
82#define HASLB(fp) ((fp)->_lb._base != NULL)
83#define FREELB(fp) { \
84 free((char *)(fp)->_lb._base); \
85 (fp)->_lb._base = NULL; \
86}
This page took 0.038758 seconds and 4 git commands to generate.