From d5049a05a4cff517cbcb9d7ae5d2f70f04ce62d3 Mon Sep 17 00:00:00 2001 From: espie <> Date: Sat, 30 Apr 2005 09:25:17 +0000 Subject: [PATCH] Change internals of FILE: reuse the unget buffer field to access an extended attribute data structure (pimpl idiom). Idea taken from citrus. Much discussion with deraadt@, otto@, millert@... This is the least disruptive way to extend FILE, since its size can't really change without this being a flag day. So the size doesn't change. Actual additions to the structure will come in separate steps, since this change is nasty enough on its own. Tests by otto@ and others, careful reading of code by otto@ and millert@. This is definitely a major bump, and has been checked to not impact a full ports build. --- src/include/stdio.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/include/stdio.h b/src/include/stdio.h index e2db2ebb..197d972d 100644 --- a/src/include/stdio.h +++ b/src/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.30 2004/06/07 21:11:23 marc Exp $ */ +/* $OpenBSD: stdio.h,v 1.31 2005/04/30 09:25:17 espie Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -119,8 +119,9 @@ typedef struct __sFILE { fpos_t (*_seek)(void *, fpos_t, int); int (*_write)(void *, const char *, int); - /* separate buffer for long sequences of ungetc() */ - struct __sbuf _ub; /* ungetc buffer */ + /* extension data, to avoid further ABI breakage */ + struct __sbuf _ext; + /* data for long sequences of ungetc() */ unsigned char *_up; /* saved _p when _p is doing ungetc data */ int _ur; /* saved _r when _r is counting ungetc data */