*/
/*$Log: SimpleServer.c,v $
-/*Revision 1.13 2001-08-30 13:15:11 sondberg
+/*Revision 1.14 2001-08-30 14:02:10 sondberg
+/*Small changes.
+/*
+/*Revision 1.11 2001/08/30 13:15:11 sondberg
/*Corrected a memory leak, one more to go.
/*
/*Revision 1.10 2001/08/29 11:48:36 sondberg
STRLEN len;
int term_len;
SV *term_tmp;
+ SV *entries_ref;
Zfront_handle *zhandle = (Zfront_handle *)handle;
number = newSVsv(*temp);
temp = hv_fetch(href, "ENTRIES", 7, 1);
- entries = (AV *)SvRV(newSVsv(*temp));
+ entries_ref = newSVsv(*temp);
PUTBACK;
FREETMPS;
rr->status = SvIV(status);
scan_list = (struct scan_entry *) odr_malloc (rr->stream, rr->num_entries * sizeof(*scan_list));
buffer = scan_list;
+ entries = (AV *)SvRV(entries_ref);
for (i = 0; i < rr->num_entries; i++)
{
- scan_item = (HV *)SvRV_noinc(sv_2mortal(av_shift(entries)));
+ scan_item = (HV *)SvRV(sv_2mortal(av_shift(entries)));
temp = hv_fetch(scan_item, "TERM", 4, 1);
ptr = SvPV(*temp, len);
buffer->term = (char *) odr_malloc (rr->stream, len + 1);
buffer->occurrences = SvIV(*temp);
buffer++;
hv_undef(scan_item);
- /*sv_free((SV *)scan_item);*/
}
rr->entries = scan_list;
zhandle->handle = point;
av_undef(list);
sv_free((SV *)list);
av_undef(entries);
- sv_free((SV *)entries);
+ /*sv_free((SV *)entries);*/
+ sv_free(entries_ref);
return 0;
}
}
-#line 1056 "SimpleServer.c"
+#line 1061 "SimpleServer.c"
XS(XS_Net__Z3950__SimpleServer_set_init_handler)
{
dXSARGS;
croak("Usage: Net::Z3950::SimpleServer::set_init_handler(arg)");
{
SV * arg = ST(0);
-#line 1052 "SimpleServer.xs"
+#line 1057 "SimpleServer.xs"
init_ref = newSVsv(arg);
-#line 1066 "SimpleServer.c"
+#line 1071 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_close_handler(arg)");
{
SV * arg = ST(0);
-#line 1059 "SimpleServer.xs"
+#line 1064 "SimpleServer.xs"
close_ref = newSVsv(arg);
-#line 1080 "SimpleServer.c"
+#line 1085 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_sort_handler(arg)");
{
SV * arg = ST(0);
-#line 1066 "SimpleServer.xs"
+#line 1071 "SimpleServer.xs"
sort_ref = newSVsv(arg);
-#line 1094 "SimpleServer.c"
+#line 1099 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_search_handler(arg)");
{
SV * arg = ST(0);
-#line 1072 "SimpleServer.xs"
+#line 1077 "SimpleServer.xs"
search_ref = newSVsv(arg);
-#line 1108 "SimpleServer.c"
+#line 1113 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_fetch_handler(arg)");
{
SV * arg = ST(0);
-#line 1079 "SimpleServer.xs"
+#line 1084 "SimpleServer.xs"
fetch_ref = newSVsv(arg);
-#line 1122 "SimpleServer.c"
+#line 1127 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_present_handler(arg)");
{
SV * arg = ST(0);
-#line 1086 "SimpleServer.xs"
+#line 1091 "SimpleServer.xs"
present_ref = newSVsv(arg);
-#line 1136 "SimpleServer.c"
+#line 1141 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_esrequest_handler(arg)");
{
SV * arg = ST(0);
-#line 1093 "SimpleServer.xs"
+#line 1098 "SimpleServer.xs"
esrequest_ref = newSVsv(arg);
-#line 1150 "SimpleServer.c"
+#line 1155 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_delete_handler(arg)");
{
SV * arg = ST(0);
-#line 1100 "SimpleServer.xs"
+#line 1105 "SimpleServer.xs"
delete_ref = newSVsv(arg);
-#line 1164 "SimpleServer.c"
+#line 1169 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
croak("Usage: Net::Z3950::SimpleServer::set_scan_handler(arg)");
{
SV * arg = ST(0);
-#line 1107 "SimpleServer.xs"
+#line 1112 "SimpleServer.xs"
scan_ref = newSVsv(arg);
-#line 1178 "SimpleServer.c"
+#line 1183 "SimpleServer.c"
}
XSRETURN_EMPTY;
}
{
dXSARGS;
{
-#line 1113 "SimpleServer.xs"
+#line 1118 "SimpleServer.xs"
char **argv;
char **argv_buf;
char *ptr;
int i;
STRLEN len;
-#line 1193 "SimpleServer.c"
+#line 1198 "SimpleServer.c"
int RETVAL;
-#line 1119 "SimpleServer.xs"
+#line 1124 "SimpleServer.xs"
argv_buf = (char **)xmalloc((items + 1) * sizeof(char *));
argv = argv_buf;
for (i = 0; i < items; i++)
*argv_buf = NULL;
RETVAL = statserv_main(items, argv, bend_init, bend_close);
-#line 1207 "SimpleServer.c"
+#line 1212 "SimpleServer.c"
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)RETVAL);
}
croak("Usage: Net::Z3950::SimpleServer::ScanSuccess()");
{
int RETVAL;
-#line 1137 "SimpleServer.xs"
+#line 1142 "SimpleServer.xs"
RETVAL = BEND_SCAN_SUCCESS;
-#line 1223 "SimpleServer.c"
+#line 1228 "SimpleServer.c"
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)RETVAL);
}
croak("Usage: Net::Z3950::SimpleServer::ScanPartial()");
{
int RETVAL;
-#line 1144 "SimpleServer.xs"
+#line 1149 "SimpleServer.xs"
RETVAL = BEND_SCAN_PARTIAL;
-#line 1239 "SimpleServer.c"
+#line 1244 "SimpleServer.c"
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)RETVAL);
}
*/
/*$Log: SimpleServer.xs,v $
-/*Revision 1.11 2001-08-30 13:15:11 sondberg
+/*Revision 1.12 2001-08-30 14:02:10 sondberg
+/*Small changes.
+/*
+/*Revision 1.11 2001/08/30 13:15:11 sondberg
/*Corrected a memory leak, one more to go.
/*
/*Revision 1.10 2001/08/29 11:48:36 sondberg
STRLEN len;
int term_len;
SV *term_tmp;
+ SV *entries_ref;
Zfront_handle *zhandle = (Zfront_handle *)handle;
number = newSVsv(*temp);
temp = hv_fetch(href, "ENTRIES", 7, 1);
- entries = (AV *)SvRV(newSVsv(*temp));
+ entries_ref = newSVsv(*temp);
PUTBACK;
FREETMPS;
rr->status = SvIV(status);
scan_list = (struct scan_entry *) odr_malloc (rr->stream, rr->num_entries * sizeof(*scan_list));
buffer = scan_list;
+ entries = (AV *)SvRV(entries_ref);
for (i = 0; i < rr->num_entries; i++)
{
scan_item = (HV *)SvRV(sv_2mortal(av_shift(entries)));
buffer->occurrences = SvIV(*temp);
buffer++;
hv_undef(scan_item);
- /*sv_free((SV *)scan_item);*/
}
rr->entries = scan_list;
zhandle->handle = point;
av_undef(list);
sv_free((SV *)list);
av_undef(entries);
- sv_free((SV *)entries);
+ /*sv_free((SV *)entries);*/
+ sv_free(entries_ref);
return 0;
}