/[freetype]/freetype2/include/freetype/cache/ftcmru.h
ViewVC logotype

Diff of /freetype2/include/freetype/cache/ftcmru.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by davidT, Wed Jun 9 21:07:49 2004 UTC revision 1.10 by wl, Mon May 23 21:33:02 2005 UTC
# Line 4  Line 4 
4  /*                                                                         */  /*                                                                         */
5  /*    Simple MRU list-cache (specification).                               */  /*    Simple MRU list-cache (specification).                               */
6  /*                                                                         */  /*                                                                         */
7  /*  Copyright 2000-2001, 2003, 2004 by                                     */  /*  Copyright 2000-2001, 2003, 2004, 2005 by                               */
8  /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */  /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9  /*                                                                         */  /*                                                                         */
10  /*  This file is part of the FreeType project, and may only be used,       */  /*  This file is part of the FreeType project, and may only be used,       */
# Line 172  FT_BEGIN_HEADER Line 172  FT_BEGIN_HEADER
172    FT_BEGIN_STMNT                                                            \    FT_BEGIN_STMNT                                                            \
173      FTC_MruNode*             _pfirst  = &(list)->nodes;                     \      FTC_MruNode*             _pfirst  = &(list)->nodes;                     \
174      FTC_MruNode_CompareFunc  _compare = (FTC_MruNode_CompareFunc)(compare); \      FTC_MruNode_CompareFunc  _compare = (FTC_MruNode_CompareFunc)(compare); \
175      FTC_MruNode              _first, _node;                              \      FTC_MruNode              _first, _node, *_pnode;                        \
176                                                                           \                                                                              \
177                                                                           \                                                                              \
178      error  = 0;                                                          \      error  = 0;                                                             \
179      _first = *(_pfirst);                                                 \      _first = *(_pfirst);                                                    \
180      _node  = NULL;                                                       \      _node  = NULL;                                                          \
181                                                                           \                                                                              \
182      if ( _first )                                                        \      if ( _first )                                                           \
183      {                                                                    \      {                                                                       \
184        _node = _first;                                                    \        _node = _first;                                                       \
185        do                                                                 \        do                                                                    \
186        {                                                                  \        {                                                                     \
187          if ( _compare( _node, (key) ) )                                  \          if ( _compare( _node, (key) ) )                                     \
188          {                                                                \          {                                                                   \
189            if ( _node != _first )                                         \            if ( _node != _first )                                            \
190              FTC_MruNode_Up( _pfirst, _node );                            \              FTC_MruNode_Up( _pfirst, _node );                               \
191                                                                           \                                                                              \
192            *(FTC_MruNode*)&(node) = _node;                                \            _pnode = (FTC_MruNode*)(void*)&(node);                            \
193            goto _MruOk;                                                   \            *_pnode = _node;                                                  \
194          }                                                                \            goto _MruOk;                                                      \
195          _node = _node->next;                                             \          }                                                                   \
196                                                                           \          _node = _node->next;                                                \
197        } while ( _node != _first) ;                                       \                                                                              \
198      }                                                                    \        } while ( _node != _first) ;                                          \
199                                                                           \      }                                                                       \
200      error = FTC_MruList_New( (list), (key), (FTC_MruNode*)&(node) );     \                                                                              \
201    _MruOk:                                                                \      error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \
202      ;                                                                    \    _MruOk:                                                                   \
203        ;                                                                       \
204    FT_END_STMNT    FT_END_STMNT
205    
206  #define FTC_MRULIST_LOOKUP( list, key, node, error ) \  #define FTC_MRULIST_LOOKUP( list, key, node, error ) \

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26