commit 3e629b4eb3e018cffbc7cfb6368fa1231389d9d6
Author: David C. Lonie <david.lonie@kitware.com>
Date:   Mon Oct 1 14:27:12 2012 -0400

    Add API to query current mode.
    
    This is useful when formatting raw markup for gl2psSpecial calls.

diff --git a/gl2ps.c b/gl2ps.c
index 15059ba..7a9c51b 100644
--- a/gl2ps.c
+++ b/gl2ps.c
@@ -6083,3 +6083,8 @@ GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format)
   else
     return "Unknown format";
 }
+
+GL2PSDLL_API GLint gl2psGetFileFormat()
+{
+  return gl2ps->format;
+}
diff --git a/gl2ps.h b/gl2ps.h
index b674f1d..9f41e1b 100644
--- a/gl2ps.h
+++ b/gl2ps.h
@@ -192,6 +192,7 @@ GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height,
                                      const unsigned char *imagemap);
 GL2PSDLL_API const char *gl2psGetFileExtension(GLint format);
 GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format);
+GL2PSDLL_API GLint gl2psGetFileFormat();
 
 #if defined(__cplusplus)
 }
