aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/xpm/XpmCrDataFrP.c
blob: 5d6024eb3cc332a5db7bbd9d82828d50efc9456e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright 1990-93 GROUPE BULL -- See license conditions in file COPYRIGHT */
/*****************************************************************************\
* XpmCrDataFP.c:                                                              *
*                                                                             *
*  XPM library                                                                *
*  Scan a pixmap and possibly its mask and create an XPM array                *
*                                                                             *
*  Developed by Arnaud Le Hors                                                *
\*****************************************************************************/

#include "xpmP.h"
#ifdef VMS
#include "sys$library:string.h"
#else
#if defined(SYSV) || defined(SVR4)
#include <string.h>
#else
#include <strings.h>
#endif
#endif

int
XpmCreateDataFromPixmap(display, data_return, pixmap, shapemask, attributes)
    Display *display;
    char ***data_return;
    Pixmap pixmap;
    Pixmap shapemask;
    XpmAttributes *attributes;
{
    int ErrorStatus;
    XpmImage image;

    /*
     * get the XpmImage
     */
    ErrorStatus = XpmCreateXpmImageFromPixmap(display, pixmap, shapemask,
					      &image, attributes);
    if (ErrorStatus == XpmSuccess) {
	/*
	 * create data from the XpmImage
	 */
	ErrorStatus =
	    XpmCreateDataFromXpmImage(data_return, &image, attributes);
	XpmFreeXpmImage(&image);
    }
    return (ErrorStatus);
}