comparison src/editfns.c @ 707:a307f9a2021d

[xemacs-hg @ 2001-12-20 05:49:28 by andyp] sync with 21-4-6-windows
author andyp
date Thu, 20 Dec 2001 05:49:48 +0000
parents fdefd0186b75
children 943eaba38521
comparison
equal deleted inserted replaced
706:c9bf82d465b5 707:a307f9a2021d
1174 return Flist (9, list_args); 1174 return Flist (9, list_args);
1175 } 1175 }
1176 1176
1177 static void set_time_zone_rule (char *tzstring); 1177 static void set_time_zone_rule (char *tzstring);
1178 1178
1179 /* from GNU Emacs 21, per Simon Josefsson, modified by stephen
1180 The slight inefficiency is justified since negative times are weird. */
1181 Lisp_Object
1182 make_time (time_t time)
1183 {
1184 return list2 (make_int (time < 0 ? time / 0x10000 : time >> 16),
1185 make_int (time & 0xFFFF));
1186 }
1187
1179 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /* 1188 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /*
1180 Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time. 1189 Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
1181 This is the reverse operation of `decode-time', which see. 1190 This is the reverse operation of `decode-time', which see.
1182 ZONE defaults to the current time zone rule. This can 1191 ZONE defaults to the current time zone rule. This can
1183 be a string (as from `set-time-zone-rule'), or it can be a list 1192 be a string (as from `set-time-zone-rule'), or it can be a list
1247 } 1256 }
1248 1257
1249 if (the_time == (time_t) -1) 1258 if (the_time == (time_t) -1)
1250 invalid_argument ("Specified time is not representable", Qunbound); 1259 invalid_argument ("Specified time is not representable", Qunbound);
1251 1260
1252 return wasteful_word_to_lisp (the_time); 1261 return make_time (the_time);
1253 } 1262 }
1254 1263
1255 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /* 1264 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*
1256 Return the current time, as a human-readable string. 1265 Return the current time, as a human-readable string.
1257 Programs can use this function to decode a time, 1266 Programs can use this function to decode a time,