|
|
|||
Warning, file /include/freetype2/freetype/ftlist.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /**************************************************************************** 0002 * 0003 * ftlist.h 0004 * 0005 * Generic list support for FreeType (specification). 0006 * 0007 * Copyright (C) 1996-2023 by 0008 * David Turner, Robert Wilhelm, and Werner Lemberg. 0009 * 0010 * This file is part of the FreeType project, and may only be used, 0011 * modified, and distributed under the terms of the FreeType project 0012 * license, LICENSE.TXT. By continuing to use, modify, or distribute 0013 * this file you indicate that you have read the license and 0014 * understand and accept it fully. 0015 * 0016 */ 0017 0018 0019 /************************************************************************** 0020 * 0021 * This file implements functions relative to list processing. Its data 0022 * structures are defined in `freetype.h`. 0023 * 0024 */ 0025 0026 0027 #ifndef FTLIST_H_ 0028 #define FTLIST_H_ 0029 0030 0031 #include <freetype/freetype.h> 0032 0033 #ifdef FREETYPE_H 0034 #error "freetype.h of FreeType 1 has been loaded!" 0035 #error "Please fix the directory search order for header files" 0036 #error "so that freetype.h of FreeType 2 is found first." 0037 #endif 0038 0039 0040 FT_BEGIN_HEADER 0041 0042 0043 /************************************************************************** 0044 * 0045 * @section: 0046 * list_processing 0047 * 0048 * @title: 0049 * List Processing 0050 * 0051 * @abstract: 0052 * Simple management of lists. 0053 * 0054 * @description: 0055 * This section contains various definitions related to list processing 0056 * using doubly-linked nodes. 0057 * 0058 * @order: 0059 * FT_List 0060 * FT_ListNode 0061 * FT_ListRec 0062 * FT_ListNodeRec 0063 * 0064 * FT_List_Add 0065 * FT_List_Insert 0066 * FT_List_Find 0067 * FT_List_Remove 0068 * FT_List_Up 0069 * FT_List_Iterate 0070 * FT_List_Iterator 0071 * FT_List_Finalize 0072 * FT_List_Destructor 0073 * 0074 */ 0075 0076 0077 /************************************************************************** 0078 * 0079 * @function: 0080 * FT_List_Find 0081 * 0082 * @description: 0083 * Find the list node for a given listed object. 0084 * 0085 * @input: 0086 * list :: 0087 * A pointer to the parent list. 0088 * data :: 0089 * The address of the listed object. 0090 * 0091 * @return: 0092 * List node. `NULL` if it wasn't found. 0093 */ 0094 FT_EXPORT( FT_ListNode ) 0095 FT_List_Find( FT_List list, 0096 void* data ); 0097 0098 0099 /************************************************************************** 0100 * 0101 * @function: 0102 * FT_List_Add 0103 * 0104 * @description: 0105 * Append an element to the end of a list. 0106 * 0107 * @inout: 0108 * list :: 0109 * A pointer to the parent list. 0110 * node :: 0111 * The node to append. 0112 */ 0113 FT_EXPORT( void ) 0114 FT_List_Add( FT_List list, 0115 FT_ListNode node ); 0116 0117 0118 /************************************************************************** 0119 * 0120 * @function: 0121 * FT_List_Insert 0122 * 0123 * @description: 0124 * Insert an element at the head of a list. 0125 * 0126 * @inout: 0127 * list :: 0128 * A pointer to parent list. 0129 * node :: 0130 * The node to insert. 0131 */ 0132 FT_EXPORT( void ) 0133 FT_List_Insert( FT_List list, 0134 FT_ListNode node ); 0135 0136 0137 /************************************************************************** 0138 * 0139 * @function: 0140 * FT_List_Remove 0141 * 0142 * @description: 0143 * Remove a node from a list. This function doesn't check whether the 0144 * node is in the list! 0145 * 0146 * @input: 0147 * node :: 0148 * The node to remove. 0149 * 0150 * @inout: 0151 * list :: 0152 * A pointer to the parent list. 0153 */ 0154 FT_EXPORT( void ) 0155 FT_List_Remove( FT_List list, 0156 FT_ListNode node ); 0157 0158 0159 /************************************************************************** 0160 * 0161 * @function: 0162 * FT_List_Up 0163 * 0164 * @description: 0165 * Move a node to the head/top of a list. Used to maintain LRU lists. 0166 * 0167 * @inout: 0168 * list :: 0169 * A pointer to the parent list. 0170 * node :: 0171 * The node to move. 0172 */ 0173 FT_EXPORT( void ) 0174 FT_List_Up( FT_List list, 0175 FT_ListNode node ); 0176 0177 0178 /************************************************************************** 0179 * 0180 * @functype: 0181 * FT_List_Iterator 0182 * 0183 * @description: 0184 * An FT_List iterator function that is called during a list parse by 0185 * @FT_List_Iterate. 0186 * 0187 * @input: 0188 * node :: 0189 * The current iteration list node. 0190 * 0191 * user :: 0192 * A typeless pointer passed to @FT_List_Iterate. Can be used to point 0193 * to the iteration's state. 0194 */ 0195 typedef FT_Error 0196 (*FT_List_Iterator)( FT_ListNode node, 0197 void* user ); 0198 0199 0200 /************************************************************************** 0201 * 0202 * @function: 0203 * FT_List_Iterate 0204 * 0205 * @description: 0206 * Parse a list and calls a given iterator function on each element. 0207 * Note that parsing is stopped as soon as one of the iterator calls 0208 * returns a non-zero value. 0209 * 0210 * @input: 0211 * list :: 0212 * A handle to the list. 0213 * iterator :: 0214 * An iterator function, called on each node of the list. 0215 * user :: 0216 * A user-supplied field that is passed as the second argument to the 0217 * iterator. 0218 * 0219 * @return: 0220 * The result (a FreeType error code) of the last iterator call. 0221 */ 0222 FT_EXPORT( FT_Error ) 0223 FT_List_Iterate( FT_List list, 0224 FT_List_Iterator iterator, 0225 void* user ); 0226 0227 0228 /************************************************************************** 0229 * 0230 * @functype: 0231 * FT_List_Destructor 0232 * 0233 * @description: 0234 * An @FT_List iterator function that is called during a list 0235 * finalization by @FT_List_Finalize to destroy all elements in a given 0236 * list. 0237 * 0238 * @input: 0239 * system :: 0240 * The current system object. 0241 * 0242 * data :: 0243 * The current object to destroy. 0244 * 0245 * user :: 0246 * A typeless pointer passed to @FT_List_Iterate. It can be used to 0247 * point to the iteration's state. 0248 */ 0249 typedef void 0250 (*FT_List_Destructor)( FT_Memory memory, 0251 void* data, 0252 void* user ); 0253 0254 0255 /************************************************************************** 0256 * 0257 * @function: 0258 * FT_List_Finalize 0259 * 0260 * @description: 0261 * Destroy all elements in the list as well as the list itself. 0262 * 0263 * @input: 0264 * list :: 0265 * A handle to the list. 0266 * 0267 * destroy :: 0268 * A list destructor that will be applied to each element of the list. 0269 * Set this to `NULL` if not needed. 0270 * 0271 * memory :: 0272 * The current memory object that handles deallocation. 0273 * 0274 * user :: 0275 * A user-supplied field that is passed as the last argument to the 0276 * destructor. 0277 * 0278 * @note: 0279 * This function expects that all nodes added by @FT_List_Add or 0280 * @FT_List_Insert have been dynamically allocated. 0281 */ 0282 FT_EXPORT( void ) 0283 FT_List_Finalize( FT_List list, 0284 FT_List_Destructor destroy, 0285 FT_Memory memory, 0286 void* user ); 0287 0288 /* */ 0289 0290 0291 FT_END_HEADER 0292 0293 #endif /* FTLIST_H_ */ 0294 0295 0296 /* END */
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|