1 /* This file is part of YAZ proxy
2 Copyright (C) 1998-2009 Index Data
4 YAZ proxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 Yaz_usemarcon::Yaz_usemarcon()
30 Yaz_usemarcon::~Yaz_usemarcon()
38 int Yaz_usemarcon::convert(const char *stage1, const char *stage2,
39 const char *input, int input_len,
40 char **output, int *output_len)
43 if (stage1 && *stage1)
49 m_stage1 = new Usemarcon();
51 m_stage1->SetIniFileName(stage1);
52 m_stage1->SetMarcRecord((char*) input, input_len);
53 int res = m_stage1->Convert();
56 m_stage1->GetMarcRecord(converted, convlen);
57 if (stage2 && *stage2)
61 m_stage2 = new Usemarcon();
63 m_stage2->SetIniFileName(stage2);
64 m_stage2->SetMarcRecord(converted, convlen);
65 res = m_stage2->Convert();
69 m_stage2->GetMarcRecord(converted, convlen);
73 yaz_log(YLOG_LOG, "USEMARCON stage 2 error %d", res);
78 *output_len = convlen;
83 yaz_log(YLOG_LOG, "USEMARCON stage 1 error %d", res);
92 * c-file-style: "Stroustrup"
93 * indent-tabs-mode: nil
95 * vim: shiftwidth=4 tabstop=8 expandtab