• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
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
7 
8 #ifndef PYUPB_DESCRIPTOR_POOL_H__
9 #define PYUPB_DESCRIPTOR_POOL_H__
10 
11 #include <stdbool.h>
12 
13 #include "protobuf.h"
14 
15 // Returns a Python wrapper object for the given symtab. The symtab must have
16 // been created from a Python DescriptorPool originally.
17 PyObject* PyUpb_DescriptorPool_Get(const upb_DefPool* symtab);
18 
19 // Given a Python DescriptorPool, returns the underlying symtab.
20 upb_DefPool* PyUpb_DescriptorPool_GetSymtab(PyObject* pool);
21 
22 // Returns the default DescriptorPool (a global singleton).
23 PyObject* PyUpb_DescriptorPool_GetDefaultPool(void);
24 
25 // Module-level init.
26 bool PyUpb_InitDescriptorPool(PyObject* m);
27 
28 #endif  // PYUPB_DESCRIPTOR_POOL_H__
29