//  ==========================================================================
//  
//  @(#) $Id: test4.C,v 1.3 2000/10/13 15:45:51 brian Exp $
//  
//  --------------------------------------------------------------------------
//  
//  Copyright (C) 1997-2000  Brian Bidulock <bidulock@dallas.net>
//  
//  All Rights Reserved.
//  
//  This library is free software; you can redistribute it and/or modify it
//  under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation; either version 2.1 of the License, or (at
//  your option) any later version.
//  
//  This library is distributed in the hope that it will be useful, but
//  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
//  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser Public License
//  for more details.
//  
//  You should have received a copy of the GNU Lesser General Public License
//  along with this library; if not, write to the Free Software Foundation,
//  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// 
//  Last Modified $Date: 2000/10/13 15:45:51 $ by $Author: brian $
// 
//  --------------------------------------------------------------------------
// 
//  $Log: test4.C,v $
//  Revision 1.3  2000/10/13 15:45:51  brian
//  First public release.
//
//  ==========================================================================

static char const ident[] = "$Id: test4.C,v 1.3 2000/10/13 15:45:51 brian Exp $";

#pragma implementation
#include "head.h"

#include "ISUP_Codec.H"
#include <iostream.h>

int len = 1000; char fme[1000];

main() {
    Codec_ISUP anISUP;
    Codec_ISUP* ISUP = &anISUP;

    int i;

    len = 1000;
    Codec::rebuild();
    ISUP->IAM->build();
    ISUP->OPARMS->CGPN->build();
    Codec** parm = (Codec**)&(ISUP->OPARMS->CLRF);
    for (i=0;i<53;i++) parm[i]->build();
    cout << "Encoding...\n";
    if (Codec::encode(ISUP,fme,len)) cout.form("Encoded %d bytes: ",len);
    for (i=0;i<len;i++) cout.form("%2x ",fme[i]&0xff); cout << '\n';
    cout << "Reporting...\n";
    Codec::report(ISUP); cout << '\n';
    cout << "Decoding...\n";
    if (Codec::decode(ISUP,fme,len)) cout.form("Decoded %d bytes.\n",len);
    cout << "Reporting...\n";
    Codec::report(ISUP); cout << '\n';

    len = 1000;
    Codec::rebuild();
    ISUP->IAM->build();
    cout << "Encoding...\n";
    if (Codec::encode(ISUP,fme,len)) cout.form("Encoded %d bytes: ",len);
    for (i=0;i<len;i++) cout.form("%2x ",fme[i]&0xff); cout << '\n';
    cout << "Reporting...\n";
    Codec::report(ISUP); cout << '\n';
    cout << "Decoding...\n";
    if (Codec::decode(ISUP,fme,len)) cout.form("Decoded %d bytes.\n",len);
    cout << "Reporting...\n";
    Codec::report(ISUP); cout << '\n';


    cout << "...Done.\n";
    cout.flush();
};
