Commit | Line | Data |
---|---|---|
bf0d695d PMF |
1 | /* $OpenBSD: fileext.h,v 1.2 2005/06/17 20:40:32 espie Exp $ */ |
2 | /* $NetBSD: fileext.h,v 1.5 2003/07/18 21:46:41 nathanw Exp $ */ | |
3 | ||
c0c0989a MJ |
4 | /* |
5 | * SPDX-License-Identifier: BSD-2-Clause | |
bf0d695d | 6 | * |
c0c0989a MJ |
7 | * Copyright (C)2001 Citrus Project, |
8 | * All rights reserved. | |
bf0d695d PMF |
9 | * |
10 | * $Citrus$ | |
11 | */ | |
12 | ||
13 | /* | |
14 | * file extension | |
15 | */ | |
002e1fde MD |
16 | struct __lttng_ust_sfileext { |
17 | struct __lttng_ust_sbuf _ub; /* ungetc buffer */ | |
bf0d695d PMF |
18 | struct wchar_io_data _wcio; /* wide char io status */ |
19 | }; | |
20 | ||
002e1fde | 21 | #define _EXT(fp) ((struct __lttng_ust_sfileext *)((fp)->_ext._base)) |
bf0d695d PMF |
22 | #define _UB(fp) _EXT(fp)->_ub |
23 | ||
24 | #define _FILEEXT_INIT(fp) \ | |
25 | do { \ | |
26 | _UB(fp)._base = NULL; \ | |
27 | _UB(fp)._size = 0; \ | |
28 | WCIO_INIT(fp); \ | |
29 | } while (0) | |
30 | ||
31 | #define _FILEEXT_SETUP(f, fext) \ | |
32 | do { \ | |
33 | (f)->_ext._base = (unsigned char *)(fext); \ | |
34 | _FILEEXT_INIT(f); \ | |
35 | } while (0) |