qlibs:(env)

πŸ“¦ version 31, in alpine 3.24

πŸ’– NAME πŸ’–

okay so bestie, we’re in qlibs:(env) and this whole page is about env β€” manage variables in the environment. that’s the assignment, and it’s lowkey iconic. ✨

πŸ› οΈ SYNTAX πŸ› οΈ

#include "env.h"

char **environ;

char *env_put(char *NAME,char *value);
char *env_puts(char *NAME=value);
char *env_set(char *NAME=value);
char *env_unset(char *NAME);
char *env_get(char *NAME);
char *env_pick();
char *env_clear();

πŸ’… DESCRIPTION πŸ’…

The environment, environ, is a 0-terminated array of 0-terminated strings, called environment variables. each environment variable is of the form NAME=value. that’s the whole vibe check. 🫢

here’s the function lineup, bestie β€” no cap, every one is doing her own little job:

  • env_puts β€” puts the string NAME=value into the environment. slay, string delivered. πŸ’Œ
  • env_put β€” assigns the new environment variable NAME with value. fresh variable, main character entrance. πŸ‘‘
  • env_set β€” assigns an existing environment variable NAME with value: NAME=value. note the β€œexisting” bestie, we’re not making a new one here. πŸ’…
  • env_unset β€” unsets an existing environment variable given as NAME. bye-bye, variable. πŸ‘‹
  • env_get β€” returns the assigned value of the first variable whose name is NAME, or 0 if there is no such variable. first match wins, and if nobody’s home, it’s 0. πŸ”
  • env_pick β€” returns any variable in the environment, or 0 if the environment is empty. little random pick-me energy, but make it Unix. 🎲
  • env_clear β€” clears the whole environment. like, the entire thing. poof. πŸ’€

🌈 SEE ALSO 🌈


okay that’s the page, bestie! signing off from section 3 of qlibs:(env) β€” the footer didn’t give a date, so that’s the whole receipt πŸ§ΎπŸ’–πŸŽ€

πŸ“¦ where this page comes from