#! /bin/sh
# 
# Motif Tools Library, Version 3.1
# $Id: xpm2res,v 1.1.1.1 2001/02/10 13:52:45 motiftools Exp $
# 
# Written by David Flanagan.
# Copyright (c) 1992-2001 by David Flanagan.
# All Rights Reserved.  See the file COPYRIGHT for details.
# This is open source software.  See the file LICENSE for details.
# There is no warranty for this software.  See NO_WARRANTY for details.
#
# $Log: xpm2res,v $
# Revision 1.1.1.1  2001/02/10 13:52:45  motiftools
# Initial import of Xmt310 to CVS
#
#

sed '

# get rid of single-line comments 
/^\/\*.*\*\//d

# get rid of multi-line comments 
/\/\*/,/\*\//d

# Look for the image name in a line with no quotes
# Remove trailing };, if it occurs on a line with no quotes
/"/!{
	/;[ 	]*$/d
	s/.*\*[ 	]*\([a-zA-Z0-9_]*\)[ 	]*\[\].*/_Pixmaps_*\1: \\/
	b
}

# strip off quotes and commas
# add \n\ at the end each line
s/[ 	]*"\(.*\)"[,}; 	]*$/\1\\n\\/

' $@

# add a blank line
echo
