/*++ /* NAME /* dict_ni 3 /* SUMMARY /* dictionary manager interface to NetInfo /* SYNOPSIS /* #include <dict_ni.h> /* /* DICT *dict_ni_open(path, dummy, dict_flags) /* char *path; /* int dummy; /* int dict_flags; /* DESCRIPTION /* dict_ni_open() `opens' the named NetInfo database. The result is /* a pointer to a structure that can be used to access the dictionary /* using the generic methods documented in dict_open(3). /* DIAGNOSTICS /* dict_ni_register() returns 0 in case of success, -1 in case /* of problems. /* Fatal errors: NetInfo errors, out of memory. /* SEE ALSO /* dict(3) generic dictionary manager /* netinfo(3N) data base subroutines /* AUTHOR(S) /* Pieter Schoenmakers /* Eindhoven University of Technology /* P.O. Box 513 /* 5600 MB Eindhoven /* The Netherlands
/*--*/
/* *Whatdoesit_mean_ifwefindthedirectorybutnotthevalue?
*/ if (ni_pathsearch(domain, &dir, query) == NI_OK
&& ni_lookupprop(domain, &dir, val_prop, &values) == NI_OK) if (values.ni_namelist_len <= 0)
ni_namelist_free(&values); else { unsignedint i, l, n;
for (i = l = 0; i < values.ni_namelist_len; i++)
l += 1 + strlen(values.ni_namelist_val[i]); if (result_cap < l) { if (result)
myfree(result);
result_cap = l + 100;
result = mymalloc(result_cap);
} for (i = l = 0; i < values.ni_namelist_len; i++) {
n = strlen(values.ni_namelist_val[i]);
memcpy(result + l, values.ni_namelist_val[i], n);
l += n; if (i < values.ni_namelist_len - 1)
result[l++] = ',';
}
result[l] = '\0';
return_val = result; break;
}
if (++depth >= NETINFO_MAX_DOMAIN_DEPTH) {
msg_warn("ni_open: domain depth limit"); break;
}
r = ni_open(domain, "..", &next_domain); if (r != NI_OK) { if (r != NI_FAILED)
msg_warn("ni_open `..': %d", r); break;
}
ni_free(domain);
domain = next_domain;
}
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.