/* Copyright 2004-2006 Grant T. Olson. See license.txt for terms.*/
#include <Python.h>

/* file autogenerated by pyasm's makeStructs script on Mon May 29 15:38:07 2006 %/

/* Preprocessor abuse at it's finest.

   We could probably do all of this in a straight python file, but then
   it wouldn't be in sync with a particular build.  This insures we have
   the right offsets for our structs in a way we can't in pure python
*/

#define OFFSET_STRING(f) #f
#define OFFSET(m,s,f)     offset = PyInt_FromLong((long)&(((s*)0)->f));     Py_INCREF(offset);     PyModule_AddObject(m, OFFSET_STRING(f), offset);

/* Py_DEBUG implies Py_TRACE_REFS. */
#if defined(Py_DEBUG) && !defined(Py_TRACE_REFS)
#define Py_TRACE_REFS
#endif

/* Py_TRACE_REFS implies Py_REF_DEBUG. */
#if defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG)
#define Py_REF_DEBUG
#endif


static PyObject *StructsError;
static PyObject *offset;

static PyMethodDef StructsMethods[] = {

    {NULL, NULL, 0, NULL}        /* Sentinel */
};



static void
load_PyObject(PyObject* module)
{
#ifdef Py_TRACE_REFS
    OFFSET(module,PyObject,_ob_next);
    OFFSET(module,PyObject,_ob_prev);
#endif
    OFFSET(module,PyObject,ob_refcnt);
    OFFSET(module,PyObject,ob_type);
}

static void
load_PyVarObject(PyObject* module)
{
    load_PyObject(module);
    OFFSET(module,PyVarObject,ob_size);
}





/* Generated from file c:\Python24\include\abstract.h */




/* Generated from file c:\Python24\include\bitset.h */




/* Generated from file c:\Python24\include\boolobject.h */




/* Generated from file c:\Python24\include\bufferobject.h */




/* Generated from file c:\Python24\include\cellobject.h */


static void
load_PyCellObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyCellObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyCellObject,ob_ref);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyCellObject",sm);
}


/* Generated from file c:\Python24\include\ceval.h */




/* Generated from file c:\Python24\include\classobject.h */


static void
load_PyClassObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyClassObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyClassObject,cl_bases);
    OFFSET(sm,PyClassObject,cl_dict);
    OFFSET(sm,PyClassObject,cl_name);
    OFFSET(sm,PyClassObject,cl_getattr);
    OFFSET(sm,PyClassObject,cl_setattr);
    OFFSET(sm,PyClassObject,cl_delattr);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyClassObject",sm);
}
static void
load_PyInstanceObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyInstanceObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyInstanceObject,in_class);
    OFFSET(sm,PyInstanceObject,in_dict);
    OFFSET(sm,PyInstanceObject,in_weakreflist);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyInstanceObject",sm);
}
static void
load_PyMethodObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyMethodObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyMethodObject,im_func);
    OFFSET(sm,PyMethodObject,im_self);
    OFFSET(sm,PyMethodObject,im_class);
    OFFSET(sm,PyMethodObject,im_weakreflist);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyMethodObject",sm);
}


/* Generated from file c:\Python24\include\cobject.h */




/* Generated from file c:\Python24\include\codecs.h */




/* Generated from file c:\Python24\include\compile.h */


static void
load_PyCodeObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyCodeObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyCodeObject,co_argcount);
    OFFSET(sm,PyCodeObject,co_nlocals);
    OFFSET(sm,PyCodeObject,co_stacksize);
    OFFSET(sm,PyCodeObject,co_flags);
    OFFSET(sm,PyCodeObject,co_code);
    OFFSET(sm,PyCodeObject,co_consts);
    OFFSET(sm,PyCodeObject,co_names);
    OFFSET(sm,PyCodeObject,co_varnames);
    OFFSET(sm,PyCodeObject,co_freevars);
    OFFSET(sm,PyCodeObject,co_cellvars);
    OFFSET(sm,PyCodeObject,co_filename);
    OFFSET(sm,PyCodeObject,co_name);
    OFFSET(sm,PyCodeObject,co_firstlineno);
    OFFSET(sm,PyCodeObject,co_lnotab);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyCodeObject",sm);
}
/* Skipping struct PyFutureFeatures, not a PyObject based struct */


/* Generated from file c:\Python24\include\complexobject.h */


/* Skipping struct Py_complex, not a PyObject based struct */
static void
load_PyComplexObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyComplexObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyComplexObject,cval);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyComplexObject",sm);
}


/* Generated from file c:\Python24\include\cStringIO.h */




/* Generated from file c:\Python24\include\descrobject.h */


/* Skipping struct PyGetSetDef, not a PyObject based struct */
/* Skipping struct PyDescrObject, not a PyObject based struct */
/* Skipping struct PyMethodDescrObject, not a PyObject based struct */
/* Skipping struct PyMemberDescrObject, not a PyObject based struct */
/* Skipping struct PyGetSetDescrObject, not a PyObject based struct */
/* Skipping struct PyWrapperDescrObject, not a PyObject based struct */


/* Generated from file c:\Python24\include\dictobject.h */


/* Skipping struct PyDictEntry, not a PyObject based struct */


/* Generated from file c:\Python24\include\enumobject.h */




/* Generated from file c:\Python24\include\errcode.h */




/* Generated from file c:\Python24\include\eval.h */




/* Generated from file c:\Python24\include\fileobject.h */


static void
load_PyFileObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyFileObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyFileObject,f_fp);
    OFFSET(sm,PyFileObject,f_name);
    OFFSET(sm,PyFileObject,f_mode);
    OFFSET(sm,PyFileObject,f_close);
    OFFSET(sm,PyFileObject,f_softspace);
    OFFSET(sm,PyFileObject,f_binary);
    OFFSET(sm,PyFileObject,f_buf);
    OFFSET(sm,PyFileObject,f_bufend);
    OFFSET(sm,PyFileObject,f_bufptr);
    OFFSET(sm,PyFileObject,f_setbuf);
    OFFSET(sm,PyFileObject,f_univ_newline);
    OFFSET(sm,PyFileObject,f_newlinetypes);
    OFFSET(sm,PyFileObject,f_skipnextlf);
    OFFSET(sm,PyFileObject,f_encoding);
    OFFSET(sm,PyFileObject,weakreflist);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyFileObject",sm);
}


/* Generated from file c:\Python24\include\floatobject.h */


static void
load_PyFloatObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyFloatObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyFloatObject,ob_fval);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyFloatObject",sm);
}


/* Generated from file c:\Python24\include\frameobject.h */


/* Skipping struct PyTryBlock, not a PyObject based struct */
/* Skipping object PyFrameObject */


/* Generated from file c:\Python24\include\funcobject.h */


static void
load_PyFunctionObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyFunctionObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyFunctionObject,func_code);
    OFFSET(sm,PyFunctionObject,func_globals);
    OFFSET(sm,PyFunctionObject,func_defaults);
    OFFSET(sm,PyFunctionObject,func_closure);
    OFFSET(sm,PyFunctionObject,func_doc);
    OFFSET(sm,PyFunctionObject,func_name);
    OFFSET(sm,PyFunctionObject,func_dict);
    OFFSET(sm,PyFunctionObject,func_weakreflist);
    OFFSET(sm,PyFunctionObject,func_module);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyFunctionObject",sm);
}


/* Generated from file c:\Python24\include\genobject.h */


static void
load_PyGenObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyGenObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyGenObject,gi_frame);
    OFFSET(sm,PyGenObject,gi_running);
    OFFSET(sm,PyGenObject,gi_weakreflist);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyGenObject",sm);
}


/* Generated from file c:\Python24\include\graminit.h */




/* Generated from file c:\Python24\include\grammar.h */


/* Skipping struct label, not a PyObject based struct */
/* Skipping struct labellist, not a PyObject based struct */
/* Skipping struct arc, not a PyObject based struct */
/* Skipping struct state, not a PyObject based struct */
/* Skipping struct dfa, not a PyObject based struct */
/* Skipping struct grammar, not a PyObject based struct */


/* Generated from file c:\Python24\include\import.h */




/* Generated from file c:\Python24\include\intobject.h */


static void
load_PyIntObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyIntObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyIntObject,ob_ival);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyIntObject",sm);
}


/* Generated from file c:\Python24\include\intrcheck.h */




/* Generated from file c:\Python24\include\iterobject.h */




/* Generated from file c:\Python24\include\listobject.h */


static void
load_PyListObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyListObject",StructsMethods);


    load_PyVarObject(sm);
    OFFSET(sm,PyListObject,ob_item);
    OFFSET(sm,PyListObject,allocated);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyListObject",sm);
}


/* Generated from file c:\Python24\include\longintrepr.h */




/* Generated from file c:\Python24\include\longobject.h */




/* Generated from file c:\Python24\include\marshal.h */




/* Generated from file c:\Python24\include\metagrammar.h */




/* Generated from file c:\Python24\include\methodobject.h */


/* Skipping struct PyMethodChain, not a PyObject based struct */
static void
load_PyCFunctionObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyCFunctionObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyCFunctionObject,m_ml);
    OFFSET(sm,PyCFunctionObject,m_self);
    OFFSET(sm,PyCFunctionObject,m_module);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyCFunctionObject",sm);
}


/* Generated from file c:\Python24\include\modsupport.h */




/* Generated from file c:\Python24\include\moduleobject.h */




/* Generated from file c:\Python24\include\node.h */


/* Skipping struct node, not a PyObject based struct */


/* Generated from file c:\Python24\include\object.h */


/* Skipping object PyObject */
/* Skipping object PyVarObject */
/* Skipping struct PyNumberMethods, not a PyObject based struct */
/* Skipping struct PySequenceMethods, not a PyObject based struct */
/* Skipping struct PyMappingMethods, not a PyObject based struct */
/* Skipping struct PyBufferProcs, not a PyObject based struct */
static void
load_PyTypeObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyTypeObject",StructsMethods);


    load_PyVarObject(sm);
    OFFSET(sm,PyTypeObject,tp_name);
    OFFSET(sm,PyTypeObject,tp_basicsize);
    OFFSET(sm,PyTypeObject,tp_itemsize);
    OFFSET(sm,PyTypeObject,tp_dealloc);
    OFFSET(sm,PyTypeObject,tp_print);
    OFFSET(sm,PyTypeObject,tp_getattr);
    OFFSET(sm,PyTypeObject,tp_setattr);
    OFFSET(sm,PyTypeObject,tp_compare);
    OFFSET(sm,PyTypeObject,tp_repr);
    OFFSET(sm,PyTypeObject,tp_as_number);
    OFFSET(sm,PyTypeObject,tp_as_sequence);
    OFFSET(sm,PyTypeObject,tp_as_mapping);
    OFFSET(sm,PyTypeObject,tp_hash);
    OFFSET(sm,PyTypeObject,tp_call);
    OFFSET(sm,PyTypeObject,tp_str);
    OFFSET(sm,PyTypeObject,tp_getattro);
    OFFSET(sm,PyTypeObject,tp_setattro);
    OFFSET(sm,PyTypeObject,tp_as_buffer);
    OFFSET(sm,PyTypeObject,tp_flags);
    OFFSET(sm,PyTypeObject,tp_doc);
    OFFSET(sm,PyTypeObject,tp_traverse);
    OFFSET(sm,PyTypeObject,tp_clear);
    OFFSET(sm,PyTypeObject,tp_richcompare);
    OFFSET(sm,PyTypeObject,tp_weaklistoffset);
    OFFSET(sm,PyTypeObject,tp_iter);
    OFFSET(sm,PyTypeObject,tp_iternext);
    OFFSET(sm,PyTypeObject,tp_methods);
    OFFSET(sm,PyTypeObject,tp_members);
    OFFSET(sm,PyTypeObject,tp_getset);
    OFFSET(sm,PyTypeObject,tp_base);
    OFFSET(sm,PyTypeObject,tp_dict);
    OFFSET(sm,PyTypeObject,tp_descr_get);
    OFFSET(sm,PyTypeObject,tp_descr_set);
    OFFSET(sm,PyTypeObject,tp_dictoffset);
    OFFSET(sm,PyTypeObject,tp_init);
    OFFSET(sm,PyTypeObject,tp_alloc);
    OFFSET(sm,PyTypeObject,tp_new);
    OFFSET(sm,PyTypeObject,tp_free);
    OFFSET(sm,PyTypeObject,tp_is_gc);
    OFFSET(sm,PyTypeObject,tp_bases);
    OFFSET(sm,PyTypeObject,tp_mro);
    OFFSET(sm,PyTypeObject,tp_cache);
    OFFSET(sm,PyTypeObject,tp_subclasses);
    OFFSET(sm,PyTypeObject,tp_weaklist);
    OFFSET(sm,PyTypeObject,tp_del);
#ifdef COUNT_ALLOCS
    OFFSET(sm,PyTypeObject,tp_allocs);
    OFFSET(sm,PyTypeObject,tp_frees);
    OFFSET(sm,PyTypeObject,tp_maxalloc);
    OFFSET(sm,PyTypeObject,tp_next);
#endif


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyTypeObject",sm);
}
/* Skipping struct PyHeapTypeObject, not a PyObject based struct */


/* Generated from file c:\Python24\include\objimpl.h */




/* Generated from file c:\Python24\include\opcode.h */




/* Generated from file c:\Python24\include\osdefs.h */




/* Generated from file c:\Python24\include\parsetok.h */


/* Skipping struct perrdetail, not a PyObject based struct */


/* Generated from file c:\Python24\include\patchlevel.h */




/* Generated from file c:\Python24\include\pgen.h */




/* Generated from file c:\Python24\include\pgenheaders.h */




/* Generated from file c:\Python24\include\pyconfig.h */




/* Generated from file c:\Python24\include\pydebug.h */




/* Generated from file c:\Python24\include\pyerrors.h */




/* Generated from file c:\Python24\include\pyfpe.h */




/* Generated from file c:\Python24\include\pygetopt.h */




/* Generated from file c:\Python24\include\pymactoolbox.h */




/* Generated from file c:\Python24\include\pymem.h */




/* Generated from file c:\Python24\include\pyport.h */


/* Skipping struct fd_set, not a PyObject based struct */


/* Generated from file c:\Python24\include\pystate.h */


/* Skipping struct PyInterpreterState, not a PyObject based struct */
/* Skipping struct PyThreadState, not a PyObject based struct */


/* Generated from file c:\Python24\include\pystrtod.h */




/* Generated from file c:\Python24\include\Python.h */




/* Generated from file c:\Python24\include\pythonrun.h */


/* Skipping struct PyCompilerFlags, not a PyObject based struct */


/* Generated from file c:\Python24\include\pythread.h */




/* Generated from file c:\Python24\include\rangeobject.h */




/* Generated from file c:\Python24\include\setobject.h */


static void
load_PySetObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PySetObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PySetObject,data);
    OFFSET(sm,PySetObject,hash);
    OFFSET(sm,PySetObject,weakreflist);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PySetObject",sm);
}


/* Generated from file c:\Python24\include\sliceobject.h */


static void
load_PySliceObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PySliceObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PySliceObject,start);
    OFFSET(sm,PySliceObject,stop);
    OFFSET(sm,PySliceObject,step);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PySliceObject",sm);
}


/* Generated from file c:\Python24\include\stringobject.h */


static void
load_PyStringObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyStringObject",StructsMethods);


    load_PyVarObject(sm);
    OFFSET(sm,PyStringObject,ob_shash);
    OFFSET(sm,PyStringObject,ob_sstate);
    OFFSET(sm,PyStringObject,ob_sval);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyStringObject",sm);
}


/* Generated from file c:\Python24\include\structmember.h */


/* Skipping struct PyMemberDef, not a PyObject based struct */


/* Generated from file c:\Python24\include\sysmodule.h */




/* Generated from file c:\Python24\include\timefuncs.h */




/* Generated from file c:\Python24\include\token.h */




/* Generated from file c:\Python24\include\traceback.h */


static void
load_PyTracebackObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyTracebackObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyTracebackObject,tb_next);
    OFFSET(sm,PyTracebackObject,tb_frame);
    OFFSET(sm,PyTracebackObject,tb_lasti);
    OFFSET(sm,PyTracebackObject,tb_lineno);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyTracebackObject",sm);
}


/* Generated from file c:\Python24\include\tupleobject.h */


static void
load_PyTupleObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyTupleObject",StructsMethods);


    load_PyVarObject(sm);
    OFFSET(sm,PyTupleObject,ob_item);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyTupleObject",sm);
}


/* Generated from file c:\Python24\include\ucnhash.h */


/* Skipping struct _PyUnicode_Name_CAPI, not a PyObject based struct */


/* Generated from file c:\Python24\include\unicodeobject.h */


static void
load_PyUnicodeObject(PyObject *structs)
{
    PyObject *sm = Py_InitModule("PyUnicodeObject",StructsMethods);


    load_PyObject(sm);
    OFFSET(sm,PyUnicodeObject,length);
    OFFSET(sm,PyUnicodeObject,str);
    OFFSET(sm,PyUnicodeObject,hash);
    OFFSET(sm,PyUnicodeObject,defenc);


    Py_INCREF(sm);
    PyModule_AddObject(structs,"PyUnicodeObject",sm);
}


/* Generated from file c:\Python24\include\weakrefobject.h */




PyMODINIT_FUNC
initstructs(void)
{
    
    PyObject *m, *n, *o;
    /*PyObject *offset;*/

    m = Py_InitModule("structs", StructsMethods);
    n = Py_InitModule("PyObject", StructsMethods);
    o = Py_InitModule("PyVarObject", StructsMethods);
    
    StructsError = PyErr_NewException("structs.StructsError", NULL, NULL);
    Py_INCREF(StructsError);
    PyModule_AddObject(m, "StructsError", StructsError);

    load_PyObject(n);
    Py_INCREF(n);
    PyModule_AddObject(m, "PyObject", n);

    load_PyVarObject(o);
    Py_INCREF(o);
    PyModule_AddObject(m, "PyVarObject", o);
    
        load_PyCellObject(m);
    load_PyClassObject(m);
    load_PyInstanceObject(m);
    load_PyMethodObject(m);
    load_PyCodeObject(m);
    load_PyComplexObject(m);
    load_PyFileObject(m);
    load_PyFloatObject(m);
    load_PyFunctionObject(m);
    load_PyGenObject(m);
    load_PyIntObject(m);
    load_PyListObject(m);
    load_PyCFunctionObject(m);
    load_PyTypeObject(m);
    load_PySetObject(m);
    load_PySliceObject(m);
    load_PyStringObject(m);
    load_PyTracebackObject(m);
    load_PyTupleObject(m);
    load_PyUnicodeObject(m);

}
