blob: 2283b96f5efd5a5b586cac1cdd05fdf4533c02c6 [file] [log] [blame]
Adam Cozzette5aca7282023-08-07 10:01:08 -07001// Protocol Buffers - Google's data interchange format
2// Copyright 2023 Google LLC. All rights reserved.
Adam Cozzette5aca7282023-08-07 10:01:08 -07003//
Protobuf Team Bot0fab7732023-11-20 13:38:15 -08004// 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 Haberman94ece042021-08-18 12:38:26 -07007
8#ifndef PYUPB_DESCRIPTOR_POOL_H__
9#define PYUPB_DESCRIPTOR_POOL_H__
10
11#include <stdbool.h>
12
13#include "protobuf.h"
14
Joshua Habermancd9915a2021-12-29 11:47:42 -080015// Returns a Python wrapper object for the given symtab. The symtab must have
16// been created from a Python DescriptorPool originally.
Joshua Haberman1c955f32022-01-12 07:19:28 -080017PyObject* PyUpb_DescriptorPool_Get(const upb_DefPool* symtab);
Joshua Habermancd9915a2021-12-29 11:47:42 -080018
19// Given a Python DescriptorPool, returns the underlying symtab.
Joshua Haberman1c955f32022-01-12 07:19:28 -080020upb_DefPool* PyUpb_DescriptorPool_GetSymtab(PyObject* pool);
Joshua Habermancd9915a2021-12-29 11:47:42 -080021
22// Returns the default DescriptorPool (a global singleton).
Joshua Habermanbfc264d2021-12-01 16:28:26 -080023PyObject* PyUpb_DescriptorPool_GetDefaultPool(void);
Joshua Habermandeddc202021-12-01 15:11:12 -080024
Joshua Habermancd9915a2021-12-29 11:47:42 -080025// Module-level init.
Joshua Haberman94ece042021-08-18 12:38:26 -070026bool PyUpb_InitDescriptorPool(PyObject* m);
27
Joshua Habermaneec1a452021-08-18 15:23:57 -070028#endif // PYUPB_DESCRIPTOR_POOL_H__