summaryrefslogtreecommitdiff
path: root/lang_ext/python/definition.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-08-16 00:25:59 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-08-16 00:25:59 -0700
commitf00091f340122f3fc0a3c6d7da2aff8a83f5506d (patch)
tree7b302aa7edc38cec30139f7369bc95a767ca64d9 /lang_ext/python/definition.h
parentcfd67dda4967d2246ab1a9d852ad466a9b2a1a18 (diff)
Beginnings of a Python extension.
Diffstat (limited to 'lang_ext/python/definition.h')
-rw-r--r--lang_ext/python/definition.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/lang_ext/python/definition.h b/lang_ext/python/definition.h
new file mode 100644
index 0000000..8731b8a
--- /dev/null
+++ b/lang_ext/python/definition.h
@@ -0,0 +1,34 @@
+/*
+ * upb - a minimalist implementation of protocol buffers.
+ *
+ * Copyright (c) 2009 Joshua Haberman. See LICENSE for details.
+ *
+ * See def.h for a general description. These definitions
+ * must be shared so that specific Python message types (for the
+ * different proto APIs) can have access to the C definitions. */
+
+#ifndef UPB_PYTHON_DEFINITION_H_
+#define UPB_PYTHON_DEFINITION_H_
+
+#include <Python.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ PyObject_HEAD
+ struct upb_msgdef *def;
+} PyUpb_MessageDefinition;
+
+extern PyTypeObject PyUpb_MessageDefinitionType;
+
+/* What format string should be passed to PyArg_ParseTuple to get just a raw
+ * string of bytes and a length. */
+extern const char *bytes_format;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback