home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / xpm / code / xpmwrite.c < prev   
Encoding:
C/C++ Source or Header  |  1994-06-20  |  2.7 KB  |  69 lines

  1. /*
  2.  * Copyright 1989-94 GROUPE BULL
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and its
  5.  * documentation for any purpose and without fee is hereby granted, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of GROUPE BULL not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  GROUPE BULL makes no representations about the
  11.  * suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * GROUPE BULL disclaims all warranties with regard to this software,
  15.  * including all implied warranties of merchantability and fitness,
  16.  * in no event shall GROUPE BULL be liable for any special,
  17.  * indirect or consequential damages or any damages
  18.  * whatsoever resulting from loss of use, data or profits,
  19.  * whether in an action of contract, negligence or other tortious
  20.  * action, arising out of or in connection with the use
  21.  * or performance of this software.
  22.  *
  23.  */
  24.  
  25. Arnaud LE HORS      BULL Research FRANCE -- Koala Project
  26.                     (XPM - X PixMap format version 2 & 3)
  27.     Internet:       lehors@sophia.inria.fr
  28. Surface Mail:       Arnaud LE HORS, INRIA - Sophia Antipolis,
  29.                     2004, route des Lucioles, 06565 Valbonne Cedex -- FRANCE
  30.  Voice phone:       (33) 93.65.77.71, Fax: (33) 93 65 77 66, Telex: 97 00 50 F
  31.  
  32.  
  33. /*****************************************************************************\
  34. * XpmWrFFrData.c:                                                             *
  35. *                                                                             *
  36. *  XPM library                                                                *
  37. *  Parse an Xpm array and write a file that corresponds to it.                *
  38. *                                                                             *
  39. *  Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com              *
  40. \*****************************************************************************/
  41.  
  42. #include "xpmP.h"
  43.  
  44. int
  45. XpmWriteFileFromData(filename, data)
  46.     char *filename;
  47.     char **data;
  48. {
  49.     XpmImage image;
  50.     XpmInfo info;
  51.     int ErrorStatus;
  52.  
  53.     info.valuemask = XpmReturnComments | XpmReturnExtensions;
  54.  
  55.     ErrorStatus = XpmCreateXpmImageFromData(data, &image, &info);
  56.  
  57.     if (ErrorStatus != XpmSuccess)
  58.     return (ErrorStatus);
  59.  
  60.     ErrorStatus = XpmWriteFileFromXpmImage(filename, &image, &info);
  61.  
  62.     XpmFreeXpmImage(&image);
  63.     XpmFreeXpmInfo(&info);
  64.  
  65.     return (ErrorStatus);
  66. }
  67.  
  68.  
  69.