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

« back to all changes in this revision

Viewing changes to unix/xc/extras/FreeType/lib/ttextend.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
/*******************************************************************
 
2
 *
 
3
 *  ttextend.h                                                   2.0
 
4
 *
 
5
 *    Extensions Interface.
 
6
 *
 
7
 *  Copyright 1996-1999 by
 
8
 *  David Turner, Robert Wilhelm, and Werner Lemberg.
 
9
 *
 
10
 *  This file is part of the FreeType project, and may only be used
 
11
 *  modified and distributed under the terms of the FreeType project
 
12
 *  license, LICENSE.TXT.  By continuing to use, modify, or distribute
 
13
 *  this file you indicate that you have read the license and
 
14
 *  understand and accept it fully.
 
15
 *
 
16
 *  This is an updated version of the extension component, now
 
17
 *  located in the main library's source directory.  It allows
 
18
 *  the dynamic registration/use of various face object extensions
 
19
 *  through a simple API.
 
20
 *
 
21
 ******************************************************************/
 
22
/* $XFree86: xc/extras/FreeType/lib/ttextend.h,v 1.2 2001/10/28 03:32:05 tsi Exp $ */
 
23
 
 
24
#ifndef TTEXTEND_H
 
25
#define TTEXTEND_H
 
26
 
 
27
#include "ttconfig.h"
 
28
#include "tttypes.h"
 
29
#include "ttobjs.h"
 
30
 
 
31
 
 
32
#ifdef __cplusplus
 
33
  extern "C" {
 
34
#endif
 
35
 
 
36
  /* The extensions don't need to be integrated at compile time into */
 
37
  /* the engine, only at link time.                                  */
 
38
 
 
39
 
 
40
  /* When a new face object is created, the face constructor calls */
 
41
  /* the extension constructor with the following arguments:       */
 
42
  /*                                                               */
 
43
  /*   ext  : typeless pointer to the face's extension block.      */
 
44
  /*          Its size is the one given at registration time       */
 
45
  /*          in the extension class's 'size' field.               */
 
46
  /*                                                               */
 
47
  /*   face : the parent face object.  Note that the extension     */
 
48
  /*          constructor is called when the face object is        */
 
49
  /*          built.                                               */
 
50
 
 
51
  typedef TT_Error  TExt_Constructor( void*  ext, PFace  face );
 
52
 
 
53
 
 
54
  /* When a face object is destroyed, the face destructor calls    */
 
55
  /* the extension destructor with the following arguments.        */
 
56
  /*                                                               */
 
57
  /*   ext  : typeless pointer to the face's extension block.      */
 
58
  /*          Its size is the one given at registration time       */
 
59
  /*          in the extension class's 'size' field.               */
 
60
  /*                                                               */
 
61
  /*   face : the parent face object.  Note that the extension     */
 
62
  /*          destructor is called before the actual face object   */
 
63
  /*          is destroyed.                                        */
 
64
 
 
65
  typedef TT_Error  TExt_Destructor ( void*  ext, PFace  face );
 
66
 
 
67
  typedef TExt_Constructor*  PExt_Constructor;
 
68
  typedef TExt_Destructor*   PExt_Destructor;
 
69
 
 
70
 
 
71
  struct TExtension_Class_
 
72
  {
 
73
    Long              id;      /* extension id                      */
 
74
    Long              size;    /* size in bytes of extension record */
 
75
    PExt_Constructor  build;   /* the extension's class constructor */
 
76
    PExt_Destructor   destroy; /* the extension's class destructor  */
 
77
 
 
78
    Long              offset;  /* offset of ext. record in face obj */
 
79
                               /* (set by the engine)               */
 
80
  };
 
81
 
 
82
  typedef struct TExtension_Class_  TExtension_Class;
 
83
  typedef TExtension_Class*         PExtension_Class;
 
84
 
 
85
 
 
86
#define Build_Extension_ID( a, b, c, d ) \
 
87
           ( ((ULong)(a) << 24) |        \
 
88
             ((ULong)(b) << 16) |        \
 
89
             ((ULong)(c) << 8 ) |        \
 
90
              (ULong)(d) )
 
91
 
 
92
  /*  A note regarding extensions and the single-object compilation    */
 
93
  /*  mode :                                                           */
 
94
  /*                                                                   */
 
95
  /*  When the engine is compiled as a single object file, extensions  */
 
96
  /*  must remain linkable *after* compile time. In order to do this,  */
 
97
  /*  we need to export the functions that an extension may need.      */
 
98
  /*  Fortunately, we can limit ourselves to :                         */
 
99
  /*                                                                   */
 
100
  /*  o TT_Register_Extension (previously called Extension_Register)   */
 
101
  /*        which is to be called by each extension on within          */
 
102
  /*        it TT_Init_XXXX_Extension initializer.                     */
 
103
  /*                                                                   */
 
104
  /*  o File and frame access functions. Fortunately, these already    */
 
105
  /*    have their names prefixed by "TT_", so no change was needed    */
 
106
  /*    except replacing the LOCAL_DEF keyword with EXPORT_DEF         */
 
107
  /*                                                                   */
 
108
  /*  o Memory access functions, i.e. TT_Alloc and TT_Free. Again,     */
 
109
  /*    the change is minimal                                          */
 
110
  /*                                                                   */
 
111
  /*  o the table-lookup function : TT_LookUp_Table, formerly known    */
 
112
  /*    as Load_TrueType_Table in ttload.c.                            */
 
113
  /*                                                                   */
 
114
  /*                                                                   */
 
115
  /*  Other than that, an extension should be able to #include all     */
 
116
  /*  relevant header files to get access to internal types, but       */
 
117
  /*  should not call engine internal functions..                      */
 
118
  /*                                                                   */
 
119
  /*  If there is a need for a specific internal function call, let    */
 
120
  /*  me known to see if we need to export it by default..             */
 
121
  /*                                                         - DavidT  */
 
122
  /*                                                                   */
 
123
 
 
124
  /* Register a new extension.  Called by extension */
 
125
  /* service initializers.                          */
 
126
  EXPORT_DEF
 
127
  TT_Error  TT_Register_Extension( PEngine_Instance  engine,
 
128
                                   Long              id,
 
129
                                   Long              size,
 
130
                                   PExt_Constructor  create,
 
131
                                   PExt_Destructor   destroy );
 
132
 
 
133
 
 
134
#if defined(TT_CONFIG_OPTION_EXTEND_ENGINE) && !defined(FTXSBIT_H)
 
135
  /* Initialize the extension component */
 
136
  LOCAL_DEF
 
137
  TT_Error  TTExtend_Init( PEngine_Instance  engine );
 
138
 
 
139
  /* Finalize the extension component */
 
140
  LOCAL_DEF
 
141
  TT_Error  TTExtend_Done( PEngine_Instance  engine );
 
142
 
 
143
  /* Create an extension within a face object.  Called by the */
 
144
  /* face object constructor.                                 */
 
145
  LOCAL_DEF
 
146
  TT_Error  Extension_Create( PFace  face );
 
147
 
 
148
  /* Destroy all extensions within a face object.  Called by the */
 
149
  /* face object destructor.                                     */
 
150
  LOCAL_DEF
 
151
  TT_Error  Extension_Destroy( PFace  face );
 
152
#endif
 
153
 
 
154
  /* Query an extension block by extension_ID.  Called by extension */
 
155
  /* service routines.                                              */
 
156
  EXPORT_DEF
 
157
  TT_Error  TT_Extension_Get( PFace   face,
 
158
                              Long    extension_id,
 
159
                              void**  extension_block );
 
160
 
 
161
#ifdef __cplusplus
 
162
  }
 
163
#endif
 
164
 
 
165
 
 
166
#endif /* TTEXTEND_H */
 
167
 
 
168
 
 
169
/* END */