EFL foundation

Strings

Bounded string, parsing, path, and numeric conversion helpers for firmware that cannot tolerate unsafe or target-variable C library behavior.

Use whenCommands, paths, labels, and numbers must fit fixed buffers.
IncludesParsing, trim/copy, tokenizing, path helpers, IP text.
API count30 current callable services.
Best fitService consoles, diagnostics, file paths, protocol text.

What it does for you

Centralizes predictable fixed-buffer string behavior: copy, append, trim, token parsing, numeric parsing, path checks, and network/address formatting.

What is in the repo

efl_strings.h and efl_strings.c, plus the bundled Core dependency needed for shared EFL status and constants.

Why you need it

Use it when product firmware needs repeatable truncation behavior, caller-owned buffers, and portable parsing helpers without scattering fragile string code across modules.

Public API.

Bounded string calls for command parsing, diagnostics, filenames, network text, and display labels where normal C string behavior is too loose.

Numeric parsing and conversion

EFL_strtod(str, endptr, val, def)Parses a decimal setting such as "3.30" volts or "12.5" amps, and falls back to a known default if the field is invalid.
EFL_strtol(str, endptr, base, val, def)Parses signed command arguments like offsets, calibration trims, or negative thresholds.
EFL_strtoU8(str, endptr, base, val, def)Parses small bounded values such as channel numbers, relay IDs, or enum-style menu choices.
EFL_strtoU16(str, endptr, base, val, def)Parses 16-bit fields such as Modbus registers, ADC counts, or packet lengths.
EFL_strtoU32(str, endptr, base, val, def)Parses larger numeric settings such as baud rates, timeouts, counters, or IPv4 words.
EFL_ByteToStr(byte, buffer, size)Formats a byte for logs and protocol traces, such as turning 0x1B into printable diagnostic text.
EFL_IpHexToStr(ip, ipStr, size)Turns a packed IPv4 address into text for status screens, service logs, or network setup output.

Cleaning, tokenizing, and search

EFL_RemoveCrLf(str, len)Cleans serial, socket, or file input lines before command parsing.
EFL_RemoveChar(str, ch2rm)Strips known separators, quotes, or protocol filler characters before validation.
EFL_RemoveWhitespace(str)Normalizes user-entered or service-console values where spacing should not matter.
EFL_Parse_Tokens(msg, tokenArr, tokenArrSize, delimiter)Splits command lines like "SET,RELAY,3,ON" into bounded token slots.
EFL_FindSubString(str, delimiter, startDelimiterIndex, substr, substrlen)Extracts one field from a delimited response, such as a modem or instrument status string.

Bounded string editing

efl_strnlen(s, maxLen)Measures received or stored text without walking off a missing terminator.
strlcpy(dst, src, dsize)Copies names, labels, and status strings into fixed firmware buffers with truncation detection.
strlcat(dst, src, dsize)Builds bounded messages by appending pieces without overrunning the output buffer.
strlLower(str, dsize)Normalizes command names, extensions, or protocol tokens before comparison.
strlUpper(str, dsize)Normalizes SCPI-style commands, menu tokens, or display labels before use.
strlcmpNoCase(str1, str2, dsize)Compares commands such as "start" and "START" without allocating temporary strings.
EFL_StrTrim(str)Removes leading and trailing whitespace from service-console input.
EFL_StrIsNullOrWhiteSpace(str)Rejects empty user input, missing config fields, or blank command arguments.
EFL_StrReplaceChar(str, original, replacement)Normalizes separators, such as changing backslashes to slashes in paths.
EFL_StrRightPad(str, size, padChar)Builds fixed-width display fields, logs, or tabular service output.
EFL_StrCopyTrimWithDots(dst, src, size, trimAt)Shortens long filenames or labels for small screens while showing they were truncated.

Path and byte helpers

EFL_PathBasename(path)Extracts the filename from a FileX path or update package path.
EFL_PathExtension(path)Finds the extension used to classify logs, firmware images, or data files.
EFL_PathHasExtension(path, extension)Checks whether a selected file is the expected type, such as .bin, .json, or .csv.
EFL_FormatNumberWithCommas(num, str, strLen)Formats counters or byte totals for readable status screens.
EFL_IsVowel(c)Small character classifier retained for text helpers and legacy consumers.
eflReverseMem(size, ptr, swapNibble)Reorders byte fields for protocols or device IDs that arrive in reverse byte order.
eflStr2Hex(string, destSize, dest)Converts service-entered hex keys, IDs, or payload bytes into binary data.