1 /* $Id: yaz-usemarcon.cpp,v 1.3 2006-03-30 10:31:37 adam Exp $
2 Copyright (c) 1998-2006, Index Data.
4 This file is part of the yazproxy.
6 YAZ proxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with YAZ proxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 Yaz_usemarcon::Yaz_usemarcon()
33 Yaz_usemarcon::~Yaz_usemarcon()
41 int Yaz_usemarcon::convert(const char *stage1, const char *stage2,
42 const char *input, int input_len,
43 char **output, int *output_len)
46 if (stage1 && *stage1)
52 m_stage1 = new Usemarcon();
54 m_stage1->SetIniFileName(stage1);
55 m_stage1->SetMarcRecord((char*) input, input_len);
56 int res = m_stage1->Convert();
59 m_stage1->GetMarcRecord(converted, convlen);
60 if (stage2 && *stage2)
64 m_stage2 = new Usemarcon();
66 m_stage2->SetIniFileName(stage2);
67 m_stage2->SetMarcRecord(converted, convlen);
68 res = m_stage2->Convert();
72 m_stage2->GetMarcRecord(converted, convlen);
76 yaz_log(YLOG_LOG, "USEMARCON stage 2 error %d", res);
81 *output_len = convlen;
86 yaz_log(YLOG_LOG, "USEMARCON stage 1 error %d", res);
95 * indent-tabs-mode: nil
97 * vim: shiftwidth=4 tabstop=8 expandtab