PS_NEW2(3)

✨ PS_NEW2 ✨

okay bestie, gather round, we're doing the pslib.h thing πŸ’– this one lives in section 3 of the Library Functions Manual, and it's literally the glow-up version of making a PostScript document. no cap.


🌸 NAME 🌸

PS_new2 β€” creates a new PostScript document object πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <pslib.h>

PSDoc * PS_new2((void  (*errorhandler)(PSDoc *p, int type, const char
*msg), void* (*allocproc)(PSDoc *p, size_t size, const char *caller),
void* (*reallocproc)(PSDoc *p, void *mem, size_t size, const char
*caller), void  (*freeproc)(PSDoc *p, void *mem), void   *opaque)

πŸ’… DESCRIPTION πŸ’…

so the way this works is: it creates a brand new document instance ✨ That's it. That's the whole vibe. It does not create the file on disk, and it does not create it in memory either β€” it just sets everything up. like, the scaffolding, the whole backstage, no actual performance yet 🎭

and here's the fun part, bestie: you can pass in your own error handler and your own memory management functions πŸ‘‘

If you pass NULL values, the internal default handler and functions get used instead. and if that's your plan, then honestly you may as well just call PS_new(3) instead, because you're doing the same thing with extra steps πŸ™ˆ


⭐ RETURN VALUE ⭐

A pointer to the new instance of the PostScript document πŸ’– β€” or NULL on failure 😭 (yes, check it, don't be that girl).


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Uwe Steinmann uwe@steinmann.cx. iconic of him fr fr 🫢


and that's the whole page, bestie β€” section 3, Library Functions Manual, PS_new2(3) energy from start to finish πŸ’œ go set up your document, you've got this, periodt 🌸

πŸ“¦ where this page comes from