diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-06 09:19:15 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-06 09:19:15 -0600 |
commit | 47bea0e67e4093d4482e8781782b98abda134801 (patch) | |
tree | 950f50b0f2119e9785e89becdaf239bb298d5146 /apps/examples | |
parent | dfbcec0bde2500b34356050537ca9d85c694412b (diff) | |
download | px4-nuttx-47bea0e67e4093d4482e8781782b98abda134801.tar.gz px4-nuttx-47bea0e67e4093d4482e8781782b98abda134801.tar.bz2 px4-nuttx-47bea0e67e4093d4482e8781782b98abda134801.zip |
With kernel build, entry point to all tasks is main, not some xyz_main
Diffstat (limited to 'apps/examples')
71 files changed, 288 insertions, 0 deletions
diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c index e78c00eac..d7e341e4e 100644 --- a/apps/examples/adc/adc_main.c +++ b/apps/examples/adc/adc_main.c @@ -227,7 +227,11 @@ static void parse_args(FAR struct adc_state_s *adc, int argc, FAR char **argv) * Name: adc_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int adc_main(int argc, char *argv[]) +#endif { struct adc_msg_s sample[CONFIG_EXAMPLES_ADC_GROUPSIZE]; size_t readsize; diff --git a/apps/examples/buttons/buttons_main.c b/apps/examples/buttons/buttons_main.c index 987ab8559..c8b27d680 100644 --- a/apps/examples/buttons/buttons_main.c +++ b/apps/examples/buttons/buttons_main.c @@ -394,7 +394,11 @@ static int button7_handler(int irq, FAR void *context) * buttons_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int buttons_main(int argc, char *argv[]) +#endif { uint8_t newset; irqstate_t flags; diff --git a/apps/examples/can/can_main.c b/apps/examples/can/can_main.c index b3dd5aa48..63009f8aa 100644 --- a/apps/examples/can/can_main.c +++ b/apps/examples/can/can_main.c @@ -104,7 +104,11 @@ * Name: can_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int can_main(int argc, char *argv[]) +#endif { #ifndef CONFIG_EXAMPLES_CAN_READONLY struct can_msg_s txmsg; diff --git a/apps/examples/cc3000/cc3000basic.c b/apps/examples/cc3000/cc3000basic.c index 260c6f821..739d91796 100644 --- a/apps/examples/cc3000/cc3000basic.c +++ b/apps/examples/cc3000/cc3000basic.c @@ -957,7 +957,11 @@ void ShowInformation(void) printf(" Connected to SSID: %s\n", localB); } +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int c3b_main(int argc, char *argv[]) +#endif { char ch='0'; diff --git a/apps/examples/cc3000/shell.c b/apps/examples/cc3000/shell.c index 084302b7a..616c75154 100644 --- a/apps/examples/cc3000/shell.c +++ b/apps/examples/cc3000/shell.c @@ -200,7 +200,11 @@ static void shell_netinit(void) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int shell_main(int argc, char *argv[]) +#endif { struct telnetd_config_s config; int ret; diff --git a/apps/examples/configdata/configdata_main.c b/apps/examples/configdata/configdata_main.c index a2d887a66..1d91ced72 100644 --- a/apps/examples/configdata/configdata_main.c +++ b/apps/examples/configdata/configdata_main.c @@ -624,7 +624,11 @@ static int configdata_cleardeleted(void) * Name: configdata_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int configdata_main(int argc, char *argv[]) +#endif { unsigned int i; int ret; diff --git a/apps/examples/cpuhog/cpuhog_main.c b/apps/examples/cpuhog/cpuhog_main.c index 486895065..729a38aa1 100644 --- a/apps/examples/cpuhog/cpuhog_main.c +++ b/apps/examples/cpuhog/cpuhog_main.c @@ -96,7 +96,11 @@ static struct state_s * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int cpuhog_main(int argc, char *argv[]) +#endif { int id = -1; char buf[256]; diff --git a/apps/examples/dhcpd/target.c b/apps/examples/dhcpd/target.c index 1a1359c8d..190a08240 100644 --- a/apps/examples/dhcpd/target.c +++ b/apps/examples/dhcpd/target.c @@ -89,7 +89,11 @@ * Name: dhcpd_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int dhcpd_main(int argc, char *argv[]) +#endif { struct in_addr addr; #if defined(CONFIG_EXAMPLES_DHCPD_NOMAC) diff --git a/apps/examples/discover/discover_main.c b/apps/examples/discover/discover_main.c index 3995c475e..e64e7f011 100644 --- a/apps/examples/discover/discover_main.c +++ b/apps/examples/discover/discover_main.c @@ -85,7 +85,11 @@ * discover_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int discover_main(int argc, char *argv[]) +#endif { /* If this task is excecutated as an NSH built-in function, then the * network has already been configured by NSH's start-up logic. diff --git a/apps/examples/elf/elf_main.c b/apps/examples/elf/elf_main.c index 88c6e804f..d14ebe659 100644 --- a/apps/examples/elf/elf_main.c +++ b/apps/examples/elf/elf_main.c @@ -215,7 +215,11 @@ static inline void testheader(FAR const char *progname) * Name: elf_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int elf_main(int argc, char *argv[]) +#endif { struct binary_s bin; int ret; diff --git a/apps/examples/flash_test/flash_test.c b/apps/examples/flash_test/flash_test.c index 92821040b..2b67010e2 100644 --- a/apps/examples/flash_test/flash_test.c +++ b/apps/examples/flash_test/flash_test.c @@ -61,7 +61,11 @@ * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int flash_test_main(int argc, char *argv[]) +#endif { struct inode* inode; int ret; diff --git a/apps/examples/ftpc/ftpc_main.c b/apps/examples/ftpc/ftpc_main.c index a66895e22..4175c780e 100644 --- a/apps/examples/ftpc/ftpc_main.c +++ b/apps/examples/ftpc/ftpc_main.c @@ -355,7 +355,11 @@ int ftpc_parse(SESSION handle, char *cmdline) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int ftpc_main(int argc, char **argv, char **envp) +#endif { struct ftpc_connect_s connect = {{0}, 0}; SESSION handle; diff --git a/apps/examples/ftpd/ftpd_main.c b/apps/examples/ftpd/ftpd_main.c index 8054c3207..e26492324 100644 --- a/apps/examples/ftpd/ftpd_main.c +++ b/apps/examples/ftpd/ftpd_main.c @@ -221,7 +221,11 @@ int ftpd_daemon(int s_argc, char **s_argv) * Name: ftpd_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int ftpd_main(int s_argc, char **s_argv) +#endif { /* Check if we have already initialized the network */ diff --git a/apps/examples/hello/hello_main.c b/apps/examples/hello/hello_main.c index 95961545c..f73c7adff 100644 --- a/apps/examples/hello/hello_main.c +++ b/apps/examples/hello/hello_main.c @@ -56,7 +56,11 @@ * hello_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int hello_main(int argc, char *argv[]) +#endif { printf("Hello, World!!\n"); return 0; diff --git a/apps/examples/hidkbd/hidkbd_main.c b/apps/examples/hidkbd/hidkbd_main.c index f1885744f..da4eed453 100644 --- a/apps/examples/hidkbd/hidkbd_main.c +++ b/apps/examples/hidkbd/hidkbd_main.c @@ -276,7 +276,11 @@ static int hidkbd_waiter(int argc, char *argv[]) * Name: hidkbd_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int hidkbd_main(int argc, char *argv[]) +#endif { char buffer[256]; pid_t pid; diff --git a/apps/examples/i2schar/i2schar_main.c b/apps/examples/i2schar/i2schar_main.c index fa5806cf9..f2a60d5c6 100644 --- a/apps/examples/i2schar/i2schar_main.c +++ b/apps/examples/i2schar/i2schar_main.c @@ -236,7 +236,11 @@ static void parse_args(FAR struct i2schar_state_s *i2schar, int argc, FAR char * * Name: i2schar_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int i2schar_main(int argc, char *argv[]) +#endif { pthread_attr_t attr; pthread_addr_t result; diff --git a/apps/examples/igmp/igmp.c b/apps/examples/igmp/igmp.c index 61272bf3c..b7830d45a 100644 --- a/apps/examples/igmp/igmp.c +++ b/apps/examples/igmp/igmp.c @@ -83,7 +83,11 @@ * igmp_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int igmp_main(int argc, char *argv[]) +#endif { struct in_addr addr; #if defined(CONFIG_EXAMPLES_IGMP_NOMAC) diff --git a/apps/examples/json/json_main.c b/apps/examples/json/json_main.c index 26e6b2855..555ae74f8 100644 --- a/apps/examples/json/json_main.c +++ b/apps/examples/json/json_main.c @@ -236,7 +236,11 @@ static void create_objects(void) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int json_main(int argc, const char *argv[]) +#endif { /* a bunch of json: */ diff --git a/apps/examples/keypadtest/keypadtest_main.c b/apps/examples/keypadtest/keypadtest_main.c index dd7369c3e..78c9bc601 100644 --- a/apps/examples/keypadtest/keypadtest_main.c +++ b/apps/examples/keypadtest/keypadtest_main.c @@ -193,7 +193,11 @@ static void keypad_decode(FAR char *buffer, ssize_t nbytes) * Name: keypadtest_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int keypadtest_main(int argc, char *argv[]) +#endif { char buffer[256]; ssize_t nbytes; diff --git a/apps/examples/lcdrw/lcdrw_main.c b/apps/examples/lcdrw/lcdrw_main.c index 709859d1b..0b696a97a 100644 --- a/apps/examples/lcdrw/lcdrw_main.c +++ b/apps/examples/lcdrw/lcdrw_main.c @@ -155,7 +155,11 @@ static inline int lcdrw_initialize(FAR struct lcdrw_instance_s *inst) * Name: lcdrw_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int lcdrw_main(int argc, char *argv[]) +#endif { struct lcdrw_instance_s inst; nxgl_coord_t row; diff --git a/apps/examples/mm/mm_main.c b/apps/examples/mm/mm_main.c index bf7e1f06d..2f51d519b 100644 --- a/apps/examples/mm/mm_main.c +++ b/apps/examples/mm/mm_main.c @@ -281,7 +281,11 @@ static void do_frees(void **mem, const int *size, const int *seq, int n) * Name: mm_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int mm_main(int argc, char *argv[]) +#endif { mm_showmallinfo(); diff --git a/apps/examples/modbus/modbus_main.c b/apps/examples/modbus/modbus_main.c index 7ff2b5b21..c89b579a7 100644 --- a/apps/examples/modbus/modbus_main.c +++ b/apps/examples/modbus/modbus_main.c @@ -359,7 +359,11 @@ static void modbus_showusage(FAR const char *progname, int exitcode) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int modbus_main(int argc, char *argv[]) +#endif { int option; int ret; diff --git a/apps/examples/mount/mount_main.c b/apps/examples/mount/mount_main.c index b1615677a..605092c97 100644 --- a/apps/examples/mount/mount_main.c +++ b/apps/examples/mount/mount_main.c @@ -571,7 +571,11 @@ static void succeed_stat(const char *path) * Name: mount_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int mount_main(int argc, char *argv[]) +#endif { int ret; diff --git a/apps/examples/mtdpart/mtdpart_main.c b/apps/examples/mtdpart/mtdpart_main.c index 2dca73ff3..c99440baf 100644 --- a/apps/examples/mtdpart/mtdpart_main.c +++ b/apps/examples/mtdpart/mtdpart_main.c @@ -148,7 +148,11 @@ extern FAR struct mtd_dev_s *mtdpart_archinitialize(void); * Name: mtdpart_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int mtdpart_main(int argc, char *argv[]) +#endif { FAR struct mtd_dev_s *master; FAR struct mtd_dev_s *part[CONFIG_EXAMPLES_MTDPART_NPARTITIONS]; diff --git a/apps/examples/netpkt/netpkt_main.c b/apps/examples/netpkt/netpkt_main.c index b833a4a14..671aad080 100644 --- a/apps/examples/netpkt/netpkt_main.c +++ b/apps/examples/netpkt/netpkt_main.c @@ -129,7 +129,11 @@ static void netpkt_usage(void) * Name: netpkt_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int netpkt_main(int argc, char **argv) +#endif { int sd; int i; diff --git a/apps/examples/nettest/nettest.c b/apps/examples/nettest/nettest.c index a24ce30f4..1db57744e 100644 --- a/apps/examples/nettest/nettest.c +++ b/apps/examples/nettest/nettest.c @@ -67,7 +67,11 @@ * nettest_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nettest_main(int argc, char *argv[]) +#endif { struct in_addr addr; #ifdef CONFIG_EXAMPLES_NETTEST_NOMAC diff --git a/apps/examples/nrf24l01_term/nrf24l01_term.c b/apps/examples/nrf24l01_term/nrf24l01_term.c index 24d6a23ae..db4d56cc8 100644 --- a/apps/examples/nrf24l01_term/nrf24l01_term.c +++ b/apps/examples/nrf24l01_term/nrf24l01_term.c @@ -260,7 +260,11 @@ void usage(void) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nrf24l01_term_main(int argc, char *argv[]) +#endif { int ret; bool quit = false; diff --git a/apps/examples/nsh/nsh_main.c b/apps/examples/nsh/nsh_main.c index a6ce3442b..e2c639469 100644 --- a/apps/examples/nsh/nsh_main.c +++ b/apps/examples/nsh/nsh_main.c @@ -116,7 +116,11 @@ const struct symtab_s CONFIG_EXECFUNCS_SYMTAB[1]; * Name: nsh_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nsh_main(int argc, char *argv[]) +#endif { int exitval = 0; int ret; diff --git a/apps/examples/null/null_main.c b/apps/examples/null/null_main.c index c4624bd1d..52032d0b3 100644 --- a/apps/examples/null/null_main.c +++ b/apps/examples/null/null_main.c @@ -61,7 +61,11 @@ * Name: null_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int null_main(int argc, char *argv[]) +#endif { return 0; } diff --git a/apps/examples/nx/nx_main.c b/apps/examples/nx/nx_main.c index 17e70e205..3ac70ef15 100644 --- a/apps/examples/nx/nx_main.c +++ b/apps/examples/nx/nx_main.c @@ -617,7 +617,11 @@ static int nxeg_initialize(void) * Name: nx_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nx_main(int argc, char *argv[]) +#endif { NXEGWINDOW hwnd1; NXEGWINDOW hwnd2; diff --git a/apps/examples/nxconsole/nxcon_main.c b/apps/examples/nxconsole/nxcon_main.c index 550ce4912..c176f9b3e 100644 --- a/apps/examples/nxconsole/nxcon_main.c +++ b/apps/examples/nxconsole/nxcon_main.c @@ -210,7 +210,11 @@ static int nxcon_task(int argc, char **argv) * Name: nxcon_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxcon_main(int argc, char **argv) +#endif { nxgl_mxpixel_t color; int fd; diff --git a/apps/examples/nxffs/nxffs_main.c b/apps/examples/nxffs/nxffs_main.c index 443ef52fe..54eb6c82f 100644 --- a/apps/examples/nxffs/nxffs_main.c +++ b/apps/examples/nxffs/nxffs_main.c @@ -789,7 +789,11 @@ static int nxffs_directory(void) * Name: nxffs_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxffs_main(int argc, char *argv[]) +#endif { FAR struct mtd_dev_s *mtd; unsigned int i; diff --git a/apps/examples/nxflat/nxflat_main.c b/apps/examples/nxflat/nxflat_main.c index b47b76771..4fce16585 100644 --- a/apps/examples/nxflat/nxflat_main.c +++ b/apps/examples/nxflat/nxflat_main.c @@ -154,7 +154,11 @@ static inline void testheader(FAR const char *progname) * Name: nxflat_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxflat_main(int argc, char *argv[]) +#endif { struct binary_s bin; int ret; diff --git a/apps/examples/nxhello/nxhello_main.c b/apps/examples/nxhello/nxhello_main.c index 23288da7d..25e465e5a 100644 --- a/apps/examples/nxhello/nxhello_main.c +++ b/apps/examples/nxhello/nxhello_main.c @@ -206,7 +206,11 @@ static inline int nxhello_initialize(void) * Name: nxhello_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxhello_main(int argc, char *argv[]) +#endif { nxgl_mxpixel_t color; int ret; diff --git a/apps/examples/nximage/nximage_main.c b/apps/examples/nximage/nximage_main.c index a32ea2a89..2c8591a61 100644 --- a/apps/examples/nximage/nximage_main.c +++ b/apps/examples/nximage/nximage_main.c @@ -214,7 +214,11 @@ static inline int nximage_initialize(void) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nximage_main(int argc, char *argv[]) +#endif { nxgl_mxpixel_t color; int ret; diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c index d9512391e..6b2bc049b 100644 --- a/apps/examples/nxlines/nxlines_main.c +++ b/apps/examples/nxlines/nxlines_main.c @@ -203,7 +203,11 @@ static inline int nxlines_initialize(void) * Name: nxlines_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxlines_main(int argc, char *argv[]) +#endif { nxgl_mxpixel_t color; int ret; diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c index 9aa2a810e..6e68dd9e2 100644 --- a/apps/examples/nxtext/nxtext_main.c +++ b/apps/examples/nxtext/nxtext_main.c @@ -346,7 +346,11 @@ static int nxtext_initialize(void) * Name: nxtext_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxtext_main(int argc, char **argv) +#endif { FAR struct nxtext_state_s *bgstate; NXWINDOW hwnd = NULL; diff --git a/apps/examples/ostest/ostest_main.c b/apps/examples/ostest/ostest_main.c index 8e78e5d2d..c923c23fe 100644 --- a/apps/examples/ostest/ostest_main.c +++ b/apps/examples/ostest/ostest_main.c @@ -223,7 +223,11 @@ static void show_environment(bool var1_valid, bool var2_valid, bool var3_valid) * Name: user_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else static int user_main(int argc, char *argv[]) +#endif { int i; @@ -506,10 +510,14 @@ static void stdio_test(void) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL /**************************************************************************** +int main(int argc, FAR char **argv) * ostest_main +#else ****************************************************************************/ +#endif int ostest_main(int argc, FAR char *argv[]) { int result; diff --git a/apps/examples/ostest/restart.c b/apps/examples/ostest/restart.c index 703dbd90e..7cbdd25d3 100644 --- a/apps/examples/ostest/restart.c +++ b/apps/examples/ostest/restart.c @@ -76,7 +76,11 @@ static bool g_restarted; * Private Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else static int restart_main(int argc, char *argv[]) +#endif { #ifndef CONFIG_DISABLE_ENVIRON char *actual; diff --git a/apps/examples/ostest/sighand.c b/apps/examples/ostest/sighand.c index ea9775e01..82c87b120 100644 --- a/apps/examples/ostest/sighand.c +++ b/apps/examples/ostest/sighand.c @@ -137,7 +137,11 @@ static void wakeup_action(int signo, siginfo_t *info, void *ucontext) } } +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else static int waiter_main(int argc, char *argv[]) +#endif { sigset_t sigset; struct sigaction act; diff --git a/apps/examples/ostest/waitpid.c b/apps/examples/ostest/waitpid.c index 6b6de7908..f31a25543 100644 --- a/apps/examples/ostest/waitpid.c +++ b/apps/examples/ostest/waitpid.c @@ -67,7 +67,11 @@ static int g_waitpids[NCHILDREN]; * Priviate Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else static int waitpid_main(int argc, char *argv[]) +#endif { pid_t me = getpid(); diff --git a/apps/examples/pashello/pashello.c b/apps/examples/pashello/pashello.c index 731bd7e37..d6b45c03e 100644 --- a/apps/examples/pashello/pashello.c +++ b/apps/examples/pashello/pashello.c @@ -75,7 +75,11 @@ * pashello_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int pashello_main(int argc, FAR char *argv[]) +#endif { FAR struct pexec_s *st; int exitcode = EXIT_SUCCESS; diff --git a/apps/examples/pipe/pipe_main.c b/apps/examples/pipe/pipe_main.c index 9ada9af5f..623265600 100644 --- a/apps/examples/pipe/pipe_main.c +++ b/apps/examples/pipe/pipe_main.c @@ -72,7 +72,11 @@ * Name: pipe_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int pipe_main(int argc, char *argv[]) +#endif { int fd[2]; int ret; diff --git a/apps/examples/poll/poll_main.c b/apps/examples/poll/poll_main.c index 0c475fa7a..6cdb5a574 100644 --- a/apps/examples/poll/poll_main.c +++ b/apps/examples/poll/poll_main.c @@ -77,7 +77,11 @@ * Name: poll_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int poll_main(int argc, char *argv[]) +#endif { char buffer[64]; ssize_t nbytes; diff --git a/apps/examples/posix_spawn/spawn_main.c b/apps/examples/posix_spawn/spawn_main.c index dff0f7c1e..a30ea3ff2 100644 --- a/apps/examples/posix_spawn/spawn_main.c +++ b/apps/examples/posix_spawn/spawn_main.c @@ -222,7 +222,11 @@ static inline void testheader(FAR const char *progname) * Name: spawn_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int spawn_main(int argc, char *argv[]) +#endif { posix_spawn_file_actions_t file_actions; posix_spawnattr_t attr; diff --git a/apps/examples/pwm/pwm_main.c b/apps/examples/pwm/pwm_main.c index 956ff04c5..e264b9927 100644 --- a/apps/examples/pwm/pwm_main.c +++ b/apps/examples/pwm/pwm_main.c @@ -273,7 +273,11 @@ static void parse_args(FAR struct pwm_state_s *pwm, int argc, FAR char **argv) * Name: pwm_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int pwm_main(int argc, char *argv[]) +#endif { struct pwm_info_s info; int fd; diff --git a/apps/examples/qencoder/qe_main.c b/apps/examples/qencoder/qe_main.c index cad5ceb7d..2b4a34136 100644 --- a/apps/examples/qencoder/qe_main.c +++ b/apps/examples/qencoder/qe_main.c @@ -240,7 +240,11 @@ static void parse_args(int argc, FAR char **argv) * Name: qe_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int qe_main(int argc, char *argv[]) +#endif { int32_t position; int fd; diff --git a/apps/examples/random/random_main.c b/apps/examples/random/random_main.c index ea8a3abc0..ade152225 100644 --- a/apps/examples/random/random_main.c +++ b/apps/examples/random/random_main.c @@ -76,7 +76,11 @@ * rand_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int rand_main(int argc, char *argv[]) +#endif { uint32_t buffer[CONFIG_EXAMPLES_MAXSAMPLES]; int nsamples = CONFIG_EXAMPLES_NSAMPLES; diff --git a/apps/examples/relays/relays_main.c b/apps/examples/relays/relays_main.c index 941ac2302..74397b942 100644 --- a/apps/examples/relays/relays_main.c +++ b/apps/examples/relays/relays_main.c @@ -85,7 +85,11 @@ * Name: relays_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int relays_main(int argc, char *argv[]) +#endif { char *stat = NULL; char *no = NULL; diff --git a/apps/examples/rgmp/rgmp_main.c b/apps/examples/rgmp/rgmp_main.c index 1cf5a56c7..57dbbb543 100644 --- a/apps/examples/rgmp/rgmp_main.c +++ b/apps/examples/rgmp/rgmp_main.c @@ -57,7 +57,11 @@ * rgmp_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int rgmp_main(int argc, char *argv[]) +#endif { // TODO: add your code here diff --git a/apps/examples/romfs/romfs_main.c b/apps/examples/romfs/romfs_main.c index 980bd4455..86e4062b3 100644 --- a/apps/examples/romfs/romfs_main.c +++ b/apps/examples/romfs/romfs_main.c @@ -455,7 +455,11 @@ static void checkdirectories(struct node_s *entry) * Name: romfs_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int romfs_main(int argc, char *argv[]) +#endif { int ret; diff --git a/apps/examples/sendmail/target.c b/apps/examples/sendmail/target.c index 684f2b742..4424093da 100644 --- a/apps/examples/sendmail/target.c +++ b/apps/examples/sendmail/target.c @@ -106,7 +106,11 @@ static const char g_msg_body[] = CONFIG_EXAMPLES_SENDMAIL_BODY "\r\n"; * sendmail_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int sendmail_main(int argc, char *argv[]) +#endif { struct in_addr addr; #if defined(CONFIG_EXAMPLES_SENDMAIL_NOMAC) diff --git a/apps/examples/serialblaster/serialblaster_main.c b/apps/examples/serialblaster/serialblaster_main.c index 88d8ebf84..c5356156c 100644 --- a/apps/examples/serialblaster/serialblaster_main.c +++ b/apps/examples/serialblaster/serialblaster_main.c @@ -67,7 +67,11 @@ static const char s[] = "abcdefghijklmnopqrstuvwxyz"; * serloop_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int serialblaster_main(int argc, char *argv[]) +#endif { int ret; diff --git a/apps/examples/serialrx/serialrx_main.c b/apps/examples/serialrx/serialrx_main.c index fcf2f49a4..7b081cc7e 100644 --- a/apps/examples/serialrx/serialrx_main.c +++ b/apps/examples/serialrx/serialrx_main.c @@ -69,7 +69,11 @@ static int count = 0; * serloop_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int serialrx_main(int argc, char *argv[]) +#endif { FAR char *buf = (FAR char *)malloc(CHUNK); FAR FILE *f; diff --git a/apps/examples/serloop/serloop_main.c b/apps/examples/serloop/serloop_main.c index af171fef3..5c1a768af 100644 --- a/apps/examples/serloop/serloop_main.c +++ b/apps/examples/serloop/serloop_main.c @@ -59,7 +59,11 @@ * serloop_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int serloop_main(int argc, char *argv[]) +#endif { #ifdef CONFIG_EXAMPLES_SERLOOP_BUFIO int ch; diff --git a/apps/examples/slcd/slcd_main.c b/apps/examples/slcd/slcd_main.c index ecdd4a2b2..6e738fc37 100644 --- a/apps/examples/slcd/slcd_main.c +++ b/apps/examples/slcd/slcd_main.c @@ -246,7 +246,11 @@ static void slcd_puts(FAR struct lib_outstream_s *outstream, * slcd_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int slcd_main(int argc, char *argv[]) +#endif { FAR struct slcd_test_s *priv = &g_slcdtest; FAR const char *str = g_slcdhello; diff --git a/apps/examples/smart/smart_main.c b/apps/examples/smart/smart_main.c index d01f814f3..c2c0f663d 100644 --- a/apps/examples/smart/smart_main.c +++ b/apps/examples/smart/smart_main.c @@ -796,7 +796,11 @@ static int smart_directory(void) * Name: smart_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int smart_main(int argc, char *argv[]) +#endif { FAR struct mtd_dev_s *mtd; unsigned int i; diff --git a/apps/examples/smart_test/smart_test.c b/apps/examples/smart_test/smart_test.c index bffb04c2c..a375cc6c4 100644 --- a/apps/examples/smart_test/smart_test.c +++ b/apps/examples/smart_test/smart_test.c @@ -327,7 +327,11 @@ static int smart_seek_with_write_test(char *filename) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int smart_test_main(int argc, char *argv[]) +#endif { int ret; diff --git a/apps/examples/tcpecho/tcpecho_main.c b/apps/examples/tcpecho/tcpecho_main.c index 9e9333e52..988778e4f 100644 --- a/apps/examples/tcpecho/tcpecho_main.c +++ b/apps/examples/tcpecho/tcpecho_main.c @@ -367,7 +367,11 @@ static int tcpecho_server(void) * discover_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int tcpecho_main(int argc, char *argv[]) +#endif { int ret; diff --git a/apps/examples/telnetd/telnetd.c b/apps/examples/telnetd/telnetd.c index 2541f96ef..a54d2f3b6 100644 --- a/apps/examples/telnetd/telnetd.c +++ b/apps/examples/telnetd/telnetd.c @@ -224,7 +224,11 @@ static void telnetd_netinit(void) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int telnetd_main(int argc, char *argv[]) +#endif { struct telnetd_config_s config; int ret; diff --git a/apps/examples/thttpd/thttpd_main.c b/apps/examples/thttpd/thttpd_main.c index c2e6325a7..868f43438 100644 --- a/apps/examples/thttpd/thttpd_main.c +++ b/apps/examples/thttpd/thttpd_main.c @@ -171,7 +171,11 @@ int g_thttpdnsymbols; * thttp_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int thttp_main(int argc, char *argv[]) +#endif { struct in_addr addr; #ifdef CONFIG_EXAMPLES_THTTPD_NOMAC diff --git a/apps/examples/tiff/tiff_main.c b/apps/examples/tiff/tiff_main.c index d3169d149..82a579878 100644 --- a/apps/examples/tiff/tiff_main.c +++ b/apps/examples/tiff/tiff_main.c @@ -104,7 +104,11 @@ * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int tiff_main(int argc, char *argv[]) +#endif { struct tiff_info_s info; uint8_t strip[3*256]; diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c index 6a1e62d5f..13a16f660 100644 --- a/apps/examples/touchscreen/tc_main.c +++ b/apps/examples/touchscreen/tc_main.c @@ -88,7 +88,11 @@ * Name: tc_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int tc_main(int argc, char *argv[]) +#endif { #ifdef CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE struct mouse_report_s sample; diff --git a/apps/examples/udp/target.c b/apps/examples/udp/target.c index ac76aec00..835219887 100644 --- a/apps/examples/udp/target.c +++ b/apps/examples/udp/target.c @@ -64,7 +64,11 @@ * udp_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int udp_main(int argc, char *argv[]) +#endif { struct in_addr addr; diff --git a/apps/examples/usbserial/usbserial_main.c b/apps/examples/usbserial/usbserial_main.c index dc7e1959a..c6ec48113 100644 --- a/apps/examples/usbserial/usbserial_main.c +++ b/apps/examples/usbserial/usbserial_main.c @@ -201,7 +201,11 @@ static void dumptrace(void) * usbserial_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int usbserial_main(int argc, char *argv[]) +#endif { #ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY int infd; diff --git a/apps/examples/usbterm/usbterm_main.c b/apps/examples/usbterm/usbterm_main.c index 4d25ad1ce..3a74fa1cc 100644 --- a/apps/examples/usbterm/usbterm_main.c +++ b/apps/examples/usbterm/usbterm_main.c @@ -184,7 +184,11 @@ static FAR void *usbterm_listener(FAR void *parameter) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int usbterm_main(int argc, char *argv[]) +#endif { pthread_attr_t attr; int ret; diff --git a/apps/examples/watchdog/watchdog_main.c b/apps/examples/watchdog/watchdog_main.c index 5dbf4aee4..2ae3a8a33 100644 --- a/apps/examples/watchdog/watchdog_main.c +++ b/apps/examples/watchdog/watchdog_main.c @@ -220,7 +220,11 @@ static void parse_args(FAR struct wdog_example_s *wdog, int argc, FAR char **arg * Name: wdog_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int wdog_main(int argc, char *argv[]) +#endif { struct wdog_example_s wdog; #ifdef CONFIG_DEBUG_WATCHDOG diff --git a/apps/examples/webserver/webserver_main.c b/apps/examples/webserver/webserver_main.c index 58e8757ea..e4273c9e4 100644 --- a/apps/examples/webserver/webserver_main.c +++ b/apps/examples/webserver/webserver_main.c @@ -110,7 +110,11 @@ * webserver_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int webserver_main(int argc, char *argv[]) +#endif { struct in_addr addr; #if defined(CONFIG_EXAMPLES_WEBSERVER_DHCPC) || defined(CONFIG_EXAMPLES_WEBSERVER_NOMAC) diff --git a/apps/examples/wget/target.c b/apps/examples/wget/target.c index 8d04bd769..5ffeb8b61 100644 --- a/apps/examples/wget/target.c +++ b/apps/examples/wget/target.c @@ -107,7 +107,11 @@ static void callback(FAR char **buffer, int offset, int datend, * wget_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int wget_main(int argc, char *argv[]) +#endif { struct in_addr addr; #if defined(CONFIG_EXAMPLES_WGET_NOMAC) diff --git a/apps/examples/wgetjson/wgetjson_main.c b/apps/examples/wgetjson/wgetjson_main.c index ac7062577..9896a1e1c 100644 --- a/apps/examples/wgetjson/wgetjson_main.c +++ b/apps/examples/wgetjson/wgetjson_main.c @@ -289,7 +289,11 @@ static int wgetjson_json_parse(char *text) * Name: wgetjson_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int wgetjson_main(int argc, char *argv[]) +#endif { char *buffer = NULL; int buffer_len = 512; diff --git a/apps/examples/xmlrpc/xmlrpc_main.c b/apps/examples/xmlrpc/xmlrpc_main.c index 228855e1e..e0ee65467 100644 --- a/apps/examples/xmlrpc/xmlrpc_main.c +++ b/apps/examples/xmlrpc/xmlrpc_main.c @@ -370,7 +370,11 @@ static int xmlrpc_netinit(void) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int xmlrpc_main(int argc, char *argv[]) +#endif { int listenfd, connfd, on = 1; socklen_t clilen; |