head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.2.4.1
	libXpm-3-5-19:1.1.1.3
	netbsd-11-0-RC3:1.1.1.2
	netbsd-11-0-RC2:1.1.1.2
	netbsd-11-0-RC1:1.1.1.2
	netbsd-11:1.1.1.2.0.4
	netbsd-11-base:1.1.1.2
	netbsd-10-1-RELEASE:1.1.1.2.2.2
	netbsd-10-0-RELEASE:1.1.1.2.2.2
	netbsd-10-0-RC6:1.1.1.2.2.2
	netbsd-10-0-RC5:1.1.1.2.2.2
	netbsd-10-0-RC4:1.1.1.2.2.2
	netbsd-10-0-RC3:1.1.1.2.2.2
	netbsd-10-0-RC2:1.1.1.2.2.2
	netbsd-10-0-RC1:1.1.1.2.2.2
	libXpm-3-5-17:1.1.1.2
	libXpm-3-5-16:1.1.1.2
	netbsd-10:1.1.1.2.0.2
	libXpm-3-5-15:1.1.1.2
	libXpm-3-5-14:1.1.1.1
	xorg:1.1.1;
locks; strict;
comment	@.\" @;


1.1
date	2023.01.08.06.00.57;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	pafnXA7eYXUjxH8E;

1.1.1.1
date	2023.01.08.06.00.57;	author mrg;	state Exp;
branches;
next	1.1.1.2;
commitid	pafnXA7eYXUjxH8E;

1.1.1.2
date	2023.01.19.05.12.23;	author mrg;	state Exp;
branches
	1.1.1.2.2.1
	1.1.1.2.4.1;
next	1.1.1.3;
commitid	wSF7Xz3G6uGJU6aE;

1.1.1.3
date	2026.04.21.22.17.19;	author mrg;	state Exp;
branches;
next	;
commitid	nFKAY4UHGiKMoSCG;

1.1.1.2.2.1
date	2023.01.19.05.12.23;	author martin;	state dead;
branches;
next	1.1.1.2.2.2;
commitid	Vv06MqbpJGbIDFaE;

1.1.1.2.2.2
date	2023.01.23.13.49.21;	author martin;	state Exp;
branches;
next	1.1.1.2.2.3;
commitid	Vv06MqbpJGbIDFaE;

1.1.1.2.2.3
date	2026.05.06.19.36.33;	author martin;	state Exp;
branches;
next	;
commitid	J7mvmZrn2XJr1NEG;

1.1.1.2.4.1
date	2026.05.06.19.33.32;	author martin;	state Exp;
branches;
next	;
commitid	45Sj6iR5I6840NEG;


desc
@@


1.1
log
@Initial revision
@
text
@.\" Copyright (C) 1989-95 GROUPE BULL
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
.\" of this software and associated documentation files (the "Software"), to
.\" deal in the Software without restriction, including without limitation the
.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
.\" sell copies of the Software, and to permit persons to whom the Software is
.\" furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
.\" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of GROUPE BULL shall not be
.\" used in advertising or otherwise to promote the sale, use or other dealings
.\" in this Software without prior written authorization from GROUPE BULL.
.\"
.hw XImage
.TH XpmWrite __libmansuffix__ __xorgversion__ "libXpm functions"
.SH NAME
XpmWrite \- write an XPM file

.SH SYNOPSIS
.HP
int XpmWriteFileFromPixmap(Display *display, char *filename, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes);
.HP
int XpmWriteFileFromImage(Display *display, char *filename, XImage *image, XImage *shapeimage, XpmAttributes *attributes);
.HP
int XpmWriteFileFromData(char *filename, char **data);
.HP
int XpmWriteFileFromXpmImage(char *filename, XpmImage *image, XImage *shapeimage, XpmInfo *info);
.HP
int XpmWriteFileFromBuffer(char *filename,  char *buffer);

.SH ARGUMENTS

.IP \fIdisplay\fP li
Specifies the connection to the X server.
.IP \fIfilename\fP li
Specifies the file name to use.
.IP \fIpixmap\fP li
Specifies the pixmap.
.IP \fIshapemask\fP li
Specifies the shape mask pixmap.
.IP \fIattributes\fP li
Specifies the location of a structure containing information (or NULL).
.IP \fIdata\fP li
Specifies the data array to read.
.IP \fIimage\fP li
Specifies the image.
.IP \fIinfo\fP li
Specifies the location of a structure to get information from (or NULL).
.IP \fIbuffer\fP li
Specifies the buffer to read.

.SH DESCRIPTION
.SS XpmWriteFileFromImage

The XpmWriteFileFromImage function writes an image and its possible shapeimage out to a file in the XPM format.
If the file cannot be opened, it returns XpmOpenFailed.
If insufficient working storage is allocated, it returns XpmNoMemory.
If no error occurs then it returns XpmSuccess.
If the passed XpmAttributes structure pointer is not NULL,
XpmWriteFileFromImage looks for the following attributes:
XpmColormap, XpmHotspot, XpmCharsPerPixel, XpmRgbFilename, and XpmExtensions.
As a backward compatibility feature, XpmWriteFileFromImage also looks for the XpmInfos attributes.
If the filename contains an extension such as “.xpm”, in order to get a valid C variable name, the dot character is
replaced by an underscore ’_’ when writing out.
As a backward compatibility feature, if the XpmInfos attributes are defined it writes out possible stored
information such as comments, color defaults and symbol.
Finally, if the XpmRgbFilenameattribute is defined, XpmWriteFileFromImage searches for color names in
this file and if found writes them out instead of the rgb values.

In addition on systems which support such features if the given file name ends by ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then, XpmWriteFileFromImage writes to a pipedcompress or gzip process.
And if instead of a file name NULL is passed to XpmWriteFileFromImage, it writes to the standard output.

.SS XpmWriteFileFromPixmap
To write out a Pixmap to an XPM file, use XpmWriteFileFromPixmap.

If the passed XpmAttributes structure pointer is not NULL,
XpmWriteFileFromPixmap looks for the following attributes: XpmSize.
If they are not defined it performs an XGetGeometry operation.
Then it uses XGetImage to get from the given pixmaps the related X images which are passed to XpmWriteFileFromImage.
Finally XpmWriteFileFromPixmap destroys the created images using XDestroyImage.
The XpmWriteFileFromPixmap function returns the same errors as XpmWriteFileFromImage.

.SS XpmWriteFileFromData
XpmWriteFileFromData writes an XPM data array to an XPM file.

XpmWriteFileToData returns XpmOpenFailed if it cannot open the file,
XpmFileInvalid if this is not a valid XPM data, and XpmSuccess otherwise.

.SS XpmWriteFileFromXpmImage
To write out an XpmImage to an XPM file, use XpmWriteFileFromXpmImage.
The XpmWriteFileFromXpmImage function writes an image out to a file in the XPM format.
If the file cannot be opened, it returns XpmOpenFailed.
If insufficient working storage is allocated, it returns XpmNoMemory.
If no error occurs then it returns XpmSuccess.
If the passed XpmInfo structure pointer is not NULL, XpmWriteFileFromXpmImage looks for the following attributes:
XpmComments, XpmExtensions, and XpmHotspot, and writes the related information out as well.
In addition on systems which support such features if the given file name ends by ’.Z’ or ’.gz’ it is assumed to be a
compressed file. Then, XpmWriteFileFromXpmImage writes to a piped compress or gzip process. And if instead
of a file name NULL is passed to XpmWriteFileFromXpmImage, it writes to the standard output.

.SS XpmWriteFileFromBuffer
XpmWriteFileFromBuffer writes a XPM-buffer to a file.
XpmWriteFileFromBuffer returns XpmOpenFailed if it cannot open the file, and XpmSuccess otherwise.

As a convenience, the XpmReadFileToBuffer and XpmWriteFileFromBuffer are provided to copy a
file to a buffer and to write a file from a buffer.
Thus for instance one may decide to use XpmReadFileToBuffer, XpmCreatePixmapFromBuffer, and XpmFree
instead of XpmReadFileToPixmap. On some systems this may lead to a performance improvement,
since the parsing will be performed in memory, but it uses more memory.

.SH "SEE ALSO"
.BR XpmWriteFileFromData(__libmansuffix__) ,
.BR XpmWriteFileFromPixmap(__libmansuffix__) ,
.BR XpmWriteFileFromImage(__libmansuffix__) ,
.BR XpmWriteFileFromXpmImage(__libmansuffix__) ,
.BR XpmWriteFileFromBuffer(__libmansuffix__)
@


1.1.1.1
log
@initial import of libXpm-3.5.14
@
text
@@


1.1.1.2
log
@initial import of libXpm-3.5.15
@
text
@a29 1
.nf
d31 1
a31 2
.BI "int XpmWriteFileFromPixmap(Display *" display ", char *" filename ,
.BI "Pixmap " pixmap ", Pixmap " shapemask ", XpmAttributes *" attributes );
d33 1
a33 2
.BI "int XpmWriteFileFromImage(Display *" display " , char *" filename ,
.BI "XImage *"image ", XImage *" shapeimage ", XpmAttributes *" attributes );
d35 1
a35 1
.BI "int XpmWriteFileFromData(char *" filename ", char **" data );
d37 1
a37 2
.BI "int XpmWriteFileFromXpmImage(char *" filename ", XpmImage *" image ,
.BI "XImage *" shapeimage ", XpmInfo *" info );
d39 1
a39 2
.BI "int XpmWriteFileFromBuffer(char *" filename ", char *" buffer );
.fi
d42 1
d64 5
a68 13
.PP
The
.BR XpmWriteFileFromImage ()
function writes an
.I image and its possible
.I shapeimage
out to a file in the XPM format.
If the file cannot be opened, it returns
.BR XpmOpenFailed .
If insufficient working storage is allocated, it returns
.BR XpmNoMemory .
If no error occurs then it returns
.BR XpmSuccess .
d70 1
a70 2
.BR XpmWriteFileFromImage ()
looks for the following attributes:
d72 2
a73 5
As a backward compatibility feature,
.BR XpmWriteFileFromImage ()
also looks for the XpmInfos attributes.
If the filename contains an extension such as “.xpm”, in order to get a valid C
variable name, the dot character is
d77 1
a77 3
Finally, if the XpmRgbFilenameattribute is defined,
.BR XpmWriteFileFromImage ()
searches for color names in
d79 4
a82 8
.PP
In addition on systems which support such features if the given file name ends
by ’.Z’ or ’.gz’ it is assumed to be a compressed file. Then,
.BR XpmWriteFileFromImage ()
writes to a piped compress or gzip process.
And if instead of a file name, NULL is passed to
.BR XpmWriteFileFromImage (),
it writes to the standard output.
d85 2
a86 4
.PP
To write out a Pixmap to an XPM file, use
.BR XpmWriteFileFromPixmap ().
.PP
d88 1
a88 2
.BR XpmWriteFileFromPixmap ()
looks for the following attributes: XpmSize.
d90 3
a92 9
Then it uses XGetImage to get from the given pixmaps the related X images which are passed to
.BR XpmWriteFileFromImage ().
Finally
.BR XpmWriteFileFromPixmap ()
destroys the created images using XDestroyImage.
The
.BR XpmWriteFileFromPixmap ()
function returns the same errors as
.BR XpmWriteFileFromImage ().
d95 4
a98 12
.PP
.BR XpmWriteFileFromData ()
writes an XPM data array to an XPM file.
.PP
.BR XpmWriteFileToData ()
returns
.B XpmOpenFailed
if it cannot open the file,
.B XpmFileInvalid
if this is not a valid XPM data, and
.B XpmSuccess
otherwise.
d101 10
a110 24
.PP
To write out an XpmImage to an XPM file, use
.BR XpmWriteFileFromXpmImage ().
The
.BR XpmWriteFileFromXpmImage ()
function writes an image out to a file in the XPM format.
If the file cannot be opened, it returns
.BR XpmOpenFailed .
If insufficient working storage is allocated, it returns
.BR XpmNoMemory .
If no error occurs then it returns
.BR XpmSuccess .
If the passed XpmInfo structure pointer is not NULL,
.BR XpmWriteFileFromXpmImage()
looks for the following attributes:
XpmComments, XpmExtensions, and XpmHotspot,
and writes the related information out as well.
In addition on systems which support such features if the given file name ends
by ’.Z’ or ’.gz’ it is assumed to be a compressed file. Then,
.BR XpmWriteFileFromXpmImage ()
writes to a piped compress or gzip process.
And if instead of a file name, NULL is passed to
.BR XpmWriteFileFromXpmImage (),
it writes to the standard output.
d113 7
a119 24
.PP
.BR XpmWriteFileFromBuffer ()
writes a XPM buffer to a file.
.BR XpmWriteFileFromBuffer ()
returns
.B XpmOpenFailed
if it cannot open the file, and
.B XpmSuccess
otherwise.
.PP
As a convenience, the
.BR XpmReadFileToBuffer ()
and
.BR XpmWriteFileFromBuffer ()
functions
are provided to copy a file to a buffer and to write a file from a buffer.
Thus for instance one may decide to use
.BR XpmCreateBufferFromPixmap (),
.BR XpmWriteFileFromBuffer (),
and
.BR XpmFree ()
instead of
.BR XpmWriteFileFromPixmap ().
On some systems this may lead to a performance improvement,
a121 1

d123 5
a127 3
.ad l
.nh
.BR XpmRead (__libmansuffix__)
@


1.1.1.2.4.1
log
@Pull up the following, requested by mrg in ticket #259:

	xsrc/external/mit/libXpm/dist/doc/README.AMIGA       delete
	xsrc/external/mit/libXpm/dist/doc/README.MSW         delete
	xsrc/external/mit/libXpm/dist/src/amigax.c           delete
	xsrc/external/mit/libXpm/dist/src/amigax.h           delete
	xsrc/external/mit/libXpm/dist/src/rgbtab.h           delete
	xsrc/external/mit/libXpm/dist/src/simx.c             delete
	xsrc/external/mit/libXpm/dist/src/simx.h             delete
	xsrc/external/mit/libXpm/dist/ChangeLog              up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/Makefile.in            up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/aclocal.m4             up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/compile                up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/config.guess           up to 1.1.1.10
	xsrc/external/mit/libXpm/dist/config.h.in            up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/config.sub             up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/configure              up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/configure.ac           up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/depcomp                up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/install-sh             up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/ltmain.sh              up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/missing                up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/tap-driver.sh          up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/test-driver            up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/cxpm/Makefile.in       up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/doc/Makefile.am        up to 1.1.1.2
	xsrc/external/mit/libXpm/dist/doc/Makefile.in        up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/include/Makefile.in    up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/include/X11/xpm.h      up to 1.1.1.5
	xsrc/external/mit/libXpm/dist/m4/libtool.m4          up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/m4/ltoptions.m4        up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/m4/ltsugar.m4          up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/m4/ltversion.m4        up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/m4/lt~obsolete.m4      up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/man/Makefile.in        up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/man/XpmCreateBuffer.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreateData.man  up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreateImage.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreatePixmap.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImage.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmMisc.man        up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmRead.man        up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmWrite.man       up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/cxpm.man           up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/sxpm.man           up to 1.1.1.2
	xsrc/external/mit/libXpm/dist/src/CrBufFrI.c         up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/src/CrDatFrI.c         up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/src/Makefile.am        up to 1.1.1.4
	xsrc/external/mit/libXpm/dist/src/Makefile.in        up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/src/RdFToBuf.c         up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/src/RdFToI.c           up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/src/WrFFrI.c           up to 1.1.1.10
	xsrc/external/mit/libXpm/dist/src/XpmI.h             up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/src/create.c           up to 1.8
	xsrc/external/mit/libXpm/dist/src/data.c             up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/src/misc.c             up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/src/parse.c            up to 1.1.1.10
	xsrc/external/mit/libXpm/dist/src/rgb.c              up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/src/scan.c             up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/sxpm/Makefile.in       up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/test/Makefile.in       up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/test/XpmWrite.c        up to 1.1.1.4
	xsrc/external/mit/libXpm/dist/test/pixmaps/good/chromesphere.xpm up to 1.1.1.2

Apply upstream fixes for CVE-2026-4367.
@
text
@d47 1
a47 1
.IP \fIdisplay\fP 1i
d49 1
a49 1
.IP \fIfilename\fP 1i
d51 1
a51 1
.IP \fIpixmap\fP 1i
d53 1
a53 1
.IP \fIshapemask\fP 1i
d55 1
a55 1
.IP \fIattributes\fP 1i
d57 1
a57 1
.IP \fIdata\fP 1i
d59 1
a59 1
.IP \fIimage\fP 1i
d61 1
a61 1
.IP \fIinfo\fP 1i
d63 1
a63 1
.IP \fIbuffer\fP 1i
d68 1
d88 2
a89 2
If the filename contains an extension such as “.xpm”,
in order to get a valid C variable name, the dot character is
d91 1
a91 2
As a backward compatibility feature,
if the XpmInfos attributes are defined it writes out possible stored
d98 2
a99 3
In addition on systems which support such features
if the given file name ends with ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then,
d107 1
d115 1
a115 2
Then it uses XGetImage to get from the given pixmaps
the related X images which are passed to
d126 1
d140 1
d153 1
a153 1
.BR XpmWriteFileFromXpmImage ()
d157 2
a158 3
In addition on systems which support such features
if the given file name ends with ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then,
d166 1
@


1.1.1.3
log
@initial import of libXpm-3.5.19
@
text
@d47 1
a47 1
.IP \fIdisplay\fP 1i
d49 1
a49 1
.IP \fIfilename\fP 1i
d51 1
a51 1
.IP \fIpixmap\fP 1i
d53 1
a53 1
.IP \fIshapemask\fP 1i
d55 1
a55 1
.IP \fIattributes\fP 1i
d57 1
a57 1
.IP \fIdata\fP 1i
d59 1
a59 1
.IP \fIimage\fP 1i
d61 1
a61 1
.IP \fIinfo\fP 1i
d63 1
a63 1
.IP \fIbuffer\fP 1i
d68 1
d88 2
a89 2
If the filename contains an extension such as “.xpm”,
in order to get a valid C variable name, the dot character is
d91 1
a91 2
As a backward compatibility feature,
if the XpmInfos attributes are defined it writes out possible stored
d98 2
a99 3
In addition on systems which support such features
if the given file name ends with ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then,
d107 1
d115 1
a115 2
Then it uses XGetImage to get from the given pixmaps
the related X images which are passed to
d126 1
d140 1
d153 1
a153 1
.BR XpmWriteFileFromXpmImage ()
d157 2
a158 3
In addition on systems which support such features
if the given file name ends with ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then,
d166 1
@


1.1.1.2.2.1
log
@file XpmWrite.man was added on branch netbsd-10 on 2023-01-23 13:49:21 +0000
@
text
@d1 196
@


1.1.1.2.2.2
log
@Sync with HEAD, requested by mrg in ticket #59:

	external/mit/libXpm/dist/man/XpmAttributesSize.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateBuffer.man up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmCreateBufferFromImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateBufferFromPixmap.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateBufferFromXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateData.man  up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmCreateDataFromImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateDataFromPixmap.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateDataFromXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateImage.man up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmFree.man        up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateImageFromBuffer.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateImageFromData.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateImageFromXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreatePixmap.man up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmCreatePixmapFromBuffer.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreatePixmapFromData.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreatePixmapFromXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateXpmImage.man up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmCreateXpmImageFromBuffer.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateXpmImageFromData.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateXpmImageFromImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmCreateXpmImageFromPixmap.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmFreeAttributes.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmFreeXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmFreeExtensions.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmFreeXpmInfo.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmGetErrorString.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmLibraryVersion.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmMisc.man        up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmRead.man        up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmReadFileToBuffer.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmReadFileToData.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmReadFileToImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmReadFileToPixmap.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmReadFileToXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmWrite.man       up to 1.1.1.2
	external/mit/libXpm/dist/man/XpmWriteFileFromBuffer.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmWriteFileFromImage.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmWriteFileFromPixmap.man up to 1.1.1.1
	external/mit/libXpm/dist/man/XpmWriteFileFromXpmImage.man up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/BlueCurves.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/Dimple.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/Dolphins.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/Miniweave.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/Squares.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/Swirl.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/Utah-teapot.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/chromesphere.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/plaid-lisp.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/plaid-v1.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/plaid-v2.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/plaid-v3.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/xorg-bw.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/good/xorg.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/CVE-2016-10164-poc.xpm.gz.gz.gz up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/doom.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/doom2.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/invalid-type.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/no-contents.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/unending-comment-c.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/zero-width-v1.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/invalid/zero-width.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/pixmaps/no-mem/oversize.xpm up to 1.1.1.1
	external/mit/libXpm/dist/test/CompareXpmImage.h up to 1.1.1.1
	external/mit/libXpm/dist/test/Makefile.am       up to 1.1.1.1
	external/mit/libXpm/dist/test/Makefile.in       up to 1.1.1.1
	external/mit/libXpm/dist/test/TestAllFiles.h    up to 1.1.1.1
	external/mit/libXpm/dist/test/XpmCreate.c       up to 1.1.1.1
	external/mit/libXpm/dist/test/XpmMisc.c         up to 1.1.1.1
	external/mit/libXpm/dist/test/XpmRead.c         up to 1.1.1.1
	external/mit/libXpm/dist/test/XpmWrite.c        up to 1.1.1.1
	external/mit/libXpm/dist/test/tap-test          up to 1.1.1.1
	external/mit/libXpm/dist/tap-driver.sh          up to 1.1.1.1
	external/mit/libXpm/dist/test-driver            up to 1.1.1.1
	external/mit/libXpm/dist/AUTHORS                up to 1.1.1.2
	external/mit/libXpm/dist/COPYING                up to 1.1.1.4
	external/mit/libXpm/dist/ChangeLog              up to 1.1.1.9
	external/mit/libXpm/dist/Makefile.am            up to 1.1.1.6
	external/mit/libXpm/dist/Makefile.in            up to 1.1.1.9
	external/mit/libXpm/dist/README.md              up to 1.1.1.3
	external/mit/libXpm/dist/aclocal.m4             up to 1.1.1.9
	external/mit/libXpm/dist/compile                up to 1.1.1.4
	external/mit/libXpm/dist/config.guess           up to 1.1.1.7
	external/mit/libXpm/dist/config.h.in            up to 1.1.1.6
	external/mit/libXpm/dist/config.sub             up to 1.1.1.8
	external/mit/libXpm/dist/configure              up to 1.1.1.9
	external/mit/libXpm/dist/configure.ac           up to 1.1.1.9
	external/mit/libXpm/dist/depcomp                up to 1.1.1.6
	external/mit/libXpm/dist/install-sh             up to 1.1.1.6
	external/mit/libXpm/dist/ltmain.sh              up to 1.1.1.9
	external/mit/libXpm/dist/missing                up to 1.1.1.7
	external/mit/libXpm/dist/cxpm/Makefile.in       up to 1.1.1.9
	external/mit/libXpm/dist/cxpm/cxpm.c            up to 1.1.1.5
	external/mit/libXpm/dist/doc/Makefile.in        up to 1.1.1.7
	external/mit/libXpm/dist/doc/README.MSW         up to 1.1.1.3
	external/mit/libXpm/dist/doc/README.html        up to 1.1.1.3
	external/mit/libXpm/dist/include/Makefile.in    up to 1.1.1.7
	external/mit/libXpm/dist/m4/libtool.m4          up to 1.1.1.4
	external/mit/libXpm/dist/man/Makefile.am        up to 1.1.1.2
	external/mit/libXpm/dist/man/Makefile.in        up to 1.1.1.6
	external/mit/libXpm/dist/src/Makefile.in        up to 1.1.1.9
	external/mit/libXpm/dist/src/RdFToI.c           up to 1.1.1.5
	external/mit/libXpm/dist/src/WrFFrI.c           up to 1.1.1.7
	external/mit/libXpm/dist/src/create.c           up to 1.5
	external/mit/libXpm/dist/src/data.c             up to 1.1.1.5
	external/mit/libXpm/dist/src/hashtab.c          up to 1.1.1.4
	external/mit/libXpm/dist/src/parse.c            up to 1.1.1.8
	external/mit/libXpm/dist/src/rgbtab.h           up to 1.1.1.2
	external/mit/libXpm/dist/src/scan.c             up to 1.1.1.5
	external/mit/libXpm/dist/sxpm/Makefile.in       up to 1.1.1.9

Upstream fixes for CVE-2022-46285, CVE-2022-44617, and CVE-2022-4883.
@
text
@a0 196
.\" Copyright (C) 1989-95 GROUPE BULL
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
.\" of this software and associated documentation files (the "Software"), to
.\" deal in the Software without restriction, including without limitation the
.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
.\" sell copies of the Software, and to permit persons to whom the Software is
.\" furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
.\" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of GROUPE BULL shall not be
.\" used in advertising or otherwise to promote the sale, use or other dealings
.\" in this Software without prior written authorization from GROUPE BULL.
.\"
.hw XImage
.TH XpmWrite __libmansuffix__ __xorgversion__ "libXpm functions"
.SH NAME
XpmWrite \- write an XPM file

.SH SYNOPSIS
.nf
.HP
.BI "int XpmWriteFileFromPixmap(Display *" display ", char *" filename ,
.BI "Pixmap " pixmap ", Pixmap " shapemask ", XpmAttributes *" attributes );
.HP
.BI "int XpmWriteFileFromImage(Display *" display " , char *" filename ,
.BI "XImage *"image ", XImage *" shapeimage ", XpmAttributes *" attributes );
.HP
.BI "int XpmWriteFileFromData(char *" filename ", char **" data );
.HP
.BI "int XpmWriteFileFromXpmImage(char *" filename ", XpmImage *" image ,
.BI "XImage *" shapeimage ", XpmInfo *" info );
.HP
.BI "int XpmWriteFileFromBuffer(char *" filename ", char *" buffer );
.fi

.SH ARGUMENTS
.IP \fIdisplay\fP li
Specifies the connection to the X server.
.IP \fIfilename\fP li
Specifies the file name to use.
.IP \fIpixmap\fP li
Specifies the pixmap.
.IP \fIshapemask\fP li
Specifies the shape mask pixmap.
.IP \fIattributes\fP li
Specifies the location of a structure containing information (or NULL).
.IP \fIdata\fP li
Specifies the data array to read.
.IP \fIimage\fP li
Specifies the image.
.IP \fIinfo\fP li
Specifies the location of a structure to get information from (or NULL).
.IP \fIbuffer\fP li
Specifies the buffer to read.

.SH DESCRIPTION
.SS XpmWriteFileFromImage
.PP
The
.BR XpmWriteFileFromImage ()
function writes an
.I image and its possible
.I shapeimage
out to a file in the XPM format.
If the file cannot be opened, it returns
.BR XpmOpenFailed .
If insufficient working storage is allocated, it returns
.BR XpmNoMemory .
If no error occurs then it returns
.BR XpmSuccess .
If the passed XpmAttributes structure pointer is not NULL,
.BR XpmWriteFileFromImage ()
looks for the following attributes:
XpmColormap, XpmHotspot, XpmCharsPerPixel, XpmRgbFilename, and XpmExtensions.
As a backward compatibility feature,
.BR XpmWriteFileFromImage ()
also looks for the XpmInfos attributes.
If the filename contains an extension such as “.xpm”, in order to get a valid C
variable name, the dot character is
replaced by an underscore ’_’ when writing out.
As a backward compatibility feature, if the XpmInfos attributes are defined it writes out possible stored
information such as comments, color defaults and symbol.
Finally, if the XpmRgbFilenameattribute is defined,
.BR XpmWriteFileFromImage ()
searches for color names in
this file and if found writes them out instead of the rgb values.
.PP
In addition on systems which support such features if the given file name ends
by ’.Z’ or ’.gz’ it is assumed to be a compressed file. Then,
.BR XpmWriteFileFromImage ()
writes to a piped compress or gzip process.
And if instead of a file name, NULL is passed to
.BR XpmWriteFileFromImage (),
it writes to the standard output.

.SS XpmWriteFileFromPixmap
.PP
To write out a Pixmap to an XPM file, use
.BR XpmWriteFileFromPixmap ().
.PP
If the passed XpmAttributes structure pointer is not NULL,
.BR XpmWriteFileFromPixmap ()
looks for the following attributes: XpmSize.
If they are not defined it performs an XGetGeometry operation.
Then it uses XGetImage to get from the given pixmaps the related X images which are passed to
.BR XpmWriteFileFromImage ().
Finally
.BR XpmWriteFileFromPixmap ()
destroys the created images using XDestroyImage.
The
.BR XpmWriteFileFromPixmap ()
function returns the same errors as
.BR XpmWriteFileFromImage ().

.SS XpmWriteFileFromData
.PP
.BR XpmWriteFileFromData ()
writes an XPM data array to an XPM file.
.PP
.BR XpmWriteFileToData ()
returns
.B XpmOpenFailed
if it cannot open the file,
.B XpmFileInvalid
if this is not a valid XPM data, and
.B XpmSuccess
otherwise.

.SS XpmWriteFileFromXpmImage
.PP
To write out an XpmImage to an XPM file, use
.BR XpmWriteFileFromXpmImage ().
The
.BR XpmWriteFileFromXpmImage ()
function writes an image out to a file in the XPM format.
If the file cannot be opened, it returns
.BR XpmOpenFailed .
If insufficient working storage is allocated, it returns
.BR XpmNoMemory .
If no error occurs then it returns
.BR XpmSuccess .
If the passed XpmInfo structure pointer is not NULL,
.BR XpmWriteFileFromXpmImage()
looks for the following attributes:
XpmComments, XpmExtensions, and XpmHotspot,
and writes the related information out as well.
In addition on systems which support such features if the given file name ends
by ’.Z’ or ’.gz’ it is assumed to be a compressed file. Then,
.BR XpmWriteFileFromXpmImage ()
writes to a piped compress or gzip process.
And if instead of a file name, NULL is passed to
.BR XpmWriteFileFromXpmImage (),
it writes to the standard output.

.SS XpmWriteFileFromBuffer
.PP
.BR XpmWriteFileFromBuffer ()
writes a XPM buffer to a file.
.BR XpmWriteFileFromBuffer ()
returns
.B XpmOpenFailed
if it cannot open the file, and
.B XpmSuccess
otherwise.
.PP
As a convenience, the
.BR XpmReadFileToBuffer ()
and
.BR XpmWriteFileFromBuffer ()
functions
are provided to copy a file to a buffer and to write a file from a buffer.
Thus for instance one may decide to use
.BR XpmCreateBufferFromPixmap (),
.BR XpmWriteFileFromBuffer (),
and
.BR XpmFree ()
instead of
.BR XpmWriteFileFromPixmap ().
On some systems this may lead to a performance improvement,
since the parsing will be performed in memory, but it uses more memory.


.SH "SEE ALSO"
.ad l
.nh
.BR XpmRead (__libmansuffix__)
@


1.1.1.2.2.3
log
@Pull up the following, requested by mrg in ticket #1256:

	xsrc/external/mit/libXpm/dist/doc/README.AMIGA       delete
	xsrc/external/mit/libXpm/dist/doc/README.MSW         delete
	xsrc/external/mit/libXpm/dist/src/amigax.c           delete
	xsrc/external/mit/libXpm/dist/src/amigax.h           delete
	xsrc/external/mit/libXpm/dist/src/rgbtab.h           delete
	xsrc/external/mit/libXpm/dist/src/simx.c             delete
	xsrc/external/mit/libXpm/dist/src/simx.h             delete
	xsrc/external/mit/libXpm/dist/ChangeLog              up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/Makefile.in            up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/aclocal.m4             up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/compile                up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/config.guess           up to 1.1.1.10
	xsrc/external/mit/libXpm/dist/config.h.in            up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/config.sub             up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/configure              up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/configure.ac           up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/depcomp                up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/install-sh             up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/ltmain.sh              up to 1.1.1.12
	xsrc/external/mit/libXpm/dist/missing                up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/tap-driver.sh          up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/test-driver            up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/cxpm/Makefile.in       up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/doc/Makefile.am        up to 1.1.1.2
	xsrc/external/mit/libXpm/dist/doc/Makefile.in        up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/include/Makefile.in    up to 1.1.1.9
	xsrc/external/mit/libXpm/dist/include/X11/xpm.h      up to 1.1.1.5
	xsrc/external/mit/libXpm/dist/m4/libtool.m4          up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/m4/ltoptions.m4        up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/m4/ltsugar.m4          up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/m4/ltversion.m4        up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/m4/lt~obsolete.m4      up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/man/Makefile.in        up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/man/XpmCreateBuffer.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreateData.man  up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreateImage.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreatePixmap.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImage.man up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmMisc.man        up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmRead.man        up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/XpmWrite.man       up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/cxpm.man           up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/man/sxpm.man           up to 1.1.1.2
	xsrc/external/mit/libXpm/dist/src/CrBufFrI.c         up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/src/CrDatFrI.c         up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/src/Makefile.am        up to 1.1.1.4
	xsrc/external/mit/libXpm/dist/src/Makefile.in        up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/src/RdFToBuf.c         up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/src/RdFToI.c           up to 1.1.1.8
	xsrc/external/mit/libXpm/dist/src/WrFFrI.c           up to 1.1.1.10
	xsrc/external/mit/libXpm/dist/src/XpmI.h             up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/src/create.c           up to 1.8
	xsrc/external/mit/libXpm/dist/src/data.c             up to 1.1.1.7
	xsrc/external/mit/libXpm/dist/src/misc.c             up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/src/parse.c            up to 1.1.1.10
	xsrc/external/mit/libXpm/dist/src/rgb.c              up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/src/scan.c             up to 1.1.1.6
	xsrc/external/mit/libXpm/dist/sxpm/Makefile.in       up to 1.1.1.11
	xsrc/external/mit/libXpm/dist/test/Makefile.in       up to 1.1.1.3
	xsrc/external/mit/libXpm/dist/test/XpmWrite.c        up to 1.1.1.4
	xsrc/external/mit/libXpm/dist/test/pixmaps/good/chromesphere.xpm up to 1.1.1.2

Apply upstream fixes for CVE-2026-4367.
@
text
@d47 1
a47 1
.IP \fIdisplay\fP 1i
d49 1
a49 1
.IP \fIfilename\fP 1i
d51 1
a51 1
.IP \fIpixmap\fP 1i
d53 1
a53 1
.IP \fIshapemask\fP 1i
d55 1
a55 1
.IP \fIattributes\fP 1i
d57 1
a57 1
.IP \fIdata\fP 1i
d59 1
a59 1
.IP \fIimage\fP 1i
d61 1
a61 1
.IP \fIinfo\fP 1i
d63 1
a63 1
.IP \fIbuffer\fP 1i
d68 1
d88 2
a89 2
If the filename contains an extension such as “.xpm”,
in order to get a valid C variable name, the dot character is
d91 1
a91 2
As a backward compatibility feature,
if the XpmInfos attributes are defined it writes out possible stored
d98 2
a99 3
In addition on systems which support such features
if the given file name ends with ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then,
d107 1
d115 1
a115 2
Then it uses XGetImage to get from the given pixmaps
the related X images which are passed to
d126 1
d140 1
d153 1
a153 1
.BR XpmWriteFileFromXpmImage ()
d157 2
a158 3
In addition on systems which support such features
if the given file name ends with ’.Z’ or ’.gz’
it is assumed to be a compressed file. Then,
d166 1
@


