aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/xpm/XpmWrFFrData.c
blob: 22ed71e9cb444cb3252f853531dddcaa4f27c848 (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
/* Copyright 1990,91 GROUPE BULL -- See license conditions in file COPYRIGHT */
/*****************************************************************************\
* XpmWrFFrData.c:                                                             *
*                                                                             *
*  XPM library                                                                *
*  Parse an Xpm array and write a file that corresponds to it.                *
*                                                                             *
*  Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com              *
\*****************************************************************************/

#include "xpmP.h"

int
XpmWriteFileFromData(filename, data)
    char *filename;
    char **data;
{
    XpmAttributes attributes;
    XpmImage image;
    int ErrorStatus;

    attributes.valuemask = XpmReturnExtensions;

    ErrorStatus = XpmCreateXpmImageFromData(data, &image, &attributes);

    if (ErrorStatus != XpmSuccess)
	return (ErrorStatus);

    ErrorStatus =
	XpmWriteFileFromXpmImage(filename, &image, &attributes, NULL);

    XpmFreeAttributes(&attributes);
    XpmFreeXpmImage(&image);

    return (ErrorStatus);
}