|
|
BSD 4.3reno
/* test.c - */
#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/test.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif
/*
* $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/test.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
*
*
* $Log: test.c,v $
* Revision 1.1.1.1 2018/04/24 16:12:56 root
* BSD 4.3reno
*
* Revision 7.0 89/11/23 21:44:38 mrose
* Release 6.0
*
*/
/*
* NOTICE
*
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
* this agreement.
*
*/
#include "quipu/util.h"
#include "quipu/entry.h"
main ()
{
char buffer [1024];
Attr_Sequence as;
Attr_Sequence as2;
extern PS opt;
extern int parse_line;
extern int parse_status;
extern char * TidyString ();
extern int oidformat;
PE pe = NULLPE;
isodetailor ("test",1);
quipu_syntaxes ();
load_oid_table ("../oidtable");
parse_line = 0;
parse_error ("Attribute parser %s","test");
for (;;) {
(void) fprintf (stderr,"-> ");
if (fgets (buffer, sizeof buffer, stdin) == 0)
exit (0);
parse_status = 0;
as = str2as (TidyString(buffer));
if (as == NULLATTR) {
(void) fprintf (stderr,"NULL value\n");
continue;
}
if (parse_status != 0) {
(void) fprintf (stderr,"parse error - non null as\n");
continue;
}
if (encode_IF_Attribute (&pe, 0, 0, NULLCP, as) == NOTOK) {
fprintf (stderr,"encode problem\n");
continue;
}
pe2pl (opt,pe);
if (decode_IF_Attribute (pe, 1, NULLIP, NULLVP, as) == NOTOK) {
fprintf (stderr,"decode problem\n");
continue;
}
ps_print (opt,"EDBOUT:\n");
as_print (opt,as,EDBOUT);
as2 = as_cpy (as);
if (as_cmp (as2,as) != 0)
fprintf (stderr,"*** Compare/Copy problem ***\n");
as_free (as);
if (as2 == NULLATTR)
(void) fprintf (stderr,"NULL value 2\n");
else {
ps_print (opt,"READOUT:\n");
as_print (opt,as2,READOUT);
}
as_free (as2);
pe = NULLPE;
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.