From 9a80c69290079feaafc0e3c5dba576329f1d5576 Mon Sep 17 00:00:00 2001
From: Per Hedbor <ph@opera.com>
Date: Tue, 6 Apr 1999 09:20:32 +0200
Subject: [PATCH] Added XPM support

Rev: src/modules/Image/image.c:1.119
---
 src/modules/Image/image.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/modules/Image/image.c b/src/modules/Image/image.c
index 756f1170d8..f38d926e63 100644
--- a/src/modules/Image/image.c
+++ b/src/modules/Image/image.c
@@ -1,9 +1,9 @@
-/* $Id: image.c,v 1.118 1999/04/06 06:23:31 per Exp $ */
+/* $Id: image.c,v 1.119 1999/04/06 07:20:32 per Exp $ */
 
 /*
 **! module Image
 **! note
-**!	$Id: image.c,v 1.118 1999/04/06 06:23:31 per Exp $
+**!	$Id: image.c,v 1.119 1999/04/06 07:20:32 per Exp $
 **! class image
 **!
 **!	The main object of the <ref>Image</ref> module, this object
@@ -97,7 +97,7 @@
 
 #include "stralloc.h"
 #include "global.h"
-RCSID("$Id: image.c,v 1.118 1999/04/06 06:23:31 per Exp $");
+RCSID("$Id: image.c,v 1.119 1999/04/06 07:20:32 per Exp $");
 #include "pike_macros.h"
 #include "object.h"
 #include "constants.h"
@@ -3495,6 +3495,7 @@ extern void exit_image_png(void);
 static struct pike_string 
    *magic_JPEG, 
    *magic_XFace,
+   *magic_XPM,
    *magic_PNG,
    *magic_TTF;
 
@@ -3523,6 +3524,14 @@ static void image_index_magic(INT32 args)
       SAFE_APPLY_MASTER("resolv",2);
       return;
    }
+   else if (sp[-1].u.string==magic_XPM)
+   {
+      pop_stack();
+      push_string(make_shared_string("_Image_XPM"));
+      push_int(0);
+      SAFE_APPLY_MASTER("resolv",2);
+      return;
+   }
    else if (sp[-1].u.string==magic_PNG)
    {
       pop_stack();
@@ -3553,6 +3562,7 @@ void pike_module_init(void)
    magic_TTF=make_shared_string("TTF");
    magic_PNG=make_shared_string("PNG");
    magic_XFace=make_shared_string("XFace");
+   magic_XPM=make_shared_string("XPM");
 
    image_noise_init();
 
@@ -3883,6 +3893,7 @@ void pike_module_exit(void)
    free_string(magic_PNG);
    free_string(magic_JPEG);
    free_string(magic_XFace);
+   free_string(magic_XPM);
    free_string(magic_TTF);
 }
 
-- 
GitLab