getoptr
Getoptr is a name used in some programming contexts to refer to a utility that returns a pointer to the next option parsed from command-line arguments. It is not a standard function in the C library, and its exact form and behavior vary by implementation. In general, getoptr operates within a small stateful parser and yields a pointer to an option structure or entry, or NULL when no more options are available.
Typical usage involve taking the argument list (argc, argv) and an option specification, which can be a
Compared with the standard getopt family, getoptr emphasizes returning a structured pointer rather than populating global
Example usage (conceptual): for (optr_t *o = getoptr(argc, argv, optspec); o != NULL; o = getoptr(NULL, NULL, NULL)) { process_option(o);