281 |
scm_misc_error ("scm_mkstrport", "port must read or write", SCM_EOL); |
scm_misc_error ("scm_mkstrport", "port must read or write", SCM_EOL); |
282 |
z = scm_cell (scm_tc16_strport, 0); |
z = scm_cell (scm_tc16_strport, 0); |
283 |
SCM_DEFER_INTS; |
SCM_DEFER_INTS; |
284 |
pt = scm_add_to_port_table (z); |
pt = scm_new_port_table_entry (); |
285 |
SCM_SET_CELL_TYPE (z, scm_tc16_strport | modes); |
SCM_SET_CELL_TYPE (z, scm_tc16_strport | modes); |
286 |
SCM_SETPTAB_ENTRY (z, pt); |
SCM_SETPTAB_ENTRY (z, pt); |
287 |
|
pt->port = z; |
288 |
|
|
289 |
SCM_SETSTREAM (z, SCM_UNPACK (str)); |
SCM_SETSTREAM (z, SCM_UNPACK (str)); |
290 |
pt->write_buf = pt->read_buf = SCM_STRING_UCHARS (str); |
pt->write_buf = pt->read_buf = SCM_STRING_UCHARS (str); |
291 |
pt->read_pos = pt->write_pos = pt->read_buf + SCM_INUM (pos); |
pt->read_pos = pt->write_pos = pt->read_buf + SCM_INUM (pos); |