resolve(3z)

πŸ“¦ version 1.10.1, in fedora 43, fedora 44

πŸ’– 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