Mercurial > hg > xemacs-beta
comparison src/editfns.c @ 5475:248176c74e6b
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Sat, 23 Apr 2011 23:47:13 +0200 |
parents | 308d34e9f07d af961911bcb2 |
children | f2881cb841b4 |
comparison
equal
deleted
inserted
replaced
5474:4dee0387b9de | 5475:248176c74e6b |
---|---|
1098 (specified_time)) | 1098 (specified_time)) |
1099 { | 1099 { |
1100 time_t time_spec; | 1100 time_t time_spec; |
1101 struct tm save_tm; | 1101 struct tm save_tm; |
1102 struct tm *decoded_time; | 1102 struct tm *decoded_time; |
1103 Lisp_Object list_args[9]; | |
1104 | 1103 |
1105 if (! lisp_to_time (specified_time, &time_spec)) | 1104 if (! lisp_to_time (specified_time, &time_spec)) |
1106 invalid_argument ("Invalid time specification", Qunbound); | 1105 invalid_argument ("Invalid time specification", Qunbound); |
1107 | 1106 |
1108 decoded_time = localtime (&time_spec); | 1107 decoded_time = localtime (&time_spec); |
1109 list_args[0] = make_int (decoded_time->tm_sec); | |
1110 list_args[1] = make_int (decoded_time->tm_min); | |
1111 list_args[2] = make_int (decoded_time->tm_hour); | |
1112 list_args[3] = make_int (decoded_time->tm_mday); | |
1113 list_args[4] = make_int (decoded_time->tm_mon + 1); | |
1114 list_args[5] = make_int (decoded_time->tm_year + 1900); | |
1115 list_args[6] = make_int (decoded_time->tm_wday); | |
1116 list_args[7] = (decoded_time->tm_isdst)? Qt : Qnil; | |
1117 | 1108 |
1118 /* Make a copy, in case gmtime modifies the struct. */ | 1109 /* Make a copy, in case gmtime modifies the struct. */ |
1119 save_tm = *decoded_time; | 1110 save_tm = *decoded_time; |
1120 decoded_time = gmtime (&time_spec); | 1111 decoded_time = gmtime (&time_spec); |
1121 if (decoded_time == 0) | 1112 |
1122 list_args[8] = Qnil; | 1113 return listn(9, |
1123 else | 1114 make_int (save_tm.tm_sec), |
1124 list_args[8] = make_int (difftm (&save_tm, decoded_time)); | 1115 make_int (save_tm.tm_min), |
1125 return Flist (9, list_args); | 1116 make_int (save_tm.tm_hour), |
1117 make_int (save_tm.tm_mday), | |
1118 make_int (save_tm.tm_mon + 1), | |
1119 make_int (save_tm.tm_year + 1900), | |
1120 make_int (save_tm.tm_wday), | |
1121 save_tm.tm_isdst ? Qt : Qnil, | |
1122 (decoded_time == NULL) | |
1123 ? Qnil | |
1124 : make_int (difftm (&save_tm, decoded_time))); | |
1126 } | 1125 } |
1127 | 1126 |
1128 static void set_time_zone_rule (Extbyte *tzstring); | 1127 static void set_time_zone_rule (Extbyte *tzstring); |
1129 | 1128 |
1130 /* from GNU Emacs 21, per Simon Josefsson, modified by stephen | 1129 /* from GNU Emacs 21, per Simon Josefsson, modified by stephen |