upscli_splitname (3) - Linux Manuals
upscli_splitname: split a UPS definition into its components
upscli_splitname - split a UPS definition into its components
int upscli_splitname(const char *buf, char **upsname, char **hostname, int *port)
A UPS definition is specified according to this format:
When the UPS name is not given, this function will print an error to stderr and return -1 without changing anything.
You must free(3) the pointers to upsname and hostname when you are done with them to avoid memory leaks.