/*++ /* NAME /* dict_alloc 3 /* SUMMARY /* dictionary memory manager /* SYNOPSIS /* #include <dict.h> /* /* DICT *dict_alloc(dict_type, dict_name, size) /* const char *dict_type; /* const char *dict_name; /* ssize_t size; /* /* void dict_free(dict) /* DICT *ptr; /* /* void dict_jmp_alloc(dict) /* DICT *ptr; /* DESCRIPTION /* dict_alloc() allocates memory for a dictionary structure of /* \fIsize\fR bytes, initializes all generic dictionary /* properties to default settings, /* and installs default methods that do not support any operation. /* The caller is supposed to override the default methods with /* ones that it supports. /* The purpose of the default methods is to trap an attempt to /* invoke an unsupported method. /* /* One exception is the default lock function. When the /* dictionary provides a file handle for locking, the default /* lock function returns the result from myflock with the /* locking method specified in the lock_type member, otherwise /* it returns 0. Presently, the lock function is used only to /* implement the DICT_FLAG_OPEN_LOCK feature (lock the database /* exclusively after it is opened) for databases that are not /* multi-writer safe. /* /* dict_free() releases memory and cleans up after dict_alloc(). /* It is up to the caller to dispose of any memory that was allocated /* by the caller. /* /* dict_jmp_alloc() implements preliminary support for exception /* handling. This will eventually be built into dict_alloc(). /* /* Arguments: /* .IP dict_type /* The official name for this type of dictionary, as used by /* dict_open(3) etc. This is stored under the \fBtype\fR /* member. /* .IP dict_name /* Dictionary name. This is stored as the \fBname\fR member. /* .IP size /* The size in bytes of the dictionary subclass structure instance. /* SEE ALSO /* dict(3) /* DIAGNOSTICS /* Fatal errors: the process invokes a default method. /* 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
/*--*/
myfree(dict->type);
myfree(dict->name); if (dict->jbuf)
myfree((void *) dict->jbuf); if (dict->utf8_backup)
myfree((void *) dict->utf8_backup); if (dict->file_buf)
vstring_free(dict->file_buf); if (dict->file_b64)
vstring_free(dict->file_b64); if (dict->reg_name)
myfree(dict->reg_name);
myfree((void *) dict);
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.19Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-08-09)
¤
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.