~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/lib/font/include/fntfilst.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Xorg: fntfilst.h,v 1.5 2001/02/09 02:04:04 xorgcvs Exp $ */
 
2
 
 
3
/*
 
4
 
 
5
Copyright 1991, 1998  The Open Group
 
6
 
 
7
Permission to use, copy, modify, distribute, and sell this software and its
 
8
documentation for any purpose is hereby granted without fee, provided that
 
9
the above copyright notice appear in all copies and that both that
 
10
copyright notice and this permission notice appear in supporting
 
11
documentation.
 
12
 
 
13
The above copyright notice and this permission notice shall be included in
 
14
all copies or substantial portions of the Software.
 
15
 
 
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
19
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
22
 
 
23
Except as contained in this notice, the name of The Open Group shall not be
 
24
used in advertising or otherwise to promote the sale, use or other dealings
 
25
in this Software without prior written authorization from The Open Group.
 
26
 
 
27
*/
 
28
/* $XFree86: xc/lib/font/include/fntfilst.h,v 3.9 2002/12/10 22:23:52 tsi Exp $ */
 
29
 
 
30
/*
 
31
 * Author:  Keith Packard, MIT X Consortium
 
32
 */
 
33
 
 
34
#ifndef _FONTFILEST_H_
 
35
#define _FONTFILEST_H_
 
36
 
 
37
#ifndef FONTMODULE
 
38
#include <X11/Xos.h>
 
39
#endif
 
40
#ifndef XP_PSTEXT
 
41
#include "fontmisc.h"
 
42
#endif
 
43
#include "fontstruct.h"
 
44
#include "fontxlfd.h"
 
45
#include "fntfil.h"
 
46
 
 
47
typedef struct _FontName {
 
48
    char        *name;
 
49
    short       length;
 
50
    short       ndashes;
 
51
} FontNameRec;
 
52
 
 
53
typedef struct _FontScaled {
 
54
    FontScalableRec     vals;
 
55
    FontEntryPtr        bitmap;
 
56
    FontPtr             pFont;
 
57
} FontScaledRec;
 
58
 
 
59
typedef struct _FontScalableExtra {
 
60
    FontScalableRec     defaults;
 
61
    int                 numScaled;
 
62
    int                 sizeScaled;
 
63
    FontScaledPtr       scaled;
 
64
    pointer             private;
 
65
} FontScalableExtraRec;
 
66
 
 
67
typedef struct _FontScalableEntry {
 
68
    FontRendererPtr         renderer;
 
69
    char                    *fileName;
 
70
    FontScalableExtraPtr   extra;
 
71
} FontScalableEntryRec;
 
72
 
 
73
/*
 
74
 * This "can't" work yet - the returned alias string must be permanent,
 
75
 * but this layer would need to generate the appropriate name from the
 
76
 * resolved scalable + the XLFD values passed in.  XXX
 
77
 */
 
78
 
 
79
typedef struct _FontScaleAliasEntry {
 
80
    char                *resolved;
 
81
} FontScaleAliasEntryRec;
 
82
 
 
83
typedef struct _FontBitmapEntry {
 
84
    FontRendererPtr     renderer;
 
85
    char                *fileName;
 
86
    FontPtr             pFont;
 
87
} FontBitmapEntryRec;
 
88
 
 
89
typedef struct _FontAliasEntry {
 
90
    char        *resolved;
 
91
} FontAliasEntryRec;
 
92
 
 
93
typedef struct _FontBCEntry {
 
94
    FontScalableRec         vals;
 
95
    FontEntryPtr            entry;
 
96
} FontBCEntryRec;
 
97
 
 
98
typedef struct _FontEntry {
 
99
    FontNameRec name;
 
100
    int         type;
 
101
    union _FontEntryParts {
 
102
        FontScalableEntryRec    scalable;
 
103
        FontBitmapEntryRec      bitmap;
 
104
        FontAliasEntryRec       alias;
 
105
        FontBCEntryRec          bc;
 
106
    } u;
 
107
} FontEntryRec;
 
108
 
 
109
typedef struct _FontTable {
 
110
    int             used;
 
111
    int             size;
 
112
    FontEntryPtr    entries;
 
113
    Bool            sorted;
 
114
} FontTableRec;
 
115
 
 
116
typedef struct _FontDirectory {
 
117
    char            *directory;
 
118
    unsigned long   dir_mtime;
 
119
    unsigned long   alias_mtime;
 
120
    FontTableRec    scalable;
 
121
    FontTableRec    nonScalable;
 
122
    char            *attributes;
 
123
} FontDirectoryRec;
 
124
 
 
125
/* Capability bits: for definition of capabilities bitmap in the
 
126
   FontRendererRec to indicate support of XLFD enhancements */
 
127
 
 
128
#define CAP_MATRIX              0x1
 
129
#define CAP_CHARSUBSETTING      0x2
 
130
 
 
131
typedef struct _FontRenderer {
 
132
    char    *fileSuffix;
 
133
    int     fileSuffixLen;
 
134
    int     (*OpenBitmap)(FontPathElementPtr /* fpe */, 
 
135
                          FontPtr * /* pFont */,
 
136
                          int /* flags */, 
 
137
                          FontEntryPtr /* entry */, 
 
138
                          char * /* fileName */, 
 
139
                          fsBitmapFormat /* format */, 
 
140
                          fsBitmapFormatMask /* mask */,
 
141
                          FontPtr /* non_cachable_font */);
 
142
    int     (*OpenScalable)(FontPathElementPtr /* fpe */, 
 
143
                            FontPtr * /* pFont */, 
 
144
                            int /* flags */, 
 
145
                            FontEntryPtr /* entry */, 
 
146
                            char * /* fileName */, 
 
147
                            FontScalablePtr /* vals */, 
 
148
                            fsBitmapFormat /* format */, 
 
149
                            fsBitmapFormatMask /* fmask */,
 
150
                            FontPtr /* non_cachable_font */);
 
151
    int     (*GetInfoBitmap)(FontPathElementPtr /* fpe */, 
 
152
                             FontInfoPtr /* pFontInfo */, 
 
153
                             FontEntryPtr /* entry */, 
 
154
                             char * /*fileName */);
 
155
    int     (*GetInfoScalable)(FontPathElementPtr /* fpe */, 
 
156
                               FontInfoPtr /* pFontInfo */, 
 
157
                               FontEntryPtr /* entry */, 
 
158
                               FontNamePtr /* fontName */,
 
159
                               char * /* fileName */, 
 
160
                               FontScalablePtr /* vals */);
 
161
    int     number;
 
162
    int     capabilities;       /* Bitmap components defined above */
 
163
} FontRendererRec;
 
164
 
 
165
typedef struct _FontRenders {
 
166
    int             number;
 
167
    struct _FontRenderersElement {
 
168
        /* In order to preserve backward compatibility, the
 
169
           priority field is made invisible to renderers */
 
170
        FontRendererPtr renderer;
 
171
        int priority;
 
172
    } *renderers;
 
173
} FontRenderersRec, *FontRenderersPtr;
 
174
 
 
175
typedef struct _BitmapInstance {
 
176
    FontScalableRec     vals;
 
177
    FontBitmapEntryPtr  bitmap;
 
178
} BitmapInstanceRec, *BitmapInstancePtr;
 
179
 
 
180
typedef struct _BitmapScalablePrivate {
 
181
    int                 numInstances;
 
182
    BitmapInstancePtr   instances;
 
183
} BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
 
184
 
 
185
typedef struct _BitmapSources {
 
186
    FontPathElementPtr  *fpe;
 
187
    int                 size;
 
188
    int                 count;
 
189
} BitmapSourcesRec, *BitmapSourcesPtr;
 
190
 
 
191
extern BitmapSourcesRec FontFileBitmapSources;
 
192
 
 
193
/* Defines for FontFileFindNamesInScalableDir() behavior */
 
194
#define NORMAL_ALIAS_BEHAVIOR           0
 
195
#define LIST_ALIASES_AND_TARGET_NAMES   (1<<0)
 
196
#define IGNORE_SCALABLE_ALIASES         (1<<1)
 
197
 
 
198
#endif /* _FONTFILEST_H_ */