# define USE_WATT32
#endif
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
+#endif
+
struct category_descriptors {
const char *opt;
const char *desc;
static int get_category_content(const char *category, unsigned int cols)
{
unsigned int i;
- for(i = 0; i < sizeof(categories)/sizeof(categories[0]); ++i)
+ for(i = 0; i < ARRAYSIZE(categories); ++i)
if(curl_strequal(categories[i].opt, category)) {
printf("%s: %s\n", categories[i].opt, categories[i].desc);
print_category(categories[i].category, cols);
static void get_categories(void)
{
unsigned int i;
- for(i = 0; i < sizeof(categories)/sizeof(categories[0]); ++i)
+ for(i = 0; i < ARRAYSIZE(categories); ++i)
printf(" %-11s %s\n", categories[i].opt, categories[i].desc);
}
{
unsigned int i;
size_t col = 0;
- for(i = 0; categories[i].opt; ++i) {
+ for(i = 0; i < ARRAYSIZE(categories); ++i) {
size_t len = strlen(categories[i].opt);
- if(!categories[i + 1].opt) {
+ if(i == ARRAYSIZE(categories) - 1) {
/* final category */
if(col + len + 1 < width)
printf("%s.\n", categories[i].opt);
This is not the full help; this menu is split into categories.
Use "--help category" to get an overview of all categories, which are:
-auth, connection, curl, dns, file, ftp, http, imap, misc, output, pop3, post,
-proxy, scp, sftp, smtp, ssh, telnet, tftp, tls, ech, upload, verbose.
+auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap,
+output, pop3, post, proxy, scp, sftp, smtp, ssh, telnet, tftp, timeout, tls,
+upload, verbose.
For all options use the manual or "--help all".
</stdout>
</verify>