Happy new year
[yazpp-moved-to-github.git] / zlint / zlint.h
index 694e0e5..73cb248 100644 (file)
@@ -1,24 +1,46 @@
-/*
- * Copyright (c) 2004, Index Data.
- * See the file LICENSE for details.
- * 
- * $Id: zlint.h,v 1.1 2004-03-25 23:14:07 adam Exp $
+/* This file is part of the yazpp toolkit.
+ * Copyright (C) Index Data and Mike Taylor
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Index Data nor the names of its contributors
+ *       may be used to endorse or promote products derived from this
+ *       software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <yaz++/z-assoc.h>
+#include <yazpp/z-assoc.h>
+
+using namespace yazpp_1;
 
 enum Zlint_code {
     TEST_FINISHED,
     TEST_CONTINUE,
-    TEST_REOPEN,
+    TEST_REOPEN
 };
 
 class Zlint_test;
 class Zlint_t;
 
-class Zlint : public Yaz_Z_Assoc {
+class Zlint : public Z_Assoc {
 public:
-    Zlint(IYaz_PDU_Observable *the_PDU_Observable);
+    Zlint(IPDU_Observable *the_PDU_Observable);
     ~Zlint();
     void add_test(Zlint_test *i);
     void set_host(const char *cp);
@@ -35,9 +57,8 @@ private:
     void timeoutNotify();
     void failNotify();
     void recv_GDU(Z_GDU *apdu, int len);
-    IYaz_PDU_Observable *m_PDU_Observable;
-    IYaz_PDU_Observer *sessionNotify(
-       IYaz_PDU_Observable *the_PDU_Observable, int fd);
+    IPDU_Observable *m_PDU_Observable;
+    IPDU_Observer *sessionNotify(IPDU_Observable *the_PDU_Observable, int fd);
     Zlint_t *m_tests;
     Zlint_t *m_cur_test;
     char *m_host;
@@ -50,6 +71,7 @@ public:
     virtual Zlint_code init(Zlint *z) = 0;
     virtual Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu) = 0;
     virtual Zlint_code recv_fail(Zlint *z, int reason) = 0;
+    virtual ~Zlint_test();
 };
 
 class Zlint_test_simple : public Zlint_test {
@@ -150,3 +172,12 @@ public:
     Zlint_code recv_gdu(Zlint *z, Z_GDU *gdu);
     Zlint_code recv_fail(Zlint *z, int reason);
 };
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+