/* SPDX-License-Identifier: GPL-2.0-or-later */ /* Generic associative array implementation. * * See Documentation/core-api/assoc_array.rst for information. * * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com)
*/
#define ASSOC_ARRAY_KEY_CHUNK_SIZE BITS_PER_LONG /* Key data retrieved in chunks of this size */
/* * Generic associative array.
*/ struct assoc_array { struct assoc_array_ptr *root; /* The node at the root of the tree */ unsignedlong nr_leaves_on_tree;
};
/* * Operations on objects and index keys for use by array manipulation routines.
*/ struct assoc_array_ops { /* Method to get a chunk of an index key from caller-supplied data */ unsignedlong (*get_key_chunk)(constvoid *index_key, int level);
/* Method to get a piece of an object's index key */ unsignedlong (*get_object_key_chunk)(constvoid *object, int level);
/* Is this the object we're looking for? */ bool (*compare_object)(constvoid *object, constvoid *index_key);
/* How different is an object from an index key, to a bit position in * their keys? (or -1 if they're the same)
*/ int (*diff_objects)(constvoid *object, constvoid *index_key);
/* Method to free an object. */ void (*free_object)(void *object);
};
/* * Access and manipulation functions.
*/ struct assoc_array_edit;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.