1 #include "stream._nitni.h"
2 #include "stream_nit.h"
3 /* out/indirect function for stream::FDStream::native_close */
4 val_t
FDStream_native_close___out( val_t recv
, val_t i
)
9 trans___i
= UNTAG_Int(i
);
10 orig_return
= stream_FDStream_FDStream_native_close_1( NULL
, trans___i
);
11 trans_return
= TAG_Int(orig_return
);
12 nitni_local_ref_clean( );
15 /* out/indirect function for stream::FDStream::native_read_char */
16 val_t
FDStream_native_read_char___out( val_t recv
, val_t i
)
21 trans___i
= UNTAG_Int(i
);
22 orig_return
= stream_FDStream_FDStream_native_read_char_1( NULL
, trans___i
);
23 trans_return
= TAG_Int(orig_return
);
24 nitni_local_ref_clean( );
27 /* out/indirect function for stream::FDStream::native_read */
28 val_t
FDStream_native_read___out( val_t recv
, val_t i
, val_t buf
, val_t len
)
34 trans___i
= UNTAG_Int(i
);
35 trans___len
= UNTAG_Int(len
);
36 orig_return
= stream_FDStream_FDStream_native_read_3( NULL
, trans___i
, UNBOX_NativeString(buf
), trans___len
);
37 trans_return
= TAG_Int(orig_return
);
38 nitni_local_ref_clean( );
41 /* out/indirect function for stream::FDStream::native_write */
42 val_t
FDStream_native_write___out( val_t recv
, val_t i
, val_t buf
, val_t len
)
48 trans___i
= UNTAG_Int(i
);
49 trans___len
= UNTAG_Int(len
);
50 orig_return
= stream_FDStream_FDStream_native_write_3( NULL
, trans___i
, UNBOX_NativeString(buf
), trans___len
);
51 trans_return
= TAG_Int(orig_return
);
52 nitni_local_ref_clean( );
55 /* out/indirect function for stream::FDStream::native_write_char */
56 val_t
FDStream_native_write_char___out( val_t recv
, val_t i
, val_t c
)
62 trans___i
= UNTAG_Int(i
);
63 trans___c
= UNTAG_Char(c
);
64 orig_return
= stream_FDStream_FDStream_native_write_char_2( NULL
, trans___i
, trans___c
);
65 trans_return
= TAG_Int(orig_return
);
66 nitni_local_ref_clean( );
69 /* out/indirect function for stream::Object::intern_poll */
70 val_t
Object_intern_poll___out( val_t recv
, val_t in_fds
, val_t out_fds
)
74 Array trans___out_fds
;
75 nullable_Int orig_return
;
77 trans_recv
= malloc( sizeof( struct s_Object
) );
78 trans_recv
->ref
.val
= NIT_NULL
;
79 trans_recv
->ref
.count
= 0;
80 nitni_local_ref_add( (struct nitni_ref
*)trans_recv
);
81 trans_recv
->ref
.val
= recv
;
82 trans___in_fds
= malloc( sizeof( struct s_Array
) );
83 trans___in_fds
->ref
.val
= NIT_NULL
;
84 trans___in_fds
->ref
.count
= 0;
85 nitni_local_ref_add( (struct nitni_ref
*)trans___in_fds
);
86 trans___in_fds
->ref
.val
= in_fds
;
87 trans___out_fds
= malloc( sizeof( struct s_Array
) );
88 trans___out_fds
->ref
.val
= NIT_NULL
;
89 trans___out_fds
->ref
.count
= 0;
90 nitni_local_ref_add( (struct nitni_ref
*)trans___out_fds
);
91 trans___out_fds
->ref
.val
= out_fds
;
92 orig_return
= malloc( sizeof( struct s_nullable_Int
) );
93 orig_return
->ref
.val
= NIT_NULL
;
94 orig_return
->ref
.count
= 0;
95 orig_return
= Object_intern_poll___impl( trans_recv
, trans___in_fds
, trans___out_fds
);
96 trans_return
= orig_return
->ref
.val
;
97 nitni_local_ref_clean( );
100 nullable_Int
stream_null_Int()
103 n
= malloc( sizeof( struct s_nullable_Int
) );
104 n
->ref
.val
= NIT_NULL
;
106 nitni_local_ref_add( (struct nitni_ref
*)n
);
109 nullable_Object
stream_null_Object()
112 n
= malloc( sizeof( struct s_nullable_Object
) );
113 n
->ref
.val
= NIT_NULL
;
115 nitni_local_ref_add( (struct nitni_ref
*)n
);
118 /* friendly for array::AbstractArrayRead::(abstract_collection::Collection::length) */
119 bigint
stream_Array_length( Array recv
)
124 trans_recv
= recv
->ref
.val
;
125 orig_return
= CALL_standard___collection___abstract_collection___Collection___length( trans_recv
)( trans_recv
);
126 trans_return
= UNTAG_Int(orig_return
);
129 /* friendly for array::Array::(abstract_collection::SequenceRead::[]) */
130 nullable_Object
stream_Array__index( Array recv
, bigint index
)
135 nullable_Object trans_return
;
136 trans_recv
= recv
->ref
.val
;
137 trans___index
= TAG_Int(index
);
138 trans_return
= malloc( sizeof( struct s_nullable_Object
) );
139 trans_return
->ref
.val
= NIT_NULL
;
140 trans_return
->ref
.count
= 0;
141 nitni_local_ref_add( (struct nitni_ref
*)trans_return
);
142 orig_return
= CALL_standard___collection___abstract_collection___SequenceRead_____bra( trans_recv
)( trans_recv
, trans___index
);
143 trans_return
->ref
.val
= orig_return
;
146 int stream_nullable_Object_is_a_Int( nullable_Object value
)
149 temp
= value
->ref
.val
;
150 if ( ISNULL(temp
) ) return 0;
151 if ( ! ( ISOBJ( temp
) ?
OBJISA( temp
, standard___kernel___Int
): VALISA( temp
, standard___kernel___Int
) ) ) return 0;
154 bigint
stream_nullable_Object_as_Int( nullable_Object value
)
158 temp
= value
->ref
.val
;
159 if ( ISNULL(temp
) ){ fprintf( stderr
, "Casting from nullable Object to Int failed because value is null." );
161 }if ( ! ( ISOBJ( temp
) ?
OBJISA( temp
, standard___kernel___Int
): VALISA( temp
, standard___kernel___Int
) ) ){
162 fprintf( stderr
, "Casting to Int failed because value is not a Int." );
165 out
= UNTAG_Int(temp
);
168 nullable_Int
stream_Int_as_nullable( bigint value
)
172 out
= malloc( sizeof( struct s_nullable_Int
) );
173 out
->ref
.val
= NIT_NULL
;
175 nitni_local_ref_add( (struct nitni_ref
*)out
);
176 temp
= TAG_Int(value
);