XpCancelDoc(3Xp)

πŸ’… XpCancelDoc β€” the "nvm, cancel that doc" era πŸ’…

okay bestie, welcome to the XpCancelDoc page from the XPRINT FUNCTIONS fam, living in section 3Xp πŸŽ€. This is the function you call when you're mid-print-job and you're like... actually no, we're not doing this anymore. Slay, but cancel it. πŸ’€


✨ SYNOPSIS ✨

void XpCancelDoc ( display, discard )
      Display *display;
      Bool discard;

πŸ¦‹ ARGUMENTS πŸ¦‹

  • display β€” a pointer to the Display structure, which you got back from XOpenDisplay. iykyk, your whole connection to the X server lives in there πŸ’–
  • discard β€” when it's TRUE, this says that all XPPrintNotify events with a detail of XPEndPageNotify or XPEndDocNotify should be discarded. bye-bye events ✨

🌸 DESCRIPTION 🌸

XpCancelDoc cancels an in-progress document. literally the "stop the presses" of print functions 🫢

If the job was started with output_mode XPGetData, then the data stream to XpGetDocumentData is interrupted β€” no further data for the current document will be generated, but data for subsequent documents can still be generated. ✨ That said, heads up: for many page description languages, such arbitrary termination may invalidate the output. it's giving "we stopped midway and the file is now cursed" 😭

If the job was started with output_mode XPSpool, then depending on the driver and spooler implementation, the entire document may be canceled or a partial document may be generated. no promises, it's implementation-dependent, ngl πŸ’…

If discard is True, all XPPrintNotify events with a detail field of XPEndPageNotify or XPEndDocNotify are discarded before XpCancelDoc returns. clean sweep, periodt 🧹

For clients selecting XPPrintMask (see XpSelectInput), the event XPPrintNotify will be generated with its detail field set to XPEndDocNotify. so you do still get told, bestie πŸ‘‘


πŸ’€ DIAGNOSTICS πŸ’€

  • XPBadContext β€” a valid print context-id has not been set prior to making this call. no context, no cancel, sorry babe πŸ™ˆ
  • XPBadSequence β€” the function was not called in the proper order with respect to the other X Print Service Extension calls (example: XpEndDoc prior to XpStartDoc). the vibes were out of order and the server noticed 😭

πŸ”₯ SEE ALSO πŸ”₯

  • XpEndDoc(3Xp)
  • XpGetDocumentData(3Xp)
  • XpSelectInput(3Xp)
  • XpStartDoc(3Xp)

lowkey reminder: cancelling mid-stream with XPGetData can invalidate the output for many page description languages β€” it's right there in the description, so don't come for me πŸ’œ

πŸ’– that's the whole page, you ate, no cap πŸ’–

sign-off era: this iconic little number ships with X Version 11, libXp 1.0.4, dated XpCancelDoc(3Xp) β€” catch you in the man pages, bestie πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from