1 /* This file is part of YAZ proxy
2 Copyright (C) 1998-2011 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)
46 #if RULE_VERSION >= 314
53 m_stage1 = new Usemarcon();
55 m_stage1->SetIniFileName(stage1);
56 m_stage1->SetMarcRecord((char*) input, input_len);
57 int res = m_stage1->Convert();
60 m_stage1->GetMarcRecord(converted, convlen);
61 if (stage2 && *stage2)
65 m_stage2 = new Usemarcon();
67 m_stage2->SetIniFileName(stage2);
68 m_stage2->SetMarcRecord(converted, convlen);
69 res = m_stage2->Convert();
73 m_stage2->GetMarcRecord(converted, convlen);
77 yaz_log(YLOG_LOG, "USEMARCON stage 2 error %d", res);
82 *output_len = convlen;
87 yaz_log(YLOG_LOG, "USEMARCON stage 1 error %d", res);
96 * c-file-style: "Stroustrup"
97 * indent-tabs-mode: nil
99 * vim: shiftwidth=4 tabstop=8 expandtab