#include "../geoip/geoip.h"
#include "../core/modules.h"
-void *country_exe(struct searchNode *thenode, void *theinput);
-void country_free(struct searchNode *thenode);
+void *country_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput);
+void country_free(searchCtx *ctx, struct searchNode *thenode);
int ext;
-struct searchNode *country_parse(int type, int argc, char **argv) {
+struct searchNode *country_parse(searchCtx *ctx, int argc, char **argv) {
struct searchNode *thenode;
GeoIP_LookupCode l;
- int target;
+ long target;
- if (type != SEARCHTYPE_NICK) {
+ if (ctx->type != SEARCHTYPE_NICK) {
parseError = "country: this function is only valid for nick searches.";
return NULL;
}
return thenode;
}
-void *country_exe(struct searchNode *thenode, void *theinput) {
+void *country_exe(searchCtx *ctx, struct searchNode *thenode, void *theinput) {
nick *np = (nick *)theinput;
- int country = (int)thenode->localdata, rc = (int)np->exts[ext];
+ long country = (long)thenode->localdata, rc = (long)np->exts[ext];
if(country == rc)
return (void *)1;
return (void *)0;
}
-void country_free(struct searchNode *thenode) {
+void country_free(searchCtx *ctx, struct searchNode *thenode) {
free(thenode);
}