@@ -1060,12 +1060,8 @@ LibraryManager.library = {
1060
1060
return time1 - time0 ;
1061
1061
} ,
1062
1062
1063
- // Statically allocated time struct.
1064
- __tm_current : '{{{ makeStaticAlloc(C_STRUCTS.tm.__size__) }}}' ,
1065
1063
// Statically allocated copy of the string "GMT" for gmtime() to point to
1066
1064
__tm_timezone : '{{{ makeStaticString("GMT") }}}' ,
1067
- // Statically allocated time strings.
1068
- __tm_formatted : '{{{ makeStaticAlloc(C_STRUCTS.tm.__size__) }}}' ,
1069
1065
mktime__deps : [ 'tzset' ] ,
1070
1066
mktime__sig : 'ii' ,
1071
1067
mktime : function ( tmPtr ) {
@@ -1105,12 +1101,8 @@ LibraryManager.library = {
1105
1101
} ,
1106
1102
timelocal : 'mktime ',
1107
1103
1108
- gmtime__deps : [ '__tm_current' , 'gmtime_r' ] ,
1109
- gmtime : function ( time ) {
1110
- return _gmtime_r ( time , ___tm_current ) ;
1111
- } ,
1112
-
1113
1104
gmtime_r__deps : [ '__tm_timezone' ] ,
1105
+ gmtime_r__sig : 'iii' ,
1114
1106
gmtime_r : function ( time , tmPtr ) {
1115
1107
var date = new Date ( { { { makeGetValue ( 'time' , 0 , 'i32' ) } } } * 1000 ) ;
1116
1108
{ { { makeSetValue ( 'tmPtr' , C_STRUCTS . tm . tm_sec , 'date.getUTCSeconds()' , 'i32' ) } } } ;
@@ -1129,6 +1121,8 @@ LibraryManager.library = {
1129
1121
1130
1122
return tmPtr ;
1131
1123
} ,
1124
+ __gmtime_r : 'gmtime_r ',
1125
+
1132
1126
timegm__deps : [ 'tzset' ] ,
1133
1127
timegm : function ( tmPtr ) {
1134
1128
_tzset ( ) ;
@@ -1149,12 +1143,8 @@ LibraryManager.library = {
1149
1143
return ( date . getTime ( ) / 1000 ) | 0 ;
1150
1144
} ,
1151
1145
1152
- localtime__deps : [ '__tm_current' , 'localtime_r' ] ,
1153
- localtime : function ( time ) {
1154
- return _localtime_r ( time , ___tm_current ) ;
1155
- } ,
1156
-
1157
1146
localtime_r__deps : [ '__tm_timezone' , 'tzset' ] ,
1147
+ localtime_r__sig : 'iii' ,
1158
1148
localtime_r : function ( time , tmPtr ) {
1159
1149
_tzset ( ) ;
1160
1150
var date = new Date ( { { { makeGetValue ( 'time' , 0 , 'i32' ) } } } * 1000 ) ;
@@ -1182,13 +1172,10 @@ LibraryManager.library = {
1182
1172
1183
1173
return tmPtr ;
1184
1174
} ,
1175
+ __localtime_r : 'localtime_r ',
1185
1176
1186
- asctime__deps : [ '__tm_formatted' , 'asctime_r' ] ,
1187
- asctime : function ( tmPtr ) {
1188
- return _asctime_r ( tmPtr , ___tm_formatted ) ;
1189
- } ,
1190
-
1191
- asctime_r__deps : [ '__tm_formatted' , 'mktime' ] ,
1177
+ asctime_r__deps : [ 'mktime' ] ,
1178
+ asctime_r__sig : 'iii' ,
1192
1179
asctime_r : function ( tmPtr , buf ) {
1193
1180
var date = {
1194
1181
tm_sec : { { { makeGetValue ( 'tmPtr' , C_STRUCTS . tm . tm_sec , 'i32' ) } } } ,
@@ -1216,19 +1203,17 @@ LibraryManager.library = {
1216
1203
stringToUTF8 ( s , buf , 26 ) ;
1217
1204
return buf ;
1218
1205
} ,
1219
-
1220
- ctime__deps : [ '__tm_current' , 'ctime_r' ] ,
1221
- ctime : function ( timer ) {
1222
- return _ctime_r ( timer , ___tm_current ) ;
1223
- } ,
1206
+ __asctime_r : 'asctime_r ',
1224
1207
1225
1208
ctime_r__deps : [ 'localtime_r' , 'asctime_r' ] ,
1209
+ ctime_r__sig : 'iii' ,
1226
1210
ctime_r : function ( time , buf ) {
1227
1211
var stack = stackSave ( ) ;
1228
1212
var rv = _asctime_r ( _localtime_r ( time , stackAlloc ( { { { C_STRUCTS . tm . __size__ } } } ) ) , buf ) ;
1229
1213
stackRestore ( stack ) ;
1230
1214
return rv ;
1231
1215
} ,
1216
+ __ctime_r : 'ctime_r' ,
1232
1217
1233
1218
dysize : function ( year ) {
1234
1219
var leap = ( ( year % 4 == 0 ) && ( ( year % 100 != 0 ) || ( year % 400 == 0 ) ) ) ;
0 commit comments