7 upscli_list_start - begin multi-item retrieval from a UPS
12 #include <upsclient.h>
13 int upscli_list_start(UPSCONN_t *ups, int numq, const char **query)
18 The *upscli_list_start()* function takes the pointer 'ups' to a
19 `UPSCONN_t` state structure, and the pointer 'query' to an array of
20 'numq' query elements. It builds a properly-formatted request from
21 those elements and transmits it to linkman:upsd[8].
23 Upon success, the caller must call linkman:upscli_list_next[3] to retrieve
24 the elements of the list. Failure to retrieve the list will most likely
25 result in the client getting out of sync with the server due to buffered
31 This function implements the "LIST" command in the protocol. As a
32 result, you can use it to request many different things from the server.
39 - LIST ENUM <ups> <var>
40 - LIST RANGE <ups> <var>
45 To see the list of variables on a UPS called 'su700', the protocol command
46 would be `LIST VAR su700`. To start that list with this function, you
47 would populate query and numq as follows:
56 All escaping of special characters and quoting of elements with spaces
57 are handled for you inside this function.
62 This function checks the response from linkman:upsd[8] against your query.
63 If it is not starting a list, or is starting the wrong type of list, it
64 will return an error code.
66 When this happens, linkman:upscli_upserror[3] will return
67 `UPSCLI_ERR_PROTOCOL`.
71 The *upscli_list_start()* function returns 0 on success, or -1 if an
77 linkman:upscli_fd[3], linkman:upscli_get[3],
78 linkman:upscli_readline[3], linkman:upscli_sendline[3],
79 linkman:upscli_ssl[3],
80 linkman:upscli_strerror[3], linkman:upscli_upserror[3]