home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / xpm / code / xpmread.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-20  |  2.8 KB  |  76 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. /*****************************************************************************\
  35. * XpmRdFToData.c:                                                             *
  36. *                                                                             *
  37. *  XPM library                                                                *
  38. *  Parse an XPM file and create an array of strings corresponding to it.      *
  39. *                                                                             *
  40. *  Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com              *
  41. \*****************************************************************************/
  42.  
  43. #include "xpmP.h"
  44.  
  45. int
  46. XpmReadFileToData(filename, data_return)
  47.     char *filename;
  48.     char ***data_return;
  49. {
  50.     XpmImage image;
  51.     XpmInfo info;
  52.     int ErrorStatus;
  53.  
  54.     info.valuemask = XpmReturnComments | XpmReturnExtensions;
  55.  
  56.     /*
  57.      * initialize return value
  58.      */
  59.     if (data_return)
  60.     *data_return = NULL;
  61.  
  62.     ErrorStatus = XpmReadFileToXpmImage(filename, &image, &info);
  63.     if (ErrorStatus != XpmSuccess)
  64.     return (ErrorStatus);
  65.  
  66.     ErrorStatus =
  67.     XpmCreateDataFromXpmImage(data_return, &image, &info);
  68.  
  69.     XpmFreeXpmImage(&image);
  70.     XpmFreeXpmInfo(&info);
  71.  
  72.     return (ErrorStatus);
  73. }
  74.  
  75.  
  76.