~ubuntu-branches/ubuntu/trusty/gnutls26/trusty-security

« back to all changes in this revision

Viewing changes to gl/stdio-impl.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2010-04-22 19:29:52 UTC
  • mto: (12.4.3 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20100422192952-gbj6cvaan8e4ejck
Tags: upstream-2.9.10
ImportĀ upstreamĀ versionĀ 2.9.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Implementation details of FILE streams.
2
 
   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
2
   Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
21
21
 
22
22
/* BSD stdio derived implementations.  */
23
23
 
 
24
#if defined __NetBSD__                         /* NetBSD */
 
25
/* Get __NetBSD_Version__.  */
 
26
# include <sys/param.h>
 
27
#endif
 
28
 
24
29
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
25
30
 
26
31
# if defined __DragonFly__          /* DragonFly */
27
32
  /* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.  */
28
33
#  define fp_ ((struct { struct __FILE_public pub; \
29
 
                         struct { unsigned char *_base; int _size; } _bf; \
30
 
                         void *cookie; \
31
 
                         void *_close; \
32
 
                         void *_read; \
33
 
                         void *_seek; \
34
 
                         void *_write; \
35
 
                         struct { unsigned char *_base; int _size; } _ub; \
36
 
                         int _ur; \
37
 
                         unsigned char _ubuf[3]; \
38
 
                         unsigned char _nbuf[1]; \
39
 
                         struct { unsigned char *_base; int _size; } _lb; \
40
 
                         int _blksize; \
41
 
                         fpos_t _offset; \
42
 
                         /* More fields, not relevant here.  */ \
43
 
                       } *) fp)
 
34
                         struct { unsigned char *_base; int _size; } _bf; \
 
35
                         void *cookie; \
 
36
                         void *_close; \
 
37
                         void *_read; \
 
38
                         void *_seek; \
 
39
                         void *_write; \
 
40
                         struct { unsigned char *_base; int _size; } _ub; \
 
41
                         int _ur; \
 
42
                         unsigned char _ubuf[3]; \
 
43
                         unsigned char _nbuf[1]; \
 
44
                         struct { unsigned char *_base; int _size; } _lb; \
 
45
                         int _blksize; \
 
46
                         fpos_t _offset; \
 
47
                         /* More fields, not relevant here.  */ \
 
48
                       } *) fp)
44
49
  /* See <http://www.dragonflybsd.org/cvsweb/src/include/stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.  */
45
50
#  define _p pub._p
46
51
#  define _flags pub._flags
50
55
#  define fp_ fp
51
56
# endif
52
57
 
53
 
# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
 
58
# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */
54
59
  /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
55
60
     and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
56
61
  struct __sfileext
59
64
      /* More fields, not relevant here.  */
60
65
    };
61
66
#  define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
62
 
# else                                         /* FreeBSD, DragonFly, MacOS X, Cygwin */
 
67
# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, MacOS X, Cygwin */
63
68
#  define fp_ub fp_->_ub
64
69
# endif
65
70
 
74
79
 
75
80
# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
76
81
#  define fp_ ((struct { unsigned char *_ptr; \
77
 
                         unsigned char *_base; \
78
 
                         unsigned char *_end; \
79
 
                         long _cnt; \
80
 
                         int _file; \
81
 
                         unsigned int _flag; \
82
 
                       } *) fp)
 
82
                         unsigned char *_base; \
 
83
                         unsigned char *_end; \
 
84
                         long _cnt; \
 
85
                         int _file; \
 
86
                         unsigned int _flag; \
 
87
                       } *) fp)
83
88
# else
84
89
#  define fp_ fp
85
90
# endif