new_contents: import sys;
  
  sys.path.append( '../../packer' )
  from pack_currenttypes import *;
  
  print '''
  #include "state/cr_statetypes.h"
  #include "cr_glwrapper.h"
  
  static double __read_double( void *src )
  {
      unsigned int *ui = (unsigned int *) src;
      double d;
      ((unsigned int *) &d)[0] = ui[0];
      ((unsigned int *) &d)[1] = ui[1];
      return d;
  }
  '''
  
  for k in gltypes.keys():
  	for i in range(1,5):
  		print 'void __convert_%s%d (GLfloat *dst, %s *src) {' % (k,i,gltypes[k]['type'])
  		if k == 'd':
  		  for j in range(1,i-1):
  		    print '\t*dst++ = (GLfloat) __read_double(src++);'
  		  print '\t*dst = (GLfloat) __read_double(src);'
  		else:
  		  for j in range(1,i-1):
  		    print '\t*dst++ = (GLfloat) *src++;';
  		  print '\t*dst = (GLfloat) *src;';
  		print '}\n';
  
  scale = {
  	'ub' : 'GL_MAXUBYTE',
  	'b'  : 'GL_MAXBYTE',
  	'us' : 'GL_MAXUSHORT',
  	's'  : 'GL_MAXSHORT',
  	'ui' : 'GL_MAXUINT',
  	'i'  : 'GL_MAXINT',
  	'f'  : '',
  	'd'  : ''
  }
  
  for k in gltypes.keys():
  	if k != 'f' and k != 'd' and k != 'l':
  		for i in range(1,5):
  			print 'void __convert_rescale_%s%d (GLfloat *dst, %s *src) {' % (k,i,gltypes[k]['type'])
  			for j in range(1,i-1):
  				print '\t*dst++ = ((GLfloat) *src++) / %s;' % scale[k]
  			print '\t*dst = ((GLfloat) *src) / %s;' % scale[k]
  			print '}\n'
  
  print '''
  
  void __convert_boolean (GLboolean *dst, GLboolean *src) {
  	*dst = *src;
  }
  '''
  
subject: Split out the convert functions since they're needed by the pincher, not just the current recovery mechanism. Shoot.