📄 idl.h
字号:
/************************************************************************** IDL.h (IDL parse tree and namespace components) Copyright (C) 1998, 1999 Andrew T. Veliath This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: IDL.h.new.in,v 1.21 1999/06/14 21:14:22 andrewtv Exp $***************************************************************************/#ifndef __IDL_H#define __IDL_H#include <glib.h>/* Try to find wchar_t support */#include <stdlib.h>#if 1 /* HAVE_WCHAR_H */# include <wchar.h>#endif#if 0 /* HAVE_WCSTR_H */# include <wcstr.h>#endif#ifdef __cplusplusextern "C" {#endif/* version */#define LIBIDL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))#define LIBIDL_MAJOR_VERSION 0#define LIBIDL_MINOR_VERSION 6#define LIBIDL_MICRO_VERSION 8#define LIBIDL_VERSION_CODE LIBIDL_VERSION(0,6,8)/* miscellaneous constants */#define IDL_SUCCESS 0#define IDL_ERROR 1#define IDL_WARNING1 2#define IDL_WARNING2 3#define IDL_WARNING3 4#define IDL_WARNINGMAX IDL_WARNING3/* general parse flags */#define IDLF_VERBOSE (1UL << 0)#define IDLF_NO_EVAL_CONST (1UL << 1)#define IDLF_COMBINE_REOPENED_MODULES (1UL << 2)#define IDLF_PREFIX_FILENAME (1UL << 3)#define IDLF_IGNORE_FORWARDS (1UL << 4)#define IDLF_PEDANTIC (1UL << 5)#define IDLF_INHIBIT_TAG_ONLY (1UL << 6)#define IDLF_INHIBIT_INCLUDES (1UL << 7)/* syntax extension parse flags */#define IDLF_TYPECODES (1UL << 16)#define IDLF_XPIDL (1UL << 17)#define IDLF_PROPERTIES (1UL << 18)#define IDLF_CODEFRAGS (1UL << 19)/* declaration specification flags */#define IDLF_DECLSPEC_EXIST (1UL << 0)#define IDLF_DECLSPEC_INHIBIT (1UL << 1)/* output flags */#define IDLF_OUTPUT_NO_NEWLINES (1UL << 0)#define IDLF_OUTPUT_NO_QUALIFY_IDENTS (1UL << 1)#define IDLF_OUTPUT_PROPERTIES (1UL << 2)#define IDLF_OUTPUT_CODEFRAGS (1UL << 3)#ifdef _WIN32# define IDL_EXPORT __declspec (dllexport)# define IDL_IMPORT __declspec (dllimport)#else# define IDL_EXPORT /* empty */# define IDL_IMPORT extern#endif/* type casting checks */#define IDL_check_cast_enable(boolean) do { \ IDL_IMPORT int __IDL_check_type_casts; \ __IDL_check_type_casts = (boolean); \} while (0)#define IDL_CHECK_CAST(tree, thetype, name) \ (IDL_check_type_cast(tree, thetype, \ __FILE__, __LINE__, \ G_GNUC_PRETTY_FUNCTION)->u.name)#ifdef G_HAVE_GINT64# if G_MAXLONG > 0xffffffffUL# define IDL_LL "l"# else# define IDL_LL "ll"# endiftypedef gint64 IDL_longlong_t;typedef guint64 IDL_ulonglong_t;#else# define IDL_LL "l"typedef long IDL_longlong_t;typedef unsigned long IDL_ulonglong_t;# warning 64-bit integer type not available, using 32-bit instead#endif /* G_HAVE_GINT64 */typedef unsigned int IDL_declspec_t;typedef struct _IDL_tree_node IDL_tree_node;typedef struct _IDL_tree_node * IDL_tree;struct _IDL_LIST { IDL_tree data; IDL_tree prev; IDL_tree next; IDL_tree _tail; /* Internal use, may not be valid */}; #define IDL_LIST(a) IDL_CHECK_CAST(a, IDLN_LIST, idl_list)extern IDL_tree IDL_list_new (IDL_tree data);extern IDL_tree IDL_list_concat (IDL_tree orig, IDL_tree append);extern IDL_tree IDL_list_remove (IDL_tree list, IDL_tree p);extern int IDL_list_length (IDL_tree list);extern IDL_tree IDL_list_nth (IDL_tree list, int n);struct _IDL_GENTREE { IDL_tree data; GHashTable *siblings; GHashTable *children; GHashFunc hash_func; GCompareFunc key_compare_func; IDL_tree _import; /* Internal use, do not recurse */ char *_cur_prefix; /* Internal use */};#define IDL_GENTREE(a) IDL_CHECK_CAST(a, IDLN_GENTREE, idl_gentree)extern IDL_tree IDL_gentree_new (GHashFunc hash_func, GCompareFunc key_compare_func, IDL_tree data);extern IDL_tree IDL_gentree_new_sibling (IDL_tree from, IDL_tree data);extern IDL_tree IDL_gentree_chain_sibling (IDL_tree from, IDL_tree data);extern IDL_tree IDL_gentree_chain_child (IDL_tree from, IDL_tree data);struct _IDL_INTEGER { IDL_longlong_t value;};#define IDL_INTEGER(a) IDL_CHECK_CAST(a, IDLN_INTEGER, idl_integer)extern IDL_tree IDL_integer_new (IDL_longlong_t value);struct _IDL_STRING { char *value;};#define IDL_STRING(a) IDL_CHECK_CAST(a, IDLN_STRING, idl_string)extern IDL_tree IDL_string_new (char *value);struct _IDL_WIDE_STRING { wchar_t *value;};#define IDL_WIDE_STRING(a) IDL_CHECK_CAST(a, IDLN_WIDE_STRING, idl_wide_string)extern IDL_tree IDL_wide_string_new (wchar_t *value);struct _IDL_CHAR { char *value;};#define IDL_CHAR(a) IDL_CHECK_CAST(a, IDLN_CHAR, idl_char)extern IDL_tree IDL_char_new (char *value);struct _IDL_WIDE_CHAR { wchar_t *value;};#define IDL_WIDE_CHAR(a) IDL_CHECK_CAST(a, IDLN_WIDE_CHAR, idl_wide_char)extern IDL_tree IDL_wide_char_new (wchar_t *value);struct _IDL_FIXED { char *value;};#define IDL_FIXED(a) IDL_CHECK_CAST(a, IDLN_FIXED, idl_fixed)extern IDL_tree IDL_fixed_new (char *value);struct _IDL_FLOAT { double value;};#define IDL_FLOAT(a) IDL_CHECK_CAST(a, IDLN_FLOAT, idl_float)extern IDL_tree IDL_float_new (double value);struct _IDL_BOOLEAN { unsigned value;};#define IDL_BOOLEAN(a) IDL_CHECK_CAST(a, IDLN_BOOLEAN, idl_boolean)extern IDL_tree IDL_boolean_new (unsigned value);struct _IDL_IDENT { char *str; char *repo_id; GSList *comments; IDL_tree _ns_ref; /* Internal use, do not recurse */ unsigned _flags; /* Internal use */#define IDLF_IDENT_CASE_MISMATCH_HIT (1UL << 0)};#define IDL_IDENT(a) IDL_CHECK_CAST(a, IDLN_IDENT, idl_ident)#define IDL_IDENT_TO_NS(a) IDL_CHECK_CAST(a, IDLN_IDENT, idl_ident._ns_ref)#define IDL_IDENT_REPO_ID(a) IDL_CHECK_CAST(a, IDLN_IDENT, idl_ident.repo_id)extern IDL_tree IDL_ident_new (char *str);extern void IDL_queue_new_ident_comment (const char *str);enum IDL_float_type { IDL_FLOAT_TYPE_FLOAT, IDL_FLOAT_TYPE_DOUBLE, IDL_FLOAT_TYPE_LONGDOUBLE};struct _IDL_TYPE_FLOAT { enum IDL_float_type f_type;};#define IDL_TYPE_FLOAT(a) IDL_CHECK_CAST(a, IDLN_TYPE_FLOAT, idl_type_float)extern IDL_tree IDL_type_float_new (enum IDL_float_type f_type);struct _IDL_TYPE_FIXED { IDL_tree positive_int_const; IDL_tree integer_lit;};#define IDL_TYPE_FIXED(a) IDL_CHECK_CAST(a, IDLN_TYPE_FIXED, idl_type_fixed)extern IDL_tree IDL_type_fixed_new (IDL_tree positive_int_const, IDL_tree integer_lit);enum IDL_integer_type { IDL_INTEGER_TYPE_SHORT, IDL_INTEGER_TYPE_LONG, IDL_INTEGER_TYPE_LONGLONG};struct _IDL_TYPE_INTEGER { unsigned f_signed : 1; enum IDL_integer_type f_type;};#define IDL_TYPE_INTEGER(a) IDL_CHECK_CAST(a, IDLN_TYPE_INTEGER, idl_type_integer)extern IDL_tree IDL_type_integer_new (unsigned f_signed, enum IDL_integer_type f_type);extern IDL_tree IDL_type_char_new (void);extern IDL_tree IDL_type_wide_char_new (void);extern IDL_tree IDL_type_boolean_new (void);extern IDL_tree IDL_type_octet_new (void);extern IDL_tree IDL_type_any_new (void);extern IDL_tree IDL_type_object_new (void);extern IDL_tree IDL_type_typecode_new (void);struct _IDL_TYPE_STRING { IDL_tree positive_int_const;};#define IDL_TYPE_STRING(a) IDL_CHECK_CAST(a, IDLN_TYPE_STRING, idl_type_string)extern IDL_tree IDL_type_string_new (IDL_tree positive_int_const);struct _IDL_TYPE_WIDE_STRING { IDL_tree positive_int_const;};#define IDL_TYPE_WIDE_STRING(a) IDL_CHECK_CAST(a, IDLN_TYPE_WIDE_STRING, idl_type_wide_string)extern IDL_tree IDL_type_wide_string_new (IDL_tree positive_int_const);struct _IDL_TYPE_ENUM { IDL_tree ident; IDL_tree enumerator_list;};#define IDL_TYPE_ENUM(a) IDL_CHECK_CAST(a, IDLN_TYPE_ENUM, idl_type_enum)extern IDL_tree IDL_type_enum_new (IDL_tree ident, IDL_tree enumerator_list);struct _IDL_TYPE_ARRAY { IDL_tree ident; IDL_tree size_list;};#define IDL_TYPE_ARRAY(a) IDL_CHECK_CAST(a, IDLN_TYPE_ARRAY, idl_type_array)extern IDL_tree IDL_type_array_new (IDL_tree ident, IDL_tree size_list);struct _IDL_TYPE_SEQUENCE { IDL_tree simple_type_spec; IDL_tree positive_int_const;};#define IDL_TYPE_SEQUENCE(a) IDL_CHECK_CAST(a, IDLN_TYPE_SEQUENCE, idl_type_sequence)extern IDL_tree IDL_type_sequence_new (IDL_tree simple_type_spec, IDL_tree positive_int_const);struct _IDL_TYPE_STRUCT { IDL_tree ident; IDL_tree member_list;};#define IDL_TYPE_STRUCT(a) IDL_CHECK_CAST(a, IDLN_TYPE_STRUCT, idl_type_struct)extern IDL_tree IDL_type_struct_new (IDL_tree ident, IDL_tree member_list);struct _IDL_TYPE_UNION { IDL_tree ident; IDL_tree switch_type_spec; IDL_tree switch_body;};#define IDL_TYPE_UNION(a) IDL_CHECK_CAST(a, IDLN_TYPE_UNION, idl_type_union)extern IDL_tree IDL_type_union_new (IDL_tree ident, IDL_tree switch_type_spec, IDL_tree switch_body);struct _IDL_MEMBER { IDL_tree type_spec; IDL_tree dcls;};#define IDL_MEMBER(a) IDL_CHECK_CAST(a, IDLN_MEMBER, idl_member)extern IDL_tree IDL_member_new (IDL_tree type_spec, IDL_tree dcls);struct _IDL_NATIVE { IDL_tree ident; char *user_type; /* XPIDL extension */};#define IDL_NATIVE(a) IDL_CHECK_CAST(a, IDLN_NATIVE, idl_native)extern IDL_tree IDL_native_new (IDL_tree ident);struct _IDL_TYPE_DCL { IDL_tree type_spec; IDL_tree dcls;};#define IDL_TYPE_DCL(a) IDL_CHECK_CAST(a, IDLN_TYPE_DCL, idl_type_dcl)extern IDL_tree IDL_type_dcl_new (IDL_tree type_spec, IDL_tree dcls);struct _IDL_CONST_DCL { IDL_tree const_type; IDL_tree ident; IDL_tree const_exp;};#define IDL_CONST_DCL(a) IDL_CHECK_CAST(a, IDLN_CONST_DCL, idl_const_dcl)extern IDL_tree IDL_const_dcl_new (IDL_tree const_type, IDL_tree ident, IDL_tree const_exp);struct _IDL_EXCEPT_DCL { IDL_tree ident; IDL_tree members;};#define IDL_EXCEPT_DCL(a) IDL_CHECK_CAST(a, IDLN_EXCEPT_DCL, idl_except_dcl)extern IDL_tree IDL_except_dcl_new (IDL_tree ident, IDL_tree members);struct _IDL_ATTR_DCL { unsigned f_readonly : 1; IDL_tree param_type_spec; IDL_tree simple_declarations;};#define IDL_ATTR_DCL(a) IDL_CHECK_CAST(a, IDLN_ATTR_DCL, idl_attr_dcl)extern IDL_tree IDL_attr_dcl_new (unsigned f_readonly, IDL_tree param_type_spec, IDL_tree simple_declarations);struct _IDL_OP_DCL { unsigned __f_noscript : 1; /* Deprecated */ unsigned f_oneway : 1; /* XPIDL extension (varags) */ unsigned f_varargs : 1; IDL_tree op_type_spec; IDL_tree ident; IDL_tree parameter_dcls; IDL_tree raises_expr; IDL_tree context_expr;};#define IDL_OP_DCL(a) IDL_CHECK_CAST(a, IDLN_OP_DCL, idl_op_dcl)extern IDL_tree IDL_op_dcl_new (unsigned f_oneway, IDL_tree op_type_spec, IDL_tree ident, IDL_tree parameter_dcls, IDL_tree raises_expr, IDL_tree context_expr);enum IDL_param_attr { IDL_PARAM_IN, IDL_PARAM_OUT, IDL_PARAM_INOUT};struct _IDL_PARAM_DCL { enum IDL_param_attr attr; IDL_tree param_type_spec; IDL_tree simple_declarator;};#define IDL_PARAM_DCL(a) IDL_CHECK_CAST(a, IDLN_PARAM_DCL, idl_param_dcl)extern IDL_tree IDL_param_dcl_new (enum IDL_param_attr attr, IDL_tree param_type_spec, IDL_tree simple_declarator);struct _IDL_CASE_STMT { IDL_tree labels; IDL_tree element_spec;};#define IDL_CASE_STMT(a) IDL_CHECK_CAST(a, IDLN_CASE_STMT, idl_case_stmt)extern IDL_tree IDL_case_stmt_new (IDL_tree labels, IDL_tree element_spec);struct _IDL_INTERFACE { IDL_tree ident; IDL_tree inheritance_spec; IDL_tree body;};#define IDL_INTERFACE(a) IDL_CHECK_CAST(a, IDLN_INTERFACE, idl_interface)extern IDL_tree IDL_interface_new (IDL_tree ident, IDL_tree inheritance_spec, IDL_tree body);struct _IDL_FORWARD_DCL { IDL_tree ident;};#define IDL_FORWARD_DCL(a) IDL_CHECK_CAST(a, IDLN_FORWARD_DCL, idl_forward_dcl)extern IDL_tree IDL_forward_dcl_new (IDL_tree ident);struct _IDL_MODULE { IDL_tree ident;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -