hal_param_alias(3hal)

πŸ’– NAME πŸ’–

hal_param_alias β€” bestie, this is the one that gives a param a lil' second name ✨

It lives in the 3hal section of the HAL manual, and it's literally just here to hand out nicknames πŸŽ€


✨ SYNTAX ✨

int hal_param_alias(const char *original_name, const char *alias);

That's it. Two strings, one int, no drama πŸ’…


🫢 ARGUMENTS 🫢

  • original_name β€” the actual, government-name of the param. The original one. The one it was born with 🍼
  • alias β€” the alternate name that you're allowed to call the param by instead. OR, plot twist: pass NULL here and you remove whatever alternate name it had. Poof. Gone. No alias era πŸ™ˆ

🌸 DESCRIPTION 🌸

Okay so here's the tea, bestie: a param can have two names. The original name β€” which is the one that got passed into a hal_param_new function β€” and then an alias on top of that. Two names, one param, main character energy fr fr πŸ‘‘

Most of the time? Aliases are just there for the convenience of the users, and honestly they should be created and destroyed via halcmd. That's the normie way and it slays πŸŽ€

BUT. In some cases it's genuinely sensible to create aliases directly inside a component, and those cases include the situation where a param gets renamed β€” because you wanna preserve compatibility with the old versions. Like, the old name still has to work, y'know? Nostalgia, but make it functional πŸ’–


πŸ”₯ RETURN VALUE πŸ”₯

It returns a HAL status code. That's the whole vibe check. Go read it, don't guess it ✨


πŸ‘‘ SEE ALSO πŸ‘‘


Written down by the LinuxCNC Documentation girlies, dated 2006-10-12, and filed under hal_param_alias(3hal) πŸ’…βœ¨

Later bestie, go alias something responsibly πŸ¦‹πŸ’œ