NBP_NAME(3)

✨ NBP_NAME(3) ✨

okay bestie, sit down, we're talking about nbp_name from the Netatalk AFP Fileserver Manual β€” she's a lil function in section 3 of the manual, and she's lowkey the reason your AFP server knows its own name πŸ’…


πŸŽ€ NAME πŸŽ€

nbp_name β€” NBP name parsing. that's it, that's the whole vibe. she takes names and she dissects them πŸ¦‹


🌸 SYNOPSIS 🌸

int nbp_name(name,
    obj,
    type,
    zone);
char *name;
char **obj;
char **type;
char **zone;

look at her. four arguments. no notes. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so like, nbp_name() takes a name that a user just handed you and parses it into its component parts: the object, the type, and the zone. it's giving girlboss surgery, honestly πŸ”₯

here's the tea: obj, type, and zone should all be passed by reference, and they should point to the caller's default values. then nbp_name() goes in and changes those pointers to point at the parsed-out values. so your defaults are basically the placeholder outfit and she's the stylist swapping it out πŸ’…

name is of the form object:type@zone, where each of object, :type, and @zone replace obj, type, and zone, respectively. (yes, exactly in that order, don't fight her on this.)

and the punctuation is not optional, bestie:

  • type must be preceded by : β€” no colon, no type, periodt.
  • zone must be preceded by @ β€” the @ is doing a LOT of heavy lifting here.

πŸ¦‹ EXAMPLES πŸ¦‹

the argument of afpd(8)'s -n option is parsed with nbp_name(). iconic crossover moment ✨

so here's the defaults situation, and honestly it's kind of a cute little family:

  • the default value of obj is the first component of the machine's hostname (as returned by gethostbyname(3)) β€” she's literally named after the computer, main character energy fr fr
  • the default value of type is "AFPServer"
  • the default value of zone is "*", the default zone 🌈

now. say you want afpd to register itself in some zone other than the default. (very "I'm not like other zones" of you, and we support it.) you'd invoke it like this, where obj and type just retain their default values:

afpd -n @some-other-zone

see how she only touched the zone? obj and type didn't even have to get up. slay πŸ’–


πŸ’€ BUGS πŸ’€

okay this is the part where we have to be real with each other. 🚨

obj, type, and zone return pointers into a static area which may be over-written on each call.

translation, bestie: they're not yours. that static area is shared, and every single time you call nbp_name() again, it can just... overwrite the thing you were pointing at. so if you were holding onto those pointers thinking they're safe β€” they are not 😭. copy what you need before the next call, or she WILL catch you slipping. this is not a drill, this is documented behavior. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Contributors to the Netatalk Project β€” the collective, the committee, the girlies who built it. 🫢


🌟 shoutout to all the references doing their lil cameo: afpd(8) and gethostbyname(3) β€” you two understood the assignment.

okay that's the whole page, you're officially an NBP name parsing expert, i don't make the rules πŸ’œ

this has been your girl signing off from the Netatalk 4.4.3 era, dated right there with NBP_NAME(3) β€” go parse something cute, mwah πŸŽ€βœ¨πŸŒΈ

πŸ“¦ where this page comes from
  • epel 10: netatalk-devel 5:4.4.3-1.el10_3 Β· GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-BSD AND FSFUL AND LicenseRef-Callaway-MIT
  • fedora 43: netatalk-devel 5:4.4.3-1.fc43 Β· GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-BSD AND FSFUL AND LicenseRef-Callaway-MIT
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms