diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /vendor/x11iraf/xpm/XpmRdFToData.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'vendor/x11iraf/xpm/XpmRdFToData.c')
-rw-r--r-- | vendor/x11iraf/xpm/XpmRdFToData.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/vendor/x11iraf/xpm/XpmRdFToData.c b/vendor/x11iraf/xpm/XpmRdFToData.c new file mode 100644 index 00000000..d30292b7 --- /dev/null +++ b/vendor/x11iraf/xpm/XpmRdFToData.c @@ -0,0 +1,41 @@ +/* Copyright 1990,91 GROUPE BULL -- See license conditions in file COPYRIGHT */ +/*****************************************************************************\ +* XpmRdFToData.c: * +* * +* XPM library * +* Parse an XPM file and create an array of strings corresponding to it. * +* * +* Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com * +\*****************************************************************************/ + +#include "xpmP.h" + +int +XpmReadFileToData(filename, data_return) + char *filename; + char ***data_return; +{ + XpmAttributes attributes; + XpmImage image; + int ErrorStatus; + + attributes.valuemask = XpmReturnExtensions; + + /* + * initialize return value + */ + if (data_return) + *data_return = NULL; + + ErrorStatus = XpmReadFileToXpmImage(filename, &image, &attributes, NULL); + if (ErrorStatus != XpmSuccess) + return (ErrorStatus); + + ErrorStatus = + XpmCreateDataFromXpmImage(data_return, &image, &attributes); + + XpmFreeAttributes(&attributes); + XpmFreeXpmImage(&image); + + return (ErrorStatus); +} |