Mercurial > hg > toybox
comparison toys/posix/ln.c @ 674:7e846e281e38
New build infrastructure to generate FLAG_ macros and TT alias, #define FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 08 Oct 2012 00:02:30 -0500 |
parents | 6df4ccc0acbe |
children | 786841fdb1e0 |
comparison
equal
deleted
inserted
replaced
673:c102f31a753e | 674:7e846e281e38 |
---|---|
20 -s Create a symbolic link | 20 -s Create a symbolic link |
21 -f Force the creation of the link, even if TO already exists | 21 -f Force the creation of the link, even if TO already exists |
22 -n Symlink at destination treated as file | 22 -n Symlink at destination treated as file |
23 */ | 23 */ |
24 | 24 |
25 #define FOR_ln | |
25 #include "toys.h" | 26 #include "toys.h" |
26 | |
27 #define FLAG_s 1 | |
28 #define FLAG_f 2 | |
29 #define FLAG_n 4 | |
30 | 27 |
31 void ln_main(void) | 28 void ln_main(void) |
32 { | 29 { |
33 char *dest = toys.optargs[--toys.optc], *new; | 30 char *dest = toys.optargs[--toys.optc], *new; |
34 struct stat buf; | 31 struct stat buf; |