XpmCreateBuffer(3)
π XpmCreateBuffer(3) π
okay bestie, welcome to the libXpm functions page for XpmCreateBuffer β she's the one who hands you a buffer instead of a whole file, and honestly? she ate. π
β¨ NAME β¨
XpmCreateBuffer β create an XPM Buffer π¦
π SYNOPSIS π
int XpmCreateBufferFromImage(Display *display , char **buffer_return,
XImage *image, XImage *shapeimage, XpmAttributes *attributes);
int XpmCreateBufferFromPixmap(Display *display, char **buffer_return,
Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes);
int XpmCreateBufferFromXpmImage(char **buffer_return, XpmImage *image,
XpmInfo *info);
three little functions, all giving buffer energy. π
πΈ ARGUMENTS πΈ
displayβ specifies the connection to the X server. your lil hotline to X, fr fr.buffer_returnβ returns the buffer which is created. this is where the magic gets dropped off, no cap.imageβ specifies the image.shapeimageβ specifies the shape mask image.attributesβ specifies the location of a structure containing information (orNULL). like, info optional, queen behavior.infoβ specifies the location of a structure to get possible information (orNULL).
π DESCRIPTION π
π XpmCreateBufferFromPixmap
XpmCreateBufferFromPixmap() creates an XPM buffer from a Pixmap. lowkey the same energy as XpmWriteFileFromPixmap(3) β it just calls XpmCreateBufferFromImage() instead of XpmWriteFileFromImage(3). and once again, bestie, the caller should free the buffer using XpmFree(3) when finished. don't leave her hanging π
As a convenience, the XpmReadFileToBuffer(3) and XpmWriteFileFromBuffer(3) functions are provided to copy a file to a buffer and to write a file from a buffer. so like, for instance, one may decide to use XpmCreateBufferFromPixmap(), XpmWriteFileFromBuffer(3), and XpmFree(3) instead of XpmWriteFileFromPixmap(3). On some systems this may lead to a performance improvement, since the processing will be performed in memory β but it uses more memory. trade-offs, babes, it's giving "choose your fighter". βοΈ
π¦ XpmCreateBufferFromImage
The XpmCreateBufferFromImage() function works as XpmWriteFileFromImage(3), it just writes to a malloc'ed buffer instead of to a file. The caller should free the buffer using XpmFree(3) when finished. yes, again. free your buffer. it's self-care. πββοΈ
β XpmCreateBufferFromXpmImage.
To create an XPM buffer from an XpmImage, use XpmCreateBufferFromXpmImage(). The XpmCreateBufferFromXpmImage() function writes out the given image to a single block malloc'ed buffer in XPM format. If insufficient working storage is allocated, it returns XpmNoMemory, and returns XpmSuccess on success. β¨
If the passed XpmInfo structure pointer is not NULL, XpmCreateBufferFromXpmImage() looks for the following attributes: XpmComments, XpmExtensions, and XpmHotspot, and writes the related information out as well. so extra lore gets included, periodt. π
The caller should free the buffer using XpmFree(3) when finished. (third time's the charm, bestie β free it.)
π₯ SEE ALSO π₯
and that's the whole page, gorgeous π this one came from X Version 11, and the version of libXpm is 3.5.17 β yeah, she's been around and she still slays. go free your buffers, mwah π
π
π¦ where this page comes from
- centos-stream 10: libXpm-devel 3.5.17-5.el10 Β· MIT AND X11-distribute-modifications-variant
- debian trixie: libxpm-dev 1:3.5.17-1+deb13u1
- fedora 43: libXpm-devel 3.5.17-6.fc43 Β· MIT AND X11-distribute-modifications-variant
- fedora 43: libXpm-devel 3.5.17-6.fc43 Β· MIT AND X11-distribute-modifications-variant
- fedora 44: libXpm-devel 3.5.17-7.fc44 Β· MIT AND X11-distribute-modifications-variant
- fedora 44: libXpm-devel 3.5.17-7.fc44 Β· MIT AND X11-distribute-modifications-variant
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- opensuse-leap 16.0: libXpm-devel 3.5.17-160000.4.1 Β· MIT
- ubuntu noble: libxpm-dev 1:3.5.17-1build2
- ubuntu noble: libxpm-dev 1:3.5.17-1ubuntu0.24.04.2
- ubuntu questing: libxpm-dev 1:3.5.17-1build2
- ubuntu resolute: libxpm-dev 1:3.5.17-1build3
- ubuntu resolute: libxpm-dev 1:3.5.17-1ubuntu0.26.04.2
- Copyright (C) 1989-95 GROUPE BULL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms