Browse Source

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.
OPENBSD_3_8
espie 19 years ago
parent
commit
d5049a05a4
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/include/stdio.h

+ 4
- 3
src/include/stdio.h View File

@ -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 */


Loading…
Cancel
Save