📄 getphonenumberbyname.3c
字号:
.TH GETPHONENUMBERBYNAME 3C "Feb 14, 1989".SH NAMEgetphonenumberbyname, getnamebyphonenumber, getphonenumberent, setphonenumberent, endphonenumberent \- get telephone number directory entry.SH SYNOPSIS.B "#include <phonenumber.h>.PP.B "extern int pn_errno;.PP.B "struct phonenumberent *getphonenumberbyname(name).br.B "char *name;.PP.B "struct phonenumberent *getnamebyphonenumber(number, type).br.B "char *number; int type;.PP.B "struct phonenumberent *getphonenumberent().PP.B "setphonenumberent(stayopen).br.B "int stayopen;.PP.B "endphonenumberent().PP.SH DESCRIPTION.I Getphonenumberbynameand.I getnamebyphonenumbereach return a pointer to an object with thefollowing structure.This structure contains either the information obtained from the name server,.IR named (8),or broken-out fields from a line in .IR /etc/phonenumbers .If the local name server is not running these routines do a lookup in.IR /etc/phonenumbers ..RS.PP.nfstruct phonenumberent { char *pn_name; /* directory listing name */ char **pn_aliases; /* alias list */ int pn_length; /* length of phone number address */ char **pn_addr_list; /* list of addresses from name server */ struct pn_addr *pn_addrtype; /* list of phone number address types */};.ft R.ad.fi.RE.PPThe members of this structure are:.TP \w'pn_addr_list'u+2npn_nameOfficial directory listing name of the phone number..TP \w'pn_addr_list'u+2npn_aliasesA zero terminated array of alternate names for this phone number..TP \w'pn_addr_list'u+2npn_addrtypeA zero terminated array of address types that can reach this location..TP \w'pn_addr_list'u+2npn_addr_listA zero terminated array of phone numbers to reach this location..PP.SH DIAGNOSTICS.PPError return status from .I getphonenumberbynameand.I getphonenumberbyaddris indicated by return of a null pointer.The external integer.IR pn_errnomay then be checked to see whether this is a temporary failureor an invalid or unknown phonenumber..PP.IR pn_errnocan have the following values:.RS.IP ENTRY_NOT_FOUND \w'ENTRY_NOT_FOUND'u+2nNo such phonenumber is known..IP TRY_AGAIN \w'ENTRY_NOT_FOUND'u+2nThis is usually a temporary errorand means that the local server did not receivea response from an authoritative server.A retry at some later time may succeed..IP NO_RECOVERY \w'ENTRY_NOT_FOUND'u+2nThis is a non-recoverable error..IP NO_ADDRESS \w'ENTRY_NOT_FOUND'u+2nThe requested name is valid but does not have an IP address; this is not a temporary error. This means another typeof request to the name server will result in an answer..RE.SH FILES/etc/phonenumbers.SH "SEE ALSO"phonenumbers(5), resolver(3), named(8).SH CAVEAT.PP.I Getphonenumberentis defined, and.I setphonenumberentand.I endphonenumberentare redefined,when.IR libcis built to use only the routines to lookup in.IR /etc/phonenumbers and not the name server..PP.I Getphonenumberentreads the next line of.IR /etc/phonenumbers ,opening the file if necessary..PP.I Setphonenumberent is redefined to open and rewind the file. If the.I stayopenargument is non-zero,the phonenumbers data base will not be closed after each call to.I getphonenumberbynameor.IR getphonenumberbyaddr ..I Endphonenumberentis redefined to close the file..SH BUGSAll informationis contained in a static areaso it must be copied if it isto be saved.Multiple address types are not implemented.Nameserver is not implemented.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -