VistaIONewString(3)
β¨ VistaIONewString(3) β¨
okay bestie, so this is a page from the Library Functions Manual and it's about one little macro that is genuinely so useful you'll be obsessed π
πΈ NAME πΈ
VistaIONewString β allocate a copy of a string π¦
π SYNOPSIS π
#include <vistaio.h>
VistaIOString VistaIONewString (string)
VistaIOString string;
π ARGUMENTS π
stringβ a null-terminated string, that's it, that's the whole vibe β¨
π DESCRIPTION π
So basically VistaIONewString copies a string into a newly-allocated block of memory, and it gets that memory by calling VistaIOMalloc(3). It's not doing anything wild β it's a convenience macro, a little bestie that does the boring part for you. Under the hood it calls VistaIOMalloc(3) with exactly these arguments, no cap:
(strcpy (VistaIOMalloc (strlen (string) + 1), string))
Like, it literally asks for strlen (string) + 1 bytes (the +1 is the null terminator, she's thorough π
) and then strcpys your string right in there. iconic behavior.
β RETURN VALUES β
VistaIONewString returns a pointer to the new copy of the string. fresh copy, no strings attached (well, one string attached, the copy) π«Ά
π SEE ALSO π
go read those too, iykyk π
π DIAGNOSTICS π
If there is insufficient memory to allocate the new block,VistaIONewStringterminates β like, full on stops existing β by callingVistaIOError(3)with the message`Out of memory`. so if you see that, bestie, your RAM said no π
π AUTHOR π
Art Pope <pope@cs.ubc.ca>
Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>
π§ ACKNOWLEDGMENT π§
This macro and this manual page are based on similar ones included in the X Toolkit Intrinsics, which is Copyright 1985, 1986, 1987, 1988 Massachusetts Institute of Technology, Cambridge, Massachusetts, and Digital Equipment Corporation, Maynard, Massachusetts. giving credit where credit is due, periodt β¨
and that's the whole page, bestie!! this one came from VistaIO Version 1.2.14, dated 24 April 1993 β vintage but still slaying ππ mwah, go forth and copy some strings π¦
π¦ where this page comes from
- debian bookworm: libvistaio-dev 1.2.19-3 Β· libvista-orig
- debian trixie: libvistaio-dev 1.2.19-3+b2 Β· libvista-orig
- ubuntu jammy: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu noble: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu questing: libvistaio-dev 1.2.19-4
- ubuntu resolute: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- ubuntu stonking: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms