2 * Standard non re-entrant versions of the re-entrant functions.
3 * Copyright (c) 1998 New Generation Software (NGS) Oy
5 * Author: Markku Rossi <mtr@ngs.fi>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26 * $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/src/r_std.c,v $
34 * Types and definitions.
44 js_localtime (const time_t *clock
, struct tm
*result
)
46 struct tm
*tm
= localtime (clock
);
47 memcpy (result
, tm
, sizeof (*tm
));
52 js_gmtime (const time_t *clock
, struct tm
*result
)
54 struct tm
*tm
= gmtime (clock
);
55 memcpy (result
, tm
, sizeof (*tm
));
60 js_asctime (const struct tm
*tm
, char *buffer
, int buffer_length
)
62 char *cp
= asctime (tm
);
70 js_drand48_create (JSVirtualMachine
*vm
)
77 js_drand48_destroy (void *drand48_context
)
83 js_srand48 (void *drand48_context
, long seed
)
87 #else /* not HAVE_DRAND48 */
89 #endif /* not HAVE_DRAND48 */
93 js_drand48 (void *drand48_context
, double *random_return
)
96 *random_return
= drand48 ();
97 #else /* not HAVE_DRAND48 */
98 *random_return
= (double ) rand () / (double) INT_MAX
;
99 #endif /* not HAVE_DRAND48 */