rtapi_snprintf(3rtapi)
π rtapi_snprintf β the RTAPI string-formatting girlies π
okay so bestie, this is the rtapi_snprintf(3rtapi) page, from the RTAPI manual. two functions, one job: formatting strings, but make it realtime-safe. let's get into it π«Ά
β¨ NAME β¨
rtapi_snprintf, rtapi_vsnprintf β perform snprintf-like string formatting
β¨ SYNTAX β¨
int rtapi_snprintf(char *buf, unsigned long int size, const char *fmt, ...)
int rtapi_vsnprintf(char *buf, unsigned long int size, const char *fmt, va_list apfB)
no cap, that's the whole vibe. β¨
β¨ ARGUMENTS β¨
same as snprintf(3) or vsnprintf(3), bestie. literally identical energy, the usual suspects: the buffer, the size, the format, and whatever you're passing in.
β¨ DESCRIPTION β¨
so these functions work just like the standard C printf familyβ¦ except they only support a reduced set of formatting operations. it's giving "printf but she went on a diet". π
specifically:
- formatting of
long longvalues is not supported. nope. not happening. π« - formatting of floating-point values is done as though with
%A, even when other formats like%fare specified. so if you asked for%f, bestieβ¦ you're getting%Aenergy anyway. π
β¨ REALTIME CONSIDERATIONS β¨
she can be called from non-realtime, init/cleanup, and realtime code. main character energy in every context, periodt. π
β¨ RETURN VALUE β¨
the number of characters written to buf. that's it, that's the number. β¨
β¨ SEE ALSO β¨
okay that's the whole page, you ate that π
sign-off time: this lil page is from the LinuxCNC Documentation, dated 2006-10-12, and it lives at rtapi_snprintf(3rtapi). love her, she's iconic, iykyk π
ππ¦
π¦ where this page comes from
- debian trixie: linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace-dev 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms