diff options
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | modules/guile/getpw.scm | 4 | ||||
-rw-r--r-- | modules/guile/guile.c | 89 |
5 files changed, 36 insertions, 84 deletions
@@ -1,8 +1,11 @@ | |||
1 | Smap NEWS -- history of user-visible changes. 2015-06-20 | 1 | Smap NEWS -- history of user-visible changes. 2019-05-10 |
2 | Copyright (C) 2006-2010, 2014-1015 Sergey Poznyakoff | ||
3 | See the end of file for copying conditions. | 2 | See the end of file for copying conditions. |
4 | 3 | ||
5 | Please send Smap bug reports to <gray+smap@gnu.org.ua> | 4 | Please send Smap bug reports to <gray+smap@gnu.org.ua> |
5 | |||
6 | Version 2.0.90 (git) | ||
7 | |||
8 | * Support for Guile 2.2 | ||
6 | 9 | ||
7 | 10 | ||
8 | Version 2.0, 2015-06-20 | 11 | Version 2.0, 2015-06-20 |
@@ -74,7 +77,7 @@ Version 1.0, 2010-06-19 | |||
74 | ========================================================================= | 77 | ========================================================================= |
75 | Copyright information: | 78 | Copyright information: |
76 | 79 | ||
77 | Copyright (C) 2006-2010, 2014-1015 Sergey Poznyakoff | 80 | Copyright (C) 2006-2019 Sergey Poznyakoff |
78 | 81 | ||
79 | Permission is granted to anyone to make or distribute verbatim copies | 82 | Permission is granted to anyone to make or distribute verbatim copies |
80 | of this document as received, in any medium, provided that the | 83 | of this document as received, in any medium, provided that the |
@@ -1,5 +1,5 @@ | |||
1 | Smap README | 1 | Smap README |
2 | Copyright (C) 2006-2010, 2014 Sergey Poznyakoff | 2 | See end of file for copying conditions. |
3 | 3 | ||
4 | * Introduction | 4 | * Introduction |
5 | ============== | 5 | ============== |
@@ -70,7 +70,7 @@ Compile with TCP wrappers (libwrap) support. This is the default. | |||
70 | 70 | ||
71 | Compile with GNU Mailutils, build the `mailutils' module. By default, | 71 | Compile with GNU Mailutils, build the `mailutils' module. By default, |
72 | this is enabled if configure determines that a sufficiently new | 72 | this is enabled if configure determines that a sufficiently new |
73 | version of GNU Mailutils (i.e. 2.0 or newer) is installed. | 73 | version of GNU Mailutils (i.e. 3.0 or newer) is installed. |
74 | 74 | ||
75 | See http://www.gnu.org/software/mailutils for more information on GNU | 75 | See http://www.gnu.org/software/mailutils for more information on GNU |
76 | Mailutils including file downloads. | 76 | Mailutils including file downloads. |
@@ -79,7 +79,7 @@ Mailutils including file downloads. | |||
79 | 79 | ||
80 | Compile with Guile support; build the `guile' module. By default, | 80 | Compile with Guile support; build the `guile' module. By default, |
81 | this is enabled if configure determines that a sufficiently new | 81 | this is enabled if configure determines that a sufficiently new |
82 | version of Guile (i.e. 1.8 or newer) is installed. | 82 | version of Guile (i.e. 2.2 or newer) is installed. |
83 | 83 | ||
84 | See http://www.gnu.org/software/guile for additional information on | 84 | See http://www.gnu.org/software/guile for additional information on |
85 | Guile including file downloads. | 85 | Guile including file downloads. |
@@ -109,7 +109,7 @@ will remain intact. | |||
109 | 109 | ||
110 | * Copyright information | 110 | * Copyright information |
111 | 111 | ||
112 | Copyright (C) 2006, 2007, 2008, 2009, 2010 Sergey Poznyakoff | 112 | Copyright (C) 2006-2019 Sergey Poznyakoff |
113 | 113 | ||
114 | Permission is granted to anyone to make or distribute verbatim copies | 114 | Permission is granted to anyone to make or distribute verbatim copies |
115 | of this document as received, in any medium, provided that the | 115 | of this document as received, in any medium, provided that the |
diff --git a/configure.ac b/configure.ac index 8bec28d..46774b2 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,5 +1,5 @@ | |||
1 | # This file is part of Smap. -*- autoconf -*- | 1 | # This file is part of Smap. -*- autoconf -*- |
2 | # Copyright (C) 2010, 2014-2016 Sergey Poznyakoff | 2 | # Copyright (C) 2010, 2014-2019 Sergey Poznyakoff |
3 | # | 3 | # |
4 | # Smap is free software; you can redistribute it and/or modify | 4 | # Smap is free software; you can redistribute it and/or modify |
5 | # it under the terms of the GNU General Public License as published by | 5 | # it under the terms of the GNU General Public License as published by |
@@ -20,7 +20,9 @@ m4_define([SMAP_VERSION_MINOR], 0) | |||
20 | m4_define([SMAP_VERSION_PATCH], 90) | 20 | m4_define([SMAP_VERSION_PATCH], 90) |
21 | AC_INIT([smap], | 21 | AC_INIT([smap], |
22 | SMAP_VERSION_MAJOR.SMAP_VERSION_MINOR[]m4_ifdef([SMAP_VERSION_PATCH],.SMAP_VERSION_PATCH), | 22 | SMAP_VERSION_MAJOR.SMAP_VERSION_MINOR[]m4_ifdef([SMAP_VERSION_PATCH],.SMAP_VERSION_PATCH), |
23 | [gray+smap@gnu.org.ua]) | 23 | [gray+smap@gnu.org.ua], |
24 | [smap], | ||
25 | [http://smap.software.gnu.org.ua]) | ||
24 | AC_CONFIG_SRCDIR([src/smapd.c]) | 26 | AC_CONFIG_SRCDIR([src/smapd.c]) |
25 | AC_CONFIG_HEADERS([config.h]) | 27 | AC_CONFIG_HEADERS([config.h]) |
26 | AC_CONFIG_AUX_DIR([build-aux]) | 28 | AC_CONFIG_AUX_DIR([build-aux]) |
@@ -101,7 +103,7 @@ AC_ARG_WITH([mailutils], | |||
101 | [status_mailutils=maybe]) | 103 | [status_mailutils=maybe]) |
102 | 104 | ||
103 | if test $status_mailutils != no; then | 105 | if test $status_mailutils != no; then |
104 | AM_GNU_MAILUTILS(2.99.992, [all], | 106 | AM_GNU_MAILUTILS(3.0, [all], |
105 | [status_mailutils=yes], | 107 | [status_mailutils=yes], |
106 | [if test $status_mailutils = yes; then | 108 | [if test $status_mailutils = yes; then |
107 | AC_MSG_ERROR([GNU Mailutils not found]) | 109 | AC_MSG_ERROR([GNU Mailutils not found]) |
@@ -112,7 +114,7 @@ fi | |||
112 | AM_CONDITIONAL([MAILUTILS_COND],[test $status_mailutils = yes]) | 114 | AM_CONDITIONAL([MAILUTILS_COND],[test $status_mailutils = yes]) |
113 | 115 | ||
114 | # Guile | 116 | # Guile |
115 | GINT_INIT([gint],[1.8 with-guile nodoc], | 117 | GINT_INIT([gint],[2.2.0 with-guile nodoc], |
116 | [status_guile=yes], | 118 | [status_guile=yes], |
117 | [status_guile=no]) | 119 | [status_guile=no]) |
118 | AM_CONDITIONAL([GUILE_COND],[test $status_guile = yes]) | 120 | AM_CONDITIONAL([GUILE_COND],[test $status_guile = yes]) |
diff --git a/modules/guile/getpw.scm b/modules/guile/getpw.scm index 168badb..2a8bc39 100644 --- a/modules/guile/getpw.scm +++ b/modules/guile/getpw.scm | |||
@@ -1,5 +1,5 @@ | |||
1 | ;;;; This file is part of Smap. | 1 | ;;;; This file is part of Smap. |
2 | ;;;; Copyright (C) 2010, 2014 Sergey Poznyakoff | 2 | ;;;; Copyright (C) 2010, 2014, 2019 Sergey Poznyakoff |
3 | ;;;; | 3 | ;;;; |
4 | ;;;; Smap is free software; you can redistribute it and/or modify | 4 | ;;;; Smap is free software; you can redistribute it and/or modify |
5 | ;;;; it under the terms of the GNU General Public License as published by | 5 | ;;;; it under the terms of the GNU General Public License as published by |
@@ -87,7 +87,7 @@ | |||
87 | (let ((src (car rest))) | 87 | (let ((src (car rest))) |
88 | (format (current-error-port) "connect from ~A~%" | 88 | (format (current-error-port) "connect from ~A~%" |
89 | (if (= (sockaddr:fam src) AF_INET) | 89 | (if (= (sockaddr:fam src) AF_INET) |
90 | (inet-ntoa (sockaddr:addr src)) | 90 | (inet-ntop AF_INET (sockaddr:addr src)) |
91 | "UNIX socket"))) | 91 | "UNIX socket"))) |
92 | ;; Select appropriate handler and call it | 92 | ;; Select appropriate handler and call it |
93 | (let ((elt (assoc map map-list))) | 93 | (let ((elt (assoc map map-list))) |
diff --git a/modules/guile/guile.c b/modules/guile/guile.c index ae63a51..2ce66c5 100644 --- a/modules/guile/guile.c +++ b/modules/guile/guile.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* This file is part of Smap. | 1 | /* This file is part of Smap. |
2 | Copyright (C) 2010, 2014, 2015 Sergey Poznyakoff | 2 | Copyright (C) 2010, 2014, 2015, 2019 Sergey Poznyakoff |
3 | 3 | ||
4 | Smap is free software; you can redistribute it and/or modify | 4 | Smap is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
@@ -171,7 +171,7 @@ argv_to_scm(int argc, char **argv) | |||
171 | return scm_first; | 171 | return scm_first; |
172 | } | 172 | } |
173 | 173 | ||
174 | static scm_t_bits scm_tc16_smap_output_port; | 174 | static scm_t_port_type *scm_smap_output_port_type; |
175 | struct _guile_smap_output_port { | 175 | struct _guile_smap_output_port { |
176 | smap_stream_t stream; | 176 | smap_stream_t stream; |
177 | }; | 177 | }; |
@@ -180,78 +180,32 @@ static SCM | |||
180 | _make_smap_output_port(smap_stream_t stream) | 180 | _make_smap_output_port(smap_stream_t stream) |
181 | { | 181 | { |
182 | struct _guile_smap_output_port *dp; | 182 | struct _guile_smap_output_port *dp; |
183 | SCM port; | ||
184 | scm_port *pt; | ||
185 | 183 | ||
186 | dp = scm_gc_malloc(sizeof (struct _guile_smap_output_port), | 184 | dp = scm_gc_typed_calloc (struct _guile_smap_output_port); |
187 | "smap-output_-port"); | ||
188 | dp->stream = stream; | 185 | dp->stream = stream; |
189 | 186 | return scm_c_make_port (scm_smap_output_port_type, | |
190 | port = scm_new_port_table_entry(scm_tc16_smap_output_port); | 187 | SCM_WRTNG | SCM_BUF0, |
191 | pt = SCM_PTAB_ENTRY(port); | 188 | (scm_t_bits) dp); |
192 | pt->rw_random = 0; | ||
193 | SCM_SET_CELL_TYPE(port, | ||
194 | (scm_tc16_smap_output_port | | ||
195 | SCM_OPN | SCM_WRTNG | SCM_BUF0)); | ||
196 | SCM_SETSTREAM(port, dp); | ||
197 | return port; | ||
198 | } | 189 | } |
199 | 190 | ||
200 | #define SMAP_OUTPUT_PORT(x) ((struct _guile_smap_output_port *) SCM_STREAM (x)) | 191 | #define SMAP_OUTPUT_PORT(x) ((struct _guile_smap_output_port *) SCM_STREAM (x)) |
201 | 192 | ||
202 | static SCM | ||
203 | _smap_output_port_mark(SCM port) | ||
204 | { | ||
205 | return SCM_BOOL_F; | ||
206 | } | ||
207 | |||
208 | static void | 193 | static void |
209 | _smap_output_port_flush(SCM port) | ||
210 | { | ||
211 | scm_port *pt = SCM_PTAB_ENTRY(port); | ||
212 | struct _guile_smap_output_port *dp = SMAP_OUTPUT_PORT(port); | ||
213 | if (dp && pt->write_pos > pt->write_buf) | ||
214 | smap_stream_write(dp->stream, "\n", 1, NULL); | ||
215 | } | ||
216 | |||
217 | static int | ||
218 | _smap_output_port_close(SCM port) | 194 | _smap_output_port_close(SCM port) |
219 | { | 195 | { |
220 | struct _guile_smap_output_port *dp = SMAP_OUTPUT_PORT(port); | 196 | struct _guile_smap_output_port *dp = SMAP_OUTPUT_PORT(port); |
221 | 197 | ||
222 | if (dp) { | 198 | if (dp && dp->stream) { |
223 | _smap_output_port_flush(port); | 199 | smap_stream_flush(dp->stream); |
224 | SCM_SETSTREAM(port, NULL); | ||
225 | scm_gc_free(dp, sizeof(struct _guile_smap_output_port), | ||
226 | "smap-output-port"); | ||
227 | } | 200 | } |
228 | return 0; | ||
229 | } | 201 | } |
230 | 202 | ||
231 | static scm_sizet | 203 | static size_t |
232 | _smap_output_port_free(SCM port) | 204 | _smap_output_port_write(SCM port, SCM src, size_t start, size_t count) |
233 | { | ||
234 | _smap_output_port_close(port); | ||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | static int | ||
239 | _smap_output_port_fill_input(SCM port) | ||
240 | { | ||
241 | return EOF; | ||
242 | } | ||
243 | |||