update app_match_nuttx for nuttx10.3

This commit is contained in:
wgzAIIT
2022-06-17 17:12:53 +08:00
parent f2355281b1
commit 4ee205876a
71 changed files with 880 additions and 21600 deletions
@@ -65,6 +65,10 @@ ifeq ($(CONFIG_BUILD_KERNEL),y)
install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
.import: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(Q) for app in ${CONFIGURED_APPS}; do \
$(MAKE) -C "$${app}" archive ; \
done
$(Q) install libapps.a $(APPDIR)$(DELIM)import$(DELIM)libs
$(Q) $(MAKE) install
import: $(IMPORT_TOOLS)
@@ -99,11 +103,7 @@ $(SYMTABOBJ): %$(OBJEXT): %.c
$(call COMPILE, -fno-lto $<, $@)
$(BIN): $(SYMTABOBJ)
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
$(call ARCHIVE_ADD, "${shell cygpath -w $(BIN)}", $^)
else
$(call ARCHIVE_ADD, $(BIN), $^)
endif
$(call ARCHIVE_ADD, $(call CONVERT_PATH,$(BIN)), $^)
endif # !CONFIG_BUILD_LOADABLE
@@ -156,13 +156,15 @@ preconfig: Kconfig
export:
ifneq ($(EXPORTDIR),)
$(Q) mkdir -p "${EXPORTDIR}"$(DELIM)registry || exit 1;
ifneq ($(CONFIG_BUILD_KERNEL),y)
ifneq ($(BUILTIN_REGISTRY),)
$(Q) mkdir -p "${EXPORTDIR}"/registry || exit 1; \
for f in "${BUILTIN_REGISTRY}"/*.bdat "${BUILTIN_REGISTRY}"/*.pdat ; do \
[ -f "$${f}" ] && cp -f "$${f}" "${EXPORTDIR}"/registry ; \
for f in "${BUILTIN_REGISTRY}"$(DELIM)*.bdat "${BUILTIN_REGISTRY}"$(DELIM)*.pdat ; do \
[ -f "$${f}" ] && cp -f "$${f}" "${EXPORTDIR}"$(DELIM)registry ; \
done
endif
endif
endif
.depdirs: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_depend)
@@ -1,5 +1,4 @@
#
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
@@ -11,7 +10,6 @@ config NSH_LIBRARY
default n
select NETUTILS_NETLIB if NET
select LIBC_NETDB if NET
select READLINE_HAVE_EXTMATCH
select BOARDCTL if (!NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT) || NSH_ARCHINIT || NSH_ROMFSETC
select BOARDCTL_MKRD if !NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT
select BOARDCTL_ROMDISK if NSH_ROMFSETC
@@ -80,6 +78,7 @@ choice
config NSH_READLINE
bool "Minimal readline()"
select SYSTEM_READLINE
select READLINE_HAVE_EXTMATCH
---help---
Selects the minimal implementation of readline(). This minimal
implementation provides on backspace for command line editing.
@@ -108,8 +107,7 @@ config NSH_LINELEN
config NSH_DISABLE_SEMICOLON
bool "Disable multiple commands per line"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
---help---
By default, you can enter multiple NSH commands on a line with each
command separated by a semicolon. You can disable this feature to
@@ -117,8 +115,7 @@ config NSH_DISABLE_SEMICOLON
config NSH_QUOTE
bool "Enable back-slash quoting of characters"
default n if DEFAULT_SMALL || !NSH_ARGCAT
default y if !DEFAULT_SMALL && NSH_ARGCAT
default !DEFAULT_SMALL && NSH_ARGCAT
---help---
Force special characters like back-quotes, quotation marks, and the
back-slash character itself to be treat like normal text.
@@ -128,8 +125,7 @@ config NSH_QUOTE
config NSH_CMDPARMS
bool "Enable commands as parameters"
default n if DEFAULT_SMALL
default y if !DEFAULT_SMALL
default !DEFAULT_SMALL
depends on !DISABLE_MOUNTPOINT
---help---
If selected, then the output from commands, from file applications, and
@@ -155,8 +151,7 @@ config NSH_MAXARGUMENTS
config NSH_ARGCAT
bool "Concatenation of argument strings"
default n if DEFAULT_SMALL
default y if !DEFAULT_SMALL
default !DEFAULT_SMALL
---help---
Support concatenation of strings with environment variables or command
output. For example:
@@ -179,8 +174,7 @@ config NSH_NESTDEPTH
config NSH_DISABLEBG
bool "Disable background commands"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
---help---
This can be set to 'y' to suppress support for background
commands. This setting disables the 'nice' command prefix and
@@ -213,155 +207,134 @@ menu "Disable Individual commands"
config NSH_DISABLE_ADDROUTE
bool "Disable addroute"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NET_ROUTE
config NSH_DISABLE_ARP
bool "Disable arp"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NET_ARP
config NSH_DISABLE_BASE64DEC
bool "Disable base64dec"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NETUTILS_CODECS && CODECS_BASE64
config NSH_DISABLE_BASE64ENC
bool "Disable base64enc"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NETUTILS_CODECS && CODECS_BASE64
config NSH_DISABLE_BASENAME
bool "Disable basename"
default y if DEFAULT_SMALL || NSH_DISABLESCRIPT
default n if !DEFAULT_SMALL && !NSH_DISABLESCRIPT
default DEFAULT_SMALL || NSH_DISABLESCRIPT
config NSH_DISABLE_CAT
bool "Disable cat"
default n
default DEFAULT_SMALL
config NSH_DISABLE_CD
bool "Disable cd"
default n
default DEFAULT_SMALL
config NSH_DISABLE_CP
bool "Disable cp"
default n
default DEFAULT_SMALL
config NSH_DISABLE_CMP
bool "Disable cmp"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_DATE
bool "Disable date"
default n if RTC
default y if !RTC
default DEFAULT_SMALL || !RTC
config NSH_DISABLE_DD
bool "Disable dd"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_DF
bool "Disable df"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_DELROUTE
bool "Disable delroute"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NET_ROUTE
config NSH_DISABLE_DIRNAME
bool "Disable dirname"
default y if DEFAULT_SMALL || NSH_DISABLESCRIPT
default n if !DEFAULT_SMALL && !NSH_DISABLESCRIPT
default DEFAULT_SMALL || NSH_DISABLESCRIPT
config NSH_DISABLE_DMESG
bool "Disable dmesg"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on RAMLOG_SYSLOG
config NSH_DISABLE_ECHO
bool "Disable echo"
default n
default DEFAULT_SMALL
config NSH_DISABLE_ENV
bool "Disable env"
default n
default DEFAULT_SMALL
config NSH_DISABLE_EXEC
bool "Disable exec"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_EXIT
bool "Disable exit"
default y if DEFAULT_SMALL && !NSH_TELNET
default n if !DEFAULT_SMALL || NSH_TELNET
default DEFAULT_SMALL && !NSH_TELNET
config NSH_DISABLE_EXPORT
bool "Disable export"
default n
default DEFAULT_SMALL
config NSH_DISABLE_FREE
bool "Disable free"
default n
default DEFAULT_SMALL
config NSH_DISABLE_GET
bool "Disable get"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_HELP
bool "Disable help"
default n
default DEFAULT_SMALL
config NSH_DISABLE_HEXDUMP
bool "Disable hexdump"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_IFCONFIG
bool "Disable ifconfig"
default y if !FS_PROCFS || FS_PROCFS_EXCLUDE_NET
default n if FS_PROCFS && !FS_PROCFS_EXCLUDE_NET
default DEFAULT_SMALL || !FS_PROCFS || FS_PROCFS_EXCLUDE_NET
config NSH_DISABLE_IFUPDOWN
bool "Disable ifup/down"
default y if !FS_PROCFS || FS_PROCFS_EXCLUDE_NET
default n if FS_PROCFS && !FS_PROCFS_EXCLUDE_NET
default DEFAULT_SMALL || !FS_PROCFS || FS_PROCFS_EXCLUDE_NET
config NSH_DISABLE_KILL
bool "Disable kill"
default n
default DEFAULT_SMALL
config NSH_DISABLE_LOSETUP
bool "Disable losetup"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_LOSMART
bool "Disable losmart"
default y if DEFAULT_SMALL || !MTD_SMART
default n if !DEFAULT_SMALL && MTD_SMART
default DEFAULT_SMALL || !MTD_SMART
config NSH_DISABLE_LN
bool "Disable ln"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on PSEUDOFS_SOFTLINKS
config NSH_DISABLE_LS
bool "Disable ls"
default n
default DEFAULT_SMALL
config NSH_DISABLE_MB
bool "Disable mb"
@@ -369,35 +342,30 @@ config NSH_DISABLE_MB
config NSH_DISABLE_MD5
bool "Disable md5"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NETUTILS_CODECS && CODECS_HASH_MD5
config NSH_DISABLE_MKDIR
bool "Disable mkdir"
default n
default DEFAULT_SMALL
config NSH_DISABLE_MKFATFS
bool "Disable mkfatfs"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on FSUTILS_MKFATFS
config NSH_DISABLE_MKFIFO
bool "Disable mkfifo"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on PIPES
config NSH_DISABLE_MKRD
bool "Disable mkrd"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_MKSMARTFS
bool "Disable mksmartfs"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on FS_SMARTFS && FSUTILS_MKSMARTFS
config NSH_DISABLE_MH
@@ -406,16 +374,16 @@ config NSH_DISABLE_MH
config NSH_DISABLE_MODCMDS
bool "Disable modules commands (insmod, rmmod, lsmod)"
default n
default DEFAULT_SMALL
depends on MODULE
config NSH_DISABLE_MOUNT
bool "Disable mount"
default n
default DEFAULT_SMALL
config NSH_DISABLE_MV
bool "Disable mv"
default n
default DEFAULT_SMALL
config NSH_DISABLE_MW
bool "Disable mw"
@@ -423,170 +391,161 @@ config NSH_DISABLE_MW
config NSH_DISABLE_NSFMOUNT
bool "Disable nfsmount"
default n
default DEFAULT_SMALL
depends on NFS
config NSH_DISABLE_NSLOOKUP
bool "Disable nslookup"
default n
default DEFAULT_SMALL
depends on LIBC_NETDB && NETDB_DNSCLIENT
config NSH_DISABLE_PASSWD
bool "Disable passwd"
default y
default DEFAULT_SMALL
depends on NSH_LOGIN_PASSWD && !FSUTILS_PASSWD_READONLY
config NSH_DISABLE_PMCONFIG
bool "Disable pmconfig"
default n
default DEFAULT_SMALL
depends on PM
config NSH_DISABLE_POWEROFF
bool "Disable poweroff"
default n if !DEFAULT_SMALL
default y if DEFAULT_SMALL
default DEFAULT_SMALL
depends on BOARDCTL_POWEROFF
config NSH_DISABLE_PRINTF
bool "Disable printf"
default y
default DEFAULT_SMALL
config NSH_DISABLE_PS
bool "Disable ps"
default y if !FS_PROCFS || FS_PROCFS_EXCLUDE_PROCESS
default n if FS_PROCFS && !FS_PROCFS_EXCLUDE_PROCESS
default DEFAULT_SMALL || !FS_PROCFS || FS_PROCFS_EXCLUDE_PROCESS
config NSH_DISABLE_PSHEAPUSAGE
bool "Disable ps heap usage"
depends on DEBUG_MM && !NSH_DISABLE_PS
default DEFAULT_SMALL
config NSH_DISABLE_PSSTACKUSAGE
bool "Disable ps stack usage"
depends on STACK_COLORATION && !NSH_DISABLE_PS
default n
default DEFAULT_SMALL
---help---
Disable to save space and not pull in floating point routines
config NSH_DISABLE_PUT
bool "Disable put"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_PWD
bool "Disable pwd"
default n
default DEFAULT_SMALL
config NSH_DISABLE_READLINK
bool "Disable readlink"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on PSEUDOFS_SOFTLINKS
config NSH_DISABLE_REBOOT
bool "Disable reboot"
default n if !DEFAULT_SMALL
default y if DEFAULT_SMALL
default DEFAULT_SMALL
depends on BOARDCTL_RESET
config NSH_DISABLE_RM
bool "Disable rm"
default n
default DEFAULT_SMALL
config NSH_DISABLE_RMDIR
bool "Disable rmdir"
default n
default DEFAULT_SMALL
config NSH_DISABLE_ROUTE
bool "Disable delroute"
depends on FS_PROCFS && NET_ROUTE && !FS_PROCFS_EXCLUDE_NET && !FS_PROCFS_EXCLUDE_ROUTE
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_RPTUN
bool "Disable rptun"
default n
default DEFAULT_SMALL
depends on RPTUN
config NSH_DISABLE_SET
bool "Disable set"
default n
default DEFAULT_SMALL
config NSH_DISABLE_SOURCE
bool "Disable source"
default n
default DEFAULT_SMALL
config NSH_DISABLE_SHUTDOWN
bool "Disable shutdown"
default n if !DEFAULT_SMALL && BOARD_POWEROFF && BOARD_RESET
default y if DEFAULT_SMALL || !BOARD_POWEROFF || !BOARD_RESET
default DEFAULT_SMALL || !BOARD_POWEROFF || !BOARD_RESET
depends on BOARDCTL_POWEROFF || BOARDCTL_RESET
config NSH_DISABLE_SLEEP
bool "Disable sleep"
default n
default DEFAULT_SMALL
config NSH_DISABLE_TIME
bool "Disable time"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_TEST
bool "Disable test"
default n
default DEFAULT_SMALL
config NSH_DISABLE_TELNETD
bool "Disable telnetd"
default n if !NSH_NETLOCAL
default y if NSH_NETLOCAL
default DEFAULT_SMALL || NSH_NETLOCAL
config NSH_DISABLE_TRUNCATE
bool "Disable truncate"
default y
default DEFAULT_SMALL
config NSH_DISABLE_UMOUNT
bool "Disable umount"
default n
default DEFAULT_SMALL
config NSH_DISABLE_UNAME
bool "Disable uname"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_UNSET
bool "Disable unset"
default n
default DEFAULT_SMALL
config NSH_DISABLE_URLDECODE
bool "Disable urldecode"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NETUTILS_CODECS && CODECS_URLCODE
config NSH_DISABLE_URLENCODE
bool "Disable urlencode"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
depends on NETUTILS_CODECS && CODECS_URLCODE
config NSH_DISABLE_USERADD
bool "Disable useradd"
default y
default DEFAULT_SMALL
depends on NSH_LOGIN_PASSWD && !FSUTILS_PASSWD_READONLY
config NSH_DISABLE_USERDEL
bool "Disable userdel"
default y
default DEFAULT_SMALL
depends on NSH_LOGIN_PASSWD && !FSUTILS_PASSWD_READONLY
config NSH_DISABLE_USLEEP
bool "Disable usleep"
default n
default DEFAULT_SMALL
config NSH_DISABLE_WGET
bool "Disable wget"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_XD
bool "Disable xd"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
config NSH_DISABLE_CH438
bool "Disable the ch438 demo."
@@ -689,12 +648,14 @@ endmenu
if MMCSD
config NSH_MMCSDMINOR
int "MMC/SD minor number"
int "MMC/SD minor device number"
default 0
---help---
If board-specific NSH start-up logic needs to mount an MMC/SD device, then the
setting should be provided to identify the MMC/SD minor device number (i.e., the N ini
/dev/mmcsdN). Default 0
If the architecture supports an MMC/SD slot and if the NSH
architecture specific logic is present, this option will provide
the MMC/SD minor number, i.e., the MMC/SD block driver will
be registered as /dev/mmcsdN where N is the minor number.
Default is zero.
config NSH_MMCSDSLOTNO
int "MMC/SD slot number"
@@ -760,8 +721,7 @@ config NSH_CODECS_BUFSIZE
config NSH_CMDOPT_HEXDUMP
bool "hexdump: Enable 'skip' and 'count' parameters"
default n if DEFAULT_SMALL
default y if !DEFAULT_SMALL
default !DEFAULT_SMALL
depends on !NSH_DISABLE_HEXDUMP
config NSH_PROC_MOUNTPOINT
@@ -793,8 +753,7 @@ menu "Scripting Support"
config NSH_DISABLESCRIPT
bool "Disable script support"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
---help---
This can be set to 'y' to suppress support for scripting. This
setting disables the 'sh', 'test', and '[' commands and the
@@ -805,8 +764,7 @@ if !NSH_DISABLESCRIPT
config NSH_DISABLE_ITEF
bool "Disable if-then-else-fi"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
---help---
This can be set to 'y' to suppress support for if-then-else-fi
sequences in scripts. This would only be set on systems where
@@ -814,8 +772,7 @@ config NSH_DISABLE_ITEF
config NSH_DISABLE_LOOPS
bool "Disable loops"
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
default DEFAULT_SMALL
---help---
This can be set to 'y' to suppress support for while-do-done and
until-do-done sequences in scripts. This would only be set on
@@ -824,16 +781,6 @@ config NSH_DISABLE_LOOPS
endif # !NSH_DISABLESCRIPT
config NSH_MMCSDMINOR
int "MMC/SD minor device number"
default 0
---help---
If the architecture supports an MMC/SD slot and if the NSH
architecture specific logic is present, this option will provide
the MMC/SD minor number, i.e., the MMC/SD block driver will
be registered as /dev/mmcsdN where N is the minor number.
Default is zero.
config NSH_ROMFSETC
bool "Support ROMFS start-up script"
default n
@@ -848,7 +795,7 @@ if NSH_ROMFSETC
config NSH_CROMFSETC
bool "Support CROMFS (compressed) start-up script"
default n
depends on NSH_ROMFSETC && FS_CROMFS
depends on FS_CROMFS
---help---
Mount a CROMFS filesystem at /etc and provide a compressed startup
script at /etc/init.d/rcS.
@@ -1232,8 +1179,7 @@ menu "Telnet Configuration"
config NSH_TELNET
bool "Use Telnet console"
default n if DEFAULT_SMALL
default y if !DEFAULT_SMALL
default !DEFAULT_SMALL
depends on NETUTILS_TELNETD
---help---
If NSH_TELNET is set to 'y', then a TELENET
@@ -24,7 +24,7 @@ include $(APPDIR)/Make.defs
CSRCS = nsh_init.c nsh_parse.c nsh_console.c nsh_script.c nsh_system.c
CSRCS += nsh_command.c nsh_fscmds.c nsh_ddcmd.c nsh_proccmds.c nsh_mmcmds.c
CSRCS += nsh_timcmds.c nsh_envcmds.c nsh_syscmds.c nsh_dbgcmds.c nsh_Applicationscmd.c
CSRCS += nsh_timcmds.c nsh_envcmds.c nsh_syscmds.c nsh_dbgcmds.c nsh_Applicationscmd.c
ifeq ($(CONFIG_FILE_STREAM),y)
CSRCS += nsh_session.c
@@ -18,15 +18,6 @@
*
****************************************************************************/
/**
* @file nsh.h
* @brief nuttx source code
* https://github.com/apache/incubator-nuttx-apps
* @version 10.2.0
* @author AIIT XUOS Lab
* @date 2022-03-17
*/
#ifndef __APPS_NSHLIB_NSH_H
#define __APPS_NSHLIB_NSH_H
@@ -574,9 +565,15 @@
# define CONFIG_NSH_DISABLE_FREE 1
#endif
#if !defined(CONFIG_FS_PROCFS) || defined(CONFIG_FS_PROCFS_EXCLUDE_MEMDUMP)
# undef CONFIG_NSH_DISABLE_MEMDUMP
# define CONFIG_NSH_DISABLE_MEMDUMP 1
#endif
/* Suppress unused file utilities */
#define NSH_HAVE_CATFILE 1
#define NSH_HAVE_WRITEFILE 1
#define NSH_HAVE_READFILE 1
#define NSH_HAVE_FOREACH_DIRENTRY 1
#define NSH_HAVE_TRIMDIR 1
@@ -949,6 +946,9 @@ void nsh_usbtrace(void);
#ifndef CONFIG_NSH_DISABLE_FREE
int cmd_free(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#ifndef CONFIG_NSH_DISABLE_MEMDUMP
int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#ifndef CONFIG_NSH_DISABLE_TIME
int cmd_time(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
@@ -1282,7 +1282,7 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
*
* Description:
* Read a small file into a user-provided buffer. The data is assumed to
* be a string and is guaranteed to be NUL-termined. An error occurs if
* be a string and is guaranteed to be NULL-terminated. An error occurs if
* the file content (+terminator) will not fit into the provided 'buffer'.
*
* Input Parameters:
@@ -1303,6 +1303,30 @@ int nsh_readfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
FAR const char *filepath, FAR char *buffer, size_t buflen);
#endif
/****************************************************************************
* Name: nsh_writefile
*
* Description:
* Dump the contents of a file to the current NSH terminal.
*
* Input Paratemets:
* vtbl - session vtbl
* cmd - NSH command name to use in error reporting
* buffer - The pointer of writting buffer
* len - The length of writting buffer
* filepath - The full path to the file to be dumped
*
* Returned Value:
* Zero (OK) on success; -1 (ERROR) on failure.
*
****************************************************************************/
#ifdef NSH_HAVE_WRITEFILE
int nsh_writefile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
FAR const char *buffer, size_t len,
FAR const char *filepath);
#endif
/****************************************************************************
* Name: nsh_foreach_direntry
*
@@ -18,15 +18,6 @@
*
****************************************************************************/
/**
* @file nsh_command.c
* @brief nuttx source code
* https://github.com/apache/incubator-nuttx-apps
* @version 10.2.0
* @author AIIT XUOS Lab
* @date 2022-03-17
*/
/****************************************************************************
* Included Files
****************************************************************************/
@@ -225,6 +216,12 @@ static const struct cmdmap_s g_cmdmap[] =
{ "free", cmd_free, 1, 1, NULL },
#endif
#ifdef CONFIG_DEBUG_MM
# ifndef CONFIG_NSH_DISABLE_MEMDUMP
{ "memdump", cmd_memdump, 1, 3, "[pid/used/free]" },
# endif
#endif
#ifdef CONFIG_NET_UDP
# ifndef CONFIG_NSH_DISABLE_GET
{ "get", cmd_get, 4, 7,