PAPERINFO(3)

πŸ’– PAPERINFO πŸ’–

okay bestie, welcome to the paperinfo era of the manual β€” this is a whole family of functions from the paper.h universe, and they're all about one thing: papers. like, actual paper sizes. width, height, names, the whole vibe. no cap.

the icons of this page are paperinfo, paperwithsize, paperfirst, paperlast, papernext, and paperprev β€” and their entire job description is return informations about a paper. yes, "informations." the original said it, so we're keeping it. πŸ’…


✨ SYNOPSYS ✨

(spelled exactly like that, don't come for me, it's iconic)

#include <paper.h>

const struct paper* paperinfo(const char* papername)
const struct paper* paperwithsize(double psw, double psh)

char*  papername(const struct paper*)
double paperpswidth(const struct paper*)
double paperpsheigth(const struct paper*)

const struct paper* paperfirst(void)
const struct paper* papernext(const struct paper* pinfo)
const struct paper* paperprev(const struct paper* pinfo)
const struct paper* paperlast(void)
lowkey important: yes, the header is <paper.h>, and yes, the synopsis really does say paperpsheigth. we do not fix the queen's spelling here. periodt.

🌸 DESCRIPTION 🌸

okay so, let's break down the cast:

paperinfo() hands you back a pointer to a struct paper stuffed with informations about the paper whose name is papername. cute, right?

paperwithsize() is the matchmaker 🫢 β€” it goes looking for a paper whose width and height are psw and psh in PostScript points, and returns a pointer to the struct paper corresponding to the paper it found.

then we have the lil accessor besties, who all take one of those opaque struct paper objects and tell you a thing about it:

  • papername() β€” returns the name of the paper described by an opaque struct paper object
  • paperpswidth() β€” returns the width, in PostScript points, of a paper described by an opaque struct paper object
  • paperpsheight() β€” returns the height, in PostScript points, of a paper described by an opaque struct paper object

and finally, the traversal squad πŸ¦‹:

  • paperfirst() and paperlast() return the first and last entries for papers.
  • iterating from one entry to the next one, or back to the previous one, is done with papernext() and paperprev() respectively.

like, walk the list, bestie. forward, backward, you're the main character of this iteration. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're giving very much required reading:


that's the whole page, fr fr. this one comes from the Library Functions Manual and it's dated 24 September 1996 β€” yes, 1996, an absolute vintage icon, we love a throwback πŸ’œβœ¨