vrshoot

diff libs/ft2static/freetype/ftlist.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/ft2static/freetype/ftlist.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,277 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  ftlist.h                                                               */
     1.7 +/*                                                                         */
     1.8 +/*    Generic list support for FreeType (specification).                   */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */
    1.11 +/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
    1.12 +/*                                                                         */
    1.13 +/*  This file is part of the FreeType project, and may only be used,       */
    1.14 +/*  modified, and distributed under the terms of the FreeType project      */
    1.15 +/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    1.16 +/*  this file you indicate that you have read the license and              */
    1.17 +/*  understand and accept it fully.                                        */
    1.18 +/*                                                                         */
    1.19 +/***************************************************************************/
    1.20 +
    1.21 +
    1.22 +  /*************************************************************************/
    1.23 +  /*                                                                       */
    1.24 +  /*  This file implements functions relative to list processing.  Its     */
    1.25 +  /*  data structures are defined in `freetype.h'.                         */
    1.26 +  /*                                                                       */
    1.27 +  /*************************************************************************/
    1.28 +
    1.29 +
    1.30 +#ifndef __FTLIST_H__
    1.31 +#define __FTLIST_H__
    1.32 +
    1.33 +
    1.34 +#include <ft2build.h>
    1.35 +#include FT_FREETYPE_H
    1.36 +
    1.37 +#ifdef FREETYPE_H
    1.38 +#error "freetype.h of FreeType 1 has been loaded!"
    1.39 +#error "Please fix the directory search order for header files"
    1.40 +#error "so that freetype.h of FreeType 2 is found first."
    1.41 +#endif
    1.42 +
    1.43 +
    1.44 +FT_BEGIN_HEADER
    1.45 +
    1.46 +
    1.47 +  /*************************************************************************/
    1.48 +  /*                                                                       */
    1.49 +  /* <Section>                                                             */
    1.50 +  /*    list_processing                                                    */
    1.51 +  /*                                                                       */
    1.52 +  /* <Title>                                                               */
    1.53 +  /*    List Processing                                                    */
    1.54 +  /*                                                                       */
    1.55 +  /* <Abstract>                                                            */
    1.56 +  /*    Simple management of lists.                                        */
    1.57 +  /*                                                                       */
    1.58 +  /* <Description>                                                         */
    1.59 +  /*    This section contains various definitions related to list          */
    1.60 +  /*    processing using doubly-linked nodes.                              */
    1.61 +  /*                                                                       */
    1.62 +  /* <Order>                                                               */
    1.63 +  /*    FT_List                                                            */
    1.64 +  /*    FT_ListNode                                                        */
    1.65 +  /*    FT_ListRec                                                         */
    1.66 +  /*    FT_ListNodeRec                                                     */
    1.67 +  /*                                                                       */
    1.68 +  /*    FT_List_Add                                                        */
    1.69 +  /*    FT_List_Insert                                                     */
    1.70 +  /*    FT_List_Find                                                       */
    1.71 +  /*    FT_List_Remove                                                     */
    1.72 +  /*    FT_List_Up                                                         */
    1.73 +  /*    FT_List_Iterate                                                    */
    1.74 +  /*    FT_List_Iterator                                                   */
    1.75 +  /*    FT_List_Finalize                                                   */
    1.76 +  /*    FT_List_Destructor                                                 */
    1.77 +  /*                                                                       */
    1.78 +  /*************************************************************************/
    1.79 +
    1.80 +
    1.81 +  /*************************************************************************/
    1.82 +  /*                                                                       */
    1.83 +  /* <Function>                                                            */
    1.84 +  /*    FT_List_Find                                                       */
    1.85 +  /*                                                                       */
    1.86 +  /* <Description>                                                         */
    1.87 +  /*    Find the list node for a given listed object.                      */
    1.88 +  /*                                                                       */
    1.89 +  /* <Input>                                                               */
    1.90 +  /*    list :: A pointer to the parent list.                              */
    1.91 +  /*    data :: The address of the listed object.                          */
    1.92 +  /*                                                                       */
    1.93 +  /* <Return>                                                              */
    1.94 +  /*    List node.  NULL if it wasn't found.                               */
    1.95 +  /*                                                                       */
    1.96 +  FT_EXPORT( FT_ListNode )
    1.97 +  FT_List_Find( FT_List  list,
    1.98 +                void*    data );
    1.99 +
   1.100 +
   1.101 +  /*************************************************************************/
   1.102 +  /*                                                                       */
   1.103 +  /* <Function>                                                            */
   1.104 +  /*    FT_List_Add                                                        */
   1.105 +  /*                                                                       */
   1.106 +  /* <Description>                                                         */
   1.107 +  /*    Append an element to the end of a list.                            */
   1.108 +  /*                                                                       */
   1.109 +  /* <InOut>                                                               */
   1.110 +  /*    list :: A pointer to the parent list.                              */
   1.111 +  /*    node :: The node to append.                                        */
   1.112 +  /*                                                                       */
   1.113 +  FT_EXPORT( void )
   1.114 +  FT_List_Add( FT_List      list,
   1.115 +               FT_ListNode  node );
   1.116 +
   1.117 +
   1.118 +  /*************************************************************************/
   1.119 +  /*                                                                       */
   1.120 +  /* <Function>                                                            */
   1.121 +  /*    FT_List_Insert                                                     */
   1.122 +  /*                                                                       */
   1.123 +  /* <Description>                                                         */
   1.124 +  /*    Insert an element at the head of a list.                           */
   1.125 +  /*                                                                       */
   1.126 +  /* <InOut>                                                               */
   1.127 +  /*    list :: A pointer to parent list.                                  */
   1.128 +  /*    node :: The node to insert.                                        */
   1.129 +  /*                                                                       */
   1.130 +  FT_EXPORT( void )
   1.131 +  FT_List_Insert( FT_List      list,
   1.132 +                  FT_ListNode  node );
   1.133 +
   1.134 +
   1.135 +  /*************************************************************************/
   1.136 +  /*                                                                       */
   1.137 +  /* <Function>                                                            */
   1.138 +  /*    FT_List_Remove                                                     */
   1.139 +  /*                                                                       */
   1.140 +  /* <Description>                                                         */
   1.141 +  /*    Remove a node from a list.  This function doesn't check whether    */
   1.142 +  /*    the node is in the list!                                           */
   1.143 +  /*                                                                       */
   1.144 +  /* <Input>                                                               */
   1.145 +  /*    node :: The node to remove.                                        */
   1.146 +  /*                                                                       */
   1.147 +  /* <InOut>                                                               */
   1.148 +  /*    list :: A pointer to the parent list.                              */
   1.149 +  /*                                                                       */
   1.150 +  FT_EXPORT( void )
   1.151 +  FT_List_Remove( FT_List      list,
   1.152 +                  FT_ListNode  node );
   1.153 +
   1.154 +
   1.155 +  /*************************************************************************/
   1.156 +  /*                                                                       */
   1.157 +  /* <Function>                                                            */
   1.158 +  /*    FT_List_Up                                                         */
   1.159 +  /*                                                                       */
   1.160 +  /* <Description>                                                         */
   1.161 +  /*    Move a node to the head/top of a list.  Used to maintain LRU       */
   1.162 +  /*    lists.                                                             */
   1.163 +  /*                                                                       */
   1.164 +  /* <InOut>                                                               */
   1.165 +  /*    list :: A pointer to the parent list.                              */
   1.166 +  /*    node :: The node to move.                                          */
   1.167 +  /*                                                                       */
   1.168 +  FT_EXPORT( void )
   1.169 +  FT_List_Up( FT_List      list,
   1.170 +              FT_ListNode  node );
   1.171 +
   1.172 +
   1.173 +  /*************************************************************************/
   1.174 +  /*                                                                       */
   1.175 +  /* <FuncType>                                                            */
   1.176 +  /*    FT_List_Iterator                                                   */
   1.177 +  /*                                                                       */
   1.178 +  /* <Description>                                                         */
   1.179 +  /*    An FT_List iterator function which is called during a list parse   */
   1.180 +  /*    by @FT_List_Iterate.                                               */
   1.181 +  /*                                                                       */
   1.182 +  /* <Input>                                                               */
   1.183 +  /*    node :: The current iteration list node.                           */
   1.184 +  /*                                                                       */
   1.185 +  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */
   1.186 +  /*            Can be used to point to the iteration's state.             */
   1.187 +  /*                                                                       */
   1.188 +  typedef FT_Error
   1.189 +  (*FT_List_Iterator)( FT_ListNode  node,
   1.190 +                       void*        user );
   1.191 +
   1.192 +
   1.193 +  /*************************************************************************/
   1.194 +  /*                                                                       */
   1.195 +  /* <Function>                                                            */
   1.196 +  /*    FT_List_Iterate                                                    */
   1.197 +  /*                                                                       */
   1.198 +  /* <Description>                                                         */
   1.199 +  /*    Parse a list and calls a given iterator function on each element.  */
   1.200 +  /*    Note that parsing is stopped as soon as one of the iterator calls  */
   1.201 +  /*    returns a non-zero value.                                          */
   1.202 +  /*                                                                       */
   1.203 +  /* <Input>                                                               */
   1.204 +  /*    list     :: A handle to the list.                                  */
   1.205 +  /*    iterator :: An iterator function, called on each node of the list. */
   1.206 +  /*    user     :: A user-supplied field which is passed as the second    */
   1.207 +  /*                argument to the iterator.                              */
   1.208 +  /*                                                                       */
   1.209 +  /* <Return>                                                              */
   1.210 +  /*    The result (a FreeType error code) of the last iterator call.      */
   1.211 +  /*                                                                       */
   1.212 +  FT_EXPORT( FT_Error )
   1.213 +  FT_List_Iterate( FT_List           list,
   1.214 +                   FT_List_Iterator  iterator,
   1.215 +                   void*             user );
   1.216 +
   1.217 +
   1.218 +  /*************************************************************************/
   1.219 +  /*                                                                       */
   1.220 +  /* <FuncType>                                                            */
   1.221 +  /*    FT_List_Destructor                                                 */
   1.222 +  /*                                                                       */
   1.223 +  /* <Description>                                                         */
   1.224 +  /*    An @FT_List iterator function which is called during a list        */
   1.225 +  /*    finalization by @FT_List_Finalize to destroy all elements in a     */
   1.226 +  /*    given list.                                                        */
   1.227 +  /*                                                                       */
   1.228 +  /* <Input>                                                               */
   1.229 +  /*    system :: The current system object.                               */
   1.230 +  /*                                                                       */
   1.231 +  /*    data   :: The current object to destroy.                           */
   1.232 +  /*                                                                       */
   1.233 +  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */
   1.234 +  /*              be used to point to the iteration's state.               */
   1.235 +  /*                                                                       */
   1.236 +  typedef void
   1.237 +  (*FT_List_Destructor)( FT_Memory  memory,
   1.238 +                         void*      data,
   1.239 +                         void*      user );
   1.240 +
   1.241 +
   1.242 +  /*************************************************************************/
   1.243 +  /*                                                                       */
   1.244 +  /* <Function>                                                            */
   1.245 +  /*    FT_List_Finalize                                                   */
   1.246 +  /*                                                                       */
   1.247 +  /* <Description>                                                         */
   1.248 +  /*    Destroy all elements in the list as well as the list itself.       */
   1.249 +  /*                                                                       */
   1.250 +  /* <Input>                                                               */
   1.251 +  /*    list    :: A handle to the list.                                   */
   1.252 +  /*                                                                       */
   1.253 +  /*    destroy :: A list destructor that will be applied to each element  */
   1.254 +  /*               of the list.                                            */
   1.255 +  /*                                                                       */
   1.256 +  /*    memory  :: The current memory object which handles deallocation.   */
   1.257 +  /*                                                                       */
   1.258 +  /*    user    :: A user-supplied field which is passed as the last       */
   1.259 +  /*               argument to the destructor.                             */
   1.260 +  /*                                                                       */
   1.261 +  /* <Note>                                                                */
   1.262 +  /*    This function expects that all nodes added by @FT_List_Add or      */
   1.263 +  /*    @FT_List_Insert have been dynamically allocated.                   */
   1.264 +  /*                                                                       */
   1.265 +  FT_EXPORT( void )
   1.266 +  FT_List_Finalize( FT_List             list,
   1.267 +                    FT_List_Destructor  destroy,
   1.268 +                    FT_Memory           memory,
   1.269 +                    void*               user );
   1.270 +
   1.271 +
   1.272 +  /* */
   1.273 +
   1.274 +
   1.275 +FT_END_HEADER
   1.276 +
   1.277 +#endif /* __FTLIST_H__ */
   1.278 +
   1.279 +
   1.280 +/* END */