summaryrefslogtreecommitdiff
path: root/libgpython/include/gpython/gpython.h
diff options
context:
space:
mode:
authorredbrain <redbrain@crules.org>2010-07-06 21:18:13 +0100
committerredbrain <redbrain@crules.org>2010-07-06 21:18:13 +0100
commit7ba8b5e537b3b5516bf293da9815c09562b421e8 (patch)
tree444b0d732182245b9dd9833aeb87c368968185db /libgpython/include/gpython/gpython.h
parentaafc924b6bf280409cc7f6eac2bf61a6bdc6b17e (diff)
downloadgcc-7ba8b5e537b3b5516bf293da9815c09562b421e8.tar.gz
outlining a basic builtin type api
Diffstat (limited to 'libgpython/include/gpython/gpython.h')
-rw-r--r--libgpython/include/gpython/gpython.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/libgpython/include/gpython/gpython.h b/libgpython/include/gpython/gpython.h
new file mode 100644
index 00000000000..892286e9114
--- /dev/null
+++ b/libgpython/include/gpython/gpython.h
@@ -0,0 +1,63 @@
+/* This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC 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 General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef __GCC_GPYTHON__
+#define __GCC_GPYTHON__
+
+typedef struct gpy_rr_object_state_t {
+ char * obj_t_ident;
+ signed long ref_count;
+ void * self;
+} gpy_rr_object_state_t ;
+
+typedef crl_symbol_obj * (*binary_op)( crl_symbol_obj * , crl_symbol_obj *,
+ crl_context_table * )
+
+typedef struct crl_number_prot_t
+{
+ bool init;
+
+ binary_op n_add;
+ binary_op n_sub;
+ binary_op n_div;
+ binary_op n_mul;
+ binary_op n_pow;
+
+ binary_op n_let;
+ binary_op n_lee;
+ binary_op n_get;
+ binary_op n_gee;
+ binary_op n_eee;
+ binary_op n_nee;
+ binary_op n_orr;
+ binary_op n_and;
+
+} crl_num_prot_t ;
+
+typedef struct crl_type_obj_def_t {
+ char * identifier;
+ size_t builtin_type_size;
+ void * (*init_hook)( crl_symbol_obj * ,
+ struct crl_type_obj_def_t ** );
+ void (*destroy_hook)( void * );
+ bool (*print_hook)( void * , FILE * , bool );
+ const struct crl_number_prot_t * binary_protocol;
+ const struct crl_builtin_member_def_t * member_fields;
+ const struct crl_builtin_function_def_t * member_functions;
+ bool builtin;
+} crl_type_obj_def_t ;
+
+#endif //__GCC_GPYTHON__