diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-08-08 16:33:48 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-08-08 16:33:48 -0700 |
commit | 487bfdfc0603ab7bf5fad381f52b8932cbcd355e (patch) | |
tree | d7db8ecbb96f8890e86313153e58edec580337df /lang_ext/python/definition.h | |
parent | 6981e468a3234b3f5439dec8178703a6364cfe03 (diff) |
Begin port of Python extension to new APIs.
Diffstat (limited to 'lang_ext/python/definition.h')
-rw-r--r-- | lang_ext/python/definition.h | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lang_ext/python/definition.h b/lang_ext/python/definition.h deleted file mode 100644 index f7162cf..0000000 --- a/lang_ext/python/definition.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2009 Google Inc. See LICENSE for details. - * Author: Josh Haberman <jhaberman@gmail.com> - * - * 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_context *context; -} PyUpb_Context; - -typedef struct { - PyObject_HEAD - struct upb_msgdef *def; - PyUpb_Context *context; -} PyUpb_MsgDef; - -extern PyTypeObject PyUpb_MsgDefType; - -/* What format string should be passed to PyArg_ParseTuple to get just a raw - * string of bytes and a length. */ -#if PY_MAJOR_VERSION >= 3 -#define BYTES_FORMAT "y#" -#else -#define BYTES_FORMAT "s#" -#endif - -PyUpb_MsgDef *get_or_create_msgdef(struct upb_msgdef *def); - -#define RETURN_BOOL(val) if(val) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif |