[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/10: put-char, put-string in default namespace
From: |
Andy Wingo |
Subject: |
[Guile-commits] 02/10: put-char, put-string in default namespace |
Date: |
Fri, 3 Jun 2016 21:03:47 +0000 (UTC) |
wingo pushed a commit to branch wip-ethreads
in repository guile.
commit c4d8d1403446aececea7bea42cc877903779a3e2
Author: Andy Wingo <address@hidden>
Date: Wed Jun 1 23:37:13 2016 +0200
put-char, put-string in default namespace
* libguile/ports.h: Add scm_put_char decl.
* libguile/ports.c (scm_put_char): New function.
* module/ice-9/ports.scm: Export put-char and put-string to (guile).
---
libguile/ports.c | 13 +++++++++++++
libguile/ports.h | 1 +
module/ice-9/ports.scm | 2 ++
3 files changed, 16 insertions(+)
diff --git a/libguile/ports.c b/libguile/ports.c
index 0020bf6..a14aac2 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -3361,6 +3361,19 @@ scm_c_put_string (SCM port, SCM string, size_t start,
size_t count)
}
}
+SCM_DEFINE (scm_put_char, "put-char", 2, 0, 0, (SCM port, SCM ch),
+ "")
+#define FUNC_NAME s_scm_put_char
+{
+ SCM_VALIDATE_OPOUTPORT (1, port);
+ SCM_VALIDATE_CHAR (2, ch);
+
+ scm_c_put_char (port, SCM_CHAR (ch));
+
+ return SCM_UNSPECIFIED;
+}
+#undef FUNC_NAME
+
SCM_DEFINE (scm_put_string, "put-string", 2, 2, 0,
(SCM port, SCM string, SCM start, SCM count),
"")
diff --git a/libguile/ports.h b/libguile/ports.h
index f8d62c1..66b2471 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -220,6 +220,7 @@ SCM_API void scm_c_put_utf32_chars (SCM port, const
scm_t_uint32 *buf,
SCM_API void scm_c_put_string (SCM port, SCM str, size_t start, size_t count);
SCM_API SCM scm_put_string (SCM port, SCM str, SCM start, SCM count);
SCM_API void scm_c_put_char (SCM port, scm_t_wchar ch);
+SCM_API SCM scm_put_char (SCM port, SCM ch);
SCM_INTERNAL void scm_c_put_escaped_char (SCM port, scm_t_wchar ch);
SCM_INTERNAL int scm_c_can_put_char (SCM port, scm_t_wchar ch);
SCM_API void scm_putc (char c, SCM port);
diff --git a/module/ice-9/ports.scm b/module/ice-9/ports.scm
index 68afed1..57ecbd4 100644
--- a/module/ice-9/ports.scm
+++ b/module/ice-9/ports.scm
@@ -53,6 +53,8 @@
peek-char
unread-char
unread-string
+ put-char
+ put-string
setvbuf
drain-input
force-output
- [Guile-commits] branch wip-ethreads created (now ddb971b), Andy Wingo, 2016/06/03
- [Guile-commits] 01/10: socket: TCP_CORK, TCP_NODELAY, Andy Wingo, 2016/06/03
- [Guile-commits] 04/10: `accept' on nonblocking socket can return #f, Andy Wingo, 2016/06/03
- [Guile-commits] 06/10: Non-blocking accept/connect Scheme support, Andy Wingo, 2016/06/03
- [Guile-commits] 05/10: Support `connect' on nonblocking sockets, Andy Wingo, 2016/06/03
- [Guile-commits] 03/10: put-char in Scheme, Andy Wingo, 2016/06/03
- [Guile-commits] 07/10: add (ice-9 epoll), Andy Wingo, 2016/06/03
- [Guile-commits] 09/10: add examples/ethreads/memcached-{client, server}, Andy Wingo, 2016/06/03
- [Guile-commits] 08/10: add (ice-9 ethreads), Andy Wingo, 2016/06/03
- [Guile-commits] 10/10: add (web server ethreads), Andy Wingo, 2016/06/03
- [Guile-commits] 02/10: put-char, put-string in default namespace,
Andy Wingo <=