resolve(3z)
π resolve(3z) β z88dk Programmer's Manual π
okay bestie, welcome to the z88dk Programmer's Manual β¨ this one's called resolve, and it's here to do one iconic little job: turn a hostname into an IP address. that's it. that's the whole slay. π¦
πΈ NAME πΈ
resolve β convert hostname to IP address π
β¨ SYNOPSIS β¨
#include <net/resolv.h>
ipaddr_t resolve(char *name);
look at that. one include, one function, zero drama. π
π DESCRIPTION π
so like, resolve() goes and queries any configured nameservers for the IP address of the host with the name name. it's giving "who dis, drop the IP". π
and if name is already in the form a.b.c.d, then no nameserver needed bestie β it just converts that straight into an IP address and returns it. instant. no cap. π₯
π«Ά RETURN VALUE π«Ά
resolv() returns the network order IP address of the requested host. π―
if the name cannot be resolved, then NULL is returned π and you just have to deal with that emotionally.
also worth knowing: resolv() may also be called by the macro gethostbyname. iykyk π«
π BUGS π
if you use the macro gethostbyname then beware that the ZSock implementation is not at all standard. not "a little quirky". not "mostly fine". not at all standard. π proceed with awareness bestie.
π AUTHOR π
Dominic Morris <dom@jb.man.ac.uk> β the main character who wrote this π
that's the whole page, and honestly? short, sweet, resolved. periodt. π
this was the z88dk Programmer's Manual's resolve(3z), dated 18 February 2000 β a true vintage baddie ππ bye bestie, go resolve some hostnames πβ
π¦ where this page comes from
- fedora 43: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- fedora 44: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms