diff --git a/examples/adc/adc_main.c b/examples/adc/adc_main.c index e78c00eac..d7e341e4e 100644 --- a/examples/adc/adc_main.c +++ b/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/examples/buttons/buttons_main.c b/examples/buttons/buttons_main.c index 987ab8559..c8b27d680 100644 --- a/examples/buttons/buttons_main.c +++ b/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/examples/can/can_main.c b/examples/can/can_main.c index b3dd5aa48..63009f8aa 100644 --- a/examples/can/can_main.c +++ b/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/examples/cc3000/cc3000basic.c b/examples/cc3000/cc3000basic.c index 260c6f821..739d91796 100644 --- a/examples/cc3000/cc3000basic.c +++ b/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/examples/cc3000/shell.c b/examples/cc3000/shell.c index 084302b7a..616c75154 100644 --- a/examples/cc3000/shell.c +++ b/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/examples/configdata/configdata_main.c b/examples/configdata/configdata_main.c index a2d887a66..1d91ced72 100644 --- a/examples/configdata/configdata_main.c +++ b/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/examples/cpuhog/cpuhog_main.c b/examples/cpuhog/cpuhog_main.c index 486895065..729a38aa1 100644 --- a/examples/cpuhog/cpuhog_main.c +++ b/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/examples/dhcpd/target.c b/examples/dhcpd/target.c index 1a1359c8d..190a08240 100644 --- a/examples/dhcpd/target.c +++ b/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/examples/discover/discover_main.c b/examples/discover/discover_main.c index 3995c475e..e64e7f011 100644 --- a/examples/discover/discover_main.c +++ b/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/examples/elf/elf_main.c b/examples/elf/elf_main.c index 88c6e804f..d14ebe659 100644 --- a/examples/elf/elf_main.c +++ b/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/examples/flash_test/flash_test.c b/examples/flash_test/flash_test.c index 92821040b..2b67010e2 100644 --- a/examples/flash_test/flash_test.c +++ b/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/examples/ftpc/ftpc_main.c b/examples/ftpc/ftpc_main.c index a66895e22..4175c780e 100644 --- a/examples/ftpc/ftpc_main.c +++ b/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/examples/ftpd/ftpd_main.c b/examples/ftpd/ftpd_main.c index 8054c3207..e26492324 100644 --- a/examples/ftpd/ftpd_main.c +++ b/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/examples/hello/hello_main.c b/examples/hello/hello_main.c index 95961545c..f73c7adff 100644 --- a/examples/hello/hello_main.c +++ b/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/examples/hidkbd/hidkbd_main.c b/examples/hidkbd/hidkbd_main.c index f1885744f..da4eed453 100644 --- a/examples/hidkbd/hidkbd_main.c +++ b/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/examples/i2schar/i2schar_main.c b/examples/i2schar/i2schar_main.c index fa5806cf9..f2a60d5c6 100644 --- a/examples/i2schar/i2schar_main.c +++ b/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/examples/igmp/igmp.c b/examples/igmp/igmp.c index 61272bf3c..b7830d45a 100644 --- a/examples/igmp/igmp.c +++ b/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/examples/json/json_main.c b/examples/json/json_main.c index 26e6b2855..555ae74f8 100644 --- a/examples/json/json_main.c +++ b/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/examples/keypadtest/keypadtest_main.c b/examples/keypadtest/keypadtest_main.c index dd7369c3e..78c9bc601 100644 --- a/examples/keypadtest/keypadtest_main.c +++ b/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/examples/lcdrw/lcdrw_main.c b/examples/lcdrw/lcdrw_main.c index 709859d1b..0b696a97a 100644 --- a/examples/lcdrw/lcdrw_main.c +++ b/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/examples/mm/mm_main.c b/examples/mm/mm_main.c index bf7e1f06d..2f51d519b 100644 --- a/examples/mm/mm_main.c +++ b/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/examples/modbus/modbus_main.c b/examples/modbus/modbus_main.c index 7ff2b5b21..c89b579a7 100644 --- a/examples/modbus/modbus_main.c +++ b/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/examples/mount/mount_main.c b/examples/mount/mount_main.c index b1615677a..605092c97 100644 --- a/examples/mount/mount_main.c +++ b/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/examples/mtdpart/mtdpart_main.c b/examples/mtdpart/mtdpart_main.c index 2dca73ff3..c99440baf 100644 --- a/examples/mtdpart/mtdpart_main.c +++ b/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/examples/netpkt/netpkt_main.c b/examples/netpkt/netpkt_main.c index b833a4a14..671aad080 100644 --- a/examples/netpkt/netpkt_main.c +++ b/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/examples/nettest/nettest.c b/examples/nettest/nettest.c index a24ce30f4..1db57744e 100644 --- a/examples/nettest/nettest.c +++ b/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/examples/nrf24l01_term/nrf24l01_term.c b/examples/nrf24l01_term/nrf24l01_term.c index 24d6a23ae..db4d56cc8 100644 --- a/examples/nrf24l01_term/nrf24l01_term.c +++ b/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/examples/nsh/nsh_main.c b/examples/nsh/nsh_main.c index a6ce3442b..e2c639469 100644 --- a/examples/nsh/nsh_main.c +++ b/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/examples/null/null_main.c b/examples/null/null_main.c index c4624bd1d..52032d0b3 100644 --- a/examples/null/null_main.c +++ b/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/examples/nx/nx_main.c b/examples/nx/nx_main.c index 17e70e205..3ac70ef15 100644 --- a/examples/nx/nx_main.c +++ b/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/examples/nxconsole/nxcon_main.c b/examples/nxconsole/nxcon_main.c index 550ce4912..c176f9b3e 100644 --- a/examples/nxconsole/nxcon_main.c +++ b/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/examples/nxffs/nxffs_main.c b/examples/nxffs/nxffs_main.c index 443ef52fe..54eb6c82f 100644 --- a/examples/nxffs/nxffs_main.c +++ b/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/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index b47b76771..4fce16585 100644 --- a/examples/nxflat/nxflat_main.c +++ b/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/examples/nxhello/nxhello_main.c b/examples/nxhello/nxhello_main.c index 23288da7d..25e465e5a 100644 --- a/examples/nxhello/nxhello_main.c +++ b/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/examples/nximage/nximage_main.c b/examples/nximage/nximage_main.c index a32ea2a89..2c8591a61 100644 --- a/examples/nximage/nximage_main.c +++ b/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/examples/nxlines/nxlines_main.c b/examples/nxlines/nxlines_main.c index d9512391e..6b2bc049b 100644 --- a/examples/nxlines/nxlines_main.c +++ b/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/examples/nxtext/nxtext_main.c b/examples/nxtext/nxtext_main.c index 9aa2a810e..6e68dd9e2 100644 --- a/examples/nxtext/nxtext_main.c +++ b/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/examples/ostest/ostest_main.c b/examples/ostest/ostest_main.c index 8e78e5d2d..c923c23fe 100644 --- a/examples/ostest/ostest_main.c +++ b/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/examples/ostest/restart.c b/examples/ostest/restart.c index 703dbd90e..7cbdd25d3 100644 --- a/examples/ostest/restart.c +++ b/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/examples/ostest/sighand.c b/examples/ostest/sighand.c index ea9775e01..82c87b120 100644 --- a/examples/ostest/sighand.c +++ b/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/examples/ostest/waitpid.c b/examples/ostest/waitpid.c index 6b6de7908..f31a25543 100644 --- a/examples/ostest/waitpid.c +++ b/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/examples/pashello/pashello.c b/examples/pashello/pashello.c index 731bd7e37..d6b45c03e 100644 --- a/examples/pashello/pashello.c +++ b/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/examples/pipe/pipe_main.c b/examples/pipe/pipe_main.c index 9ada9af5f..623265600 100644 --- a/examples/pipe/pipe_main.c +++ b/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/examples/poll/poll_main.c b/examples/poll/poll_main.c index 0c475fa7a..6cdb5a574 100644 --- a/examples/poll/poll_main.c +++ b/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/examples/posix_spawn/spawn_main.c b/examples/posix_spawn/spawn_main.c index dff0f7c1e..a30ea3ff2 100644 --- a/examples/posix_spawn/spawn_main.c +++ b/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/examples/pwm/pwm_main.c b/examples/pwm/pwm_main.c index 956ff04c5..e264b9927 100644 --- a/examples/pwm/pwm_main.c +++ b/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/examples/qencoder/qe_main.c b/examples/qencoder/qe_main.c index cad5ceb7d..2b4a34136 100644 --- a/examples/qencoder/qe_main.c +++ b/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/examples/random/random_main.c b/examples/random/random_main.c index ea8a3abc0..ade152225 100644 --- a/examples/random/random_main.c +++ b/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/examples/relays/relays_main.c b/examples/relays/relays_main.c index 941ac2302..74397b942 100644 --- a/examples/relays/relays_main.c +++ b/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/examples/rgmp/rgmp_main.c b/examples/rgmp/rgmp_main.c index 1cf5a56c7..57dbbb543 100644 --- a/examples/rgmp/rgmp_main.c +++ b/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/examples/romfs/romfs_main.c b/examples/romfs/romfs_main.c index 980bd4455..86e4062b3 100644 --- a/examples/romfs/romfs_main.c +++ b/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/examples/sendmail/target.c b/examples/sendmail/target.c index 684f2b742..4424093da 100644 --- a/examples/sendmail/target.c +++ b/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/examples/serialblaster/serialblaster_main.c b/examples/serialblaster/serialblaster_main.c index 88d8ebf84..c5356156c 100644 --- a/examples/serialblaster/serialblaster_main.c +++ b/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/examples/serialrx/serialrx_main.c b/examples/serialrx/serialrx_main.c index fcf2f49a4..7b081cc7e 100644 --- a/examples/serialrx/serialrx_main.c +++ b/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/examples/serloop/serloop_main.c b/examples/serloop/serloop_main.c index af171fef3..5c1a768af 100644 --- a/examples/serloop/serloop_main.c +++ b/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/examples/slcd/slcd_main.c b/examples/slcd/slcd_main.c index ecdd4a2b2..6e738fc37 100644 --- a/examples/slcd/slcd_main.c +++ b/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/examples/smart/smart_main.c b/examples/smart/smart_main.c index d01f814f3..c2c0f663d 100644 --- a/examples/smart/smart_main.c +++ b/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/examples/smart_test/smart_test.c b/examples/smart_test/smart_test.c index bffb04c2c..a375cc6c4 100644 --- a/examples/smart_test/smart_test.c +++ b/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/examples/tcpecho/tcpecho_main.c b/examples/tcpecho/tcpecho_main.c index 9e9333e52..988778e4f 100644 --- a/examples/tcpecho/tcpecho_main.c +++ b/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/examples/telnetd/telnetd.c b/examples/telnetd/telnetd.c index 2541f96ef..a54d2f3b6 100644 --- a/examples/telnetd/telnetd.c +++ b/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/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c index c2e6325a7..868f43438 100644 --- a/examples/thttpd/thttpd_main.c +++ b/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/examples/tiff/tiff_main.c b/examples/tiff/tiff_main.c index d3169d149..82a579878 100644 --- a/examples/tiff/tiff_main.c +++ b/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/examples/touchscreen/tc_main.c b/examples/touchscreen/tc_main.c index 6a1e62d5f..13a16f660 100644 --- a/examples/touchscreen/tc_main.c +++ b/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/examples/udp/target.c b/examples/udp/target.c index ac76aec00..835219887 100644 --- a/examples/udp/target.c +++ b/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/examples/usbserial/usbserial_main.c b/examples/usbserial/usbserial_main.c index dc7e1959a..c6ec48113 100644 --- a/examples/usbserial/usbserial_main.c +++ b/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/examples/usbterm/usbterm_main.c b/examples/usbterm/usbterm_main.c index 4d25ad1ce..3a74fa1cc 100644 --- a/examples/usbterm/usbterm_main.c +++ b/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/examples/watchdog/watchdog_main.c b/examples/watchdog/watchdog_main.c index 5dbf4aee4..2ae3a8a33 100644 --- a/examples/watchdog/watchdog_main.c +++ b/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/examples/webserver/webserver_main.c b/examples/webserver/webserver_main.c index 58e8757ea..e4273c9e4 100644 --- a/examples/webserver/webserver_main.c +++ b/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/examples/wget/target.c b/examples/wget/target.c index 8d04bd769..5ffeb8b61 100644 --- a/examples/wget/target.c +++ b/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/examples/wgetjson/wgetjson_main.c b/examples/wgetjson/wgetjson_main.c index ac7062577..9896a1e1c 100644 --- a/examples/wgetjson/wgetjson_main.c +++ b/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/examples/xmlrpc/xmlrpc_main.c b/examples/xmlrpc/xmlrpc_main.c index 228855e1e..e0ee65467 100644 --- a/examples/xmlrpc/xmlrpc_main.c +++ b/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; diff --git a/graphics/screenshot/screenshot_main.c b/graphics/screenshot/screenshot_main.c index c058081a7..71fbcb5d0 100644 --- a/graphics/screenshot/screenshot_main.c +++ b/graphics/screenshot/screenshot_main.c @@ -226,7 +226,11 @@ int save_screenshot(FAR const char *filename) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int screenshot_main(int argc, char *argv[]) +#endif { if (argc != 2) { diff --git a/netutils/thttpd/thttpd.c b/netutils/thttpd/thttpd.c index 6611b2e3b..80a6d8486 100644 --- a/netutils/thttpd/thttpd.c +++ b/netutils/thttpd/thttpd.c @@ -651,7 +651,11 @@ static void occasional(ClientData client_data, struct timeval *nowP) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int thttpd_main(int argc, char **argv) +#endif { int num_ready; int cnum; diff --git a/system/cdcacm/cdcacm_main.c b/system/cdcacm/cdcacm_main.c index 724e8fd14..ee6b545ac 100644 --- a/system/cdcacm/cdcacm_main.c +++ b/system/cdcacm/cdcacm_main.c @@ -79,7 +79,11 @@ struct cdcacm_state_s g_cdcacm; * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int sercon_main(int argc, char *argv[]) +#endif { int ret; @@ -118,10 +122,14 @@ int sercon_main(int argc, char *argv[]) * * Description: * This is a program entry point that will disconnect the CDC/ACM serial +#ifdef CONFIG_BUILD_KERNEL * device. +int main(int argc, FAR char **argv) * +#else ****************************************************************************/ +#endif int serdis_main(int argc, char *argv[]) { /* First check if the USB mass storage device is already connected */ diff --git a/system/composite/composite_main.c b/system/composite/composite_main.c index 5bba46132..c4ab61855 100644 --- a/system/composite/composite_main.c +++ b/system/composite/composite_main.c @@ -673,7 +673,11 @@ void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int conn_main(int argc, char *argv[]) +#endif { int ret; @@ -822,10 +826,14 @@ errout: * device. This program is only available if CONFIG_NSH_BUILTIN_APPS * is defined in the NuttX configuration. In that case, this program can * be executed by entering the "msdis" command at the NSH console. +#ifdef CONFIG_BUILD_KERNEL * +int main(int argc, FAR char **argv) ****************************************************************************/ +#else #ifdef CONFIG_NSH_BUILTIN_APPS +#endif int disconn_main(int argc, char *argv[]) { /* First check if the USB mass storage device is already connected */ diff --git a/system/flash_eraseall/flash_eraseall.c b/system/flash_eraseall/flash_eraseall.c index 824360c33..8e744f746 100644 --- a/system/flash_eraseall/flash_eraseall.c +++ b/system/flash_eraseall/flash_eraseall.c @@ -58,7 +58,11 @@ * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int flash_eraseall_main(int argc, char *argv[]) +#endif { /* Argument given? */ diff --git a/system/free/free.c b/system/free/free.c index 3132be5ed..efaa8a227 100644 --- a/system/free/free.c +++ b/system/free/free.c @@ -97,7 +97,11 @@ static void free_getprogmeminfo(struct mallinfo * mem) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int free_main(int argc, char **argv) +#endif { struct mallinfo data; struct mallinfo prog; diff --git a/system/hex2bin/hex2bin_main.c b/system/hex2bin/hex2bin_main.c index 4743eda0a..b35ecca19 100644 --- a/system/hex2bin/hex2bin_main.c +++ b/system/hex2bin/hex2bin_main.c @@ -117,7 +117,11 @@ static void show_usage(FAR const char *progname, int exitcode) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int hex2bin_main(int argc, char **argv) +#endif { struct lib_stdinstream_s stdinstream; struct lib_stdsostream_s stdoutstream; diff --git a/system/hex2bin/hex2mem_main.c b/system/hex2bin/hex2mem_main.c index b8b814d60..39560055a 100644 --- a/system/hex2bin/hex2mem_main.c +++ b/system/hex2bin/hex2mem_main.c @@ -112,7 +112,11 @@ static void show_usage(FAR const char *progname, int exitcode) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int hex2mem_main(int argc, char **argv) +#endif { struct lib_stdinstream_s stdinstream; struct lib_memsostream_s memoutstream; diff --git a/system/i2c/i2c_main.c b/system/i2c/i2c_main.c index 47e60ec1d..136ccfc04 100644 --- a/system/i2c/i2c_main.c +++ b/system/i2c/i2c_main.c @@ -351,7 +351,11 @@ static void i2c_teardown(FAR struct i2ctool_s *i2ctool) * Name: i2c_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int i2c_main(int argc, char *argv[]) +#endif { /* Verify settings */ diff --git a/system/install/install.c b/system/install/install.c index fe0c467f7..3b2ea4245 100644 --- a/system/install/install.c +++ b/system/install/install.c @@ -330,7 +330,11 @@ static int install_remove(const char *scriptname) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int install_main(int argc, char *argv[]) +#endif { int i; int progsize; diff --git a/system/mdio/mdio_main.c b/system/mdio/mdio_main.c index 31419b0ef..e896cbcd8 100644 --- a/system/mdio/mdio_main.c +++ b/system/mdio/mdio_main.c @@ -159,7 +159,11 @@ int set_phy_reg(uint16_t phy_id, uint16_t reg_num, uint16_t val) * mdio_main ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int mdio_main(int argc, char *argv[]) +#endif { int ret; int i; diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index 48a9a2bfa..6b2502c29 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -591,7 +591,11 @@ static int nxplayer_cmd_help(FAR struct nxplayer_s *pPlayer, char* parg) * **************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int nxplayer_main(int argc, char *argv[]) +#endif { char buffer[64]; int len, x, running; diff --git a/system/poweroff/poweroff.c b/system/poweroff/poweroff.c index 916936a80..3d050bbcb 100644 --- a/system/poweroff/poweroff.c +++ b/system/poweroff/poweroff.c @@ -43,7 +43,11 @@ * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int poweroff_main(int argc, char *argv[]) +#endif { /* TODO: * - replace this by sending general system signal to shutdown, where i.e. nsh diff --git a/system/prun/pexec_main.c b/system/prun/pexec_main.c index 0b6b61939..74771f0c0 100644 --- a/system/prun/pexec_main.c +++ b/system/prun/pexec_main.c @@ -81,7 +81,11 @@ static void show_usage(FAR const char *progname, int errcode) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int pexec_main(int argc, FAR char **argv) +#endif { FAR char *filename = NULL; FAR char *endptr; diff --git a/system/ramtest/ramtest.c b/system/ramtest/ramtest.c index fb3519a13..02ba1151e 100644 --- a/system/ramtest/ramtest.c +++ b/system/ramtest/ramtest.c @@ -556,7 +556,11 @@ static void addr_in_addr(FAR struct ramtest_s *info) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int ramtest_main(int argc, char **argv) +#endif { struct ramtest_s info; diff --git a/system/ramtron/ramtron.c b/system/ramtron/ramtron.c index f769a7ea7..52cfd7d6d 100644 --- a/system/ramtron/ramtron.c +++ b/system/ramtron/ramtron.c @@ -83,7 +83,11 @@ int ramtron_start(int spino) } +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int ramtron_main(int argc, char *argv[]) +#endif { int spino; diff --git a/system/sdcard/sdcard.c b/system/sdcard/sdcard.c index fba01c3ae..708ca4676 100644 --- a/system/sdcard/sdcard.c +++ b/system/sdcard/sdcard.c @@ -104,7 +104,11 @@ static int sdcard_start(int slotno) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int sdcard_main(int argc, char *argv[]) +#endif { int slotno = 0; diff --git a/system/sudoku/sudoku.c b/system/sudoku/sudoku.c index 80fbfbc82..69a9b7a60 100755 --- a/system/sudoku/sudoku.c +++ b/system/sudoku/sudoku.c @@ -500,7 +500,11 @@ static inline void count_cells(void) * Private Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int sudoku_main(int argc, char **argv, char **envp) +#endif { int cmd; int nchanged; diff --git a/system/sysinfo/sysinfo.c b/system/sysinfo/sysinfo.c index 858567586..734c94233 100644 --- a/system/sysinfo/sysinfo.c +++ b/system/sysinfo/sysinfo.c @@ -55,7 +55,11 @@ * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int sysinfo_main(int argc, char *argv[]) +#endif { printf("System Information:\n"); printf("\tNuttX Version:\t" CONFIG_VERSION_STRING diff --git a/system/usbmsc/usbmsc_main.c b/system/usbmsc/usbmsc_main.c index 39eaebeff..1e5a314ae 100644 --- a/system/usbmsc/usbmsc_main.c +++ b/system/usbmsc/usbmsc_main.c @@ -389,7 +389,11 @@ static int usbmsc_enumerate(struct usbtrace_s *trace, void *arg) * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int msconn_main(int argc, char *argv[]) +#endif { FAR void *handle; int ret; @@ -568,10 +572,14 @@ int msconn_main(int argc, char *argv[]) * device. This program is only available if CONFIG_NSH_BUILTIN_APPS * is defined in the NuttX configuration. In that case, this program can * be executed by entering the "msdis" command at the NSH console. +#ifdef CONFIG_BUILD_KERNEL * +int main(int argc, FAR char **argv) ****************************************************************************/ +#else #ifdef CONFIG_NSH_BUILTIN_APPS +#endif int msdis_main(int argc, char *argv[]) { /* First check if the USB mass storage device is already connected */ diff --git a/system/vi/vi.c b/system/vi/vi.c index 35b2a8610..b1e7fecdb 100644 --- a/system/vi/vi.c +++ b/system/vi/vi.c @@ -3569,7 +3569,11 @@ static void vi_showusage(FAR struct vi_s *vi, FAR const char *progname, * ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int vi_main(int argc, char **argv) +#endif { FAR struct vi_s *vi; int option; diff --git a/system/zmodem/rz_main.c b/system/zmodem/rz_main.c index a7d475e2f..cd1f57ed8 100644 --- a/system/zmodem/rz_main.c +++ b/system/zmodem/rz_main.c @@ -70,7 +70,11 @@ static void show_usage(FAR const char *progname, int errcode) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int rz_main(int argc, FAR char **argv) +#endif { ZMRHANDLE handle; FAR const char *devname = CONFIG_SYSTEM_ZMODEM_DEVNAME; diff --git a/system/zmodem/sz_main.c b/system/zmodem/sz_main.c index e20af9e97..863ad8588 100644 --- a/system/zmodem/sz_main.c +++ b/system/zmodem/sz_main.c @@ -89,7 +89,11 @@ static void show_usage(FAR const char *progname, int errcode) * Public Functions ****************************************************************************/ +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char **argv) +#else int sz_main(int argc, FAR char **argv) +#endif { enum zm_xfertype_e xfrtype = XM_XFERTYPE_NORMAL; enum zm_option_e xfroption = XM_OPTION_REPLACE;