1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  *   http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef _THRIFT_CONFIGURATION_H
21 #define _THRIFT_CONFIGURATION_H
22 
23 #include <glib-object.h>
24 
25 G_BEGIN_DECLS
26 
27 /* type macros */
28 #define THRIFT_TYPE_CONFIGURATION (thrift_configuration_get_type ())
29 #define THRIFT_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_CONFIGURATION, ThriftConfiguration))
30 #define THRIFT_IS_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_CONFIGURATION))
31 #define THRIFT_CONFIGURATTION_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_CONFIGURATION, ThriftConfigurationClass))
32 #define THRIFT_IS_CONFIGURATION_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_CONFIGURATION))
33 #define THRIFT_CONFIGURATION_GET_CLASS(obj) (G_TYPE_INSTAANCE_GET_CLASS ((obj), THRIFT_TYPE_CONFIGURATION, ThriftconfigurationClass))
34 
35 typedef struct _ThriftConfiguration ThriftConfiguration;
36 
37 /*!
38  * Thrift Configuration object
39  */
40 struct _ThriftConfiguration
41 {
42     GObject parent;
43 
44     /* private */
45     int maxMessageSize_;
46     int maxFrameSize_;
47     int recursionLimit_;
48 };
49 
50 typedef struct _ThriftConfigurationClass ThriftConfigurationClass;
51 
52 /*!
53  *  Thrift Configuration class
54  */
55 struct _ThriftConfigurationClass
56 {
57     GObjectClass parent;
58 };
59 
60 /* used by THRIFT_TYPE_CONFIGURATION */
61 GType thrift_configuration_get_type(void);
62 
63 #define DEFAULT_MAX_MESSAGE_SIZE  (100 * 1024 * 1024)
64 #define DEFAULT_MAX_FRAME_SIZE    (16384000)
65 #define DEFAULT_RECURSION_DEPTH   (64)
66 
67 G_END_DECLS
68 
69 #endif /* #ifndef _THRIFT_CONFIGURATION_H */
70