VECARGS(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

✨ NAME ✨

vecargs β€” command argument vector insertion routines. That's the whole name vibe, bestie πŸ’…

🌸 SYNOPSIS 🌸

#include <vecargs.h>

char** vecload(char* string); char** vecfile(const char* path); char** vecstring(const char* string); void vecfree(char**, int); int vecargs(char** vec, int* argcp, char*** argvp);

πŸ’– DESCRIPTION πŸ’–

okay so welcome to the VECARGS(3) page from the Library Functions Manual β€” it's literally all about string vectors and slipping args into your command's argv. Let's go function by function, no cap. 🫢

  • vecload β€” loads a string vector from lines in string. Heads up: string may be modified upon return. Each line in string is treated as a new vector element. Lines with # as the first character are comments. \newline joins consecutive lines. It returns a string vector pointer, or 0 on error. ✨
  • vecfile β€” constructs a string vector by calling vecload on the contents of the file named by path. Returns the string vector pointer, or 0 on error. πŸŽ€
  • vecstring β€” constructs a string vector by calling vecload on a copy of string. Returns the string vector pointer, or 0 on error. πŸ¦‹
  • vecfree β€” frees a string vector allocated by vecfile, vecload or vecstring. Cleanup icon behavior, honestly. 🧚
  • vecargs β€” inserts the string vector vec (as returned by vecfile, vecload or vecstring) between (*argvp)[0] and (*argvp)[1], sliding (*argvp)[1] ... over. NULL and empty string args in vec are not copied. vecfree(vec) is called before the return. Returns -1 if the insertion failed. πŸ’€

πŸ¦‹ EXAMPLES πŸ¦‹

vecargs is commonly used to modify command argv from fixed files. For example, make(1) checks for the files ./Makeargs and ./makeargs to modify its arguments on startup. It's a handy way to override default options on a directory by directory basis without modifying the standard control files (Makefile in this case). πŸ”₯

πŸŽ€ CAVEATS πŸŽ€

This paradigm is not recommended for all commands; only a few exceptions make sense. So like, don't go wild with it, bestie β€” it's a special-case slay, not a universal vibe. πŸ™ˆ

and that's the whole page, bestie! 🫢 this was VECARGS(3) from the Library Functions Manual β€” there's no date listed on this one, so we're not inventing one. stay iconic and may your vectors always insert cleanly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from