hesiod.3
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 116 行
3
116 行
./" new manpage created for FT2 of V4.0 20 dec, 1989 (JM).TH hesiod 3.SH Namehes_init, hes_to_bind, hes_error, hes_resolve - routines for usingHesiod .SH Syntax.nf.B #include <hesiod.h>.PP .B hes_init().PP.B char *hes_to_bind(\fIHesiodName\fP, \fIHesiodNameType\fP).br.B char *\fIHesiodName\fP, *\fIHesiodNameType\fP;.PP.B hes_error().PP.B har **hes_resolve(\fIHesiodName\fP, \fIHesiodNameType\fP).br.B char *\fIHesiodName\fP, *\fIHesiodNameType\fP;.fi.SH Description.NXR "hesiod".NXR "hes_init routine".NXR "hes_to_bind routine".NXR "hes_error routine".NXR "hes_resolve routine"The .PN "hes_init()"routine opens and reads the Hesiodconfiguration file, .PN "/etc/hesiod.conf" to extract the lefthand side and right hand side of the Hesiod name..PPThe .PN "hes_to_bind()" routine takes as arguments a .PN HesiodName and.PN HesiodNameType and returns a fully qualified name to be handed to BIND..PPThe two most useful routines to the applications programmer are.PN "hes_error()" and .PN "hes_resolve()." The .PN "hes_error()" routine has noarguments and returns an integer which corresponds to a set of errorswhich can be found in .PN "hesiod.h" file..EX 0#define HES_ER_UNINIT \-1.sp #define HES_ER_OK 0.sp#define HES_ER_NOTFOUND 1.sp#define HES_ER_CONFIG 2.sp#define HES_ER_NET 3.EE.PPThe .PN "hes_resolve()" routine resolves given names via the Hesiod nameserver. It takes as arguments a name to be resolved, the .PN HesiodName ,and a type corresponding to the name, the .PN HesiodNameType ,and returnsa pointer to an array of strings which contains all data that matchedthe query, one match per array slot. The array is null terminated..PPIf applications require the data to be maintained throughout multiplecalls to .PN "hes_resolve()," the data should be copied since another callto .PN "hes_resolve()" will overwrite any previously-returned data. A nullis returned if the data cannot be found..SH ExamplesThe following example shows the use of the Hesiod routines to obtain a Hesiod name from a Hesiod database:.EX#include <hesiod.h>.spchar *HesiodName, *HesiodNameType;char **hp;.sphp = hes_resolve(HesiodName, HesiodNameType);if (hp == NULL) { error = hes_error(); switch(error) { . . . } } else process(hp);.EE.SH Files.PN /etc/hesiod.conf.br .PN /usr/include/hesiod.h.SH See Alsohesiod.conf(5), bindsetup(8).br.I Guide to the BIND/Hesiod Service
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?