1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2009 Index Data
3 * See the file LICENSE for details.
7 * \brief yaz-ztest Generic Frontend Server
18 #include <yaz/backend.h>
20 #include <yaz/diagbib1.h>
24 static int log_level=0;
25 static int log_level_set=0;
27 int ztest_search(void *handle, bend_search_rr *rr);
28 int ztest_sort(void *handle, bend_sort_rr *rr);
29 int ztest_present(void *handle, bend_present_rr *rr);
30 int ztest_esrequest(void *handle, bend_esrequest_rr *rr);
31 int ztest_delete(void *handle, bend_delete_rr *rr);
33 /** \brief use term value as hit count
34 \param s RPN structure
35 \return >= 0: search term number or -1: not found
37 Traverse RPN tree 'in order' and use term value as hit count.
38 Only terms that looks a numeric is used.. Returns -1 if
39 no sub tree has a hit count term
41 static int get_term_hit(Z_RPNStructure *s)
46 case Z_RPNStructure_simple:
47 if (s->u.simple->which == Z_Operand_APT)
49 Z_AttributesPlusTerm *apt = s->u.simple->u.attributesPlusTerm;
50 if (apt->term->which == Z_Term_general)
52 Odr_oct *oct = apt->term->u.general;
53 if (oct->len > 0 && oct->buf[0] >= '0' && oct->buf[0] <= '9')
54 h = atoi_n((const char *) oct->buf, oct->len);
58 case Z_RPNStructure_complex:
59 h = get_term_hit(s->u.complex->s1);
61 h = get_term_hit(s->u.complex->s2);
67 /** \brief gets hit count for numeric terms in RPN queries
69 \return number of hits (random or number for term)
71 This is just for testing.. A real database of course uses
72 the content of a database to establish a value.. In our case, we
73 have a way to trigger a certain hit count. Good for testing of
74 client applications etc
76 static int get_hit_count(Z_Query *q)
79 if (q->which == Z_Query_type_1 || q->which == Z_Query_type_101)
80 h = get_term_hit(q->u.type_1->RPNStructure);
86 /** \brief checks if it's a dummy Slow database..
87 \param basename database name to check
88 \param association backend association (or NULL if not available)
89 \retval 1 is slow database
90 \retval 0 is not a slow database
92 The Slow database is for testing.. It allows us to simulate
95 static int check_slow(const char *basename, bend_association association)
97 if (strncmp(basename, "Slow", 4) == 0)
102 sscanf(basename+4, "%d", &w);
103 /* wait up to 3 seconds and check if connection is still alive */
104 for (i = 0; i < w; i++)
106 if (association && !bend_assoc_is_alive(association))
108 yaz_log(YLOG_LOG, "search aborted");
119 int ztest_search(void *handle, bend_search_rr *rr)
121 if (rr->num_bases != 1)
123 rr->errcode = YAZ_BIB1_COMBI_OF_SPECIFIED_DATABASES_UNSUPP;
126 /* Throw Database unavailable if other than Default or Slow */
127 if (!yaz_matchstr(rr->basenames[0], "Default"))
128 ; /* Default is OK in our test */
129 else if (check_slow(rr->basenames[0], rr->association))
131 rr->estimated_hit_count = 1;
135 rr->errcode = YAZ_BIB1_DATABASE_UNAVAILABLE;
136 rr->errstring = rr->basenames[0];
143 WRBUF response_xml = wrbuf_alloc();
144 wrbuf_puts(response_xml, "<extra>");
145 for (a = rr->extra_args; a; a = a->next)
147 wrbuf_puts(response_xml, "<extra name=\"");
148 wrbuf_xmlputs(response_xml, a->name);
149 wrbuf_puts(response_xml, "\"");
152 wrbuf_puts(response_xml, " value=\"");
153 wrbuf_xmlputs(response_xml, a->value);
154 wrbuf_puts(response_xml, "\"");
156 wrbuf_puts(response_xml, "/>");
158 wrbuf_puts(response_xml, "</extra>");
159 rr->extra_response_data =
160 odr_strdup(rr->stream, wrbuf_cstr(response_xml));
161 wrbuf_destroy(response_xml);
163 rr->hits = get_hit_count(rr->query);
168 /* this huge function handles extended services */
169 int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
171 /* user-defined handle - created in bend_init */
172 int *counter = (int*) handle;
174 yaz_log(log_level, "ESRequest no %d", *counter);
178 if (rr->esr->packageName)
179 yaz_log(log_level, "packagename: %s", rr->esr->packageName);
180 yaz_log(log_level, "Waitaction: " ODR_INT_PRINTF, *rr->esr->waitAction);
183 yaz_log(log_level, "function: " ODR_INT_PRINTF, *rr->esr->function);
185 if (!rr->esr->taskSpecificParameters)
187 yaz_log(log_level, "No task specific parameters");
189 else if (rr->esr->taskSpecificParameters->which == Z_External_itemOrder)
191 Z_ItemOrder *it = rr->esr->taskSpecificParameters->u.itemOrder;
192 yaz_log(log_level, "Received ItemOrder");
193 if (it->which == Z_IOItemOrder_esRequest)
195 Z_IORequest *ir = it->u.esRequest;
196 Z_IOOriginPartToKeep *k = ir->toKeep;
197 Z_IOOriginPartNotToKeep *n = ir->notToKeep;
198 const char *xml_in_response = 0;
202 if (k->contact->name)
203 yaz_log(log_level, "contact name %s", k->contact->name);
204 if (k->contact->phone)
205 yaz_log(log_level, "contact phone %s", k->contact->phone);
206 if (k->contact->email)
207 yaz_log(log_level, "contact email %s", k->contact->email);
211 yaz_log(log_level, "Billing info (not shown)");
214 if (n->resultSetItem)
216 yaz_log(log_level, "resultsetItem");
217 yaz_log(log_level, "setId: %s", n->resultSetItem->resultSetId);
218 yaz_log(log_level, "item: " ODR_INT_PRINTF, *n->resultSetItem->item);
222 Z_External *r = (Z_External*) n->itemRequest;
223 ILL_ItemRequest *item_req = 0;
224 ILL_APDU *ill_apdu = 0;
225 if (r->direct_reference)
227 char oid_name_str[OID_STR_MAX];
229 const char *oid_name =
230 yaz_oid_to_string_buf(r->direct_reference,
231 &oclass, oid_name_str);
233 yaz_log(log_level, "OID %s", oid_name);
234 if (!oid_oidcmp(r->direct_reference, yaz_oid_recsyn_xml))
236 yaz_log(log_level, "ILL XML request");
237 if (r->which == Z_External_octet)
238 yaz_log(log_level, "%.*s",
239 r->u.octet_aligned->len,
240 r->u.octet_aligned->buf);
241 xml_in_response = "<dummy>x</dummy>";
243 if (!oid_oidcmp(r->direct_reference,
244 yaz_oid_general_isoill_1))
246 yaz_log(log_level, "Decode ItemRequest begin");
247 if (r->which == ODR_EXTERNAL_single)
249 odr_setbuf(rr->decode,
250 (char *) r->u.single_ASN1_type->buf,
251 r->u.single_ASN1_type->len, 0);
253 if (!ill_ItemRequest(rr->decode, &item_req, 0, 0))
256 "Couldn't decode ItemRequest %s near %ld",
257 odr_errmsg(odr_geterror(rr->decode)),
258 (long) odr_offset(rr->decode));
261 yaz_log(log_level, "Decode ItemRequest OK");
264 ill_ItemRequest(rr->print, &item_req, 0,
266 odr_reset(rr->print);
269 if (!item_req && r->which == ODR_EXTERNAL_single)
271 yaz_log(log_level, "Decode ILL APDU begin");
272 odr_setbuf(rr->decode,
273 (char*) r->u.single_ASN1_type->buf,
274 r->u.single_ASN1_type->len, 0);
276 if (!ill_APDU(rr->decode, &ill_apdu, 0, 0))
279 "Couldn't decode ILL APDU %s near %ld",
280 odr_errmsg(odr_geterror(rr->decode)),
281 (long) odr_offset(rr->decode));
282 yaz_log(log_level, "PDU dump:");
283 odr_dumpBER(yaz_log_file(),
284 (char *) r->u.single_ASN1_type->buf,
285 r->u.single_ASN1_type->len);
288 yaz_log(log_level, "Decode ILL APDU OK");
291 ill_APDU(rr->print, &ill_apdu, 0,
293 odr_reset(rr->print);
300 yaz_log(log_level, "ILL protocol version = "
302 *item_req->protocol_version_num);
308 Z_External *ext = (Z_External *)
309 odr_malloc(rr->stream, sizeof(*ext));
310 Z_IUOriginPartToKeep *keep = (Z_IUOriginPartToKeep *)
311 odr_malloc(rr->stream, sizeof(*keep));
312 Z_IOTargetPart *targetPart = (Z_IOTargetPart *)
313 odr_malloc(rr->stream, sizeof(*targetPart));
315 rr->taskPackage = (Z_TaskPackage *)
316 odr_malloc(rr->stream, sizeof(*rr->taskPackage));
317 rr->taskPackage->packageType =
318 odr_oiddup(rr->stream, rr->esr->packageType);
319 rr->taskPackage->packageName = 0;
320 rr->taskPackage->userId = 0;
321 rr->taskPackage->retentionTime = 0;
322 rr->taskPackage->permissions = 0;
323 rr->taskPackage->description = 0;
324 rr->taskPackage->targetReference = (Odr_oct *)
325 odr_malloc(rr->stream, sizeof(Odr_oct));
326 rr->taskPackage->targetReference->buf =
327 (unsigned char *) odr_strdup(rr->stream, "911");
328 rr->taskPackage->targetReference->len =
329 rr->taskPackage->targetReference->size =
330 strlen((char *) (rr->taskPackage->targetReference->buf));
331 rr->taskPackage->creationDateTime = 0;
332 rr->taskPackage->taskStatus = odr_intdup(rr->stream, 0);
333 rr->taskPackage->packageDiagnostics = 0;
334 rr->taskPackage->taskSpecificParameters = ext;
336 ext->direct_reference =
337 odr_oiddup(rr->stream, rr->esr->packageType);
338 ext->indirect_reference = 0;
340 ext->which = Z_External_itemOrder;
341 ext->u.itemOrder = (Z_ItemOrder *)
342 odr_malloc(rr->stream, sizeof(*ext->u.update));
343 ext->u.itemOrder->which = Z_IOItemOrder_taskPackage;
344 ext->u.itemOrder->u.taskPackage = (Z_IOTaskPackage *)
345 odr_malloc(rr->stream, sizeof(Z_IOTaskPackage));
346 ext->u.itemOrder->u.taskPackage->originPart = k;
347 ext->u.itemOrder->u.taskPackage->targetPart = targetPart;
350 targetPart->itemRequest =
351 z_ext_record_xml(rr->stream, xml_in_response,
352 strlen(xml_in_response));
354 targetPart->itemRequest = 0;
356 targetPart->statusOrErrorReport = 0;
357 targetPart->auxiliaryStatus = 0;
361 else if (rr->esr->taskSpecificParameters->which == Z_External_update)
363 Z_IUUpdate *up = rr->esr->taskSpecificParameters->u.update;
364 yaz_log(log_level, "Received DB Update");
365 if (up->which == Z_IUUpdate_esRequest)
367 Z_IUUpdateEsRequest *esRequest = up->u.esRequest;
368 Z_IUOriginPartToKeep *toKeep = esRequest->toKeep;
369 Z_IUSuppliedRecords *notToKeep = esRequest->notToKeep;
371 yaz_log(log_level, "action");
374 switch (*toKeep->action)
376 case Z_IUOriginPartToKeep_recordInsert:
377 yaz_log(log_level, " recordInsert");
379 case Z_IUOriginPartToKeep_recordReplace:
380 yaz_log(log_level, " recordReplace");
382 case Z_IUOriginPartToKeep_recordDelete:
383 yaz_log(log_level, " recordDelete");
385 case Z_IUOriginPartToKeep_elementUpdate:
386 yaz_log(log_level, " elementUpdate");
388 case Z_IUOriginPartToKeep_specialUpdate:
389 yaz_log(log_level, " specialUpdate");
392 yaz_log(log_level, " unknown (" ODR_INT_PRINTF ")",
396 if (toKeep->databaseName)
398 yaz_log(log_level, "database: %s", toKeep->databaseName);
399 if (!strcmp(toKeep->databaseName, "fault"))
401 rr->errcode = YAZ_BIB1_DATABASE_UNAVAILABLE;
402 rr->errstring = toKeep->databaseName;
404 if (!strcmp(toKeep->databaseName, "accept"))
409 Z_External *ext = (Z_External *)
410 odr_malloc(rr->stream, sizeof(*ext));
411 Z_IUOriginPartToKeep *keep = (Z_IUOriginPartToKeep *)
412 odr_malloc(rr->stream, sizeof(*keep));
413 Z_IUTargetPart *targetPart = (Z_IUTargetPart *)
414 odr_malloc(rr->stream, sizeof(*targetPart));
416 rr->taskPackage = (Z_TaskPackage *)
417 odr_malloc(rr->stream, sizeof(*rr->taskPackage));
418 rr->taskPackage->packageType =
419 odr_oiddup(rr->stream, rr->esr->packageType);
420 rr->taskPackage->packageName = 0;
421 rr->taskPackage->userId = 0;
422 rr->taskPackage->retentionTime = 0;
423 rr->taskPackage->permissions = 0;
424 rr->taskPackage->description = 0;
425 rr->taskPackage->targetReference = (Odr_oct *)
426 odr_malloc(rr->stream, sizeof(Odr_oct));
427 rr->taskPackage->targetReference->buf =
428 (unsigned char *) odr_strdup(rr->stream, "123");
429 rr->taskPackage->targetReference->len =
430 rr->taskPackage->targetReference->size =
431 strlen((char *) (rr->taskPackage->targetReference->buf));
432 rr->taskPackage->creationDateTime = 0;
433 rr->taskPackage->taskStatus = odr_intdup(rr->stream, 0);
434 rr->taskPackage->packageDiagnostics = 0;
435 rr->taskPackage->taskSpecificParameters = ext;
437 ext->direct_reference =
438 odr_oiddup(rr->stream, rr->esr->packageType);
439 ext->indirect_reference = 0;
441 ext->which = Z_External_update;
442 ext->u.update = (Z_IUUpdate *)
443 odr_malloc(rr->stream, sizeof(*ext->u.update));
444 ext->u.update->which = Z_IUUpdate_taskPackage;
445 ext->u.update->u.taskPackage = (Z_IUUpdateTaskPackage *)
446 odr_malloc(rr->stream, sizeof(Z_IUUpdateTaskPackage));
447 ext->u.update->u.taskPackage->originPart = keep;
448 ext->u.update->u.taskPackage->targetPart = targetPart;
450 keep->action = odr_intdup(rr->stream, *toKeep->action);
452 odr_strdup(rr->stream, toKeep->databaseName);
454 keep->elementSetName = 0;
455 keep->actionQualifier = 0;
457 targetPart->updateStatus = odr_intdup(rr->stream, 1);
458 targetPart->num_globalDiagnostics = 0;
459 targetPart->globalDiagnostics = (Z_DiagRec **) odr_nullval();
460 targetPart->num_taskPackageRecords = 1;
461 targetPart->taskPackageRecords =
462 (Z_IUTaskPackageRecordStructure **)
463 odr_malloc(rr->stream,
464 sizeof(Z_IUTaskPackageRecordStructure *));
465 targetPart->taskPackageRecords[0] =
466 (Z_IUTaskPackageRecordStructure *)
467 odr_malloc(rr->stream,
468 sizeof(Z_IUTaskPackageRecordStructure));
470 targetPart->taskPackageRecords[0]->which =
471 Z_IUTaskPackageRecordStructure_record;
472 targetPart->taskPackageRecords[0]->u.record =
473 z_ext_record_sutrs(rr->stream, "test", 4);
474 targetPart->taskPackageRecords[0]->correlationInfo = 0;
475 targetPart->taskPackageRecords[0]->recordStatus =
476 odr_intdup(rr->stream,
477 Z_IUTaskPackageRecordStructure_success);
478 targetPart->taskPackageRecords[0]->num_supplementalDiagnostics
481 targetPart->taskPackageRecords[0]->supplementalDiagnostics = 0;
486 for (i = 0; i < notToKeep->num; i++)
488 Z_External *rec = notToKeep->elements[i]->record;
490 if (rec->direct_reference)
492 char oid_name_str[OID_STR_MAX];
494 = oid_name = yaz_oid_to_string_buf(
495 rec->direct_reference, 0,
498 yaz_log(log_level, "record %d type %s", i,
503 case Z_External_sutrs:
504 if (rec->u.octet_aligned->len > 170)
505 yaz_log(log_level, "%d bytes:\n%.168s ...",
509 yaz_log(log_level, "%d bytes:\n%s",
513 case Z_External_octet :
514 if (rec->u.octet_aligned->len > 170)
515 yaz_log(log_level, "%d bytes:\n%.168s ...",
516 rec->u.octet_aligned->len,
517 rec->u.octet_aligned->buf);
519 yaz_log(log_level, "%d bytes\n%s",
520 rec->u.octet_aligned->len,
521 rec->u.octet_aligned->buf);
530 /* result set delete */
531 int ztest_delete(void *handle, bend_delete_rr *rr)
533 if (rr->num_setnames == 1 && !strcmp(rr->setnames[0], "1"))
534 rr->delete_status = Z_DeleteStatus_success;
536 rr->delete_status = Z_DeleteStatus_resultSetDidNotExist;
540 /* Our sort handler really doesn't sort... */
541 int ztest_sort(void *handle, bend_sort_rr *rr)
544 rr->sort_status = Z_SortResponse_success;
549 /* present request handler */
550 int ztest_present(void *handle, bend_present_rr *rr)
555 /* retrieval of a single record (present, and piggy back search) */
556 int ztest_fetch(void *handle, bend_fetch_rr *r)
559 const Odr_oid *oid = r->request_format;
562 r->basename = "Default";
563 r->output_format = r->request_format;
565 if (!oid || yaz_oid_is_iso2709(oid))
567 cp = dummy_marc_record(r->number, r->stream);
570 r->errcode = YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE;
577 r->output_format = odr_oiddup(r->stream, yaz_oid_recsyn_usmarc);
580 else if (!oid_oidcmp(oid, yaz_oid_recsyn_opac))
582 cp = dummy_marc_record(r->number, r->stream);
585 r->errcode = YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE;
588 r->record = (char *) dummy_opac(r->number, r->stream, cp);
591 else if (!oid_oidcmp(oid, yaz_oid_recsyn_sutrs))
593 /* this section returns a small record */
596 sprintf(buf, "This is dummy SUTRS record number %d\n", r->number);
598 r->len = strlen(buf);
599 r->record = (char *) odr_malloc(r->stream, r->len+1);
600 strcpy(r->record, buf);
602 else if (!oid_oidcmp(oid, yaz_oid_recsyn_grs_1))
605 r->record = (char*) dummy_grs_record(r->number, r->stream);
608 r->errcode = YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE;
612 else if (!oid_oidcmp(oid, yaz_oid_recsyn_postscript))
618 sprintf(fname, "part.%d.ps", r->number);
619 f = fopen(fname, "rb");
622 r->errcode = YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE;
625 fseek(f, 0L, SEEK_END);
627 if (size <= 0 || size >= 5000000)
629 r->errcode = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
631 fseek(f, 0L, SEEK_SET);
632 r->record = (char*) odr_malloc(r->stream, size);
634 if (fread(r->record, size, 1, f) != 1)
636 r->errcode = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
640 else if (!oid_oidcmp(oid, yaz_oid_recsyn_xml))
642 if ((cp = dummy_xml_record(r->number, r->stream)))
649 r->errcode = YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE;
650 r->surrogate_flag = 1;
656 char buf[OID_STR_MAX];
657 r->errcode = YAZ_BIB1_RECORD_SYNTAX_UNSUPP;
658 r->errstring = odr_strdup(r->stream, oid_oid_to_dotstring(oid, buf));
666 * silly dummy-scan what reads words from a file.
668 int ztest_scan(void *handle, bend_scan_rr *q)
671 static struct scan_entry list[200];
672 static char entries[200][80];
676 int term_position_req = q->term_position;
677 int num_entries_req = q->num_entries;
679 /* Throw Database unavailable if other than Default or Slow */
680 if (!yaz_matchstr(q->basenames[0], "Default"))
681 ; /* Default is OK in our test */
682 else if (check_slow(q->basenames[0], 0 /* no assoc for scan */))
686 q->errcode = YAZ_BIB1_DATABASE_UNAVAILABLE;
687 q->errstring = q->basenames[0];
694 q->status = BEND_SCAN_SUCCESS;
695 if (!f && !(f = fopen("dummy-words", "r")))
697 perror("dummy-words");
700 if (q->num_entries > 200)
702 q->errcode = YAZ_BIB1_RESOURCES_EXHAUSTED_NO_RESULTS_AVAILABLE;
708 if (q->term->term->which != Z_Term_general)
710 q->errcode = YAZ_BIB1_TERM_TYPE_UNSUPP;
713 if (*q->step_size != 0)
715 q->errcode = YAZ_BIB1_ONLY_ZERO_STEP_SIZE_SUPPORTED_FOR_SCAN;
718 len = q->term->term->u.general->len;
719 if (len >= sizeof(term))
720 len = sizeof(term)-1;
721 memcpy(term, q->term->term->u.general->buf, len);
724 else if (q->scanClause)
726 strncpy(term, q->scanClause, sizeof(term)-1);
727 term[sizeof(term)-1] = '\0';
732 for (p = term; *p; p++)
733 if (islower(*(unsigned char *) p))
736 fseek(f, 0, SEEK_SET);
739 for (i = 0, pos = 0; fscanf(f, " %79[^:]:%d", entries[pos], &hits[pos]) == 2;
740 i++, pos < 199 ? pos++ : (pos = 0))
742 if (!q->num_entries && strcmp(entries[pos], term) >= 0) /* s-point fnd */
744 if ((q->term_position = term_position_req) > i + 1)
746 q->term_position = i + 1;
747 q->status = BEND_SCAN_PARTIAL;
749 for (; q->num_entries < q->term_position; q->num_entries++)
753 po = pos - q->term_position + q->num_entries+1; /* find pos */
757 if (!strcmp(term, "SD") && q->num_entries == 2)
759 list[q->num_entries].term = entries[pos];
760 list[q->num_entries].occurrences = -1;
761 list[q->num_entries].errcode =
762 YAZ_BIB1_SCAN_UNSUPP_VALUE_OF_POSITION_IN_RESPONSE;
763 list[q->num_entries].errstring = "SD for Scan Term";
767 list[q->num_entries].term = entries[po];
768 list[q->num_entries].occurrences = hits[po];
772 else if (q->num_entries)
774 list[q->num_entries].term = entries[pos];
775 list[q->num_entries].occurrences = hits[pos];
778 if (q->num_entries >= num_entries_req)
782 q->status = BEND_SCAN_PARTIAL;
786 int ztest_explain(void *handle, bend_explain_rr *rr)
788 if (rr->database && !strcmp(rr->database, "Default"))
790 rr->explain_buf = "<explain>\n"
792 "\t\t<host>localhost</host>\n"
793 "\t\t<port>210</port>\n"
800 int ztest_update(void *handle, bend_update_rr *rr)
802 rr->operation_status = "success";
806 bend_initresult *bend_init(bend_initrequest *q)
808 bend_initresult *r = (bend_initresult *)
809 odr_malloc(q->stream, sizeof(*r));
810 int *counter = (int *) xmalloc(sizeof(int));
814 log_level=yaz_log_module_level("ztest");
821 r->handle = counter; /* user handle, in this case a simple int */
822 q->bend_sort = ztest_sort; /* register sort handler */
823 q->bend_search = ztest_search; /* register search handler */
824 q->bend_present = ztest_present; /* register present handle */
825 q->bend_esrequest = ztest_esrequest;
826 q->bend_delete = ztest_delete;
827 q->bend_fetch = ztest_fetch;
828 q->bend_scan = ztest_scan;
830 q->bend_explain = ztest_explain;
832 q->bend_srw_scan = ztest_scan;
833 q->bend_srw_update = ztest_update;
835 q->query_charset = "ISO-8859-1";
836 q->records_in_same_charset = 0;
841 void bend_close(void *handle)
843 xfree(handle); /* release our user-defined handle */
847 int main(int argc, char **argv)
849 return statserv_main(argc, argv, bend_init, bend_close);
854 * c-file-style: "Stroustrup"
855 * indent-tabs-mode: nil
857 * vim: shiftwidth=4 tabstop=8 expandtab