![]() |
![]()
| ![]() |
![]()
NAMEnamealloc - hash table for strings See the file man1/alc_origin.1. SYNOPSIS#include "mut.h" char ∗namealloc(inputname) char ∗inputname; PARAMETER
DESCRIPTIONThe namealloc function creates a dictionary of names in
mbk. It warranties equality on characters string if the pointers to these
strings are equal, at strcmp(3) meaning. This means also that there
is a single memory address for a given string.
RETURN VALUEnamealloc returns a string pointer. If the inputname is already in the hash table, then its internal pointer is returned, else a new entry is created, and then the new pointer returned. EXAMPLE#include "mut.h" #include "mlo.h" lofig_list ∗find_fig(name) char ∗name; { lofig_list ∗p; name = namealloc(name); for (p = HEAD_LOFIG; p; p = p->NEXT) if (p->NAME == name) /∗ pointer equality ∗/ return p; return NULL; } DIAGNOSTICSnamealloc can be used only after a call to mbkenv(3). SEE ALSOmbk(1). See the file man1/alc_bug_report.1.
|