This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/ + -Wall
[perl5.git] / ext / Time / Piece / Piece.xs
CommitLineData
302d38aa
JH
1#ifdef __cplusplus
2#extern "C" {
3#endif
4#include "EXTERN.h"
5#include "perl.h"
6#include "XSUB.h"
7#include <time.h>
8#ifdef __cplusplus
9}
10#endif
11
12MODULE = Time::Piece PACKAGE = Time::Piece
13
14PROTOTYPES: ENABLE
15
16char *
d0369dd1 17__strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)
302d38aa
JH
18 char * fmt
19 int sec
20 int min
21 int hour
22 int mday
23 int mon
24 int year
25 int wday
26 int yday
27 int isdst
c6c619a9
DM
28
29 PREINIT:
30 char *buf = NULL;
31
302d38aa 32 CODE:
c6c619a9
DM
33 #XXX: an sv_strftime() that can make use of the TARG would faster
34 buf = my_strftime(fmt, sec, min, hour, mday, mon, year, wday, yday, isdst);
35 if (buf) {
36 RETVAL = buf;
37 }
38
39 OUTPUT:
40 RETVAL
41
42 CLEANUP:
43 if (buf) {
44 Safefree(buf);
45 }