#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

menu "errno Decode Support"

config LIBC_STRERROR
	bool "Enable strerror"
	default n
	---help---
		strerror() is useful because it decodes 'errno' values into human readable
		strings.  But it can also require a lot of memory.  If this option is not
		selected, strerror() will still exist in the build but it will not decode error
		values.  This option should be used by other logic to decide if it should use
		strerror() or not.  For example, the NSH application will not use strerror()
		if this option is not selected; perror() will not use strerror() is this option
		is not selected (see also NSH_STRERROR).

config LIBC_STRERROR_SHORT
	bool "Use short error descriptions in strerror()"
	default n
	depends on LIBC_STRERROR
	---help---
		If this option is selected, then strerror() will use shortened string when
		it decodes the error.  Specifically, strerror() is simply use the string that
		is the common name for the error.  For example, the 'errno' value of 2 will
		produce the string "No such file or directory" if LIBC_STRERROR_SHORT
		is not defined but the string "ENOENT" if LIBC_STRERROR_SHORT is defined.

config LIBC_STRERROR_ERRNUM
	bool "Print unknown error code in strerror()"
	default !LIBC_STRERROR && !DEFAULT_SMALL
	---help---
		If this option is selected, then strerror() will print error code
		for unknown errors like "Unknown error 101". Default enabled when
		LIBC_STRERROR is not selected.

config LIBC_PERROR_STDOUT
	bool "perror() to stdout"
	default n
	---help---
		POSIX requires that perror() provide its output on stderr.  This option may
		be defined, however, to provide perror() output that is serialized with
		other stdout messages.

endmenu # errno Decode Support

menu "memcpy/memset Options"

config LIBC_NEWLIB_OPTSPEED
	bool "newlib optimized function"
	depends on ALLOW_BSD_COMPONENTS
	default !DEFAULT_SMALL
	---help---
		Use optimized string function implementation based on newlib.

config LIBC_MEMCPY_VIK
	bool "Vik memcpy()"
	default n
	depends on !LIBC_NEWLIB_OPTSPEED && !LIBC_ARCH_MEMCPY
	---help---
		Select this option to use the optimized memcpy() function by Daniel Vik.
		Select this option for improved performance at the expense of increased
		size. See licensing information in the top-level LICENSE file.

if LIBC_MEMCPY_VIK

config LIBC_MEMCPY_PRE_INC_PTRS
	bool "Pre-increment pointers"
	default n
	---help---
		Use pre-increment of pointers. Default is post increment of pointers.

config LIBC_MEMCPY_INDEXED_COPY
	bool "Array indexing"
	default y
	---help---
		Copying data using array indexing. Using this option, disables the
		LIBC_MEMCPY_PRE_INC_PTRS option.

config LIBC_MEMCPY_64BIT
	bool "64-bit memcpy()"
	default n
	---help---
		Compiles memcpy() for architectures that support 64-bit operations
		efficiently.

endif # LIBC_MEMCPY_VIK

config LIBC_MEMSET_OPTSPEED
	bool "Optimize memset() for speed"
	default n
	depends on !LIBC_NEWLIB_OPTSPEED && !LIBC_ARCH_MEMSET
	---help---
		Select this option to use a version of memcpy() optimized for speed.
		Default: memcpy() is optimized for size.

config LIBC_MEMSET_64BIT
	bool "64-bit memset()"
	default n
	depends on LIBC_MEMSET_OPTSPEED
	---help---
		Compiles memset() for architectures that support 64-bit operations
		efficiently.

endmenu # memcpy/memset Options

menu "signal Decode Support"

config LIBC_STRSIGNAL
	bool "Enable strsignal"
	default y
	---help---
		strsignal() is useful because it decodes signal number values into
		human readable strings.  But it can also require additional memory.
		If this option is not selected, strsignal() will still exist in the
		build but it will not decode signal number values to specific string
		equivalents, but a generic string 'Signal X' will be returned for the
		valid signal number value and 'Real-time Signal X' will be returned
		for the valid real-time signal number value.

config LIBC_STRSIGNAL_SHORT
	bool "Use short message string descriptions in strsignal()"
	default DEFAULT_SMALL
	depends on LIBC_STRSIGNAL
	---help---
		If this option is selected, then strsignal() will use a symbolic value
		string equivalent to the signal number when signal value is decoded.
		For example, the signal value for SIGTRAP will produce the string
		"Trace/breakpoint trap" if LIBC_STRSIGNAL_SHORT is not defined but the
		string "SIGTRAP" if LIBC_STRSIGNAL_SHORT is defined.

endmenu # signal Decode Support
