# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the pack_current.c file.
import sys
import apiutil
from pack_currenttypes import *
print """
/* DO NOT EDIT - THIS FILE GENERATED BY THE pack_current.py SCRIPT */
#include <memory.h>
#include "packer.h"
#include "state/cr_currentpointers.h"
#include <stdio.h>
void crPackOffsetCurrentPointers( int offset )
{
CR_GET_PACKER_CONTEXT(pc);
GLnormal_p *normal = &(pc->current.c.normal);
GLcolor_p *color = &(pc->current.c.color);
GLsecondarycolor_p *secondaryColor = &(pc->current.c.secondaryColor);
GLtexcoord_p *texCoord = &(pc->current.c.texCoord);
GLindex_p *index = &(pc->current.c.index);
GLedgeflag_p *edgeFlag = &(pc->current.c.edgeFlag);
GLvertexattrib_p *vertexAttrib = &(pc->current.c.vertexAttrib);
GLfogcoord_p *fogCoord = &(pc->current.c.fogCoord);
int i;
"""
for k in current_fns.keys():
print '\t{'
ptr += "[i]"
print "%s\t{" % indent
print "%s\t}" % indent
print '\t}'
print """
}
void crPackNullCurrentPointers( void )
{
CR_GET_PACKER_CONTEXT(pc);
CRCurrentStateAttr *c = &(pc->current.c);
"""
print '\tmemset ( c, 0, sizeof (CRCurrentStateAttr));'
print "}"