|
|
1.1 ! root 1: /* test.c - */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/dsap/common/RCS/test.c,v 7.0 89/11/23 21:44:38 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/dsap/common/RCS/test.c,v 7.0 89/11/23 21:44:38 mrose Rel $ ! 9: * ! 10: * ! 11: * $Log: test.c,v $ ! 12: * Revision 7.0 89/11/23 21:44:38 mrose ! 13: * Release 6.0 ! 14: * ! 15: */ ! 16: ! 17: /* ! 18: * NOTICE ! 19: * ! 20: * Acquisition, use, and distribution of this module and related ! 21: * materials are subject to the restrictions of a license agreement. ! 22: * Consult the Preface in the User's Manual for the full terms of ! 23: * this agreement. ! 24: * ! 25: */ ! 26: ! 27: ! 28: #include "quipu/util.h" ! 29: #include "quipu/entry.h" ! 30: ! 31: main () ! 32: { ! 33: char buffer [1024]; ! 34: Attr_Sequence as; ! 35: Attr_Sequence as2; ! 36: extern PS opt; ! 37: extern int parse_line; ! 38: extern int parse_status; ! 39: extern char * TidyString (); ! 40: extern int oidformat; ! 41: PE pe = NULLPE; ! 42: ! 43: isodetailor ("test",1); ! 44: ! 45: quipu_syntaxes (); ! 46: load_oid_table ("../oidtable"); ! 47: ! 48: parse_line = 0; ! 49: parse_error ("Attribute parser %s","test"); ! 50: ! 51: for (;;) { ! 52: (void) fprintf (stderr,"-> "); ! 53: if (fgets (buffer, sizeof buffer, stdin) == 0) ! 54: exit (0); ! 55: parse_status = 0; ! 56: ! 57: as = str2as (TidyString(buffer)); ! 58: ! 59: if (as == NULLATTR) { ! 60: (void) fprintf (stderr,"NULL value\n"); ! 61: continue; ! 62: } ! 63: if (parse_status != 0) { ! 64: (void) fprintf (stderr,"parse error - non null as\n"); ! 65: continue; ! 66: } ! 67: ! 68: if (encode_IF_Attribute (&pe, 0, 0, NULLCP, as) == NOTOK) { ! 69: fprintf (stderr,"encode problem\n"); ! 70: continue; ! 71: } ! 72: ! 73: pe2pl (opt,pe); ! 74: ! 75: if (decode_IF_Attribute (pe, 1, NULLIP, NULLVP, as) == NOTOK) { ! 76: fprintf (stderr,"decode problem\n"); ! 77: continue; ! 78: } ! 79: ! 80: ps_print (opt,"EDBOUT:\n"); ! 81: as_print (opt,as,EDBOUT); ! 82: ! 83: as2 = as_cpy (as); ! 84: ! 85: if (as_cmp (as2,as) != 0) ! 86: fprintf (stderr,"*** Compare/Copy problem ***\n"); ! 87: ! 88: as_free (as); ! 89: ! 90: if (as2 == NULLATTR) ! 91: (void) fprintf (stderr,"NULL value 2\n"); ! 92: else { ! 93: ps_print (opt,"READOUT:\n"); ! 94: as_print (opt,as2,READOUT); ! 95: } ! 96: ! 97: as_free (as2); ! 98: pe = NULLPE; ! 99: ! 100: } ! 101: ! 102: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.