2006-07-03 01:17:05 +05:30
|
|
|
/* vi: set sw=4 ts=4: */
|
2008-12-07 06:22:58 +05:30
|
|
|
/*
|
|
|
|
* Copyright (C) 2008 Denys Vlasenko.
|
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2, see file LICENSE in this source tree.
|
2008-12-07 06:22:58 +05:30
|
|
|
*/
|
2006-04-28 05:04:46 +05:30
|
|
|
#include <unistd.h>
|
2010-06-06 02:41:07 +05:30
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2006-10-05 15:47:08 +05:30
|
|
|
|
2009-10-02 04:40:32 +05:30
|
|
|
#include "autoconf.h"
|
2006-04-28 05:04:46 +05:30
|
|
|
|
2008-06-14 02:14:05 +05:30
|
|
|
/* Since we can't use platform.h, have to do this again by hand: */
|
|
|
|
#if ENABLE_NOMMU
|
2009-10-02 04:40:32 +05:30
|
|
|
# define BB_MMU 0
|
|
|
|
# define USE_FOR_NOMMU(...) __VA_ARGS__
|
|
|
|
# define USE_FOR_MMU(...)
|
2008-06-14 02:14:05 +05:30
|
|
|
#else
|
2009-10-02 04:40:32 +05:30
|
|
|
# define BB_MMU 1
|
|
|
|
# define USE_FOR_NOMMU(...)
|
|
|
|
# define USE_FOR_MMU(...) __VA_ARGS__
|
2008-06-14 02:14:05 +05:30
|
|
|
#endif
|
|
|
|
|
2006-10-20 03:40:07 +05:30
|
|
|
#include "usage.h"
|
2010-06-06 02:41:07 +05:30
|
|
|
#define MAKE_USAGE(aname, usage) { aname, usage },
|
|
|
|
static struct usage_data {
|
|
|
|
const char *aname;
|
|
|
|
const char *usage;
|
|
|
|
} usage_array[] = {
|
2006-10-20 03:40:07 +05:30
|
|
|
#include "applets.h"
|
2010-06-06 02:41:07 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
static int compare_func(const void *a, const void *b)
|
|
|
|
{
|
|
|
|
const struct usage_data *ua = a;
|
|
|
|
const struct usage_data *ub = b;
|
|
|
|
return strcmp(ua->aname, ub->aname);
|
|
|
|
}
|
2006-04-28 05:04:46 +05:30
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2010-06-06 02:41:07 +05:30
|
|
|
int i;
|
|
|
|
int num_messages = sizeof(usage_array) / sizeof(usage_array[0]);
|
|
|
|
|
|
|
|
if (num_messages == 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
qsort(usage_array,
|
|
|
|
num_messages, sizeof(usage_array[0]),
|
|
|
|
compare_func);
|
|
|
|
for (i = 0; i < num_messages; i++)
|
|
|
|
write(STDOUT_FILENO, usage_array[i].usage, strlen(usage_array[i].usage) + 1);
|
|
|
|
|
2006-04-28 05:04:46 +05:30
|
|
|
return 0;
|
|
|
|
}
|