Index: trunk/archive/scripts/src/psAdditionals.c
===================================================================
--- trunk/archive/scripts/src/psAdditionals.c	(revision 4093)
+++ trunk/archive/scripts/src/psAdditionals.c	(revision 4309)
@@ -2,5 +2,5 @@
 #include <string.h>
 #include "pslib.h"
-#include "psmodule.h"
+#include "papmodule.h"
 
 
@@ -35,8 +35,8 @@
 
 
-const char *psMetadataLookupString(bool *status, const psMetadata *md, const char *key)
+char *psMetadataLookupString(bool *status, const psMetadata *md, const char *key)
 {
     psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments
-    const char *value = NULL;		// The value to return
+    char *value = NULL;			// The value to return
     if (!item) {
 	// The given key isn't in the metadata
@@ -64,4 +64,61 @@
 }
 
+papChip *psMetadataLookupChip(bool *status, const psMetadata *md, const char *key)
+{
+    psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments
+    papChip *value = NULL;		// The value to return
+    if (!item) {
+	// The given key isn't in the metadata
+	if (status) {
+	    *status = false;
+	} else {
+	    psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
+	}
+    } else if (item->type != PS_META_CHIP) {
+	// The value at the key isn't metadata
+	if (status) {
+	    *status = false;
+	} else {
+	    psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_CHIP, as expected.\n");
+	}
+	value = NULL;
+    } else {
+	// We have the requested metadata
+	if (status) {
+	    *status = true;
+	}
+	value = item->data.V; // The requested metadata
+    }
+    return value;
+}
+
+papCell *psMetadataLookupCell(bool *status, const psMetadata *md, const char *key)
+{
+    psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments
+    papCell *value = NULL;		// The value to return
+    if (!item) {
+	// The given key isn't in the metadata
+	if (status) {
+	    *status = false;
+	} else {
+	    psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
+	}
+    } else if (item->type != PS_META_CELL) {
+	// The value at the key isn't metadata
+	if (status) {
+	    *status = false;
+	} else {
+	    psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_CHIP, as expected.\n");
+	}
+	value = NULL;
+    } else {
+	// We have the requested metadata
+	if (status) {
+	    *status = true;
+	}
+	value = item->data.V; // The requested metadata
+    }
+    return value;
+}
 
 void psMetadataPrint(psMetadata *md, int level)
