Last change
on this file since 2749 was 2725, checked in by Bruno Cornec, 13 years ago |
- Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1765] | 1 | /* vi: set sw=4 ts=4: */
|
---|
[2725] | 2 | /*
|
---|
| 3 | * Copyright (C) 2008 Denys Vlasenko.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under GPLv2, see file LICENSE in this source tree.
|
---|
| 6 | */
|
---|
[1765] | 7 | #include <unistd.h>
|
---|
[2725] | 8 | #include <stdlib.h>
|
---|
| 9 | #include <string.h>
|
---|
[1765] | 10 |
|
---|
[2725] | 11 | #include "autoconf.h"
|
---|
[1765] | 12 |
|
---|
[2725] | 13 | /* Since we can't use platform.h, have to do this again by hand: */
|
---|
| 14 | #if ENABLE_NOMMU
|
---|
| 15 | # define BB_MMU 0
|
---|
| 16 | # define USE_FOR_NOMMU(...) __VA_ARGS__
|
---|
| 17 | # define USE_FOR_MMU(...)
|
---|
| 18 | #else
|
---|
| 19 | # define BB_MMU 1
|
---|
| 20 | # define USE_FOR_NOMMU(...)
|
---|
| 21 | # define USE_FOR_MMU(...) __VA_ARGS__
|
---|
| 22 | #endif
|
---|
| 23 |
|
---|
[1765] | 24 | #include "usage.h"
|
---|
[2725] | 25 | #define MAKE_USAGE(aname, usage) { aname, usage },
|
---|
| 26 | static struct usage_data {
|
---|
| 27 | const char *aname;
|
---|
| 28 | const char *usage;
|
---|
| 29 | } usage_array[] = {
|
---|
[1765] | 30 | #include "applets.h"
|
---|
[2725] | 31 | };
|
---|
[1765] | 32 |
|
---|
[2725] | 33 | static int compare_func(const void *a, const void *b)
|
---|
| 34 | {
|
---|
| 35 | const struct usage_data *ua = a;
|
---|
| 36 | const struct usage_data *ub = b;
|
---|
| 37 | return strcmp(ua->aname, ub->aname);
|
---|
| 38 | }
|
---|
| 39 |
|
---|
[1765] | 40 | int main(void)
|
---|
| 41 | {
|
---|
[2725] | 42 | int i;
|
---|
| 43 | int num_messages = sizeof(usage_array) / sizeof(usage_array[0]);
|
---|
| 44 |
|
---|
| 45 | if (num_messages == 0)
|
---|
| 46 | return 0;
|
---|
| 47 |
|
---|
| 48 | qsort(usage_array,
|
---|
| 49 | num_messages, sizeof(usage_array[0]),
|
---|
| 50 | compare_func);
|
---|
| 51 | for (i = 0; i < num_messages; i++)
|
---|
| 52 | write(STDOUT_FILENO, usage_array[i].usage, strlen(usage_array[i].usage) + 1);
|
---|
| 53 |
|
---|
[1765] | 54 | return 0;
|
---|
| 55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.