/*++ /* NAME /* maps 3 /* SUMMARY /* multi-dictionary search /* SYNOPSIS /* #include <maps.h> /* /* MAPS *maps_create(title, map_names, flags) /* const char *title; /* const char *map_names; /* int flags; /* /* const char *maps_find(maps, key, flags) /* MAPS *maps; /* const char *key; /* int flags; /* /* const char *maps_file_find(maps, key, flags) /* MAPS *maps; /* const char *key; /* int flags; /* /* MAPS *maps_free(maps) /* MAPS *maps; /* DESCRIPTION /* This module implements multi-dictionary searches. it goes /* through the high-level dictionary interface and does file /* locking. Dictionaries are opened read-only, and in-memory /* dictionary instances are shared. /* /* maps_create() takes list of type:name pairs and opens the /* named dictionaries. /* The result is a handle that must be specified along with all /* other maps_xxx() operations. /* See dict_open(3) for a description of flags. /* This includes the flags that specify preferences for search /* string case folding. /* /* maps_find() searches the specified list of dictionaries /* in the specified order for the named key. The result is in /* memory that is overwritten upon each call. /* The flags argument is either 0 or specifies a filter: /* for example, DICT_FLAG_FIXED | DICT_FLAG_PATTERN selects /* dictionaries that have fixed keys or pattern keys. /* /* maps_file_find() implements maps_find() but also decodes /* the base64 lookup result. This requires that the maps are /* opened with DICT_FLAG_SRC_RHS_IS_FILE. /* /* maps_free() releases storage claimed by maps_create() /* and conveniently returns a null pointer. /* /* Arguments: /* .IP title /* String used for diagnostics. Typically one specifies the /* type of information stored in the lookup tables. /* .IP map_names /* Null-terminated string with type:name dictionary specifications, /* separated by whitespace or commas. /* .IP flags /* With maps_create(), flags that are passed to dict_open(). /* With maps_find(), flags that control searching behavior /* as documented above. /* .IP maps /* A result from maps_create(). /* .IP key /* Null-terminated string with a lookup key. Table lookup is case /* sensitive. /* DIAGNOSTICS /* Panic: inappropriate use; fatal errors: out of memory, unable /* to open database. Warnings: null string lookup result. /* /* maps_find() returns a null pointer when the requested /* information was not found, and logs a warning when the /* lookup failed due to error. The maps->error value indicates /* if the last lookup failed due to error. /* BUGS /* The dictionary name space is flat, so dictionary names allocated /* by maps_create() may collide with dictionary names allocated by /* other methods. /* /* This functionality could be implemented by allowing the user to /* specify dictionary search paths to dict_lookup() or dict_eval(). /* However, that would either require that the dict(3) module adopts /* someone else's list notation syntax, or that the dict(3) module /* imposes syntax restrictions onto other software, neither of which /* is desirable. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
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 und die Messung sind noch experimentell.