# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the cr/include/cr_packfunctions.h file from the
# gl_header.parsed file.
import sys
import string
import apiutil
print """#ifndef CR_PACKFUNCTIONS_H
#define CR_PACKFUNCTIONS_H
/* DO NOT EDIT - THIS FILE GENERATED BY THE pack_header.py SCRIPT */
/* Prototypes for the OpenGL packer functions in packer.c and pack_bbox.c */
#include "chromium.h"
#include "state/cr_client.h"
#include "cr_pack.h"
#ifdef WINDOWS
#define PACK_APIENTRY __stdcall
#else
#define PACK_APIENTRY
#endif
#ifdef __cplusplus
extern "C" {
#endif
"""
# OK, generate a crPackFooBar() prototype for this function
if return_type != 'void':
else:
print 'void PACK_APIENTRY crPack%s( %s );' % (func_name, apiutil.MakeDeclarationStringWithContext('CR_PACKER_CONTEXT', args))
print 'void PACK_APIENTRY crPack%sSWAP( %s );' % (func_name, apiutil.MakeDeclarationStringWithContext('CR_PACKER_CONTEXT', args))
# Now generate special BBOX, COUNT, SWAP variations on the glVertex and
# glVertexAttrib functions.
print 'void PACK_APIENTRY crPack%sBBOX_COUNT(%s);' % (func_name, apiutil.MakeDeclarationString(args))
print 'void PACK_APIENTRY crPack%sBBOX_COUNTSWAP(%s);' % (func_name, apiutil.MakeDeclarationString(args))
print """
#ifdef __cplusplus
}
#endif
#endif /* CR_PACKFUNCTIONS_H */
"""