Adam Cozzette | 5aca728 | 2023-08-07 10:01:08 -0700 | [diff] [blame] | 1 | // Protocol Buffers - Google's data interchange format |
| 2 | // Copyright 2023 Google LLC. All rights reserved. |
Adam Cozzette | 5aca728 | 2023-08-07 10:01:08 -0700 | [diff] [blame] | 3 | // |
Protobuf Team Bot | 0fab773 | 2023-11-20 13:38:15 -0800 | [diff] [blame] | 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file or at |
| 6 | // https://developers.google.com/open-source/licenses/bsd |
Joshua Haberman | 94ece04 | 2021-08-18 12:38:26 -0700 | [diff] [blame] | 7 | |
| 8 | #ifndef PYUPB_DESCRIPTOR_POOL_H__ |
| 9 | #define PYUPB_DESCRIPTOR_POOL_H__ |
| 10 | |
| 11 | #include <stdbool.h> |
| 12 | |
| 13 | #include "protobuf.h" |
| 14 | |
Joshua Haberman | cd9915a | 2021-12-29 11:47:42 -0800 | [diff] [blame] | 15 | // Returns a Python wrapper object for the given symtab. The symtab must have |
| 16 | // been created from a Python DescriptorPool originally. |
Joshua Haberman | 1c955f3 | 2022-01-12 07:19:28 -0800 | [diff] [blame] | 17 | PyObject* PyUpb_DescriptorPool_Get(const upb_DefPool* symtab); |
Joshua Haberman | cd9915a | 2021-12-29 11:47:42 -0800 | [diff] [blame] | 18 | |
| 19 | // Given a Python DescriptorPool, returns the underlying symtab. |
Joshua Haberman | 1c955f3 | 2022-01-12 07:19:28 -0800 | [diff] [blame] | 20 | upb_DefPool* PyUpb_DescriptorPool_GetSymtab(PyObject* pool); |
Joshua Haberman | cd9915a | 2021-12-29 11:47:42 -0800 | [diff] [blame] | 21 | |
| 22 | // Returns the default DescriptorPool (a global singleton). |
Joshua Haberman | bfc264d | 2021-12-01 16:28:26 -0800 | [diff] [blame] | 23 | PyObject* PyUpb_DescriptorPool_GetDefaultPool(void); |
Joshua Haberman | deddc20 | 2021-12-01 15:11:12 -0800 | [diff] [blame] | 24 | |
Joshua Haberman | cd9915a | 2021-12-29 11:47:42 -0800 | [diff] [blame] | 25 | // Module-level init. |
Joshua Haberman | 94ece04 | 2021-08-18 12:38:26 -0700 | [diff] [blame] | 26 | bool PyUpb_InitDescriptorPool(PyObject* m); |
| 27 | |
Joshua Haberman | eec1a45 | 2021-08-18 15:23:57 -0700 | [diff] [blame] | 28 | #endif // PYUPB_DESCRIPTOR_POOL_H__ |