1 |
* Ned Ludd <solar@g.o> schrieb: |
2 |
> On Tue, 2006-05-30 at 14:05 +0200, Natanael Copa wrote: |
3 |
> > On Tue, 2006-05-30 at 13:06 +0200, Enrico Weigelt wrote: |
4 |
> > > Hi folks, |
5 |
> > > |
6 |
> > > JFYI: I've made an mii-tool single distribution, which is |
7 |
> > > independent from the rest of the net-tools stuff. |
8 |
> > > |
9 |
> > > http://www.metux.de/articles/oss/mii-tool-1_9_1_1 |
10 |
> > > |
11 |
> > > This is especially interesting for embedded systems with plenty |
12 |
> > > of space. |
13 |
> |
14 |
> (embedded with plenty of space? kinda funny) If you had plenty of space |
15 |
> then chances are you would be going the net-tools route. |
16 |
|
17 |
ugh, seems there was a bit fallen over when I typed the mail ;-o |
18 |
Of course: s/plenty/little/; |
19 |
|
20 |
<snip> |
21 |
|
22 |
> > It would be even more interesting if you could get it into busybox |
23 |
> > and/or get it into portage. |
24 |
> |
25 |
> busybox absolutely seems the ideal place for cut out utils. |
26 |
> mii-tool is a handy one also. |
27 |
|
28 |
It would be good to have an simple API for writing such commandlets, |
29 |
so that they can be easily built standalone or compiled in into |
30 |
larger utils like busybox without changes in the source. Maybe a well |
31 |
defined set of preprocessor symbols / macros could easily do the job. |
32 |
|
33 |
For example: |
34 |
|
35 |
|
36 |
#include "commandlet.h" |
37 |
|
38 |
#ifdef CMDLET_MAIN_MODIFIER |
39 |
CMDLET_MAIN_MODIFIER |
40 |
#endif |
41 |
int |
42 |
#ifdef CMDLET_MAIN_NAME |
43 |
CMDLET_MAIN_NAME |
44 |
#else |
45 |
main |
46 |
#endif |
47 |
(int argc, char** argv); |
48 |
{ |
49 |
|
50 |
} |
51 |
|
52 |
|
53 |
|
54 |
When built within some shell, we pass -DCMDLET_MAIN_NAME=... |
55 |
so that the surrounding code (makefile ?) can control how the |
56 |
main function is named (ie. foo_main() instead of main()). |
57 |
By defining CMDLET_MAIN_MODIFIER we can add something to |
58 |
the function declaration, ie "static". |
59 |
|
60 |
|
61 |
... |
62 |
|
63 |
|
64 |
cu |
65 |
-- |
66 |
--------------------------------------------------------------------- |
67 |
Enrico Weigelt == metux IT service |
68 |
|
69 |
phone: +49 36207 519931 www: http://www.metux.de/ |
70 |
fax: +49 36207 519932 email: contact@×××××.de |
71 |
cellphone: +49 174 7066481 |
72 |
--------------------------------------------------------------------- |
73 |
-- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops -- |
74 |
--------------------------------------------------------------------- |
75 |
-- |
76 |
gentoo-embedded@g.o mailing list |