Prototypes are now explicitly disabled. This makes no difference to
authorMike Taylor <mike@indexdata.com>
Fri, 3 Sep 2004 13:27:19 +0000 (13:27 +0000)
committerMike Taylor <mike@indexdata.com>
Fri, 3 Sep 2004 13:27:19 +0000 (13:27 +0000)
functionality, but suppresses an error message for a cleaner
build.
fatal() errors now print "SimpleServer" instead of "yazwrap"!
New code attempts to translate a result-set reference into a
corresponding Perl query node, but DOES NOT WORK.  It's no
more broken than it was before, though.  I am completely
stumped as to what's wrong with it.

SimpleServer.xs

index 34cbb9a..44384f7 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: SimpleServer.xs,v 1.33 2004-06-07 17:00:55 adam Exp $ 
+ * $Id: SimpleServer.xs,v 1.34 2004-09-03 13:27:19 mike Exp $ 
  * ----------------------------------------------------------------------
  * 
  * Copyright (c) 2000-2004, Index Data.
  * ----------------------------------------------------------------------
  * 
  * Copyright (c) 2000-2004, Index Data.
@@ -358,7 +358,7 @@ void fatal(char *fmt, ...)
 {
     va_list ap;
 
 {
     va_list ap;
 
-    fprintf(stderr, "FATAL (yazwrap): ");
+    fprintf(stderr, "FATAL (SimpleServer): ");
     va_start(ap, fmt);
     vfprintf(stderr, fmt, ap);
     va_end(ap);
     va_start(ap, fmt);
     vfprintf(stderr, fmt, ap);
     va_end(ap);
@@ -441,8 +441,21 @@ static SV *rpn2perl(Z_RPNStructure *s)
     case Z_RPNStructure_simple: {
        Z_Operand *o = s->u.simple;
        Z_AttributesPlusTerm *at;
     case Z_RPNStructure_simple: {
        Z_Operand *o = s->u.simple;
        Z_AttributesPlusTerm *at;
+       if (o->which == Z_Operand_resultSetId) {
+           /* This code causes a SIGBUS on my machine, and I have no
+              idea why.  It seems as clear as day to me */
+           char *rsid = (char*) o->u.resultSetId;
+           printf("Encoding resultSetId '%s'\n", rsid);
+           sv = newObject("Net::Z3950::RPN::RSID", (SV*) (hv = newHV()));
+           printf("Made sv=0x%lx, hv=0x%lx\n",
+                  (unsigned long) sv ,(unsigned long) hv);
+           SV *sv2 = newSVpv(rsid, strlen(rsid));
+           setMember(hv, "id", sv2);
+           printf("Set hv{id} to 0x%lx\n", (unsigned long) sv2);
+           return sv;
+       }
        if (o->which != Z_Operand_APT)
        if (o->which != Z_Operand_APT)
-           fatal("can't handle RPN simples other than APT");
+           fatal("can't handle RPN simples other than APT and RSID");
        at = o->u.attributesPlusTerm;
        if (at->term->which != Z_Term_general)
            fatal("can't handle RPN terms other than general");
        at = o->u.attributesPlusTerm;
        if (at->term->which != Z_Term_general)
            fatal("can't handle RPN terms other than general");
@@ -1318,6 +1331,9 @@ void bend_close(void *handle)
 
 MODULE = Net::Z3950::SimpleServer      PACKAGE = Net::Z3950::SimpleServer
 
 
 MODULE = Net::Z3950::SimpleServer      PACKAGE = Net::Z3950::SimpleServer
 
+PROTOTYPES: DISABLE
+
+
 void
 set_init_handler(arg)
                SV *arg
 void
 set_init_handler(arg)
                SV *arg