]>
jfr.im git - irc/quakenet/newserv.git/blob - newsearch/ns-timestamp.c
3344c85d1afafd48aa0ce83ec46128c51a198532
2 * TIMESTAMP functionality
10 #include "../irc/irc_config.h"
11 #include "../lib/irc_string.h"
13 void *timestamp_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
);
14 void timestamp_free(searchCtx
*ctx
, struct searchNode
*thenode
);
16 struct searchNode
*timestamp_parse(searchCtx
*ctx
, int argc
, char **argv
) {
17 struct searchNode
*thenode
;
19 if (ctx
->type
!= SEARCHTYPE_NICK
) {
20 parseError
= "timestamp: this function is only valid for nick searches.";
24 if (!(thenode
=(struct searchNode
*)malloc(sizeof (struct searchNode
)))) {
25 parseError
= "malloc: could not allocate memory for this search.";
29 thenode
->returntype
= RETURNTYPE_INT
;
30 thenode
->localdata
= NULL
;
31 thenode
->exe
= timestamp_exe
;
32 thenode
->free
= timestamp_free
;
37 void *timestamp_exe(searchCtx
*ctx
, struct searchNode
*thenode
, void *theinput
) {
38 nick
*np
= (nick
*)theinput
;
40 return (void *)np
->timestamp
;
43 void timestamp_free(searchCtx
*ctx
, struct searchNode
*thenode
) {