From 47bea0e67e4093d4482e8781782b98abda134801 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 6 Sep 2014 09:19:15 -0600 Subject: With kernel build, entry point to all tasks is main, not some xyz_main --- apps/system/cdcacm/cdcacm_main.c | 8 ++++++++ apps/system/composite/composite_main.c | 8 ++++++++ apps/system/flash_eraseall/flash_eraseall.c | 4 ++++ apps/system/free/free.c | 4 ++++ apps/system/hex2bin/hex2bin_main.c | 4 ++++ apps/system/hex2bin/hex2mem_main.c | 4 ++++ apps/system/i2c/i2c_main.c | 4 ++++ apps/system/install/install.c | 4 ++++ apps/system/mdio/mdio_main.c | 4 ++++ apps/system/nxplayer/nxplayer_main.c | 4 ++++ apps/system/poweroff/poweroff.c | 4 ++++ apps/system/prun/pexec_main.c | 4 ++++ apps/system/ramtest/ramtest.c | 4 ++++ apps/system/ramtron/ramtron.c | 4 ++++ apps/system/sdcard/sdcard.c | 4 ++++ apps/system/sudoku/sudoku.c | 4 ++++ apps/system/sysinfo/sysinfo.c | 4 ++++ apps/system/usbmsc/usbmsc_main.c | 8 ++++++++ apps/system/vi/vi.c | 4 ++++ apps/system/zmodem/rz_main.c | 4 ++++ apps/system/zmodem/sz_main.c | 4 ++++ 21 files changed, 96 insertions(+) (limited to 'apps/system') diff --git a/apps/system/cdcacm/cdcacm_main.c b/apps/system/cdcacm/cdcacm_main.c index 724e8fd14..ee6b545ac 100644 --- a/apps/system/cdcacm/cdcacm_main.c +++ b/apps/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/apps/system/composite/composite_main.c b/apps/system/composite/composite_main.c index 5bba46132..c4ab61855 100644 --- a/apps/system/composite/composite_main.c +++ b/apps/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/apps/system/flash_eraseall/flash_eraseall.c b/apps/system/flash_eraseall/flash_eraseall.c index 824360c33..8e744f746 100644 --- a/apps/system/flash_eraseall/flash_eraseall.c +++ b/apps/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/apps/system/free/free.c b/apps/system/free/free.c index 3132be5ed..efaa8a227 100644 --- a/apps/system/free/free.c +++ b/apps/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/apps/system/hex2bin/hex2bin_main.c b/apps/system/hex2bin/hex2bin_main.c index 4743eda0a..b35ecca19 100644 --- a/apps/system/hex2bin/hex2bin_main.c +++ b/apps/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/apps/system/hex2bin/hex2mem_main.c b/apps/system/hex2bin/hex2mem_main.c index b8b814d60..39560055a 100644 --- a/apps/system/hex2bin/hex2mem_main.c +++ b/apps/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/apps/system/i2c/i2c_main.c b/apps/system/i2c/i2c_main.c index 47e60ec1d..136ccfc04 100644 --- a/apps/system/i2c/i2c_main.c +++ b/apps/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/apps/system/install/install.c b/apps/system/install/install.c index fe0c467f7..3b2ea4245 100644 --- a/apps/system/install/install.c +++ b/apps/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/apps/system/mdio/mdio_main.c b/apps/system/mdio/mdio_main.c index 31419b0ef..e896cbcd8 100644 --- a/apps/system/mdio/mdio_main.c +++ b/apps/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/apps/system/nxplayer/nxplayer_main.c b/apps/system/nxplayer/nxplayer_main.c index 48a9a2bfa..6b2502c29 100644 --- a/apps/system/nxplayer/nxplayer_main.c +++ b/apps/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/apps/system/poweroff/poweroff.c b/apps/system/poweroff/poweroff.c index 916936a80..3d050bbcb 100644 --- a/apps/system/poweroff/poweroff.c +++ b/apps/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/apps/system/prun/pexec_main.c b/apps/system/prun/pexec_main.c index 0b6b61939..74771f0c0 100644 --- a/apps/system/prun/pexec_main.c +++ b/apps/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/apps/system/ramtest/ramtest.c b/apps/system/ramtest/ramtest.c index fb3519a13..02ba1151e 100644 --- a/apps/system/ramtest/ramtest.c +++ b/apps/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/apps/system/ramtron/ramtron.c b/apps/system/ramtron/ramtron.c index f769a7ea7..52cfd7d6d 100644 --- a/apps/system/ramtron/ramtron.c +++ b/apps/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/apps/system/sdcard/sdcard.c b/apps/system/sdcard/sdcard.c index fba01c3ae..708ca4676 100644 --- a/apps/system/sdcard/sdcard.c +++ b/apps/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/apps/system/sudoku/sudoku.c b/apps/system/sudoku/sudoku.c index 80fbfbc82..69a9b7a60 100755 --- a/apps/system/sudoku/sudoku.c +++ b/apps/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/apps/system/sysinfo/sysinfo.c b/apps/system/sysinfo/sysinfo.c index 858567586..734c94233 100644 --- a/apps/system/sysinfo/sysinfo.c +++ b/apps/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/apps/system/usbmsc/usbmsc_main.c b/apps/system/usbmsc/usbmsc_main.c index 39eaebeff..1e5a314ae 100644 --- a/apps/system/usbmsc/usbmsc_main.c +++ b/apps/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/apps/system/vi/vi.c b/apps/system/vi/vi.c index 35b2a8610..b1e7fecdb 100644 --- a/apps/system/vi/vi.c +++ b/apps/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/apps/system/zmodem/rz_main.c b/apps/system/zmodem/rz_main.c index a7d475e2f..cd1f57ed8 100644 --- a/apps/system/zmodem/rz_main.c +++ b/apps/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/apps/system/zmodem/sz_main.c b/apps/system/zmodem/sz_main.c index e20af9e97..863ad8588 100644 --- a/apps/system/zmodem/sz_main.c +++ b/apps/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; -- cgit v1.2.3