summaryrefslogtreecommitdiff
path: root/libguile/stime.c
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-10-30 11:42:26 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-10-30 11:42:26 +0000
commita6d9e5abe5b110dc30e8cf914bcb4de4d28baf43 (patch)
treed5a3679c885a17f8469801bc97897a80ae48f1d6 /libguile/stime.c
parente9bfab50e4ec7787db05605727a06f98fe30f5b6 (diff)
downloadguile-a6d9e5abe5b110dc30e8cf914bcb4de4d28baf43.tar.gz
* Change a couple of functions to accept either symbols or strings only.
* Get rid of remainig uses of SCM_LENGTH etc.
Diffstat (limited to 'libguile/stime.c')
-rw-r--r--libguile/stime.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libguile/stime.c b/libguile/stime.c
index 6e99a008c..19c428dec 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -307,9 +307,9 @@ setzone (SCM zone, int pos, const char *subr)
char *buf;
SCM_ASSERT (SCM_STRINGP (zone), zone, pos, subr);
- SCM_COERCE_SUBSTR (zone);
+ SCM_STRING_COERCE_0TERMINATION_X (zone);
buf = scm_must_malloc (SCM_STRING_LENGTH (zone) + sizeof (tzvar) + 1, subr);
- sprintf (buf, "%s=%s", tzvar, SCM_ROCHARS (zone));
+ sprintf (buf, "%s=%s", tzvar, SCM_STRING_CHARS (zone));
oldenv = environ;
tmpenv[0] = buf;
tmpenv[1] = 0;
@@ -573,12 +573,12 @@ SCM_DEFINE (scm_strftime, "strftime", 2, 0, 0,
int len;
SCM result;
- SCM_VALIDATE_ROSTRING (1,format);
+ SCM_VALIDATE_STRING (1, format);
bdtime2c (stime, &t, SCM_ARG2, FUNC_NAME);
- SCM_COERCE_SUBSTR (format);
- fmt = SCM_ROCHARS (format);
- len = SCM_ROLENGTH (format);
+ SCM_STRING_COERCE_0TERMINATION_X (format);
+ fmt = SCM_STRING_CHARS (format);
+ len = SCM_STRING_LENGTH (format);
/* Ugly hack: strftime can return 0 if its buffer is too small,
but some valid time strings (e.g. "%p") can sometimes produce
@@ -666,13 +666,13 @@ SCM_DEFINE (scm_strptime, "strptime", 2, 0, 0,
struct tm t;
char *fmt, *str, *rest;
- SCM_VALIDATE_ROSTRING (1,format);
- SCM_VALIDATE_ROSTRING (2,string);
+ SCM_VALIDATE_STRING (1, format);
+ SCM_VALIDATE_STRING (2, string);
- SCM_COERCE_SUBSTR (format);
- SCM_COERCE_SUBSTR (string);
- fmt = SCM_ROCHARS (format);
- str = SCM_ROCHARS (string);
+ SCM_STRING_COERCE_0TERMINATION_X (format);
+ SCM_STRING_COERCE_0TERMINATION_X (string);
+ fmt = SCM_STRING_CHARS (format);
+ str = SCM_STRING_CHARS (string);
/* initialize the struct tm */
#define tm_init(field) t.field = 0