Move compat macros in 'lttng/align.h' to a private header
[lttng-ust.git] / snprintf / local.h
... / ...
CommitLineData
1/* $OpenBSD: local.h,v 1.14 2009/10/22 01:23:16 guenther Exp $ */
2
3/*
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Copyright (C) 1990, 1993
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.
11 */
12
13/*
14 * Information local to this implementation of stdio,
15 * in particular, macros and private variables.
16 */
17
18#include <stdio.h>
19#include <wchar.h>
20#include "ust-helper.h"
21#include "various.h"
22#include "wcio.h"
23#include "fileext.h"
24
25LTTNG_HIDDEN
26int __sflush(LTTNG_UST_LFILE *);
27LTTNG_HIDDEN
28LTTNG_UST_LFILE *__sfp(void);
29LTTNG_HIDDEN
30int __srefill(LTTNG_UST_LFILE *);
31LTTNG_HIDDEN
32int __sread(void *, char *, int);
33LTTNG_HIDDEN
34int __swrite(void *, const char *, int);
35LTTNG_HIDDEN
36fpos_t __sseek(void *, fpos_t, int);
37LTTNG_HIDDEN
38int __sclose(void *);
39LTTNG_HIDDEN
40void __sinit(void);
41LTTNG_HIDDEN
42void _cleanup(void);
43LTTNG_HIDDEN
44void __smakebuf(LTTNG_UST_LFILE *);
45LTTNG_HIDDEN
46int __swhatbuf(LTTNG_UST_LFILE *, size_t *, int *);
47LTTNG_HIDDEN
48int _fwalk(int (*)(LTTNG_UST_LFILE *));
49LTTNG_HIDDEN
50int __swsetup(LTTNG_UST_LFILE *);
51LTTNG_HIDDEN
52int __sflags(const char *, int *);
53LTTNG_HIDDEN
54wint_t __fgetwc_unlock(LTTNG_UST_LFILE *);
55
56LTTNG_HIDDEN
57extern void __atexit_register_cleanup(void (*)(void));
58LTTNG_HIDDEN
59extern int __sdidinit;
60
61/*
62 * Return true if the given LTTNG_UST_LFILE cannot be written now.
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.027727 seconds and 4 git commands to generate.